diff --git a/README.md b/README.md index 6b3b81c4..e85e3369 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ ## 功能 - **兼容接口**:Chat Completions、Responses、Anthropic Messages 和模型列表,支持流式回复与函数工具调用。 -- **多账号调度**:自动选号、会话粘性、并发限制、冷却与故障切换。 +- **多账号调度**:轮询、加权轮询、顺序填满,以及可选的同供应商最早到期优先(FEFO);保留自动选号、会话粘性、并发限制、冷却与故障切换。 - **统一控制台**:管理账号、模型、客户端密钥、代理设置,查看额度和请求日志。 - **Docker 运维**:持久化账号数据;可选安装宿主机更新器,在控制台下载更新、确认升级和回滚。 @@ -71,6 +71,15 @@ Go 网关统一鉴权、调度和记录请求。Qoder 每个账号使用独立 N 在「账号」卡片直接操作 WorkBuddy、QwenWork 国内版/国际版与 Qoder 国内版、国际版的签到、自动签到开关(默认关闭),并从「更多 → 签到记录」查看历史,不另设签到中心。在「系统 → 自动签到」配置各供应商默认时间,「编辑账号」可选择跟随默认或自定义;修改默认时间会立即影响未覆盖的账号。已有 WorkBuddy 账号保留原时间,可在编辑账号时切回跟随默认。活动关闭时只记录跳过;真实账号签到验收仍待完成。QwenWork 的签到接口在客户端里存在,但生产网关尚未开放(404):国内版按钱包日额度核对当日免费积分,国际版只能核对总额度并记录跳过原因。 +## 最早到期优先(FEFO) + +在「系统 → 账号调度策略」选择「最早到期优先(FEFO)」,或向 `PATCH /api/system/settings` 提交 `{"routing_strategy":"fefo"}`。默认仍是轮询,原有轮询、加权轮询和顺序填满行为不变。 + +- **只在同一供应商内排序**:先按供应商分组,再比较本组账号最近的积分包到期日;Qoder、WorkBuddy 等互不影响,跨供应商仍按原有轮询选择。 +- **只认实际可消费的积分包到期**:跳过余额为零、已过期或到期未知的包;同一 UTC+8 自然日到期的账号公平轮询。未知到期不猜测,作为该供应商的兜底候选,只有已知到期账号都不可用时才参与。 +- **额度与故障切换照旧**:额度耗尽、限流冷却、并发占满或被显式排除的账号先退出候选,恢复后自动回到排序。响应或流结束后异步刷新该账号额度并重新排序;缓存中的包自然过期也会触发额度探测。不会把订阅重置、令牌有效期或签到奖励当成积分包到期。 +- **数据缺口**:目前只有 WorkBuddy 个人账号的 `get-user-resource` 返回逐包 `CycleEndTime`。Qoder 的 `quota/usage` 只有订阅月度边界(`expiresAt`),Trae、Devin、Command Code、Codex 也只有重置窗口或总额度,因此这些供应商的账号在 FEFO 下按未知日期处理。WorkBuddy 企业/共享身份,以及结果达到 100 条的未确认列表,也不会获得 FEFO 优先级。升级后尚未刷新额度的旧缓存同样按未知日期处理,启动探测或手动刷新后才会带上包元数据。 + ## 使用限制 - 只连接你自己的账号,不提供账号、额度或官方 API 服务。 diff --git a/README_EN.md b/README_EN.md index 6575b242..217aabc6 100644 --- a/README_EN.md +++ b/README_EN.md @@ -20,7 +20,7 @@ Deploy with Docker, manage accounts in the web console, and connect clients thro ## Features - **Compatible APIs**: Chat Completions, Responses, Anthropic Messages, and model listing, with streaming and function tools. -- **Multi-account routing**: automatic selection, session affinity, concurrency limits, cooldowns, and failover. +- **Multi-account routing**: round-robin, weighted round-robin, fill-first, and opt-in same-provider earliest-expiry-first (FEFO), with automatic selection, session affinity, concurrency limits, cooldowns, and failover. - **Web console**: manage accounts, models, client keys, and proxies; view quotas and request logs. - **Docker operations**: persistent account data; an optional host updater lets you download, confirm, and roll back updates from the console. @@ -71,6 +71,15 @@ Accounts, models, access, and logs all live in one web console: readiness and qu Account cards provide WorkBuddy, QwenWork CN/Global, Qoder CN, and Qoder Global check-in actions and automatic check-in switches (off by default), with history under More → Check-in records; no separate check-in page is needed. Set each provider's default time under System → Automatic check-in, then choose inheritance or an override in Edit account. Default changes apply to inheriting accounts immediately. Existing WorkBuddy accounts retain their previous times until switched to inheritance. Inactive campaigns are skipped. Live-account check-in acceptance is still pending. QwenWork ships a check-in API in its desktop client, but production gateways do not route it (404): CN confirms the daily free credits from the wallet balance, while Global can only report the total quota and the skip reason. +## Earliest-expiry-first (FEFO) + +Select **Earliest expiry first (FEFO)** under **System → Account routing strategy**, or send `{"routing_strategy":"fefo"}` to `PATCH /api/system/settings`. Round-robin remains the default; the existing round-robin, weighted round-robin, and fill-first behavior is unchanged. + +- **Rank only inside one provider.** Accounts are grouped by provider family before their nearest credit-package expiry is compared. Qoder, WorkBuddy, and other providers never compete with each other, and cross-provider selection keeps its existing rotation. +- **Use only spendable package dates.** Depleted, expired, and undated packages are skipped. Accounts expiring on the same UTC+8 calendar day rotate fairly. Missing dates are never guessed: they form that provider's fallback cohort and participate only after every dated account is unavailable. +- **Keep quota and failover semantics.** Exhausted, cooling, concurrency-saturated, or explicitly excluded accounts leave the candidate set and return to the ranking once they recover. Finishing a response or stream refreshes that account's quota asynchronously; a cached package expiring naturally also triggers a probe. Subscription resets, token lifetimes, and check-in rewards are never treated as package expiry. +- **Data gaps.** Only WorkBuddy personal accounts currently return per-package `CycleEndTime` from `get-user-resource`. Qoder's `quota/usage` exposes only the subscription cycle boundary (`expiresAt`), while Trae, Devin, Command Code, and Codex expose reset windows or totals only, so their accounts remain in the unknown-date cohort under FEFO. WorkBuddy enterprise/shared identities and unconfirmed result sets capped at 100 also receive no FEFO priority. Cached quota snapshots written before this version remain undated until the boot probe or a manual refresh repopulates the package metadata. + ## Limitations - Bring your own accounts. CLI2API does not supply accounts, quotas, or an official API service. diff --git a/changelog/unreleased/fefo-credit-expiry-routing.md b/changelog/unreleased/fefo-credit-expiry-routing.md new file mode 100644 index 00000000..7e4b918e --- /dev/null +++ b/changelog/unreleased/fefo-credit-expiry-routing.md @@ -0,0 +1,13 @@ +### English + +- Add opt-in earliest-expiry-first (FEFO) account routing. It ranks accounts only inside the same provider family by their nearest spendable credit-package expiry, rotates accounts expiring on the same UTC+8 day, and falls back to round-robin when a provider has no package dates. Existing round-robin, weighted round-robin, fill-first, affinity, pinning, region/provider gates, cooldowns, and failover are unchanged. +- Refresh a FEFO account's quota after each completed response or stream (coalesced per account) and re-probe accounts whose trusted packages all expired, so newly granted or spent credits change the next selection without waiting for a manual refresh. +- Expose WorkBuddy package expiry as FEFO-eligible only for personal identities with a complete, paginated result. Enterprise/shared identities, full result pages, undated packages, and other providers' reset windows or token lifetimes never invent a priority. +- Add the FEFO option to System → Account routing strategy and document that Qoder, Trae, Devin, Command Code, and Codex do not currently provide per-package credit expiry, so their accounts stay in the unknown-date cohort. + +### 中文 + +- 新增可选的同供应商最早到期优先(FEFO)调度:只在同一供应商内按最近可消费积分包到期日排序,同一 UTC+8 自然日到期的账号公平轮询;供应商没有积分包日期时回退轮询。原有轮询、加权轮询、顺序填满、会话粘性、固定账号、地域/供应商限制、冷却与故障切换保持不变。 +- 每次响应或流结束后异步刷新该账号额度(按账号合并请求),并重新探测积分包已全部过期的账号,让新增或已消耗的积分立即影响下一次选择,无需手动刷新。 +- 仅 WorkBuddy 个人身份且分页结果完整的积分包参与 FEFO 优先级;企业/共享身份、满 100 条的未确认列表、无日期包,以及其他供应商的重置窗口或令牌有效期都不会被伪造成到期优先级。 +- 在「系统 → 账号调度策略」增加 FEFO 选项,并说明 Qoder、Trae、Devin、Command Code、Codex 当前不提供逐包积分到期信息,其账号保持未知日期分组。 diff --git a/frontend/src/api/system.ts b/frontend/src/api/system.ts index 3c7fea9e..c9a5ab01 100644 --- a/frontend/src/api/system.ts +++ b/frontend/src/api/system.ts @@ -63,7 +63,7 @@ export type SystemSettings = { cross_provider_model_pool: boolean checkin_disabled_accounts: boolean proxy_url: string - routing_strategy: 'round-robin' | 'weighted-round-robin' | 'fill-first' + routing_strategy: 'round-robin' | 'weighted-round-robin' | 'fill-first' | 'fefo' workbuddy_checkin_time: string checkin_times: Record timezone: string diff --git a/frontend/src/i18n/messages.ts b/frontend/src/i18n/messages.ts index 64036aed..81f636ca 100644 --- a/frontend/src/i18n/messages.ts +++ b/frontend/src/i18n/messages.ts @@ -122,11 +122,12 @@ export const messages: Record = { workbuddyCheckinSettingsHint: 'Default first daily check-in time for new WorkBuddy accounts. Existing accounts keep their own time until you edit them.', workbuddyCheckinSettingsFieldHint: 'Uses server local time. New WorkBuddy accounts inherit this unless you set a different time on the account.', routingStrategyTitle: 'Account routing strategy', - routingStrategyHint: 'Choose how ready accounts share traffic. Fill-first keeps traffic on the highest-priority account until it is unavailable.', + routingStrategyHint: 'Choose how ready accounts share traffic. Fill-first keeps traffic on the highest-priority account until it is unavailable. Earliest-expiry-first only ranks accounts inside the same provider by their nearest credit-package expiry; providers without package expiry keep the existing rotation.', routingStrategy: 'Strategy', routingRoundRobin: 'Round robin', routingWeightedRoundRobin: 'Weighted round robin', routingFillFirst: 'Fill first', + routingFEFO: 'Earliest expiry first (FEFO)', routingWeight: 'Routing weight', sessionAffinityTTL: 'Session TTL', sessionAffinityHits: 'Sticky hits', @@ -1053,11 +1054,12 @@ export const messages: Record = { workbuddyCheckinSettingsHint: '新建 WorkBuddy 账号时使用的默认首次签到时间。已有账号会保留各自的时间,直到你单独修改。', workbuddyCheckinSettingsFieldHint: '使用服务器本地时间。新建 WorkBuddy 账号会继承这里的时间,账号编辑页仍可单独覆盖。', routingStrategyTitle: '账号调度策略', - routingStrategyHint: '选择就绪账号如何分担流量。填满优先会持续使用最高优先级账号,直到它不可用。', + routingStrategyHint: '选择就绪账号如何分担流量。填满优先会持续使用最高优先级账号,直到它不可用。最早到期优先只在同一供应商内部按最近的积分包到期日排序;没有积分包到期信息的供应商保持原有轮询。', routingStrategy: '策略', routingRoundRobin: '轮询', routingWeightedRoundRobin: '加权轮询', routingFillFirst: '填满优先', + routingFEFO: '最早到期优先(FEFO)', routingWeight: '调度权重', sessionAffinityTTL: '会话 TTL', sessionAffinityHits: '粘性命中', diff --git a/frontend/src/pages/SystemPage.tsx b/frontend/src/pages/SystemPage.tsx index 326eab9e..a93ef66d 100644 --- a/frontend/src/pages/SystemPage.tsx +++ b/frontend/src/pages/SystemPage.tsx @@ -255,6 +255,7 @@ export function SystemPage() { + diff --git a/internal/accounts/ids.go b/internal/accounts/ids.go index 3a827282..05de83f0 100644 --- a/internal/accounts/ids.go +++ b/internal/accounts/ids.go @@ -9,6 +9,10 @@ const ( RoutingStrategyRoundRobin = "round-robin" RoutingStrategyWeightedRoundRobin = "weighted-round-robin" RoutingStrategyFillFirst = "fill-first" + // RoutingStrategyFEFO is the opt-in earliest-expiry-first strategy. It + // ranks accounts inside one provider family by the nearest credit-package + // expiry and leaves cross-provider rotation untouched. + RoutingStrategyFEFO = "fefo" ) func NormalizeRoutingStrategy(strategy string) string { @@ -17,6 +21,8 @@ func NormalizeRoutingStrategy(strategy string) string { return RoutingStrategyFillFirst case RoutingStrategyWeightedRoundRobin: return RoutingStrategyWeightedRoundRobin + case RoutingStrategyFEFO: + return RoutingStrategyFEFO default: return RoutingStrategyRoundRobin } diff --git a/internal/accounts/quota.go b/internal/accounts/quota.go index 2d88d110..5f5adf6d 100644 --- a/internal/accounts/quota.go +++ b/internal/accounts/quota.go @@ -15,6 +15,11 @@ type QuotaWindow struct { Exceeded bool `json:"exceeded,omitempty"` } +// QuotaPackageScopeAccountFEFO marks credit packages that the provider has +// confirmed are spendable by this account and carry a real package expiry. An +// empty or unknown scope never participates in FEFO ranking. +const QuotaPackageScopeAccountFEFO = "account-fefo" + // QuotaPackage is one upstream credit/resource pack that carries its own // expiry. EndsAt is a Unix second; EndTime is the provider-native wall-clock // string for display. @@ -23,12 +28,14 @@ type QuotaPackage struct { Used float64 `json:"used"` Size float64 `json:"size"` Unit string `json:"unit,omitempty"` + Scope string `json:"scope,omitempty"` EndsAt int64 `json:"ends_at,omitempty"` EndTime string `json:"end_time,omitempty"` } // QuotaSnapshot is the quota state for one account. -// A zero value means "unknown"; only Exceeded influences routing. +// A zero value means "unknown". Exceeded gates quota routing; explicitly +// scoped package expiry may additionally guide opt-in FEFO scheduling. type QuotaSnapshot struct { Used float64 `json:"used"` Total float64 `json:"total"` diff --git a/internal/api/system_settings_test.go b/internal/api/system_settings_test.go index c43b35eb..7b364d52 100644 --- a/internal/api/system_settings_test.go +++ b/internal/api/system_settings_test.go @@ -86,6 +86,29 @@ func TestSystemSettingsRoutePersistsAndAppliesRoutingStrategy(t *testing.T) { } } +func TestSystemSettingsRoutePersistsFEFORoutingStrategy(t *testing.T) { + srv := New(config.Config{ + Host: "127.0.0.1", Port: 3010, ProxyAPIKey: "secret", + QoderHome: t.TempDir(), DataDir: t.TempDir(), + }) + defer srv.Close() + + request := httptest.NewRequest(http.MethodPatch, "/api/system/settings", bytes.NewBufferString(`{"routing_strategy":"fefo"}`)) + request.Header.Set("Authorization", "Bearer secret") + response := httptest.NewRecorder() + srv.Handler().ServeHTTP(response, request) + if response.Code != http.StatusOK || !bytes.Contains(response.Body.Bytes(), []byte(`"routing_strategy":"fefo"`)) { + t.Fatalf("updated settings: %d %s", response.Code, response.Body.String()) + } + if got := srv.Pool.RoutingStrategy(); got != accounts.RoutingStrategyFEFO { + t.Fatalf("runtime strategy = %q", got) + } + value, ok, err := srv.Manager.Store().GetSecret(context.Background(), routingStrategySecret) + if err != nil || !ok || value != accounts.RoutingStrategyFEFO { + t.Fatalf("persisted strategy=%q ok=%v err=%v", value, ok, err) + } +} + func TestEnsureWorkBuddyCheckinTimeDefaultsToNine(t *testing.T) { store, err := sqlstore.OpenStore(filepath.Join(t.TempDir(), "qoder.db")) if err != nil { diff --git a/internal/app/gateway.go b/internal/app/gateway.go index 0515e635..5010cb03 100644 --- a/internal/app/gateway.go +++ b/internal/app/gateway.go @@ -48,6 +48,7 @@ func (a *App) newGateway() *apigateway.Handler { } if a.Manager != nil { h.Catalogs = a.Manager + h.AfterAccountUse = a.Manager.RefreshFEFOQuotaAfterUse } if a.Recorder != nil { h.Logs = a.Recorder diff --git a/internal/control/system.go b/internal/control/system.go index 3e16bff8..af4064b9 100644 --- a/internal/control/system.go +++ b/internal/control/system.go @@ -80,8 +80,8 @@ func (h *System) Patch(ctx context.Context, input SystemSettingsPatch) error { var strategy string if input.RoutingStrategy != nil { rawStrategy := strings.ToLower(strings.TrimSpace(*input.RoutingStrategy)) - if rawStrategy != accounts.RoutingStrategyRoundRobin && rawStrategy != accounts.RoutingStrategyWeightedRoundRobin && rawStrategy != accounts.RoutingStrategyFillFirst { - return operationError("invalid_routing_strategy", "routing_strategy must be round-robin, weighted-round-robin, or fill-first") + if rawStrategy != accounts.RoutingStrategyRoundRobin && rawStrategy != accounts.RoutingStrategyWeightedRoundRobin && rawStrategy != accounts.RoutingStrategyFillFirst && rawStrategy != accounts.RoutingStrategyFEFO { + return operationError("invalid_routing_strategy", "routing_strategy must be round-robin, weighted-round-robin, fill-first, or fefo") } strategy = accounts.NormalizeRoutingStrategy(rawStrategy) } diff --git a/internal/executor/fefo.go b/internal/executor/fefo.go new file mode 100644 index 00000000..84203a5d --- /dev/null +++ b/internal/executor/fefo.go @@ -0,0 +1,202 @@ +package executor + +import ( + "time" + + "github.com/caigee-cmd/cli2api/internal/accounts" +) + +// fefoBillingUTCOffsetSeconds is the credit-package billing calendar. WorkBuddy +// reports CycleEndTime as a UTC+8 wall clock, so two expiries on the same +// billing day share one priority batch even when their timestamps differ. +const fefoBillingUTCOffsetSeconds = 8 * 60 * 60 + +// effectiveCreditModel resolves an account alias to the model whose pricing +// actually applies. A free alias must stay free, and an empty/auto model must +// not pretend to spend credits. +func effectiveCreditModel(item Item, publicModel string) string { + model := routeModel(publicModel) + if target := item.ModelAliases[model]; target != "" { + model = routeModel(target) + } + return model +} + +// routeQuotaExceeded is the single quota gate for routing. The historical +// strategies keep the cached Exceeded flag; FEFO additionally treats a +// trustworthy package set with no live positive balance as exhausted, because +// an expired package can leave Exceeded false until the next quota refresh. +func routeQuotaExceeded(item Item, q RouteQuery) bool { + model := q.PublicModel + if !q.fefoNow.IsZero() { + model = effectiveCreditModel(item, model) + } + if itemServesFreeModel(item, model) { + return false + } + if item.Quota != nil && item.Quota.Exceeded { + return true + } + if !q.fefoNow.IsZero() { + _, depleted := fefoExpiry(item, q.PublicModel, q.fefoNow) + return depleted + } + return false +} + +// fefoQuotaState inspects one account's packages without reference to a model. +// tracked is true only when the provider explicitly scoped every reported +// package to this account and the package is credit-denominated. Such a set can +// prove "no live positive balance"; mixed, unscoped, or non-credit data cannot. +func fefoQuotaState(item Item, now time.Time) (earliest int64, depleted, tracked bool) { + quota := item.Quota + if quota == nil || len(quota.Packages) == 0 || quota.HasAddOn || quota.HasResourcePackage { + return 0, false, false + } + unknownDate := false + live := false + for _, pkg := range quota.Packages { + if pkg.Scope != accounts.QuotaPackageScopeAccountFEFO || (pkg.Unit != "" && pkg.Unit != "credits") { + return 0, false, false + } + // NaN fails this comparison too, so a malformed balance never counts as + // spendable. A package with no reported expiry stays in the unknown + // tier instead of borrowing the subscription or token lifetime. + if !(pkg.Remain > 0) || (pkg.EndsAt > 0 && pkg.EndsAt <= now.Unix()) { + continue + } + live = true + if pkg.EndsAt <= 0 { + unknownDate = true + continue + } + if earliest == 0 || pkg.EndsAt < earliest { + earliest = pkg.EndsAt + } + } + if !live { + return 0, true, true + } + if unknownDate { + return 0, false, true + } + return earliest, false, true +} + +// fefoExpiry returns the nearest live package expiry for a paid model. A free +// model never consumes credits, so it never creates FEFO priority or depletion. +func fefoExpiry(item Item, publicModel string, now time.Time) (expiry int64, depleted bool) { + model := effectiveCreditModel(item, publicModel) + if model == "" || itemServesFreeModel(item, model) { + return 0, false + } + earliest, depleted, tracked := fefoQuotaState(item, now) + if !tracked { + return 0, false + } + return earliest, depleted +} + +// fefoCreditDay maps an expiry instant onto the UTC+8 billing day. Expired +// packages are filtered by the caller before this comparison so a package that +// lapsed earlier today cannot remain the "nearest" batch. +func fefoCreditDay(expiry int64) int64 { + return (expiry + fefoBillingUTCOffsetSeconds) / (24 * 60 * 60) +} + +// fefoCandidates narrows the already healthy/model/region/concurrency-filtered +// pool to each provider's earliest billing day. Providers are grouped by family +// so a Qoder or Kimi account never has to compete with a WorkBuddy expiry, and +// the existing ID-cursor round-robin still distributes that day's requests. +// A provider with no usable dates keeps all of its accounts; inside a provider +// that has dated accounts, unknown-date accounts are fallback candidates that +// rejoin as soon as no dated account is available. +func fefoCandidates(available []Item, publicModel string, now time.Time) []Item { + if len(available) < 2 { + return available + } + minDay := make(map[string]int64, 4) + known := make(map[string]bool, 4) + for _, item := range available { + expiry, _ := fefoExpiry(item, publicModel, now) + if expiry <= 0 { + continue + } + family := accounts.NormalizeProviderFamily(item.Provider) + day := fefoCreditDay(expiry) + if !known[family] || day < minDay[family] { + minDay[family] = day + known[family] = true + } + } + if len(known) == 0 { + return available + } + out := make([]Item, 0, len(available)) + for _, item := range available { + family := accounts.NormalizeProviderFamily(item.Provider) + if !known[family] { + out = append(out, item) + continue + } + expiry, _ := fefoExpiry(item, publicModel, now) + if expiry <= 0 || fefoCreditDay(expiry) != minDay[family] { + continue + } + out = append(out, item) + } + if len(out) == 0 { + return available + } + return out +} + +// HasFEFOQuota reports whether a completed request could have consumed a +// trustworthy package balance. Runtime uses this gate to refresh only opt-in, +// supported routes; the historical strategies add no upstream traffic. +func (p *Pool) HasFEFOQuota(accountID, publicModel string) bool { + if p == nil || accountID == "" { + return false + } + p.mu.Lock() + defer p.mu.Unlock() + if p.routingStrategy != RoutingStrategyFEFO { + return false + } + for _, item := range p.items { + if item.ID != accountID { + continue + } + model := effectiveCreditModel(item, publicModel) + if model == "" || itemServesFreeModel(item, model) { + return false + } + _, _, tracked := fefoQuotaState(item, time.Now()) + return tracked + } + return false +} + +// FEFOQuotaDepleted reports whether an account routed by FEFO has a +// trustworthy package set with no live positive balance. A naturally expired +// cache looks exactly like this while its top-level Exceeded flag stays false. +// The runtime stale-quota sweep uses it to discover newly granted upstream +// packages; unknown scopes or dates never qualify. +func (p *Pool) FEFOQuotaDepleted(accountID string) bool { + if p == nil || accountID == "" { + return false + } + p.mu.Lock() + defer p.mu.Unlock() + if p.routingStrategy != RoutingStrategyFEFO { + return false + } + for _, item := range p.items { + if item.ID != accountID { + continue + } + _, depleted, tracked := fefoQuotaState(item, time.Now()) + return tracked && depleted + } + return false +} diff --git a/internal/executor/fefo_test.go b/internal/executor/fefo_test.go new file mode 100644 index 00000000..0c14b985 --- /dev/null +++ b/internal/executor/fefo_test.go @@ -0,0 +1,319 @@ +package executor + +import ( + "testing" + "time" + + "github.com/caigee-cmd/cli2api/internal/accounts" +) + +func fefoTime(days, hour int) int64 { + now := time.Now().In(time.FixedZone("billing", 8*60*60)) + return time.Date(now.Year(), now.Month(), now.Day()+days, hour, 0, 0, 0, now.Location()).Unix() +} + +func fefoPack(remain float64, expiry int64) accounts.QuotaPackage { + return accounts.QuotaPackage{ + Remain: remain, + Size: remain, + Unit: "credits", + Scope: accounts.QuotaPackageScopeAccountFEFO, + EndsAt: expiry, + } +} + +func fefoItem(id string, packages ...accounts.QuotaPackage) Item { + return Item{ + ID: id, + Provider: "workbuddy", + Region: "cn", + Models: []string{"paid", "free", "unknown"}, + FreeModels: []string{ + "free", + }, + Quota: &accounts.QuotaSnapshot{Total: 100, Remaining: 100, Unit: "credits", Packages: packages}, + } +} + +func fefoPool(items ...Item) *Pool { + p := NewPool(nil, nil) + p.SetRoutingStrategy(RoutingStrategyFEFO) + for _, item := range items { + p.Upsert(item) + } + return p +} + +func assertFEFOPick(t *testing.T, p *Pool, q RouteQuery, want string) { + t.Helper() + item, ok := p.PickRoute(q) + if !ok || item.ID != want { + t.Fatalf("pick = %q, %v; want %q", item.ID, ok, want) + } +} + +func TestFEFOSelectsEarliestLivePackageAndFollowsRefresh(t *testing.T) { + later := fefoItem("a", fefoPack(20, fefoTime(3, 12))) + earlier := fefoItem("z", + fefoPack(0, fefoTime(1, 12)), + fefoPack(100, time.Now().Add(-time.Hour).Unix()), + fefoPack(10, fefoTime(2, 12)), + ) + // A stale aggregate field must never outrank the live package list. + later.Quota.ExpiresAt = fefoTime(1, 12) + p := fefoPool(later, earlier) + for i := 0; i < 4; i++ { + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, "z") + } + // A quota refresh changes the winner without replacing the pool. + p.MergeQuota("z", &QuotaSnapshot{Packages: []accounts.QuotaPackage{ + fefoPack(0, fefoTime(2, 12)), + fefoPack(20, fefoTime(4, 12)), + }}) + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, "a") +} + +func TestFEFOSameBillingDayRotatesAndIgnoresWeights(t *testing.T) { + a := fefoItem("a", fefoPack(5, fefoTime(2, 1))) + b := fefoItem("b", fefoPack(20, fefoTime(2, 23))) + a.Weight, b.Weight = 99, 1 + p := fefoPool(a, b, fefoItem("later", fefoPack(100, fefoTime(3, 1)))) + for i := 0; i < 10; i++ { + want := "a" + if i%2 == 1 { + want = "b" + } + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, want) + } +} + +func TestFEFOUnknownExpiryFallsBackWithoutInventingDates(t *testing.T) { + a := fefoItem("a", fefoPack(10, 0)) + b := fefoItem("b") + b.Quota.ExpiresAt = fefoTime(1, 12) + p := fefoPool(a, b) + for i := 0; i < 6; i++ { + want := "a" + if i%2 == 1 { + want = "b" + } + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, want) + } + + // Inside one provider, a dated cohort outranks unknown dates, but unknown + // accounts rejoin once no dated account is available. + known := fefoItem("known", fefoPack(10, fefoTime(1, 12))) + unknown := fefoItem("unknown", fefoPack(10, 0)) + later := fefoItem("later", fefoPack(10, fefoTime(2, 12))) + p = fefoPool(known, unknown, later) + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, "known") + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid", Excluded: map[string]struct{}{"known": {}}}, "later") + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid", Excluded: map[string]struct{}{"known": {}, "later": {}}}, "unknown") +} + +func TestFEFOCrossProviderIsolation(t *testing.T) { + q1 := fefoItem("q1") + q2 := fefoItem("q2") + q1.Provider, q2.Provider = "qoder", "qoder" + q1.Models, q2.Models = []string{"paid"}, []string{"paid"} + w1 := fefoItem("w1", fefoPack(10, fefoTime(1, 12))) + w2 := fefoItem("w2", fefoPack(10, fefoTime(2, 12))) + p := fefoPool(q1, q2, w1, w2) + // Qoder has no package dates, so it keeps rotating both accounts. WorkBuddy + // contributes only its nearest-expiry account; w2 must not inherit w1's day. + want := []string{"q1", "q2", "w1", "q1", "q2", "w1"} + for i, id := range want { + item, ok := p.PickRoute(RouteQuery{PublicModel: "paid"}) + if !ok || item.ID != id { + t.Fatalf("pick %d = %q, %v; want %q", i, item.ID, ok, id) + } + } + // A provider-scoped route is unaffected by another provider's dates. + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid", ProviderFilter: "qoder"}, "q1") + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid", ProviderFilter: "workbuddy"}, "w1") + + // Even when every provider has dates, the earliest WorkBuddy package must + // not suppress the earliest Qoder account: each family picks its own batch. + q1 = fefoItem("q1", fefoPack(10, fefoTime(10, 12))) + q2 = fefoItem("q2", fefoPack(10, fefoTime(20, 12))) + q1.Provider, q2.Provider = "qoder", "qoder" + q1.Models, q2.Models = []string{"paid"}, []string{"paid"} + w1 = fefoItem("w1", fefoPack(10, fefoTime(1, 12))) + w2 = fefoItem("w2", fefoPack(10, fefoTime(2, 12))) + p = fefoPool(q1, q2, w1, w2) + want = []string{"q1", "w1", "q1", "w1"} + for i, id := range want { + item, ok := p.PickRoute(RouteQuery{PublicModel: "paid"}) + if !ok || item.ID != id { + t.Fatalf("dated pick %d = %q, %v; want %q", i, item.ID, ok, id) + } + } +} + +func TestFEFODepletedExpiredAndFreeModels(t *testing.T) { + dead := fefoItem("a", fefoPack(0, fefoTime(1, 12)), fefoPack(50, time.Now().Add(-time.Minute).Unix())) + live := fefoItem("z", fefoPack(10, fefoTime(2, 12))) + p := fefoPool(dead, live) + q := RouteQuery{PublicModel: "paid"} + assertFEFOPick(t, p, q, "z") + if got := p.LenRoute(q); got != 1 { + t.Fatalf("LenRoute = %d, want 1", got) + } + if _, ok := p.QuotaBlockedForModel(q); !ok { + t.Fatal("expired trusted packages must report quota exhaustion, not model mismatch") + } + // A known-free model spends no credits and may still use the exhausted account. + assertFEFOPick(t, p, RouteQuery{PublicModel: "free"}, "a") + dead.Quota.Exceeded = true + p = fefoPool(dead, live) + assertFEFOPick(t, p, RouteQuery{PublicModel: "free"}, "a") + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, "z") +} + +func TestFEFOUnknownScopeMixedBucketsAndAliasesStayUnknown(t *testing.T) { + for _, test := range []struct { + name string + edit func(*Item) + }{ + {"unknown scope", func(i *Item) { i.Quota.Packages[0].Scope = "" }}, + {"other scope", func(i *Item) { i.Quota.Packages[0].Scope = "work-only" }}, + {"non-credit unit", func(i *Item) { i.Quota.Packages[0].Unit = "tokens" }}, + {"mixed unknown date", func(i *Item) { i.Quota.Packages = append(i.Quota.Packages, fefoPack(10, 0)) }}, + {"additional add-on bucket", func(i *Item) { i.Quota.HasAddOn = true }}, + {"organization resource package", func(i *Item) { i.Quota.HasResourcePackage = true }}, + } { + t.Run(test.name, func(t *testing.T) { + a := fefoItem("a", fefoPack(10, fefoTime(1, 12))) + test.edit(&a) + p := fefoPool(a, fefoItem("z", fefoPack(20, fefoTime(2, 12)))) + // Unknown metadata never outranks a dated package; the account is a + // fallback candidate once the dated account is unavailable. + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, "z") + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid", Excluded: map[string]struct{}{"z": {}}}, "a") + }) + } + + a := fefoItem("a", fefoPack(10, fefoTime(3, 12))) + z := fefoItem("z", fefoPack(10, fefoTime(1, 12))) + a.ModelAliases = map[string]string{"free-alias": "free", "paid-alias": "paid"} + z.ModelAliases = map[string]string{"free-alias": "free", "paid-alias": "paid"} + p := fefoPool(a, z) + assertFEFOPick(t, p, RouteQuery{PublicModel: "free-alias"}, "a") + assertFEFOPick(t, p, RouteQuery{PublicModel: "free-alias"}, "z") + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid-alias"}, "z") +} + +func TestFEFORespectsPinCooldownSaturationAndExclusion(t *testing.T) { + early := fefoItem("a", fefoPack(10, fefoTime(1, 12))) + late := fefoItem("z", fefoPack(10, fefoTime(2, 12))) + p := fefoPool(early, late) + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid", PreferAccount: "z"}, "z") + + early.DownUntil = time.Now().Add(time.Hour) + p = fefoPool(early, late) + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, "z") + + // Once the cooldown expires, the earlier account returns to the front of + // its provider's ranking. + early.DownUntil = time.Now().Add(-time.Second) + p = fefoPool(early, late) + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, "a") + + early.DownUntil = time.Time{} + early.MaxInFlight = 1 + p = fefoPool(early, late) + if !p.Acquire("a") { + t.Fatal("acquire") + } + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, "z") + p.Release("a") + + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid", Excluded: map[string]struct{}{"a": {}}}, "z") + + early.Region = "global" + p = fefoPool(early, late) + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid", RegionFilter: "cn"}, "z") +} + +func TestFEFOLeavesHistoricalStrategiesUnchanged(t *testing.T) { + for _, strategy := range []string{RoutingStrategyRoundRobin, RoutingStrategyWeightedRoundRobin, RoutingStrategyFillFirst} { + t.Run(strategy, func(t *testing.T) { + a := fefoItem("a", fefoPack(0, fefoTime(-1, 12))) + z := fefoItem("z", fefoPack(20, fefoTime(2, 12))) + a.Weight, z.Weight = 90, 10 + p := fefoPool(a, z) + p.SetRoutingStrategy(strategy) + counts := map[string]int{} + for i := 0; i < 10; i++ { + item, ok := p.PickRoute(RouteQuery{PublicModel: "paid"}) + if !ok { + t.Fatal("historical strategy gate changed") + } + counts[item.ID]++ + } + want := 5 + if strategy == RoutingStrategyWeightedRoundRobin { + want = 9 + } + if strategy == RoutingStrategyFillFirst { + want = 10 + } + if counts["a"] != want { + t.Fatalf("counts=%v; want %d picks for a", counts, want) + } + }) + } +} + +func TestFEFOIgnoresSubscriptionAndTokenExpiry(t *testing.T) { + // The top-level quota timestamp is a subscription/reset boundary on + // providers such as Qoder, never a credit-package expiry. + q1 := fefoItem("q1") + q2 := fefoItem("q2") + q1.Provider, q2.Provider = "qoder", "qoder" + q1.Quota.ExpiresAt = fefoTime(1, 12) + q2.Quota.ExpiresAt = fefoTime(2, 12) + p := fefoPool(q1, q2) + for i := 0; i < 4; i++ { + want := "q1" + if i%2 == 1 { + want = "q2" + } + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, want) + } + + // A dated package still outranks an account whose only timestamp is the + // aggregate field. + aggregateOnly := fefoItem("aggregate") + aggregateOnly.Quota.ExpiresAt = fefoTime(1, 12) + p = fefoPool(aggregateOnly, fefoItem("dated", fefoPack(10, fefoTime(2, 12)))) + assertFEFOPick(t, p, RouteQuery{PublicModel: "paid"}, "dated") +} + +func TestFEFOQuotaTrackingAndDepletion(t *testing.T) { + unknownDate := fefoItem("unknown-date", fefoPack(10, 0)) + if !fefoPool(unknownDate).HasFEFOQuota("unknown-date", "paid") { + t.Fatal("scoped packages with unknown dates still need post-use refresh") + } + unknownScope := fefoItem("unknown-scope", fefoPack(10, fefoTime(1, 12))) + unknownScope.Quota.Packages[0].Scope = "" + if fefoPool(unknownScope).HasFEFOQuota("unknown-scope", "paid") { + t.Fatal("unknown scope must not create extra quota traffic") + } + free := fefoItem("free", fefoPack(10, fefoTime(1, 12))) + if fefoPool(free).HasFEFOQuota("free", "free") { + t.Fatal("free models must not create FEFO quota traffic") + } + check := fefoPool(free) + check.SetRoutingStrategy(RoutingStrategyFillFirst) + if check.HasFEFOQuota("free", "paid") { + t.Fatal("other strategies must not create FEFO quota traffic") + } + expired := fefoItem("expired", fefoPack(100, fefoTime(-1, 12))) + if !fefoPool(expired).FEFOQuotaDepleted("expired") { + t.Fatal("expired trusted packages should be revalidated under FEFO") + } + if fefoPool(unknownDate).FEFOQuotaDepleted("unknown-date") { + t.Fatal("unknown dates must not be treated as depleted") + } +} diff --git a/internal/executor/ids.go b/internal/executor/ids.go index 68ea3ede..8219613f 100644 --- a/internal/executor/ids.go +++ b/internal/executor/ids.go @@ -24,6 +24,7 @@ const ( RoutingStrategyRoundRobin = accounts.RoutingStrategyRoundRobin RoutingStrategyWeightedRoundRobin = accounts.RoutingStrategyWeightedRoundRobin RoutingStrategyFillFirst = accounts.RoutingStrategyFillFirst + RoutingStrategyFEFO = accounts.RoutingStrategyFEFO ) func NormalizeRoutingStrategy(strategy string) string { diff --git a/internal/executor/pool.go b/internal/executor/pool.go index 5d0c7734..56d13b60 100644 --- a/internal/executor/pool.go +++ b/internal/executor/pool.go @@ -106,6 +106,9 @@ type RouteQuery struct { // protocol (for example native Responses input the chat form cannot // carry). Nil admits every item. Eligible func(Item) bool + // fefoNow is set only by a FEFO pool. Other strategies keep the historical + // quota gate, even when a cached package has since expired. + fefoNow time.Time } func itemRegion(item Item) string { @@ -324,7 +327,7 @@ func itemServesFreeModel(item Item, publicModel string) bool { } func routeBaseMatches(item Item, q RouteQuery) bool { - if item.Quota != nil && item.Quota.Exceeded && !itemServesFreeModel(item, q.PublicModel) { + if routeQuotaExceeded(item, q) { return false } return routeReadyAndScoped(item, q) @@ -360,7 +363,7 @@ func routeReadyAndScoped(item Item, q RouteQuery) bool { // that its quota is exceeded. Free-model accounts are never quota-blocked: // they spend no credits, so an exhausted account can still serve them. func routeBlockedByQuota(item Item, q RouteQuery) bool { - if item.Quota == nil || !item.Quota.Exceeded || itemServesFreeModel(item, q.PublicModel) { + if !routeQuotaExceeded(item, q) { return false } return routeReadyAndScoped(item, q) && itemCouldServeModel(item, q.PublicModel) @@ -489,6 +492,9 @@ func (p *Pool) LenRoute(q RouteQuery) int { } p.mu.Lock() defer p.mu.Unlock() + if p.routingStrategy == RoutingStrategyFEFO { + q.fefoNow = time.Now() + } count := 0 for _, item := range p.items { if routeMatches(item, q) { @@ -508,6 +514,9 @@ func (p *Pool) QuotaBlockedForModel(q RouteQuery) (Item, bool) { } p.mu.Lock() defer p.mu.Unlock() + if p.routingStrategy == RoutingStrategyFEFO { + q.fefoNow = time.Now() + } for _, item := range p.items { if routeBlockedByQuota(item, q) { return item, true @@ -553,6 +562,9 @@ func (p *Pool) PickRoute(q RouteQuery) (Item, bool) { p.mu.Lock() defer p.mu.Unlock() now := time.Now() + if p.routingStrategy == RoutingStrategyFEFO { + q.fefoNow = now + } eligible := make([]int, 0, len(p.items)) for i, item := range p.items { if routeMatches(item, q) { @@ -653,6 +665,9 @@ func (p *Pool) PickRoute(q RouteQuery) (Item, bool) { } else { p.lastRegion[key] = itemRegion(available[0]) } + if p.routingStrategy == RoutingStrategyFEFO { + available = fefoCandidates(available, q.PublicModel, now) + } if p.routingStrategy == RoutingStrategyFillFirst { picked := pickFillFirst(available) p.lastPicked[key] = picked.ID diff --git a/internal/gateway/fefo_quota_test.go b/internal/gateway/fefo_quota_test.go new file mode 100644 index 00000000..cf8f726a --- /dev/null +++ b/internal/gateway/fefo_quota_test.go @@ -0,0 +1,31 @@ +package gateway + +import ( + "testing" + "time" + + "github.com/caigee-cmd/cli2api/internal/accounts" + "github.com/caigee-cmd/cli2api/internal/translate" +) + +func TestQuotaInvalidationRunsAfterTerminalResponseNotStreamHeaders(t *testing.T) { + var calls []string + h := &Handler{AfterAccountUse: func(id, model string) { calls = append(calls, id+":"+model) }} + finish := func(status, id, publicModel string) { + h.finishRequestLog("", time.Now(), translate.ChatRequest{Model: "paid"}, publicModel, id, "workbuddy", "", status, 0, nil, nil, 1, "") + } + finish(accounts.RequestStatusStarted, "synthetic", "paid") + finish(accounts.RequestStatusStreaming, "synthetic", "paid") + finish(accounts.RequestStatusOK, "", "paid") + if len(calls) != 0 { + t.Fatalf("invalidated before account use finished: %v", calls) + } + for _, status := range []string{accounts.RequestStatusOK, accounts.RequestStatusIncomplete, accounts.RequestStatusError, accounts.RequestStatusCanceled} { + finish(status, "synthetic", "paid") + } + finish(accounts.RequestStatusOK, "synthetic", "workbuddy-cn/paid") + h.finishRequestLog("", time.Now(), translate.ChatRequest{Model: "alias"}, "workbuddy/alias", "synthetic", "workbuddy", "", accounts.RequestStatusOK, 0, nil, nil, 1, "") + if len(calls) != 6 || calls[0] != "synthetic:paid" || calls[4] != "synthetic:paid" || calls[5] != "synthetic:alias" { + t.Fatalf("terminal response invalidations = %v", calls) + } +} diff --git a/internal/gateway/handler.go b/internal/gateway/handler.go index e3691b7f..ef90a514 100644 --- a/internal/gateway/handler.go +++ b/internal/gateway/handler.go @@ -26,6 +26,9 @@ type Handler struct { RequestedAccount func(*http.Request) string FilterModels func(*http.Request, []map[string]any) []map[string]any DecorateModels func(*http.Request, []map[string]any) []map[string]any + // AfterAccountUse is an optional non-blocking quota invalidation hook. It + // runs after the response/stream finishes, never on receipt of SSE headers. + AfterAccountUse func(accountID, publicModel string) } func (h *Handler) requestIdentity(r *http.Request) auth.Identity { diff --git a/internal/gateway/openai.go b/internal/gateway/openai.go index 463e397b..d8e430b8 100644 --- a/internal/gateway/openai.go +++ b/internal/gateway/openai.go @@ -169,6 +169,9 @@ func (h *Handler) HandleChatCompletions(w http.ResponseWriter, r *http.Request) } func (h *Handler) finishRequestLog(requestID string, started time.Time, req translate.ChatRequest, publicModel, accountID, provider, routing, status string, ttfb int, stats *StreamRelayStats, err error, attemptCount int, resolvedReasoning string) { + if accountID != "" && h.AfterAccountUse != nil && status != accounts.RequestStatusStarted && status != accounts.RequestStatusStreaming { + h.AfterAccountUse(accountID, firstNonEmpty(req.Model, publicModel)) + } if h.Recorder == nil || requestID == "" { return } diff --git a/internal/providers/interfaces.go b/internal/providers/interfaces.go index 9263361e..269f81a3 100644 --- a/internal/providers/interfaces.go +++ b/internal/providers/interfaces.go @@ -191,10 +191,12 @@ type QuotaWindow struct { // QuotaPackage is one upstream credit/resource pack with its own expiry. // EndsAt is a Unix second; EndTime is the provider-native wall-clock string. type QuotaPackage struct { - Remain float64 - Used float64 - Size float64 - Unit string + Remain float64 + Used float64 + Size float64 + Unit string + // Scope follows accounts.QuotaPackageScopeAccountFEFO; empty is unknown. + Scope string EndsAt int64 EndTime string } diff --git a/internal/providers/workbuddy/client.go b/internal/providers/workbuddy/client.go index 1cafea66..77cc95ab 100644 --- a/internal/providers/workbuddy/client.go +++ b/internal/providers/workbuddy/client.go @@ -1025,7 +1025,7 @@ func (c *Client) Keepalive(ctx context.Context, accountID string) error { // UserResource aggregates package remain/used/total from get-user-resource. // packages carries the per-pack expiry detail parsed from CycleEndTime. func (c *Client) UserResource(ctx context.Context, accountID string, credential Credential) (remain, used, total int64, packages []providers.QuotaPackage, err error) { - now := time.Now() + now := time.Now().In(cycleEndTimeZone) payload, err := json.Marshal(map[string]any{ "PageNumber": 1, "PageSize": 100, @@ -1064,7 +1064,16 @@ func (c *Client) UserResource(ctx context.Context, accountID string, credential return 0, 0, 0, nil, fmt.Errorf("user-resource code=%d msg=%s", env.Code, env.Msg) } remain, used, total = aggregateUserResource(env.Data.Response.Data.Accounts, env.Data.Response.Data.TotalDosage) - return remain, used, total, quotaPackages(env.Data.Response.Data.Accounts), nil + packages = quotaPackages(env.Data.Response.Data.Accounts) + // These packs are account-wide only for a personal identity. Enterprise + // resources may belong to a shared pool or an unselected payer, and a full + // page may hide additional packs; either case leaves FEFO scope unknown. + if credential.EnterpriseID != "" || len(env.Data.Response.Data.Accounts) >= 100 { + for i := range packages { + packages[i].Scope = "" + } + } + return remain, used, total, packages, nil } type resourcePackage struct { @@ -1083,6 +1092,10 @@ var cycleEndTimeZone = time.FixedZone("UTC+8", 8*60*60) // quotaPackages converts raw packs into per-pack expiry detail for the // console. A pack with no parseable CycleEndTime keeps EndsAt zero. +// +// The request above filters ProductCode=p_tcaca and live statuses, so every +// returned pack is a personal credit pack. The scope declaration is cleared by +// UserResource for enterprise identities and incomplete pages. func quotaPackages(packages []resourcePackage) []providers.QuotaPackage { out := make([]providers.QuotaPackage, 0, len(packages)) for _, pkg := range packages { @@ -1092,6 +1105,7 @@ func quotaPackages(packages []resourcePackage) []providers.QuotaPackage { Used: float64(used), Size: float64(size), Unit: "credits", + Scope: accounts.QuotaPackageScopeAccountFEFO, } if trimmed := strings.TrimSpace(pkg.CycleEndTime); trimmed != "" { if parsed, err := time.ParseInLocation("2006-01-02 15:04:05", trimmed, cycleEndTimeZone); err == nil { @@ -1104,11 +1118,17 @@ func quotaPackages(packages []resourcePackage) []providers.QuotaPackage { return out } -// soonestExpiry returns the earliest non-zero pack expiry and the remaining -// amount that expires at that time. +// soonestExpiry returns the earliest future expiry of a positive balance and +// the remaining amount that expires at that time. Depleted and already-expired +// packages must not keep advertising a stale date after the cached snapshot has +// outlived the package. func soonestExpiry(packages []providers.QuotaPackage) (expiresAt int64, expiringRemain float64) { + return soonestExpiryAt(packages, time.Now().Unix()) +} + +func soonestExpiryAt(packages []providers.QuotaPackage, nowUnix int64) (expiresAt int64, expiringRemain float64) { for _, pkg := range packages { - if pkg.EndsAt <= 0 { + if pkg.EndsAt <= 0 || pkg.EndsAt <= nowUnix || !(pkg.Remain > 0) { continue } if expiresAt == 0 || pkg.EndsAt < expiresAt { diff --git a/internal/providers/workbuddy/client_test.go b/internal/providers/workbuddy/client_test.go index d3e5b0ac..78364b47 100644 --- a/internal/providers/workbuddy/client_test.go +++ b/internal/providers/workbuddy/client_test.go @@ -1568,8 +1568,8 @@ func TestUserResourcePackageExpiry(t *testing.T) { "Response": map[string]any{ "Data": map[string]any{ "Accounts": []map[string]any{ - {"CycleCapacitySize": 2000, "CycleCapacityRemain": 1200, "CycleCapacityUsed": 800, "CycleEndTime": "2026-12-31 23:59:59"}, - {"CycleCapacitySize": 500, "CycleCapacityRemain": 300, "CycleCapacityUsed": 200, "CycleEndTime": "2026-10-01 00:00:00"}, + {"CycleCapacitySize": 2000, "CycleCapacityRemain": 1200, "CycleCapacityUsed": 800, "CycleEndTime": "2027-12-31 23:59:59"}, + {"CycleCapacitySize": 500, "CycleCapacityRemain": 300, "CycleCapacityUsed": 200, "CycleEndTime": "2027-10-01 00:00:00"}, {"CycleCapacitySize": 100, "CycleCapacityRemain": 100, "CycleCapacityUsed": 0}, }, }, @@ -1588,32 +1588,134 @@ func TestUserResourcePackageExpiry(t *testing.T) { if len(info.Packages) != 3 { t.Fatalf("packages=%+v", info.Packages) } - // UTC+8 2026-10-01 00:00:00 = UTC 2026-09-30 16:00:00 - want := time.Date(2026, 9, 30, 16, 0, 0, 0, time.UTC).Unix() + // UTC+8 2027-10-01 00:00:00 = UTC 2027-09-30 16:00:00 + want := time.Date(2027, 9, 30, 16, 0, 0, 0, time.UTC).Unix() if info.ExpiresAt != want { t.Fatalf("expires_at=%d want %d", info.ExpiresAt, want) } if info.ExpiringRemain != 300 { t.Fatalf("expiring_remain=%v want 300", info.ExpiringRemain) } - if info.Packages[1].EndsAt != want || info.Packages[1].EndTime != "2026-10-01 00:00:00" { + if info.Packages[1].EndsAt != want || info.Packages[1].EndTime != "2027-10-01 00:00:00" { t.Fatalf("pkg=%+v", info.Packages[1]) } + if info.Packages[0].Scope != accounts.QuotaPackageScopeAccountFEFO { + t.Fatalf("personal package scope = %q", info.Packages[0].Scope) + } if info.Packages[2].EndsAt != 0 { t.Fatalf("unexpired pkg ends_at=%d want 0", info.Packages[2].EndsAt) } } -func TestSoonestExpiry(t *testing.T) { - expiresAt, remain := soonestExpiry([]providers.QuotaPackage{ - {Remain: 100, EndsAt: 200}, - {Remain: 50, EndsAt: 200}, +func TestUserResourceQueryUsesBillingTimezone(t *testing.T) { + // The API expects UTC+8 wall-clock bounds. A host in another zone must not + // shift the query window and hide a package expiring today. + previous := time.Local + time.Local = time.FixedZone("fixture-UTC-7", -7*60*60) + t.Cleanup(func() { time.Local = previous }) + before := time.Now() + client, _ := newTestClient(t, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + var payload struct { + Begin string `json:"PackageEndTimeRangeBegin"` + End string `json:"PackageEndTimeRangeEnd"` + } + if err := json.NewDecoder(r.Body).Decode(&payload); err != nil { + t.Error(err) + w.WriteHeader(http.StatusBadRequest) + return + } + begin, err := time.ParseInLocation("2006-01-02 15:04:05", payload.Begin, cycleEndTimeZone) + if err != nil { + t.Error(err) + } + end, err := time.ParseInLocation("2006-01-02 15:04:05", payload.End, cycleEndTimeZone) + if err != nil { + t.Error(err) + } + if begin.Before(before.Add(-time.Minute)) || begin.After(time.Now().Add(time.Minute)) { + t.Errorf("query begin=%s outside current instant range; host timezone leaked", begin) + } + if end.Sub(begin) != 365*101*24*time.Hour { + t.Errorf("query range=%s", end.Sub(begin)) + } + _, _ = w.Write([]byte(`{"code":0,"data":{"Response":{"Data":{"Accounts":[]}}}}`)) + })) + if _, _, _, _, err := client.UserResource(context.Background(), "fixture-account", Credential{UID: "fixture-user", AccessToken: "fixture-token"}); err != nil { + t.Fatal(err) + } +} + +func TestSoonestExpirySkipsDepletedExpiredAndUndated(t *testing.T) { + now := time.Now().Unix() + expiresAt, remain := soonestExpiryAt([]providers.QuotaPackage{ + {Remain: 100, EndsAt: now + 200}, + {Remain: 50, EndsAt: now + 200}, {Remain: 300, EndsAt: 0}, - {Remain: 400, EndsAt: 100}, - }) - if expiresAt != 100 || remain != 400 { + {Remain: 0, EndsAt: now + 100}, + {Remain: 400, EndsAt: now - 100}, + {Remain: 400, EndsAt: now + 100}, + }, now) + if expiresAt != now+100 || remain != 400 { t.Fatalf("expiresAt=%d remain=%v", expiresAt, remain) } + if got, left := soonestExpiryAt([]providers.QuotaPackage{{Remain: 10, EndsAt: now - 1}}, now); got != 0 || left != 0 { + t.Fatalf("expired-only summary = %d/%v", got, left) + } +} + +func TestUserResourcePackageScopeClearedForEnterpriseAndIncompletePage(t *testing.T) { + pack := func() map[string]any { + return map[string]any{ + "CycleCapacitySize": 100, "CycleCapacityRemain": 100, + "CycleCapacityUsed": 0, "CycleEndTime": "2027-12-31 23:59:59", + } + } + for _, test := range []struct { + name string + credential Credential + accounts []map[string]any + }{ + { + name: "enterprise identity", + credential: Credential{AccessToken: "at", RefreshToken: "rt", ExpiresAt: 4102444800, Domain: DomainCN, UID: "u1", EnterpriseID: "ent-1"}, + accounts: []map[string]any{pack()}, + }, + { + name: "full page", + credential: Credential{AccessToken: "at", RefreshToken: "rt", ExpiresAt: 4102444800, Domain: DomainCN, UID: "u1"}, + accounts: func() []map[string]any { + out := make([]map[string]any, 100) + for i := range out { + out[i] = pack() + } + return out + }(), + }, + } { + t.Run(test.name, func(t *testing.T) { + client, store := newTestClient(t, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + _ = json.NewEncoder(w).Encode(map[string]any{ + "code": 0, + "data": map[string]any{"Response": map[string]any{"Data": map[string]any{"Accounts": test.accounts}}}, + }) + })) + payload, _ := json.Marshal(test.credential) + _ = store.SaveCredentialPayload(context.Background(), "acc1", CredentialFormat, payload) + info, err := client.Quota(context.Background(), "acc1") + if err != nil { + t.Fatal(err) + } + if len(info.Packages) != len(test.accounts) { + t.Fatalf("packages=%d want %d", len(info.Packages), len(test.accounts)) + } + for _, pkg := range info.Packages { + if pkg.Scope != "" { + t.Fatalf("incomplete/shared package kept FEFO scope: %+v", pkg) + } + } + }) + } } func TestDailyCheckinSuccess(t *testing.T) { diff --git a/internal/runtime/manager.go b/internal/runtime/manager.go index afbabb23..548fa629 100644 --- a/internal/runtime/manager.go +++ b/internal/runtime/manager.go @@ -131,6 +131,21 @@ type Manager struct { quotaProbeMu sync.Mutex quotaProbeLevels map[string]int + // FEFO completion refreshes coalesce per account. A completion during an + // in-flight fetch marks it dirty for one further fetch, not another + // goroutine. Guarded by mu; Close cancels and waits before the backing + // store is closed. + quotaAfterUse map[string]bool + quotaAfterUseDone sync.WaitGroup + + // All provider quota fetches for one account share a gate so an older, + // slow request cannot persist after a newer one (boot/manual/check-in, + // maintenance sweep, and FEFO after-use all pass through + // fetchProviderQuota). Guarded by quotaFetchMu; gates are reference-counted + // and removed when idle. + quotaFetchMu sync.Mutex + quotaFetchGates map[string]*quotaFetchGate + // healthFailures counts consecutive liveness probe failures per worker // account. The maintenance loop's workerLiveness watchdog increments it on // each failed /health probe and clears it on success; reaching @@ -485,6 +500,7 @@ func (m *Manager) Close() error { m.cancel() m.mu.Unlock() m.recoverDone.Wait() + m.quotaAfterUseDone.Wait() m.mu.Lock() processes := make([]ManagedProcess, 0, len(m.processes)) for _, process := range m.processes { diff --git a/internal/runtime/manager_fefo.go b/internal/runtime/manager_fefo.go new file mode 100644 index 00000000..76739692 --- /dev/null +++ b/internal/runtime/manager_fefo.go @@ -0,0 +1,51 @@ +package runtime + +import ( + "context" + "time" +) + +// RefreshFEFOQuotaAfterUse invalidates a trusted credit balance after the whole +// response (including an SSE body) finishes. It never waits on upstream quota in +// the request path. Concurrent completions share one fetch; a completion during +// that fetch requests one trailing fetch so its consumption is not lost. +func (m *Manager) RefreshFEFOQuotaAfterUse(accountID, publicModel string) { + if m == nil || m.pool == nil || m.runCtx == nil || !m.pool.HasFEFOQuota(accountID, publicModel) { + return + } + m.mu.Lock() + if m.runCtx.Err() != nil { + m.mu.Unlock() + return + } + if m.quotaAfterUse == nil { + m.quotaAfterUse = map[string]bool{} + } + if _, running := m.quotaAfterUse[accountID]; running { + m.quotaAfterUse[accountID] = true + m.mu.Unlock() + return + } + m.quotaAfterUse[accountID] = false + m.quotaAfterUseDone.Add(1) + m.mu.Unlock() + + go func() { + defer m.quotaAfterUseDone.Done() + for { + if item, ok := m.pool.ByID(accountID); ok && m.pool.HasFEFOQuota(accountID, publicModel) { + ctx, cancel := context.WithTimeout(m.runCtx, 10*time.Second) + m.refreshQuotaOnly(ctx, item) + cancel() + } + m.mu.Lock() + if !m.quotaAfterUse[accountID] || m.runCtx.Err() != nil { + delete(m.quotaAfterUse, accountID) + m.mu.Unlock() + return + } + m.quotaAfterUse[accountID] = false + m.mu.Unlock() + } + }() +} diff --git a/internal/runtime/manager_fefo_test.go b/internal/runtime/manager_fefo_test.go new file mode 100644 index 00000000..70089412 --- /dev/null +++ b/internal/runtime/manager_fefo_test.go @@ -0,0 +1,300 @@ +package runtime + +import ( + "context" + "path/filepath" + "sync/atomic" + "testing" + "time" + + "github.com/caigee-cmd/cli2api/internal/accounts" + "github.com/caigee-cmd/cli2api/internal/executor" + "github.com/caigee-cmd/cli2api/internal/providers" + sqlstore "github.com/caigee-cmd/cli2api/internal/store" +) + +type fefoRefreshProber struct { + calls atomic.Int32 + started chan int32 + release chan struct{} +} + +func (p *fefoRefreshProber) Probe(context.Context, string) (providers.AccountHealth, error) { + return providers.AccountHealth{Ready: true}, nil +} + +func (p *fefoRefreshProber) Quota(ctx context.Context, _ string) (*providers.QuotaInfo, error) { + n := p.calls.Add(1) + p.started <- n + select { + case <-p.release: + case <-ctx.Done(): + return nil, ctx.Err() + } + return &providers.QuotaInfo{ + ProviderID: "workbuddy", Total: 100, Used: 100, Exceeded: true, + FetchedAt: time.Now().UTC().Format(time.RFC3339Nano), + Packages: []providers.QuotaPackage{{Size: 100, Used: 100, Unit: "credits", Scope: accounts.QuotaPackageScopeAccountFEFO, EndsAt: time.Now().Add(time.Hour).Unix()}}, + }, nil +} + +func newFEFORefreshFixture(t *testing.T) (*Manager, string, *fefoRefreshProber) { + t.Helper() + store, err := sqlstore.OpenStore(filepath.Join(t.TempDir(), "after-use.db")) + if err != nil { + t.Fatal(err) + } + m := NewManager(ManagerConfig{}, store, nil) + t.Cleanup(func() { _ = m.Close(); _ = store.Close() }) + account, err := store.Create(context.Background(), accounts.CreateAccount{Name: "synthetic-after-use", Provider: "workbuddy", Region: "cn"}) + if err != nil { + t.Fatal(err) + } + m.pool.SetRoutingStrategy(accounts.RoutingStrategyFEFO) + m.pool.Upsert(Item{ + ID: account.ID, Provider: "workbuddy", Region: "cn", Models: []string{"paid", "free"}, FreeModels: []string{"free"}, + Quota: &accounts.QuotaSnapshot{Remaining: 10, Total: 100, Packages: []accounts.QuotaPackage{{ + Remain: 10, Size: 100, Unit: "credits", Scope: accounts.QuotaPackageScopeAccountFEFO, EndsAt: time.Now().Add(time.Hour).Unix(), + }}}, + }) + p := &fefoRefreshProber{started: make(chan int32, 10), release: make(chan struct{}, 10)} + registry := providers.NewRegistry() + registry.Register(providers.Adapter{ID: "workbuddy", Prober: p}) + m.SetProviders(registry) + return m, account.ID, p +} + +func awaitFEFORefresh(t *testing.T, p *fefoRefreshProber, want int32) { + t.Helper() + select { + case got := <-p.started: + if got != want { + t.Fatalf("refresh number = %d, want %d", got, want) + } + case <-time.After(2 * time.Second): + t.Fatal("quota refresh did not start") + } +} + +func TestFEFOCompletionRefreshCoalescesAndReorders(t *testing.T) { + m, id, p := newFEFORefreshFixture(t) + m.pool.Upsert(Item{ + ID: "later", Provider: "workbuddy", Region: "cn", Models: []string{"paid"}, + Quota: &accounts.QuotaSnapshot{Remaining: 10, Packages: []accounts.QuotaPackage{{ + Remain: 10, Unit: "credits", Scope: accounts.QuotaPackageScopeAccountFEFO, EndsAt: time.Now().Add(48 * time.Hour).Unix(), + }}}, + }) + m.RefreshFEFOQuotaAfterUse(id, "paid") + awaitFEFORefresh(t, p, 1) + for i := 0; i < 100; i++ { + m.RefreshFEFOQuotaAfterUse(id, "paid") + } + p.release <- struct{}{} + awaitFEFORefresh(t, p, 2) + p.release <- struct{}{} + m.quotaAfterUseDone.Wait() + if got := p.calls.Load(); got != 2 { + t.Fatalf("concurrent invalidations made %d requests, want 2", got) + } + item, ok := m.pool.PickRoute(executor.RouteQuery{PublicModel: "paid"}) + if !ok || item.ID != "later" { + t.Fatalf("spent package remains preferred: %q, %v", item.ID, ok) + } + stored, err := m.store.Get(context.Background(), id) + if err != nil || stored.Quota == nil || !stored.Quota.Exceeded { + t.Fatalf("new quota not persisted: %v, %+v", err, stored.Quota) + } +} + +func TestFEFOCompletionRefreshSkipsHistoricalStrategiesAndFreeRoutes(t *testing.T) { + m, id, p := newFEFORefreshFixture(t) + for _, strategy := range []string{accounts.RoutingStrategyRoundRobin, accounts.RoutingStrategyWeightedRoundRobin, accounts.RoutingStrategyFillFirst} { + m.pool.SetRoutingStrategy(strategy) + m.RefreshFEFOQuotaAfterUse(id, "paid") + } + m.pool.SetRoutingStrategy(accounts.RoutingStrategyFEFO) + m.RefreshFEFOQuotaAfterUse(id, "free") + m.RefreshFEFOQuotaAfterUse("missing", "paid") + m.quotaAfterUseDone.Wait() + if p.calls.Load() != 0 { + t.Fatal("unsupported route created extra quota traffic") + } +} + +func TestFEFOCompletionRefreshStopsOnClose(t *testing.T) { + m, id, p := newFEFORefreshFixture(t) + m.RefreshFEFOQuotaAfterUse(id, "paid") + awaitFEFORefresh(t, p, 1) + done := make(chan struct{}) + go func() { + _ = m.Close() + close(done) + }() + select { + case <-done: + case <-time.After(2 * time.Second): + t.Fatal("Close did not cancel the pending quota fetch") + } + m.RefreshFEFOQuotaAfterUse(id, "paid") + if p.calls.Load() != 1 { + t.Fatal("closed manager started another quota fetch") + } +} + +type orderedQuotaProber struct { + started chan int + release chan struct{} + calls atomic.Int32 +} + +func (p *orderedQuotaProber) Probe(context.Context, string) (providers.AccountHealth, error) { + return providers.AccountHealth{Ready: true}, nil +} + +func (p *orderedQuotaProber) Quota(ctx context.Context, _ string) (*providers.QuotaInfo, error) { + n := p.calls.Add(1) + p.started <- int(n) + if n == 1 { + select { + case <-p.release: + case <-ctx.Done(): + return nil, ctx.Err() + } + } + remain := 10.0 + exceeded := false + if n > 1 { + remain = 0 + exceeded = true + } + return &providers.QuotaInfo{ + ProviderID: "workbuddy", Total: 100, Remaining: remain, Used: 100 - remain, Exceeded: exceeded, + FetchedAt: time.Now().UTC().Format(time.RFC3339Nano), + Packages: []providers.QuotaPackage{{Remain: remain, Size: 100, Unit: "credits", Scope: accounts.QuotaPackageScopeAccountFEFO, EndsAt: time.Now().Add(time.Hour).Unix()}}, + }, nil +} + +// A slow ordinary refresh must not persist an old positive snapshot after the +// post-use refresh has already discovered the spent balance. +func TestQuotaFetchGateSerializesOrdinaryAndAfterUseRefreshes(t *testing.T) { + m, id, _ := newFEFORefreshFixture(t) + p := &orderedQuotaProber{started: make(chan int, 10), release: make(chan struct{})} + registry := providers.NewRegistry() + registry.Register(providers.Adapter{ID: "workbuddy", Prober: p}) + m.SetProviders(registry) + go func() { + item, _ := m.pool.ByID(id) + m.refreshQuotaOnly(context.Background(), item) + }() + if got := <-p.started; got != 1 { + t.Fatalf("first start = %d", got) + } + m.RefreshFEFOQuotaAfterUse(id, "paid") + close(p.release) + select { + case got := <-p.started: + if got != 2 { + t.Fatalf("second start = %d", got) + } + case <-time.After(2 * time.Second): + t.Fatal("after-use refresh did not wait for the in-flight ordinary refresh") + } + m.quotaAfterUseDone.Wait() + item, _ := m.pool.ByID(id) + if item.Quota == nil || !item.Quota.Exceeded { + t.Fatalf("stale positive snapshot overwrote the newer depleted one: %+v", item.Quota) + } +} + +// An account whose trusted packages expired naturally has Exceeded=false but is +// invisible to FEFO. The stale sweep must still probe it so a new upstream +// package can restore routing, with the normal backoff. +func TestFEFOExpiredTrustedPackagesEnterStaleRevalidation(t *testing.T) { + m, id, _ := newFEFORefreshFixture(t) + expired := &accounts.QuotaSnapshot{ + Used: 100, Total: 100, Remaining: 100, Exceeded: false, + FetchedAt: time.Now().Add(-2 * time.Hour).UTC().Format(time.RFC3339), + Packages: []accounts.QuotaPackage{{Remain: 100, Size: 100, Unit: "credits", Scope: accounts.QuotaPackageScopeAccountFEFO, EndsAt: time.Now().Add(-time.Minute).Unix()}}, + } + m.pool.MergeQuota(id, expired) + item, _ := m.pool.ByID(id) + if !m.quotaNeedsRevalidationFor(item, time.Now()) { + t.Fatal("exceeded=false expired trusted packages must be revalidated") + } + m.pool.SetRoutingStrategy(accounts.RoutingStrategyRoundRobin) + if m.quotaNeedsRevalidationFor(item, time.Now()) { + t.Fatal("stale revalidation must not add traffic outside FEFO") + } + m.pool.SetRoutingStrategy(accounts.RoutingStrategyFEFO) + m.pool.MergeQuota(id, &accounts.QuotaSnapshot{Exceeded: false, Packages: []accounts.QuotaPackage{{Remain: 100, Scope: "unknown", EndsAt: time.Now().Add(-time.Minute).Unix()}}}) + item, _ = m.pool.ByID(id) + if m.quotaNeedsRevalidationFor(item, time.Now()) { + t.Fatal("unknown scope must never be treated as depleted") + } + m.pool.MergeQuota(id, &accounts.QuotaSnapshot{Exceeded: false, Packages: []accounts.QuotaPackage{{Remain: 100, Scope: accounts.QuotaPackageScopeAccountFEFO, EndsAt: 0}}}) + item, _ = m.pool.ByID(id) + if m.quotaNeedsRevalidationFor(item, time.Now()) { + t.Fatal("unknown expiry must never be treated as depleted") + } +} + +type fefoQuotaFixture struct{ info *providers.QuotaInfo } + +func (f fefoQuotaFixture) Probe(context.Context, string) (providers.AccountHealth, error) { + return providers.AccountHealth{Ready: true}, nil +} + +func (f fefoQuotaFixture) Quota(context.Context, string) (*providers.QuotaInfo, error) { + return f.info, nil +} + +func TestFetchProviderQuotaPreservesPackageScopeOnlyForWorkBuddy(t *testing.T) { + ctx := context.Background() + store, err := sqlstore.OpenStore(filepath.Join(t.TempDir(), "quota-fixture.db")) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = store.Close() }) + account, err := store.Create(ctx, accounts.CreateAccount{Name: "scope-fixture", Provider: "workbuddy", Region: "cn"}) + if err != nil { + t.Fatal(err) + } + manager := &Manager{pool: NewPool(nil, nil), store: store} + manager.pool.Upsert(Item{ID: account.ID, Provider: "workbuddy", Runtime: "in_process"}) + for _, providerID := range []string{"workbuddy", "trae", ""} { + t.Run(providerID, func(t *testing.T) { + info := &providers.QuotaInfo{ + ProviderID: providerID, Remaining: 10, Total: 10, FetchedAt: "2026-10-24T00:00:00Z", + ExpiresAt: 1792857600, ExpiringRemain: 10, + Packages: []providers.QuotaPackage{ + {Remain: 10, Size: 10, Scope: accounts.QuotaPackageScopeAccountFEFO, EndsAt: 1792857600, EndTime: "2026-10-25 00:00:00"}, + {Remain: 5, Size: 5, Unit: "credits", Scope: "work-only"}, + {Remain: 5, Size: 5}, + }, + } + manager.fetchProviderQuota(ctx, account.ID, fefoQuotaFixture{info: info}) + item, _ := manager.pool.ByID(account.ID) + stored, err := store.Get(ctx, account.ID) + if err != nil { + t.Fatal(err) + } + for _, quota := range []*accounts.QuotaSnapshot{item.Quota, stored.Quota} { + if quota == nil { + t.Fatal("missing quota snapshot") + } + if providerID != "workbuddy" { + if len(quota.Packages) != 0 || quota.ExpiresAt != 0 || quota.ExpiringRemain != 0 { + t.Fatalf("non-WorkBuddy package metadata leaked through gate: %+v", quota) + } + continue + } + if len(quota.Packages) != 3 || quota.Packages[0].Scope != accounts.QuotaPackageScopeAccountFEFO || + quota.Packages[1].Scope != "work-only" || quota.Packages[2].Scope != "" || + quota.Packages[0].Unit != "credits" || quota.Packages[0].EndTime != "2026-10-25 00:00:00" || + quota.ExpiresAt != info.ExpiresAt || quota.ExpiringRemain != 10 { + t.Fatalf("package facts were not preserved: %+v", quota) + } + } + }) + } +} diff --git a/internal/runtime/manager_maintenance.go b/internal/runtime/manager_maintenance.go index a94ac155..be52a45d 100644 --- a/internal/runtime/manager_maintenance.go +++ b/internal/runtime/manager_maintenance.go @@ -476,6 +476,17 @@ func quotaNeedsRevalidation(item Item, now time.Time) bool { !item.DownUntil.IsZero() && now.Before(item.DownUntil) } +// quotaNeedsRevalidationFor adds the FEFO-only case: a trustworthy package set +// whose live balance is empty is invisible to routing while its top-level +// Exceeded flag stays false. Without this probe, a newly granted package would +// never re-enter the pool. Unknown scopes or dates never trigger the probe. +func (manager *Manager) quotaNeedsRevalidationFor(item Item, now time.Time) bool { + if quotaNeedsRevalidation(item, now) { + return true + } + return manager != nil && manager.pool != nil && manager.pool.FEFOQuotaDepleted(item.ID) +} + // refreshStaleQuota re-fetches quota for accounts whose cached snapshot still // reports Exceeded. A snapshot can go stale when upstream credits are // replenished out-of-band (billing reset, add-on purchase) or when a flaky @@ -503,7 +514,7 @@ func (manager *Manager) refreshStaleQuota(ctx context.Context) { if item.RuntimeState == "dead" { continue } - if !quotaNeedsRevalidation(item, now) { + if !manager.quotaNeedsRevalidationFor(item, now) { // Recovered (or never exhausted): the next exhaustion is a new // episode and starts from the 5-minute probes again. manager.resetQuotaProbeLevel(item.ID) @@ -527,7 +538,7 @@ func (manager *Manager) refreshStaleQuota(ctx context.Context) { // Probe failed (upstream/network). Keep the level so the next // sweep retries at the same cadence instead of escalating a // transient outage into an hours-long wait. - case updated.Quota.Exceeded: + case updated.Quota.Exceeded || manager.pool.FEFOQuotaDepleted(item.ID): manager.bumpQuotaProbeLevel(item.ID) default: manager.resetQuotaProbeLevel(item.ID) diff --git a/internal/runtime/manager_quota.go b/internal/runtime/manager_quota.go index 5e06a20f..bac81f61 100644 --- a/internal/runtime/manager_quota.go +++ b/internal/runtime/manager_quota.go @@ -27,6 +27,11 @@ func (m *Manager) fetchProviderQuota(ctx context.Context, accountID string, prob if prober == nil { return } + release, ok := m.acquireQuotaFetch(ctx, accountID) + if !ok { + return + } + defer release() info, err := prober.Quota(ctx, accountID) if err != nil || info == nil || !quotaInfoHasWindows(info) { // An empty snapshot is "not fetched yet", not a zero balance. Saving it @@ -110,6 +115,7 @@ func quotaPackagesFromInfo(packages []providers.QuotaPackage) []accounts.QuotaPa Used: pkg.Used, Size: pkg.Size, Unit: unit, + Scope: pkg.Scope, EndsAt: pkg.EndsAt, EndTime: pkg.EndTime, }) diff --git a/internal/runtime/manager_quota_gate.go b/internal/runtime/manager_quota_gate.go new file mode 100644 index 00000000..e3a95c00 --- /dev/null +++ b/internal/runtime/manager_quota_gate.go @@ -0,0 +1,58 @@ +package runtime + +import ( + "context" + "sync" +) + +// quotaFetchGate serializes quota samples for one account. Every entry point +// (boot probe, manual/console refresh, maintenance sweep, check-in, and the +// FEFO after-use refresher) funnels through fetchProviderQuota, so an older +// sample that started first cannot be persisted after a newer one. +type quotaFetchGate struct { + ch chan struct{} + // refs counts the holder plus all waiters. The map entry is dropped when + // the last participant leaves, keeping the table bounded by active probes. + refs int +} + +// acquireQuotaFetch blocks until this account's gate is free or ctx ends. +// The returned release must be called exactly once after the fetch completes. +func (m *Manager) acquireQuotaFetch(ctx context.Context, accountID string) (func(), bool) { + m.quotaFetchMu.Lock() + if m.quotaFetchGates == nil { + m.quotaFetchGates = make(map[string]*quotaFetchGate) + } + gate := m.quotaFetchGates[accountID] + if gate == nil { + gate = "aFetchGate{ch: make(chan struct{}, 1)} + m.quotaFetchGates[accountID] = gate + } + gate.refs++ + m.quotaFetchMu.Unlock() + + select { + case gate.ch <- struct{}{}: + var once sync.Once + return func() { + once.Do(func() { + <-gate.ch + m.releaseQuotaFetchRef(accountID, gate) + }) + }, true + case <-ctx.Done(): + m.releaseQuotaFetchRef(accountID, gate) + return func() {}, false + } +} + +func (m *Manager) releaseQuotaFetchRef(accountID string, gate *quotaFetchGate) { + m.quotaFetchMu.Lock() + gate.refs-- + if gate.refs == 0 { + if current, ok := m.quotaFetchGates[accountID]; ok && current == gate { + delete(m.quotaFetchGates, accountID) + } + } + m.quotaFetchMu.Unlock() +} diff --git a/internal/webui/static/assets/AreaChart-Cm1PLzri.js b/internal/webui/static/assets/AreaChart-CpgbhahE.js similarity index 60% rename from internal/webui/static/assets/AreaChart-Cm1PLzri.js rename to internal/webui/static/assets/AreaChart-CpgbhahE.js index 6bf865c8..22a2ddcf 100644 --- a/internal/webui/static/assets/AreaChart-Cm1PLzri.js +++ b/internal/webui/static/assets/AreaChart-CpgbhahE.js @@ -1 +1 @@ -import{f as e,h as t}from"./index--8Ifgwr4.js";import{L as n,t as r}from"./CartesianChart-BtPJbdpG.js";var i=t(e()),a=[`axis`],o=(0,i.forwardRef)((e,t)=>i.createElement(r,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:a,tooltipPayloadSearcher:n,categoricalChartProps:e,ref:t}));export{o as t}; \ No newline at end of file +import{f as e,h as t}from"./index-A4ivp0An.js";import{L as n,t as r}from"./CartesianChart-BkZGKHVn.js";var i=t(e()),a=[`axis`],o=(0,i.forwardRef)((e,t)=>i.createElement(r,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:a,tooltipPayloadSearcher:n,categoricalChartProps:e,ref:t}));export{o as t}; \ No newline at end of file diff --git a/internal/webui/static/assets/CartesianChart-BtPJbdpG.js b/internal/webui/static/assets/CartesianChart-BkZGKHVn.js similarity index 99% rename from internal/webui/static/assets/CartesianChart-BtPJbdpG.js rename to internal/webui/static/assets/CartesianChart-BkZGKHVn.js index 1c86685d..3a07bbc5 100644 --- a/internal/webui/static/assets/CartesianChart-BtPJbdpG.js +++ b/internal/webui/static/assets/CartesianChart-BkZGKHVn.js @@ -1,4 +1,4 @@ -import{c as e,d as t,f as n,h as r,m as i,p as a,u as o}from"./index--8Ifgwr4.js";var s=r(n()),c=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdateCapture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function l(e){return typeof e==`string`&&c.includes(e)}var u=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function d(e){return typeof e==`string`&&u.has(e)}function f(e){return typeof e==`string`&&e.startsWith(`data-`)}function p(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(d(n)||f(n))&&(t[n]=e[n]);return t}function m(e){if(e==null)return null;if((0,s.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return p(t)}return typeof e==`object`&&!Array.isArray(e)?p(e):null}function h(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(d(n)||f(n)||l(n))&&(t[n]=e[n]);return t}function g(e){return e==null?null:(0,s.isValidElement)(e)?h(e.props):typeof e==`object`&&!Array.isArray(e)?h(e):null}var _=r(t()),v=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=e.children,r=e.width,i=e.height,a=e.viewBox,c=e.className,l=e.style,u=e.title,d=e.desc,f=b(e,v),p=a||{width:r,height:i,x:0,y:0},m=o(`recharts-surface`,c);return s.createElement(`svg`,y({},h(f),{className:m,width:r,height:i,style:l,viewBox:`${p.x} ${p.y} ${p.width} ${p.height}`,ref:t}),s.createElement(`title`,null,u),s.createElement(`desc`,null,d),n)}),C=[`children`,`className`];function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=e.children,r=e.className,i=T(e,C),a=o(`recharts-layer`,r);return s.createElement(`g`,w({className:a},h(i),{ref:t}),n)});function O(e){return e===`__proto__`}var k=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function A(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:k.test(e);default:return!1}}function j(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function M(e){return typeof e==`symbol`||e instanceof Symbol}function N(e){return e==null?``:ee(e)}function ee(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(ee).join(`,`);if(M(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function te(e){if(Array.isArray(e))return e.map(j);if(typeof e==`symbol`)return[e];e=N(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r1&&arguments[1]!==void 0?arguments[1]:ie),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function oe(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+ae(i)+n},``)}var se=e=>e===0?0:e>0?1:-1,ce=e=>typeof e==`number`&&e!=+e,le=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,P=e=>(typeof e==`number`||e instanceof Number)&&!ce(e),ue=e=>P(e)||typeof e==`string`,de=0,fe=e=>{var t=++de;return`${e||``}${t}`},pe=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!P(e)&&typeof e!=`string`)return n;var i;if(le(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return ce(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},me=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;re&&(typeof t==`function`?t(e):ne(e,t))===n)}var _e=e=>e==null,ve=e=>_e(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function ye(e){return e!=null}function be(){}function xe(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=xe(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var O={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(O.height=Math.max(E.y+E.height-(l+u),0),O.width=f),O}if(n===`left`){var k={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(k.x-E.x,0),k.height=u),k}if(n===`right`){var A={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(A.width=Math.max(E.x+E.width-A.x,0),A.height=u),A}var j=o&&E?{width:g,height:u}:{};return n===`insideLeft`?Ce({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},j):n===`insideRight`?Ce({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},j):n===`insideTop`?Ce({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},j):n===`insideBottom`?Ce({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},j):n===`insideTopLeft`?Ce({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},j):n===`insideTopRight`?Ce({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},j):n===`insideBottomLeft`?Ce({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},j):n===`insideBottomRight`?Ce({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},j):n&&typeof n==`object`&&(P(n.x)||le(n.x))&&(P(n.y)||le(n.y))?Ce({x:c+pe(n.x,g),y:l+pe(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},j):Ce({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},j)},Oe=[`top`,`left`,`right`,`bottom`];function ke(e){return e==null?!1:typeof e==`object`||Oe.includes(e)}var Ae=(0,s.createContext)(null);function F(e){return function(){return e}}var je=Math.PI,Me=2*je,Ne=1e-6,Pe=Me-Ne;function Fe(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw Error(`invalid digits: ${e}`);if(t>15)return Fe;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tNe){if(!(Math.abs(u*s-c*l)>Ne)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((je-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Ne&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Ne||Math.abs(this._y1-l)>Ne)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Me+Me),d>Pe?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Ne&&this._append`A${n},${n},0,${+(d>=je)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};Le.prototype;function Re(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Le(t)}Array.prototype.slice;function ze(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Be(e){this._context=e}Be.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function Ve(e){return new Be(e)}function He(e){return e[0]}function Ue(e){return e[1]}function We(e,t){var n=F(!0),r=null,i=Ve,a=null,o=Re(s);e=typeof e==`function`?e:e===void 0?He:F(e),t=typeof t==`function`?t:t===void 0?Ue:F(t);function s(s){var c,l=(s=ze(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return We().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:F(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:F(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:F(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:F(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:F(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:F(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:F(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var Ke=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function qe(e){return new Ke(e,!0)}function Je(e){return new Ke(e,!1)}function Ye(){}function Xe(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ze(e){this._context=e}Ze.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Xe(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Xe(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Qe(e){return new Ze(e)}function $e(e){this._context=e}$e.prototype={areaStart:Ye,areaEnd:Ye,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Xe(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function et(e){return new $e(e)}function tt(e){this._context=e}tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Xe(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nt(e){return new tt(e)}function rt(e){this._context=e}rt.prototype={areaStart:Ye,areaEnd:Ye,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function it(e){return new rt(e)}function at(e){return e<0?-1:1}function ot(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(at(a)+at(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function st(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ct(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function lt(e){this._context=e}lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ct(this,this._t0,st(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ct(this,st(this,n=ot(this,e,t)),n);break;default:ct(this,this._t0,n=ot(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function ut(e){this._context=new dt(e)}(ut.prototype=Object.create(lt.prototype)).point=function(e,t){lt.prototype.point.call(this,t,e)};function dt(e){this._context=e}dt.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function ft(e){return new lt(e)}function pt(e){return new ut(e)}function mt(e){this._context=e}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=ht(e),i=ht(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function vt(e){return new _t(e,.5)}function yt(e){return new _t(e,0)}function bt(e){return new _t(e,1)}function xt(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n=0;)n[t]=t;return n}function Ct(e,t){return e[t]}function wt(e){let t=[];return t.key=e,t}function Tt(){var e=F([]),t=St,n=xt,r=Ct;function i(i){var a=Array.from(e.apply(this,arguments),wt),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o0){for(var n,r,i=0,a=e[0].length,o;i0){for(var n=0,r=e[t[0]],i,a=r.length;n0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r`radius`in e&&`startAngle`in e&&`endAngle`in e,At=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,s.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{l(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},jt=(e,t,n)=>r=>(e(t,n,r),null),Mt=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];l(i)&&typeof a==`function`&&(r||={},r[i]=jt(a,t,n))}),r};function Nt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function zt(e){return Number.isSafeInteger(e)&&e>=0}function Bt(e){return e!=null&&typeof e!=`function`&&zt(e.length)}function Vt(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Ht(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Ut=`[object RegExp]`,Wt=`[object String]`,Gt=`[object Number]`,Kt=`[object Boolean]`,qt=`[object Arguments]`,Jt=`[object Symbol]`,Yt=`[object Date]`,Xt=`[object Map]`,Zt=`[object Set]`,Qt=`[object Array]`,$t=`[object Function]`,en=`[object ArrayBuffer]`,tn=`[object Object]`,nn=`[object Error]`,rn=`[object DataView]`,an=`[object Uint8Array]`,on=`[object Uint8ClampedArray]`,sn=`[object Uint16Array]`,cn=`[object Uint32Array]`,ln=`[object BigUint64Array]`,un=`[object Int8Array]`,dn=`[object Int16Array]`,fn=`[object Int32Array]`,pn=`[object BigInt64Array]`,mn=`[object Float32Array]`,hn=`[object Float64Array]`,gn=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function _n(e){return gn.Buffer!==void 0&&gn.Buffer.isBuffer(e)}function vn(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function yn(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}var bn=/^(?:0|[1-9]\d*)$/;function xn(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e{var r=n(),i=e();function a(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var o=typeof Object.is==`function`?Object.is:a,s=i.useSyncExternalStore,c=r.useRef,l=r.useEffect,u=r.useMemo,d=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=c(null);if(a.current===null){var f={hasValue:!1,value:null};a.current=f}else f=a.current;a=u(function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,o(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var a=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=s(e,a[0],a[1]);return l(function(){f.hasValue=!0,f.value=p},[p]),d(p),p}})),Cn=a(((e,t)=>{t.exports=Sn()}))(),wn=(0,s.createContext)(null),Tn=e=>e,I=()=>{var e=(0,s.useContext)(wn);return e?e.store.dispatch:Tn},En=()=>{},Dn=()=>En,On=(e,t)=>e===t;function L(e){var t=(0,s.useContext)(wn),n=(0,s.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:En,[t,e]);return(0,Cn.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:Dn,t?t.store.getState:En,t?t.store.getState:En,n,On)}function kn(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function An(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var jn=e=>Array.isArray(e)?e:[e];function Mn(e){let t=Array.isArray(e[0])?e[0]:e;return An(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function Nn(e,t){let n=[],{length:r}=e;for(let i=0;i`u`?Pn:WeakRef,In=0,Ln=1;function Rn(){return{s:In,v:void 0,o:null,p:null}}function zn(e){return e instanceof Fn?e.deref():e}function Bn(e,t={}){let n=Rn(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e{n=Rn(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Vn(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),kn(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=Bn,argsMemoizeOptions:u=[]}={...n,...a},d=jn(c),f=jn(u),p=Mn(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=Nn(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var R=Vn(Bn);function Hn(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a{if(e!==t){let r=Wn(e),i=Wn(t);if(r===i&&r===0){if(et)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},Kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qn=/^\w*$/;function Jn(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||M(e)?!0:typeof e==`string`&&(qn.test(e)||!Kn.test(e))||t!=null&&Object.hasOwn(t,e)}function Yn(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Bt(e)?Array.from(e):Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e,r=0;for(;r0&&r===t.length?n:void 0},a=(e,t)=>{if(e==null)return t;if(t!=null)return typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):t[e]},o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||Jn(e)?e:{key:e,path:te(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;re.original)}function Xn(e,...t){let n=t.length;return n>1&&Un(e,t[0],t[1])?t=[]:n>2&&Un(t[0],t[1],t[2])&&(t=[t[0]]),Yn(e,Hn(t),[`asc`])}var Zn=e=>e.legend.settings,Qn=e=>e.legend.size;R([e=>e.legend.payload,Zn],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?Xn(r,n):r});function z(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var $n=typeof Symbol==`function`&&Symbol.observable||`@@observable`,er=()=>Math.random().toString(36).substring(7).split(``).join(`.`),tr={INIT:`@@redux/INIT${er()}`,REPLACE:`@@redux/REPLACE${er()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${er()}`};function nr(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function rr(e,t,n){if(typeof e!=`function`)throw Error(z(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(z(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(z(1));return n(rr)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(z(3));return i}function d(e){if(typeof e!=`function`)throw Error(z(4));if(c)throw Error(z(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(z(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!nr(e))throw Error(z(7));if(e.type===void 0)throw Error(z(8));if(typeof e.type!=`string`)throw Error(z(17));if(c)throw Error(z(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(z(10));r=e,f({type:tr.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(z(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[$n](){return this}}}return f({type:tr.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[$n]:m}}function ir(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:tr.INIT})===void 0)throw Error(z(12));if(n(void 0,{type:tr.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(z(13))})}function ar(e){let t=Object.keys(e),n={};for(let r=0;re:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function sr(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(z(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=or(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function cr(e){return nr(e)&&`type`in e&&typeof e.type==`string`}var lr=Symbol.for(`immer-nothing`),ur=Symbol.for(`immer-draftable`),dr=Symbol.for(`immer-state`);function fr(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pr=Object,mr=pr.getPrototypeOf,hr=`constructor`,gr=`prototype`,_r=`configurable`,vr=`enumerable`,yr=`writable`,br=`value`,xr=e=>!!e&&!!e[dr];function Sr(e){return e?Tr(e)||Mr(e)||!!e[ur]||!!e[hr]?.[ur]||Nr(e)||Pr(e):!1}var Cr=pr[gr][hr].toString(),wr=new WeakMap;function Tr(e){if(!e||!Fr(e))return!1;let t=mr(e);if(t===null||t===pr[gr])return!0;let n=pr.hasOwnProperty.call(t,hr)&&t[hr];if(n===Object)return!0;if(!Ir(n))return!1;let r=wr.get(n);return r===void 0&&(r=Function.toString.call(n),wr.set(n,r)),r===Cr}function Er(e,t,n=!0){Dr(e)===0?(n?Reflect.ownKeys(e):pr.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Dr(e){let t=e[dr];return t?t.type_:Mr(e)?1:Nr(e)?2:Pr(e)?3:0}var Or=(e,t,n=Dr(e))=>n===2?e.has(t):pr[gr].hasOwnProperty.call(e,t),kr=(e,t,n=Dr(e))=>n===2?e.get(t):e[t],Ar=(e,t,n,r=Dr(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function jr(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Mr=Array.isArray,Nr=e=>e instanceof Map,Pr=e=>e instanceof Set,Fr=e=>typeof e==`object`,Ir=e=>typeof e==`function`,Lr=e=>typeof e==`boolean`;function Rr(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var zr=e=>e.copy_||e.base_,Br=e=>e.modified_?e.copy_:e.base_;function Vr(e,t){if(Nr(e))return new Map(e);if(Pr(e))return new Set(e);if(Mr(e))return Array[gr].slice.call(e);let n=Tr(e);if(t===!0||t===`class_only`&&!n){let t=pr.getOwnPropertyDescriptors(e);delete t[dr];let n=Reflect.ownKeys(t);for(let r=0;r1&&pr.defineProperties(e,{set:Wr,add:Wr,clear:Wr,delete:Wr}),pr.freeze(e),t&&Er(e,(e,t)=>{Hr(t,!0)},!1),e)}function Ur(){fr(2)}var Wr={[br]:Ur};function Gr(e){return e===null||!Fr(e)||pr.isFrozen(e)}var Kr=`MapSet`,qr=`Patches`,Jr=`ArrayMethods`,Yr={};function Xr(e){let t=Yr[e];return t||fr(0,e),t}var Zr=e=>!!Yr[e],Qr,$r=()=>Qr,ei=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Zr(Kr)?Xr(Kr):void 0,arrayMethodsPlugin_:Zr(Jr)?Xr(Jr):void 0});function ti(e,t){t&&(e.patchPlugin_=Xr(qr),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ni(e){ri(e),e.drafts_.forEach(ai),e.drafts_=null}function ri(e){e===Qr&&(Qr=e.parent_)}var ii=e=>Qr=ei(Qr,e);function ai(e){let t=e[dr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function oi(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[dr].modified_&&(ni(t),fr(4)),Sr(e)&&(e=si(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[dr].base_,e,t)}else e=si(t,n);return ci(t,e,!0),ni(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===lr?void 0:e}function si(e,t){if(Gr(t))return t;let n=t[dr];if(!n)return gi(t,e.handledSet_,e);if(!ui(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);mi(n,e)}return n.copy_}function ci(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Hr(t,n)}function li(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var ui=(e,t)=>e.scope_===t,di=[];function fi(e,t,n,r){let i=zr(e),a=e.type_;if(r!==void 0&&kr(i,r,a)===t){Ar(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Er(i,(e,n)=>{if(xr(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??di;for(let e of o)Ar(i,e,n,a)}function pi(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!ui(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Br(i);fi(e,i.draft_??i,a,n),mi(i,r)})}function mi(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}li(e)}}function hi(e,t,n){let{scope_:r}=e;if(xr(n)){let i=n[dr];ui(i,r)&&i.callbacks_.push(function(){Ti(e),fi(e,n,Br(i),t)})}else Sr(n)&&e.callbacks_.push(function(){let i=zr(e);e.type_===3?i.has(n)&&gi(n,r.handledSet_,r):kr(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&gi(kr(e.copy_,t,e.type_),r.handledSet_,r)})}function gi(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||xr(e)||t.has(e)||!Sr(e)||Gr(e)?e:(t.add(e),Er(e,(r,i)=>{if(xr(i)){let t=i[dr];ui(t,n)&&(Ar(e,r,Br(t),e.type_),li(t))}else Sr(i)&&gi(i,t,n)}),e)}function _i(e,t){let n=Mr(e),r={type_:+!!n,scope_:t?t.scope_:$r(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=vi;n&&(i=[r],a=yi);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var vi={get(e,t){if(t===dr)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=zr(e);if(!Or(i,t,e.type_))return Si(e,i,t);let a=i[t];if(e.finalized_||!Sr(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Rr(t))return a;if(a===bi(e.base_,t)||xi(e,t,a)){Ti(e);let n=e.type_===1?+t:t,r=Di(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in zr(e)},ownKeys(e){return Reflect.ownKeys(zr(e))},set(e,t,n){let r=Ci(zr(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=bi(zr(e),t),i=r?.[dr];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(jr(n,r)&&(n!==void 0||Or(e.base_,t,e.type_)))return!0;Ti(e),wi(e)}return e.copy_[t]===n&&(n!==void 0||Or(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),hi(e,t,n),!0)},deleteProperty(e,t){return Ti(e),bi(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),wi(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=zr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[yr]:!0,[_r]:e.type_!==1||t!==`length`,[vr]:r[vr],[br]:n[t]}},defineProperty(){fr(11)},getPrototypeOf(e){return mr(e.base_)},setPrototypeOf(){fr(12)}},yi={};for(let e in vi){let t=vi[e];yi[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}yi.deleteProperty=function(e,t){return yi.set.call(this,e,t,void 0)},yi.set=function(e,t,n){return vi.set.call(this,e[0],t,n,e[0])};function bi(e,t){let n=e[dr];return(n?zr(n):e)[t]}function xi(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!Sr(n)||n[dr]?!1:e.baseRefs_.has(n)}function Si(e,t,n){let r=Ci(t,n);return r?br in r?r[br]:r.get?.call(e.draft_):void 0}function Ci(e,t){if(!(t in e))return;let n=mr(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=mr(n)}}function wi(e){e.modified_||(e.modified_=!0,e.parent_&&wi(e.parent_))}function Ti(e){e.copy_||=(e.assigned_=new Map,Vr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ei=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Ir(e)&&!Ir(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Ir(t)||fr(6),n!==void 0&&!Ir(n)&&fr(7);let r;if(Sr(e)){let i=ii(this),a=Di(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?ni(i):ri(i)}return ti(i,n),oi(r,i)}if(!e||!Fr(e)){if(r=t(e),r===void 0&&(r=e),r===lr&&(r=void 0),this.autoFreeze_&&Hr(r,!0),n){let t=[],i=[];Xr(qr).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}fr(1,e)},this.produceWithPatches=(e,t)=>{if(Ir(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Lr(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Lr(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Lr(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Sr(e)||fr(8),xr(e)&&(e=Oi(e));let t=ii(this),n=Di(t,e,void 0);return n[dr].isManual_=!0,ri(t),n}finishDraft(e,t){let n=e&&e[dr];(!n||!n.isManual_)&&fr(9);let{scope_:r}=n;return ti(r,t),oi(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Xr(qr).applyPatches_;return xr(e)?r(e,t):this.produce(e,e=>r(e,t))}};function Di(e,t,n,r){let[i,a]=Nr(t)?Xr(Kr).proxyMap_(t,n):Pr(t)?Xr(Kr).proxySet_(t,n):_i(t,n);return(n?.scope_??$r()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?pi(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function Oi(e){return xr(e)||fr(10,e),ki(e)}function ki(e){if(!Sr(e)||Gr(e))return e;let t=e[dr],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Vr(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Vr(e,!0);return Er(n,(e,t)=>{Ar(n,e,ki(t))},r),t&&(t.finalized_=!1),n}globalThis.Iterator?.from;var Ai=new Ei().produce,B=e=>e;function ji(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var Mi=ji(),Ni=ji,Pi=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?or:or.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Fi(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(Ua(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>cr(t)&&t.type===e,n}var Ii=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Li(e){return Sr(e)?Ai(e,()=>{}):e}function Ri(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function zi(e){return typeof e==`boolean`}var Bi=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new Ii;return t&&(zi(t)?a.push(Mi):a.push(Ni(t.extraArgument))),a},Vi=`RTK_autoBatch`,V=()=>e=>({payload:e,meta:{[Vi]:!0}}),Hi=e=>t=>{setTimeout(t,e)},Ui=(e,t)=>n=>{let r=!1,i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(o),n())},a=e(i),o=setTimeout(i,t)},Wi=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?Ui(window.requestAnimationFrame,100):Hi(10):e.type===`callback`?e.queueNotification:Hi(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[Vi],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},Gi=e=>function(t){let{autoBatch:n=!0}=t??{},r=new Ii(e);return n&&r.push(Wi(typeof n==`object`?n:void 0)),r};function Ki(e){let t=Bi(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(nr(n))c=ar(n);else throw Error(Ua(1));let l;l=typeof r==`function`?r(t):t();let u=or;i&&(u=Pi({trace:!1,...typeof i==`object`&&i}));let d=Gi(sr(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return rr(c,o,p)}function qi(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(Ua(28));if(r in t)throw Error(Ua(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function Ji(e){return typeof e==`function`}function Yi(e,t){let[n,r,i]=qi(t),a;if(Ji(e))a=()=>Li(e());else{let t=Li(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n){if(xr(e)){let r=n(e,t);return r===void 0?e:r}if(Sr(e))return Ai(e,e=>n(e,t));{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}}return e},e)}return o.getInitialState=a,o}var Xi=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,Zi=(e=21)=>{let t=``,n=e;for(;n--;)t+=Xi[Math.random()*64|0];return t},Qi=Symbol.for(`rtk-slice-createasyncthunk`);function $i(e,t){return`${e}/${t}`}function ea({creators:e}={}){let t=e?.asyncThunk?.[Qi];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(Ua(11));let i=(typeof e.reducers==`function`?e.reducers(ra()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(Ua(12));if(n in o.sliceCaseReducersByType)throw Error(Ua(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:$i(n,r),createNotation:typeof e.reducers==`function`};aa(a)?sa(o,a,s,t):ia(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?qi(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Yi(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=Ri(d,r,m)),i}function i(t=l){return Ri(Ri(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=ta(a,t,()=>Ri(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function ta(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var na=ea();function ra(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function ia({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!oa(r))throw Error(Ua(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Fi(e,o):Fi(e))}function aa(e){return e._reducerDefinitionType===`asyncThunk`}function oa(e){return e._reducerDefinitionType===`reducerWithPrepare`}function sa({type:e,reducerName:t},n,r,i){if(!i)throw Error(Ua(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||ca,pending:s||ca,rejected:c||ca,settled:l||ca})}function ca(){}var la=`task`,ua=`listener`,da=`completed`,fa=`cancelled`,pa=`task-${fa}`,ma=`task-${da}`,ha=`${ua}-${fa}`,ga=`${ua}-${da}`,_a=class{constructor(e){this.code=e,this.message=`${la} ${fa} (reason: ${e})`}code;name=`TaskAbortError`;message},va=(e,t)=>{if(typeof e!=`function`)throw TypeError(Ua(32))},ya=()=>{},ba=(e,t=ya)=>(e.catch(t),e),xa=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),Sa=e=>{if(e.aborted)throw new _a(e.reason)};function Ca(e,t){let n=ya;return new Promise((r,i)=>{let a=()=>i(new _a(e.reason));if(e.aborted){a();return}n=xa(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=ya})}var wa=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof _a?`cancelled`:`rejected`,error:e}}finally{t?.()}},Ta=e=>t=>ba(Ca(e,t).then(t=>(Sa(e),t))),Ea=e=>{let t=Ta(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:Da}=Object,Oa={},ka=`listenerMiddleware`,Aa=(e,t)=>{let n=t=>xa(e,()=>t.abort(e.reason));return(r,i)=>{va(r,`taskExecutor`);let a=new AbortController;n(a);let o=wa(async()=>{Sa(e),Sa(a.signal);let t=await r({pause:Ta(a.signal),delay:Ea(a.signal),signal:a.signal});return Sa(a.signal),t},()=>a.abort(ma));return i?.autoJoin&&t.push(o.catch(ya)),{result:Ta(e)(o),cancel(){a.abort(pa)}}}},ja=(e,t)=>{let n=async(n,r)=>{Sa(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await Ca(t,Promise.race(a));return Sa(t),e}finally{i()}};return((e,t)=>ba(n(e,t)))},Ma=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Fi(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(Ua(21));return va(a,`options.listener`),{predicate:i,type:t,effect:a}},Na=Da(e=>{let{type:t,predicate:n,effect:r}=Ma(e);return{id:Zi(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(Ua(22))}}},{withTypes:()=>Na}),Pa=(e,t)=>{let{type:n,effect:r,predicate:i}=Ma(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},Fa=e=>{e.pending.forEach(e=>{e.abort(ha)})},Ia=(e,t)=>()=>{for(let e of t.keys())Fa(e);e.clear()},La=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},Ra=Da(Fi(`${ka}/add`),{withTypes:()=>Ra}),za=Fi(`${ka}/removeAll`),Ba=Da(Fi(`${ka}/remove`),{withTypes:()=>Ba}),Va=(...e)=>{console.error(`${ka}/error`,...e)},Ha=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=Va}=e;va(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&Fa(e)}),c=(e=>{let n=Pa(t,e)??Na(e);return s(n)});Da(c,{withTypes:()=>c});let l=e=>{let n=Pa(t,e);return n&&(n.unsubscribe(),e.cancelActive&&Fa(n)),!!n};Da(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=ja(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,Da({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:Ea(u.signal),pause:Ta(u.signal),extra:a,signal:u.signal,fork:Aa(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(ha),n.delete(e))})},cancel:()=>{u.abort(ha),e.pending.delete(u)},throwIfCancelled:()=>{Sa(u.signal)}})))}catch(e){e instanceof _a||La(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(ga),i(e),e.pending.delete(u)}},d=Ia(t,n);return{middleware:e=>n=>r=>{if(!cr(r))return n(r);if(Ra.match(r))return c(r.payload);if(za.match(r)){d();return}if(Ba.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===Oa)throw Error(Ua(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,La(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=Oa}return s},startListening:c,stopListening:l,clearListeners:d}};function Ua(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Wa=na({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),Ga=Wa.actions,Ka=Ga.setMargin,qa=Ga.setLayout,Ja=Ga.setChartSize,Ya=Ga.setScale,Xa=Wa.reducer;function Za(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function H(e){return Number.isFinite(e)}function Qa(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function $a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eo(e){for(var t=1;t{if(t&&n){var r=n.width,i=n.height,a=t.align,o=t.verticalAlign,s=t.layout,c=t.position,l=t.offset,u=l===void 0?0:l;if(c!=null){if(ke(c)){if(c===`top`&&P(e.top))return eo(eo({},e),{},{top:e.top+(i||0)+u});if(c===`bottom`&&P(e.bottom))return eo(eo({},e),{},{bottom:e.bottom+(i||0)+u});if(c===`left`&&P(e.left))return eo(eo({},e),{},{left:e.left+(r||0)+u});if(c===`right`&&P(e.right))return eo(eo({},e),{},{right:e.right+(r||0)+u})}return e}if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&P(e[a]))return eo(eo({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&P(e[o]))return eo(eo({},e),{},{[o]:e[o]+(i||0)})}return e},ao=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,oo=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},so=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,o=e.scale,s=e.realScaleType,c=e.isCategorical,l=e.categoricalDomain,u=e.tickCount,d=e.ticks,f=e.niceTicks,p=e.axisType;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?se(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return H(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(ye):c&&l?l.map((e,t)=>{var n=o.map(e);return H(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(ye):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return H(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(ye):o.domain().map((e,t)=>{var n=o.map(e);return H(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(ye)},co={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:Et,none:xt,silhouette:Dt,wiggle:Ot,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},lo=(e,t,n)=>{var r=co[n]??xt,i=Tt().keys(t).value((e,t)=>Number(U(e,t,0))).order(St).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=U(e[i],t[r],0);Array.isArray(a)&&a.length===2&&P(a[0])&&P(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function uo(e){return e==null?void 0:String(e)}function fo(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!_e(i[t.dataKey])){var s=ge(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=U(i,_e(o)?t.dataKey:o),l=t.scale.map(c);return P(l)?l:null}var po=e=>{var t=e.flat(2).filter(P);return[Math.min(...t),Math.max(...t)]},mo=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],ho=(e,t,n)=>{if(e!=null&&Object.keys(e).length!==0)return mo(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var o=a.stackedData.reduce((e,r)=>{var i=po(Za(r,t,n));return!H(i[0])||!H(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},go=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,_o=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vo=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=Xn(t,e=>e.coordinate),a=[],o=0,s=1,c=i.length;su&&(d=Math.min(f,d));return d===1/0?0:d}return n?void 0:0};function yo(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return eo(eo({},t),{},{dataKey:n,payload:r,value:i,name:a})}function bo(e,t){if(e!=null)return String(e);if(typeof t==`string`)return t}var xo=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},So=(e,t)=>t===`centric`?e.angle:e.radius,Co=e=>e.layout.width,wo=e=>e.layout.height,To=e=>e.layout.scale,Eo=e=>e.layout.margin,Do=R(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Oo=R(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),ko=`data-recharts-item-index`;function Ao(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jo(e){for(var t=1;te.brush.height;function Io(e){return Oo(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Lo(e){return Oo(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Ro(e){return Do(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}function zo(e){return Do(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}var Bo=R([Co,wo,Eo,Fo,Io,Lo,Ro,zo,Zn,Qn],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=jo(jo({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=io(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return jo(jo({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),Vo=R(Bo,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Ho=R(Co,wo,(e,t)=>({x:0,y:0,width:e,height:t})),Uo=(0,s.createContext)(null),Wo=()=>(0,s.useContext)(Uo)!=null,Go=e=>e.brush,Ko=R([Go,Bo,Eo],(e,t,n)=>({height:e.height,x:P(e.x)?e.x:t.left,y:P(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:P(e.width)?e.width:t.width}));function qo(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Jo(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=qo(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?((r||i)&&(s=e.apply(this,t)),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function Yo(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return Jo(e,t,{leading:r,maxWait:t,trailing:i})}var Xo=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e)){if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}}},Zo={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Qo=(e,t,n)=>{var r=n.width,i=r===void 0?Zo.width:r,a=n.height,o=a===void 0?Zo.height:a,s=n.aspect,c=n.maxHeight,l=le(i)?e:Number(i),u=le(o)?t:Number(o);return s&&s>0&&(l?u=l/s:u&&(l=u*s),c&&u!=null&&u>c&&(u=c)),{calculatedWidth:l,calculatedHeight:u}},$o={width:0,height:0,overflow:`visible`},es={width:0,overflowX:`visible`},ts={height:0,overflowY:`visible`},ns={},rs=e=>{var t=e.width,n=e.height,r=le(t),i=le(n);return r&&i?$o:r?es:i?ts:ns};function is(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Zo.width,a=Zo.height):i===void 0?i=r&&r>0?void 0:Zo.width:a===void 0&&(a=r&&r>0?void 0:Zo.height),{width:i,height:a}}var as=[`aspect`,`initialDimension`,`width`,`height`,`minWidth`,`minHeight`,`maxHeight`,`children`,`debounce`,`id`,`className`,`onResize`,`style`];function os(){return os=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=e.children,r=e.width,i=e.height,a=e.viewBox,c=e.className,l=e.style,u=e.title,d=e.desc,f=b(e,v),p=a||{width:r,height:i,x:0,y:0},m=o(`recharts-surface`,c);return s.createElement(`svg`,y({},h(f),{className:m,width:r,height:i,style:l,viewBox:`${p.x} ${p.y} ${p.width} ${p.height}`,ref:t}),s.createElement(`title`,null,u),s.createElement(`desc`,null,d),n)}),C=[`children`,`className`];function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=e.children,r=e.className,i=T(e,C),a=o(`recharts-layer`,r);return s.createElement(`g`,w({className:a},h(i),{ref:t}),n)});function O(e){return e===`__proto__`}var k=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function A(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:k.test(e);default:return!1}}function j(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function M(e){return typeof e==`symbol`||e instanceof Symbol}function N(e){return e==null?``:ee(e)}function ee(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(ee).join(`,`);if(M(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function te(e){if(Array.isArray(e))return e.map(j);if(typeof e==`symbol`)return[e];e=N(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r1&&arguments[1]!==void 0?arguments[1]:ie),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function oe(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+ae(i)+n},``)}var se=e=>e===0?0:e>0?1:-1,ce=e=>typeof e==`number`&&e!=+e,le=e=>typeof e==`string`&&e.length>1&&e.indexOf(`%`)===e.length-1,P=e=>(typeof e==`number`||e instanceof Number)&&!ce(e),ue=e=>P(e)||typeof e==`string`,de=0,fe=e=>{var t=++de;return`${e||``}${t}`},pe=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!P(e)&&typeof e!=`string`)return n;var i;if(le(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return ce(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},me=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;re&&(typeof t==`function`?t(e):ne(e,t))===n)}var _e=e=>e==null,ve=e=>_e(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function ye(e){return e!=null}function be(){}function xe(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,o=e.clamp,s=xe(t),c=s.x,l=s.y,u=s.height,d=s.upperWidth,f=s.lowerWidth,p=c,m=c+(d-f)/2,h=(p+m)/2,g=(d+f)/2,_=p+d/2,v=u>=0?1:-1,y=v*i,b=v>0?`end`:`start`,x=v>0?`start`:`end`,S=d>=0?1:-1,C=S*i,w=S>0?`end`:`start`,T=S>0?`start`:`end`,E=a;if(n===`top`){var D={x:p+d/2,y:l-y,horizontalAnchor:`middle`,verticalAnchor:b};return o&&E&&(D.height=Math.max(l-E.y,0),D.width=d),D}if(n===`bottom`){var O={x:m+f/2,y:l+u+y,horizontalAnchor:`middle`,verticalAnchor:x};return o&&E&&(O.height=Math.max(E.y+E.height-(l+u),0),O.width=f),O}if(n===`left`){var k={x:h-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`};return o&&E&&(k.width=Math.max(k.x-E.x,0),k.height=u),k}if(n===`right`){var A={x:h+g+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`};return o&&E&&(A.width=Math.max(E.x+E.width-A.x,0),A.height=u),A}var j=o&&E?{width:g,height:u}:{};return n===`insideLeft`?Ce({x:h+C,y:l+u/2,horizontalAnchor:T,verticalAnchor:`middle`},j):n===`insideRight`?Ce({x:h+g-C,y:l+u/2,horizontalAnchor:w,verticalAnchor:`middle`},j):n===`insideTop`?Ce({x:p+d/2,y:l+y,horizontalAnchor:`middle`,verticalAnchor:x},j):n===`insideBottom`?Ce({x:m+f/2,y:l+u-y,horizontalAnchor:`middle`,verticalAnchor:b},j):n===`insideTopLeft`?Ce({x:p+C,y:l+y,horizontalAnchor:T,verticalAnchor:x},j):n===`insideTopRight`?Ce({x:p+d-C,y:l+y,horizontalAnchor:w,verticalAnchor:x},j):n===`insideBottomLeft`?Ce({x:m+C,y:l+u-y,horizontalAnchor:T,verticalAnchor:b},j):n===`insideBottomRight`?Ce({x:m+f-C,y:l+u-y,horizontalAnchor:w,verticalAnchor:b},j):n&&typeof n==`object`&&(P(n.x)||le(n.x))&&(P(n.y)||le(n.y))?Ce({x:c+pe(n.x,g),y:l+pe(n.y,u),horizontalAnchor:`end`,verticalAnchor:`end`},j):Ce({x:_,y:l+u/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},j)},Oe=[`top`,`left`,`right`,`bottom`];function ke(e){return e==null?!1:typeof e==`object`||Oe.includes(e)}var Ae=(0,s.createContext)(null);function F(e){return function(){return e}}var je=Math.PI,Me=2*je,Ne=1e-6,Pe=Me-Ne;function Fe(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw Error(`invalid digits: ${e}`);if(t>15)return Fe;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;tNe){if(!(Math.abs(u*s-c*l)>Ne)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((je-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Ne&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Ne||Math.abs(this._y1-l)>Ne)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Me+Me),d>Pe?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Ne&&this._append`A${n},${n},0,${+(d>=je)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};Le.prototype;function Re(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Le(t)}Array.prototype.slice;function ze(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Be(e){this._context=e}Be.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};function Ve(e){return new Be(e)}function He(e){return e[0]}function Ue(e){return e[1]}function We(e,t){var n=F(!0),r=null,i=Ve,a=null,o=Re(s);e=typeof e==`function`?e:e===void 0?He:F(e),t=typeof t==`function`?t:t===void 0?Ue:F(t);function s(s){var c,l=(s=ze(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return We().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:F(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:F(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:F(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:F(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:F(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:F(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:F(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var Ke=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function qe(e){return new Ke(e,!0)}function Je(e){return new Ke(e,!1)}function Ye(){}function Xe(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ze(e){this._context=e}Ze.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Xe(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Xe(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Qe(e){return new Ze(e)}function $e(e){this._context=e}$e.prototype={areaStart:Ye,areaEnd:Ye,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Xe(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function et(e){return new $e(e)}function tt(e){this._context=e}tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Xe(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nt(e){return new tt(e)}function rt(e){this._context=e}rt.prototype={areaStart:Ye,areaEnd:Ye,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function it(e){return new rt(e)}function at(e){return e<0?-1:1}function ot(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(at(a)+at(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function st(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ct(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function lt(e){this._context=e}lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ct(this,this._t0,st(this,this._t0))}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,e!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ct(this,st(this,n=ot(this,e,t)),n);break;default:ct(this,this._t0,n=ot(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function ut(e){this._context=new dt(e)}(ut.prototype=Object.create(lt.prototype)).point=function(e,t){lt.prototype.point.call(this,t,e)};function dt(e){this._context=e}dt.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function ft(e){return new lt(e)}function pt(e){return new ut(e)}function mt(e){this._context=e}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=ht(e),i=ht(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function vt(e){return new _t(e,.5)}function yt(e){return new _t(e,0)}function bt(e){return new _t(e,1)}function xt(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n=0;)n[t]=t;return n}function Ct(e,t){return e[t]}function wt(e){let t=[];return t.key=e,t}function Tt(){var e=F([]),t=St,n=xt,r=Ct;function i(i){var a=Array.from(e.apply(this,arguments),wt),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o0){for(var n,r,i=0,a=e[0].length,o;i0){for(var n=0,r=e[t[0]],i,a=r.length;n0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r`radius`in e&&`startAngle`in e&&`endAngle`in e,At=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,s.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{l(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r},jt=(e,t,n)=>r=>(e(t,n,r),null),Mt=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];l(i)&&typeof a==`function`&&(r||={},r[i]=jt(a,t,n))}),r};function Nt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function zt(e){return Number.isSafeInteger(e)&&e>=0}function Bt(e){return e!=null&&typeof e!=`function`&&zt(e.length)}function Vt(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Ht(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Ut=`[object RegExp]`,Wt=`[object String]`,Gt=`[object Number]`,Kt=`[object Boolean]`,qt=`[object Arguments]`,Jt=`[object Symbol]`,Yt=`[object Date]`,Xt=`[object Map]`,Zt=`[object Set]`,Qt=`[object Array]`,$t=`[object Function]`,en=`[object ArrayBuffer]`,tn=`[object Object]`,nn=`[object Error]`,rn=`[object DataView]`,an=`[object Uint8Array]`,on=`[object Uint8ClampedArray]`,sn=`[object Uint16Array]`,cn=`[object Uint32Array]`,ln=`[object BigUint64Array]`,un=`[object Int8Array]`,dn=`[object Int16Array]`,fn=`[object Int32Array]`,pn=`[object BigInt64Array]`,mn=`[object Float32Array]`,hn=`[object Float64Array]`,gn=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function _n(e){return gn.Buffer!==void 0&&gn.Buffer.isBuffer(e)}function vn(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function yn(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}var bn=/^(?:0|[1-9]\d*)$/;function xn(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e{var r=n(),i=e();function a(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var o=typeof Object.is==`function`?Object.is:a,s=i.useSyncExternalStore,c=r.useRef,l=r.useEffect,u=r.useMemo,d=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=c(null);if(a.current===null){var f={hasValue:!1,value:null};a.current=f}else f=a.current;a=u(function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,o(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var a=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=s(e,a[0],a[1]);return l(function(){f.hasValue=!0,f.value=p},[p]),d(p),p}})),Cn=a(((e,t)=>{t.exports=Sn()}))(),wn=(0,s.createContext)(null),Tn=e=>e,I=()=>{var e=(0,s.useContext)(wn);return e?e.store.dispatch:Tn},En=()=>{},Dn=()=>En,On=(e,t)=>e===t;function L(e){var t=(0,s.useContext)(wn),n=(0,s.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:En,[t,e]);return(0,Cn.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:Dn,t?t.store.getState:En,t?t.store.getState:En,n,On)}function kn(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function An(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var jn=e=>Array.isArray(e)?e:[e];function Mn(e){let t=Array.isArray(e[0])?e[0]:e;return An(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function Nn(e,t){let n=[],{length:r}=e;for(let i=0;i`u`?Pn:WeakRef,In=0,Ln=1;function Rn(){return{s:In,v:void 0,o:null,p:null}}function zn(e){return e instanceof Fn?e.deref():e}function Bn(e,t={}){let n=Rn(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e{n=Rn(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Vn(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),kn(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=Bn,argsMemoizeOptions:u=[]}={...n,...a},d=jn(c),f=jn(u),p=Mn(e),m=s(function(){return t++,o.apply(null,arguments)},...d),h=l(function(){r++;let e=Nn(p,arguments);return i=m.apply(null,e),i},...f);return Object.assign(h,{resultFunc:o,memoizedResultFunc:m,dependencies:p,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var R=Vn(Bn);function Hn(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a{if(e!==t){let r=Wn(e),i=Wn(t);if(r===i&&r===0){if(et)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},Kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qn=/^\w*$/;function Jn(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||M(e)?!0:typeof e==`string`&&(qn.test(e)||!Kn.test(e))||t!=null&&Object.hasOwn(t,e)}function Yn(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Bt(e)?Array.from(e):Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e,r=0;for(;r0&&r===t.length?n:void 0},a=(e,t)=>{if(e==null)return t;if(t!=null)return typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):t[e]},o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||Jn(e)?e:{key:e,path:te(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;re.original)}function Xn(e,...t){let n=t.length;return n>1&&Un(e,t[0],t[1])?t=[]:n>2&&Un(t[0],t[1],t[2])&&(t=[t[0]]),Yn(e,Hn(t),[`asc`])}var Zn=e=>e.legend.settings,Qn=e=>e.legend.size;R([e=>e.legend.payload,Zn],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?Xn(r,n):r});function z(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var $n=typeof Symbol==`function`&&Symbol.observable||`@@observable`,er=()=>Math.random().toString(36).substring(7).split(``).join(`.`),tr={INIT:`@@redux/INIT${er()}`,REPLACE:`@@redux/REPLACE${er()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${er()}`};function nr(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function rr(e,t,n){if(typeof e!=`function`)throw Error(z(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(z(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(z(1));return n(rr)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(z(3));return i}function d(e){if(typeof e!=`function`)throw Error(z(4));if(c)throw Error(z(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(z(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!nr(e))throw Error(z(7));if(e.type===void 0)throw Error(z(8));if(typeof e.type!=`string`)throw Error(z(17));if(c)throw Error(z(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(z(10));r=e,f({type:tr.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(z(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[$n](){return this}}}return f({type:tr.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[$n]:m}}function ir(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:tr.INIT})===void 0)throw Error(z(12));if(n(void 0,{type:tr.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(z(13))})}function ar(e){let t=Object.keys(e),n={};for(let r=0;re:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function sr(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(z(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=or(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function cr(e){return nr(e)&&`type`in e&&typeof e.type==`string`}var lr=Symbol.for(`immer-nothing`),ur=Symbol.for(`immer-draftable`),dr=Symbol.for(`immer-state`);function fr(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pr=Object,mr=pr.getPrototypeOf,hr=`constructor`,gr=`prototype`,_r=`configurable`,vr=`enumerable`,yr=`writable`,br=`value`,xr=e=>!!e&&!!e[dr];function Sr(e){return e?Tr(e)||Mr(e)||!!e[ur]||!!e[hr]?.[ur]||Nr(e)||Pr(e):!1}var Cr=pr[gr][hr].toString(),wr=new WeakMap;function Tr(e){if(!e||!Fr(e))return!1;let t=mr(e);if(t===null||t===pr[gr])return!0;let n=pr.hasOwnProperty.call(t,hr)&&t[hr];if(n===Object)return!0;if(!Ir(n))return!1;let r=wr.get(n);return r===void 0&&(r=Function.toString.call(n),wr.set(n,r)),r===Cr}function Er(e,t,n=!0){Dr(e)===0?(n?Reflect.ownKeys(e):pr.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Dr(e){let t=e[dr];return t?t.type_:Mr(e)?1:Nr(e)?2:Pr(e)?3:0}var Or=(e,t,n=Dr(e))=>n===2?e.has(t):pr[gr].hasOwnProperty.call(e,t),kr=(e,t,n=Dr(e))=>n===2?e.get(t):e[t],Ar=(e,t,n,r=Dr(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function jr(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Mr=Array.isArray,Nr=e=>e instanceof Map,Pr=e=>e instanceof Set,Fr=e=>typeof e==`object`,Ir=e=>typeof e==`function`,Lr=e=>typeof e==`boolean`;function Rr(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var zr=e=>e.copy_||e.base_,Br=e=>e.modified_?e.copy_:e.base_;function Vr(e,t){if(Nr(e))return new Map(e);if(Pr(e))return new Set(e);if(Mr(e))return Array[gr].slice.call(e);let n=Tr(e);if(t===!0||t===`class_only`&&!n){let t=pr.getOwnPropertyDescriptors(e);delete t[dr];let n=Reflect.ownKeys(t);for(let r=0;r1&&pr.defineProperties(e,{set:Wr,add:Wr,clear:Wr,delete:Wr}),pr.freeze(e),t&&Er(e,(e,t)=>{Hr(t,!0)},!1),e)}function Ur(){fr(2)}var Wr={[br]:Ur};function Gr(e){return e===null||!Fr(e)||pr.isFrozen(e)}var Kr=`MapSet`,qr=`Patches`,Jr=`ArrayMethods`,Yr={};function Xr(e){let t=Yr[e];return t||fr(0,e),t}var Zr=e=>!!Yr[e],Qr,$r=()=>Qr,ei=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Zr(Kr)?Xr(Kr):void 0,arrayMethodsPlugin_:Zr(Jr)?Xr(Jr):void 0});function ti(e,t){t&&(e.patchPlugin_=Xr(qr),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ni(e){ri(e),e.drafts_.forEach(ai),e.drafts_=null}function ri(e){e===Qr&&(Qr=e.parent_)}var ii=e=>Qr=ei(Qr,e);function ai(e){let t=e[dr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function oi(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[dr].modified_&&(ni(t),fr(4)),Sr(e)&&(e=si(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[dr].base_,e,t)}else e=si(t,n);return ci(t,e,!0),ni(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===lr?void 0:e}function si(e,t){if(Gr(t))return t;let n=t[dr];if(!n)return gi(t,e.handledSet_,e);if(!ui(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);mi(n,e)}return n.copy_}function ci(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Hr(t,n)}function li(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var ui=(e,t)=>e.scope_===t,di=[];function fi(e,t,n,r){let i=zr(e),a=e.type_;if(r!==void 0&&kr(i,r,a)===t){Ar(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Er(i,(e,n)=>{if(xr(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??di;for(let e of o)Ar(i,e,n,a)}function pi(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!ui(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Br(i);fi(e,i.draft_??i,a,n),mi(i,r)})}function mi(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}li(e)}}function hi(e,t,n){let{scope_:r}=e;if(xr(n)){let i=n[dr];ui(i,r)&&i.callbacks_.push(function(){Ti(e),fi(e,n,Br(i),t)})}else Sr(n)&&e.callbacks_.push(function(){let i=zr(e);e.type_===3?i.has(n)&&gi(n,r.handledSet_,r):kr(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&gi(kr(e.copy_,t,e.type_),r.handledSet_,r)})}function gi(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||xr(e)||t.has(e)||!Sr(e)||Gr(e)?e:(t.add(e),Er(e,(r,i)=>{if(xr(i)){let t=i[dr];ui(t,n)&&(Ar(e,r,Br(t),e.type_),li(t))}else Sr(i)&&gi(i,t,n)}),e)}function _i(e,t){let n=Mr(e),r={type_:+!!n,scope_:t?t.scope_:$r(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=vi;n&&(i=[r],a=yi);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var vi={get(e,t){if(t===dr)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=zr(e);if(!Or(i,t,e.type_))return Si(e,i,t);let a=i[t];if(e.finalized_||!Sr(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Rr(t))return a;if(a===bi(e.base_,t)||xi(e,t,a)){Ti(e);let n=e.type_===1?+t:t,r=Di(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in zr(e)},ownKeys(e){return Reflect.ownKeys(zr(e))},set(e,t,n){let r=Ci(zr(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=bi(zr(e),t),i=r?.[dr];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(jr(n,r)&&(n!==void 0||Or(e.base_,t,e.type_)))return!0;Ti(e),wi(e)}return e.copy_[t]===n&&(n!==void 0||Or(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),hi(e,t,n),!0)},deleteProperty(e,t){return Ti(e),bi(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),wi(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=zr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[yr]:!0,[_r]:e.type_!==1||t!==`length`,[vr]:r[vr],[br]:n[t]}},defineProperty(){fr(11)},getPrototypeOf(e){return mr(e.base_)},setPrototypeOf(){fr(12)}},yi={};for(let e in vi){let t=vi[e];yi[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}yi.deleteProperty=function(e,t){return yi.set.call(this,e,t,void 0)},yi.set=function(e,t,n){return vi.set.call(this,e[0],t,n,e[0])};function bi(e,t){let n=e[dr];return(n?zr(n):e)[t]}function xi(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!Sr(n)||n[dr]?!1:e.baseRefs_.has(n)}function Si(e,t,n){let r=Ci(t,n);return r?br in r?r[br]:r.get?.call(e.draft_):void 0}function Ci(e,t){if(!(t in e))return;let n=mr(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=mr(n)}}function wi(e){e.modified_||(e.modified_=!0,e.parent_&&wi(e.parent_))}function Ti(e){e.copy_||=(e.assigned_=new Map,Vr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ei=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Ir(e)&&!Ir(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Ir(t)||fr(6),n!==void 0&&!Ir(n)&&fr(7);let r;if(Sr(e)){let i=ii(this),a=Di(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?ni(i):ri(i)}return ti(i,n),oi(r,i)}if(!e||!Fr(e)){if(r=t(e),r===void 0&&(r=e),r===lr&&(r=void 0),this.autoFreeze_&&Hr(r,!0),n){let t=[],i=[];Xr(qr).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}fr(1,e)},this.produceWithPatches=(e,t)=>{if(Ir(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Lr(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Lr(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Lr(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Sr(e)||fr(8),xr(e)&&(e=Oi(e));let t=ii(this),n=Di(t,e,void 0);return n[dr].isManual_=!0,ri(t),n}finishDraft(e,t){let n=e&&e[dr];(!n||!n.isManual_)&&fr(9);let{scope_:r}=n;return ti(r,t),oi(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Xr(qr).applyPatches_;return xr(e)?r(e,t):this.produce(e,e=>r(e,t))}};function Di(e,t,n,r){let[i,a]=Nr(t)?Xr(Kr).proxyMap_(t,n):Pr(t)?Xr(Kr).proxySet_(t,n):_i(t,n);return(n?.scope_??$r()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?pi(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function Oi(e){return xr(e)||fr(10,e),ki(e)}function ki(e){if(!Sr(e)||Gr(e))return e;let t=e[dr],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Vr(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Vr(e,!0);return Er(n,(e,t)=>{Ar(n,e,ki(t))},r),t&&(t.finalized_=!1),n}globalThis.Iterator?.from;var Ai=new Ei().produce,B=e=>e;function ji(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var Mi=ji(),Ni=ji,Pi=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?or:or.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function Fi(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(Ua(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>cr(t)&&t.type===e,n}var Ii=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Li(e){return Sr(e)?Ai(e,()=>{}):e}function Ri(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function zi(e){return typeof e==`boolean`}var Bi=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new Ii;return t&&(zi(t)?a.push(Mi):a.push(Ni(t.extraArgument))),a},Vi=`RTK_autoBatch`,V=()=>e=>({payload:e,meta:{[Vi]:!0}}),Hi=e=>t=>{setTimeout(t,e)},Ui=(e,t)=>n=>{let r=!1,i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(o),n())},a=e(i),o=setTimeout(i,t)},Wi=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?Ui(window.requestAnimationFrame,100):Hi(10):e.type===`callback`?e.queueNotification:Hi(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[Vi],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},Gi=e=>function(t){let{autoBatch:n=!0}=t??{},r=new Ii(e);return n&&r.push(Wi(typeof n==`object`?n:void 0)),r};function Ki(e){let t=Bi(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(nr(n))c=ar(n);else throw Error(Ua(1));let l;l=typeof r==`function`?r(t):t();let u=or;i&&(u=Pi({trace:!1,...typeof i==`object`&&i}));let d=Gi(sr(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return rr(c,o,p)}function qi(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(Ua(28));if(r in t)throw Error(Ua(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function Ji(e){return typeof e==`function`}function Yi(e,t){let[n,r,i]=qi(t),a;if(Ji(e))a=()=>Li(e());else{let t=Li(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n){if(xr(e)){let r=n(e,t);return r===void 0?e:r}if(Sr(e))return Ai(e,e=>n(e,t));{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}}return e},e)}return o.getInitialState=a,o}var Xi=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,Zi=(e=21)=>{let t=``,n=e;for(;n--;)t+=Xi[Math.random()*64|0];return t},Qi=Symbol.for(`rtk-slice-createasyncthunk`);function $i(e,t){return`${e}/${t}`}function ea({creators:e}={}){let t=e?.asyncThunk?.[Qi];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(Ua(11));let i=(typeof e.reducers==`function`?e.reducers(ra()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(Ua(12));if(n in o.sliceCaseReducersByType)throw Error(Ua(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:$i(n,r),createNotation:typeof e.reducers==`function`};aa(a)?sa(o,a,s,t):ia(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?qi(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Yi(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=Ri(d,r,m)),i}function i(t=l){return Ri(Ri(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=ta(a,t,()=>Ri(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function ta(e,t,n,r){function i(i,...a){let o=t(i);return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var na=ea();function ra(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function ia({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!oa(r))throw Error(Ua(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Fi(e,o):Fi(e))}function aa(e){return e._reducerDefinitionType===`asyncThunk`}function oa(e){return e._reducerDefinitionType===`reducerWithPrepare`}function sa({type:e,reducerName:t},n,r,i){if(!i)throw Error(Ua(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||ca,pending:s||ca,rejected:c||ca,settled:l||ca})}function ca(){}var la=`task`,ua=`listener`,da=`completed`,fa=`cancelled`,pa=`task-${fa}`,ma=`task-${da}`,ha=`${ua}-${fa}`,ga=`${ua}-${da}`,_a=class{constructor(e){this.code=e,this.message=`${la} ${fa} (reason: ${e})`}code;name=`TaskAbortError`;message},va=(e,t)=>{if(typeof e!=`function`)throw TypeError(Ua(32))},ya=()=>{},ba=(e,t=ya)=>(e.catch(t),e),xa=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),Sa=e=>{if(e.aborted)throw new _a(e.reason)};function Ca(e,t){let n=ya;return new Promise((r,i)=>{let a=()=>i(new _a(e.reason));if(e.aborted){a();return}n=xa(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=ya})}var wa=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof _a?`cancelled`:`rejected`,error:e}}finally{t?.()}},Ta=e=>t=>ba(Ca(e,t).then(t=>(Sa(e),t))),Ea=e=>{let t=Ta(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:Da}=Object,Oa={},ka=`listenerMiddleware`,Aa=(e,t)=>{let n=t=>xa(e,()=>t.abort(e.reason));return(r,i)=>{va(r,`taskExecutor`);let a=new AbortController;n(a);let o=wa(async()=>{Sa(e),Sa(a.signal);let t=await r({pause:Ta(a.signal),delay:Ea(a.signal),signal:a.signal});return Sa(a.signal),t},()=>a.abort(ma));return i?.autoJoin&&t.push(o.catch(ya)),{result:Ta(e)(o),cancel(){a.abort(pa)}}}},ja=(e,t)=>{let n=async(n,r)=>{Sa(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await Ca(t,Promise.race(a));return Sa(t),e}finally{i()}};return((e,t)=>ba(n(e,t)))},Ma=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Fi(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(Ua(21));return va(a,`options.listener`),{predicate:i,type:t,effect:a}},Na=Da(e=>{let{type:t,predicate:n,effect:r}=Ma(e);return{id:Zi(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(Ua(22))}}},{withTypes:()=>Na}),Pa=(e,t)=>{let{type:n,effect:r,predicate:i}=Ma(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},Fa=e=>{e.pending.forEach(e=>{e.abort(ha)})},Ia=(e,t)=>()=>{for(let e of t.keys())Fa(e);e.clear()},La=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},Ra=Da(Fi(`${ka}/add`),{withTypes:()=>Ra}),za=Fi(`${ka}/removeAll`),Ba=Da(Fi(`${ka}/remove`),{withTypes:()=>Ba}),Va=(...e)=>{console.error(`${ka}/error`,...e)},Ha=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=Va}=e;va(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&Fa(e)}),c=(e=>{let n=Pa(t,e)??Na(e);return s(n)});Da(c,{withTypes:()=>c});let l=e=>{let n=Pa(t,e);return n&&(n.unsubscribe(),e.cancelActive&&Fa(n)),!!n};Da(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=ja(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,Da({},s,{getOriginalState:l,condition:(e,t)=>d(e,t).then(Boolean),take:d,delay:Ea(u.signal),pause:Ta(u.signal),extra:a,signal:u.signal,fork:Aa(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(ha),n.delete(e))})},cancel:()=>{u.abort(ha),e.pending.delete(u)},throwIfCancelled:()=>{Sa(u.signal)}})))}catch(e){e instanceof _a||La(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(ga),i(e),e.pending.delete(u)}},d=Ia(t,n);return{middleware:e=>n=>r=>{if(!cr(r))return n(r);if(Ra.match(r))return c(r.payload);if(za.match(r)){d();return}if(Ba.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===Oa)throw Error(Ua(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,La(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=Oa}return s},startListening:c,stopListening:l,clearListeners:d}};function Ua(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Wa=na({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),Ga=Wa.actions,Ka=Ga.setMargin,qa=Ga.setLayout,Ja=Ga.setChartSize,Ya=Ga.setScale,Xa=Wa.reducer;function Za(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function H(e){return Number.isFinite(e)}function Qa(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}function $a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eo(e){for(var t=1;t{if(t&&n){var r=n.width,i=n.height,a=t.align,o=t.verticalAlign,s=t.layout,c=t.position,l=t.offset,u=l===void 0?0:l;if(c!=null){if(ke(c)){if(c===`top`&&P(e.top))return eo(eo({},e),{},{top:e.top+(i||0)+u});if(c===`bottom`&&P(e.bottom))return eo(eo({},e),{},{bottom:e.bottom+(i||0)+u});if(c===`left`&&P(e.left))return eo(eo({},e),{},{left:e.left+(r||0)+u});if(c===`right`&&P(e.right))return eo(eo({},e),{},{right:e.right+(r||0)+u})}return e}if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&P(e[a]))return eo(eo({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&P(e[o]))return eo(eo({},e),{},{[o]:e[o]+(i||0)})}return e},ao=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,oo=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},so=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,o=e.scale,s=e.realScaleType,c=e.isCategorical,l=e.categoricalDomain,u=e.tickCount,d=e.ticks,f=e.niceTicks,p=e.axisType;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?se(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return H(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(ye):c&&l?l.map((e,t)=>{var n=o.map(e);return H(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(ye):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return H(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(ye):o.domain().map((e,t)=>{var n=o.map(e);return H(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(ye)},co={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:Et,none:xt,silhouette:Dt,wiggle:Ot,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},lo=(e,t,n)=>{var r=co[n]??xt,i=Tt().keys(t).value((e,t)=>Number(U(e,t,0))).order(St).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=U(e[i],t[r],0);Array.isArray(a)&&a.length===2&&P(a[0])&&P(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function uo(e){return e==null?void 0:String(e)}function fo(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!_e(i[t.dataKey])){var s=ge(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=U(i,_e(o)?t.dataKey:o),l=t.scale.map(c);return P(l)?l:null}var po=e=>{var t=e.flat(2).filter(P);return[Math.min(...t),Math.max(...t)]},mo=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],ho=(e,t,n)=>{if(e!=null&&Object.keys(e).length!==0)return mo(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var o=a.stackedData.reduce((e,r)=>{var i=po(Za(r,t,n));return!H(i[0])||!H(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]))},go=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,_o=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vo=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=Xn(t,e=>e.coordinate),a=[],o=0,s=1,c=i.length;su&&(d=Math.min(f,d));return d===1/0?0:d}return n?void 0:0};function yo(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return eo(eo({},t),{},{dataKey:n,payload:r,value:i,name:a})}function bo(e,t){if(e!=null)return String(e);if(typeof t==`string`)return t}var xo=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},So=(e,t)=>t===`centric`?e.angle:e.radius,Co=e=>e.layout.width,wo=e=>e.layout.height,To=e=>e.layout.scale,Eo=e=>e.layout.margin,Do=R(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Oo=R(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),ko=`data-recharts-item-index`;function Ao(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jo(e){for(var t=1;te.brush.height;function Io(e){return Oo(e).reduce((e,t)=>t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Lo(e){return Oo(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function Ro(e){return Do(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}function zo(e){return Do(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+(typeof t.height==`number`?t.height:30):e,0)}var Bo=R([Co,wo,Eo,Fo,Io,Lo,Ro,zo,Zn,Qn],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=jo(jo({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=io(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return jo(jo({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),Vo=R(Bo,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Ho=R(Co,wo,(e,t)=>({x:0,y:0,width:e,height:t})),Uo=(0,s.createContext)(null),Wo=()=>(0,s.useContext)(Uo)!=null,Go=e=>e.brush,Ko=R([Go,Bo,Eo],(e,t,n)=>({height:e.height,x:P(e.x)?e.x:t.left,y:P(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:P(e.width)?e.width:t.width}));function qo(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Jo(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=qo(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?((r||i)&&(s=e.apply(this,t)),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function Yo(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return Jo(e,t,{leading:r,maxWait:t,trailing:i})}var Xo=function(e,t){var n=[...arguments].slice(2);if(typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e)){if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}}},Zo={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Qo=(e,t,n)=>{var r=n.width,i=r===void 0?Zo.width:r,a=n.height,o=a===void 0?Zo.height:a,s=n.aspect,c=n.maxHeight,l=le(i)?e:Number(i),u=le(o)?t:Number(o);return s&&s>0&&(l?u=l/s:u&&(l=u*s),c&&u!=null&&u>c&&(u=c)),{calculatedWidth:l,calculatedHeight:u}},$o={width:0,height:0,overflow:`visible`},es={width:0,overflowX:`visible`},ts={height:0,overflowY:`visible`},ns={},rs=e=>{var t=e.width,n=e.height,r=le(t),i=le(n);return r&&i?$o:r?es:i?ts:ns};function is(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Zo.width,a=Zo.height):i===void 0?i=r&&r>0?void 0:Zo.width:a===void 0&&(a=r&&r>0?void 0:Zo.height),{width:i,height:a}}var as=[`aspect`,`initialDimension`,`width`,`height`,`minWidth`,`minHeight`,`maxHeight`,`children`,`debounce`,`id`,`className`,`onResize`,`style`];function os(){return os=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n({width:n,height:r}),[n,r]);return xs(i)?s.createElement(bs.Provider,{value:i},t):null}var Cs=()=>(0,s.useContext)(bs),ws=(0,s.forwardRef)((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Zo.initialDimension:r,a=e.width,c=e.height,l=e.minWidth,u=l===void 0?Zo.minWidth:l,d=e.minHeight,f=e.maxHeight,p=e.children,m=e.debounce,h=m===void 0?Zo.debounce:m,g=e.id,_=e.className,v=e.onResize,y=e.style,b=y===void 0?{}:y,x=vs(e,as),S=(0,s.useRef)(null),C=(0,s.useRef)();C.current=v,(0,s.useImperativeHandle)(t,()=>S.current);var w=fs((0,s.useState)({containerWidth:i.width,containerHeight:i.height}),2),T=w[0],E=w[1],D=(0,s.useCallback)((e,t)=>{E(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,s.useEffect)(()=>{if(S.current==null||typeof ResizeObserver>`u`)return be;var e=e=>{var t,n=e[0];if(n!=null){var r=n.contentRect,i=r.width,a=r.height;D(i,a),(t=C.current)==null||t.call(C,i,a)}};h>0&&(e=Yo(e,h,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=S.current.getBoundingClientRect(),r=n.width,i=n.height;return D(r,i),t.observe(S.current),()=>{t.disconnect()}},[D,h]);var O=T.containerWidth,k=T.containerHeight;Xo(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var A=Qo(O,k,{width:a,height:c,aspect:n,maxHeight:f}),j=A.calculatedWidth,M=A.calculatedHeight;return Xo(O<0||k<0||j!=null&&j>0||M!=null&&M>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the diff --git a/internal/webui/static/assets/CostChart-zKBs-QQq.js b/internal/webui/static/assets/CostChart-5urt0nTO.js similarity index 93% rename from internal/webui/static/assets/CostChart-zKBs-QQq.js rename to internal/webui/static/assets/CostChart-5urt0nTO.js index cd568ccc..20d58a83 100644 --- a/internal/webui/static/assets/CostChart-zKBs-QQq.js +++ b/internal/webui/static/assets/CostChart-5urt0nTO.js @@ -1 +1 @@ -import{a as e,f as t,h as n,i as r,l as i,r as a}from"./index--8Ifgwr4.js";import{i as o,n as s,wt as c}from"./CartesianChart-BtPJbdpG.js";import{n as l,r as u,t as d}from"./XAxis-C10B4cAr.js";import{t as f}from"./AreaChart-Cm1PLzri.js";var p=n(t(),1),m=i(),h=[`var(--accent)`,`var(--muted)`,`var(--success)`,`var(--warning)`];function g(e,t,n){let r=new Date(e);return Number.isFinite(r.getTime())?new Intl.DateTimeFormat(n===`zh`?`zh-CN`:`en-US`,t?{month:`short`,day:`numeric`}:{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(r):``}function _(e,t){return t===`credits`?e.per_model_credits??{}:t===`tokens`?e.per_model_tokens??{}:e.per_model??{}}function v(t,n){return n===`cost`?a(t):n===`tokens`?r(t):e(t)}function y(t,n){return n===`cost`?`¥${t>=10?Math.round(t):Number(t.toFixed(1))}`:n===`tokens`?r(t):e(t)}function b({active:e,payload:t,label:n,daily:r,lang:i,models:a,totalLabel:o,metric:s}){if(!e||!t?.length)return null;let c=new Map(a.map(e=>[e.id,e.label])),l=t.filter(e=>(e.value??0)>0).sort((e,t)=>t.value-e.value),u=t.reduce((e,t)=>e+(t.value??0),0);return(0,m.jsxs)(`div`,{className:`rounded-xl bg-overlay px-3 py-2 text-caption text-overlay-foreground shadow-overlay`,children:[(0,m.jsx)(`div`,{className:`mono text-muted`,children:g(String(n),r,i)}),(0,m.jsxs)(`div`,{className:`mt-1.5 grid gap-1`,children:[l.map(e=>(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-6`,children:[(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{background:h[a.findIndex(t=>t.id===e.dataKey)%h.length]}}),c.get(e.dataKey)||e.dataKey]}),(0,m.jsx)(`span`,{className:`mono font-medium`,children:v(e.value,s)})]},e.dataKey)),(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-6 border-t border-separator pt-1`,children:[(0,m.jsx)(`span`,{className:`text-muted`,children:o}),(0,m.jsx)(`span`,{className:`mono font-medium`,children:v(u,s)})]})]})]})}function x({series:e,models:t,lang:n,emptyLabel:r,totalLabel:i,metric:a=`credits`}){let v=(0,p.useMemo)(()=>t.map(e=>e.id),[t]),x=(0,p.useMemo)(()=>e.map(e=>{let t=_(e,a),n={at:e.at};for(let e of v){let r=Number(t[e]??0);n[e]=a===`tokens`?r:Number(r.toFixed(4))}return n}),[e,v,a]),S=Math.max(0,...x.map(e=>v.reduce((t,n)=>t+Number(e[n]??0),0)))>0,C=(x.length>1?Date.parse(x[x.length-1].at)-Date.parse(x[0].at):0)>1728e5;return!e.length||!S?(0,m.jsx)(`div`,{className:`grid min-h-56 place-items-center px-6 py-12 text-center text-sm text-muted`,children:r}):(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`h-72 w-full`,children:(0,m.jsx)(c,{width:`100%`,height:`100%`,children:(0,m.jsxs)(f,{data:x,margin:{top:8,right:8,bottom:0,left:0},children:[(0,m.jsx)(`defs`,{children:v.map((e,t)=>(0,m.jsxs)(`linearGradient`,{id:`cost-${a}-${e}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,m.jsx)(`stop`,{offset:`0%`,stopColor:h[t%h.length],stopOpacity:.32}),(0,m.jsx)(`stop`,{offset:`100%`,stopColor:h[t%h.length],stopOpacity:.04})]},e))}),(0,m.jsx)(l,{vertical:!1,stroke:`var(--separator)`,strokeDasharray:`3 6`}),(0,m.jsx)(d,{dataKey:`at`,tickLine:!1,axisLine:!1,minTickGap:28,tick:{fill:`var(--muted)`,fontSize:10,fontFamily:`var(--font-mono)`},tickFormatter:e=>g(e,C,n)}),(0,m.jsx)(s,{width:52,tickLine:!1,axisLine:!1,tick:{fill:`var(--muted)`,fontSize:10,fontFamily:`var(--font-mono)`},tickFormatter:e=>y(e,a)}),(0,m.jsx)(u,{cursor:{stroke:`var(--border)`,strokeDasharray:`3 3`},content:(0,m.jsx)(b,{daily:C,lang:n,models:t,totalLabel:i,metric:a})}),v.map((e,t)=>(0,m.jsx)(o,{type:`monotone`,dataKey:e,stackId:`usage`,stroke:h[t%h.length],strokeWidth:1.5,fill:`url(#cost-${a}-${e})`,isAnimationActive:!1,dot:!1,activeDot:{r:3,strokeWidth:1.2}},e))]})})}),(0,m.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] text-muted`,children:t.map((e,t)=>(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{background:h[t%h.length]}}),e.label]},e.id))})]})}export{x as CostChart}; \ No newline at end of file +import{a as e,f as t,h as n,i as r,l as i,r as a}from"./index-A4ivp0An.js";import{i as o,n as s,wt as c}from"./CartesianChart-BkZGKHVn.js";import{n as l,r as u,t as d}from"./XAxis-BeXdNyw4.js";import{t as f}from"./AreaChart-CpgbhahE.js";var p=n(t(),1),m=i(),h=[`var(--accent)`,`var(--muted)`,`var(--success)`,`var(--warning)`];function g(e,t,n){let r=new Date(e);return Number.isFinite(r.getTime())?new Intl.DateTimeFormat(n===`zh`?`zh-CN`:`en-US`,t?{month:`short`,day:`numeric`}:{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(r):``}function _(e,t){return t===`credits`?e.per_model_credits??{}:t===`tokens`?e.per_model_tokens??{}:e.per_model??{}}function v(t,n){return n===`cost`?a(t):n===`tokens`?r(t):e(t)}function y(t,n){return n===`cost`?`¥${t>=10?Math.round(t):Number(t.toFixed(1))}`:n===`tokens`?r(t):e(t)}function b({active:e,payload:t,label:n,daily:r,lang:i,models:a,totalLabel:o,metric:s}){if(!e||!t?.length)return null;let c=new Map(a.map(e=>[e.id,e.label])),l=t.filter(e=>(e.value??0)>0).sort((e,t)=>t.value-e.value),u=t.reduce((e,t)=>e+(t.value??0),0);return(0,m.jsxs)(`div`,{className:`rounded-xl bg-overlay px-3 py-2 text-caption text-overlay-foreground shadow-overlay`,children:[(0,m.jsx)(`div`,{className:`mono text-muted`,children:g(String(n),r,i)}),(0,m.jsxs)(`div`,{className:`mt-1.5 grid gap-1`,children:[l.map(e=>(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-6`,children:[(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{background:h[a.findIndex(t=>t.id===e.dataKey)%h.length]}}),c.get(e.dataKey)||e.dataKey]}),(0,m.jsx)(`span`,{className:`mono font-medium`,children:v(e.value,s)})]},e.dataKey)),(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-6 border-t border-separator pt-1`,children:[(0,m.jsx)(`span`,{className:`text-muted`,children:o}),(0,m.jsx)(`span`,{className:`mono font-medium`,children:v(u,s)})]})]})]})}function x({series:e,models:t,lang:n,emptyLabel:r,totalLabel:i,metric:a=`credits`}){let v=(0,p.useMemo)(()=>t.map(e=>e.id),[t]),x=(0,p.useMemo)(()=>e.map(e=>{let t=_(e,a),n={at:e.at};for(let e of v){let r=Number(t[e]??0);n[e]=a===`tokens`?r:Number(r.toFixed(4))}return n}),[e,v,a]),S=Math.max(0,...x.map(e=>v.reduce((t,n)=>t+Number(e[n]??0),0)))>0,C=(x.length>1?Date.parse(x[x.length-1].at)-Date.parse(x[0].at):0)>1728e5;return!e.length||!S?(0,m.jsx)(`div`,{className:`grid min-h-56 place-items-center px-6 py-12 text-center text-sm text-muted`,children:r}):(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`h-72 w-full`,children:(0,m.jsx)(c,{width:`100%`,height:`100%`,children:(0,m.jsxs)(f,{data:x,margin:{top:8,right:8,bottom:0,left:0},children:[(0,m.jsx)(`defs`,{children:v.map((e,t)=>(0,m.jsxs)(`linearGradient`,{id:`cost-${a}-${e}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,m.jsx)(`stop`,{offset:`0%`,stopColor:h[t%h.length],stopOpacity:.32}),(0,m.jsx)(`stop`,{offset:`100%`,stopColor:h[t%h.length],stopOpacity:.04})]},e))}),(0,m.jsx)(l,{vertical:!1,stroke:`var(--separator)`,strokeDasharray:`3 6`}),(0,m.jsx)(d,{dataKey:`at`,tickLine:!1,axisLine:!1,minTickGap:28,tick:{fill:`var(--muted)`,fontSize:10,fontFamily:`var(--font-mono)`},tickFormatter:e=>g(e,C,n)}),(0,m.jsx)(s,{width:52,tickLine:!1,axisLine:!1,tick:{fill:`var(--muted)`,fontSize:10,fontFamily:`var(--font-mono)`},tickFormatter:e=>y(e,a)}),(0,m.jsx)(u,{cursor:{stroke:`var(--border)`,strokeDasharray:`3 3`},content:(0,m.jsx)(b,{daily:C,lang:n,models:t,totalLabel:i,metric:a})}),v.map((e,t)=>(0,m.jsx)(o,{type:`monotone`,dataKey:e,stackId:`usage`,stroke:h[t%h.length],strokeWidth:1.5,fill:`url(#cost-${a}-${e})`,isAnimationActive:!1,dot:!1,activeDot:{r:3,strokeWidth:1.2}},e))]})})}),(0,m.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] text-muted`,children:t.map((e,t)=>(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{background:h[t%h.length]}}),e.label]},e.id))})]})}export{x as CostChart}; \ No newline at end of file diff --git a/internal/webui/static/assets/LiveSparkline-g4J_1uGD.js b/internal/webui/static/assets/LiveSparkline-CiMyj7tn.js similarity index 73% rename from internal/webui/static/assets/LiveSparkline-g4J_1uGD.js rename to internal/webui/static/assets/LiveSparkline-CiMyj7tn.js index 3bd45fbf..535bc0c9 100644 --- a/internal/webui/static/assets/LiveSparkline-g4J_1uGD.js +++ b/internal/webui/static/assets/LiveSparkline-CiMyj7tn.js @@ -1 +1 @@ -import{l as e}from"./index--8Ifgwr4.js";import{i as t,n,wt as r}from"./CartesianChart-BtPJbdpG.js";import{t as i}from"./AreaChart-Cm1PLzri.js";var a=e();function o({samples:e,capacity:o,label:s}){let c=e.length?e:[{at:0,value:0}],l=Math.max(1,o,...c.map(e=>e.value));return(0,a.jsx)(`div`,{className:`h-6 w-[120px] shrink-0`,role:`img`,"aria-label":s,children:(0,a.jsx)(r,{width:`100%`,height:`100%`,children:(0,a.jsxs)(i,{data:c,margin:{top:1,right:0,bottom:1,left:0},children:[(0,a.jsx)(n,{hide:!0,domain:[0,l]}),(0,a.jsx)(t,{type:`monotone`,dataKey:`value`,stroke:`var(--foreground)`,strokeOpacity:.7,strokeWidth:1.25,fill:`var(--foreground)`,fillOpacity:.08,isAnimationActive:!1,dot:!1})]})})})}export{o as LiveSparkline}; \ No newline at end of file +import{l as e}from"./index-A4ivp0An.js";import{i as t,n,wt as r}from"./CartesianChart-BkZGKHVn.js";import{t as i}from"./AreaChart-CpgbhahE.js";var a=e();function o({samples:e,capacity:o,label:s}){let c=e.length?e:[{at:0,value:0}],l=Math.max(1,o,...c.map(e=>e.value));return(0,a.jsx)(`div`,{className:`h-6 w-[120px] shrink-0`,role:`img`,"aria-label":s,children:(0,a.jsx)(r,{width:`100%`,height:`100%`,children:(0,a.jsxs)(i,{data:c,margin:{top:1,right:0,bottom:1,left:0},children:[(0,a.jsx)(n,{hide:!0,domain:[0,l]}),(0,a.jsx)(t,{type:`monotone`,dataKey:`value`,stroke:`var(--foreground)`,strokeOpacity:.7,strokeWidth:1.25,fill:`var(--foreground)`,fillOpacity:.08,isAnimationActive:!1,dot:!1})]})})})}export{o as LiveSparkline}; \ No newline at end of file diff --git a/internal/webui/static/assets/TrafficChart-jYJwrZhA.js b/internal/webui/static/assets/TrafficChart-DKxQTayd.js similarity index 98% rename from internal/webui/static/assets/TrafficChart-jYJwrZhA.js rename to internal/webui/static/assets/TrafficChart-DKxQTayd.js index 28b9bc70..0b10250f 100644 --- a/internal/webui/static/assets/TrafficChart-jYJwrZhA.js +++ b/internal/webui/static/assets/TrafficChart-DKxQTayd.js @@ -1 +1 @@ -import{f as e,h as t,i as n,l as r,n as i,o as a,s as o,t as s,u as c}from"./index--8Ifgwr4.js";import{A as l,An as u,C as d,Cn as f,D as p,E as m,Et as h,L as g,Lt as _,M as v,Mn as y,Mt as b,N as x,Nt as S,O as C,Ot as w,P as T,Pt as E,Q as D,Rt as O,S as k,T as A,Z as j,_t as M,a as N,bn as P,bt as ee,ct as te,d as F,et as ne,f as re,g as ie,gt as ae,h as oe,hn as I,i as se,j as ce,jn as L,k as le,kt as R,m as ue,n as de,nt as fe,o as pe,p as me,pt as he,s as ge,st as z,t as _e,vn as B,w as ve,wn as ye,wt as be,x as xe,yn as V,z as H,zt as U}from"./CartesianChart-BtPJbdpG.js";import{i as Se,n as Ce,r as we,t as Te}from"./XAxis-C10B4cAr.js";var Ee=class{constructor(e){var t=e.x,n=e.y;this.xAxisScale=t,this.yAxisScale=n}map(e,t){var n=t.position;return{x:this.xAxisScale.map(e.x,{position:n})??0,y:this.yAxisScale.map(e.y,{position:n})??0}}mapWithFallback(e,t){var n=t.position,r=t.fallback,i=r===`rangeMin`?this.yAxisScale.rangeMin():r===`rangeMax`?this.yAxisScale.rangeMax():0,a=r===`rangeMin`?this.xAxisScale.rangeMin():r===`rangeMax`?this.xAxisScale.rangeMax():0;return{x:this.xAxisScale.map(e.x,{position:n})??a,y:this.yAxisScale.map(e.y,{position:n})??i}}isInRange(e){var t=e.x,n=e.y,r=t==null||this.xAxisScale.isInRange(t),i=n==null||this.yAxisScale.isInRange(n);return r&&i}},W=t(e());function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t{var s=o.x1,c=o.x2,l=o.y1,u=o.y2;if(i==null||a==null)return null;var d=new Ee({x:i,y:a}),f={x:e?i.map(s,{position:`start`})??null:i.rangeMin(),y:n?a.map(l,{position:`start`})??null:a.rangeMin()},p={x:t?i.map(c,{position:`end`})??null:i.rangeMax(),y:r?a.map(u,{position:`end`})??null:a.rangeMax()};return o.ifOverflow===`discard`&&(!d.isInRange(f)||!d.isInRange(p))?null:ue(f,p)},je=(e,t)=>W.isValidElement(e)?W.cloneElement(e,t):typeof e==`function`?e(t):W.createElement(Se,q({},t,{className:`recharts-reference-area-rect`}));function Me(e){var t=O();return(0,W.useEffect)(()=>(t(re(e)),()=>{t(me(e))})),null}function Ne(e){var t=e.x1,n=e.x2,r=e.y1,i=e.y2,a=e.className,o=e.shape,s=e.xAxisId,l=e.yAxisId,d=F(),f=h(),p=U(e=>j(e,`xAxis`,s,f)),m=U(e=>j(e,`yAxis`,l,f));if(p==null||m==null)return null;var g=P(t),_=P(n),v=P(r),y=P(i);if(!g&&!_&&!v&&!y&&!o)return null;var b=Ae(g,_,v,y,p,m,e);if(!b&&!o)return null;var S=e.ifOverflow===`hidden`?`url(#${d})`:void 0;return W.createElement(H,{zIndex:e.zIndex},W.createElement(u,{className:c(`recharts-reference-area`,a)},je(o,K(K({clipPath:S},L(e)),b)),b!=null&&W.createElement(x,q({},b,{lowerWidth:b.width,upperWidth:b.width}),W.createElement(T,{label:e.label}),e.children)))}var Pe={ifOverflow:`discard`,xAxisId:0,yAxisId:0,radius:0,fill:`#ccc`,label:!1,fillOpacity:.5,stroke:`none`,strokeWidth:1,zIndex:z.area};function Fe(e){var t=I(e,Pe);return W.createElement(W.Fragment,null,W.createElement(Me,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2}),W.createElement(Ne,t))}Fe.displayName=`ReferenceArea`;var Ie=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`visibleLength`,`strokeDasharray`,`connectNulls`];function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;te+t,0);if(!i)return Be(t,e);for(var a=Math.floor(e/i),o=e%i,s=[],c=0,l=0;co){s=[...r.slice(0,c),o-l];break}}var f=s.length%2==0?[0,t]:[t];return[...He(r,a),...s,...f].map(e=>`${e}px`).join(`, `)}function We(e,t,n){return e?Ue(n,t,`${e}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):Be(t,n)}function Ge(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=Le(e,Ie),a=r??!1,o;if(t!=null){var s=i.pathRef;o=We(n,ze(s?.current??null),t)}else n!=null&&(o=String(n));return W.createElement(he,J({},i,{connectNulls:a,strokeDasharray:o}))}function Ke(e){var t=(0,W.useRef)(0),n=(0,W.useRef)(0),r=(0,W.useRef)(!1),i=(0,W.useRef)(e);return i.current!==e&&(t.current=n.current,i.current=e),(0,W.useCallback)((e,i)=>{if(r.current)return null;var a=Math.min(ye(t.current+e*i),i);return e>0&&i>0&&(n.current=Math.max(n.current,a),a>=i)?(r.current=!0,null):a},[])}var qe=[`children`];function Je(e,t){if(e==null)return{};var n,r,i=Ye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r({x:0,y:0,value:0}),errorBarOffset:0});function Ze(e){var t=e.children,n=Je(e,qe);return W.createElement(Xe.Provider,{value:n},t)}var Qe=(e,t,n,r)=>D(e,`xAxis`,t,r),$e=(e,t,n,r)=>ne(e,`xAxis`,t,r),et=(e,t,n,r)=>D(e,`yAxis`,n,r),tt=(e,t,n,r)=>ne(e,`yAxis`,n,r),nt=_([M,Qe,et,$e,tt],(e,t,n,r,i)=>E(e,`xAxis`)?w(t,r,!1):w(n,i,!1)),rt=(e,t,n,r,i)=>i;function it(e){return e.type===`line`}var at=_([fe,rt],(e,t)=>e.filter(it).find(e=>e.id===t)),ot=_([M,Qe,et,$e,tt,at,nt,te],(e,t,n,r,i,a,o,s)=>{var c=s.chartData,l=s.dataStartIndex,u=s.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var d=a.dataKey,f=a.data,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return Dt({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}}),st=[`id`],ct=[`type`,`layout`,`connectNulls`,`needClip`,`shape`,`strokeDasharray`],lt=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?t/n:0}var Q={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationInterpolateFn:(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(e=>e.status===`removed`?[]:[e.next]);var n=gt(e),r=[];for(var i of e)if(i.status===`matched`)r.push(Z(Z({},i.next),{},{x:B(i.prev.x,i.next.x,t),y:B(i.prev.y,i.next.y,t)}));else if(i.status===`added`){if(i.next.x!=null){var a=i.next.x-n;r.push(Z(Z({},i.next),{},{x:B(a,i.next.x,t),y:i.next.y}))}else r.push(i.next)}else if(i.status===`removed`&&i.prev.x!=null){var o=i.prev.x+n;r.push(Z(Z({},i.prev),{},{x:B(i.prev.x,o,t),y:i.prev.y}))}return r},animationMatchBy:m,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,shape:Ge,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:z.line,type:`linear`},_t=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType;return[{inactive:e.hide,dataKey:t,type:i,color:r,value:b(n,t),payload:e}]},vt=W.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,p={dataDefinedOnItem:n,getPosition:f,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:b(o,t),hide:s,type:u,color:r,unit:c,formatter:l,graphicalItemId:d}};return W.createElement(C,{tooltipEntrySettings:p})});function yt(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,o=r.needClip;r.id;var s=X(r,st),c=y(s);return W.createElement(xe,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:c,needClip:o,clipPathId:t})}function bt(e){var t=e.showLabels,n=e.children,r=e.points,i=(0,W.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return Z(Z({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return W.createElement(ce,{value:t?i:void 0},n)}function xt(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,o=e.isAnimating,s=e.isEntrance,c=e.visibleLength,l=i.type,u=i.layout,d=i.connectNulls,f=i.needClip,p=i.shape,m=i.strokeDasharray,h=X(i,ct),g=Z(Z({},L(h)),{},{fill:`none`,className:`recharts-line-curve`,clipPath:f?`url(#clipPath-${t})`:void 0,points:r,type:l,layout:u,connectNulls:d,strokeDasharray:m??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:o,isEntrance:i.animateNewValues?s:!1,visibleLength:c});return W.createElement(W.Fragment,null,r?.length>1&&W.createElement(le,{option:p,DefaultShape:Q.shape,shapeProps:g}),W.createElement(yt,{points:r,clipPathId:t,props:i}))}function St(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,o=n.isAnimationActive,s=n.animationBegin,c=n.animationDuration,l=n.animationEasing,u=n.animationMatchBy,d=n.animationInterpolateFn,f=n.layout,p=ht(r.current),m=A(n.onAnimationStart,n.onAnimationEnd),h=m.isAnimating,g=m.handleAnimationStart,_=m.handleAnimationEnd,y=!h,b=Ke(a),x=(0,W.useCallback)(e=>e>0&&p>0,[p]);return W.createElement(bt,{points:a,showLabels:y},n.children,W.createElement(ve,{animationInput:a,animationIdPrefix:`recharts-line-`,items:a,previousItemsRef:i,isAnimationActive:o,animationBegin:s,animationDuration:c,animationEasing:l,onAnimationStart:g,onAnimationEnd:_,animationInterpolateFn:d,animationMatchBy:u,shouldUpdatePreviousRef:x,layout:f},(e,i,a)=>{var o=h||i<1,s=o?b(i,p):null;return W.createElement(xt,{props:n,points:e,clipPathId:t,pathRef:r,animationElapsedTime:i,isAnimating:o,isEntrance:a,visibleLength:s})}),W.createElement(v,{label:n.label}))}function Ct(e){var t=e.clipPathId,n=e.props,r=(0,W.useRef)(null),i=(0,W.useRef)(null);return W.createElement(St,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var wt=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:S(e.payload,t)}),Tt=class extends W.Component{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.xAxisId,o=e.yAxisId,s=e.top,d=e.left,f=e.width,p=e.height,m=e.id,h=e.needClip,g=e.zIndex;if(t)return null;var _=c(`recharts-line`,i),v=m,y=N(n),b=y.r,x=y.strokeWidth,S=l(n),C=b*2+x,w=h?`url(#clipPath-${S?``:`dots-`}${v})`:void 0;return W.createElement(H,{zIndex:g},W.createElement(u,{className:_},h&&W.createElement(`defs`,null,W.createElement(pe,{clipPathId:v,xAxisId:a,yAxisId:o}),!S&&W.createElement(`clipPath`,{id:`clipPath-dots-${v}`},W.createElement(`rect`,{x:d-C/2,y:s-C/2,width:f+C,height:p+C}))),W.createElement(Ze,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:wt,errorBarOffset:0},W.createElement(Ct,{props:this.props,clipPathId:v}))),W.createElement(oe,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:w}))}};function Et(e){var t=I(e,Q),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.connectNulls,c=t.dot,l=t.hide,u=t.isAnimationActive,d=t.label,f=t.legendType,p=t.xAxisId,m=t.yAxisId,g=t.id,_=X(t,lt),v=ge(p,m).needClip,y=ie(),b=ee(),x=h(),S=U(e=>ot(e,p,m,x,g));if(b!==`horizontal`&&b!==`vertical`||S==null||y==null)return null;var C=y.height,w=y.width,T=y.x,E=y.y;return W.createElement(Tt,Y({},_,{id:g,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:f,xAxisId:p,yAxisId:m,points:S,layout:b,height:C,width:w,left:T,top:E,needClip:v}))}function Dt(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,s=e.bandSize;return e.displayedData.map((e,c)=>{var l=S(e,o);if(t===`horizontal`)return{x:R({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(V(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=V(l)?null:n.scale.map(l),d=R({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function Ot(e){var t=I(e,Q),n=h();return W.createElement(d,{id:t.id,type:`line`},e=>W.createElement(W.Fragment,null,W.createElement(p,{legendPayload:_t(t)}),W.createElement(vt,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),W.createElement(k,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),W.createElement(Et,Y({},t,{id:e}))))}var kt=W.memo(Ot,ae);kt.displayName=`Line`;var At=[`axis`],jt=(0,W.forwardRef)((e,t)=>W.createElement(_e,{chartName:`ComposedChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:At,tooltipPayloadSearcher:g,categoricalChartProps:e,ref:t})),Mt={metric:24,title:18,section:15,body:13,xs:12,caption:12},$=r();function Nt(e,t,n){let r=new Date(e);return Number.isFinite(r.getTime())?new Intl.DateTimeFormat(n===`zh`?`zh-CN`:`en-US`,t?{month:`short`,day:`numeric`}:{hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(r):``}function Pt(e){if(e<=1)return 1;let t=10**Math.floor(Math.log10(e)),n=e/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t}function Ft(e){let t=Math.max(0,e.ok??e.requests-e.error),n=Math.min(Math.max(0,e.requests-t),Math.max(0,e.requests));return{...e,okCount:t,errorCount:n,inputTokens:e.prompt_tokens??0,outputTokens:e.completion_tokens??0,cacheTokens:e.cache_read_tokens??0,p50:e.latency_p50_ms??null,p95:e.latency_p95_ms??null}}function It({active:e,payload:t,daily:n,lang:r,specs:i,format:a,totalLabel:o,total:s}){if(!e||!t?.[0])return null;let c=t[0].payload;return(0,$.jsxs)(`div`,{className:`rounded-xl bg-overlay px-3 py-2 text-caption text-overlay-foreground shadow-overlay`,children:[(0,$.jsx)(`div`,{className:`mono text-muted`,children:Nt(c.at,n,r)}),(0,$.jsxs)(`div`,{className:`mt-1.5 grid gap-1`,children:[i.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-6`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{background:e.color}}),e.label]}),(0,$.jsx)(`span`,{className:`mono font-medium`,children:a(c[e.key])})]},String(e.key))),s&&o?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-6 pt-1`,children:[(0,$.jsx)(`span`,{className:`text-muted`,children:o}),(0,$.jsx)(`span`,{className:`mono font-medium`,children:a(s(c))})]}):null]})]})}function Lt({series:e,lang:t,emptyLabel:r,okLabel:c,errorLabel:l,onSelectRange:u,selectHint:d,labels:f,initialMetric:p=`requests`}){let[m,h]=(0,W.useState)(p),[g,_]=(0,W.useState)(null),[v,y]=(0,W.useState)(null),b=(0,W.useRef)(!1),x=(0,W.useRef)(null),S=(0,W.useMemo)(()=>e.map(Ft),[e]),C=S[0],w=S[S.length-1],T=(C&&w?Date.parse(w.at)-Date.parse(C.at):0)>1728e5,E=f??{requests:`Requests`,tokens:`Tokens`,latency:`p95 latency`,input:`input`,output:`output`,cacheRead:`cache read`,p50:`p50`,p95:`p95`,total:`total`},D=m===`tokens`?[{key:`inputTokens`,label:E.input,color:`var(--foreground)`,area:!0,width:1.5,opacity:.75},{key:`outputTokens`,label:E.output,color:`var(--success)`,area:!0,width:1.5},{key:`cacheTokens`,label:E.cacheRead,color:`var(--muted)`,width:1.25,opacity:.8}]:m===`latency`?[{key:`p95`,label:E.p95,color:`var(--warning)`,area:!0,width:1.75},{key:`p50`,label:E.p50,color:`var(--muted)`,width:1.25,opacity:.85}]:[{key:`okCount`,label:c,color:`var(--success)`,area:!0,width:1.75},{key:`errorCount`,label:l,color:`var(--danger)`,area:!0,width:1.25,opacity:.7}],O=e=>e==null?`—`:m===`latency`?a(e):n(e),k=m===`requests`?e=>e.requests:m===`tokens`?e=>e.inputTokens+e.outputTokens:void 0,A=S.flatMap(e=>D.map(t=>Number(e[t.key]??0))),j=m===`requests`?Math.max(0,...S.map(e=>e.requests)):Math.max(0,...A),M=Pt(j),N=S.some(e=>e.requests>0),P=S.map(e=>`${e.at}:${e.requests}:${e.error}`).join(`|`);(0,W.useLayoutEffect)(()=>{let e=x.current;if(!e||!N||b.current)return;let t=!1,n=null,r=o.context(()=>{let r=o.matchMedia(),i=()=>{let t=o.utils.toArray(`.recharts-area-area`,e),n=o.utils.toArray(`.recharts-line-curve`,e);return!t.length&&!n.length?!1:(r.add(`(prefers-reduced-motion: reduce)`,()=>{o.set(n,{clearProps:`strokeDashoffset,strokeDasharray`}),o.set(t,{clearProps:`autoAlpha`})}),r.add(`(prefers-reduced-motion: no-preference)`,()=>{o.fromTo(t,{autoAlpha:0},{autoAlpha:1,duration:.45,ease:`power2.out`,stagger:.05}),n.forEach((e,t)=>{let n=e.getTotalLength();o.fromTo(e,{strokeDasharray:n,strokeDashoffset:n},{strokeDashoffset:0,duration:.7,delay:t*.05,ease:`power2.out`})})}),!0)};if(i()){t=!0,b.current=!0;return}n=new MutationObserver(()=>{t||i()&&(t=!0,b.current=!0,n?.disconnect())}),n.observe(e,{childList:!0,subtree:!0})},e);return()=>{n?.disconnect(),r.revert()}},[N,P]);let ee=S.length>1?Date.parse(S[1].at)-Date.parse(S[0].at):36e5,te=()=>{if(g&&v&&u){let e=Date.parse(g),t=Date.parse(v);if(Number.isFinite(e)&&Number.isFinite(t)){let n=Math.min(e,t),r=Math.max(e,t)+ee;u(new Date(n).toISOString(),new Date(r).toISOString())}}_(null),y(null)},F=e=>{let t=e?.activeLabel;return t==null?null:String(t)};return!e.length||!N?(0,$.jsx)(i,{emptyLabel:r}):(0,$.jsxs)(`div`,{ref:x,className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`mb-3 flex justify-end`,children:(0,$.jsx)(s,{value:m,onChange:e=>h(e),ariaLabel:E.requests,options:[{id:`requests`,label:E.requests},{id:`tokens`,label:E.tokens},{id:`latency`,label:E.latency}]})}),(0,$.jsx)(`div`,{className:`h-56 w-full`,children:(0,$.jsx)(be,{width:`100%`,height:`100%`,children:(0,$.jsxs)(jt,{data:S,margin:{top:8,right:8,bottom:0,left:0},style:u?{cursor:`crosshair`,userSelect:`none`}:void 0,onMouseDown:u?e=>{let t=F(e);t&&(_(t),y(t))}:void 0,onMouseMove:u?e=>{if(!g)return;let t=F(e);t&&y(t)}:void 0,onMouseUp:u?te:void 0,onMouseLeave:u?()=>{_(null),y(null)}:void 0,children:[(0,$.jsx)(`defs`,{children:D.filter(e=>e.area).map(e=>(0,$.jsxs)(`linearGradient`,{id:`traffic-fill-${String(e.key)}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,$.jsx)(`stop`,{offset:`0%`,stopColor:e.color,stopOpacity:.22}),(0,$.jsx)(`stop`,{offset:`100%`,stopColor:e.color,stopOpacity:.02})]},String(e.key)))}),(0,$.jsx)(Ce,{vertical:!1,stroke:`var(--separator)`,strokeDasharray:`3 6`}),(0,$.jsx)(Te,{dataKey:`at`,tickLine:!1,axisLine:!1,minTickGap:28,tick:{fill:`var(--muted)`,fontSize:Mt.caption,fontFamily:`var(--font-mono)`},tickFormatter:e=>Nt(e,T,t)}),(0,$.jsx)(de,{width:m===`latency`?44:36,domain:[0,M],tickLine:!1,axisLine:!1,allowDecimals:!1,tick:{fill:`var(--muted)`,fontSize:Mt.caption,fontFamily:`var(--font-mono)`},tickFormatter:e=>m===`latency`?a(e):n(e)}),(0,$.jsx)(we,{cursor:{stroke:`var(--border)`,strokeDasharray:`3 3`},content:(0,$.jsx)(It,{daily:T,lang:t,specs:D,format:O,totalLabel:E.total,total:k})}),D.filter(e=>e.area).map(e=>(0,$.jsx)(se,{type:`monotone`,dataKey:e.key,stroke:`none`,fill:`url(#traffic-fill-${String(e.key)})`,isAnimationActive:!1,activeDot:!1,dot:!1,connectNulls:!0},`area-${String(e.key)}`)),D.map(e=>(0,$.jsx)(kt,{type:`monotone`,dataKey:e.key,stroke:e.color,strokeWidth:e.width??1.5,strokeOpacity:e.opacity??1,dot:!1,isAnimationActive:!1,connectNulls:!0,activeDot:{r:4,fill:`var(--surface)`,stroke:e.color,strokeWidth:1.5}},`line-${String(e.key)}`)),g&&v?(0,$.jsx)(Fe,{x1:g,x2:v,fill:`var(--foreground)`,fillOpacity:.06,stroke:`none`,ifOverflow:`visible`}):null]})})}),(0,$.jsxs)(`div`,{className:`mt-2 flex min-h-5 items-center justify-between gap-3 text-caption text-muted`,children:[(0,$.jsx)(`div`,{className:`flex items-center gap-3`,children:D.map(e=>(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{background:e.color}}),e.label]},String(e.key)))}),(0,$.jsxs)(`span`,{className:`flex items-center gap-3`,children:[u&&d?(0,$.jsx)(`span`,{children:d}):null,(0,$.jsxs)(`span`,{className:`mono`,children:[O(j),` peak`]})]})]})]})}export{Lt as TrafficChart}; \ No newline at end of file +import{f as e,h as t,i as n,l as r,n as i,o as a,s as o,t as s,u as c}from"./index-A4ivp0An.js";import{A as l,An as u,C as d,Cn as f,D as p,E as m,Et as h,L as g,Lt as _,M as v,Mn as y,Mt as b,N as x,Nt as S,O as C,Ot as w,P as T,Pt as E,Q as D,Rt as O,S as k,T as A,Z as j,_t as M,a as N,bn as P,bt as ee,ct as te,d as F,et as ne,f as re,g as ie,gt as ae,h as oe,hn as I,i as se,j as ce,jn as L,k as le,kt as R,m as ue,n as de,nt as fe,o as pe,p as me,pt as he,s as ge,st as z,t as _e,vn as B,w as ve,wn as ye,wt as be,x as xe,yn as V,z as H,zt as U}from"./CartesianChart-BkZGKHVn.js";import{i as Se,n as Ce,r as we,t as Te}from"./XAxis-BeXdNyw4.js";var Ee=class{constructor(e){var t=e.x,n=e.y;this.xAxisScale=t,this.yAxisScale=n}map(e,t){var n=t.position;return{x:this.xAxisScale.map(e.x,{position:n})??0,y:this.yAxisScale.map(e.y,{position:n})??0}}mapWithFallback(e,t){var n=t.position,r=t.fallback,i=r===`rangeMin`?this.yAxisScale.rangeMin():r===`rangeMax`?this.yAxisScale.rangeMax():0,a=r===`rangeMin`?this.xAxisScale.rangeMin():r===`rangeMax`?this.xAxisScale.rangeMax():0;return{x:this.xAxisScale.map(e.x,{position:n})??a,y:this.yAxisScale.map(e.y,{position:n})??i}}isInRange(e){var t=e.x,n=e.y,r=t==null||this.xAxisScale.isInRange(t),i=n==null||this.yAxisScale.isInRange(n);return r&&i}},W=t(e());function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t{var s=o.x1,c=o.x2,l=o.y1,u=o.y2;if(i==null||a==null)return null;var d=new Ee({x:i,y:a}),f={x:e?i.map(s,{position:`start`})??null:i.rangeMin(),y:n?a.map(l,{position:`start`})??null:a.rangeMin()},p={x:t?i.map(c,{position:`end`})??null:i.rangeMax(),y:r?a.map(u,{position:`end`})??null:a.rangeMax()};return o.ifOverflow===`discard`&&(!d.isInRange(f)||!d.isInRange(p))?null:ue(f,p)},je=(e,t)=>W.isValidElement(e)?W.cloneElement(e,t):typeof e==`function`?e(t):W.createElement(Se,q({},t,{className:`recharts-reference-area-rect`}));function Me(e){var t=O();return(0,W.useEffect)(()=>(t(re(e)),()=>{t(me(e))})),null}function Ne(e){var t=e.x1,n=e.x2,r=e.y1,i=e.y2,a=e.className,o=e.shape,s=e.xAxisId,l=e.yAxisId,d=F(),f=h(),p=U(e=>j(e,`xAxis`,s,f)),m=U(e=>j(e,`yAxis`,l,f));if(p==null||m==null)return null;var g=P(t),_=P(n),v=P(r),y=P(i);if(!g&&!_&&!v&&!y&&!o)return null;var b=Ae(g,_,v,y,p,m,e);if(!b&&!o)return null;var S=e.ifOverflow===`hidden`?`url(#${d})`:void 0;return W.createElement(H,{zIndex:e.zIndex},W.createElement(u,{className:c(`recharts-reference-area`,a)},je(o,K(K({clipPath:S},L(e)),b)),b!=null&&W.createElement(x,q({},b,{lowerWidth:b.width,upperWidth:b.width}),W.createElement(T,{label:e.label}),e.children)))}var Pe={ifOverflow:`discard`,xAxisId:0,yAxisId:0,radius:0,fill:`#ccc`,label:!1,fillOpacity:.5,stroke:`none`,strokeWidth:1,zIndex:z.area};function Fe(e){var t=I(e,Pe);return W.createElement(W.Fragment,null,W.createElement(Me,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2}),W.createElement(Ne,t))}Fe.displayName=`ReferenceArea`;var Ie=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`visibleLength`,`strokeDasharray`,`connectNulls`];function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;te+t,0);if(!i)return Be(t,e);for(var a=Math.floor(e/i),o=e%i,s=[],c=0,l=0;co){s=[...r.slice(0,c),o-l];break}}var f=s.length%2==0?[0,t]:[t];return[...He(r,a),...s,...f].map(e=>`${e}px`).join(`, `)}function We(e,t,n){return e?Ue(n,t,`${e}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):Be(t,n)}function Ge(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=Le(e,Ie),a=r??!1,o;if(t!=null){var s=i.pathRef;o=We(n,ze(s?.current??null),t)}else n!=null&&(o=String(n));return W.createElement(he,J({},i,{connectNulls:a,strokeDasharray:o}))}function Ke(e){var t=(0,W.useRef)(0),n=(0,W.useRef)(0),r=(0,W.useRef)(!1),i=(0,W.useRef)(e);return i.current!==e&&(t.current=n.current,i.current=e),(0,W.useCallback)((e,i)=>{if(r.current)return null;var a=Math.min(ye(t.current+e*i),i);return e>0&&i>0&&(n.current=Math.max(n.current,a),a>=i)?(r.current=!0,null):a},[])}var qe=[`children`];function Je(e,t){if(e==null)return{};var n,r,i=Ye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r({x:0,y:0,value:0}),errorBarOffset:0});function Ze(e){var t=e.children,n=Je(e,qe);return W.createElement(Xe.Provider,{value:n},t)}var Qe=(e,t,n,r)=>D(e,`xAxis`,t,r),$e=(e,t,n,r)=>ne(e,`xAxis`,t,r),et=(e,t,n,r)=>D(e,`yAxis`,n,r),tt=(e,t,n,r)=>ne(e,`yAxis`,n,r),nt=_([M,Qe,et,$e,tt],(e,t,n,r,i)=>E(e,`xAxis`)?w(t,r,!1):w(n,i,!1)),rt=(e,t,n,r,i)=>i;function it(e){return e.type===`line`}var at=_([fe,rt],(e,t)=>e.filter(it).find(e=>e.id===t)),ot=_([M,Qe,et,$e,tt,at,nt,te],(e,t,n,r,i,a,o,s)=>{var c=s.chartData,l=s.dataStartIndex,u=s.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var d=a.dataKey,f=a.data,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return Dt({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}}),st=[`id`],ct=[`type`,`layout`,`connectNulls`,`needClip`,`shape`,`strokeDasharray`],lt=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?t/n:0}var Q={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationInterpolateFn:(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(e=>e.status===`removed`?[]:[e.next]);var n=gt(e),r=[];for(var i of e)if(i.status===`matched`)r.push(Z(Z({},i.next),{},{x:B(i.prev.x,i.next.x,t),y:B(i.prev.y,i.next.y,t)}));else if(i.status===`added`){if(i.next.x!=null){var a=i.next.x-n;r.push(Z(Z({},i.next),{},{x:B(a,i.next.x,t),y:i.next.y}))}else r.push(i.next)}else if(i.status===`removed`&&i.prev.x!=null){var o=i.prev.x+n;r.push(Z(Z({},i.prev),{},{x:B(i.prev.x,o,t),y:i.prev.y}))}return r},animationMatchBy:m,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,shape:Ge,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:z.line,type:`linear`},_t=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType;return[{inactive:e.hide,dataKey:t,type:i,color:r,value:b(n,t),payload:e}]},vt=W.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,p={dataDefinedOnItem:n,getPosition:f,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:b(o,t),hide:s,type:u,color:r,unit:c,formatter:l,graphicalItemId:d}};return W.createElement(C,{tooltipEntrySettings:p})});function yt(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,o=r.needClip;r.id;var s=X(r,st),c=y(s);return W.createElement(xe,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:c,needClip:o,clipPathId:t})}function bt(e){var t=e.showLabels,n=e.children,r=e.points,i=(0,W.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return Z(Z({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return W.createElement(ce,{value:t?i:void 0},n)}function xt(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,o=e.isAnimating,s=e.isEntrance,c=e.visibleLength,l=i.type,u=i.layout,d=i.connectNulls,f=i.needClip,p=i.shape,m=i.strokeDasharray,h=X(i,ct),g=Z(Z({},L(h)),{},{fill:`none`,className:`recharts-line-curve`,clipPath:f?`url(#clipPath-${t})`:void 0,points:r,type:l,layout:u,connectNulls:d,strokeDasharray:m??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:o,isEntrance:i.animateNewValues?s:!1,visibleLength:c});return W.createElement(W.Fragment,null,r?.length>1&&W.createElement(le,{option:p,DefaultShape:Q.shape,shapeProps:g}),W.createElement(yt,{points:r,clipPathId:t,props:i}))}function St(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,o=n.isAnimationActive,s=n.animationBegin,c=n.animationDuration,l=n.animationEasing,u=n.animationMatchBy,d=n.animationInterpolateFn,f=n.layout,p=ht(r.current),m=A(n.onAnimationStart,n.onAnimationEnd),h=m.isAnimating,g=m.handleAnimationStart,_=m.handleAnimationEnd,y=!h,b=Ke(a),x=(0,W.useCallback)(e=>e>0&&p>0,[p]);return W.createElement(bt,{points:a,showLabels:y},n.children,W.createElement(ve,{animationInput:a,animationIdPrefix:`recharts-line-`,items:a,previousItemsRef:i,isAnimationActive:o,animationBegin:s,animationDuration:c,animationEasing:l,onAnimationStart:g,onAnimationEnd:_,animationInterpolateFn:d,animationMatchBy:u,shouldUpdatePreviousRef:x,layout:f},(e,i,a)=>{var o=h||i<1,s=o?b(i,p):null;return W.createElement(xt,{props:n,points:e,clipPathId:t,pathRef:r,animationElapsedTime:i,isAnimating:o,isEntrance:a,visibleLength:s})}),W.createElement(v,{label:n.label}))}function Ct(e){var t=e.clipPathId,n=e.props,r=(0,W.useRef)(null),i=(0,W.useRef)(null);return W.createElement(St,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var wt=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:S(e.payload,t)}),Tt=class extends W.Component{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.xAxisId,o=e.yAxisId,s=e.top,d=e.left,f=e.width,p=e.height,m=e.id,h=e.needClip,g=e.zIndex;if(t)return null;var _=c(`recharts-line`,i),v=m,y=N(n),b=y.r,x=y.strokeWidth,S=l(n),C=b*2+x,w=h?`url(#clipPath-${S?``:`dots-`}${v})`:void 0;return W.createElement(H,{zIndex:g},W.createElement(u,{className:_},h&&W.createElement(`defs`,null,W.createElement(pe,{clipPathId:v,xAxisId:a,yAxisId:o}),!S&&W.createElement(`clipPath`,{id:`clipPath-dots-${v}`},W.createElement(`rect`,{x:d-C/2,y:s-C/2,width:f+C,height:p+C}))),W.createElement(Ze,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:wt,errorBarOffset:0},W.createElement(Ct,{props:this.props,clipPathId:v}))),W.createElement(oe,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:w}))}};function Et(e){var t=I(e,Q),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.connectNulls,c=t.dot,l=t.hide,u=t.isAnimationActive,d=t.label,f=t.legendType,p=t.xAxisId,m=t.yAxisId,g=t.id,_=X(t,lt),v=ge(p,m).needClip,y=ie(),b=ee(),x=h(),S=U(e=>ot(e,p,m,x,g));if(b!==`horizontal`&&b!==`vertical`||S==null||y==null)return null;var C=y.height,w=y.width,T=y.x,E=y.y;return W.createElement(Tt,Y({},_,{id:g,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:f,xAxisId:p,yAxisId:m,points:S,layout:b,height:C,width:w,left:T,top:E,needClip:v}))}function Dt(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,s=e.bandSize;return e.displayedData.map((e,c)=>{var l=S(e,o);if(t===`horizontal`)return{x:R({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(V(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=V(l)?null:n.scale.map(l),d=R({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function Ot(e){var t=I(e,Q),n=h();return W.createElement(d,{id:t.id,type:`line`},e=>W.createElement(W.Fragment,null,W.createElement(p,{legendPayload:_t(t)}),W.createElement(vt,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),W.createElement(k,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),W.createElement(Et,Y({},t,{id:e}))))}var kt=W.memo(Ot,ae);kt.displayName=`Line`;var At=[`axis`],jt=(0,W.forwardRef)((e,t)=>W.createElement(_e,{chartName:`ComposedChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:At,tooltipPayloadSearcher:g,categoricalChartProps:e,ref:t})),Mt={metric:24,title:18,section:15,body:13,xs:12,caption:12},$=r();function Nt(e,t,n){let r=new Date(e);return Number.isFinite(r.getTime())?new Intl.DateTimeFormat(n===`zh`?`zh-CN`:`en-US`,t?{month:`short`,day:`numeric`}:{hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(r):``}function Pt(e){if(e<=1)return 1;let t=10**Math.floor(Math.log10(e)),n=e/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t}function Ft(e){let t=Math.max(0,e.ok??e.requests-e.error),n=Math.min(Math.max(0,e.requests-t),Math.max(0,e.requests));return{...e,okCount:t,errorCount:n,inputTokens:e.prompt_tokens??0,outputTokens:e.completion_tokens??0,cacheTokens:e.cache_read_tokens??0,p50:e.latency_p50_ms??null,p95:e.latency_p95_ms??null}}function It({active:e,payload:t,daily:n,lang:r,specs:i,format:a,totalLabel:o,total:s}){if(!e||!t?.[0])return null;let c=t[0].payload;return(0,$.jsxs)(`div`,{className:`rounded-xl bg-overlay px-3 py-2 text-caption text-overlay-foreground shadow-overlay`,children:[(0,$.jsx)(`div`,{className:`mono text-muted`,children:Nt(c.at,n,r)}),(0,$.jsxs)(`div`,{className:`mt-1.5 grid gap-1`,children:[i.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-6`,children:[(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{background:e.color}}),e.label]}),(0,$.jsx)(`span`,{className:`mono font-medium`,children:a(c[e.key])})]},String(e.key))),s&&o?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-6 pt-1`,children:[(0,$.jsx)(`span`,{className:`text-muted`,children:o}),(0,$.jsx)(`span`,{className:`mono font-medium`,children:a(s(c))})]}):null]})]})}function Lt({series:e,lang:t,emptyLabel:r,okLabel:c,errorLabel:l,onSelectRange:u,selectHint:d,labels:f,initialMetric:p=`requests`}){let[m,h]=(0,W.useState)(p),[g,_]=(0,W.useState)(null),[v,y]=(0,W.useState)(null),b=(0,W.useRef)(!1),x=(0,W.useRef)(null),S=(0,W.useMemo)(()=>e.map(Ft),[e]),C=S[0],w=S[S.length-1],T=(C&&w?Date.parse(w.at)-Date.parse(C.at):0)>1728e5,E=f??{requests:`Requests`,tokens:`Tokens`,latency:`p95 latency`,input:`input`,output:`output`,cacheRead:`cache read`,p50:`p50`,p95:`p95`,total:`total`},D=m===`tokens`?[{key:`inputTokens`,label:E.input,color:`var(--foreground)`,area:!0,width:1.5,opacity:.75},{key:`outputTokens`,label:E.output,color:`var(--success)`,area:!0,width:1.5},{key:`cacheTokens`,label:E.cacheRead,color:`var(--muted)`,width:1.25,opacity:.8}]:m===`latency`?[{key:`p95`,label:E.p95,color:`var(--warning)`,area:!0,width:1.75},{key:`p50`,label:E.p50,color:`var(--muted)`,width:1.25,opacity:.85}]:[{key:`okCount`,label:c,color:`var(--success)`,area:!0,width:1.75},{key:`errorCount`,label:l,color:`var(--danger)`,area:!0,width:1.25,opacity:.7}],O=e=>e==null?`—`:m===`latency`?a(e):n(e),k=m===`requests`?e=>e.requests:m===`tokens`?e=>e.inputTokens+e.outputTokens:void 0,A=S.flatMap(e=>D.map(t=>Number(e[t.key]??0))),j=m===`requests`?Math.max(0,...S.map(e=>e.requests)):Math.max(0,...A),M=Pt(j),N=S.some(e=>e.requests>0),P=S.map(e=>`${e.at}:${e.requests}:${e.error}`).join(`|`);(0,W.useLayoutEffect)(()=>{let e=x.current;if(!e||!N||b.current)return;let t=!1,n=null,r=o.context(()=>{let r=o.matchMedia(),i=()=>{let t=o.utils.toArray(`.recharts-area-area`,e),n=o.utils.toArray(`.recharts-line-curve`,e);return!t.length&&!n.length?!1:(r.add(`(prefers-reduced-motion: reduce)`,()=>{o.set(n,{clearProps:`strokeDashoffset,strokeDasharray`}),o.set(t,{clearProps:`autoAlpha`})}),r.add(`(prefers-reduced-motion: no-preference)`,()=>{o.fromTo(t,{autoAlpha:0},{autoAlpha:1,duration:.45,ease:`power2.out`,stagger:.05}),n.forEach((e,t)=>{let n=e.getTotalLength();o.fromTo(e,{strokeDasharray:n,strokeDashoffset:n},{strokeDashoffset:0,duration:.7,delay:t*.05,ease:`power2.out`})})}),!0)};if(i()){t=!0,b.current=!0;return}n=new MutationObserver(()=>{t||i()&&(t=!0,b.current=!0,n?.disconnect())}),n.observe(e,{childList:!0,subtree:!0})},e);return()=>{n?.disconnect(),r.revert()}},[N,P]);let ee=S.length>1?Date.parse(S[1].at)-Date.parse(S[0].at):36e5,te=()=>{if(g&&v&&u){let e=Date.parse(g),t=Date.parse(v);if(Number.isFinite(e)&&Number.isFinite(t)){let n=Math.min(e,t),r=Math.max(e,t)+ee;u(new Date(n).toISOString(),new Date(r).toISOString())}}_(null),y(null)},F=e=>{let t=e?.activeLabel;return t==null?null:String(t)};return!e.length||!N?(0,$.jsx)(i,{emptyLabel:r}):(0,$.jsxs)(`div`,{ref:x,className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`mb-3 flex justify-end`,children:(0,$.jsx)(s,{value:m,onChange:e=>h(e),ariaLabel:E.requests,options:[{id:`requests`,label:E.requests},{id:`tokens`,label:E.tokens},{id:`latency`,label:E.latency}]})}),(0,$.jsx)(`div`,{className:`h-56 w-full`,children:(0,$.jsx)(be,{width:`100%`,height:`100%`,children:(0,$.jsxs)(jt,{data:S,margin:{top:8,right:8,bottom:0,left:0},style:u?{cursor:`crosshair`,userSelect:`none`}:void 0,onMouseDown:u?e=>{let t=F(e);t&&(_(t),y(t))}:void 0,onMouseMove:u?e=>{if(!g)return;let t=F(e);t&&y(t)}:void 0,onMouseUp:u?te:void 0,onMouseLeave:u?()=>{_(null),y(null)}:void 0,children:[(0,$.jsx)(`defs`,{children:D.filter(e=>e.area).map(e=>(0,$.jsxs)(`linearGradient`,{id:`traffic-fill-${String(e.key)}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,$.jsx)(`stop`,{offset:`0%`,stopColor:e.color,stopOpacity:.22}),(0,$.jsx)(`stop`,{offset:`100%`,stopColor:e.color,stopOpacity:.02})]},String(e.key)))}),(0,$.jsx)(Ce,{vertical:!1,stroke:`var(--separator)`,strokeDasharray:`3 6`}),(0,$.jsx)(Te,{dataKey:`at`,tickLine:!1,axisLine:!1,minTickGap:28,tick:{fill:`var(--muted)`,fontSize:Mt.caption,fontFamily:`var(--font-mono)`},tickFormatter:e=>Nt(e,T,t)}),(0,$.jsx)(de,{width:m===`latency`?44:36,domain:[0,M],tickLine:!1,axisLine:!1,allowDecimals:!1,tick:{fill:`var(--muted)`,fontSize:Mt.caption,fontFamily:`var(--font-mono)`},tickFormatter:e=>m===`latency`?a(e):n(e)}),(0,$.jsx)(we,{cursor:{stroke:`var(--border)`,strokeDasharray:`3 3`},content:(0,$.jsx)(It,{daily:T,lang:t,specs:D,format:O,totalLabel:E.total,total:k})}),D.filter(e=>e.area).map(e=>(0,$.jsx)(se,{type:`monotone`,dataKey:e.key,stroke:`none`,fill:`url(#traffic-fill-${String(e.key)})`,isAnimationActive:!1,activeDot:!1,dot:!1,connectNulls:!0},`area-${String(e.key)}`)),D.map(e=>(0,$.jsx)(kt,{type:`monotone`,dataKey:e.key,stroke:e.color,strokeWidth:e.width??1.5,strokeOpacity:e.opacity??1,dot:!1,isAnimationActive:!1,connectNulls:!0,activeDot:{r:4,fill:`var(--surface)`,stroke:e.color,strokeWidth:1.5}},`line-${String(e.key)}`)),g&&v?(0,$.jsx)(Fe,{x1:g,x2:v,fill:`var(--foreground)`,fillOpacity:.06,stroke:`none`,ifOverflow:`visible`}):null]})})}),(0,$.jsxs)(`div`,{className:`mt-2 flex min-h-5 items-center justify-between gap-3 text-caption text-muted`,children:[(0,$.jsx)(`div`,{className:`flex items-center gap-3`,children:D.map(e=>(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{background:e.color}}),e.label]},String(e.key)))}),(0,$.jsxs)(`span`,{className:`flex items-center gap-3`,children:[u&&d?(0,$.jsx)(`span`,{children:d}):null,(0,$.jsxs)(`span`,{className:`mono`,children:[O(j),` peak`]})]})]})]})}export{Lt as TrafficChart}; \ No newline at end of file diff --git a/internal/webui/static/assets/XAxis-C10B4cAr.js b/internal/webui/static/assets/XAxis-BeXdNyw4.js similarity index 99% rename from internal/webui/static/assets/XAxis-C10B4cAr.js rename to internal/webui/static/assets/XAxis-BeXdNyw4.js index 9eafe1b4..2e525e75 100644 --- a/internal/webui/static/assets/XAxis-C10B4cAr.js +++ b/internal/webui/static/assets/XAxis-BeXdNyw4.js @@ -1,4 +1,4 @@ -import{d as e,f as t,h as n,u as r}from"./index--8Ifgwr4.js";import{$ as i,$t as a,At as o,B as s,Bt as c,Ct as l,Dn as u,Dt as d,En as f,Et as p,F as m,Ft as h,G as g,Gt as _,H as v,Ht as y,I as b,It as x,J as S,Jt as C,K as w,Kt as T,Mn as E,Nn as D,On as O,Ot as k,Qt as A,R as ee,Rt as j,Sn as M,St as N,Tn as P,Tt as te,U as ne,Ut as re,V as ie,Vt as ae,W as oe,Wt as se,X as F,Xt as ce,Y as I,Yt as le,Zt as ue,_ as de,_n as L,an as fe,at as pe,b as me,bn as he,bt as ge,c as _e,cn as ve,dn as ye,dt as be,en as xe,fn as Se,ft as Ce,gn as we,hn as R,ht as Te,in as Ee,it as De,jn as Oe,jt as ke,kn as Ae,l as z,ln as je,lt as Me,mn as Ne,mt as Pe,nn as Fe,on as Ie,ot as Le,pn as Re,pt as ze,q as Be,qt as Ve,r as He,rn as Ue,rt as We,sn as Ge,st as B,tn as Ke,tt as qe,u as Je,un as Ye,ut as V,v as Xe,vn as Ze,vt as Qe,wn as H,xn as U,xt as $e,y as et,yn as tt,yt as nt,z as rt,zt as W}from"./CartesianChart-BtPJbdpG.js";function it(e,t){let n=new Map;for(let r=0;rvoid 0)}function mt(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return ht(e,t,n,r,i);case`function`:return Object.keys(t).length>0?mt(e,{...t},n,r,i):y(e,t);default:return ae(e)&&i?typeof t!=`string`||t===``:y(e,t)}}function ht(e,t,n,r,i=!1){if(t==null)return!0;if(Array.isArray(t))return _t(e,t,n,r);if(t instanceof Map)return gt(e,t,n,r);if(t instanceof Set)return vt(e,t,n,r);let a=Object.keys(t);if(e==null)return i&&a.length===0;if(i)ct(e)&&(e=Object(e));else{let t=Se(e);if(t!==`[object Object]`&&t!==`[object Arguments]`)return!1}if(a.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let i=0;ivoid 0)}function bt(e){return e=ft(e),t=>yt(t,e)}function xt(e,t){return ut(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(Se(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),K(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case Fe:case Ie:case Ve:{let t=new e.constructor(e?.valueOf());return K(t,e),t}case se:{let t={};return K(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function St(e){return xt(e)}function Ct(e){return typeof e==`object`&&!!e&&Se(e)===`[object Arguments]`}function wt(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&Ae(t)&&!(t in Object(e))?u(t):[t],n.length===0)return!1;let r=e;for(let e=0;evoid 0)}function mt(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return ht(e,t,n,r,i);case`function`:return Object.keys(t).length>0?mt(e,{...t},n,r,i):y(e,t);default:return ae(e)&&i?typeof t!=`string`||t===``:y(e,t)}}function ht(e,t,n,r,i=!1){if(t==null)return!0;if(Array.isArray(t))return _t(e,t,n,r);if(t instanceof Map)return gt(e,t,n,r);if(t instanceof Set)return vt(e,t,n,r);let a=Object.keys(t);if(e==null)return i&&a.length===0;if(i)ct(e)&&(e=Object(e));else{let t=Se(e);if(t!==`[object Object]`&&t!==`[object Arguments]`)return!1}if(a.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let i=0;ivoid 0)}function bt(e){return e=ft(e),t=>yt(t,e)}function xt(e,t){return ut(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(Se(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),K(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case Fe:case Ie:case Ve:{let t=new e.constructor(e?.valueOf());return K(t,e),t}case se:{let t={};return K(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function St(e){return xt(e)}function Ct(e){return typeof e==`object`&&!!e&&Se(e)===`[object Arguments]`}function wt(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&Ae(t)&&!(t in Object(e))?u(t):[t],n.length===0)return!1;let r=e;for(let e=0;ee.length)&&(t=e.length);for(var n=0,r=Array(t);nLt||Math.abs(e.left-t.left)>Lt||Math.abs(e.top-t.top)>Lt||Math.abs(e.width-t.width)>Lt}function zt(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function Bt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=jt((0,q.useState)({height:0,left:0,top:0,width:0}),2),n=t[0],r=t[1],i=(0,q.useRef)(null),a=(0,q.useRef)(n);a.current=n;var o=(0,q.useCallback)(e=>{if(i.current!=null&&(i.current.disconnect(),i.current=null),e!=null){var t=zt(e);if(Rt(t,a.current)&&r(t),typeof ResizeObserver<`u`){var n=new ResizeObserver(()=>{var t=zt(e);Rt(t,a.current)&&r(t)});n.observe(e),i.current=n}}},[...e]);return(0,q.useEffect)(()=>()=>{var e;(e=i.current)==null||e.disconnect()},[]),[n,o]}function Vt(){return Vt=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{var t=e.separator,n=t===void 0?J.separator:t,i=e.contentStyle,a=e.itemStyle,o=e.labelStyle,s=o===void 0?J.labelStyle:o,c=e.payload,l=e.formatter,u=e.itemSorter,d=e.wrapperClassName,f=e.labelClassName,p=e.label,m=e.labelFormatter,h=e.accessibilityLayer,g=h===void 0?J.accessibilityLayer:h,_=()=>{if(c&&c.length){var e={padding:0,margin:0},t=en(c,u).map((e,t)=>{if(!e||e.type===`none`)return null;var r=e.formatter||l||$t,i=e.value,o=e.name,s=i,u=o;if(r){var d=r(i,o,e,t,c);if(Array.isArray(d)){var f=qt(d,2);s=f[0],u=f[1]}else if(d!=null)s=d;else return null}var p=Ut(Ut({},J.itemStyle),{},{color:e.color||J.itemStyle.color},a);return q.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:p},he(u)?q.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,he(u)?q.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,q.createElement(`span`,{className:`recharts-tooltip-item-value`},s),q.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return q.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},v=Ut(Ut({},J.contentStyle),i),y=Ut({margin:0},s),b=!tt(p),x=b?p:``,S=r(`recharts-default-tooltip`,d),C=r(`recharts-tooltip-label`,f);b&&m&&c!=null&&(x=m(p,c));var w=g?{role:`status`,"aria-live":`assertive`}:{};return q.createElement(`div`,Vt({className:S,style:v},w),q.createElement(`p`,{className:C,style:y},q.isValidElement(x)?x:`${x}`),_())},nn=`recharts-tooltip-wrapper`,rn={visibility:`hidden`};function an(e){var t=e.coordinate,n=e.translateX,i=e.translateY;return r(nn,{[`${nn}-right`]:U(n)&&t&&U(t.x)&&n>=t.x,[`${nn}-left`]:U(n)&&t&&U(t.x)&&n=t.y,[`${nn}-top`]:U(i)&&t&&U(t.y)&&i0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?Math.max(uf+l?Math.max(u,f):Math.max(d,f)}function sn(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function cn(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,o=e.reverseDirection,s=e.tooltipBox,c=e.useTranslate3d,l=e.viewBox,u,d,f;return s&&s.height>0&&s.width>0&&n?(d=on({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=on({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=sn({translateX:d,translateY:f,useTranslate3d:c})):u=rn,{cssProperties:u,cssClasses:an({translateX:d,translateY:f,coordinate:n})}}function ln(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),2),r=n[0],i=n[1];q.useEffect(()=>{var t=t=>{t.key===`Escape`&&i({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),r.dismissed&&((e.coordinate?.x??0)!==r.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==r.dismissedAtCoordinate.y)&&i(Y(Y({},r),{},{dismissed:!1}));var a=cn({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:e.lastBoundingBox,useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=a.cssClasses,s=a.cssProperties,c=Y(Y({},e.hasPortalFromProps?{}:Y(Y({transition:yn({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},s),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!r.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return q.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:o,style:c,ref:e.innerRef},e.children)}var xn=q.memo(bn),Sn=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function Cn(){return Cn=Object.assign?Object.assign.bind():function(e){for(var t=1;t`M${e},${i}v${r}M${a},${t}h${n}`,Mn=e=>{var t=e.x,n=t===void 0?0:t,i=e.y,a=i===void 0?0:i,o=e.top,s=o===void 0?0:o,c=e.left,l=c===void 0?0:c,u=e.width,d=u===void 0?0:u,f=e.height,p=f===void 0?0:f,m=e.className,h=kn(e,Sn),g=Tn({x:n,y:a,top:s,left:l,width:d,height:p},h);return!U(n)||!U(a)||!U(d)||!U(p)||!U(s)||!U(l)?null:q.createElement(`path`,Cn({},Oe(g),{className:r(`recharts-cross`,m),d:jn(n,a,d,p,s,l)}))};function Nn(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}var Pn=e=>e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),Fn=(e,t,n)=>e.map(e=>`${Pn(e)} ${t}ms ${n}`).join(`,`),In=[`radius`],Ln=[`radius`],Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn;function Jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Yn(e){for(var t=1;ti.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LiveSparkline-CiMyj7tn.js","assets/CartesianChart-BkZGKHVn.js","assets/AreaChart-CpgbhahE.js","assets/TrafficChart-DKxQTayd.js","assets/XAxis-BeXdNyw4.js","assets/CostChart-5urt0nTO.js"])))=>i.map(i=>d[i]); var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1R||(e.current=te[R],te[R]=null,R--)}function ne(e,t){R++,te[R]=e.current,e.current=t}var re=z(null),ie=z(null),V=z(null),ae=z(null);function oe(e,t){switch(ne(V,t),ne(ie,e),ne(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jd(t),e=Yd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(re),ne(re,e)}function se(){B(re),B(ie),B(V)}function ce(e){e.memoizedState!==null&&ne(ae,e);var t=re.current,n=Yd(t,e.type);t!==n&&(ne(ie,e),ne(re,n))}function le(e){ie.current===e&&(B(re),B(ie)),ae.current===e&&(B(ae),ip._currentValue=L)}var ue,de;function fe(e){if(ue===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ue=t&&t[1]||``,de=-1)`:-1 to e)),this.defaultLocale=t}getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=J_(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(t){if(typeof window>`u`)return null;let n=window[W_];if(K_===void 0){let t=window[G_];if(!t)return null;K_={};for(let r in t)K_[r]=new e({[n]:t[r]},n)}let r=K_?.[t];if(!r)throw Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}};function J_(e,t,n=`en-US`){if(t[e])return t[e];let r=Y_(e),i=X_(e);if(i&&t[`${r}-${i}`])return t[`${r}-${i}`];if(t[r])return t[r];for(let e in t)if(e.startsWith(r+`-`))return t[e];return t[n]}function Y_(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}function X_(e){if(Intl.Locale)return new Intl.Locale(e).script}var Z_=new Map,Q_=new Map,$_=class{constructor(e,t){this.locale=e,this.strings=t}format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return typeof n==`function`?n(t,this):n}plural(e,t,n=`cardinal`){let r=t[`=`+e];if(r)return typeof r==`function`?r():r;let i=this.locale+`:`+n,a=Z_.get(i);return a||(a=new Intl.PluralRules(this.locale,{type:n}),Z_.set(i,a)),r=t[a.select(e)]||t.other,typeof r==`function`?r():r}number(e){let t=Q_.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),Q_.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return typeof n==`function`?n():n}},ev=new WeakMap;function tv(e){let t=ev.get(e);return t||(t=new q_(e),ev.set(e,t)),t}function nv(e,t){return t&&q_.getGlobalDictionaryForPackage(t)||tv(e)}function rv(e,t){let{locale:n}=rp(),r=nv(e,t);return(0,v.useMemo)(()=>new $_(n,r),[n,r])}var iv={border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`};function av(e={}){let{style:t,isFocusable:n}=e,[r,i]=(0,v.useState)(!1),{focusWithinProps:a}=qm({isDisabled:!n,onFocusWithinChange:e=>i(e)}),o=(0,v.useMemo)(()=>r?t:t?{...iv,...t}:iv,[r]);return{visuallyHiddenProps:{...a,style:o}}}function ov(e){let{children:t,elementType:n=`div`,isFocusable:r,style:i,...a}=e,{visuallyHiddenProps:o}=av(e);return v.createElement(n,U(a,o),t)}function sv(e){return e&&e.__esModule?e.default:e}function cv(e){let{onDismiss:t,...n}=e,r=Fs(n,rv(sv(U_),`@react-aria/overlays`).format(`dismiss`)),i=()=>{t&&t()};return v.createElement(ov,null,v.createElement(`button`,{...r,tabIndex:-1,onClick:i,style:{width:1,height:1}}))}var lv=v.forwardRef(({children:e,...t},n)=>{let r=(0,v.useRef)(!1),i=(0,v.useContext)(Mm),a=U(i||{},{...t,register(){r.current=!0,i&&i.register()}});return a.ref=Is(n||i?.ref),Us(i,a.ref),(0,v.useEffect)(()=>{r.current||=!0},[]),v.createElement(Mm.Provider,{value:a},e)});function uv({children:e}){let t=(0,v.useMemo)(()=>({register:()=>{}}),[]);return v.createElement(Mm.Provider,{value:t},e)}var dv=(0,v.createContext)({});function fv(){return(0,v.useContext)(dv)??{}}var pv=v.createContext(null);function mv(e){let t=Jo(),{portalContainer:n=t?null:document.body,isExiting:r}=e,[i,a]=(0,v.useState)(!1),o=(0,v.useMemo)(()=>({contain:i,setContain:a}),[i,a]),{getContainer:s}=fv();if(!e.portalContainer&&s&&(n=s()),!n)return null;let c=e.children;return e.disableFocusManagement||(c=v.createElement(Sg,{restoreFocus:!0,contain:(e.shouldContainFocus||i)&&!r},c)),c=v.createElement(pv.Provider,{value:o},v.createElement(uv,null,v.createElement(Cm.Provider,{value:null},c))),dc.createPortal(c,n)}function hv(){let e=(0,v.useContext)(pv)?.setContain;Io(()=>{e?.(!0)},[e])}function gv(e){let[t,n]=sh(e.isOpen,e.defaultOpen||!1,e.onOpenChange),[r,i]=(0,v.useState)(null);return{isOpen:t,setOpen:n,open:(0,v.useCallback)(()=>{n(!0)},[n]),close:(0,v.useCallback)(()=>{n(!1)},[n]),toggle:(0,v.useCallback)(()=>{n(!t)},[n,t]),point:r,setPoint:i}}var _v=(0,v.createContext)(null),vv=(0,v.createContext)(null),yv=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,_v);let n=(0,v.useContext)(cS),r=gv(e),i=e.isOpen!=null||e.defaultOpen!=null||!n?r:n,a=pc(t,i.isOpen),o=e.isExiting||!e.shouldSkipAnimation&&a||!1,s=Uf(),{direction:c}=rp();if(s){let t=e.children;return typeof t==`function`&&(t=t({trigger:e.trigger||null,placement:`bottom`,isEntering:!1,isExiting:!1,defaultChildren:null})),v.createElement(v.Fragment,null,t)}return i&&!i.isOpen&&!o?null:v.createElement(bv,{...e,triggerRef:e.triggerRef,state:i,popoverRef:t,isExiting:o,dir:c})});function bv({state:e,isExiting:t,UNSTABLE_portalContainer:n,clearContexts:r,...i}){let a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useContext)(vv),c=s&&i.trigger===`SubmenuTrigger`,{popoverProps:l,underlayProps:u,arrowProps:d,placement:f,triggerAnchorPoint:p}=c_({...i,offset:i.offset??8,arrowRef:a,groupRef:c?s:o},e),m=i.popoverRef,h=fc(m,!!f),g=i.isEntering||!i.shouldSkipAnimation&&h||!1,_=Mf({...i,defaultClassName:`react-aria-Popover`,values:{trigger:i.trigger||null,placement:f,isEntering:g,isExiting:t}}),y=!i.isNonModal||i.trigger===`SubmenuTrigger`||i.trigger===`PreviewTrigger`,[b,x]=(0,v.useState)(i.trigger===`PreviewTrigger`);Io(()=>{m.current&&x(y&&!m.current.querySelector(`[role=dialog]`))},[m,y]),(0,v.useEffect)(()=>{b&&i.trigger!==`PreviewTrigger`&&(i.trigger!==`SubmenuTrigger`||em()!==`pointer`)&&m.current&&!gs(m.current)&&sm(m.current)},[b,m,i.trigger]);let S=(0,v.useMemo)(()=>{let e=_.children;if(r)for(let t of r)e=v.createElement(t.Provider,{value:null},e);return e},[_.children,r]),[C,w]=(0,v.useState)(null),T=(0,v.useCallback)(()=>{i.triggerRef.current&&w(i.triggerRef.current.getBoundingClientRect().width+`px`)},[i.triggerRef]);Io(T,[T]),Hs({ref:_.style?.[`--trigger-width`]?void 0:i.triggerRef,onResize:T});let E={...l.style,"--trigger-anchor-point":p?`${p.x}px ${p.y}px`:void 0,..._.style,"--trigger-width":_.style?.[`--trigger-width`]||C},D=v.createElement(q.div,{...U(W(i,{global:!0}),l),..._,id:b?i.id:void 0,role:b?`dialog`:void 0,tabIndex:b?-1:void 0,"aria-label":i[`aria-label`],"aria-labelledby":i[`aria-labelledby`],ref:m,slot:i.slot||void 0,style:E,dir:i.dir,"data-trigger":i.trigger,"data-placement":f,"data-entering":g||void 0,"data-exiting":t||void 0},!i.isNonModal&&v.createElement(cv,{onDismiss:e.close}),v.createElement(Lh.Provider,{value:{...d,placement:f,ref:a}},S),v.createElement(cv,{onDismiss:e.close}));return c?v.createElement(mv,{...i,shouldContainFocus:b&&i.trigger!==`PreviewTrigger`,isExiting:t,portalContainer:n??s?.current??void 0},D):v.createElement(mv,{...i,shouldContainFocus:b&&i.trigger!==`PreviewTrigger`,isExiting:t,portalContainer:n},!i.isNonModal&&e.isOpen&&v.createElement(`div`,{"data-testid":`underlay`,...u,style:{position:`fixed`,inset:0}}),v.createElement(`div`,{ref:o,style:{display:`contents`}},v.createElement(vv.Provider,{value:o},D)))}var xv=class{constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}},Sv=class extends xv{filter(e,t,n){let[r,i]=Dv(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}};(class extends xv{static{this.type=`header`}});var Cv=class extends xv{static{this.type=`loader`}},wv=class extends Sv{static{this.type=`item`}filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}},Tv=class extends Sv{static{this.type=`section`}filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}},Ev=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=Dv(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function Dv(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey==null?null:e.getItem(o.nextKey)}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e==null?a=null:(a=t.getItem(e),a.nextKey=null)}return[i?.key??null,a?.key??null]}var Ov=class{constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.indexthis.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}};function jv(e){let{children:t,items:n,idScope:r,addIdAndValue:i,dependencies:a=[]}=e,o=(0,v.useMemo)(()=>void 0,[t]),s=(0,v.useMemo)(()=>new WeakMap,[...a,o]);return(0,v.useMemo)(()=>{if(n&&typeof t==`function`){let e=[];for(let a of n){let n=Mv(a)?a:null,o=n?s.get(n):null;if(!o){o=t(a);let c=o.props.id??a?.key??a?.id;r!=null&&o.props.id==null&&c!=null&&(c=r+`:`+c);let l=c??e.length;o=(0,v.cloneElement)(o,i?{key:l,id:c,value:a}:{key:l}),n&&s.set(n,o)}e.push(o)}return e}if(typeof t!=`function`)return t},[t,n,s,r,i])}function Mv(e){switch(typeof e){case`object`:return e!=null;case`function`:case`symbol`:return!0;default:return!1}}var Nv=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Pv=o(((e,t)=>{t.exports=Nv()})),Fv=Pv(),Iv=(0,v.createContext)(!1),Lv=(0,v.createContext)(null);function Rv(e){if((0,v.useContext)(Lv))return e.content;let{collection:t,document:n}=Hv(e.createCollection);return v.createElement(v.Fragment,null,v.createElement(Vf,null,v.createElement(Lv.Provider,{value:n},e.content)),v.createElement(zv,{render:e.children,collection:t}))}function zv({collection:e,render:t}){return t(e)}function Bv(e,t,n){let r=Jo(),i=(0,v.useRef)(r);i.current=r;let a=(0,v.useCallback)(()=>i.current?n():t(),[t,n]);return(0,Fv.useSyncExternalStore)(e,a)}var Vv=typeof v.useSyncExternalStore==`function`?v.useSyncExternalStore:Bv;function Hv(e){let[t]=(0,v.useState)(()=>new Av(e?.()||new Ev));return{collection:Vv((0,v.useCallback)(e=>t.subscribe(e),[t]),(0,v.useCallback)(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),(0,v.useCallback)(()=>(t.isSSR=!0,t.getCollection()),[t])),document:t}}var Uv=(0,v.createContext)(null);function Wv(e){return class extends xv{static{this.type=e}}}function Gv(e,t,n,r,i,a){typeof e==`string`&&(e=Wv(e));let o=(0,v.useCallback)(i=>{i?.setProps(t,n,e,r,a)},[t,n,r,a,e]),s=(0,v.useContext)(Uv);if(s){let o=s.ownerDocument.nodesByProps.get(t);return o||(o=s.ownerDocument.createElement(e.type),o.setProps(t,n,e,r,a),s.appendChild(o),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(t,o)),i?v.createElement(Uv.Provider,{value:o},i):null}return v.createElement(e.type,{ref:o},i)}function Kv(e,t){let n=({node:e})=>t(e.props,e.props.ref,e),r=(0,v.forwardRef)((r,i)=>{let a=(0,v.useContext)(Cm);if(!(0,v.useContext)(Iv)){if(t.length>=3)throw Error(t.name+` cannot be rendered outside a collection.`);return t(r,i)}return Gv(e,r,i,`children`in r?r.children:null,null,e=>v.createElement(Cm.Provider,{value:a},v.createElement(n,{node:e})))});return r.displayName=t.name,r}function qv(e,t,n=Jv){let r=({node:e})=>t(e.props,e.props.ref,e),i=(0,v.forwardRef)((t,i)=>Gv(e,t,i,null,n(t),e=>v.createElement(r,{node:e}))??v.createElement(v.Fragment,null));return i.displayName=t.name,i}function Jv(e){return jv({...e,addIdAndValue:!0})}var Yv=(0,v.createContext)(null);function Xv(e){let t=(0,v.useContext)(Yv),n=(t?.dependencies||[]).concat(e.dependencies),r=e.idScope??t?.idScope,i=Jv({...e,idScope:r,dependencies:n});return(0,v.useContext)(Lv)&&(i=v.createElement(Zv,null,i)),t=(0,v.useMemo)(()=>({dependencies:n,idScope:r}),[r,...n]),v.createElement(Yv.Provider,{value:t},i)}function Zv({children:e}){let t=(0,v.useContext)(Lv),n=(0,v.useMemo)(()=>v.createElement(Lv.Provider,{value:null},v.createElement(Iv.Provider,{value:!0},e)),[e]);return Jo()?v.createElement(Uv.Provider,{value:t},n):(0,dc.createPortal)(n,t)}var Qv=(0,v.createContext)(null),$v={CollectionRoot({collection:e,renderDropIndicator:t}){return ey(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return ey(e,t,n)}};function ey(e,t,n){return jv({items:t?e.getChildren(t.key):e,dependencies:[n],children(t){if(t.type===`content`)return v.createElement(v.Fragment,null);let r=t.render(t);return!n||t.type!==`item`?r:v.createElement(v.Fragment,null,n({type:`item`,key:t.key,dropPosition:`before`}),r,ty(e,t,n))}})}function ty(e,t,n){let r=t.key,i=e.getKeyAfter(r),a=i==null?null:e.getItem(i);for(;a!=null&&a.type!==`item`;)i=e.getKeyAfter(a.key),a=i==null?null:e.getItem(i);let o=t.nextKey==null?null:e.getItem(t.nextKey);for(;o!=null&&o.type!==`item`;)o=o.nextKey==null?null:e.getItem(o.nextKey);let s=[];if(o==null){let r=t;for(;r?.type===`item`&&(!a||r.parentKey!==a.parentKey&&a.levele==null?null:new Set([e]),[e])}function iy(e){let t=sy(is(e));t!==e&&(t&&ay(t,e),e&&oy(e,t))}function ay(e,t){e.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:t})),e.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:t}))}function oy(e,t){e.dispatchEvent(new FocusEvent(`focus`,{relatedTarget:t})),e.dispatchEvent(new FocusEvent(`focusin`,{bubbles:!0,relatedTarget:t}))}function sy(e){let t=ms(e),n=t?.getAttribute(`aria-activedescendant`);return n&&e.getElementById(n)||t}var cy={};cy={collectionLabel:`مقترحات`};var ly={};ly={collectionLabel:`Предложения`};var uy={};uy={collectionLabel:`Návrhy`};var dy={};dy={collectionLabel:`Forslag`};var fy={};fy={collectionLabel:`Empfehlungen`};var py={};py={collectionLabel:`Προτάσεις`};var my={};my={collectionLabel:`Suggestions`};var hy={};hy={collectionLabel:`Sugerencias`};var gy={};gy={collectionLabel:`Soovitused`};var _y={};_y={collectionLabel:`Ehdotukset`};var vy={};vy={collectionLabel:`Suggestions`};var yy={};yy={collectionLabel:`הצעות`};var by={};by={collectionLabel:`Prijedlozi`};var xy={};xy={collectionLabel:`Javaslatok`};var Sy={};Sy={collectionLabel:`Suggerimenti`};var Cy={};Cy={collectionLabel:`候補`};var wy={};wy={collectionLabel:`제안`};var Ty={};Ty={collectionLabel:`Pasiūlymai`};var Ey={};Ey={collectionLabel:`Ieteikumi`};var Dy={};Dy={collectionLabel:`Forslag`};var Oy={};Oy={collectionLabel:`Suggesties`};var ky={};ky={collectionLabel:`Sugestie`};var Ay={};Ay={collectionLabel:`Sugestões`};var jy={};jy={collectionLabel:`Sugestões`};var My={};My={collectionLabel:`Sugestii`};var Ny={};Ny={collectionLabel:`Предложения`};var Py={};Py={collectionLabel:`Návrhy`};var Fy={};Fy={collectionLabel:`Predlogi`};var Iy={};Iy={collectionLabel:`Predlozi`};var Ly={};Ly={collectionLabel:`Förslag`};var Ry={};Ry={collectionLabel:`Öneriler`};var zy={};zy={collectionLabel:`Пропозиції`};var By={};By={collectionLabel:`建议`};var Vy={};Vy={collectionLabel:`建議`};var Hy={};Hy={"ar-AE":cy,"bg-BG":ly,"cs-CZ":uy,"da-DK":dy,"de-DE":fy,"el-GR":py,"en-US":my,"es-ES":hy,"et-EE":gy,"fi-FI":_y,"fr-FR":vy,"he-IL":yy,"hr-HR":by,"hu-HU":xy,"it-IT":Sy,"ja-JP":Cy,"ko-KR":wy,"lt-LT":Ty,"lv-LV":Ey,"nb-NO":Dy,"nl-NL":Oy,"pl-PL":ky,"pt-BR":Ay,"pt-PT":jy,"ro-RO":My,"ru-RU":Ny,"sk-SK":Py,"sl-SI":Fy,"sr-SP":Iy,"sv-SE":Ly,"tr-TR":Ry,"uk-UA":zy,"zh-CN":By,"zh-TW":Vy};function Uy(e){return e&&e.__esModule?e.default:e}function Wy(e,t){let{inputRef:n,collectionRef:r,filter:i,disableAutoFocusFirst:a=!1,disableVirtualFocus:o=!1}=e,s=es(),c=(0,v.useRef)(void 0),l=(0,v.useRef)(!1),u=(0,v.useRef)(null),d=em()===`virtual`&&(go()||bo()),[f,p]=(0,v.useState)(!d&&!o),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(!1);(0,v.useEffect)(()=>()=>clearTimeout(c.current),[]);let y=Rs(e=>{!e.isTrusted&&f&&n.current&&ms(is(n.current))!==n.current&&nm()!==`touch`&&n.current.focus();let i=H(e);e.isTrusted||!i||u.current===i.id||(clearTimeout(c.current),i===r.current?u.current&&!document.getElementById(u.current)&&(u.current=null,t.setFocusedNodeId(null)):l.current?(u.current=i.id,c.current=setTimeout(()=>{t.setFocusedNodeId(i.id)},500)):(u.current=i.id,t.setFocusedNodeId(i.id)),l.current=!1)}),[b,x]=(0,v.useState)(null),S=(0,v.useCallback)(e=>{x(e),e==null?h(!1):(e.getAttribute(`tabindex`)!=null&&p(!1),h(!0))},[]);Io(()=>(b?.addEventListener(`focusin`,y),()=>{b?.removeEventListener(`focusin`,y)}),[b]);let C=Is((0,v.useMemo)(()=>ys(r,S),[r,S])),w=(0,v.useCallback)(()=>{if(!r.current){_(!0);return}l.current=!0,r.current?.dispatchEvent(new CustomEvent(co,{cancelable:!0,bubbles:!0,detail:{focusStrategy:`first`}}))},[r]),T=(0,v.useCallback)(e=>{_(!1),iy(ms()),u.current=null,t.setFocusedNodeId(null);let n=new CustomEvent(so,{cancelable:!0,bubbles:!0,detail:{clearFocusKey:e}});clearTimeout(c.current),l.current=!1,r.current?.dispatchEvent(n)},[r,t]),E=(0,v.useRef)(``);nc(n,`beforeinput`,e=>{let{inputType:t}=e;E.current=t});let D=e=>{(E.current===`insertText`||E.current===`insertCompositionText`||E.current===`insertFromComposition`)&&!a?w():E.current&&(E.current.includes(`insert`)||E.current.includes(`delete`)||E.current.includes(`history`))&&(T(!0),sy(document)===n.current&&oy(n.current,null)),t.setInputValue(e)},O=(0,v.useRef)(null),k=e=>{if(O.current=H(e),e.nativeEvent.isComposing)return;let t=u.current;switch(t!==null&&is(n.current).getElementById(t)==null&&(u.current=null,t=null),e.key){case`a`:if(qs(e))return;break;case`Escape`:if(e.isDefaultPrevented())return;break;case` `:return;case`Tab`:`continuePropagation`in e&&e.continuePropagation();return;case`Home`:case`End`:case`PageDown`:case`PageUp`:case`ArrowUp`:case`ArrowDown`:case`ArrowRight`:case`ArrowLeft`:{if((e.key===`Home`||e.key===`End`)&&t==null&&e.shiftKey)return;if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(t==null){e.isPropagationStopped()||e.stopPropagation();return}break}e.preventDefault();let n=new CustomEvent(co,{cancelable:!0,bubbles:!0});r.current?.dispatchEvent(n);break}}e.isPropagationStopped()||e.stopPropagation();let i=!0;if(r.current!==null){if(t==null)i=r.current?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent))||!1;else{let n=document.getElementById(t);n&&(i=n?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent))||!1)}}if(i)switch(e.key){case`ArrowLeft`:case`ArrowRight`:T();break;case`Enter`:t!=null&&document.getElementById(t)?.dispatchEvent(new PointerEvent(`click`,e.nativeEvent));break}else e.preventDefault()},A=Rs(e=>{if(H(e)===O.current){e.stopImmediatePropagation();let t=u.current;t==null?r.current?.dispatchEvent(new KeyboardEvent(e.type,e)):document.getElementById(t)?.dispatchEvent(new KeyboardEvent(e.type,e))}});(0,v.useEffect)(()=>(document.addEventListener(`keyup`,A,!0),()=>{document.removeEventListener(`keyup`,A,!0)}),[]);let j=Fs({id:s,"aria-label":rv(Uy(Hy),`@react-aria/autocomplete`).format(`collectionLabel`)}),M=(0,v.useCallback)((e,n)=>!i||i(e,t.inputValue,n),[t.inputValue,i]),N=e=>{if(!e.isTrusted)return;let t=u.current?document.getElementById(u.current):null;t&&ay(t,e.relatedTarget)},P=e=>{if(e.isTrusted&&u.current&&document.getElementById(u.current)){let t=H(e);queueMicrotask(()=>{ay(t,r.current),oy(r.current,t)})}},ee=e=>{e.button===0&&e.pointerType!==`touch`&&u.current!=null&&n.current!=null&&H(e)===n.current&&T()},F={value:t.inputValue,onChange:D},I={onKeyDown:k,"aria-activedescendant":t.focusedNodeId??void 0,onBlur:N,onFocus:P,onPointerDown:ee};return F={...F,...f&&m&&I,enterKeyHint:`go`,"aria-controls":m?s:void 0,"aria-autocomplete":`list`,autoCorrect:`off`,spellCheck:`false`,autoComplete:`off`},{inputProps:F,collectionProps:U(j,{shouldUseVirtualFocus:f,disallowTypeAhead:f,autoFocus:g?`first`:!1}),collectionRef:C,filter:i==null?void 0:M}}function Gy(e){let{onInputChange:t,inputValue:n,defaultInputValue:r=``}=e,i=e=>{t&&t(e)},[a,o]=(0,v.useState)(null),[s,c]=sh(n,r,i);return{inputValue:s,setInputValue:c,focusedNodeId:a,setFocusedNodeId:o}}var Ky=(0,v.createContext)(null),qy=(0,v.createContext)(null),Jy=(0,v.createContext)(null),Yy=(0,v.createContext)(null);function Xy(e){e=U(Pf(Ky,e.slot),e);let{filter:t,disableAutoFocusFirst:n}=e,r=Gy(e),i=(0,v.useRef)(null),a=(0,v.useRef)(null),{inputProps:o,collectionProps:s,collectionRef:c,filter:l}=Wy({...Lf(e),filter:t,disableAutoFocusFirst:n,inputRef:i,collectionRef:a},r);return v.createElement(jf,{values:[[qy,r],[Yy,{...o,ref:i}],[Jy,{...s,filter:l,ref:c}]]},e.children)}var Zy=(0,v.createContext)({}),Qy=(0,v.createContext)({}),$y=(0,v.createContext)(null);function eb(e){let t=(0,v.useRef)({});return v.createElement($y.Provider,{value:t},e.children)}var tb=(0,v.forwardRef)(function(e,t){let{name:n,isVisible:r=!0,children:i,className:a,style:o,render:s,...c}=e,[l,u]=(0,v.useState)(r?`visible`:`hidden`),d=(0,v.useContext)($y);if(!d)throw Error(` must be rendered inside a `);r&&l===`hidden`&&u(`visible`),t=Is(t),Io(()=>{let e=t.current,i=d.current,a=i[n],o=null;if(e&&r&&a){u(`visible`);let t=e.getAnimations(),r=a.style.map(([t,n])=>{let r=e.style[t];if(t===`translate`){let t=a.rect,n=e.getBoundingClientRect(),r=t.left-n?.left,i=t.top-n?.top;e.style.translate=`${r}px ${i}px`}else e.style[t]=n;return[t,r]});for(let n of e.getAnimations())t.includes(n)||n.cancel();o=requestAnimationFrame(()=>{o=null;for(let[t,n]of r)e.style[t]=n}),delete i[n]}else e&&r&&!a?(queueMicrotask(()=>(0,dc.flushSync)(()=>u(`entering`))),o=requestAnimationFrame(()=>{o=null,u(`visible`)})):e&&!r&&queueMicrotask(()=>{i[n]?(delete i[n],(0,dc.flushSync)(()=>u(`exiting`)),Promise.all(e.getAnimations().map(e=>e.finished)).then(()=>u(`hidden`)).catch(()=>{})):u(`hidden`)});return()=>{if(o!=null&&cancelAnimationFrame(o),e&&e.isConnected&&!e.hasAttribute(`data-exiting`)){let t=window.getComputedStyle(e);if(t.transitionProperty!==`none`){let r=t.transitionProperty.split(/\s*,\s*/);i[n]={rect:e.getBoundingClientRect(),style:r.map(e=>[e,t[e]])}}}}},[t,d,n,r]);let f=Mf({children:i,className:a,style:o,render:s,values:{isEntering:l===`entering`,isExiting:l===`exiting`}});return l===`hidden`?null:v.createElement(q.div,{...c,...f,ref:t,"data-entering":l===`entering`||void 0,"data-exiting":l===`exiting`||void 0})}),nb=(0,v.createContext)({isSelected:!1}),rb=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,nb);let{isSelected:n,...r}=e;return v.createElement(tb,{...r,ref:t,className:e.className||`react-aria-SelectionIndicator`,name:`SelectionIndicator`,isVisible:n})});function ib(e){let t=W(e,{labelable:!0}),n;return e.orientation===`vertical`&&(n=`vertical`),e.elementType===`hr`?{separatorProps:t}:{separatorProps:{...t,role:`separator`,"aria-orientation":n}}}var ab=(0,v.createContext)({}),ob=Kv(class extends xv{static{this.type=`separator`}filter(e,t){let n=t.getItem(this.prevKey);if(n&&n.type!==`separator`){let n=this.clone();return t.addDescendants(n,e),n}return null}},function(e,t){[e,t]=Ff(e,t,ab);let{elementType:n,orientation:r,style:i,className:a,slot:o,...s}=e,c=n||`hr`;c===`hr`&&r===`vertical`&&(c=`div`);let l=q[c],{separatorProps:u}=ib({...s,elementType:n,orientation:r}),d=W(e,{global:!0});return v.createElement(l,{render:e.render,...U(d,u),style:i,className:a??`react-aria-Separator`,ref:t,slot:o||void 0})}),sb=(0,v.createContext)({}),cb=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,sb);let{elementType:n=`span`,...r}=e,i=q[n];return v.createElement(i,{className:`react-aria-Text`,...r,ref:t})}),lb={};lb={longPressMessage:`اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة`};var ub={};ub={longPressMessage:`Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто`};var db={};db={longPressMessage:`Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku`};var fb={};fb={longPressMessage:`Langt tryk eller tryk på Alt + pil ned for at åbne menuen`};var pb={};pb={longPressMessage:`Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen`};var mb={};mb={longPressMessage:`Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού`};var hb={};hb={longPressMessage:`Long press or press Alt + ArrowDown to open menu`};var gb={};gb={longPressMessage:`Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú`};var _b={};_b={longPressMessage:`Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool`};var vb={};vb={longPressMessage:`Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli`};var yb={};yb={longPressMessage:`Appuyez de manière prolongée ou appuyez sur Alt\xA0+\xA0Flèche vers le bas pour ouvrir le menu.`};var bb={};bb={longPressMessage:`לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט`};var xb={};xb={longPressMessage:`Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika`};var Sb={};Sb={longPressMessage:`Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához`};var Cb={};Cb={longPressMessage:`Premi a lungo o premi Alt + Freccia giù per aprire il menu`};var wb={};wb={longPressMessage:`長押しまたは Alt+下矢印キーでメニューを開く`};var Tb={};Tb={longPressMessage:`길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기`};var Eb={};Eb={longPressMessage:`Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“.`};var Db={};Db={longPressMessage:`Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa`};var Ob={};Ob={longPressMessage:`Langt trykk eller trykk Alt + PilNed for å åpne menyen`};var kb={};kb={longPressMessage:`Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen`};var Ab={};Ab={longPressMessage:`Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu`};var jb={};jb={longPressMessage:`Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu`};var Mb={};Mb={longPressMessage:`Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu`};var Nb={};Nb={longPressMessage:`Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul`};var Pb={};Pb={longPressMessage:`Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню`};var Fb={};Fb={longPressMessage:`Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol`};var Ib={};Ib={longPressMessage:`Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol`};var Lb={};Lb={longPressMessage:`Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni`};var Rb={};Rb={longPressMessage:`Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn`};var zb={};zb={longPressMessage:`Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın`};var Bb={};Bb={longPressMessage:`Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню`};var Vb={};Vb={longPressMessage:`长按或按 Alt + 向下方向键以打开菜单`};var Hb={};Hb={longPressMessage:`長按或按 Alt+向下鍵以開啟功能表`};var Ub={};Ub={"ar-AE":lb,"bg-BG":ub,"cs-CZ":db,"da-DK":fb,"de-DE":pb,"el-GR":mb,"en-US":hb,"es-ES":gb,"et-EE":_b,"fi-FI":vb,"fr-FR":yb,"he-IL":bb,"hr-HR":xb,"hu-HU":Sb,"it-IT":Cb,"ja-JP":wb,"ko-KR":Tb,"lt-LT":Eb,"lv-LV":Db,"nb-NO":Ob,"nl-NL":kb,"pl-PL":Ab,"pt-BR":jb,"pt-PT":Mb,"ro-RO":Nb,"ru-RU":Pb,"sk-SK":Fb,"sl-SI":Ib,"sr-SP":Lb,"sv-SE":Rb,"tr-TR":zb,"uk-UA":Bb,"zh-CN":Vb,"zh-TW":Hb};var Wb=500;function Gb(e){let{isDisabled:t,pointerType:n,onLongPressStart:r,onLongPressEnd:i,onLongPress:a,threshold:o=Wb,accessibilityDescription:s}=e,c=(0,v.useRef)(void 0),{addGlobalListener:l,removeAllGlobalListeners:u}=Ps(),d=e=>n?e.pointerType===n:e.pointerType===`mouse`||e.pointerType===`touch`,{pressProps:f}=Rm({isDisabled:t,onPressStart(e){if(e.continuePropagation(),d(e)){r&&r({...e,type:`longpressstart`}),c.current=setTimeout(()=>{e.target.dispatchEvent(new PointerEvent(`pointercancel`,{bubbles:!0})),l(e.target,`click`,e=>e.preventDefault(),{once:!0}),is(e.target).activeElement!==e.target&&So(e.target),a&&a({...e,type:`longpress`}),c.current=void 0},o),e.pointerType===`touch`&&l(e.target,`contextmenu`,e=>e.preventDefault(),{once:!0});let t=as(e.target);l(t,`pointerup`,()=>{setTimeout(()=>{u()},100)},{once:!0})}},onPressEnd(e){c.current&&clearTimeout(c.current),i&&d(e)&&i({...e,type:`longpressend`})}});return{longPressProps:U(f,tc(a&&!t?s:void 0))}}function Kb(e){let{onContextMenu:t}=e,n=(0,v.useRef)(!1),{longPressProps:r}=Gb({onLongPressStart(){n.current=!1},onLongPress(e){n.current?n.current=!1:t?.({target:e.target,x:e.x,y:e.y})}});return t?{contextMenuProps:U(go()?r:{},{onContextMenu(e){e.stopPropagation(),e.preventDefault(),n.current=!0;let r=e.currentTarget.getBoundingClientRect();t({target:e.currentTarget,x:e.clientX-r.x,y:e.clientY-r.y})},onKeyDown(e){if(po()&&e.ctrlKey&&e.key===`Enter`){n.current=!1;let r=e.currentTarget;e.stopPropagation(),setTimeout(()=>{if(n.current)n.current=!1;else{let e=r.getBoundingClientRect();t({target:r,x:e.width/2,y:e.height/2})}},10)}}})}:{contextMenuProps:{}}}function qb(e,t,n){let{type:r}=e,{isOpen:i}=t;(0,v.useEffect)(()=>{n&&n.current&&pg.set(n.current,t.close)});let a;r===`menu`?a=!0:r===`listbox`&&(a=`listbox`);let o=es();return{triggerProps:{"aria-haspopup":a,"aria-expanded":i,"aria-controls":i?o:void 0,onPress:t.toggle},overlayProps:{id:o}}}function Jb(e){return e&&e.__esModule?e.default:e}function Yb(e,t,n){let{type:r=`menu`,isDisabled:i,trigger:a=`press`}=e,o=es(),{triggerProps:s,overlayProps:c}=qb({type:r},t,n),l=(e,n,r=`first`)=>{if(!e||n.isDefaultPrevented())return!1;t.toggle(r)},{keyboardProps:u}=Sm({isDisabled:i,shortcuts:{Enter:e=>l(a!==`longPress`,e,`first`)," ":e=>l(a!==`longPress`,e,`first`),ArrowDown:e=>l(a!==`longPress`,e,`first`),ArrowUp:e=>l(a!==`longPress`,e,`last`),"Alt+Enter":e=>l(a===`longPress`,e,`first`),"Alt+ ":e=>l(a===`longPress`,e,`first`),"Alt+ArrowDown":e=>l(!0,e,`first`),"Alt+ArrowUp":e=>l(!0,e,`last`)}}),d=rv(Jb(Ub),`@react-aria/menu`),{longPressProps:f}=Gb({isDisabled:i||a!==`longPress`,accessibilityDescription:d.format(`longPressMessage`),onLongPressStart(){t.close()},onLongPress(){t.open(`first`)}}),p={preventFocusOnPress:!0,onPressStart(e){e.pointerType!==`touch`&&e.pointerType!==`keyboard`&&!i&&(So(e.target),t.open(e.pointerType===`virtual`?`first`:null))},onPress(e){e.pointerType===`touch`&&!i&&(So(e.target),t.toggle())}};delete s.onPress;let{contextMenuProps:m}=Kb({onContextMenu(e){let n=e.target.getBoundingClientRect();t.setPoint({x:n.x+e.x,y:n.y+e.y}),t.open()}});(0,v.useEffect)(()=>{if(t.isOpen&&a===`contextMenu`){let e=e=>{(e.button===2||e.button===0&&e.ctrlKey===!0)&&H(e)===document.body&&t.close()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)}},[t,a]);let h;if(a===`press`)h={...p,...u};else if(a===`longPress`)h={...f,...u};else if(a===`contextMenu`){h=m;let{"aria-haspopup":e,"aria-expanded":t,"aria-controls":n,...r}=s;s=r}return{menuTriggerProps:{...s,...h,id:o},menuProps:{...c,"aria-labelledby":o,autoFocus:t.focusStrategy||!0,onClose:t.close}}}var Xb=new WeakMap;function Zb(e){return _o()?e.altKey:e.ctrlKey}function Qb(e,t){let n=`[data-key="${CSS.escape(String(t))}"]`,r=e.current?.dataset.collection;return r&&(n=`[data-collection="${CSS.escape(r)}"]${n}`),e.current?.querySelector(n)}var $b=new WeakMap;function ex(e){let t=es();return $b.set(e,t),t}function tx(e){return $b.get(e)}var nx=1e3;function rx(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:r}=e,i=(0,v.useRef)({search:``,timeout:void 0});return(0,v.useEffect)(()=>{let e=i.current.timeout;return()=>{clearTimeout(e)}},[i]),{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?e=>{if(i.current.search.length>0&&e.key===` `){if(e.preventDefault(),(!(`continuePropagation`in e)||`continuePropagation`in e&&!e.isPropagationStopped())&&e.stopPropagation(),i.current.search+=` `,t.getKeyForSearch!=null){let e=t.getKeyForSearch(i.current.search,n.focusedKey);e??=t.getKeyForSearch(i.current.search),e!=null&&(n.setFocusedKey(e),r&&r(e))}clearTimeout(i.current.timeout),i.current.timeout=setTimeout(()=>{i.current.search=``},nx)}}:void 0,onKeyDown:t.getKeyForSearch?e=>{let a=ix(e.key);if(!(!a||e.ctrlKey||e.metaKey||e.altKey||!ps(e.currentTarget,H(e))||i.current.search.length===0&&a===` `)){if(i.current.search+=a,t.getKeyForSearch!=null){let a=t.getKeyForSearch(i.current.search,n.focusedKey);if(a??=t.getKeyForSearch(i.current.search),a!=null)n.setFocusedKey(a),r&&r(a),e.preventDefault(),`continuePropagation`in e||e.stopPropagation();else{i.current.search=``,clearTimeout(i.current.timeout),i.current.timeout=void 0;return}}clearTimeout(i.current.timeout),i.current.timeout=setTimeout(()=>{i.current.search=``},nx)}}:void 0}}}function ix(e){return e.length===1||!/^[A-Z]/i.test(e)?e:``}function ax(e){let{selectionManager:t,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:a=!1,disallowEmptySelection:o=!1,disallowSelectAll:s=!1,escapeKeyBehavior:c=`clearSelection`,selectOnFocus:l=t.selectionBehavior===`replace`,disallowTypeAhead:u=!1,shouldUseVirtualFocus:d,allowsTabNavigation:f=!1,scrollRef:p=r,linkBehavior:m=`action`,UNSTABLE_focusOnEntry:h}=e,{direction:g}=rp(),_=Oo(),y=(e,n,i)=>{if(n!=null){if(t.isLink(n)&&m===`selection`&&l&&!Zb(e)){(0,dc.flushSync)(()=>{t.setFocusedKey(n,i)});let a=Qb(r,n),o=t.getItemProps(n);if(a){_.open(a,e,o.href,o.routerOptions);return}return!1}if(t.setFocusedKey(n,i),t.isLink(n)&&m===`override`)return!1;if(e.shiftKey&&t.selectionMode===`multiple`){t.extendSelection(n);return}if(l&&!Zb(e)){t.replaceSelection(n);return}}return!1},b=e=>{if(n.getKeyBelow){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyBelow?.(t.focusedKey);if(r==null&&a&&(r=n.getFirstKey?.(t.focusedKey)),r!=null){y(e,r);return}}return!1},x=e=>{if(n.getKeyAbove){let r=t.focusedKey==null?n.getLastKey?.():n.getKeyAbove?.(t.focusedKey);if(r==null&&a&&(r=n.getLastKey?.(t.focusedKey)),r!=null){y(e,r);return}}return!1},S=e=>{if(n.getFirstKey){if(t.focusedKey===null&&e.shiftKey)return!1;let r=n.getFirstKey(t.focusedKey,qs(e));if(t.setFocusedKey(r),r!=null){if(qs(e)&&e.shiftKey&&t.selectionMode===`multiple`){t.extendSelection(r);return}if(l){t.replaceSelection(r);return}}}return!1},C=e=>{if(n.getKeyLeftOf){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyLeftOf?.(t.focusedKey);if(r==null&&a&&(r=g===`rtl`?n.getFirstKey?.(t.focusedKey):n.getLastKey?.(t.focusedKey)),r!=null){y(e,r,g===`rtl`?`first`:`last`);return}}return!1},w=e=>{if(n.getKeyRightOf){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyRightOf?.(t.focusedKey);if(r==null&&a&&(r=g===`rtl`?n.getLastKey?.(t.focusedKey):n.getFirstKey?.(t.focusedKey)),r!=null){y(e,r,g===`rtl`?`last`:`first`);return}}return!1},T=e=>{if(n.getLastKey){if(t.focusedKey===null&&e.shiftKey)return!1;let r=n.getLastKey(t.focusedKey,qs(e));if(t.setFocusedKey(r),r!=null){if(qs(e)&&e.shiftKey&&t.selectionMode===`multiple`){t.extendSelection(r);return}if(l){t.replaceSelection(r);return}}}return!1},E=e=>{if(n.getKeyPageBelow&&t.focusedKey!=null){let r=n.getKeyPageBelow(t.focusedKey);if(r!=null)return y(e,r)}return!1},D=e=>{if(n.getKeyPageAbove&&t.focusedKey!=null){let r=n.getKeyPageAbove(t.focusedKey);if(r!=null)return y(e,r)}return!1},O=()=>{if(t.selectionMode===`multiple`&&s!==!0){t.selectAll();return}return!1},k=()=>{if(c===`clearSelection`&&!o&&t.selectedKeys.size!==0){t.clearSelection();return}return!1},A=()=>{if(!f&&r.current){let e=Hg(r.current,{tabbable:!0}),t,n;do n=e.lastChild(),n&&(t=n);while(n);let i=ms();t&&(!gs(t)||i&&!Cc(i))&&So(t)}return{shouldContinuePropagation:!0,shouldPreventDefault:!1}},j=()=>(!f&&r.current&&r.current.focus(),{shouldContinuePropagation:!0,shouldPreventDefault:!1}),M=(e,t)=>({[po()?e+`+Shift+Alt`:e+`+Shift+Control`]:t,[e+`+Shift`]:t,[po()?e+`+Alt`:e+`+Control`]:t,[e]:t}),{keyboardProps:N}=Sm({shortcuts:{...M(`ArrowDown`,b),...M(`ArrowUp`,x),...M(`ArrowLeft`,C),...M(`ArrowRight`,w),...M(`PageDown`,E),...M(`PageUp`,D)},allowRepeats:!0}),{keyboardProps:P}=Sm({shortcuts:{...M(`Home`,S),...M(`End`,T),"Mod+A":O,Escape:k,Tab:A,"Tab+Shift":j}}),ee=(0,v.useRef)({top:0,left:0});nc(p,`scroll`,()=>{ee.current={top:p.current?.scrollTop??0,left:p.current?.scrollLeft??0}});let F=e=>{if(t.isFocused){ps(e.currentTarget,H(e))||t.setFocused(!1);return}if(!ps(e.currentTarget,H(e)))return;let i=em();t.setFocused(!0);let a=e=>{e!=null&&(t.setFocusedKey(e),l&&!t.isSelected(e)&&t.replaceSelection(e))};if(h&&(i===`keyboard`||i===`virtual`))a(h===`first`?n.getFirstKey?.():n.getLastKey?.());else if(t.focusedKey==null){let r=e.relatedTarget;r&&e.currentTarget.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING?a(t.lastSelectedKey??n.getLastKey?.()):a(t.firstSelectedKey??n.getFirstKey?.())}else p.current&&(p.current.scrollTop=ee.current.top,p.current.scrollLeft=ee.current.left);if(t.focusedKey!=null&&p.current){let e=Qb(r,t.focusedKey);e instanceof HTMLElement&&(!gs(e)&&!d&&So(e),(i===`keyboard`||h&&i===`virtual`)&&ic(e,{containingElement:r.current}))}},I=e=>{ps(e.currentTarget,e.relatedTarget)||t.setFocused(!1)},L=(0,v.useRef)(!1);nc(r,co,d?e=>{let{detail:n}=e;e.stopPropagation(),t.setFocused(!0),n?.focusStrategy===`first`&&(L.current=!0)}:void 0);let te=n.getFirstKey?.()??null;Bs(()=>{if(L.current){if(te==null){let e=ms();iy(r.current),oy(e,null),t.collection.size>0&&(L.current=!1)}else t.setFocusedKey(te),L.current=!1}},[te,t.collection.size]),Bs(()=>{t.collection.size>0&&(L.current=!1)},[t.focusedKey]),nc(r,so,d?e=>{e.stopPropagation(),t.setFocused(!1),e.detail?.clearFocusKey&&t.setFocusedKey(null)}:void 0);let R=(0,v.useRef)(i),z=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(R.current){let e=null;i===`first`&&(e=n.getFirstKey?.()??null),i===`last`&&(e=n.getLastKey?.()??null);let a=t.selectedKeys;if(a.size){for(let n of a)if(t.canSelectItem(n)){e=n;break}}t.setFocused(!0),t.setFocusedKey(e),e==null&&!d&&r.current&&sm(r.current),t.collection.size>0&&(R.current=!1,z.current=!0)}});let B=(0,v.useRef)(t.focusedKey),ne=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==B.current||z.current)&&p.current&&r.current){let e=em(),n=Qb(r,t.focusedKey);if(!(n instanceof HTMLElement))return;(e===`keyboard`||z.current)&&(ne.current&&cancelAnimationFrame(ne.current),ne.current=requestAnimationFrame(()=>{p.current&&(rc(p.current,n),e!==`virtual`&&ic(n,{containingElement:r.current}))}))}!d&&t.isFocused&&t.focusedKey==null&&B.current!=null&&r.current&&sm(r.current),B.current=t.focusedKey,z.current=!1}),(0,v.useEffect)(()=>()=>{ne.current&&cancelAnimationFrame(ne.current)},[]),nc(r,`react-aria-focus-scope-restore`,e=>{e.preventDefault(),t.setFocused(!0)});let re={...U(P,N),onFocus:F,onBlur:I,onMouseDown(e){p.current===H(e)&&e.preventDefault()}},{typeSelectProps:ie}=rx({keyboardDelegate:n,selectionManager:t});u||(re=U(ie,re));let V;d||(V=t.focusedKey==null?0:-1);let ae=ex(t.collection);return{collectionProps:U(re,{tabIndex:V,"data-collection":ae})}}var ox=class{constructor(e){this.ref=e}getItemRect(e){let t=this.ref.current;if(!t)return null;let n=e==null?null:Qb(this.ref,e);if(!n)return null;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();return{x:i.left-r.left-t.clientLeft+t.scrollLeft,y:i.top-r.top-t.clientTop+t.scrollTop,width:i.width,height:i.height}}getContentSize(){let e=this.ref.current;return{width:e?.scrollWidth??0,height:e?.scrollHeight??0}}getVisibleRect(){let e=this.ref.current;return{x:e?.scrollLeft??0,y:e?.scrollTop??0,width:e?.clientWidth??0,height:e?.clientHeight??0}}},sx=class{constructor(...e){if(e.length===1){let t=e[0];this.collection=t.collection,this.ref=t.ref,this.collator=t.collator,this.disabledKeys=t.disabledKeys||new Set,this.disabledBehavior=t.disabledBehavior||`all`,this.orientation=t.orientation||`vertical`,this.direction=t.direction,this.layout=t.layout||`stack`,this.layoutDelegate=t.layoutDelegate||new ox(t.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout=`stack`,this.orientation=`vertical`,this.disabledBehavior=`all`,this.layoutDelegate=new ox(this.ref);this.layout===`stack`&&this.orientation===`vertical`&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){return this.disabledBehavior===`all`&&(e.props?.isDisabled||this.disabledKeys.has(e.key))&&e.props?.disabledBehavior!==`selection`}findNextNonDisabled(e,t,n=!1){let r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e?.type===`item`&&(n||!this.isDisabled(e)))return r;r=t(r)}return null}getNextKey(e,t){let n=e;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,e=>this.collection.getKeyAfter(e),t?.includeDisabled)}getPreviousKey(e,t){let n=e;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,e=>this.collection.getKeyBefore(e),t?.includeDisabled)}findKey(e,t,n){let r=e,i=this.layoutDelegate.getItemRect(r);if(!i||r==null)return null;let a=i;do{if(r=t(r),r==null)break;i=this.layoutDelegate.getItemRect(r)}while(i&&n(a,i)&&r!=null);return r}isSameRow(e,t){return e.y===t.y||e.x!==t.x}isSameColumn(e,t){return e.x===t.x||e.y!==t.y}isReversed(e){let t=this.getNextKey(e),n=Qb(this.ref,e);if(t!=null){let e=Qb(this.ref,t);return!n||!e?!1:n.getBoundingClientRect().top>e.getBoundingClientRect().top}let r=this.getPreviousKey(e);if(r!=null){let e=Qb(this.ref,r);return!n||!e?!1:e.getBoundingClientRect().top>n.getBoundingClientRect().top}return!1}getKeyBelow(e,t){return this.layout===`grid`&&this.orientation===`vertical`?this.findKey(e,e=>this.getNextKey(e,t),this.isSameRow):this.orientation===`vertical`&&this.isReversed(e)?this.getPreviousKey(e,t):this.getNextKey(e,t)}getKeyAbove(e,t){return this.layout===`grid`&&this.orientation===`vertical`?this.findKey(e,e=>this.getPreviousKey(e,t),this.isSameRow):this.orientation===`vertical`&&this.isReversed(e)?this.getNextKey(e,t):this.getPreviousKey(e,t)}getNextColumn(e,t,n){return t?this.getPreviousKey(e,n):this.getNextKey(e,n)}getKeyRightOf(e,t){let n=this.direction===`ltr`?`getKeyRightOf`:`getKeyLeftOf`;return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,e=>this.layoutDelegate[n](e),t?.includeDisabled)):this.layout===`grid`?this.orientation===`vertical`?this.getNextColumn(e,this.direction===`rtl`,t):this.findKey(e,e=>this.getNextColumn(e,this.direction===`rtl`,t),this.isSameColumn):this.orientation===`horizontal`?this.getNextColumn(e,this.direction===`rtl`,t):null}getKeyLeftOf(e,t){let n=this.direction===`ltr`?`getKeyLeftOf`:`getKeyRightOf`;return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,e=>this.layoutDelegate[n](e),t?.includeDisabled)):this.layout===`grid`?this.orientation===`vertical`?this.getNextColumn(e,this.direction===`ltr`,t):this.findKey(e,e=>this.getNextColumn(e,this.direction===`ltr`,t),this.isSameColumn):this.orientation===`horizontal`?this.getNextColumn(e,this.direction===`ltr`,t):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,e=>this.collection.getKeyAfter(e))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,e=>this.collection.getKeyBefore(e))}getKeyPageAbove(e){let t=this.ref.current,n=this.layoutDelegate.getItemRect(e);if(!n)return null;let r=this.isReversed(e);if(t&&!Ws(t))return this.getFirstKey();let i=e;if(this.orientation===`horizontal`){let e=Math.max(0,n.x+n.width-this.layoutDelegate.getVisibleRect().width);for(;n&&n.x>e&&i!=null;)i=this.getKeyAbove(i),n=i==null?null:this.layoutDelegate.getItemRect(i)}else{let e=this.layoutDelegate.getVisibleRect(),t=r?n.y-e.height:Math.max(0,n.y+n.height-e.height);for(;n&&n.y>t&&i!=null;)i=this.getKeyAbove(i),n=i==null?null:this.layoutDelegate.getItemRect(i)}return i??(r?this.getLastKey():this.getFirstKey())}getKeyPageBelow(e){let t=this.ref.current,n=this.layoutDelegate.getItemRect(e);if(!n)return null;let r=this.isReversed(e);if(t&&!Ws(t))return this.getLastKey();let i=e;if(this.orientation===`horizontal`){let e=Math.min(this.layoutDelegate.getContentSize().width,n.x-n.width+this.layoutDelegate.getVisibleRect().width);for(;n&&n.xe[0]a||new sx({collection:n,disabledKeys:r,disabledBehavior:l,ref:i,collator:c,layoutDelegate:o,orientation:s}),[a,o,n,r,i,c,l,s]),{collectionProps:d}=ax({...e,ref:i,selectionManager:t,keyboardDelegate:u});return{listProps:d}}function dx(e,t,n){let{shouldFocusWrap:r=!0,onKeyDown:i,onKeyUp:a,...o}=e;!e[`aria-label`]&&e[`aria-labelledby`];let s=W(e,{labelable:!0}),{listProps:c}=ux({...o,ref:n,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,shouldFocusWrap:r,linkBehavior:`override`});return Xb.set(t,{onClose:e.onClose,onAction:e.onAction,shouldUseVirtualFocus:e.shouldUseVirtualFocus}),{menuProps:U(s,{onKeyDown:i,onKeyUp:a},{role:`menu`,...c,onKeyDown:t=>{(t.key!==`Escape`||e.shouldUseVirtualFocus)&&c.onKeyDown?.(t)}})}}function fx(e){let{id:t,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:a,shouldUseVirtualFocus:o,focus:s,isDisabled:c,onAction:l,allowsDifferentPressOrigin:u,linkBehavior:d=`action`}=e,f=Oo();t=es(t);let p=e=>{if(e.pointerType===`keyboard`&&Zb(e))n.toggleSelection(r);else{if(n.selectionMode===`none`)return;if(n.isLink(r)){if(d===`selection`&&i.current){let t=n.getItemProps(r);f.open(i.current,e,t.href,t.routerOptions),n.setSelectedKeys(n.selectedKeys);return}if(d===`override`||d===`none`)return}n.selectionMode===`single`?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):e&&e.shiftKey?n.extendSelection(r):n.selectionBehavior===`toggle`||e&&(qs(e)||e.pointerType===`touch`||e.pointerType===`virtual`)?n.toggleSelection(r):n.replaceSelection(r)}};(0,v.useEffect)(()=>{r===n.focusedKey&&n.isFocused&&(o?iy(i.current):s?s():ms()!==i.current&&i.current&&sm(i.current))},[i,r,n.focusedKey,n.childFocusStrategy,n.isFocused,o]),c||=n.isDisabled(r);let m={};!o&&!c?m={tabIndex:r===n.focusedKey?0:-1,onFocus(e){H(e)===i.current&&n.setFocusedKey(r)}}:c&&(m.onMouseDown=e=>{e.preventDefault()}),(0,v.useEffect)(()=>{c&&n.focusedKey===r&&n.setFocusedKey(null)},[n,c,r]);let h=n.isLink(r)&&d===`override`,g=l&&e.UNSTABLE_itemBehavior===`action`,_=n.isLink(r)&&d!==`selection`&&d!==`none`,y=!c&&n.canSelectItem(r)&&!h&&!g,b=(l||_)&&!c,x=b&&(n.selectionBehavior===`replace`?!y:!y||n.isEmpty),S=b&&y&&n.selectionBehavior===`replace`,C=x||S,w=(0,v.useRef)(null),T=C&&y,E=(0,v.useRef)(!1),D=(0,v.useRef)(!1),O=n.getItemProps(r),k=e=>{l&&(l(),i.current?.dispatchEvent(new CustomEvent(`react-aria-item-action`,{bubbles:!0}))),_&&i.current&&f.open(i.current,e,O.href,O.routerOptions)},A={ref:i};a?(A.onPressStart=e=>{w.current=e.pointerType,E.current=T,e.pointerType===`keyboard`&&(!C||mx(e.key))&&p(e)},u?(A.onPressUp=x?void 0:e=>{e.pointerType===`mouse`&&y&&p(e)},A.onPress=x?k:e=>{e.pointerType!==`keyboard`&&e.pointerType!==`mouse`&&y&&p(e)}):A.onPress=e=>{if(x||S&&e.pointerType!==`mouse`){if(e.pointerType===`keyboard`&&!px(e.key))return;k(e)}else e.pointerType!==`keyboard`&&y&&p(e)}):(A.onPressStart=e=>{w.current=e.pointerType,E.current=T,D.current=x,y&&(e.pointerType===`mouse`&&!x||e.pointerType===`keyboard`&&(!b||mx(e.key)))&&p(e)},A.onPress=e=>{(e.pointerType===`touch`||e.pointerType===`pen`||e.pointerType===`virtual`||e.pointerType===`keyboard`&&C&&px(e.key)||e.pointerType===`mouse`&&D.current)&&(C?k(e):y&&p(e))});let j=tx(n.collection);if(m[`data-collection`]=j,m[`data-key`]=r,A.preventFocusOnPress=o,o&&(A=U(A,{onPressStart(e){e.pointerType!==`touch`&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(e){e.pointerType===`touch`&&(n.setFocused(!0),n.setFocusedKey(r))}})),O)for(let e of[`onPressStart`,`onPressEnd`,`onPressChange`,`onPress`,`onPressUp`,`onClick`])O[e]&&(A[e]=rs(A[e],O[e]));let{pressProps:M,isPressed:N}=Rm(A),P=S?e=>{w.current===`mouse`&&(e.stopPropagation(),e.preventDefault(),k(e))}:void 0,{longPressProps:ee}=Gb({isDisabled:!T,onLongPress(e){e.pointerType===`touch`&&(p(e),n.setSelectionBehavior(`toggle`))}}),F=e=>{w.current===`touch`&&E.current&&e.preventDefault()},I=d!==`none`&&n.isLink(r)?e=>{Ao.isOpening||e.preventDefault()}:void 0,L=U(m,y||x||o&&!c?M:{},T?ee:{},{onDoubleClick:P,onDragStartCapture:F,onClick:I,id:t},o?{onMouseDown:e=>e.preventDefault()}:void 0),te=e=>{let t=e;for(;t&&t!==i.current;){let e=t.getAttribute(`data-collection`);if(e!=null)return e!==j;t=t.parentElement}return Cc(e)},R=L.onPointerDown;L.onPointerDown=e=>{let t=H(e);if(t&&t!==i.current&&te(t)){e.stopPropagation();return}R?.(e)};let z=L.onMouseDown;return L.onMouseDown=e=>{let t=H(e);if(t&&t!==i.current&&te(t)){e.stopPropagation();return}z?.(e)},{itemProps:L,isPressed:N,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:c,allowsSelection:y,hasAction:C}}function px(e){return e===`Enter`}function mx(e){return e===` `}function hx(e,t){return typeof t.getChildren==`function`?t.getChildren(e.key):e.childNodes}function gx(e){return _x(e,0)}function _x(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function vx(e){let t;for(let n of e)t=n;return t}function yx(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...bx(e,t),t],i=[...bx(e,n),n],a=r.slice(0,i.length).findIndex((e,t)=>e!==i[t]);return a===-1?r.findIndex(e=>e===n)>=0?1:(i.findIndex(e=>e===t),-1):(t=r[a],n=i[a],t.index-n.index)}function bx(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}var xx=new WeakMap;function Sx(e){let t=xx.get(e);if(t!=null)return t;let n=0,r=t=>{for(let i of t)i.type===`section`?r(hx(i,e)):i.type===`item`&&n++};return r(e),xx.set(e,n),n}function Cx(e,t,n){let{id:r,key:i,closeOnSelect:a,shouldCloseOnSelect:o,isVirtualized:s,"aria-haspopup":c,onPressStart:l,onPressUp:u,onPress:d,onPressChange:f,onPressEnd:p,onClick:m,onHoverStart:h,onHoverChange:g,onHoverEnd:_,onKeyDown:y,onKeyUp:b,onFocus:x,onFocusChange:S,onBlur:C,selectionManager:w=t.selectionManager}=e,T=!!c,E=T&&e[`aria-expanded`]===`true`,D=e.isDisabled??w.isDisabled(i),O=e.isSelected??w.isSelected(i),k=Xb.get(t),A=t.collection.getItem(i),j=e.onClose||k.onClose,M=Oo(),N=()=>{if(!T&&(A?.props?.onAction?A.props.onAction():e.onAction&&e.onAction(i),k.onAction)){let e=k.onAction;e(i,A?.value)}},P=`menuitem`;T||(w.selectionMode===`single`?P=`menuitemradio`:w.selectionMode===`multiple`&&(P=`menuitemcheckbox`));let ee=ns(),F=ns(),I=ns(),L={id:r,"aria-disabled":D||void 0,role:P,"aria-label":e[`aria-label`],"aria-labelledby":ee,"aria-describedby":[e[`aria-describedby`],F,I].filter(Boolean).join(` `)||void 0,"aria-controls":e[`aria-controls`],"aria-haspopup":c,"aria-expanded":e[`aria-expanded`]};if(w.selectionMode!==`none`&&!T&&(L[`aria-checked`]=O),s){let e=Number(A?.index);L[`aria-posinset`]=Number.isNaN(e)?void 0:e+1,L[`aria-setsize`]=Sx(t.collection)}let te=(0,v.useRef)(!1),R=e=>{f?.(e),te.current=e},z=(0,v.useRef)(null),B=e=>{e.pointerType!==`keyboard`&&(z.current={pointerType:e.pointerType}),e.pointerType===`mouse`&&(te.current||e.target.click()),u?.(e)},ne=e=>{m?.(e),N(),Fo(e,M,A.props.href,A?.props.routerOptions);let t=z.current?.pointerType===`keyboard`?z.current?.key===`Enter`||w.selectionMode===`none`||w.isLink(i):w.selectionMode!==`multiple`||w.isLink(i);t=o??a??t,j&&!T&&t&&j(),z.current=null},{itemProps:re,isFocused:ie}=fx({id:r,selectionManager:w,key:i,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:`none`,shouldUseVirtualFocus:k.shouldUseVirtualFocus}),{pressProps:V,isPressed:ae}=Rm({onPressStart:l,onPress:d,onPressUp:B,onPressChange:R,onPressEnd:p,isDisabled:D}),{hoverProps:oe}=eh({isDisabled:D,onHoverStart(e){!$p()&&!(E&&c)&&(w.setFocused(!0),w.setFocusedKey(i)),h?.(e)},onHoverChange:g,onHoverEnd:_}),{keyboardProps:se}=Sm({shortcuts:{" ":e=>{z.current={pointerType:`keyboard`,key:` `},H(e).click(),tm(`keyboard`)},Enter:e=>{z.current={pointerType:`keyboard`,key:`Enter`};let t=H(e);if(t.tagName!==`A`){t.click(),tm(`keyboard`);return}return tm(`keyboard`),{shouldPreventDefault:!1,shouldContinuePropagation:!1}}},onKeyDown:y,onKeyUp:b}),{focusableProps:ce}=Em({onBlur:C,onFocus:x,onFocusChange:S},n),le=W(A?.props);delete le.id;let ue=Po(A?.props);return{menuItemProps:{...L,...U(le,ue,T?{onFocus:re.onFocus,"data-collection":re[`data-collection`],"data-key":re[`data-key`]}:re,V,oe,se,ce,k.shouldUseVirtualFocus||T?{onMouseDown:e=>e.preventDefault()}:void 0,D?void 0:{onClick:ne}),tabIndex:re.tabIndex!=null&&E&&!k.shouldUseVirtualFocus?-1:re.tabIndex},labelProps:{id:ee},descriptionProps:{id:F},keyboardShortcutProps:{id:I},isFocused:ie,isFocusVisible:ie&&w.isFocused&&$p()&&!E,isSelected:O,isPressed:ae,isDisabled:D}}function wx(e){let{heading:t,"aria-label":n}=e,r=es();return{itemProps:{role:`presentation`},headingProps:t?{id:r,role:`presentation`}:{},groupProps:{role:`group`,"aria-label":n,"aria-labelledby":t?r:void 0}}}var Tx=2,Ex=50,Dx=1e3,Ox=Math.PI/12;function kx(e){let{menuRef:t,submenuRef:n,isOpen:r,isDisabled:i}=e,a=(0,v.useRef)(void 0),o=(0,v.useRef)(void 0),s=(0,v.useRef)(0),c=(0,v.useRef)(void 0),l=(0,v.useRef)(void 0),u=(0,v.useRef)(void 0),d=(0,v.useRef)(2),[f,p]=(0,v.useState)(!1);Hs({ref:r?n:void 0,onResize:()=>{n.current&&(o.current=n.current.getBoundingClientRect(),u.current=void 0)}});let m=()=>{p(!1),d.current=Tx,a.current=void 0},h=rm(),g=Rs(e=>{f&&e.preventDefault()});(0,v.useEffect)(()=>{f&&t.current?t.current.style.pointerEvents=`none`:t.current.style.pointerEvents=``},[t,f]),Io(()=>{let e=n.current,f=t.current;if(i||!e||!r||h!==`pointer`||!f){m();return}o.current=e.getBoundingClientRect();let _=e=>{if(e.pointerType===`touch`||e.pointerType===`pen`)return;let t=Date.now();if(t-s.currento.current.right?`left`:`right`,nf.getBoundingClientRect().right||rf.getBoundingClientRect().bottom){m();return}let i=a.current.x,h=a.current.y,g=u.current===`right`?o.current.left-i:i-o.current.right,_=Math.atan2(h-o.current.top,g)+Ox,v=Math.atan2(h-o.current.bottom,g)-Ox,y=Math.atan2(h-r,u.current===`left`?-(n-i):n-i),b=y<_&&y>v;d.current=b?Math.min(d.current+1,Tx):Math.max(d.current-1,0),d.current>=Tx?p(!0):p(!1),s.current=t,a.current={x:n,y:r},b&&(c.current=setTimeout(()=>{m(),l.current=setTimeout(()=>{let e=document.elementFromPoint(n,r);e&&ps(f,e)&&e.dispatchEvent(new PointerEvent(`pointerover`,{bubbles:!0,cancelable:!0}))},100)},Dx))};return window.addEventListener(`pointermove`,_),window.addEventListener(`pointerdown`,g,!0),()=>{window.removeEventListener(`pointermove`,_),window.removeEventListener(`pointerdown`,g,!0),clearTimeout(c.current),clearTimeout(l.current),d.current=Tx}},[i,r,t,h,p,n])}function Ax(e,t,n){let{parentMenuRef:r,submenuRef:i,type:a=`menu`,isDisabled:o,delay:s=200,shouldUseVirtualFocus:c}=e,l=es(),u=es(),{direction:d}=rp(),f=(0,v.useRef)(void 0),p=(0,v.useCallback)(()=>{f.current&&=(clearTimeout(f.current),void 0)},[f]),m=(0,v.useCallback)(e=>{p(),t.open(e)},[t,p]),h=(0,v.useCallback)(()=>{p(),t.close()},[t,p]);Io(()=>()=>{p()},[p]);let{keyboardProps:g}=Sm({shortcuts:{ArrowLeft:e=>{if(!gs(e.currentTarget))return!1;if(d===`ltr`&&ps(e.currentTarget,H(e))){h(),!c&&n.current&&So(n.current);return}return!1},ArrowRight:e=>{if(!gs(e.currentTarget))return!1;if(d===`rtl`&&ps(e.currentTarget,H(e))){h(),!c&&n.current&&So(n.current);return}return!1},Escape:e=>{if(!gs(e.currentTarget))return!1;if(ps(i.current,H(e))){h(),!c&&n.current&&So(n.current);return}return!1}}}),_={id:u,"aria-labelledby":l,submenuLevel:t.submenuLevel,...a===`menu`&&{onClose:t.closeAll,autoFocus:t.focusStrategy??void 0,...g}},{keyboardProps:y}=Sm({shortcuts:{ArrowRight:()=>{if(!o){if(d===`ltr`){t.isOpen||m(`first`),a===`menu`&&i?.current&&ms()===n?.current&&So(i.current);return}if(t.isOpen){h();return}return!1}return!1},ArrowLeft:()=>{if(!o){if(d===`rtl`){t.isOpen||m(`first`),a===`menu`&&i?.current&&ms()===n?.current&&So(i.current);return}if(t.isOpen){h();return}return!1}return!1}}});return nc(r,`focusin`,e=>{t.isOpen&&ps(r.current,H(e))&&H(e)!==n.current&&h()}),kx({menuRef:r,submenuRef:i,isOpen:t.isOpen,isDisabled:o}),{submenuTriggerProps:{onKeyDown:y.onKeyDown,onKeyUp:y.onKeyUp,id:l,"aria-controls":t.isOpen?u:void 0,"aria-haspopup":o?void 0:a,"aria-expanded":t.isOpen?`true`:`false`,onPressStart:e=>{!o&&(e.pointerType===`virtual`||e.pointerType===`keyboard`)&&m(`first`)},onPress:e=>{!o&&(e.pointerType===`touch`||e.pointerType===`mouse`)&&m()},onHoverChange:e=>{o||(e&&!t.isOpen?f.current||=setTimeout(()=>{m()},s):e||p())},isOpen:t.isOpen},submenuProps:_,popoverProps:{isNonModal:!0,shouldCloseOnInteractOutside:e=>e!==n.current}}}function jx(e){let t=gv(e),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)([]),o=()=>{a([]),t.close()},s=(e,t)=>{a(n=>t>n.length?n:[...n.slice(0,t),e])},c=(e,t)=>{a(n=>n[t]===e?n.slice(0,t):n)};return{focusStrategy:n,...t,open(e=null){r(e),t.open()},toggle(e=null){r(e),t.toggle()},close(){o()},expandedKeysStack:i,openSubmenu:s,closeSubmenu:c}}function Mx(e,t){let{triggerKey:n}=e,{expandedKeysStack:r,openSubmenu:i,closeSubmenu:a,close:o}=t,[s]=(0,v.useState)(r?.length),c=(0,v.useMemo)(()=>r[s]===n,[r,n,s]),[l,u]=(0,v.useState)(null),d=(0,v.useCallback)(e=>{u(e??null),i(n,s)},[i,s,n]),f=(0,v.useCallback)(()=>{u(null),a(n,s)},[a,s,n]),p=(0,v.useCallback)(e=>{u(e??null),c?f():d(e)},[f,d,c]);return(0,v.useMemo)(()=>({focusStrategy:l,isOpen:c,open:d,close:f,closeAll:o,submenuLevel:s,setOpen:()=>{},toggle:p,point:null,setPoint:()=>{}}),[c,d,f,o,l,p,s])}var Nx=class e extends Set{constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}},Px=class e{constructor(e,t,n){this.collection=e,this.state=t,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null,this.fullCollection=n?.fullCollection||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys===`all`?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode===`none`)return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys===`all`?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!==`all`&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys===`all`)return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(e=>t.has(e)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&yx(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&yx(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n;if(this.state.selectedKeys===`all`)n=new Nx([t],t,t);else{let e=this.state.selectedKeys,r=e.anchorKey??t;n=new Nx(e,r,t);for(let i of this.getKeyRange(r,e.currentKey??t))n.delete(i);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&n.add(e)}this.state.setSelectedKeys(n)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?yx(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let n=[],r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e&&(e.type===`item`||e.type===`cell`&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type===`cell`&&this.allowsCellSelection)return e;for(;t&&t.type!==`item`&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!==`item`?null:t.key}toggleSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new Nx(this.state.selectedKeys===`all`?this.getSelectAllKeys():this.state.selectedKeys);n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new Nx([t],t,t):new Nx;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode===`none`)return;let t=new Nx;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode===`single`))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=this.fullCollection??this.collection,t=[],n=r=>{for(;r!=null;){if(this.canSelectItemIn(r,e)){let i=e.getItem(r);i?.type===`item`&&t.push(r),i?.hasChildNodes&&(this.allowsCellSelection||i.type!==`item`)&&n(gx(hx(i,e))?.key??null)}r=e.getKeyAfter(r)}};return n(e.getFirstKey()),t}selectAll(){!this.isSelectAll&&this.selectionMode===`multiple`&&this.state.setSelectedKeys(`all`)}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys===`all`||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Nx)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!==`none`&&(this.selectionMode===`single`?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior===`toggle`||t&&(t.pointerType===`touch`||t.pointerType===`virtual`)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,t){if(this.state.selectionMode===`none`||this.state.disabledKeys.has(e))return!1;let n=t.getItem(e);return!(!n||n?.props?.isDisabled||n.type===`cell`&&!this.allowsCellSelection)}isDisabled(e){let t=this.collection.getItem(e);return this.state.disabledBehavior===`all`&&(this.state.disabledKeys.has(e)||!!t?.props?.isDisabled)&&t?.props?.disabledBehavior!==`selection`}isLink(e){return!!this.collection.getItem(e)?.props?.href}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(t){return new e(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}},Fx=class{constructor(e,{expandedKeys:t}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e,t||=new Set;let n=e=>{if(this.keyMap.set(e.key,e),e.childNodes&&(e.type===`section`||t.has(e.key)))for(let t of e.childNodes)n(t)};for(let t of e)n(t);let r=null,i=0;for(let[e,t]of this.keyMap)r?(r.nextKey=e,t.prevKey=r.key):(this.firstKey=e,t.prevKey=void 0),t.type===`item`&&(t.index=i++),r=t,r.nextKey=void 0;this.lastKey=r?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey??null:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}},Ix=class{build(e,t){return this.context=t,Lx(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:t,items:n}=e;if(v.isValidElement(t)&&t.type===v.Fragment)yield*this.iterateCollection({children:t.props.children,items:n});else if(typeof t==`function`){if(!n)throw Error(`props.children was a function but props.items is missing`);let e=0;for(let r of n)yield*this.getFullNode({value:r,index:e},{renderer:t}),e++}else{let e=[];v.Children.forEach(t,t=>{t&&e.push(t)});let n=0;for(let t of e){let e=this.getFullNode({element:t,index:n},{});for(let t of e)n++,yield t}}}getKey(e,t,n,r){if(e.key!=null)return e.key;if(t.type===`cell`&&t.key!=null)return`${r}${t.key}`;let i=t.value;if(i!=null){let e=i.key??i.id;if(e==null)throw Error(`No key found for item`);return e}return r?`${r}.${t.index}`:`$.${t.index}`}getChildState(e,t){return{renderer:t.renderer||e.renderer}}*getFullNode(e,t,n,r){if(v.isValidElement(e.element)&&e.element.type===v.Fragment){let i=[];v.Children.forEach(e.element.props.children,e=>{i.push(e)});let a=e.index??0;for(let e of i)yield*this.getFullNode({element:e,index:a++},t,n,r);return}let i=e.element;if(!i&&e.value&&t&&t.renderer){let n=this.cache.get(e.value);if(n&&(!n.shouldInvalidate||!n.shouldInvalidate(this.context))){n.index=e.index,n.parentKey=r?r.key:null,yield n;return}i=t.renderer(e.value)}if(v.isValidElement(i)){let a=i.type;if(typeof a!=`function`&&typeof a.getCollectionNode!=`function`){let e=i.type;throw Error(`Unknown element <${e}> in collection.`)}let o=a.getCollectionNode(i.props,this.context),s=e.index??0,c=o.next();for(;!c.done&&c.value;){let a=c.value;e.index=s;let l=a.key??null;l??=a.element?null:this.getKey(i,e,t,n);let u=[...this.getFullNode({...a,key:l,index:s,wrapper:Rx(e.wrapper,a.wrapper)},this.getChildState(t,a),n?`${n}${i.key}`:i.key,r)];for(let t of u){if(t.value=a.value??e.value??null,t.value&&this.cache.set(t.value,t),e.type&&t.type!==e.type)throw Error(`Unsupported type <${zx(t.type)}> in <${zx(r?.type??`unknown parent type`)}>. Only <${zx(e.type)}> is supported.`);s++,yield t}c=o.next(u)}return}if(e.key==null||e.type==null)return;let a=this,o={type:e.type,props:e.props,key:e.key,parentKey:r?r.key:null,value:e.value??null,level:(r?.level??0)+ +(r?.type===`item`),index:e.index,rendered:e.rendered,textValue:e.textValue??``,"aria-label":e[`aria-label`],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:Lx(function*(){if(!e.hasChildNodes||!e.childNodes)return;let n=0;for(let r of e.childNodes()){r.key!=null&&(r.key=`${o.key}${r.key}`);let e=a.getFullNode({...r,index:n},a.getChildState(t,r),o.key,o);for(let t of e)n++,yield t}})};yield o}constructor(){this.cache=new WeakMap}};function Lx(e){let t=[],n=null;return{*[Symbol.iterator](){for(let e of t)yield e;n||=e();for(let e of n)t.push(e),yield e}}}function Rx(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function zx(e){return e[0].toUpperCase()+e.slice(1)}function Bx(e,t,n){let r=(0,v.useMemo)(()=>new Ix,[]),{children:i,items:a,collection:o}=e;return(0,v.useMemo)(()=>o||t(r.build({children:i,items:a},n)),[r,i,a,o,n,t])}function Vx(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Hx(e){let{selectionMode:t=`none`,disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i=`toggle`,disabledBehavior:a=`all`}=e,o=(0,v.useRef)(!1),[,s]=(0,v.useState)(!1),c=(0,v.useRef)(null),l=(0,v.useRef)(null),[,u]=(0,v.useState)(null),[d,f]=sh((0,v.useMemo)(()=>Ux(e.selectedKeys),[e.selectedKeys]),(0,v.useMemo)(()=>Ux(e.defaultSelectedKeys,new Nx),[e.defaultSelectedKeys]),e.onSelectionChange),p=(0,v.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[m,h]=(0,v.useState)(i);i===`replace`&&m===`toggle`&&typeof d==`object`&&d.size===0&&h(`replace`);let g=(0,v.useRef)(i);return(0,v.useEffect)(()=>{i!==g.current&&(h(i),g.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:m,setSelectionBehavior:h,get isFocused(){return o.current},setFocused(e){o.current=e,s(e)},get focusedKey(){return c.current},get childFocusStrategy(){return l.current},setFocusedKey(e,t=`first`){c.current=e,l.current=t,u(e)},selectedKeys:d,setSelectedKeys(e){(r||!Vx(e,d))&&f(e)},disabledKeys:p,disabledBehavior:a}}function Ux(e,t){return e?e===`all`?`all`:new Nx(e):t}function Wx(e){let{onExpandedChange:t}=e,[n,r]=sh(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,t),i=Hx(e),a=(0,v.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),o=Bx(e,(0,v.useCallback)(e=>new Fx(e,{expandedKeys:n}),[n]),null);return(0,v.useEffect)(()=>{i.focusedKey!=null&&!o.getItem(i.focusedKey)&&i.setFocusedKey(null)},[o,i.focusedKey]),{collection:o,expandedKeys:n,disabledKeys:a,toggleKey:e=>{r(Gx(n,e))},setExpandedKeys:r,selectionManager:new Px(o,i)}}function Gx(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}var Kx=(0,v.createContext)(null),qx=(0,v.createContext)(null),Jx=(0,v.createContext)(null),Yx=(0,v.createContext)(null);function Xx(e){let t=jx(e),n=(0,v.useRef)(null),{menuTriggerProps:r,menuProps:i}=Yb({...e,type:`menu`},t,n),a=(0,v.useRef)(null);return Uf()?null:v.createElement(jf,{values:[[Kx,{...i,ref:a}],[cS,t],[Jx,t],[_v,{trigger:`MenuTrigger`,triggerRef:n,scrollRef:a,placement:`bottom start`,"aria-labelledby":i[`aria-labelledby`],offset:e.trigger===`contextMenu`?0:void 0}]]},v.createElement(lv,{...r,ref:n,isPressed:t.isOpen},e.children))}var Zx=(0,v.createContext)(null),Qx=qv(class extends xv{static{this.type=`submenutrigger`}filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}},(e,t,n)=>{let{CollectionBranch:r}=(0,v.useContext)(ny),i=(0,v.useContext)(qx),a=(0,v.useContext)(Jx),o=Mx({triggerKey:n.key},a),s=(0,v.useRef)(null),c=Is(t),{parentMenuRef:l,shouldUseVirtualFocus:u}=(0,v.useContext)(Zx),{submenuTriggerProps:d,submenuProps:f,popoverProps:p}=Ax({parentMenuRef:l,submenuRef:s,delay:e.delay,shouldUseVirtualFocus:u},o,c);return v.createElement(jf,{values:[[iS,{...d,onAction:void 0,ref:c}],[Kx,{ref:s,...f}],[cS,o],[_v,{trigger:`SubmenuTrigger`,triggerRef:c,placement:`end top`,"aria-labelledby":f[`aria-labelledby`],...p}]]},v.createElement(r,{collection:i.collection,parent:n}),e.children[1])},e=>e.children[0]),$x=(0,v.forwardRef)(function(e,t){return[e,t]=Ff(e,t,Kx),v.createElement(Rv,{content:v.createElement(Xv,e)},n=>v.createElement(eS,{props:e,collection:n,menuRef:t}))});function eS({props:e,collection:t,menuRef:n}){[e,n]=Ff(e,n,Jy);let{filter:r,...i}=e,a=(0,v.useMemo)(()=>r?t.filter(r):t,[t,r]),o=Wx({...e,collection:a,children:void 0}),s=(0,v.useContext)(Jx),{isVirtualized:c,CollectionRoot:l}=(0,v.useContext)(ny),{menuProps:u}=dx({...e,isVirtualized:c,onClose:e.onClose||s?.close},o,n),d=Mf({...e,children:void 0,defaultClassName:`react-aria-Menu`,values:{isEmpty:o.collection.size===0}}),f=null;o.collection.size===0&&e.renderEmptyState&&(f=v.createElement(`div`,{role:`menuitem`,style:{display:`contents`}},e.renderEmptyState()));let p=W(e,{global:!0});return v.createElement(Sg,null,v.createElement(q.div,{...U(p,d,u),ref:n,slot:e.slot||void 0,"data-empty":o.collection.size===0||void 0,onScroll:e.onScroll},v.createElement(jf,{values:[[qx,o],[ab,{elementType:`div`}],[Qv,{name:`MenuSection`,render:nS}],[Zx,{parentMenuRef:n,shouldUseVirtualFocus:i?.shouldUseVirtualFocus}],[iS,{shouldCloseOnSelect:e.shouldCloseOnSelect}],[Jy,null],[Yy,null],[Yx,o.selectionManager],[Jx,s??jx({})]]},v.createElement(eb,null,v.createElement(l,{collection:o.collection,persistedKeys:ry(o.selectionManager.focusedKey),scrollRef:n}))),f))}var tS=class extends Px{constructor(e,t){super(e.collection,t),this.parent=e}get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,t){return this.parent.setFocusedKey(e,t)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}};function nS(e,t,n,r=`react-aria-MenuSection`){let i=(0,v.useContext)(qx),{CollectionBranch:a}=(0,v.useContext)(ny),[o,s]=If(),{headingProps:c,groupProps:l}=wx({heading:s,"aria-label":n.props[`aria-label`]??void 0}),u=Mf({...e,id:void 0,children:void 0,defaultClassName:r,className:n.props?.className,style:n.props?.style,values:void 0}),d=(0,v.useContext)(Yx),f=Hx(e),p=e.selectionMode==null?d:new tS(d,f),m=Pf(iS)?.shouldCloseOnSelect,h=W(e,{global:!0});return delete h.id,v.createElement(q.section,{...U(h,u,l),ref:t},v.createElement(jf,{values:[[Zy,{...c,ref:o}],[Yx,p],[iS,{shouldCloseOnSelect:e.shouldCloseOnSelect??m}]]},v.createElement(a,{collection:i.collection,parent:n})))}var rS=qv(Tv,nS),iS=(0,v.createContext)(null),aS=Kv(wv,function(e,t,n){[e,t]=Ff(e,t,iS);let r=Pf(iS)?.id,i=(0,v.useContext)(qx),a=Is(t),o=(0,v.useContext)(Yx),{isVirtualized:s}=(0,v.useContext)(ny),{menuItemProps:c,labelProps:l,descriptionProps:u,keyboardShortcutProps:d,...f}=Cx({...e,id:r,key:n.key,selectionManager:o,isVirtualized:s},i,a),{hoverProps:p,isHovered:m}=eh({isDisabled:f.isDisabled}),h=Mf({...e,id:void 0,children:n.rendered,defaultClassName:`react-aria-MenuItem`,values:{...f,isHovered:m,isFocusVisible:f.isFocusVisible,selectionMode:o.selectionMode,selectionBehavior:o.selectionBehavior,hasSubmenu:!!e[`aria-haspopup`],isOpen:e[`aria-expanded`]===`true`}}),g=e.href?q.a:q.div,_=W(e,{global:!0});return delete _.id,delete _.onClick,v.createElement(g,{...U(_,h,c,p),ref:a,"data-disabled":f.isDisabled||void 0,"data-hovered":m||void 0,"data-focused":f.isFocused||void 0,"data-focus-visible":f.isFocusVisible||void 0,"data-pressed":f.isPressed||void 0,"data-selected":f.isSelected||void 0,"data-selection-mode":o.selectionMode===`none`?void 0:o.selectionMode,"data-has-submenu":!!e[`aria-haspopup`]||void 0,"data-open":e[`aria-expanded`]===`true`||void 0},v.createElement(jf,{values:[[sb,{slots:{[Af]:l,label:l,description:u}}],[Qy,d],[nb,{isSelected:f.isSelected}]]},h.children))});function oS(e,t){let{role:n=`dialog`}=e,r=ns();r=e[`aria-label`]?void 0:r;let i=ns();i=n===`alertdialog`&&!e[`aria-describedby`]?i:void 0;let a=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(t.current&&!gs(t.current)){sm(t.current);let e=setTimeout(()=>{(ms()===t.current||ms()===document.body)&&(a.current=!0,t.current&&(t.current.blur(),sm(t.current)),a.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),hv(),(0,v.useRef)(!1),(0,v.useEffect)(()=>{});let o=e[`aria-describedby`]??i;return{dialogProps:{...W(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e[`aria-labelledby`]??r,"aria-describedby":o,onBlur:e=>{a.current&&e.stopPropagation()}},titleProps:{id:r},contentProps:{id:i}}}var sS=(0,v.createContext)(null),cS=(0,v.createContext)(null);function lS(e){let t=jx(e),n=(0,v.useRef)(null),{triggerProps:r,overlayProps:i}=qb({type:`dialog`},t,n);return r.id=es(),i[`aria-labelledby`]=r.id,v.createElement(jf,{values:[[cS,t],[Jx,t],[sS,i],[_v,{trigger:`DialogTrigger`,triggerRef:n,id:i.id,"aria-labelledby":i[`aria-labelledby`]}]]},v.createElement(lv,{...r,ref:n,isPressed:t.isOpen},e.children))}var uS=(0,v.forwardRef)(function(e,t){let n=e[`aria-labelledby`];[e,t]=Ff(e,t,sS);let{dialogProps:r,titleProps:i,contentProps:a}=oS({...e,"aria-labelledby":n},t),o=(0,v.useContext)(cS);!r[`aria-label`]&&!r[`aria-labelledby`]&&e[`aria-labelledby`]&&(r[`aria-labelledby`]=e[`aria-labelledby`]);let s=Mf({defaultClassName:`react-aria-Dialog`,className:e.className,style:e.style,children:e.children,values:{close:o?.close||(()=>{})}}),c=W(e,{global:!0});return v.createElement(q.section,{...U(c,s,r),render:e.render,ref:t,slot:e.slot||void 0},v.createElement(jf,{values:[[_h,{slots:{[Af]:{},title:{...i,level:2}}}],[sb,{slots:{[Af]:{},description:a}}],[th,{slots:{[Af]:{},close:{onPress:()=>o?.close()}}}]]},s.children))});function dS(e,t,n){let{overlayProps:r,underlayProps:i}=Zg({...e,isOpen:t.isOpen,onClose:t.close},n);return t_({isDisabled:!t.isOpen}),hv(),(0,v.useEffect)(()=>{if(t.isOpen&&n.current)return Uh([n.current],{shouldUseInert:!0})},[t.isOpen,n]),{modalProps:U(r),underlayProps:i}}var fS=(0,v.createContext)(null),pS=(0,v.createContext)(null),mS=(0,v.forwardRef)(function(e,t){if((0,v.useContext)(pS))return v.createElement(vS,{...e,modalRef:t},e.children);let{isDismissable:n,isKeyboardDismissDisabled:r,isOpen:i,defaultOpen:a,onOpenChange:o,children:s,isEntering:c,isExiting:l,UNSTABLE_portalContainer:u,shouldCloseOnInteractOutside:d,...f}=e;return v.createElement(gS,{isDismissable:n,isKeyboardDismissDisabled:r,isOpen:i,defaultOpen:a,onOpenChange:o,isEntering:c,isExiting:l,UNSTABLE_portalContainer:u,shouldCloseOnInteractOutside:d},v.createElement(vS,{...f,modalRef:t},s))});function hS(e,t){[e,t]=Ff(e,t,fS);let n=(0,v.useContext)(cS),r=gv(e),i=e.isOpen!=null||e.defaultOpen!=null||!n?r:n,a=Is(t),o=(0,v.useRef)(null),s=pc(a,i.isOpen),c=pc(o,i.isOpen),l=s||c||e.isExiting||!1,u=Jo();return!i.isOpen&&!l||u?null:v.createElement(_S,{...e,state:i,isExiting:l,overlayRef:a,modalRef:o})}var gS=(0,v.forwardRef)(hS);function _S({UNSTABLE_portalContainer:e,...t}){let n=t.modalRef,{state:r}=t,{modalProps:i,underlayProps:a}=dS(t,r,n),o=fc(t.overlayRef)||t.isEntering||!1,s=Mf({...t,defaultClassName:`react-aria-ModalOverlay`,values:{isEntering:o,isExiting:t.isExiting,state:r}}),c=Zs(),l,u;if(typeof document<`u`){let e=Ws(document.body)?document.body:document.scrollingElement||document.documentElement,t=e.getBoundingClientRect().width%1,n=e.getBoundingClientRect().height%1;l=e.scrollWidth-t,u=e.scrollHeight-n}let d={...s.style,"--visual-viewport-width":c.width+`px`,"--visual-viewport-height":c.height+`px`,"--page-width":l===void 0?void 0:l+`px`,"--page-height":u===void 0?void 0:u+`px`};return v.createElement(mv,{isExiting:t.isExiting,portalContainer:e},v.createElement(q.div,{...U(W(t,{global:!0}),a),...s,style:d,ref:t.overlayRef,"data-entering":o||void 0,"data-exiting":t.isExiting||void 0},v.createElement(jf,{values:[[pS,{modalProps:i,modalRef:n,isExiting:t.isExiting,isDismissable:t.isDismissable}],[cS,r]]},s.children)))}function vS(e){let{modalProps:t,modalRef:n,isExiting:r,isDismissable:i}=(0,v.useContext)(pS),a=(0,v.useContext)(cS),o=Is((0,v.useMemo)(()=>ys(e.modalRef,n),[e.modalRef,n])),s=fc(o),c=Mf({...e,defaultClassName:`react-aria-Modal`,values:{isEntering:s,isExiting:r,state:a}});return v.createElement(q.div,{...U(W(e,{global:!0}),t),...c,ref:o,"data-entering":s||void 0,"data-exiting":r||void 0},i&&v.createElement(cv,{onDismiss:a.close}),c.children)}var yS=v.forwardRef(({children:e,...t},n)=>{n=Is(n);let{pressProps:r}=Rm({...t,ref:n}),{focusableProps:i}=Em(t,n),a=v.Children.only(e);(0,v.useEffect)(()=>{},[n,t.isDisabled]);let o=a.props.ref;return v.cloneElement(a,{...U(r,i,a.props),ref:ys(o,n)})}),bS=({children:e,className:t,slot:n,style:r,variant:i,...a})=>{let o=(0,v.useMemo)(()=>Jd({variant:i}),[i]);return(0,G.jsx)(nh,{"aria-label":`Close`,className:J(t,o),"data-slot":`close-button`,slot:n,style:r,type:`button`,...a,children:t=>typeof e==`function`?e(t):e??(0,G.jsx)(wh,{"data-slot":`close-button-icon`})})},xS=Object.assign(bS,{Root:bS}),SS=(0,v.createContext)({}),CS=({children:e,...t})=>{let n=(0,v.useMemo)(()=>({slots:Bd(),placement:void 0}),[]);return(0,G.jsx)(SS,{value:n,children:(0,G.jsx)(lS,{"data-slot":`alert-dialog-root`,...t,children:e})})},wS=Object.assign(CS,{Root:CS,Trigger:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SS);return(0,G.jsx)(yS,{children:(0,G.jsx)(`div`,{className:Y(r?.trigger,t),"data-slot":`alert-dialog-trigger`,role:`button`,...n,children:e})})},Backdrop:({children:e,className:t,isDismissable:n=!1,isKeyboardDismissDisabled:r=!0,onClick:i,variant:a,...o})=>{let{slots:s}=(0,v.use)(SS),c=(0,v.useMemo)(()=>Bd({variant:a}),[a]),l=(0,v.useMemo)(()=>({slots:{...s,...c}}),[s,c]);return(0,G.jsx)(gS,{className:J(t,c?.backdrop()),"data-slot":`alert-dialog-backdrop`,isDismissable:n,isKeyboardDismissDisabled:r,onClick:e=>{e.stopPropagation(),i?.(e)},...o,children:t=>(0,G.jsxs)(SS,{value:l,children:[typeof e==`function`?e(t):e,` `]})})},Container:({children:e,className:t,placement:n=`auto`,size:r,...i})=>{let{slots:a}=(0,v.use)(SS),o=(0,v.useMemo)(()=>Bd({size:r}),[r]),s=(0,v.useMemo)(()=>({placement:n,slots:{...a,...o}}),[n,a,o]);return(0,G.jsx)(mS,{className:J(t,o?.container()),"data-placement":n,"data-slot":`alert-dialog-container`,...i,children:t=>(0,G.jsx)(SS,{value:s,children:typeof e==`function`?e(t):e})})},Dialog:({children:e,className:t,...n})=>{let{placement:r,slots:i}=(0,v.use)(SS);return(0,G.jsx)(uS,{className:Y(i?.dialog,t),"data-placement":r,"data-slot":`alert-dialog-dialog`,role:`alertdialog`,...n,children:e})},Header:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SS);return(0,G.jsx)(`div`,{className:Y(r?.header,t),"data-slot":`alert-dialog-header`,...n,children:e})},Heading:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SS);return(0,G.jsx)(vh,{className:Y(r?.heading,t),"data-slot":`alert-dialog-heading`,slot:`title`,...n,children:e})},Body:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SS);return(0,G.jsx)(`div`,{className:Y(r?.body,t),"data-slot":`alert-dialog-body`,...n,children:e})},Footer:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SS);return(0,G.jsx)(`div`,{className:Y(r?.footer,t),"data-slot":`alert-dialog-footer`,...n,children:e})},Icon:({children:e,className:t,status:n=`danger`,...r})=>{let i=(0,v.useMemo)(()=>Bd({status:n}),[n]),a=()=>{switch(n){case`default`:return(0,G.jsx)(Th,{"data-slot":`alert-dialog-default-icon`});case`accent`:return(0,G.jsx)(Th,{"data-slot":`alert-dialog-default-icon`});case`success`:return(0,G.jsx)(Oh,{"data-slot":`alert-dialog-default-icon`});case`warning`:return(0,G.jsx)(Eh,{"data-slot":`alert-dialog-default-icon`});case`danger`:return(0,G.jsx)(Dh,{"data-slot":`alert-dialog-default-icon`});default:return(0,G.jsx)(Dh,{"data-slot":`alert-dialog-default-icon`})}};return(0,G.jsx)(K.div,{className:i?.icon({className:t}),"data-slot":`alert-dialog-icon`,...r,children:e??a()})},CloseTrigger:({className:e,...t})=>{let{slots:n}=(0,v.use)(SS);return(0,G.jsx)(xS,{className:J(e,n?.closeTrigger()),"data-slot":`alert-dialog-close-trigger`,slot:`close`,...t})}});function TS(e){let t=lx({usage:`search`,...e}),n=(0,v.useCallback)((e,n)=>n.length===0||(e=e.normalize(`NFC`),n=n.normalize(`NFC`),t.compare(e.slice(0,n.length),n)===0),[t]),r=(0,v.useCallback)((e,n)=>n.length===0||(e=e.normalize(`NFC`),n=n.normalize(`NFC`),t.compare(e.slice(-n.length),n)===0),[t]),i=(0,v.useCallback)((e,n)=>{if(n.length===0)return!0;e=e.normalize(`NFC`),n=n.normalize(`NFC`);let r=0,i=n.length;for(;r+i<=e.length;r++){let a=e.slice(r,r+i);if(t.compare(n,a)===0)return!0}return!1},[t]);return(0,v.useMemo)(()=>({startsWith:n,endsWith:r,contains:i}),[n,r,i])}var ES=(0,v.createContext)({}),DS=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,ES);let{isDisabled:n,isInvalid:r,isReadOnly:i,onHoverStart:a,onHoverChange:o,onHoverEnd:s,...c}=e;n??=!!e[`aria-disabled`]&&e[`aria-disabled`]!==`false`,r??=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`;let{hoverProps:l,isHovered:u}=eh({onHoverStart:a,onHoverChange:o,onHoverEnd:s,isDisabled:n}),{isFocused:d,isFocusVisible:f,focusProps:p}=Jm({within:!0}),m=Mf({...e,values:{isHovered:u,isFocusWithin:d,isFocusVisible:f,isDisabled:n,isInvalid:r},defaultClassName:`react-aria-Group`});return v.createElement(q.div,{...U(c,p,l),...m,ref:t,role:e.role??`group`,slot:e.slot??void 0,"data-focus-within":d||void 0,"data-hovered":u||void 0,"data-focus-visible":f||void 0,"data-disabled":n||void 0,"data-invalid":r||void 0,"data-readonly":i||void 0},m.children)}),OS=(0,v.createContext)(null),kS={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},AS={...kS,customError:!0,valid:!1},jS={isInvalid:!1,validationDetails:kS,validationErrors:[]},MS=(0,v.createContext)({}),NS=`__reactAriaFormValidationState`;function PS(e){if(e.__reactAriaFormValidationState){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}=e[NS];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}}return FS(e)}function FS(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:a,validate:o,validationBehavior:s=`aria`}=e;n&&(t||=n===`invalid`);let c=t===void 0?null:{isInvalid:t,validationErrors:[],validationDetails:AS},l=(0,v.useMemo)(()=>!o||i==null?null:RS(LS(o,i)),[o,i]);a?.validationDetails.valid&&(a=void 0);let u=(0,v.useContext)(MS),d=(0,v.useMemo)(()=>r?Array.isArray(r)?r.flatMap(e=>IS(u[e])):IS(u[r]):[],[u,r]),[f,p]=(0,v.useState)(u),[m,h]=(0,v.useState)(!1);u!==f&&(p(u),h(!1));let g=(0,v.useMemo)(()=>RS(m?[]:d),[m,d]),_=(0,v.useRef)(jS),[y,b]=(0,v.useState)(jS),x=(0,v.useRef)(jS),S=()=>{if(!C)return;w(!1);let e=l||a||_.current;zS(e,x.current)||(x.current=e,b(e))},[C,w]=(0,v.useState)(!1);return(0,v.useEffect)(S),{realtimeValidation:c||g||l||a||jS,displayValidation:s===`native`?c||g||y:c||g||l||a||y,updateValidation(e){s===`aria`&&!zS(y,e)?b(e):_.current=e},resetValidation(){let e=jS;zS(e,x.current)||(x.current=e,b(e)),s===`native`&&w(!1),h(!0)},commitValidation(){s===`native`&&w(!0),h(!0)}}}function IS(e){return e?Array.isArray(e)?e:[e]:[]}function LS(e,t){if(typeof e==`function`){let n=e(t);if(n&&typeof n!=`boolean`)return IS(n)}return[]}function RS(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:AS}:null}function zS(e,t){return e===t||!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,n)=>e===t.validationErrors[n])&&Object.entries(e.validationDetails).every(([e,n])=>t.validationDetails[e]===n)}function BS(...e){let t=new Set,n=!1,r={...kS};for(let i of e){for(let e of i.validationErrors)t.add(e);n||=i.isInvalid;for(let e in r)r[e]||=i.validationDetails[e]}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}var VS=(0,v.createContext)(null),HS=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,VS);let{validationErrors:n,validationBehavior:r=`native`,children:i,className:a,...o}=e;return v.createElement(q.form,{noValidate:r!==`native`,...o,ref:t,className:a||`react-aria-Form`},v.createElement(VS.Provider,{value:{...e,validationBehavior:r}},v.createElement(MS.Provider,{value:n??{}},i)))}),US={};US={colorSwatchPicker:`تغييرات الألوان`,dropzoneLabel:`DropZone`,selectPlaceholder:`حدد عنصرًا`,tableResizer:`أداة تغيير الحجم`};var WS={};WS={colorSwatchPicker:`Цветови мостри`,dropzoneLabel:`DropZone`,selectPlaceholder:`Изберете предмет`,tableResizer:`Преоразмерител`};var GS={};GS={colorSwatchPicker:`Vzorky barev`,dropzoneLabel:`Místo pro přetažení`,selectPlaceholder:`Vyberte položku`,tableResizer:`Změna velikosti`};var KS={};KS={colorSwatchPicker:`Farveprøver`,dropzoneLabel:`DropZone`,selectPlaceholder:`Vælg et element`,tableResizer:`Størrelsesændring`};var qS={};qS={colorSwatchPicker:`Farbfelder`,dropzoneLabel:`Ablegebereich`,selectPlaceholder:`Element wählen`,tableResizer:`Größenanpassung`};var JS={};JS={colorSwatchPicker:`Χρωματικά δείγματα`,dropzoneLabel:`DropZone`,selectPlaceholder:`Επιλέξτε ένα αντικείμενο`,tableResizer:`Αλλαγή μεγέθους`};var YS={};YS={selectPlaceholder:`Select an item`,tableResizer:`Resizer`,dropzoneLabel:`DropZone`,colorSwatchPicker:`Color swatches`};var XS={};XS={colorSwatchPicker:`Muestras de colores`,dropzoneLabel:`DropZone`,selectPlaceholder:`Seleccionar un artículo`,tableResizer:`Cambiador de tamaño`};var ZS={};ZS={colorSwatchPicker:`Värvinäidised`,dropzoneLabel:`DropZone`,selectPlaceholder:`Valige üksus`,tableResizer:`Suuruse muutja`};var QS={};QS={colorSwatchPicker:`Värimallit`,dropzoneLabel:`DropZone`,selectPlaceholder:`Valitse kohde`,tableResizer:`Koon muuttaja`};var $S={};$S={colorSwatchPicker:`Échantillons de couleurs`,dropzoneLabel:`DropZone`,selectPlaceholder:`Sélectionner un élément`,tableResizer:`Redimensionneur`};var eC={};eC={colorSwatchPicker:`דוגמיות צבע`,dropzoneLabel:`DropZone`,selectPlaceholder:`בחר פריט`,tableResizer:`שינוי גודל`};var tC={};tC={colorSwatchPicker:`Uzorci boja`,dropzoneLabel:`Zona spuštanja`,selectPlaceholder:`Odaberite stavku`,tableResizer:`Promjena veličine`};var nC={};nC={colorSwatchPicker:`Színtárak`,dropzoneLabel:`DropZone`,selectPlaceholder:`Válasszon ki egy elemet`,tableResizer:`Átméretező`};var rC={};rC={colorSwatchPicker:`Campioni di colore`,dropzoneLabel:`Zona di rilascio`,selectPlaceholder:`Seleziona un elemento`,tableResizer:`Ridimensionamento`};var iC={};iC={colorSwatchPicker:`カラースウォッチ`,dropzoneLabel:`ドロップゾーン`,selectPlaceholder:`項目を選択`,tableResizer:`サイズ変更ツール`};var aC={};aC={colorSwatchPicker:`색상 견본`,dropzoneLabel:`드롭 영역`,selectPlaceholder:`항목 선택`,tableResizer:`크기 조정기`};var oC={};oC={colorSwatchPicker:`Spalvų pavyzdžiai`,dropzoneLabel:`„DropZone“`,selectPlaceholder:`Pasirinkite elementą`,tableResizer:`Dydžio keitiklis`};var sC={};sC={colorSwatchPicker:`Krāsu paraugi`,dropzoneLabel:`DropZone`,selectPlaceholder:`Izvēlēties vienumu`,tableResizer:`Izmēra mainītājs`};var cC={};cC={colorSwatchPicker:`Fargekart`,dropzoneLabel:`Droppsone`,selectPlaceholder:`Velg et element`,tableResizer:`Størrelsesendrer`};var lC={};lC={colorSwatchPicker:`kleurstalen`,dropzoneLabel:`DropZone`,selectPlaceholder:`Selecteer een item`,tableResizer:`Resizer`};var uC={};uC={colorSwatchPicker:`Próbki kolorów`,dropzoneLabel:`Strefa upuszczania`,selectPlaceholder:`Wybierz element`,tableResizer:`Zmiana rozmiaru`};var dC={};dC={colorSwatchPicker:`Amostras de cores`,dropzoneLabel:`DropZone`,selectPlaceholder:`Selecione um item`,tableResizer:`Redimensionador`};var fC={};fC={colorSwatchPicker:`Amostras de cores`,dropzoneLabel:`DropZone`,selectPlaceholder:`Selecione um item`,tableResizer:`Redimensionador`};var pC={};pC={colorSwatchPicker:`Specimene de culoare`,dropzoneLabel:`Zonă de plasare`,selectPlaceholder:`Selectați un element`,tableResizer:`Instrument de redimensionare`};var mC={};mC={colorSwatchPicker:`Цветовые образцы`,dropzoneLabel:`DropZone`,selectPlaceholder:`Выберите элемент`,tableResizer:`Средство изменения размера`};var hC={};hC={colorSwatchPicker:`Vzorkovníky farieb`,dropzoneLabel:`DropZone`,selectPlaceholder:`Vyberte položku`,tableResizer:`Nástroj na zmenu veľkosti`};var gC={};gC={colorSwatchPicker:`Barvne palete`,dropzoneLabel:`DropZone`,selectPlaceholder:`Izberite element`,tableResizer:`Spreminjanje velikosti`};var _C={};_C={colorSwatchPicker:`Uzorci boje`,dropzoneLabel:`DropZone`,selectPlaceholder:`Izaberite stavku`,tableResizer:`Promena veličine`};var vC={};vC={colorSwatchPicker:`Färgrutor`,dropzoneLabel:`DropZone`,selectPlaceholder:`Välj en artikel`,tableResizer:`Storleksändrare`};var yC={};yC={colorSwatchPicker:`Renk örnekleri`,dropzoneLabel:`Bırakma Bölgesi`,selectPlaceholder:`Bir öğe seçin`,tableResizer:`Yeniden boyutlandırıcı`};var bC={};bC={colorSwatchPicker:`Зразки кольорів`,dropzoneLabel:`DropZone`,selectPlaceholder:`Виберіть елемент`,tableResizer:`Засіб змінення розміру`};var xC={};xC={colorSwatchPicker:`颜色色板`,dropzoneLabel:`放置区域`,selectPlaceholder:`选择一个项目`,tableResizer:`尺寸调整器`};var SC={};SC={colorSwatchPicker:`色票`,dropzoneLabel:`放置區`,selectPlaceholder:`選取項目`,tableResizer:`大小調整器`};var CC={};CC={"ar-AE":US,"bg-BG":WS,"cs-CZ":GS,"da-DK":KS,"de-DE":qS,"el-GR":JS,"en-US":YS,"es-ES":XS,"et-EE":ZS,"fi-FI":QS,"fr-FR":$S,"he-IL":eC,"hr-HR":tC,"hu-HU":nC,"it-IT":rC,"ja-JP":iC,"ko-KR":aC,"lt-LT":oC,"lv-LV":sC,"nb-NO":cC,"nl-NL":lC,"pl-PL":uC,"pt-BR":dC,"pt-PT":fC,"ro-RO":pC,"ru-RU":mC,"sk-SK":hC,"sl-SI":gC,"sr-SP":_C,"sv-SE":vC,"tr-TR":yC,"uk-UA":bC,"zh-CN":xC,"zh-TW":SC};var wC=(0,v.createContext)({}),TC=(0,v.createContext)(null),EC=(0,v.forwardRef)(function(e,t){let{render:n}=(0,v.useContext)(TC);return v.createElement(v.Fragment,null,n(e,t))});function DC(e,t){let n=e?.renderDropIndicator,r=e?.isVirtualDragging?.(),i=(0,v.useCallback)(e=>{if(r||t?.isDropTarget(e))return n?n(e):v.createElement(EC,{target:e})},[t?.target,r,n]);return e?.useDropIndicator?i:void 0}function OC(e,t,n){let r=e.focusedKey,i=null;if(t?.isVirtualDragging?.()&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e!=null;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return(0,v.useMemo)(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}var kC=new WeakMap;function AC(e){return typeof e==`string`?e.replace(/\s*/g,``):``+e}function jC(e,t){let n=kC.get(e);if(!n)throw Error(`Unknown list`);return`${n.id}-option-${AC(t)}`}function MC(e,t,n){let r=W(e,{labelable:!0}),i=e.selectionBehavior||`toggle`,a=e.orientation||`vertical`,o=e.linkBehavior||(i===`replace`?`action`:`override`);i===`toggle`&&o===`action`&&(o=`override`);let{listProps:s}=ux({...e,ref:n,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,linkBehavior:o}),{focusWithinProps:c}=qm({onFocusWithin:e.onFocus,onBlurWithin:e.onBlur,onFocusWithinChange:e.onFocusChange}),l=es(e.id);kC.set(t,{id:l,shouldUseVirtualFocus:e.shouldUseVirtualFocus,shouldSelectOnPressUp:e.shouldSelectOnPressUp,shouldFocusOnHover:e.shouldFocusOnHover,isVirtualized:e.isVirtualized,onAction:e.onAction,linkBehavior:o,UNSTABLE_itemBehavior:e.UNSTABLE_itemBehavior});let{labelProps:u,fieldProps:d}=Kf({...e,id:l,labelElementType:`span`});return{labelProps:u,listBoxProps:U(r,c,t.selectionManager.selectionMode===`multiple`?{"aria-multiselectable":`true`}:{},{role:`listbox`,"aria-orientation":a,...U(d,s)})}}function NC(e,t,n){let{key:r}=e,i=kC.get(t),a=e.isDisabled??t.selectionManager.isDisabled(r),o=e.isSelected??t.selectionManager.isSelected(r),s=e.shouldSelectOnPressUp??i?.shouldSelectOnPressUp,c=e.shouldFocusOnHover??i?.shouldFocusOnHover,l=e.shouldUseVirtualFocus??i?.shouldUseVirtualFocus,u=e.isVirtualized??i?.isVirtualized,d=ns(),f=ns(),p={role:`option`,"aria-disabled":a||void 0,"aria-selected":t.selectionManager.selectionMode===`none`?void 0:o,"aria-label":e[`aria-label`],"aria-labelledby":d,"aria-describedby":f},m=t.collection.getItem(r);if(u){let e=Number(m?.index);p[`aria-posinset`]=Number.isNaN(e)?void 0:e+1,p[`aria-setsize`]=Sx(t.collection)}let h=i?.onAction?()=>i?.onAction?.(r):void 0,g=jC(t,r),{itemProps:_,isPressed:v,isFocused:y,hasAction:b,allowsSelection:x}=fx({selectionManager:t.selectionManager,key:r,ref:n,shouldSelectOnPressUp:s,allowsDifferentPressOrigin:s&&c,isVirtualized:u,shouldUseVirtualFocus:l,isDisabled:a,onAction:h||m?.props?.onAction?rs(m?.props?.onAction,h):void 0,linkBehavior:i?.linkBehavior,UNSTABLE_itemBehavior:i?.UNSTABLE_itemBehavior,id:g}),{hoverProps:S}=eh({isDisabled:a||!c,onHoverStart(){$p()||(t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(r))}}),C=W(m?.props);delete C.id;let w=Po(m?.props);return{optionProps:{...p,...U(C,_,S,w),id:g},labelProps:{id:d},descriptionProps:{id:f},isFocused:y,isFocusVisible:y&&t.selectionManager.isFocused&&$p(),isSelected:o,isDisabled:a,isPressed:v,allowsSelection:x,hasAction:b}}function PC(e){let{heading:t,"aria-label":n}=e,r=es();return{itemProps:{role:`presentation`},headingProps:t?{id:r,role:`presentation`,onMouseDown:e=>{e.preventDefault()}}:{},groupProps:{role:`group`,"aria-label":n,"aria-labelledby":t?r:void 0}}}var FC=class{constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let t=e=>{if(this.keyMap.set(e.key,e),e.childNodes&&e.type===`section`)for(let n of e.childNodes)t(n)};for(let n of e)t(n);let n=null,r=0,i=0;for(let[e,t]of this.keyMap)n?(n.nextKey=e,t.prevKey=n.key):(this.firstKey=e,t.prevKey=void 0),t.type===`item`&&(t.index=r++),(t.type===`section`||t.type===`item`)&&i++,n=t,n.nextKey=void 0;this._size=i,this.lastKey=n?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey??null:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}getChildren(e){return this.keyMap.get(e)?.childNodes||[]}};function IC(e){let{filter:t,layoutDelegate:n}=e,r=Hx(e),i=(0,v.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),a=Bx(e,(0,v.useCallback)(e=>t?new FC(t(e)):new FC(e),[t]),(0,v.useMemo)(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning])),o=(0,v.useMemo)(()=>new Px(a,r,{layoutDelegate:n}),[a,r,n]);return RC(a,o),{collection:a,disabledKeys:i,selectionManager:o}}function LC(e,t){let n=(0,v.useMemo)(()=>t?e.collection.filter(t):e.collection,[e.collection,t]),r=e.selectionManager.withCollection(n);return RC(n,r),{collection:n,selectionManager:r,disabledKeys:e.disabledKeys}}function RC(e,t){let n=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&n.current){let r=n.current.getKeyAfter(t.focusedKey),i=null;for(;r!=null;){let a=e.getItem(r);if(a&&a.type===`item`&&!t.isDisabled(r)){i=r;break}r=n.current.getKeyAfter(r)}if(i==null)for(r=n.current.getKeyBefore(t.focusedKey);r!=null;){let a=e.getItem(r);if(a&&a.type===`item`&&!t.isDisabled(r)){i=r;break}r=n.current.getKeyBefore(r)}t.setFocusedKey(i)}n.current=e},[e,t])}var zC=(0,v.createContext)(null),BC=(0,v.createContext)(null),VC=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,zC);let n=(0,v.useContext)(BC);return n?v.createElement(UC,{state:n,props:e,listBoxRef:t}):v.createElement(Rv,{content:v.createElement(Xv,e)},n=>v.createElement(HC,{props:e,listBoxRef:t,collection:n}))});function HC({props:e,listBoxRef:t,collection:n}){e={...e,collection:n,children:null,items:null};let{layoutDelegate:r}=(0,v.useContext)(ny),i=IC({...e,layoutDelegate:r});return v.createElement(UC,{state:i,props:e,listBoxRef:t})}function UC({state:e,props:t,listBoxRef:n}){[t,n]=Ff(t,n,Jy);let{dragAndDropHooks:r,layout:i=`stack`,orientation:a=`vertical`,filter:o}=t,s=LC(e,o),{collection:c,selectionManager:l}=s,u=!!r?.useDraggableCollectionState,d=!!r?.useDroppableCollectionState,{direction:f}=rp(),{disabledBehavior:p,disabledKeys:m}=l,h=lx({usage:`search`,sensitivity:`base`}),{isVirtualized:g,layoutDelegate:_,dropTargetDelegate:y,CollectionRoot:b}=(0,v.useContext)(ny),x=(0,v.useMemo)(()=>t.keyboardDelegate||new sx({collection:c,collator:h,ref:n,disabledKeys:m,disabledBehavior:p,layout:i,orientation:a,direction:f,layoutDelegate:_}),[c,h,n,p,m,a,f,t.keyboardDelegate,i,_]),{listBoxProps:S}=MC({...t,shouldSelectOnPressUp:u||t.shouldSelectOnPressUp,keyboardDelegate:x,isVirtualized:g},s,n);(0,v.useRef)(u),(0,v.useRef)(d),(0,v.useEffect)(()=>{},[u,d]);let C,w,T,E=!1,D=null,O=(0,v.useRef)(null);if(u&&r){C=r.useDraggableCollectionState({collection:c,selectionManager:l,preview:r.renderDragPreview?O:void 0}),r.useDraggableCollection({},C,n);let e=r.DragPreview;D=r.renderDragPreview?v.createElement(e,{ref:O},r.renderDragPreview):null}if(d&&r){w=r.useDroppableCollectionState({collection:c,selectionManager:l});let e=r.dropTargetDelegate||y||new r.ListDropTargetDelegate(c,n,{orientation:a,layout:i,direction:f});T=r.useDroppableCollection({keyboardDelegate:x,dropTargetDelegate:e},w,n),E=w.isDropTarget({type:`root`})}let{focusProps:k,isFocused:A,isFocusVisible:j}=Jm(),M=s.collection.size===0,N={isDropTarget:E,isEmpty:M,isFocused:A,isFocusVisible:j,layout:t.layout||`stack`,orientation:a,state:s},P=Mf({...t,children:void 0,defaultClassName:`react-aria-ListBox`,values:N}),ee=null;M&&t.renderEmptyState&&(ee=v.createElement(`div`,{role:`option`,style:{display:`contents`}},t.renderEmptyState(N)));let F=W(t,{global:!0});return v.createElement(Sg,null,v.createElement(q.div,{...U(F,P,S,k,T?.collectionProps),ref:n,slot:t.slot||void 0,onScroll:t.onScroll,"data-drop-target":E||void 0,"data-empty":M||void 0,"data-focused":A||void 0,"data-focus-visible":j||void 0,"data-layout":t.layout||`stack`,"data-orientation":a},v.createElement(jf,{values:[[zC,t],[BC,s],[wC,{dragAndDropHooks:r,dragState:C,dropState:w}],[ab,{elementType:`div`}],[TC,{render:qC}],[Qv,{name:`ListBoxSection`,render:WC}]]},v.createElement(eb,null,v.createElement(b,{collection:c,scrollRef:n,persistedKeys:OC(l,r,w),renderDropIndicator:DC(r,w)}))),ee,D))}function WC(e,t,n,r=`react-aria-ListBoxSection`){let i=(0,v.useContext)(BC),{dragAndDropHooks:a,dropState:o}=(0,v.useContext)(wC),{CollectionBranch:s}=(0,v.useContext)(ny),[c,l]=If(),{headingProps:u,groupProps:d}=PC({heading:l,"aria-label":e[`aria-label`]??void 0}),f=Mf({...e,id:void 0,children:void 0,defaultClassName:r,values:void 0}),p=W(e,{global:!0});return delete p.id,v.createElement(q.section,{...U(p,f,d),ref:t},v.createElement(Zy.Provider,{value:{...u,ref:c}},v.createElement(s,{collection:i.collection,parent:n,renderDropIndicator:DC(a,o)})))}var GC=qv(Tv,WC),KC=Kv(wv,function(e,t,n){let r=Is(t),i=(0,v.useContext)(BC),{dragAndDropHooks:a,dragState:o,dropState:s}=(0,v.useContext)(wC),c=o&&!(o.isDisabled||o.selectionManager.isDisabled(n.key)),{optionProps:l,labelProps:u,descriptionProps:d,...f}=NC({key:n.key,"aria-label":e?.[`aria-label`]},i,r),{hoverProps:p,isHovered:m}=eh({isDisabled:!f.allowsSelection&&!f.hasAction&&!c,onHoverStart:n.props.onHoverStart,onHoverChange:n.props.onHoverChange,onHoverEnd:n.props.onHoverEnd}),{keyboardProps:h}=Sm(e),{focusProps:g}=cm(e),_=null;o&&a&&(_=a.useDraggableItem({key:n.key,hasAction:f.hasAction},o));let y=null;s&&a&&(y=a.useDroppableItem({target:{type:`item`,key:n.key,dropPosition:`on`}},s,r));let b=o&&o.isDragging(n.key),x=Mf({...e,id:void 0,children:e.children,defaultClassName:`react-aria-ListBoxItem`,values:{...f,isHovered:m,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,allowsDragging:!!o,isDragging:b,isDropTarget:y?.isDropTarget}});(0,v.useEffect)(()=>{n.textValue},[n.textValue]);let S=e.href?q.a:q.div,C=W(e,{global:!0});return delete C.id,delete C.onClick,e.href&&l.tabIndex==null&&(l.tabIndex=-1),v.createElement(S,{...U(C,x,l,p,h,g,_?.dragProps,y?.dropProps),ref:r,"data-allows-dragging":!!o||void 0,"data-selected":f.isSelected||void 0,"data-disabled":f.isDisabled||void 0,"data-hovered":m||void 0,"data-focused":f.isFocused||void 0,"data-focus-visible":f.isFocusVisible||void 0,"data-pressed":f.isPressed||void 0,"data-dragging":b||void 0,"data-drop-target":y?.isDropTarget||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode},v.createElement(jf,{values:[[sb,{slots:{[Af]:u,label:u,description:d}}],[nb,{isSelected:f.isSelected}]]},x.children))});function qC(e,t){t=Is(t);let{dragAndDropHooks:n,dropState:r}=(0,v.useContext)(wC),{dropIndicatorProps:i,isHidden:a,isDropTarget:o}=n.useDropIndicator(e,r,t);return a?null:v.createElement(YC,{...e,dropIndicatorProps:i,isDropTarget:o,ref:t})}function JC(e,t){let{dropIndicatorProps:n,isDropTarget:r,...i}=e,a=Mf({...i,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:r}});return v.createElement(v.Fragment,null,v.createElement(q.div,{...n,...a,role:`option`,ref:t,"data-drop-target":r||void 0}))}var YC=(0,v.forwardRef)(JC);Kv(Cv,function(e,t,n){let r=(0,v.useContext)(BC),{isLoading:i,onLoadMore:a,scrollOffset:o,...s}=e,c=(0,v.useRef)(null);lc((0,v.useMemo)(()=>({onLoadMore:a,collection:r?.collection,sentinelRef:c,scrollOffset:o}),[a,o,r?.collection]),c);let l=Mf({...s,id:void 0,children:n.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return v.createElement(v.Fragment,null,v.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:uc(!0)},v.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:c,style:{position:`absolute`,height:1,width:1}})),i&&l.children&&v.createElement(v.Fragment,null,v.createElement(q.div,{...U(W(e,{global:!0}),{tabIndex:-1}),...l,role:`option`,ref:t},l.children)))});function XC(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:a,fieldProps:o}=Kf(e),s=ns([!!t,!!n,r,i]),c=ns([!!t,!!n,r,i]);return o=U(o,{"aria-describedby":[s,c,e[`aria-describedby`]].filter(Boolean).join(` `)||void 0}),{labelProps:a,fieldProps:o,descriptionProps:{id:s},errorMessageProps:{id:c}}}var ZC=new WeakMap;function QC(e,t,n){let{keyboardDelegate:r,isDisabled:i,isRequired:a,name:o,form:s,validationBehavior:c=`aria`}=e,l=lx({usage:`search`,sensitivity:`base`}),u=(0,v.useMemo)(()=>r||new sx(t.collection,t.disabledKeys,n,l),[r,t.collection,t.disabledKeys,l,n]),{menuTriggerProps:d,menuProps:f}=Yb({isDisabled:i,type:`listbox`},t,n),{keyboardProps:p}=Sm({shortcuts:{ArrowLeft:()=>{if(t.selectionManager.selectionMode===`multiple`)return!1;let e=t.selectedKey==null?u.getFirstKey?.():u.getKeyAbove?.(t.selectedKey);e!=null&&t.setSelectedKey(e)},ArrowRight:()=>{if(t.selectionManager.selectionMode===`multiple`)return!1;let e=t.selectedKey==null?u.getFirstKey?.():u.getKeyBelow?.(t.selectedKey);e!=null&&t.setSelectedKey(e)}},allowRepeats:!0,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp}),{typeSelectProps:m}=rx({keyboardDelegate:u,selectionManager:t.selectionManager,onTypeSelect(e){t.setSelectedKey(e)}}),{isInvalid:h,validationErrors:g,validationDetails:_}=t.displayValidation,{labelProps:y,fieldProps:b,descriptionProps:x,errorMessageProps:S}=XC({...e,labelElementType:`span`,isInvalid:h,errorMessage:e.errorMessage||g});t.selectionManager.selectionMode===`multiple`&&(m={});let C=W(e,{labelable:!0}),w=U(m,d,b),T=es();return ZC.set(t,{isDisabled:i,isRequired:a,name:o,form:s,validationBehavior:c}),{labelProps:{...y,onClick:()=>{e.isDisabled||(n.current?.focus(),tm(`keyboard`))}},triggerProps:U(C,{...w,isDisabled:i,onKeyDown:rs(w.onKeyDown,p.onKeyDown),onKeyUp:p.onKeyUp,"aria-labelledby":[T,w[`aria-labelledby`],w[`aria-label`]&&!w[`aria-labelledby`]?w.id:null].filter(Boolean).join(` `),onFocus(n){t.isFocused||(e.onFocus&&e.onFocus(n),e.onFocusChange&&e.onFocusChange(!0),t.setFocused(!0))},onBlur(n){t.isOpen||(e.onBlur&&e.onBlur(n),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))}}),valueProps:{id:T},menuProps:{...f,onAction:void 0,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:`selection`,onBlur:n=>{ps(n.currentTarget,n.relatedTarget)||(e.onBlur&&e.onBlur(n),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))},"aria-labelledby":[b[`aria-labelledby`],w[`aria-label`]&&!b[`aria-labelledby`]?w.id:null].filter(Boolean).join(` `)},descriptionProps:x,errorMessageProps:S,isInvalid:h,validationErrors:g,validationDetails:_,hiddenSelectProps:{isDisabled:i,name:o,label:e.label,state:t,triggerRef:n,form:s}}}function $C(e,t,n){let{validationBehavior:r,focus:i}=e;Io(()=>{if(r===`native`&&n?.current&&`setCustomValidity`in n.current&&!n.current.disabled){let e=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(` `)||`Invalid value.`:``;n.current.setCustomValidity(e),n.current.hasAttribute(`title`)||(n.current.title=``),t.realtimeValidation.isInvalid||t.updateValidation(tw(n.current))}});let a=(0,v.useRef)(!1),o=Rs(()=>{a.current||t.resetValidation()}),s=Rs(e=>{t.displayValidation.isInvalid||t.commitValidation();let r=n?.current?.form;!e.defaultPrevented&&n&&r&&nw(r)===n.current&&(i?i():n.current?.focus(),tm(`keyboard`)),e.preventDefault()}),c=Rs(()=>{t.commitValidation()});(0,v.useEffect)(()=>{let e=n?.current;if(!e)return;let t=e.form,r=t?.reset;return t&&(t.reset=()=>{a.current=!window.event||window.event.type===`message`&&H(window.event)instanceof MessagePort,r?.call(t),a.current=!1}),e.addEventListener(`invalid`,s),e.addEventListener(`change`,c),t?.addEventListener(`reset`,o),()=>{e.removeEventListener(`invalid`,s),e.removeEventListener(`change`,c),t?.removeEventListener(`reset`,o),t&&(t.reset=r)}},[n,r])}function ew(e){let t=e.validity;return{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing,valid:t.valid}}function tw(e){return{isInvalid:!e.validity.valid,validationDetails:ew(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function nw(e){for(let t=0;tn.current?.focus()},t,e.selectRef);let d=t.setValue,f=(0,v.useCallback)(e=>{let t=H(e);t.multiple?d(Array.from(t.selectedOptions,e=>e.value)):d(e.currentTarget.value)},[d]);return{containerProps:{...u,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":`aria-hidden-focus`},inputProps:{style:{display:`none`}},selectProps:{tabIndex:-1,autoComplete:i,disabled:s,multiple:t.selectionManager.selectionMode===`multiple`,required:c===`native`&&l,name:a,form:o,value:t.value??``,onChange:f,onInput:f}}}function iw(e){let{state:t,triggerRef:n,label:r,name:i,form:a,isDisabled:o}=e,s=(0,v.useRef)(null),c=(0,v.useRef)(null),{containerProps:l,selectProps:u}=rw({...e,selectRef:t.collection.size<=300?s:c},t,n),d=Array.isArray(t.value)?t.value:[t.value];if(t.collection.size<=300)return v.createElement(`div`,{...l,"data-testid":`hidden-select-container`},v.createElement(`label`,null,r,v.createElement(`select`,{...u,ref:s},v.createElement(`option`,{value:``,label:`\xA0`},`\xA0`),[...t.collection.getKeys()].map(e=>{let n=t.collection.getItem(e);if(n&&n.type===`item`)return v.createElement(`option`,{key:n.key,value:n.key},n.textValue)}),t.collection.size===0&&i&&d.map((e,t)=>v.createElement(`option`,{key:t,value:e??``})))));if(i){let{validationBehavior:e}=ZC.get(t)||{};d.length===0&&(d=[null]);let n=d.map((t,n)=>{let r={type:`hidden`,autoComplete:u.autoComplete,name:i,form:a,disabled:o,value:t??``};return e===`native`?v.createElement(`input`,{key:n,...r,ref:n===0?c:null,style:{display:`none`},type:`text`,required:n===0&&u.required,onChange:()=>{}}):v.createElement(`input`,{key:n,...r,ref:n===0?c:null})});return v.createElement(v.Fragment,null,n)}return null}function aw(e){let{selectionMode:t=`single`,shouldCloseOnSelect:n=t===`single`}=e,r=gv(e),[i,a]=(0,v.useState)(null),o=(0,v.useMemo)(()=>e.defaultValue===void 0?t===`single`?e.defaultSelectedKey??null:[]:e.defaultValue,[e.defaultValue,e.defaultSelectedKey,t]),[s,c]=sh((0,v.useMemo)(()=>e.value===void 0?t===`single`?e.selectedKey:void 0:e.value,[e.value,e.selectedKey,t]),o,e.onChange),l=t===`single`&&Array.isArray(s)?s[0]:s,u=n=>{if(t===`single`){let t=Array.isArray(n)?n[0]??null:n;c(t),t!==l&&e.onSelectionChange?.(t)}else{let e=[];Array.isArray(n)?e=n:n!=null&&(e=[n]),c(e)}},d=IC({...e,selectionMode:t,disallowEmptySelection:t===`single`,allowDuplicateSelectionEvents:!0,selectedKeys:(0,v.useMemo)(()=>ow(l),[l]),onSelectionChange:e=>{if(e!==`all`){if(t===`single`){let t=e.values().next().value??null;u(t)}else u([...e]);n&&r.close(),m.commitValidation()}}}),f=d.selectionManager.firstSelectedKey,p=(0,v.useMemo)(()=>[...d.selectionManager.selectedKeys].map(e=>d.collection.getItem(e)).filter(e=>e!=null),[d.selectionManager.selectedKeys,d.collection]),m=PS({...e,value:Array.isArray(l)&&l.length===0?null:l}),[h,g]=(0,v.useState)(!1),[_]=(0,v.useState)(l);return{...m,...d,...r,value:l,defaultValue:o??_,setValue:u,selectedKey:f,setSelectedKey:u,selectedItem:p[0]??null,selectedItems:p,defaultSelectedKey:e.defaultSelectedKey??(e.selectionMode===`single`?_:null),focusStrategy:i,open(t=null){(d.collection.size!==0||e.allowsEmptyCollection)&&(a(t),r.open())},toggle(t=null){(d.collection.size!==0||e.allowsEmptyCollection)&&(a(t),r.toggle())},isFocused:h,setFocused:g}}function ow(e){if(e!==void 0)return e===null?[]:Array.isArray(e)?e:[e]}function sw(e={}){let{locale:t}=rp();return(0,v.useMemo)(()=>new Intl.ListFormat(t,e),[t,e])}function cw(e){return e&&e.__esModule?e.default:e}var lw=(0,v.createContext)(null),uw=(0,v.createContext)(null),dw=Hf(function(e,t){[e,t]=Ff(e,t,lw);let{children:n,isDisabled:r=!1,isInvalid:i=!1,isRequired:a=!1}=e,o=(0,v.useMemo)(()=>typeof n==`function`?n({isOpen:!1,isDisabled:r,isInvalid:i,isRequired:a,isFocused:!1,isFocusVisible:!1,defaultChildren:null}):n,[n,r,i,a]);return v.createElement(Rv,{content:o},n=>v.createElement(pw,{props:e,collection:n,selectRef:t}))}),fw=[Wf,th,sb];function pw({props:e,selectRef:t,collection:n}){let{validationBehavior:r}=Pf(VS)||{},i=e.validationBehavior??r??`native`,a=aw({...e,collection:n,children:void 0,validationBehavior:i}),{isFocusVisible:o,focusProps:s}=Jm({within:!0}),c=(0,v.useRef)(null),[l,u]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),{labelProps:d,triggerProps:f,valueProps:p,menuProps:m,descriptionProps:h,errorMessageProps:g,hiddenSelectProps:_,...y}=QC({...Lf(e),label:u,validationBehavior:i},a,c),b=(0,v.useMemo)(()=>({isOpen:a.isOpen,isFocused:a.isFocused,isFocusVisible:o,isDisabled:e.isDisabled||!1,isInvalid:y.isInvalid||!1,isRequired:e.isRequired||!1}),[a.isOpen,a.isFocused,o,e.isDisabled,y.isInvalid,e.isRequired]),x=Mf({...e,values:b,defaultClassName:`react-aria-Select`}),S=W(e,{global:!0});delete S.id;let C=(0,v.useRef)(null);return v.createElement(jf,{values:[[lw,e],[uw,a],[mw,p],[Wf,{...d,ref:l,elementType:`span`}],[th,{...f,ref:c,isPressed:a.isOpen,autoFocus:e.autoFocus}],[cS,a],[_v,{trigger:`Select`,triggerRef:c,scrollRef:C,placement:`bottom start`,"aria-labelledby":m[`aria-labelledby`],clearContexts:fw}],[zC,{...m,ref:C}],[BC,a],[sb,{slots:{description:h,errorMessage:g}}],[OS,y]]},v.createElement(q.div,{...U(S,x,s),ref:t,slot:e.slot||void 0,"data-focused":a.isFocused||void 0,"data-focus-visible":o||void 0,"data-open":a.isOpen||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":y.isInvalid||void 0,"data-required":e.isRequired||void 0},x.children,v.createElement(iw,{..._,autoComplete:e.autoComplete})))}var mw=(0,v.createContext)(null),hw=Hf(function(e,t){[e,t]=Ff(e,t,mw);let n=(0,v.useContext)(uw),{placeholder:r}=Pf(lw),i=n.selectedItems.map(e=>{let t=e.props?.children;return typeof t==`function`&&(t=t({isHovered:!1,isPressed:!1,isSelected:!1,isFocused:!1,isFocusVisible:!1,isDisabled:!1,selectionMode:`single`,selectionBehavior:`toggle`})),t}),a=sw(),o=(0,v.useMemo)(()=>n.selectedItems.map(e=>e?.textValue),[n.selectedItems]),s=n.selectionManager.selectionMode,c=(0,v.useMemo)(()=>s===`single`?o[0]??``:a.format(o),[s,a,o]),l=(0,v.useMemo)(()=>{if(s===`single`)return i[0];let e=a.formatToParts(o);if(e.length===0)return null;let t=0;return e.map(e=>e.type===`element`?v.createElement(v.Fragment,{key:t},i[t++]):e.value)},[s,a,o,i]),u=rv(cw(CC),`react-aria-components`),d=Mf({...e,defaultChildren:l??r??u.format(`selectPlaceholder`),defaultClassName:`react-aria-SelectValue`,values:{selectedItem:n.selectedItems[0]?.value??null,selectedItems:(0,v.useMemo)(()=>n.selectedItems.map(e=>e.value??null),[n.selectedItems]),selectedText:c,isPlaceholder:n.selectedItems.length===0,state:n}}),f=W(e,{global:!0});return v.createElement(q.span,{ref:t,...f,...d,"data-placeholder":n.selectedItems.length===0||void 0},v.createElement(sb.Provider,{value:void 0},d.children))}),gw=(0,v.createContext)(!1),_w=e=>{let t=(0,v.use)(gw),n=(0,v.use)(sb);return!t||n?.slots?.[e]!=null},vw=({children:e})=>(0,G.jsx)(gw,{value:!0,children:e}),yw=(0,v.createContext)({triggerRef:{current:null},clearButtonRef:{current:null},isDisabled:!1}),bw=({children:e,className:t,fullWidth:n,isDisabled:r,onClear:i,variant:a,...o})=>{let s=v.useMemo(()=>Vd({fullWidth:n,variant:a}),[n,a]),c=(0,v.useRef)(null),l=(0,v.useRef)(null);return(0,G.jsx)(vw,{children:(0,G.jsx)(yw,{value:{slots:s,triggerRef:c,clearButtonRef:l,onClear:i,isDisabled:r},children:(0,G.jsx)(dw,{"data-slot":`autocomplete`,...o,className:J(t,s?.base()),isDisabled:r,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})})},xw=({children:e,className:t,isDisabled:n,onClick:r,ref:i,...a})=>{let{clearButtonRef:o,isDisabled:s,slots:c,triggerRef:l}=(0,v.use)(yw),u=(0,v.use)(uw),d=n??s??!1,f=Uf(),p=ys(v.useCallback(e=>{l.current=e},[l]),i);return f?null:(0,G.jsx)(DS,{ref:p,className:J(t,c?.trigger()),"data-slot":`autocomplete-trigger`,isDisabled:d,onClick:e=>{o.current?.contains(e.target)||(r?.(e),u?.toggle())},...a,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})};xw.displayName=`AutocompleteTrigger`;var Sw=Object.assign(bw,{Root:bw,Trigger:xw,Value:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(yw);return(0,G.jsx)(hw,{className:J(t,r?.value()),"data-slot":`autocomplete-value`,...n,children:e})},Indicator:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(yw),i=(0,v.use)(uw),a=e&&v.isValidElement(e)?v.cloneElement(e,{...n,className:Y(r?.indicator,t),"data-slot":`autocomplete-indicator`,"data-open":yh(i?.isOpen)}):(0,G.jsx)(bh,{className:Y(r?.indicator,t),"data-open":yh(i?.isOpen),"data-slot":`autocomplete-default-indicator`,...n});return(0,G.jsx)(nh,{children:a})},Popover:({children:e,className:t,placement:n=`bottom`,style:r,...i})=>{let{slots:a,triggerRef:o}=(0,v.use)(yw),[s,c]=(0,v.useState)(null);return Hs({ref:o,onResize:(0,v.useCallback)(()=>{o.current&&c(o.current.offsetWidth+`px`)},[o])}),(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(yv,{...i,className:J(t,a?.popover()),"data-slot":`autocomplete-popover`,placement:n,triggerRef:o,style:{"--trigger-width":s,...typeof r==`object`&&r?r:{}},children:e})})},Filter:({children:e,...t})=>(0,G.jsx)(Xy,{"data-slot":`autocomplete-filter`,...t,children:e}),ClearButton:({className:e,onClick:t,ref:n,...r})=>{let{clearButtonRef:i,isDisabled:a,onClear:o,slots:s}=(0,v.use)(yw),c=(0,v.use)(uw),l=ys(v.useCallback(e=>{i.current=e},[i]),n),u=e=>{c?.selectionManager.setSelectedKeys(new Set),o?.(),t?.(e)},d=c?.selectionManager.selectedKeys.size===0;return(0,G.jsx)(K.button,{ref:l,"aria-hidden":d||void 0,"aria-label":`Clear selection`,className:s?.clearButton({className:e}),"data-empty":yh(d),"data-slot":`autocomplete-clear-button`,disabled:a??!1,tabIndex:-1,type:`button`,onClick:u,...r,children:(0,G.jsx)(wh,{"data-slot":`autocomplete-clear-button-icon`})})}});function Cw(e,t,n){let{isSelected:r}=t,{isPressed:i,buttonProps:a}=Km({...e,onPress:rs(t.toggle,e.onPress)},n);return{isPressed:i,isSelected:r,isDisabled:e.isDisabled||!1,buttonProps:U(a,{"aria-pressed":r})}}function ww(e,t){let{"aria-label":n,"aria-labelledby":r,orientation:i=`horizontal`}=e,[a,o]=(0,v.useState)(!1);Io(()=>{o(!!(t.current&&t.current.parentElement?.closest(`[role="toolbar"]`)))});let{direction:s}=rp(),c=s===`rtl`&&i===`horizontal`,l=Ug(t),u=e=>{if(ps(e.currentTarget,H(e))){if(i===`horizontal`&&e.key===`ArrowRight`||i===`vertical`&&e.key===`ArrowDown`)c?l.focusPrevious():l.focusNext();else if(i===`horizontal`&&e.key===`ArrowLeft`||i===`vertical`&&e.key===`ArrowUp`)c?l.focusNext():l.focusPrevious();else if(e.key===`Tab`){d.current=ms(),e.shiftKey?l.focusFirst():l.focusLast();return}else return;e.stopPropagation(),e.preventDefault()}},d=(0,v.useRef)(null),f=e=>{!ps(e.currentTarget,e.relatedTarget)&&!d.current&&(d.current=H(e))},p=e=>{d.current&&!ps(e.currentTarget,e.relatedTarget)&&ps(t.current,H(e))&&(d.current?.focus(),d.current=null)};return{toolbarProps:{...W(e,{labelable:!0}),role:a?`group`:`toolbar`,"aria-orientation":i,"aria-label":n,"aria-labelledby":n==null?r:void 0,onKeyDownCapture:a?void 0:u,onFocusCapture:a?void 0:p,onBlurCapture:a?void 0:f}}}function Tw(e,t,n){let{isDisabled:r}=e,{toolbarProps:i}=ww(e,n);return{groupProps:{...i,role:t.selectionMode===`single`?`radiogroup`:i.role,"aria-disabled":r}}}function Ew(e,t,n){let r={isSelected:t.selectedKeys.has(e.id),defaultSelected:!1,setSelected(n){t.setSelected(e.id,n)},toggle(){t.toggleKey(e.id)}},{isPressed:i,isSelected:a,isDisabled:o,buttonProps:s}=Cw({...e,id:void 0,isDisabled:e.isDisabled||t.isDisabled},r,n);return t.selectionMode===`single`&&(s.role=`radio`,s[`aria-checked`]=r.isSelected,delete s[`aria-pressed`]),{isPressed:i,isSelected:a,isDisabled:o,buttonProps:s}}function Dw(e){let{selectionMode:t=`single`,disallowEmptySelection:n,isDisabled:r=!1}=e,[i,a]=sh((0,v.useMemo)(()=>e.selectedKeys?new Set(e.selectedKeys):void 0,[e.selectedKeys]),(0,v.useMemo)(()=>e.defaultSelectedKeys?new Set(e.defaultSelectedKeys):new Set,[e.defaultSelectedKeys]),e.onSelectionChange);return{selectionMode:t,isDisabled:r,selectedKeys:i,setSelectedKeys:a,toggleKey(e){let r;t===`multiple`?(r=new Set(i),r.has(e)&&(!n||r.size>1)?r.delete(e):r.add(e)):r=new Set(i.has(e)&&!n?[]:[e]),a(r)},setSelected(e,t){t!==i.has(e)&&this.toggleKey(e)}}}var Ow=(0,v.createContext)({}),kw=(0,v.createContext)(null),Aw=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,Ow);let n=Dw(e),{groupProps:r}=Tw(e,n,t),i=Mf({...e,values:{orientation:e.orientation||`horizontal`,isDisabled:n.isDisabled,state:n},defaultClassName:`react-aria-ToggleButtonGroup`}),a=W(e,{global:!0});return v.createElement(q.div,{...U(a,i,r),ref:t,slot:e.slot||void 0,"data-orientation":e.orientation||`horizontal`,"data-disabled":e.isDisabled||void 0},v.createElement(kw.Provider,{value:n},v.createElement(eb,null,i.children)))});function jw(e={}){let{isReadOnly:t}=e,[n,r]=sh(e.isSelected,e.defaultSelected||!1,e.onChange),[i]=(0,v.useState)(n);function a(e){t||r(e)}function o(){t||r(!n)}return{isSelected:n,defaultSelected:e.defaultSelected??i,setSelected:a,toggle:o}}var Mw=(0,v.createContext)({}),Nw=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,Mw);let n=(0,v.useContext)(kw),r=jw(n&&e.id!=null?{isSelected:n.selectedKeys.has(e.id),onChange(t){n.setSelected(e.id,t)}}:e),{buttonProps:i,isPressed:a,isSelected:o,isDisabled:s}=n&&e.id!=null?Ew({...e,id:e.id},n,t):Cw({...e,id:e.id==null?void 0:String(e.id)},r,t),{focusProps:c,isFocused:l,isFocusVisible:u}=Jm(e),{hoverProps:d,isHovered:f}=eh({...e,isDisabled:s}),p=Mf({...e,id:void 0,values:{isHovered:f,isPressed:a,isFocused:l,isSelected:r.isSelected,isFocusVisible:u,isDisabled:s,state:r},defaultClassName:`react-aria-ToggleButton`}),m=W(e,{global:!0});return delete m.id,delete m.onClick,v.createElement(q.button,{...U(m,p,i,c,d),ref:t,slot:e.slot||void 0,"data-focused":l||void 0,"data-disabled":s||void 0,"data-pressed":a||void 0,"data-selected":o||void 0,"data-hovered":f||void 0,"data-focus-visible":u||void 0},v.createElement(nb.Provider,{value:{isSelected:o}},p.children))}),Pw=(0,v.createContext)({}),Fw=`__button_group_child`,Iw=({children:e,className:t,fullWidth:n,isDisabled:r,isIconOnly:i,size:a,slot:o,style:s,variant:c,[Fw]:l,...u})=>{let d=(0,v.use)(Pw),f=l===!0,p=a??(f?d?.size:void 0),m=c??(f?d?.variant:void 0),h=r??(f?d?.isDisabled:void 0),g=Hd({fullWidth:n??(f?d?.fullWidth:void 0),isIconOnly:i,size:p,variant:m});return(0,G.jsx)(nh,{className:J(t,g),"data-slot":`button`,isDisabled:h,slot:o,style:s,...u,children:t=>typeof e==`function`?e(t):e})},X=Object.assign(Iw,{Root:Iw}),Lw=(0,v.createContext)({}),Rw=({children:e,className:t,variant:n=`default`,...r})=>{let i=v.useMemo(()=>Gd({variant:n}),[n]),a=(0,G.jsx)(K.div,{className:i.base({className:t}),"data-slot":`card`,...r,children:e});return(0,G.jsx)(Lw,{value:{slots:i},children:n===`transparent`?a:(0,G.jsx)(Nh,{value:{variant:n},children:a})})},zw=Object.assign(Rw,{Root:Rw,Header:({className:e,...t})=>{let{slots:n}=(0,v.use)(Lw);return(0,G.jsx)(K.div,{className:Y(n?.header,e),"data-slot":`card-header`,...t})},Title:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(Lw);return(0,G.jsx)(K.h3,{className:Y(r?.title,t),"data-slot":`card-title`,...n,children:e})},Description:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(Lw);return(0,G.jsx)(K.p,{className:Y(r?.description,t),"data-slot":`card-description`,...n,children:e})},Content:({className:e,...t})=>{let{slots:n}=(0,v.use)(Lw);return(0,G.jsx)(K.div,{className:Y(n?.content,e),"data-slot":`card-content`,...t})},Footer:({className:e,...t})=>{let{slots:n}=(0,v.use)(Lw);return(0,G.jsx)(K.div,{className:Y(n?.footer,e),"data-slot":`card-footer`,...t})}}),Bw=new WeakMap;function Vw(e=!0){let[t,n]=(0,v.useState)(e),r=(0,v.useRef)(!1),i=(0,v.useCallback)(e=>{r.current=!0,n(!!e)},[]);return Io(()=>{r.current||n(!1)},[]),[i,t]}function Hw(e=!0){let t=es(),[n,r]=Vw(e);return{id:r?t:void 0,ref:n}}function Uw(e,t,n){let{isDisabled:r=!1,isReadOnly:i=!1,value:a,name:o,form:s,children:c,isRequired:l,validationBehavior:u=`aria`,"aria-label":d,"aria-labelledby":f,"aria-describedby":p,onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:y,onClick:b}=e,x=PS({...e,value:t.isSelected}),{isInvalid:S,validationErrors:C,validationDetails:w}=x.displayValidation;$C(e,x,n);let T=e=>{e.stopPropagation(),t.setSelected(H(e).checked)},{pressProps:E,isPressed:D}=Rm({onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:y,onClick:b,isDisabled:r}),[O,k]=(0,v.useState)(!1),{pressProps:A}=Rm({onPressStart(e){if(e.pointerType===`keyboard`||e.pointerType===`virtual`){e.continuePropagation();return}m?.(e),g?.(!0),k(!0)},onPressEnd(e){if(e.pointerType===`keyboard`||e.pointerType===`virtual`){e.continuePropagation();return}h?.(e),g?.(!1),k(!1)},onPressUp(e){if(e.pointerType===`keyboard`||e.pointerType===`virtual`){e.continuePropagation();return}y?.(e)},onClick:b,onPress(r){if(r.pointerType===`keyboard`||r.pointerType===`virtual`){r.continuePropagation();return}_?.(r),t.toggle(),n.current?.focus();let{[NS]:i}=e,{commitValidation:a}=i||x;a()},isDisabled:r||i}),{focusableProps:j}=Em(e,n),M=U(E,j),N=W(e,{labelable:!0});cc(n,t.defaultSelected,t.setSelected);let P=Hw(),ee=Hw();return{labelProps:U(A,{onClick:e=>e.preventDefault()}),inputProps:U(N,{checked:t.isSelected,"aria-required":l&&u===`aria`||void 0,required:l&&u===`native`,"aria-invalid":S||e.validationState===`invalid`||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-controls":e[`aria-controls`],"aria-readonly":i||void 0,"aria-describedby":[P.id,ee.id,p].filter(Boolean).join(` `)||void 0,onChange:T,disabled:r,...a==null?{}:{value:a},name:o,form:s,type:`checkbox`,...M}),descriptionProps:P,errorMessageProps:ee,isSelected:t.isSelected,isPressed:D||O,isDisabled:r,isReadOnly:i,isInvalid:S||e.validationState===`invalid`,validationErrors:C,validationDetails:w}}function Ww(e,t,n){let{labelProps:r,inputProps:i,descriptionProps:a,errorMessageProps:o,isSelected:s,isPressed:c,isDisabled:l,isReadOnly:u,isInvalid:d,validationErrors:f,validationDetails:p}=Uw(e,t,n),{isIndeterminate:m}=e;return(0,v.useEffect)(()=>{n.current&&(n.current.indeterminate=!!m)}),{labelProps:U(r,(0,v.useMemo)(()=>({onMouseDown:e=>e.preventDefault()}),[])),inputProps:i,descriptionProps:a,errorMessageProps:o,isSelected:s,isPressed:c,isDisabled:l,isReadOnly:u,isInvalid:d,validationErrors:f,validationDetails:p}}function Gw(e,t,n){let r=jw({isReadOnly:e.isReadOnly||t.isReadOnly,isSelected:t.isSelected(e.value),defaultSelected:t.defaultValue.includes(e.value),onChange(n){n?t.addValue(e.value):t.removeValue(e.value),e.onChange&&e.onChange(n)}}),{name:i,form:a,descriptionId:o,errorMessageId:s,validationBehavior:c}=Bw.get(t);c=e.validationBehavior??c;let{realtimeValidation:l}=PS({...e,value:r.isSelected,name:void 0,validationBehavior:`aria`}),u=(0,v.useRef)(jS),d=()=>{t.setInvalid(e.value,l.isInvalid?l:u.current)};(0,v.useEffect)(d);let f=t.realtimeValidation.isInvalid?t.realtimeValidation:l,p=c===`native`?t.displayValidation:f,m=Ww({...e,isReadOnly:e.isReadOnly||t.isReadOnly,isDisabled:e.isDisabled||t.isDisabled,name:e.name||i,form:e.form||a,isRequired:e.isRequired??t.isRequired,validationBehavior:c,[NS]:{realtimeValidation:f,displayValidation:p,resetValidation:t.resetValidation,commitValidation:t.commitValidation,updateValidation(e){u.current=e,d()}}},r,n);return{...m,inputProps:{...m.inputProps,"aria-describedby":[m.inputProps[`aria-describedby`],t.isInvalid?s:null,o].filter(Boolean).join(` `)||void 0}}}var Kw=(0,v.createContext)(null),qw=(0,v.createContext)(null),Jw=(0,v.createContext)(null),Yw=(0,v.createContext)(null),Xw=(0,v.forwardRef)(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=Ff(r,t,qw);let i=(0,v.useContext)(Jw),[a,o]=Zw(e,n),{descriptionProps:s,errorMessageProps:c,isSelected:l,isDisabled:u,isReadOnly:d,isInvalid:f,validationDetails:p,validationErrors:m}=a,h=Mf({...e,defaultClassName:`react-aria-CheckboxField`,values:{isSelected:l,isIndeterminate:e.isIndeterminate||!1,isDisabled:u,isReadOnly:d,isInvalid:f,isRequired:e.isRequired||!1}}),g=W(e,{global:!0});return delete g.id,delete g.onClick,v.createElement(q.div,{...U(g,h),ref:t,slot:e.slot||void 0,"data-selected":l||void 0,"data-indeterminate":e.isIndeterminate||void 0,"data-disabled":u||void 0,"data-readonly":d||void 0,"data-invalid":f||void 0,"data-required":e.isRequired||void 0},v.createElement(jf,{values:[[Yw,{...a,inputRef:o,defaultClassName:`react-aria-CheckboxButton`,isIndeterminate:e.isIndeterminate,isRequired:e.isRequired}],[sb,{slots:{description:s,errorMessage:c}}],[OS,i?null:{isInvalid:f,validationDetails:p,validationErrors:m}]]},h.children))});function Zw(e,t){let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,i=(0,v.useContext)(Jw),a=Is((0,v.useMemo)(()=>ys(t,e.inputRef===void 0?null:e.inputRef),[t,e.inputRef])),o={...Lf(e),children:typeof e.children==`function`||e.children,value:e.value,validationBehavior:r};return[i?Gw(o,i,a):Ww(o,jw(e),a),a]}var Qw=(0,v.forwardRef)(function(e,t){let{labelProps:n,inputProps:r,isSelected:i,isDisabled:a,isReadOnly:o,isPressed:s,isInvalid:c,inputRef:l,defaultClassName:u,isIndeterminate:d,isRequired:f}=(0,v.useContext)(Yw),{isFocused:p,isFocusVisible:m,focusProps:h}=Jm(),g=a||o,{hoverProps:_,isHovered:y}=eh({...e,isDisabled:g}),b=Mf({...e,defaultClassName:u,values:{isSelected:i,isIndeterminate:d||!1,isPressed:s,isHovered:y,isFocused:p,isFocusVisible:m,isDisabled:a,isReadOnly:o,isInvalid:c,isRequired:f||!1}}),x=W(e,{global:!0});return delete x.id,delete x.onClick,v.createElement(q.label,{...U(x,n,_,b),ref:t,slot:e.slot||void 0,"data-selected":i||void 0,"data-indeterminate":d||void 0,"data-pressed":s||void 0,"data-hovered":y||void 0,"data-focused":p||void 0,"data-focus-visible":m||void 0,"data-disabled":a||void 0,"data-readonly":o||void 0,"data-invalid":c||void 0,"data-required":f||void 0},v.createElement(ov,{elementType:`span`},v.createElement(`input`,{...U(r,h),ref:l})),b.children)}),$w=(0,v.createContext)({}),eT=(0,v.createContext)({}),tT=({children:e,className:t,variant:n,...r})=>{let i=(0,v.use)($w),a=n??i.variant,o=v.useMemo(()=>Kd({variant:a}),[a]);return(0,G.jsx)(Xw,{"data-slot":`checkbox`,...r,className:J(t,o.base()),children:t=>(0,G.jsx)(eT,{value:{slots:o,state:t},children:typeof e==`function`?e(t):e})})};tT.displayName=`HeroUI.Checkbox`;var nT=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(eT);return(0,G.jsx)(Qw,{"data-slot":`checkbox-content`,...n,className:J(t,r?.content()),children:e})};nT.displayName=`HeroUI.Checkbox.Content`;var rT=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(eT);return(0,G.jsx)(K.span,{className:Y(r?.control,t),"data-slot":`checkbox-control`,...n,children:e})};rT.displayName=`HeroUI.Checkbox.Control`;var iT=({children:e,className:t,...n})=>{let{slots:r,state:i}=(0,v.use)(eT),a=i?.isSelected,o=i?.isIndeterminate,s=typeof e==`function`?e(i??{}):e||(o?(0,G.jsx)(`svg`,{"aria-hidden":`true`,"data-slot":`checkbox-default-indicator--indeterminate`,fill:`none`,role:`presentation`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:3,viewBox:`0 0 24 24`,children:(0,G.jsx)(`line`,{x1:`21`,x2:`3`,y1:`12`,y2:`12`})}):(0,G.jsx)(`svg`,{"aria-hidden":`true`,"data-slot":`checkbox-default-indicator--checkmark`,fill:`none`,role:`presentation`,stroke:`currentColor`,strokeDasharray:22,strokeDashoffset:a?44:66,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 17 18`,children:(0,G.jsx)(`polyline`,{points:`1 9 7 14 15 4`})}));return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(r?.indicator,t),"data-slot":`checkbox-indicator`,...n,children:s})};iT.displayName=`HeroUI.Checkbox.Indicator`;var aT=Object.assign(tT,{Root:tT,Content:nT,Control:rT,Indicator:iT}),oT=(0,v.createContext)({}),sT=({children:e,className:t,color:n,size:r,variant:i,...a})=>{let o=v.useMemo(()=>qd({color:n,size:r,variant:i}),[n,r,i]),s=v.useMemo(()=>typeof e==`string`||typeof e==`number`?(0,G.jsx)(cT,{children:e}):e,[e]);return(0,G.jsx)(oT,{value:{slots:o},children:(0,G.jsx)(K.span,{...a,className:Y(o.base,t),"data-slot":`chip`,children:s})})},cT=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(oT);return(0,G.jsx)(K.span,{className:Y(r?.label,t),"data-slot":`chip-label`,...n,children:e})},lT=Object.assign(sT,{Root:sT,Label:cT});function uT(e){let{onMoveStart:t,onMove:n,onMoveEnd:r}=e,i=(0,v.useRef)({didMove:!1,lastPosition:null,id:null}),{addGlobalListener:a,removeGlobalListener:o}=Ps(),s=Rs((0,v.useCallback)((e,r,a,o)=>{(a!==0||o!==0)&&(i.current.didMove||(i.current.didMove=!0,t?.({type:`movestart`,pointerType:r,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})),n?.({type:`move`,pointerType:r,deltaX:a,deltaY:o,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey}))},[t,n,i])),c=Rs((0,v.useCallback)((e,t)=>{jm(),i.current.didMove&&r?.({type:`moveend`,pointerType:t,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})},[r,i]));return{moveProps:(0,v.useMemo)(()=>{let e={},t=()=>{Am(),i.current.didMove=!1};{let n=e=>{if(e.pointerId===i.current.id){let t=e.pointerType||`mouse`;s(e,t,e.pageX-(i.current.lastPosition?.pageX??0),e.pageY-(i.current.lastPosition?.pageY??0)),i.current.lastPosition={pageX:e.pageX,pageY:e.pageY}}},r=e=>{if(e.pointerId===i.current.id){let t=e.pointerType||`mouse`;c(e,t),i.current.id=null;let a=as(H(e));o(a,`pointermove`,n,!1),o(a,`pointerup`,r,!1),o(a,`pointercancel`,r,!1)}};e.onPointerDown=e=>{if(e.button===0&&i.current.id==null){t(),e.stopPropagation(),e.preventDefault(),i.current.lastPosition={pageX:e.pageX,pageY:e.pageY},i.current.id=e.pointerId;let o=as(H(e));a(o,`pointermove`,n,!1),a(o,`pointerup`,r,!1),a(o,`pointercancel`,r,!1)}}}let n=(e,n,r)=>{t(),s(e,`keyboard`,n,r),c(e,`keyboard`)};return e.onKeyDown=e=>{switch(e.key){case`Left`:case`ArrowLeft`:e.preventDefault(),e.stopPropagation(),n(e,-1,0);break;case`Right`:case`ArrowRight`:e.preventDefault(),e.stopPropagation(),n(e,1,0);break;case`Up`:case`ArrowUp`:e.preventDefault(),e.stopPropagation(),n(e,0,-1);break;case`Down`:case`ArrowDown`:e.preventDefault(),e.stopPropagation(),n(e,0,1)}},e},[a,o,i])}}var dT=(0,v.createContext)({}),fT=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i},pT=Hf(function(e,t){[e,t]=Ff(e,t,dT);let{hoverProps:n,isHovered:r}=eh({...e,isDisabled:e.disabled}),{isFocused:i,isFocusVisible:a,focusProps:o}=Jm({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,c=Mf({...e,values:{isHovered:r,isFocused:i,isFocusVisible:a,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:`react-aria-Input`});return v.createElement(q.input,{...U(fT(e),o,n),...c,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":a||void 0,"data-invalid":s||void 0})});function mT(e,t){let{inputElementType:n=`input`,isDisabled:r=!1,isRequired:i=!1,isReadOnly:a=!1,type:o=`text`,validationBehavior:s=`aria`}=e,[c,l]=sh(e.value,e.defaultValue||``,e.onChange),{focusableProps:u}=Em(e,t),d=PS({...e,value:c}),{isInvalid:f,validationErrors:p,validationDetails:m}=d.displayValidation,{labelProps:h,fieldProps:g,descriptionProps:_,errorMessageProps:y}=XC({...e,isInvalid:f,errorMessage:e.errorMessage||p}),b=W(e,{labelable:!0}),x={type:o,pattern:e.pattern},[S]=(0,v.useState)(c);return cc(t,e.defaultValue??S,l),$C(e,d,t),{labelProps:h,inputProps:U(b,n===`input`?x:void 0,{disabled:r,readOnly:a,required:i&&s===`native`,"aria-required":i&&s===`aria`||void 0,"aria-invalid":f||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-activedescendant":e[`aria-activedescendant`],"aria-autocomplete":e[`aria-autocomplete`],"aria-haspopup":e[`aria-haspopup`],"aria-controls":e[`aria-controls`],value:c,onChange:e=>l(H(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,enterKeyHint:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...u,...g}),descriptionProps:_,errorMessageProps:y,isInvalid:f,validationErrors:p,validationDetails:m}}function hT(){return typeof window<`u`&&window.InputEvent&&typeof InputEvent.prototype.getTargetRanges==`function`}function gT(e,t,n){let r=Rs(e=>{let r=n.current;if(!r)return;let i=null;switch(e.inputType){case`historyUndo`:case`historyRedo`:return;case`insertLineBreak`:return;case`deleteContent`:case`deleteByCut`:case`deleteByDrag`:i=r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteContentForward`:i=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd+1):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteContentBackward`:i=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart-1)+r.value.slice(r.selectionStart):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteSoftLineBackward`:case`deleteHardLineBackward`:i=r.value.slice(r.selectionStart);break;default:e.data!=null&&(i=r.value.slice(0,r.selectionStart)+e.data+r.value.slice(r.selectionEnd))}(i==null||!t.validate(i))&&e.preventDefault()});(0,v.useEffect)(()=>{if(!hT()||!n.current)return;let e=n.current;return e.addEventListener(`beforeinput`,r,!1),()=>{e.removeEventListener(`beforeinput`,r,!1)}},[n]);let i=hT()?null:e=>{let n=H(e).value.slice(0,H(e).selectionStart)+e.data+H(e).value.slice(H(e).selectionEnd);t.validate(n)||e.preventDefault()},{labelProps:a,inputProps:o,descriptionProps:s,errorMessageProps:c,...l}=mT(e,n),u=(0,v.useRef)(null);return{inputProps:U(o,{onBeforeInput:i,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:r}=n.current;u.current={value:e,selectionStart:t,selectionEnd:r}},onCompositionEnd(){if(n.current&&!t.validate(n.current.value)){let{value:e,selectionStart:r,selectionEnd:i}=u.current;n.current.value=e,n.current.setSelectionRange(r,i),t.setInputValue(e)}}}),labelProps:a,descriptionProps:s,errorMessageProps:c,...l}}function _T(e,t){let{onScroll:n,isDisabled:r}=e,i=(0,v.useCallback)(e=>{e.ctrlKey||(e.preventDefault(),e.stopPropagation(),n&&n({deltaX:e.deltaX,deltaY:e.deltaY}))},[n]);nc(t,`wheel`,r?void 0:i)}var vT={};vT={Empty:`فارغ`};var yT={};yT={Empty:`Изпразни`};var bT={};bT={Empty:`Prázdné`};var xT={};xT={Empty:`Tom`};var ST={};ST={Empty:`Leer`};var CT={};CT={Empty:`Άδειο`};var wT={};wT={Empty:`Empty`};var TT={};TT={Empty:`Vacío`};var ET={};ET={Empty:`Tühjenda`};var DT={};DT={Empty:`Tyhjä`};var OT={};OT={Empty:`Vide`};var kT={};kT={Empty:`ריק`};var AT={};AT={Empty:`Prazno`};var jT={};jT={Empty:`Üres`};var MT={};MT={Empty:`Vuoto`};var NT={};NT={Empty:`空`};var PT={};PT={Empty:`비어 있음`};var FT={};FT={Empty:`Tuščias`};var IT={};IT={Empty:`Tukšs`};var LT={};LT={Empty:`Tom`};var RT={};RT={Empty:`Leeg`};var zT={};zT={Empty:`Pusty`};var BT={};BT={Empty:`Vazio`};var VT={};VT={Empty:`Vazio`};var HT={};HT={Empty:`Gol`};var UT={};UT={Empty:`Не заполнено`};var WT={};WT={Empty:`Prázdne`};var GT={};GT={Empty:`Prazen`};var KT={};KT={Empty:`Prazno`};var qT={};qT={Empty:`Tomt`};var JT={};JT={Empty:`Boş`};var YT={};YT={Empty:`Пусто`};var XT={};XT={Empty:`空`};var ZT={};ZT={Empty:`空白`};var QT={};QT={"ar-AE":vT,"bg-BG":yT,"cs-CZ":bT,"da-DK":xT,"de-DE":ST,"el-GR":CT,"en-US":wT,"es-ES":TT,"et-EE":ET,"fi-FI":DT,"fr-FR":OT,"he-IL":kT,"hr-HR":AT,"hu-HU":jT,"it-IT":MT,"ja-JP":NT,"ko-KR":PT,"lt-LT":FT,"lv-LV":IT,"nb-NO":LT,"nl-NL":RT,"pl-PL":zT,"pt-BR":BT,"pt-PT":VT,"ro-RO":HT,"ru-RU":UT,"sk-SK":WT,"sl-SI":GT,"sr-SP":KT,"sv-SE":qT,"tr-TR":JT,"uk-UA":YT,"zh-CN":XT,"zh-TW":ZT};function $T(e){return e&&e.__esModule?e.default:e}var eE=()=>{};function tE(e){let t=(0,v.useRef)(void 0),{value:n,textValue:r,minValue:i,maxValue:a,isDisabled:o,isReadOnly:s,isRequired:c,onIncrement:l,onIncrementPage:u,onDecrement:d,onDecrementPage:f,onDecrementToMin:p,onIncrementToMax:m}=e,h=rv($T(QT),`@react-aria/spinbutton`),g=(0,v.useRef)(!1),_=(0,v.useCallback)(()=>{clearTimeout(t.current),g.current=!1},[]),y=Rs(()=>{_()});(0,v.useEffect)(()=>()=>y(),[]);let{keyboardProps:b}=Sm({isDisabled:o||s,shortcuts:{PageUp:()=>{if(u){u();return}if(l){l();return}return!1},ArrowUp:()=>{if(l){l();return}return!1},PageDown:()=>{if(f){f();return}if(d){d();return}return!1},ArrowDown:()=>{if(d){d();return}return!1},Home:()=>{if(p){p();return}return!1},End:()=>{if(m){m();return}return!1}},allowRepeats:!0}),x=(0,v.useRef)(!1),S=()=>{x.current=!0},C=()=>{x.current=!1},w=r===``?h.format(`Empty`):(r||`${n}`).replace(`-`,`−`);(0,v.useEffect)(()=>{x.current&&(kp(`assertive`),Op(w,`assertive`))},[w]);let T=(0,v.useCallback)(()=>{_()},[_]),E=Rs(l??eE),D=Rs(d??eE),O=Rs(()=>{(a===void 0||isNaN(a)||n===void 0||isNaN(n)||n{y(),g.current=!0,t.current=window.setTimeout(O,e)}),A=Rs(()=>{(i===void 0||isNaN(i)||n===void 0||isNaN(n)||n>i)&&(D(),j(60))}),j=Rs(e=>{y(),g.current=!0,t.current=window.setTimeout(A,e)}),M=e=>{e.preventDefault()},{addGlobalListener:N,removeAllGlobalListeners:P}=Ps(),ee=(0,v.useRef)(!1),[F,I]=(0,v.useState)(null);(0,v.useEffect)(()=>{F===`touch`?k(600):F?k(400):F||y()},[F]);let[L,te]=(0,v.useState)(null);return(0,v.useEffect)(()=>{L===`touch`?j(600):L?j(400):L||y()},[L]),{spinButtonProps:{role:`spinbutton`,"aria-valuenow":n!==void 0&&!isNaN(n)?n:void 0,"aria-valuetext":w,"aria-valuemin":i,"aria-valuemax":a,"aria-disabled":o||void 0,"aria-readonly":s||void 0,"aria-required":c||void 0,...b,onFocus:S,onBlur:C},incrementButtonProps:{onPressStart:e=>{_(),e.pointerType===`touch`?(N(window,`pointercancel`,T,{capture:!0}),ee.current=!1,I(`touch`)):(l?.(),I(`mouse`)),N(window,`contextmenu`,M)},onPressUp:e=>{_(),e.pointerType===`touch`&&(ee.current=!0),P(),I(null)},onPressEnd:e=>{_(),e.pointerType===`touch`&&!g.current&&ee.current&&l?.(),ee.current=!1,I(null)},onFocus:S,onBlur:C},decrementButtonProps:{onPressStart:e=>{_(),e.pointerType===`touch`?(N(window,`pointercancel`,T,{capture:!0}),ee.current=!1,te(`touch`)):(d?.(),te(`mouse`))},onPressUp:e=>{_(),e.pointerType===`touch`&&(ee.current=!0),P(),te(null)},onPressEnd:e=>{_(),e.pointerType===`touch`&&!g.current&&ee.current&&d?.(),ee.current=!1,te(null)},onFocus:S,onBlur:C}}}var nE={};nE={decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:`حقل رقمي`};var rE={};rE={decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:`Номер на полето`};var iE={};iE={decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:`Číselné pole`};var aE={};aE={decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:`Talfelt`};var oE={};oE={decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:`Nummernfeld`};var sE={};sE={decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:`Πεδίο αριθμού`};var cE={};cE={decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:`Number field`};var lE={};lE={decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de número`};var uE={};uE={decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:`Numbri väli`};var dE={};dE={decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:`Numerokenttä`};var fE={};fE={decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:`Champ de nombre`};var pE={};pE={decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:`שדה מספר`};var mE={};mE={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:`Polje broja`};var hE={};hE={decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:`Számmező`};var gE={};gE={decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:`Campo numero`};var _E={};_E={decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:`数値フィールド`};var vE={};vE={decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:`번호 필드`};var yE={};yE={decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:`Numerio laukas`};var bE={};bE={decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:`Skaitļu lauks`};var xE={};xE={decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:`Tallfelt`};var SE={};SE={decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:`Getalveld`};var CE={};CE={decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:`Pole numeru`};var wE={};wE={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de número`};var TE={};TE={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo numérico`};var EE={};EE={decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:`Câmp numeric`};var DE={};DE={decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:`Числовое поле`};var OE={};OE={decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:`Číselné pole`};var kE={};kE={decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:`Številčno polje`};var AE={};AE={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:`Polje broja`};var jE={};jE={decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:`Nummerfält`};var ME={};ME={decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:`Sayı alanı`};var NE={};NE={decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:`Поле номера`};var PE={};PE={decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:`数字字段`};var FE={};FE={decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:`數字欄位`};var IE={};IE={"ar-AE":nE,"bg-BG":rE,"cs-CZ":iE,"da-DK":aE,"de-DE":oE,"el-GR":sE,"en-US":cE,"es-ES":lE,"et-EE":uE,"fi-FI":dE,"fr-FR":fE,"he-IL":pE,"hr-HR":mE,"hu-HU":hE,"it-IT":gE,"ja-JP":_E,"ko-KR":vE,"lt-LT":yE,"lv-LV":bE,"nb-NO":xE,"nl-NL":SE,"pl-PL":CE,"pt-BR":wE,"pt-PT":TE,"ro-RO":EE,"ru-RU":DE,"sk-SK":OE,"sl-SI":kE,"sr-SP":AE,"sv-SE":jE,"tr-TR":ME,"uk-UA":NE,"zh-CN":PE,"zh-TW":FE};function LE(e){return e&&e.__esModule?e.default:e}function RE(e,t,n){let{id:r,decrementAriaLabel:i,incrementAriaLabel:a,isDisabled:o,isReadOnly:s,isRequired:c,minValue:l,maxValue:u,autoFocus:d,label:f,formatOptions:p,onBlur:m=()=>{},onFocus:h,onFocusChange:g,onKeyDown:_,onKeyUp:y,description:b,errorMessage:x,isWheelDisabled:S,...C}=e,{increment:w,incrementToMax:T,decrement:E,decrementToMin:D,numberValue:O,inputValue:k,commit:A,commitValidation:j}=t,M=rv(LE(IE),`@react-aria/numberfield`),N=(0,v.useCallback)(()=>{let e=n.current?.value??``;(0,dc.flushSync)(()=>{A()}),n.current?.value!==e&&Op(n.current?.value??``,`assertive`)},[A,n]),P=es(r),{focusProps:ee}=cm({onBlur(){N()}}),F=Cp(p),I=(0,v.useMemo)(()=>F.resolvedOptions(),[F]),L=Cp({...p,currencySign:void 0}),{spinButtonProps:te,incrementButtonProps:R,decrementButtonProps:z}=tE({isDisabled:o,isReadOnly:s,isRequired:c,maxValue:u,minValue:l,onIncrement:w,onIncrementToMax:T,onDecrement:E,onDecrementToMin:D,value:O,textValue:(0,v.useMemo)(()=>isNaN(O)?``:L.format(O),[L,O])}),[B,ne]=(0,v.useState)(!1),{focusWithinProps:re}=qm({isDisabled:o,onFocusWithinChange:ne});_T({onScroll:(0,v.useCallback)(e=>{Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.deltaY>0?w():e.deltaY<0&&E())},[E,w]),isDisabled:S||o||s||!B},n);let ie=(I.maximumFractionDigits??0)>0,V=t.minValue===void 0||isNaN(t.minValue)||t.minValue<0,ae=`numeric`;mo()?V?ae=`text`:ie&&(ae=`decimal`):bo()&&(V?ae=`numeric`:ie&&(ae=`decimal`));let oe=e=>{t.validate(e)&&t.setInputValue(e)},se=t=>{e.onPaste?.(t);let n=H(t);n&&(n.selectionEnd??-1)-(n.selectionStart??0)===n.value.length&&(t.preventDefault(),A(t.clipboardData?.getData?.(`text/plain`)?.trim()??``))},ce=W(e),{keyboardProps:le}=Sm({isDisabled:o||s,shortcuts:{Enter:()=>((0,dc.flushSync)(()=>{A()}),j(),{shouldPreventDefault:!1})},onKeyDown:_,onKeyUp:y}),{isInvalid:ue,validationErrors:de,validationDetails:fe}=t.displayValidation,{labelProps:pe,inputProps:me,descriptionProps:he,errorMessageProps:ge}=gT({...C,...ce,name:void 0,form:void 0,label:f,autoFocus:d,isDisabled:o,isReadOnly:s,isRequired:c,validate:void 0,[NS]:t,value:k,defaultValue:`!`,autoComplete:`off`,"aria-label":e[`aria-label`]||void 0,"aria-labelledby":e[`aria-labelledby`]||void 0,id:P,type:`text`,inputMode:ae,onChange:oe,onBlur:m,onFocus:h,onFocusChange:g,onPaste:se,description:b,errorMessage:x},t,n),_e=U(le,me);cc(n,t.defaultNumberValue,t.setNumberValue),BE(t,e.validationBehavior,e.commitBehavior,n,t.minValue,t.maxValue,e.step,t.numberValue);let ve=U(te,ee,_e,{role:null,"aria-roledescription":go()?null:M.format(`numberField`),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:`off`,spellCheck:`false`});e.validationBehavior===`native`&&(ve[`aria-required`]=void 0);let ye=e=>{ms()!==n.current&&(e.pointerType===`mouse`?n.current?.focus():e.target.focus())},be=e[`aria-label`]||(typeof e.label==`string`?e.label:``),xe;be||(xe=e.label==null?e[`aria-labelledby`]:pe.id);let Se=es(),Ce=es(),we=U(R,{"aria-label":a||M.format(`increase`,{fieldLabel:be}).trim(),id:xe&&!a?Se:null,"aria-labelledby":xe&&!a?`${Se} ${xe}`:null,"aria-controls":P,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:ye}),Te=U(z,{"aria-label":i||M.format(`decrease`,{fieldLabel:be}).trim(),id:xe&&!i?Ce:null,"aria-labelledby":xe&&!i?`${Ce} ${xe}`:null,"aria-controls":P,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:ye});return{groupProps:{...re,role:`group`,"aria-disabled":o,"aria-invalid":ue?`true`:void 0},labelProps:pe,inputProps:ve,incrementButtonProps:we,decrementButtonProps:Te,errorMessageProps:ge,descriptionProps:he,isInvalid:ue,validationErrors:de,validationDetails:fe}}var zE=null;function BE(e,t,n,r,i,a,o,s){Io(()=>{let c=r.current;if(n!==`validate`||e.realtimeValidation.isInvalid||!c||c.disabled||(!zE&&typeof document<`u`&&(zE=document.createElement(`input`),zE.type=`number`),!zE))return;zE.min=i!=null&&!isNaN(i)?String(i):``,zE.max=a!=null&&!isNaN(a)?String(a):``,zE.step=o!=null&&!isNaN(o)?String(o):``,zE.value=s!=null&&!isNaN(s)?String(s):``;let l=c.validity.valid&&zE.validity.valid,u=c.validationMessage||zE.validationMessage,d={isInvalid:!l,validationErrors:u?[u]:[],validationDetails:{badInput:c.validity.badInput,customError:c.validity.customError,patternMismatch:c.validity.patternMismatch,rangeOverflow:zE.validity.rangeOverflow,rangeUnderflow:zE.validity.rangeUnderflow,stepMismatch:zE.validity.stepMismatch,tooLong:c.validity.tooLong,tooShort:c.validity.tooShort,typeMismatch:c.validity.typeMismatch,valueMissing:c.validity.valueMissing,valid:l}};e.updateValidation(d),t===`native`&&!zE.validity.valid&&c.setCustomValidity(zE.validationMessage)})}function VE(e){let{minValue:t,maxValue:n,step:r,formatOptions:i,value:a,defaultValue:o=NaN,onChange:s,locale:c,isDisabled:l,isReadOnly:u,commitBehavior:d=`snap`}=e;a===null&&(a=NaN);let f=(0,v.useCallback)(e=>r===void 0||isNaN(r)?Oc(e,t,n):Ac(e,t,n,r),[r,t,n]);a!==void 0&&!isNaN(a)&&d===`snap`&&(a=f(a)),!isNaN(o)&&d===`snap`&&(o=f(o));let[p,m]=sh(a,isNaN(o)?NaN:o,s),[h]=(0,v.useState)(p),[g,_]=(0,v.useState)(()=>isNaN(p)?``:new cp(c,i).format(p)),y=(0,v.useMemo)(()=>new pp(c,i),[c,i]),b=(0,v.useMemo)(()=>y.getNumberingSystem(g),[y,g]),x=(0,v.useMemo)(()=>new cp(c,{...i,numberingSystem:b}),[c,i,b]),S=(0,v.useMemo)(()=>x.resolvedOptions(),[x]),C=(0,v.useCallback)(e=>isNaN(e)||e===null?``:x.format(e),[x]),w=PS({...e,value:p}),T=r!==void 0&&!isNaN(r)?r:1;S.style===`percent`&&(r===void 0||isNaN(r))&&(T=.01);let[E,D]=(0,v.useState)(p),[O,k]=(0,v.useState)(c),[A,j]=(0,v.useState)(i);(!Object.is(p,E)||c!==O||!HE(i,A))&&(_(C(p)),D(p),k(c),j(i));let M=(0,v.useMemo)(()=>y.parse(g),[y,g]),N=e=>{let t=e===void 0?g:e,n=M;if(e!==void 0&&(n=y.parse(t)),!t.length){m(NaN),_(a===void 0?``:C(p));return}if(isNaN(n)){_(C(p));return}let r=d===`snap`?f(n):n;r=y.parse(C(r));let i=r!==p;m(r),_(C(a===void 0?r:p)),i&&w.commitValidation()},P=(e,r=0)=>{let i=M;if(isNaN(i))return Ac(isNaN(r)?0:r,t,n,T);{let r=Ac(i,t,n,T);return e===`+`&&r>i||e===`-`&&r{let e=P(`+`,t);e===p&&_(C(e)),m(e),w.commitValidation()},F=()=>{let e=P(`-`,n);e===p&&_(C(e)),m(e),w.commitValidation()},I=()=>{n!=null&&(m(Ac(n,t,n,T)),w.commitValidation())},L=()=>{t!=null&&(m(t),w.commitValidation())},te=(0,v.useMemo)(()=>!l&&!u&&(isNaN(M)||n===void 0||isNaN(n)||Ac(M,t,n,T)>M||UE(`+`,M,T)<=n),[l,u,t,n,T,M]),R=(0,v.useMemo)(()=>!l&&!u&&(isNaN(M)||t===void 0||isNaN(t)||Ac(M,t,n,T)=t),[l,u,t,n,T,M]),z=e=>y.isValidPartialNumber(e,t,n);return{...w,validate:z,increment:ee,incrementToMax:I,decrement:F,decrementToMin:L,canIncrement:te,canDecrement:R,minValue:t,maxValue:n,numberValue:M,defaultNumberValue:isNaN(o)?h:o,setNumberValue:m,setInputValue:_,inputValue:g,commit:N}}function HE(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(t[r]!==e[r])return!1;return!0}function UE(e,t,n){let r=e===`+`?t+n:t-n;if(t%1!=0||n%1!=0){let i=t.toString().split(`.`),a=n.toString().split(`.`),o=i[1]&&i[1].length||0,s=a[1]&&a[1].length||0,c=10**Math.max(o,s);t=Math.round(t*c),n=Math.round(n*c),r=e===`+`?t+n:t-n,r/=c}return r}var WE={blue:`\x1B[34m`,green:`\x1B[32m`,magenta:`\x1B[35m`,red:`\x1B[31m`,reset:`\x1B[0m`,yellow:`\x1B[33m`},GE={debug:WE.magenta,error:WE.red,info:WE.blue,success:WE.green,warn:WE.yellow},KE={debug:`🔍`,error:`❌`,info:`ℹ️`,success:`✅`,warn:`⚠️`},qE=new class{constructor(e={}){this.enabled=e.enabled??!0,this.prefix=e.prefix??`HeroUI`}formatMessage(e,t){let n=GE[e],r=KE[e];return`${n}[${this.prefix}]${WE.reset} ${r} ${t}`}log(e,t,...n){if(!this.enabled)return;let r=this.formatMessage(e,t);switch(e){case`error`:console.error(r,...n);break;case`warn`:console.warn(r,...n);break;default:console.log(r,...n)}}info(e,...t){this.log(`info`,e,...t)}success(e,...t){this.log(`success`,e,...t)}warn(e,...t){this.log(`warn`,e,...t)}error(e,...t){this.log(`error`,e,...t)}debug(e,...t){this.log(`debug`,e,...t)}divider(e=`=`,t=80){this.enabled&&console.log(e.repeat(t))}newline(){this.enabled&&console.log()}}({prefix:`HeroUI`}),JE,YE=typeof process<`u`&&!1,XE=e=>{YE&&(JE??=new Set,JE.has(e)&&qE.warn(`Duplicate collection slot "${e}". Use a unique, namespaced name (e.g. "tabs.listContainer", "menu.popover").`),JE.add(e));let t=`$$heroui.collection.${e}`,n=(0,v.createContext)(void 0),r=(e,n)=>v.Children.map(e,e=>(0,v.isValidElement)(e)?v.cloneElement(e,{[t]:n}):e),i=e=>{let{[t]:n,...r}=e;return[n,r]},a=e=>{let[t,r]=i(e),a=(0,v.useContext)(n);return[t??a,r]},o=({children:e,...t})=>(0,G.jsx)(n.Provider,{value:t,children:r(e,t)});return o.displayName=`HeroUI.CollectionSlot(${e})`,{key:t,inject:r,consume:i,useSlot:a,Injector:o,withSlot:(t,n)=>{let r=(0,v.forwardRef)(function(r,i){let[o,s]=a(r),{children:c,...l}=s;if(!o)return(0,G.jsx)(t,{...l,ref:i,children:c});if(n)return n({...l,children:c},o,i);let{className:u,render:d,...f}=o;return(0,G.jsx)(t,{...l,ref:i,children:d?d({children:c,className:u,...f}):(0,G.jsx)(`div`,{className:u,"data-slot":`${e}-container`,...f,children:c})})});return r.displayName=`HeroUI.withCollectionSlot(${t.displayName||t.name||e})`,r},Context:n}},ZE=(0,v.createContext)({});XE(`combo-box.inputGroup`);function QE(e,t){return e-t*Math.floor(e/t)}var $E=1721426;function eD(e,t,n,r){t=nD(e,t);let i=t-1,a=-2;return n<=2?a=0:tD(t)&&(a=-1),1721425+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+r)}function tD(e){return e%4==0&&(e%100!=0||e%400==0)}function nD(e,t){return e===`BC`?1-t:t}function rD(e){let t=`AD`;return e<=0&&(t=`BC`,e=1-e),[t,e]}var iD={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},aD=class{fromJulianDay(e){let t=e,n=t-$E,r=Math.floor(n/146097),i=QE(n,146097),a=Math.floor(i/36524),o=QE(i,36524),s=Math.floor(o/1461),c=QE(o,1461),l=Math.floor(c/365),[u,d]=rD(r*400+a*100+s*4+l+ +(a!==4&&l!==4)),f=t-eD(u,d,1,1),p=2;t=0?e:t:e||t}function ID(e){return e=XD(e,new aD),LD(nD(e.era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function LD(e,t,n,r,i,a,o){let s=new Date;return s.setUTCHours(r,i,a,o),s.setUTCFullYear(e,t-1,n),s.getTime()}function RD(e,t){if(t===`UTC`)return 0;if(e>0&&t===SD()&&!CD())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=BD(e,t);return LD(n,r,i,a,o,s,0)-Math.floor(e/1e3)*1e3}var zD=new Map;function BD(e,t){let n=zD.get(t);n||(n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),zD.set(t,n));let r=n.formatToParts(new Date(e)),i={};for(let e of r)e.type!==`literal`&&(i[e.type]=e.value);return{year:i.era===`BC`||i.era===`B`?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour===`24`?0:+i.hour,minute:+i.minute,second:+i.second}}var VD=864e5;function HD(e,t,n,r){return(n===r?[n]:[n,r]).filter(n=>UD(e,t,n))}function UD(e,t,n){let r=BD(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function WD(e,t,n=`compatible`){let r=JD(e);if(t===`UTC`)return ID(r);if(t===SD()&&n===`compatible`&&!CD()){r=XD(r,new aD);let e=new Date,t=nD(r.era,r.year);return e.setFullYear(t,r.month-1,r.day),e.setHours(r.hour,r.minute,r.second,r.millisecond),e.getTime()}let i=ID(r),a=RD(i-VD,t),o=RD(i+VD,t),s=HD(r,t,i-a,i-o);if(s.length===1)return s[0];if(s.length>1)switch(n){case`compatible`:case`earlier`:return s[0];case`later`:return s[s.length-1];case`reject`:throw RangeError(`Multiple possible absolute times found`)}switch(n){case`earlier`:return Math.min(i-a,i-o);case`compatible`:case`later`:return Math.max(i-a,i-o);case`reject`:throw RangeError(`No such absolute time found`)}}function GD(e,t,n=`compatible`){return new Date(WD(e,t,n))}function KD(e,t){let n=RD(e,t),r=new Date(e+n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new HO(i<1?`BC`:`AD`,i<1?-i+1:i,a,o,t,n,s,c,l,u)}function qD(e){return new zO(e.calendar,e.era,e.year,e.month,e.day)}function JD(e,t){let n=0,r=0,i=0,a=0;if(`timeZone`in e)({hour:n,minute:r,second:i,millisecond:a}=e);else if(`hour`in e&&!t)return e;return t&&({hour:n,minute:r,second:i,millisecond:a}=t),new VO(e.calendar,e.era,e.year,e.month,e.day,n,r,i,a)}function YD(e){return new BO(e.hour,e.minute,e.second,e.millisecond)}function XD(e,t){if(dD(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,sO(r),r}function ZD(e,t,n){return e instanceof HO?e.timeZone===t?e:$D(e,t):KD(WD(e,t,n),t)}function QD(e){let t=ID(e)-e.offset;return new Date(t)}function $D(e,t){return XD(KD(ID(e)-e.offset,t),e.calendar)}function eO(e){return $D(e,SD())}var tO=36e5;function nO(e,t){let n=e.copy(),r=`hour`in n?hO(n,t):0;rO(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,iO(n),oO(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,aO(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){let e=n.calendar.isInverseEra?.(n);n.year=i,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function rO(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function iO(e){for(;e.month<1;)rO(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,rO(e,1)}function aO(e){for(;e.day<1;)e.month--,iO(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,iO(e)}function oO(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function sO(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),oO(e)}function cO(e){let t={};for(let n in e)typeof e[n]==`number`&&(t[n]=-e[n]);return t}function lO(e,t){return nO(e,cO(t))}function uO(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),sO(n),n}function dO(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),pO(n),n}function fO(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=mO(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=mO(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=mO(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=mO(e.hour,24),t}function pO(e){e.millisecond=Math.max(0,Math.min(e.millisecond,999)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function mO(e,t){let n=e%t;return n<0&&(n+=t),n}function hO(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,fO(e)}function gO(e,t){let n=e.copy();return hO(n,t),n}function _O(e,t){return gO(e,cO(t))}function vO(e,t,n,r){let i=e.copy();switch(t){case`era`:{let t=e.calendar.getEras(),a=t.indexOf(e.era);if(a<0)throw Error(`Invalid era: `+e.era);a=bO(a,n,0,t.length-1,r?.round),i.era=t[a],sO(i);break}case`year`:i.calendar.isInverseEra?.(i)&&(n=-n),i.year=bO(e.year,n,-1/0,9999,r?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case`month`:i.month=bO(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case`day`:i.day=bO(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw Error(`Unsupported field `+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),sO(i),i}function yO(e,t,n,r){let i=e.copy();switch(t){case`hour`:{let t=e.hour,a=0,o=23;if(r?.hourCycle===12){let e=t>=12;a=e?12:0,o=e?23:11}i.hour=bO(t,n,a,o,r?.round);break}case`minute`:i.minute=bO(e.minute,n,0,59,r?.round);break;case`second`:i.second=bO(e.second,n,0,59,r?.round);break;case`millisecond`:i.millisecond=bO(e.millisecond,n,0,999,r?.round);break;default:throw Error(`Unsupported field `+t)}return i}function bO(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e0?Math.ceil(e/i)*i:Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,er&&(e=n+(e-r-1));return e}function xO(e,t){let n;return n=t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0?WD(nO(JD(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):ID(e)-e.offset,n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5,XD(KD(n,e.timeZone),e.calendar)}function SO(e,t){return xO(e,cO(t))}function CO(e,t,n,r){switch(t){case`hour`:{let t=0,i=23;if(r?.hourCycle===12){let n=e.hour>=12;t=n?12:0,i=n?23:11}let a=JD(e),o=XD(dO(a,{hour:t}),new aD),s=[WD(o,e.timeZone,`earlier`),WD(o,e.timeZone,`later`)].filter(t=>KD(t,e.timeZone).day===o.day)[0],c=XD(dO(a,{hour:i}),new aD),l=[WD(c,e.timeZone,`earlier`),WD(c,e.timeZone,`later`)].filter(t=>KD(t,e.timeZone).day===c.day).pop(),u=ID(e)-e.offset,d=Math.floor(u/tO),f=u%tO;return u=bO(d,n,Math.floor(s/tO),Math.floor(l/tO),r?.round)*tO+f,XD(KD(u,e.timeZone),e.calendar)}case`minute`:case`second`:case`millisecond`:return yO(e,t,n,r);case`era`:case`year`:case`month`:case`day`:return XD(KD(WD(vO(JD(e),t,n,r),e.timeZone),e.timeZone),e.calendar);default:throw Error(`Unsupported field `+t)}}function wO(e,t,n){let r=JD(e),i=dO(uO(r,t),t);return i.compare(r)===0?e:XD(KD(WD(i,e.timeZone,n),e.timeZone),e.calendar)}var TO=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,EO=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,DO=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function OO(e){let t=e.match(TO);if(!t)throw DO.test(e)?Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):Error(`Invalid ISO 8601 date string: `+e);let n=new zO(MO(t[1],0,9999),MO(t[2],1,12),1);return n.day=MO(t[3],1,n.calendar.getDaysInMonth(n)),n}function kO(e){let t=e.match(EO);if(!t)throw DO.test(e)?Error(`Invalid ISO 8601 date time string: ${e}. Use parseAbsolute() instead.`):Error(`Invalid ISO 8601 date time string: `+e);let n=MO(t[1],-9999,9999),r=new VO(n<1?`BC`:`AD`,n<1?-n+1:n,MO(t[2],1,12),1,t[4]?MO(t[4],0,23):0,t[5]?MO(t[5],0,59):0,t[6]?MO(t[6],0,59):0,t[7]?MO(t[7],0,1/0)*1e3:0);return r.day=MO(t[3],0,r.calendar.getDaysInMonth(r)),r}function AO(e,t){let n=e.match(DO);if(!n)throw Error(`Invalid ISO 8601 date time string: `+e);let r=MO(n[1],-9999,9999),i=new HO(r<1?`BC`:`AD`,r<1?-r+1:r,MO(n[2],1,12),1,t,0,n[4]?MO(n[4],0,23):0,n[5]?MO(n[5],0,59):0,n[6]?MO(n[6],0,59):0,n[7]?MO(n[7],0,1/0)*1e3:0);return i.day=MO(n[3],0,i.calendar.getDaysInMonth(i)),n[8]&&(i.offset=MO(n[8],-23,23)*36e5+MO(n[9]??`0`,0,59)*6e4),$D(i,t)}function jO(e){return AO(e,SD())}function MO(e,t,n){let r=Number(e);if(rn)throw RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);return r}function NO(e){return`${String(e.hour).padStart(2,`0`)}:${String(e.minute).padStart(2,`0`)}:${String(e.second).padStart(2,`0`)}${e.millisecond?String(e.millisecond/1e3).slice(1):``}`}function PO(e){let t=XD(e,new aD),n;return n=t.era===`BC`?t.year===1?`0000`:`-`+String(Math.abs(1-t.year)).padStart(6,`00`):String(t.year).padStart(4,`0`),`${n}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)}`}function FO(e){return`${PO(e)}T${NO(e)}`}function IO(e){let t=Math.sign(e)<0?`-`:`+`;e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`;return i!==0&&(a+=`:${String(i).padStart(2,`0`)}`),a}function LO(e){return`${FO(e)}${IO(e.offset)}[${e.timeZone}]`}function RO(e){let t=typeof e[0]==`object`?e.shift():new aD,n;if(typeof e[0]==`string`)n=e.shift();else{let e=t.getEras();n=e[e.length-1]}let r=e.shift(),i=e.shift(),a=e.shift();return[t,n,r,i,a]}var zO=class e{constructor(...e){let[t,n,r,i,a]=RO(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,sO(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day):new e(this.calendar,this.year,this.month,this.day)}add(e){return nO(this,e)}subtract(e){return lO(this,e)}set(e){return uO(this,e)}cycle(e,t,n){return vO(this,e,t,n)}toDate(e){return GD(this,e)}toString(){return PO(this)}compare(e){return _D(this,e)}},BO=class e{constructor(e=0,t=0,n=0,r=0){this.hour=e,this.minute=t,this.second=n,this.millisecond=r,pO(this)}copy(){return new e(this.hour,this.minute,this.second,this.millisecond)}add(e){return gO(this,e)}subtract(e){return _O(this,e)}set(e){return dO(this,e)}cycle(e,t,n){return yO(this,e,t,n)}toString(){return NO(this)}compare(e){return vD(this,e)}},VO=class e{constructor(...e){let[t,n,r,i,a]=RO(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,sO(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return nO(this,e)}subtract(e){return lO(this,e)}set(e){return uO(dO(this,e),e)}cycle(e,t,n){switch(e){case`era`:case`year`:case`month`:case`day`:return vO(this,e,t,n);default:return yO(this,e,t,n)}}toDate(e,t){return GD(this,e,t)}toString(){return FO(this)}compare(e){let t=_D(this,e);return t===0?vD(this,JD(e)):t}},HO=class e{constructor(...e){let[t,n,r,i,a]=RO(e),o=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.timeZone=o,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,sO(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return xO(this,e)}subtract(e){return SO(this,e)}set(e,t){return wO(this,e,t)}cycle(e,t,n){return CO(this,e,t,n)}toDate(){return QD(this)}toString(){return LO(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-ZD(e,this.timeZone).toDate().getTime()}},UO=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],WO=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],GO=[1867,1911,1925,1988,2018],KO=[`meiji`,`taisho`,`showa`,`heisei`,`reiwa`];function qO(e){let t=UO.findIndex(([t,n,r])=>e.year=0){let[,n,r]=UO[t];e.month=Math.max(n,e.month),e.month===n&&(e.day=Math.max(r,e.day))}}getEras(){return KO}getYearsInEra(e){let t=KO.indexOf(e.era),n=UO[t],r=UO[t+1];if(r==null)return 9999-n[0]+1;let i=r[0]-n[0];return(e.month0?[`minguo`,t]:[`before_minguo`,1-t]}var rk=class extends aD{fromJulianDay(e){let t=super.fromJulianDay(e),[n,r]=nk(nD(t.era,t.year));return new zO(this,n,r,t.month,t.day)}toJulianDay(e){return super.toJulianDay(ik(e))}getEras(){return[`before_minguo`,`minguo`]}balanceDate(e){let[t,n]=nk(tk(e));e.era=t,e.year=n}isInverseEra(e){return e.era===`before_minguo`}getDaysInMonth(e){return super.getDaysInMonth(ik(e))}getYearsInEra(e){return e.era===`before_minguo`?9999:8088}constructor(...e){super(...e),this.identifier=`roc`}};function ik(e){let[t,n]=rD(tk(e));return new zO(t,n,e.month,e.day)}var ak=1948320,ok=[0,31,62,93,124,155,186,216,246,276,306,336],sk=class{fromJulianDay(e){let t=e-ak,n=1+Math.floor((33*t+3)/12053),r=t-(365*(n-1)+Math.floor((8*n+21)/33)),i=Math.floor(r<216?r/31:(r-6)/30),a=r-ok[i]+1;return new zO(this,n,i+1,a)}toJulianDay(e){let t=1948319+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=ok[e.month-1],t+=e.day,t}getMonthsInYear(){return 12}getDaysInMonth(e){return e.month<=6?31:e.month<=11||QE(25*e.year+11,33)<8?30:29}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getEras(){return[`AP`]}getYearsInEra(){return 9377}constructor(){this.identifier=`persian`}},ck=78,lk=80,uk=class extends aD{fromJulianDay(e){let t=super.fromJulianDay(e),n=t.year-ck,r=e-eD(t.era,t.year,1,1),i;r=8&&(i+=(e.month-7)*30),i+=e.day-1,i)}getDaysInMonth(e){return e.month===1&&tD(e.year+ck)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return[`saka`]}balanceDate(){}constructor(...e){super(...e),this.identifier=`indian`}},dk=1948440,fk=1948439,pk=1300,mk=1600,hk=460322;function gk(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function _k(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),i=Math.min(12,Math.ceil((n-(29+gk(t,r,1,1)))/29.5)+1);return new zO(e,r,i,n-gk(t,r,i,1)+1)}function vk(e){return(14+11*e)%30<11}var yk=class{fromJulianDay(e){return _k(this,dk,e)}toJulianDay(e){return gk(dk,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return e.month===12&&vk(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return vk(e.year)?355:354}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9665}getEras(){return[`AH`]}constructor(){this.identifier=`islamic-civil`}},bk=class extends yk{fromJulianDay(e){return _k(this,fk,e)}toJulianDay(e){return gk(fk,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier=`islamic-tbla`}},xk=`qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=`,Sk,Ck;function wk(e){return hk+Ck[e-pk]}function Tk(e,t){let n=e-pk,r=1<<11-(t-1);return(Sk[n]&r)===0?29:30}function Ek(e,t){let n=wk(e);for(let r=1;re.charCodeAt(0)).buffer),!Ck){Ck=new Uint32Array(301);let e=0;for(let t=pk;t<=mk;t++){Ck[t-pk]=e;for(let n=1;n<=12;n++)e+=Tk(t,n)}}}fromJulianDay(e){let t=e-dk,n=wk(pk),r=wk(mk);if(tr)return super.fromJulianDay(e);{let e=1299,n=1,r=1;for(;r>0;){e++,r=t-wk(e)+1;let i=Dk(e);if(r===i){n=12;break}if(rt;)r-=t,n++,t=Tk(e,n);break}}return new zO(this,e,n,t-Ek(e,n)+1)}}toJulianDay(e){return e.yearmk?super.toJulianDay(e):dk+Ek(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.yearmk?super.getDaysInMonth(e):Tk(e.year,e.month)}getDaysInYear(e){return e.yearmk?super.getDaysInYear(e):Dk(e.year)}},kk=347997,Ak=25920,jk=765433;function Mk(e){return QE(e*7+1,19)<7}function Nk(e){let t=Math.floor((235*e-234)/19),n=12084+13753*t,r=t*29+Math.floor(n/25920);return QE(3*(r+1),7)<3&&(r+=1),r}function Pk(e){let t=Nk(e-1),n=Nk(e);return Nk(e+1)-n===356?2:+(n-t===382)}function Fk(e){return Nk(e)+Pk(e)}function Ik(e){return Fk(e+1)-Fk(e)}function Lk(e){let t=Ik(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function Rk(e,t){if(t>=6&&!Mk(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let n=Lk(e);return t===2?n===2?30:29:t===3?n===0?29:30:t===6?Mk(e)?30:0:30}var zk=class{fromJulianDay(e){let t=e-kk,n=t*Ak/jk,r=Math.floor((19*n+234)/235)+1,i=Fk(r),a=Math.floor(t-i);for(;a<1;)r--,i=Fk(r),a=Math.floor(t-i);let o=1,s=0;for(;s6?e.month--:!Mk(t.year)&&Mk(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier=`hebrew`}},Bk=1723856,Vk=1824665,Hk=5500;function Uk(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function Wk(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-Uk(e,n,1,1))/30);return[n,r,t+1-Uk(e,n,r,1)]}function Gk(e){return Math.floor(e%4/3)}function Kk(e,t){return t%13==0?Gk(e)+5:30}var qk=class{fromJulianDay(e){let[t,n,r]=Wk(Bk,e),i=`AM`;return t<=0&&(i=`AA`,t+=Hk),new zO(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`AA`&&(t-=Hk),Uk(Bk,t,e.month,e.day)}getDaysInMonth(e){return Kk(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+Gk(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(e){return e.era===`AA`?9999:9991}getEras(){return[`AA`,`AM`]}constructor(){this.identifier=`ethiopic`}},Jk=class extends qk{fromJulianDay(e){let[t,n,r]=Wk(Bk,e);return t+=Hk,new zO(this,`AA`,t,n,r)}getEras(){return[`AA`]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier=`ethioaa`}},Yk=class extends qk{fromJulianDay(e){let[t,n,r]=Wk(Vk,e),i=`CE`;return t<=0&&(i=`BCE`,t=1-t),new zO(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`BCE`&&(t=1-t),Uk(Vk,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return e.era===`BCE`&&(t=1-t),Kk(t,e.month)}isInverseEra(e){return e.era===`BCE`}balanceDate(e){e.year<=0&&(e.era=e.era===`BCE`?`CE`:`BCE`,e.year=1-e.year)}getEras(){return[`BCE`,`CE`]}getYearsInEra(e){return e.era===`BCE`?9999:9715}constructor(...e){super(...e),this.identifier=`coptic`}};function Xk(e){switch(e){case`buddhist`:return new QO;case`ethiopic`:return new qk;case`ethioaa`:return new Jk;case`coptic`:return new Yk;case`hebrew`:return new zk;case`indian`:return new uk;case`islamic-civil`:return new yk;case`islamic-tbla`:return new bk;case`islamic-umalqura`:return new Ok;case`japanese`:return new YO;case`persian`:return new sk;case`roc`:return new rk;default:return new aD}}var Zk=new Map,Qk=class{constructor(e,t={}){this.formatter=eA(e,t),this.options=t}format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if(typeof this.formatter.formatRange==`function`)return this.formatter.formatRange(e,t);if(t= start date`);return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if(typeof this.formatter.formatRangeToParts==`function`)return this.formatter.formatRangeToParts(e,t);if(t= start date`);let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return iA()&&(this.resolvedHourCycle||=aA(e.locale,this.options),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle===`h11`||this.resolvedHourCycle===`h12`),e.calendar===`ethiopic-amete-alem`&&(e.calendar=`ethioaa`),e}},$k={true:{ja:`h11`},false:{}};function eA(e,t={}){if(typeof t.hour12==`boolean`&&nA()){t={...t};let n=$k[String(t.hour12)][e.split(`-`)[0]],r=t.hour12?`h12`:`h23`;t.hourCycle=n??r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]e.type===`hour`).value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>e.type===`hour`).value,10);if(r===0&&i===23)return`h23`;if(r===24&&i===23)return`h24`;if(r===0&&i===11)return`h11`;if(r===12&&i===11)return`h12`;throw Error(`Unexpected hour cycle result`)}var oA=[`day`,`month`,`year`],sA={hour:1,minute:2,second:3};function cA(e,t){let{autoComplete:n,isDisabled:r,name:i}=e,{visuallyHiddenProps:a}=av({style:{position:`fixed`,top:0,left:0}}),o=60;t.granularity===`second`?o=1:t.granularity===`hour`&&(o=3600);let s=``;t.value&&(s=t.granularity===`day`?qD(t.value).toString():JD(`timeZone`in t.value?eO(t.value):t.value).toString());let c=t.granularity===`day`?`date`:`datetime-local`,l=[`hour`,`minute`,`second`],u=0;return l.includes(t.granularity)&&(u=sA[t.granularity],l=l.slice(0,u)),{containerProps:{...a,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":`aria-hidden-focus`},inputProps:{tabIndex:-1,autoComplete:n,disabled:r,type:c,form:``,name:i,step:o,value:s,onChange:e=>{let n=H(e).value.toString();if(n)try{let e=kO(n);if(t.granularity===`day`&&(e=OO(n)),`setSegment`in t)for(let n in e)oA.includes(n)&&t.setSegment(n,e[n]),l.includes(n)&&t.setSegment(n,e[n]);t.setValue(e)}catch{}}}}}function lA(e){let{state:t}=e,{containerProps:n,inputProps:r}=cA({...e},t);return v.createElement(`div`,{...n,"data-testid":`hidden-dateinput-container`},v.createElement(`input`,r))}var uA={};uA={calendar:`التقويم`,day:`يوم`,dayPeriod:`ص/م`,endDate:`تاريخ الانتهاء`,era:`العصر`,hour:`الساعات`,minute:`الدقائق`,month:`الشهر`,second:`الثواني`,selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,selectedTimeDescription:e=>`\u{627}\u{644}\u{648}\u{642}\u{62A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.time}`,startDate:`تاريخ البدء`,timeZoneName:`التوقيت`,weekday:`اليوم`,year:`السنة`};var dA={};dA={calendar:`Календар`,day:`ден`,dayPeriod:`пр.об./сл.об.`,endDate:`Крайна дата`,era:`ера`,hour:`час`,minute:`минута`,month:`месец`,second:`секунда`,selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{434}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{432}\u{440}\u{435}\u{43C}\u{435}: ${e.time}`,startDate:`Начална дата`,timeZoneName:`часова зона`,weekday:`ден от седмицата`,year:`година`};var fA={};fA={calendar:`Kalendář`,day:`den`,dayPeriod:`část dne`,endDate:`Konečné datum`,era:`letopočet`,hour:`hodina`,minute:`minuta`,month:`měsíc`,second:`sekunda`,selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.startDate} a\u{17E} ${e.endDate}`,selectedTimeDescription:e=>`Vybran\xfd \u{10D}as: ${e.time}`,startDate:`Počáteční datum`,timeZoneName:`časové pásmo`,weekday:`den v týdnu`,year:`rok`};var pA={};pA={calendar:`Kalender`,day:`dag`,dayPeriod:`AM/PM`,endDate:`Slutdato`,era:`æra`,hour:`time`,minute:`minut`,month:`måned`,second:`sekund`,selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tidspunkt: ${e.time}`,startDate:`Startdato`,timeZoneName:`tidszone`,weekday:`ugedag`,year:`år`};var mA={};mA={calendar:`Kalender`,day:`Tag`,dayPeriod:`Tageshälfte`,endDate:`Enddatum`,era:`Epoche`,hour:`Stunde`,minute:`Minute`,month:`Monat`,second:`Sekunde`,selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.startDate} bis ${e.endDate}`,selectedTimeDescription:e=>`Ausgew\xe4hlte Zeit: ${e.time}`,startDate:`Startdatum`,timeZoneName:`Zeitzone`,weekday:`Wochentag`,year:`Jahr`};var hA={};hA={calendar:`Ημερολόγιο`,day:`ημέρα`,dayPeriod:`π.μ./μ.μ.`,endDate:`Ημερομηνία λήξης`,era:`περίοδος`,hour:`ώρα`,minute:`λεπτό`,month:`μήνας`,second:`δευτερόλεπτο`,selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,selectedTimeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3CE}\u{3C1}\u{3B1}: ${e.time}`,startDate:`Ημερομηνία έναρξης`,timeZoneName:`ζώνη ώρας`,weekday:`καθημερινή`,year:`έτος`};var gA={};gA={era:`era`,year:`year`,month:`month`,day:`day`,hour:`hour`,minute:`minute`,second:`second`,dayPeriod:`AM/PM`,calendar:`Calendar`,startDate:`Start Date`,endDate:`End Date`,weekday:`day of the week`,timeZoneName:`time zone`,selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.startDate} to ${e.endDate}`,selectedTimeDescription:e=>`Selected Time: ${e.time}`};var _A={};_A={calendar:`Calendario`,day:`día`,dayPeriod:`a.\xA0m./p.\xA0m.`,endDate:`Fecha final`,era:`era`,hour:`hora`,minute:`minuto`,month:`mes`,second:`segundo`,selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Rango seleccionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora seleccionada: ${e.time}`,startDate:`Fecha de inicio`,timeZoneName:`zona horaria`,weekday:`día de la semana`,year:`año`};var vA={};vA={calendar:`Kalender`,day:`päev`,dayPeriod:`enne/pärast lõunat`,endDate:`Lõppkuupäev`,era:`ajastu`,hour:`tund`,minute:`minut`,month:`kuu`,second:`sekund`,selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.startDate} kuni ${e.endDate}`,selectedTimeDescription:e=>`Valitud aeg: ${e.time}`,startDate:`Alguskuupäev`,timeZoneName:`ajavöönd`,weekday:`nädalapäev`,year:`aasta`};var yA={};yA={calendar:`Kalenteri`,day:`päivä`,dayPeriod:`vuorokaudenaika`,endDate:`Päättymispäivä`,era:`aikakausi`,hour:`tunti`,minute:`minuutti`,month:`kuukausi`,second:`sekunti`,selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.startDate} \u{2013} ${e.endDate}`,selectedTimeDescription:e=>`Valittu aika: ${e.time}`,startDate:`Alkamispäivä`,timeZoneName:`aikavyöhyke`,weekday:`viikonpäivä`,year:`vuosi`};var bA={};bA={calendar:`Calendrier`,day:`jour`,dayPeriod:`cadran`,endDate:`Date de fin`,era:`ère`,hour:`heure`,minute:`minute`,month:`mois`,second:`seconde`,selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.startDate} au ${e.endDate}`,selectedTimeDescription:e=>`Heure choisie\xa0: ${e.time}`,startDate:`Date de début`,timeZoneName:`fuseau horaire`,weekday:`jour de la semaine`,year:`année`};var xA={};xA={calendar:`לוח שנה`,day:`יום`,dayPeriod:`לפנה״צ/אחה״צ`,endDate:`תאריך סיום`,era:`תקופה`,hour:`שעה`,minute:`דקה`,month:`חודש`,second:`שנייה`,selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,selectedTimeDescription:e=>`\u{5D6}\u{5DE}\u{5DF} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.time}`,startDate:`תאריך התחלה`,timeZoneName:`אזור זמן`,weekday:`יום בשבוע`,year:`שנה`};var SA={};SA={calendar:`Kalendar`,day:`dan`,dayPeriod:`AM/PM`,endDate:`Datum završetka`,era:`era`,hour:`sat`,minute:`minuta`,month:`mjesec`,second:`sekunda`,selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Odabrano vrijeme: ${e.time}`,startDate:`Datum početka`,timeZoneName:`vremenska zona`,weekday:`dan u tjednu`,year:`godina`};var CA={};CA={calendar:`Naptár`,day:`nap`,dayPeriod:`napszak`,endDate:`Befejező dátum`,era:`éra`,hour:`óra`,minute:`perc`,month:`hónap`,second:`másodperc`,selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.startDate}\u{2013}${e.endDate}`,selectedTimeDescription:e=>`Kijel\xf6lt id\u{151}: ${e.time}`,startDate:`Kezdő dátum`,timeZoneName:`időzóna`,weekday:`hét napja`,year:`év`};var wA={};wA={calendar:`Calendario`,day:`giorno`,dayPeriod:`AM/PM`,endDate:`Data finale`,era:`era`,hour:`ora`,minute:`minuto`,month:`mese`,second:`secondo`,selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: da ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Ora selezionata: ${e.time}`,startDate:`Data iniziale`,timeZoneName:`fuso orario`,weekday:`giorno della settimana`,year:`anno`};var TA={};TA={calendar:`カレンダー`,day:`日`,dayPeriod:`午前/午後`,endDate:`終了日`,era:`時代`,hour:`時`,minute:`分`,month:`月`,second:`秒`,selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.startDate} \u{304B}\u{3089} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{6642}\u{9593} : ${e.time}`,startDate:`開始日`,timeZoneName:`タイムゾーン`,weekday:`曜日`,year:`年`};var EA={};EA={calendar:`달력`,day:`일`,dayPeriod:`오전/오후`,endDate:`종료일`,era:`연호`,hour:`시`,minute:`분`,month:`월`,second:`초`,selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.startDate} ~ ${e.endDate}`,selectedTimeDescription:e=>`\u{C120}\u{D0DD} \u{C2DC}\u{AC04}: ${e.time}`,startDate:`시작일`,timeZoneName:`시간대`,weekday:`요일`,year:`년`};var DA={};DA={calendar:`Kalendorius`,day:`diena`,dayPeriod:`iki pietų / po pietų`,endDate:`Pabaigos data`,era:`era`,hour:`valanda`,minute:`minutė`,month:`mėnuo`,second:`sekundė`,selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: nuo ${e.startDate} iki ${e.endDate}`,selectedTimeDescription:e=>`Pasirinktas laikas: ${e.time}`,startDate:`Pradžios data`,timeZoneName:`laiko juosta`,weekday:`savaitės diena`,year:`metai`};var OA={};OA={calendar:`Kalendārs`,day:`diena`,dayPeriod:`priekšpusdienā/pēcpusdienā`,endDate:`Beigu datums`,era:`ēra`,hour:`stundas`,minute:`minūtes`,month:`mēnesis`,second:`sekundes`,selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: no ${e.startDate} l\u{12B}dz ${e.endDate}`,selectedTimeDescription:e=>`Atlas\u{12B}tais laiks: ${e.time}`,startDate:`Sākuma datums`,timeZoneName:`laika josla`,weekday:`nedēļas diena`,year:`gads`};var kA={};kA={calendar:`Kalender`,day:`dag`,dayPeriod:`a.m./p.m.`,endDate:`Sluttdato`,era:`tidsalder`,hour:`time`,minute:`minutt`,month:`måned`,second:`sekund`,selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tid: ${e.time}`,startDate:`Startdato`,timeZoneName:`tidssone`,weekday:`ukedag`,year:`år`};var AA={};AA={calendar:`Kalender`,day:`dag`,dayPeriod:`a.m./p.m.`,endDate:`Einddatum`,era:`tijdperk`,hour:`uur`,minute:`minuut`,month:`maand`,second:`seconde`,selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.startDate} tot ${e.endDate}`,selectedTimeDescription:e=>`Geselecteerde tijd: ${e.time}`,startDate:`Startdatum`,timeZoneName:`tijdzone`,weekday:`dag van de week`,year:`jaar`};var jA={};jA={calendar:`Kalendarz`,day:`dzień`,dayPeriod:`rano / po południu / wieczorem`,endDate:`Data końcowa`,era:`era`,hour:`godzina`,minute:`minuta`,month:`miesiąc`,second:`sekunda`,selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Wybrany czas: ${e.time}`,startDate:`Data początkowa`,timeZoneName:`strefa czasowa`,weekday:`dzień tygodnia`,year:`rok`};var MA={};MA={calendar:`Calendário`,day:`dia`,dayPeriod:`AM/PM`,endDate:`Data final`,era:`era`,hour:`hora`,minute:`minuto`,month:`mês`,second:`segundo`,selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:`Data inicial`,timeZoneName:`fuso horário`,weekday:`dia da semana`,year:`ano`};var NA={};NA={calendar:`Calendário`,day:`dia`,dayPeriod:`am/pm`,endDate:`Data de Término`,era:`era`,hour:`hora`,minute:`minuto`,month:`mês`,second:`segundo`,selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:`Data de Início`,timeZoneName:`fuso horário`,weekday:`dia da semana`,year:`ano`};var PA={};PA={calendar:`Calendar`,day:`zi`,dayPeriod:`a.m/p.m.`,endDate:`Dată final`,era:`eră`,hour:`oră`,minute:`minut`,month:`lună`,second:`secundă`,selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: de la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,selectedTimeDescription:e=>`Ora selectat\u{103}: ${e.time}`,startDate:`Dată început`,timeZoneName:`fus orar`,weekday:`ziua din săptămână`,year:`an`};var FA={};FA={calendar:`Календарь`,day:`день`,dayPeriod:`AM/PM`,endDate:`Дата окончания`,era:`эра`,hour:`час`,minute:`минута`,month:`месяц`,second:`секунда`,selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: \u{441} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{43E}\u{435} \u{432}\u{440}\u{435}\u{43C}\u{44F}: ${e.time}`,startDate:`Дата начала`,timeZoneName:`часовой пояс`,weekday:`день недели`,year:`год`};var IA={};IA={calendar:`Kalendár`,day:`deň`,dayPeriod:`AM/PM`,endDate:`Dátum ukončenia`,era:`letopočet`,hour:`hodina`,minute:`minúta`,month:`mesiac`,second:`sekunda`,selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Vybrat\xfd \u{10D}as: ${e.time}`,startDate:`Dátum začatia`,timeZoneName:`časové pásmo`,weekday:`deň týždňa`,year:`rok`};var LA={};LA={calendar:`Koledar`,day:`dan`,dayPeriod:`dop/pop`,endDate:`Datum konca`,era:`doba`,hour:`ura`,minute:`minuta`,month:`mesec`,second:`sekunda`,selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izbrani \u{10D}as: ${e.time}`,startDate:`Datum začetka`,timeZoneName:`časovni pas`,weekday:`dan v tednu`,year:`leto`};var RA={};RA={calendar:`Kalendar`,day:`дан`,dayPeriod:`пре подне/по подне`,endDate:`Datum završetka`,era:`ера`,hour:`сат`,minute:`минут`,month:`месец`,second:`секунд`,selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani opseg: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izabrano vreme: ${e.time}`,startDate:`Datum početka`,timeZoneName:`временска зона`,weekday:`дан у недељи`,year:`година`};var zA={};zA={calendar:`Kalender`,day:`dag`,dayPeriod:`fm/em`,endDate:`Slutdatum`,era:`era`,hour:`timme`,minute:`minut`,month:`månad`,second:`sekund`,selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.startDate} till ${e.endDate}`,selectedTimeDescription:e=>`Vald tid: ${e.time}`,startDate:`Startdatum`,timeZoneName:`tidszon`,weekday:`veckodag`,year:`år`};var BA={};BA={calendar:`Takvim`,day:`gün`,dayPeriod:`ÖÖ/ÖS`,endDate:`Bitiş Tarihi`,era:`çağ`,hour:`saat`,minute:`dakika`,month:`ay`,second:`saniye`,selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.startDate} - ${e.endDate}`,selectedTimeDescription:e=>`Se\xe7ilen Zaman: ${e.time}`,startDate:`Başlangıç Tarihi`,timeZoneName:`saat dilimi`,weekday:`haftanın günü`,year:`yıl`};var VA={};VA={calendar:`Календар`,day:`день`,dayPeriod:`дп/пп`,endDate:`Дата завершення`,era:`ера`,hour:`година`,minute:`хвилина`,month:`місяць`,second:`секунда`,selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{2014} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{447}\u{430}\u{441}: ${e.time}`,startDate:`Дата початку`,timeZoneName:`часовий пояс`,weekday:`день тижня`,year:`рік`};var HA={};HA={calendar:`日历`,day:`日`,dayPeriod:`上午/下午`,endDate:`结束日期`,era:`纪元`,hour:`小时`,minute:`分钟`,month:`月`,second:`秒`,selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65F6}\u{95F4}\u{FF1A}${e.time}`,startDate:`开始日期`,timeZoneName:`时区`,weekday:`工作日`,year:`年`};var UA={};UA={calendar:`日曆`,day:`日`,dayPeriod:`上午/下午`,endDate:`結束日期`,era:`纪元`,hour:`小时`,minute:`分钟`,month:`月`,second:`秒`,selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{6642}\u{9593}\u{FF1A}${e.time}`,startDate:`開始日期`,timeZoneName:`时区`,weekday:`工作日`,year:`年`};var WA={};WA={"ar-AE":uA,"bg-BG":dA,"cs-CZ":fA,"da-DK":pA,"de-DE":mA,"el-GR":hA,"en-US":gA,"es-ES":_A,"et-EE":vA,"fi-FI":yA,"fr-FR":bA,"he-IL":xA,"hr-HR":SA,"hu-HU":CA,"it-IT":wA,"ja-JP":TA,"ko-KR":EA,"lt-LT":DA,"lv-LV":OA,"nb-NO":kA,"nl-NL":AA,"pl-PL":jA,"pt-BR":MA,"pt-PT":NA,"ro-RO":PA,"ru-RU":FA,"sk-SK":IA,"sl-SI":LA,"sr-SP":RA,"sv-SE":zA,"tr-TR":BA,"uk-UA":VA,"zh-CN":HA,"zh-TW":UA};function GA(e,t,n){let{direction:r}=rp(),i=(0,v.useMemo)(()=>Ug(t),[t]),{keyboardProps:a}=Sm({shortcuts:{"Alt+ArrowDown":()=>{if(`setOpen`in e){e.setOpen(!0);return}return!1},"Alt+ArrowUp":()=>{if(`setOpen`in e){e.setOpen(!0);return}return!1},ArrowLeft:e=>{if(n)return!1;if(r===`rtl`){if(t.current){let n=H(e),r=KA(t.current,n.getBoundingClientRect().left,-1);if(r){r.focus();return}}}else{i.focusPrevious();return}return!1},ArrowRight:e=>{if(n)return!1;if(r===`rtl`){if(t.current){let n=H(e),r=KA(t.current,n.getBoundingClientRect().left,1);if(r){r.focus();return}}}else{i.focusNext();return}return!1}},allowRepeats:!0}),o=()=>{if(!t.current)return;let e=window.event?H(window.event):null,n=Hg(t.current,{tabbable:!0});if(e&&=(n.currentNode=e,n.previousNode()),!e){let t;do t=n.lastChild(),t&&(e=t);while(t)}for(;e?.hasAttribute(`data-placeholder`);){let t=n.previousNode();if(t&&t.hasAttribute(`data-placeholder`))e=t;else break}e&&e.focus()},{pressProps:s}=Rm({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(e){e.pointerType===`mouse`&&o()},onPress(e){(e.pointerType===`touch`||e.pointerType===`pen`)&&o()}});return U(s,a)}function KA(e,t,n){let r=Hg(e,{tabbable:!0}),i=r.nextNode(),a=null,o=1/0;for(;i;){let e=i.getBoundingClientRect().left-t,s=Math.abs(e);Math.sign(e)===n&&s{t.confirmPlaceholder(),t.value!==u.current&&t.commitValidation(),e.onBlur?.(n)},onFocusWithinChange:e.onFocusChange}),f=rv(qA(WA),`@react-aria/datepicker`),p=t.maxGranularity===`hour`?`selectedTimeDescription`:`selectedDateDescription`,m=t.maxGranularity===`hour`?`time`:`date`,h=tc(t.value?f.format(p,{[m]:t.formatValue({month:`long`})}):``),g=e.__reactAriaDateFieldRole===`presentation`?s[`aria-describedby`]:[h[`aria-describedby`],s[`aria-describedby`]].filter(Boolean).join(` `)||void 0,_=e[XA],y=(0,v.useMemo)(()=>_||Ug(n),[_,n]),b=GA(t,n,e[YA]===`presentation`);JA.set(t,{ariaLabel:e[`aria-label`],ariaLabelledBy:[o.id,e[`aria-labelledby`]].filter(Boolean).join(` `)||void 0,ariaDescribedBy:g,focusManager:y});let x=(0,v.useRef)(e.autoFocus),S;S=e.__reactAriaDateFieldRole===`presentation`?{role:`presentation`}:U(s,{role:`group`,"aria-disabled":e.isDisabled||void 0,"aria-describedby":g}),(0,v.useEffect)(()=>{x.current&&y.focusFirst(),x.current=!1},[y]),cc(e.inputRef,t.defaultValue,t.setValue),$C({...e,focus(){y.focusFirst()}},t,e.inputRef);let C={type:`hidden`,name:e.name,form:e.form,value:t.value?.toString()||``,disabled:e.isDisabled};e.validationBehavior===`native`&&(C.type=`text`,C.hidden=!0,C.required=e.isRequired,C.onChange=()=>{});let w=W(e);return{labelProps:{...o,onClick:()=>{y.focusFirst()}},fieldProps:U(w,S,b,d,{onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,style:{unicodeBidi:`isolate`}}),inputProps:C,descriptionProps:c,errorMessageProps:l,isInvalid:r,validationErrors:i,validationDetails:a}}function QA(e,t,n){let r=ZA(e,t,n);return r.inputProps.value=t.timeValue?.toString()||``,r}function $A(e){e=sc(e??{},ej);let{locale:t}=rp();return(0,v.useMemo)(()=>new Qk(t,e),[t,e])}function ej(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(t[r]!==e[r])return!1;return!0}function tj(e){return e&&e.__esModule?e.default:e}function nj(){let{locale:e}=rp(),t=nv(tj(WA),`@react-aria/datepicker`);return(0,v.useMemo)(()=>{try{return new Intl.DisplayNames(e,{type:`dateTimeField`})}catch{return new rj(e,t)}},[e,t])}var rj=class{constructor(e,t){this.locale=e,this.dictionary=t}of(e){return this.dictionary.getStringForLocale(e,this.locale)}};function ij(e,t,n){let r=(0,v.useRef)(``),{locale:i,direction:a}=rp(),o=nj(),{ariaLabel:s,ariaLabelledBy:c,ariaDescribedBy:l,focusManager:u}=JA.get(t),d=e.isPlaceholder?``:e.text,f=(0,v.useMemo)(()=>t.dateFormatter.resolvedOptions(),[t.dateFormatter]),p=$A({month:`long`,timeZone:f.timeZone}),m=$A({hour:`numeric`,hour12:f.hour12,timeZone:f.timeZone});if(e.type===`month`&&!e.isPlaceholder){let e=p.format(t.dateValue);d=e===d?e:`${d} \u{2013} ${e}`}else e.type===`hour`&&!e.isPlaceholder&&(d=m.format(t.dateValue));let{spinButtonProps:h}=tE({value:e.value??void 0,textValue:d,minValue:e.minValue,maxValue:e.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly||!e.isEditable,isRequired:t.isRequired,onIncrement:()=>{r.current=``,t.increment(e.type)},onDecrement:()=>{r.current=``,t.decrement(e.type)},onIncrementPage:()=>{r.current=``,t.incrementPage(e.type)},onDecrementPage:()=>{r.current=``,t.decrementPage(e.type)},onIncrementToMax:()=>{r.current=``,t.incrementToMax(e.type)},onDecrementToMin:()=>{r.current=``,t.decrementToMin(e.type)}}),g=(0,v.useMemo)(()=>new pp(i,{maximumFractionDigits:0}),[i]),_=()=>{if(e.text===e.placeholder&&u.focusPrevious(),g.isValidPartialNumber(e.text)&&!t.isReadOnly&&!e.isPlaceholder){let n=e.text.slice(0,-1),i=g.parse(n);n=i===0?``:n,n.length===0||i===0?t.clearSegment(e.type):t.setSegment(e.type,i),r.current=n}else(e.type===`dayPeriod`||e.type===`era`)&&t.clearSegment(e.type)},{keyboardProps:y}=Sm({shortcuts:{Backspace:()=>{_()},Delete:()=>{_()},"Mod+a":()=>{}},allowRepeats:!0}),{startsWith:b}=TS({sensitivity:`base`}),x=$A({hour:`numeric`,hour12:!0}),S=(0,v.useMemo)(()=>{let e=new Date;return e.setHours(0),x.formatToParts(e).find(e=>e.type===`dayPeriod`).value},[x]),C=(0,v.useMemo)(()=>{let e=new Date;return e.setHours(12),x.formatToParts(e).find(e=>e.type===`dayPeriod`).value},[x]),w=$A({year:`numeric`,era:`narrow`,timeZone:`UTC`}),T=(0,v.useMemo)(()=>{if(e.type!==`era`)return[];let n=XD(new zO(1,1,1),t.calendar),r=t.calendar.getEras().map(e=>{let t=n.set({year:1,month:1,day:1,era:e}).toDate(`UTC`);return{era:e,formatted:w.formatToParts(t).find(e=>e.type===`era`).value}}),i=aj(r.map(e=>e.formatted));if(i)for(let e of r)e.formatted=e.formatted.slice(i);return r},[w,t.calendar,e.type]),E=n=>{if(t.isDisabled||t.isReadOnly)return;let i=r.current+n;switch(e.type){case`dayPeriod`:if(b(S,n))t.setSegment(`dayPeriod`,0);else if(b(C,n))t.setSegment(`dayPeriod`,1);else break;u.focusNext();break;case`era`:{let e=T.find(e=>b(e.formatted,n));e&&(t.setSegment(`era`,e.era),u.focusNext());break}case`day`:case`hour`:case`minute`:case`second`:case`month`:case`year`:{if(!g.isValidPartialNumber(i))return;let a=g.parse(i),o=a;if(e.maxValue!==void 0&&a>e.maxValue&&(o=g.parse(n)),isNaN(a))return;t.setSegment(e.type,o),e.maxValue!==void 0&&(Number(a+`0`)>e.maxValue||i.length>=String(e.maxValue).length)?(r.current=``,u.focusNext()):r.current=i;break}}},D=()=>{r.current=``,n.current&&ic(n.current,{containingElement:Gs(n.current)}),window.getSelection()?.collapse(n.current)};nc((0,v.useRef)(typeof document<`u`?document:null),`selectionchange`,()=>{let e=window.getSelection();e?.anchorNode&&ps(n.current,e?.anchorNode)&&ms()===n.current&&e.collapse(n.current)});let O=(0,v.useRef)(``);nc(n,`beforeinput`,r=>{if(n.current)switch(r.preventDefault(),r.inputType){case`deleteContentBackward`:case`deleteContentForward`:g.isValidPartialNumber(e.text)&&!t.isReadOnly&&_();break;case`insertCompositionText`:O.current=n.current.textContent,n.current.textContent=n.current.textContent;break;default:r.data!=null&&E(r.data)}}),nc(n,`input`,e=>{let{inputType:t,data:r}=e;t===`insertCompositionText`&&(n.current&&(n.current.textContent=O.current),r!=null&&(b(S,r)||b(C,r))&&E(r))}),Io(()=>{let e=n.current;return()=>{ms()===e&&(u.focusPrevious()||u.focusNext())}},[n,u]);let k=go()||e.type===`timeZoneName`?{role:`textbox`,"aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e!==(0,v.useMemo)(()=>t.segments.find(e=>e.isEditable),[t.segments])&&!t.isInvalid&&(l=void 0);let A=es(),j=!t.isDisabled&&!t.isReadOnly&&e.isEditable,M=Fs({"aria-label":`${e.type===`literal`?``:o.of(e.type)}${s?`, ${s}`:``}${c?`, `:``}`,"aria-labelledby":c});if(e.type===`literal`)return{segmentProps:{"aria-hidden":!0}};let N={caretColor:`transparent`};if(a===`rtl`){N.unicodeBidi=`embed`;let t=f[e.type];(t===`numeric`||t===`2-digit`)&&(N.direction=`ltr`)}return{segmentProps:U(h,M,{id:A,...k,...y,"aria-invalid":t.isInvalid?`true`:void 0,"aria-describedby":l,"aria-readonly":t.isReadOnly||!e.isEditable?`true`:void 0,"data-placeholder":e.isPlaceholder||void 0,contentEditable:j,suppressContentEditableWarning:j,spellCheck:j?`false`:void 0,autoCorrect:j?`off`:void 0,enterKeyHint:j?`next`:void 0,inputMode:t.isDisabled||e.type===`dayPeriod`||e.type===`era`||!j?void 0:`numeric`,tabIndex:t.isDisabled?void 0:0,onFocus:D,style:N,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}function aj(e){e.sort();let t=e[0],n=e[e.length-1];for(let e=0;e`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.maxValue} \u{623}\u{648} \u{642}\u{628}\u{644} \u{630}\u{644}\u{643}.`,rangeReversed:`تاريخ البدء يجب أن يكون قبل تاريخ الانتهاء.`,rangeUnderflow:e=>`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.minValue} \u{623}\u{648} \u{628}\u{639}\u{62F} \u{630}\u{644}\u{643}.`,unavailableDate:`البيانات المحددة غير متاحة.`};var sj={};sj={rangeOverflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.maxValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{440}\u{430}\u{43D}\u{43D}\u{430}.`,rangeReversed:`Началната дата трябва да е преди крайната.`,rangeUnderflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.minValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{43A}\u{44A}\u{441}\u{43D}\u{43E}.`,unavailableDate:`Избраната дата не е налична.`};var cj={};cj={rangeOverflow:e=>`Hodnota mus\xed b\xfdt ${e.maxValue} nebo d\u{159}\xedv\u{11B}j\u{161}\xed.`,rangeReversed:`Datum zahájení musí předcházet datu ukončení.`,rangeUnderflow:e=>`Hodnota mus\xed b\xfdt ${e.minValue} nebo pozd\u{11B}j\u{161}\xed.`,unavailableDate:`Vybrané datum není k dispozici.`};var lj={};lj={rangeOverflow:e=>`V\xe6rdien skal v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:`Startdatoen skal være før slutdatoen.`,rangeUnderflow:e=>`V\xe6rdien skal v\xe6re ${e.minValue} eller nyere.`,unavailableDate:`Den valgte dato er ikke tilgængelig.`};var uj={};uj={rangeOverflow:e=>`Der Wert muss ${e.maxValue} oder fr\xfcher sein.`,rangeReversed:`Das Startdatum muss vor dem Enddatum liegen.`,rangeUnderflow:e=>`Der Wert muss ${e.minValue} oder sp\xe4ter sein.`,unavailableDate:`Das ausgewählte Datum ist nicht verfügbar.`};var dj={};dj={rangeOverflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.maxValue} \u{3AE} \u{3C0}\u{3B1}\u{3BB}\u{3B1}\u{3B9}\u{3CC}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,rangeReversed:`Η ημερομηνία έναρξης πρέπει να είναι πριν από την ημερομηνία λήξης.`,rangeUnderflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.minValue} \u{3AE} \u{3BC}\u{3B5}\u{3C4}\u{3B1}\u{3B3}\u{3B5}\u{3BD}\u{3AD}\u{3C3}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,unavailableDate:`Η επιλεγμένη ημερομηνία δεν είναι διαθέσιμη.`};var fj={};fj={rangeUnderflow:e=>`Value must be ${e.minValue} or later.`,rangeOverflow:e=>`Value must be ${e.maxValue} or earlier.`,rangeReversed:`Start date must be before end date.`,unavailableDate:`Selected date unavailable.`};var pj={};pj={rangeOverflow:e=>`El valor debe ser ${e.maxValue} o anterior.`,rangeReversed:`La fecha de inicio debe ser anterior a la fecha de finalización.`,rangeUnderflow:e=>`El valor debe ser ${e.minValue} o posterior.`,unavailableDate:`Fecha seleccionada no disponible.`};var mj={};mj={rangeOverflow:e=>`V\xe4\xe4rtus peab olema ${e.maxValue} v\xf5i varasem.`,rangeReversed:`Alguskuupäev peab olema enne lõppkuupäeva.`,rangeUnderflow:e=>`V\xe4\xe4rtus peab olema ${e.minValue} v\xf5i hilisem.`,unavailableDate:`Valitud kuupäev pole saadaval.`};var hj={};hj={rangeOverflow:e=>`Arvon on oltava ${e.maxValue} tai sit\xe4 aikaisempi.`,rangeReversed:`Aloituspäivän on oltava ennen lopetuspäivää.`,rangeUnderflow:e=>`Arvon on oltava ${e.minValue} tai sit\xe4 my\xf6h\xe4isempi.`,unavailableDate:`Valittu päivämäärä ei ole käytettävissä.`};var gj={};gj={rangeOverflow:e=>`La valeur doit \xeatre ${e.maxValue} ou ant\xe9rieure.`,rangeReversed:`La date de début doit être antérieure à la date de fin.`,rangeUnderflow:e=>`La valeur doit \xeatre ${e.minValue} ou ult\xe9rieure.`,unavailableDate:`La date sélectionnée n’est pas disponible.`};var _j={};_j={rangeOverflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.maxValue} \u{5D0}\u{5D5} \u{5DE}\u{5D5}\u{5E7}\u{5D3}\u{5DD} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,rangeReversed:`תאריך ההתחלה חייב להיות לפני תאריך הסיום.`,rangeUnderflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.minValue} \u{5D0}\u{5D5} \u{5DE}\u{5D0}\u{5D5}\u{5D7}\u{5E8} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,unavailableDate:`התאריך הנבחר אינו זמין.`};var vj={};vj={rangeOverflow:e=>`Vrijednost mora biti ${e.maxValue} ili ranije.`,rangeReversed:`Datum početka mora biti prije datuma završetka.`,rangeUnderflow:e=>`Vrijednost mora biti ${e.minValue} ili kasnije.`,unavailableDate:`Odabrani datum nije dostupan.`};var yj={};yj={rangeOverflow:e=>`Az \xe9rt\xe9knek ${e.maxValue} vagy kor\xe1bbinak kell lennie.`,rangeReversed:`A kezdő dátumnak a befejező dátumnál korábbinak kell lennie.`,rangeUnderflow:e=>`Az \xe9rt\xe9knek ${e.minValue} vagy k\xe9s\u{151}bbinek kell lennie.`,unavailableDate:`A kiválasztott dátum nem érhető el.`};var bj={};bj={rangeOverflow:e=>`Il valore deve essere ${e.maxValue} o precedente.`,rangeReversed:`La data di inizio deve essere antecedente alla data di fine.`,rangeUnderflow:e=>`Il valore deve essere ${e.minValue} o successivo.`,unavailableDate:`Data selezionata non disponibile.`};var xj={};xj={rangeOverflow:e=>`\u{5024}\u{306F} ${e.maxValue} \u{4EE5}\u{4E0B}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,rangeReversed:`開始日は終了日より前にする必要があります。`,rangeUnderflow:e=>`\u{5024}\u{306F} ${e.minValue} \u{4EE5}\u{4E0A}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,unavailableDate:`選択した日付は使用できません。`};var Sj={};Sj={rangeOverflow:e=>`\u{AC12}\u{C740} ${e.maxValue} \u{C774}\u{C804}\u{C774}\u{C5B4}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,rangeReversed:`시작일은 종료일 이전이어야 합니다.`,rangeUnderflow:e=>`\u{AC12}\u{C740} ${e.minValue} \u{C774}\u{D6C4}\u{C5EC}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,unavailableDate:`선택한 날짜를 사용할 수 없습니다.`};var Cj={};Cj={rangeOverflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.maxValue} arba ankstesn\u{117}.`,rangeReversed:`Pradžios data turi būti ankstesnė nei pabaigos data.`,rangeUnderflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.minValue} arba naujesn\u{117}.`,unavailableDate:`Pasirinkta data nepasiekiama.`};var wj={};wj={rangeOverflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.maxValue} vai agr\u{101}kai.`,rangeReversed:`Sākuma datumam ir jābūt pirms beigu datuma.`,rangeUnderflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.minValue} vai v\u{113}l\u{101}kai.`,unavailableDate:`Atlasītais datums nav pieejams.`};var Tj={};Tj={rangeOverflow:e=>`Verdien m\xe5 v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:`Startdatoen må være før sluttdatoen.`,rangeUnderflow:e=>`Verdien m\xe5 v\xe6re ${e.minValue} eller senere.`,unavailableDate:`Valgt dato utilgjengelig.`};var Ej={};Ej={rangeOverflow:e=>`Waarde moet ${e.maxValue} of eerder zijn.`,rangeReversed:`De startdatum moet voor de einddatum liggen.`,rangeUnderflow:e=>`Waarde moet ${e.minValue} of later zijn.`,unavailableDate:`Geselecteerde datum niet beschikbaar.`};var Dj={};Dj={rangeOverflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.maxValue} lub wcze\u{15B}niejsz\u{105}.`,rangeReversed:`Data rozpoczęcia musi być wcześniejsza niż data zakończenia.`,rangeUnderflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.minValue} lub p\xf3\u{17A}niejsz\u{105}.`,unavailableDate:`Wybrana data jest niedostępna.`};var Oj={};Oj={rangeOverflow:e=>`O valor deve ser ${e.maxValue} ou anterior.`,rangeReversed:`A data inicial deve ser anterior à data final.`,rangeUnderflow:e=>`O valor deve ser ${e.minValue} ou posterior.`,unavailableDate:`Data selecionada indisponível.`};var kj={};kj={rangeOverflow:e=>`O valor tem de ser ${e.maxValue} ou anterior.`,rangeReversed:`A data de início deve ser anterior à data de fim.`,rangeUnderflow:e=>`O valor tem de ser ${e.minValue} ou posterior.`,unavailableDate:`Data selecionada indisponível.`};var Aj={};Aj={rangeOverflow:e=>`Valoarea trebuie s\u{103} fie ${e.maxValue} sau anterioar\u{103}.`,rangeReversed:`Data de început trebuie să fie anterioară datei de sfârșit.`,rangeUnderflow:e=>`Valoarea trebuie s\u{103} fie ${e.minValue} sau ulterioar\u{103}.`,unavailableDate:`Data selectată nu este disponibilă.`};var jj={};jj={rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{43F}\u{43E}\u{437}\u{436}\u{435} ${e.maxValue}.`,rangeReversed:`Дата начала должна предшествовать дате окончания.`,rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{44C}\u{448}\u{435} ${e.minValue}.`,unavailableDate:`Выбранная дата недоступна.`};var Mj={};Mj={rangeOverflow:e=>`Hodnota mus\xed by\u{165} ${e.maxValue} alebo skor\u{161}ia.`,rangeReversed:`Dátum začiatku musí byť skorší ako dátum konca.`,rangeUnderflow:e=>`Hodnota mus\xed by\u{165} ${e.minValue} alebo neskor\u{161}ia.`,unavailableDate:`Vybratý dátum je nedostupný.`};var Nj={};Nj={rangeOverflow:e=>`Vrednost mora biti ${e.maxValue} ali starej\u{161}a.`,rangeReversed:`Začetni datum mora biti pred končnim datumom.`,rangeUnderflow:e=>`Vrednost mora biti ${e.minValue} ali novej\u{161}a.`,unavailableDate:`Izbrani datum ni na voljo.`};var Pj={};Pj={rangeOverflow:e=>`Vrednost mora da bude ${e.maxValue} ili starija.`,rangeReversed:`Datum početka mora biti pre datuma završetka.`,rangeUnderflow:e=>`Vrednost mora da bude ${e.minValue} ili novija.`,unavailableDate:`Izabrani datum nije dostupan.`};var Fj={};Fj={rangeOverflow:e=>`V\xe4rdet m\xe5ste vara ${e.maxValue} eller tidigare.`,rangeReversed:`Startdatumet måste vara före slutdatumet.`,rangeUnderflow:e=>`V\xe4rdet m\xe5ste vara ${e.minValue} eller senare.`,unavailableDate:`Det valda datumet är inte tillgängligt.`};var Ij={};Ij={rangeOverflow:e=>`De\u{11F}er, ${e.maxValue} veya \xf6ncesi olmal\u{131}d\u{131}r.`,rangeReversed:`Başlangıç tarihi bitiş tarihinden önce olmalıdır.`,rangeUnderflow:e=>`De\u{11F}er, ${e.minValue} veya sonras\u{131} olmal\u{131}d\u{131}r.`,unavailableDate:`Seçilen tarih kullanılamıyor.`};var Lj={};Lj={rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{43F}\u{456}\u{437}\u{43D}\u{456}\u{448}\u{435} ${e.maxValue}.`,rangeReversed:`Дата початку має передувати даті завершення.`,rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{456}\u{448}\u{435} ${e.minValue}.`,unavailableDate:`Вибрана дата недоступна.`};var Rj={};Rj={rangeOverflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{65E5}\u{671F}\u{3002}`,rangeReversed:`开始日期必须早于结束日期。`,rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{65E5}\u{671F}\u{3002}`,unavailableDate:`所选日期不可用。`};var zj={};zj={rangeOverflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{3002}`,rangeReversed:`開始日期必須在結束日期之前。`,rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{3002}`,unavailableDate:`所選日期無法使用。`};var Bj={};Bj={"ar-AE":oj,"bg-BG":sj,"cs-CZ":cj,"da-DK":lj,"de-DE":uj,"el-GR":dj,"en-US":fj,"es-ES":pj,"et-EE":mj,"fi-FI":hj,"fr-FR":gj,"he-IL":_j,"hr-HR":vj,"hu-HU":yj,"it-IT":bj,"ja-JP":xj,"ko-KR":Sj,"lt-LT":Cj,"lv-LV":wj,"nb-NO":Tj,"nl-NL":Ej,"pl-PL":Dj,"pt-BR":Oj,"pt-PT":kj,"ro-RO":Aj,"ru-RU":jj,"sk-SK":Mj,"sl-SI":Nj,"sr-SP":Pj,"sv-SE":Fj,"tr-TR":Ij,"uk-UA":Lj,"zh-CN":Rj,"zh-TW":zj};function Vj(e){return e&&e.__esModule?e.default:e}var Hj=new q_(Vj(Bj));function Uj(){let e=typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e=`en-US`}return e}function Wj(e,t,n,r,i){let a=e!=null&&n!=null&&e.compare(n)>0,o=e!=null&&t!=null&&e.compare(t)<0,s=e!=null&&r?.(e)||!1,c=a||o||s,l=[];if(c){let e=Uj(),r=new $_(e,q_.getGlobalDictionaryForPackage(`@react-stately/datepicker`)||Hj),c=new Qk(e,Jj({},i)),u=c.resolvedOptions().timeZone;o&&t!=null&&l.push(r.format(`rangeUnderflow`,{minValue:c.format(t.toDate(u))})),a&&n!=null&&l.push(r.format(`rangeOverflow`,{maxValue:c.format(n.toDate(u))})),s&&l.push(r.format(`unavailableDate`))}return{isInvalid:c,validationErrors:l,validationDetails:{badInput:s,customError:!1,patternMismatch:!1,rangeOverflow:a,rangeUnderflow:o,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!c}}}function Gj(e,t,n,r,i){let a=BS(Wj(e?.start??null,t,n,r,i),Wj(e?.end??null,t,n,r,i));if(e?.end!=null&&e.start!=null&&e.end.compare(e.start)<0){let e=q_.getGlobalDictionaryForPackage(`@react-stately/datepicker`)||Hj;a=BS(a,{isInvalid:!0,validationErrors:[e.getStringForLocale(`rangeReversed`,Uj())],validationDetails:{...kS,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})}return a}var Kj={year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`2-digit`,second:`2-digit`},qj={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`};function Jj(e,t){e={...t.shouldForceLeadingZeros?qj:Kj,...e};let n=t.granularity||`minute`,r=Object.keys(e),i=r.indexOf(t.maxGranularity??`year`);i<0&&(i=0);let a=r.indexOf(n);if(a<0&&(a=2),i>a)throw Error(`maxGranularity must be greater than granularity`);let o=r.slice(i,a+1).reduce((t,n)=>(t[n]=e[n],t),{});return t.hourCycle!=null&&(o.hour12=t.hourCycle===12),o.timeZone=t.timeZone||`UTC`,(n===`hour`||n===`minute`||n===`second`)&&t.timeZone&&!t.hideTimeZone&&(o.timeZoneName=`short`),t.showEra&&i===0&&(o.era=`short`),o}function Yj(e){return e&&`hour`in e?e:new BO}function Xj(e,t){if(e===null)return null;if(e)return XD(e,t)}function Zj(e,t,n,r){if(e)return Xj(e,n);let i=XD(hD(r??SD()).set({hour:0,minute:0,second:0,millisecond:0}),n);return t===`year`||t===`month`||t===`day`?qD(i):r?i:JD(i)}function Qj(e,t){let n=e&&`timeZone`in e?e.timeZone:void 0,r=e&&`minute`in e?`minute`:`day`;if(e&&t&&!(t in e))throw Error(`Invalid granularity `+t+` for value `+e.toString());let[i,a]=(0,v.useState)([r,n]);e&&(i[0]!==r||i[1]!==n)&&a([r,n]),t||=e?r:i[0];let o=e?n:i[1];return[t,o]}var $j=new q_({ach:{year:`mwaka`,month:`dwe`,day:`nino`},af:{year:`jjjj`,month:`mm`,day:`dd`},am:{year:`ዓዓዓዓ`,month:`ሚሜ`,day:`ቀቀ`},an:{year:`aaaa`,month:`mm`,day:`dd`},ar:{year:`سنة`,month:`شهر`,day:`يوم`},ast:{year:`aaaa`,month:`mm`,day:`dd`},az:{year:`iiii`,month:`aa`,day:`gg`},be:{year:`гггг`,month:`мм`,day:`дд`},bg:{year:`гггг`,month:`мм`,day:`дд`},bn:{year:`yyyy`,month:`মিমি`,day:`dd`},br:{year:`bbbb`,month:`mm`,day:`dd`},bs:{year:`gggg`,month:`mm`,day:`dd`},ca:{year:`aaaa`,month:`mm`,day:`dd`},cak:{year:`jjjj`,month:`ii`,day:`q'q'`},ckb:{year:`ساڵ`,month:`مانگ`,day:`ڕۆژ`},cs:{year:`rrrr`,month:`mm`,day:`dd`},cy:{year:`bbbb`,month:`mm`,day:`dd`},da:{year:`åååå`,month:`mm`,day:`dd`},de:{year:`jjjj`,month:`mm`,day:`tt`},dsb:{year:`llll`,month:`mm`,day:`źź`},el:{year:`εεεε`,month:`μμ`,day:`ηη`},en:{year:`yyyy`,month:`mm`,day:`dd`},eo:{year:`jjjj`,month:`mm`,day:`tt`},es:{year:`aaaa`,month:`mm`,day:`dd`},et:{year:`aaaa`,month:`kk`,day:`pp`},eu:{year:`uuuu`,month:`hh`,day:`ee`},fa:{year:`سال`,month:`ماه`,day:`روز`},ff:{year:`hhhh`,month:`ll`,day:`ññ`},fi:{year:`vvvv`,month:`kk`,day:`pp`},fr:{year:`aaaa`,month:`mm`,day:`jj`},fy:{year:`jjjj`,month:`mm`,day:`dd`},ga:{year:`bbbb`,month:`mm`,day:`ll`},gd:{year:`bbbb`,month:`mm`,day:`ll`},gl:{year:`aaaa`,month:`mm`,day:`dd`},he:{year:`שנה`,month:`חודש`,day:`יום`},hr:{year:`gggg`,month:`mm`,day:`dd`},hsb:{year:`llll`,month:`mm`,day:`dd`},hu:{year:`éééé`,month:`hh`,day:`nn`},ia:{year:`aaaa`,month:`mm`,day:`dd`},id:{year:`tttt`,month:`bb`,day:`hh`},is:{year:`áááá`,month:`mm`,day:`dd`},it:{year:`aaaa`,month:`mm`,day:`gg`},ja:{year:`年`,month:`月`,day:`日`},ka:{year:`წწწწ`,month:`თთ`,day:`რრ`},kk:{year:`жжжж`,month:`аа`,day:`кк`},kn:{year:`ವವವವ`,month:`ಮಿಮೀ`,day:`ದಿದಿ`},ko:{year:`연도`,month:`월`,day:`일`},lb:{year:`jjjj`,month:`mm`,day:`dd`},lo:{year:`ປປປປ`,month:`ດດ`,day:`ວວ`},lt:{year:`mmmm`,month:`mm`,day:`dd`},lv:{year:`gggg`,month:`mm`,day:`dd`},meh:{year:`aaaa`,month:`mm`,day:`dd`},ml:{year:`വർഷം`,month:`മാസം`,day:`തീയതി`},ms:{year:`tttt`,month:`mm`,day:`hh`},nb:{year:`åååå`,month:`mm`,day:`dd`},nl:{year:`jjjj`,month:`mm`,day:`dd`},nn:{year:`åååå`,month:`mm`,day:`dd`},no:{year:`åååå`,month:`mm`,day:`dd`},oc:{year:`aaaa`,month:`mm`,day:`jj`},pl:{year:`rrrr`,month:`mm`,day:`dd`},pt:{year:`aaaa`,month:`mm`,day:`dd`},rm:{year:`oooo`,month:`mm`,day:`dd`},ro:{year:`aaaa`,month:`ll`,day:`zz`},ru:{year:`гггг`,month:`мм`,day:`дд`},sc:{year:`aaaa`,month:`mm`,day:`dd`},scn:{year:`aaaa`,month:`mm`,day:`jj`},sk:{year:`rrrr`,month:`mm`,day:`dd`},sl:{year:`llll`,month:`mm`,day:`dd`},sr:{year:`гггг`,month:`мм`,day:`дд`},"sr-Latn":{year:`gggg`,month:`mm`,day:`dd`},sv:{year:`åååå`,month:`mm`,day:`dd`},szl:{year:`rrrr`,month:`mm`,day:`dd`},tg:{year:`сссс`,month:`мм`,day:`рр`},th:{year:`ปปปป`,month:`ดด`,day:`วว`},tr:{year:`yyyy`,month:`aa`,day:`gg`},uk:{year:`рррр`,month:`мм`,day:`дд`},"zh-CN":{year:`年`,month:`月`,day:`日`},"zh-TW":{year:`年`,month:`月`,day:`日`}},`en`);function eM(e,t,n){return e===`era`||e===`dayPeriod`?t:e===`year`||e===`month`||e===`day`?$j.getStringForLocale(e,n):`––`}var tM=class e{constructor(e,t,n){if(this.era=n?.era??null,this.calendar=e,this.year=n?.year??null,this.month=n?.month??null,this.day=n?.day??null,this.hour=n?.hour??null,this.hourCycle=t,this.dayPeriod=null,this.minute=n?.minute??null,this.second=n?.second??null,this.millisecond=n?.millisecond??null,this.offset=`offset`in(n??{})?n.offset:null,this.hour!=null){let[e,n]=rM(this.hour,t);this.dayPeriod=e,this.hour=n}}copy(){let t=new e(this.calendar,this.hourCycle);return t.era=this.era,t.year=this.year,t.month=this.month,t.day=this.day,t.hour=this.hour,t.dayPeriod=this.dayPeriod,t.minute=this.minute,t.second=this.second,t.millisecond=this.millisecond,t.offset=this.offset,t}isComplete(e){return e.every(e=>this[e]!=null)}validate(e,t){return t.every(t=>{if((t===`hour`||t===`dayPeriod`)&&`hour`in e){let[t,n]=rM(e.hour,this.hourCycle);return this.dayPeriod===t&&this.hour===n}return this[t]===e[t]})}isCleared(e){return e.every(e=>this[e]===null)}set(e,t,n){let r=this.copy();return r[e]=t,e===`hour`&&r.dayPeriod==null&&`hour`in n&&(r.dayPeriod=rM(n.hour,this.hourCycle)[0]),e===`year`&&r.era==null&&(r.era=n.era),e!==`second`&&e!==`literal`&&e!==`timeZoneName`&&(r.offset=null),r}clear(e){let t=this.copy();return t[e]=null,e===`year`&&(t.era=null),t.offset=null,t}cycle(e,t,n,r){let i=this.copy();if(i[e]==null&&e!==`dayPeriod`&&e!==`era`){if(e===`hour`&&`hour`in n){let[e,t]=rM(n.hour,this.hourCycle);i.dayPeriod=e,i.hour=t}else i[e]=n[e];return e===`year`&&i.era==null&&(i.era=n.era),i}switch(e){case`era`:{let e=this.calendar.getEras(),n=e.indexOf(i.era);n=nM(n,t,0,e.length-1),i.era=e[n];break}case`year`:{let r=new zO(this.calendar,this.era??n.era,this.year??n.year,this.month??1,this.day??1);r=r.cycle(e,t,{round:e===`year`}),i.era=r.era,i.year=r.year;break}case`month`:i.month=nM(i.month??1,t,1,this.calendar.getMaximumMonthsInYear());break;case`day`:i.day=nM(i.day??1,t,1,this.calendar.getMaximumDaysInMonth());break;case`hour`:{let e=r.some(e=>[`year`,`month`,`day`].includes(e));if(`timeZone`in n&&(!e||i.year!=null&&i.month!=null&&i.day!=null)){let e=this.toValue(n);e=e.cycle(`hour`,t,{hourCycle:this.hourCycle===`h12`?12:24,round:!1});let[r,a]=rM(e.hour,this.hourCycle);i.hour=a,i.dayPeriod=r,i.offset=e.offset}else{let e=i.hour??0,r=this.getSegmentLimits(`hour`);i.hour=nM(e,t,r.minValue,r.maxValue),i.dayPeriod==null&&`hour`in n&&(i.dayPeriod=rM(n.hour,this.hourCycle)[0])}break}case`dayPeriod`:i.dayPeriod=nM(i.dayPeriod??0,t,0,1);break;case`minute`:i.minute=nM(i.minute??0,t,0,59,!0);break;case`second`:i.second=nM(i.second??0,t,0,59,!0)}return i}toValue(e){if(`hour`in e){let t=this.hour;t==null?(this.hourCycle===`h12`||this.hourCycle===`h11`)&&(t=this.dayPeriod===1?12:0):t=iM(t,this.dayPeriod??0,this.hourCycle);let n=e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day,hour:t??e.hour,minute:this.minute??e.minute,second:this.second??e.second,millisecond:this.millisecond??e.millisecond});return`offset`in n&&this.offset!=null&&n.offset!==this.offset&&(n=n.add({milliseconds:n.offset-this.offset})),n}return e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day})}getSegmentLimits(e){switch(e){case`era`:{let e=this.calendar.getEras();return{value:this.era==null?e.length-1:e.indexOf(this.era),minValue:0,maxValue:e.length-1}}case`year`:return{value:this.year,minValue:1,maxValue:9999};case`month`:return{value:this.month,minValue:1,maxValue:this.calendar.getMaximumMonthsInYear()};case`day`:return{value:this.day,minValue:1,maxValue:this.calendar.getMaximumDaysInMonth()};case`dayPeriod`:return{value:this.dayPeriod,minValue:0,maxValue:1};case`hour`:{let e=0,t=23;return this.hourCycle===`h12`?(e=1,t=12):this.hourCycle===`h11`&&(e=0,t=11),{value:this.hour,minValue:e,maxValue:t}}case`minute`:return{value:this.minute,minValue:0,maxValue:59};case`second`:return{value:this.second,minValue:0,maxValue:59}}}};function nM(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e0?Math.ceil(e/i)*i:Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,er&&(e=n+(e-r-1));return e}function rM(e,t){let n=+(e>=12);switch(t){case`h11`:e>=12&&(e-=12);break;case`h12`:e===0?e=12:e>12&&(e-=12);break;case`h23`:n=null;break;case`h24`:e+=1,n=null}return[n,e]}function iM(e,t,n){switch(n){case`h11`:t===1&&(e+=12);break;case`h12`:e===12&&(e=0),t===1&&(e+=12);break;case`h24`:--e}return e}var aM={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},oM={year:5,month:2,day:7,hour:2,minute:15,second:15},sM={dayperiod:`dayPeriod`,relatedYear:`year`,yearName:`literal`,unknown:`literal`};function cM(e){let{locale:t,createCalendar:n,hideTimeZone:r,isDisabled:i=!1,isReadOnly:a=!1,isRequired:o=!1,minValue:s,maxValue:c,isDateUnavailable:l}=e,u=e.value||e.defaultValue||e.placeholderValue||null,[d,f]=Qj(u,e.granularity),p=f||`UTC`;if(u&&!(d in u))throw Error(`Invalid granularity `+d+` for value `+u.toString());let[m,h]=(0,v.useMemo)(()=>{let r=new Qk(t,{dateStyle:`short`,timeStyle:`short`,hour12:e.hourCycle==null?void 0:e.hourCycle===12}).resolvedOptions();return[n(r.calendar),r.hourCycle]},[t,e.hourCycle,n]),[g,_]=sh(e.value,e.defaultValue??null,e.onChange),[y]=(0,v.useState)(g),b=(0,v.useMemo)(()=>Xj(g,m)??null,[g,m]),[x,S]=(0,v.useState)(()=>new tM(m,h,b)),C=m.identifier===`gregory`&&x.era===`BC`,w=(0,v.useMemo)(()=>({granularity:d,maxGranularity:e.maxGranularity??`year`,timeZone:f,hideTimeZone:r,hourCycle:e.hourCycle,showEra:C,shouldForceLeadingZeros:e.shouldForceLeadingZeros}),[e.maxGranularity,d,e.hourCycle,e.shouldForceLeadingZeros,f,r,C]),T=(0,v.useMemo)(()=>Jj({},w),[w]),E=(0,v.useMemo)(()=>new Qk(t,T),[t,T]),D=(0,v.useMemo)(()=>E.resolvedOptions(),[E]),O=(0,v.useMemo)(()=>Zj(e.placeholderValue,d,m,f),[e.placeholderValue,d,m,f]),k=(0,v.useMemo)(()=>{let t=h===`h11`||h===`h12`,n=[`era`,`year`,`month`,`day`,`hour`,...t?[`dayPeriod`]:[],`minute`,`second`],r=n.indexOf(e.maxGranularity||`era`),i=n.indexOf(d===`hour`&&t?`dayPeriod`:d);return n.slice(r,i+1)},[e.maxGranularity,d,h]),[A,j]=(0,v.useState)(b),[M,N]=(0,v.useState)(m),[P,ee]=(0,v.useState)(h);(b!==A||h!==P||!dD(m,M))&&(x=new tM(m,h,b),j(b),N(m),ee(h),S(x));let F=t=>{if(!(e.isDisabled||e.isReadOnly)){if(t==null||t instanceof tM&&t.isCleared(k))S(new tM(m,h,b)),_(null);else if(!(t instanceof tM))t=XD(t,u?.calendar||new aD),S(new tM(m,h,b)),_(t);else{if(t.isComplete(k)){let e=t.toValue(b??O);if(t.validate(e,k)){let t=XD(e,u?.calendar||new aD);if(!g||t.compare(g)!==0){S(new tM(m,h,b)),_(t);return}}}S(t)}}},I=(0,v.useMemo)(()=>x.toValue(b??O).toDate(p),[x,p,b,O]),L=(0,v.useMemo)(()=>lM(I,x,E,D,m,t,d),[I,E,D,x,m,t,d]),te=(e,t)=>{F(x.cycle(e,t,O,k))},R=(0,v.useMemo)(()=>Wj(g,s,c,l,w),[g,s,c,l,w]),z=PS({...e,value:g,builtinValidation:R}),B=z.displayValidation.isInvalid,ne=e.validationState||(B?`invalid`:null);return{...z,value:b,defaultValue:e.defaultValue??y,dateValue:I,calendar:m,setValue:F,segments:L,dateFormatter:E,validationState:ne,isInvalid:B,granularity:d,maxGranularity:e.maxGranularity??`year`,isDisabled:i,isReadOnly:a,isRequired:o,increment(e){te(e,1)},decrement(e){te(e,-1)},incrementPage(e){te(e,oM[e]||1)},decrementPage(e){te(e,-(oM[e]||1))},incrementToMax(e){let t=e===`hour`&&h===`h12`?11:x.getSegmentLimits(e).maxValue;F(x.set(e,t,O))},decrementToMin(e){let t=e===`hour`&&h===`h12`?12:x.getSegmentLimits(e).minValue;F(x.set(e,t,O))},setSegment(e,t){F(x.set(e,t,O))},confirmPlaceholder(){if(!(e.isDisabled||e.isReadOnly)&&x.isComplete(k)){let e=XD(x.toValue(b??O),u?.calendar||new aD);(!g||e.compare(g)!==0)&&_(e),S(new tM(m,h,b))}},clearSegment(e){let t=x;e!==`timeZoneName`&&e!==`literal`&&(t=x.clear(e)),F(t)},formatValue(e){if(!b)return``;let n=Jj(e,w);return new Qk(t,n).format(I)},getDateFormatter(e,t){return new Qk(e,Jj({},{...w,...t}))}}}function lM(e,t,n,r,i,a,o){let s=[`hour`,`minute`,`second`],c=n.formatToParts(e),l=new cp(a,{useGrouping:!1}),u=new cp(a,{useGrouping:!1,minimumIntegerDigits:2});for(let e of c)if(e.type===`year`||e.type===`month`||e.type===`day`||e.type===`hour`){let n=t[e.type]??0;e.value=r[e.type]===`2-digit`?u.format(n):l.format(n)}let d=[];for(let e of c){let n=sM[e.type]||e.type,r=aM[n];n===`era`&&i.getEras().length===1&&(r=!1);let c=aM[n]&&t[e.type]==null,l=aM[n]?eM(n,e.value,a):null,u={type:n,text:c?l:e.value,...t.getSegmentLimits(n),isPlaceholder:c,placeholder:l,isEditable:r};n===`hour`?(d.push({type:`literal`,text:`⁦`,isPlaceholder:!1,placeholder:``,isEditable:!1}),d.push(u),n===o&&d.push({type:`literal`,text:`⁩`,isPlaceholder:!1,placeholder:``,isEditable:!1})):s.includes(n)&&n===o?(d.push(u),d.push({type:`literal`,text:`⁩`,isPlaceholder:!1,placeholder:``,isEditable:!1})):d.push(u)}return d}function uM(e){let{placeholderValue:t=new BO,minValue:n,maxValue:r,defaultValue:i,granularity:a,validate:o}=e,[s,c]=sh(e.value,i??null,e.onChange),l=s||t,u=l&&`day`in l?l:void 0,d=i&&`timeZone`in i?i.timeZone:void 0,f=(0,v.useMemo)(()=>{let e=l&&`timeZone`in l?l.timeZone:void 0;return(e||d)&&t?ZD(dM(t),e||d):dM(t)},[t,l,d]),p=(0,v.useMemo)(()=>dM(n,u),[n,u]),m=(0,v.useMemo)(()=>dM(r,u),[r,u]),h=(0,v.useMemo)(()=>s&&`day`in s?YD(s):s,[s]),g=(0,v.useMemo)(()=>s==null?null:dM(s),[s]),_=(0,v.useMemo)(()=>i==null?null:dM(i),[i]),y=e=>{c(u||d?e:e&&YD(e))};return{...cM({...e,value:g,defaultValue:_,minValue:p,maxValue:m,onChange:y,granularity:a||`minute`,maxGranularity:`hour`,placeholderValue:f??void 0,createCalendar:()=>new aD,validate:(0,v.useCallback)(()=>o?.(s),[o,s])}),timeValue:h}}function dM(e,t=gD(SD())){return e?`day`in e?e:JD(t,e):null}var fM=(0,v.createContext)(null),pM=(0,v.createContext)(null),mM=(0,v.createContext)(null),hM=(0,v.createContext)(null),gM=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,fM);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,{locale:i}=rp(),a=cM({...e,locale:i,createCalendar:Xk,validationBehavior:r}),o=(0,v.useRef)(null),[s,c]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),l=(0,v.useRef)(null),{labelProps:u,fieldProps:d,inputProps:f,descriptionProps:p,errorMessageProps:m,...h}=ZA({...Lf(e),label:c,inputRef:l,validationBehavior:r},a,o),g=Mf({...Lf(e),values:{state:a,isInvalid:a.isInvalid,isDisabled:a.isDisabled,isReadOnly:a.isReadOnly,isRequired:e.isRequired||!1},defaultClassName:`react-aria-DateField`}),_=W(e,{global:!0});return delete _.id,v.createElement(jf,{values:[[mM,a],[ES,{...d,ref:o,isInvalid:a.isInvalid,isDisabled:a.isDisabled}],[dT,{...f,ref:l}],[Wf,{...u,ref:s,elementType:`span`}],[sb,{slots:{description:p,errorMessage:m}}],[OS,h]]},v.createElement(q.div,{..._,...g,ref:t,slot:e.slot||void 0,"data-invalid":a.isInvalid||void 0,"data-disabled":a.isDisabled||void 0,"data-readonly":a.isReadOnly||void 0,"data-required":e.isRequired||void 0}),v.createElement(lA,{autoComplete:e.autoComplete,name:e.name,isDisabled:e.isDisabled,state:a}))}),_M=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,pM);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,{locale:i}=rp(),a=uM({...e,locale:i,validationBehavior:r}),o=(0,v.useRef)(null),[s,c]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),l=(0,v.useRef)(null),{labelProps:u,fieldProps:d,inputProps:f,descriptionProps:p,errorMessageProps:m,...h}=QA({...Lf(e),label:c,inputRef:l,validationBehavior:r},a,o),g=Mf({...e,values:{state:a,isInvalid:a.isInvalid,isDisabled:a.isDisabled,isReadOnly:a.isReadOnly,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TimeField`}),_=W(e,{global:!0});return delete _.id,v.createElement(jf,{values:[[hM,a],[ES,{...d,ref:o,isInvalid:a.isInvalid,isDisabled:a.isDisabled}],[dT,{...f,ref:l}],[Wf,{...u,ref:s,elementType:`span`}],[sb,{slots:{description:p,errorMessage:m}}],[OS,h]]},v.createElement(q.div,{..._,...g,ref:t,slot:e.slot||void 0,"data-invalid":a.isInvalid||void 0,"data-disabled":a.isDisabled||void 0,"data-readonly":a.isReadOnly||void 0,"data-required":e.isRequired||void 0}))}),vM=(0,v.forwardRef)(function(e,t){let n=(0,v.useContext)(mM),r=(0,v.useContext)(hM);return n||r?v.createElement(bM,{...e,ref:t}):v.createElement(yM,{...e,ref:t})}),yM=(0,v.forwardRef)((e,t)=>{let[n,r]=Ff({slot:e.slot},t,fM),{locale:i}=rp(),a=cM({...n,locale:i,createCalendar:Xk}),o=(0,v.useRef)(null),{fieldProps:s,inputProps:c}=ZA({...n,inputRef:o},a,r);return v.createElement(jf,{values:[[mM,a],[dT,{...c,ref:o}],[ES,{...s,ref:r,isInvalid:a.isInvalid,isDisabled:a.isDisabled}]]},v.createElement(bM,e))}),bM=(0,v.forwardRef)((e,t)=>{let{className:n,children:r}=e,i=(0,v.useContext)(mM),a=(0,v.useContext)(hM),o=i??a;return v.createElement(v.Fragment,null,v.createElement(DS,{...e,ref:t,slot:e.slot||void 0,className:n??`react-aria-DateInput`,isReadOnly:o.isReadOnly,isInvalid:o.isInvalid,isDisabled:o.isDisabled},o.segments.map((e,t)=>(0,v.cloneElement)(r(e),{key:t}))),v.createElement(pT,{className:``}))}),xM=(0,v.forwardRef)(function({segment:e,...t},n){let r=(0,v.useContext)(mM),i=(0,v.useContext)(hM),a=r??i,o=Is(n),{segmentProps:s}=ij(e,a,o),{focusProps:c,isFocused:l,isFocusVisible:u}=Jm(),{hoverProps:d,isHovered:f}=eh({...t,isDisabled:a.isDisabled||e.type===`literal`}),p=Mf({...t,values:{...e,isReadOnly:a.isReadOnly,isInvalid:a.isInvalid,isDisabled:a.isDisabled,isHovered:f,isFocused:l,isFocusVisible:u},defaultChildren:e.text,defaultClassName:`react-aria-DateSegment`});return v.createElement(q.span,{...U(W(t,{global:!0}),s,c,d),...p,style:s.style,ref:o,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":a.isInvalid||void 0,"data-readonly":a.isReadOnly||void 0,"data-disabled":a.isDisabled||void 0,"data-type":e.type,"data-hovered":f||void 0,"data-focused":l||void 0,"data-focus-visible":u||void 0})}),SM=(0,v.createContext)({}),CM=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=v.useMemo(()=>Zd({fullWidth:n,variant:r}),[n,r]);return(0,G.jsx)(SM,{value:{slots:a},children:(0,G.jsx)(DS,{className:J(t,a?.base()),"data-slot":`date-input-group`,...i,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})},wM=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SM);return(0,G.jsx)(K.div,{className:Y(r?.prefix,t),"data-slot":`date-input-group-prefix`,...n,children:e})},TM=({className:e,...t})=>{let{slots:n}=(0,v.use)(SM);return(0,G.jsx)(vM,{className:J(e,n?.input()),"data-slot":`date-input-group-input`,...t})},EM=({className:e,segment:t,...n})=>{let{slots:r}=(0,v.use)(SM);return(0,G.jsx)(xM,{className:Y(r?.segment,e),"data-slot":`date-input-group-segment`,segment:t,...n})},DM=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SM);return(0,G.jsx)(K.div,{className:Y(r?.inputContainer,t),"data-slot":`date-input-group-input-container`,...n,children:e})},OM=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SM);return(0,G.jsx)(K.div,{className:Y(r?.suffix,t),"data-slot":`date-input-group-suffix`,...n,children:e})};function kM({children:e,className:t,fullWidth:n,...r}){let i=v.useMemo(()=>Yd({fullWidth:n}),[n]);return(0,G.jsx)(gM,{"data-required":yh(r.isRequired),"data-slot":`date-field`,...r,className:J(t,i),children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})}var AM=Object.assign(kM,{Root:kM,Group:CM,Input:TM,InputContainer:DM,Segment:EM,Prefix:wM,Suffix:OM}),jM={};jM={dateRange:e=>`${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,dateSelected:e=>`${e.date} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`,finishRangeSelectionPrompt:`انقر لإنهاء عملية تحديد نطاق التاريخ`,maximumDate:`آخر تاريخ متاح`,minimumDate:`أول تاريخ متاح`,next:`التالي`,previous:`السابق`,selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.dateRange}`,startRangeSelectionPrompt:`انقر لبدء عملية تحديد نطاق التاريخ`,todayDate:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date}`,todayDateSelected:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date} \u{645}\u{62D}\u{62F}\u{62F}`};var MM={};MM={dateRange:e=>`${e.startDate} \u{434}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{435} ${e.date}`,finishRangeSelectionPrompt:`Натиснете, за да довършите избора на времеви интервал`,maximumDate:`Последна налична дата`,minimumDate:`Първа налична дата`,next:`Напред`,previous:`Назад`,selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:`Натиснете, за да пристъпите към избора на времеви интервал`,todayDate:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date}`,todayDateSelected:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date} \u{441}\u{430} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{438}`};var NM={};NM={dateRange:e=>`${e.startDate} a\u{17E} ${e.endDate}`,dateSelected:e=>`Vybr\xe1no ${e.date}`,finishRangeSelectionPrompt:`Kliknutím dokončíte výběr rozsahu dat`,maximumDate:`Poslední dostupné datum`,minimumDate:`První dostupné datum`,next:`Další`,previous:`Předchozí`,selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknutím zahájíte výběr rozsahu dat`,todayDate:e=>`Dnes, ${e.date}`,todayDateSelected:e=>`Dnes, vybr\xe1no ${e.date}`};var PM={};PM={dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:`Klik for at fuldføre valg af datoområde`,maximumDate:`Sidste ledige dato`,minimumDate:`Første ledige dato`,next:`Næste`,previous:`Forrige`,selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.dateRange}`,startRangeSelectionPrompt:`Klik for at starte valg af datoområde`,todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`};var FM={};FM={dateRange:e=>`${e.startDate} bis ${e.endDate}`,dateSelected:e=>`${e.date} ausgew\xe4hlt`,finishRangeSelectionPrompt:`Klicken, um die Auswahl des Datumsbereichs zu beenden`,maximumDate:`Letztes verfügbares Datum`,minimumDate:`Erstes verfügbares Datum`,next:`Weiter`,previous:`Zurück`,selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.dateRange}`,startRangeSelectionPrompt:`Klicken, um die Auswahl des Datumsbereichs zu beginnen`,todayDate:e=>`Heute, ${e.date}`,todayDateSelected:e=>`Heute, ${e.date} ausgew\xe4hlt`};var IM={};IM={dateRange:e=>`${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,dateSelected:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} ${e.date}`,finishRangeSelectionPrompt:`Κάντε κλικ για να ολοκληρώσετε την επιλογή εύρους ημερομηνιών`,maximumDate:`Τελευταία διαθέσιμη ημερομηνία`,minimumDate:`Πρώτη διαθέσιμη ημερομηνία`,next:`Επόμενο`,previous:`Προηγούμενο`,selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.dateRange}`,startRangeSelectionPrompt:`Κάντε κλικ για να ξεκινήσετε την επιλογή εύρους ημερομηνιών`,todayDate:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, ${e.date}`,todayDateSelected:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, \u{3B5}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3C4}\u{3B7}\u{3BA}\u{3B5} ${e.date}`};var LM={};LM={previous:`Previous`,next:`Next`,selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.dateRange}`,todayDate:e=>`Today, ${e.date}`,todayDateSelected:e=>`Today, ${e.date} selected`,dateSelected:e=>`${e.date} selected`,startRangeSelectionPrompt:`Click to start selecting date range`,finishRangeSelectionPrompt:`Click to finish selecting date range`,minimumDate:`First available date`,maximumDate:`Last available date`,dateRange:e=>`${e.startDate} to ${e.endDate}`};var RM={};RM={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} seleccionado`,finishRangeSelectionPrompt:`Haga clic para terminar de seleccionar rango de fechas`,maximumDate:`Última fecha disponible`,minimumDate:`Primera fecha disponible`,next:`Siguiente`,previous:`Anterior`,selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo seleccionado: ${e.dateRange}`,startRangeSelectionPrompt:`Haga clic para comenzar a seleccionar un rango de fechas`,todayDate:e=>`Hoy, ${e.date}`,todayDateSelected:e=>`Hoy, ${e.date} seleccionado`};var zM={};zM={dateRange:e=>`${e.startDate} kuni ${e.endDate}`,dateSelected:e=>`${e.date} valitud`,finishRangeSelectionPrompt:`Klõpsake kuupäevavahemiku valimise lõpetamiseks`,maximumDate:`Viimane saadaolev kuupäev`,minimumDate:`Esimene saadaolev kuupäev`,next:`Järgmine`,previous:`Eelmine`,selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.dateRange}`,startRangeSelectionPrompt:`Klõpsake kuupäevavahemiku valimiseks`,todayDate:e=>`T\xe4na, ${e.date}`,todayDateSelected:e=>`T\xe4na, ${e.date} valitud`};var BM={};BM={dateRange:e=>`${e.startDate} \u{2013} ${e.endDate}`,dateSelected:e=>`${e.date} valittu`,finishRangeSelectionPrompt:`Lopeta päivämääräalueen valinta napsauttamalla tätä.`,maximumDate:`Viimeinen varattavissa oleva päivämäärä`,minimumDate:`Ensimmäinen varattavissa oleva päivämäärä`,next:`Seuraava`,previous:`Edellinen`,selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.dateRange}`,startRangeSelectionPrompt:`Aloita päivämääräalueen valinta napsauttamalla tätä.`,todayDate:e=>`T\xe4n\xe4\xe4n, ${e.date}`,todayDateSelected:e=>`T\xe4n\xe4\xe4n, ${e.date} valittu`};var VM={};VM={dateRange:e=>`${e.startDate} \xe0 ${e.endDate}`,dateSelected:e=>`${e.date} s\xe9lectionn\xe9`,finishRangeSelectionPrompt:`Cliquer pour finir de sélectionner la plage de dates`,maximumDate:`Dernière date disponible`,minimumDate:`Première date disponible`,next:`Suivant`,previous:`Précédent`,selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.dateRange}`,startRangeSelectionPrompt:`Cliquer pour commencer à sélectionner la plage de dates`,todayDate:e=>`Aujourd'hui, ${e.date}`,todayDateSelected:e=>`Aujourd\u{2019}hui, ${e.date} s\xe9lectionn\xe9`};var HM={};HM={dateRange:e=>`${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,dateSelected:e=>`${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`,finishRangeSelectionPrompt:`חץ כדי לסיים את בחירת טווח התאריכים`,maximumDate:`תאריך פנוי אחרון`,minimumDate:`תאריך פנוי ראשון`,next:`הבא`,previous:`הקודם`,selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.dateRange}`,startRangeSelectionPrompt:`לחץ כדי להתחיל בבחירת טווח התאריכים`,todayDate:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date}`,todayDateSelected:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`};var UM={};UM={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} odabran`,finishRangeSelectionPrompt:`Kliknite da dovršite raspon odabranih datuma`,maximumDate:`Posljednji raspoloživi datum`,minimumDate:`Prvi raspoloživi datum`,next:`Sljedeći`,previous:`Prethodni`,selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknite da započnete raspon odabranih datuma`,todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, odabran ${e.date}`};var WM={};WM={dateRange:e=>`${e.startDate}\u{2013}${e.endDate}`,dateSelected:e=>`${e.date} kiv\xe1lasztva`,finishRangeSelectionPrompt:`Kattintson a dátumtartomány kijelölésének befejezéséhez`,maximumDate:`Utolsó elérhető dátum`,minimumDate:`Az első elérhető dátum`,next:`Következő`,previous:`Előző`,selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.dateRange}`,startRangeSelectionPrompt:`Kattintson a dátumtartomány kijelölésének indításához`,todayDate:e=>`Ma, ${e.date}`,todayDateSelected:e=>`Ma, ${e.date} kijel\xf6lve`};var GM={};GM={dateRange:e=>`Da ${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selezionata`,finishRangeSelectionPrompt:`Fai clic per completare la selezione dell’intervallo di date`,maximumDate:`Ultima data disponibile`,minimumDate:`Prima data disponibile`,next:`Successivo`,previous:`Precedente`,selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: ${e.dateRange}`,startRangeSelectionPrompt:`Fai clic per selezionare l’intervallo di date`,todayDate:e=>`Oggi, ${e.date}`,todayDateSelected:e=>`Oggi, ${e.date} selezionata`};var KM={};KM={dateRange:e=>`${e.startDate} \u{304B}\u{3089} ${e.endDate}`,dateSelected:e=>`${e.date} \u{3092}\u{9078}\u{629E}`,finishRangeSelectionPrompt:`クリックして日付範囲の選択を終了`,maximumDate:`最終利用可能日`,minimumDate:`最初の利用可能日`,next:`次へ`,previous:`前へ`,selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.dateRange}`,startRangeSelectionPrompt:`クリックして日付範囲の選択を開始`,todayDate:e=>`\u{672C}\u{65E5}\u{3001}${e.date}`,todayDateSelected:e=>`\u{672C}\u{65E5}\u{3001}${e.date} \u{3092}\u{9078}\u{629E}`};var qM={};qM={dateRange:e=>`${e.startDate} ~ ${e.endDate}`,dateSelected:e=>`${e.date} \u{C120}\u{D0DD}\u{B428}`,finishRangeSelectionPrompt:`날짜 범위 선택을 완료하려면 클릭하십시오.`,maximumDate:`마지막으로 사용 가능한 일자`,minimumDate:`처음으로 사용 가능한 일자`,next:`다음`,previous:`이전`,selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.dateRange}`,startRangeSelectionPrompt:`날짜 범위 선택을 시작하려면 클릭하십시오.`,todayDate:e=>`\u{C624}\u{B298}, ${e.date}`,todayDateSelected:e=>`\u{C624}\u{B298}, ${e.date} \u{C120}\u{D0DD}\u{B428}`};var JM={};JM={dateRange:e=>`Nuo ${e.startDate} iki ${e.endDate}`,dateSelected:e=>`Pasirinkta ${e.date}`,finishRangeSelectionPrompt:`Spustelėkite, kad baigtumėte pasirinkti datų intervalą`,maximumDate:`Paskutinė galima data`,minimumDate:`Pirmoji galima data`,next:`Paskesnis`,previous:`Ankstesnis`,selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: ${e.dateRange}`,startRangeSelectionPrompt:`Spustelėkite, kad pradėtumėte pasirinkti datų intervalą`,todayDate:e=>`\u{160}iandien, ${e.date}`,todayDateSelected:e=>`\u{160}iandien, pasirinkta ${e.date}`};var YM={};YM={dateRange:e=>`No ${e.startDate} l\u{12B}dz ${e.endDate}`,dateSelected:e=>`Atlas\u{12B}ts: ${e.date}`,finishRangeSelectionPrompt:`Noklikšķiniet, lai pabeigtu datumu diapazona atlasi`,maximumDate:`Pēdējais pieejamais datums`,minimumDate:`Pirmais pieejamais datums`,next:`Tālāk`,previous:`Atpakaļ`,selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: ${e.dateRange}`,startRangeSelectionPrompt:`Noklikšķiniet, lai sāktu datumu diapazona atlasi`,todayDate:e=>`\u{160}odien, ${e.date}`,todayDateSelected:e=>`Atlas\u{12B}ta \u{161}odiena, ${e.date}`};var XM={};XM={dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:`Klikk for å fullføre valg av datoområde`,maximumDate:`Siste tilgjengelige dato`,minimumDate:`Første tilgjengelige dato`,next:`Neste`,previous:`Forrige`,selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.dateRange}`,startRangeSelectionPrompt:`Klikk for å starte valg av datoområde`,todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`};var ZM={};ZM={dateRange:e=>`${e.startDate} tot ${e.endDate}`,dateSelected:e=>`${e.date} geselecteerd`,finishRangeSelectionPrompt:`Klik om de selectie van het datumbereik te voltooien`,maximumDate:`Laatste beschikbare datum`,minimumDate:`Eerste beschikbare datum`,next:`Volgende`,previous:`Vorige`,selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.dateRange}`,startRangeSelectionPrompt:`Klik om het datumbereik te selecteren`,todayDate:e=>`Vandaag, ${e.date}`,todayDateSelected:e=>`Vandaag, ${e.date} geselecteerd`};var QM={};QM={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`Wybrano ${e.date}`,finishRangeSelectionPrompt:`Kliknij, aby zakończyć wybór zakresu dat`,maximumDate:`Ostatnia dostępna data`,minimumDate:`Pierwsza dostępna data`,next:`Dalej`,previous:`Wstecz`,selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknij, aby rozpocząć wybór zakresu dat`,todayDate:e=>`Dzisiaj, ${e.date}`,todayDateSelected:e=>`Dzisiaj wybrano ${e.date}`};var $M={};$M={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:`Clique para concluir a seleção do intervalo de datas`,maximumDate:`Última data disponível`,minimumDate:`Primeira data disponível`,next:`Próximo`,previous:`Anterior`,selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:`Clique para iniciar a seleção do intervalo de datas`,todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`};var eN={};eN={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:`Clique para terminar de selecionar o intervalo de datas`,maximumDate:`Última data disponível`,minimumDate:`Primeira data disponível`,next:`Próximo`,previous:`Anterior`,selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:`Clique para começar a selecionar o intervalo de datas`,todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`};var tN={};tN={dateRange:e=>`De la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,dateSelected:e=>`${e.date} selectat\u{103}`,finishRangeSelectionPrompt:`Apăsaţi pentru a finaliza selecţia razei pentru dată`,maximumDate:`Ultima dată disponibilă`,minimumDate:`Prima dată disponibilă`,next:`Următorul`,previous:`Înainte`,selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: ${e.dateRange}`,startRangeSelectionPrompt:`Apăsaţi pentru a începe selecţia razei pentru dată`,todayDate:e=>`Ast\u{103}zi, ${e.date}`,todayDateSelected:e=>`Azi, ${e.date} selectat\u{103}`};var nN={};nN={dateRange:e=>`\u{421} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:`Щелкните, чтобы завершить выбор диапазона дат`,maximumDate:`Последняя доступная дата`,minimumDate:`Первая доступная дата`,next:`Далее`,previous:`Назад`,selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:`Щелкните, чтобы начать выбор диапазона дат`,todayDate:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`};var rN={};rN={dateRange:e=>`Od ${e.startDate} do ${e.endDate}`,dateSelected:e=>`Vybrat\xfd d\xe1tum ${e.date}`,finishRangeSelectionPrompt:`Kliknutím dokončíte výber rozsahu dátumov`,maximumDate:`Posledný dostupný dátum`,minimumDate:`Prvý dostupný dátum`,next:`Nasledujúce`,previous:`Predchádzajúce`,selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknutím spustíte výber rozsahu dátumov`,todayDate:e=>`Dnes ${e.date}`,todayDateSelected:e=>`Vybrat\xfd dne\u{161}n\xfd d\xe1tum ${e.date}`};var iN={};iN={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izbrano`,finishRangeSelectionPrompt:`Kliknite za dokončanje izbire datumskega obsega`,maximumDate:`Zadnji razpoložljivi datum`,minimumDate:`Prvi razpoložljivi datum`,next:`Naprej`,previous:`Nazaj`,selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknite za začetek izbire datumskega obsega`,todayDate:e=>`Danes, ${e.date}`,todayDateSelected:e=>`Danes, ${e.date} izbrano`};var aN={};aN={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izabran`,finishRangeSelectionPrompt:`Kliknite da dovršite opseg izabranih datuma`,maximumDate:`Zadnji raspoloživi datum`,minimumDate:`Prvi raspoloživi datum`,next:`Sledeći`,previous:`Prethodni`,selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani period: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknite da započnete opseg izabranih datuma`,todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, izabran ${e.date}`};var oN={};oN={dateRange:e=>`${e.startDate} till ${e.endDate}`,dateSelected:e=>`${e.date} har valts`,finishRangeSelectionPrompt:`Klicka för att avsluta val av datumintervall`,maximumDate:`Sista tillgängliga datum`,minimumDate:`Första tillgängliga datum`,next:`Nästa`,previous:`Föregående`,selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.dateRange}`,startRangeSelectionPrompt:`Klicka för att välja datumintervall`,todayDate:e=>`Idag, ${e.date}`,todayDateSelected:e=>`Idag, ${e.date} har valts`};var sN={};sN={dateRange:e=>`${e.startDate} - ${e.endDate}`,dateSelected:e=>`${e.date} se\xe7ildi`,finishRangeSelectionPrompt:`Tarih aralığı seçimini tamamlamak için tıklayın`,maximumDate:`Son müsait tarih`,minimumDate:`İlk müsait tarih`,next:`Sonraki`,previous:`Önceki`,selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.dateRange}`,startRangeSelectionPrompt:`Tarih aralığı seçimini başlatmak için tıklayın`,todayDate:e=>`Bug\xfcn, ${e.date}`,todayDateSelected:e=>`Bug\xfcn, ${e.date} se\xe7ildi`};var cN={};cN={dateRange:e=>`${e.startDate} \u{2014} ${e.endDate}`,dateSelected:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:`Натисніть, щоб завершити вибір діапазону дат`,maximumDate:`Остання доступна дата`,minimumDate:`Перша доступна дата`,next:`Наступний`,previous:`Попередній`,selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:`Натисніть, щоб почати вибір діапазону дат`,todayDate:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`};var lN={};lN={dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9009}\u{62E9} ${e.date}`,finishRangeSelectionPrompt:`单击以完成选择日期范围`,maximumDate:`最后一个可用日期`,minimumDate:`第一个可用日期`,next:`下一页`,previous:`上一页`,selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:`单击以开始选择日期范围`,todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9009}\u{62E9}\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`};var uN={};uN={dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9078}\u{53D6} ${e.date}`,finishRangeSelectionPrompt:`按一下以完成選取日期範圍`,maximumDate:`最後一個可用日期`,minimumDate:`第一個可用日期`,next:`下一頁`,previous:`上一頁`,selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:`按一下以開始選取日期範圍`,todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9078}\u{53D6}\u{4ECA}\u{5929}\u{FF0C}${e.date}`};var dN={};dN={"ar-AE":jM,"bg-BG":MM,"cs-CZ":NM,"da-DK":PM,"de-DE":FM,"el-GR":IM,"en-US":LM,"es-ES":RM,"et-EE":zM,"fi-FI":BM,"fr-FR":VM,"he-IL":HM,"hr-HR":UM,"hu-HU":WM,"it-IT":GM,"ja-JP":KM,"ko-KR":qM,"lt-LT":JM,"lv-LV":YM,"nb-NO":XM,"nl-NL":ZM,"pl-PL":QM,"pt-BR":$M,"pt-PT":eN,"ro-RO":tN,"ru-RU":nN,"sk-SK":rN,"sl-SI":iN,"sr-SP":aN,"sv-SE":oN,"tr-TR":sN,"uk-UA":cN,"zh-CN":lN,"zh-TW":uN};function fN(e){return e&&e.__esModule?e.default:e}var pN=new WeakMap;function mN(e){return e?.calendar.identifier===`gregory`&&e.era===`BC`?`short`:void 0}function hN(e){let t=rv(fN(dN),`@react-aria/calendar`),n,r;`highlightedRange`in e?{start:n,end:r}=e.highlightedRange||{}:(n=Array.isArray(e.value)?e.value[0]:e.value??void 0,r=Array.isArray(e.value)?e.value.at(-1):e.value??void 0);let i=$A({weekday:`long`,month:`long`,year:`numeric`,day:`numeric`,era:mN(n)||mN(r),timeZone:e.timeZone}),{locale:a}=rp(),o=(0,v.useMemo)(()=>new Intl.ListFormat(a),[a]),s=`anchorDate`in e?e.anchorDate:null;return(0,v.useMemo)(()=>{if(!s&&n&&r){if(sD(n,r)){let r=i.format(n.toDate(e.timeZone));return t.format(`selectedDateDescription`,{date:r})}if(`highlightedRange`in e){let a=_N(i,t,n,r,e.timeZone);return t.format(`selectedRangeDescription`,{dateRange:a})}if(Array.isArray(e.value)){let n=e.value.map(t=>i.format(t.toDate(e.timeZone))),r=o.format(n);return t.format(`selectedDateDescription`,{date:r})}}return``},[n,r,s,e,t,i,o])}function gN(e,t,n,r){let i=rv(fN(dN),`@react-aria/calendar`),a=mN(e)||mN(t),o=$A({month:`long`,year:`numeric`,era:a,calendar:e.calendar.identifier,timeZone:n}),s=$A({month:`long`,year:`numeric`,day:`numeric`,era:a,calendar:e.calendar.identifier,timeZone:n});return(0,v.useMemo)(()=>{if(sD(e,wD(e))){let a=e,s=t;if(e.calendar.getFormattableMonth&&(a=e.calendar.getFormattableMonth(e)),t.calendar.getFormattableMonth&&(s=t.calendar.getFormattableMonth(t)),sD(t,TD(e)))return o.format(a.toDate(n));if(sD(t,TD(t)))return r?_N(o,i,a,s,n):o.formatRange(a.toDate(n),s.toDate(n))}return r?_N(s,i,e,t,n):s.formatRange(e.toDate(n),t.toDate(n))},[e,t,o,s,i,n,r])}function _N(e,t,n,r,i){let a=e.formatRangeToParts(n.toDate(i),r.toDate(i)),o=-1;for(let e=0;eo&&(c+=a[e].value);return t.format(`dateRange`,{startDate:s,endDate:c})}function vN(e){return e&&e.__esModule?e.default:e}function yN(e,t){let n=rv(vN(dN),`@react-aria/calendar`),r=W(e),i=gN(t.visibleRange.start,t.visibleRange.end,t.timeZone,!1),a=gN(t.visibleRange.start,t.visibleRange.end,t.timeZone,!0);zs(()=>{t.isFocused||Op(a)},[a]);let o=hN(t);zs(()=>{o&&Op(o,`polite`,4e3)},[o]);let s=ns([!!e.errorMessage,e.isInvalid,e.validationState]);pN.set(t,{ariaLabel:e[`aria-label`],ariaLabelledBy:e[`aria-labelledby`],errorMessageId:s,selectedDateDescription:o});let[c,l]=(0,v.useState)(!1),u=e.isDisabled||t.isNextVisibleRangeInvalid();u&&c&&(l(!1),t.setFocused(!0));let[d,f]=(0,v.useState)(!1),p=e.isDisabled||t.isPreviousVisibleRangeInvalid();return p&&d&&(f(!1),t.setFocused(!0)),{calendarProps:U(r,Fs({id:e.id,"aria-label":[e[`aria-label`],a].filter(Boolean).join(`, `),"aria-labelledby":e[`aria-labelledby`]}),{role:`application`,"aria-details":e[`aria-details`]||void 0,"aria-describedby":e[`aria-describedby`]||void 0}),nextButtonProps:{onPress:()=>t.focusNextPage(),"aria-label":n.format(`next`),isDisabled:u,onFocusChange:l},prevButtonProps:{onPress:()=>t.focusPreviousPage(),"aria-label":n.format(`previous`),isDisabled:p,onFocusChange:f},errorMessageProps:{id:s},title:i}}function bN(e,t){let{startDate:n=t.visibleRange.start,endDate:r=t.visibleRange.end,firstDayOfWeek:i}=e,{direction:a}=rp(),{keyboardProps:o}=Sm({shortcuts:{End:()=>{t.focusSectionEnd()},Home:()=>{t.focusSectionStart()},Escape:()=>(`setAnchorDate`in t&&t.setAnchorDate(null),!1)}}),{keyboardProps:s}=Sm({shortcuts:{Enter:()=>{t.selectFocusedDate()}," ":()=>{t.selectFocusedDate()},PageUp:()=>{t.focusPreviousSection()},"Shift+PageUp":()=>{t.focusPreviousSection(!0)},PageDown:()=>{t.focusNextSection()},"Shift+PageDown":()=>{t.focusNextSection(!0)},ArrowLeft:()=>{a===`rtl`?t.focusNextDay():t.focusPreviousDay()},ArrowUp:()=>{t.focusPreviousRow()},ArrowRight:()=>{a===`rtl`?t.focusPreviousDay():t.focusNextDay()},ArrowDown:()=>{t.focusNextRow()}},allowRepeats:!0}),c=gN(n,r,t.timeZone,!0),{ariaLabel:l,ariaLabelledBy:u}=pN.get(t),d=Fs({"aria-label":[l,c].filter(Boolean).join(`, `),"aria-labelledby":u}),f=$A({weekday:e.weekdayStyle||`narrow`,timeZone:t.timeZone}),{locale:p}=rp(),m=(0,v.useMemo)(()=>{let e=t.visibleDuration.days&&t.visibleDuration.days<7,r=e?n:DD(gD(t.timeZone),p,i),a=e?t.visibleDuration.days:7;return[...Array(a).keys()].map(e=>{let n=r.add({days:e}).toDate(t.timeZone);return f.format(n)})},[p,t.timeZone,f,i,n,t.visibleDuration.days]),h=t.getWeeksInMonth(n);return{gridProps:U(d,{role:`grid`,"aria-readonly":t.isReadOnly||void 0,"aria-disabled":t.isDisabled||void 0,"aria-multiselectable":`highlightedRange`in t||t.selectionMode===`multiple`||void 0,onFocus:()=>t.setFocused(!0),onBlur:()=>t.setFocused(!1)},o,s),headerProps:{"aria-hidden":!0},weekDays:m,weeksInMonth:h}}function xN(e){return e&&e.__esModule?e.default:e}function SN(e,t,n){let{date:r,isDisabled:i}=e,{errorMessageId:a,selectedDateDescription:o}=pN.get(t),s=rv(xN(dN),`@react-aria/calendar`),c=$A({weekday:`long`,day:`numeric`,month:`long`,year:`numeric`,era:mN(r),timeZone:t.timeZone}),l=t.isCellFocused(r)&&!e.isOutsideMonth;i=i||t.isCellDisabled(r)||!!e.isOutsideMonth;let u=t.isCellUnavailable(r),d=!i&&!u,f=t.isSelected(r)&&d,p=!1;t.isValueInvalid&&(`highlightedRange`in t?p=!t.anchorDate&&t.highlightedRange!=null&&r.compare(t.highlightedRange.start)>=0&&r.compare(t.highlightedRange.end)<=0:Array.isArray(t.value)?p=t.value.some(e=>sD(e,r)):t.value&&(p=sD(t.value,r))),p&&!i&&(f=!0),r=sc(r,uD);let m=(0,v.useMemo)(()=>r.toDate(t.timeZone),[r,t.timeZone]),h=fD(r,t.timeZone),g=(0,v.useMemo)(()=>{let e=``;return`highlightedRange`in t&&t.value&&!t.anchorDate&&(sD(r,t.value.start)||sD(r,t.value.end))&&(e=o+`, `),e+=c.format(m),h?e=s.format(f?`todayDateSelected`:`todayDate`,{date:e}):f&&(e=s.format(`dateSelected`,{date:e})),t.minValue&&sD(r,t.minValue)?e+=`, `+s.format(`minimumDate`):t.maxValue&&sD(r,t.maxValue)&&(e+=`, `+s.format(`maximumDate`)),e},[c,m,s,f,h,r,t,o]),_=``;`anchorDate`in t&&l&&!t.isReadOnly&&d&&(_=t.anchorDate?s.format(`finishRangeSelectionPrompt`):s.format(`startRangeSelectionPrompt`));let y=tc(_),b=(0,v.useRef)(!1),x=(0,v.useRef)(!1),S=(0,v.useRef)(void 0),{pressProps:C,isPressed:w}=Rm({shouldCancelOnPointerExit:`anchorDate`in t&&!!t.anchorDate,preventFocusOnPress:!0,isDisabled:!d||t.isReadOnly,onPressStart(e){if(t.isReadOnly){t.setFocusedDate(r),t.setFocused(!0);return}if(`highlightedRange`in t&&!t.anchorDate&&(e.pointerType===`mouse`||e.pointerType===`touch`)){if(t.highlightedRange&&!p){if(sD(r,t.highlightedRange.start)){t.setAnchorDate(t.highlightedRange.end),t.setFocusedDate(r),t.setFocused(!0),t.setDragging(!0),x.current=!0;return}if(sD(r,t.highlightedRange.end)){t.setAnchorDate(t.highlightedRange.start),t.setFocusedDate(r),t.setFocused(!0),t.setDragging(!0),x.current=!0;return}}let n=()=>{t.setDragging(!0),S.current=void 0,t.selectDate(r),t.setFocusedDate(r),t.setFocused(!0),b.current=!0};e.pointerType===`touch`?S.current=setTimeout(n,200):n()}},onPressEnd(){x.current=!1,b.current=!1,clearTimeout(S.current),S.current=void 0},onPress(){!(`anchorDate`in t)&&!t.isReadOnly&&(t.selectDate(r),t.setFocusedDate(r),t.setFocused(!0))},onPressUp(e){t.isReadOnly||(`anchorDate`in t&&S.current&&(t.selectDate(r),t.setFocusedDate(r),t.setFocused(!0)),`anchorDate`in t&&(x.current?t.setAnchorDate(r):t.anchorDate&&!b.current?(t.selectDate(r),t.setFocusedDate(r),t.setFocused(!0)):e.pointerType===`keyboard`&&!t.anchorDate?(t.selectDate(r),t.focusNearestAvailableDate(r)):e.pointerType===`virtual`&&(t.selectDate(r),t.setFocusedDate(r),t.setFocused(!0))))}}),T;i||(T=sD(r,t.focusedDate)?0:-1),(0,v.useEffect)(()=>{l&&n.current&&(So(n.current),em()!==`pointer`&&ms()===n.current&&ic(n.current,{containingElement:Gs(n.current)}))},[l,n]);let E=$A({day:`numeric`,timeZone:t.timeZone,calendar:r.calendar.identifier}),D=(0,v.useMemo)(()=>E.formatToParts(m).find(e=>e.type===`day`).value,[E,m]);return{cellProps:{role:`gridcell`,"aria-disabled":!d||void 0,"aria-selected":f||void 0,"aria-invalid":p||void 0},buttonProps:U(C,{onFocus(){i||(t.setFocusedDate(r),t.setFocused(!0))},tabIndex:T,role:`button`,"aria-disabled":!d||void 0,"aria-label":g,"aria-invalid":p||void 0,"aria-describedby":[p?a:void 0,y[`aria-describedby`]].filter(Boolean).join(` `)||void 0,onPointerEnter(e){`highlightDate`in t&&(e.pointerType!==`touch`||t.isDragging)&&d&&t.highlightDate(r)},onPointerDown(e){let t=H(e);t instanceof HTMLElement&&`releasePointerCapture`in t&&(`hasPointerCapture`in t?t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId):t.releasePointerCapture(e.pointerId))},onContextMenu(e){e.preventDefault()}}),isPressed:w,isFocused:l,isSelected:f,isDisabled:i,isUnavailable:u,isOutsideVisibleRange:r.compare(t.visibleRange.start)<0||r.compare(t.visibleRange.end)>0,isInvalid:p,formattedDate:D}}function CN(e,t){let n=$A({year:e.format?.year||`numeric`,era:e.format?.era||(t.focusedDate.calendar.identifier===`gregory`&&t.focusedDate.era===`BC`?`short`:void 0),calendar:t.focusedDate.calendar.identifier,timeZone:t.timeZone}),r=e.visibleYears||20,i=t.focusedDate.subtract({years:Math.floor(r/2)}),a=t.focusedDate.add({years:Math.ceil(r/2)-1});t.maxValue&&a.compare(t.maxValue)>0&&(a=qD(t.maxValue),i=a.subtract({years:r-1})),t.minValue&&i.compare(t.minValue)<0&&(i=qD(t.minValue),a=i.add({years:r-1}),t.maxValue&&a.compare(t.maxValue)>0&&(a=qD(t.maxValue)));let o=[],s=i,c=0;for(;s.compare(a)<=0;)lD(s,t.focusedDate)&&(c=o.length),o.push({id:o.length,date:s,formatted:n.format(s.toDate(t.timeZone))}),s=s.add({years:1});let{locale:l}=rp();return{"aria-label":(0,v.useMemo)(()=>new Intl.DisplayNames(l,{type:`dateTimeField`}).of(`year`),[l]),value:c,onChange:e=>{e!=null&&t.setFocusedDate(o[e].date)},items:o}}function wN(e,t){let n=(0,v.useMemo)(()=>{let n=t.visibleRange.start;return e.offset&&(n=n.add(e.offset)),n},[t.visibleRange.start,e.offset]),r=t.visibleDuration.days||t.visibleDuration.weeks,i=$A({day:e.format?.day||(r?`numeric`:void 0),month:e.format?.month||`long`,year:e.format?.year||`numeric`,era:e.format?.era||n&&n.calendar.identifier===`gregory`&&n.era===`BC`?`short`:void 0,calendar:t.visibleRange?.start.calendar.identifier,timeZone:t.timeZone});return(0,v.useMemo)(()=>{if(r)return i.formatRange(n.toDate(t.timeZone),t.visibleRange.end.toDate(t.timeZone));let e=n.calendar.getFormattableMonth?n.calendar.getFormattableMonth(n):n;return i.format(e.toDate(t.timeZone))},[i,r,n,t.timeZone,t.visibleRange.end])}function TN(e,t,n){let{commitBehavior:r=`select`,...i}=e,a=yN(i,t),o=(0,v.useRef)(!1),s=(0,v.useRef)(typeof window<`u`?window:null);nc(s,`pointerdown`,e=>{o.current=e.width===0&&e.height===0});let c={clear:()=>t.clearSelection(),reset:()=>t.setAnchorDate(null),select:()=>t.commitSelection()};return nc(s,`pointerup`,e=>{if(o.current){o.current=!1;return}if(t.setDragging(!1),!t.anchorDate)return;let i=e.target;n.current&&gs(n.current)&&(!ps(n.current,i)||!i.closest(`button, [role="button"]`))&&c[r]()}),a.calendarProps.onBlur=e=>{n.current&&(!e.relatedTarget||!ps(n.current,e.relatedTarget))&&t.anchorDate&&c[r]()},nc(n,`touchmove`,e=>{t.isDragging&&e.preventDefault()},{passive:!1,capture:!0}),a}function EN(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function DN(e,t,n,r,i){let a={};for(let e in t)a[e]=Math.floor(t[e]/2),a[e]>0&&t[e]%2==0&&a[e]--;return AN(e,ON(e,t,n).subtract(a),t,n,r,i)}function ON(e,t,n,r,i){let a=e;return t.years?a=ED(e):t.months?a=wD(e):(t.weeks||t.days&&t.days>7)&&(a=DD(e,n)),AN(e,a,t,n,r,i)}function kN(e,t,n,r,i){let a={...t};return a.days?a.days--:a.weeks?a.weeks--:a.months?a.months--:a.years&&a.years--,AN(e,ON(e,t,n).subtract(a),t,n,r,i)}function AN(e,t,n,r,i,a){if(i&&e.compare(i)>=0){let e=FD(t,ON(qD(i),n,r));e&&(t=e)}if(a&&e.compare(a)<=0){let e=PD(t,kN(qD(a),n,r));e&&(t=e)}return t}function jN(e,t,n){if(t){let n=FD(e,qD(t));n&&(e=n)}if(n){let t=PD(e,qD(n));t&&(e=t)}return e}function MN(e,t,n){if(!n)return e;for(;e.compare(t)>=0&&n(e);)e=e.subtract({days:1});return e.compare(t)>=0?e:null}function NN(e,t){return e===t||e.days===t.days&&e.weeks===t.weeks&&e.months===t.months&&e.years===t.years}function PN(e){let t=(0,v.useMemo)(()=>new Qk(e.locale),[e.locale]),n=(0,v.useMemo)(()=>t.resolvedOptions(),[t]),{locale:r,createCalendar:i,visibleDuration:a={months:1},minValue:o,maxValue:s,selectionAlignment:c,isDateUnavailable:l,pageBehavior:u=`visible`,selectionMode:d=`single`,firstDayOfWeek:f,weeksInMonth:p}=e,m=(0,v.useMemo)(()=>i(n.calendar),[i,n.calendar]),[h,g]=sh(e.value,e.defaultValue??null,e.onChange),_=(0,v.useMemo)(()=>Array.isArray(h)?h.map(e=>XD(qD(e),m)):h?XD(qD(h),m):null,[h,m]),y=(0,v.useMemo)(()=>{let e=Array.isArray(h)?h[0]:h;return e&&`timeZone`in e?e.timeZone:n.timeZone},[h,n.timeZone]),[b,x]=sh((0,v.useMemo)(()=>e.focusedValue?jN(XD(qD(e.focusedValue),m),o,s):void 0,[e.focusedValue,m,o,s]),(0,v.useMemo)(()=>e.defaultFocusedValue?jN(XD(qD(e.defaultFocusedValue),m),o,s):jN(_?Array.isArray(_)?_[0]:_:XD(gD(y),m),o,s),[e.defaultFocusedValue,_,y,m,o,s]),e.onFocusChange),S=()=>{switch(c){case`start`:return ON(b,a,r,o,s);case`end`:return kN(b,a,r,o,s);default:return DN(b,a,r,o,s)}},[C,w]=(0,v.useState)(S),[T,E]=(0,v.useState)(e.autoFocus||!1),[D,O]=(0,v.useState)(a);NN(a,D)||(O(a),w(S()));let k=(0,v.useMemo)(()=>{let e={...a};return e.days?e.days--:e.days=-1,C.add(e)},[C,a]),[A,j]=(0,v.useState)(m);if(!dD(m,A)){let e=XD(b,m);w(DN(e,a,r,o,s)),x(e),j(m)}EN(b,o,s)?x(jN(b,o,s)):b.compare(C)<0?w(kN(b,a,r,o,s)):b.compare(k)>0&&w(ON(b,a,r,o,s));function M(e){e=jN(e,o,s),x(e)}function N(e){let t=MN(jN(e,o,s),C,l);if(!t)return null;let n=Array.isArray(h)?h[0]:h,r=XD(t,n?.calendar||new aD);return n&&`hour`in n?n.set(r):r}function P(t){if(!e.isDisabled&&!e.isReadOnly){if(t===null){g(d===`multiple`?[]:null);return}if(Array.isArray(t))g(t.map(N).filter(Boolean));else{let e=N(t);e&&g(e)}}}let ee=(0,v.useMemo)(()=>_?Array.isArray(_)?_.some(e=>l?.(e)||EN(e,o,s)):l?.(_)||EN(_,o,s):!1,[_,l,o,s]),F=e.isInvalid||e.validationState===`invalid`||ee,I=F?`invalid`:null,L=(0,v.useMemo)(()=>u===`visible`?a:FN(a),[u,a]);return{isDisabled:e.isDisabled??!1,isReadOnly:e.isReadOnly??!1,value:_,setValue:P,selectionMode:d,visibleDuration:a,visibleRange:{start:C,end:k},minValue:o,maxValue:s,focusedDate:b,timeZone:y,validationState:I,isValueInvalid:F,setFocusedDate(e){M(e)},focusNextDay(){M(b.add({days:1}))},focusPreviousDay(){M(b.subtract({days:1}))},focusNextRow(){a.days?this.focusNextPage():(a.weeks||a.months||a.years)&&M(b.add({weeks:1}))},focusPreviousRow(){a.days?this.focusPreviousPage():(a.weeks||a.months||a.years)&&M(b.subtract({weeks:1}))},focusNextPage(){let e=C.add(L);x(jN(b.add(L),o,s)),w(ON(AN(b,e,L,r,o,s),L,r))},focusPreviousPage(){let e=C.subtract(L);x(jN(b.subtract(L),o,s)),w(ON(AN(b,e,L,r,o,s),L,r))},focusSectionStart(){a.days?M(C):a.weeks?M(DD(b,r)):(a.months||a.years)&&M(wD(b))},focusSectionEnd(){a.days?M(k):a.weeks?M(OD(b,r)):(a.months||a.years)&&M(TD(b))},focusNextSection(e){if(!e&&!a.days){M(b.add(FN(a)));return}a.days?this.focusNextPage():a.weeks?M(b.add({months:1})):(a.months||a.years)&&M(b.add({years:1}))},focusPreviousSection(e){if(!e&&!a.days){M(b.subtract(FN(a)));return}a.days?this.focusPreviousPage():a.weeks?M(b.subtract({months:1})):(a.months||a.years)&&M(b.subtract({years:1}))},selectFocusedDate(){l&&l(b)||this.selectDate(b)},selectDate(t){if(!(e.isDisabled||e.isReadOnly)){if(d===`multiple`&&t!=null){let e=N(t);if(!e)return;let n=[];Array.isArray(h)?n=h:h!=null&&(n=[h]);let r=n.findIndex(t=>sD(t,e)),i=r>=0?n.slice(0,r).concat(n.slice(r+1)):[...n,e];g(i)}else P(t)}},isFocused:T,setFocused:E,isInvalid(e){return EN(e,o,s)},isSelected(e){return!_||this.isCellDisabled(e)||this.isCellUnavailable(e)?!1:Array.isArray(_)?_.some(t=>sD(t,e)):sD(e,_)},isCellFocused(e){return T&&b&&sD(e,b)},isCellDisabled(t){return e.isDisabled||t.compare(C)<0||t.compare(k)>0||this.isInvalid(t)},isCellUnavailable(t){return e.isDateUnavailable?e.isDateUnavailable(t):!1},isPreviousVisibleRangeInvalid(){let e=C.subtract({days:1});return sD(e,C)||this.isInvalid(e)},isNextVisibleRangeInvalid(){let e=k.add({days:1});return sD(e,k)||this.isInvalid(e)},getDatesInWeek(e,t=C){let n=t.add({weeks:e}),i=[],o=a.days&&a.days<7?a.days:7;if(o===7){n=DD(n,r,f);let e=mD(n,r,f);for(let t=0;t0&&(m=`start`)}let h=(0,v.useMemo)(()=>{let t=e.isDateUnavailable;if(t)return e=>t(e,f)},[e.isDateUnavailable,f]),g=(0,v.useCallback)(t=>t&&h&&!e.allowsNonContiguousRanges?{start:zN(t,h,o,-1),end:zN(t,h,o,1)}:null,[h,o,e.allowsNonContiguousRanges]),_=(0,v.useMemo)(()=>g(f),[g,f]),y=(0,v.useMemo)(()=>FD(s,_?.start),[s,_]),b=(0,v.useMemo)(()=>PD(c,_?.end),[c,_]),x=PN({...l,value:u&&u.start,createCalendar:i,locale:a,visibleDuration:o,minValue:y,maxValue:b,selectionAlignment:e.selectionAlignment||m,isDateUnavailable:h}),S=f?LN(f,x.focusedDate):u&&LN(u.start,u.end),C=t=>{if(e.isReadOnly)return;let n=MN(jN(t,y,b),x.visibleRange.start,h);if(n){if(!f)p(n);else{let e=LN(f,n);e&&d({start:RN(e.start,u?.start),end:RN(e.end,u?.end)}),p(null)}}},[w,T]=(0,v.useState)(!1),E=(0,v.useMemo)(()=>!u||f?!1:h&&(h(u.start)||h(u.end))?!0:EN(u.start,s,c)||EN(u.end,s,c),[h,u,f,s,c]),D=e.isInvalid||e.validationState===`invalid`||E,O=D?`invalid`:null;return{...x,value:u,setValue:d,anchorDate:f,setAnchorDate:p,highlightedRange:S,validationState:O,isValueInvalid:D,selectFocusedDate(){x.isCellUnavailable(x.focusedDate)||C(x.focusedDate)},commitSelection(){C(x.focusedDate)},selectDate:C,highlightDate(e){f&&x.setFocusedDate(e)},isSelected(e){return!!(S&&e.compare(S.start)>=0&&e.compare(S.end)<=0&&!x.isCellDisabled(e)&&!x.isCellUnavailable(e))},isInvalid(e){return x.isInvalid(e)||EN(e,_?.start,_?.end)},isDragging:w,setDragging:T,clearSelection(){p(null),d(null)},focusNearestAvailableDate(e){let t=g(e),n=e=>this.isInvalid(e)||EN(e,t?.start,t?.end),r=e.add({days:1});n(r)&&(r=e.subtract({days:1})),n(r)||(this.setFocusedDate(r),this.setFocused(!0))}}}function LN(e,t){return!e||!t?null:(t.compare(e)<0&&([e,t]=[t,e]),{start:qD(e),end:qD(t)})}function RN(e,t){return e=XD(e,t?.calendar||new aD),t&&`hour`in t?t.set(e):e}function zN(e,t,n,r){let i=e.add({days:r}),a=e.subtract(n),o=e.add(n);for(;(r<0?i.compare(a)>=0:i.compare(o)<=0)&&!t(i);)i=i.add({days:r});if(t(i))return i.add({days:-r})}var BN=(0,v.createContext)(null),VN=(0,v.createContext)(null),HN=(0,v.createContext)(null),UN=(0,v.createContext)(null),WN=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,VN);let{locale:n}=rp(),r=IN({...e,locale:n,createCalendar:e.createCalendar||Xk}),{calendarProps:i,prevButtonProps:a,nextButtonProps:o,errorMessageProps:s,title:c}=TN(e,r,t),l=Mf({...e,values:{state:r,isDisabled:e.isDisabled||!1,isInvalid:r.isValueInvalid},defaultClassName:`react-aria-RangeCalendar`}),u=W(e,{global:!0});return v.createElement(q.div,{...U(l,u,i),ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":r.isValueInvalid||void 0},v.createElement(jf,{values:[[th,{slots:{previous:a,next:o}}],[_h,{"aria-hidden":!0,level:2,children:c}],[UN,r],[VN,e],[sb,{slots:{errorMessage:s}}]]},v.createElement(ov,null,v.createElement(`h2`,null,i[`aria-label`])),l.children,v.createElement(ov,null,v.createElement(`button`,{"aria-label":o[`aria-label`],disabled:o.isDisabled,onClick:()=>r.focusNextPage(),tabIndex:-1}))))}),GN=(0,v.createContext)(null),KN=(0,v.forwardRef)(function(e,t){let n=(0,v.useContext)(HN),r=(0,v.useContext)(UN),i=Pf(BN),a=Pf(VN),o=n??r,s=o.visibleRange.start;e.offset&&(s=s.add(e.offset));let c=i?.firstDayOfWeek??a?.firstDayOfWeek,{gridProps:l,headerProps:u,weekDays:d,weeksInMonth:f}=bN({startDate:s,endDate:TD(s),weekdayStyle:e.weekdayStyle,firstDayOfWeek:c},o),p=W(e,{global:!0});return v.createElement(GN.Provider,{value:{headerProps:u,weekDays:d,startDate:s,weeksInMonth:f}},v.createElement(q.table,{render:e.render,...U(p,l),ref:t,style:e.style,cellPadding:0,className:e.className??`react-aria-CalendarGrid`},typeof e.children==`function`?v.createElement(v.Fragment,null,v.createElement(JN,null,e=>v.createElement(XN,null,e)),v.createElement(QN,null,e.children)):e.children))});function qN(e,t){let{children:n,style:r,className:i}=e,{headerProps:a,weekDays:o}=(0,v.useContext)(GN),s=W(e,{global:!0});return v.createElement(q.thead,{render:e.render,...U(s,a),ref:t,style:r,className:i??`react-aria-CalendarGridHeader`},v.createElement(`tr`,null,o.map((e,t)=>v.cloneElement(n(e),{key:t}))))}var JN=(0,v.forwardRef)(qN);function YN(e,t){let{children:n,style:r,className:i}=e,a=W(e,{global:!0});return v.createElement(q.th,{render:e.render,...a,ref:t,style:r,className:i||`react-aria-CalendarHeaderCell`},n)}var XN=(0,v.forwardRef)(YN);function ZN(e,t){let{children:n,style:r,className:i}=e,a=(0,v.useContext)(HN),o=(0,v.useContext)(UN),s=a??o,{startDate:c,weeksInMonth:l}=(0,v.useContext)(GN),u=W(e,{global:!0});return v.createElement(q.tbody,{render:e.render,...u,ref:t,style:r,className:i??`react-aria-CalendarGridBody`},[...Array(l).keys()].map(e=>v.createElement(`tr`,{key:e},s.getDatesInWeek(e,c).map((e,t)=>e?v.cloneElement(n(e),{key:t}):v.createElement(`td`,{key:t})))))}var QN=(0,v.forwardRef)(ZN),$N=(0,v.forwardRef)(function({date:e,...t},n){let r=(0,v.useContext)(HN),i=(0,v.useContext)(UN),a=r??i,{startDate:o}=(0,v.useContext)(GN)??{startDate:a.visibleRange.start},s=a.visibleDuration.days||a.visibleDuration.weeks?!1:!cD(o,e),c=fD(e,a.timeZone),l=(0,v.useRef)(null),{cellProps:u,buttonProps:d,...f}=SN({date:e,isOutsideMonth:s},a,l),{hoverProps:p,isHovered:m}=eh({...t,isDisabled:f.isDisabled||f.isUnavailable}),{focusProps:h,isFocusVisible:g}=Jm();g&&=f.isFocused;let _=!1,y=!1;`highlightedRange`in a&&a.highlightedRange&&(_=sD(e,a.highlightedRange.start),y=sD(e,a.highlightedRange.end));let b=Mf({...t,defaultChildren:f.formattedDate,defaultClassName:`react-aria-CalendarCell`,values:{date:e,isHovered:m,isOutsideMonth:s,isFocusVisible:g,isSelectionStart:_,isSelectionEnd:y,isToday:c,...f}}),x={"data-focused":f.isFocused||void 0,"data-hovered":m||void 0,"data-pressed":f.isPressed||void 0,"data-unavailable":f.isUnavailable||void 0,"data-disabled":f.isDisabled||void 0,"data-focus-visible":g||void 0,"data-outside-visible-range":f.isOutsideVisibleRange||void 0,"data-outside-month":s||void 0,"data-selected":f.isSelected||void 0,"data-selection-start":_||void 0,"data-selection-end":y||void 0,"data-invalid":f.isInvalid||void 0,"data-today":c||void 0},S=W(t,{global:!0});return v.createElement(`td`,{...u,ref:n},v.createElement(q.div,{...U(S,d,h,p,x,b),ref:l}))}),eP=(0,v.forwardRef)(function(e,t){let{offset:n,format:r,className:i=`react-aria-CalendarHeading`,...a}=e,o=v.useContext(HN),s=v.useContext(UN),c=wN({offset:n,format:r},o||s);return v.createElement(vh,{...a,className:i,ref:t},c)});function tP(e){return e&&e.__esModule?e.default:e}function nP(e,t,n){let r=rv(tP(WA),`@react-aria/datepicker`),{isInvalid:i,validationErrors:a,validationDetails:o}=t.displayValidation,{labelProps:s,fieldProps:c,descriptionProps:l,errorMessageProps:u}=XC({...e,labelElementType:`span`,isInvalid:i,errorMessage:e.errorMessage||a}),d=c[`aria-labelledby`]||c.id,{locale:f}=rp(),p=t.formatValue(f,{month:`long`}),m=tc(p?r.format(`selectedRangeDescription`,{startDate:p.start,endDate:p.end}):``),h={"aria-label":r.format(`startDate`),"aria-labelledby":d},g={"aria-label":r.format(`endDate`),"aria-labelledby":d},_=es(),y=es(),b=GA(t,n),x=[m[`aria-describedby`],c[`aria-describedby`]].filter(Boolean).join(` `)||void 0,S=(0,v.useMemo)(()=>Ug(n,{accept:e=>e.id!==_}),[n,_]),C={[XA]:S,[YA]:`presentation`,"aria-describedby":x,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},w=W(e),T=(0,v.useRef)(!1),{focusWithinProps:E}=qm({...e,isDisabled:t.isOpen,onBlurWithin:t=>{ps(document.getElementById(y),t.relatedTarget)||(T.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{T.current||(T.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}}),D=(0,v.useRef)(jS),O=(0,v.useRef)(jS);return{groupProps:U(w,b,c,m,E,{role:`group`,"aria-disabled":e.isDisabled||null,"aria-describedby":x,onKeyDown(n){t.isOpen||e.onKeyDown&&e.onKeyDown(n)},onKeyUp(n){t.isOpen||e.onKeyUp&&e.onKeyUp(n)}}),labelProps:{...s,onClick:()=>{S.focusFirst()}},buttonProps:{...m,id:_,"aria-haspopup":`dialog`,"aria-label":r.format(`calendar`),"aria-labelledby":`${_} ${d}`,"aria-describedby":x,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:y,"aria-labelledby":`${_} ${d}`},startFieldProps:{...h,...C,value:t.value?.start??null,defaultValue:t.defaultValue?.start,onChange:e=>t.setDateTime(`start`,e),autoFocus:e.autoFocus,name:e.startName,form:e.form,[NS]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){D.current=e,t.updateValidation(BS(e,O.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...g,...C,value:t.value?.end??null,defaultValue:t.defaultValue?.end,onChange:e=>t.setDateTime(`end`,e),name:e.endName,form:e.form,[NS]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){O.current=e,t.updateValidation(BS(D.current,e))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:l,errorMessageProps:u,calendarProps:{autoFocus:!0,value:t.dateRange?.start&&t.dateRange.end?t.dateRange:null,onChange:t.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:t.dateRange?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:typeof e.errorMessage==`function`?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(` `),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:i,validationErrors:a,validationDetails:o}}function rP(e){let t=gv(e),[n,r]=sh(e.value,e.defaultValue||null,e.onChange),[i]=(0,v.useState)(n),[a,o]=(0,v.useState)(()=>n||{start:null,end:null});n==null&&a.start&&a.end&&(a={start:null,end:null},o(a));let s=n||a,c=e=>{s=e||{start:null,end:null},o(s),iP(s)?r(s):r(null)},[l,u]=Qj(s?.start||s?.end||e.placeholderValue||null,e.granularity),d=l===`hour`||l===`minute`||l===`second`,f=e.shouldCloseOnSelect??!0,[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(null);s&&iP(s)&&(p=s,`hour`in s.start&&(h=s));let _=(e,t)=>{c({start:`timeZone`in t.start?t.start.set(qD(e.start)):JD(e.start,t.start),end:`timeZone`in t.end?t.end.set(qD(e.end)):JD(e.end,t.end)}),m(null),g(null),D.commitValidation()},y=n=>{let r=typeof f==`function`?f():f;d?iP(n)&&(r||h?.start&&h?.end)?_(n,{start:h?.start||Yj(e.placeholderValue),end:h?.end||Yj(e.placeholderValue)}):m(n):iP(n)?(c(n),D.commitValidation()):m(n),r&&t.setOpen(!1)},b=e=>{iP(p)&&iP(e)?_(p,e):g(e)},x=s?.start?.calendar.identifier===`gregory`&&s.start.era===`BC`||s?.end?.calendar.identifier===`gregory`&&s.end.era===`BC`,S=(0,v.useMemo)(()=>({granularity:l,timeZone:u,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:x}),[l,e.hourCycle,e.shouldForceLeadingZeros,u,e.hideTimeZone,x]),{minValue:C,maxValue:w,isDateUnavailable:T}=e,E=(0,v.useMemo)(()=>Gj(s,C,w,T?e=>T(e,null):void 0,S),[s,C,w,T,S]),D=PS({...e,value:n,name:(0,v.useMemo)(()=>[e.startName,e.endName].filter(e=>e!=null),[e.startName,e.endName]),builtinValidation:E}),O=D.displayValidation.isInvalid,k=e.validationState||(O?`invalid`:null);return{...D,value:s,defaultValue:e.defaultValue??i,setValue:c,dateRange:p,timeRange:h,granularity:l,hasTime:d,setDate(e,t){y(e===`start`?{start:t,end:p?.end??null}:{start:p?.start??null,end:t})},setTime(e,t){b(e===`start`?{start:t,end:h?.end??null}:{start:h?.start??null,end:t})},setDateTime(e,t){c(e===`start`?{start:t,end:s?.end??null}:{start:s?.start??null,end:t})},setDateRange:y,setTimeRange:b,...t,setOpen(n){!n&&!(s?.start&&s?.end)&&iP(p)&&d&&_(p,{start:h?.start||Yj(e.placeholderValue),end:h?.end||Yj(e.placeholderValue)}),t.setOpen(n)},validationState:k,isInvalid:O,formatValue(t,n){if(!s||!s.start||!s.end)return null;let r=`timeZone`in s.start?s.start.timeZone:void 0,i=e.granularity||(s.start&&`minute`in s.start?`minute`:`day`),a=`timeZone`in s.end?s.end.timeZone:void 0,o=e.granularity||(s.end&&`minute`in s.end?`minute`:`day`),c=Jj(n,{granularity:i,timeZone:r,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:s.start.calendar.identifier===`gregory`&&s.start.era===`BC`||s.end.calendar.identifier===`gregory`&&s.end.era===`BC`}),l=s.start.toDate(r||`UTC`),u=s.end.toDate(a||`UTC`),d=new Qk(t,c),f;if(r===a&&i===o&&s.start.compare(s.end)!==0){try{let e=d.formatRangeToParts(l,u),t=-1;for(let n=0;nt&&(r+=e[i].value);return{start:n,end:r}}catch{}f=d}else f=new Qk(t,Jj(n,{granularity:o,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:d.format(l),end:f.format(u)}},getDateFormatter(e,t){return new Qk(e,Jj({},{...S,...t}))}}}function iP(e){return e?.start!=null&&e.end!=null}var aP=(0,v.createContext)(null),oP=(0,v.createContext)(null),sP=[ES,th,Wf,sb],cP=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,aP);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,i=rP({...e,validationBehavior:r}),a=(0,v.useRef)(null),[o,s]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),{groupProps:c,labelProps:l,startFieldProps:u,endFieldProps:d,buttonProps:f,dialogProps:p,calendarProps:m,descriptionProps:h,errorMessageProps:g,..._}=nP({...Lf(e),label:s,validationBehavior:r},i,a),{focusProps:y,isFocused:b,isFocusVisible:x}=Jm({within:!0}),S=Mf({...e,values:{state:i,isFocusWithin:b,isFocusVisible:x,isDisabled:e.isDisabled||!1,isInvalid:i.isInvalid,isOpen:i.isOpen,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-DateRangePicker`}),C=W(e,{global:!0});return delete C.id,v.createElement(jf,{values:[[oP,i],[ES,{...c,ref:a,isInvalid:i.isInvalid}],[th,{...f,isPressed:i.isOpen}],[Wf,{...l,ref:o,elementType:`span`}],[VN,m],[cS,i],[_v,{trigger:`DateRangePicker`,triggerRef:a,placement:`bottom start`,clearContexts:sP}],[sS,p],[fM,{slots:{start:u,end:d}}],[sb,{slots:{description:h,errorMessage:g}}],[OS,_]]},v.createElement(q.div,{...U(C,S,y),ref:t,slot:e.slot||void 0,"data-focus-within":b||void 0,"data-invalid":i.isInvalid||void 0,"data-focus-visible":x||void 0,"data-disabled":e.isDisabled||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-open":i.isOpen||void 0}))}),lP=(0,v.createContext)({triggerRef:{current:null}}),uP=({children:e,className:t,onOpenChange:n,...r})=>{let i=v.useMemo(()=>Xd(),[]),a=(0,v.useRef)(null),[o,s]=v.useState(!1),c=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(!o)return;let e=e=>{!e.metaKey&&!e.ctrlKey&&!e.altKey&&(c.current=!0)};return window.addEventListener(`keydown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0)}},[o]);let l=e=>{s(e),!e&&c.current&&window.requestAnimationFrame(()=>{a.current?.focus()}),c.current=!1,n?.(e)};return(0,G.jsx)(lP,{value:{slots:i,triggerRef:a},children:(0,G.jsx)(cP,{"data-required":yh(r.isRequired),"data-slot":`date-range-picker`,...r,className:J(t,i?.base()),onOpenChange:l,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})};uP.displayName=`HeroUI.DateRangePicker`;var dP=({children:e,className:t,ref:n,...r})=>{let{slots:i,triggerRef:a}=(0,v.use)(lP),o=ys(v.useCallback(e=>{a.current=e},[a]),n);return(0,G.jsx)(nh,{ref:o,className:J(t,i?.trigger()),"data-slot":`date-range-picker-trigger`,...r,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})};dP.displayName=`HeroUI.DateRangePicker.Trigger`;var fP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(lP);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(r?.triggerIndicator,t),"data-slot":`date-range-picker-trigger-indicator`,...n,children:e||(0,G.jsx)(Mh,{})})};fP.displayName=`HeroUI.DateRangePicker.TriggerIndicator`;var pP=({children:e=` - `,className:t,...n})=>{let{slots:r}=(0,v.use)(lP);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(r?.rangeSeparator,t),"data-slot":`date-range-picker-range-separator`,...n,children:e})};pP.displayName=`HeroUI.DateRangePicker.RangeSeparator`;var mP=({children:e,className:t,placement:n=`bottom`,...r})=>{let{slots:i}=(0,v.use)(lP);return(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(yv,{...r,className:J(t,i?.popover()),"data-slot":`date-range-picker-popover`,placement:n,children:e})})};mP.displayName=`HeroUI.DateRangePicker.Popover`;var hP=Object.assign(uP,{Root:uP,Trigger:dP,TriggerIndicator:fP,RangeSeparator:pP,Popover:mP}),gP=8,_P=.3,vP=.5;function yP(e,t){let n=(0,v.use)(cS),r=(0,v.useRef)(null),i=(0,v.useRef)(!1),a=(0,v.useRef)(!1),o=(0,v.useRef)(0),s=(0,v.useRef)(0),c=(0,v.useRef)(0),l=(0,v.useRef)(0),u=(0,v.useRef)(0),d=e===`top`||e===`bottom`,f=(0,v.useCallback)(e=>d?e.clientY:e.clientX,[d]),p=(0,v.useCallback)(t=>{switch(e){case`bottom`:return Math.max(0,t);case`top`:return Math.min(0,t);case`right`:return Math.max(0,t);case`left`:return Math.min(0,t);default:return t}},[e]),m=(0,v.useCallback)(e=>{t&&e.button===0&&(e.target.closest(`input, textarea, button, [role='button'], select, a, [data-slot='drawer-body']`)||(i.current=!0,a.current=!1,o.current=f(e),u.current=o.current,l.current=Date.now(),s.current=0,c.current=0))},[f,t]),h=(0,v.useCallback)(e=>{if(!i.current||!r.current)return;let t=f(e),n=t-o.current,m=p(n);if(!a.current){if(Math.abs(n)0&&(c.current=(t-u.current)/g,l.current=h,u.current=t);let _=d?`Y`:`X`;r.current.style.transform=`translate${_}(${m}px)`},[f,p,d]),g=(0,v.useCallback)(e=>{if(!i.current)return;i.current=!1;let t=r.current;if(!t||!a.current){a.current=!1;return}a.current=!1;try{t.releasePointerCapture(e.pointerId)}catch{}let o=d?t.offsetHeight:t.offsetWidth,l=Math.abs(s.current),u=Math.abs(c.current);(l>o*_P||u>vP)&&n?n.close():(t.style.transition=`transform 300ms cubic-bezier(0.32, 0.72, 0, 1)`,t.style.transform=``,t.addEventListener(`transitionend`,()=>{t.style.transition=``},{once:!0})),s.current=0,c.current=0},[d,n]);return{dialogRef:r,dragHandlers:t?{onPointerDown:m,onPointerMove:h,onPointerUp:g}:{}}}var bP=(0,v.createContext)({}),xP=({children:e,state:t,...n})=>{let r=(0,v.useMemo)(()=>({slots:$d(),placement:void 0,isDismissable:!0}),[]),i=(0,v.useMemo)(()=>t?{isOpen:t.isOpen,onOpenChange:t.setOpen}:{},[t]);return(0,G.jsx)(bP,{value:r,children:(0,G.jsx)(lS,{"data-slot":`drawer-root`,...U(n,i),children:e})})};xP.displayName=`HeroUI.Drawer`;var SP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bP);return(0,G.jsx)(nh,{className:J(t,r?.trigger()),"data-slot":`drawer-trigger`,...n,children:e})};SP.displayName=`HeroUI.Drawer.Trigger`;var CP=({children:e,className:t,isDismissable:n=!0,variant:r,...i})=>{let{slots:a}=(0,v.use)(bP),o=(0,v.useMemo)(()=>$d({variant:r}),[r]),s=(0,v.useMemo)(()=>({slots:{...a,...o},isDismissable:n}),[a,o,n]);return(0,G.jsx)(gS,{className:J(t,o?.backdrop()),"data-slot":`drawer-backdrop`,isDismissable:n,...i,children:t=>(0,G.jsx)(bP,{value:s,children:typeof e==`function`?e(t):e})})};CP.displayName=`HeroUI.Drawer.Backdrop`;var wP=({children:e,className:t,placement:n=`bottom`,...r})=>{let{isDismissable:i,slots:a}=(0,v.use)(bP),o=(0,v.useMemo)(()=>$d({placement:n}),[n]),s=(0,v.useMemo)(()=>({placement:n,isDismissable:i,slots:{...a,...o}}),[a,n,i,o]);return(0,G.jsx)(mS,{className:J(t,o?.content()),"data-placement":n,"data-slot":`drawer-content`,...r,children:t=>(0,G.jsx)(bP,{value:s,children:typeof e==`function`?e(t):e})})};wP.displayName=`HeroUI.Drawer.Content`;var TP=({children:e,className:t,...n})=>{let{isDismissable:r=!0,placement:i,slots:a}=(0,v.use)(bP),{dialogRef:o,dragHandlers:s}=yP(i,r);return(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(uS,{ref:o,className:Y(a?.dialog,t),"data-placement":i,"data-slot":`drawer-dialog`,style:r?{touchAction:`none`}:void 0,...s,...n,children:e})})};TP.displayName=`HeroUI.Drawer.Dialog`;var EP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bP);return(0,G.jsx)(K.div,{className:Y(r?.header,t),"data-slot":`drawer-header`,...n,children:e})};EP.displayName=`HeroUI.Drawer.Header`;var DP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bP);return(0,G.jsx)(K.div,{className:Y(r?.body,t),"data-slot":`drawer-body`,style:{touchAction:`pan-y`},...n,children:e})};DP.displayName=`HeroUI.Drawer.Body`;var OP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bP);return(0,G.jsx)(K.div,{className:Y(r?.footer,t),"data-slot":`drawer-footer`,...n,children:e})};OP.displayName=`HeroUI.Drawer.Footer`;var kP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bP);return(0,G.jsx)(vh,{className:Y(r?.heading,t),"data-slot":`drawer-heading`,slot:`title`,...n,children:e})};kP.displayName=`HeroUI.Drawer.Heading`;var AP=({className:e,...t})=>{let{slots:n}=(0,v.use)(bP);return(0,G.jsx)(K.div,{"aria-hidden":`true`,className:Y(n?.handle,e),"data-slot":`drawer-handle`,...t,children:(0,G.jsx)(`div`,{"data-slot":`drawer-handle-bar`})})};AP.displayName=`HeroUI.Drawer.Handle`;var jP=({className:e,...t})=>{let{slots:n}=(0,v.use)(bP);return(0,G.jsx)(xS,{className:J(e,n?.closeTrigger()),"data-slot":`drawer-close-trigger`,slot:`close`,...t})};jP.displayName=`HeroUI.Drawer.CloseTrigger`;var MP=Object.assign(xP,{Root:xP,Trigger:SP,Backdrop:CP,Content:wP,Dialog:TP,Header:EP,Heading:kP,Body:DP,Footer:OP,Handle:AP,CloseTrigger:jP});function NP(e){let{progressBarProps:t,labelProps:n}=wp(e);return{meterProps:{...t,role:`meter progressbar`},labelProps:n}}var PP=(0,v.createContext)(null),FP=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,PP);let{value:n=0,minValue:r=0,maxValue:i=100}=e;n=Oc(n,r,i);let a=i-r,[o,s]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),{meterProps:c,labelProps:l}=NP({...e,label:s}),u=a===0?0:(n-r)/a*100,d=Mf({...e,defaultClassName:`react-aria-Meter`,values:{percentage:u,valueText:c[`aria-valuetext`]}}),f=W(e,{global:!0});return v.createElement(q.div,{...U(f,d,c),ref:t,slot:e.slot||void 0},v.createElement(Wf.Provider,{value:{...l,ref:o,elementType:`span`}},d.children))});function IP({children:e,className:t,fullWidth:n,...r}){let i=v.useMemo(()=>Tf({fullWidth:n}),[n]);return(0,G.jsx)(_M,{"data-required":yh(r.isRequired),"data-slot":`time-field`,...r,className:J(t,i),children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})}var LP=Object.assign(IP,{Root:IP,Group:CM,Input:TM,InputContainer:DM,Segment:EM,Prefix:wM,Suffix:OM}),RP=e=>{let{containerRef:t,isEnabled:n,offset:r,onVisibilityChange:i,orientation:a,visibility:o}=e,s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useCallback)(()=>{let e=t.current;if(!e)return;let n=a===`vertical`,o=n?e.scrollTop:Math.abs(e.scrollLeft),l=n?e.scrollHeight:e.scrollWidth,u=n?e.clientHeight:e.clientWidth,d=o>r,f=o+u+r{c.current=null,n?d&&f?(e.dataset.topBottomScroll=`true`,delete e.dataset.topScroll,delete e.dataset.bottomScroll,i?.(`both`)):(e.dataset.topScroll=String(d),e.dataset.bottomScroll=String(f),delete e.dataset.topBottomScroll,i&&i(d?`top`:f?`bottom`:`none`)):d&&f?(e.dataset.leftRightScroll=`true`,delete e.dataset.leftScroll,delete e.dataset.rightScroll,i?.(`both`)):(e.dataset.leftScroll=String(d),e.dataset.rightScroll=String(f),delete e.dataset.leftRightScroll,i&&i(d?`left`:f?`right`:`none`))}))},[t,a,r,i]);(0,v.useEffect)(()=>{let e=t.current;if(!e||!n||o!==`auto`)return;l(),e.addEventListener(`scroll`,l,{passive:!0});let r=new ResizeObserver(l);return r.observe(e),()=>{e.removeEventListener(`scroll`,l),r.disconnect(),c.current!==null&&(cancelAnimationFrame(c.current),c.current=null),s.current=null}},[t,o,n,l])},zP=globalThis?.document?v.useLayoutEffect:v.useEffect,BP=({children:e,className:t,hideScrollBar:n=!1,isEnabled:r=!0,offset:i=0,onVisibilityChange:a,orientation:o=`vertical`,ref:s,size:c=40,variant:l=`fade`,visibility:u=`auto`,...d})=>{let f=(0,v.useRef)(null);RP({containerRef:f,isEnabled:r,offset:i,onVisibilityChange:a,orientation:o,visibility:u}),zP(()=>{let e=f.current;!e||u===`auto`||(delete e.dataset.topScroll,delete e.dataset.bottomScroll,delete e.dataset.topBottomScroll,delete e.dataset.leftScroll,delete e.dataset.rightScroll,delete e.dataset.leftRightScroll,u===`both`?e.dataset[o===`vertical`?`topBottomScroll`:`leftRightScroll`]=`true`:u!==`none`&&(e.dataset[`${u}Scroll`]=`true`))},[u,o]);let p=(0,v.useMemo)(()=>hf({hideScrollBar:n,orientation:o,variant:l}),[o,n,l]),m={"--scroll-shadow-size":`${c}px`,...d.style};return(0,G.jsx)(`div`,{ref:ys(f,s),className:p.base({className:t}),"data-orientation":o,"data-scroll-shadow-size":c,"data-slot":`scroll-shadow`,style:m,...d,children:e})};BP.displayName=`HeroUI.ScrollShadow`;var VP=Object.assign(BP,{Root:BP}),HP=({className:e,orientation:t,variant:n,...r})=>{let i=Pf(ab),a=t??i?.orientation??`horizontal`;return(0,G.jsx)(ob,{"data-orientation":a,"data-slot":`separator`,orientation:a,className:vf({orientation:a,variant:n,className:e}),...r})},UP=Object.assign(HP,{Root:HP}),WP=new Map;function GP(e,t,n=!0){let r=Jo();return v.useMemo(()=>{if(t!==void 0)return t;if(!r){if(n&&WP.has(e))return WP.get(e);try{let t=document.documentElement,r=getComputedStyle(t).getPropertyValue(e).trim()||void 0;return n&&WP.set(e,r),r}catch{return}}},[e,t,r,n])}var KP=({animationType:e,className:t,...n})=>{let r=GP(`--skeleton-animation`,e),i=v.useMemo(()=>yf({animationType:r}),[r]);return(0,G.jsx)(K.div,{className:i.base({className:t}),...n})},qP=Object.assign(KP,{Root:KP}),JP=(0,v.createContext)({}),YP=({children:e,className:t,fullWidth:n,isDetached:r=!1,isDisabled:i,orientation:a,size:o,...s})=>{let c=Pf(Ow),l=a??c?.orientation??`horizontal`,u=v.useMemo(()=>Df({fullWidth:n,isDetached:r,orientation:l}),[n,r,l]);return(0,G.jsx)(JP,{value:{slots:u,size:o,isDisabled:i},children:(0,G.jsx)(Aw,{className:J(t,u.base()),"data-slot":`toggle-button-group`,isDisabled:i,orientation:l,...s,children:e})})},XP=({className:e,...t})=>{let{slots:n}=(0,v.use)(JP);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(n?.separator,e),"data-slot":`toggle-button-group-separator`,...t})},ZP=({children:e,className:t,isIconOnly:n,size:r,style:i,variant:a,...o})=>{let s=(0,v.use)(JP),c=Ef({isIconOnly:n,size:r??s?.size,variant:a});return(0,G.jsx)(Nw,{className:J(t,c),"data-slot":`toggle-button`,style:i,...o,children:t=>typeof e==`function`?e(t):e})},QP=Object.assign(ZP,{Root:ZP});function $P(e,t,n){let{labelProps:r,inputProps:i,isSelected:a,...o}=Uw(e,t,n);return{labelProps:r,inputProps:{...i,role:`switch`,checked:a},isSelected:a,...o}}var eF=(0,v.createContext)(null),tF=(0,v.createContext)(null),nF=(0,v.createContext)(null),rF=(0,v.forwardRef)(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=Ff(r,t,eF);let{validationBehavior:i}=Pf(VS)||{},a=e.validationBehavior??i??`native`,o=Is(ys(n,e.inputRef===void 0?null:e.inputRef)),s=jw(e),c=$P({...Lf(e),children:typeof e.children==`function`||e.children,validationBehavior:a},s,o),{descriptionProps:l,errorMessageProps:u,isSelected:d,isDisabled:f,isReadOnly:p,isInvalid:m,validationDetails:h,validationErrors:g}=c,_=Mf({...e,defaultClassName:`react-aria-SwitchField`,values:{isSelected:d,isDisabled:f,isReadOnly:p,isInvalid:m,isRequired:e.isRequired||!1,state:s}}),y=W(e,{global:!0});return delete y.id,delete y.onClick,v.createElement(q.div,{...U(y,_),ref:t,slot:e.slot||void 0,"data-selected":d||void 0,"data-disabled":f||void 0,"data-readonly":p||void 0,"data-invalid":m||void 0,"data-required":e.isRequired||void 0},v.createElement(jf,{values:[[tF,s],[nF,{...c,inputRef:o,defaultClassName:`react-aria-SwitchButton`,isRequired:e.isRequired}],[sb,{slots:{description:l,errorMessage:u}}],[OS,{isInvalid:m,validationDetails:h,validationErrors:g}]]},_.children))}),iF=(0,v.forwardRef)(function(e,t){let{labelProps:n,inputProps:r,isSelected:i,isDisabled:a,isReadOnly:o,isPressed:s,isInvalid:c,inputRef:l,defaultClassName:u,isRequired:d}=(0,v.useContext)(nF),{isFocused:f,isFocusVisible:p,focusProps:m}=Jm(),h=a||o,g=(0,v.useContext)(tF),{hoverProps:_,isHovered:y}=eh({...e,isDisabled:h}),b=Mf({...e,defaultClassName:u,values:{isSelected:i,isPressed:s,isHovered:y,isFocused:f,isFocusVisible:p,isDisabled:a,isReadOnly:o,isInvalid:c,isRequired:d||!1,state:g}}),x=W(e,{global:!0});return delete x.id,delete x.onClick,v.createElement(q.label,{...U(x,n,_,b),ref:t,slot:e.slot||void 0,"data-selected":i||void 0,"data-pressed":s||void 0,"data-hovered":y||void 0,"data-focused":f||void 0,"data-focus-visible":p||void 0,"data-disabled":a||void 0,"data-readonly":o||void 0,"data-invalid":c||void 0,"data-required":d||void 0},v.createElement(ov,{elementType:`span`},v.createElement(`input`,{...U(r,m),ref:l})),b.children)}),aF=(0,v.createContext)({}),oF=({children:e,className:t,size:n,...r})=>{let i=v.useMemo(()=>bf({size:n}),[n]);return(0,G.jsx)(rF,{"data-slot":`switch`,...r,className:J(t,i.base()),children:t=>(0,G.jsx)(aF,{value:{slots:i,state:t},children:typeof e==`function`?e(t):e})})};oF.displayName=`HeroUI.Switch`;var sF=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aF);return(0,G.jsx)(iF,{"data-slot":`switch-content`,...n,className:J(t,r?.content()),children:e})};sF.displayName=`HeroUI.Switch.Content`;var cF=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aF);return(0,G.jsx)(K.span,{className:Y(r?.control,t),"data-slot":`switch-control`,...n,children:e})};cF.displayName=`HeroUI.Switch.Control`;var lF=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aF);return(0,G.jsx)(K.span,{className:Y(r?.thumb,t),"data-slot":`switch-thumb`,...n,children:e})};lF.displayName=`HeroUI.Switch.Thumb`;var uF=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aF);return(0,G.jsx)(K.span,{className:Y(r?.icon,t),"data-slot":`switch-icon`,...n,children:e})};uF.displayName=`HeroUI.Switch.Icon`;var dF=Object.assign(oF,{Root:oF,Content:sF,Control:cF,Thumb:lF,Icon:uF}),fF=new WeakMap;function pF(e,t,n){return e?(typeof t==`string`&&(t=t.replace(/\s+/g,``)),`${fF.get(e)}-${n}-${t}`):``}function mF(e,t,n){let{key:r,isDisabled:i,shouldSelectOnPressUp:a}=e,{selectionManager:o,selectedKey:s}=t,c=r===s,l=i||t.isDisabled||t.selectionManager.isDisabled(r),u=t.collection.getItem(r),{itemProps:d,isPressed:f}=fx({selectionManager:o,key:r,ref:n,isDisabled:l,shouldSelectOnPressUp:a??u?.props.href!=null,linkBehavior:`selection`}),p=pF(t,r,`tab`),m=pF(t,r,`tabpanel`),{tabIndex:h}=d,g=W(u?.props,{labelable:!0});delete g.id;let _=Po(u?.props),{focusableProps:v}=Em({...u?.props,isDisabled:l},n);return{tabProps:U(g,v,_,d,{id:p,"aria-selected":c,"aria-disabled":l||void 0,"aria-controls":c?m:void 0,tabIndex:l?void 0:h,role:`tab`}),isSelected:c,isDisabled:l,isPressed:f}}function hF(e,t){let n=t?.isDisabled,[r,i]=(0,v.useState)(!1);return Io(()=>{if(e?.current&&!n){let t=()=>{if(e.current){let t=Hg(e.current,{tabbable:!0});i(!!t.nextNode())}};t();let n=new MutationObserver(t);return n.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`tabIndex`,`disabled`]}),()=>{n.disconnect()}}}),!n&&r}function gF(e,t,n){let r=hF(n)?void 0:0,i=pF(t,e.id??t?.selectedKey,`tabpanel`);return{tabPanelProps:U(Fs({...e,id:i,"aria-labelledby":pF(t,t?.selectedKey,`tab`)}),{tabIndex:r,role:`tabpanel`,"aria-describedby":e[`aria-describedby`],"aria-details":e[`aria-details`]})}}var _F=class{constructor(e,t,n,r=new Set){this.collection=e,this.flipDirection=t===`rtl`&&n===`horizontal`,this.disabledKeys=r,this.tabDirection=n===`horizontal`}getKeyLeftOf(e){return this.flipDirection?this.getNextKey(e):this.getPreviousKey(e)}getKeyRightOf(e){return this.flipDirection?this.getPreviousKey(e):this.getNextKey(e)}isDisabled(e){return this.disabledKeys.has(e)||!!this.collection.getItem(e)?.props?.isDisabled}getFirstKey(){let e=this.collection.getFirstKey();return e!=null&&this.isDisabled(e)&&(e=this.getNextKey(e)),e}getLastKey(){let e=this.collection.getLastKey();return e!=null&&this.isDisabled(e)&&(e=this.getPreviousKey(e)),e}getKeyAbove(e){return this.tabDirection?null:this.getPreviousKey(e)}getKeyBelow(e){return this.tabDirection?null:this.getNextKey(e)}getNextKey(e){let t=e;do t=this.collection.getKeyAfter(t),t??=this.collection.getFirstKey();while(t!=null&&this.isDisabled(t)&&t!==e);return t}getPreviousKey(e){let t=e;do t=this.collection.getKeyBefore(t),t??=this.collection.getLastKey();while(t!=null&&this.isDisabled(t)&&t!==e);return t}};function vF(e,t,n){let{orientation:r=`horizontal`,keyboardActivation:i=`automatic`}=e,{collection:a,selectionManager:o,disabledKeys:s}=t,{direction:c}=rp(),{collectionProps:l}=ax({ref:n,selectionManager:o,keyboardDelegate:(0,v.useMemo)(()=>new _F(a,c,r,s),[a,s,r,c]),selectOnFocus:i===`automatic`,disallowEmptySelection:!0,scrollRef:n,linkBehavior:`selection`}),u=es();return fF.set(t,u),{tabListProps:{...U(l,Fs({...e,id:u})),role:`tablist`,"aria-orientation":r,tabIndex:void 0}}}function yF(e){let[t,n]=sh(e.selectedKey,e.defaultSelectedKey??null,e.onSelectionChange),r=(0,v.useMemo)(()=>t==null?[]:[t],[t]),{collection:i,disabledKeys:a,selectionManager:o}=IC({...e,selectionMode:`single`,disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:r,onSelectionChange:r=>{if(r===`all`)return;let i=r.values().next().value??null;i===t&&e.onSelectionChange&&e.onSelectionChange(i),n(i)}});return{collection:i,disabledKeys:a,selectionManager:o,selectedKey:t,setSelectedKey:n,selectedItem:t==null?null:i.getItem(t)}}function bF(e){let t=yF({...e,onSelectionChange:e.onSelectionChange?t=>{t!=null&&e.onSelectionChange?.(t)}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:e.defaultSelectedKey??xF(e.collection,e.disabledKeys?new Set(e.disabledKeys):new Set)??void 0}),{selectionManager:n,collection:r,selectedKey:i}=t,a=(0,v.useRef)(i);return(0,v.useEffect)(()=>{let o=i;e.selectedKey==null&&(n.isEmpty||o==null||!r.getItem(o))&&(o=xF(r,t.disabledKeys),o!=null&&n.setSelectedKeys([o])),(o!=null&&n.focusedKey==null||!n.isFocused&&o!==a.current)&&n.setFocusedKey(o),a.current=o}),{...t,isDisabled:e.isDisabled||!1}}function xF(e,t){let n=null;if(e){for(n=e.getFirstKey();n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n!==e.getLastKey();)n=e.getKeyAfter(n);n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n===e.getLastKey()&&(n=e.getFirstKey())}return n}var SF=(0,v.createContext)(null),CF=(0,v.createContext)(null),wF=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,SF);let{children:n,orientation:r=`horizontal`}=e;return n=(0,v.useMemo)(()=>typeof n==`function`?n({orientation:r,defaultChildren:null}):n,[n,r]),v.createElement(Rv,{content:n},n=>v.createElement(TF,{props:e,collection:n,tabsRef:t}))});function TF({props:e,tabsRef:t,collection:n}){let{orientation:r=`horizontal`}=e,i=bF({...e,collection:n,children:void 0}),{focusProps:a,isFocused:o,isFocusVisible:s}=Jm({within:!0}),c=(0,v.useMemo)(()=>({orientation:r,isFocusWithin:o,isFocusVisible:s}),[r,o,s]),l=Mf({...e,defaultClassName:`react-aria-Tabs`,values:c}),u=W(e,{global:!0});return v.createElement(q.div,{...U(u,l,a),ref:t,slot:e.slot||void 0,"data-focused":o||void 0,"data-orientation":r,"data-focus-visible":s||void 0,"data-disabled":i.isDisabled||void 0},v.createElement(jf,{values:[[SF,e],[CF,i]]},l.children))}var EF=(0,v.forwardRef)(function(e,t){return(0,v.useContext)(CF)?v.createElement(DF,{props:e,forwardedRef:t}):v.createElement(Xv,e)});function DF({props:e,forwardedRef:t}){let n=(0,v.useContext)(CF),{CollectionRoot:r}=(0,v.useContext)(ny),{orientation:i=`horizontal`,keyboardActivation:a=`automatic`}=Pf(SF),o=Is(t),{tabListProps:s}=vF({...e,orientation:i,keyboardActivation:a},n,o),c=Mf({...e,children:null,defaultClassName:`react-aria-TabList`,values:{orientation:i,state:n}}),l=W(e,{global:!0});return delete l.id,v.createElement(q.div,{...U(l,c,s),ref:o,"data-orientation":i||void 0},v.createElement(eb,null,v.createElement(r,{collection:n.collection,persistedKeys:ry(n.selectionManager.focusedKey)})))}var OF=Kv(class extends xv{static{this.type=`item`}},(e,t,n)=>{let r=(0,v.useContext)(CF),i=Is(t),{tabProps:a,isSelected:o,isDisabled:s,isPressed:c}=mF({key:n.key,...e},r,i),{focusProps:l,isFocused:u,isFocusVisible:d}=Jm(),{hoverProps:f,isHovered:p}=eh({isDisabled:s,onHoverStart:e.onHoverStart,onHoverEnd:e.onHoverEnd,onHoverChange:e.onHoverChange}),m=Mf({...e,id:void 0,children:n.rendered,defaultClassName:`react-aria-Tab`,values:{isSelected:o,isDisabled:s,isFocused:u,isFocusVisible:d,isPressed:c,isHovered:p}}),h=n.props.href?q.a:q.div,g=W(e,{global:!0});return delete g.id,delete g.onClick,v.createElement(h,{...U(g,m,a,l,f),ref:i,"data-selected":o||void 0,"data-disabled":s||void 0,"data-focused":u||void 0,"data-focus-visible":d||void 0,"data-pressed":c||void 0,"data-hovered":p||void 0},v.createElement(nb.Provider,{value:{isSelected:o}},m.children))}),kF=Hf(function(e,t){let n=(0,v.useContext)(CF),r=Is(t),i=n.selectedKey===e.id,[a,o]=(0,v.useState)(n.selectedKey==null?null:i);a==null&&n.selectedKey!=null?o(i):!i&&a&&o(!1);let s=pc(r,i);return!i&&!e.shouldForceMount&&!s?null:v.createElement(AF,{...e,tabPanelRef:r,isInitiallySelected:a||!1,isExiting:s})});function AF(e){let t=(0,v.useContext)(CF),{id:n,tabPanelRef:r,isInitiallySelected:i,isExiting:a,...o}=e,{tabPanelProps:s}=gF(e,t,r),{focusProps:c,isFocused:l,isFocusVisible:u}=Jm(),d=t.selectedKey===e.id,f=fc(r)&&!i,p=Mf({...e,defaultClassName:`react-aria-TabPanel`,values:{isFocused:l,isFocusVisible:u,isInert:uc(!d),isEntering:f,isExiting:a,state:t}}),m=W(o,{global:!0});delete m.id;let h=d?U(m,s,c,p):U(m,p);return v.createElement(q.div,{...h,ref:r,"data-focused":l||void 0,"data-focus-visible":u||void 0,inert:uc(!d||e.inert),"data-inert":d?void 0:`true`,"data-entering":f||void 0,"data-exiting":a||void 0},v.createElement(jf,{values:[[SF,null],[CF,null]]},v.createElement(ny.Provider,{value:$v},p.children)))}var jF=(0,v.createContext)({}),MF=XE(`tabs.listContainer`),NF=({children:e,className:t,orientation:n=`horizontal`,variant:r,...i})=>{let a=v.useMemo(()=>Sf({variant:r}),[r]);return(0,G.jsx)(jF,{value:{orientation:n,slots:a},children:(0,G.jsx)(wF,{...i,className:J(t,a.base()),"data-slot":`tabs`,orientation:n,children:e})})},PF=({children:e,className:t,render:n,...r})=>(0,G.jsx)(MF.Injector,{...r,className:t,render:n,children:e}),FF=({children:e,className:t,...n})=>{let{orientation:r=`horizontal`,slots:i}=(0,v.use)(jF),a=(0,v.useRef)(null),o=r===`vertical`,[s,c]=MF.useSlot(n),l=(0,v.useCallback)(e=>{let t=a.current;if(!t)return;let n=o?t.clientHeight:t.clientWidth,r=o?t.scrollHeight:t.scrollWidth,i=Math.max(0,r-n),s=!o&&getComputedStyle(t).direction===`rtl`,c=e*n*.8*(s?-1:1),l=o?t.scrollTop:t.scrollLeft,u=Math.min(s?0:i,Math.max(s?-i:0,l+c));u!==l&&t.scrollTo({behavior:`smooth`,[o?`top`:`left`]:u})},[o]);if(!s)return(0,G.jsx)(EF,{...c,className:J(t,i?.tabList()),"data-slot":`tabs-list`,children:e});let{className:u,render:d,...f}=s;return(0,G.jsx)(EF,{...c,className:J(t,i?.tabList()),"data-slot":`tabs-list`,render:e=>{let{children:t,className:n,ref:s,...c}=e;return(0,G.jsxs)(K.div,{className:Y(i?.tabListContainer,u),"data-slot":`tabs-list-container`,render:d,...f,children:[(0,G.jsx)(VP,{ref:a,hideScrollBar:!0,className:Y(i?.scroller),orientation:r,size:64,children:(0,G.jsx)(`div`,{...c,ref:s,className:n,children:t})}),(0,G.jsx)(`button`,{"aria-label":o?`Scroll tabs up`:`Scroll tabs left`,className:Y(i?.scrollPrev),tabIndex:-1,type:`button`,onClick:()=>l(-1),children:o?(0,G.jsx)(xh,{}):(0,G.jsx)(Sh,{})}),(0,G.jsx)(`button`,{"aria-label":o?`Scroll tabs down`:`Scroll tabs right`,className:Y(i?.scrollNext),tabIndex:-1,type:`button`,onClick:()=>l(1),children:o?(0,G.jsx)(bh,{}):(0,G.jsx)(Ch,{})})]})},children:e})},IF=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(jF);return(0,G.jsx)(OF,{...n,className:J(t,r?.tab()),"data-slot":`tabs-tab`,children:e})},LF=Object.assign(NF,{Root:NF,ListContainer:PF,List:FF,Tab:IF,Indicator:({className:e,...t})=>{let{slots:n}=(0,v.use)(jF);return(0,G.jsx)(rb,{className:Y(n?.tabIndicator,e),"data-slot":`tabs-indicator`,...t})},Separator:({className:e,...t})=>{let{slots:n}=(0,v.use)(jF);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(n?.separator,e),"data-slot":`tabs-separator`,...t})},Panel:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(jF);return(0,G.jsx)(kF,{...n,className:J(t,r?.tabPanel()),"data-slot":`tabs-panel`,children:e})}}),RF={};RF={deselectedItem:e=>`${e.item} \u{63A}\u{64A}\u{631} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`,longPressToSelect:`اضغط مطولًا للدخول إلى وضع التحديد.`,select:`تحديد`,selectedAll:`جميع العناصر المحددة.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`لم يتم تحديد عناصر`,one:()=>`${t.number(e.count)} \u{639}\u{646}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}`,other:()=>`${t.number(e.count)} \u{639}\u{646}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}`})}.`,selectedItem:e=>`${e.item} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`};var zF={};zF={deselectedItem:e=>`${e.item} \u{43D}\u{435} \u{435} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}.`,longPressToSelect:`Натиснете и задръжте за да влезете в избирателен режим.`,select:`Изберете`,selectedAll:`Всички елементи са избрани.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Няма избрани елементи`,one:()=>`${t.number(e.count)} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}`,other:()=>`${t.number(e.count)} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{438} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}\u{438}`})}.`,selectedItem:e=>`${e.item} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}.`};var BF={};BF={deselectedItem:e=>`Polo\u{17E}ka ${e.item} nen\xed vybr\xe1na.`,longPressToSelect:`Dlouhým stisknutím přejdete do režimu výběru.`,select:`Vybrat`,selectedAll:`Vybrány všechny položky.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nevybrány žádné položky`,one:()=>`Vybr\xe1na ${t.number(e.count)} polo\u{17E}ka`,other:()=>`Vybr\xe1no ${t.number(e.count)} polo\u{17E}ek`})}.`,selectedItem:e=>`Vybr\xe1na polo\u{17E}ka ${e.item}.`};var VF={};VF={deselectedItem:e=>`${e.item} ikke valgt.`,longPressToSelect:`Lav et langt tryk for at aktivere valgtilstand.`,select:`Vælg`,selectedAll:`Alle elementer valgt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ingen elementer valgt`,one:()=>`${t.number(e.count)} element valgt`,other:()=>`${t.number(e.count)} elementer valgt`})}.`,selectedItem:e=>`${e.item} valgt.`};var HF={};HF={deselectedItem:e=>`${e.item} nicht ausgew\xe4hlt.`,longPressToSelect:`Gedrückt halten, um Auswahlmodus zu öffnen.`,select:`Auswählen`,selectedAll:`Alle Elemente ausgewählt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Keine Elemente ausgewählt`,one:()=>`${t.number(e.count)} Element ausgew\xe4hlt`,other:()=>`${t.number(e.count)} Elemente ausgew\xe4hlt`})}.`,selectedItem:e=>`${e.item} ausgew\xe4hlt.`};var UF={};UF={deselectedItem:e=>`\u{394}\u{3B5}\u{3BD} \u{3B5}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} \u{3C4}\u{3BF} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3BF} ${e.item}.`,longPressToSelect:`Πατήστε παρατεταμένα για να μπείτε σε λειτουργία επιλογής.`,select:`Επιλογή`,selectedAll:`Επιλέχθηκαν όλα τα στοιχεία.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Δεν επιλέχθηκαν στοιχεία`,one:()=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} ${t.number(e.count)} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3BF}`,other:()=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B1}\u{3BD} ${t.number(e.count)} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3B1}`})}.`,selectedItem:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} \u{3C4}\u{3BF} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3BF} ${e.item}.`};var WF={};WF={deselectedItem:e=>`${e.item} not selected.`,select:`Select`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`No items selected`,one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:`All items selected.`,selectedItem:e=>`${e.item} selected.`,longPressToSelect:`Long press to enter selection mode.`};var GF={};GF={deselectedItem:e=>`${e.item} no seleccionado.`,longPressToSelect:`Mantenga pulsado para abrir el modo de selección.`,select:`Seleccionar`,selectedAll:`Todos los elementos seleccionados.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ningún elemento seleccionado`,one:()=>`${t.number(e.count)} elemento seleccionado`,other:()=>`${t.number(e.count)} elementos seleccionados`})}.`,selectedItem:e=>`${e.item} seleccionado.`};var KF={};KF={deselectedItem:e=>`${e.item} pole valitud.`,longPressToSelect:`Valikurežiimi sisenemiseks vajutage pikalt.`,select:`Vali`,selectedAll:`Kõik üksused valitud.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Üksusi pole valitud`,one:()=>`${t.number(e.count)} \xfcksus valitud`,other:()=>`${t.number(e.count)} \xfcksust valitud`})}.`,selectedItem:e=>`${e.item} valitud.`};var qF={};qF={deselectedItem:e=>`Kohdetta ${e.item} ei valittu.`,longPressToSelect:`Siirry valintatilaan painamalla pitkään.`,select:`Valitse`,selectedAll:`Kaikki kohteet valittu.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ei yhtään kohdetta valittu`,one:()=>`${t.number(e.count)} kohde valittu`,other:()=>`${t.number(e.count)} kohdetta valittu`})}.`,selectedItem:e=>`${e.item} valittu.`};var JF={};JF={deselectedItem:e=>`${e.item} non s\xe9lectionn\xe9.`,longPressToSelect:`Appuyez de manière prolongée pour passer en mode de sélection.`,select:`Sélectionner`,selectedAll:`Tous les éléments sélectionnés.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Aucun élément sélectionné`,one:()=>`${t.number(e.count)} \xe9l\xe9ment s\xe9lectionn\xe9`,other:()=>`${t.number(e.count)} \xe9l\xe9ments s\xe9lectionn\xe9s`})}.`,selectedItem:e=>`${e.item} s\xe9lectionn\xe9.`};var YF={};YF={deselectedItem:e=>`${e.item} \u{5DC}\u{5D0} \u{5E0}\u{5D1}\u{5D7}\u{5E8}.`,longPressToSelect:`הקשה ארוכה לכניסה למצב בחירה.`,select:`בחר`,selectedAll:`כל הפריטים נבחרו.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`לא נבחרו פריטים`,one:()=>`\u{5E4}\u{5E8}\u{5D9}\u{5D8} ${t.number(e.count)} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`,other:()=>`${t.number(e.count)} \u{5E4}\u{5E8}\u{5D9}\u{5D8}\u{5D9}\u{5DD} \u{5E0}\u{5D1}\u{5D7}\u{5E8}\u{5D5}`})}.`,selectedItem:e=>`${e.item} \u{5E0}\u{5D1}\u{5D7}\u{5E8}.`};var XF={};XF={deselectedItem:e=>`Stavka ${e.item} nije odabrana.`,longPressToSelect:`Dugo pritisnite za ulazak u način odabira.`,select:`Odaberite`,selectedAll:`Odabrane su sve stavke.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nije odabrana nijedna stavka`,one:()=>`Odabrana je ${t.number(e.count)} stavka`,other:()=>`Odabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`Stavka ${e.item} je odabrana.`};var ZF={};ZF={deselectedItem:e=>`${e.item} nincs kijel\xf6lve.`,longPressToSelect:`Nyomja hosszan a kijelöléshez.`,select:`Kijelölés`,selectedAll:`Az összes elem kijelölve.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Egy elem sincs kijelölve`,one:()=>`${t.number(e.count)} elem kijel\xf6lve`,other:()=>`${t.number(e.count)} elem kijel\xf6lve`})}.`,selectedItem:e=>`${e.item} kijel\xf6lve.`};var QF={};QF={deselectedItem:e=>`${e.item} non selezionato.`,longPressToSelect:`Premi a lungo per passare alla modalità di selezione.`,select:`Seleziona`,selectedAll:`Tutti gli elementi selezionati.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nessun elemento selezionato`,one:()=>`${t.number(e.count)} elemento selezionato`,other:()=>`${t.number(e.count)} elementi selezionati`})}.`,selectedItem:e=>`${e.item} selezionato.`};var $F={};$F={deselectedItem:e=>`${e.item} \u{304C}\u{9078}\u{629E}\u{3055}\u{308C}\u{3066}\u{3044}\u{307E}\u{305B}\u{3093}\u{3002}`,longPressToSelect:`長押しして選択モードを開きます。`,select:`選択`,selectedAll:`すべての項目を選択しました。`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`項目が選択されていません`,one:()=>`${t.number(e.count)} \u{9805}\u{76EE}\u{3092}\u{9078}\u{629E}\u{3057}\u{307E}\u{3057}\u{305F}`,other:()=>`${t.number(e.count)} \u{9805}\u{76EE}\u{3092}\u{9078}\u{629E}\u{3057}\u{307E}\u{3057}\u{305F}`})}\u{3002}`,selectedItem:e=>`${e.item} \u{3092}\u{9078}\u{629E}\u{3057}\u{307E}\u{3057}\u{305F}\u{3002}`};var eI={};eI={deselectedItem:e=>`${e.item}\u{C774}(\u{AC00}) \u{C120}\u{D0DD}\u{B418}\u{C9C0} \u{C54A}\u{C558}\u{C2B5}\u{B2C8}\u{B2E4}.`,longPressToSelect:`선택 모드로 들어가려면 길게 누르십시오.`,select:`선택`,selectedAll:`모든 항목이 선택되었습니다.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`선택된 항목이 없습니다`,one:()=>`${t.number(e.count)}\u{AC1C} \u{D56D}\u{BAA9}\u{C774} \u{C120}\u{D0DD}\u{B418}\u{C5C8}\u{C2B5}\u{B2C8}\u{B2E4}`,other:()=>`${t.number(e.count)}\u{AC1C} \u{D56D}\u{BAA9}\u{C774} \u{C120}\u{D0DD}\u{B418}\u{C5C8}\u{C2B5}\u{B2C8}\u{B2E4}`})}.`,selectedItem:e=>`${e.item}\u{C774}(\u{AC00}) \u{C120}\u{D0DD}\u{B418}\u{C5C8}\u{C2B5}\u{B2C8}\u{B2E4}.`};var tI={};tI={deselectedItem:e=>`${e.item} nepasirinkta.`,longPressToSelect:`Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.`,select:`Pasirinkti`,selectedAll:`Pasirinkti visi elementai.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nepasirinktas nė vienas elementas`,one:()=>`Pasirinktas ${t.number(e.count)} elementas`,other:()=>`Pasirinkta element\u{173}: ${t.number(e.count)}`})}.`,selectedItem:e=>`Pasirinkta: ${e.item}.`};var nI={};nI={deselectedItem:e=>`Vienums ${e.item} nav atlas\u{12B}ts.`,longPressToSelect:`Ilgi turiet nospiestu. lai ieslēgtu atlases režīmu.`,select:`Atlasīt`,selectedAll:`Atlasīti visi vienumi.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nav atlasīts neviens vienums`,one:()=>`Atlas\u{12B}to vienumu skaits: ${t.number(e.count)}`,other:()=>`Atlas\u{12B}to vienumu skaits: ${t.number(e.count)}`})}.`,selectedItem:e=>`Atlas\u{12B}ts vienums ${e.item}.`};var rI={};rI={deselectedItem:e=>`${e.item} er ikke valgt.`,longPressToSelect:`Bruk et langt trykk for å gå inn i valgmodus.`,select:`Velg`,selectedAll:`Alle elementer er valgt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ingen elementer er valgt`,one:()=>`${t.number(e.count)} element er valgt`,other:()=>`${t.number(e.count)} elementer er valgt`})}.`,selectedItem:e=>`${e.item} er valgt.`};var iI={};iI={deselectedItem:e=>`${e.item} niet geselecteerd.`,longPressToSelect:`Druk lang om de selectiemodus te openen.`,select:`Selecteren`,selectedAll:`Alle items geselecteerd.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Geen items geselecteerd`,one:()=>`${t.number(e.count)} item geselecteerd`,other:()=>`${t.number(e.count)} items geselecteerd`})}.`,selectedItem:e=>`${e.item} geselecteerd.`};var aI={};aI={deselectedItem:e=>`Nie zaznaczono ${e.item}.`,longPressToSelect:`Naciśnij i przytrzymaj, aby wejść do trybu wyboru.`,select:`Zaznacz`,selectedAll:`Wszystkie zaznaczone elementy.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nie zaznaczono żadnych elementów`,one:()=>`${t.number(e.count)} zaznaczony element`,other:()=>`${t.number(e.count)} zaznaczonych element\xf3w`})}.`,selectedItem:e=>`Zaznaczono ${e.item}.`};var oI={};oI={deselectedItem:e=>`${e.item} n\xe3o selecionado.`,longPressToSelect:`Mantenha pressionado para entrar no modo de seleção.`,select:`Selecionar`,selectedAll:`Todos os itens selecionados.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nenhum item selecionado`,one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var sI={};sI={deselectedItem:e=>`${e.item} n\xe3o selecionado.`,longPressToSelect:`Prima continuamente para entrar no modo de seleção.`,select:`Selecionar`,selectedAll:`Todos os itens selecionados.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nenhum item selecionado`,one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var cI={};cI={deselectedItem:e=>`${e.item} neselectat.`,longPressToSelect:`Apăsați lung pentru a intra în modul de selectare.`,select:`Selectare`,selectedAll:`Toate elementele selectate.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Niciun element selectat`,one:()=>`${t.number(e.count)} element selectat`,other:()=>`${t.number(e.count)} elemente selectate`})}.`,selectedItem:e=>`${e.item} selectat.`};var lI={};lI={deselectedItem:e=>`${e.item} \u{43D}\u{435} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`,longPressToSelect:`Нажмите и удерживайте для входа в режим выбора.`,select:`Выбрать`,selectedAll:`Выбраны все элементы.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Нет выбранных элементов`,one:()=>`${t.number(e.count)} \u{44D}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}`,other:()=>`${t.number(e.count)} \u{44D}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}\u{43E}\u{432} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E}`})}.`,selectedItem:e=>`${e.item} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`};var uI={};uI={deselectedItem:e=>`Nevybrat\xe9 polo\u{17E}ky: ${e.item}.`,longPressToSelect:`Dlhším stlačením prejdite do režimu výberu.`,select:`Vybrať`,selectedAll:`Všetky vybraté položky.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Žiadne vybraté položky`,one:()=>`${t.number(e.count)} vybrat\xe1 polo\u{17E}ka`,other:()=>`Po\u{10D}et vybrat\xfdch polo\u{17E}iek:${t.number(e.count)}`})}.`,selectedItem:e=>`Vybrat\xe9 polo\u{17E}ky: ${e.item}.`};var dI={};dI={deselectedItem:e=>`Element ${e.item} ni izbran.`,longPressToSelect:`Za izbirni način pritisnite in dlje časa držite.`,select:`Izberite`,selectedAll:`Vsi elementi so izbrani.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Noben element ni izbran`,one:()=>`${t.number(e.count)} element je izbran`,other:()=>`${t.number(e.count)} elementov je izbranih`})}.`,selectedItem:e=>`Element ${e.item} je izbran.`};var fI={};fI={deselectedItem:e=>`${e.item} nije izabrano.`,longPressToSelect:`Dugo pritisnite za ulazak u režim biranja.`,select:`Izaberite`,selectedAll:`Izabrane su sve stavke.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nije izabrana nijedna stavka`,one:()=>`Izabrana je ${t.number(e.count)} stavka`,other:()=>`Izabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`${e.item} je izabrano.`};var pI={};pI={deselectedItem:e=>`${e.item} ej markerat.`,longPressToSelect:`Tryck länge när du vill öppna väljarläge.`,select:`Markera`,selectedAll:`Alla markerade objekt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Inga markerade objekt`,one:()=>`${t.number(e.count)} markerat objekt`,other:()=>`${t.number(e.count)} markerade objekt`})}.`,selectedItem:e=>`${e.item} markerat.`};var mI={};mI={deselectedItem:e=>`${e.item} se\xe7ilmedi.`,longPressToSelect:`Seçim moduna girmek için uzun basın.`,select:`Seç`,selectedAll:`Tüm ögeler seçildi.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Hiçbir öge seçilmedi`,one:()=>`${t.number(e.count)} \xf6ge se\xe7ildi`,other:()=>`${t.number(e.count)} \xf6ge se\xe7ildi`})}.`,selectedItem:e=>`${e.item} se\xe7ildi.`};var hI={};hI={deselectedItem:e=>`${e.item} \u{43D}\u{435} \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`,longPressToSelect:`Виконайте довге натиснення, щоб перейти в режим вибору.`,select:`Вибрати`,selectedAll:`Усі елементи вибрано.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Жодних елементів не вибрано`,one:()=>`${t.number(e.count)} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442} \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}`,other:()=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}\u{456}\u{432}: ${t.number(e.count)}`})}.`,selectedItem:e=>`${e.item} \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`};var gI={};gI={deselectedItem:e=>`\u{672A}\u{9009}\u{62E9} ${e.item}\u{3002}`,longPressToSelect:`长按以进入选择模式。`,select:`选择`,selectedAll:`已选择所有项目。`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`未选择项目`,one:()=>`\u{5DF2}\u{9009}\u{62E9} ${t.number(e.count)} \u{4E2A}\u{9879}\u{76EE}`,other:()=>`\u{5DF2}\u{9009}\u{62E9} ${t.number(e.count)} \u{4E2A}\u{9879}\u{76EE}`})}\u{3002}`,selectedItem:e=>`\u{5DF2}\u{9009}\u{62E9} ${e.item}\u{3002}`};var _I={};_I={deselectedItem:e=>`\u{672A}\u{9078}\u{53D6}\u{300C}${e.item}\u{300D}\u{3002}`,longPressToSelect:`長按以進入選擇模式。`,select:`選取`,selectedAll:`已選取所有項目。`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`未選取任何項目`,one:()=>`\u{5DF2}\u{9078}\u{53D6} ${t.number(e.count)} \u{500B}\u{9805}\u{76EE}`,other:()=>`\u{5DF2}\u{9078}\u{53D6} ${t.number(e.count)} \u{500B}\u{9805}\u{76EE}`})}\u{3002}`,selectedItem:e=>`\u{5DF2}\u{9078}\u{53D6}\u{300C}${e.item}\u{300D}\u{3002}`};var vI={};vI={"ar-AE":RF,"bg-BG":zF,"cs-CZ":BF,"da-DK":VF,"de-DE":HF,"el-GR":UF,"en-US":WF,"es-ES":GF,"et-EE":KF,"fi-FI":qF,"fr-FR":JF,"he-IL":YF,"hr-HR":XF,"hu-HU":ZF,"it-IT":QF,"ja-JP":$F,"ko-KR":eI,"lt-LT":tI,"lv-LV":nI,"nb-NO":rI,"nl-NL":iI,"pl-PL":aI,"pt-BR":oI,"pt-PT":sI,"ro-RO":cI,"ru-RU":lI,"sk-SK":uI,"sl-SI":dI,"sr-SP":fI,"sv-SE":pI,"tr-TR":mI,"uk-UA":hI,"zh-CN":gI,"zh-TW":_I};function yI(e){return e&&e.__esModule?e.default:e}function bI(e,t){let{getRowText:n=e=>t.collection.getTextValue?.(e)??t.collection.getItem(e)?.textValue}=e,r=rv(yI(vI),`@react-aria/grid`),i=t.selectionManager.rawSelection,a=(0,v.useRef)(i),o=(0,v.useCallback)(()=>{if(!t.selectionManager.isFocused||i===a.current){a.current=i;return}let e=xI(i,a.current),o=xI(a.current,i),s=t.selectionManager.selectionBehavior===`replace`,c=[];if(t.selectionManager.selectedKeys.size===1&&s){let e=t.selectionManager.selectedKeys.keys().next().value;if(e!=null&&t.collection.getItem(e)){let t=n(e);t&&c.push(r.format(`selectedItem`,{item:t}))}}else if(e.size===1&&o.size===0){let t=e.keys().next().value;if(t!=null){let e=n(t);e&&c.push(r.format(`selectedItem`,{item:e}))}}else if(o.size===1&&e.size===0){let e=o.keys().next().value;if(e!=null&&t.collection.getItem(e)){let t=n(e);t&&c.push(r.format(`deselectedItem`,{item:t}))}}t.selectionManager.selectionMode===`multiple`&&(c.length===0||i===`all`||i.size>1||a.current===`all`||a.current?.size>1)&&c.push(i===`all`?r.format(`selectedAll`):r.format(`selectedCount`,{count:i.size})),c.length>0&&Op(c.join(` `)),a.current=i},[i,t.selectionManager.selectedKeys,t.selectionManager.isFocused,t.selectionManager.selectionBehavior,t.selectionManager.selectionMode,t.collection,n,r]);zs(()=>{if(t.selectionManager.isFocused)o();else{let e=requestAnimationFrame(o);return()=>cancelAnimationFrame(e)}},[i,t.selectionManager.isFocused])}function xI(e,t){let n=new Set;if(e===`all`||t===`all`)return n;for(let r of e.keys())t.has(r)||n.add(r);return n}function SI(e){return e&&e.__esModule?e.default:e}function CI(e){let t=rv(SI(vI),`@react-aria/grid`),n=rm(),r=(n===`pointer`||n===`virtual`||n==null)&&typeof window<`u`&&`ontouchstart`in window;return tc((0,v.useMemo)(()=>{let n=e.selectionManager.selectionMode,i=e.selectionManager.selectionBehavior,a;return r&&(a=t.format(`longPressToSelect`)),i===`replace`&&n!==`none`&&e.hasItemActions?a:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,r]))}var wI=Object.assign(YP,{Root:YP,Separator:XP}),TI=(0,v.createContext)({}),EI=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,TI);let{toolbarProps:n}=ww(e,t),r=Mf({...e,values:{orientation:e.orientation||`horizontal`},defaultClassName:`react-aria-Toolbar`}),i=W(e,{global:!0});return delete i.id,v.createElement(q.div,{...U(i,r,n),ref:t,slot:e.slot||void 0,"data-orientation":e.orientation||`horizontal`},r.children)}),DI=({children:e,className:t,isAttached:n,orientation:r=`horizontal`,...i})=>{let a=v.useMemo(()=>Of({isAttached:n,orientation:r}),[n,r]);return(0,G.jsx)(Ow.Provider,{value:{orientation:r},children:(0,G.jsx)(ab.Provider,{value:{orientation:r===`horizontal`?`vertical`:`horizontal`},children:(0,G.jsx)(EI,{className:J(t,a),"data-slot":`toolbar`,orientation:r,...i,children:e})})})};DI.displayName=`HeroUI.Toolbar`;var OI=Object.assign(DI,{Root:DI}),kI=v.createContext(null);function AI(e){let{children:t}=e,n=(0,v.useContext)(kI),[r,i]=(0,v.useState)(0),a=(0,v.useMemo)(()=>({parent:n,modalCount:r,addModal(){i(e=>e+1),n&&n.addModal()},removeModal(){i(e=>e-1),n&&n.removeModal()}}),[n,r]);return v.createElement(kI.Provider,{value:a},t)}function jI(){let e=(0,v.useContext)(kI);return{modalProviderProps:{"aria-hidden":e&&e.modalCount>0?!0:void 0}}}function MI(e){let{modalProviderProps:t}=jI();return v.createElement(`div`,{"data-overlay-container":!0,...e,...t})}function NI(e){return v.createElement(AI,null,v.createElement(MI,e))}function PI(e){let t=Jo(),{portalContainer:n=t?null:document.body,...r}=e,{getContainer:i}=fv();if(!e.portalContainer&&i&&(n=i()),v.useEffect(()=>{if(n?.closest(`[data-overlay-container]`))throw Error(`An OverlayContainer must not be inside another container. Please change the portalContainer prop.`)},[n]),!n)return null;let a=v.createElement(NI,r);return dc.createPortal(a,n)}var FI=1500,II=500,LI={},RI=0,zI=!1,BI=null,VI=null;function HI(e={}){let{delay:t=FI,closeDelay:n=II}=e,{isOpen:r,open:i,close:a}=gv(e),[o,s]=(0,v.useState)(!1),c=(0,v.useMemo)(()=>`${++RI}`,[]),l=(0,v.useRef)(null),u=(0,v.useRef)(a),d=()=>{LI[c]=m},f=()=>{for(let e in LI)e!==c&&(LI[e](!0,!0),delete LI[e])},p=e=>{l.current&&clearTimeout(l.current),l.current=null,f(),d(),s(!!e),zI=!0,i(),BI&&=(clearTimeout(BI),null),VI&&=(clearTimeout(VI),null)},m=(e,t)=>{s(!!t),e||n<=0?(l.current&&clearTimeout(l.current),l.current=null,u.current()):l.current||=setTimeout(()=>{l.current=null,u.current()},n),BI&&=(clearTimeout(BI),null),zI&&(VI&&clearTimeout(VI),VI=setTimeout(()=>{delete LI[c],VI=null,zI=!1},Math.max(II,n)))},h=()=>{f(),d(),!r&&!zI?(BI&&clearTimeout(BI),BI=setTimeout(()=>{BI=null,zI=!0,p(!1)},t)):r||p(!0)};return(0,v.useEffect)(()=>{u.current=a},[a]),(0,v.useEffect)(()=>()=>{l.current&&clearTimeout(l.current),LI[c]&&delete LI[c]},[c]),{isOpen:r,shouldSkipAnimation:o,open:e=>{!e&&t>0&&!l.current?h():p(zI)},close:m}}function UI(e,t){let n=W(e,{labelable:!0}),{hoverProps:r}=eh({onHoverStart:()=>t?.open(!0),onHoverEnd:()=>t?.close()});return{tooltipProps:U(n,r,{role:`tooltip`})}}function WI(e,t,n){let{isDisabled:r,trigger:i,shouldCloseOnPress:a=!0}=e,o=es(),s=(0,v.useRef)(!1),c=(0,v.useRef)(!1),l=()=>{(s.current||c.current)&&t.open(c.current)},u=e=>{!s.current&&!c.current&&t.close(e)};(0,v.useEffect)(()=>{let e=e=>{n&&n.current&&e.key===`Escape`&&(e.stopPropagation(),t.close(!0))};if(t.isOpen)return document.addEventListener(`keydown`,e,!0),()=>{document.removeEventListener(`keydown`,e,!0)}},[n,t]);let d=()=>{i!==`focus`&&(em()===`pointer`?s.current=!0:s.current=!1,l())},f=()=>{i!==`focus`&&(c.current=!1,s.current=!1,u())},p=()=>{a&&(c.current=!1,s.current=!1,u(!0))},m=()=>{$p()&&(c.current=!0,l())},h=()=>{c.current=!1,s.current=!1,u(!0)},{hoverProps:g}=eh({isDisabled:r,onHoverStart:d,onHoverEnd:f}),{focusableProps:_}=Em({isDisabled:r,onFocus:m,onBlur:h},n);return{triggerProps:{"aria-describedby":t.isOpen?o:void 0,...U(_,g,{onPointerDown:p,onKeyDown:p}),tabIndex:void 0},tooltipProps:{id:o}}}var GI=(0,v.createContext)(null),KI=(0,v.createContext)(null);function qI(e){let t=HI(e),n=(0,v.useRef)(null),{triggerProps:r,tooltipProps:i}=WI(e,t,n);return v.createElement(jf,{values:[[GI,t],[KI,{...i,triggerRef:n}]]},v.createElement(Tm,{...r,ref:n},e.children))}var JI=(0,v.forwardRef)(function({UNSTABLE_portalContainer:e,...t},n){[t,n]=Ff(t,n,KI);let r=(0,v.useContext)(GI),i=HI(t),a=t.isOpen!=null||t.defaultOpen!=null||!r?i:r,o=pc(n,a.isOpen),s=t.isExiting||!a.shouldSkipAnimation&&o||!1;return!a.isOpen&&!s?null:v.createElement(PI,{portalContainer:e},v.createElement(YI,{...t,tooltipRef:n,isExiting:s}))});function YI(e){let t=(0,v.useContext)(GI),n=(0,v.useRef)(null),{overlayProps:r,arrowProps:i,placement:a,triggerAnchorPoint:o}=gg({placement:e.placement||`top`,targetRef:e.triggerRef,overlayRef:e.tooltipRef,arrowRef:n,offset:e.offset,crossOffset:e.crossOffset,isOpen:t.isOpen,arrowBoundaryOffset:e.arrowBoundaryOffset,shouldFlip:e.shouldFlip,containerPadding:e.containerPadding,onClose:()=>t.close(!0)}),s=fc(e.tooltipRef,!!a),c=e.isEntering||!t.shouldSkipAnimation&&s||!1,l=Mf({...e,defaultClassName:`react-aria-Tooltip`,values:{placement:a,isEntering:c,isExiting:e.isExiting,state:t}});e=U(e,r);let{tooltipProps:u}=UI(e,t),d=W(e,{global:!0});return v.createElement(q.div,{...U(d,l,u),ref:e.tooltipRef,style:{...r.style,"--trigger-anchor-point":o?`${o.x}px ${o.y}px`:void 0,...l.style},"data-placement":a??void 0,"data-entering":c||void 0,"data-exiting":e.isExiting||void 0},v.createElement(Lh.Provider,{value:{...i,placement:a,ref:n}},l.children))}var XI=e=>{if(!e)return;let t=e.trim(),n=parseFloat(t);if(!Number.isNaN(n))return t.endsWith(`ms`)?n:t.endsWith(`s`)?n*1e3:n},ZI=(0,v.createContext)({}),QI=({children:e,shouldSkipAnimation:t})=>{let n=(0,v.use)(GI);return!n||t?e:(0,G.jsx)(GI,{value:{...n,shouldSkipAnimation:!1},children:e})},$I=({children:e,closeDelay:t,delay:n,shouldSkipAnimation:r=!1,...i})=>{let a=v.useMemo(()=>kf(),[]),o=GP(`--tooltip-delay`),s=GP(`--tooltip-close-delay`),c=n??XI(o),l=t??XI(s);return(0,G.jsx)(ZI,{value:{slots:a},children:(0,G.jsx)(qI,{closeDelay:l,"data-slot":`tooltip-root`,delay:c,...i,children:(0,G.jsx)(QI,{shouldSkipAnimation:r,children:e})})})},eL=Object.assign($I,{Root:$I,Trigger:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(ZI),i=(0,v.useRef)(null),{focusableProps:a}=Em({},i);return(0,G.jsx)(K.div,{ref:i,className:Y(r?.trigger,t),"data-slot":`tooltip-trigger`,role:`button`,...U(a,n),children:e})},Content:({children:e,className:t,offset:n,showArrow:r=!1,...i})=>{let{slots:a}=(0,v.use)(ZI),o=n||(r?7:3);return(0,G.jsx)(JI,{...i,className:J(t,a?.base()),offset:o,children:e})},Arrow:({children:e,className:t,...n})=>{let r=(0,G.jsx)(`svg`,{"data-slot":`overlay-arrow`,fill:`none`,height:`12`,viewBox:`0 0 12 12`,width:`12`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M0 0C5.48483 8 6.5 8 12 0Z`})}),i=v.isValidElement(e)?v.cloneElement(e,{"data-slot":`overlay-arrow`}):r;return(0,G.jsx)(Rh,{"data-slot":`tooltip-arrow`,...n,className:t,children:i})}}),tL=(0,v.createContext)({}),nL=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i},rL=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,tL);let{hoverProps:n,isHovered:r}=eh(e),{isFocused:i,isFocusVisible:a,focusProps:o}=Jm({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,c=Mf({...e,values:{isHovered:r,isFocused:i,isFocusVisible:a,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:`react-aria-TextArea`});return v.createElement(q.textarea,{...U(nL(e),o,n),...c,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":a||void 0,"data-invalid":s||void 0})}),iL=(0,v.createContext)(null),aL=Hf(function(e,t){[e,t]=Ff(e,t,iL);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,i=(0,v.useRef)(null);[e,i]=Ff(e,i,Yy);let[a,o]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),[s,c]=(0,v.useState)(`input`),{labelProps:l,inputProps:u,descriptionProps:d,errorMessageProps:f,...p}=mT({...Lf(e),inputElementType:s,label:o,validationBehavior:r},i),m=(0,v.useCallback)(e=>{i.current=e,e&&c(e instanceof HTMLTextAreaElement?`textarea`:`input`)},[i]),h=Mf({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:p.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TextField`}),g=W(e,{global:!0});return delete g.id,v.createElement(q.div,{...g,...h,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":p.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},v.createElement(jf,{values:[[Wf,{...l,ref:a}],[dT,{...u,ref:m}],[tL,{...u,ref:m}],[ES,{role:`presentation`,isInvalid:p.isInvalid,isDisabled:e.isDisabled||!1}],[sb,{slots:{description:d,errorMessage:f}}],[OS,p]]},h.children))}),oL=(0,v.createContext)({}),sL=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=v.useMemo(()=>Cf({fullWidth:n}),[n]);return(0,G.jsx)(aL,{"data-slot":`textfield`,...i,className:J(t,a),children:t=>(0,G.jsx)(oL,{value:{variant:r},children:(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})},cL=({className:e,fullWidth:t,variant:n,...r})=>{let i=(0,v.use)(oL),a=(0,v.use)(ZE),o=n??i.variant??a.variant;return(0,G.jsx)(pT,{className:J(e,nf({fullWidth:t,variant:o})),"data-slot":`input`,...r})},lL=Object.assign(cL,{Root:cL}),uL=(0,v.createContext)({}),dL=({children:e,className:t,fullWidth:n,onClick:r,variant:i,...a})=>{let o=(0,v.use)(oL),s=i??o?.variant,c=v.useRef(null),l=v.useMemo(()=>rf({fullWidth:n,variant:s}),[n,s]),u=e=>{let t=e.target,n=c.current?.querySelector(`input`);n&&t!==n&&!n.contains(t)&&n.focus(),r?.(e)};return(0,G.jsx)(uL,{value:{slots:l},children:(0,G.jsx)(DS,{...a,ref:c,className:J(t,l?.base()),"data-slot":`input-group`,onClick:u,children:t=>typeof e==`function`?e(t):e})})},fL=Object.assign(dL,{Root:dL,Input:({className:e,...t})=>{let{slots:n}=(0,v.use)(uL);return(0,G.jsx)(pT,{className:J(e,n?.input()),"data-slot":`input-group-input`,...t})},TextArea:({className:e,...t})=>{let{slots:n}=(0,v.use)(uL);return(0,G.jsx)(rL,{className:J(e,n?.input()),"data-slot":`input-group-textarea`,...t})},Prefix:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(uL);return(0,G.jsx)(`div`,{className:Y(r?.prefix,t),"data-slot":`input-group-prefix`,...n,children:e})},Suffix:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(uL);return(0,G.jsx)(`div`,{className:Y(r?.suffix,t),"data-slot":`input-group-suffix`,...n,children:e})}}),pL=({className:e,fullWidth:t,variant:n,...r})=>{let i=(0,v.use)(oL),a=n??i?.variant;return(0,G.jsx)(rL,{"data-slot":`textarea`,className:J(e,wf({fullWidth:t,variant:a})),...r})},mL=Object.assign(pL,{Root:pL}),hL=Object.assign(sL,{Root:sL}),gL={};gL={"Clear search":`مسح البحث`};var _L={};_L={"Clear search":`Изчистване на търсене`};var vL={};vL={"Clear search":`Vymazat hledání`};var yL={};yL={"Clear search":`Ryd søgning`};var bL={};bL={"Clear search":`Suche zurücksetzen`};var xL={};xL={"Clear search":`Απαλοιφή αναζήτησης`};var SL={};SL={"Clear search":`Clear search`};var CL={};CL={"Clear search":`Borrar búsqueda`};var wL={};wL={"Clear search":`Tühjenda otsing`};var TL={};TL={"Clear search":`Tyhjennä haku`};var EL={};EL={"Clear search":`Effacer la recherche`};var DL={};DL={"Clear search":`נקה חיפוש`};var OL={};OL={"Clear search":`Obriši pretragu`};var kL={};kL={"Clear search":`Keresés törlése`};var AL={};AL={"Clear search":`Cancella ricerca`};var jL={};jL={"Clear search":`検索をクリア`};var ML={};ML={"Clear search":`검색 지우기`};var NL={};NL={"Clear search":`Išvalyti iešką`};var PL={};PL={"Clear search":`Notīrīt meklēšanu`};var FL={};FL={"Clear search":`Tøm søk`};var IL={};IL={"Clear search":`Zoekactie wissen`};var LL={};LL={"Clear search":`Wyczyść zawartość wyszukiwania`};var RL={};RL={"Clear search":`Limpar pesquisa`};var zL={};zL={"Clear search":`Limpar pesquisa`};var BL={};BL={"Clear search":`Ştergeţi căutarea`};var VL={};VL={"Clear search":`Очистить поиск`};var HL={};HL={"Clear search":`Vymazať vyhľadávanie`};var UL={};UL={"Clear search":`Počisti iskanje`};var WL={};WL={"Clear search":`Obriši pretragu`};var GL={};GL={"Clear search":`Rensa sökning`};var KL={};KL={"Clear search":`Aramayı temizle`};var qL={};qL={"Clear search":`Очистити пошук`};var JL={};JL={"Clear search":`清除搜索`};var YL={};YL={"Clear search":`清除搜尋條件`};var XL={};XL={"ar-AE":gL,"bg-BG":_L,"cs-CZ":vL,"da-DK":yL,"de-DE":bL,"el-GR":xL,"en-US":SL,"es-ES":CL,"et-EE":wL,"fi-FI":TL,"fr-FR":EL,"he-IL":DL,"hr-HR":OL,"hu-HU":kL,"it-IT":AL,"ja-JP":jL,"ko-KR":ML,"lt-LT":NL,"lv-LV":PL,"nb-NO":FL,"nl-NL":IL,"pl-PL":LL,"pt-BR":RL,"pt-PT":zL,"ro-RO":BL,"ru-RU":VL,"sk-SK":HL,"sl-SI":UL,"sr-SP":WL,"sv-SE":GL,"tr-TR":KL,"uk-UA":qL,"zh-CN":JL,"zh-TW":YL};function ZL(e){return e&&e.__esModule?e.default:e}function QL(e,t,n){let r=rv(ZL(XL),`@react-aria/searchfield`),{isDisabled:i,isReadOnly:a,onSubmit:o,onClear:s,type:c=`search`}=e,{keyboardProps:l}=Sm({isDisabled:i||a,shortcuts:{Enter:()=>{if(o){o(t.value);return}return!1},Escape:()=>{if(t.value===``&&(!n.current||n.current.value===``))return!1;t.setValue(``),s?.()}}}),u=()=>{t.setValue(``),s&&s()},d=()=>{n.current?.focus()},{labelProps:f,inputProps:p,descriptionProps:m,errorMessageProps:h,...g}=mT({...e,value:t.value,onChange:t.setValue,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,type:c},n);return{labelProps:f,inputProps:U(l,{...p,defaultValue:void 0}),clearButtonProps:{"aria-label":r.format(`Clear search`),excludeFromTabOrder:!0,preventFocusOnPress:!0,isDisabled:i||a,onPress:u,onPressStart:d},descriptionProps:m,errorMessageProps:h,...g}}function $L(e){let[t,n]=sh(eR(e.value),eR(e.defaultValue)||``,e.onChange);return{value:t,setValue:n}}function eR(e){if(e!=null)return e.toString()}var tR=(0,v.createContext)(null),nR=Hf(function(e,t){[e,t]=Ff(e,t,tR);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,i=(0,v.useRef)(null);[e,i]=Ff(e,i,Yy);let[a,o]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),s=$L({...e,validationBehavior:r}),{labelProps:c,inputProps:l,clearButtonProps:u,descriptionProps:d,errorMessageProps:f,...p}=QL({...Lf(e),label:o,validationBehavior:r},s,i),m=Mf({...e,values:{isEmpty:s.value===``,isDisabled:e.isDisabled||!1,isInvalid:p.isInvalid||!1,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1,state:s},defaultClassName:`react-aria-SearchField`}),h=W(e,{global:!0});return delete h.id,v.createElement(q.div,{...h,...m,ref:t,slot:e.slot||void 0,"data-empty":s.value===``||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":p.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},v.createElement(jf,{values:[[Wf,{...c,ref:a}],[dT,{...l,ref:i}],[th,u],[sb,{slots:{description:d,errorMessage:f}}],[ES,{isInvalid:p.isInvalid,isDisabled:e.isDisabled||!1}],[OS,p]]},m.children))}),rR=(0,v.createContext)({}),iR=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=v.useMemo(()=>gf({fullWidth:n,variant:r}),[n,r]);return(0,G.jsx)(rR,{value:{slots:a},children:(0,G.jsx)(nR,{"data-slot":`search-field`,...i,className:J(t,a?.base()),children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})},aR=Object.assign(iR,{Root:iR,Group:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rR);return(0,G.jsx)(DS,{className:J(t,r?.group()),"data-slot":`search-field-group`,...n,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})},Input:({className:e,...t})=>{let{slots:n}=(0,v.use)(rR);return(0,G.jsx)(pT,{className:J(e,n?.input()),"data-slot":`search-field-input`,...t})},SearchIcon:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rR);return e&&v.isValidElement(e)?v.cloneElement(e,{...n,className:Y(r?.searchIcon,t),"data-slot":`search-field-search-icon`}):(0,G.jsx)(jh,{className:Y(r?.searchIcon,t),"data-slot":`search-field-search-icon`,...n})},ClearButton:({className:e,...t})=>{let{slots:n}=(0,v.use)(rR);return(0,G.jsx)(xS,{className:J(e,n?.clearButton()),"data-slot":`search-field-clear-button`,slot:`clear`,...t})}}),oR=({children:e,className:t,isDisabled:n,isInvalid:r,isRequired:i,...a})=>(0,G.jsx)(Gf,{className:af({isRequired:i,isDisabled:n,isInvalid:r,className:t}),"data-slot":`label`,...a,children:e}),sR=Object.assign(oR,{Root:oR}),cR=({children:e,className:t,...n})=>_w(`description`)?(0,G.jsx)(cb,{className:Qd({className:t}),"data-slot":`description`,slot:`description`,...n,children:e}):null,lR=Object.assign(cR,{Root:cR}),uR=({children:e,className:t,...n})=>(0,G.jsx)(K.div,{className:tf({className:t}),"data-slot":`empty-state`,...n,children:e||`No results found`}),dR=Object.assign(uR,{Root:uR});function fR(e){return e&&e.__esModule?e.default:e}function pR(e,t){let{key:n}=e,r=t.selectionManager,i=es(),a=!t.selectionManager.canSelectItem(n),o=t.selectionManager.isSelected(n);return{checkboxProps:{id:i,"aria-label":rv(fR(vI),`@react-aria/grid`).format(`select`),isSelected:o,isDisabled:a,onChange:()=>r.toggleSelection(n)}}}for(var mR=(0,v.createContext)(null),hR=(0,v.createContext)(null),gR=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,mR);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,{locale:i}=rp(),a=VE({...e,locale:i,validationBehavior:r}),o=(0,v.useRef)(null),[s,c]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),{labelProps:l,groupProps:u,inputProps:d,incrementButtonProps:f,decrementButtonProps:p,descriptionProps:m,errorMessageProps:h,...g}=RE({...Lf(e),label:c,validationBehavior:r},a,o),_=Mf({...e,values:{state:a,isDisabled:e.isDisabled||!1,isInvalid:g.isInvalid||!1,isRequired:e.isRequired||!1,isReadOnly:e.isReadOnly||!1},defaultClassName:`react-aria-NumberField`}),y=W(e,{global:!0});return delete y.id,v.createElement(jf,{values:[[hR,a],[ES,u],[dT,{...d,ref:o}],[Wf,{...l,ref:s}],[th,{slots:{increment:f,decrement:p}}],[sb,{slots:{description:m,errorMessage:h}}],[OS,g]]},v.createElement(q.div,{...y,..._,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-invalid":g.isInvalid||void 0}),e.name&&v.createElement(`input`,{type:`hidden`,name:e.name,form:e.form,value:isNaN(a.numberValue)?``:a.numberValue,disabled:e.isDisabled||void 0}))}),_R=10,vR=5,yR=class{setup(e,t,n){this.delegate=e,this.state=t,this.direction=n}getDropTargetFromPoint(e,t,n){let r=this.delegate.getDropTargetFromPoint(e,t,n);return!r||r.type===`root`?r:this.resolveDropTarget(r,e,t,n)}resolveDropTarget(e,t,n,r){let i=this.pointerTracking,a=n-i.lastY,o=t-i.lastX,s=i.yDirection,c=i.xDirection;if(Math.abs(a)>vR&&(s=a>0?`down`:`up`,i.yDirection=s,i.lastY=n),Math.abs(o)>_R&&(c=o>0?`right`:`left`,i.xDirection=c,i.lastX=t),e.dropPosition===`before`){let t=this.state.collection.getKeyBefore(e.key);for(;t!=null;){let e=this.state.collection.getItem(t);if(e?.type===`item`)break;t=e?.parentKey??null}if(t!=null){let n={type:`item`,key:t,dropPosition:`after`};r(n)&&(e=n)}}let l=this.getPotentialTargets(e,r);if(l.length===0)return{type:`root`};let u;return l.length>1?u=this.selectTarget(l,e,t,n,s,c):(u=l[0],i.boundaryContext=null),u}getPotentialTargets(e,t){if(e.dropPosition===`on`)return[e];let n=e,r=this.state.collection,i=r.getItem(n.key);for(;i&&i?.type!==`item`&&i.nextKey!=null;)n.key=i.nextKey,i=r.getItem(i.nextKey);let a=[n];if(i&&i.hasChildNodes&&this.state.expandedKeys.has(i.key)&&r.getChildren&&n.dropPosition===`after`){let e=i.firstChildKey==null?null:r.getItem(i.firstChildKey);for(;e&&e.type!==`item`;)e=e.nextKey==null?null:r.getItem(e.nextKey);if(e?.type===`item`){let n={type:`item`,key:e.key,dropPosition:`before`};return t(n)?[n]:[]}}if(i?.nextKey!=null)return[e];let o=i?.parentKey,s=[];for(;o!=null;){let e=r.getItem(o),n=e?.nextKey==null?null:r.getItem(e.nextKey);if(!n||n.parentKey!==o){let e={type:`item`,key:o,dropPosition:`after`};if(t(e)&&s.push(e),n)break}o=e?.parentKey}if(s.length>0&&a.push(...s),a.length===1){let e=r.getKeyAfter(n.key),a=e==null?null:r.getItem(e);if(e!=null&&a&&i&&a.level!=null&&i.level!=null&&a.level>i.level){let n={type:`item`,key:e,dropPosition:`before`};if(t(n))return[n]}}return a.filter(t)}selectTarget(e,t,n,r,i,a){if(e.length<2)return e[0];let o=this.pointerTracking,s=this.state.collection.getItem(t.key)?.parentKey;if(s==null)return e[0];(!o.boundaryContext||o.boundaryContext.parentKey!==s)&&(o.boundaryContext={parentKey:s,preferredTargetIndex:o.yDirection===`up`?e.length-1:0,lastSwitchY:r,lastSwitchX:n});let c=o.boundaryContext,l=Math.abs(n-c.lastSwitchX);if(Math.abs(r-c.lastSwitchY)>vR&&i){let t=c.preferredTargetIndex||0;i===`down`&&t===0?c.preferredTargetIndex=e.length-1:i===`up`&&t===e.length-1&&(c.preferredTargetIndex=0),o.xDirection=null}if(l>_R&&a){let t=c.preferredTargetIndex||0;a===`left`?this.direction===`ltr`?t0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):a===`right`&&(this.direction===`ltr`?t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):t{let i=this.keyMap.get(r.key);e.visitNode&&(r=e.visitNode(r)),this.keyMap.set(r.key,r);let a=new Set,o=null,s=!1;if(r.type===`item`){for(let e of r.childNodes)if(e.props?.colSpan!==void 0){s=!0;break}}for(let e of r.childNodes)e.type===`cell`&&s&&(e.colspan=e.props?.colSpan,e.colSpan=e.props?.colSpan,e.colIndex=o?(o.colIndex??o.index)+(o.colSpan??1):e.index),e.type===`cell`&&e.parentKey==null&&(e.parentKey=r.key),a.add(e.key),o?(o.nextKey=e.key,e.prevKey=o.key):e.prevKey=null,t(e),o=e;if(o&&(o.nextKey=null),i)for(let e of i.childNodes)a.has(e.key)||n(e)},n=e=>{this.keyMap.delete(e.key);for(let t of e.childNodes)this.keyMap.get(t.key)===t&&n(t)},r=null;for(let[n,i]of e.items.entries()){let e={...i,level:i.level??0,key:i.key??`row-`+n,type:i.type??`row`,value:i.value??null,hasChildNodes:!0,childNodes:[...i.childNodes],rendered:i.rendered,textValue:i.textValue??``,index:i.index??n};r?(r.nextKey=e.key,e.prevKey=r.key):e.prevKey=null,this.rows.push(e),t(e),r=e}r&&(r.nextKey=null)}*[Symbol.iterator](){yield*[...this.rows]}get size(){return[...this.rows].length}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey??null:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey??null:null}getFirstKey(){return[...this.rows][0]?.key}getLastKey(){let e=[...this.rows];return e[e.length-1]?.key}getItem(e){return this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}getChildren(e){return this.keyMap.get(e)?.childNodes||[]}},xR=`row-header-column-`+Math.random().toString(36).slice(2),SR=`row-header-column-`+Math.random().toString(36).slice(2);xR===SR;)SR=`row-header-column-`+Math.random().toString(36).slice(2);function CR(e,t){if(t.length===0)return[];let n=[],r=new Map;for(let i of t){let t=i.parentKey,a=[i];for(;t!=null;){let n=e.get(t);if(!n)break;if(r.has(n)){n.colSpan??=0,n.colSpan++,n.colspan=n.colSpan;let{column:e,index:t}=r.get(n);if(t>a.length)break;for(let n=t;ne.length)),a=Array(i).fill(0).map(()=>[]),o=0;for(let e of n){let t=i-1;for(let n of e){if(n){let e=a[t],r=e.reduce((e,t)=>e+(t.colSpan??1),0);if(r0&&(e[e.length-1].nextKey=i.key,i.prevKey=e[e.length-1].key),e.push(i)}e.length>0&&(e[e.length-1].nextKey=n.key,n.prevKey=e[e.length-1].key),n.level=t,n.colIndex=o,e.push(n)}t--}o++}let s=0;for(let e of a){let n=e.reduce((e,t)=>e+(t.colSpan??1),0);if(n({type:`headerrow`,key:`headerrow-`+t,index:t,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:e,textValue:``}))}var wR=class extends bR{constructor(e,t,n){let r=new Set,i=null,a=[];if(n?.showSelectionCheckboxes){let e={type:`column`,key:xR,value:null,textValue:``,level:0,index:+!!n?.showDragButtons,hasChildNodes:!1,rendered:null,childNodes:[],props:{isSelectionCell:!0}};a.unshift(e)}if(n?.showDragButtons){let e={type:`column`,key:SR,value:null,textValue:``,level:0,index:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isDragButtonCell:!0}};a.unshift(e)}let o=[],s=new Map,c=e=>{switch(e.type){case`body`:i=e;break;case`column`:s.set(e.key,e),e.hasChildNodes||(a.push(e),e.props.isRowHeader&&r.add(e.key));break;case`item`:o.push(e);return}for(let t of e.childNodes)c(t)};for(let t of e)c(t);let l=CR(s,a);if(l.forEach((e,t)=>o.splice(t,0,e)),super({columnCount:a.length,items:o,visitNode:e=>(e.column=a[e.index],e)}),this._size=0,this.columns=a,this.rowHeaderColumnKeys=r,this.body=i,this.headerRows=l,this._size=[...i.childNodes].length,this.rowHeaderColumnKeys.size===0){let e=this.columns.find(e=>!e.props?.isDragButtonCell&&!e.props?.isSelectionCell);e&&this.rowHeaderColumnKeys.add(e.key)}}*[Symbol.iterator](){yield*this.body.childNodes}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey??null}getKeyAfter(e){return this.keyMap.get(e)?.nextKey??null}getFirstKey(){return gx(this.body.childNodes)?.key??null}getLastKey(){return vx(this.body.childNodes)?.key??null}getItem(e){return e===this.body.key?this.body:this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}getChildren(e){if(e===this.body.key)return this.body.childNodes;let t=this.getItem(e);return t?.type===`item`?[...t.childNodes].filter(e=>e.type===`cell`):super.getChildren(e)}getTextValue(e){let t=this.getItem(e);if(!t)return``;if(t.textValue)return t.textValue;let n=this.rowHeaderColumnKeys;if(n){let e=[];for(let r of t.childNodes){let t=this.columns[r.index];if(n.has(t.key)&&r.textValue&&e.push(r.textValue),e.length===n.size)break}return e.join(` `)}return``}};function TR(e){return e!=null&&(!isNaN(e)||String(e).match(/^(\d+)(?=%$)/)!==null)}function ER(e){if(!e||typeof e==`number`)return 1;let t=e.match(/^(.+)(?=fr$)/);return t?parseFloat(t[0]):1}function DR(e,t){if(typeof e==`string`){let n=e.match(/^(\d+)(?=%$)/);if(!n)throw Error(`Only percentages or numbers are supported for static column widths`);return t*(parseFloat(n[0])/100)}return e}function OR(e,t){return e==null?2**53-1:DR(e,t)}function kR(e,t){return e==null?0:DR(e,t)}function AR(e,t,n,r,i){let a=e,o=Math.floor(e),s=e-o>0;e=o;let c=!1,l=t.map((t,a)=>{let o=n.get(t.key)==null?t.width??t.defaultWidth??r?.(a)??`1fr`:n.get(t.key)??`1fr`,s=!1,l=0,u=0,d=0;TR(o)?(l=DR(o,e),s=!0):(u=ER(o),u<=0&&(s=!0));let f=kR(t.minWidth??i?.(a)??0,e),p=OR(t.maxWidth,e),m=Math.max(f,Math.min(l,p));return s?d=m:l>m&&(s=!0,d=m),s||(c=!0),{frozen:s,baseSize:l,hypotheticalMainSize:m,min:f,max:p,flex:u,targetMainSize:d,violation:0}});for(;c;){let t=0,n=0;l.forEach(e=>{e.frozen?t+=e.targetMainSize:(t+=e.baseSize,n+=e.flex)});let r=e-t;r>0&&l.forEach(e=>{if(!e.frozen){let t=e.flex/n;e.targetMainSize=e.baseSize+t*r}});let i=0;l.forEach(e=>{if(e.violation=0,!e.frozen){let{min:t,max:n,targetMainSize:r}=e;e.targetMainSize=Math.max(t,Math.min(r,n)),e.violation=e.targetMainSize-r,i+=e.violation}}),c=!1,l.forEach(e=>{i===0||Math.sign(i)===Math.sign(e.violation)?e.frozen=!0:e.frozen||(c=!0)})}let u=jR(l);if(s&&u.length>0){let e=a.toString().split(`.`)[1],t=u[u.length-1].toString();u[u.length-1]=Number(t+`.`+e)}return u}function jR(e){let t=0,n=0,r=[];return e.forEach(function(e){let i=e.targetMainSize,a=Math.round(i+t)-n;t+=i,n+=a,r.push(a)}),r}var MR=class{constructor(e){this.columnWidths=new Map,this.columnMinWidths=new Map,this.columnMaxWidths=new Map,this.getDefaultWidth=e?.getDefaultWidth??(()=>`1fr`),this.getDefaultMinWidth=e?.getDefaultMinWidth??(()=>75)}splitColumnsIntoControlledAndUncontrolled(e){return e.reduce((e,t)=>(t.props.width==null?e[1].set(t.key,t):e[0].set(t.key,t),e),[new Map,new Map])}recombineColumns(e,t,n,r){return new Map(e.map(e=>n.has(e.key)?[e.key,t.get(e.key)]:[e.key,r.get(e.key).props.width]))}getInitialUncontrolledWidths(e){return new Map(Array.from(e).map(([e,t])=>[e,t.props.defaultWidth??this.getDefaultWidth?.(t)??`1fr`]))}getColumnWidth(e){return this.columnWidths.get(e)??0}getColumnMinWidth(e){return this.columnMinWidths.get(e)??0}getColumnMaxWidth(e){return this.columnMaxWidths.get(e)??0}resizeColumnWidth(e,t,n,r){let i=this.columnWidths,a=!0,o=new Map;return r=Math.max(this.getColumnMinWidth(n),Math.min(this.getColumnMaxWidth(n),Math.floor(r))),e.columns.forEach(e=>{e.key===n?(o.set(e.key,r),a=!1):a?o.set(e.key,i.get(e.key)??0):o.set(e.key,e.props.width??t.get(e.key))}),o}buildColumnWidths(e,t,n){return this.columnWidths=new Map,this.columnMinWidths=new Map,this.columnMaxWidths=new Map,AR(e,t.columns.map(e=>({...e.props,key:e.key})),n,e=>this.getDefaultWidth(t.columns[e]),e=>this.getDefaultMinWidth(t.columns[e])).forEach((n,r)=>{let i=t.columns[r].key,a=t.columns[r];this.columnWidths.set(i,n),this.columnMinWidths.set(i,kR(a.props.minWidth??this.getDefaultMinWidth(a),e)),this.columnMaxWidths.set(i,OR(a.props.maxWidth,e))}),this.columnWidths}};function NR(e,t){let{getDefaultWidth:n,getDefaultMinWidth:r,tableWidth:i=0}=e,[a,o]=(0,v.useState)(null),s=(0,v.useMemo)(()=>new MR({getDefaultWidth:n,getDefaultMinWidth:r}),[n,r]),[c,l]=(0,v.useMemo)(()=>s.splitColumnsIntoControlledAndUncontrolled(t.collection.columns),[t.collection.columns,s]),[u,d]=(0,v.useState)(()=>s.getInitialUncontrolledWidths(l)),[f,p]=(0,v.useState)(t.collection.columns);t.collection.columns!==f&&((t.collection.columns.length!==f.length||t.collection.columns.some((e,t)=>e.key!==f[t].key))&&d(s.getInitialUncontrolledWidths(l)),p(t.collection.columns));let m=(0,v.useMemo)(()=>s.recombineColumns(t.collection.columns,u,l,c),[t.collection.columns,u,l,c,s]),h=(0,v.useCallback)(e=>{o(e)},[o]),g=(0,v.useCallback)((e,n)=>{let r=s.resizeColumnWidth(t.collection,u,e,n),i=new Map(Array.from(l).map(([e])=>[e,r.get(e)]));return i.set(e,n),d(i),r},[l,d,s,t.collection,u]),_=(0,v.useCallback)(()=>{o(null)},[o]),y=(0,v.useMemo)(()=>s.buildColumnWidths(i,t.collection,m),[i,t.collection,m,s]);return(0,v.useMemo)(()=>({resizingColumn:a,updateResizedColumns:g,startResize:h,endResize:_,getColumnWidth:e=>s.getColumnWidth(e),getColumnMinWidth:e=>s.getColumnMinWidth(e),getColumnMaxWidth:e=>s.getColumnMaxWidth(e),tableState:t,columnWidths:y}),[s,y,a,g,h,_,t])}function PR(e){let{collection:t,focusMode:n}=e,r=e.UNSAFE_selectionState||Hx(e),i=(0,v.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),a=r.setFocusedKey;r.setFocusedKey=(e,r)=>{if(n===`cell`&&e!=null){let n=t.getItem(e);if(n?.type===`item`){let i=hx(n,t);e=r===`last`?vx(i)?.key??null:gx(i)?.key??null}}a(e,r)};let o=(0,v.useMemo)(()=>new Px(t,r),[t,r]),s=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(r.focusedKey!=null&&s.current&&!t.getItem(r.focusedKey)){let e=s.current.getItem(r.focusedKey),n=e?.parentKey!=null&&(e.type===`cell`||e.type===`rowheader`||e.type===`column`)?s.current.getItem(e.parentKey):e;if(!n){r.setFocusedKey(null);return}let i=s.current.rows,a=t.rows,c=i.length-a.length,l=Math.min(c>1?Math.max(n.index-c+1,0):n.index,a.length-1),u=null;for(let e=Math.max(0,l);e=0;e--)if(!o.isDisabled(a[e].key)&&a[e].type!==`headerrow`){u=a[e];break}}if(u){let i=u.hasChildNodes?[...hx(u,t)]:[],a=u.hasChildNodes&&n!==e&&e&&e.index({showSelectionCheckboxes:i&&r!==`none`,showDragButtons:a,selectionMode:r,columns:[]}),[e.children,i,r,a]),c=Bx(e,(0,v.useCallback)(e=>new wR(e,null,s),[s]),s),{disabledKeys:l,selectionManager:u}=PR({...e,collection:c,disabledBehavior:e.disabledBehavior||`selection`}),[d,f]=sh(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,e.onExpandedChange);return{collection:c,disabledKeys:l,selectionManager:u,showSelectionCheckboxes:e.showSelectionCheckboxes||!1,sortDescriptor:e.sortDescriptor??null,isKeyboardNavigationDisabled:c.size===0||t,setKeyboardNavigationDisabled:n,sort(t,n){e.onSortChange?.({column:t,direction:n??(e.sortDescriptor?.column===t?FR[e.sortDescriptor.direction]:`ascending`)})},expandedKeys:d,toggleKey(e){f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},treeColumn:o}}function LR(e,t){let n=(0,v.useMemo)(()=>t?e.collection.filter(t):e.collection,[e.collection,t]),r=e.selectionManager.withCollection(n);return{...e,collection:n,selectionManager:r}}var RR=class{constructor(e){if(this.collection=e.collection,this.disabledKeys=e.disabledKeys,this.disabledBehavior=e.disabledBehavior||`all`,this.direction=e.direction,this.collator=e.collator,!e.layout&&!e.ref)throw Error(`Either a layout or a ref must be specified.`);this.layoutDelegate=e.layoutDelegate||(e.layout?new zR(e.layout):new ox(e.ref)),this.focusMode=e.focusMode??`row`}isCell(e){return e.type===`cell`}isRow(e){return e.type===`row`||e.type===`item`}isDisabled(e){return this.disabledBehavior===`all`&&(e.props?.isDisabled||this.disabledKeys.has(e.key))&&e.props?.disabledBehavior!==`selection`}findPreviousKey(e,t,n=!1){let r=e==null?this.collection.getLastKey():this.collection.getKeyBefore(e);for(;r!=null;){let e=this.collection.getItem(r);if(!e)return null;if((n||!this.isDisabled(e))&&(!t||t(e)))return r;r=this.collection.getKeyBefore(r)}return null}findNextKey(e,t,n=!1){let r=e==null?this.collection.getFirstKey():this.collection.getKeyAfter(e);for(;r!=null;){let e=this.collection.getItem(r);if(!e)return null;if((n||!this.isDisabled(e))&&(!t||t(e)))return r;if(r=this.collection.getKeyAfter(r),r==null)return null}return null}getKeyForItemInRowByIndex(e,t=0){if(t<0)return null;let n=this.collection.getItem(e);if(!n)return null;let r=0;for(let e of hx(n,this.collection)){if(e.colSpan&&e.colSpan+r>t||(e.colSpan&&(r=r+e.colSpan-1),r===t))return e.key??null;r++}return null}getKeyBelow(e,t){let n=e,r=this.collection.getItem(n);if(!r||(this.isCell(r)&&(n=r.parentKey??null),n==null))return null;if(n=this.findNextKey(n,e=>e.type===`item`,t?.includeDisabled),n!=null){if(this.isCell(r)){let e=r.colIndex?r.colIndex:r.index;return this.getKeyForItemInRowByIndex(n,e)}if(this.focusMode===`row`)return n}return null}getKeyAbove(e,t){let n=e,r=this.collection.getItem(n);if(!r||(this.isCell(r)&&(n=r.parentKey??null),n==null))return null;if(n=this.findPreviousKey(n,e=>e.type===`item`,t?.includeDisabled),n!=null){if(this.isCell(r)){let e=r.colIndex?r.colIndex:r.index;return this.getKeyForItemInRowByIndex(n,e)}if(this.focusMode===`row`)return n}return null}getKeyRightOf(e){let t=this.collection.getItem(e);if(!t)return null;if(this.isRow(t)){let e=hx(t,this.collection);return(this.direction===`rtl`?vx(e)?.key:gx(e)?.key)??null}if(this.isCell(t)&&t.parentKey!=null){let n=this.collection.getItem(t.parentKey);if(!n)return null;let r=hx(n,this.collection),i=(this.direction===`rtl`?_x(r,t.index-1):_x(r,t.index+1))??null;return i?i.key??null:this.focusMode===`row`?t.parentKey??null:(this.direction===`rtl`?this.getFirstKey(e):this.getLastKey(e))??null}return null}getKeyLeftOf(e){let t=this.collection.getItem(e);if(!t)return null;if(this.isRow(t)){let e=hx(t,this.collection);return(this.direction===`rtl`?gx(e)?.key:vx(e)?.key)??null}if(this.isCell(t)&&t.parentKey!=null){let n=this.collection.getItem(t.parentKey);if(!n)return null;let r=hx(n,this.collection),i=(this.direction===`rtl`?_x(r,t.index+1):_x(r,t.index-1))??null;return i?i.key??null:this.focusMode===`row`?t.parentKey??null:(this.direction===`rtl`?this.getLastKey(e):this.getFirstKey(e))??null}return null}getFirstKey(e,t){let n=e??null,r;if(n!=null){if(r=this.collection.getItem(n),!r)return null;if(this.isCell(r)&&!t&&r.parentKey!=null){let e=this.collection.getItem(r.parentKey);return e?gx(hx(e,this.collection))?.key??null:null}}if(n=this.findNextKey(void 0,e=>e.type===`item`),n!=null&&(r&&this.isCell(r)&&t||this.focusMode===`cell`)){let e=this.collection.getItem(n);if(!e)return null;n=gx(hx(e,this.collection))?.key??null}return n}getLastKey(e,t){let n=e??null,r;if(n!=null){if(r=this.collection.getItem(n),!r)return null;if(this.isCell(r)&&!t&&r.parentKey!=null){let e=this.collection.getItem(r.parentKey);return e?vx(hx(e,this.collection))?.key??null:null}}if(n=this.findPreviousKey(void 0,e=>e.type===`item`),n!=null&&(r&&this.isCell(r)&&t||this.focusMode===`cell`)){let e=this.collection.getItem(n);if(!e)return null;n=vx(hx(e,this.collection))?.key??null}return n}getKeyPageAbove(e){let t=e,n=this.layoutDelegate.getItemRect(t);if(!n)return null;let r=Math.max(0,n.y+n.height-this.layoutDelegate.getVisibleRect().height);for(;n&&n.y>r&&t!=null&&(t=this.getKeyAbove(t)??null,t!=null);)n=this.layoutDelegate.getItemRect(t);return t}getKeyPageBelow(e){let t=e,n=this.layoutDelegate.getItemRect(t);if(!n)return null;let r=this.layoutDelegate.getVisibleRect().height,i=Math.min(this.layoutDelegate.getContentSize().height,n.y+r);for(;n&&n.y+n.heighte.type===`item`),n==null&&!a&&(n=this.getFirstKey(),a=!0)}return null}},zR=class{constructor(e){this.layout=e}getContentSize(){return this.layout.getContentSize()}getItemRect(e){return this.layout.getLayoutInfo(e)?.rect||null}getVisibleRect(){return this.layout.virtualizer.visibleRect}},BR=new WeakMap;function VR(e,t,n){let{isVirtualized:r,disallowTypeAhead:i,keyboardDelegate:a,focusMode:o,scrollRef:s,getRowText:c,onRowAction:l,onCellAction:u,escapeKeyBehavior:d=`clearSelection`,shouldSelectOnPressUp:f,keyboardNavigationBehavior:p=`arrow`}=e,{selectionManager:m}=t;!e[`aria-label`]&&!e[`aria-labelledby`]&&console.warn(`An aria-label or aria-labelledby prop is required for accessibility.`);let h=lx({usage:`search`,sensitivity:`base`}),{direction:g}=rp(),_=t.selectionManager.disabledBehavior,y=(0,v.useMemo)(()=>a||new RR({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:_,ref:n,direction:g,collator:h,focusMode:o}),[a,t.collection,t.disabledKeys,_,n,g,h,o]),{collectionProps:b}=ax({ref:n,selectionManager:m,keyboardDelegate:y,isVirtualized:r,scrollRef:s,disallowTypeAhead:i,escapeKeyBehavior:d}),x=es(e.id);BR.set(t,{keyboardDelegate:y,actions:{onRowAction:l,onCellAction:u},shouldSelectOnPressUp:f,keyboardNavigationBehavior:p});let S=CI({selectionManager:m,hasItemActions:!!(l||u)}),C=W(e,{labelable:!0}),w=(0,v.useCallback)(e=>{if(m.isFocused){ps(e.currentTarget,H(e))||m.setFocused(!1);return}ps(e.currentTarget,H(e))&&m.setFocused(!0)},[m]),T=(0,v.useMemo)(()=>({onBlur:b.onBlur,onFocus:w}),[w,b.onBlur]),E=hF(n,{isDisabled:t.collection.size!==0}),D=U(C,{role:`grid`,id:x,"aria-multiselectable":m.selectionMode===`multiple`?`true`:void 0},t.isKeyboardNavigationDisabled?T:b,t.collection.size===0&&{tabIndex:E?-1:0}||void 0,S);return r&&(D[`aria-rowcount`]=t.collection.size,D[`aria-colcount`]=t.collection.columnCount),bI({getRowText:c},t),{gridProps:D}}var HR=new WeakMap;function UR(e){return typeof e==`string`?e.replace(/\s*/g,``):``+e}function WR(e,t){let n=HR.get(e);if(!n)throw Error(`Unknown grid`);return`${n}-${UR(t)}`}function GR(e,t,n){let r=HR.get(e);if(!r)throw Error(`Unknown grid`);return`${r}-${UR(t)}-${UR(n)}`}function KR(e,t){return[...e.collection.rowHeaderColumnKeys].map(n=>GR(e,t,n)).join(` `)}var qR={};qR={ascending:`تصاعدي`,ascendingSort:e=>`\u{62A}\u{631}\u{62A}\u{64A}\u{628} \u{62D}\u{633}\u{628} \u{627}\u{644}\u{639}\u{645}\u{648}\u{62F} ${e.columnName} \u{628}\u{62A}\u{631}\u{62A}\u{64A}\u{628} \u{62A}\u{635}\u{627}\u{639}\u{62F}\u{64A}`,collapse:`طي`,columnSize:e=>`${e.value} \u{628}\u{627}\u{644}\u{628}\u{643}\u{633}\u{644}`,descending:`تنازلي`,descendingSort:e=>`\u{62A}\u{631}\u{62A}\u{64A}\u{628} \u{62D}\u{633}\u{628} \u{627}\u{644}\u{639}\u{645}\u{648}\u{62F} ${e.columnName} \u{628}\u{62A}\u{631}\u{62A}\u{64A}\u{628} \u{62A}\u{646}\u{627}\u{632}\u{644}\u{64A}`,expand:`تمديد`,resizerDescription:`اضغط على مفتاح Enter لبدء تغيير الحجم`,select:`تحديد`,selectAll:`تحديد الكل`,sortable:`عمود قابل للترتيب`};var JR={};JR={ascending:`възходящ`,ascendingSort:e=>`\u{441}\u{43E}\u{440}\u{442}\u{438}\u{440}\u{430}\u{43D}\u{43E} \u{43F}\u{43E} \u{43A}\u{43E}\u{43B}\u{43E}\u{43D}\u{430} ${e.columnName} \u{432}\u{44A}\u{432} \u{432}\u{44A}\u{437}\u{445}\u{43E}\u{434}\u{44F}\u{449} \u{440}\u{435}\u{434}`,collapse:`Свиване`,columnSize:e=>`${e.value} \u{43F}\u{438}\u{43A}\u{441}\u{435}\u{43B}\u{430}`,descending:`низходящ`,descendingSort:e=>`\u{441}\u{43E}\u{440}\u{442}\u{438}\u{440}\u{430}\u{43D}\u{43E} \u{43F}\u{43E} \u{43A}\u{43E}\u{43B}\u{43E}\u{43D}\u{430} ${e.columnName} \u{432} \u{43D}\u{438}\u{437}\u{445}\u{43E}\u{434}\u{44F}\u{449} \u{440}\u{435}\u{434}`,expand:`Разширяване`,resizerDescription:`Натиснете „Enter“, за да започнете да преоразмерявате`,select:`Изберете`,selectAll:`Изберете всичко`,sortable:`сортираща колона`};var YR={};YR={ascending:`vzestupně`,ascendingSort:e=>`\u{159}azeno vzestupn\u{11B} podle sloupce ${e.columnName}`,collapse:`Sbalit`,columnSize:e=>`${e.value} pixel\u{16F}`,descending:`sestupně`,descendingSort:e=>`\u{159}azeno sestupn\u{11B} podle sloupce ${e.columnName}`,expand:`Roztáhnout`,resizerDescription:`Stisknutím klávesy Enter začnete měnit velikost`,select:`Vybrat`,selectAll:`Vybrat vše`,sortable:`sloupec s možností řazení`};var XR={};XR={ascending:`stigende`,ascendingSort:e=>`sorteret efter kolonne ${e.columnName} i stigende r\xe6kkef\xf8lge`,collapse:`Skjul`,columnSize:e=>`${e.value} pixels`,descending:`faldende`,descendingSort:e=>`sorteret efter kolonne ${e.columnName} i faldende r\xe6kkef\xf8lge`,expand:`Udvid`,resizerDescription:`Tryk på Enter for at ændre størrelse`,select:`Vælg`,selectAll:`Vælg alle`,sortable:`sorterbar kolonne`};var ZR={};ZR={ascending:`aufsteigend`,ascendingSort:e=>`sortiert nach Spalte ${e.columnName} in aufsteigender Reihenfolge`,collapse:`Reduzieren`,columnSize:e=>`${e.value} Pixel`,descending:`absteigend`,descendingSort:e=>`sortiert nach Spalte ${e.columnName} in absteigender Reihenfolge`,expand:`Erweitern`,resizerDescription:`Eingabetaste zum Starten der Größenänderung drücken`,select:`Auswählen`,selectAll:`Alles auswählen`,sortable:`sortierbare Spalte`};var QR={};QR={ascending:`αύξουσα`,ascendingSort:e=>`\u{3B4}\u{3B9}\u{3B1}\u{3BB}\u{3BF}\u{3B3}\u{3AE} \u{3B1}\u{3BD}\u{3AC} \u{3C3}\u{3C4}\u{3AE}\u{3BB}\u{3B7} ${e.columnName} \u{3C3}\u{3B5} \u{3B1}\u{3CD}\u{3BE}\u{3BF}\u{3C5}\u{3C3}\u{3B1} \u{3C3}\u{3B5}\u{3B9}\u{3C1}\u{3AC}`,collapse:`Σύμπτυξη`,columnSize:e=>`${e.value} pixel`,descending:`φθίνουσα`,descendingSort:e=>`\u{3B4}\u{3B9}\u{3B1}\u{3BB}\u{3BF}\u{3B3}\u{3AE} \u{3B1}\u{3BD}\u{3AC} \u{3C3}\u{3C4}\u{3AE}\u{3BB}\u{3B7} ${e.columnName} \u{3C3}\u{3B5} \u{3C6}\u{3B8}\u{3AF}\u{3BD}\u{3BF}\u{3C5}\u{3C3}\u{3B1} \u{3C3}\u{3B5}\u{3B9}\u{3C1}\u{3AC}`,expand:`Ανάπτυξη`,resizerDescription:`Πατήστε Enter για έναρξη της αλλαγής μεγέθους`,select:`Επιλογή`,selectAll:`Επιλογή όλων`,sortable:`Στήλη διαλογής`};var $R={};$R={select:`Select`,selectAll:`Select All`,sortable:`sortable column`,ascending:`ascending`,descending:`descending`,ascendingSort:e=>`sorted by column ${e.columnName} in ascending order`,descendingSort:e=>`sorted by column ${e.columnName} in descending order`,columnSize:e=>`${e.value} pixels`,resizerDescription:`Press Enter to start resizing`,expand:`Expand`,collapse:`Collapse`};var ez={};ez={ascending:`ascendente`,ascendingSort:e=>`ordenado por columna ${e.columnName} en sentido ascendente`,collapse:`Contraer`,columnSize:e=>`${e.value} p\xedxeles`,descending:`descendente`,descendingSort:e=>`ordenado por columna ${e.columnName} en orden descendente`,expand:`Ampliar`,resizerDescription:`Pulse Intro para empezar a redimensionar`,select:`Seleccionar`,selectAll:`Seleccionar todos`,sortable:`columna ordenable`};var tz={};tz={ascending:`tõusev järjestus`,ascendingSort:e=>`sorditud veeru j\xe4rgi ${e.columnName} t\xf5usvas j\xe4rjestuses`,collapse:`Ahenda`,columnSize:e=>`${e.value} pikslit`,descending:`laskuv järjestus`,descendingSort:e=>`sorditud veeru j\xe4rgi ${e.columnName} laskuvas j\xe4rjestuses`,expand:`Laienda`,resizerDescription:`Suuruse muutmise alustamiseks vajutage klahvi Enter`,select:`Vali`,selectAll:`Vali kõik`,sortable:`sorditav veerg`};var nz={};nz={ascending:`nouseva`,ascendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan nousevassa j\xe4rjestyksess\xe4`,collapse:`Pienennä`,columnSize:e=>`${e.value} pikseli\xe4`,descending:`laskeva`,descendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan laskevassa j\xe4rjestyksess\xe4`,expand:`Laajenna`,resizerDescription:`Aloita koon muutos painamalla Enter-näppäintä`,select:`Valitse`,selectAll:`Valitse kaikki`,sortable:`lajiteltava sarake`};var rz={};rz={ascending:`croissant`,ascendingSort:e=>`tri\xe9 en fonction de la colonne\xa0${e.columnName} par ordre croissant`,collapse:`Réduire`,columnSize:e=>`${e.value}\xa0pixels`,descending:`décroissant`,descendingSort:e=>`tri\xe9 en fonction de la colonne\xa0${e.columnName} par ordre d\xe9croissant`,expand:`Développer`,resizerDescription:`Appuyez sur Entrée pour commencer le redimensionnement.`,select:`Sélectionner`,selectAll:`Sélectionner tout`,sortable:`colonne triable`};var iz={};iz={ascending:`עולה`,ascendingSort:e=>`\u{5DE}\u{5D5}\u{5D9}\u{5DF} \u{5DC}\u{5E4}\u{5D9} \u{5E2}\u{5DE}\u{5D5}\u{5D3}\u{5D4} ${e.columnName} \u{5D1}\u{5E1}\u{5D3}\u{5E8} \u{5E2}\u{5D5}\u{5DC}\u{5D4}`,collapse:`כווץ`,columnSize:e=>`${e.value} \u{5E4}\u{5D9}\u{5E7}\u{5E1}\u{5DC}\u{5D9}\u{5DD}`,descending:`יורד`,descendingSort:e=>`\u{5DE}\u{5D5}\u{5D9}\u{5DF} \u{5DC}\u{5E4}\u{5D9} \u{5E2}\u{5DE}\u{5D5}\u{5D3}\u{5D4} ${e.columnName} \u{5D1}\u{5E1}\u{5D3}\u{5E8} \u{5D9}\u{5D5}\u{5E8}\u{5D3}`,expand:`הרחב`,resizerDescription:`הקש Enter כדי לשנות את הגודל`,select:`בחר`,selectAll:`בחר הכול`,sortable:`עמודה שניתן למיין`};var az={};az={ascending:`rastući`,ascendingSort:e=>`razvrstano po stupcima ${e.columnName} rastu\u{107}em redoslijedom`,collapse:`Sažmi`,columnSize:e=>`${e.value} piksela`,descending:`padajući`,descendingSort:e=>`razvrstano po stupcima ${e.columnName} padaju\u{107}im redoslijedom`,expand:`Proširi`,resizerDescription:`Pritisnite Enter da biste započeli promenu veličine`,select:`Odaberite`,selectAll:`Odaberite sve`,sortable:`stupac koji se može razvrstati`};var oz={};oz={ascending:`növekvő`,ascendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, n\xf6vekv\u{151} sorrendben`,collapse:`Összecsukás`,columnSize:e=>`${e.value} k\xe9ppont`,descending:`csökkenő`,descendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, cs\xf6kken\u{151} sorrendben`,expand:`Kibontás`,resizerDescription:`Nyomja le az Enter billentyűt az átméretezés megkezdéséhez`,select:`Kijelölés`,selectAll:`Összes kijelölése`,sortable:`rendezendő oszlop`};var sz={};sz={ascending:`crescente`,ascendingSort:e=>`in ordine crescente in base alla colonna ${e.columnName}`,collapse:`Comprimi`,columnSize:e=>`${e.value} pixel`,descending:`decrescente`,descendingSort:e=>`in ordine decrescente in base alla colonna ${e.columnName}`,expand:`Espandi`,resizerDescription:`Premi Invio per iniziare a ridimensionare`,select:`Seleziona`,selectAll:`Seleziona tutto`,sortable:`colonna ordinabile`};var cz={};cz={ascending:`昇順`,ascendingSort:e=>`\u{5217} ${e.columnName} \u{3092}\u{6607}\u{9806}\u{3067}\u{4E26}\u{3079}\u{66FF}\u{3048}`,collapse:`折りたたむ`,columnSize:e=>`${e.value} \u{30D4}\u{30AF}\u{30BB}\u{30EB}`,descending:`降順`,descendingSort:e=>`\u{5217} ${e.columnName} \u{3092}\u{964D}\u{9806}\u{3067}\u{4E26}\u{3079}\u{66FF}\u{3048}`,expand:`展開`,resizerDescription:`Enter キーを押してサイズ変更を開始`,select:`選択`,selectAll:`すべて選択`,sortable:`並べ替え可能な列`};var lz={};lz={ascending:`오름차순`,ascendingSort:e=>`${e.columnName} \u{C5F4}\u{C744} \u{AE30}\u{C900}\u{C73C}\u{B85C} \u{C624}\u{B984}\u{CC28}\u{C21C}\u{C73C}\u{B85C} \u{C815}\u{B82C}\u{B428}`,collapse:`접기`,columnSize:e=>`${e.value} \u{D53D}\u{C140}`,descending:`내림차순`,descendingSort:e=>`${e.columnName} \u{C5F4}\u{C744} \u{AE30}\u{C900}\u{C73C}\u{B85C} \u{B0B4}\u{B9BC}\u{CC28}\u{C21C}\u{C73C}\u{B85C} \u{C815}\u{B82C}\u{B428}`,expand:`펼치기`,resizerDescription:`크기 조정을 시작하려면 Enter를 누르세요.`,select:`선택`,selectAll:`모두 선택`,sortable:`정렬 가능한 열`};var uz={};uz={ascending:`didėjančia tvarka`,ascendingSort:e=>`surikiuota pagal stulpel\u{12F} ${e.columnName} did\u{117}jan\u{10D}ia tvarka`,collapse:`Sutraukti`,columnSize:e=>`${e.value} piks.`,descending:`mažėjančia tvarka`,descendingSort:e=>`surikiuota pagal stulpel\u{12F} ${e.columnName} ma\u{17E}\u{117}jan\u{10D}ia tvarka`,expand:`Išskleisti`,resizerDescription:`Paspauskite „Enter“, kad pradėtumėte keisti dydį`,select:`Pasirinkti`,selectAll:`Pasirinkti viską`,sortable:`rikiuojamas stulpelis`};var dz={};dz={ascending:`augošā secībā`,ascendingSort:e=>`k\u{101}rtots p\u{113}c kolonnas ${e.columnName} augo\u{161}\u{101} sec\u{12B}b\u{101}`,collapse:`Sakļaut`,columnSize:e=>`${e.value} pikse\u{13C}i`,descending:`dilstošā secībā`,descendingSort:e=>`k\u{101}rtots p\u{113}c kolonnas ${e.columnName} dilsto\u{161}\u{101} sec\u{12B}b\u{101}`,expand:`Izvērst`,resizerDescription:`Nospiediet Enter, lai sāktu izmēru mainīšanu`,select:`Atlasīt`,selectAll:`Atlasīt visu`,sortable:`kārtojamā kolonna`};var fz={};fz={ascending:`stigende`,ascendingSort:e=>`sortert etter kolonne ${e.columnName} i stigende rekkef\xf8lge`,collapse:`Skjul`,columnSize:e=>`${e.value} piksler`,descending:`synkende`,descendingSort:e=>`sortert etter kolonne ${e.columnName} i synkende rekkef\xf8lge`,expand:`Utvid`,resizerDescription:`Trykk på Enter for å starte størrelsesendring`,select:`Velg`,selectAll:`Velg alle`,sortable:`kolonne som kan sorteres`};var pz={};pz={ascending:`oplopend`,ascendingSort:e=>`gesorteerd in oplopende volgorde in kolom ${e.columnName}`,collapse:`Samenvouwen`,columnSize:e=>`${e.value} pixels`,descending:`aflopend`,descendingSort:e=>`gesorteerd in aflopende volgorde in kolom ${e.columnName}`,expand:`Uitvouwen`,resizerDescription:`Druk op Enter om het formaat te wijzigen`,select:`Selecteren`,selectAll:`Alles selecteren`,sortable:`sorteerbare kolom`};var mz={};mz={ascending:`rosnąco`,ascendingSort:e=>`posortowano wed\u{142}ug kolumny ${e.columnName} w porz\u{105}dku rosn\u{105}cym`,collapse:`Zwiń`,columnSize:e=>`Liczba pikseli: ${e.value}`,descending:`malejąco`,descendingSort:e=>`posortowano wed\u{142}ug kolumny ${e.columnName} w porz\u{105}dku malej\u{105}cym`,expand:`Rozwiń`,resizerDescription:`Naciśnij Enter, aby rozpocząć zmienianie rozmiaru`,select:`Zaznacz`,selectAll:`Zaznacz wszystko`,sortable:`kolumna z możliwością sortowania`};var hz={};hz={ascending:`crescente`,ascendingSort:e=>`classificado pela coluna ${e.columnName} em ordem crescente`,collapse:`Recolher`,columnSize:e=>`${e.value} pixels`,descending:`decrescente`,descendingSort:e=>`classificado pela coluna ${e.columnName} em ordem decrescente`,expand:`Expandir`,resizerDescription:`Pressione Enter para começar a redimensionar`,select:`Selecionar`,selectAll:`Selecionar tudo`,sortable:`coluna classificável`};var gz={};gz={ascending:`ascendente`,ascendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem ascendente`,collapse:`Colapsar`,columnSize:e=>`${e.value} pixels`,descending:`descendente`,descendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem descendente`,expand:`Expandir`,resizerDescription:`Prima Enter para iniciar o redimensionamento`,select:`Selecionar`,selectAll:`Selecionar tudo`,sortable:`Coluna ordenável`};var _z={};_z={ascending:`crescătoare`,ascendingSort:e=>`sortate dup\u{103} coloana ${e.columnName} \xeen ordine cresc\u{103}toare`,collapse:`Restrângeți`,columnSize:e=>`${e.value} pixeli`,descending:`descrescătoare`,descendingSort:e=>`sortate dup\u{103} coloana ${e.columnName} \xeen ordine descresc\u{103}toare`,expand:`Extindeți`,resizerDescription:`Apăsați pe Enter pentru a începe redimensionarea`,select:`Selectare`,selectAll:`Selectare totală`,sortable:`coloană sortabilă`};var vz={};vz={ascending:`возрастание`,ascendingSort:e=>`\u{441}\u{43E}\u{440}\u{442}\u{438}\u{440}\u{43E}\u{432}\u{430}\u{442}\u{44C} \u{441}\u{442}\u{43E}\u{43B}\u{431}\u{435}\u{446} ${e.columnName} \u{432} \u{43F}\u{43E}\u{440}\u{44F}\u{434}\u{43A}\u{435} \u{432}\u{43E}\u{437}\u{440}\u{430}\u{441}\u{442}\u{430}\u{43D}\u{438}\u{44F}`,collapse:`Свернуть`,columnSize:e=>`${e.value} \u{43F}\u{438}\u{43A}\u{441}.`,descending:`убывание`,descendingSort:e=>`\u{441}\u{43E}\u{440}\u{442}\u{438}\u{440}\u{43E}\u{432}\u{430}\u{442}\u{44C} \u{441}\u{442}\u{43E}\u{43B}\u{431}\u{435}\u{446} ${e.columnName} \u{432} \u{43F}\u{43E}\u{440}\u{44F}\u{434}\u{43A}\u{435} \u{443}\u{431}\u{44B}\u{432}\u{430}\u{43D}\u{438}\u{44F}`,expand:`Развернуть`,resizerDescription:`Нажмите клавишу Enter для начала изменения размеров`,select:`Выбрать`,selectAll:`Выбрать все`,sortable:`сортируемый столбец`};var yz={};yz={ascending:`vzostupne`,ascendingSort:e=>`zoraden\xe9 zostupne pod\u{13E}a st\u{13A}pca ${e.columnName}`,collapse:`Zbaliť`,columnSize:e=>`Po\u{10D}et pixelov: ${e.value}`,descending:`zostupne`,descendingSort:e=>`zoraden\xe9 zostupne pod\u{13E}a st\u{13A}pca ${e.columnName}`,expand:`Rozbaliť`,resizerDescription:`Stlačením klávesu Enter začnete zmenu veľkosti`,select:`Vybrať`,selectAll:`Vybrať všetko`,sortable:`zoraditeľný stĺpec`};var bz={};bz={ascending:`naraščajoče`,ascendingSort:e=>`razvr\u{161}\u{10D}eno po stolpcu ${e.columnName} v nara\u{161}\u{10D}ajo\u{10D}em vrstnem redu`,collapse:`Strni`,columnSize:e=>`${e.value} slikovnih pik`,descending:`padajoče`,descendingSort:e=>`razvr\u{161}\u{10D}eno po stolpcu ${e.columnName} v padajo\u{10D}em vrstnem redu`,expand:`Razširi`,resizerDescription:`Pritisnite tipko Enter da začnete spreminjati velikost`,select:`Izberite`,selectAll:`Izberite vse`,sortable:`razvrstljivi stolpec`};var xz={};xz={ascending:`rastući`,ascendingSort:e=>`sortirano po kolonama ${e.columnName} rastu\u{107}im redosledom`,collapse:`Skupi`,columnSize:e=>`${e.value} piksela`,descending:`padajući`,descendingSort:e=>`sortirano po kolonama ${e.columnName} padaju\u{107}im redosledom`,expand:`Proširi`,resizerDescription:`Pritisnite Enter da biste započeli promenu veličine`,select:`Izaberite`,selectAll:`Izaberite sve`,sortable:`kolona koja se može sortirati`};var Sz={};Sz={ascending:`stigande`,ascendingSort:e=>`sorterat p\xe5 kolumn ${e.columnName} i stigande ordning`,collapse:`Dölj`,columnSize:e=>`${e.value} pixlar`,descending:`fallande`,descendingSort:e=>`sorterat p\xe5 kolumn ${e.columnName} i fallande ordning`,expand:`Expandera`,resizerDescription:`Tryck på Retur för att börja ändra storlek`,select:`Markera`,selectAll:`Markera allt`,sortable:`sorterbar kolumn`};var Cz={};Cz={ascending:`artan sırada`,ascendingSort:e=>`${e.columnName} s\xfctuna g\xf6re artan d\xfczende s\u{131}rala`,collapse:`Daralt`,columnSize:e=>`${e.value} piksel`,descending:`azalan sırada`,descendingSort:e=>`${e.columnName} s\xfctuna g\xf6re azalan d\xfczende s\u{131}rala`,expand:`Genişlet`,resizerDescription:`Yeniden boyutlandırmak için Enter'a basın`,select:`Seç`,selectAll:`Tümünü Seç`,sortable:`Sıralanabilir sütun`};var wz={};wz={ascending:`висхідний`,ascendingSort:e=>`\u{432}\u{456}\u{434}\u{441}\u{43E}\u{440}\u{442}\u{43E}\u{432}\u{430}\u{43D}\u{43E} \u{437}\u{430} \u{441}\u{442}\u{43E}\u{432}\u{43F}\u{446}\u{435}\u{43C} ${e.columnName} \u{443} \u{432}\u{438}\u{441}\u{445}\u{456}\u{434}\u{43D}\u{43E}\u{43C}\u{443} \u{43F}\u{43E}\u{440}\u{44F}\u{434}\u{43A}\u{443}`,collapse:`Згорнути`,columnSize:e=>`${e.value} \u{43F}\u{456}\u{43A}\u{441}.`,descending:`низхідний`,descendingSort:e=>`\u{432}\u{456}\u{434}\u{441}\u{43E}\u{440}\u{442}\u{43E}\u{432}\u{430}\u{43D}\u{43E} \u{437}\u{430} \u{441}\u{442}\u{43E}\u{432}\u{43F}\u{446}\u{435}\u{43C} ${e.columnName} \u{443} \u{43D}\u{438}\u{437}\u{445}\u{456}\u{434}\u{43D}\u{43E}\u{43C}\u{443} \u{43F}\u{43E}\u{440}\u{44F}\u{434}\u{43A}\u{443}`,expand:`Розгорнути`,resizerDescription:`Натисніть Enter, щоб почати зміну розміру`,select:`Вибрати`,selectAll:`Вибрати все`,sortable:`сортувальний стовпець`};var Tz={};Tz={ascending:`升序`,ascendingSort:e=>`\u{6309}\u{5217} ${e.columnName} \u{5347}\u{5E8F}\u{6392}\u{5E8F}`,collapse:`折叠`,columnSize:e=>`${e.value} \u{50CF}\u{7D20}`,descending:`降序`,descendingSort:e=>`\u{6309}\u{5217} ${e.columnName} \u{964D}\u{5E8F}\u{6392}\u{5E8F}`,expand:`扩展`,resizerDescription:`按 Enter 开始调整大小。`,select:`选择`,selectAll:`全选`,sortable:`可排序的列`};var Ez={};Ez={ascending:`遞增`,ascendingSort:e=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${e.columnName}\u{300D}\u{6B04}\u{905E}\u{589E}\u{6392}\u{5E8F}`,collapse:`收合`,columnSize:e=>`${e.value} \u{50CF}\u{7D20}`,descending:`遞減`,descendingSort:e=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${e.columnName}\u{300D}\u{6B04}\u{905E}\u{6E1B}\u{6392}\u{5E8F}`,expand:`展開`,resizerDescription:`按 Enter 鍵以開始調整大小`,select:`選取`,selectAll:`全選`,sortable:`可排序的欄`};var Dz={};Dz={"ar-AE":qR,"bg-BG":JR,"cs-CZ":YR,"da-DK":XR,"de-DE":ZR,"el-GR":QR,"en-US":$R,"es-ES":ez,"et-EE":tz,"fi-FI":nz,"fr-FR":rz,"he-IL":iz,"hr-HR":az,"hu-HU":oz,"it-IT":sz,"ja-JP":cz,"ko-KR":lz,"lt-LT":uz,"lv-LV":dz,"nb-NO":fz,"nl-NL":pz,"pl-PL":mz,"pt-BR":hz,"pt-PT":gz,"ro-RO":_z,"ru-RU":vz,"sk-SK":yz,"sl-SI":bz,"sr-SP":xz,"sv-SE":Sz,"tr-TR":Cz,"uk-UA":wz,"zh-CN":Tz,"zh-TW":Ez};var Oz=class extends RR{isCell(e){return e.type===`cell`||e.type===`rowheader`||e.type===`column`}getKeyBelow(e,t){let n=this.collection.getItem(e);if(!n)return null;if(n.type===`column`){let e=gx(hx(n,this.collection));if(e)return e.key;let t=this.getFirstKey();return t==null||!this.collection.getItem(t)?null:super.getKeyForItemInRowByIndex(t,n.index)}return super.getKeyBelow(e,t)}getKeyAbove(e,t){let n=this.collection.getItem(e);if(!n)return null;if(n.type===`column`){let e=n.parentKey==null?null:this.collection.getItem(n.parentKey);return e&&e.type===`column`?e.key:null}let r=super.getKeyAbove(e,t),i=r==null?null:this.collection.getItem(r);return i&&i.type!==`headerrow`?r:this.isCell(n)?this.collection.columns[n.index].key:this.collection.columns[0].key}findNextColumnKey(e){let t=this.findNextKey(e.key,e=>e.type===`column`);if(t!=null)return t;let n=this.collection.headerRows[e.level];for(let e of hx(n,this.collection))if(e.type===`column`)return e.key;return null}findPreviousColumnKey(e){let t=this.findPreviousKey(e.key,e=>e.type===`column`);if(t!=null)return t;let n=this.collection.headerRows[e.level],r=[...hx(n,this.collection)];for(let e=r.length-1;e>=0;e--){let t=r[e];if(t.type===`column`)return t.key}return null}getKeyRightOf(e){let t=this.collection.getItem(e);return t?t.type===`column`?this.direction===`rtl`?this.findPreviousColumnKey(t):this.findNextColumnKey(t):super.getKeyRightOf(e):null}getKeyLeftOf(e){let t=this.collection.getItem(e);return t?t.type===`column`?this.direction===`rtl`?this.findNextColumnKey(t):this.findPreviousColumnKey(t):super.getKeyLeftOf(e):null}getKeyForSearch(e,t){if(!this.collator)return null;let n=this.collection,r=t??this.getFirstKey();if(r==null)return null;let i=n.getItem(r);i?.type===`cell`&&(r=i.parentKey??null);let a=!1;for(;r!=null;){let o=n.getItem(r);if(!o)return null;if(o.textValue){let t=o.textValue.slice(0,e.length);if(this.collator.compare(t,e)===0)return o.key}for(let r of hx(o,this.collection)){let a=n.columns[r.index];if(n.rowHeaderColumnKeys.has(a.key)&&r.textValue){let a=r.textValue.slice(0,e.length);if(this.collator.compare(a,e)===0)return(t==null?i:n.getItem(t))?.type===`cell`?r.key:o.key}}r=this.getKeyBelow(r),r==null&&!a&&(r=this.getFirstKey(),a=!0)}return null}};function kz(e){return e&&e.__esModule?e.default:e}function Az(e,t,n){let{keyboardDelegate:r,isVirtualized:i,layoutDelegate:a,layout:o}=e,s=lx({usage:`search`,sensitivity:`base`}),{direction:c}=rp(),l=t.selectionManager.disabledBehavior,u=(0,v.useMemo)(()=>r||new Oz({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:l,ref:n,direction:c,collator:s,layoutDelegate:a,layout:o}),[r,t.collection,t.disabledKeys,l,n,c,s,a,o]),d=es(e.id);HR.set(t,d);let{gridProps:f}=VR({...e,id:d,keyboardDelegate:u},t,n);i&&(f[`aria-rowcount`]=t.collection.size+t.collection.headerRows.length),t.treeColumn!=null&&(f.role=`treegrid`);let{column:p,direction:m}=t.sortDescriptor||{},h=rv(kz(Dz),`@react-aria/table`),g=(0,v.useMemo)(()=>{let e=t.collection.columns.find(e=>e.key===p)?.textValue??``;return m&&p?h.format(`${m}Sort`,{columnName:e}):void 0},[m,p,t.collection.columns]),_=tc(g);return zs(()=>{g&&Op(g,`assertive`,500)},[g]),{gridProps:U(f,_,{"aria-describedby":[_[`aria-describedby`],f[`aria-describedby`]].filter(Boolean).join(` `)})}}function jz(e,t,n){let{node:r,isVirtualized:i,focusMode:a,allowsArrowNavigation:o,shouldSelectOnPressUp:s,onAction:c}=e,{direction:l}=rp(),{keyboardDelegate:u,actions:{onCellAction:d},keyboardNavigationBehavior:f}=BR.get(t),p=a??(f===`tab`?`cell`:`child`),m=(0,v.useRef)(null),h=()=>{if(n.current){let e=Hg(n.current);if(p===`child`){if(gs(n.current)&&n.current!==ms(is(n.current)))return;let r=t.selectionManager.childFocusStrategy===`last`?Mz(e):e.firstChild();if(r){sm(r);return}}(m.current!=null&&r.key!==m.current||!gs(n.current))&&sm(n.current)}},{itemProps:g,isPressed:_}=fx({selectionManager:t.selectionManager,key:r.key,ref:n,isVirtualized:i,focus:h,shouldSelectOnPressUp:s,onAction:d?()=>d(r.key):c,isDisabled:t.collection.size===0}),y=U(g,{role:`gridcell`,onKeyDownCapture:f!==`tab`||o?e=>{let i=ms(is(n.current));if(!ps(e.currentTarget,H(e))||t.isKeyboardNavigationDisabled||!n.current||!i)return;let a=Hg(n.current);switch(a.currentNode=i,e.key){case`ArrowLeft`:{let t=l===`rtl`?a.nextNode():a.previousNode();if(p===`child`&&t===n.current&&(t=null),e.preventDefault(),e.stopPropagation(),t)sm(t),ic(t,{containingElement:Gs(n.current)});else{if(u.getKeyLeftOf?.(r.key)!==r.key){n.current.parentElement?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent));break}p===`cell`&&l===`rtl`?(sm(n.current),ic(n.current,{containingElement:Gs(n.current)})):(a.currentNode=n.current,t=l===`rtl`?a.firstChild():Mz(a),t&&(sm(t),ic(t,{containingElement:Gs(n.current)})))}break}case`ArrowRight`:{let t=l===`rtl`?a.previousNode():a.nextNode();if(p===`child`&&t===n.current&&(t=null),e.preventDefault(),e.stopPropagation(),t)sm(t),ic(t,{containingElement:Gs(n.current)});else{if(u.getKeyRightOf?.(r.key)!==r.key){n.current.parentElement?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent));break}p===`cell`&&l===`ltr`?(sm(n.current),ic(n.current,{containingElement:Gs(n.current)})):(a.currentNode=n.current,t=l===`rtl`?Mz(a):a.firstChild(),t&&(sm(t),ic(t,{containingElement:Gs(n.current)})))}break}case`ArrowUp`:case`ArrowDown`:!e.altKey&&ps(n.current,H(e))&&(e.stopPropagation(),e.preventDefault(),n.current.parentElement?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent)))}}:void 0,onKeyDown:f===`tab`?e=>{let r=ms(is(n.current));if(!(!ps(e.currentTarget,H(e))||t.isKeyboardNavigationDisabled||!n.current||!r)){if(f===`tab`&&H(e)!==n.current&&e.key!==`Tab`){e.stopPropagation();return}if(e.key===`Tab`&&f===`tab`){let t=Hg(n.current,{tabbable:!0});t.currentNode=r,(e.shiftKey?t.previousNode():t.nextNode())&&e.stopPropagation()}}}:void 0,"aria-colspan":r.colSpan,"aria-colindex":r.colIndex==null?void 0:r.colIndex+1,colSpan:i?void 0:r.colSpan,onFocus:e=>{if(m.current=r.key,H(e)!==n.current){$p()||t.selectionManager.setFocusedKey(r.key);return}p===`child`&&e.relatedTarget&&ps(n.current,e.relatedTarget)||requestAnimationFrame(()=>{p===`child`&&ms(is(n.current))===n.current&&h()})},...p===`child`&&f===`tab`?{tabIndex:-1}:{}});return i&&(y[`aria-colindex`]=(r.colIndex??r.index)+1),s&&y.tabIndex!=null&&y.onPointerDown==null&&(y.onPointerDown=e=>{let t=e.currentTarget,n=t.getAttribute(`tabindex`);t.removeAttribute(`tabindex`),requestAnimationFrame(()=>{n!=null&&t.setAttribute(`tabindex`,n)})}),{gridCellProps:y,isPressed:_}}function Mz(e){let t=null,n=null;do n=e.lastChild(),n&&(t=n);while(n);return t}function Nz(e){return e&&e.__esModule?e.default:e}function Pz(e,t,n){let{node:r}=e,i=r.props.allowsSorting,{gridCellProps:a}=jz({focusMode:`child`,...e},t,n),o=r.props.isSelectionCell&&t.selectionManager.selectionMode===`single`,{pressProps:s,isPressed:c}=Rm({isDisabled:!i||o,onPress(){t.sort(r.key)},ref:n}),{focusableProps:l}=Em({},n),u,d=t.sortDescriptor?.column===r.key,f=t.sortDescriptor?.direction;r.props.allowsSorting&&!bo()&&(u=d?f:`none`);let p=rv(Nz(Dz),`@react-aria/table`),m;i&&(m=`${p.format(`sortable`)}`,d&&f&&bo()&&(m=`${m}, ${p.format(f)}`));let h=tc(m),g=t.collection.size===0;return(0,v.useEffect)(()=>{g&&t.selectionManager.focusedKey===r.key&&t.selectionManager.setFocusedKey(null)},[g,t.selectionManager,r.key]),{columnHeaderProps:{...U(l,a,s,h,g?{tabIndex:-1}:null),role:`columnheader`,id:WR(t,r.key),"aria-colspan":r.colSpan&&r.colSpan>1?r.colSpan:void 0,"aria-sort":u},isPressed:c}}function Fz(e,t,n){let{node:r,isVirtualized:i,shouldSelectOnPressUp:a,onAction:o}=e,{actions:s,shouldSelectOnPressUp:c}=BR.get(t),l=s.onRowAction?()=>s.onRowAction?.(r.key):o,{itemProps:u,...d}=fx({selectionManager:t.selectionManager,key:r.key,ref:n,isVirtualized:i,shouldSelectOnPressUp:c||a,onAction:l||r?.props?.onAction?rs(r?.props?.onAction,l):void 0,isDisabled:t.collection.size===0}),f=t.selectionManager.isSelected(r.key),p={role:`row`,"aria-selected":t.selectionManager.selectionMode===`none`?void 0:f,"aria-disabled":d.isDisabled||void 0,...u};return i&&(p[`aria-rowindex`]=r.index+1),{rowProps:p,...d}}function Iz(e){return e&&e.__esModule?e.default:e}var Lz={expand:{ltr:`ArrowRight`,rtl:`ArrowLeft`},collapse:{ltr:`ArrowLeft`,rtl:`ArrowRight`}};function Rz(e,t,n){let{node:r,isVirtualized:i}=e,{rowProps:a,...o}=Fz(e,t,n),{direction:s}=rp();i&&t.treeColumn==null?a[`aria-rowindex`]=r.index+1+t.collection.headerRows.length:delete a[`aria-rowindex`];let c=t.treeColumn!=null&&(t.expandedKeys===`all`||t.expandedKeys.has(r.key)),l=rv(Iz(Dz),`@react-aria/table`),u=Fs({"aria-label":c?l.format(`collapse`):l.format(`expand`),"aria-labelledby":KR(t,r.key)}),d={},f={};if(t.treeColumn!=null){let e=t.collection.getItem(r.key);if(e!=null){let n=zz(t.collection,r),i=e.props?.hasChildRows||e.props?.UNSTABLE_childItems||n?.type!==`cell`,a=t.collection.getItem(r.parentKey),c=a.type===`tablebody`||a.type===`body`,l=zz(t.collection,a);for(;l&&l.type!==`item`&&l.prevKey!=null;)l=t.collection.getItem(l.prevKey);d={onKeyDown:n=>{n.key===Lz.expand[s]&&t.selectionManager.focusedKey===e.key&&i&&t.expandedKeys!==`all`&&!t.expandedKeys.has(e.key)?(t.toggleKey(e.key),n.stopPropagation()):n.key===Lz.collapse[s]&&t.selectionManager.focusedKey===e.key&&(t.expandedKeys===`all`?t.expandedKeys===`all`&&(t.toggleKey(e.key),n.stopPropagation()):i&&t.expandedKeys.has(e.key)?(t.toggleKey(e.key),n.stopPropagation()):!t.expandedKeys.has(e.key)&&e.parentKey!=null&&e.level>0&&(t.selectionManager.setFocusedKey(e.parentKey),n.stopPropagation()))},"aria-expanded":i?t.expandedKeys===`all`||t.expandedKeys.has(r.key):void 0,"aria-level":e.level+1,"aria-posinset":e.index-(c?0:t.collection.columnCount)+1,"aria-setsize":l.index-(c?0:t.collection.columnCount)+1},f={isDisabled:o.isDisabled,onPress:()=>{o.isDisabled||(t.toggleKey(r.key),t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(r.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...u}}}let p=No(r.props),m=o.hasAction?p:{};return{rowProps:{...U(a,d,m),"aria-labelledby":KR(t,r.key)},expandButtonProps:f,...o}}function zz(e,t){return`lastChildKey`in t?t.lastChildKey==null?null:e.getItem(t.lastChildKey):Array.from(t.childNodes).findLast(e=>e.parentKey===t.key)}function Bz(e,t,n){let{node:r,isVirtualized:i}=e,a={role:`row`};return i&&t.treeColumn==null&&(a[`aria-rowindex`]=r.index+1),{rowProps:a}}function Vz(e,t,n){let{gridCellProps:r,isPressed:i}=jz(e,t,n),a=e.node.column?.key;return a!=null&&t.collection.rowHeaderColumnKeys.has(a)&&(r.role=`rowheader`,r.id=GR(t,e.node.parentKey,a)),{gridCellProps:r,isPressed:i}}function Hz(e){return e&&e.__esModule?e.default:e}function Uz(e,t){let{key:n}=e,{checkboxProps:r}=pR(e,t);return{checkboxProps:{...r,"aria-labelledby":`${r.id} ${KR(t,n)}`}}}function Wz(e){let{isEmpty:t,isSelectAll:n,selectionMode:r}=e.selectionManager;return{checkboxProps:{"aria-label":rv(Hz(Dz),`@react-aria/table`).format(r===`single`?`select`:`selectAll`),isSelected:n,isDisabled:r!==`multiple`||e.collection.size===0||e.collection.rows.length===1&&e.collection.rows[0].type===`loader`,isIndeterminate:!t&&!n,onChange:()=>e.selectionManager.toggleSelectAll()}}}function Gz(e){return e&&e.__esModule?e.default:e}function Kz(e,t,n){let{column:r,triggerRef:i,isDisabled:a,onResizeStart:o,onResize:s,onResizeEnd:c,"aria-label":l}=e,u=rv(Gz(Dz),`@react-aria/table`),d=es(),f=t.resizingColumn===r.key,p=(0,v.useRef)(f),m=(0,v.useRef)(null),h=(0,v.useRef)(!1),g=t.tableState.isKeyboardNavigationDisabled,[_,y]=(0,v.useState)(!1),{direction:b}=rp(),x=(0,v.useCallback)(e=>{p.current||(m.current=t.updateResizedColumns(e.key,t.getColumnWidth(e.key)),t.startResize(e.key),t.tableState.setKeyboardNavigationDisabled(!0),o?.(m.current)),p.current=!0},[t,o]),S=(0,v.useCallback)((e,n)=>{let r=t.updateResizedColumns(e.key,n);s?.(r),m.current=r},[t,s]),C=(0,v.useCallback)(e=>{p.current&&(m.current??=t.updateResizedColumns(e.key,t.getColumnWidth(e.key)),t.endResize(),t.tableState.setKeyboardNavigationDisabled(!1),c?.(m.current),p.current=!1,i?.current&&!h.current&&sm(i.current)),m.current=null},[t,i,c]),w=()=>{if(g){C(r);return}return!1},{keyboardProps:T}=Sm({shortcuts:{Escape:()=>w(),Enter:()=>{g?C(r):x(r)}," ":()=>w(),Tab:()=>w()}}),E=(0,v.useRef)(0),{moveProps:D}=uT({onMoveStart(e){E.current=t.getColumnWidth(r.key),e.pointerType===`mouse`&&y(!0),x(r)},onMove(e){let{deltaX:t,deltaY:n,pointerType:i}=e;b===`rtl`&&(t*=-1),i===`keyboard`&&(n!==0&&t===0&&(t=n*-1),t*=10),t!==0&&(E.current+=t,S(r,E.current))},onMoveEnd(e){let{pointerType:t}=e;E.current=0,y(!1),(t===`mouse`||t===`touch`&&h.current)&&C(r)}}),O=(0,v.useCallback)(e=>{g&&D.onKeyDown?.(e)},[g,D]),k=Math.floor(t.getColumnMinWidth(r.key)),A=Math.floor(t.getColumnMaxWidth(r.key));A===1/0&&(A=2**53-1);let j=Math.floor(t.getColumnWidth(r.key)),M=rm();M===`virtual`&&typeof window<`u`&&`ontouchstart`in window&&(M=`touch`);let N=tc(i?.current==null&&(M===`keyboard`||M===`virtual`)&&!f?u.format(`resizerDescription`):void 0),P={"aria-label":l,"aria-orientation":`horizontal`,"aria-labelledby":`${d} ${WR(t.tableState,r.key)}`,"aria-valuetext":u.format(`columnSize`,{value:j}),type:`range`,min:k,max:A,value:j,...N},ee=(0,v.useCallback)(()=>{n.current&&sm(n.current)},[n]),F=t.resizingColumn,I=(0,v.useRef)(null),L=Rs(x);(0,v.useEffect)(()=>{if(I.current!==F&&F!=null&&F===r.key){h.current=ms()===n.current,L(r);let e=setTimeout(()=>ee(),0),t=setTimeout(ee,400);return()=>{clearTimeout(e),clearTimeout(t)}}I.current=F},[F,r,ee,n]);let te=e=>{let n=t.getColumnWidth(r.key),i=parseFloat(H(e).value);i=i>n?n+10:n-10,S(r,i)},{pressProps:R}=Rm({preventFocusOnPress:!0,onPressStart:e=>{if(!(e.ctrlKey||e.altKey||e.metaKey||e.shiftKey||e.pointerType===`keyboard`)){if(e.pointerType===`virtual`&&t.resizingColumn!=null){C(r);return}ee(),e.pointerType!==`virtual`&&x(r)}},onPress:e=>{(e.pointerType===`touch`&&h.current||e.pointerType===`mouse`)&&t.resizingColumn!=null&&C(r)}}),{visuallyHiddenProps:z}=av();return{resizerProps:U(T,{...D,onKeyDown:O},R,{style:{touchAction:`none`}}),inputProps:U(z,{id:d,onBlur:()=>{C(r)},onChange:te,disabled:a},P),isResizing:f,isMouseResizing:_}}function qz(){return{rowGroupProps:{role:`rowgroup`}}}function Jz(){return qz()}function Yz(e){return e&&e.__esModule?e.default:e}var Xz=class extends Ev{withExpandedKeys(e){let t=this.clone();return t.expandedKeys=e,t.frozen=this.frozen,t.rows=Array.from(t.getRows()),t}addNode(e){super.addNode(e),this.columnsDirty||=e.type===`column`,e.type===`tableheader`&&(this.head=e)}getRows(){let e=[];for(let t of this)(t.type===`tablebody`||t.type===`tablefooter`)&&e.push(...this.getChildren(t.key));return e}get body(){for(let e of this)if(e.type===`tablebody`)return e;return new _B(-2)}commit(e,t,n=!1){this.updateColumns(n),this.firstKey=e,this.lastKey=t,this.rows=[];for(let e of this.getRows()){let t=e.lastChildKey;if(t!=null){let e=this.getItem(t);for(;e&&e.type!==`cell`;)e=e.prevKey==null?null:this.getItem(e.prevKey);if(e){let t=(e.colIndex??e.index)+(e.colSpan??1);if(t!==this.columns.length&&!n)throw Error(`Cell count must match column count. Found ${t} cells and ${this.columns.length} columns.`)}}this.rows.push(e)}super.commit(e,t,n)}updateColumns(e){if(!this.columnsDirty)return;this.rowHeaderColumnKeys=new Set,this.columns=[];let t=new Map,n=e=>{e.type===`column`&&(t.set(e.key,e),e.hasChildNodes||(e.index=this.columns.length,this.columns.push(e),e.props.isRowHeader&&this.rowHeaderColumnKeys.add(e.key)));for(let t of this.getChildren(e.key))n(t)};for(let e of this.getChildren(this.head.key))n(e);if(this.headerRows=CR(t,this.columns),this.columnsDirty=!1,this.rowHeaderColumnKeys.size===0&&this.columns.length>0&&!e)throw Error(`A table must have at least one Column with the isRowHeader prop set to true`)}get columnCount(){return this.columns.length}*[Symbol.iterator](){let e=this.firstKey;for(;e!=null;){let t=this.getItem(e);t&&(yield t),e=t?.nextKey??null}}getFirstKey(){for(let e of this)if(e.type===`tablebody`)return e.firstChildKey??null;return null}getLastKey(){let e=this.lastKey;if(e==null)return null;let t=this.getItem(e);for(;t?.lastChildKey!=null&&(t.type!==`item`||this.expandedKeys.has(t.key));)t=this.getItem(t.lastChildKey);return t?.key}getKeyAfter(e){let t=this.getItem(e);if(t?.type===`column`)return t.nextKey??null;if(!t)return null;if(t.type===`item`&&t.firstChildKey!=null&&this.expandedKeys.has(t.key)){let e=this.getItem(t.firstChildKey);for(;e;){if(e.type===`item`)return e.key;e=e.nextKey==null?null:this.getItem(e.nextKey)}}return super.getKeyAfter(e)}getKeyBefore(e){let t=this.getItem(e);if(t?.type===`column`)return t.prevKey??null;if(!t)return null;let n=null;if(t.prevKey!=null){for(t=this.getItem(t.prevKey);t&&(t.type!==`item`||this.expandedKeys.has(t.key))&&t.lastChildKey!=null;)t=this.getItem(t.lastChildKey);n=t?.key??null}return n??=t.parentKey,n!=null&&this.getItem(n)?.type===`tableheader`?null:n}getChildren(e){let t=this.getItem(e);if(!t){for(let t of this.headerRows)if(t.key===e)return t.childNodes}let n=this;return t?.type===`tablebody`||t?.type===`tablefooter`?{*[Symbol.iterator](){let e=t.firstChildKey,r=e==null?null:n.getItem(e);for(;r;){yield r;let e=n.getKeyAfter(r.key);if(r=e==null?null:n.getItem(e),r&&r.parentKey===t.parentKey)break}}}:{*[Symbol.iterator](){let t=n.getItem(e),r=t?.firstChildKey==null?null:n.getItem(t.firstChildKey);for(;r&&(yield r,r=r.nextKey==null?null:n.getItem(r.nextKey),t?.type!==`item`||r?.type===`cell`););}}}clone(){let e=super.clone();return e.headerRows=this.headerRows,e.columns=this.columns,e.rows=this.rows,e.rowHeaderColumnKeys=this.rowHeaderColumnKeys,e.head=this.head,e}getTextValue(e){let t=this.getItem(e);if(!t)return``;if(t.textValue)return t.textValue;let n=this.rowHeaderColumnKeys,r=[];for(let t of this.getChildren(e)){let e=this.columns[t.index];if(n.has(e.key)&&t.textValue&&r.push(t.textValue),r.length===n.size)break}return r.join(` `)}constructor(...e){super(...e),this.headerRows=[],this.columns=[],this.rows=[],this.rowHeaderColumnKeys=new Set,this.head=new sB(-1),this.columnsDirty=!0,this.expandedKeys=new Set}},Zz=(0,v.createContext)(null),Qz=(0,v.forwardRef)(function(e,t){let n=Is(t),r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)(0);Io(()=>{let e=r.current;for(;e&&e!==n.current&&!Ws(e);)e=e.parentElement;i.current=e},[n]),Hs({ref:i,box:`border-box`,onResize(){o(i.current?.clientWidth??0)}}),Io(()=>{o(i.current?.clientWidth??0)},[]);let s=(0,v.useMemo)(()=>({tableRef:r,scrollRef:i,tableWidth:a,useTableColumnResizeState:NR,onResizeStart:e.onResizeStart,onResize:e.onResize,onResizeEnd:e.onResizeEnd}),[r,a,e.onResizeStart,e.onResize,e.onResizeEnd]);return v.createElement(q.div,{render:e.render,...W(e,{global:!0}),ref:n,className:e.className||`react-aria-ResizableTableContainer`,style:e.style,onScroll:e.onScroll},v.createElement(Zz.Provider,{value:s},e.children))}),$z=(0,v.createContext)(null),eB=(0,v.createContext)(null),tB=(0,v.createContext)(null),nB=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,$z);let n=Hx(e),{selectionBehavior:r,selectionMode:i,disallowEmptySelection:a}=n,o=!!e.dragAndDropHooks?.useDraggableCollectionState,s=(0,v.useMemo)(()=>({selectionBehavior:i===`none`?null:r,selectionMode:i,disallowEmptySelection:a,allowsDragging:o}),[r,i,a,o]),c=v.createElement(oB.Provider,{value:s},v.createElement(Xv,e));return v.createElement(Rv,{content:c,createCollection:()=>new Xz},r=>v.createElement(aB,{props:e,forwardedRef:t,selectionState:n,collection:r}))}),rB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.table,{...e,ref:t})}),iB={expand:{ltr:`ArrowRight`,rtl:`ArrowLeft`},collapse:{ltr:`ArrowLeft`,rtl:`ArrowRight`}};function aB({props:e,forwardedRef:t,selectionState:n,collection:r}){[e,t]=Ff(e,t,Jy);let{shouldUseVirtualFocus:i,disallowTypeAhead:a,filter:o,...s}=e,c=(0,v.useContext)(Zz);t=Is((0,v.useMemo)(()=>ys(t,c?.tableRef),[t,c?.tableRef]));let[l,u]=sh(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,e.onExpandedChange);r=(0,v.useMemo)(()=>r.withExpandedKeys(l),[r,l]);let d=IR({...s,collection:r,children:void 0,UNSAFE_selectionState:n,expandedKeys:l,onExpandedChange:u}),f=LR(d,o),{isVirtualized:p,layoutDelegate:m,dropTargetDelegate:h,CollectionRoot:g}=(0,v.useContext)(ny),{dragAndDropHooks:_}=e,{gridProps:y}=Az({...s,layoutDelegate:m,isVirtualized:p},f,t),b=f.selectionManager,x=!!_?.useDraggableCollectionState,S=!!_?.useDroppableCollectionState;(0,v.useRef)(x),(0,v.useRef)(S),(0,v.useEffect)(()=>{},[x,S]);let C,w,T,E=!1,D=null,O=(0,v.useRef)(null),{direction:k}=rp(),[A]=(0,v.useState)(()=>new yR);if(x&&_){C=_.useDraggableCollectionState({collection:f.collection,selectionManager:b,preview:_.renderDragPreview?O:void 0}),_.useDraggableCollection({},C,t);let e=_.DragPreview;D=_.renderDragPreview?v.createElement(e,{ref:O},_.renderDragPreview):null}if(S&&_){w=_.useDroppableCollectionState({collection:f.collection,selectionManager:b});let e=new sx({collection:f.collection,disabledKeys:b.disabledKeys,disabledBehavior:b.disabledBehavior,ref:t,layoutDelegate:m}),n=_.dropTargetDelegate||h||new _.ListDropTargetDelegate(r.rows,t);A.setup(n,d,k),T=_.useDroppableCollection({keyboardDelegate:e,dropTargetDelegate:A,onDropActivate:e=>{if(e.target.type===`item`){let t=e.target.key,n=d.collection.getItem(t),r=l.has(t);n&&n.hasChildNodes&&(!r||_?.isVirtualDragging?.())&&d.toggleKey(t)}},onKeyDown:e=>{let t=w?.target;if(t&&t.type===`item`&&t.dropPosition===`on`){let n=d.collection.getItem(t.key);(e.key===iB.expand[k]&&n?.hasChildNodes&&!d.expandedKeys.has(t.key)||e.key===iB.collapse[k]&&n?.hasChildNodes&&d.expandedKeys.has(t.key))&&d.toggleKey(t.key)}}},w,t),E=w.isDropTarget({type:`root`})}let{focusProps:j,isFocused:M,isFocusVisible:N}=Jm(),P=Mf({...e,children:void 0,defaultClassName:`react-aria-Table`,values:{isDropTarget:E,isFocused:M,isFocusVisible:N,state:f}}),ee=!!(x&&!C?.isDisabled),F=P.style,I=null;c&&(I=c.useTableColumnResizeState({tableWidth:c.tableWidth},f),p||(F={...F,tableLayout:`fixed`,width:`min-content`}));let L=W(e,{global:!0});return v.createElement(jf,{values:[[eB,f],[tB,I],[wC,{dragAndDropHooks:_,dragState:C,dropState:w}],[TC,{render:DB}],[Jy,null],[Yy,null]]},v.createElement(Sg,null,v.createElement(rB,{...U(L,P,y,j,T?.collectionProps),style:F,ref:t,slot:e.slot||void 0,onScroll:e.onScroll,"data-allows-dragging":ee||void 0,"data-drop-target":E||void 0,"data-focused":M||void 0,"data-focus-visible":N||void 0},v.createElement(eb,null,v.createElement(g,{collection:f.collection,scrollRef:c?.scrollRef??t,persistedKeys:OC(b,_,w)})))),D)}var oB=(0,v.createContext)(null),sB=class extends xv{static{this.type=`tableheader`}},cB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.thead,{...e,ref:t})}),lB=qv(sB,(e,t)=>{let n=(0,v.useContext)(eB).collection,r=jv({items:n.headerRows,children:(0,v.useCallback)(e=>{switch(e.type){case`headerrow`:return v.createElement(dB,{item:e});default:throw Error(`Unsupported node type in TableHeader: `+e.type)}},[])}),{rowGroupProps:i}=Jz(),{hoverProps:a,isHovered:o}=eh({onHoverStart:e.onHoverStart,onHoverChange:e.onHoverChange,onHoverEnd:e.onHoverEnd}),s=Mf({...e,children:void 0,defaultClassName:`react-aria-TableHeader`,values:{isHovered:o}});return v.createElement(cB,{...U(W(e,{global:!0}),i,a),...s,ref:t,"data-hovered":o||void 0},r)},e=>v.createElement(Xv,{dependencies:e.dependencies,items:e.columns},e.children)),uB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(`div`,{...e,ref:t}):v.createElement(`tr`,{...e,ref:t})});function dB({item:e}){let t=(0,v.useRef)(null),n=(0,v.useContext)(eB),{isVirtualized:r,CollectionBranch:i}=(0,v.useContext)(ny),{rowProps:a}=Bz({node:e,isVirtualized:r},n,t),{checkboxProps:o}=Wz(n);return v.createElement(uB,{...a,ref:t},v.createElement(jf,{values:[[Kw,{slots:{selection:o}}],[qw,{slots:{selection:o}}]]},v.createElement(i,{collection:n.collection,parent:e})))}var fB=class extends xv{static{this.type=`column`}},pB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.th,{...e,ref:t})}),mB=Kv(fB,(e,t,n)=>{let r=Is(t),i=(0,v.useContext)(eB),{isVirtualized:a}=(0,v.useContext)(ny),{columnHeaderProps:o,isPressed:s}=Pz({node:n,isVirtualized:a,focusMode:e.focusMode,allowsArrowNavigation:e.allowsArrowNavigation},i,r),{isFocused:c,isFocusVisible:l,focusProps:u}=Jm(),d=(0,v.useContext)(tB),f=!1;d&&(f=d.resizingColumn===n.key);let{hoverProps:p,isHovered:m}=eh({isDisabled:!e.allowsSorting}),h=Mf({...e,id:void 0,children:n.rendered,defaultClassName:`react-aria-Column`,values:{isHovered:m,isPressed:s,isFocused:c,isFocusVisible:l,allowsSorting:n.props.allowsSorting,sortDirection:i.sortDescriptor?.column===n.key?i.sortDescriptor.direction:void 0,isResizing:f,startResize:()=>{if(d)d.startResize(n.key),i.setKeyboardNavigationDisabled(!0);else throw Error(`Wrap your in a to enable column resizing`)},sort:e=>{i.sort(n.key,e)}}}),g=h.style;d&&(g={...g,width:d.getColumnWidth(n.key)});let _=W(e,{global:!0});return delete _.id,v.createElement(pB,{...U(_,o,u,p),...h,style:g,ref:r,"data-hovered":m||void 0,"data-pressed":s||void 0,"data-focused":c||void 0,"data-focus-visible":l||void 0,"data-resizing":f||void 0,"data-allows-sorting":n.props.allowsSorting||void 0,"data-sort-direction":i.sortDescriptor?.column===n.key?i.sortDescriptor.direction:void 0},v.createElement(jf,{values:[[hB,{column:n,triggerRef:r}],[ny,$v]]},h.children))}),hB=(0,v.createContext)(null),gB=(0,v.forwardRef)(function(e,t){let n=(0,v.useContext)(tB);if(!n)throw Error(`Wrap your
in a to enable column resizing`);let r=rv(Yz(CC),`react-aria-components`),{onResizeStart:i,onResize:a,onResizeEnd:o}=(0,v.useContext)(Zz),{column:s,triggerRef:c}=(0,v.useContext)(hB),l=(0,v.useRef)(null),{resizerProps:u,inputProps:d,isResizing:f,isMouseResizing:p}=Kz({column:s,"aria-label":e[`aria-label`]||r.format(`tableResizer`),onResizeStart:i,onResize:a,onResizeEnd:o,triggerRef:c},n,l),{focusProps:m,isFocused:h,isFocusVisible:g}=Jm(),{hoverProps:_,isHovered:y}=eh(e),b=n.getColumnMinWidth(s.key)>=n.getColumnWidth(s.key),x=n.getColumnMaxWidth(s.key)<=n.getColumnWidth(s.key),{direction:S}=rp(),C=`both`;C=b?S===`rtl`?`right`:`left`:x?S===`rtl`?`left`:`right`:`both`;let w=Is(t),[T,E]=(0,v.useState)(``);(0,v.useEffect)(()=>{if(!w.current)return;let e=window.getComputedStyle(w.current);E(e.cursor)},[w,C]);let D=Mf({...e,defaultClassName:`react-aria-ColumnResizer`,values:{isFocused:h,isFocusVisible:g,isResizing:f,isHovered:y,resizableDirection:C}}),O=W(e,{global:!0});return v.createElement(q.div,{ref:w,role:`presentation`,...U(O,D,u,_),"data-hovered":y||void 0,"data-focused":h||void 0,"data-focus-visible":g||void 0,"data-resizing":f||void 0,"data-resizable-direction":C},D.children,v.createElement(`input`,{ref:l,...U(d,m)}),f&&p&&dc.createPortal(v.createElement(`div`,{style:{position:`fixed`,top:0,left:0,bottom:0,right:0,cursor:T},"data-testid":`cursor-overlay`}),document.body))}),_B=class extends Sv{static{this.type=`tablebody`}},vB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.tbody,{...e,ref:t})}),yB=qv(_B,(e,t,n)=>{let r=(0,v.useContext)(eB),{isVirtualized:i}=(0,v.useContext)(ny),a=r.collection,{CollectionBranch:o}=(0,v.useContext)(ny),{dragAndDropHooks:s,dropState:c}=(0,v.useContext)(wC),l=!!s?.useDroppableCollectionState&&!c?.isDisabled,u=l&&!!c&&(c.isDropTarget({type:`root`})??!1),d=a.size===0,f={isDropTarget:u,isEmpty:d},p=Mf({...e,id:void 0,children:void 0,defaultClassName:`react-aria-TableBody`,values:f}),m,h=a.columnCount;if(d&&e.renderEmptyState&&r){let t={},n={},r={};i?(n[`aria-colspan`]=h,r={display:`contents`}):n.colSpan=h,m=v.createElement(SB,{role:`row`,...t,style:r},v.createElement(TB,{role:`rowheader`,...n,style:r},e.renderEmptyState(f)))}let{rowGroupProps:g}=Jz(),_=W(e,{global:!0});return v.createElement(vB,{...U(_,p,g),ref:t,"data-empty":d||void 0},l&&v.createElement(MB,null),v.createElement(o,{collection:a,parent:n,renderDropIndicator:DC(s,c)}),m)});(class extends Sv{static{this.type=`tablefooter`}});var bB=(0,v.createContext)({isFocusVisibleWithinRow:!1}),xB=class extends xv{static{this.type=`item`}filter(e,t,n){let r=e.getChildren(this.key);for(let i of r)if(n(i.textValue,i)){let n=this.clone();return t.addDescendants(n,e),n}return null}},SB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.tr,{...e,ref:t})}),CB=qv(xB,(e,t,n)=>{let r=Is(t),i=(0,v.useContext)(eB),{dragAndDropHooks:a,dragState:o,dropState:s}=(0,v.useContext)(wC),{isVirtualized:c,CollectionBranch:l}=(0,v.useContext)(ny),u=o&&!(o.isDisabled||o.selectionManager.isDisabled(n.key)),{rowProps:d,expandButtonProps:f,...p}=Rz({node:n,shouldSelectOnPressUp:!!o,isVirtualized:c},i,r),{isFocused:m,isFocusVisible:h,focusProps:g}=Jm(),{isFocusVisible:_,focusProps:y}=Jm({within:!0}),{hoverProps:b,isHovered:x}=eh({isDisabled:!p.allowsSelection&&!p.hasAction&&!u,onHoverStart:e.onHoverStart,onHoverChange:e.onHoverChange,onHoverEnd:e.onHoverEnd}),{checkboxProps:S}=Uz({key:n.key},i),C;o&&a&&(C=a.useDraggableItem({key:n.key,hasDragButton:!0},o));let w,T=(0,v.useRef)(null),{visuallyHiddenProps:E}=av();s&&a&&(w=a.useDropIndicator({target:{type:`item`,key:n.key,dropPosition:`on`}},s,T));let D=(0,v.useRef)(null);(0,v.useEffect)(()=>{o&&D.current},[]);let O=o&&o.isDragging(n.key),{children:k,...A}=e,j=e.hasChildItems||i.collection.getItem(n.lastChildKey)?.type!==`cell`,M=j&&i.expandedKeys.has(n.key),N=Mf({...A,id:void 0,defaultClassName:`react-aria-Row`,defaultStyle:{"--table-row-level":n.level+1},values:{...p,state:i,isHovered:x,isFocused:m,isFocusVisible:h,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,isDragging:O,isDropTarget:w?.isDropTarget,isFocusVisibleWithin:_,id:n.key,hasChildItems:j,isExpanded:M,level:n.level+1}}),P=W(e,{global:!0});return delete P.id,delete P.onClick,v.createElement(v.Fragment,null,w&&!w.isHidden&&v.createElement(SB,{role:`row`,style:{height:0}},v.createElement(TB,{role:`gridcell`,colSpan:i.collection.columnCount,style:{padding:0}},v.createElement(`div`,{role:`button`,...E,...w.dropIndicatorProps,ref:T}))),v.createElement(SB,{...U(P,N,d,g,b,C?.dragProps,y),ref:r,"data-disabled":p.isDisabled||void 0,"data-selected":p.isSelected||void 0,"data-hovered":x||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":h||void 0,"data-pressed":p.isPressed||void 0,"data-dragging":O||void 0,"data-drop-target":w?.isDropTarget||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode,"data-focus-visible-within":_||void 0,"data-expanded":M||void 0,"data-has-child-items":j||void 0,"data-level":n.level+1},v.createElement(jf,{values:[[Kw,{slots:{[Af]:{},selection:S}}],[qw,{slots:{[Af]:{},selection:S}}],[th,{slots:{[Af]:{},chevron:f,drag:{...C?.dragButtonProps,ref:D,style:{pointerEvents:`none`}}}}],[nb,{isSelected:p.isSelected}],[bB,{isFocusVisibleWithinRow:_}]]},v.createElement(l,{collection:i.collection,parent:n}))))},e=>{if(e.id==null&&typeof e.children==`function`)throw Error(`No id detected for the Row element. The Row element requires a id to be provided to it when the cells are rendered dynamically.`);let t=[e.value].concat(e.dependencies);return v.createElement(Xv,{dependencies:t,items:e.columns,idScope:e.id},e.children)}),wB=class extends xv{static{this.type=`cell`}},TB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.td,{...e,ref:t})}),EB=Kv(wB,(e,t,n)=>{let r=Is(t),i=(0,v.useContext)(eB),{dragState:a}=(0,v.useContext)(wC),{isVirtualized:o}=(0,v.useContext)(ny);n.column=i.collection.columns[n.index];let{gridCellProps:s,isPressed:c}=Vz({node:n,shouldSelectOnPressUp:!!a,isVirtualized:o,focusMode:e.focusMode,allowsArrowNavigation:e.allowsArrowNavigation},i,r),{isFocused:l,isFocusVisible:u,focusProps:d}=Jm(),{hoverProps:f,isHovered:p}=eh({}),{isFocusVisibleWithinRow:m}=(0,v.useContext)(bB),h=n.parentKey!=null&&i.selectionManager.isSelected(n.parentKey),g=n.colIndex||n.index,_=i.collection.getItem(n.parentKey),y=_.props.hasChildItems||i.collection.getItem(_.lastChildKey)?.type!==`cell`,b=y&&i.expandedKeys.has(n.parentKey),x=i.selectionManager.isDisabled(n.parentKey),S=Mf({...e,id:void 0,defaultClassName:`react-aria-Cell`,values:{isFocused:l,isFocusVisible:u,isFocusVisibleWithinRow:m,isPressed:c,isHovered:p,isSelected:h,id:n.key,columnIndex:g,hasChildItems:y,isExpanded:b,isDisabled:x,level:_.level+1,isTreeColumn:n.column.key===i.treeColumn}}),C=W(e,{global:!0});return delete C.id,v.createElement(TB,{...U(C,S,s,d,f),ref:r,"data-focused":l||void 0,"data-focus-visible":u||void 0,"data-focus-visible-within-row":m||void 0,"data-pressed":c||void 0,"data-selected":h||void 0,"data-column-index":g,"data-expanded":b||void 0,"data-has-child-items":y||void 0,"data-level":_.level+1,"data-tree-column":n.column.key===i.treeColumn||void 0,"data-disabled":x||void 0},v.createElement(ny.Provider,{value:$v},S.children))});function DB(e,t){t=Is(t);let{dragAndDropHooks:n,dropState:r}=(0,v.useContext)(wC),i=(0,v.useRef)(null),{dropIndicatorProps:a,isHidden:o,isDropTarget:s}=n.useDropIndicator(e,r,i);if(o)return null;let c=r&&e.target.type===`item`?(r.collection.getItem(e.target.key)?.level||0)+1:1;return v.createElement(jB,{...e,dropIndicatorProps:a,isDropTarget:s,buttonRef:i,level:c,ref:t})}var OB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.tr,{...e,ref:t})}),kB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.td,{...e,ref:t})});function AB(e,t){let{dropIndicatorProps:n,isDropTarget:r,buttonRef:i,level:a,...o}=e,s=(0,v.useContext)(eB),{visuallyHiddenProps:c}=av(),l=Mf({...o,defaultClassName:`react-aria-DropIndicator`,defaultStyle:{"--table-row-level":a+1},values:{isDropTarget:r}});return v.createElement(OB,{...W(e,{global:!0}),...l,role:`row`,ref:t,"data-drop-target":r||void 0,"aria-level":a},v.createElement(kB,{role:`gridcell`,colSpan:s.collection.columnCount,style:{padding:0}},v.createElement(`div`,{...c,role:`button`,...n,ref:i}),l.children))}var jB=(0,v.forwardRef)(AB);function MB(){let e=(0,v.useContext)(eB),{dragAndDropHooks:t,dropState:n}=(0,v.useContext)(wC),r=(0,v.useRef)(null),{dropIndicatorProps:i}=t.useDropIndicator({target:{type:`root`}},n,r),a=n.isDropTarget({type:`root`}),{visuallyHiddenProps:o}=av();return!a&&i[`aria-hidden`]?null:v.createElement(SB,{role:`row`,"aria-hidden":i[`aria-hidden`],style:{height:0}},v.createElement(TB,{role:`gridcell`,colSpan:e.collection.columnCount,style:{padding:0}},v.createElement(`div`,{role:`button`,...o,...i,ref:r})))}var NB=Kv(Cv,function(e,t,n){let r=(0,v.useContext)(eB),{isVirtualized:i}=(0,v.useContext)(ny),{isLoading:a,onLoadMore:o,scrollOffset:s,...c}=e,l=r.collection.columns.length,u=(0,v.useRef)(null);lc((0,v.useMemo)(()=>({onLoadMore:o,collection:r?.collection,sentinelRef:u,scrollOffset:s}),[o,s,r?.collection]),u);let d=Mf({...c,id:void 0,children:n.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,defaultStyle:{"--table-row-level":n.level+1},values:void 0}),f={},p={},m={};return i?(p[`aria-colspan`]=l,m={display:`contents`}):p.colSpan=l,v.createElement(v.Fragment,null,v.createElement(SB,{style:{height:0},inert:uc(!0)},v.createElement(TB,{style:{padding:0,border:0}},v.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:u,style:{position:`relative`,height:1,width:1}}))),a&&d.children&&v.createElement(SB,{...U(W(e,{global:!0}),f),...d,role:`row`,ref:t,"aria-level":n.level+1,"data-level":n.level+1},v.createElement(TB,{role:`rowheader`,...p,style:m},d.children)))}),PB=({...e})=>(0,G.jsx)(HS,{...e}),FB=Object.assign(PB,{Root:PB}),IB=(0,v.createContext)({}),LB=({children:e,className:t,status:n,...r})=>{let i=v.useMemo(()=>zd({status:n}),[n]);return(0,G.jsx)(IB,{value:{slots:i,status:n},children:(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(K.div,{className:i?.base({className:t}),"data-slot":`alert-root`,...r,children:e})})})},RB=Object.assign(LB,{Root:LB,Indicator:({children:e,className:t,...n})=>{let{slots:r,status:i}=(0,v.use)(IB),a=()=>{switch(i){case`accent`:return(0,G.jsx)(Th,{"data-slot":`alert-default-icon`});case`success`:return(0,G.jsx)(Oh,{"data-slot":`alert-default-icon`});case`warning`:return(0,G.jsx)(Eh,{"data-slot":`alert-default-icon`});case`danger`:return(0,G.jsx)(Dh,{"data-slot":`alert-default-icon`});default:return(0,G.jsx)(Th,{"data-slot":`alert-default-icon`})}};return(0,G.jsx)(K.div,{className:Y(r?.indicator,t),"data-slot":`alert-indicator`,...n,children:e??a()})},Content:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(IB);return(0,G.jsx)(K.div,{className:Y(r?.content,t),"data-slot":`alert-content`,...n,children:e})},Title:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(IB);return(0,G.jsx)(K.p,{className:Y(r?.title,t),"data-slot":`alert-title`,...n,children:e})},Description:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(IB);return(0,G.jsx)(K.span,{className:Y(r?.description,t),"data-slot":`alert-description`,...n,children:e})}}),zB=(0,v.createContext)({}),BB=({children:e,className:t,variant:n,...r})=>{let i=v.useMemo(()=>sf({variant:n}),[n]);return(0,G.jsx)(KC,{className:J(t,i.item()),"data-slot":`list-box-item`,...r,children:t=>(0,G.jsx)(zB,{value:{slots:i,state:t},children:typeof e==`function`?e(t):e})})},VB=({children:e,className:t,...n})=>{let{slots:r,state:i}=(0,v.use)(zB),a=i?.isSelected,o=typeof e==`function`?e(i??{}):e||(0,G.jsx)(`svg`,{"aria-hidden":`true`,"data-slot":`list-box-item-indicator--checkmark`,fill:`none`,role:`presentation`,stroke:`currentColor`,strokeDasharray:22,strokeDashoffset:a?44:66,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 17 18`,children:(0,G.jsx)(`polyline`,{points:`1 9 7 14 15 4`})});return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(r?.indicator,t),"data-slot":`list-box-item-indicator`,"data-visible":a||void 0,...n,children:o})},HB=Object.assign(BB,{Root:BB,Indicator:VB}),UB=({children:e,className:t,...n})=>{let r=v.useMemo(()=>cf({class:typeof t==`string`?t:void 0}),[t]);return(0,G.jsx)(GC,{className:r,...n,children:e})};function WB({className:e,variant:t,...n}){let r=v.useMemo(()=>of({variant:t}),[t]);return(0,G.jsx)(VC,{className:J(e,r),"data-slot":`list-box`,...n})}var GB=Object.assign(WB,{Root:WB,Item:HB,ItemIndicator:VB,Section:UB}),KB=(0,v.createContext)({}),qB=({children:e,className:t,variant:n,...r})=>{let i=v.useMemo(()=>uf({variant:n}),[n]);return(0,G.jsx)(aS,{className:J(t,i.item()),"data-slot":`menu-item`,...r,children:t=>(0,G.jsx)(KB,{value:{slots:i,state:t},children:typeof e==`function`?e(t):e})})},JB=({children:e,className:t,type:n=`checkmark`,...r})=>{let{slots:i,state:a}=(0,v.use)(KB),o=a?.isSelected,s=typeof e==`function`?e(a??{}):e||(n===`dot`?(0,G.jsx)(`svg`,{"aria-hidden":`true`,"data-slot":`menu-item-indicator--dot`,fill:`currentColor`,fillRule:`evenodd`,role:`presentation`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{clipRule:`evenodd`,d:`M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14`,fillRule:`evenodd`})}):(0,G.jsx)(`svg`,{"aria-hidden":`true`,"data-slot":`menu-item-indicator--checkmark`,fill:`none`,role:`presentation`,stroke:`currentColor`,strokeDasharray:22,strokeDashoffset:o?44:66,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 17 18`,children:(0,G.jsx)(`polyline`,{points:`1 9 7 14 15 4`})}));return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(i?.indicator,t),"data-slot":`menu-item-indicator`,"data-type":n,"data-visible":o||void 0,...r,children:s})},YB=({children:e,className:t,...n})=>{let{slots:r,state:i}=(0,v.use)(KB);if(!i?.hasSubmenu)return null;let a=e??(0,G.jsx)(Ch,{});return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(r?.submenuIndicator,t),"data-slot":`submenu-indicator`,...n,children:a})},XB=({children:e,className:t,...n})=>{let r=v.useMemo(()=>df({class:typeof t==`string`?t:void 0}),[t]);return(0,G.jsx)(rS,{className:r,...n,children:e})},ZB=(0,v.createContext)({}),QB=({children:e,...t})=>{let n=v.useMemo(()=>ef(),[]);return(0,G.jsx)(ZB,{value:{slots:n},children:(0,G.jsx)(Xx,{...t,children:e})})},$B=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(ZB);return(0,G.jsx)(nh,{className:J(t,r?.trigger()),"data-slot":`dropdown-trigger`,...n,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})},eV=({children:e,className:t,placement:n,...r})=>{let{slots:i}=(0,v.use)(ZB);return(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(yv,{...r,className:J(t,i?.popover()),"data-slot":`dropdown-popover`,placement:n,children:e})})};function tV({className:e,...t}){let{slots:n}=(0,v.use)(ZB);return(0,G.jsx)($x,{className:J(e,n?.menu()),"data-selection-mode":t.selectionMode,"data-slot":`dropdown-menu`,...t})}var nV=Object.assign(QB,{Root:QB,Trigger:$B,Popover:eV,Menu:tV,Section:e=>(0,G.jsx)(XB,{...e}),Item:e=>(0,G.jsx)(qB,{...e}),ItemIndicator:e=>(0,G.jsx)(JB,{...e}),SubmenuIndicator:e=>(0,G.jsx)(YB,{...e}),SubmenuTrigger:({children:e,...t})=>(0,G.jsx)(Qx,{"data-slot":`dropdown-submenu-trigger`,...t,children:e})}),rV=(0,v.createContext)({}),iV=({children:e,state:t,...n})=>{let r=(0,v.useMemo)(()=>({slots:ff(),placement:void 0}),[]),i=(0,v.useMemo)(()=>t?{isOpen:t.isOpen,onOpenChange:t.setOpen}:{},[t]);return(0,G.jsx)(rV,{value:r,children:(0,G.jsx)(lS,{"data-slot":`modal-root`,...U(n,i),children:e})})},Z=Object.assign(iV,{Root:iV,Trigger:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(yS,{children:(0,G.jsx)(K.div,{className:Y(r?.trigger,t),"data-slot":`modal-trigger`,role:`button`,...n,children:e})})},Backdrop:({children:e,className:t,isDismissable:n=!0,onClick:r,variant:i,...a})=>{let{slots:o}=(0,v.use)(rV),s=(0,v.useMemo)(()=>ff({variant:i}),[i]),c=(0,v.useMemo)(()=>({slots:{...o,...s}}),[o,s]);return(0,G.jsx)(gS,{className:J(t,s?.backdrop()),"data-slot":`modal-backdrop`,isDismissable:n,onClick:e=>{e.stopPropagation(),r?.(e)},...a,children:t=>(0,G.jsxs)(rV,{value:c,children:[typeof e==`function`?e(t):e,` `]})})},Container:({children:e,className:t,placement:n=`auto`,scroll:r,size:i,...a})=>{let{slots:o}=(0,v.use)(rV),s=(0,v.useMemo)(()=>ff({scroll:r,size:i}),[r,i]),c=(0,v.useMemo)(()=>({placement:n,slots:{...o,...s}}),[o,n,s]);return(0,G.jsx)(mS,{className:J(t,s?.container()),"data-placement":n,"data-slot":`modal-container`,...a,children:t=>(0,G.jsx)(rV,{value:c,children:typeof e==`function`?e(t):e})})},Dialog:({children:e,className:t,...n})=>{let{placement:r,slots:i}=(0,v.use)(rV);return(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(uS,{className:Y(i?.dialog,t),"data-placement":r,"data-slot":`modal-dialog`,...n,children:e})})},Header:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(K.div,{className:Y(r?.header,t),"data-slot":`modal-header`,...n,children:e})},Icon:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(K.div,{className:Y(r?.icon,t),"data-slot":`modal-icon`,...n,children:e})},Heading:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(vh,{className:Y(r?.heading,t),"data-slot":`modal-heading`,slot:`title`,...n,children:e})},Body:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(K.div,{className:Y(r?.body,t),"data-slot":`modal-body`,...n,children:e})},Footer:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(K.div,{className:Y(r?.footer,t),"data-slot":`modal-footer`,...n,children:e})},CloseTrigger:({className:e,...t})=>{let{slots:n}=(0,v.use)(rV);return(0,G.jsx)(xS,{className:J(e,n?.closeTrigger()),"data-slot":`modal-close-trigger`,slot:`close`,...t})}}),aV=(0,v.createContext)({}),oV=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=v.useMemo(()=>pf({fullWidth:n,variant:r}),[n,r]);return(0,G.jsx)(aV,{value:{slots:a},children:(0,G.jsx)(gR,{"data-slot":`number-field`,...i,className:J(t,a?.base()),children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})},sV=Object.assign(oV,{Root:oV,Group:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aV);return(0,G.jsx)(DS,{className:J(t,r?.group()),"data-slot":`number-field-group`,...n,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})},Input:({className:e,...t})=>{let{slots:n}=(0,v.use)(aV);return(0,G.jsx)(pT,{className:J(e,n?.input()),"data-slot":`number-field-input`,...t})},IncrementButton:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aV);return(0,G.jsx)(nh,{className:J(t,r?.incrementButton()),"data-slot":`number-field-increment-button`,slot:`increment`,...n,children:e&&v.isValidElement(e)?e:(0,G.jsx)(Ah,{"data-slot":`number-field-increment-button-icon`})})},DecrementButton:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aV);return(0,G.jsx)(nh,{className:J(t,r?.decrementButton()),"data-slot":`number-field-decrement-button`,slot:`decrement`,...n,children:e&&v.isValidElement(e)?e:(0,G.jsx)(kh,{"data-slot":`number-field-decrement-button-icon`})})}}),cV=(0,v.createContext)({}),lV=({children:e,className:t,size:n,...r})=>{let i=v.useMemo(()=>mf({size:n}),[n]);return(0,G.jsx)(cV,{value:{slots:i},children:(0,G.jsx)(K.nav,{"aria-label":`pagination`,"data-slot":`pagination`,role:`navigation`,...r,className:Y(i.base,t),children:e})})};lV.displayName=`HeroUI.Pagination`;var uV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(cV);return(0,G.jsx)(K.div,{className:Y(r?.summary,t),"data-slot":`pagination-summary`,dir:`auto`,...n,children:e})};uV.displayName=`HeroUI.Pagination.Summary`;var dV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(cV);return(0,G.jsx)(K.ul,{className:Y(r?.content,t),"data-slot":`pagination-content`,...n,children:e})};dV.displayName=`HeroUI.Pagination.Content`;var fV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(cV);return(0,G.jsx)(K.li,{className:Y(r?.item,t),"data-slot":`pagination-item`,...n,children:e})};fV.displayName=`HeroUI.Pagination.Item`;var pV=({children:e,className:t,isActive:n,...r})=>{let{slots:i}=(0,v.use)(cV);return(0,G.jsx)(nh,{"aria-current":n?`page`:void 0,className:J(t,i?.link()),"data-active":n?`true`:void 0,"data-slot":`pagination-link`,...r,children:e})};pV.displayName=`HeroUI.Pagination.Link`;var mV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(cV),i=`${r?.link()??``} pagination__link--nav`.trim();return(0,G.jsx)(nh,{className:J(t,i),"data-slot":`pagination-previous`,...n,children:e})};mV.displayName=`HeroUI.Pagination.Previous`;var hV=({children:e,className:t,...n})=>(0,G.jsx)(K.span,{"aria-hidden":`true`,className:t,"data-slot":`pagination-previous-icon`,...n,children:e??(0,G.jsx)(Sh,{})});hV.displayName=`HeroUI.Pagination.PreviousIcon`;var gV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(cV),i=`${r?.link()??``} pagination__link--nav`.trim();return(0,G.jsx)(nh,{className:J(t,i),"data-slot":`pagination-next`,...n,children:e})};gV.displayName=`HeroUI.Pagination.Next`;var _V=({children:e,className:t,...n})=>(0,G.jsx)(K.span,{"aria-hidden":`true`,className:t,"data-slot":`pagination-next-icon`,...n,children:e??(0,G.jsx)(Ch,{})});_V.displayName=`HeroUI.Pagination.NextIcon`;var vV=({className:e,...t})=>{let{slots:n}=(0,v.use)(cV);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(n?.ellipsis,e),"data-slot":`pagination-ellipsis`,...t,children:`…`})};vV.displayName=`HeroUI.Pagination.Ellipsis`;var yV=Object.assign(lV,{Content:dV,Ellipsis:vV,Item:fV,Link:pV,Next:gV,NextIcon:_V,Previous:mV,PreviousIcon:hV,Root:lV,Summary:uV}),bV=(0,v.createContext)({}),xV=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=v.useMemo(()=>_f({fullWidth:n,variant:r}),[n,r]);return(0,G.jsx)(vw,{children:(0,G.jsx)(bV,{value:{slots:a},children:(0,G.jsx)(dw,{"data-slot":`select`,...i,className:J(t,a?.base()),children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})})},SV=Object.assign(xV,{Root:xV,Trigger:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bV);return(0,G.jsx)(nh,{className:J(t,r?.trigger()),"data-slot":`select-trigger`,...n,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})},Value:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bV);return(0,G.jsx)(hw,{className:J(t,r?.value()),"data-slot":`select-value`,...n,children:e})},Indicator:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bV),i=(0,v.use)(uw);return e&&v.isValidElement(e)?v.cloneElement(e,{...n,className:Y(r?.indicator,t),"data-slot":`select-indicator`,"data-open":yh(i?.isOpen)}):(0,G.jsx)(bh,{className:Y(r?.indicator,t),"data-open":yh(i?.isOpen),"data-slot":`select-default-indicator`,...n})},Popover:({children:e,className:t,placement:n=`bottom`,...r})=>{let{slots:i}=(0,v.use)(bV);return(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(yv,{...r,className:J(t,i?.popover()),"data-slot":`select-popover`,placement:n,children:e})})}}),CV=(0,v.createContext)({}),wV=({children:e,className:t,color:n,size:r,...i})=>{let a=v.useMemo(()=>lf({color:n,size:r}),[n,r]);return(0,G.jsx)(FP,{"data-slot":`meter`,...i,className:J(t,a.base()),children:t=>(0,G.jsx)(CV,{value:{slots:a,state:t},children:typeof e==`function`?e(t):e})})};wV.displayName=`HeroUI.Meter`;var TV=({children:e,className:t,...n})=>{let{slots:r,state:i}=(0,v.use)(CV);return(0,G.jsx)(K.span,{className:Y(r?.output,t),"data-slot":`meter-output`,...n,children:e??i?.valueText})};TV.displayName=`HeroUI.Meter.Output`;var EV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(CV);return(0,G.jsx)(K.div,{className:Y(r?.track,t),"data-slot":`meter-track`,...n,children:e})};EV.displayName=`HeroUI.Meter.Track`;var DV=({className:e,style:t,...n})=>{let{slots:r,state:i}=(0,v.use)(CV);return(0,G.jsx)(K.div,{className:Y(r?.fill,e),"data-slot":`meter-fill`,style:{...t,width:`${i?.percentage??0}%`},...n})};DV.displayName=`HeroUI.Meter.Fill`;var OV=Object.assign(wV,{Root:wV,Output:TV,Track:EV,Fill:DV}),kV=(0,v.createContext)({}),AV=({children:e,className:t,variant:n,...r})=>{let i=v.useMemo(()=>xf({variant:n}),[n]);return(0,G.jsx)(kV,{value:{slots:i},children:(0,G.jsx)(K.div,{className:i.base({className:t}),"data-slot":`table`,...r,children:e})})};AV.displayName=`HeroUI.Table`;var jV=({className:e,...t})=>{let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(K.div,{className:Y(n?.scrollContainer,e),"data-slot":`table-scroll-container`,...t})};jV.displayName=`HeroUI.Table.ScrollContainer`;function MV({className:e,...t}){let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(nB,{className:J(e,n?.content()),"data-slot":`table-content`,...t})}MV.displayName=`HeroUI.Table.Content`;function NV({className:e,...t}){let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(lB,{className:J(e,n?.header()),"data-slot":`table-header`,...t})}NV.displayName=`HeroUI.Table.Header`;var PV=({className:e,ref:t,...n})=>{let{slots:r}=(0,v.use)(kV);return(0,G.jsx)(mB,{ref:t,className:J(e,r?.column()),"data-slot":`table-column`,...n})};PV.displayName=`HeroUI.Table.Column`;function FV({className:e,...t}){let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(yB,{className:J(e,n?.body()),"data-slot":`table-body`,...t})}FV.displayName=`HeroUI.Table.Body`;function IV({className:e,...t}){let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(CB,{className:J(e,n?.row()),"data-slot":`table-row`,...t})}IV.displayName=`HeroUI.Table.Row`;var LV=({className:e,ref:t,...n})=>{let{slots:r}=(0,v.use)(kV);return(0,G.jsx)(EB,{ref:t,className:J(e,r?.cell()),"data-slot":`table-cell`,...n})};LV.displayName=`HeroUI.Table.Cell`;var RV=({className:e,...t})=>{let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(K.div,{className:Y(n?.footer,e),"data-slot":`table-footer`,...t})};RV.displayName=`HeroUI.Table.Footer`;var zV=({className:e,ref:t,...n})=>(0,G.jsx)(Qz,{ref:t,className:Ld(`table__resizable-container`,e),"data-slot":`table-resizable-container`,...n});zV.displayName=`HeroUI.Table.ResizableContainer`;var BV=({className:e,ref:t,...n})=>{let{slots:r}=(0,v.use)(kV);return(0,G.jsx)(gB,{ref:t,className:J(e,r?.columnResizer()),"data-slot":`table-column-resizer`,...n})};BV.displayName=`HeroUI.Table.ColumnResizer`;var VV=({className:e,ref:t,...n})=>{let{slots:r}=(0,v.use)(kV);return(0,G.jsx)(NB,{ref:t,className:Y(r?.loadMore,e),"data-slot":`table-load-more`,...n})};VV.displayName=`HeroUI.Table.LoadMore`;var HV=({className:e,...t})=>{let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(K.div,{className:Y(n?.loadMoreContent,e),"data-slot":`table-load-more-content`,...t})};HV.displayName=`HeroUI.Table.LoadMoreContent`;var UV=({children:e,className:t,indicator:n,ref:r,showIndicator:i=!0,sortDirection:a,...o})=>{let{slots:s}=(0,v.use)(kV),c=i&&!!a,l=null;if(c){if(n===void 0)l=(0,G.jsx)(xh,{className:s?.sortableColumnIndicator(),"data-direction":a,"data-slot":`table-sortable-column-indicator`});else if(v.isValidElement(n)){let e=n;l=v.cloneElement(e,{className:Y(s?.sortableColumnIndicator,e.props.className),"data-direction":a,"data-slot":`table-sortable-column-indicator`})}else l=n}return(0,G.jsxs)(`span`,{ref:r,className:Y(s?.sortableColumnHeader,t),"data-direction":a,"data-slot":`table-sortable-column-header`,...o,children:[e,l]})};UV.displayName=`HeroUI.Table.SortableColumnHeader`;var Q=Object.assign(AV,{Body:FV,Cell:LV,Collection:Xv,Column:PV,ColumnResizer:BV,Content:MV,Footer:RV,Header:NV,LoadMore:VV,LoadMoreContent:HV,ResizableContainer:zV,Root:AV,Row:IV,ScrollContainer:jV,SortableColumnHeader:UV}),WV=(0,v.createContext)(null);function GV(){let e=(0,v.use)(WV);if(!e)throw Error(`useYearPicker must be used within a or component.`);return e}function KV(){let e=(0,v.use)(HN),t=(0,v.use)(UN),n=e??t;if(!n)throw Error(`useCalendarOrRangeState must be used within a or component.`);return n}function qV(e){switch(e){case`buddhist`:return 543;case`ethiopic`:case`ethioaa`:return-8;case`coptic`:return-284;case`hebrew`:return 3760;case`indian`:return-78;case`islamic-civil`:case`islamic-tbla`:case`islamic-umalqura`:return-579;case`persian`:return-600;default:return 0}}function JV(e,t){let n=[];if(!e||!t)return n;let r=ED(e);for(;r.compare(t)<=0;)n.push(r),r=ED(r.add({years:1}));return n}function YV(e,t,n,r=`short`,i=`UTC`){let a=new Intl.DateTimeFormat(t,{weekday:r,timeZone:i}),o=DD(e,t,n),s=[],c=o;for(let e=0;e<7;e++){s.push(a.format(c.toDate(i)));let e=c.add({days:1});if(sD(c,e))break;c=e}for(;s.length<7;)s.push(``);return s}function XV(e,t){let n=[],r=e;for(let e=0;e<7;e++){n.push(r.compare(t)>0?null:r);let e=r.add({days:1});if(sD(r,e)){for(;n.length<7;)n.push(null);return n}r=e}return n}function ZV(e,t,n,r){let i=[],a=DD(e,n,r);for(i.push(XV(a,t)),a=a.add({weeks:1});a.compare(t)<=0;){i.push(XV(a,t));let e=a.add({weeks:1});if(sD(a,e))break;a=e}return i}var QV=v.createContext(null);function $V(){let e=v.use(QV);if(!e)throw Error(`CalendarYearPicker trigger components must be used within .`);return e}var eH=({children:e,className:t,onKeyDown:n,onPress:r,...i})=>{let{isYearPickerOpen:a,setIsYearPickerOpen:o}=GV(),s=wN({},KV()),c=v.useMemo(()=>Ud(),[]),l=v.useCallback(()=>{o(!a)},[a,o]),u=e=>{n?.(e),!e.defaultPrevented&&e.key===`Escape`&&a&&(e.preventDefault(),o(!1))},d=v.useMemo(()=>({isOpen:a,monthYear:s,toggle:l}),[l,a,s]),f=v.useMemo(()=>({...d,slots:c}),[c,d]);return(0,G.jsx)(QV,{value:f,children:(0,G.jsx)(nh,{"aria-expanded":a,"aria-label":`${s}, year selector`,className:J(t,c.trigger()),"data-open":a||void 0,"data-slot":`calendar-year-picker-trigger`,slot:null,onKeyDown:u,onPress:e=>{r?.(e),l()},...i,children:typeof e==`function`?e(d):e})})};eH.displayName=`HeroUI.CalendarYearPicker.Trigger`;var tH=({children:e,className:t,format:n,offset:r,...i})=>{let{monthYear:a,slots:o,...s}=$V(),c=KV(),l=wN({format:n,offset:r},c);return(0,G.jsx)(K.span,{className:Y(o.triggerHeading,t),"data-slot":`calendar-year-picker-trigger-heading`,...i,children:typeof e==`function`?e({monthYear:a,...s}):e||l})};tH.displayName=`HeroUI.CalendarYearPicker.TriggerHeading`;var nH=({children:e,className:t,...n})=>{let{monthYear:r,slots:i,...a}=$V();return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(i.triggerIndicator,t),"data-slot":`calendar-year-picker-trigger-indicator`,...n,children:typeof e==`function`?e({monthYear:r,...a}):e||(0,G.jsx)(Ch,{height:`1em`,width:`1em`})})};nH.displayName=`HeroUI.CalendarYearPicker.TriggerIndicator`;var rH=v.createContext(null);function iH(){let e=v.use(rH);if(!e)throw Error(`CalendarYearPicker components must be used within .`);return e}var aH=({children:e,className:t,format:n,onKeyDown:r,visibleYears:i,...a})=>{let{calendarGridSlot:o,calendarRef:s,isYearPickerOpen:c,setIsYearPickerOpen:l}=GV(),u=KV(),d=v.useRef(null),f=v.useMemo(()=>Ud(),[]),{"aria-label":p,items:m,onChange:h,value:g}=CN({format:n,visibleYears:v.useMemo(()=>i??(!u.minValue||!u.maxValue?20:JV(u.minValue,u.maxValue).length),[u.maxValue,u.minValue,i])},u),_=m.map(e=>`${e.id}:${e.date.year}`).join(`|`),y=m.map(e=>e.date.year),b=new Map(m.map(e=>[e.date.year,e])),x=m[g]?.date.year??u.focusedDate.year,S=v.useCallback(e=>b.get(e)?.formatted??String(e),[b]),[C,w]=v.useState(x),T=v.useRef(!1);v.useEffect(()=>{let e=d.current;if(!e)return;let t=s.current?.querySelector(`[data-slot='${o}']`);t&&(e.style.top=`${t.offsetTop}px`,e.style.height=`${t.offsetHeight}px`)},[o,s,u.focusedDate]);let E=v.useCallback(e=>{let t=d.current;if(!t)return;let n=t.querySelector(`[data-year='${e}']`);n&&n.focus()},[]);v.useEffect(()=>{let e=c&&!T.current;if(T.current=c,!e||y.length===0)return;let[t]=y;if(t==null)return;let n=y.includes(x)?x:t;w(n);let r=requestAnimationFrame(()=>{E(n)});return()=>{cancelAnimationFrame(r)}},[E,x,c,_,y.length]),v.useEffect(()=>{if(!c||y.length===0)return;let[e]=y;e!=null&&(y.includes(C)||w(e))},[C,c,_,y]);let D=v.useCallback(e=>{let t=b.get(e);t!=null&&(l(!1),h(t.id))},[b,h,l]),O=e=>{if(r?.(e),e.defaultPrevented)return;if(e.key===`Escape`&&c){e.preventDefault(),l(!1);return}if(!c||y.length===0)return;let t=y.indexOf(C);if(t===-1)return;let n=t;switch(e.key){case`ArrowRight`:n=Math.min(t+1,y.length-1);break;case`ArrowLeft`:n=Math.max(t-1,0);break;case`ArrowDown`:n=Math.min(t+3,y.length-1);break;case`ArrowUp`:n=Math.max(t-3,0);break;case`Home`:n=0;break;case`End`:n=y.length-1;break;default:return}if(n!==t){let t=y[n];if(t==null)return;e.preventDefault(),w(t),E(t)}},k=v.useMemo(()=>({activeYear:C,focusedYear:x,getFormattedYear:S,isYearPickerOpen:c,selectYear:D,setActiveYear:w,slots:f,years:y}),[C,x,S,D,c,f,y]);return(0,G.jsx)(rH,{value:k,children:(0,G.jsx)(K.div,{ref:d,"aria-hidden":!c,"aria-label":p,className:Y(f.yearGrid,t),"data-open":c||void 0,"data-slot":`calendar-year-picker-grid`,role:`listbox`,tabIndex:-1,onKeyDown:O,...a,children:e})})};aH.displayName=`HeroUI.CalendarYearPicker.Grid`;var oH=({children:e})=>{let{focusedYear:t,getFormattedYear:n,isYearPickerOpen:r,selectYear:i,years:a}=iH(),o=new Date().getFullYear();return(0,G.jsx)(G.Fragment,{children:a.map(a=>{let s=a===t,c={formattedYear:n(a),isCurrentYear:a===o,isOpen:r,isSelected:s,selectYear:()=>i(a),year:a};return(0,G.jsx)(v.Fragment,{children:typeof e==`function`?e(c):(0,G.jsx)(sH,{year:a})},a)})})};oH.displayName=`HeroUI.CalendarYearPicker.GridBody`;var sH=({children:e,className:t,excludeFromTabOrder:n,onFocus:r,onPress:i,year:a,...o})=>{let{activeYear:s,focusedYear:c,getFormattedYear:l,isYearPickerOpen:u,selectYear:d,setActiveYear:f,slots:p}=iH(),m=a===c,h=a===s,g=l(a),_={formattedYear:g,isCurrentYear:a===new Date().getFullYear(),isOpen:u,isSelected:m,selectYear:()=>d(a),year:a};return(0,G.jsx)(nh,{"aria-label":g,"aria-selected":m,className:J(t,p.yearCell()),"data-selected":m||void 0,"data-slot":`calendar-year-picker-year-cell`,"data-year":a,excludeFromTabOrder:n??!(u&&h),slot:null,onFocus:e=>{r?.(e),f(a)},onPress:e=>{i?.(e),d(a)},...o,children:typeof e==`function`?e(_):e||g})};sH.displayName=`HeroUI.CalendarYearPicker.Cell`;function cH({children:e,className:t,"data-slot":n=`calendar-grid-body`,firstDayOfWeek:r,visibleRange:i}){let{locale:a}=rp(),o=v.useMemo(()=>ZV(i.start,i.end,a,r),[r,a,i.end,i.start]);return(0,G.jsx)(K.tbody,{className:t,"data-slot":n,children:o.map((t,n)=>(0,G.jsx)(`tr`,{children:t.map((t,n)=>t?v.cloneElement(e(t),{key:n}):(0,G.jsx)(`td`,{},n))},n))})}function lH({children:e,className:t,"data-slot":n=`calendar-grid-header`,firstDayOfWeek:r,timeZone:i=`UTC`,visibleRange:a,weekdayStyle:o=`short`}){let{locale:s}=rp(),c=v.useMemo(()=>YV(a.start,s,r,o,i),[r,s,i,a.start,o]);return(0,G.jsx)(K.thead,{"aria-hidden":!0,className:t,"data-slot":n,children:(0,G.jsx)(`tr`,{children:c.map((t,n)=>v.cloneElement(e(t),{key:n}))})})}var uH=(0,v.createContext)({});function dH({children:e,className:t,defaultYearPickerOpen:n=!1,firstDayOfWeek:r,isYearPickerOpen:i,maxValue:a,minValue:o,onYearPickerOpenChange:s,visibleDuration:c,...l}){let u=c?.weeks!=null,d=c?.days!=null,f=c?.days,{locale:p}=rp(),m=v.useMemo(()=>Wd(),[]),h=v.useRef(null),[g,_]=sh(i,n,s),y=v.useMemo(()=>{let e=new Qk(p).resolvedOptions().calendar;return Xk(e)},[p]),b=v.useMemo(()=>qV(y.identifier),[y.identifier]),x=o??new zO(y,1900+b,1,1),S=a??new zO(y,2099+b,12,31);return(0,G.jsx)(WV,{value:{calendarGridSlot:`range-calendar-grid`,isYearPickerOpen:g,setIsYearPickerOpen:_,calendarRef:h},children:(0,G.jsx)(WN,{ref:h,"data-slot":`range-calendar`,firstDayOfWeek:r,maxValue:S,minValue:x,visibleDuration:c,...l,className:J(t,Ld(m.base(),u&&`range-calendar--week-view`,d&&`range-calendar--day-view`)),children:t=>(0,G.jsx)(uH,{value:{dayView:d&&f!=null?{days:f,firstDayOfWeek:r,timeZone:t.state.timeZone,visibleRange:t.state.visibleRange}:void 0,slots:m},children:typeof e==`function`?e(t):e})})})}dH.displayName=`HeroUI.RangeCalendar`;var fH=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(uH);return(0,G.jsx)(K.header,{className:Y(r?.header,t),"data-slot":`range-calendar-header`,...n,children:e})};fH.displayName=`HeroUI.RangeCalendar.Header`;var pH=({className:e,...t})=>{let{slots:n}=(0,v.use)(uH);return(0,G.jsx)(eP,{"data-slot":`range-calendar-heading`,...t,className:Y(n?.heading,e)})};pH.displayName=`HeroUI.RangeCalendar.Heading`;var mH=({children:e,className:t,slot:n,...r})=>{let{slots:i}=(0,v.use)(uH);return(0,G.jsx)(nh,{"data-slot":`range-calendar-nav-button`,slot:n,...r,className:J(t,i?.navButton()),children:e||(n===`previous`?(0,G.jsx)(Sh,{className:i?.navButtonIcon(),"data-slot":`range-calendar-nav-button-icon`}):(0,G.jsx)(Ch,{className:i?.navButtonIcon(),"data-slot":`range-calendar-nav-button-icon`}))})};mH.displayName=`HeroUI.RangeCalendar.NavButton`;var hH=({children:e,className:t,weekdayStyle:n=`short`,...r})=>{let i=(0,v.use)(uH),{dayView:a,slots:o}=i,s=v.useMemo(()=>({...i,dayView:a?{...a,weekdayStyle:n}:void 0}),[a,i,n]);return(0,G.jsx)(uH,{value:s,children:(0,G.jsx)(KN,{"data-slot":`range-calendar-grid`,weekdayStyle:n,...r,className:Y(o?.grid,t),children:e})})};hH.displayName=`HeroUI.RangeCalendar.Grid`;var gH=({children:e,className:t,...n})=>{let{dayView:r,slots:i}=(0,v.use)(uH);return r&&r.days>=7&&typeof e==`function`?(0,G.jsx)(lH,{className:Y(i?.gridHeader,t),"data-slot":`range-calendar-grid-header`,firstDayOfWeek:r.firstDayOfWeek,timeZone:r.timeZone,visibleRange:r.visibleRange,weekdayStyle:r.weekdayStyle,children:e}):(0,G.jsx)(JN,{"data-slot":`range-calendar-grid-header`,...n,className:Y(i?.gridHeader,t),children:e})};gH.displayName=`HeroUI.RangeCalendar.GridHeader`;var _H=({children:e,className:t,...n})=>{let{dayView:r,slots:i}=(0,v.use)(uH);return r&&r.days>=7&&typeof e==`function`?(0,G.jsx)(cH,{className:Y(i?.gridBody,t),"data-slot":`range-calendar-grid-body`,firstDayOfWeek:r.firstDayOfWeek,visibleRange:r.visibleRange,children:e}):(0,G.jsx)(QN,{"data-slot":`range-calendar-grid-body`,...n,className:Y(i?.gridBody,t),children:e})};_H.displayName=`HeroUI.RangeCalendar.GridBody`;var vH=({className:e,...t})=>{let{slots:n}=(0,v.use)(uH);return(0,G.jsx)(XN,{"data-slot":`range-calendar-header-cell`,...t,className:Y(n?.headerCell,e)})};vH.displayName=`HeroUI.RangeCalendar.HeaderCell`;var yH=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(uH);return(0,G.jsx)($N,{"data-slot":`range-calendar-cell`,...n,className:J(t,r?.cell()),children:t=>{let{formattedDate:n,isDisabled:r,isHovered:i,isPressed:a,isSelectionEnd:o,isSelectionStart:s}=t,c=typeof e==`function`?e(t):e||n;return(0,G.jsx)(`span`,{className:`range-calendar__cell-button`,"data-disabled":yh(r),"data-hovered":yh(i),"data-pressed":yh(a),"data-selected":yh(s||o),"data-slot":`range-calendar-cell-button`,children:c})}})};yH.displayName=`HeroUI.RangeCalendar.Cell`;var bH=({className:e,...t})=>{let{slots:n}=(0,v.use)(uH);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(n?.cellIndicator,e),"data-slot":`range-calendar-cell-indicator`,...t})};bH.displayName=`HeroUI.RangeCalendar.CellIndicator`;var xH=Object.assign(dH,{Root:dH,Header:fH,Heading:pH,NavButton:mH,Grid:hH,GridHeader:gH,GridBody:_H,HeaderCell:vH,Cell:yH,CellIndicator:bH,YearPickerTrigger:eH,YearPickerTriggerHeading:tH,YearPickerTriggerIndicator:nH,YearPickerGrid:aH,YearPickerGridBody:oH,YearPickerCell:sH}),SH={en:{brandSub:`login state gateway`,controlPlane:`control plane`,workspace:`Workspace`,develop:`Develop`,system:`System`,runtimeSnapshot:`Runtime and scheduler snapshot`,routesHint:`OpenAI / Anthropic-compatible routes`,clientConfig:`Client configuration`,clientConfigHint:`Use the same console key as Bearer token`,providerPrefixHint:`Pin a provider with a qoder/, workbuddy/, trae/, devin/, command/, codex/, zhipu/, qwenwork/, or kimi/ model prefix. A named API key can also limit which providers are listed and routed. Bare IDs follow the cross-provider pool setting on System.`,authentication:`Authentication`,curlExample:`curl example`,quickTestHint:`Send a real request through the selected account`,response:`Response`,providerCatalog:`Model catalog`,providerCatalogMeta:`SIGNED-IN / LIVE`,accountPool:`Account pool`,accountCreateHint:`Create an isolated runtime first, then sign in with browser or PAT.`,credentialImportHint:`Only credential bundles exported from this console, with matching user blob and machine ID.`,accountEmptyHint:`Create an account runtime to begin.`,oauthDeviceFlow:`OAuth device flow`,navOverview:`Overview`,navAuth:`Accounts`,navProviders:`Models`,navAccess:`Access & try`,navAccounts:`Accounts`,checkinDefaultsTitle:`Automatic check-in`,checkinDefaultsHint:`Set a default time for each provider. Accounts following the default pick up changes automatically; custom times stay unchanged.`,checkinDisabledAccountsTitle:`Check in disabled accounts`,checkinDisabledAccountsHint:`When enabled, accounts disabled for chat can still run their opted-in automatic check-in. Manual check-in remains unavailable for disabled accounts.`,checkinDisabledAccountsStatus:`Current status`,checkinDisabledAccountsAriaLabel:`Allow automatic check-in for disabled accounts`,checkinInherit:`Follow provider default`,checkinDefaultValue:`Provider default: {time}`,checkinCustom:`Account override`,checkinScheduleHint:`Uses the displayed timezone, normally within about 90 seconds of the chosen time; sequential account processing can take longer. Earlier failures retry once around 21:00. Disabled campaigns are skipped for the day. Chat is unaffected.`,checkinTimeInvalid:`Enter a valid check-in time (HH:mm).`,checkinRecordSkipped:`Activity unavailable`,navUsage:`Usage`,usageTitle:`Usage`,usageLead:`Requests, latency, tokens and credits by model, account and provider.`,usageByModel:`Models`,usageByAccount:`Accounts`,usageByProvider:`Providers`,usageColRequests:`Requests`,usageColSuccess:`Success`,usageColTokens:`Tokens`,usageColCacheWrite:`Cache write`,usageColCredits:`Credits`,usageRowCount:`{count} rows`,usageEmpty:`No requests in this window.`,usageStatsTab:`Stats`,usageCostTab:`Quota`,usageCostLead:`Subscription quota and token usage by model across every provider.`,usageWindow:`Window`,usageWindow24h:`24h`,usageWindow7d:`7d`,usageWindowTotal:`All retained`,usageCredits:`Quota used`,usageCreditsHint:`Subscription credits across all providers`,usageEstCost:`Equivalent cost`,usageTotalTokens:`Total tokens`,usageRequests:`Requests`,usageModelCount:`{count} models`,usageCacheHitRate:`Cache hit`,usageTokenSplitNote:`hit / miss / output`,usageChartTitle:`Usage over time`,usageChartHint:`Stacked by model. Switch between quota and tokens.`,usageChartEmpty:`No usage in this window.`,usageBreakdownTitle:`By model`,usageBreakdownHint:`Tokens and subscription credits for every model.`,usageColInputHit:`Input · cache hit`,usageColInputMiss:`Input · cache miss`,usageColOutput:`Output`,usageColCost:`Equiv. cost`,usageUnpricedCost:`no list price`,usageColSplit:`Peak / off-peak`,usageTotals:`Total`,usageRetentionHint:`Request logs are pruned on a schedule, so “All retained” covers only what is still stored.`,usageRenderNote:`Optional DeepSeek official list-price estimate in CNY. Subscription accounts do not bill this way — for comparison only.`,usagePeakNote:`Peak = Beijing time Mon–Fri 09:00–12:00 & 14:00–18:00; off-peak is half. Holidays are not handled.`,usageUnpricedHint:`No list-price row (quota and tokens only): {models}`,usageNoteTitle:`How this is calculated`,usagePriceTitle:`DeepSeek official price table`,usagePriceHit:`Cache hit`,usagePriceMiss:`Cache miss`,usagePriceOutput:`Output`,usagePriceBandOff:`Off-peak`,usagePriceBandPeak:`Peak`,usageOffPeak:`Off-peak`,usagePeak:`Peak`,usageChartMetric:`Chart metric`,usageEstimateTitle:`DeepSeek list-price estimate`,usageEstimateHint:`Optional CNY comparison for priced models. Collapsed by default.`,usageEstimateChartTitle:`List-price trend`,usageEstimateChartEmpty:`No priced DeepSeek usage in this window.`,chartMetricRequests:`Requests`,chartMetricTokens:`Tokens`,chartMetricLatency:`p95 latency`,chartInput:`Input`,chartOutput:`Output`,chartCacheRead:`Cache read`,chartTotal:`Total`,navLogs:`Logs`,navKeys:`API keys`,navSystem:`System settings`,sidebarFoot:`Gateway for CLI logins`,sidebarInFlight:`In flight: {count}`,systemSettingsTitle:`System settings`,systemSettingsLead:`Manage cross-provider routing, provider check-in defaults, updates, SQLite protection, and the console API key.`,crossProviderModelPoolTitle:`Cross-provider model pool`,crossProviderModelPoolHint:`When enabled, bare model IDs can route across matching Qoder, WorkBuddy, and Trae accounts. When disabled, bare IDs are rejected and requests must use a provider-prefixed model ID.`,crossProviderModelPoolStatus:`Current status`,crossProviderModelPoolAriaLabel:`Enable cross-provider model pool`,workbuddyCheckinSettingsTitle:`WorkBuddy check-in`,workbuddyCheckinSettingsHint:`Default first daily check-in time for new WorkBuddy accounts. Existing accounts keep their own time until you edit them.`,workbuddyCheckinSettingsFieldHint:`Uses server local time. New WorkBuddy accounts inherit this unless you set a different time on the account.`,routingStrategyTitle:`Account routing strategy`,routingStrategyHint:`Choose how ready accounts share traffic. Fill-first keeps traffic on the highest-priority account until it is unavailable.`,routingStrategy:`Strategy`,routingRoundRobin:`Round robin`,routingWeightedRoundRobin:`Weighted round robin`,routingFillFirst:`Fill first`,routingWeight:`Routing weight`,sessionAffinityTTL:`Session TTL`,sessionAffinityHits:`Sticky hits`,sessionAffinityMisses:`Sticky misses`,sessionAffinityEscapes:`Sticky escapes`,lastSessionMiss:`Last miss`,lastSessionEscape:`Last escape`,checkUpdates:`Check updates`,versionUpdate:`Version update`,latestVersionHint:`Download the latest version first, then apply it when you are ready.`,updateAvailable:`Update available`,settingsTabGeneral:`General`,settingsTabRouting:`Routing`,settingsTabSecurity:`Security & data`,settingsTabUpdates:`Updates`,sidebarNewVersion:`New version {version}`,sidebarReleaseNotes:`Release notes`,sidebarGoToUpdate:`History & rollback`,upToDate:`Up to date`,currentVersion:`Current version`,latestVersion:`Latest version`,skippedBetweenLabel:`Versions in between`,releaseNotes:`What changed`,updateNoNotes:`No notes for this version.`,versionHistory:`Version history`,versionCurrentBadge:`Current`,versionLatestBadge:`Latest`,restoreThisVersion:`Restore this version`,restoreVersionTitle:`Restore {version}?`,restoreVersionHint:`The service will switch back to this version. New requests pause only while it restarts.`,updaterReady:`Updates are ready on this host`,updaterUnavailable:`Updates are not available on this host`,updaterNeedsHost:`This process cannot replace its own container`,updaterUnavailableHint:`This page can check for new versions, but this host cannot apply them until updates are set up.`,updaterNeedInstall:`Install the host updater from deploy/install-updater.sh or deploy/install-updater.ps1 so it can talk to Docker.`,updaterNeedCompose:`Linux needs the updater socket mounted into the container. Docker Desktop uses a loopback updater URL instead of a Unix socket.`,updaterNeedRelease:`The running build must be a published GitHub release, not a local or development image.`,updateNow:`Download update`,applyUpdateNow:`Update now`,cancelUpdate:`Cancel download`,discardPreparedImage:`Discard this update`,updateReadyHint:`The update is downloaded. Apply it when you want to restart; new requests pause only then.`,updateReadyTargetHint:`Ready to switch to {version}. New requests pause only during the restart.`,updateNewerReleaseHint:`A newer version is available ({latest}). Update now, or discard this download and start again.`,updateStagedUnavailableHint:`Update the host updater first to use the staged update flow.`,updateLegacyOneShotHint:`This host will download and apply the update in one step. Later versions can download first, then wait for Update now.`,rollbackToVersion:`Restore an older version`,rollbackToVersionHint:`You can restore one of the three most recent versions before the one running now.`,updateReloadingIn:`Refreshing in {seconds}s`,updateInProgress:`Updating…`,updatePreparingImage:`Downloading update…`,updatePreparingImageHint:`Downloading the update in the background. This host stays on the current version until you tap Update now. Cancel if the download hangs.`,updateApplyingHint:`Applying the update. This page will refresh when it is ready.`,updateInProgressHint:`The service is updating and will refresh automatically when it is ready.`,updateUnavailableHint:`Updates are temporarily unavailable. Please try again later.`,updateFailedHint:`The update could not be completed. Please try again.`,updateCheckFailedHint:`Unable to check for updates. Please try again later.`,updatePreparingHint:`Getting the update ready: checking the version and saving a backup. Existing connections may be interrupted; clients can retry.`,updateRunningHint:`The update is running. This page will refresh when it is ready.`,updateReloadingHint:`Update complete. Refreshing this page…`,updateElapsed:`{seconds}s elapsed`,sqliteProtection:`SQLite protection`,sqliteProtectionHint:`Your data stays in place, and a verified backup is created before the update.`,sqliteBackupBeforeUpdate:`Verified backup before the update`,sqliteKeepFive:`Keep the five most recent backups`,sqliteRollbackTogether:`Restore the database and previous version together if the update fails`,updateStatus:`Update status`,noUpdateJob:`No update job yet`,confirmUpdate:`Update now`,confirmUpdateHint:`New requests pause briefly while a backup is created. Existing connections may be interrupted; clients can retry them.`,updateState_idle:`Idle`,updateState_unavailable:`Unavailable`,updateState_queued:`Waiting to start`,updateState_preparing:`Getting ready`,updateState_preparing_image:`Downloading update`,updateState_checking:`Checking version`,updateState_backing_up:`Saving a backup`,updateState_submitting:`Starting update`,updateState_running:`Updating`,updateState_pulling:`Downloading update`,updateState_host_binary:`Downloading update helper`,updateState_image_ready:`Download complete`,updateState_ready_to_apply:`Ready to update`,updateState_recreating:`Restarting`,updateState_health_checking:`Checking that it started`,updateState_rolling_back:`Restoring previous version`,updateState_succeeded:`Updated`,updateState_rolled_back:`Restored previous version`,updateState_failed:`Update failed`,checking:`checking`,refresh:`Refresh`,apiKey:`API key`,apiKeyPh:`API key`,needApiKey:`Sign in with the console password to load data.`,loginTitle:`Enter the console`,loginLead:`This host already has a running CLI2API proxy. Use the same API key your clients send to /v1.`,loginDesc:`Same key as Authorization: Bearer on the API.`,loginFormTitle:`Continue`,loginPassword:`Console password`,loginPasswordPh:`API key`,loginNeedKey:`Password is empty.`,loginBadKey:`That key does not match this host.`,loginSubmit:`Continue`,loggingInConsole:`Checking…`,loginHint:`Self-hosted only. Account login happens after this, on Accounts.`,showPassword:`Show password`,hidePassword:`Hide password`,signOut:`Sign out`,checkingSession:`Checking session…`,refreshing:`Refreshing`,pages:{home:{title:`Overview`,desc:`Runtime health, request volume, and ready endpoints.`},auth:{title:`Auth`,desc:`Browser device-flow login, PAT login, and session rewarm.`},providers:{title:`Models`,desc:`Models from signed-in accounts, plus per-model defaults for context and reasoning.`},access:{title:`Access & try`,desc:`Multi-turn chat in the main panel; expand Raw API below to debug.`},accounts:{title:`Accounts`,desc:`One login per account. Browser sign-in first; PAT only when needed.`},usage:{title:`Usage`,desc:`Usage by model, account and provider.`},logs:{title:`Logs`,desc:`Recent proxy requests and process output.`},keys:{title:`API keys`,desc:`Create client keys and limit them to selected providers.`},system:{title:`System settings`,desc:`Cross-provider routing, managed updates, SQLite protection, and the console API key.`},login:{title:`Enter the console`,desc:`Same API key as /v1.`}},logsLead:`Request history and runtime output from this host.`,logsRequests:`Request history`,logsRuntime:`Runtime logs`,logsEmptyRequests:`No requests recorded yet.`,logsEmptyRuntime:`No runtime lines captured yet.`,logsSearchRuntime:`Search runtime output…`,logsSearchRequestId:`Find a request id`,logsSearchModel:`Find a model`,logsSearchAccount:`Find an account`,logsFilterIdAll:`All request IDs`,logsNoFilterOptions:`No matching options`,logsClear:`Clear history`,logsClearConfirm:`Delete all request history on this host?`,logsColTime:`Time`,logsColAccount:`Account`,logsColProvider:`Provider`,logsColModel:`Model`,logsColReasoning:`Reasoning`,logsColStatus:`Status`,logsColLatency:`Latency`,logsColTTFT:`First token`,logsColTokens:`Tokens`,logsTokensIn:`in`,logsTokensOut:`out`,logsTokensPoints:`{value} pts`,logsColStream:`Mode`,logsStreamYes:`stream`,logsStreamNo:`sync`,logsFilterAll:`All`,logsFilterOk:`OK`,logsFilterIncomplete:`Incomplete`,logsFilterError:`Error`,logsFilterCanceled:`Canceled`,logsFilterAccountAll:`All accounts`,logsFilterProviderAll:`All providers`,logsFilterModelAll:`All models`,logsFilterKindAll:`All errors`,logsFilterStreamAll:`All modes`,logsTimeRange:`Time`,logsTimeAll:`All time`,logsTime1h:`1 hour`,logsTime24h:`24 hours`,logsTime7d:`7 days`,logsTimeCustom:`Custom`,logsTimeFrom:`From`,logsTimeTo:`To`,logsKindQuota:`Quota`,logsKindRateLimit:`Rate limit`,logsKindAuth:`Auth`,logsKindNotReady:`Not ready`,logsKindUnavailable:`Unavailable`,logsKindInvalidRequest:`Invalid request`,logsKindModelNotAvailable:`Model missing`,logsPageSize:`Per page`,logsPage:`Page {page} / {pages}`,logsPrevPage:`Previous`,logsNextPage:`Next`,logsNoMatch:`No requests match these filters.`,logsLevelAll:`All`,logsLevelInfo:`Info`,logsLevelWarn:`Warn`,logsLevelError:`Error`,logsAttempts:`Attempts`,logsRouting:`Routing`,logsRouting_pool:`Pool`,logsRouting_pin:`Pinned`,logsRouting_sticky:`Session sticky`,logsRouting_sticky_escape:`Session escape`,logsNoAttempts:`No attempt details.`,logsStreamDiagnostics:`Stream diagnostics`,logsMessageShape:`Message shape`,logsMessageCount:`Messages`,logsEmptyMessageIndexes:`Empty indexes`,logsMessageRoles:`Roles`,logsCancellationSource:`Cancellation source`,logsUpstreamStatus:`Upstream status`,logsSSEEvents:`SSE events`,logsBytesRead:`Bytes read`,logsLastEvent:`Last event`,logsStreamComplete:`Completed with [DONE]`,logsUsageDetail:`Consumption`,logsCreditConsumed:`Points consumed`,logsDetailTitle:`Request detail`,logsRuntimeDetailTitle:`Runtime log detail`,logsRuntimeLevel:`Level`,logsRuntimeSource:`Source`,logsRuntimeMessage:`Message`,logsShownTotal:`{shown} / {total}`,logsAutoRefresh:`Live`,failedLogs:`Failed to load logs: {msg}`,homeEyebrow:`Runtime`,homeDisplay:`Gateway pulse`,homeLead:`Runtime health plus request volume, latency, and tokens from this host.`,metricRequests:`Requests`,metricSuccess:`Success`,metricLatency:`p95`,metricTokens:`Tokens`,statsWindow1h:`1h`,statsWindow24h:`24h`,statsWindow7d:`7d`,statsWindow30d:`30d`,statsWindowCustom:`Custom`,statsWindowToday:`Today`,statsRefreshPause:`Pause auto-refresh`,statsRefreshResume:`Resume auto-refresh`,statsRefreshAuto:`Refreshing every 30s · click to pause`,statsRefreshPaused:`Auto-refresh paused · click to resume`,statsDragHint:`Drag to open logs for a range`,statsWindowHint:`{window} window`,statsTraffic:`Traffic`,statsTrafficHint:`Completed chat requests in the selected window`,statsEmptyTraffic:`No requests in this window yet.`,statsLatencyP50:`p50`,statsLatencyP95:`p95`,statsLatencyAvg:`avg`,statsTTFB:`TTFB`,statsPool:`Account pool`,statsPoolHint:`Ready workers and remaining quota`,statsCooling:`cooling`,statsTopModels:`Top models`,statsTopAccounts:`Top accounts`,statsTopProviders:`Providers`,statsTopProvidersHint:`Request share by account family`,statsNoProviders:`No provider traffic yet.`,statsErrorMix:`Error mix`,statsStatusMix:`Outcomes & errors`,statsStatusMixHint:`Request status, failure kinds and busiest accounts`,statsCoolingDetails:`Cooling down · reason · remaining · backoff`,statsBackoffLevel:`Restart backoff level`,statsAffinityHit:`Affinity hit`,statsAffinityHint:`{hits} hits · {misses} misses · {bindings} bindings`,metricCacheHit:`Cache hit rate`,metricCacheHitDetail:`{read} cached / {prompt} prompt`,metricStreaming:`Streaming share`,metricStreamingDetail:`{count} of {total} requests`,metricCanceled:`Canceled`,metricCanceledDetail:`{rate} of requests`,statsErrorMixHint:`Classified failures in this window`,statsNoModels:`No model traffic yet.`,statsNoAccounts:`No account traffic yet.`,statsNoErrors:`No classified errors.`,statsUnknown:`unknown`,statsUnassigned:`unassigned`,resTitle:`Resources`,resHint:`Host process memory and CPU`,resServer:`Server`,resWorkers:`Workers`,resEmpty:`No worker processes yet.`,resGoroutines:`goroutines`,resCpuLifetime:`lifetime avg`,failedStats:`Failed to load stats: {msg}`,homeNote:`Signed into the local console. Account logins live on the Accounts page.`,metricRuntime:`Runtime`,metricAccounts:`Accounts`,metricModels:`Models`,metricAuth:`Auth`,metricPort:`Port`,serviceDetail:`Service detail`,endpoints:`Endpoints`,copyBaseUrl:`Copy Base URL`,copied:`Copied`,copy:`Copy`,open:`Open`,waitingOverview:`Waiting for overview…`,signIn:`Sign in`,connectQoder:`Connect account`,rewarm:`Rewarm`,rewarming:`Rewarming`,refreshAccount:`Refresh`,refreshingAccount:`Refreshing`,stepBrowserTitle:`Browser device flow`,stepBrowserDesc:`Opens account selection. Finish in the browser, then this page polls until the session is ready.`,startBrowserLogin:`Sign in with browser`,starting:`Starting…`,quotaLoading:`Getting quota…`,quotaUnavailable:`Quota unavailable`,authUrl:`Auth URL`,openAuthUrl:`Open link`,stepPatTitle:`Personal access token`,stepPatDesc:`Optional fallback when browser flow is inconvenient.`,pat:`PAT`,pasteToken:`paste token`,loginWithPat:`Login with PAT`,loggingIn:`Logging in…`,localState:`Local state`,raw:`Raw`,noAuthSnapshot:`No auth snapshot yet.`,catalog:`Catalog`,availableModels:`Available models`,modelsPulled:`Pulled from`,filter:`Filter`,filterPh:`glm / qwen / deepseek`,providerFilterAll:`All providers`,accountStatusFilter:`Account status`,connection:`Connection`,apiPlayground:`Access & try`,apiPlaygroundHint:`Pick an account and model, chat in the main panel, or open Raw API below for JSON and curl.`,readyAccounts:`{ready} of {total} accounts ready`,baseUrl:`Base URL`,externalClients:`External clients`,protocol:`Protocol`,quickTest:`Quick test`,requestBuilder:`Request builder`,responseInspector:`Response inspector`,responseInspectorHint:`Raw JSON from the local proxy`,requestIdle:`Idle`,requestComplete:`Complete`,requestFailed:`Request failed`,responseReceived:`Response received`,responseEmptyTitle:`No response yet`,responseEmptyHint:`Choose a route, write a prompt, and send the request. The raw response appears here.`,sendRequest:`Send request`,promptPlaceholder:`Write a message for the model`,promptHelper:`This test uses a non-streaming Chat Completions request.`,accessTabChat:`Chat`,accessTabApi:`Native API`,accessTabsLabel:`Access modes`,chatTryEmptyTitle:`No reply yet`,chatTryEmptyHint:`Write a message below. Account and model live in the composer. Session clears when you leave.`,chatTryHelper:`Enter to send · Shift+Enter for a new line. Attachments stay in this turn.`,chatTrySend:`Send`,chatTryStop:`Stop`,chatTryStreaming:`Streaming…`,chatTryUserLabel:`You`,chatTryAssistantLabel:`Assistant`,chatTryCreditsUsed:`Used {amount} credits`,chatTryUsageTokens:`{prompt} → {completion}`,chatTryUsageFoot:`{tokens} · {amount} credits`,nativeApiHint:`Non-streaming request, raw JSON response, and a matching curl command.`,rawApiShow:`Show raw API`,rawApiHide:`Hide raw API`,chatAttach:`Attach file`,chatAttachRemove:`Remove attachment`,chatAttachUnsupported:`Unsupported file type: {names}`,thinkingPhaseScan:`Scanning`,thinkingPhasePlan:`Planning`,thinkingPhaseDraft:`Drafting`,thinkingDone:`Thought`,thinkingElapsed:`{n}s`,toolCallGroup:`Used {n} tools`,chatDemoLoad:`Preview sample`,thinkingChars:`{count} chars`,thinkingWorking:`Thinking`,toolCallRunning:`Running`,toolCallSuccess:`Done`,toolCallError:`Error`,toolCallUntitled:`tool`,toolCallArgs:`Arguments`,toolCallArgsEmpty:`(empty)`,autoAccountHint:`The scheduler chooses an available account.`,fixedAccountHint:`This request is pinned to the selected account.`,modelRoutingHint:`Uses the public model ID exposed by this proxy.`,accountModelHint:`Only models this account currently serves. A pinned request fails if the ID is missing here.`,noAccountModels:`This account has no models to send.`,accountModels:`Available models`,accountModelsTitle:`Models on {name}`,accountModelsHint:`Live catalog from this account. Requests pinned here only use these IDs.`,accountModelsEmpty:`This account has not published a model catalog yet.`,accountModelsError:`Could not load models: {msg}`,noAccountsForTest:`No account runtime is available. Add and sign in to an account before testing.`,curlGeneratedHint:`Generated from the current account, model, and prompt`,prompt:`Prompt`,model:`Model`,send:`Send`,waitingRequest:`Waiting for a request…`,requesting:`Requesting…`,endpointOpenAI:`OpenAI Compatible`,endpointChat:`Chat Completions`,endpointBaseHint:`Use this path as the base URL in OpenAI-compatible clients.`,endpointChatHint:`OpenAI-compatible chat. Prefix the model ID to pin one provider, for example qoder/glm-5.2.`,endpointMessages:`Anthropic Messages`,endpointMessagesHint:`Stateless Anthropic Messages. Use a provider-prefixed model ID to pin one family.`,endpointResponses:`OpenAI Responses`,endpointResponsesHint:`Stateless OpenAI Responses. Use a provider-prefixed model ID to pin one family.`,endpointModels:`Models`,endpointModelsHint:`Public model IDs. Named API keys only see models from their allowed providers.`,endpointHealth:`Health`,endpointHealthHint:`Check whether the local proxy is responding.`,endpointCount:`{count} API routes`,endpointReady:`Available now`,endpointBaseLabel:`Client base URL`,endpointAuthLabel:`Bearer API key`,hasUserBlob:`Has user blob`,userBlobBytes:`User blob bytes`,machineId:`Machine ID`,sessionHot:`Session hot`,upstreamEndpoint:`Upstream endpoint`,rewarmCount:`Rewarm count`,proxy:`Proxy`,endpoint:`Endpoint`,lastError:`Last error`,running:`Running`,down:`Down`,hot:`Hot`,up:`Up`,ready:`Ready`,missing:`Missing`,degraded:`Degraded`,error:`Error`,yes:`yes`,no:`no`,modelCol:`Model`,mappedKeyCol:`Upstream key`,requestIdCol:`Request ID`,providerCol:`Provider`,qoderKeyCol:`Upstream key`,routedTo:`Upstream model {model}`,stateCol:`State`,contextWindowCol:`Context window`,modelDefaultsCol:`Context and reasoning`,contextConfigHint:`These are defaults. If a request sets Max context or reasoning, that request wins.`,qoderContextHint:`Default context window used when the request omits context length / max input tokens.`,contextInvalid:`Context window must be an integer between 1,024 and 4,000,000 tokens.`,contextSaved:`Saved context window for {model}.`,contextReset:`Restored the default context window for {model}.`,contextMaxOn:`Enabled Max context for {model}.`,contextMaxOff:`Disabled Max context for {model}.`,contextMaxUnavailable:`This model has no Max context switch.`,maxMode:`Max context`,maxModeHint:`Trae larger context window, often 200k to 1M. Not a plan or quota. Used only when the request omits is_max_mode; an explicit request still wins. Unsupported models never send this switch.`,qoderMaxModeHint:`Qoder larger context window. Not a plan or quota. When on, requests use the model’s largest window; when off (or when a request sets its own context) the default window applies.`,catalogWindow:`Catalog size`,catalogWindowHint:`This Trae model has no Max-context switch. The number is the catalog window.`,workbuddyContextHint:`WorkBuddy desktop default and optional context budgets from the catalog. This is a local compact budget, not Trae is_max_mode. Chat requests do not send a window switch.`,reasoningLevels:`Reasoning intensity`,reasoningHint:`Default thinking effort when the request omits reasoning_effort and related flags. This does not lock every call to that level, and it does not cap a higher client value. A level the model does not allow falls back to an allowed option.`,reasoningFixed:`Fixed thinking: {type}`,noReasoningLevels:`This model has no selectable reasoning levels.`,reasoningSaved:`Saved default reasoning for {model}: {level}.`,reasoningLevel_none:`Off`,reasoningLevel_low:`Low`,reasoningLevel_medium:`Medium`,reasoningLevel_high:`High`,reasoningLevel_xhigh:`Extra high`,reasoningLevel_max:`Max effort`,modelDetails:`Details`,promptMaxTokens:`Prompt max`,maxOutputTokens:`Output max`,actions:`Actions`,save:`Save`,custom:`Custom`,defaultValue:`Default`,resetDefault:`Restore default`,fallback:`fallback`,modelFree:`(free)`,shownTotal:`{shown} shown / {total} total`,noModelsYet:`No models yet`,noModelsMatch:`No models match this filter.`,noProviders:`No providers loaded.`,failedOverview:`Failed to load overview: {msg}`,pastePatFirst:`Paste a PAT first`,patDone:`PAT login completed`,loginOpenMsg:`Open the auth URL to finish login`,idle:`idle`,menu:`Menu`,toggleSidebar:`Toggle sidebar`,accountsTitle:`Accounts`,accountsDesc:`One login per account. Chat round-robins and fails over.`,noAccounts:`No accounts yet. Add one to start serving chat.`,accountCount:`Accounts`,signedIn:`Signed in`,enabledAccounts:`Enabled`,availableAccounts:`Available`,needsAttention:`Needs attention`,searchAccounts:`Search name, ID, UID, provider, or auth type`,filterAll:`All`,shownAccounts:`{shown} / {total}`,noAccountsMatch:`No accounts match this filter.`,clearFilters:`Clear filters`,more:`More actions`,partialCooling:`Partial model cooldown`,runtimeState:`Runtime state`,maxInflight:`Max concurrency`,priority:`Priority`,updatedAt:`Updated`,enabledState:`Enabled`,cooling:`Cooling down`,dead:`Recovering`,authFailed:`Auth failed`,patFallback:`PAT fallback`,usePat:`Use PAT`,account:`Account`,autoAccount:`Auto (round-robin)`,cooldown:`Cooldown`,inFlight:`In-flight`,liveConcurrency:`Concurrency`,liveRpm:`Last 60s`,liveRpmUnit:`req`,liveRpmHint:`started in the last minute`,liveTrace:`Trend`,livePeak:`peak {n}`,liveSaturated:`Saturated`,restarts:`Restarts`,dropSystemPrompt:`Drop system prompt`,dropSystemPromptHint:`Strip caller system prompts before sending; WorkBuddy still gets an empty leading system slot so Global does not reject the request`,autoCheckin:`Daily check-in`,autoCheckinHint:`Run the daily WorkBuddy credit check-in at the configured local time. Failed attempts retry around 21:00. Off by default.`,autoCheckinCreateHint:`WorkBuddy only. Enable automatic daily credit check-ins. The first attempt uses this account time, or the system default if left unchanged.`,autoCheckinTime:`Check-in time`,autoCheckinTimeHint:`Uses server local time and runs within about 14 minutes after the selected time. Failed attempts retry around 21:00. New accounts start from the system default.`,checkinNow:`Check in now`,lastCheckin:`Last check-in`,lastCheckinNone:`No check-in yet`,checkinStatus:`Check-in`,checkinToday:`Checked in today`,checkinPending:`Not checked in today`,checkinFailed:`Check-in failed`,checkinRecords:`Check-in records`,checkinRecordsTitle:`Check-in records · {name}`,checkinRecordsHint:`The latest 20 check-in attempts for this account.`,checkinRecordsEmpty:`No check-in records yet`,checkinRecordsCount:`{count} records`,checkinRecordSuccess:`Success`,checkinRecordAlready:`Already checked in`,checkinRecordFailed:`Failed`,refreshCredits:`Refresh credits`,expiryDistTitle:`Credit expiry distribution`,expiryDistHint:`Grouped by calendar day · colour marks the account · FEFO: upstream burns the soonest-expiring credits first`,expiryDistExpand:`Show all {n} days`,expiryDistCollapse:`Show less`,expiryDistDayTotal:`{n} credits expire`,expiryDistColAccount:`Account`,expiryDistColSoonest:`Soonest`,expiryDistColDaysLeft:`Days left`,expiryDistColBatch:`Expiring`,expiryDistColDaily:`Daily burn`,expiryDistDays:`{n}d`,expiryDistFoot:`"Daily burn" = credits expiring on the soonest day ÷ days until then — the pace needed to use them before they lapse.`,expiryDistExpired:`Expired`,usageDetailTitle:`Usage breakdown`,usageDetailHint:`Same window as above · tokens, cache hit rate and latency per dimension`,usageDimNote:`{n} rows (top 20) · request count includes failed attempts · scope differs from the Usage page top-N / missing-metric rules`,usageDimAccount:`By account`,usageDimModel:`By model`,usageDimRealm:`By realm`,usageSortTotal:`Total tokens`,usageSortRequests:`Requests`,usageSortErrors:`Errors`,usageSortLatency:`Latency`,usageColAccount:`Account`,usageColModel:`Model`,usageColRealm:`Realm`,usageColErrors:`Errors`,usageColPrompt:`Prompt`,usageColCacheHit:`Cache hit`,usageColCompletion:`Completion`,usageColTotal:`Total`,usageColAvgLatency:`Avg latency`,usageCreditTitle:`Credit deduction history`,usageCreditHint:`Summed from upstream usage.credit · requests without a credit reading are not counted`,usageCreditEmpty:`No credit deductions yet; token-only history from before the upgrade is never filled with made-up credits.`,usageCreditNote:`{accounts} accounts · {models} model rate groups · only tokens observed alongside credits are counted`,usageCreditKpiCredits:`Credits deducted`,usageCreditKpiCreditsSub:`from upstream usage.credit`,usageCreditKpiTokens:`Matched tokens`,usageCreditKpiTokensSub:`tokens observed with credits`,usageCreditKpiAvg:`Avg credits / 1M tokens`,usageCreditKpiAvgSub:`lower is cheaper`,usageCreditKpiSamples:`Valid samples`,usageCreditKpiSamplesSub:`rows missing the field are excluded`,usageCreditKpiCache:`Cache hit rate`,usageCreditKpiCacheSub:`hit / (hit + miss) · low hit multiplies cost`,usageCreditColRate:`Rate`,usageCreditColCredits:`Credits`,usageCreditColSampleTokens:`Sample tokens`,usageCreditColPer1M:`Credits / 1M`,quota:`Quota`,quotaUsed:`Used`,quotaRemaining:`Remaining`,quotaDaily:`Daily quota`,quotaWeekly:`Weekly quota`,quotaMonthly:`Monthly quota`,quotaFiveHour:`5-Hour Limit`,quotaWeeklyLimit:`Weekly Limit`,quotaPlan:`Plan`,quotaMonthlyLimit:`Monthly Limit`,quotaUsedPercent:`{n}% used`,quotaResetsSoon:`Resets soon`,quotaResetsInMinutes:`Resets in {n} minutes`,quotaResetsInHours:`Resets in {n} hours`,quotaExpiresOn:`{amount}{unit} expire on {date}`,quotaAddOn:`Add-on`,quotaResourcePackage:`Resource package`,quotaExceeded:`Quota exceeded`,errorKind:`Error kind`,qoderLoginHint:`This signs in the upstream account only. It does not change the console password.`,needQoderLogin:`Needs account login`,waitingQoderLogin:`Waiting for account login…`,qoderLoginDone:`Account login completed`,rewarmDone:`Rewarm completed`,accountsSigned:`{n} / {total} accounts ready`,addAccount:`Add account`,batchImport:`Batch import`,batchImportLoading:`Importing WorkBuddy accounts…`,batchImportUnrecognized:`Could not recognize this credential file format.`,batchImportConfirmTitle:`Confirm batch import`,batchImportConfirmHint:`Detected from {file}. Review and confirm before importing.`,batchImportConfirmHintNoFile:`Review the detected format, then confirm to import.`,batchImportRegion:`WorkBuddy region`,batchImportRegionPickHint:`Region was unclear — pick CN or Global before importing.`,batchImportRegionMixed:`This pack mixes CN and Global domains. Split it, or pick one region to force.`,batchImportRegionUnknown:`Region not detected from domains — please confirm.`,batchImportUnknownFormat:`Unknown format field; guessed from shape.`,batchImportProviderUnsupported:`Batch import for this provider is not supported yet. Detection is ready for a future release.`,batchImportConfirmAction:`Import`,batchImportFormatUnknown:`Unknown format`,batchImportProviderUnknown:`Unknown provider`,accountName:`Account name`,accountNameRequired:`Enter an account name.`,accountCreated:`Account created. Session is starting.`,importCredential:`Import native credential`,accountImported:`Credential imported and runtime started.`,accountImportBatch:`Imported {n} accounts.`,accountImportPartial:`Imported {ok}, failed {fail}.`,credentialCopied:`Credential bundle copied.`,addAccountTitle:`Add account`,accountType:`Account type`,loginMethod:`Login method`,accountTypeHint:`Choose the upstream login family for this isolated runtime.`,accountTypeQoderGlobal:`Qoder Global`,accountTypeQoderGlobalHint:`Qoder Global via browser, PAT, or imported credential`,accountTypeQoderCN:`Qoder CN`,accountTypeQoderCNHint:`Qoder China via browser, PAT, or imported credential`,accountTypeWorkBuddyCN:`WorkBuddy CN`,accountTypeWorkBuddyCNHint:`CodeBuddy CN via browser login or imported credential`,accountTypeWorkBuddyGlobal:`WorkBuddy Global`,accountTypeWorkBuddyGlobalHint:`WorkBuddy Global via browser login or imported credential`,accountTypeTraeCN:`Trae CN Solo`,accountTypeTraeCNHint:`Trae China Solo via browser login or imported credential`,accountTypeDevinGlobal:`Devin (experimental)`,accountTypeDevinGlobalHint:`Experimental Devin Global via browser OAuth or session token import`,accountTypeCommandGlobal:`Command Code`,accountTypeCommandGlobalHint:`Command Code via a pasted user_… key. Speaks the CLI /alpha/generate protocol, so every plan works, including the $1 Go plan.`,accountTypeCodexGlobal:`Codex`,accountTypeCodexGlobalHint:`OpenAI Codex via Codex CLI OAuth, Sign in with ChatGPT, or an imported credential`,accountTypeZhipuCN:`Zhipu GLM`,accountTypeZhipuCNHint:`Zhipu GLM with an API key. Choose pay-as-you-go or Coding Plan, the same way the upstream account is billed.`,accountTypeQwenworkGlobal:`QwenWork International`,accountTypeQwenworkGlobalHint:`QwenWork international (qwenwork.ai) via browser OAuth or imported credential. The authorization link is single-use: open it directly in a browser already signed in to the target account, and do not send it through chat tools.`,accountTypeQwenworkCN:`QwenWork CN`,accountTypeQwenworkCNHint:`千问办公 China (qwenwork.cn) via browser OAuth or imported credential. The authorization link is single-use: open it directly in a browser already signed in to the target account, and do not send it through chat tools. The CN region has not yet been verified with a real account.`,accountTypeKimiCN:`Kimi Code CN`,accountTypeKimiCNHint:`Kimi Code China subscription via device-code sign-in against auth.kimi.com. Uses the same OAuth client as the official CLI, so the login you already completed with Kimi Code can be pasted in as its credential JSON.`,addAccountDesc:`Create an isolated account session. Each account keeps its own runtime home.`,tabBrowser:`Browser login`,tabPat:`PAT`,tabImport:`Import credential`,recommended:`Recommended`,wizardSettings:`Account settings`,wizardAdvanced:`Advanced options`,wizardContinue:`Continue`,wizardBack:`Back`,wizardSettingsHint:`Set these before login. You can still change them later from Edit on the account card.`,editAccount:`Edit`,editAccountTitle:`Edit {name}`,editAccountHint:`Change the display name, concurrency, routing priority, outbound proxy, model aliases, and check-in time when supported.`,accountModelAliases:`Aliases`,accountModelAliasesHint:`A name this account answers as. The request is rewritten to this account's real model after the account is picked.`,accountModelAliasTargetPlaceholder:`real model on this account`,modelAliasName:`Alias`,modelAliasTarget:`Real model`,modelAliasAdd:`Add`,modelAliasRemove:`Remove`,modelAliasPlaceholder:`kimi-k3`,enabledModels:`Models`,enabledModelsHint:`Leave unrestricted to serve the whole catalog. Restrict to choose which models this account may serve.`,restrictModels:`Only selected models`,allModels:`All models`,modelPickerSearch:`Search models`,modelPickerCount:`{selected} / {total} selected`,modelPickerSelectAll:`Select all`,modelPickerClear:`Clear`,modelPickerOffline:`Offline`,modelPickerRemove:`Remove {model}`,modelPickerNoMatch:`No matching models.`,maxInflightInvalid:`Concurrency must be an integer from 1 to 32.`,priorityInvalid:`Priority must be an integer from 1 to 100.`,wizardNamePh:`Account name`,maxInflightHint:`How many chats this account may run at once. Changing it later restarts the worker.`,priorityHint:`Higher numbers are preferred when routing later uses this field. Default 50.`,proxyUrl:`Proxy URL`,proxyUrlPlaceholder:`http://127.0.0.1:7890, direct`,proxyUrlHint:`Blank inherits the global proxy. Use direct or none to bypass proxies for this account. Qoder supports HTTP(S) only; WorkBuddy/Trae also support SOCKS5.`,proxySettingsTitle:`Outbound proxy`,proxySettingsHint:`Set the default proxy for upstream requests. Global proxies support HTTP(S) only. SOCKS5 is available for WorkBuddy/Trae account-level proxies. Account-level settings override it.`,dropSystemPromptCreateHint:`WorkBuddy only. Strip caller system prompts, then send an empty leading system slot so Global still accepts the request.`,wizardBrowserLead:`Shows the authorization URL. Open or copy it, finish in the browser, and this wizard continues automatically.`,wizardCodexBrowserLead:`Choose Codex CLI or Sign in with ChatGPT, then open the authorization URL. ChatGPT website logins need Sign in with ChatGPT; the CLI flow cannot refresh those tokens.`,codexLoginMethod:`Codex login`,codexLoginCli:`Codex CLI`,codexLoginCliHint:`Official Codex CLI OAuth. Use this for CLI-issued credentials.`,codexLoginChatGPT:`Sign in with ChatGPT`,codexLoginChatGPTHint:`ChatGPT website login. Stores a separate token that refreshes at a different endpoint.`,startCodexCliLogin:`Start Codex CLI login`,startCodexChatGPTLogin:`Sign in with ChatGPT`,wizardStartBrowser:`Start browser login`,wizardStartingSession:`Starting the account session…`,wizardWaitingBrowser:`Waiting for authorization in the browser…`,wizardCallbackLead:`If the browser stays on 127.0.0.1 and this console never finishes, copy the full address-bar URL here.`,wizardCallbackPh:`Paste the full http://127.0.0.1…/authorize?… URL`,wizardSubmitCallback:`Submit callback URL`,wizardStartingWorker:`Authorization received. Starting account session…`,wizardAccountReady:`Account is ready.`,wizardLoginTimeout:`Timed out waiting for browser login. You can retry from the account card.`,wizardPatLead:`Use a personal access token when the browser flow is inconvenient.`,wizardPatLeadCN:`Create a PAT at qoder.com.cn/account/integrations, then paste it here.`,wizardPatLeadCommand:`Paste your Command Code key (it looks like user_…, from commandcode.ai/settings).`,zhipuApiKey:`API key`,zhipuApiKeyPh:`Paste the key from open.bigmodel.cn`,zhipuAccountMode:`Account mode`,zhipuModePayg:`Pay as you go`,zhipuModePaygHint:`Billed by token. Uses the standard GLM endpoint.`,zhipuModeCoding:`Coding Plan`,zhipuModeCodingHint:`Subscription plan. Uses the Coding Plan endpoint and shows its quota.`,zhipuOrganization:`Organization ID`,zhipuOrganizationPh:`Optional, for a team Coding Plan`,zhipuProject:`Project ID`,zhipuProjectPh:`Optional`,zhipuCreate:`Add Zhipu account`,zhipuKeyRequired:`Paste the Zhipu API key first.`,wizardPatPh:`Paste personal access token`,wizardCreateAndLogin:`Create and sign in`,wizardImportLead:`Paste a credential JSON export. WorkBuddy hub packages import every account in the file.`,wizardImportPh:`Paste credential JSON`,wizardChooseFile:`Choose file`,wizardBadJson:`That does not look like a valid credential bundle.`,reLogin:`Sign in`,cancel:`Cancel`,close:`Close`,create:`Create`,import:`Import`,export:`Export`,enable:`Enable`,disable:`Disable`,disabled:`Disabled`,delete:`Delete`,holdToDelete:`Hold to delete`,trendHalfHint:`Second half of the window vs the first half`,toastRefreshingAccount:`Refreshing account…`,toastAccountRefreshed:`Account refreshed`,toastRefreshingCredits:`Refreshing credits…`,toastCreditsRefreshed:`Credits refreshed`,toastAccountAdded:`Account added`,toastAccountDeleted:`Account deleted`,toastClearingLogs:`Clearing request logs…`,toastLogsCleared:`Request logs cleared`,toastKeyDeleted:`API key deleted`,toastFailed:`Operation failed`,deleteAccountConfirm:`Delete account {name}? This removes its local runtime and stored credential.`,edit:`Edit`,enabled:`Enabled`,keysLead:`Client keys call /v1. Leave providers empty to allow every family. The console key stays on System.`,keysCreate:`Create key`,keysEmpty:`No client keys yet`,keysEmptyHint:`Create a named key for OpenAI-compatible clients. It cannot sign in to this console.`,keysCreateTitle:`Create API key`,keysCreateHint:`The secret is shown once. Store it in the client that will call /v1.`,keysEditTitle:`Edit API key`,keysEditHint:`Rename the key or change which providers it may route to.`,keysName:`Name`,keysNamePh:`CI bot`,keysNameRequired:`Name is required.`,keysProviders:`Providers`,keysProvidersHint:`Restrict this key to specific provider regions. Leave all unchecked to allow every provider.`,keysAllProviders:`All providers`,keysAllRegions:`All regions`,keysProvidersNotLoaded:`Provider list is still loading. Saving is disabled so the key permissions stay unchanged.`,keysProvidersLoadFailed:`Failed to load provider list: {message}`,keysLastUsed:`Last used {time}`,keysNeverUsed:`Not used yet`,keysSecretTitle:`Store this secret now`,keysSecretHint:`This value is not stored in plaintext. It will not be shown again.`,keysSecretOnce:`Copy the key before closing this dialog.`,keysDeleteConfirm:`Delete API key {name}? Clients using it will fail immediately.`,consoleKeyTitle:`Console API key`,consoleKeyHint:`This is the administrator key used to sign in here.`,consoleKeyLead:`It can call every provider and manage accounts, keys, and updates. Client keys live on the API keys page.`,consoleKeyRotate:`Rotate key`,consoleKeyRotateHint:`Rotating signs you out of other sessions and restarts Qoder workers so they pick up the new secret.`,consoleKeyRotateNow:`Rotate now`,consoleKeySecretTitle:`New console key`,consoleKeySecretHint:`This browser session is already updated. Copy the key for any other clients that used the old console secret.`},zh:{brandSub:`登录态网关`,controlPlane:`控制平面`,workspace:`工作区`,develop:`开发`,system:`系统`,runtimeSnapshot:`运行时与调度器快照`,routesHint:`OpenAI / Anthropic 兼容端点`,clientConfig:`客户端配置`,clientConfigHint:`使用与控制台相同的密钥作为 Bearer Token`,providerPrefixHint:`用 qoder/、workbuddy/、trae/、devin/、command/、codex/、zhipu/、qwenwork/ 或 kimi/ 前缀指定供应商。客户端 API 密钥也可以限制可见和可调度的供应商。不带前缀时是否跨供应商,由系统设置里的模型池决定。`,authentication:`认证方式`,curlExample:`curl 示例`,quickTestHint:`通过所选账号发送一条真实请求`,response:`响应`,providerCatalog:`模型目录`,providerCatalogMeta:`已登录 / 实时`,accountPool:`账号池`,accountCreateHint:`先创建隔离运行时,再通过浏览器或 PAT 登录。`,credentialImportHint:`仅支持从本控制台导出、且 user blob 与 machine ID 匹配的凭证包。`,accountEmptyHint:`创建一个账号运行时后即可开始。`,oauthDeviceFlow:`OAuth 浏览器登录`,navOverview:`概览`,navAuth:`账号`,navProviders:`模型`,navAccess:`接入与调试`,navAccounts:`账号`,checkinDefaultsTitle:`自动签到`,checkinDefaultsHint:`按供应商设置默认时间。跟随默认的账号会立即采用新时间,账号自定义时间不受影响。`,checkinDisabledAccountsTitle:`停用账号也自动签到`,checkinDisabledAccountsHint:`开启后,停用聊天功能的账号仍可执行已开启的自动签到;停用账号仍不可手动签到。`,checkinDisabledAccountsStatus:`当前状态`,checkinDisabledAccountsAriaLabel:`允许停用账号自动签到`,checkinInherit:`跟随供应商默认`,checkinDefaultValue:`供应商默认:{time}`,checkinCustom:`账号自定义`,checkinScheduleHint:`按显示的时区执行,通常在设定时间后的约 90 秒内开始,多账号顺序处理可能延后;较早的失败会在约 21:00 重试一次,活动未开放则当天跳过。签到不影响聊天。`,checkinTimeInvalid:`请输入有效的签到时间(HH:mm)。`,checkinRecordSkipped:`活动未开放`,navUsage:`用量`,usageTitle:`用量`,usageLead:`按模型、账号与供应商查看请求、延迟、token 与积分。`,usageByModel:`模型`,usageByAccount:`账号`,usageByProvider:`供应商`,usageColRequests:`请求`,usageColSuccess:`成功率`,usageColTokens:`Tokens`,usageColCacheWrite:`缓存写入`,usageColCredits:`积分`,usageRowCount:`{count} 行`,usageEmpty:`该时间窗口内没有请求。`,usageStatsTab:`统计`,usageCostTab:`额度`,usageCostLead:`按模型汇总各供应商的订阅额度与 token 用量。`,usageWindow:`时间范围`,usageWindow24h:`24 小时`,usageWindow7d:`7 天`,usageWindowTotal:`全部留存`,usageCredits:`已用额度`,usageCreditsHint:`所有 provider 合计消耗的订阅额度`,usageEstCost:`折合费用`,usageTotalTokens:`Token 总量`,usageRequests:`请求数`,usageModelCount:`{count} 个模型`,usageCacheHitRate:`缓存命中`,usageTokenSplitNote:`命中 / 未命中 / 输出`,usageChartTitle:`用量趋势`,usageChartHint:`按模型堆叠。可在额度与 token 之间切换。`,usageChartEmpty:`该时间范围内暂无用量。`,usageBreakdownTitle:`按模型明细`,usageBreakdownHint:`每个模型的 token 与订阅额度。`,usageColInputHit:`输入·缓存命中`,usageColInputMiss:`输入·缓存未命中`,usageColOutput:`输出`,usageColCost:`折合费用`,usageUnpricedCost:`无官方价`,usageColSplit:`高峰 / 闲时`,usageTotals:`合计`,usageRetentionHint:`请求日志按计划清理,因此「全部留存」只覆盖仍在库内的部分。`,usageRenderNote:`可选的 DeepSeek 官方列表价人民币折算。订阅账号并不按此计费——仅供对比。`,usagePeakNote:`高峰按北京时间周一至周五 09:00-12:00、14:00-18:00 估算;闲时为高峰一半。未处理法定节假日及调休。`,usageUnpricedHint:`以下模型没有列表价行,只计入额度与 token:{models}`,usageNoteTitle:`计算说明`,usagePriceTitle:`DeepSeek 官方价格表`,usagePriceHit:`缓存命中`,usagePriceMiss:`缓存未命中`,usagePriceOutput:`输出`,usagePriceBandOff:`闲时`,usagePriceBandPeak:`高峰`,usageOffPeak:`闲时`,usagePeak:`高峰`,usageChartMetric:`图表指标`,usageEstimateTitle:`DeepSeek 官方列表价折算`,usageEstimateHint:`有官方价的模型可查看人民币对比;默认折叠。`,usageEstimateChartTitle:`列表价趋势`,usageEstimateChartEmpty:`该时间范围内暂无 DeepSeek 计价用量。`,chartMetricRequests:`请求`,chartMetricTokens:`Tokens`,chartMetricLatency:`p95 延迟`,chartInput:`输入`,chartOutput:`输出`,chartCacheRead:`缓存读取`,chartTotal:`合计`,navLogs:`日志`,navKeys:`API 密钥`,navSystem:`系统设置`,sidebarFoot:`CLI 登录态网关`,sidebarInFlight:`当前并发 {count}`,systemSettingsTitle:`系统设置`,systemSettingsLead:`管理跨 Provider 路由、各供应商签到默认时间、系统更新、SQLite 保护和控制台管理员密钥。`,crossProviderModelPoolTitle:`跨 Provider 模型池`,crossProviderModelPoolHint:`开启后,不带 Provider 前缀的模型 ID 可以在匹配的 Qoder、WorkBuddy 和 Trae 账号之间调度;关闭后 bare ID 会被拒绝,必须使用带 Provider 前缀的模型 ID。`,crossProviderModelPoolStatus:`当前状态`,crossProviderModelPoolAriaLabel:`开启跨 Provider 模型池`,workbuddyCheckinSettingsTitle:`WorkBuddy 签到`,workbuddyCheckinSettingsHint:`新建 WorkBuddy 账号时使用的默认首次签到时间。已有账号会保留各自的时间,直到你单独修改。`,workbuddyCheckinSettingsFieldHint:`使用服务器本地时间。新建 WorkBuddy 账号会继承这里的时间,账号编辑页仍可单独覆盖。`,routingStrategyTitle:`账号调度策略`,routingStrategyHint:`选择就绪账号如何分担流量。填满优先会持续使用最高优先级账号,直到它不可用。`,routingStrategy:`策略`,routingRoundRobin:`轮询`,routingWeightedRoundRobin:`加权轮询`,routingFillFirst:`填满优先`,routingWeight:`调度权重`,sessionAffinityTTL:`会话 TTL`,sessionAffinityHits:`粘性命中`,sessionAffinityMisses:`粘性未命中`,sessionAffinityEscapes:`粘性逃逸`,lastSessionMiss:`最近未命中`,lastSessionEscape:`最近逃逸`,checkUpdates:`检查更新`,versionUpdate:`版本更新`,latestVersionHint:`先下载最新版本,准备好后再点立即更新。`,updateAvailable:`有可用更新`,settingsTabGeneral:`常规`,settingsTabRouting:`路由调度`,settingsTabSecurity:`安全与数据`,settingsTabUpdates:`版本更新`,sidebarNewVersion:`新版本 {version}`,sidebarReleaseNotes:`更新日志`,sidebarGoToUpdate:`历史版本与回滚`,upToDate:`已是最新版本`,currentVersion:`当前版本`,latestVersion:`最新版本`,skippedBetweenLabel:`中间经过的版本`,releaseNotes:`更新内容`,updateNoNotes:`这个版本还没有说明。`,versionHistory:`历史版本`,versionCurrentBadge:`当前`,versionLatestBadge:`最新`,restoreThisVersion:`恢复此版本`,restoreVersionTitle:`恢复到 {version}?`,restoreVersionHint:`服务会切回这个版本。只有重启时才会暂停新请求。`,updaterReady:`这台机器可以更新`,updaterUnavailable:`这台机器暂时不能更新`,updaterNeedsHost:`当前进程不能替换自己的容器`,updaterUnavailableHint:`这一页可以检查新版本,但还不能在这台机器上安装更新。`,updaterNeedInstall:`用 deploy/install-updater.sh 或 deploy/install-updater.ps1 安装宿主机更新器,让它能调用 Docker。`,updaterNeedCompose:`Linux 需要把更新器 socket 挂进容器。Docker Desktop 用本机回环地址,而不是 Unix socket。`,updaterNeedRelease:`当前运行的必须是已发布的 GitHub Release,不能是本地或开发镜像。`,updateNow:`下载更新`,applyUpdateNow:`立即更新`,cancelUpdate:`取消下载`,discardPreparedImage:`放弃这次更新`,updateReadyHint:`更新已经下载好。点立即更新才会重启;在此之前不会暂停新请求。`,updateReadyTargetHint:`可以切换到 {version}。只有重启时才会暂停新请求。`,updateNewerReleaseHint:`又有更新的版本({latest})。可以先立即更新,或放弃这次下载后重新开始。`,updateStagedUnavailableHint:`请先更新宿主机更新器,才能使用分阶段更新。`,updateLegacyOneShotHint:`这台机器会一次下载并完成更新。之后的版本可以先下载,再点立即更新。`,rollbackToVersion:`恢复旧版本`,rollbackToVersionHint:`可以恢复到当前版本之前最近的三个版本。`,updateReloadingIn:`{seconds}s 后刷新`,updateInProgress:`更新中…`,updatePreparingImage:`正在下载更新…`,updatePreparingImageHint:`正在后台下载更新。当前版本会继续运行,下载完成后点立即更新才会切换。下载卡住时可以取消。`,updateApplyingHint:`正在安装更新。完成后会自动刷新这个页面。`,updateInProgressHint:`系统正在更新,准备就绪后会自动刷新页面。`,updateUnavailableHint:`暂时无法更新,请稍后重试。`,updateFailedHint:`更新未完成,请重试。`,updateCheckFailedHint:`暂时无法检查更新,请稍后重试。`,updatePreparingHint:`正在准备更新:检查版本并保存备份。现有连接可能会被中断,客户端可自行重试。`,updateRunningHint:`正在更新。完成后会自动刷新这个页面。`,updateReloadingHint:`更新完成,正在刷新页面…`,updateElapsed:`已用时 {seconds}s`,sqliteProtection:`SQLite 保护`,sqliteProtectionHint:`数据会留在原处,并在更新前创建经过校验的备份。`,sqliteBackupBeforeUpdate:`更新前创建并校验备份`,sqliteKeepFive:`保留最近 5 份备份`,sqliteRollbackTogether:`失败时同时恢复数据库和上一版本`,updateStatus:`更新状态`,noUpdateJob:`暂无更新任务`,confirmUpdate:`立即更新`,confirmUpdateHint:`系统会短暂停止接收新请求并保存备份。现有连接可能会被中断,客户端可自行重试。`,updateState_idle:`空闲`,updateState_unavailable:`不可用`,updateState_queued:`等待开始`,updateState_preparing:`准备中`,updateState_preparing_image:`正在下载更新`,updateState_checking:`正在检查版本`,updateState_backing_up:`正在保存备份`,updateState_submitting:`正在开始更新`,updateState_running:`正在更新`,updateState_pulling:`正在下载更新`,updateState_host_binary:`正在下载更新程序`,updateState_image_ready:`下载完成`,updateState_ready_to_apply:`可以立即更新`,updateState_recreating:`正在重启`,updateState_health_checking:`正在确认启动`,updateState_rolling_back:`正在恢复上一版本`,updateState_succeeded:`更新完成`,updateState_rolled_back:`已恢复上一版本`,updateState_failed:`更新失败`,checking:`检查中`,refresh:`刷新`,apiKey:`API Key`,apiKeyPh:`API Key`,needApiKey:`先用控制台密码登录才能加载数据。`,loginTitle:`进入控制台`,loginLead:`这台机器上的 CLI2API 代理已经在运行。请输入客户端访问 /v1 时使用的 API Key。`,loginDesc:`和接口 Authorization: Bearer 是同一把钥匙。`,loginFormTitle:`继续`,loginPassword:`控制台密码`,loginPasswordPh:`API Key`,loginNeedKey:`密码是空的。`,loginBadKey:`这把钥匙对不上这台机器。`,loginSubmit:`进入`,loggingInConsole:`核对中…`,loginHint:`只解锁本机控制台。账号登录在进入后的「账号」页。`,showPassword:`显示密码`,hidePassword:`隐藏密码`,signOut:`退出`,checkingSession:`正在检查登录态…`,refreshing:`刷新中`,pages:{home:{title:`概览`,desc:`查看运行状态、请求量与可用端点。`},auth:{title:`授权`,desc:`浏览器 device-flow 登录、PAT 登录,以及会话 rewarm。`},providers:{title:`模型`,desc:`已登录账号可用的模型,以及每个模型的上下文和推理默认值。`},access:{title:`接入与调试`,desc:`主区多轮对话试玩;下方可展开原始 API 调试。`},accounts:{title:`账号`,desc:`一个账号一个登录态。先走浏览器登录;浏览器不方便再用 PAT。`},usage:{title:`用量`,desc:`按模型、账号与供应商统计用量。`},logs:{title:`日志`,desc:`查看近期代理请求和进程输出。`},keys:{title:`API 密钥`,desc:`创建客户端密钥,并限制可用的供应商。`},system:{title:`系统设置`,desc:`管理跨 Provider 路由、系统更新、SQLite 保护和控制台管理员密钥。`},login:{title:`进入控制台`,desc:`和 /v1 使用同一把 API Key。`}},logsLead:`本机请求历史与运行时输出。`,logsRequests:`请求历史`,logsRuntime:`运行日志`,logsEmptyRequests:`还没有请求记录。`,logsEmptyRuntime:`还没有捕获到运行输出。`,logsSearchRuntime:`搜索运行输出…`,logsSearchRequestId:`搜索请求 ID`,logsSearchModel:`搜索模型`,logsSearchAccount:`搜索账号`,logsFilterIdAll:`全部请求 ID`,logsNoFilterOptions:`没有匹配项`,logsClear:`清空历史`,logsClearConfirm:`删除本机全部请求历史?`,logsColTime:`时间`,logsColAccount:`账号`,logsColProvider:`供应商`,logsColModel:`模型`,logsColReasoning:`推理`,logsColStatus:`状态`,logsColLatency:`延迟`,logsColTTFT:`首字`,logsColTokens:`Tokens`,logsTokensIn:`输入`,logsTokensOut:`输出`,logsTokensPoints:`{value} 点`,logsColStream:`模式`,logsStreamYes:`流式`,logsStreamNo:`同步`,logsFilterAll:`全部`,logsFilterOk:`成功`,logsFilterIncomplete:`未完成`,logsFilterError:`失败`,logsFilterCanceled:`取消`,logsFilterAccountAll:`全部账号`,logsFilterProviderAll:`全部供应商`,logsFilterModelAll:`全部模型`,logsFilterKindAll:`全部错误`,logsFilterStreamAll:`全部模式`,logsTimeRange:`时间`,logsTimeAll:`全部时间`,logsTime1h:`1 小时`,logsTime24h:`24 小时`,logsTime7d:`7 天`,logsTimeCustom:`自定义`,logsTimeFrom:`开始`,logsTimeTo:`结束`,logsKindQuota:`额度`,logsKindRateLimit:`限流`,logsKindAuth:`鉴权`,logsKindNotReady:`未就绪`,logsKindUnavailable:`不可用`,logsKindInvalidRequest:`非法请求`,logsKindModelNotAvailable:`模型不可用`,logsPageSize:`每页`,logsPage:`第 {page} / {pages} 页`,logsPrevPage:`上一页`,logsNextPage:`下一页`,logsNoMatch:`没有符合当前筛选的请求。`,logsLevelAll:`全部`,logsLevelInfo:`信息`,logsLevelWarn:`警告`,logsLevelError:`错误`,logsAttempts:`尝试记录`,logsRouting:`路由方式`,logsRouting_pool:`常规池`,logsRouting_pin:`显式指定`,logsRouting_sticky:`会话粘性`,logsRouting_sticky_escape:`粘性逃逸`,logsNoAttempts:`没有尝试详情。`,logsStreamDiagnostics:`流诊断`,logsMessageShape:`消息结构`,logsMessageCount:`消息数`,logsEmptyMessageIndexes:`空内容下标`,logsMessageRoles:`角色顺序`,logsCancellationSource:`取消来源`,logsUpstreamStatus:`上游状态`,logsSSEEvents:`SSE 事件数`,logsBytesRead:`读取字节数`,logsLastEvent:`最后事件`,logsStreamComplete:`已收到 [DONE]`,logsUsageDetail:`本次消耗`,logsCreditConsumed:`消耗点数`,logsDetailTitle:`请求详情`,logsRuntimeDetailTitle:`运行日志详情`,logsRuntimeLevel:`级别`,logsRuntimeSource:`来源`,logsRuntimeMessage:`日志内容`,logsShownTotal:`{shown} / {total}`,logsAutoRefresh:`实时`,failedLogs:`加载日志失败:{msg}`,homeEyebrow:`运行时`,homeDisplay:`网关状态`,homeLead:`运行状态之外,还能看到本机请求量、延迟和 token。`,metricRequests:`请求`,metricSuccess:`成功率`,metricLatency:`p95`,metricTokens:`Tokens`,statsWindow1h:`1小时`,statsWindow24h:`24小时`,statsWindow7d:`7天`,statsWindow30d:`30天`,statsWindowCustom:`自定义`,statsWindowToday:`今天`,statsRefreshPause:`暂停自动刷新`,statsRefreshResume:`恢复自动刷新`,statsRefreshAuto:`每 30 秒刷新 · 点击暂停`,statsRefreshPaused:`自动刷新已暂停 · 点击恢复`,statsDragHint:`拖选时间段查看日志`,statsWindowHint:`{window}窗口`,statsTraffic:`流量`,statsTrafficHint:`所选时间窗口内的已完成聊天请求`,statsEmptyTraffic:`这个时间窗口还没有请求。`,statsLatencyP50:`p50`,statsLatencyP95:`p95`,statsLatencyAvg:`平均`,statsTTFB:`TTFB`,statsPool:`账号池`,statsPoolHint:`就绪 worker 与剩余额度`,statsCooling:`冷却中`,statsTopModels:`热门模型`,statsTopAccounts:`热门账号`,statsTopProviders:`供应商`,statsTopProvidersHint:`按账号类型统计请求量`,statsNoProviders:`还没有供应商流量。`,statsErrorMix:`错误构成`,statsStatusMix:`结果与错误`,statsStatusMixHint:`请求状态、失败类型与热门账号`,statsCoolingDetails:`冷却中 · 原因 · 剩余 · 退避`,statsBackoffLevel:`重启退避等级`,statsAffinityHit:`会话亲和命中`,statsAffinityHint:`命中 {hits} · 未命中 {misses} · 绑定 {bindings}`,metricCacheHit:`缓存命中率`,metricCacheHitDetail:`缓存 {read} / 输入 {prompt}`,metricStreaming:`流式占比`,metricStreamingDetail:`{total} 次请求中 {count} 次`,metricCanceled:`已取消`,metricCanceledDetail:`占请求 {rate}`,statsErrorMixHint:`该窗口内已分类的失败`,statsNoModels:`还没有模型流量。`,statsNoAccounts:`还没有账号流量。`,statsNoErrors:`没有分类错误。`,statsUnknown:`未知`,statsUnassigned:`未分配`,resTitle:`资源占用`,resHint:`主机进程内存与 CPU`,resServer:`主进程`,resWorkers:`Worker`,resEmpty:`还没有 worker 进程。`,resGoroutines:`个协程`,resCpuLifetime:`生命周期均值`,failedStats:`加载统计失败:{msg}`,homeNote:`已登录本机控制台。账号登录在「账号」页。`,metricRuntime:`运行状态`,metricAccounts:`账号`,metricModels:`模型`,metricAuth:`登录态`,metricPort:`端口`,serviceDetail:`服务详情`,endpoints:`可用端点`,copyBaseUrl:`复制 Base URL`,copied:`已复制`,copy:`复制`,open:`打开`,waitingOverview:`等待概览数据…`,signIn:`登录`,connectQoder:`连接账号`,rewarm:`Rewarm`,rewarming:`Rewarm 中`,refreshAccount:`刷新`,refreshingAccount:`刷新中`,stepBrowserTitle:`浏览器 Device Flow`,stepBrowserDesc:`打开账号选择页。浏览器完成授权后,本页会轮询直到会话就绪。`,startBrowserLogin:`用浏览器登录`,starting:`启动中…`,quotaLoading:`额度获取中…`,quotaUnavailable:`额度不可用`,authUrl:`授权链接`,openAuthUrl:`打开链接`,stepPatTitle:`个人访问令牌`,stepPatDesc:`浏览器流程不方便时,可用 PAT 作为备选。`,pat:`PAT`,pasteToken:`粘贴 token`,loginWithPat:`使用 PAT 登录`,loggingIn:`登录中…`,localState:`本地状态`,raw:`原始数据`,noAuthSnapshot:`暂无授权快照。`,catalog:`目录`,availableModels:`可用模型`,modelsPulled:`来源`,filter:`筛选`,filterPh:`glm / qwen / deepseek`,providerFilterAll:`全部供应商`,accountStatusFilter:`账号状态`,connection:`连接信息`,apiPlayground:`接入与调试`,apiPlaygroundHint:`选择账号与模型,主区对话试玩;下方可展开原始 API 查看 JSON 与 curl。`,readyAccounts:`{ready} / {total} 个账号就绪`,baseUrl:`Base URL`,externalClients:`外部客户端`,protocol:`协议`,quickTest:`快速测试`,requestBuilder:`请求编排`,responseInspector:`响应检查`,responseInspectorHint:`本地代理返回的原始 JSON`,requestIdle:`等待请求`,requestComplete:`请求完成`,requestFailed:`请求失败`,responseReceived:`已收到响应`,responseEmptyTitle:`还没有响应`,responseEmptyHint:`选择路由、填写提示词并发送请求,原始响应会显示在这里。`,sendRequest:`发送请求`,promptPlaceholder:`输入要发送给模型的内容`,promptHelper:`测试请求使用非流式 Chat Completions。`,accessTabChat:`对话`,accessTabApi:`原生 API`,accessTabsLabel:`接入方式`,chatTryEmptyTitle:`还没有回复`,chatTryEmptyHint:`在下方输入消息。账号与模型在输入框底栏。离开页面后会话清空。`,chatTryHelper:`Enter 发送 · Shift+Enter 换行。附件随本轮发送。`,chatTrySend:`发送`,chatTryStop:`停止`,chatTryStreaming:`生成中…`,chatTryUserLabel:`你`,chatTryAssistantLabel:`助手`,chatTryCreditsUsed:`消耗 {amount} credits`,chatTryUsageTokens:`{prompt} → {completion}`,chatTryUsageFoot:`{tokens} · {amount} credits`,nativeApiHint:`非流式请求、原始 JSON 响应,以及对应的 curl 命令。`,rawApiShow:`展开原始 API`,rawApiHide:`收起原始 API`,chatAttach:`添加附件`,chatAttachRemove:`移除附件`,chatAttachUnsupported:`不支持的文件类型:{names}`,thinkingPhaseScan:`检索中`,thinkingPhasePlan:`规划中`,thinkingPhaseDraft:`起草中`,thinkingDone:`已思考`,thinkingElapsed:`{n}s`,toolCallGroup:`用了 {n} 个工具`,chatDemoLoad:`预览样例`,thinkingChars:`{count} 字`,thinkingWorking:`思考中`,toolCallRunning:`进行中`,toolCallSuccess:`完成`,toolCallError:`失败`,toolCallUntitled:`工具`,toolCallArgs:`参数`,toolCallArgsEmpty:`(空)`,autoAccountHint:`由调度器选择一个可用账号。`,fixedAccountHint:`本次请求固定发送到所选账号。`,modelRoutingHint:`使用当前代理暴露的公开模型 ID。`,accountModelHint:`只列出该账号当前能提供的模型。钉死账号后,目录里没有的 ID 会请求失败。`,noAccountModels:`这个账号目前没有可发送的模型。`,accountModels:`可用模型`,accountModelsTitle:`{name} 的模型`,accountModelsHint:`该账号的实时目录。钉到此账号的请求只会使用这些 ID。`,accountModelsEmpty:`这个账号还没有公布模型目录。`,accountModelsError:`无法加载模型:{msg}`,noAccountsForTest:`暂无可用账号运行时,请先添加账号并完成登录。`,curlGeneratedHint:`根据当前账号、模型和提示词实时生成`,prompt:`提示词`,model:`模型`,send:`发送`,waitingRequest:`等待请求…`,requesting:`请求中…`,endpointOpenAI:`OpenAI 兼容`,endpointChat:`Chat Completions`,endpointBaseHint:`在 OpenAI 兼容客户端中,将此地址作为 Base URL。`,endpointChatHint:`OpenAI 兼容对话。模型 ID 加前缀即可指定供应商,例如 qoder/glm-5.2。`,endpointMessages:`Anthropic Messages`,endpointMessagesHint:`无状态 Anthropic Messages。使用带供应商前缀的模型 ID 即可钉死一家。`,endpointResponses:`OpenAI Responses`,endpointResponsesHint:`无状态 OpenAI Responses。使用带供应商前缀的模型 ID 即可钉死一家。`,endpointModels:`模型列表`,endpointModelsHint:`公开模型 ID。客户端 API 密钥只会看到其允许供应商的模型。`,endpointHealth:`健康检查`,endpointHealthHint:`检查本地代理是否正在响应。`,endpointCount:`{count} 个 API 端点`,endpointReady:`当前可用`,endpointBaseLabel:`客户端 Base URL`,endpointAuthLabel:`Bearer API Key`,hasUserBlob:`已有 user blob`,userBlobBytes:`user blob 大小`,machineId:`Machine ID`,sessionHot:`会话热状态`,upstreamEndpoint:`上游端点`,rewarmCount:`Rewarm 次数`,proxy:`Proxy`,endpoint:`端点`,lastError:`最近错误`,running:`运行中`,down:`离线`,hot:`热就绪`,up:`在线`,ready:`就绪`,missing:`缺失`,degraded:`降级`,error:`错误`,yes:`是`,no:`否`,modelCol:`模型`,mappedKeyCol:`上游 Key`,requestIdCol:`请求 ID`,providerCol:`供应商`,qoderKeyCol:`上游 Key`,routedTo:`上游模型 {model}`,stateCol:`状态`,contextWindowCol:`上下文窗口`,modelDefaultsCol:`上下文与推理`,contextConfigHint:`这里改的是默认值。请求里如果指定了更大上下文或推理强度,仍以请求为准。`,qoderContextHint:`请求没写上下文长度时使用的默认窗口。`,contextInvalid:`上下文窗口必须是 1,024 到 4,000,000 之间的整数。`,contextSaved:`已保存 {model} 的上下文窗口。`,contextReset:`已恢复 {model} 的默认上下文窗口。`,contextMaxOn:`已开启 {model} 的更大上下文。`,contextMaxOff:`已关闭 {model} 的更大上下文。`,contextMaxUnavailable:`这个模型没有更大上下文开关。`,maxMode:`更大上下文`,maxModeHint:`Trae 的更大上下文窗口,常见是 200k 提到 1M,不是套餐也不是额度。只在请求没带 is_max_mode 时使用;请求里写了仍以请求为准。模型不支持时不会发送这个开关。`,qoderMaxModeHint:`Qoder 的更大上下文窗口,不是套餐也不是额度。开启时请求使用该模型的最大窗口;关闭时(或请求自带上下文窗口时)使用默认窗口。`,catalogWindow:`目录默认窗口`,catalogWindowHint:`这个 Trae 模型没有更大上下文开关,数字是目录里的默认窗口。`,workbuddyContextHint:`WorkBuddy 桌面端目录里的默认窗口和可选窗口,用于本地压缩预算,不是 Trae 的 is_max_mode。聊天请求不会发送窗口开关。`,reasoningLevels:`推理强度`,reasoningHint:`请求没指定推理强度时使用的默认档位。选了不会强制每次都走这一档,也不会限制客户端改用其他允许档位。不在列表里的值会回退到可用档位,而不是锁死。`,reasoningFixed:`固定思考:{type}`,noReasoningLevels:`这个模型没有可选的推理档位。`,reasoningSaved:`已保存 {model} 的默认推理强度:{level}。`,reasoningLevel_none:`关闭`,reasoningLevel_low:`低`,reasoningLevel_medium:`中`,reasoningLevel_high:`高`,reasoningLevel_xhigh:`极高`,reasoningLevel_max:`最强推理`,modelDetails:`详情`,promptMaxTokens:`输入上限`,maxOutputTokens:`输出上限`,actions:`操作`,save:`保存`,custom:`自定义`,defaultValue:`默认`,resetDefault:`恢复默认`,fallback:`回退`,modelFree:`免费`,shownTotal:`显示 {shown} / 共 {total}`,noModelsYet:`暂无模型`,noModelsMatch:`没有匹配的模型。`,noProviders:`尚未加载供应商。`,failedOverview:`概览加载失败:{msg}`,pastePatFirst:`请先粘贴 PAT`,patDone:`PAT 登录完成`,loginOpenMsg:`请在浏览器打开授权链接完成登录`,idle:`空闲`,menu:`菜单`,toggleSidebar:`收起侧栏`,accountsTitle:`账号`,accountsDesc:`一个账号一个登录态。Chat 会 round-robin,失败切下一个。`,noAccounts:`还没有账号,添加一个即可开始服务。`,accountCount:`账号`,signedIn:`已登录`,enabledAccounts:`已启用`,availableAccounts:`可用`,needsAttention:`需处理`,searchAccounts:`搜索名称、账号 ID、UID、提供方或认证类型`,filterAll:`全部`,shownAccounts:`{shown} / {total}`,noAccountsMatch:`没有符合当前条件的账号。`,clearFilters:`清除筛选`,more:`更多操作`,partialCooling:`部分模型冷却`,runtimeState:`运行状态`,maxInflight:`最大并发`,priority:`优先级`,updatedAt:`更新于`,enabledState:`已启用`,cooling:`冷却中`,dead:`恢复中`,authFailed:`登录失败`,patFallback:`PAT 备选`,usePat:`用 PAT`,account:`账号`,autoAccount:`自动(轮询)`,cooldown:`冷却`,inFlight:`进行中`,liveConcurrency:`当前并发`,liveRpm:`近 60 秒`,liveRpmUnit:`次`,liveRpmHint:`最近一分钟发起`,liveTrace:`走势`,livePeak:`峰值 {n}`,liveSaturated:`已满载`,restarts:`重启次数`,dropSystemPrompt:`丢弃系统提示词`,dropSystemPromptHint:`发送前剥离调用方的系统提示词;仍会补一条空的 system,避免国际版要求第一条必须是系统提示词`,autoCheckin:`每日签到`,autoCheckinHint:`按账号配置的本地时间自动领取 WorkBuddy 积分;失败会在约 21:00 重试。默认关闭。`,autoCheckinCreateHint:`仅 WorkBuddy。开启后按该账号的签到时间自动领取积分;未改时间时使用系统默认。`,autoCheckinTime:`签到时间`,autoCheckinTimeHint:`使用服务器本地时间,并在所选时间后的约 14 分钟内执行;首次失败会在约 21:00 重试。新建账号默认继承系统设置。`,checkinNow:`立即签到`,lastCheckin:`最近签到`,lastCheckinNone:`还没有签到记录`,checkinStatus:`签到`,checkinToday:`今日已签到`,checkinPending:`今日未签到`,checkinFailed:`签到异常`,checkinRecords:`签到记录`,checkinRecordsTitle:`签到记录 · {name}`,checkinRecordsHint:`显示该账号最近 20 次签到结果。`,checkinRecordsEmpty:`还没有签到记录`,checkinRecordsCount:`{count} 条记录`,checkinRecordSuccess:`成功`,checkinRecordAlready:`已签到`,checkinRecordFailed:`失败`,refreshCredits:`刷新积分`,expiryDistTitle:`积分到期分布`,expiryDistHint:`按自然日聚合 · 颜色区分账号 · FEFO:上游按失效时刻先后优先扣减`,expiryDistExpand:`展开全部 {n} 天`,expiryDistCollapse:`收起`,expiryDistDayTotal:`到期 {n} 积分`,expiryDistColAccount:`账号`,expiryDistColSoonest:`最近到期`,expiryDistColDaysLeft:`距到期`,expiryDistColBatch:`该日到期`,expiryDistColDaily:`日均需耗`,expiryDistDays:`{n} 天`,expiryDistFoot:`「日均需耗」= 最近到期那天的积分 ÷ 距该日天数,即到期前需要消耗的速度。`,expiryDistExpired:`已过期`,usageDetailTitle:`用量明细`,usageDetailHint:`与上方同一时间窗口 · 按维度看 token、缓存命中率与延迟`,usageDimNote:`共 {n} 行(最多 20)· 请求数含失败尝试 · 口径与用量页 top-N / 缺测规则不同`,usageDimAccount:`按账号`,usageDimModel:`按模型`,usageDimRealm:`按域`,usageSortTotal:`合计 Token`,usageSortRequests:`请求数`,usageSortErrors:`失败数`,usageSortLatency:`平均延迟`,usageColAccount:`账号`,usageColModel:`模型`,usageColRealm:`域`,usageColErrors:`失败`,usageColPrompt:`Prompt`,usageColCacheHit:`缓存命中率`,usageColCompletion:`Completion`,usageColTotal:`合计`,usageColAvgLatency:`均延迟`,usageCreditTitle:`积分扣除历史`,usageCreditHint:`按上游 usage.credit 累计 · 未观测到积分的请求不计入`,usageCreditEmpty:`暂无积分扣除记录;升级前仅含 Token 的历史不会伪造积分。`,usageCreditNote:`{accounts} 个账号 · {models} 个模型倍率分组 · 仅统计与积分同时观测到的 Token`,usageCreditKpiCredits:`扣除积分`,usageCreditKpiCreditsSub:`按上游 usage.credit 累计`,usageCreditKpiTokens:`匹配 Token`,usageCreditKpiTokensSub:`与积分同时观测到的 Token`,usageCreditKpiAvg:`平均积分 / 1M Token`,usageCreditKpiAvgSub:`越低越划算`,usageCreditKpiSamples:`有效积分样本`,usageCreditKpiSamplesSub:`缺字段的历史不参与折算`,usageCreditKpiCache:`缓存命中率`,usageCreditKpiCacheSub:`命中 /(命中+未命中)· 低命中意味着费用翻倍`,usageCreditColRate:`积分倍率`,usageCreditColCredits:`扣除积分`,usageCreditColSampleTokens:`有效样本 Token`,usageCreditColPer1M:`积分 / 1M`,quota:`额度`,quotaUsed:`已用`,quotaRemaining:`剩余`,quotaDaily:`日额度`,quotaWeekly:`周额度`,quotaMonthly:`月额度`,quotaFiveHour:`5 小时额度`,quotaWeeklyLimit:`周额度`,quotaPlan:`订阅`,quotaMonthlyLimit:`月额度`,quotaUsedPercent:`{n}%`,quotaResetsSoon:`即将重置`,quotaResetsInMinutes:`{n} 分钟后重置`,quotaResetsInHours:`{n} 小时后重置`,quotaExpiresOn:`{amount}{unit} 将于 {date} 到期`,quotaAddOn:`附加包`,quotaResourcePackage:`资源包`,quotaExceeded:`额度已用尽`,errorKind:`错误类型`,qoderLoginHint:`这里登录的是该账号的上游登录态,不会改控制台密码。`,needQoderLogin:`需要账号登录`,waitingQoderLogin:`等待账号登录完成…`,qoderLoginDone:`账号登录完成`,rewarmDone:`Rewarm 完成`,accountsSigned:`{n} / {total} 个账号就绪`,addAccount:`添加账号`,batchImport:`批量导入`,batchImportLoading:`正在导入 WorkBuddy 账号…`,batchImportUnrecognized:`无法识别此凭证文件格式。`,batchImportConfirmTitle:`确认批量导入`,batchImportConfirmHint:`已从 {file} 识别。请核对后再导入。`,batchImportConfirmHintNoFile:`请核对识别结果,确认后再导入。`,batchImportRegion:`WorkBuddy 区`,batchImportRegionPickHint:`未能明确识别区,请先选择国内版或国际版。`,batchImportRegionMixed:`此包同时含国内与国际域名。请拆分后导入,或强制选择一个区。`,batchImportRegionUnknown:`未从域名识别出区,请确认。`,batchImportUnknownFormat:`未知 format 字段,已按形状猜测。`,batchImportProviderUnsupported:`该供应商暂不支持批量导入。识别结果已保留,便于后续扩展。`,batchImportConfirmAction:`导入`,batchImportFormatUnknown:`未知格式`,batchImportProviderUnknown:`未知供应商`,accountName:`账号名称`,accountNameRequired:`请输入账号名称。`,accountCreated:`账号已创建,会话正在启动。`,importCredential:`导入原生凭证`,accountImported:`凭证已导入,运行时已启动。`,accountImportBatch:`已导入 {n} 个账号。`,accountImportPartial:`成功 {ok},失败 {fail}。`,credentialCopied:`凭证包已复制。`,addAccountTitle:`添加账号`,accountType:`账号类型`,loginMethod:`登录方式`,accountTypeHint:`选择这个隔离运行时使用的上游登录类型。`,accountTypeQoderGlobal:`Qoder 国际版`,accountTypeQoderGlobalHint:`Qoder 国际版:浏览器、PAT 或导入凭证`,accountTypeQoderCN:`Qoder 国内版`,accountTypeQoderCNHint:`Qoder 中国大陆版:浏览器、PAT 或导入凭证`,accountTypeWorkBuddyCN:`WorkBuddy 国内版`,accountTypeWorkBuddyCNHint:`CodeBuddy 国内版:浏览器登录或导入凭证`,accountTypeWorkBuddyGlobal:`WorkBuddy 国际版`,accountTypeWorkBuddyGlobalHint:`WorkBuddy 国际版:浏览器登录或导入凭证`,accountTypeTraeCN:`Trae 国内版(Solo)`,accountTypeTraeCNHint:`Trae 国内 Solo:浏览器登录或导入凭证`,accountTypeDevinGlobal:`Devin(实验性)`,accountTypeDevinGlobalHint:`实验性 Devin 国际版:浏览器 OAuth 或导入 session token`,accountTypeCommandGlobal:`Command Code`,accountTypeCommandGlobalHint:`粘贴 user_… 密钥接入。走 CLI 的 /alpha/generate 协议,所有档位均可用(含 $1 Go 套餐)。`,accountTypeCodexGlobal:`Codex`,accountTypeCodexGlobalHint:`OpenAI Codex:Codex CLI OAuth、Sign in with ChatGPT,或导入凭证`,accountTypeZhipuCN:`智谱 GLM`,accountTypeZhipuCNHint:`填写智谱 API Key。按量付费或 Coding Plan 与上游账号的计费方式一致。`,accountTypeQwenworkGlobal:`QwenWork 国际版`,accountTypeQwenworkGlobalHint:`QwenWork 国际版(qwenwork.ai),浏览器授权或导入凭证。授权链接只能使用一次:请在已登录目标账号的浏览器窗口里直接打开,不要经聊天工具发送。`,accountTypeQwenworkCN:`千问办公 国内版`,accountTypeQwenworkCNHint:`千问办公国内版(qwenwork.cn),浏览器授权或导入凭证。授权链接只能使用一次:请在已登录目标账号的浏览器窗口里直接打开,不要经聊天工具发送。国内版尚未经真实账号验收。`,accountTypeKimiCN:`Kimi Code 国内版`,accountTypeKimiCNHint:`Kimi Code 中国区订阅,走 auth.kimi.com 的设备码授权,与官方 CLI 使用同一个 OAuth 客户端。已在本机登录 Kimi Code 的,可直接粘贴它的凭证 JSON 导入。`,addAccountDesc:`创建一个隔离会话并登录。每个账号使用独立的运行时目录。`,tabBrowser:`浏览器登录`,tabPat:`PAT`,tabImport:`导入凭证`,recommended:`推荐`,wizardSettings:`账号设置`,wizardAdvanced:`高级选项`,wizardContinue:`继续`,wizardBack:`返回`,wizardSettingsHint:`登录前先设好这些选项,之后仍可在账号卡片上点编辑修改。`,editAccount:`编辑`,editAccountTitle:`编辑 {name}`,editAccountHint:`修改显示名称、并发、调度优先级、代理出口和模型别名;支持签到的账号还可设置签到时间。`,accountModelAliases:`别名`,accountModelAliasesHint:`这个账号对外应答的名字。选中这个账号后,请求会换成它自己的真实模型。`,accountModelAliasTargetPlaceholder:`这个账号上的真实模型`,modelAliasName:`外号`,modelAliasTarget:`真实模型`,modelAliasAdd:`添加`,modelAliasRemove:`移除`,modelAliasPlaceholder:`kimi-k3`,enabledModels:`可用模型`,enabledModelsHint:`不限制时使用整个目录。限制后,这个账号只接选中的模型。`,restrictModels:`仅选中`,allModels:`全部模型`,modelPickerSearch:`搜索模型`,modelPickerCount:`已选 {selected} / 共 {total}`,modelPickerSelectAll:`全选`,modelPickerClear:`清空`,modelPickerOffline:`已下线`,modelPickerRemove:`移除 {model}`,modelPickerNoMatch:`没有匹配的模型。`,maxInflightInvalid:`并发必须是 1 到 32 之间的整数。`,priorityInvalid:`优先级必须是 1 到 100 之间的整数。`,wizardNamePh:`账号名称`,maxInflightHint:`这个账号同时能跑多少条对话。之后改并发会重启该账号的 worker。`,priorityHint:`数字越大,之后调度会越优先选这个账号。默认 50。`,proxyUrl:`代理地址`,proxyUrlPlaceholder:`http://127.0.0.1:7890、direct`,proxyUrlHint:`留空继承全局代理;填写 direct 或 none 可让此账号直连。Qoder 仅支持 HTTP(S),WorkBuddy/Trae 额外支持 SOCKS5。`,proxySettingsTitle:`统一代理出口`,proxySettingsHint:`设置所有上游请求的默认代理;全局代理支持 HTTP(S),SOCKS5 仅支持 WorkBuddy/Trae 的账号级代理;账号级代理优先于全局代理。`,dropSystemPromptCreateHint:`仅 WorkBuddy。剥离调用方系统提示词后仍补一条空的 system,避免国际版拒绝请求。`,wizardBrowserLead:`会展示授权地址。打开或复制后在浏览器完成授权,向导会自动继续。`,wizardCodexBrowserLead:`先选 Codex CLI 或 Sign in with ChatGPT,再打开授权地址。ChatGPT 网页登录必须走后者,CLI 流刷新不了那种 token。`,codexLoginMethod:`Codex 登录方式`,codexLoginCli:`Codex CLI`,codexLoginCliHint:`官方 Codex CLI OAuth,适合 CLI 签发的凭证。`,codexLoginChatGPT:`Sign in with ChatGPT`,codexLoginChatGPTHint:`ChatGPT 网页登录。凭证单独存储,刷新走另一套 token 端点。`,startCodexCliLogin:`开始 Codex CLI 登录`,startCodexChatGPTLogin:`Sign in with ChatGPT`,wizardStartBrowser:`开始浏览器登录`,wizardStartingSession:`正在启动账号会话…`,wizardWaitingBrowser:`正在等待浏览器完成授权…`,wizardCallbackLead:`如果浏览器停在 127.0.0.1,而控制台一直没有完成,把地址栏完整 URL 粘贴到这里。`,wizardCallbackPh:`粘贴完整的 http://127.0.0.1…/authorize?… 地址`,wizardSubmitCallback:`提交回调地址`,wizardStartingWorker:`已收到授权,正在启动账号会话…`,wizardAccountReady:`账号已就绪。`,wizardLoginTimeout:`等待浏览器登录超时,可在账号卡片重试。`,wizardPatLead:`浏览器流程不方便时,可用个人访问令牌登录。`,wizardPatLeadCN:`在 qoder.com.cn/account/integrations 创建 PAT,然后粘贴到这里。`,wizardPatLeadCommand:`粘贴你的 Command Code 密钥(形如 user_…,来自 commandcode.ai/settings)。`,zhipuApiKey:`API Key`,zhipuApiKeyPh:`粘贴 open.bigmodel.cn 的密钥`,zhipuAccountMode:`账号类型`,zhipuModePayg:`按量付费`,zhipuModePaygHint:`按 token 计费,走标准 GLM 端点。`,zhipuModeCoding:`Coding Plan`,zhipuModeCodingHint:`编程套餐。走 Coding Plan 端点,并显示套餐额度。`,zhipuOrganization:`组织 ID`,zhipuOrganizationPh:`可选,团队版 Coding Plan 才需要`,zhipuProject:`项目 ID`,zhipuProjectPh:`可选`,zhipuCreate:`添加智谱账号`,zhipuKeyRequired:`请先粘贴智谱 API Key。`,wizardPatPh:`粘贴个人访问令牌`,wizardCreateAndLogin:`创建并登录`,wizardImportLead:`粘贴凭证 JSON。WorkBuddy hub 导出包会一次性导入其中全部账号。`,wizardImportPh:`粘贴凭证 JSON`,wizardChooseFile:`选择文件`,wizardBadJson:`这看起来不是有效的凭证包。`,reLogin:`登录`,cancel:`取消`,close:`关闭`,create:`创建`,import:`导入`,export:`导出`,enable:`启用`,disable:`停用`,disabled:`已停用`,delete:`删除`,holdToDelete:`按住删除`,trendHalfHint:`所选时间窗口后半段对比前半段`,toastRefreshingAccount:`正在刷新账号…`,toastAccountRefreshed:`账号已刷新`,toastRefreshingCredits:`正在刷新积分…`,toastCreditsRefreshed:`积分已刷新`,toastAccountAdded:`账号已添加`,toastAccountDeleted:`账号已删除`,toastClearingLogs:`正在清空请求日志…`,toastLogsCleared:`请求日志已清空`,toastKeyDeleted:`API Key 已删除`,toastFailed:`操作失败`,deleteAccountConfirm:`确定删除账号 {name} 吗?这会移除它的本地运行时和已保存凭据。`,edit:`编辑`,enabled:`已启用`,keysLead:`客户端密钥只用于 /v1。供应商留空表示全部可用。控制台管理员密钥在系统页。`,keysCreate:`创建密钥`,keysEmpty:`还没有客户端密钥`,keysEmptyHint:`为 OpenAI 兼容客户端创建命名密钥。它不能登录这个控制台。`,keysCreateTitle:`创建 API 密钥`,keysCreateHint:`明文密钥只显示一次,请保存在会调用 /v1 的客户端里。`,keysEditTitle:`编辑 API 密钥`,keysEditHint:`可以改名称,或限制它能调度到哪些供应商。`,keysName:`名称`,keysNamePh:`CI 机器人`,keysNameRequired:`请填写名称。`,keysProviders:`供应商`,keysProvidersHint:`可将 Key 限制到特定供应商区域(如国内版 / 国际版)。全部不勾选表示允许所有供应商。`,keysAllProviders:`全部供应商`,keysAllRegions:`全区域`,keysProvidersNotLoaded:`供应商列表仍在加载中。已禁用保存,以保证 Key 权限不会被意外更改。`,keysProvidersLoadFailed:`供应商列表加载失败:{message}`,keysLastUsed:`最近使用 {time}`,keysNeverUsed:`尚未使用`,keysSecretTitle:`请立刻保存这把密钥`,keysSecretHint:`服务端只存哈希,关闭后无法再查看明文。`,keysSecretOnce:`关闭弹窗前请先复制。`,keysDeleteConfirm:`确定删除 API 密钥 {name} 吗?正在使用它的客户端会立刻失败。`,consoleKeyTitle:`控制台 API 密钥`,consoleKeyHint:`这是登录本控制台的管理员密钥。`,consoleKeyLead:`它可以调用全部供应商,并管理账号、密钥和更新。客户端密钥在「API 密钥」页。`,consoleKeyRotate:`轮换密钥`,consoleKeyRotateHint:`轮换后其他会话会失效,并重启 Qoder worker 以使用新密钥。`,consoleKeyRotateNow:`立即轮换`,consoleKeySecretTitle:`新的控制台密钥`,consoleKeySecretHint:`当前浏览器会话已更新。如果还有客户端在用旧的控制台密钥,请把新值复制过去。`}};function CH(e,t,n={}){let r=SH[e]||SH.en,i=SH.en,a=r[t];return a??=i[t],typeof a==`string`?a.replace(/\{(\w+)\}/g,(e,t)=>n[t]==null?`{${t}}`:String(n[t])):t}function wH(e,t){return((SH[e]||SH.en).pages||SH.en.pages)[t]||{title:t,desc:``}}var TH=(0,v.createContext)(null);function EH({children:e}){let[t,n]=(0,v.useState)(()=>localStorage.getItem(`cli2api_lang`)===`en`?`en`:`zh`),r=(0,v.useMemo)(()=>({lang:t,setLang:e=>{let t=e===`en`?`en`:`zh`;localStorage.setItem(`cli2api_lang`,t),document.documentElement.lang=t===`zh`?`zh-CN`:`en`,n(t)},t:(e,n)=>CH(t,e,n),page:e=>wH(t,e)}),[t]);return(0,G.jsx)(TH.Provider,{value:r,children:e})}function DH(){let e=(0,v.useContext)(TH);if(!e)throw Error(`useI18n must be used within I18nProvider`);return e}var OH=`cli2api_key`,kH=(0,v.createContext)(null);function AH({children:e}){let[t,n]=(0,v.useState)(()=>localStorage.getItem(OH)||``),r=(0,v.useMemo)(()=>({apiKey:t,setApiKey:e=>{let t=String(e||``).trim();t?localStorage.setItem(OH,t):localStorage.removeItem(OH),n(t)},signOut:()=>{localStorage.removeItem(OH),n(``)}}),[t]);return(0,G.jsx)(kH.Provider,{value:r,children:e})}function jH(){let e=(0,v.useContext)(kH);if(!e)throw Error(`useApiKey must be used within ApiKeyProvider`);return e}function MH(){return(localStorage.getItem(OH)||``).trim()}var NH=class extends Error{status;code;constructor(e,t,n){super(e),this.name=`ApiError`,this.status=t,this.code=n}};function PH(e){if(e instanceof NH)return e.status===401||e.code===`invalid_api_key`;let t=e instanceof Error?e.message:String(e||``);return/invalid_api_key|unauthorized|Missing\/invalid API key/i.test(t)}async function FH(e,t={},n){let r=new Headers(t.headers||{});t.body&&!(t.body instanceof FormData)&&!r.has(`Content-Type`)&&r.set(`Content-Type`,`application/json`);let i=(n??MH()).trim();i&&!r.has(`Authorization`)&&r.set(`Authorization`,`Bearer ${i}`);let a=await fetch(e,{...t,headers:r}),o=await a.text(),s;try{s=o?JSON.parse(o):null}catch{s=o}if(!a.ok){let e=typeof s==`string`?s:o,t=/]/i.test(e);throw new NH(s?.error?.message||s?.message||(t?`${a.status} ${a.statusText}`:e||a.statusText),a.status,s?.error?.code)}return s}function IH(e){return FH(`/api/overview/summary`,{},e)}function LH(e=!1){return FH(`/api/accounts?refresh=${e?`1`:`0`}`)}function RH(e,t){if(!e)throw Error(`account id required`);let n={};return t&&(n.login_method=t),FH(`/api/accounts/${encodeURIComponent(e)}/login/device`,{method:`POST`,body:JSON.stringify(n)})}function zH(e){if(!e)throw Error(`account id required`);return FH(`/api/accounts/${encodeURIComponent(e)}/login/status`)}function BH(e,t){if(!e)throw Error(`account id required`);return FH(`/api/accounts/${encodeURIComponent(e)}/login/callback`,{method:`POST`,body:JSON.stringify({callback_url:t})})}function VH(e,t){if(!t)throw Error(`account id required`);return FH(`/api/accounts/${encodeURIComponent(t)}/login/pat`,{method:`POST`,body:JSON.stringify({pat:e})})}var HH=3e4,UH=new Map;function WH(e,t){return`${e||`*`}@${t||`merged`}`}function GH(e,t=!1,n){let r=new URLSearchParams;t&&r.set(`refresh`,`1`),e&&r.set(`account`,e),n&&r.set(`view`,n);let i=r.toString();return FH(`/api/models${i?`?${i}`:``}`)}function KH(e,t){let n=WH(e,t),r=UH.get(n);if(r&&Date.now()-r.at(UH.set(n,{data:e,at:Date.now()}),e)).finally(()=>{let e=UH.get(n);e?.pending===i&&UH.set(n,{data:e.data,at:e.at})});return UH.set(n,{data:r?.data||{},at:r?.at||0,pending:i}),i}function qH(e,t){let n=WH(e,t);return UH.delete(n),GH(e,!0,t).then(e=>(UH.set(n,{data:e,at:Date.now()}),e))}function JH(e,t,n,r){return FH(`/api/models/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PATCH`,body:JSON.stringify(e===`qoder`&&n&&r?{max_mode:n,context_length:r}:{max_mode:n})})}function YH(e,t,n){return FH(`/api/models/${e}/${encodeURIComponent(t)}`,{method:`PATCH`,body:JSON.stringify({reasoning_effort:n})})}function XH(e,t){if(!e)throw Error(`account id required`);let n=t?.quota?`?quota=1`:``;return FH(`/api/accounts/${encodeURIComponent(e)}/refresh${n}`,{method:`POST`,body:`{}`})}function ZH(e,t,n){let r={};return n&&(r[`X-Qoder-Account`]=n),FH(`/api/chat`,{method:`POST`,headers:r,body:JSON.stringify({model:e,stream:!1,messages:[{role:`user`,content:t}]})})}function QH(e,t){if(!Array.isArray(t))return e;let n=e.map(e=>({...e,function:e.function?{...e.function}:void 0}));for(let e of t){if(!e||typeof e!=`object`)continue;let t=e,r=typeof t.index==`number`?t.index:n.length;for(;n.length<=r;)n.push({index:n.length,function:{name:``,arguments:``}});let i=n[r];i.index=r,typeof t.id==`string`&&t.id&&(i.id=t.id),typeof t.type==`string`&&t.type&&(i.type=t.type);let a=t.function;if(a&&typeof a==`object`){let e=a;i.function||={name:``,arguments:``},typeof e.name==`string`&&e.name&&(i.function.name=e.name),typeof e.arguments==`string`&&e.arguments&&(i.function.arguments=(i.function.arguments||``)+e.arguments)}}return n}function $H(e){return typeof e==`string`?[{role:`user`,content:e}]:e}async function eU(e,t,n,r={}){let i={"Content-Type":`application/json`};n&&(i[`X-Qoder-Account`]=n);let a=MH().trim();a&&(i.Authorization=`Bearer ${a}`);let o=$H(t),s=await fetch(`/api/chat`,{method:`POST`,headers:i,body:JSON.stringify({model:e,stream:!0,messages:o}),signal:r.signal});if(!s.ok){let e=await s.text(),t;try{t=e?JSON.parse(e):null}catch{t=e}let n=typeof t==`string`?t:e,r=/]/i.test(n);throw new NH(t?.error?.message||t?.message||(r?`${s.status} ${s.statusText}`:n||s.statusText),s.status,t?.error?.code)}let c=s.body?.getReader();if(!c)throw Error(`No response body`);let l=new TextDecoder,u=``,d=``,f=``,p=[],m=e=>{for(let t of[`credits`,`credit`,`consumed_credits`,`ConsumedCredits`]){let n=e[t];if(typeof n==`number`&&Number.isFinite(n))return n}},h=e=>{let t=e.trim();if(!t.startsWith(`data:`))return!1;let n=t.slice(5).trim();if(!n)return!1;if(n===`[DONE]`)return!0;try{let e=JSON.parse(n),t=e?.usage;if(t&&typeof t==`object`){let e=t,n={prompt_tokens:typeof e.prompt_tokens==`number`?e.prompt_tokens:void 0,completion_tokens:typeof e.completion_tokens==`number`?e.completion_tokens:void 0,total_tokens:typeof e.total_tokens==`number`?e.total_tokens:void 0,credits:m(e),source:typeof e.source==`string`?e.source:void 0};r.onUsage?.(n)}let i=e?.choices?.[0]?.delta;if(!i||typeof i!=`object`)return!1;let a=i.content;typeof a==`string`&&a&&(d+=a,r.onContent?.(a,d));let o=i.reasoning_content;typeof o==`string`&&o&&(f+=o,r.onReasoning?.(o,f)),i.tool_calls&&(p=QH(p,i.tool_calls),r.onToolCalls?.(p))}catch{}return!1};for(;;){let{done:e,value:t}=await c.read();if(e)break;u+=l.decode(t,{stream:!0});let n=u.split(` +}`,document.head.prepend(i);let o=e=>{if(!(e.touches.length===2||n)){if(!t||t===document.documentElement||t===document.body){e.preventDefault();return}t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth&&e.preventDefault()}},s=e=>{let t=H(e),n=e.relatedTarget;n&&Ys(n)?(n.focus({preventScroll:!0}),o_(n,Ys(t))):n||(t.parentElement?.closest(`[tabindex]`))?.focus({preventScroll:!0})},c=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(e){let t=ms(),n=t!=null&&Ys(t);c.call(this,{...e,preventScroll:!0}),(!e||!e.preventScroll)&&o_(this,n)};let l=rs(a_(document,`touchstart`,r,{passive:!1,capture:!0}),a_(document,`touchmove`,o,{passive:!1,capture:!0}),a_(document,`blur`,s,!0));return()=>{e(),l(),i.remove(),HTMLElement.prototype.focus=c}}function i_(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function a_(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function o_(e,t){t||!Qg?s_(e):Qg.addEventListener(`resize`,()=>s_(e),{once:!0})}function s_(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let e=Gs(n);if(e!==document.documentElement&&e!==document.body&&e!==n){let t=e.getBoundingClientRect(),r=n.getBoundingClientRect();if(r.topt.top+n.clientHeight){let n=t.bottom;Qg&&(n=Math.min(n,Qg.offsetTop+Qg.height));let i=r.top-t.top-((n-t.top)/2-r.height/2);e.scrollTo({top:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,e.scrollTop+i)),behavior:`smooth`})}}n=e.parentElement}}function c_(e,t){let{triggerRef:n,popoverRef:r,groupRef:i,isNonModal:a,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:s,...c}=e,l=c.trigger===`SubmenuTrigger`,{overlayProps:u,underlayProps:d}=Zg({isOpen:t.isOpen,onClose:t.close,shouldCloseOnBlur:!0,isDismissable:!a||l,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:s},i??r),{overlayProps:f,arrowProps:p,placement:m,triggerAnchorPoint:h}=gg({...c,targetRef:n,overlayRef:r,isOpen:t.isOpen,onClose:a&&!l?t.close:null,getTargetRect:c.getTargetRect??(t.point?()=>new DOMRect(t.point.x,t.point.y,0,0):void 0)});t_({isDisabled:a||!t.isOpen}),(0,v.useEffect)(()=>{if(t.isOpen&&r.current)return a?Wh(i?.current??r.current):Uh([i?.current??r.current],{shouldUseInert:!0})},[a,t.isOpen,r,i]);let{focusWithinProps:g}=qm(e);return{popoverProps:U(u,f,g),arrowProps:p,underlayProps:d,placement:m,triggerAnchorPoint:h}}var l_={};l_={dismiss:`تجاهل`};var u_={};u_={dismiss:`Отхвърляне`};var d_={};d_={dismiss:`Odstranit`};var f_={};f_={dismiss:`Luk`};var p_={};p_={dismiss:`Schließen`};var m_={};m_={dismiss:`Απόρριψη`};var h_={};h_={dismiss:`Dismiss`};var g_={};g_={dismiss:`Descartar`};var __={};__={dismiss:`Lõpeta`};var v_={};v_={dismiss:`Hylkää`};var y_={};y_={dismiss:`Rejeter`};var b_={};b_={dismiss:`התעלם`};var x_={};x_={dismiss:`Odbaci`};var S_={};S_={dismiss:`Elutasítás`};var C_={};C_={dismiss:`Ignora`};var w_={};w_={dismiss:`閉じる`};var T_={};T_={dismiss:`무시`};var E_={};E_={dismiss:`Atmesti`};var D_={};D_={dismiss:`Nerādīt`};var O_={};O_={dismiss:`Lukk`};var k_={};k_={dismiss:`Negeren`};var A_={};A_={dismiss:`Zignoruj`};var j_={};j_={dismiss:`Descartar`};var M_={};M_={dismiss:`Dispensar`};var N_={};N_={dismiss:`Revocare`};var P_={};P_={dismiss:`Пропустить`};var F_={};F_={dismiss:`Zrušiť`};var I_={};I_={dismiss:`Opusti`};var L_={};L_={dismiss:`Odbaci`};var R_={};R_={dismiss:`Avvisa`};var z_={};z_={dismiss:`Kapat`};var B_={};B_={dismiss:`Скасувати`};var V_={};V_={dismiss:`取消`};var H_={};H_={dismiss:`關閉`};var U_={};U_={"ar-AE":l_,"bg-BG":u_,"cs-CZ":d_,"da-DK":f_,"de-DE":p_,"el-GR":m_,"en-US":h_,"es-ES":g_,"et-EE":__,"fi-FI":v_,"fr-FR":y_,"he-IL":b_,"hr-HR":x_,"hu-HU":S_,"it-IT":C_,"ja-JP":w_,"ko-KR":T_,"lt-LT":E_,"lv-LV":D_,"nb-NO":O_,"nl-NL":k_,"pl-PL":A_,"pt-BR":j_,"pt-PT":M_,"ro-RO":N_,"ru-RU":P_,"sk-SK":F_,"sl-SI":I_,"sr-SP":L_,"sv-SE":R_,"tr-TR":z_,"uk-UA":B_,"zh-CN":V_,"zh-TW":H_};var W_=Symbol.for(`react-aria.i18n.locale`),G_=Symbol.for(`react-aria.i18n.strings`),K_=void 0,q_=class e{constructor(e,t=`en-US`){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=J_(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(t){if(typeof window>`u`)return null;let n=window[W_];if(K_===void 0){let t=window[G_];if(!t)return null;K_={};for(let r in t)K_[r]=new e({[n]:t[r]},n)}let r=K_?.[t];if(!r)throw Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}};function J_(e,t,n=`en-US`){if(t[e])return t[e];let r=Y_(e),i=X_(e);if(i&&t[`${r}-${i}`])return t[`${r}-${i}`];if(t[r])return t[r];for(let e in t)if(e.startsWith(r+`-`))return t[e];return t[n]}function Y_(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}function X_(e){if(Intl.Locale)return new Intl.Locale(e).script}var Z_=new Map,Q_=new Map,$_=class{constructor(e,t){this.locale=e,this.strings=t}format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return typeof n==`function`?n(t,this):n}plural(e,t,n=`cardinal`){let r=t[`=`+e];if(r)return typeof r==`function`?r():r;let i=this.locale+`:`+n,a=Z_.get(i);return a||(a=new Intl.PluralRules(this.locale,{type:n}),Z_.set(i,a)),r=t[a.select(e)]||t.other,typeof r==`function`?r():r}number(e){let t=Q_.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),Q_.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return typeof n==`function`?n():n}},ev=new WeakMap;function tv(e){let t=ev.get(e);return t||(t=new q_(e),ev.set(e,t)),t}function nv(e,t){return t&&q_.getGlobalDictionaryForPackage(t)||tv(e)}function rv(e,t){let{locale:n}=rp(),r=nv(e,t);return(0,v.useMemo)(()=>new $_(n,r),[n,r])}var iv={border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`};function av(e={}){let{style:t,isFocusable:n}=e,[r,i]=(0,v.useState)(!1),{focusWithinProps:a}=qm({isDisabled:!n,onFocusWithinChange:e=>i(e)}),o=(0,v.useMemo)(()=>r?t:t?{...iv,...t}:iv,[r]);return{visuallyHiddenProps:{...a,style:o}}}function ov(e){let{children:t,elementType:n=`div`,isFocusable:r,style:i,...a}=e,{visuallyHiddenProps:o}=av(e);return v.createElement(n,U(a,o),t)}function sv(e){return e&&e.__esModule?e.default:e}function cv(e){let{onDismiss:t,...n}=e,r=Fs(n,rv(sv(U_),`@react-aria/overlays`).format(`dismiss`)),i=()=>{t&&t()};return v.createElement(ov,null,v.createElement(`button`,{...r,tabIndex:-1,onClick:i,style:{width:1,height:1}}))}var lv=v.forwardRef(({children:e,...t},n)=>{let r=(0,v.useRef)(!1),i=(0,v.useContext)(Mm),a=U(i||{},{...t,register(){r.current=!0,i&&i.register()}});return a.ref=Is(n||i?.ref),Us(i,a.ref),(0,v.useEffect)(()=>{r.current||=!0},[]),v.createElement(Mm.Provider,{value:a},e)});function uv({children:e}){let t=(0,v.useMemo)(()=>({register:()=>{}}),[]);return v.createElement(Mm.Provider,{value:t},e)}var dv=(0,v.createContext)({});function fv(){return(0,v.useContext)(dv)??{}}var pv=v.createContext(null);function mv(e){let t=Jo(),{portalContainer:n=t?null:document.body,isExiting:r}=e,[i,a]=(0,v.useState)(!1),o=(0,v.useMemo)(()=>({contain:i,setContain:a}),[i,a]),{getContainer:s}=fv();if(!e.portalContainer&&s&&(n=s()),!n)return null;let c=e.children;return e.disableFocusManagement||(c=v.createElement(Sg,{restoreFocus:!0,contain:(e.shouldContainFocus||i)&&!r},c)),c=v.createElement(pv.Provider,{value:o},v.createElement(uv,null,v.createElement(Cm.Provider,{value:null},c))),dc.createPortal(c,n)}function hv(){let e=(0,v.useContext)(pv)?.setContain;Io(()=>{e?.(!0)},[e])}function gv(e){let[t,n]=sh(e.isOpen,e.defaultOpen||!1,e.onOpenChange),[r,i]=(0,v.useState)(null);return{isOpen:t,setOpen:n,open:(0,v.useCallback)(()=>{n(!0)},[n]),close:(0,v.useCallback)(()=>{n(!1)},[n]),toggle:(0,v.useCallback)(()=>{n(!t)},[n,t]),point:r,setPoint:i}}var _v=(0,v.createContext)(null),vv=(0,v.createContext)(null),yv=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,_v);let n=(0,v.useContext)(cS),r=gv(e),i=e.isOpen!=null||e.defaultOpen!=null||!n?r:n,a=pc(t,i.isOpen),o=e.isExiting||!e.shouldSkipAnimation&&a||!1,s=Uf(),{direction:c}=rp();if(s){let t=e.children;return typeof t==`function`&&(t=t({trigger:e.trigger||null,placement:`bottom`,isEntering:!1,isExiting:!1,defaultChildren:null})),v.createElement(v.Fragment,null,t)}return i&&!i.isOpen&&!o?null:v.createElement(bv,{...e,triggerRef:e.triggerRef,state:i,popoverRef:t,isExiting:o,dir:c})});function bv({state:e,isExiting:t,UNSTABLE_portalContainer:n,clearContexts:r,...i}){let a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useContext)(vv),c=s&&i.trigger===`SubmenuTrigger`,{popoverProps:l,underlayProps:u,arrowProps:d,placement:f,triggerAnchorPoint:p}=c_({...i,offset:i.offset??8,arrowRef:a,groupRef:c?s:o},e),m=i.popoverRef,h=fc(m,!!f),g=i.isEntering||!i.shouldSkipAnimation&&h||!1,_=Mf({...i,defaultClassName:`react-aria-Popover`,values:{trigger:i.trigger||null,placement:f,isEntering:g,isExiting:t}}),y=!i.isNonModal||i.trigger===`SubmenuTrigger`||i.trigger===`PreviewTrigger`,[b,x]=(0,v.useState)(i.trigger===`PreviewTrigger`);Io(()=>{m.current&&x(y&&!m.current.querySelector(`[role=dialog]`))},[m,y]),(0,v.useEffect)(()=>{b&&i.trigger!==`PreviewTrigger`&&(i.trigger!==`SubmenuTrigger`||em()!==`pointer`)&&m.current&&!gs(m.current)&&sm(m.current)},[b,m,i.trigger]);let S=(0,v.useMemo)(()=>{let e=_.children;if(r)for(let t of r)e=v.createElement(t.Provider,{value:null},e);return e},[_.children,r]),[C,w]=(0,v.useState)(null),T=(0,v.useCallback)(()=>{i.triggerRef.current&&w(i.triggerRef.current.getBoundingClientRect().width+`px`)},[i.triggerRef]);Io(T,[T]),Hs({ref:_.style?.[`--trigger-width`]?void 0:i.triggerRef,onResize:T});let E={...l.style,"--trigger-anchor-point":p?`${p.x}px ${p.y}px`:void 0,..._.style,"--trigger-width":_.style?.[`--trigger-width`]||C},D=v.createElement(q.div,{...U(W(i,{global:!0}),l),..._,id:b?i.id:void 0,role:b?`dialog`:void 0,tabIndex:b?-1:void 0,"aria-label":i[`aria-label`],"aria-labelledby":i[`aria-labelledby`],ref:m,slot:i.slot||void 0,style:E,dir:i.dir,"data-trigger":i.trigger,"data-placement":f,"data-entering":g||void 0,"data-exiting":t||void 0},!i.isNonModal&&v.createElement(cv,{onDismiss:e.close}),v.createElement(Lh.Provider,{value:{...d,placement:f,ref:a}},S),v.createElement(cv,{onDismiss:e.close}));return c?v.createElement(mv,{...i,shouldContainFocus:b&&i.trigger!==`PreviewTrigger`,isExiting:t,portalContainer:n??s?.current??void 0},D):v.createElement(mv,{...i,shouldContainFocus:b&&i.trigger!==`PreviewTrigger`,isExiting:t,portalContainer:n},!i.isNonModal&&e.isOpen&&v.createElement(`div`,{"data-testid":`underlay`,...u,style:{position:`fixed`,inset:0}}),v.createElement(`div`,{ref:o,style:{display:`contents`}},v.createElement(vv.Provider,{value:o},D)))}var xv=class{constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}},Sv=class extends xv{filter(e,t,n){let[r,i]=Dv(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}};(class extends xv{static{this.type=`header`}});var Cv=class extends xv{static{this.type=`loader`}},wv=class extends Sv{static{this.type=`item`}filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}},Tv=class extends Sv{static{this.type=`section`}filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}},Ev=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=Dv(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};function Dv(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey==null?null:e.getItem(o.nextKey)}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e==null?a=null:(a=t.getItem(e),a.nextKey=null)}return[i?.key??null,a?.key??null]}var Ov=class{constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.indexthis.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}};function jv(e){let{children:t,items:n,idScope:r,addIdAndValue:i,dependencies:a=[]}=e,o=(0,v.useMemo)(()=>void 0,[t]),s=(0,v.useMemo)(()=>new WeakMap,[...a,o]);return(0,v.useMemo)(()=>{if(n&&typeof t==`function`){let e=[];for(let a of n){let n=Mv(a)?a:null,o=n?s.get(n):null;if(!o){o=t(a);let c=o.props.id??a?.key??a?.id;r!=null&&o.props.id==null&&c!=null&&(c=r+`:`+c);let l=c??e.length;o=(0,v.cloneElement)(o,i?{key:l,id:c,value:a}:{key:l}),n&&s.set(n,o)}e.push(o)}return e}if(typeof t!=`function`)return t},[t,n,s,r,i])}function Mv(e){switch(typeof e){case`object`:return e!=null;case`function`:case`symbol`:return!0;default:return!1}}var Nv=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Pv=o(((e,t)=>{t.exports=Nv()})),Fv=Pv(),Iv=(0,v.createContext)(!1),Lv=(0,v.createContext)(null);function Rv(e){if((0,v.useContext)(Lv))return e.content;let{collection:t,document:n}=Hv(e.createCollection);return v.createElement(v.Fragment,null,v.createElement(Vf,null,v.createElement(Lv.Provider,{value:n},e.content)),v.createElement(zv,{render:e.children,collection:t}))}function zv({collection:e,render:t}){return t(e)}function Bv(e,t,n){let r=Jo(),i=(0,v.useRef)(r);i.current=r;let a=(0,v.useCallback)(()=>i.current?n():t(),[t,n]);return(0,Fv.useSyncExternalStore)(e,a)}var Vv=typeof v.useSyncExternalStore==`function`?v.useSyncExternalStore:Bv;function Hv(e){let[t]=(0,v.useState)(()=>new Av(e?.()||new Ev));return{collection:Vv((0,v.useCallback)(e=>t.subscribe(e),[t]),(0,v.useCallback)(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),(0,v.useCallback)(()=>(t.isSSR=!0,t.getCollection()),[t])),document:t}}var Uv=(0,v.createContext)(null);function Wv(e){return class extends xv{static{this.type=e}}}function Gv(e,t,n,r,i,a){typeof e==`string`&&(e=Wv(e));let o=(0,v.useCallback)(i=>{i?.setProps(t,n,e,r,a)},[t,n,r,a,e]),s=(0,v.useContext)(Uv);if(s){let o=s.ownerDocument.nodesByProps.get(t);return o||(o=s.ownerDocument.createElement(e.type),o.setProps(t,n,e,r,a),s.appendChild(o),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(t,o)),i?v.createElement(Uv.Provider,{value:o},i):null}return v.createElement(e.type,{ref:o},i)}function Kv(e,t){let n=({node:e})=>t(e.props,e.props.ref,e),r=(0,v.forwardRef)((r,i)=>{let a=(0,v.useContext)(Cm);if(!(0,v.useContext)(Iv)){if(t.length>=3)throw Error(t.name+` cannot be rendered outside a collection.`);return t(r,i)}return Gv(e,r,i,`children`in r?r.children:null,null,e=>v.createElement(Cm.Provider,{value:a},v.createElement(n,{node:e})))});return r.displayName=t.name,r}function qv(e,t,n=Jv){let r=({node:e})=>t(e.props,e.props.ref,e),i=(0,v.forwardRef)((t,i)=>Gv(e,t,i,null,n(t),e=>v.createElement(r,{node:e}))??v.createElement(v.Fragment,null));return i.displayName=t.name,i}function Jv(e){return jv({...e,addIdAndValue:!0})}var Yv=(0,v.createContext)(null);function Xv(e){let t=(0,v.useContext)(Yv),n=(t?.dependencies||[]).concat(e.dependencies),r=e.idScope??t?.idScope,i=Jv({...e,idScope:r,dependencies:n});return(0,v.useContext)(Lv)&&(i=v.createElement(Zv,null,i)),t=(0,v.useMemo)(()=>({dependencies:n,idScope:r}),[r,...n]),v.createElement(Yv.Provider,{value:t},i)}function Zv({children:e}){let t=(0,v.useContext)(Lv),n=(0,v.useMemo)(()=>v.createElement(Lv.Provider,{value:null},v.createElement(Iv.Provider,{value:!0},e)),[e]);return Jo()?v.createElement(Uv.Provider,{value:t},n):(0,dc.createPortal)(n,t)}var Qv=(0,v.createContext)(null),$v={CollectionRoot({collection:e,renderDropIndicator:t}){return ey(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return ey(e,t,n)}};function ey(e,t,n){return jv({items:t?e.getChildren(t.key):e,dependencies:[n],children(t){if(t.type===`content`)return v.createElement(v.Fragment,null);let r=t.render(t);return!n||t.type!==`item`?r:v.createElement(v.Fragment,null,n({type:`item`,key:t.key,dropPosition:`before`}),r,ty(e,t,n))}})}function ty(e,t,n){let r=t.key,i=e.getKeyAfter(r),a=i==null?null:e.getItem(i);for(;a!=null&&a.type!==`item`;)i=e.getKeyAfter(a.key),a=i==null?null:e.getItem(i);let o=t.nextKey==null?null:e.getItem(t.nextKey);for(;o!=null&&o.type!==`item`;)o=o.nextKey==null?null:e.getItem(o.nextKey);let s=[];if(o==null){let r=t;for(;r?.type===`item`&&(!a||r.parentKey!==a.parentKey&&a.levele==null?null:new Set([e]),[e])}function iy(e){let t=sy(is(e));t!==e&&(t&&ay(t,e),e&&oy(e,t))}function ay(e,t){e.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:t})),e.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:t}))}function oy(e,t){e.dispatchEvent(new FocusEvent(`focus`,{relatedTarget:t})),e.dispatchEvent(new FocusEvent(`focusin`,{bubbles:!0,relatedTarget:t}))}function sy(e){let t=ms(e),n=t?.getAttribute(`aria-activedescendant`);return n&&e.getElementById(n)||t}var cy={};cy={collectionLabel:`مقترحات`};var ly={};ly={collectionLabel:`Предложения`};var uy={};uy={collectionLabel:`Návrhy`};var dy={};dy={collectionLabel:`Forslag`};var fy={};fy={collectionLabel:`Empfehlungen`};var py={};py={collectionLabel:`Προτάσεις`};var my={};my={collectionLabel:`Suggestions`};var hy={};hy={collectionLabel:`Sugerencias`};var gy={};gy={collectionLabel:`Soovitused`};var _y={};_y={collectionLabel:`Ehdotukset`};var vy={};vy={collectionLabel:`Suggestions`};var yy={};yy={collectionLabel:`הצעות`};var by={};by={collectionLabel:`Prijedlozi`};var xy={};xy={collectionLabel:`Javaslatok`};var Sy={};Sy={collectionLabel:`Suggerimenti`};var Cy={};Cy={collectionLabel:`候補`};var wy={};wy={collectionLabel:`제안`};var Ty={};Ty={collectionLabel:`Pasiūlymai`};var Ey={};Ey={collectionLabel:`Ieteikumi`};var Dy={};Dy={collectionLabel:`Forslag`};var Oy={};Oy={collectionLabel:`Suggesties`};var ky={};ky={collectionLabel:`Sugestie`};var Ay={};Ay={collectionLabel:`Sugestões`};var jy={};jy={collectionLabel:`Sugestões`};var My={};My={collectionLabel:`Sugestii`};var Ny={};Ny={collectionLabel:`Предложения`};var Py={};Py={collectionLabel:`Návrhy`};var Fy={};Fy={collectionLabel:`Predlogi`};var Iy={};Iy={collectionLabel:`Predlozi`};var Ly={};Ly={collectionLabel:`Förslag`};var Ry={};Ry={collectionLabel:`Öneriler`};var zy={};zy={collectionLabel:`Пропозиції`};var By={};By={collectionLabel:`建议`};var Vy={};Vy={collectionLabel:`建議`};var Hy={};Hy={"ar-AE":cy,"bg-BG":ly,"cs-CZ":uy,"da-DK":dy,"de-DE":fy,"el-GR":py,"en-US":my,"es-ES":hy,"et-EE":gy,"fi-FI":_y,"fr-FR":vy,"he-IL":yy,"hr-HR":by,"hu-HU":xy,"it-IT":Sy,"ja-JP":Cy,"ko-KR":wy,"lt-LT":Ty,"lv-LV":Ey,"nb-NO":Dy,"nl-NL":Oy,"pl-PL":ky,"pt-BR":Ay,"pt-PT":jy,"ro-RO":My,"ru-RU":Ny,"sk-SK":Py,"sl-SI":Fy,"sr-SP":Iy,"sv-SE":Ly,"tr-TR":Ry,"uk-UA":zy,"zh-CN":By,"zh-TW":Vy};function Uy(e){return e&&e.__esModule?e.default:e}function Wy(e,t){let{inputRef:n,collectionRef:r,filter:i,disableAutoFocusFirst:a=!1,disableVirtualFocus:o=!1}=e,s=es(),c=(0,v.useRef)(void 0),l=(0,v.useRef)(!1),u=(0,v.useRef)(null),d=em()===`virtual`&&(go()||bo()),[f,p]=(0,v.useState)(!d&&!o),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(!1);(0,v.useEffect)(()=>()=>clearTimeout(c.current),[]);let y=Rs(e=>{!e.isTrusted&&f&&n.current&&ms(is(n.current))!==n.current&&nm()!==`touch`&&n.current.focus();let i=H(e);e.isTrusted||!i||u.current===i.id||(clearTimeout(c.current),i===r.current?u.current&&!document.getElementById(u.current)&&(u.current=null,t.setFocusedNodeId(null)):l.current?(u.current=i.id,c.current=setTimeout(()=>{t.setFocusedNodeId(i.id)},500)):(u.current=i.id,t.setFocusedNodeId(i.id)),l.current=!1)}),[b,x]=(0,v.useState)(null),S=(0,v.useCallback)(e=>{x(e),e==null?h(!1):(e.getAttribute(`tabindex`)!=null&&p(!1),h(!0))},[]);Io(()=>(b?.addEventListener(`focusin`,y),()=>{b?.removeEventListener(`focusin`,y)}),[b]);let C=Is((0,v.useMemo)(()=>ys(r,S),[r,S])),w=(0,v.useCallback)(()=>{if(!r.current){_(!0);return}l.current=!0,r.current?.dispatchEvent(new CustomEvent(co,{cancelable:!0,bubbles:!0,detail:{focusStrategy:`first`}}))},[r]),T=(0,v.useCallback)(e=>{_(!1),iy(ms()),u.current=null,t.setFocusedNodeId(null);let n=new CustomEvent(so,{cancelable:!0,bubbles:!0,detail:{clearFocusKey:e}});clearTimeout(c.current),l.current=!1,r.current?.dispatchEvent(n)},[r,t]),E=(0,v.useRef)(``);nc(n,`beforeinput`,e=>{let{inputType:t}=e;E.current=t});let D=e=>{(E.current===`insertText`||E.current===`insertCompositionText`||E.current===`insertFromComposition`)&&!a?w():E.current&&(E.current.includes(`insert`)||E.current.includes(`delete`)||E.current.includes(`history`))&&(T(!0),sy(document)===n.current&&oy(n.current,null)),t.setInputValue(e)},O=(0,v.useRef)(null),k=e=>{if(O.current=H(e),e.nativeEvent.isComposing)return;let t=u.current;switch(t!==null&&is(n.current).getElementById(t)==null&&(u.current=null,t=null),e.key){case`a`:if(qs(e))return;break;case`Escape`:if(e.isDefaultPrevented())return;break;case` `:return;case`Tab`:`continuePropagation`in e&&e.continuePropagation();return;case`Home`:case`End`:case`PageDown`:case`PageUp`:case`ArrowUp`:case`ArrowDown`:case`ArrowRight`:case`ArrowLeft`:{if((e.key===`Home`||e.key===`End`)&&t==null&&e.shiftKey)return;if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(t==null){e.isPropagationStopped()||e.stopPropagation();return}break}e.preventDefault();let n=new CustomEvent(co,{cancelable:!0,bubbles:!0});r.current?.dispatchEvent(n);break}}e.isPropagationStopped()||e.stopPropagation();let i=!0;if(r.current!==null){if(t==null)i=r.current?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent))||!1;else{let n=document.getElementById(t);n&&(i=n?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent))||!1)}}if(i)switch(e.key){case`ArrowLeft`:case`ArrowRight`:T();break;case`Enter`:t!=null&&document.getElementById(t)?.dispatchEvent(new PointerEvent(`click`,e.nativeEvent));break}else e.preventDefault()},A=Rs(e=>{if(H(e)===O.current){e.stopImmediatePropagation();let t=u.current;t==null?r.current?.dispatchEvent(new KeyboardEvent(e.type,e)):document.getElementById(t)?.dispatchEvent(new KeyboardEvent(e.type,e))}});(0,v.useEffect)(()=>(document.addEventListener(`keyup`,A,!0),()=>{document.removeEventListener(`keyup`,A,!0)}),[]);let j=Fs({id:s,"aria-label":rv(Uy(Hy),`@react-aria/autocomplete`).format(`collectionLabel`)}),M=(0,v.useCallback)((e,n)=>!i||i(e,t.inputValue,n),[t.inputValue,i]),N=e=>{if(!e.isTrusted)return;let t=u.current?document.getElementById(u.current):null;t&&ay(t,e.relatedTarget)},P=e=>{if(e.isTrusted&&u.current&&document.getElementById(u.current)){let t=H(e);queueMicrotask(()=>{ay(t,r.current),oy(r.current,t)})}},ee=e=>{e.button===0&&e.pointerType!==`touch`&&u.current!=null&&n.current!=null&&H(e)===n.current&&T()},F={value:t.inputValue,onChange:D},I={onKeyDown:k,"aria-activedescendant":t.focusedNodeId??void 0,onBlur:N,onFocus:P,onPointerDown:ee};return F={...F,...f&&m&&I,enterKeyHint:`go`,"aria-controls":m?s:void 0,"aria-autocomplete":`list`,autoCorrect:`off`,spellCheck:`false`,autoComplete:`off`},{inputProps:F,collectionProps:U(j,{shouldUseVirtualFocus:f,disallowTypeAhead:f,autoFocus:g?`first`:!1}),collectionRef:C,filter:i==null?void 0:M}}function Gy(e){let{onInputChange:t,inputValue:n,defaultInputValue:r=``}=e,i=e=>{t&&t(e)},[a,o]=(0,v.useState)(null),[s,c]=sh(n,r,i);return{inputValue:s,setInputValue:c,focusedNodeId:a,setFocusedNodeId:o}}var Ky=(0,v.createContext)(null),qy=(0,v.createContext)(null),Jy=(0,v.createContext)(null),Yy=(0,v.createContext)(null);function Xy(e){e=U(Pf(Ky,e.slot),e);let{filter:t,disableAutoFocusFirst:n}=e,r=Gy(e),i=(0,v.useRef)(null),a=(0,v.useRef)(null),{inputProps:o,collectionProps:s,collectionRef:c,filter:l}=Wy({...Lf(e),filter:t,disableAutoFocusFirst:n,inputRef:i,collectionRef:a},r);return v.createElement(jf,{values:[[qy,r],[Yy,{...o,ref:i}],[Jy,{...s,filter:l,ref:c}]]},e.children)}var Zy=(0,v.createContext)({}),Qy=(0,v.createContext)({}),$y=(0,v.createContext)(null);function eb(e){let t=(0,v.useRef)({});return v.createElement($y.Provider,{value:t},e.children)}var tb=(0,v.forwardRef)(function(e,t){let{name:n,isVisible:r=!0,children:i,className:a,style:o,render:s,...c}=e,[l,u]=(0,v.useState)(r?`visible`:`hidden`),d=(0,v.useContext)($y);if(!d)throw Error(` must be rendered inside a `);r&&l===`hidden`&&u(`visible`),t=Is(t),Io(()=>{let e=t.current,i=d.current,a=i[n],o=null;if(e&&r&&a){u(`visible`);let t=e.getAnimations(),r=a.style.map(([t,n])=>{let r=e.style[t];if(t===`translate`){let t=a.rect,n=e.getBoundingClientRect(),r=t.left-n?.left,i=t.top-n?.top;e.style.translate=`${r}px ${i}px`}else e.style[t]=n;return[t,r]});for(let n of e.getAnimations())t.includes(n)||n.cancel();o=requestAnimationFrame(()=>{o=null;for(let[t,n]of r)e.style[t]=n}),delete i[n]}else e&&r&&!a?(queueMicrotask(()=>(0,dc.flushSync)(()=>u(`entering`))),o=requestAnimationFrame(()=>{o=null,u(`visible`)})):e&&!r&&queueMicrotask(()=>{i[n]?(delete i[n],(0,dc.flushSync)(()=>u(`exiting`)),Promise.all(e.getAnimations().map(e=>e.finished)).then(()=>u(`hidden`)).catch(()=>{})):u(`hidden`)});return()=>{if(o!=null&&cancelAnimationFrame(o),e&&e.isConnected&&!e.hasAttribute(`data-exiting`)){let t=window.getComputedStyle(e);if(t.transitionProperty!==`none`){let r=t.transitionProperty.split(/\s*,\s*/);i[n]={rect:e.getBoundingClientRect(),style:r.map(e=>[e,t[e]])}}}}},[t,d,n,r]);let f=Mf({children:i,className:a,style:o,render:s,values:{isEntering:l===`entering`,isExiting:l===`exiting`}});return l===`hidden`?null:v.createElement(q.div,{...c,...f,ref:t,"data-entering":l===`entering`||void 0,"data-exiting":l===`exiting`||void 0})}),nb=(0,v.createContext)({isSelected:!1}),rb=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,nb);let{isSelected:n,...r}=e;return v.createElement(tb,{...r,ref:t,className:e.className||`react-aria-SelectionIndicator`,name:`SelectionIndicator`,isVisible:n})});function ib(e){let t=W(e,{labelable:!0}),n;return e.orientation===`vertical`&&(n=`vertical`),e.elementType===`hr`?{separatorProps:t}:{separatorProps:{...t,role:`separator`,"aria-orientation":n}}}var ab=(0,v.createContext)({}),ob=Kv(class extends xv{static{this.type=`separator`}filter(e,t){let n=t.getItem(this.prevKey);if(n&&n.type!==`separator`){let n=this.clone();return t.addDescendants(n,e),n}return null}},function(e,t){[e,t]=Ff(e,t,ab);let{elementType:n,orientation:r,style:i,className:a,slot:o,...s}=e,c=n||`hr`;c===`hr`&&r===`vertical`&&(c=`div`);let l=q[c],{separatorProps:u}=ib({...s,elementType:n,orientation:r}),d=W(e,{global:!0});return v.createElement(l,{render:e.render,...U(d,u),style:i,className:a??`react-aria-Separator`,ref:t,slot:o||void 0})}),sb=(0,v.createContext)({}),cb=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,sb);let{elementType:n=`span`,...r}=e,i=q[n];return v.createElement(i,{className:`react-aria-Text`,...r,ref:t})}),lb={};lb={longPressMessage:`اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة`};var ub={};ub={longPressMessage:`Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто`};var db={};db={longPressMessage:`Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku`};var fb={};fb={longPressMessage:`Langt tryk eller tryk på Alt + pil ned for at åbne menuen`};var pb={};pb={longPressMessage:`Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen`};var mb={};mb={longPressMessage:`Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού`};var hb={};hb={longPressMessage:`Long press or press Alt + ArrowDown to open menu`};var gb={};gb={longPressMessage:`Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú`};var _b={};_b={longPressMessage:`Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool`};var vb={};vb={longPressMessage:`Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli`};var yb={};yb={longPressMessage:`Appuyez de manière prolongée ou appuyez sur Alt\xA0+\xA0Flèche vers le bas pour ouvrir le menu.`};var bb={};bb={longPressMessage:`לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט`};var xb={};xb={longPressMessage:`Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika`};var Sb={};Sb={longPressMessage:`Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához`};var Cb={};Cb={longPressMessage:`Premi a lungo o premi Alt + Freccia giù per aprire il menu`};var wb={};wb={longPressMessage:`長押しまたは Alt+下矢印キーでメニューを開く`};var Tb={};Tb={longPressMessage:`길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기`};var Eb={};Eb={longPressMessage:`Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“.`};var Db={};Db={longPressMessage:`Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa`};var Ob={};Ob={longPressMessage:`Langt trykk eller trykk Alt + PilNed for å åpne menyen`};var kb={};kb={longPressMessage:`Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen`};var Ab={};Ab={longPressMessage:`Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu`};var jb={};jb={longPressMessage:`Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu`};var Mb={};Mb={longPressMessage:`Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu`};var Nb={};Nb={longPressMessage:`Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul`};var Pb={};Pb={longPressMessage:`Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню`};var Fb={};Fb={longPressMessage:`Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol`};var Ib={};Ib={longPressMessage:`Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol`};var Lb={};Lb={longPressMessage:`Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni`};var Rb={};Rb={longPressMessage:`Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn`};var zb={};zb={longPressMessage:`Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın`};var Bb={};Bb={longPressMessage:`Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню`};var Vb={};Vb={longPressMessage:`长按或按 Alt + 向下方向键以打开菜单`};var Hb={};Hb={longPressMessage:`長按或按 Alt+向下鍵以開啟功能表`};var Ub={};Ub={"ar-AE":lb,"bg-BG":ub,"cs-CZ":db,"da-DK":fb,"de-DE":pb,"el-GR":mb,"en-US":hb,"es-ES":gb,"et-EE":_b,"fi-FI":vb,"fr-FR":yb,"he-IL":bb,"hr-HR":xb,"hu-HU":Sb,"it-IT":Cb,"ja-JP":wb,"ko-KR":Tb,"lt-LT":Eb,"lv-LV":Db,"nb-NO":Ob,"nl-NL":kb,"pl-PL":Ab,"pt-BR":jb,"pt-PT":Mb,"ro-RO":Nb,"ru-RU":Pb,"sk-SK":Fb,"sl-SI":Ib,"sr-SP":Lb,"sv-SE":Rb,"tr-TR":zb,"uk-UA":Bb,"zh-CN":Vb,"zh-TW":Hb};var Wb=500;function Gb(e){let{isDisabled:t,pointerType:n,onLongPressStart:r,onLongPressEnd:i,onLongPress:a,threshold:o=Wb,accessibilityDescription:s}=e,c=(0,v.useRef)(void 0),{addGlobalListener:l,removeAllGlobalListeners:u}=Ps(),d=e=>n?e.pointerType===n:e.pointerType===`mouse`||e.pointerType===`touch`,{pressProps:f}=Rm({isDisabled:t,onPressStart(e){if(e.continuePropagation(),d(e)){r&&r({...e,type:`longpressstart`}),c.current=setTimeout(()=>{e.target.dispatchEvent(new PointerEvent(`pointercancel`,{bubbles:!0})),l(e.target,`click`,e=>e.preventDefault(),{once:!0}),is(e.target).activeElement!==e.target&&So(e.target),a&&a({...e,type:`longpress`}),c.current=void 0},o),e.pointerType===`touch`&&l(e.target,`contextmenu`,e=>e.preventDefault(),{once:!0});let t=as(e.target);l(t,`pointerup`,()=>{setTimeout(()=>{u()},100)},{once:!0})}},onPressEnd(e){c.current&&clearTimeout(c.current),i&&d(e)&&i({...e,type:`longpressend`})}});return{longPressProps:U(f,tc(a&&!t?s:void 0))}}function Kb(e){let{onContextMenu:t}=e,n=(0,v.useRef)(!1),{longPressProps:r}=Gb({onLongPressStart(){n.current=!1},onLongPress(e){n.current?n.current=!1:t?.({target:e.target,x:e.x,y:e.y})}});return t?{contextMenuProps:U(go()?r:{},{onContextMenu(e){e.stopPropagation(),e.preventDefault(),n.current=!0;let r=e.currentTarget.getBoundingClientRect();t({target:e.currentTarget,x:e.clientX-r.x,y:e.clientY-r.y})},onKeyDown(e){if(po()&&e.ctrlKey&&e.key===`Enter`){n.current=!1;let r=e.currentTarget;e.stopPropagation(),setTimeout(()=>{if(n.current)n.current=!1;else{let e=r.getBoundingClientRect();t({target:r,x:e.width/2,y:e.height/2})}},10)}}})}:{contextMenuProps:{}}}function qb(e,t,n){let{type:r}=e,{isOpen:i}=t;(0,v.useEffect)(()=>{n&&n.current&&pg.set(n.current,t.close)});let a;r===`menu`?a=!0:r===`listbox`&&(a=`listbox`);let o=es();return{triggerProps:{"aria-haspopup":a,"aria-expanded":i,"aria-controls":i?o:void 0,onPress:t.toggle},overlayProps:{id:o}}}function Jb(e){return e&&e.__esModule?e.default:e}function Yb(e,t,n){let{type:r=`menu`,isDisabled:i,trigger:a=`press`}=e,o=es(),{triggerProps:s,overlayProps:c}=qb({type:r},t,n),l=(e,n,r=`first`)=>{if(!e||n.isDefaultPrevented())return!1;t.toggle(r)},{keyboardProps:u}=Sm({isDisabled:i,shortcuts:{Enter:e=>l(a!==`longPress`,e,`first`)," ":e=>l(a!==`longPress`,e,`first`),ArrowDown:e=>l(a!==`longPress`,e,`first`),ArrowUp:e=>l(a!==`longPress`,e,`last`),"Alt+Enter":e=>l(a===`longPress`,e,`first`),"Alt+ ":e=>l(a===`longPress`,e,`first`),"Alt+ArrowDown":e=>l(!0,e,`first`),"Alt+ArrowUp":e=>l(!0,e,`last`)}}),d=rv(Jb(Ub),`@react-aria/menu`),{longPressProps:f}=Gb({isDisabled:i||a!==`longPress`,accessibilityDescription:d.format(`longPressMessage`),onLongPressStart(){t.close()},onLongPress(){t.open(`first`)}}),p={preventFocusOnPress:!0,onPressStart(e){e.pointerType!==`touch`&&e.pointerType!==`keyboard`&&!i&&(So(e.target),t.open(e.pointerType===`virtual`?`first`:null))},onPress(e){e.pointerType===`touch`&&!i&&(So(e.target),t.toggle())}};delete s.onPress;let{contextMenuProps:m}=Kb({onContextMenu(e){let n=e.target.getBoundingClientRect();t.setPoint({x:n.x+e.x,y:n.y+e.y}),t.open()}});(0,v.useEffect)(()=>{if(t.isOpen&&a===`contextMenu`){let e=e=>{(e.button===2||e.button===0&&e.ctrlKey===!0)&&H(e)===document.body&&t.close()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)}},[t,a]);let h;if(a===`press`)h={...p,...u};else if(a===`longPress`)h={...f,...u};else if(a===`contextMenu`){h=m;let{"aria-haspopup":e,"aria-expanded":t,"aria-controls":n,...r}=s;s=r}return{menuTriggerProps:{...s,...h,id:o},menuProps:{...c,"aria-labelledby":o,autoFocus:t.focusStrategy||!0,onClose:t.close}}}var Xb=new WeakMap;function Zb(e){return _o()?e.altKey:e.ctrlKey}function Qb(e,t){let n=`[data-key="${CSS.escape(String(t))}"]`,r=e.current?.dataset.collection;return r&&(n=`[data-collection="${CSS.escape(r)}"]${n}`),e.current?.querySelector(n)}var $b=new WeakMap;function ex(e){let t=es();return $b.set(e,t),t}function tx(e){return $b.get(e)}var nx=1e3;function rx(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:r}=e,i=(0,v.useRef)({search:``,timeout:void 0});return(0,v.useEffect)(()=>{let e=i.current.timeout;return()=>{clearTimeout(e)}},[i]),{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?e=>{if(i.current.search.length>0&&e.key===` `){if(e.preventDefault(),(!(`continuePropagation`in e)||`continuePropagation`in e&&!e.isPropagationStopped())&&e.stopPropagation(),i.current.search+=` `,t.getKeyForSearch!=null){let e=t.getKeyForSearch(i.current.search,n.focusedKey);e??=t.getKeyForSearch(i.current.search),e!=null&&(n.setFocusedKey(e),r&&r(e))}clearTimeout(i.current.timeout),i.current.timeout=setTimeout(()=>{i.current.search=``},nx)}}:void 0,onKeyDown:t.getKeyForSearch?e=>{let a=ix(e.key);if(!(!a||e.ctrlKey||e.metaKey||e.altKey||!ps(e.currentTarget,H(e))||i.current.search.length===0&&a===` `)){if(i.current.search+=a,t.getKeyForSearch!=null){let a=t.getKeyForSearch(i.current.search,n.focusedKey);if(a??=t.getKeyForSearch(i.current.search),a!=null)n.setFocusedKey(a),r&&r(a),e.preventDefault(),`continuePropagation`in e||e.stopPropagation();else{i.current.search=``,clearTimeout(i.current.timeout),i.current.timeout=void 0;return}}clearTimeout(i.current.timeout),i.current.timeout=setTimeout(()=>{i.current.search=``},nx)}}:void 0}}}function ix(e){return e.length===1||!/^[A-Z]/i.test(e)?e:``}function ax(e){let{selectionManager:t,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:a=!1,disallowEmptySelection:o=!1,disallowSelectAll:s=!1,escapeKeyBehavior:c=`clearSelection`,selectOnFocus:l=t.selectionBehavior===`replace`,disallowTypeAhead:u=!1,shouldUseVirtualFocus:d,allowsTabNavigation:f=!1,scrollRef:p=r,linkBehavior:m=`action`,UNSTABLE_focusOnEntry:h}=e,{direction:g}=rp(),_=Oo(),y=(e,n,i)=>{if(n!=null){if(t.isLink(n)&&m===`selection`&&l&&!Zb(e)){(0,dc.flushSync)(()=>{t.setFocusedKey(n,i)});let a=Qb(r,n),o=t.getItemProps(n);if(a){_.open(a,e,o.href,o.routerOptions);return}return!1}if(t.setFocusedKey(n,i),t.isLink(n)&&m===`override`)return!1;if(e.shiftKey&&t.selectionMode===`multiple`){t.extendSelection(n);return}if(l&&!Zb(e)){t.replaceSelection(n);return}}return!1},b=e=>{if(n.getKeyBelow){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyBelow?.(t.focusedKey);if(r==null&&a&&(r=n.getFirstKey?.(t.focusedKey)),r!=null){y(e,r);return}}return!1},x=e=>{if(n.getKeyAbove){let r=t.focusedKey==null?n.getLastKey?.():n.getKeyAbove?.(t.focusedKey);if(r==null&&a&&(r=n.getLastKey?.(t.focusedKey)),r!=null){y(e,r);return}}return!1},S=e=>{if(n.getFirstKey){if(t.focusedKey===null&&e.shiftKey)return!1;let r=n.getFirstKey(t.focusedKey,qs(e));if(t.setFocusedKey(r),r!=null){if(qs(e)&&e.shiftKey&&t.selectionMode===`multiple`){t.extendSelection(r);return}if(l){t.replaceSelection(r);return}}}return!1},C=e=>{if(n.getKeyLeftOf){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyLeftOf?.(t.focusedKey);if(r==null&&a&&(r=g===`rtl`?n.getFirstKey?.(t.focusedKey):n.getLastKey?.(t.focusedKey)),r!=null){y(e,r,g===`rtl`?`first`:`last`);return}}return!1},w=e=>{if(n.getKeyRightOf){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyRightOf?.(t.focusedKey);if(r==null&&a&&(r=g===`rtl`?n.getLastKey?.(t.focusedKey):n.getFirstKey?.(t.focusedKey)),r!=null){y(e,r,g===`rtl`?`last`:`first`);return}}return!1},T=e=>{if(n.getLastKey){if(t.focusedKey===null&&e.shiftKey)return!1;let r=n.getLastKey(t.focusedKey,qs(e));if(t.setFocusedKey(r),r!=null){if(qs(e)&&e.shiftKey&&t.selectionMode===`multiple`){t.extendSelection(r);return}if(l){t.replaceSelection(r);return}}}return!1},E=e=>{if(n.getKeyPageBelow&&t.focusedKey!=null){let r=n.getKeyPageBelow(t.focusedKey);if(r!=null)return y(e,r)}return!1},D=e=>{if(n.getKeyPageAbove&&t.focusedKey!=null){let r=n.getKeyPageAbove(t.focusedKey);if(r!=null)return y(e,r)}return!1},O=()=>{if(t.selectionMode===`multiple`&&s!==!0){t.selectAll();return}return!1},k=()=>{if(c===`clearSelection`&&!o&&t.selectedKeys.size!==0){t.clearSelection();return}return!1},A=()=>{if(!f&&r.current){let e=Hg(r.current,{tabbable:!0}),t,n;do n=e.lastChild(),n&&(t=n);while(n);let i=ms();t&&(!gs(t)||i&&!Cc(i))&&So(t)}return{shouldContinuePropagation:!0,shouldPreventDefault:!1}},j=()=>(!f&&r.current&&r.current.focus(),{shouldContinuePropagation:!0,shouldPreventDefault:!1}),M=(e,t)=>({[po()?e+`+Shift+Alt`:e+`+Shift+Control`]:t,[e+`+Shift`]:t,[po()?e+`+Alt`:e+`+Control`]:t,[e]:t}),{keyboardProps:N}=Sm({shortcuts:{...M(`ArrowDown`,b),...M(`ArrowUp`,x),...M(`ArrowLeft`,C),...M(`ArrowRight`,w),...M(`PageDown`,E),...M(`PageUp`,D)},allowRepeats:!0}),{keyboardProps:P}=Sm({shortcuts:{...M(`Home`,S),...M(`End`,T),"Mod+A":O,Escape:k,Tab:A,"Tab+Shift":j}}),ee=(0,v.useRef)({top:0,left:0});nc(p,`scroll`,()=>{ee.current={top:p.current?.scrollTop??0,left:p.current?.scrollLeft??0}});let F=e=>{if(t.isFocused){ps(e.currentTarget,H(e))||t.setFocused(!1);return}if(!ps(e.currentTarget,H(e)))return;let i=em();t.setFocused(!0);let a=e=>{e!=null&&(t.setFocusedKey(e),l&&!t.isSelected(e)&&t.replaceSelection(e))};if(h&&(i===`keyboard`||i===`virtual`))a(h===`first`?n.getFirstKey?.():n.getLastKey?.());else if(t.focusedKey==null){let r=e.relatedTarget;r&&e.currentTarget.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING?a(t.lastSelectedKey??n.getLastKey?.()):a(t.firstSelectedKey??n.getFirstKey?.())}else p.current&&(p.current.scrollTop=ee.current.top,p.current.scrollLeft=ee.current.left);if(t.focusedKey!=null&&p.current){let e=Qb(r,t.focusedKey);e instanceof HTMLElement&&(!gs(e)&&!d&&So(e),(i===`keyboard`||h&&i===`virtual`)&&ic(e,{containingElement:r.current}))}},I=e=>{ps(e.currentTarget,e.relatedTarget)||t.setFocused(!1)},L=(0,v.useRef)(!1);nc(r,co,d?e=>{let{detail:n}=e;e.stopPropagation(),t.setFocused(!0),n?.focusStrategy===`first`&&(L.current=!0)}:void 0);let te=n.getFirstKey?.()??null;Bs(()=>{if(L.current){if(te==null){let e=ms();iy(r.current),oy(e,null),t.collection.size>0&&(L.current=!1)}else t.setFocusedKey(te),L.current=!1}},[te,t.collection.size]),Bs(()=>{t.collection.size>0&&(L.current=!1)},[t.focusedKey]),nc(r,so,d?e=>{e.stopPropagation(),t.setFocused(!1),e.detail?.clearFocusKey&&t.setFocusedKey(null)}:void 0);let R=(0,v.useRef)(i),z=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(R.current){let e=null;i===`first`&&(e=n.getFirstKey?.()??null),i===`last`&&(e=n.getLastKey?.()??null);let a=t.selectedKeys;if(a.size){for(let n of a)if(t.canSelectItem(n)){e=n;break}}t.setFocused(!0),t.setFocusedKey(e),e==null&&!d&&r.current&&sm(r.current),t.collection.size>0&&(R.current=!1,z.current=!0)}});let B=(0,v.useRef)(t.focusedKey),ne=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==B.current||z.current)&&p.current&&r.current){let e=em(),n=Qb(r,t.focusedKey);if(!(n instanceof HTMLElement))return;(e===`keyboard`||z.current)&&(ne.current&&cancelAnimationFrame(ne.current),ne.current=requestAnimationFrame(()=>{p.current&&(rc(p.current,n),e!==`virtual`&&ic(n,{containingElement:r.current}))}))}!d&&t.isFocused&&t.focusedKey==null&&B.current!=null&&r.current&&sm(r.current),B.current=t.focusedKey,z.current=!1}),(0,v.useEffect)(()=>()=>{ne.current&&cancelAnimationFrame(ne.current)},[]),nc(r,`react-aria-focus-scope-restore`,e=>{e.preventDefault(),t.setFocused(!0)});let re={...U(P,N),onFocus:F,onBlur:I,onMouseDown(e){p.current===H(e)&&e.preventDefault()}},{typeSelectProps:ie}=rx({keyboardDelegate:n,selectionManager:t});u||(re=U(ie,re));let V;d||(V=t.focusedKey==null?0:-1);let ae=ex(t.collection);return{collectionProps:U(re,{tabIndex:V,"data-collection":ae})}}var ox=class{constructor(e){this.ref=e}getItemRect(e){let t=this.ref.current;if(!t)return null;let n=e==null?null:Qb(this.ref,e);if(!n)return null;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();return{x:i.left-r.left-t.clientLeft+t.scrollLeft,y:i.top-r.top-t.clientTop+t.scrollTop,width:i.width,height:i.height}}getContentSize(){let e=this.ref.current;return{width:e?.scrollWidth??0,height:e?.scrollHeight??0}}getVisibleRect(){let e=this.ref.current;return{x:e?.scrollLeft??0,y:e?.scrollTop??0,width:e?.clientWidth??0,height:e?.clientHeight??0}}},sx=class{constructor(...e){if(e.length===1){let t=e[0];this.collection=t.collection,this.ref=t.ref,this.collator=t.collator,this.disabledKeys=t.disabledKeys||new Set,this.disabledBehavior=t.disabledBehavior||`all`,this.orientation=t.orientation||`vertical`,this.direction=t.direction,this.layout=t.layout||`stack`,this.layoutDelegate=t.layoutDelegate||new ox(t.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout=`stack`,this.orientation=`vertical`,this.disabledBehavior=`all`,this.layoutDelegate=new ox(this.ref);this.layout===`stack`&&this.orientation===`vertical`&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){return this.disabledBehavior===`all`&&(e.props?.isDisabled||this.disabledKeys.has(e.key))&&e.props?.disabledBehavior!==`selection`}findNextNonDisabled(e,t,n=!1){let r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e?.type===`item`&&(n||!this.isDisabled(e)))return r;r=t(r)}return null}getNextKey(e,t){let n=e;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,e=>this.collection.getKeyAfter(e),t?.includeDisabled)}getPreviousKey(e,t){let n=e;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,e=>this.collection.getKeyBefore(e),t?.includeDisabled)}findKey(e,t,n){let r=e,i=this.layoutDelegate.getItemRect(r);if(!i||r==null)return null;let a=i;do{if(r=t(r),r==null)break;i=this.layoutDelegate.getItemRect(r)}while(i&&n(a,i)&&r!=null);return r}isSameRow(e,t){return e.y===t.y||e.x!==t.x}isSameColumn(e,t){return e.x===t.x||e.y!==t.y}isReversed(e){let t=this.getNextKey(e),n=Qb(this.ref,e);if(t!=null){let e=Qb(this.ref,t);return!n||!e?!1:n.getBoundingClientRect().top>e.getBoundingClientRect().top}let r=this.getPreviousKey(e);if(r!=null){let e=Qb(this.ref,r);return!n||!e?!1:e.getBoundingClientRect().top>n.getBoundingClientRect().top}return!1}getKeyBelow(e,t){return this.layout===`grid`&&this.orientation===`vertical`?this.findKey(e,e=>this.getNextKey(e,t),this.isSameRow):this.orientation===`vertical`&&this.isReversed(e)?this.getPreviousKey(e,t):this.getNextKey(e,t)}getKeyAbove(e,t){return this.layout===`grid`&&this.orientation===`vertical`?this.findKey(e,e=>this.getPreviousKey(e,t),this.isSameRow):this.orientation===`vertical`&&this.isReversed(e)?this.getNextKey(e,t):this.getPreviousKey(e,t)}getNextColumn(e,t,n){return t?this.getPreviousKey(e,n):this.getNextKey(e,n)}getKeyRightOf(e,t){let n=this.direction===`ltr`?`getKeyRightOf`:`getKeyLeftOf`;return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,e=>this.layoutDelegate[n](e),t?.includeDisabled)):this.layout===`grid`?this.orientation===`vertical`?this.getNextColumn(e,this.direction===`rtl`,t):this.findKey(e,e=>this.getNextColumn(e,this.direction===`rtl`,t),this.isSameColumn):this.orientation===`horizontal`?this.getNextColumn(e,this.direction===`rtl`,t):null}getKeyLeftOf(e,t){let n=this.direction===`ltr`?`getKeyLeftOf`:`getKeyRightOf`;return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,e=>this.layoutDelegate[n](e),t?.includeDisabled)):this.layout===`grid`?this.orientation===`vertical`?this.getNextColumn(e,this.direction===`ltr`,t):this.findKey(e,e=>this.getNextColumn(e,this.direction===`ltr`,t),this.isSameColumn):this.orientation===`horizontal`?this.getNextColumn(e,this.direction===`ltr`,t):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,e=>this.collection.getKeyAfter(e))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,e=>this.collection.getKeyBefore(e))}getKeyPageAbove(e){let t=this.ref.current,n=this.layoutDelegate.getItemRect(e);if(!n)return null;let r=this.isReversed(e);if(t&&!Ws(t))return this.getFirstKey();let i=e;if(this.orientation===`horizontal`){let e=Math.max(0,n.x+n.width-this.layoutDelegate.getVisibleRect().width);for(;n&&n.x>e&&i!=null;)i=this.getKeyAbove(i),n=i==null?null:this.layoutDelegate.getItemRect(i)}else{let e=this.layoutDelegate.getVisibleRect(),t=r?n.y-e.height:Math.max(0,n.y+n.height-e.height);for(;n&&n.y>t&&i!=null;)i=this.getKeyAbove(i),n=i==null?null:this.layoutDelegate.getItemRect(i)}return i??(r?this.getLastKey():this.getFirstKey())}getKeyPageBelow(e){let t=this.ref.current,n=this.layoutDelegate.getItemRect(e);if(!n)return null;let r=this.isReversed(e);if(t&&!Ws(t))return this.getLastKey();let i=e;if(this.orientation===`horizontal`){let e=Math.min(this.layoutDelegate.getContentSize().width,n.x-n.width+this.layoutDelegate.getVisibleRect().width);for(;n&&n.xe[0]a||new sx({collection:n,disabledKeys:r,disabledBehavior:l,ref:i,collator:c,layoutDelegate:o,orientation:s}),[a,o,n,r,i,c,l,s]),{collectionProps:d}=ax({...e,ref:i,selectionManager:t,keyboardDelegate:u});return{listProps:d}}function dx(e,t,n){let{shouldFocusWrap:r=!0,onKeyDown:i,onKeyUp:a,...o}=e;!e[`aria-label`]&&e[`aria-labelledby`];let s=W(e,{labelable:!0}),{listProps:c}=ux({...o,ref:n,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,shouldFocusWrap:r,linkBehavior:`override`});return Xb.set(t,{onClose:e.onClose,onAction:e.onAction,shouldUseVirtualFocus:e.shouldUseVirtualFocus}),{menuProps:U(s,{onKeyDown:i,onKeyUp:a},{role:`menu`,...c,onKeyDown:t=>{(t.key!==`Escape`||e.shouldUseVirtualFocus)&&c.onKeyDown?.(t)}})}}function fx(e){let{id:t,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:a,shouldUseVirtualFocus:o,focus:s,isDisabled:c,onAction:l,allowsDifferentPressOrigin:u,linkBehavior:d=`action`}=e,f=Oo();t=es(t);let p=e=>{if(e.pointerType===`keyboard`&&Zb(e))n.toggleSelection(r);else{if(n.selectionMode===`none`)return;if(n.isLink(r)){if(d===`selection`&&i.current){let t=n.getItemProps(r);f.open(i.current,e,t.href,t.routerOptions),n.setSelectedKeys(n.selectedKeys);return}if(d===`override`||d===`none`)return}n.selectionMode===`single`?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):e&&e.shiftKey?n.extendSelection(r):n.selectionBehavior===`toggle`||e&&(qs(e)||e.pointerType===`touch`||e.pointerType===`virtual`)?n.toggleSelection(r):n.replaceSelection(r)}};(0,v.useEffect)(()=>{r===n.focusedKey&&n.isFocused&&(o?iy(i.current):s?s():ms()!==i.current&&i.current&&sm(i.current))},[i,r,n.focusedKey,n.childFocusStrategy,n.isFocused,o]),c||=n.isDisabled(r);let m={};!o&&!c?m={tabIndex:r===n.focusedKey?0:-1,onFocus(e){H(e)===i.current&&n.setFocusedKey(r)}}:c&&(m.onMouseDown=e=>{e.preventDefault()}),(0,v.useEffect)(()=>{c&&n.focusedKey===r&&n.setFocusedKey(null)},[n,c,r]);let h=n.isLink(r)&&d===`override`,g=l&&e.UNSTABLE_itemBehavior===`action`,_=n.isLink(r)&&d!==`selection`&&d!==`none`,y=!c&&n.canSelectItem(r)&&!h&&!g,b=(l||_)&&!c,x=b&&(n.selectionBehavior===`replace`?!y:!y||n.isEmpty),S=b&&y&&n.selectionBehavior===`replace`,C=x||S,w=(0,v.useRef)(null),T=C&&y,E=(0,v.useRef)(!1),D=(0,v.useRef)(!1),O=n.getItemProps(r),k=e=>{l&&(l(),i.current?.dispatchEvent(new CustomEvent(`react-aria-item-action`,{bubbles:!0}))),_&&i.current&&f.open(i.current,e,O.href,O.routerOptions)},A={ref:i};a?(A.onPressStart=e=>{w.current=e.pointerType,E.current=T,e.pointerType===`keyboard`&&(!C||mx(e.key))&&p(e)},u?(A.onPressUp=x?void 0:e=>{e.pointerType===`mouse`&&y&&p(e)},A.onPress=x?k:e=>{e.pointerType!==`keyboard`&&e.pointerType!==`mouse`&&y&&p(e)}):A.onPress=e=>{if(x||S&&e.pointerType!==`mouse`){if(e.pointerType===`keyboard`&&!px(e.key))return;k(e)}else e.pointerType!==`keyboard`&&y&&p(e)}):(A.onPressStart=e=>{w.current=e.pointerType,E.current=T,D.current=x,y&&(e.pointerType===`mouse`&&!x||e.pointerType===`keyboard`&&(!b||mx(e.key)))&&p(e)},A.onPress=e=>{(e.pointerType===`touch`||e.pointerType===`pen`||e.pointerType===`virtual`||e.pointerType===`keyboard`&&C&&px(e.key)||e.pointerType===`mouse`&&D.current)&&(C?k(e):y&&p(e))});let j=tx(n.collection);if(m[`data-collection`]=j,m[`data-key`]=r,A.preventFocusOnPress=o,o&&(A=U(A,{onPressStart(e){e.pointerType!==`touch`&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(e){e.pointerType===`touch`&&(n.setFocused(!0),n.setFocusedKey(r))}})),O)for(let e of[`onPressStart`,`onPressEnd`,`onPressChange`,`onPress`,`onPressUp`,`onClick`])O[e]&&(A[e]=rs(A[e],O[e]));let{pressProps:M,isPressed:N}=Rm(A),P=S?e=>{w.current===`mouse`&&(e.stopPropagation(),e.preventDefault(),k(e))}:void 0,{longPressProps:ee}=Gb({isDisabled:!T,onLongPress(e){e.pointerType===`touch`&&(p(e),n.setSelectionBehavior(`toggle`))}}),F=e=>{w.current===`touch`&&E.current&&e.preventDefault()},I=d!==`none`&&n.isLink(r)?e=>{Ao.isOpening||e.preventDefault()}:void 0,L=U(m,y||x||o&&!c?M:{},T?ee:{},{onDoubleClick:P,onDragStartCapture:F,onClick:I,id:t},o?{onMouseDown:e=>e.preventDefault()}:void 0),te=e=>{let t=e;for(;t&&t!==i.current;){let e=t.getAttribute(`data-collection`);if(e!=null)return e!==j;t=t.parentElement}return Cc(e)},R=L.onPointerDown;L.onPointerDown=e=>{let t=H(e);if(t&&t!==i.current&&te(t)){e.stopPropagation();return}R?.(e)};let z=L.onMouseDown;return L.onMouseDown=e=>{let t=H(e);if(t&&t!==i.current&&te(t)){e.stopPropagation();return}z?.(e)},{itemProps:L,isPressed:N,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:c,allowsSelection:y,hasAction:C}}function px(e){return e===`Enter`}function mx(e){return e===` `}function hx(e,t){return typeof t.getChildren==`function`?t.getChildren(e.key):e.childNodes}function gx(e){return _x(e,0)}function _x(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function vx(e){let t;for(let n of e)t=n;return t}function yx(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...bx(e,t),t],i=[...bx(e,n),n],a=r.slice(0,i.length).findIndex((e,t)=>e!==i[t]);return a===-1?r.findIndex(e=>e===n)>=0?1:(i.findIndex(e=>e===t),-1):(t=r[a],n=i[a],t.index-n.index)}function bx(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}var xx=new WeakMap;function Sx(e){let t=xx.get(e);if(t!=null)return t;let n=0,r=t=>{for(let i of t)i.type===`section`?r(hx(i,e)):i.type===`item`&&n++};return r(e),xx.set(e,n),n}function Cx(e,t,n){let{id:r,key:i,closeOnSelect:a,shouldCloseOnSelect:o,isVirtualized:s,"aria-haspopup":c,onPressStart:l,onPressUp:u,onPress:d,onPressChange:f,onPressEnd:p,onClick:m,onHoverStart:h,onHoverChange:g,onHoverEnd:_,onKeyDown:y,onKeyUp:b,onFocus:x,onFocusChange:S,onBlur:C,selectionManager:w=t.selectionManager}=e,T=!!c,E=T&&e[`aria-expanded`]===`true`,D=e.isDisabled??w.isDisabled(i),O=e.isSelected??w.isSelected(i),k=Xb.get(t),A=t.collection.getItem(i),j=e.onClose||k.onClose,M=Oo(),N=()=>{if(!T&&(A?.props?.onAction?A.props.onAction():e.onAction&&e.onAction(i),k.onAction)){let e=k.onAction;e(i,A?.value)}},P=`menuitem`;T||(w.selectionMode===`single`?P=`menuitemradio`:w.selectionMode===`multiple`&&(P=`menuitemcheckbox`));let ee=ns(),F=ns(),I=ns(),L={id:r,"aria-disabled":D||void 0,role:P,"aria-label":e[`aria-label`],"aria-labelledby":ee,"aria-describedby":[e[`aria-describedby`],F,I].filter(Boolean).join(` `)||void 0,"aria-controls":e[`aria-controls`],"aria-haspopup":c,"aria-expanded":e[`aria-expanded`]};if(w.selectionMode!==`none`&&!T&&(L[`aria-checked`]=O),s){let e=Number(A?.index);L[`aria-posinset`]=Number.isNaN(e)?void 0:e+1,L[`aria-setsize`]=Sx(t.collection)}let te=(0,v.useRef)(!1),R=e=>{f?.(e),te.current=e},z=(0,v.useRef)(null),B=e=>{e.pointerType!==`keyboard`&&(z.current={pointerType:e.pointerType}),e.pointerType===`mouse`&&(te.current||e.target.click()),u?.(e)},ne=e=>{m?.(e),N(),Fo(e,M,A.props.href,A?.props.routerOptions);let t=z.current?.pointerType===`keyboard`?z.current?.key===`Enter`||w.selectionMode===`none`||w.isLink(i):w.selectionMode!==`multiple`||w.isLink(i);t=o??a??t,j&&!T&&t&&j(),z.current=null},{itemProps:re,isFocused:ie}=fx({id:r,selectionManager:w,key:i,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:`none`,shouldUseVirtualFocus:k.shouldUseVirtualFocus}),{pressProps:V,isPressed:ae}=Rm({onPressStart:l,onPress:d,onPressUp:B,onPressChange:R,onPressEnd:p,isDisabled:D}),{hoverProps:oe}=eh({isDisabled:D,onHoverStart(e){!$p()&&!(E&&c)&&(w.setFocused(!0),w.setFocusedKey(i)),h?.(e)},onHoverChange:g,onHoverEnd:_}),{keyboardProps:se}=Sm({shortcuts:{" ":e=>{z.current={pointerType:`keyboard`,key:` `},H(e).click(),tm(`keyboard`)},Enter:e=>{z.current={pointerType:`keyboard`,key:`Enter`};let t=H(e);if(t.tagName!==`A`){t.click(),tm(`keyboard`);return}return tm(`keyboard`),{shouldPreventDefault:!1,shouldContinuePropagation:!1}}},onKeyDown:y,onKeyUp:b}),{focusableProps:ce}=Em({onBlur:C,onFocus:x,onFocusChange:S},n),le=W(A?.props);delete le.id;let ue=Po(A?.props);return{menuItemProps:{...L,...U(le,ue,T?{onFocus:re.onFocus,"data-collection":re[`data-collection`],"data-key":re[`data-key`]}:re,V,oe,se,ce,k.shouldUseVirtualFocus||T?{onMouseDown:e=>e.preventDefault()}:void 0,D?void 0:{onClick:ne}),tabIndex:re.tabIndex!=null&&E&&!k.shouldUseVirtualFocus?-1:re.tabIndex},labelProps:{id:ee},descriptionProps:{id:F},keyboardShortcutProps:{id:I},isFocused:ie,isFocusVisible:ie&&w.isFocused&&$p()&&!E,isSelected:O,isPressed:ae,isDisabled:D}}function wx(e){let{heading:t,"aria-label":n}=e,r=es();return{itemProps:{role:`presentation`},headingProps:t?{id:r,role:`presentation`}:{},groupProps:{role:`group`,"aria-label":n,"aria-labelledby":t?r:void 0}}}var Tx=2,Ex=50,Dx=1e3,Ox=Math.PI/12;function kx(e){let{menuRef:t,submenuRef:n,isOpen:r,isDisabled:i}=e,a=(0,v.useRef)(void 0),o=(0,v.useRef)(void 0),s=(0,v.useRef)(0),c=(0,v.useRef)(void 0),l=(0,v.useRef)(void 0),u=(0,v.useRef)(void 0),d=(0,v.useRef)(2),[f,p]=(0,v.useState)(!1);Hs({ref:r?n:void 0,onResize:()=>{n.current&&(o.current=n.current.getBoundingClientRect(),u.current=void 0)}});let m=()=>{p(!1),d.current=Tx,a.current=void 0},h=rm(),g=Rs(e=>{f&&e.preventDefault()});(0,v.useEffect)(()=>{f&&t.current?t.current.style.pointerEvents=`none`:t.current.style.pointerEvents=``},[t,f]),Io(()=>{let e=n.current,f=t.current;if(i||!e||!r||h!==`pointer`||!f){m();return}o.current=e.getBoundingClientRect();let _=e=>{if(e.pointerType===`touch`||e.pointerType===`pen`)return;let t=Date.now();if(t-s.currento.current.right?`left`:`right`,nf.getBoundingClientRect().right||rf.getBoundingClientRect().bottom){m();return}let i=a.current.x,h=a.current.y,g=u.current===`right`?o.current.left-i:i-o.current.right,_=Math.atan2(h-o.current.top,g)+Ox,v=Math.atan2(h-o.current.bottom,g)-Ox,y=Math.atan2(h-r,u.current===`left`?-(n-i):n-i),b=y<_&&y>v;d.current=b?Math.min(d.current+1,Tx):Math.max(d.current-1,0),d.current>=Tx?p(!0):p(!1),s.current=t,a.current={x:n,y:r},b&&(c.current=setTimeout(()=>{m(),l.current=setTimeout(()=>{let e=document.elementFromPoint(n,r);e&&ps(f,e)&&e.dispatchEvent(new PointerEvent(`pointerover`,{bubbles:!0,cancelable:!0}))},100)},Dx))};return window.addEventListener(`pointermove`,_),window.addEventListener(`pointerdown`,g,!0),()=>{window.removeEventListener(`pointermove`,_),window.removeEventListener(`pointerdown`,g,!0),clearTimeout(c.current),clearTimeout(l.current),d.current=Tx}},[i,r,t,h,p,n])}function Ax(e,t,n){let{parentMenuRef:r,submenuRef:i,type:a=`menu`,isDisabled:o,delay:s=200,shouldUseVirtualFocus:c}=e,l=es(),u=es(),{direction:d}=rp(),f=(0,v.useRef)(void 0),p=(0,v.useCallback)(()=>{f.current&&=(clearTimeout(f.current),void 0)},[f]),m=(0,v.useCallback)(e=>{p(),t.open(e)},[t,p]),h=(0,v.useCallback)(()=>{p(),t.close()},[t,p]);Io(()=>()=>{p()},[p]);let{keyboardProps:g}=Sm({shortcuts:{ArrowLeft:e=>{if(!gs(e.currentTarget))return!1;if(d===`ltr`&&ps(e.currentTarget,H(e))){h(),!c&&n.current&&So(n.current);return}return!1},ArrowRight:e=>{if(!gs(e.currentTarget))return!1;if(d===`rtl`&&ps(e.currentTarget,H(e))){h(),!c&&n.current&&So(n.current);return}return!1},Escape:e=>{if(!gs(e.currentTarget))return!1;if(ps(i.current,H(e))){h(),!c&&n.current&&So(n.current);return}return!1}}}),_={id:u,"aria-labelledby":l,submenuLevel:t.submenuLevel,...a===`menu`&&{onClose:t.closeAll,autoFocus:t.focusStrategy??void 0,...g}},{keyboardProps:y}=Sm({shortcuts:{ArrowRight:()=>{if(!o){if(d===`ltr`){t.isOpen||m(`first`),a===`menu`&&i?.current&&ms()===n?.current&&So(i.current);return}if(t.isOpen){h();return}return!1}return!1},ArrowLeft:()=>{if(!o){if(d===`rtl`){t.isOpen||m(`first`),a===`menu`&&i?.current&&ms()===n?.current&&So(i.current);return}if(t.isOpen){h();return}return!1}return!1}}});return nc(r,`focusin`,e=>{t.isOpen&&ps(r.current,H(e))&&H(e)!==n.current&&h()}),kx({menuRef:r,submenuRef:i,isOpen:t.isOpen,isDisabled:o}),{submenuTriggerProps:{onKeyDown:y.onKeyDown,onKeyUp:y.onKeyUp,id:l,"aria-controls":t.isOpen?u:void 0,"aria-haspopup":o?void 0:a,"aria-expanded":t.isOpen?`true`:`false`,onPressStart:e=>{!o&&(e.pointerType===`virtual`||e.pointerType===`keyboard`)&&m(`first`)},onPress:e=>{!o&&(e.pointerType===`touch`||e.pointerType===`mouse`)&&m()},onHoverChange:e=>{o||(e&&!t.isOpen?f.current||=setTimeout(()=>{m()},s):e||p())},isOpen:t.isOpen},submenuProps:_,popoverProps:{isNonModal:!0,shouldCloseOnInteractOutside:e=>e!==n.current}}}function jx(e){let t=gv(e),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)([]),o=()=>{a([]),t.close()},s=(e,t)=>{a(n=>t>n.length?n:[...n.slice(0,t),e])},c=(e,t)=>{a(n=>n[t]===e?n.slice(0,t):n)};return{focusStrategy:n,...t,open(e=null){r(e),t.open()},toggle(e=null){r(e),t.toggle()},close(){o()},expandedKeysStack:i,openSubmenu:s,closeSubmenu:c}}function Mx(e,t){let{triggerKey:n}=e,{expandedKeysStack:r,openSubmenu:i,closeSubmenu:a,close:o}=t,[s]=(0,v.useState)(r?.length),c=(0,v.useMemo)(()=>r[s]===n,[r,n,s]),[l,u]=(0,v.useState)(null),d=(0,v.useCallback)(e=>{u(e??null),i(n,s)},[i,s,n]),f=(0,v.useCallback)(()=>{u(null),a(n,s)},[a,s,n]),p=(0,v.useCallback)(e=>{u(e??null),c?f():d(e)},[f,d,c]);return(0,v.useMemo)(()=>({focusStrategy:l,isOpen:c,open:d,close:f,closeAll:o,submenuLevel:s,setOpen:()=>{},toggle:p,point:null,setPoint:()=>{}}),[c,d,f,o,l,p,s])}var Nx=class e extends Set{constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}},Px=class e{constructor(e,t,n){this.collection=e,this.state=t,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null,this.fullCollection=n?.fullCollection||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys===`all`?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode===`none`)return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys===`all`?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!==`all`&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys===`all`)return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(e=>t.has(e)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&yx(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&yx(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n;if(this.state.selectedKeys===`all`)n=new Nx([t],t,t);else{let e=this.state.selectedKeys,r=e.anchorKey??t;n=new Nx(e,r,t);for(let i of this.getKeyRange(r,e.currentKey??t))n.delete(i);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&n.add(e)}this.state.setSelectedKeys(n)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?yx(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let n=[],r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e&&(e.type===`item`||e.type===`cell`&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type===`cell`&&this.allowsCellSelection)return e;for(;t&&t.type!==`item`&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!==`item`?null:t.key}toggleSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new Nx(this.state.selectedKeys===`all`?this.getSelectAllKeys():this.state.selectedKeys);n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new Nx([t],t,t):new Nx;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode===`none`)return;let t=new Nx;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode===`single`))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=this.fullCollection??this.collection,t=[],n=r=>{for(;r!=null;){if(this.canSelectItemIn(r,e)){let i=e.getItem(r);i?.type===`item`&&t.push(r),i?.hasChildNodes&&(this.allowsCellSelection||i.type!==`item`)&&n(gx(hx(i,e))?.key??null)}r=e.getKeyAfter(r)}};return n(e.getFirstKey()),t}selectAll(){!this.isSelectAll&&this.selectionMode===`multiple`&&this.state.setSelectedKeys(`all`)}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys===`all`||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Nx)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!==`none`&&(this.selectionMode===`single`?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior===`toggle`||t&&(t.pointerType===`touch`||t.pointerType===`virtual`)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,t){if(this.state.selectionMode===`none`||this.state.disabledKeys.has(e))return!1;let n=t.getItem(e);return!(!n||n?.props?.isDisabled||n.type===`cell`&&!this.allowsCellSelection)}isDisabled(e){let t=this.collection.getItem(e);return this.state.disabledBehavior===`all`&&(this.state.disabledKeys.has(e)||!!t?.props?.isDisabled)&&t?.props?.disabledBehavior!==`selection`}isLink(e){return!!this.collection.getItem(e)?.props?.href}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(t){return new e(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}},Fx=class{constructor(e,{expandedKeys:t}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e,t||=new Set;let n=e=>{if(this.keyMap.set(e.key,e),e.childNodes&&(e.type===`section`||t.has(e.key)))for(let t of e.childNodes)n(t)};for(let t of e)n(t);let r=null,i=0;for(let[e,t]of this.keyMap)r?(r.nextKey=e,t.prevKey=r.key):(this.firstKey=e,t.prevKey=void 0),t.type===`item`&&(t.index=i++),r=t,r.nextKey=void 0;this.lastKey=r?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey??null:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}},Ix=class{build(e,t){return this.context=t,Lx(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:t,items:n}=e;if(v.isValidElement(t)&&t.type===v.Fragment)yield*this.iterateCollection({children:t.props.children,items:n});else if(typeof t==`function`){if(!n)throw Error(`props.children was a function but props.items is missing`);let e=0;for(let r of n)yield*this.getFullNode({value:r,index:e},{renderer:t}),e++}else{let e=[];v.Children.forEach(t,t=>{t&&e.push(t)});let n=0;for(let t of e){let e=this.getFullNode({element:t,index:n},{});for(let t of e)n++,yield t}}}getKey(e,t,n,r){if(e.key!=null)return e.key;if(t.type===`cell`&&t.key!=null)return`${r}${t.key}`;let i=t.value;if(i!=null){let e=i.key??i.id;if(e==null)throw Error(`No key found for item`);return e}return r?`${r}.${t.index}`:`$.${t.index}`}getChildState(e,t){return{renderer:t.renderer||e.renderer}}*getFullNode(e,t,n,r){if(v.isValidElement(e.element)&&e.element.type===v.Fragment){let i=[];v.Children.forEach(e.element.props.children,e=>{i.push(e)});let a=e.index??0;for(let e of i)yield*this.getFullNode({element:e,index:a++},t,n,r);return}let i=e.element;if(!i&&e.value&&t&&t.renderer){let n=this.cache.get(e.value);if(n&&(!n.shouldInvalidate||!n.shouldInvalidate(this.context))){n.index=e.index,n.parentKey=r?r.key:null,yield n;return}i=t.renderer(e.value)}if(v.isValidElement(i)){let a=i.type;if(typeof a!=`function`&&typeof a.getCollectionNode!=`function`){let e=i.type;throw Error(`Unknown element <${e}> in collection.`)}let o=a.getCollectionNode(i.props,this.context),s=e.index??0,c=o.next();for(;!c.done&&c.value;){let a=c.value;e.index=s;let l=a.key??null;l??=a.element?null:this.getKey(i,e,t,n);let u=[...this.getFullNode({...a,key:l,index:s,wrapper:Rx(e.wrapper,a.wrapper)},this.getChildState(t,a),n?`${n}${i.key}`:i.key,r)];for(let t of u){if(t.value=a.value??e.value??null,t.value&&this.cache.set(t.value,t),e.type&&t.type!==e.type)throw Error(`Unsupported type <${zx(t.type)}> in <${zx(r?.type??`unknown parent type`)}>. Only <${zx(e.type)}> is supported.`);s++,yield t}c=o.next(u)}return}if(e.key==null||e.type==null)return;let a=this,o={type:e.type,props:e.props,key:e.key,parentKey:r?r.key:null,value:e.value??null,level:(r?.level??0)+ +(r?.type===`item`),index:e.index,rendered:e.rendered,textValue:e.textValue??``,"aria-label":e[`aria-label`],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:Lx(function*(){if(!e.hasChildNodes||!e.childNodes)return;let n=0;for(let r of e.childNodes()){r.key!=null&&(r.key=`${o.key}${r.key}`);let e=a.getFullNode({...r,index:n},a.getChildState(t,r),o.key,o);for(let t of e)n++,yield t}})};yield o}constructor(){this.cache=new WeakMap}};function Lx(e){let t=[],n=null;return{*[Symbol.iterator](){for(let e of t)yield e;n||=e();for(let e of n)t.push(e),yield e}}}function Rx(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function zx(e){return e[0].toUpperCase()+e.slice(1)}function Bx(e,t,n){let r=(0,v.useMemo)(()=>new Ix,[]),{children:i,items:a,collection:o}=e;return(0,v.useMemo)(()=>o||t(r.build({children:i,items:a},n)),[r,i,a,o,n,t])}function Vx(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Hx(e){let{selectionMode:t=`none`,disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i=`toggle`,disabledBehavior:a=`all`}=e,o=(0,v.useRef)(!1),[,s]=(0,v.useState)(!1),c=(0,v.useRef)(null),l=(0,v.useRef)(null),[,u]=(0,v.useState)(null),[d,f]=sh((0,v.useMemo)(()=>Ux(e.selectedKeys),[e.selectedKeys]),(0,v.useMemo)(()=>Ux(e.defaultSelectedKeys,new Nx),[e.defaultSelectedKeys]),e.onSelectionChange),p=(0,v.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[m,h]=(0,v.useState)(i);i===`replace`&&m===`toggle`&&typeof d==`object`&&d.size===0&&h(`replace`);let g=(0,v.useRef)(i);return(0,v.useEffect)(()=>{i!==g.current&&(h(i),g.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:m,setSelectionBehavior:h,get isFocused(){return o.current},setFocused(e){o.current=e,s(e)},get focusedKey(){return c.current},get childFocusStrategy(){return l.current},setFocusedKey(e,t=`first`){c.current=e,l.current=t,u(e)},selectedKeys:d,setSelectedKeys(e){(r||!Vx(e,d))&&f(e)},disabledKeys:p,disabledBehavior:a}}function Ux(e,t){return e?e===`all`?`all`:new Nx(e):t}function Wx(e){let{onExpandedChange:t}=e,[n,r]=sh(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,t),i=Hx(e),a=(0,v.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),o=Bx(e,(0,v.useCallback)(e=>new Fx(e,{expandedKeys:n}),[n]),null);return(0,v.useEffect)(()=>{i.focusedKey!=null&&!o.getItem(i.focusedKey)&&i.setFocusedKey(null)},[o,i.focusedKey]),{collection:o,expandedKeys:n,disabledKeys:a,toggleKey:e=>{r(Gx(n,e))},setExpandedKeys:r,selectionManager:new Px(o,i)}}function Gx(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}var Kx=(0,v.createContext)(null),qx=(0,v.createContext)(null),Jx=(0,v.createContext)(null),Yx=(0,v.createContext)(null);function Xx(e){let t=jx(e),n=(0,v.useRef)(null),{menuTriggerProps:r,menuProps:i}=Yb({...e,type:`menu`},t,n),a=(0,v.useRef)(null);return Uf()?null:v.createElement(jf,{values:[[Kx,{...i,ref:a}],[cS,t],[Jx,t],[_v,{trigger:`MenuTrigger`,triggerRef:n,scrollRef:a,placement:`bottom start`,"aria-labelledby":i[`aria-labelledby`],offset:e.trigger===`contextMenu`?0:void 0}]]},v.createElement(lv,{...r,ref:n,isPressed:t.isOpen},e.children))}var Zx=(0,v.createContext)(null),Qx=qv(class extends xv{static{this.type=`submenutrigger`}filter(e,t,n){let r=e.getItem(this.firstChildKey);if(r&&n(r.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}},(e,t,n)=>{let{CollectionBranch:r}=(0,v.useContext)(ny),i=(0,v.useContext)(qx),a=(0,v.useContext)(Jx),o=Mx({triggerKey:n.key},a),s=(0,v.useRef)(null),c=Is(t),{parentMenuRef:l,shouldUseVirtualFocus:u}=(0,v.useContext)(Zx),{submenuTriggerProps:d,submenuProps:f,popoverProps:p}=Ax({parentMenuRef:l,submenuRef:s,delay:e.delay,shouldUseVirtualFocus:u},o,c);return v.createElement(jf,{values:[[iS,{...d,onAction:void 0,ref:c}],[Kx,{ref:s,...f}],[cS,o],[_v,{trigger:`SubmenuTrigger`,triggerRef:c,placement:`end top`,"aria-labelledby":f[`aria-labelledby`],...p}]]},v.createElement(r,{collection:i.collection,parent:n}),e.children[1])},e=>e.children[0]),$x=(0,v.forwardRef)(function(e,t){return[e,t]=Ff(e,t,Kx),v.createElement(Rv,{content:v.createElement(Xv,e)},n=>v.createElement(eS,{props:e,collection:n,menuRef:t}))});function eS({props:e,collection:t,menuRef:n}){[e,n]=Ff(e,n,Jy);let{filter:r,...i}=e,a=(0,v.useMemo)(()=>r?t.filter(r):t,[t,r]),o=Wx({...e,collection:a,children:void 0}),s=(0,v.useContext)(Jx),{isVirtualized:c,CollectionRoot:l}=(0,v.useContext)(ny),{menuProps:u}=dx({...e,isVirtualized:c,onClose:e.onClose||s?.close},o,n),d=Mf({...e,children:void 0,defaultClassName:`react-aria-Menu`,values:{isEmpty:o.collection.size===0}}),f=null;o.collection.size===0&&e.renderEmptyState&&(f=v.createElement(`div`,{role:`menuitem`,style:{display:`contents`}},e.renderEmptyState()));let p=W(e,{global:!0});return v.createElement(Sg,null,v.createElement(q.div,{...U(p,d,u),ref:n,slot:e.slot||void 0,"data-empty":o.collection.size===0||void 0,onScroll:e.onScroll},v.createElement(jf,{values:[[qx,o],[ab,{elementType:`div`}],[Qv,{name:`MenuSection`,render:nS}],[Zx,{parentMenuRef:n,shouldUseVirtualFocus:i?.shouldUseVirtualFocus}],[iS,{shouldCloseOnSelect:e.shouldCloseOnSelect}],[Jy,null],[Yy,null],[Yx,o.selectionManager],[Jx,s??jx({})]]},v.createElement(eb,null,v.createElement(l,{collection:o.collection,persistedKeys:ry(o.selectionManager.focusedKey),scrollRef:n}))),f))}var tS=class extends Px{constructor(e,t){super(e.collection,t),this.parent=e}get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,t){return this.parent.setFocusedKey(e,t)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}};function nS(e,t,n,r=`react-aria-MenuSection`){let i=(0,v.useContext)(qx),{CollectionBranch:a}=(0,v.useContext)(ny),[o,s]=If(),{headingProps:c,groupProps:l}=wx({heading:s,"aria-label":n.props[`aria-label`]??void 0}),u=Mf({...e,id:void 0,children:void 0,defaultClassName:r,className:n.props?.className,style:n.props?.style,values:void 0}),d=(0,v.useContext)(Yx),f=Hx(e),p=e.selectionMode==null?d:new tS(d,f),m=Pf(iS)?.shouldCloseOnSelect,h=W(e,{global:!0});return delete h.id,v.createElement(q.section,{...U(h,u,l),ref:t},v.createElement(jf,{values:[[Zy,{...c,ref:o}],[Yx,p],[iS,{shouldCloseOnSelect:e.shouldCloseOnSelect??m}]]},v.createElement(a,{collection:i.collection,parent:n})))}var rS=qv(Tv,nS),iS=(0,v.createContext)(null),aS=Kv(wv,function(e,t,n){[e,t]=Ff(e,t,iS);let r=Pf(iS)?.id,i=(0,v.useContext)(qx),a=Is(t),o=(0,v.useContext)(Yx),{isVirtualized:s}=(0,v.useContext)(ny),{menuItemProps:c,labelProps:l,descriptionProps:u,keyboardShortcutProps:d,...f}=Cx({...e,id:r,key:n.key,selectionManager:o,isVirtualized:s},i,a),{hoverProps:p,isHovered:m}=eh({isDisabled:f.isDisabled}),h=Mf({...e,id:void 0,children:n.rendered,defaultClassName:`react-aria-MenuItem`,values:{...f,isHovered:m,isFocusVisible:f.isFocusVisible,selectionMode:o.selectionMode,selectionBehavior:o.selectionBehavior,hasSubmenu:!!e[`aria-haspopup`],isOpen:e[`aria-expanded`]===`true`}}),g=e.href?q.a:q.div,_=W(e,{global:!0});return delete _.id,delete _.onClick,v.createElement(g,{...U(_,h,c,p),ref:a,"data-disabled":f.isDisabled||void 0,"data-hovered":m||void 0,"data-focused":f.isFocused||void 0,"data-focus-visible":f.isFocusVisible||void 0,"data-pressed":f.isPressed||void 0,"data-selected":f.isSelected||void 0,"data-selection-mode":o.selectionMode===`none`?void 0:o.selectionMode,"data-has-submenu":!!e[`aria-haspopup`]||void 0,"data-open":e[`aria-expanded`]===`true`||void 0},v.createElement(jf,{values:[[sb,{slots:{[Af]:l,label:l,description:u}}],[Qy,d],[nb,{isSelected:f.isSelected}]]},h.children))});function oS(e,t){let{role:n=`dialog`}=e,r=ns();r=e[`aria-label`]?void 0:r;let i=ns();i=n===`alertdialog`&&!e[`aria-describedby`]?i:void 0;let a=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(t.current&&!gs(t.current)){sm(t.current);let e=setTimeout(()=>{(ms()===t.current||ms()===document.body)&&(a.current=!0,t.current&&(t.current.blur(),sm(t.current)),a.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),hv(),(0,v.useRef)(!1),(0,v.useEffect)(()=>{});let o=e[`aria-describedby`]??i;return{dialogProps:{...W(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e[`aria-labelledby`]??r,"aria-describedby":o,onBlur:e=>{a.current&&e.stopPropagation()}},titleProps:{id:r},contentProps:{id:i}}}var sS=(0,v.createContext)(null),cS=(0,v.createContext)(null);function lS(e){let t=jx(e),n=(0,v.useRef)(null),{triggerProps:r,overlayProps:i}=qb({type:`dialog`},t,n);return r.id=es(),i[`aria-labelledby`]=r.id,v.createElement(jf,{values:[[cS,t],[Jx,t],[sS,i],[_v,{trigger:`DialogTrigger`,triggerRef:n,id:i.id,"aria-labelledby":i[`aria-labelledby`]}]]},v.createElement(lv,{...r,ref:n,isPressed:t.isOpen},e.children))}var uS=(0,v.forwardRef)(function(e,t){let n=e[`aria-labelledby`];[e,t]=Ff(e,t,sS);let{dialogProps:r,titleProps:i,contentProps:a}=oS({...e,"aria-labelledby":n},t),o=(0,v.useContext)(cS);!r[`aria-label`]&&!r[`aria-labelledby`]&&e[`aria-labelledby`]&&(r[`aria-labelledby`]=e[`aria-labelledby`]);let s=Mf({defaultClassName:`react-aria-Dialog`,className:e.className,style:e.style,children:e.children,values:{close:o?.close||(()=>{})}}),c=W(e,{global:!0});return v.createElement(q.section,{...U(c,s,r),render:e.render,ref:t,slot:e.slot||void 0},v.createElement(jf,{values:[[_h,{slots:{[Af]:{},title:{...i,level:2}}}],[sb,{slots:{[Af]:{},description:a}}],[th,{slots:{[Af]:{},close:{onPress:()=>o?.close()}}}]]},s.children))});function dS(e,t,n){let{overlayProps:r,underlayProps:i}=Zg({...e,isOpen:t.isOpen,onClose:t.close},n);return t_({isDisabled:!t.isOpen}),hv(),(0,v.useEffect)(()=>{if(t.isOpen&&n.current)return Uh([n.current],{shouldUseInert:!0})},[t.isOpen,n]),{modalProps:U(r),underlayProps:i}}var fS=(0,v.createContext)(null),pS=(0,v.createContext)(null),mS=(0,v.forwardRef)(function(e,t){if((0,v.useContext)(pS))return v.createElement(vS,{...e,modalRef:t},e.children);let{isDismissable:n,isKeyboardDismissDisabled:r,isOpen:i,defaultOpen:a,onOpenChange:o,children:s,isEntering:c,isExiting:l,UNSTABLE_portalContainer:u,shouldCloseOnInteractOutside:d,...f}=e;return v.createElement(gS,{isDismissable:n,isKeyboardDismissDisabled:r,isOpen:i,defaultOpen:a,onOpenChange:o,isEntering:c,isExiting:l,UNSTABLE_portalContainer:u,shouldCloseOnInteractOutside:d},v.createElement(vS,{...f,modalRef:t},s))});function hS(e,t){[e,t]=Ff(e,t,fS);let n=(0,v.useContext)(cS),r=gv(e),i=e.isOpen!=null||e.defaultOpen!=null||!n?r:n,a=Is(t),o=(0,v.useRef)(null),s=pc(a,i.isOpen),c=pc(o,i.isOpen),l=s||c||e.isExiting||!1,u=Jo();return!i.isOpen&&!l||u?null:v.createElement(_S,{...e,state:i,isExiting:l,overlayRef:a,modalRef:o})}var gS=(0,v.forwardRef)(hS);function _S({UNSTABLE_portalContainer:e,...t}){let n=t.modalRef,{state:r}=t,{modalProps:i,underlayProps:a}=dS(t,r,n),o=fc(t.overlayRef)||t.isEntering||!1,s=Mf({...t,defaultClassName:`react-aria-ModalOverlay`,values:{isEntering:o,isExiting:t.isExiting,state:r}}),c=Zs(),l,u;if(typeof document<`u`){let e=Ws(document.body)?document.body:document.scrollingElement||document.documentElement,t=e.getBoundingClientRect().width%1,n=e.getBoundingClientRect().height%1;l=e.scrollWidth-t,u=e.scrollHeight-n}let d={...s.style,"--visual-viewport-width":c.width+`px`,"--visual-viewport-height":c.height+`px`,"--page-width":l===void 0?void 0:l+`px`,"--page-height":u===void 0?void 0:u+`px`};return v.createElement(mv,{isExiting:t.isExiting,portalContainer:e},v.createElement(q.div,{...U(W(t,{global:!0}),a),...s,style:d,ref:t.overlayRef,"data-entering":o||void 0,"data-exiting":t.isExiting||void 0},v.createElement(jf,{values:[[pS,{modalProps:i,modalRef:n,isExiting:t.isExiting,isDismissable:t.isDismissable}],[cS,r]]},s.children)))}function vS(e){let{modalProps:t,modalRef:n,isExiting:r,isDismissable:i}=(0,v.useContext)(pS),a=(0,v.useContext)(cS),o=Is((0,v.useMemo)(()=>ys(e.modalRef,n),[e.modalRef,n])),s=fc(o),c=Mf({...e,defaultClassName:`react-aria-Modal`,values:{isEntering:s,isExiting:r,state:a}});return v.createElement(q.div,{...U(W(e,{global:!0}),t),...c,ref:o,"data-entering":s||void 0,"data-exiting":r||void 0},i&&v.createElement(cv,{onDismiss:a.close}),c.children)}var yS=v.forwardRef(({children:e,...t},n)=>{n=Is(n);let{pressProps:r}=Rm({...t,ref:n}),{focusableProps:i}=Em(t,n),a=v.Children.only(e);(0,v.useEffect)(()=>{},[n,t.isDisabled]);let o=a.props.ref;return v.cloneElement(a,{...U(r,i,a.props),ref:ys(o,n)})}),bS=({children:e,className:t,slot:n,style:r,variant:i,...a})=>{let o=(0,v.useMemo)(()=>Jd({variant:i}),[i]);return(0,G.jsx)(nh,{"aria-label":`Close`,className:J(t,o),"data-slot":`close-button`,slot:n,style:r,type:`button`,...a,children:t=>typeof e==`function`?e(t):e??(0,G.jsx)(wh,{"data-slot":`close-button-icon`})})},xS=Object.assign(bS,{Root:bS}),SS=(0,v.createContext)({}),CS=({children:e,...t})=>{let n=(0,v.useMemo)(()=>({slots:Bd(),placement:void 0}),[]);return(0,G.jsx)(SS,{value:n,children:(0,G.jsx)(lS,{"data-slot":`alert-dialog-root`,...t,children:e})})},wS=Object.assign(CS,{Root:CS,Trigger:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SS);return(0,G.jsx)(yS,{children:(0,G.jsx)(`div`,{className:Y(r?.trigger,t),"data-slot":`alert-dialog-trigger`,role:`button`,...n,children:e})})},Backdrop:({children:e,className:t,isDismissable:n=!1,isKeyboardDismissDisabled:r=!0,onClick:i,variant:a,...o})=>{let{slots:s}=(0,v.use)(SS),c=(0,v.useMemo)(()=>Bd({variant:a}),[a]),l=(0,v.useMemo)(()=>({slots:{...s,...c}}),[s,c]);return(0,G.jsx)(gS,{className:J(t,c?.backdrop()),"data-slot":`alert-dialog-backdrop`,isDismissable:n,isKeyboardDismissDisabled:r,onClick:e=>{e.stopPropagation(),i?.(e)},...o,children:t=>(0,G.jsxs)(SS,{value:l,children:[typeof e==`function`?e(t):e,` `]})})},Container:({children:e,className:t,placement:n=`auto`,size:r,...i})=>{let{slots:a}=(0,v.use)(SS),o=(0,v.useMemo)(()=>Bd({size:r}),[r]),s=(0,v.useMemo)(()=>({placement:n,slots:{...a,...o}}),[n,a,o]);return(0,G.jsx)(mS,{className:J(t,o?.container()),"data-placement":n,"data-slot":`alert-dialog-container`,...i,children:t=>(0,G.jsx)(SS,{value:s,children:typeof e==`function`?e(t):e})})},Dialog:({children:e,className:t,...n})=>{let{placement:r,slots:i}=(0,v.use)(SS);return(0,G.jsx)(uS,{className:Y(i?.dialog,t),"data-placement":r,"data-slot":`alert-dialog-dialog`,role:`alertdialog`,...n,children:e})},Header:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SS);return(0,G.jsx)(`div`,{className:Y(r?.header,t),"data-slot":`alert-dialog-header`,...n,children:e})},Heading:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SS);return(0,G.jsx)(vh,{className:Y(r?.heading,t),"data-slot":`alert-dialog-heading`,slot:`title`,...n,children:e})},Body:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SS);return(0,G.jsx)(`div`,{className:Y(r?.body,t),"data-slot":`alert-dialog-body`,...n,children:e})},Footer:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SS);return(0,G.jsx)(`div`,{className:Y(r?.footer,t),"data-slot":`alert-dialog-footer`,...n,children:e})},Icon:({children:e,className:t,status:n=`danger`,...r})=>{let i=(0,v.useMemo)(()=>Bd({status:n}),[n]),a=()=>{switch(n){case`default`:return(0,G.jsx)(Th,{"data-slot":`alert-dialog-default-icon`});case`accent`:return(0,G.jsx)(Th,{"data-slot":`alert-dialog-default-icon`});case`success`:return(0,G.jsx)(Oh,{"data-slot":`alert-dialog-default-icon`});case`warning`:return(0,G.jsx)(Eh,{"data-slot":`alert-dialog-default-icon`});case`danger`:return(0,G.jsx)(Dh,{"data-slot":`alert-dialog-default-icon`});default:return(0,G.jsx)(Dh,{"data-slot":`alert-dialog-default-icon`})}};return(0,G.jsx)(K.div,{className:i?.icon({className:t}),"data-slot":`alert-dialog-icon`,...r,children:e??a()})},CloseTrigger:({className:e,...t})=>{let{slots:n}=(0,v.use)(SS);return(0,G.jsx)(xS,{className:J(e,n?.closeTrigger()),"data-slot":`alert-dialog-close-trigger`,slot:`close`,...t})}});function TS(e){let t=lx({usage:`search`,...e}),n=(0,v.useCallback)((e,n)=>n.length===0||(e=e.normalize(`NFC`),n=n.normalize(`NFC`),t.compare(e.slice(0,n.length),n)===0),[t]),r=(0,v.useCallback)((e,n)=>n.length===0||(e=e.normalize(`NFC`),n=n.normalize(`NFC`),t.compare(e.slice(-n.length),n)===0),[t]),i=(0,v.useCallback)((e,n)=>{if(n.length===0)return!0;e=e.normalize(`NFC`),n=n.normalize(`NFC`);let r=0,i=n.length;for(;r+i<=e.length;r++){let a=e.slice(r,r+i);if(t.compare(n,a)===0)return!0}return!1},[t]);return(0,v.useMemo)(()=>({startsWith:n,endsWith:r,contains:i}),[n,r,i])}var ES=(0,v.createContext)({}),DS=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,ES);let{isDisabled:n,isInvalid:r,isReadOnly:i,onHoverStart:a,onHoverChange:o,onHoverEnd:s,...c}=e;n??=!!e[`aria-disabled`]&&e[`aria-disabled`]!==`false`,r??=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`;let{hoverProps:l,isHovered:u}=eh({onHoverStart:a,onHoverChange:o,onHoverEnd:s,isDisabled:n}),{isFocused:d,isFocusVisible:f,focusProps:p}=Jm({within:!0}),m=Mf({...e,values:{isHovered:u,isFocusWithin:d,isFocusVisible:f,isDisabled:n,isInvalid:r},defaultClassName:`react-aria-Group`});return v.createElement(q.div,{...U(c,p,l),...m,ref:t,role:e.role??`group`,slot:e.slot??void 0,"data-focus-within":d||void 0,"data-hovered":u||void 0,"data-focus-visible":f||void 0,"data-disabled":n||void 0,"data-invalid":r||void 0,"data-readonly":i||void 0},m.children)}),OS=(0,v.createContext)(null),kS={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},AS={...kS,customError:!0,valid:!1},jS={isInvalid:!1,validationDetails:kS,validationErrors:[]},MS=(0,v.createContext)({}),NS=`__reactAriaFormValidationState`;function PS(e){if(e.__reactAriaFormValidationState){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}=e[NS];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}}return FS(e)}function FS(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:a,validate:o,validationBehavior:s=`aria`}=e;n&&(t||=n===`invalid`);let c=t===void 0?null:{isInvalid:t,validationErrors:[],validationDetails:AS},l=(0,v.useMemo)(()=>!o||i==null?null:RS(LS(o,i)),[o,i]);a?.validationDetails.valid&&(a=void 0);let u=(0,v.useContext)(MS),d=(0,v.useMemo)(()=>r?Array.isArray(r)?r.flatMap(e=>IS(u[e])):IS(u[r]):[],[u,r]),[f,p]=(0,v.useState)(u),[m,h]=(0,v.useState)(!1);u!==f&&(p(u),h(!1));let g=(0,v.useMemo)(()=>RS(m?[]:d),[m,d]),_=(0,v.useRef)(jS),[y,b]=(0,v.useState)(jS),x=(0,v.useRef)(jS),S=()=>{if(!C)return;w(!1);let e=l||a||_.current;zS(e,x.current)||(x.current=e,b(e))},[C,w]=(0,v.useState)(!1);return(0,v.useEffect)(S),{realtimeValidation:c||g||l||a||jS,displayValidation:s===`native`?c||g||y:c||g||l||a||y,updateValidation(e){s===`aria`&&!zS(y,e)?b(e):_.current=e},resetValidation(){let e=jS;zS(e,x.current)||(x.current=e,b(e)),s===`native`&&w(!1),h(!0)},commitValidation(){s===`native`&&w(!0),h(!0)}}}function IS(e){return e?Array.isArray(e)?e:[e]:[]}function LS(e,t){if(typeof e==`function`){let n=e(t);if(n&&typeof n!=`boolean`)return IS(n)}return[]}function RS(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:AS}:null}function zS(e,t){return e===t||!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,n)=>e===t.validationErrors[n])&&Object.entries(e.validationDetails).every(([e,n])=>t.validationDetails[e]===n)}function BS(...e){let t=new Set,n=!1,r={...kS};for(let i of e){for(let e of i.validationErrors)t.add(e);n||=i.isInvalid;for(let e in r)r[e]||=i.validationDetails[e]}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}var VS=(0,v.createContext)(null),HS=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,VS);let{validationErrors:n,validationBehavior:r=`native`,children:i,className:a,...o}=e;return v.createElement(q.form,{noValidate:r!==`native`,...o,ref:t,className:a||`react-aria-Form`},v.createElement(VS.Provider,{value:{...e,validationBehavior:r}},v.createElement(MS.Provider,{value:n??{}},i)))}),US={};US={colorSwatchPicker:`تغييرات الألوان`,dropzoneLabel:`DropZone`,selectPlaceholder:`حدد عنصرًا`,tableResizer:`أداة تغيير الحجم`};var WS={};WS={colorSwatchPicker:`Цветови мостри`,dropzoneLabel:`DropZone`,selectPlaceholder:`Изберете предмет`,tableResizer:`Преоразмерител`};var GS={};GS={colorSwatchPicker:`Vzorky barev`,dropzoneLabel:`Místo pro přetažení`,selectPlaceholder:`Vyberte položku`,tableResizer:`Změna velikosti`};var KS={};KS={colorSwatchPicker:`Farveprøver`,dropzoneLabel:`DropZone`,selectPlaceholder:`Vælg et element`,tableResizer:`Størrelsesændring`};var qS={};qS={colorSwatchPicker:`Farbfelder`,dropzoneLabel:`Ablegebereich`,selectPlaceholder:`Element wählen`,tableResizer:`Größenanpassung`};var JS={};JS={colorSwatchPicker:`Χρωματικά δείγματα`,dropzoneLabel:`DropZone`,selectPlaceholder:`Επιλέξτε ένα αντικείμενο`,tableResizer:`Αλλαγή μεγέθους`};var YS={};YS={selectPlaceholder:`Select an item`,tableResizer:`Resizer`,dropzoneLabel:`DropZone`,colorSwatchPicker:`Color swatches`};var XS={};XS={colorSwatchPicker:`Muestras de colores`,dropzoneLabel:`DropZone`,selectPlaceholder:`Seleccionar un artículo`,tableResizer:`Cambiador de tamaño`};var ZS={};ZS={colorSwatchPicker:`Värvinäidised`,dropzoneLabel:`DropZone`,selectPlaceholder:`Valige üksus`,tableResizer:`Suuruse muutja`};var QS={};QS={colorSwatchPicker:`Värimallit`,dropzoneLabel:`DropZone`,selectPlaceholder:`Valitse kohde`,tableResizer:`Koon muuttaja`};var $S={};$S={colorSwatchPicker:`Échantillons de couleurs`,dropzoneLabel:`DropZone`,selectPlaceholder:`Sélectionner un élément`,tableResizer:`Redimensionneur`};var eC={};eC={colorSwatchPicker:`דוגמיות צבע`,dropzoneLabel:`DropZone`,selectPlaceholder:`בחר פריט`,tableResizer:`שינוי גודל`};var tC={};tC={colorSwatchPicker:`Uzorci boja`,dropzoneLabel:`Zona spuštanja`,selectPlaceholder:`Odaberite stavku`,tableResizer:`Promjena veličine`};var nC={};nC={colorSwatchPicker:`Színtárak`,dropzoneLabel:`DropZone`,selectPlaceholder:`Válasszon ki egy elemet`,tableResizer:`Átméretező`};var rC={};rC={colorSwatchPicker:`Campioni di colore`,dropzoneLabel:`Zona di rilascio`,selectPlaceholder:`Seleziona un elemento`,tableResizer:`Ridimensionamento`};var iC={};iC={colorSwatchPicker:`カラースウォッチ`,dropzoneLabel:`ドロップゾーン`,selectPlaceholder:`項目を選択`,tableResizer:`サイズ変更ツール`};var aC={};aC={colorSwatchPicker:`색상 견본`,dropzoneLabel:`드롭 영역`,selectPlaceholder:`항목 선택`,tableResizer:`크기 조정기`};var oC={};oC={colorSwatchPicker:`Spalvų pavyzdžiai`,dropzoneLabel:`„DropZone“`,selectPlaceholder:`Pasirinkite elementą`,tableResizer:`Dydžio keitiklis`};var sC={};sC={colorSwatchPicker:`Krāsu paraugi`,dropzoneLabel:`DropZone`,selectPlaceholder:`Izvēlēties vienumu`,tableResizer:`Izmēra mainītājs`};var cC={};cC={colorSwatchPicker:`Fargekart`,dropzoneLabel:`Droppsone`,selectPlaceholder:`Velg et element`,tableResizer:`Størrelsesendrer`};var lC={};lC={colorSwatchPicker:`kleurstalen`,dropzoneLabel:`DropZone`,selectPlaceholder:`Selecteer een item`,tableResizer:`Resizer`};var uC={};uC={colorSwatchPicker:`Próbki kolorów`,dropzoneLabel:`Strefa upuszczania`,selectPlaceholder:`Wybierz element`,tableResizer:`Zmiana rozmiaru`};var dC={};dC={colorSwatchPicker:`Amostras de cores`,dropzoneLabel:`DropZone`,selectPlaceholder:`Selecione um item`,tableResizer:`Redimensionador`};var fC={};fC={colorSwatchPicker:`Amostras de cores`,dropzoneLabel:`DropZone`,selectPlaceholder:`Selecione um item`,tableResizer:`Redimensionador`};var pC={};pC={colorSwatchPicker:`Specimene de culoare`,dropzoneLabel:`Zonă de plasare`,selectPlaceholder:`Selectați un element`,tableResizer:`Instrument de redimensionare`};var mC={};mC={colorSwatchPicker:`Цветовые образцы`,dropzoneLabel:`DropZone`,selectPlaceholder:`Выберите элемент`,tableResizer:`Средство изменения размера`};var hC={};hC={colorSwatchPicker:`Vzorkovníky farieb`,dropzoneLabel:`DropZone`,selectPlaceholder:`Vyberte položku`,tableResizer:`Nástroj na zmenu veľkosti`};var gC={};gC={colorSwatchPicker:`Barvne palete`,dropzoneLabel:`DropZone`,selectPlaceholder:`Izberite element`,tableResizer:`Spreminjanje velikosti`};var _C={};_C={colorSwatchPicker:`Uzorci boje`,dropzoneLabel:`DropZone`,selectPlaceholder:`Izaberite stavku`,tableResizer:`Promena veličine`};var vC={};vC={colorSwatchPicker:`Färgrutor`,dropzoneLabel:`DropZone`,selectPlaceholder:`Välj en artikel`,tableResizer:`Storleksändrare`};var yC={};yC={colorSwatchPicker:`Renk örnekleri`,dropzoneLabel:`Bırakma Bölgesi`,selectPlaceholder:`Bir öğe seçin`,tableResizer:`Yeniden boyutlandırıcı`};var bC={};bC={colorSwatchPicker:`Зразки кольорів`,dropzoneLabel:`DropZone`,selectPlaceholder:`Виберіть елемент`,tableResizer:`Засіб змінення розміру`};var xC={};xC={colorSwatchPicker:`颜色色板`,dropzoneLabel:`放置区域`,selectPlaceholder:`选择一个项目`,tableResizer:`尺寸调整器`};var SC={};SC={colorSwatchPicker:`色票`,dropzoneLabel:`放置區`,selectPlaceholder:`選取項目`,tableResizer:`大小調整器`};var CC={};CC={"ar-AE":US,"bg-BG":WS,"cs-CZ":GS,"da-DK":KS,"de-DE":qS,"el-GR":JS,"en-US":YS,"es-ES":XS,"et-EE":ZS,"fi-FI":QS,"fr-FR":$S,"he-IL":eC,"hr-HR":tC,"hu-HU":nC,"it-IT":rC,"ja-JP":iC,"ko-KR":aC,"lt-LT":oC,"lv-LV":sC,"nb-NO":cC,"nl-NL":lC,"pl-PL":uC,"pt-BR":dC,"pt-PT":fC,"ro-RO":pC,"ru-RU":mC,"sk-SK":hC,"sl-SI":gC,"sr-SP":_C,"sv-SE":vC,"tr-TR":yC,"uk-UA":bC,"zh-CN":xC,"zh-TW":SC};var wC=(0,v.createContext)({}),TC=(0,v.createContext)(null),EC=(0,v.forwardRef)(function(e,t){let{render:n}=(0,v.useContext)(TC);return v.createElement(v.Fragment,null,n(e,t))});function DC(e,t){let n=e?.renderDropIndicator,r=e?.isVirtualDragging?.(),i=(0,v.useCallback)(e=>{if(r||t?.isDropTarget(e))return n?n(e):v.createElement(EC,{target:e})},[t?.target,r,n]);return e?.useDropIndicator?i:void 0}function OC(e,t,n){let r=e.focusedKey,i=null;if(t?.isVirtualDragging?.()&&n?.target?.type===`item`&&(i=n.target.key,n.target.dropPosition===`after`)){let e=n.collection.getKeyAfter(i),t=null;if(e!=null){let r=n.collection.getItem(i)?.level??0;for(;e!=null;){let i=n.collection.getItem(e);if(!i)break;if(i.type!==`item`){e=n.collection.getKeyAfter(e);continue}if((i.level??0)<=r)break;t=e,e=n.collection.getKeyAfter(e)}}i=e??t??i}return(0,v.useMemo)(()=>new Set([r,i].filter(e=>e!=null)),[r,i])}var kC=new WeakMap;function AC(e){return typeof e==`string`?e.replace(/\s*/g,``):``+e}function jC(e,t){let n=kC.get(e);if(!n)throw Error(`Unknown list`);return`${n.id}-option-${AC(t)}`}function MC(e,t,n){let r=W(e,{labelable:!0}),i=e.selectionBehavior||`toggle`,a=e.orientation||`vertical`,o=e.linkBehavior||(i===`replace`?`action`:`override`);i===`toggle`&&o===`action`&&(o=`override`);let{listProps:s}=ux({...e,ref:n,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,linkBehavior:o}),{focusWithinProps:c}=qm({onFocusWithin:e.onFocus,onBlurWithin:e.onBlur,onFocusWithinChange:e.onFocusChange}),l=es(e.id);kC.set(t,{id:l,shouldUseVirtualFocus:e.shouldUseVirtualFocus,shouldSelectOnPressUp:e.shouldSelectOnPressUp,shouldFocusOnHover:e.shouldFocusOnHover,isVirtualized:e.isVirtualized,onAction:e.onAction,linkBehavior:o,UNSTABLE_itemBehavior:e.UNSTABLE_itemBehavior});let{labelProps:u,fieldProps:d}=Kf({...e,id:l,labelElementType:`span`});return{labelProps:u,listBoxProps:U(r,c,t.selectionManager.selectionMode===`multiple`?{"aria-multiselectable":`true`}:{},{role:`listbox`,"aria-orientation":a,...U(d,s)})}}function NC(e,t,n){let{key:r}=e,i=kC.get(t),a=e.isDisabled??t.selectionManager.isDisabled(r),o=e.isSelected??t.selectionManager.isSelected(r),s=e.shouldSelectOnPressUp??i?.shouldSelectOnPressUp,c=e.shouldFocusOnHover??i?.shouldFocusOnHover,l=e.shouldUseVirtualFocus??i?.shouldUseVirtualFocus,u=e.isVirtualized??i?.isVirtualized,d=ns(),f=ns(),p={role:`option`,"aria-disabled":a||void 0,"aria-selected":t.selectionManager.selectionMode===`none`?void 0:o,"aria-label":e[`aria-label`],"aria-labelledby":d,"aria-describedby":f},m=t.collection.getItem(r);if(u){let e=Number(m?.index);p[`aria-posinset`]=Number.isNaN(e)?void 0:e+1,p[`aria-setsize`]=Sx(t.collection)}let h=i?.onAction?()=>i?.onAction?.(r):void 0,g=jC(t,r),{itemProps:_,isPressed:v,isFocused:y,hasAction:b,allowsSelection:x}=fx({selectionManager:t.selectionManager,key:r,ref:n,shouldSelectOnPressUp:s,allowsDifferentPressOrigin:s&&c,isVirtualized:u,shouldUseVirtualFocus:l,isDisabled:a,onAction:h||m?.props?.onAction?rs(m?.props?.onAction,h):void 0,linkBehavior:i?.linkBehavior,UNSTABLE_itemBehavior:i?.UNSTABLE_itemBehavior,id:g}),{hoverProps:S}=eh({isDisabled:a||!c,onHoverStart(){$p()||(t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(r))}}),C=W(m?.props);delete C.id;let w=Po(m?.props);return{optionProps:{...p,...U(C,_,S,w),id:g},labelProps:{id:d},descriptionProps:{id:f},isFocused:y,isFocusVisible:y&&t.selectionManager.isFocused&&$p(),isSelected:o,isDisabled:a,isPressed:v,allowsSelection:x,hasAction:b}}function PC(e){let{heading:t,"aria-label":n}=e,r=es();return{itemProps:{role:`presentation`},headingProps:t?{id:r,role:`presentation`,onMouseDown:e=>{e.preventDefault()}}:{},groupProps:{role:`group`,"aria-label":n,"aria-labelledby":t?r:void 0}}}var FC=class{constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let t=e=>{if(this.keyMap.set(e.key,e),e.childNodes&&e.type===`section`)for(let n of e.childNodes)t(n)};for(let n of e)t(n);let n=null,r=0,i=0;for(let[e,t]of this.keyMap)n?(n.nextKey=e,t.prevKey=n.key):(this.firstKey=e,t.prevKey=void 0),t.type===`item`&&(t.index=r++),(t.type===`section`||t.type===`item`)&&i++,n=t,n.nextKey=void 0;this._size=i,this.lastKey=n?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey??null:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}getChildren(e){return this.keyMap.get(e)?.childNodes||[]}};function IC(e){let{filter:t,layoutDelegate:n}=e,r=Hx(e),i=(0,v.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),a=Bx(e,(0,v.useCallback)(e=>t?new FC(t(e)):new FC(e),[t]),(0,v.useMemo)(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning])),o=(0,v.useMemo)(()=>new Px(a,r,{layoutDelegate:n}),[a,r,n]);return RC(a,o),{collection:a,disabledKeys:i,selectionManager:o}}function LC(e,t){let n=(0,v.useMemo)(()=>t?e.collection.filter(t):e.collection,[e.collection,t]),r=e.selectionManager.withCollection(n);return RC(n,r),{collection:n,selectionManager:r,disabledKeys:e.disabledKeys}}function RC(e,t){let n=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&n.current){let r=n.current.getKeyAfter(t.focusedKey),i=null;for(;r!=null;){let a=e.getItem(r);if(a&&a.type===`item`&&!t.isDisabled(r)){i=r;break}r=n.current.getKeyAfter(r)}if(i==null)for(r=n.current.getKeyBefore(t.focusedKey);r!=null;){let a=e.getItem(r);if(a&&a.type===`item`&&!t.isDisabled(r)){i=r;break}r=n.current.getKeyBefore(r)}t.setFocusedKey(i)}n.current=e},[e,t])}var zC=(0,v.createContext)(null),BC=(0,v.createContext)(null),VC=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,zC);let n=(0,v.useContext)(BC);return n?v.createElement(UC,{state:n,props:e,listBoxRef:t}):v.createElement(Rv,{content:v.createElement(Xv,e)},n=>v.createElement(HC,{props:e,listBoxRef:t,collection:n}))});function HC({props:e,listBoxRef:t,collection:n}){e={...e,collection:n,children:null,items:null};let{layoutDelegate:r}=(0,v.useContext)(ny),i=IC({...e,layoutDelegate:r});return v.createElement(UC,{state:i,props:e,listBoxRef:t})}function UC({state:e,props:t,listBoxRef:n}){[t,n]=Ff(t,n,Jy);let{dragAndDropHooks:r,layout:i=`stack`,orientation:a=`vertical`,filter:o}=t,s=LC(e,o),{collection:c,selectionManager:l}=s,u=!!r?.useDraggableCollectionState,d=!!r?.useDroppableCollectionState,{direction:f}=rp(),{disabledBehavior:p,disabledKeys:m}=l,h=lx({usage:`search`,sensitivity:`base`}),{isVirtualized:g,layoutDelegate:_,dropTargetDelegate:y,CollectionRoot:b}=(0,v.useContext)(ny),x=(0,v.useMemo)(()=>t.keyboardDelegate||new sx({collection:c,collator:h,ref:n,disabledKeys:m,disabledBehavior:p,layout:i,orientation:a,direction:f,layoutDelegate:_}),[c,h,n,p,m,a,f,t.keyboardDelegate,i,_]),{listBoxProps:S}=MC({...t,shouldSelectOnPressUp:u||t.shouldSelectOnPressUp,keyboardDelegate:x,isVirtualized:g},s,n);(0,v.useRef)(u),(0,v.useRef)(d),(0,v.useEffect)(()=>{},[u,d]);let C,w,T,E=!1,D=null,O=(0,v.useRef)(null);if(u&&r){C=r.useDraggableCollectionState({collection:c,selectionManager:l,preview:r.renderDragPreview?O:void 0}),r.useDraggableCollection({},C,n);let e=r.DragPreview;D=r.renderDragPreview?v.createElement(e,{ref:O},r.renderDragPreview):null}if(d&&r){w=r.useDroppableCollectionState({collection:c,selectionManager:l});let e=r.dropTargetDelegate||y||new r.ListDropTargetDelegate(c,n,{orientation:a,layout:i,direction:f});T=r.useDroppableCollection({keyboardDelegate:x,dropTargetDelegate:e},w,n),E=w.isDropTarget({type:`root`})}let{focusProps:k,isFocused:A,isFocusVisible:j}=Jm(),M=s.collection.size===0,N={isDropTarget:E,isEmpty:M,isFocused:A,isFocusVisible:j,layout:t.layout||`stack`,orientation:a,state:s},P=Mf({...t,children:void 0,defaultClassName:`react-aria-ListBox`,values:N}),ee=null;M&&t.renderEmptyState&&(ee=v.createElement(`div`,{role:`option`,style:{display:`contents`}},t.renderEmptyState(N)));let F=W(t,{global:!0});return v.createElement(Sg,null,v.createElement(q.div,{...U(F,P,S,k,T?.collectionProps),ref:n,slot:t.slot||void 0,onScroll:t.onScroll,"data-drop-target":E||void 0,"data-empty":M||void 0,"data-focused":A||void 0,"data-focus-visible":j||void 0,"data-layout":t.layout||`stack`,"data-orientation":a},v.createElement(jf,{values:[[zC,t],[BC,s],[wC,{dragAndDropHooks:r,dragState:C,dropState:w}],[ab,{elementType:`div`}],[TC,{render:qC}],[Qv,{name:`ListBoxSection`,render:WC}]]},v.createElement(eb,null,v.createElement(b,{collection:c,scrollRef:n,persistedKeys:OC(l,r,w),renderDropIndicator:DC(r,w)}))),ee,D))}function WC(e,t,n,r=`react-aria-ListBoxSection`){let i=(0,v.useContext)(BC),{dragAndDropHooks:a,dropState:o}=(0,v.useContext)(wC),{CollectionBranch:s}=(0,v.useContext)(ny),[c,l]=If(),{headingProps:u,groupProps:d}=PC({heading:l,"aria-label":e[`aria-label`]??void 0}),f=Mf({...e,id:void 0,children:void 0,defaultClassName:r,values:void 0}),p=W(e,{global:!0});return delete p.id,v.createElement(q.section,{...U(p,f,d),ref:t},v.createElement(Zy.Provider,{value:{...u,ref:c}},v.createElement(s,{collection:i.collection,parent:n,renderDropIndicator:DC(a,o)})))}var GC=qv(Tv,WC),KC=Kv(wv,function(e,t,n){let r=Is(t),i=(0,v.useContext)(BC),{dragAndDropHooks:a,dragState:o,dropState:s}=(0,v.useContext)(wC),c=o&&!(o.isDisabled||o.selectionManager.isDisabled(n.key)),{optionProps:l,labelProps:u,descriptionProps:d,...f}=NC({key:n.key,"aria-label":e?.[`aria-label`]},i,r),{hoverProps:p,isHovered:m}=eh({isDisabled:!f.allowsSelection&&!f.hasAction&&!c,onHoverStart:n.props.onHoverStart,onHoverChange:n.props.onHoverChange,onHoverEnd:n.props.onHoverEnd}),{keyboardProps:h}=Sm(e),{focusProps:g}=cm(e),_=null;o&&a&&(_=a.useDraggableItem({key:n.key,hasAction:f.hasAction},o));let y=null;s&&a&&(y=a.useDroppableItem({target:{type:`item`,key:n.key,dropPosition:`on`}},s,r));let b=o&&o.isDragging(n.key),x=Mf({...e,id:void 0,children:e.children,defaultClassName:`react-aria-ListBoxItem`,values:{...f,isHovered:m,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,allowsDragging:!!o,isDragging:b,isDropTarget:y?.isDropTarget}});(0,v.useEffect)(()=>{n.textValue},[n.textValue]);let S=e.href?q.a:q.div,C=W(e,{global:!0});return delete C.id,delete C.onClick,e.href&&l.tabIndex==null&&(l.tabIndex=-1),v.createElement(S,{...U(C,x,l,p,h,g,_?.dragProps,y?.dropProps),ref:r,"data-allows-dragging":!!o||void 0,"data-selected":f.isSelected||void 0,"data-disabled":f.isDisabled||void 0,"data-hovered":m||void 0,"data-focused":f.isFocused||void 0,"data-focus-visible":f.isFocusVisible||void 0,"data-pressed":f.isPressed||void 0,"data-dragging":b||void 0,"data-drop-target":y?.isDropTarget||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode},v.createElement(jf,{values:[[sb,{slots:{[Af]:u,label:u,description:d}}],[nb,{isSelected:f.isSelected}]]},x.children))});function qC(e,t){t=Is(t);let{dragAndDropHooks:n,dropState:r}=(0,v.useContext)(wC),{dropIndicatorProps:i,isHidden:a,isDropTarget:o}=n.useDropIndicator(e,r,t);return a?null:v.createElement(YC,{...e,dropIndicatorProps:i,isDropTarget:o,ref:t})}function JC(e,t){let{dropIndicatorProps:n,isDropTarget:r,...i}=e,a=Mf({...i,defaultClassName:`react-aria-DropIndicator`,values:{isDropTarget:r}});return v.createElement(v.Fragment,null,v.createElement(q.div,{...n,...a,role:`option`,ref:t,"data-drop-target":r||void 0}))}var YC=(0,v.forwardRef)(JC);Kv(Cv,function(e,t,n){let r=(0,v.useContext)(BC),{isLoading:i,onLoadMore:a,scrollOffset:o,...s}=e,c=(0,v.useRef)(null);lc((0,v.useMemo)(()=>({onLoadMore:a,collection:r?.collection,sentinelRef:c,scrollOffset:o}),[a,o,r?.collection]),c);let l=Mf({...s,id:void 0,children:n.rendered,defaultClassName:`react-aria-ListBoxLoadingIndicator`,values:void 0});return v.createElement(v.Fragment,null,v.createElement(`div`,{style:{position:`relative`,width:0,height:0},inert:uc(!0)},v.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:c,style:{position:`absolute`,height:1,width:1}})),i&&l.children&&v.createElement(v.Fragment,null,v.createElement(q.div,{...U(W(e,{global:!0}),{tabIndex:-1}),...l,role:`option`,ref:t},l.children)))});function XC(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:a,fieldProps:o}=Kf(e),s=ns([!!t,!!n,r,i]),c=ns([!!t,!!n,r,i]);return o=U(o,{"aria-describedby":[s,c,e[`aria-describedby`]].filter(Boolean).join(` `)||void 0}),{labelProps:a,fieldProps:o,descriptionProps:{id:s},errorMessageProps:{id:c}}}var ZC=new WeakMap;function QC(e,t,n){let{keyboardDelegate:r,isDisabled:i,isRequired:a,name:o,form:s,validationBehavior:c=`aria`}=e,l=lx({usage:`search`,sensitivity:`base`}),u=(0,v.useMemo)(()=>r||new sx(t.collection,t.disabledKeys,n,l),[r,t.collection,t.disabledKeys,l,n]),{menuTriggerProps:d,menuProps:f}=Yb({isDisabled:i,type:`listbox`},t,n),{keyboardProps:p}=Sm({shortcuts:{ArrowLeft:()=>{if(t.selectionManager.selectionMode===`multiple`)return!1;let e=t.selectedKey==null?u.getFirstKey?.():u.getKeyAbove?.(t.selectedKey);e!=null&&t.setSelectedKey(e)},ArrowRight:()=>{if(t.selectionManager.selectionMode===`multiple`)return!1;let e=t.selectedKey==null?u.getFirstKey?.():u.getKeyBelow?.(t.selectedKey);e!=null&&t.setSelectedKey(e)}},allowRepeats:!0,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp}),{typeSelectProps:m}=rx({keyboardDelegate:u,selectionManager:t.selectionManager,onTypeSelect(e){t.setSelectedKey(e)}}),{isInvalid:h,validationErrors:g,validationDetails:_}=t.displayValidation,{labelProps:y,fieldProps:b,descriptionProps:x,errorMessageProps:S}=XC({...e,labelElementType:`span`,isInvalid:h,errorMessage:e.errorMessage||g});t.selectionManager.selectionMode===`multiple`&&(m={});let C=W(e,{labelable:!0}),w=U(m,d,b),T=es();return ZC.set(t,{isDisabled:i,isRequired:a,name:o,form:s,validationBehavior:c}),{labelProps:{...y,onClick:()=>{e.isDisabled||(n.current?.focus(),tm(`keyboard`))}},triggerProps:U(C,{...w,isDisabled:i,onKeyDown:rs(w.onKeyDown,p.onKeyDown),onKeyUp:p.onKeyUp,"aria-labelledby":[T,w[`aria-labelledby`],w[`aria-label`]&&!w[`aria-labelledby`]?w.id:null].filter(Boolean).join(` `),onFocus(n){t.isFocused||(e.onFocus&&e.onFocus(n),e.onFocusChange&&e.onFocusChange(!0),t.setFocused(!0))},onBlur(n){t.isOpen||(e.onBlur&&e.onBlur(n),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))}}),valueProps:{id:T},menuProps:{...f,onAction:void 0,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:`selection`,onBlur:n=>{ps(n.currentTarget,n.relatedTarget)||(e.onBlur&&e.onBlur(n),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))},"aria-labelledby":[b[`aria-labelledby`],w[`aria-label`]&&!b[`aria-labelledby`]?w.id:null].filter(Boolean).join(` `)},descriptionProps:x,errorMessageProps:S,isInvalid:h,validationErrors:g,validationDetails:_,hiddenSelectProps:{isDisabled:i,name:o,label:e.label,state:t,triggerRef:n,form:s}}}function $C(e,t,n){let{validationBehavior:r,focus:i}=e;Io(()=>{if(r===`native`&&n?.current&&`setCustomValidity`in n.current&&!n.current.disabled){let e=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(` `)||`Invalid value.`:``;n.current.setCustomValidity(e),n.current.hasAttribute(`title`)||(n.current.title=``),t.realtimeValidation.isInvalid||t.updateValidation(tw(n.current))}});let a=(0,v.useRef)(!1),o=Rs(()=>{a.current||t.resetValidation()}),s=Rs(e=>{t.displayValidation.isInvalid||t.commitValidation();let r=n?.current?.form;!e.defaultPrevented&&n&&r&&nw(r)===n.current&&(i?i():n.current?.focus(),tm(`keyboard`)),e.preventDefault()}),c=Rs(()=>{t.commitValidation()});(0,v.useEffect)(()=>{let e=n?.current;if(!e)return;let t=e.form,r=t?.reset;return t&&(t.reset=()=>{a.current=!window.event||window.event.type===`message`&&H(window.event)instanceof MessagePort,r?.call(t),a.current=!1}),e.addEventListener(`invalid`,s),e.addEventListener(`change`,c),t?.addEventListener(`reset`,o),()=>{e.removeEventListener(`invalid`,s),e.removeEventListener(`change`,c),t?.removeEventListener(`reset`,o),t&&(t.reset=r)}},[n,r])}function ew(e){let t=e.validity;return{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing,valid:t.valid}}function tw(e){return{isInvalid:!e.validity.valid,validationDetails:ew(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function nw(e){for(let t=0;tn.current?.focus()},t,e.selectRef);let d=t.setValue,f=(0,v.useCallback)(e=>{let t=H(e);t.multiple?d(Array.from(t.selectedOptions,e=>e.value)):d(e.currentTarget.value)},[d]);return{containerProps:{...u,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":`aria-hidden-focus`},inputProps:{style:{display:`none`}},selectProps:{tabIndex:-1,autoComplete:i,disabled:s,multiple:t.selectionManager.selectionMode===`multiple`,required:c===`native`&&l,name:a,form:o,value:t.value??``,onChange:f,onInput:f}}}function iw(e){let{state:t,triggerRef:n,label:r,name:i,form:a,isDisabled:o}=e,s=(0,v.useRef)(null),c=(0,v.useRef)(null),{containerProps:l,selectProps:u}=rw({...e,selectRef:t.collection.size<=300?s:c},t,n),d=Array.isArray(t.value)?t.value:[t.value];if(t.collection.size<=300)return v.createElement(`div`,{...l,"data-testid":`hidden-select-container`},v.createElement(`label`,null,r,v.createElement(`select`,{...u,ref:s},v.createElement(`option`,{value:``,label:`\xA0`},`\xA0`),[...t.collection.getKeys()].map(e=>{let n=t.collection.getItem(e);if(n&&n.type===`item`)return v.createElement(`option`,{key:n.key,value:n.key},n.textValue)}),t.collection.size===0&&i&&d.map((e,t)=>v.createElement(`option`,{key:t,value:e??``})))));if(i){let{validationBehavior:e}=ZC.get(t)||{};d.length===0&&(d=[null]);let n=d.map((t,n)=>{let r={type:`hidden`,autoComplete:u.autoComplete,name:i,form:a,disabled:o,value:t??``};return e===`native`?v.createElement(`input`,{key:n,...r,ref:n===0?c:null,style:{display:`none`},type:`text`,required:n===0&&u.required,onChange:()=>{}}):v.createElement(`input`,{key:n,...r,ref:n===0?c:null})});return v.createElement(v.Fragment,null,n)}return null}function aw(e){let{selectionMode:t=`single`,shouldCloseOnSelect:n=t===`single`}=e,r=gv(e),[i,a]=(0,v.useState)(null),o=(0,v.useMemo)(()=>e.defaultValue===void 0?t===`single`?e.defaultSelectedKey??null:[]:e.defaultValue,[e.defaultValue,e.defaultSelectedKey,t]),[s,c]=sh((0,v.useMemo)(()=>e.value===void 0?t===`single`?e.selectedKey:void 0:e.value,[e.value,e.selectedKey,t]),o,e.onChange),l=t===`single`&&Array.isArray(s)?s[0]:s,u=n=>{if(t===`single`){let t=Array.isArray(n)?n[0]??null:n;c(t),t!==l&&e.onSelectionChange?.(t)}else{let e=[];Array.isArray(n)?e=n:n!=null&&(e=[n]),c(e)}},d=IC({...e,selectionMode:t,disallowEmptySelection:t===`single`,allowDuplicateSelectionEvents:!0,selectedKeys:(0,v.useMemo)(()=>ow(l),[l]),onSelectionChange:e=>{if(e!==`all`){if(t===`single`){let t=e.values().next().value??null;u(t)}else u([...e]);n&&r.close(),m.commitValidation()}}}),f=d.selectionManager.firstSelectedKey,p=(0,v.useMemo)(()=>[...d.selectionManager.selectedKeys].map(e=>d.collection.getItem(e)).filter(e=>e!=null),[d.selectionManager.selectedKeys,d.collection]),m=PS({...e,value:Array.isArray(l)&&l.length===0?null:l}),[h,g]=(0,v.useState)(!1),[_]=(0,v.useState)(l);return{...m,...d,...r,value:l,defaultValue:o??_,setValue:u,selectedKey:f,setSelectedKey:u,selectedItem:p[0]??null,selectedItems:p,defaultSelectedKey:e.defaultSelectedKey??(e.selectionMode===`single`?_:null),focusStrategy:i,open(t=null){(d.collection.size!==0||e.allowsEmptyCollection)&&(a(t),r.open())},toggle(t=null){(d.collection.size!==0||e.allowsEmptyCollection)&&(a(t),r.toggle())},isFocused:h,setFocused:g}}function ow(e){if(e!==void 0)return e===null?[]:Array.isArray(e)?e:[e]}function sw(e={}){let{locale:t}=rp();return(0,v.useMemo)(()=>new Intl.ListFormat(t,e),[t,e])}function cw(e){return e&&e.__esModule?e.default:e}var lw=(0,v.createContext)(null),uw=(0,v.createContext)(null),dw=Hf(function(e,t){[e,t]=Ff(e,t,lw);let{children:n,isDisabled:r=!1,isInvalid:i=!1,isRequired:a=!1}=e,o=(0,v.useMemo)(()=>typeof n==`function`?n({isOpen:!1,isDisabled:r,isInvalid:i,isRequired:a,isFocused:!1,isFocusVisible:!1,defaultChildren:null}):n,[n,r,i,a]);return v.createElement(Rv,{content:o},n=>v.createElement(pw,{props:e,collection:n,selectRef:t}))}),fw=[Wf,th,sb];function pw({props:e,selectRef:t,collection:n}){let{validationBehavior:r}=Pf(VS)||{},i=e.validationBehavior??r??`native`,a=aw({...e,collection:n,children:void 0,validationBehavior:i}),{isFocusVisible:o,focusProps:s}=Jm({within:!0}),c=(0,v.useRef)(null),[l,u]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),{labelProps:d,triggerProps:f,valueProps:p,menuProps:m,descriptionProps:h,errorMessageProps:g,hiddenSelectProps:_,...y}=QC({...Lf(e),label:u,validationBehavior:i},a,c),b=(0,v.useMemo)(()=>({isOpen:a.isOpen,isFocused:a.isFocused,isFocusVisible:o,isDisabled:e.isDisabled||!1,isInvalid:y.isInvalid||!1,isRequired:e.isRequired||!1}),[a.isOpen,a.isFocused,o,e.isDisabled,y.isInvalid,e.isRequired]),x=Mf({...e,values:b,defaultClassName:`react-aria-Select`}),S=W(e,{global:!0});delete S.id;let C=(0,v.useRef)(null);return v.createElement(jf,{values:[[lw,e],[uw,a],[mw,p],[Wf,{...d,ref:l,elementType:`span`}],[th,{...f,ref:c,isPressed:a.isOpen,autoFocus:e.autoFocus}],[cS,a],[_v,{trigger:`Select`,triggerRef:c,scrollRef:C,placement:`bottom start`,"aria-labelledby":m[`aria-labelledby`],clearContexts:fw}],[zC,{...m,ref:C}],[BC,a],[sb,{slots:{description:h,errorMessage:g}}],[OS,y]]},v.createElement(q.div,{...U(S,x,s),ref:t,slot:e.slot||void 0,"data-focused":a.isFocused||void 0,"data-focus-visible":o||void 0,"data-open":a.isOpen||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":y.isInvalid||void 0,"data-required":e.isRequired||void 0},x.children,v.createElement(iw,{..._,autoComplete:e.autoComplete})))}var mw=(0,v.createContext)(null),hw=Hf(function(e,t){[e,t]=Ff(e,t,mw);let n=(0,v.useContext)(uw),{placeholder:r}=Pf(lw),i=n.selectedItems.map(e=>{let t=e.props?.children;return typeof t==`function`&&(t=t({isHovered:!1,isPressed:!1,isSelected:!1,isFocused:!1,isFocusVisible:!1,isDisabled:!1,selectionMode:`single`,selectionBehavior:`toggle`})),t}),a=sw(),o=(0,v.useMemo)(()=>n.selectedItems.map(e=>e?.textValue),[n.selectedItems]),s=n.selectionManager.selectionMode,c=(0,v.useMemo)(()=>s===`single`?o[0]??``:a.format(o),[s,a,o]),l=(0,v.useMemo)(()=>{if(s===`single`)return i[0];let e=a.formatToParts(o);if(e.length===0)return null;let t=0;return e.map(e=>e.type===`element`?v.createElement(v.Fragment,{key:t},i[t++]):e.value)},[s,a,o,i]),u=rv(cw(CC),`react-aria-components`),d=Mf({...e,defaultChildren:l??r??u.format(`selectPlaceholder`),defaultClassName:`react-aria-SelectValue`,values:{selectedItem:n.selectedItems[0]?.value??null,selectedItems:(0,v.useMemo)(()=>n.selectedItems.map(e=>e.value??null),[n.selectedItems]),selectedText:c,isPlaceholder:n.selectedItems.length===0,state:n}}),f=W(e,{global:!0});return v.createElement(q.span,{ref:t,...f,...d,"data-placeholder":n.selectedItems.length===0||void 0},v.createElement(sb.Provider,{value:void 0},d.children))}),gw=(0,v.createContext)(!1),_w=e=>{let t=(0,v.use)(gw),n=(0,v.use)(sb);return!t||n?.slots?.[e]!=null},vw=({children:e})=>(0,G.jsx)(gw,{value:!0,children:e}),yw=(0,v.createContext)({triggerRef:{current:null},clearButtonRef:{current:null},isDisabled:!1}),bw=({children:e,className:t,fullWidth:n,isDisabled:r,onClear:i,variant:a,...o})=>{let s=v.useMemo(()=>Vd({fullWidth:n,variant:a}),[n,a]),c=(0,v.useRef)(null),l=(0,v.useRef)(null);return(0,G.jsx)(vw,{children:(0,G.jsx)(yw,{value:{slots:s,triggerRef:c,clearButtonRef:l,onClear:i,isDisabled:r},children:(0,G.jsx)(dw,{"data-slot":`autocomplete`,...o,className:J(t,s?.base()),isDisabled:r,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})})},xw=({children:e,className:t,isDisabled:n,onClick:r,ref:i,...a})=>{let{clearButtonRef:o,isDisabled:s,slots:c,triggerRef:l}=(0,v.use)(yw),u=(0,v.use)(uw),d=n??s??!1,f=Uf(),p=ys(v.useCallback(e=>{l.current=e},[l]),i);return f?null:(0,G.jsx)(DS,{ref:p,className:J(t,c?.trigger()),"data-slot":`autocomplete-trigger`,isDisabled:d,onClick:e=>{o.current?.contains(e.target)||(r?.(e),u?.toggle())},...a,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})};xw.displayName=`AutocompleteTrigger`;var Sw=Object.assign(bw,{Root:bw,Trigger:xw,Value:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(yw);return(0,G.jsx)(hw,{className:J(t,r?.value()),"data-slot":`autocomplete-value`,...n,children:e})},Indicator:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(yw),i=(0,v.use)(uw),a=e&&v.isValidElement(e)?v.cloneElement(e,{...n,className:Y(r?.indicator,t),"data-slot":`autocomplete-indicator`,"data-open":yh(i?.isOpen)}):(0,G.jsx)(bh,{className:Y(r?.indicator,t),"data-open":yh(i?.isOpen),"data-slot":`autocomplete-default-indicator`,...n});return(0,G.jsx)(nh,{children:a})},Popover:({children:e,className:t,placement:n=`bottom`,style:r,...i})=>{let{slots:a,triggerRef:o}=(0,v.use)(yw),[s,c]=(0,v.useState)(null);return Hs({ref:o,onResize:(0,v.useCallback)(()=>{o.current&&c(o.current.offsetWidth+`px`)},[o])}),(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(yv,{...i,className:J(t,a?.popover()),"data-slot":`autocomplete-popover`,placement:n,triggerRef:o,style:{"--trigger-width":s,...typeof r==`object`&&r?r:{}},children:e})})},Filter:({children:e,...t})=>(0,G.jsx)(Xy,{"data-slot":`autocomplete-filter`,...t,children:e}),ClearButton:({className:e,onClick:t,ref:n,...r})=>{let{clearButtonRef:i,isDisabled:a,onClear:o,slots:s}=(0,v.use)(yw),c=(0,v.use)(uw),l=ys(v.useCallback(e=>{i.current=e},[i]),n),u=e=>{c?.selectionManager.setSelectedKeys(new Set),o?.(),t?.(e)},d=c?.selectionManager.selectedKeys.size===0;return(0,G.jsx)(K.button,{ref:l,"aria-hidden":d||void 0,"aria-label":`Clear selection`,className:s?.clearButton({className:e}),"data-empty":yh(d),"data-slot":`autocomplete-clear-button`,disabled:a??!1,tabIndex:-1,type:`button`,onClick:u,...r,children:(0,G.jsx)(wh,{"data-slot":`autocomplete-clear-button-icon`})})}});function Cw(e,t,n){let{isSelected:r}=t,{isPressed:i,buttonProps:a}=Km({...e,onPress:rs(t.toggle,e.onPress)},n);return{isPressed:i,isSelected:r,isDisabled:e.isDisabled||!1,buttonProps:U(a,{"aria-pressed":r})}}function ww(e,t){let{"aria-label":n,"aria-labelledby":r,orientation:i=`horizontal`}=e,[a,o]=(0,v.useState)(!1);Io(()=>{o(!!(t.current&&t.current.parentElement?.closest(`[role="toolbar"]`)))});let{direction:s}=rp(),c=s===`rtl`&&i===`horizontal`,l=Ug(t),u=e=>{if(ps(e.currentTarget,H(e))){if(i===`horizontal`&&e.key===`ArrowRight`||i===`vertical`&&e.key===`ArrowDown`)c?l.focusPrevious():l.focusNext();else if(i===`horizontal`&&e.key===`ArrowLeft`||i===`vertical`&&e.key===`ArrowUp`)c?l.focusNext():l.focusPrevious();else if(e.key===`Tab`){d.current=ms(),e.shiftKey?l.focusFirst():l.focusLast();return}else return;e.stopPropagation(),e.preventDefault()}},d=(0,v.useRef)(null),f=e=>{!ps(e.currentTarget,e.relatedTarget)&&!d.current&&(d.current=H(e))},p=e=>{d.current&&!ps(e.currentTarget,e.relatedTarget)&&ps(t.current,H(e))&&(d.current?.focus(),d.current=null)};return{toolbarProps:{...W(e,{labelable:!0}),role:a?`group`:`toolbar`,"aria-orientation":i,"aria-label":n,"aria-labelledby":n==null?r:void 0,onKeyDownCapture:a?void 0:u,onFocusCapture:a?void 0:p,onBlurCapture:a?void 0:f}}}function Tw(e,t,n){let{isDisabled:r}=e,{toolbarProps:i}=ww(e,n);return{groupProps:{...i,role:t.selectionMode===`single`?`radiogroup`:i.role,"aria-disabled":r}}}function Ew(e,t,n){let r={isSelected:t.selectedKeys.has(e.id),defaultSelected:!1,setSelected(n){t.setSelected(e.id,n)},toggle(){t.toggleKey(e.id)}},{isPressed:i,isSelected:a,isDisabled:o,buttonProps:s}=Cw({...e,id:void 0,isDisabled:e.isDisabled||t.isDisabled},r,n);return t.selectionMode===`single`&&(s.role=`radio`,s[`aria-checked`]=r.isSelected,delete s[`aria-pressed`]),{isPressed:i,isSelected:a,isDisabled:o,buttonProps:s}}function Dw(e){let{selectionMode:t=`single`,disallowEmptySelection:n,isDisabled:r=!1}=e,[i,a]=sh((0,v.useMemo)(()=>e.selectedKeys?new Set(e.selectedKeys):void 0,[e.selectedKeys]),(0,v.useMemo)(()=>e.defaultSelectedKeys?new Set(e.defaultSelectedKeys):new Set,[e.defaultSelectedKeys]),e.onSelectionChange);return{selectionMode:t,isDisabled:r,selectedKeys:i,setSelectedKeys:a,toggleKey(e){let r;t===`multiple`?(r=new Set(i),r.has(e)&&(!n||r.size>1)?r.delete(e):r.add(e)):r=new Set(i.has(e)&&!n?[]:[e]),a(r)},setSelected(e,t){t!==i.has(e)&&this.toggleKey(e)}}}var Ow=(0,v.createContext)({}),kw=(0,v.createContext)(null),Aw=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,Ow);let n=Dw(e),{groupProps:r}=Tw(e,n,t),i=Mf({...e,values:{orientation:e.orientation||`horizontal`,isDisabled:n.isDisabled,state:n},defaultClassName:`react-aria-ToggleButtonGroup`}),a=W(e,{global:!0});return v.createElement(q.div,{...U(a,i,r),ref:t,slot:e.slot||void 0,"data-orientation":e.orientation||`horizontal`,"data-disabled":e.isDisabled||void 0},v.createElement(kw.Provider,{value:n},v.createElement(eb,null,i.children)))});function jw(e={}){let{isReadOnly:t}=e,[n,r]=sh(e.isSelected,e.defaultSelected||!1,e.onChange),[i]=(0,v.useState)(n);function a(e){t||r(e)}function o(){t||r(!n)}return{isSelected:n,defaultSelected:e.defaultSelected??i,setSelected:a,toggle:o}}var Mw=(0,v.createContext)({}),Nw=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,Mw);let n=(0,v.useContext)(kw),r=jw(n&&e.id!=null?{isSelected:n.selectedKeys.has(e.id),onChange(t){n.setSelected(e.id,t)}}:e),{buttonProps:i,isPressed:a,isSelected:o,isDisabled:s}=n&&e.id!=null?Ew({...e,id:e.id},n,t):Cw({...e,id:e.id==null?void 0:String(e.id)},r,t),{focusProps:c,isFocused:l,isFocusVisible:u}=Jm(e),{hoverProps:d,isHovered:f}=eh({...e,isDisabled:s}),p=Mf({...e,id:void 0,values:{isHovered:f,isPressed:a,isFocused:l,isSelected:r.isSelected,isFocusVisible:u,isDisabled:s,state:r},defaultClassName:`react-aria-ToggleButton`}),m=W(e,{global:!0});return delete m.id,delete m.onClick,v.createElement(q.button,{...U(m,p,i,c,d),ref:t,slot:e.slot||void 0,"data-focused":l||void 0,"data-disabled":s||void 0,"data-pressed":a||void 0,"data-selected":o||void 0,"data-hovered":f||void 0,"data-focus-visible":u||void 0},v.createElement(nb.Provider,{value:{isSelected:o}},p.children))}),Pw=(0,v.createContext)({}),Fw=`__button_group_child`,Iw=({children:e,className:t,fullWidth:n,isDisabled:r,isIconOnly:i,size:a,slot:o,style:s,variant:c,[Fw]:l,...u})=>{let d=(0,v.use)(Pw),f=l===!0,p=a??(f?d?.size:void 0),m=c??(f?d?.variant:void 0),h=r??(f?d?.isDisabled:void 0),g=Hd({fullWidth:n??(f?d?.fullWidth:void 0),isIconOnly:i,size:p,variant:m});return(0,G.jsx)(nh,{className:J(t,g),"data-slot":`button`,isDisabled:h,slot:o,style:s,...u,children:t=>typeof e==`function`?e(t):e})},X=Object.assign(Iw,{Root:Iw}),Lw=(0,v.createContext)({}),Rw=({children:e,className:t,variant:n=`default`,...r})=>{let i=v.useMemo(()=>Gd({variant:n}),[n]),a=(0,G.jsx)(K.div,{className:i.base({className:t}),"data-slot":`card`,...r,children:e});return(0,G.jsx)(Lw,{value:{slots:i},children:n===`transparent`?a:(0,G.jsx)(Nh,{value:{variant:n},children:a})})},zw=Object.assign(Rw,{Root:Rw,Header:({className:e,...t})=>{let{slots:n}=(0,v.use)(Lw);return(0,G.jsx)(K.div,{className:Y(n?.header,e),"data-slot":`card-header`,...t})},Title:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(Lw);return(0,G.jsx)(K.h3,{className:Y(r?.title,t),"data-slot":`card-title`,...n,children:e})},Description:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(Lw);return(0,G.jsx)(K.p,{className:Y(r?.description,t),"data-slot":`card-description`,...n,children:e})},Content:({className:e,...t})=>{let{slots:n}=(0,v.use)(Lw);return(0,G.jsx)(K.div,{className:Y(n?.content,e),"data-slot":`card-content`,...t})},Footer:({className:e,...t})=>{let{slots:n}=(0,v.use)(Lw);return(0,G.jsx)(K.div,{className:Y(n?.footer,e),"data-slot":`card-footer`,...t})}}),Bw=new WeakMap;function Vw(e=!0){let[t,n]=(0,v.useState)(e),r=(0,v.useRef)(!1),i=(0,v.useCallback)(e=>{r.current=!0,n(!!e)},[]);return Io(()=>{r.current||n(!1)},[]),[i,t]}function Hw(e=!0){let t=es(),[n,r]=Vw(e);return{id:r?t:void 0,ref:n}}function Uw(e,t,n){let{isDisabled:r=!1,isReadOnly:i=!1,value:a,name:o,form:s,children:c,isRequired:l,validationBehavior:u=`aria`,"aria-label":d,"aria-labelledby":f,"aria-describedby":p,onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:y,onClick:b}=e,x=PS({...e,value:t.isSelected}),{isInvalid:S,validationErrors:C,validationDetails:w}=x.displayValidation;$C(e,x,n);let T=e=>{e.stopPropagation(),t.setSelected(H(e).checked)},{pressProps:E,isPressed:D}=Rm({onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:y,onClick:b,isDisabled:r}),[O,k]=(0,v.useState)(!1),{pressProps:A}=Rm({onPressStart(e){if(e.pointerType===`keyboard`||e.pointerType===`virtual`){e.continuePropagation();return}m?.(e),g?.(!0),k(!0)},onPressEnd(e){if(e.pointerType===`keyboard`||e.pointerType===`virtual`){e.continuePropagation();return}h?.(e),g?.(!1),k(!1)},onPressUp(e){if(e.pointerType===`keyboard`||e.pointerType===`virtual`){e.continuePropagation();return}y?.(e)},onClick:b,onPress(r){if(r.pointerType===`keyboard`||r.pointerType===`virtual`){r.continuePropagation();return}_?.(r),t.toggle(),n.current?.focus();let{[NS]:i}=e,{commitValidation:a}=i||x;a()},isDisabled:r||i}),{focusableProps:j}=Em(e,n),M=U(E,j),N=W(e,{labelable:!0});cc(n,t.defaultSelected,t.setSelected);let P=Hw(),ee=Hw();return{labelProps:U(A,{onClick:e=>e.preventDefault()}),inputProps:U(N,{checked:t.isSelected,"aria-required":l&&u===`aria`||void 0,required:l&&u===`native`,"aria-invalid":S||e.validationState===`invalid`||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-controls":e[`aria-controls`],"aria-readonly":i||void 0,"aria-describedby":[P.id,ee.id,p].filter(Boolean).join(` `)||void 0,onChange:T,disabled:r,...a==null?{}:{value:a},name:o,form:s,type:`checkbox`,...M}),descriptionProps:P,errorMessageProps:ee,isSelected:t.isSelected,isPressed:D||O,isDisabled:r,isReadOnly:i,isInvalid:S||e.validationState===`invalid`,validationErrors:C,validationDetails:w}}function Ww(e,t,n){let{labelProps:r,inputProps:i,descriptionProps:a,errorMessageProps:o,isSelected:s,isPressed:c,isDisabled:l,isReadOnly:u,isInvalid:d,validationErrors:f,validationDetails:p}=Uw(e,t,n),{isIndeterminate:m}=e;return(0,v.useEffect)(()=>{n.current&&(n.current.indeterminate=!!m)}),{labelProps:U(r,(0,v.useMemo)(()=>({onMouseDown:e=>e.preventDefault()}),[])),inputProps:i,descriptionProps:a,errorMessageProps:o,isSelected:s,isPressed:c,isDisabled:l,isReadOnly:u,isInvalid:d,validationErrors:f,validationDetails:p}}function Gw(e,t,n){let r=jw({isReadOnly:e.isReadOnly||t.isReadOnly,isSelected:t.isSelected(e.value),defaultSelected:t.defaultValue.includes(e.value),onChange(n){n?t.addValue(e.value):t.removeValue(e.value),e.onChange&&e.onChange(n)}}),{name:i,form:a,descriptionId:o,errorMessageId:s,validationBehavior:c}=Bw.get(t);c=e.validationBehavior??c;let{realtimeValidation:l}=PS({...e,value:r.isSelected,name:void 0,validationBehavior:`aria`}),u=(0,v.useRef)(jS),d=()=>{t.setInvalid(e.value,l.isInvalid?l:u.current)};(0,v.useEffect)(d);let f=t.realtimeValidation.isInvalid?t.realtimeValidation:l,p=c===`native`?t.displayValidation:f,m=Ww({...e,isReadOnly:e.isReadOnly||t.isReadOnly,isDisabled:e.isDisabled||t.isDisabled,name:e.name||i,form:e.form||a,isRequired:e.isRequired??t.isRequired,validationBehavior:c,[NS]:{realtimeValidation:f,displayValidation:p,resetValidation:t.resetValidation,commitValidation:t.commitValidation,updateValidation(e){u.current=e,d()}}},r,n);return{...m,inputProps:{...m.inputProps,"aria-describedby":[m.inputProps[`aria-describedby`],t.isInvalid?s:null,o].filter(Boolean).join(` `)||void 0}}}var Kw=(0,v.createContext)(null),qw=(0,v.createContext)(null),Jw=(0,v.createContext)(null),Yw=(0,v.createContext)(null),Xw=(0,v.forwardRef)(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=Ff(r,t,qw);let i=(0,v.useContext)(Jw),[a,o]=Zw(e,n),{descriptionProps:s,errorMessageProps:c,isSelected:l,isDisabled:u,isReadOnly:d,isInvalid:f,validationDetails:p,validationErrors:m}=a,h=Mf({...e,defaultClassName:`react-aria-CheckboxField`,values:{isSelected:l,isIndeterminate:e.isIndeterminate||!1,isDisabled:u,isReadOnly:d,isInvalid:f,isRequired:e.isRequired||!1}}),g=W(e,{global:!0});return delete g.id,delete g.onClick,v.createElement(q.div,{...U(g,h),ref:t,slot:e.slot||void 0,"data-selected":l||void 0,"data-indeterminate":e.isIndeterminate||void 0,"data-disabled":u||void 0,"data-readonly":d||void 0,"data-invalid":f||void 0,"data-required":e.isRequired||void 0},v.createElement(jf,{values:[[Yw,{...a,inputRef:o,defaultClassName:`react-aria-CheckboxButton`,isIndeterminate:e.isIndeterminate,isRequired:e.isRequired}],[sb,{slots:{description:s,errorMessage:c}}],[OS,i?null:{isInvalid:f,validationDetails:p,validationErrors:m}]]},h.children))});function Zw(e,t){let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,i=(0,v.useContext)(Jw),a=Is((0,v.useMemo)(()=>ys(t,e.inputRef===void 0?null:e.inputRef),[t,e.inputRef])),o={...Lf(e),children:typeof e.children==`function`||e.children,value:e.value,validationBehavior:r};return[i?Gw(o,i,a):Ww(o,jw(e),a),a]}var Qw=(0,v.forwardRef)(function(e,t){let{labelProps:n,inputProps:r,isSelected:i,isDisabled:a,isReadOnly:o,isPressed:s,isInvalid:c,inputRef:l,defaultClassName:u,isIndeterminate:d,isRequired:f}=(0,v.useContext)(Yw),{isFocused:p,isFocusVisible:m,focusProps:h}=Jm(),g=a||o,{hoverProps:_,isHovered:y}=eh({...e,isDisabled:g}),b=Mf({...e,defaultClassName:u,values:{isSelected:i,isIndeterminate:d||!1,isPressed:s,isHovered:y,isFocused:p,isFocusVisible:m,isDisabled:a,isReadOnly:o,isInvalid:c,isRequired:f||!1}}),x=W(e,{global:!0});return delete x.id,delete x.onClick,v.createElement(q.label,{...U(x,n,_,b),ref:t,slot:e.slot||void 0,"data-selected":i||void 0,"data-indeterminate":d||void 0,"data-pressed":s||void 0,"data-hovered":y||void 0,"data-focused":p||void 0,"data-focus-visible":m||void 0,"data-disabled":a||void 0,"data-readonly":o||void 0,"data-invalid":c||void 0,"data-required":f||void 0},v.createElement(ov,{elementType:`span`},v.createElement(`input`,{...U(r,h),ref:l})),b.children)}),$w=(0,v.createContext)({}),eT=(0,v.createContext)({}),tT=({children:e,className:t,variant:n,...r})=>{let i=(0,v.use)($w),a=n??i.variant,o=v.useMemo(()=>Kd({variant:a}),[a]);return(0,G.jsx)(Xw,{"data-slot":`checkbox`,...r,className:J(t,o.base()),children:t=>(0,G.jsx)(eT,{value:{slots:o,state:t},children:typeof e==`function`?e(t):e})})};tT.displayName=`HeroUI.Checkbox`;var nT=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(eT);return(0,G.jsx)(Qw,{"data-slot":`checkbox-content`,...n,className:J(t,r?.content()),children:e})};nT.displayName=`HeroUI.Checkbox.Content`;var rT=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(eT);return(0,G.jsx)(K.span,{className:Y(r?.control,t),"data-slot":`checkbox-control`,...n,children:e})};rT.displayName=`HeroUI.Checkbox.Control`;var iT=({children:e,className:t,...n})=>{let{slots:r,state:i}=(0,v.use)(eT),a=i?.isSelected,o=i?.isIndeterminate,s=typeof e==`function`?e(i??{}):e||(o?(0,G.jsx)(`svg`,{"aria-hidden":`true`,"data-slot":`checkbox-default-indicator--indeterminate`,fill:`none`,role:`presentation`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:3,viewBox:`0 0 24 24`,children:(0,G.jsx)(`line`,{x1:`21`,x2:`3`,y1:`12`,y2:`12`})}):(0,G.jsx)(`svg`,{"aria-hidden":`true`,"data-slot":`checkbox-default-indicator--checkmark`,fill:`none`,role:`presentation`,stroke:`currentColor`,strokeDasharray:22,strokeDashoffset:a?44:66,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 17 18`,children:(0,G.jsx)(`polyline`,{points:`1 9 7 14 15 4`})}));return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(r?.indicator,t),"data-slot":`checkbox-indicator`,...n,children:s})};iT.displayName=`HeroUI.Checkbox.Indicator`;var aT=Object.assign(tT,{Root:tT,Content:nT,Control:rT,Indicator:iT}),oT=(0,v.createContext)({}),sT=({children:e,className:t,color:n,size:r,variant:i,...a})=>{let o=v.useMemo(()=>qd({color:n,size:r,variant:i}),[n,r,i]),s=v.useMemo(()=>typeof e==`string`||typeof e==`number`?(0,G.jsx)(cT,{children:e}):e,[e]);return(0,G.jsx)(oT,{value:{slots:o},children:(0,G.jsx)(K.span,{...a,className:Y(o.base,t),"data-slot":`chip`,children:s})})},cT=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(oT);return(0,G.jsx)(K.span,{className:Y(r?.label,t),"data-slot":`chip-label`,...n,children:e})},lT=Object.assign(sT,{Root:sT,Label:cT});function uT(e){let{onMoveStart:t,onMove:n,onMoveEnd:r}=e,i=(0,v.useRef)({didMove:!1,lastPosition:null,id:null}),{addGlobalListener:a,removeGlobalListener:o}=Ps(),s=Rs((0,v.useCallback)((e,r,a,o)=>{(a!==0||o!==0)&&(i.current.didMove||(i.current.didMove=!0,t?.({type:`movestart`,pointerType:r,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})),n?.({type:`move`,pointerType:r,deltaX:a,deltaY:o,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey}))},[t,n,i])),c=Rs((0,v.useCallback)((e,t)=>{jm(),i.current.didMove&&r?.({type:`moveend`,pointerType:t,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})},[r,i]));return{moveProps:(0,v.useMemo)(()=>{let e={},t=()=>{Am(),i.current.didMove=!1};{let n=e=>{if(e.pointerId===i.current.id){let t=e.pointerType||`mouse`;s(e,t,e.pageX-(i.current.lastPosition?.pageX??0),e.pageY-(i.current.lastPosition?.pageY??0)),i.current.lastPosition={pageX:e.pageX,pageY:e.pageY}}},r=e=>{if(e.pointerId===i.current.id){let t=e.pointerType||`mouse`;c(e,t),i.current.id=null;let a=as(H(e));o(a,`pointermove`,n,!1),o(a,`pointerup`,r,!1),o(a,`pointercancel`,r,!1)}};e.onPointerDown=e=>{if(e.button===0&&i.current.id==null){t(),e.stopPropagation(),e.preventDefault(),i.current.lastPosition={pageX:e.pageX,pageY:e.pageY},i.current.id=e.pointerId;let o=as(H(e));a(o,`pointermove`,n,!1),a(o,`pointerup`,r,!1),a(o,`pointercancel`,r,!1)}}}let n=(e,n,r)=>{t(),s(e,`keyboard`,n,r),c(e,`keyboard`)};return e.onKeyDown=e=>{switch(e.key){case`Left`:case`ArrowLeft`:e.preventDefault(),e.stopPropagation(),n(e,-1,0);break;case`Right`:case`ArrowRight`:e.preventDefault(),e.stopPropagation(),n(e,1,0);break;case`Up`:case`ArrowUp`:e.preventDefault(),e.stopPropagation(),n(e,0,-1);break;case`Down`:case`ArrowDown`:e.preventDefault(),e.stopPropagation(),n(e,0,1)}},e},[a,o,i])}}var dT=(0,v.createContext)({}),fT=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i},pT=Hf(function(e,t){[e,t]=Ff(e,t,dT);let{hoverProps:n,isHovered:r}=eh({...e,isDisabled:e.disabled}),{isFocused:i,isFocusVisible:a,focusProps:o}=Jm({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,c=Mf({...e,values:{isHovered:r,isFocused:i,isFocusVisible:a,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:`react-aria-Input`});return v.createElement(q.input,{...U(fT(e),o,n),...c,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":a||void 0,"data-invalid":s||void 0})});function mT(e,t){let{inputElementType:n=`input`,isDisabled:r=!1,isRequired:i=!1,isReadOnly:a=!1,type:o=`text`,validationBehavior:s=`aria`}=e,[c,l]=sh(e.value,e.defaultValue||``,e.onChange),{focusableProps:u}=Em(e,t),d=PS({...e,value:c}),{isInvalid:f,validationErrors:p,validationDetails:m}=d.displayValidation,{labelProps:h,fieldProps:g,descriptionProps:_,errorMessageProps:y}=XC({...e,isInvalid:f,errorMessage:e.errorMessage||p}),b=W(e,{labelable:!0}),x={type:o,pattern:e.pattern},[S]=(0,v.useState)(c);return cc(t,e.defaultValue??S,l),$C(e,d,t),{labelProps:h,inputProps:U(b,n===`input`?x:void 0,{disabled:r,readOnly:a,required:i&&s===`native`,"aria-required":i&&s===`aria`||void 0,"aria-invalid":f||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-activedescendant":e[`aria-activedescendant`],"aria-autocomplete":e[`aria-autocomplete`],"aria-haspopup":e[`aria-haspopup`],"aria-controls":e[`aria-controls`],value:c,onChange:e=>l(H(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,enterKeyHint:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...u,...g}),descriptionProps:_,errorMessageProps:y,isInvalid:f,validationErrors:p,validationDetails:m}}function hT(){return typeof window<`u`&&window.InputEvent&&typeof InputEvent.prototype.getTargetRanges==`function`}function gT(e,t,n){let r=Rs(e=>{let r=n.current;if(!r)return;let i=null;switch(e.inputType){case`historyUndo`:case`historyRedo`:return;case`insertLineBreak`:return;case`deleteContent`:case`deleteByCut`:case`deleteByDrag`:i=r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteContentForward`:i=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd+1):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteContentBackward`:i=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart-1)+r.value.slice(r.selectionStart):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteSoftLineBackward`:case`deleteHardLineBackward`:i=r.value.slice(r.selectionStart);break;default:e.data!=null&&(i=r.value.slice(0,r.selectionStart)+e.data+r.value.slice(r.selectionEnd))}(i==null||!t.validate(i))&&e.preventDefault()});(0,v.useEffect)(()=>{if(!hT()||!n.current)return;let e=n.current;return e.addEventListener(`beforeinput`,r,!1),()=>{e.removeEventListener(`beforeinput`,r,!1)}},[n]);let i=hT()?null:e=>{let n=H(e).value.slice(0,H(e).selectionStart)+e.data+H(e).value.slice(H(e).selectionEnd);t.validate(n)||e.preventDefault()},{labelProps:a,inputProps:o,descriptionProps:s,errorMessageProps:c,...l}=mT(e,n),u=(0,v.useRef)(null);return{inputProps:U(o,{onBeforeInput:i,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:r}=n.current;u.current={value:e,selectionStart:t,selectionEnd:r}},onCompositionEnd(){if(n.current&&!t.validate(n.current.value)){let{value:e,selectionStart:r,selectionEnd:i}=u.current;n.current.value=e,n.current.setSelectionRange(r,i),t.setInputValue(e)}}}),labelProps:a,descriptionProps:s,errorMessageProps:c,...l}}function _T(e,t){let{onScroll:n,isDisabled:r}=e,i=(0,v.useCallback)(e=>{e.ctrlKey||(e.preventDefault(),e.stopPropagation(),n&&n({deltaX:e.deltaX,deltaY:e.deltaY}))},[n]);nc(t,`wheel`,r?void 0:i)}var vT={};vT={Empty:`فارغ`};var yT={};yT={Empty:`Изпразни`};var bT={};bT={Empty:`Prázdné`};var xT={};xT={Empty:`Tom`};var ST={};ST={Empty:`Leer`};var CT={};CT={Empty:`Άδειο`};var wT={};wT={Empty:`Empty`};var TT={};TT={Empty:`Vacío`};var ET={};ET={Empty:`Tühjenda`};var DT={};DT={Empty:`Tyhjä`};var OT={};OT={Empty:`Vide`};var kT={};kT={Empty:`ריק`};var AT={};AT={Empty:`Prazno`};var jT={};jT={Empty:`Üres`};var MT={};MT={Empty:`Vuoto`};var NT={};NT={Empty:`空`};var PT={};PT={Empty:`비어 있음`};var FT={};FT={Empty:`Tuščias`};var IT={};IT={Empty:`Tukšs`};var LT={};LT={Empty:`Tom`};var RT={};RT={Empty:`Leeg`};var zT={};zT={Empty:`Pusty`};var BT={};BT={Empty:`Vazio`};var VT={};VT={Empty:`Vazio`};var HT={};HT={Empty:`Gol`};var UT={};UT={Empty:`Не заполнено`};var WT={};WT={Empty:`Prázdne`};var GT={};GT={Empty:`Prazen`};var KT={};KT={Empty:`Prazno`};var qT={};qT={Empty:`Tomt`};var JT={};JT={Empty:`Boş`};var YT={};YT={Empty:`Пусто`};var XT={};XT={Empty:`空`};var ZT={};ZT={Empty:`空白`};var QT={};QT={"ar-AE":vT,"bg-BG":yT,"cs-CZ":bT,"da-DK":xT,"de-DE":ST,"el-GR":CT,"en-US":wT,"es-ES":TT,"et-EE":ET,"fi-FI":DT,"fr-FR":OT,"he-IL":kT,"hr-HR":AT,"hu-HU":jT,"it-IT":MT,"ja-JP":NT,"ko-KR":PT,"lt-LT":FT,"lv-LV":IT,"nb-NO":LT,"nl-NL":RT,"pl-PL":zT,"pt-BR":BT,"pt-PT":VT,"ro-RO":HT,"ru-RU":UT,"sk-SK":WT,"sl-SI":GT,"sr-SP":KT,"sv-SE":qT,"tr-TR":JT,"uk-UA":YT,"zh-CN":XT,"zh-TW":ZT};function $T(e){return e&&e.__esModule?e.default:e}var eE=()=>{};function tE(e){let t=(0,v.useRef)(void 0),{value:n,textValue:r,minValue:i,maxValue:a,isDisabled:o,isReadOnly:s,isRequired:c,onIncrement:l,onIncrementPage:u,onDecrement:d,onDecrementPage:f,onDecrementToMin:p,onIncrementToMax:m}=e,h=rv($T(QT),`@react-aria/spinbutton`),g=(0,v.useRef)(!1),_=(0,v.useCallback)(()=>{clearTimeout(t.current),g.current=!1},[]),y=Rs(()=>{_()});(0,v.useEffect)(()=>()=>y(),[]);let{keyboardProps:b}=Sm({isDisabled:o||s,shortcuts:{PageUp:()=>{if(u){u();return}if(l){l();return}return!1},ArrowUp:()=>{if(l){l();return}return!1},PageDown:()=>{if(f){f();return}if(d){d();return}return!1},ArrowDown:()=>{if(d){d();return}return!1},Home:()=>{if(p){p();return}return!1},End:()=>{if(m){m();return}return!1}},allowRepeats:!0}),x=(0,v.useRef)(!1),S=()=>{x.current=!0},C=()=>{x.current=!1},w=r===``?h.format(`Empty`):(r||`${n}`).replace(`-`,`−`);(0,v.useEffect)(()=>{x.current&&(kp(`assertive`),Op(w,`assertive`))},[w]);let T=(0,v.useCallback)(()=>{_()},[_]),E=Rs(l??eE),D=Rs(d??eE),O=Rs(()=>{(a===void 0||isNaN(a)||n===void 0||isNaN(n)||n{y(),g.current=!0,t.current=window.setTimeout(O,e)}),A=Rs(()=>{(i===void 0||isNaN(i)||n===void 0||isNaN(n)||n>i)&&(D(),j(60))}),j=Rs(e=>{y(),g.current=!0,t.current=window.setTimeout(A,e)}),M=e=>{e.preventDefault()},{addGlobalListener:N,removeAllGlobalListeners:P}=Ps(),ee=(0,v.useRef)(!1),[F,I]=(0,v.useState)(null);(0,v.useEffect)(()=>{F===`touch`?k(600):F?k(400):F||y()},[F]);let[L,te]=(0,v.useState)(null);return(0,v.useEffect)(()=>{L===`touch`?j(600):L?j(400):L||y()},[L]),{spinButtonProps:{role:`spinbutton`,"aria-valuenow":n!==void 0&&!isNaN(n)?n:void 0,"aria-valuetext":w,"aria-valuemin":i,"aria-valuemax":a,"aria-disabled":o||void 0,"aria-readonly":s||void 0,"aria-required":c||void 0,...b,onFocus:S,onBlur:C},incrementButtonProps:{onPressStart:e=>{_(),e.pointerType===`touch`?(N(window,`pointercancel`,T,{capture:!0}),ee.current=!1,I(`touch`)):(l?.(),I(`mouse`)),N(window,`contextmenu`,M)},onPressUp:e=>{_(),e.pointerType===`touch`&&(ee.current=!0),P(),I(null)},onPressEnd:e=>{_(),e.pointerType===`touch`&&!g.current&&ee.current&&l?.(),ee.current=!1,I(null)},onFocus:S,onBlur:C},decrementButtonProps:{onPressStart:e=>{_(),e.pointerType===`touch`?(N(window,`pointercancel`,T,{capture:!0}),ee.current=!1,te(`touch`)):(d?.(),te(`mouse`))},onPressUp:e=>{_(),e.pointerType===`touch`&&(ee.current=!0),P(),te(null)},onPressEnd:e=>{_(),e.pointerType===`touch`&&!g.current&&ee.current&&d?.(),ee.current=!1,te(null)},onFocus:S,onBlur:C}}}var nE={};nE={decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:`حقل رقمي`};var rE={};rE={decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:`Номер на полето`};var iE={};iE={decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:`Číselné pole`};var aE={};aE={decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:`Talfelt`};var oE={};oE={decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:`Nummernfeld`};var sE={};sE={decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:`Πεδίο αριθμού`};var cE={};cE={decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:`Number field`};var lE={};lE={decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de número`};var uE={};uE={decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:`Numbri väli`};var dE={};dE={decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:`Numerokenttä`};var fE={};fE={decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:`Champ de nombre`};var pE={};pE={decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:`שדה מספר`};var mE={};mE={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:`Polje broja`};var hE={};hE={decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:`Számmező`};var gE={};gE={decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:`Campo numero`};var _E={};_E={decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:`数値フィールド`};var vE={};vE={decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:`번호 필드`};var yE={};yE={decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:`Numerio laukas`};var bE={};bE={decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:`Skaitļu lauks`};var xE={};xE={decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:`Tallfelt`};var SE={};SE={decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:`Getalveld`};var CE={};CE={decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:`Pole numeru`};var wE={};wE={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de número`};var TE={};TE={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo numérico`};var EE={};EE={decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:`Câmp numeric`};var DE={};DE={decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:`Числовое поле`};var OE={};OE={decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:`Číselné pole`};var kE={};kE={decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:`Številčno polje`};var AE={};AE={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:`Polje broja`};var jE={};jE={decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:`Nummerfält`};var ME={};ME={decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:`Sayı alanı`};var NE={};NE={decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:`Поле номера`};var PE={};PE={decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:`数字字段`};var FE={};FE={decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:`數字欄位`};var IE={};IE={"ar-AE":nE,"bg-BG":rE,"cs-CZ":iE,"da-DK":aE,"de-DE":oE,"el-GR":sE,"en-US":cE,"es-ES":lE,"et-EE":uE,"fi-FI":dE,"fr-FR":fE,"he-IL":pE,"hr-HR":mE,"hu-HU":hE,"it-IT":gE,"ja-JP":_E,"ko-KR":vE,"lt-LT":yE,"lv-LV":bE,"nb-NO":xE,"nl-NL":SE,"pl-PL":CE,"pt-BR":wE,"pt-PT":TE,"ro-RO":EE,"ru-RU":DE,"sk-SK":OE,"sl-SI":kE,"sr-SP":AE,"sv-SE":jE,"tr-TR":ME,"uk-UA":NE,"zh-CN":PE,"zh-TW":FE};function LE(e){return e&&e.__esModule?e.default:e}function RE(e,t,n){let{id:r,decrementAriaLabel:i,incrementAriaLabel:a,isDisabled:o,isReadOnly:s,isRequired:c,minValue:l,maxValue:u,autoFocus:d,label:f,formatOptions:p,onBlur:m=()=>{},onFocus:h,onFocusChange:g,onKeyDown:_,onKeyUp:y,description:b,errorMessage:x,isWheelDisabled:S,...C}=e,{increment:w,incrementToMax:T,decrement:E,decrementToMin:D,numberValue:O,inputValue:k,commit:A,commitValidation:j}=t,M=rv(LE(IE),`@react-aria/numberfield`),N=(0,v.useCallback)(()=>{let e=n.current?.value??``;(0,dc.flushSync)(()=>{A()}),n.current?.value!==e&&Op(n.current?.value??``,`assertive`)},[A,n]),P=es(r),{focusProps:ee}=cm({onBlur(){N()}}),F=Cp(p),I=(0,v.useMemo)(()=>F.resolvedOptions(),[F]),L=Cp({...p,currencySign:void 0}),{spinButtonProps:te,incrementButtonProps:R,decrementButtonProps:z}=tE({isDisabled:o,isReadOnly:s,isRequired:c,maxValue:u,minValue:l,onIncrement:w,onIncrementToMax:T,onDecrement:E,onDecrementToMin:D,value:O,textValue:(0,v.useMemo)(()=>isNaN(O)?``:L.format(O),[L,O])}),[B,ne]=(0,v.useState)(!1),{focusWithinProps:re}=qm({isDisabled:o,onFocusWithinChange:ne});_T({onScroll:(0,v.useCallback)(e=>{Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.deltaY>0?w():e.deltaY<0&&E())},[E,w]),isDisabled:S||o||s||!B},n);let ie=(I.maximumFractionDigits??0)>0,V=t.minValue===void 0||isNaN(t.minValue)||t.minValue<0,ae=`numeric`;mo()?V?ae=`text`:ie&&(ae=`decimal`):bo()&&(V?ae=`numeric`:ie&&(ae=`decimal`));let oe=e=>{t.validate(e)&&t.setInputValue(e)},se=t=>{e.onPaste?.(t);let n=H(t);n&&(n.selectionEnd??-1)-(n.selectionStart??0)===n.value.length&&(t.preventDefault(),A(t.clipboardData?.getData?.(`text/plain`)?.trim()??``))},ce=W(e),{keyboardProps:le}=Sm({isDisabled:o||s,shortcuts:{Enter:()=>((0,dc.flushSync)(()=>{A()}),j(),{shouldPreventDefault:!1})},onKeyDown:_,onKeyUp:y}),{isInvalid:ue,validationErrors:de,validationDetails:fe}=t.displayValidation,{labelProps:pe,inputProps:me,descriptionProps:he,errorMessageProps:ge}=gT({...C,...ce,name:void 0,form:void 0,label:f,autoFocus:d,isDisabled:o,isReadOnly:s,isRequired:c,validate:void 0,[NS]:t,value:k,defaultValue:`!`,autoComplete:`off`,"aria-label":e[`aria-label`]||void 0,"aria-labelledby":e[`aria-labelledby`]||void 0,id:P,type:`text`,inputMode:ae,onChange:oe,onBlur:m,onFocus:h,onFocusChange:g,onPaste:se,description:b,errorMessage:x},t,n),_e=U(le,me);cc(n,t.defaultNumberValue,t.setNumberValue),BE(t,e.validationBehavior,e.commitBehavior,n,t.minValue,t.maxValue,e.step,t.numberValue);let ve=U(te,ee,_e,{role:null,"aria-roledescription":go()?null:M.format(`numberField`),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:`off`,spellCheck:`false`});e.validationBehavior===`native`&&(ve[`aria-required`]=void 0);let ye=e=>{ms()!==n.current&&(e.pointerType===`mouse`?n.current?.focus():e.target.focus())},be=e[`aria-label`]||(typeof e.label==`string`?e.label:``),xe;be||(xe=e.label==null?e[`aria-labelledby`]:pe.id);let Se=es(),Ce=es(),we=U(R,{"aria-label":a||M.format(`increase`,{fieldLabel:be}).trim(),id:xe&&!a?Se:null,"aria-labelledby":xe&&!a?`${Se} ${xe}`:null,"aria-controls":P,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:ye}),Te=U(z,{"aria-label":i||M.format(`decrease`,{fieldLabel:be}).trim(),id:xe&&!i?Ce:null,"aria-labelledby":xe&&!i?`${Ce} ${xe}`:null,"aria-controls":P,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:ye});return{groupProps:{...re,role:`group`,"aria-disabled":o,"aria-invalid":ue?`true`:void 0},labelProps:pe,inputProps:ve,incrementButtonProps:we,decrementButtonProps:Te,errorMessageProps:ge,descriptionProps:he,isInvalid:ue,validationErrors:de,validationDetails:fe}}var zE=null;function BE(e,t,n,r,i,a,o,s){Io(()=>{let c=r.current;if(n!==`validate`||e.realtimeValidation.isInvalid||!c||c.disabled||(!zE&&typeof document<`u`&&(zE=document.createElement(`input`),zE.type=`number`),!zE))return;zE.min=i!=null&&!isNaN(i)?String(i):``,zE.max=a!=null&&!isNaN(a)?String(a):``,zE.step=o!=null&&!isNaN(o)?String(o):``,zE.value=s!=null&&!isNaN(s)?String(s):``;let l=c.validity.valid&&zE.validity.valid,u=c.validationMessage||zE.validationMessage,d={isInvalid:!l,validationErrors:u?[u]:[],validationDetails:{badInput:c.validity.badInput,customError:c.validity.customError,patternMismatch:c.validity.patternMismatch,rangeOverflow:zE.validity.rangeOverflow,rangeUnderflow:zE.validity.rangeUnderflow,stepMismatch:zE.validity.stepMismatch,tooLong:c.validity.tooLong,tooShort:c.validity.tooShort,typeMismatch:c.validity.typeMismatch,valueMissing:c.validity.valueMissing,valid:l}};e.updateValidation(d),t===`native`&&!zE.validity.valid&&c.setCustomValidity(zE.validationMessage)})}function VE(e){let{minValue:t,maxValue:n,step:r,formatOptions:i,value:a,defaultValue:o=NaN,onChange:s,locale:c,isDisabled:l,isReadOnly:u,commitBehavior:d=`snap`}=e;a===null&&(a=NaN);let f=(0,v.useCallback)(e=>r===void 0||isNaN(r)?Oc(e,t,n):Ac(e,t,n,r),[r,t,n]);a!==void 0&&!isNaN(a)&&d===`snap`&&(a=f(a)),!isNaN(o)&&d===`snap`&&(o=f(o));let[p,m]=sh(a,isNaN(o)?NaN:o,s),[h]=(0,v.useState)(p),[g,_]=(0,v.useState)(()=>isNaN(p)?``:new cp(c,i).format(p)),y=(0,v.useMemo)(()=>new pp(c,i),[c,i]),b=(0,v.useMemo)(()=>y.getNumberingSystem(g),[y,g]),x=(0,v.useMemo)(()=>new cp(c,{...i,numberingSystem:b}),[c,i,b]),S=(0,v.useMemo)(()=>x.resolvedOptions(),[x]),C=(0,v.useCallback)(e=>isNaN(e)||e===null?``:x.format(e),[x]),w=PS({...e,value:p}),T=r!==void 0&&!isNaN(r)?r:1;S.style===`percent`&&(r===void 0||isNaN(r))&&(T=.01);let[E,D]=(0,v.useState)(p),[O,k]=(0,v.useState)(c),[A,j]=(0,v.useState)(i);(!Object.is(p,E)||c!==O||!HE(i,A))&&(_(C(p)),D(p),k(c),j(i));let M=(0,v.useMemo)(()=>y.parse(g),[y,g]),N=e=>{let t=e===void 0?g:e,n=M;if(e!==void 0&&(n=y.parse(t)),!t.length){m(NaN),_(a===void 0?``:C(p));return}if(isNaN(n)){_(C(p));return}let r=d===`snap`?f(n):n;r=y.parse(C(r));let i=r!==p;m(r),_(C(a===void 0?r:p)),i&&w.commitValidation()},P=(e,r=0)=>{let i=M;if(isNaN(i))return Ac(isNaN(r)?0:r,t,n,T);{let r=Ac(i,t,n,T);return e===`+`&&r>i||e===`-`&&r{let e=P(`+`,t);e===p&&_(C(e)),m(e),w.commitValidation()},F=()=>{let e=P(`-`,n);e===p&&_(C(e)),m(e),w.commitValidation()},I=()=>{n!=null&&(m(Ac(n,t,n,T)),w.commitValidation())},L=()=>{t!=null&&(m(t),w.commitValidation())},te=(0,v.useMemo)(()=>!l&&!u&&(isNaN(M)||n===void 0||isNaN(n)||Ac(M,t,n,T)>M||UE(`+`,M,T)<=n),[l,u,t,n,T,M]),R=(0,v.useMemo)(()=>!l&&!u&&(isNaN(M)||t===void 0||isNaN(t)||Ac(M,t,n,T)=t),[l,u,t,n,T,M]),z=e=>y.isValidPartialNumber(e,t,n);return{...w,validate:z,increment:ee,incrementToMax:I,decrement:F,decrementToMin:L,canIncrement:te,canDecrement:R,minValue:t,maxValue:n,numberValue:M,defaultNumberValue:isNaN(o)?h:o,setNumberValue:m,setInputValue:_,inputValue:g,commit:N}}function HE(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(t[r]!==e[r])return!1;return!0}function UE(e,t,n){let r=e===`+`?t+n:t-n;if(t%1!=0||n%1!=0){let i=t.toString().split(`.`),a=n.toString().split(`.`),o=i[1]&&i[1].length||0,s=a[1]&&a[1].length||0,c=10**Math.max(o,s);t=Math.round(t*c),n=Math.round(n*c),r=e===`+`?t+n:t-n,r/=c}return r}var WE={blue:`\x1B[34m`,green:`\x1B[32m`,magenta:`\x1B[35m`,red:`\x1B[31m`,reset:`\x1B[0m`,yellow:`\x1B[33m`},GE={debug:WE.magenta,error:WE.red,info:WE.blue,success:WE.green,warn:WE.yellow},KE={debug:`🔍`,error:`❌`,info:`ℹ️`,success:`✅`,warn:`⚠️`},qE=new class{constructor(e={}){this.enabled=e.enabled??!0,this.prefix=e.prefix??`HeroUI`}formatMessage(e,t){let n=GE[e],r=KE[e];return`${n}[${this.prefix}]${WE.reset} ${r} ${t}`}log(e,t,...n){if(!this.enabled)return;let r=this.formatMessage(e,t);switch(e){case`error`:console.error(r,...n);break;case`warn`:console.warn(r,...n);break;default:console.log(r,...n)}}info(e,...t){this.log(`info`,e,...t)}success(e,...t){this.log(`success`,e,...t)}warn(e,...t){this.log(`warn`,e,...t)}error(e,...t){this.log(`error`,e,...t)}debug(e,...t){this.log(`debug`,e,...t)}divider(e=`=`,t=80){this.enabled&&console.log(e.repeat(t))}newline(){this.enabled&&console.log()}}({prefix:`HeroUI`}),JE,YE=typeof process<`u`&&!1,XE=e=>{YE&&(JE??=new Set,JE.has(e)&&qE.warn(`Duplicate collection slot "${e}". Use a unique, namespaced name (e.g. "tabs.listContainer", "menu.popover").`),JE.add(e));let t=`$$heroui.collection.${e}`,n=(0,v.createContext)(void 0),r=(e,n)=>v.Children.map(e,e=>(0,v.isValidElement)(e)?v.cloneElement(e,{[t]:n}):e),i=e=>{let{[t]:n,...r}=e;return[n,r]},a=e=>{let[t,r]=i(e),a=(0,v.useContext)(n);return[t??a,r]},o=({children:e,...t})=>(0,G.jsx)(n.Provider,{value:t,children:r(e,t)});return o.displayName=`HeroUI.CollectionSlot(${e})`,{key:t,inject:r,consume:i,useSlot:a,Injector:o,withSlot:(t,n)=>{let r=(0,v.forwardRef)(function(r,i){let[o,s]=a(r),{children:c,...l}=s;if(!o)return(0,G.jsx)(t,{...l,ref:i,children:c});if(n)return n({...l,children:c},o,i);let{className:u,render:d,...f}=o;return(0,G.jsx)(t,{...l,ref:i,children:d?d({children:c,className:u,...f}):(0,G.jsx)(`div`,{className:u,"data-slot":`${e}-container`,...f,children:c})})});return r.displayName=`HeroUI.withCollectionSlot(${t.displayName||t.name||e})`,r},Context:n}},ZE=(0,v.createContext)({});XE(`combo-box.inputGroup`);function QE(e,t){return e-t*Math.floor(e/t)}var $E=1721426;function eD(e,t,n,r){t=nD(e,t);let i=t-1,a=-2;return n<=2?a=0:tD(t)&&(a=-1),1721425+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+r)}function tD(e){return e%4==0&&(e%100!=0||e%400==0)}function nD(e,t){return e===`BC`?1-t:t}function rD(e){let t=`AD`;return e<=0&&(t=`BC`,e=1-e),[t,e]}var iD={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},aD=class{fromJulianDay(e){let t=e,n=t-$E,r=Math.floor(n/146097),i=QE(n,146097),a=Math.floor(i/36524),o=QE(i,36524),s=Math.floor(o/1461),c=QE(o,1461),l=Math.floor(c/365),[u,d]=rD(r*400+a*100+s*4+l+ +(a!==4&&l!==4)),f=t-eD(u,d,1,1),p=2;t=0?e:t:e||t}function ID(e){return e=XD(e,new aD),LD(nD(e.era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function LD(e,t,n,r,i,a,o){let s=new Date;return s.setUTCHours(r,i,a,o),s.setUTCFullYear(e,t-1,n),s.getTime()}function RD(e,t){if(t===`UTC`)return 0;if(e>0&&t===SD()&&!CD())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=BD(e,t);return LD(n,r,i,a,o,s,0)-Math.floor(e/1e3)*1e3}var zD=new Map;function BD(e,t){let n=zD.get(t);n||(n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),zD.set(t,n));let r=n.formatToParts(new Date(e)),i={};for(let e of r)e.type!==`literal`&&(i[e.type]=e.value);return{year:i.era===`BC`||i.era===`B`?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour===`24`?0:+i.hour,minute:+i.minute,second:+i.second}}var VD=864e5;function HD(e,t,n,r){return(n===r?[n]:[n,r]).filter(n=>UD(e,t,n))}function UD(e,t,n){let r=BD(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function WD(e,t,n=`compatible`){let r=JD(e);if(t===`UTC`)return ID(r);if(t===SD()&&n===`compatible`&&!CD()){r=XD(r,new aD);let e=new Date,t=nD(r.era,r.year);return e.setFullYear(t,r.month-1,r.day),e.setHours(r.hour,r.minute,r.second,r.millisecond),e.getTime()}let i=ID(r),a=RD(i-VD,t),o=RD(i+VD,t),s=HD(r,t,i-a,i-o);if(s.length===1)return s[0];if(s.length>1)switch(n){case`compatible`:case`earlier`:return s[0];case`later`:return s[s.length-1];case`reject`:throw RangeError(`Multiple possible absolute times found`)}switch(n){case`earlier`:return Math.min(i-a,i-o);case`compatible`:case`later`:return Math.max(i-a,i-o);case`reject`:throw RangeError(`No such absolute time found`)}}function GD(e,t,n=`compatible`){return new Date(WD(e,t,n))}function KD(e,t){let n=RD(e,t),r=new Date(e+n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new HO(i<1?`BC`:`AD`,i<1?-i+1:i,a,o,t,n,s,c,l,u)}function qD(e){return new zO(e.calendar,e.era,e.year,e.month,e.day)}function JD(e,t){let n=0,r=0,i=0,a=0;if(`timeZone`in e)({hour:n,minute:r,second:i,millisecond:a}=e);else if(`hour`in e&&!t)return e;return t&&({hour:n,minute:r,second:i,millisecond:a}=t),new VO(e.calendar,e.era,e.year,e.month,e.day,n,r,i,a)}function YD(e){return new BO(e.hour,e.minute,e.second,e.millisecond)}function XD(e,t){if(dD(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,sO(r),r}function ZD(e,t,n){return e instanceof HO?e.timeZone===t?e:$D(e,t):KD(WD(e,t,n),t)}function QD(e){let t=ID(e)-e.offset;return new Date(t)}function $D(e,t){return XD(KD(ID(e)-e.offset,t),e.calendar)}function eO(e){return $D(e,SD())}var tO=36e5;function nO(e,t){let n=e.copy(),r=`hour`in n?hO(n,t):0;rO(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,iO(n),oO(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,aO(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){let e=n.calendar.isInverseEra?.(n);n.year=i,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function rO(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function iO(e){for(;e.month<1;)rO(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,rO(e,1)}function aO(e){for(;e.day<1;)e.month--,iO(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,iO(e)}function oO(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function sO(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),oO(e)}function cO(e){let t={};for(let n in e)typeof e[n]==`number`&&(t[n]=-e[n]);return t}function lO(e,t){return nO(e,cO(t))}function uO(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),sO(n),n}function dO(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),pO(n),n}function fO(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=mO(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=mO(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=mO(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=mO(e.hour,24),t}function pO(e){e.millisecond=Math.max(0,Math.min(e.millisecond,999)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function mO(e,t){let n=e%t;return n<0&&(n+=t),n}function hO(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,fO(e)}function gO(e,t){let n=e.copy();return hO(n,t),n}function _O(e,t){return gO(e,cO(t))}function vO(e,t,n,r){let i=e.copy();switch(t){case`era`:{let t=e.calendar.getEras(),a=t.indexOf(e.era);if(a<0)throw Error(`Invalid era: `+e.era);a=bO(a,n,0,t.length-1,r?.round),i.era=t[a],sO(i);break}case`year`:i.calendar.isInverseEra?.(i)&&(n=-n),i.year=bO(e.year,n,-1/0,9999,r?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case`month`:i.month=bO(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case`day`:i.day=bO(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw Error(`Unsupported field `+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),sO(i),i}function yO(e,t,n,r){let i=e.copy();switch(t){case`hour`:{let t=e.hour,a=0,o=23;if(r?.hourCycle===12){let e=t>=12;a=e?12:0,o=e?23:11}i.hour=bO(t,n,a,o,r?.round);break}case`minute`:i.minute=bO(e.minute,n,0,59,r?.round);break;case`second`:i.second=bO(e.second,n,0,59,r?.round);break;case`millisecond`:i.millisecond=bO(e.millisecond,n,0,999,r?.round);break;default:throw Error(`Unsupported field `+t)}return i}function bO(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e0?Math.ceil(e/i)*i:Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,er&&(e=n+(e-r-1));return e}function xO(e,t){let n;return n=t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0?WD(nO(JD(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):ID(e)-e.offset,n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5,XD(KD(n,e.timeZone),e.calendar)}function SO(e,t){return xO(e,cO(t))}function CO(e,t,n,r){switch(t){case`hour`:{let t=0,i=23;if(r?.hourCycle===12){let n=e.hour>=12;t=n?12:0,i=n?23:11}let a=JD(e),o=XD(dO(a,{hour:t}),new aD),s=[WD(o,e.timeZone,`earlier`),WD(o,e.timeZone,`later`)].filter(t=>KD(t,e.timeZone).day===o.day)[0],c=XD(dO(a,{hour:i}),new aD),l=[WD(c,e.timeZone,`earlier`),WD(c,e.timeZone,`later`)].filter(t=>KD(t,e.timeZone).day===c.day).pop(),u=ID(e)-e.offset,d=Math.floor(u/tO),f=u%tO;return u=bO(d,n,Math.floor(s/tO),Math.floor(l/tO),r?.round)*tO+f,XD(KD(u,e.timeZone),e.calendar)}case`minute`:case`second`:case`millisecond`:return yO(e,t,n,r);case`era`:case`year`:case`month`:case`day`:return XD(KD(WD(vO(JD(e),t,n,r),e.timeZone),e.timeZone),e.calendar);default:throw Error(`Unsupported field `+t)}}function wO(e,t,n){let r=JD(e),i=dO(uO(r,t),t);return i.compare(r)===0?e:XD(KD(WD(i,e.timeZone,n),e.timeZone),e.calendar)}var TO=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,EO=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,DO=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function OO(e){let t=e.match(TO);if(!t)throw DO.test(e)?Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):Error(`Invalid ISO 8601 date string: `+e);let n=new zO(MO(t[1],0,9999),MO(t[2],1,12),1);return n.day=MO(t[3],1,n.calendar.getDaysInMonth(n)),n}function kO(e){let t=e.match(EO);if(!t)throw DO.test(e)?Error(`Invalid ISO 8601 date time string: ${e}. Use parseAbsolute() instead.`):Error(`Invalid ISO 8601 date time string: `+e);let n=MO(t[1],-9999,9999),r=new VO(n<1?`BC`:`AD`,n<1?-n+1:n,MO(t[2],1,12),1,t[4]?MO(t[4],0,23):0,t[5]?MO(t[5],0,59):0,t[6]?MO(t[6],0,59):0,t[7]?MO(t[7],0,1/0)*1e3:0);return r.day=MO(t[3],0,r.calendar.getDaysInMonth(r)),r}function AO(e,t){let n=e.match(DO);if(!n)throw Error(`Invalid ISO 8601 date time string: `+e);let r=MO(n[1],-9999,9999),i=new HO(r<1?`BC`:`AD`,r<1?-r+1:r,MO(n[2],1,12),1,t,0,n[4]?MO(n[4],0,23):0,n[5]?MO(n[5],0,59):0,n[6]?MO(n[6],0,59):0,n[7]?MO(n[7],0,1/0)*1e3:0);return i.day=MO(n[3],0,i.calendar.getDaysInMonth(i)),n[8]&&(i.offset=MO(n[8],-23,23)*36e5+MO(n[9]??`0`,0,59)*6e4),$D(i,t)}function jO(e){return AO(e,SD())}function MO(e,t,n){let r=Number(e);if(rn)throw RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);return r}function NO(e){return`${String(e.hour).padStart(2,`0`)}:${String(e.minute).padStart(2,`0`)}:${String(e.second).padStart(2,`0`)}${e.millisecond?String(e.millisecond/1e3).slice(1):``}`}function PO(e){let t=XD(e,new aD),n;return n=t.era===`BC`?t.year===1?`0000`:`-`+String(Math.abs(1-t.year)).padStart(6,`00`):String(t.year).padStart(4,`0`),`${n}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)}`}function FO(e){return`${PO(e)}T${NO(e)}`}function IO(e){let t=Math.sign(e)<0?`-`:`+`;e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`;return i!==0&&(a+=`:${String(i).padStart(2,`0`)}`),a}function LO(e){return`${FO(e)}${IO(e.offset)}[${e.timeZone}]`}function RO(e){let t=typeof e[0]==`object`?e.shift():new aD,n;if(typeof e[0]==`string`)n=e.shift();else{let e=t.getEras();n=e[e.length-1]}let r=e.shift(),i=e.shift(),a=e.shift();return[t,n,r,i,a]}var zO=class e{constructor(...e){let[t,n,r,i,a]=RO(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,sO(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day):new e(this.calendar,this.year,this.month,this.day)}add(e){return nO(this,e)}subtract(e){return lO(this,e)}set(e){return uO(this,e)}cycle(e,t,n){return vO(this,e,t,n)}toDate(e){return GD(this,e)}toString(){return PO(this)}compare(e){return _D(this,e)}},BO=class e{constructor(e=0,t=0,n=0,r=0){this.hour=e,this.minute=t,this.second=n,this.millisecond=r,pO(this)}copy(){return new e(this.hour,this.minute,this.second,this.millisecond)}add(e){return gO(this,e)}subtract(e){return _O(this,e)}set(e){return dO(this,e)}cycle(e,t,n){return yO(this,e,t,n)}toString(){return NO(this)}compare(e){return vD(this,e)}},VO=class e{constructor(...e){let[t,n,r,i,a]=RO(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,sO(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return nO(this,e)}subtract(e){return lO(this,e)}set(e){return uO(dO(this,e),e)}cycle(e,t,n){switch(e){case`era`:case`year`:case`month`:case`day`:return vO(this,e,t,n);default:return yO(this,e,t,n)}}toDate(e,t){return GD(this,e,t)}toString(){return FO(this)}compare(e){let t=_D(this,e);return t===0?vD(this,JD(e)):t}},HO=class e{constructor(...e){let[t,n,r,i,a]=RO(e),o=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.timeZone=o,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,sO(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return xO(this,e)}subtract(e){return SO(this,e)}set(e,t){return wO(this,e,t)}cycle(e,t,n){return CO(this,e,t,n)}toDate(){return QD(this)}toString(){return LO(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-ZD(e,this.timeZone).toDate().getTime()}},UO=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],WO=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],GO=[1867,1911,1925,1988,2018],KO=[`meiji`,`taisho`,`showa`,`heisei`,`reiwa`];function qO(e){let t=UO.findIndex(([t,n,r])=>e.year=0){let[,n,r]=UO[t];e.month=Math.max(n,e.month),e.month===n&&(e.day=Math.max(r,e.day))}}getEras(){return KO}getYearsInEra(e){let t=KO.indexOf(e.era),n=UO[t],r=UO[t+1];if(r==null)return 9999-n[0]+1;let i=r[0]-n[0];return(e.month0?[`minguo`,t]:[`before_minguo`,1-t]}var rk=class extends aD{fromJulianDay(e){let t=super.fromJulianDay(e),[n,r]=nk(nD(t.era,t.year));return new zO(this,n,r,t.month,t.day)}toJulianDay(e){return super.toJulianDay(ik(e))}getEras(){return[`before_minguo`,`minguo`]}balanceDate(e){let[t,n]=nk(tk(e));e.era=t,e.year=n}isInverseEra(e){return e.era===`before_minguo`}getDaysInMonth(e){return super.getDaysInMonth(ik(e))}getYearsInEra(e){return e.era===`before_minguo`?9999:8088}constructor(...e){super(...e),this.identifier=`roc`}};function ik(e){let[t,n]=rD(tk(e));return new zO(t,n,e.month,e.day)}var ak=1948320,ok=[0,31,62,93,124,155,186,216,246,276,306,336],sk=class{fromJulianDay(e){let t=e-ak,n=1+Math.floor((33*t+3)/12053),r=t-(365*(n-1)+Math.floor((8*n+21)/33)),i=Math.floor(r<216?r/31:(r-6)/30),a=r-ok[i]+1;return new zO(this,n,i+1,a)}toJulianDay(e){let t=1948319+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=ok[e.month-1],t+=e.day,t}getMonthsInYear(){return 12}getDaysInMonth(e){return e.month<=6?31:e.month<=11||QE(25*e.year+11,33)<8?30:29}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getEras(){return[`AP`]}getYearsInEra(){return 9377}constructor(){this.identifier=`persian`}},ck=78,lk=80,uk=class extends aD{fromJulianDay(e){let t=super.fromJulianDay(e),n=t.year-ck,r=e-eD(t.era,t.year,1,1),i;r=8&&(i+=(e.month-7)*30),i+=e.day-1,i)}getDaysInMonth(e){return e.month===1&&tD(e.year+ck)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return[`saka`]}balanceDate(){}constructor(...e){super(...e),this.identifier=`indian`}},dk=1948440,fk=1948439,pk=1300,mk=1600,hk=460322;function gk(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function _k(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),i=Math.min(12,Math.ceil((n-(29+gk(t,r,1,1)))/29.5)+1);return new zO(e,r,i,n-gk(t,r,i,1)+1)}function vk(e){return(14+11*e)%30<11}var yk=class{fromJulianDay(e){return _k(this,dk,e)}toJulianDay(e){return gk(dk,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return e.month===12&&vk(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return vk(e.year)?355:354}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9665}getEras(){return[`AH`]}constructor(){this.identifier=`islamic-civil`}},bk=class extends yk{fromJulianDay(e){return _k(this,fk,e)}toJulianDay(e){return gk(fk,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier=`islamic-tbla`}},xk=`qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=`,Sk,Ck;function wk(e){return hk+Ck[e-pk]}function Tk(e,t){let n=e-pk,r=1<<11-(t-1);return(Sk[n]&r)===0?29:30}function Ek(e,t){let n=wk(e);for(let r=1;re.charCodeAt(0)).buffer),!Ck){Ck=new Uint32Array(301);let e=0;for(let t=pk;t<=mk;t++){Ck[t-pk]=e;for(let n=1;n<=12;n++)e+=Tk(t,n)}}}fromJulianDay(e){let t=e-dk,n=wk(pk),r=wk(mk);if(tr)return super.fromJulianDay(e);{let e=1299,n=1,r=1;for(;r>0;){e++,r=t-wk(e)+1;let i=Dk(e);if(r===i){n=12;break}if(rt;)r-=t,n++,t=Tk(e,n);break}}return new zO(this,e,n,t-Ek(e,n)+1)}}toJulianDay(e){return e.yearmk?super.toJulianDay(e):dk+Ek(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.yearmk?super.getDaysInMonth(e):Tk(e.year,e.month)}getDaysInYear(e){return e.yearmk?super.getDaysInYear(e):Dk(e.year)}},kk=347997,Ak=25920,jk=765433;function Mk(e){return QE(e*7+1,19)<7}function Nk(e){let t=Math.floor((235*e-234)/19),n=12084+13753*t,r=t*29+Math.floor(n/25920);return QE(3*(r+1),7)<3&&(r+=1),r}function Pk(e){let t=Nk(e-1),n=Nk(e);return Nk(e+1)-n===356?2:+(n-t===382)}function Fk(e){return Nk(e)+Pk(e)}function Ik(e){return Fk(e+1)-Fk(e)}function Lk(e){let t=Ik(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function Rk(e,t){if(t>=6&&!Mk(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let n=Lk(e);return t===2?n===2?30:29:t===3?n===0?29:30:t===6?Mk(e)?30:0:30}var zk=class{fromJulianDay(e){let t=e-kk,n=t*Ak/jk,r=Math.floor((19*n+234)/235)+1,i=Fk(r),a=Math.floor(t-i);for(;a<1;)r--,i=Fk(r),a=Math.floor(t-i);let o=1,s=0;for(;s6?e.month--:!Mk(t.year)&&Mk(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier=`hebrew`}},Bk=1723856,Vk=1824665,Hk=5500;function Uk(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function Wk(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-Uk(e,n,1,1))/30);return[n,r,t+1-Uk(e,n,r,1)]}function Gk(e){return Math.floor(e%4/3)}function Kk(e,t){return t%13==0?Gk(e)+5:30}var qk=class{fromJulianDay(e){let[t,n,r]=Wk(Bk,e),i=`AM`;return t<=0&&(i=`AA`,t+=Hk),new zO(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`AA`&&(t-=Hk),Uk(Bk,t,e.month,e.day)}getDaysInMonth(e){return Kk(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+Gk(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(e){return e.era===`AA`?9999:9991}getEras(){return[`AA`,`AM`]}constructor(){this.identifier=`ethiopic`}},Jk=class extends qk{fromJulianDay(e){let[t,n,r]=Wk(Bk,e);return t+=Hk,new zO(this,`AA`,t,n,r)}getEras(){return[`AA`]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier=`ethioaa`}},Yk=class extends qk{fromJulianDay(e){let[t,n,r]=Wk(Vk,e),i=`CE`;return t<=0&&(i=`BCE`,t=1-t),new zO(this,i,t,n,r)}toJulianDay(e){let t=e.year;return e.era===`BCE`&&(t=1-t),Uk(Vk,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return e.era===`BCE`&&(t=1-t),Kk(t,e.month)}isInverseEra(e){return e.era===`BCE`}balanceDate(e){e.year<=0&&(e.era=e.era===`BCE`?`CE`:`BCE`,e.year=1-e.year)}getEras(){return[`BCE`,`CE`]}getYearsInEra(e){return e.era===`BCE`?9999:9715}constructor(...e){super(...e),this.identifier=`coptic`}};function Xk(e){switch(e){case`buddhist`:return new QO;case`ethiopic`:return new qk;case`ethioaa`:return new Jk;case`coptic`:return new Yk;case`hebrew`:return new zk;case`indian`:return new uk;case`islamic-civil`:return new yk;case`islamic-tbla`:return new bk;case`islamic-umalqura`:return new Ok;case`japanese`:return new YO;case`persian`:return new sk;case`roc`:return new rk;default:return new aD}}var Zk=new Map,Qk=class{constructor(e,t={}){this.formatter=eA(e,t),this.options=t}format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if(typeof this.formatter.formatRange==`function`)return this.formatter.formatRange(e,t);if(t= start date`);return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if(typeof this.formatter.formatRangeToParts==`function`)return this.formatter.formatRangeToParts(e,t);if(t= start date`);let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return iA()&&(this.resolvedHourCycle||=aA(e.locale,this.options),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle===`h11`||this.resolvedHourCycle===`h12`),e.calendar===`ethiopic-amete-alem`&&(e.calendar=`ethioaa`),e}},$k={true:{ja:`h11`},false:{}};function eA(e,t={}){if(typeof t.hour12==`boolean`&&nA()){t={...t};let n=$k[String(t.hour12)][e.split(`-`)[0]],r=t.hour12?`h12`:`h23`;t.hourCycle=n??r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]e.type===`hour`).value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>e.type===`hour`).value,10);if(r===0&&i===23)return`h23`;if(r===24&&i===23)return`h24`;if(r===0&&i===11)return`h11`;if(r===12&&i===11)return`h12`;throw Error(`Unexpected hour cycle result`)}var oA=[`day`,`month`,`year`],sA={hour:1,minute:2,second:3};function cA(e,t){let{autoComplete:n,isDisabled:r,name:i}=e,{visuallyHiddenProps:a}=av({style:{position:`fixed`,top:0,left:0}}),o=60;t.granularity===`second`?o=1:t.granularity===`hour`&&(o=3600);let s=``;t.value&&(s=t.granularity===`day`?qD(t.value).toString():JD(`timeZone`in t.value?eO(t.value):t.value).toString());let c=t.granularity===`day`?`date`:`datetime-local`,l=[`hour`,`minute`,`second`],u=0;return l.includes(t.granularity)&&(u=sA[t.granularity],l=l.slice(0,u)),{containerProps:{...a,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":`aria-hidden-focus`},inputProps:{tabIndex:-1,autoComplete:n,disabled:r,type:c,form:``,name:i,step:o,value:s,onChange:e=>{let n=H(e).value.toString();if(n)try{let e=kO(n);if(t.granularity===`day`&&(e=OO(n)),`setSegment`in t)for(let n in e)oA.includes(n)&&t.setSegment(n,e[n]),l.includes(n)&&t.setSegment(n,e[n]);t.setValue(e)}catch{}}}}}function lA(e){let{state:t}=e,{containerProps:n,inputProps:r}=cA({...e},t);return v.createElement(`div`,{...n,"data-testid":`hidden-dateinput-container`},v.createElement(`input`,r))}var uA={};uA={calendar:`التقويم`,day:`يوم`,dayPeriod:`ص/م`,endDate:`تاريخ الانتهاء`,era:`العصر`,hour:`الساعات`,minute:`الدقائق`,month:`الشهر`,second:`الثواني`,selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,selectedTimeDescription:e=>`\u{627}\u{644}\u{648}\u{642}\u{62A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.time}`,startDate:`تاريخ البدء`,timeZoneName:`التوقيت`,weekday:`اليوم`,year:`السنة`};var dA={};dA={calendar:`Календар`,day:`ден`,dayPeriod:`пр.об./сл.об.`,endDate:`Крайна дата`,era:`ера`,hour:`час`,minute:`минута`,month:`месец`,second:`секунда`,selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{434}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{432}\u{440}\u{435}\u{43C}\u{435}: ${e.time}`,startDate:`Начална дата`,timeZoneName:`часова зона`,weekday:`ден от седмицата`,year:`година`};var fA={};fA={calendar:`Kalendář`,day:`den`,dayPeriod:`část dne`,endDate:`Konečné datum`,era:`letopočet`,hour:`hodina`,minute:`minuta`,month:`měsíc`,second:`sekunda`,selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.startDate} a\u{17E} ${e.endDate}`,selectedTimeDescription:e=>`Vybran\xfd \u{10D}as: ${e.time}`,startDate:`Počáteční datum`,timeZoneName:`časové pásmo`,weekday:`den v týdnu`,year:`rok`};var pA={};pA={calendar:`Kalender`,day:`dag`,dayPeriod:`AM/PM`,endDate:`Slutdato`,era:`æra`,hour:`time`,minute:`minut`,month:`måned`,second:`sekund`,selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tidspunkt: ${e.time}`,startDate:`Startdato`,timeZoneName:`tidszone`,weekday:`ugedag`,year:`år`};var mA={};mA={calendar:`Kalender`,day:`Tag`,dayPeriod:`Tageshälfte`,endDate:`Enddatum`,era:`Epoche`,hour:`Stunde`,minute:`Minute`,month:`Monat`,second:`Sekunde`,selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.startDate} bis ${e.endDate}`,selectedTimeDescription:e=>`Ausgew\xe4hlte Zeit: ${e.time}`,startDate:`Startdatum`,timeZoneName:`Zeitzone`,weekday:`Wochentag`,year:`Jahr`};var hA={};hA={calendar:`Ημερολόγιο`,day:`ημέρα`,dayPeriod:`π.μ./μ.μ.`,endDate:`Ημερομηνία λήξης`,era:`περίοδος`,hour:`ώρα`,minute:`λεπτό`,month:`μήνας`,second:`δευτερόλεπτο`,selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,selectedTimeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3CE}\u{3C1}\u{3B1}: ${e.time}`,startDate:`Ημερομηνία έναρξης`,timeZoneName:`ζώνη ώρας`,weekday:`καθημερινή`,year:`έτος`};var gA={};gA={era:`era`,year:`year`,month:`month`,day:`day`,hour:`hour`,minute:`minute`,second:`second`,dayPeriod:`AM/PM`,calendar:`Calendar`,startDate:`Start Date`,endDate:`End Date`,weekday:`day of the week`,timeZoneName:`time zone`,selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.startDate} to ${e.endDate}`,selectedTimeDescription:e=>`Selected Time: ${e.time}`};var _A={};_A={calendar:`Calendario`,day:`día`,dayPeriod:`a.\xA0m./p.\xA0m.`,endDate:`Fecha final`,era:`era`,hour:`hora`,minute:`minuto`,month:`mes`,second:`segundo`,selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Rango seleccionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora seleccionada: ${e.time}`,startDate:`Fecha de inicio`,timeZoneName:`zona horaria`,weekday:`día de la semana`,year:`año`};var vA={};vA={calendar:`Kalender`,day:`päev`,dayPeriod:`enne/pärast lõunat`,endDate:`Lõppkuupäev`,era:`ajastu`,hour:`tund`,minute:`minut`,month:`kuu`,second:`sekund`,selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.startDate} kuni ${e.endDate}`,selectedTimeDescription:e=>`Valitud aeg: ${e.time}`,startDate:`Alguskuupäev`,timeZoneName:`ajavöönd`,weekday:`nädalapäev`,year:`aasta`};var yA={};yA={calendar:`Kalenteri`,day:`päivä`,dayPeriod:`vuorokaudenaika`,endDate:`Päättymispäivä`,era:`aikakausi`,hour:`tunti`,minute:`minuutti`,month:`kuukausi`,second:`sekunti`,selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.startDate} \u{2013} ${e.endDate}`,selectedTimeDescription:e=>`Valittu aika: ${e.time}`,startDate:`Alkamispäivä`,timeZoneName:`aikavyöhyke`,weekday:`viikonpäivä`,year:`vuosi`};var bA={};bA={calendar:`Calendrier`,day:`jour`,dayPeriod:`cadran`,endDate:`Date de fin`,era:`ère`,hour:`heure`,minute:`minute`,month:`mois`,second:`seconde`,selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.startDate} au ${e.endDate}`,selectedTimeDescription:e=>`Heure choisie\xa0: ${e.time}`,startDate:`Date de début`,timeZoneName:`fuseau horaire`,weekday:`jour de la semaine`,year:`année`};var xA={};xA={calendar:`לוח שנה`,day:`יום`,dayPeriod:`לפנה״צ/אחה״צ`,endDate:`תאריך סיום`,era:`תקופה`,hour:`שעה`,minute:`דקה`,month:`חודש`,second:`שנייה`,selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,selectedTimeDescription:e=>`\u{5D6}\u{5DE}\u{5DF} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.time}`,startDate:`תאריך התחלה`,timeZoneName:`אזור זמן`,weekday:`יום בשבוע`,year:`שנה`};var SA={};SA={calendar:`Kalendar`,day:`dan`,dayPeriod:`AM/PM`,endDate:`Datum završetka`,era:`era`,hour:`sat`,minute:`minuta`,month:`mjesec`,second:`sekunda`,selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Odabrano vrijeme: ${e.time}`,startDate:`Datum početka`,timeZoneName:`vremenska zona`,weekday:`dan u tjednu`,year:`godina`};var CA={};CA={calendar:`Naptár`,day:`nap`,dayPeriod:`napszak`,endDate:`Befejező dátum`,era:`éra`,hour:`óra`,minute:`perc`,month:`hónap`,second:`másodperc`,selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.startDate}\u{2013}${e.endDate}`,selectedTimeDescription:e=>`Kijel\xf6lt id\u{151}: ${e.time}`,startDate:`Kezdő dátum`,timeZoneName:`időzóna`,weekday:`hét napja`,year:`év`};var wA={};wA={calendar:`Calendario`,day:`giorno`,dayPeriod:`AM/PM`,endDate:`Data finale`,era:`era`,hour:`ora`,minute:`minuto`,month:`mese`,second:`secondo`,selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: da ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Ora selezionata: ${e.time}`,startDate:`Data iniziale`,timeZoneName:`fuso orario`,weekday:`giorno della settimana`,year:`anno`};var TA={};TA={calendar:`カレンダー`,day:`日`,dayPeriod:`午前/午後`,endDate:`終了日`,era:`時代`,hour:`時`,minute:`分`,month:`月`,second:`秒`,selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.startDate} \u{304B}\u{3089} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{6642}\u{9593} : ${e.time}`,startDate:`開始日`,timeZoneName:`タイムゾーン`,weekday:`曜日`,year:`年`};var EA={};EA={calendar:`달력`,day:`일`,dayPeriod:`오전/오후`,endDate:`종료일`,era:`연호`,hour:`시`,minute:`분`,month:`월`,second:`초`,selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.startDate} ~ ${e.endDate}`,selectedTimeDescription:e=>`\u{C120}\u{D0DD} \u{C2DC}\u{AC04}: ${e.time}`,startDate:`시작일`,timeZoneName:`시간대`,weekday:`요일`,year:`년`};var DA={};DA={calendar:`Kalendorius`,day:`diena`,dayPeriod:`iki pietų / po pietų`,endDate:`Pabaigos data`,era:`era`,hour:`valanda`,minute:`minutė`,month:`mėnuo`,second:`sekundė`,selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: nuo ${e.startDate} iki ${e.endDate}`,selectedTimeDescription:e=>`Pasirinktas laikas: ${e.time}`,startDate:`Pradžios data`,timeZoneName:`laiko juosta`,weekday:`savaitės diena`,year:`metai`};var OA={};OA={calendar:`Kalendārs`,day:`diena`,dayPeriod:`priekšpusdienā/pēcpusdienā`,endDate:`Beigu datums`,era:`ēra`,hour:`stundas`,minute:`minūtes`,month:`mēnesis`,second:`sekundes`,selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: no ${e.startDate} l\u{12B}dz ${e.endDate}`,selectedTimeDescription:e=>`Atlas\u{12B}tais laiks: ${e.time}`,startDate:`Sākuma datums`,timeZoneName:`laika josla`,weekday:`nedēļas diena`,year:`gads`};var kA={};kA={calendar:`Kalender`,day:`dag`,dayPeriod:`a.m./p.m.`,endDate:`Sluttdato`,era:`tidsalder`,hour:`time`,minute:`minutt`,month:`måned`,second:`sekund`,selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tid: ${e.time}`,startDate:`Startdato`,timeZoneName:`tidssone`,weekday:`ukedag`,year:`år`};var AA={};AA={calendar:`Kalender`,day:`dag`,dayPeriod:`a.m./p.m.`,endDate:`Einddatum`,era:`tijdperk`,hour:`uur`,minute:`minuut`,month:`maand`,second:`seconde`,selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.startDate} tot ${e.endDate}`,selectedTimeDescription:e=>`Geselecteerde tijd: ${e.time}`,startDate:`Startdatum`,timeZoneName:`tijdzone`,weekday:`dag van de week`,year:`jaar`};var jA={};jA={calendar:`Kalendarz`,day:`dzień`,dayPeriod:`rano / po południu / wieczorem`,endDate:`Data końcowa`,era:`era`,hour:`godzina`,minute:`minuta`,month:`miesiąc`,second:`sekunda`,selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Wybrany czas: ${e.time}`,startDate:`Data początkowa`,timeZoneName:`strefa czasowa`,weekday:`dzień tygodnia`,year:`rok`};var MA={};MA={calendar:`Calendário`,day:`dia`,dayPeriod:`AM/PM`,endDate:`Data final`,era:`era`,hour:`hora`,minute:`minuto`,month:`mês`,second:`segundo`,selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:`Data inicial`,timeZoneName:`fuso horário`,weekday:`dia da semana`,year:`ano`};var NA={};NA={calendar:`Calendário`,day:`dia`,dayPeriod:`am/pm`,endDate:`Data de Término`,era:`era`,hour:`hora`,minute:`minuto`,month:`mês`,second:`segundo`,selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:`Data de Início`,timeZoneName:`fuso horário`,weekday:`dia da semana`,year:`ano`};var PA={};PA={calendar:`Calendar`,day:`zi`,dayPeriod:`a.m/p.m.`,endDate:`Dată final`,era:`eră`,hour:`oră`,minute:`minut`,month:`lună`,second:`secundă`,selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: de la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,selectedTimeDescription:e=>`Ora selectat\u{103}: ${e.time}`,startDate:`Dată început`,timeZoneName:`fus orar`,weekday:`ziua din săptămână`,year:`an`};var FA={};FA={calendar:`Календарь`,day:`день`,dayPeriod:`AM/PM`,endDate:`Дата окончания`,era:`эра`,hour:`час`,minute:`минута`,month:`месяц`,second:`секунда`,selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: \u{441} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{43E}\u{435} \u{432}\u{440}\u{435}\u{43C}\u{44F}: ${e.time}`,startDate:`Дата начала`,timeZoneName:`часовой пояс`,weekday:`день недели`,year:`год`};var IA={};IA={calendar:`Kalendár`,day:`deň`,dayPeriod:`AM/PM`,endDate:`Dátum ukončenia`,era:`letopočet`,hour:`hodina`,minute:`minúta`,month:`mesiac`,second:`sekunda`,selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Vybrat\xfd \u{10D}as: ${e.time}`,startDate:`Dátum začatia`,timeZoneName:`časové pásmo`,weekday:`deň týždňa`,year:`rok`};var LA={};LA={calendar:`Koledar`,day:`dan`,dayPeriod:`dop/pop`,endDate:`Datum konca`,era:`doba`,hour:`ura`,minute:`minuta`,month:`mesec`,second:`sekunda`,selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izbrani \u{10D}as: ${e.time}`,startDate:`Datum začetka`,timeZoneName:`časovni pas`,weekday:`dan v tednu`,year:`leto`};var RA={};RA={calendar:`Kalendar`,day:`дан`,dayPeriod:`пре подне/по подне`,endDate:`Datum završetka`,era:`ера`,hour:`сат`,minute:`минут`,month:`месец`,second:`секунд`,selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani opseg: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izabrano vreme: ${e.time}`,startDate:`Datum početka`,timeZoneName:`временска зона`,weekday:`дан у недељи`,year:`година`};var zA={};zA={calendar:`Kalender`,day:`dag`,dayPeriod:`fm/em`,endDate:`Slutdatum`,era:`era`,hour:`timme`,minute:`minut`,month:`månad`,second:`sekund`,selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.startDate} till ${e.endDate}`,selectedTimeDescription:e=>`Vald tid: ${e.time}`,startDate:`Startdatum`,timeZoneName:`tidszon`,weekday:`veckodag`,year:`år`};var BA={};BA={calendar:`Takvim`,day:`gün`,dayPeriod:`ÖÖ/ÖS`,endDate:`Bitiş Tarihi`,era:`çağ`,hour:`saat`,minute:`dakika`,month:`ay`,second:`saniye`,selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.startDate} - ${e.endDate}`,selectedTimeDescription:e=>`Se\xe7ilen Zaman: ${e.time}`,startDate:`Başlangıç Tarihi`,timeZoneName:`saat dilimi`,weekday:`haftanın günü`,year:`yıl`};var VA={};VA={calendar:`Календар`,day:`день`,dayPeriod:`дп/пп`,endDate:`Дата завершення`,era:`ера`,hour:`година`,minute:`хвилина`,month:`місяць`,second:`секунда`,selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{2014} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{447}\u{430}\u{441}: ${e.time}`,startDate:`Дата початку`,timeZoneName:`часовий пояс`,weekday:`день тижня`,year:`рік`};var HA={};HA={calendar:`日历`,day:`日`,dayPeriod:`上午/下午`,endDate:`结束日期`,era:`纪元`,hour:`小时`,minute:`分钟`,month:`月`,second:`秒`,selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65F6}\u{95F4}\u{FF1A}${e.time}`,startDate:`开始日期`,timeZoneName:`时区`,weekday:`工作日`,year:`年`};var UA={};UA={calendar:`日曆`,day:`日`,dayPeriod:`上午/下午`,endDate:`結束日期`,era:`纪元`,hour:`小时`,minute:`分钟`,month:`月`,second:`秒`,selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{6642}\u{9593}\u{FF1A}${e.time}`,startDate:`開始日期`,timeZoneName:`时区`,weekday:`工作日`,year:`年`};var WA={};WA={"ar-AE":uA,"bg-BG":dA,"cs-CZ":fA,"da-DK":pA,"de-DE":mA,"el-GR":hA,"en-US":gA,"es-ES":_A,"et-EE":vA,"fi-FI":yA,"fr-FR":bA,"he-IL":xA,"hr-HR":SA,"hu-HU":CA,"it-IT":wA,"ja-JP":TA,"ko-KR":EA,"lt-LT":DA,"lv-LV":OA,"nb-NO":kA,"nl-NL":AA,"pl-PL":jA,"pt-BR":MA,"pt-PT":NA,"ro-RO":PA,"ru-RU":FA,"sk-SK":IA,"sl-SI":LA,"sr-SP":RA,"sv-SE":zA,"tr-TR":BA,"uk-UA":VA,"zh-CN":HA,"zh-TW":UA};function GA(e,t,n){let{direction:r}=rp(),i=(0,v.useMemo)(()=>Ug(t),[t]),{keyboardProps:a}=Sm({shortcuts:{"Alt+ArrowDown":()=>{if(`setOpen`in e){e.setOpen(!0);return}return!1},"Alt+ArrowUp":()=>{if(`setOpen`in e){e.setOpen(!0);return}return!1},ArrowLeft:e=>{if(n)return!1;if(r===`rtl`){if(t.current){let n=H(e),r=KA(t.current,n.getBoundingClientRect().left,-1);if(r){r.focus();return}}}else{i.focusPrevious();return}return!1},ArrowRight:e=>{if(n)return!1;if(r===`rtl`){if(t.current){let n=H(e),r=KA(t.current,n.getBoundingClientRect().left,1);if(r){r.focus();return}}}else{i.focusNext();return}return!1}},allowRepeats:!0}),o=()=>{if(!t.current)return;let e=window.event?H(window.event):null,n=Hg(t.current,{tabbable:!0});if(e&&=(n.currentNode=e,n.previousNode()),!e){let t;do t=n.lastChild(),t&&(e=t);while(t)}for(;e?.hasAttribute(`data-placeholder`);){let t=n.previousNode();if(t&&t.hasAttribute(`data-placeholder`))e=t;else break}e&&e.focus()},{pressProps:s}=Rm({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(e){e.pointerType===`mouse`&&o()},onPress(e){(e.pointerType===`touch`||e.pointerType===`pen`)&&o()}});return U(s,a)}function KA(e,t,n){let r=Hg(e,{tabbable:!0}),i=r.nextNode(),a=null,o=1/0;for(;i;){let e=i.getBoundingClientRect().left-t,s=Math.abs(e);Math.sign(e)===n&&s{t.confirmPlaceholder(),t.value!==u.current&&t.commitValidation(),e.onBlur?.(n)},onFocusWithinChange:e.onFocusChange}),f=rv(qA(WA),`@react-aria/datepicker`),p=t.maxGranularity===`hour`?`selectedTimeDescription`:`selectedDateDescription`,m=t.maxGranularity===`hour`?`time`:`date`,h=tc(t.value?f.format(p,{[m]:t.formatValue({month:`long`})}):``),g=e.__reactAriaDateFieldRole===`presentation`?s[`aria-describedby`]:[h[`aria-describedby`],s[`aria-describedby`]].filter(Boolean).join(` `)||void 0,_=e[XA],y=(0,v.useMemo)(()=>_||Ug(n),[_,n]),b=GA(t,n,e[YA]===`presentation`);JA.set(t,{ariaLabel:e[`aria-label`],ariaLabelledBy:[o.id,e[`aria-labelledby`]].filter(Boolean).join(` `)||void 0,ariaDescribedBy:g,focusManager:y});let x=(0,v.useRef)(e.autoFocus),S;S=e.__reactAriaDateFieldRole===`presentation`?{role:`presentation`}:U(s,{role:`group`,"aria-disabled":e.isDisabled||void 0,"aria-describedby":g}),(0,v.useEffect)(()=>{x.current&&y.focusFirst(),x.current=!1},[y]),cc(e.inputRef,t.defaultValue,t.setValue),$C({...e,focus(){y.focusFirst()}},t,e.inputRef);let C={type:`hidden`,name:e.name,form:e.form,value:t.value?.toString()||``,disabled:e.isDisabled};e.validationBehavior===`native`&&(C.type=`text`,C.hidden=!0,C.required=e.isRequired,C.onChange=()=>{});let w=W(e);return{labelProps:{...o,onClick:()=>{y.focusFirst()}},fieldProps:U(w,S,b,d,{onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,style:{unicodeBidi:`isolate`}}),inputProps:C,descriptionProps:c,errorMessageProps:l,isInvalid:r,validationErrors:i,validationDetails:a}}function QA(e,t,n){let r=ZA(e,t,n);return r.inputProps.value=t.timeValue?.toString()||``,r}function $A(e){e=sc(e??{},ej);let{locale:t}=rp();return(0,v.useMemo)(()=>new Qk(t,e),[t,e])}function ej(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(t[r]!==e[r])return!1;return!0}function tj(e){return e&&e.__esModule?e.default:e}function nj(){let{locale:e}=rp(),t=nv(tj(WA),`@react-aria/datepicker`);return(0,v.useMemo)(()=>{try{return new Intl.DisplayNames(e,{type:`dateTimeField`})}catch{return new rj(e,t)}},[e,t])}var rj=class{constructor(e,t){this.locale=e,this.dictionary=t}of(e){return this.dictionary.getStringForLocale(e,this.locale)}};function ij(e,t,n){let r=(0,v.useRef)(``),{locale:i,direction:a}=rp(),o=nj(),{ariaLabel:s,ariaLabelledBy:c,ariaDescribedBy:l,focusManager:u}=JA.get(t),d=e.isPlaceholder?``:e.text,f=(0,v.useMemo)(()=>t.dateFormatter.resolvedOptions(),[t.dateFormatter]),p=$A({month:`long`,timeZone:f.timeZone}),m=$A({hour:`numeric`,hour12:f.hour12,timeZone:f.timeZone});if(e.type===`month`&&!e.isPlaceholder){let e=p.format(t.dateValue);d=e===d?e:`${d} \u{2013} ${e}`}else e.type===`hour`&&!e.isPlaceholder&&(d=m.format(t.dateValue));let{spinButtonProps:h}=tE({value:e.value??void 0,textValue:d,minValue:e.minValue,maxValue:e.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly||!e.isEditable,isRequired:t.isRequired,onIncrement:()=>{r.current=``,t.increment(e.type)},onDecrement:()=>{r.current=``,t.decrement(e.type)},onIncrementPage:()=>{r.current=``,t.incrementPage(e.type)},onDecrementPage:()=>{r.current=``,t.decrementPage(e.type)},onIncrementToMax:()=>{r.current=``,t.incrementToMax(e.type)},onDecrementToMin:()=>{r.current=``,t.decrementToMin(e.type)}}),g=(0,v.useMemo)(()=>new pp(i,{maximumFractionDigits:0}),[i]),_=()=>{if(e.text===e.placeholder&&u.focusPrevious(),g.isValidPartialNumber(e.text)&&!t.isReadOnly&&!e.isPlaceholder){let n=e.text.slice(0,-1),i=g.parse(n);n=i===0?``:n,n.length===0||i===0?t.clearSegment(e.type):t.setSegment(e.type,i),r.current=n}else(e.type===`dayPeriod`||e.type===`era`)&&t.clearSegment(e.type)},{keyboardProps:y}=Sm({shortcuts:{Backspace:()=>{_()},Delete:()=>{_()},"Mod+a":()=>{}},allowRepeats:!0}),{startsWith:b}=TS({sensitivity:`base`}),x=$A({hour:`numeric`,hour12:!0}),S=(0,v.useMemo)(()=>{let e=new Date;return e.setHours(0),x.formatToParts(e).find(e=>e.type===`dayPeriod`).value},[x]),C=(0,v.useMemo)(()=>{let e=new Date;return e.setHours(12),x.formatToParts(e).find(e=>e.type===`dayPeriod`).value},[x]),w=$A({year:`numeric`,era:`narrow`,timeZone:`UTC`}),T=(0,v.useMemo)(()=>{if(e.type!==`era`)return[];let n=XD(new zO(1,1,1),t.calendar),r=t.calendar.getEras().map(e=>{let t=n.set({year:1,month:1,day:1,era:e}).toDate(`UTC`);return{era:e,formatted:w.formatToParts(t).find(e=>e.type===`era`).value}}),i=aj(r.map(e=>e.formatted));if(i)for(let e of r)e.formatted=e.formatted.slice(i);return r},[w,t.calendar,e.type]),E=n=>{if(t.isDisabled||t.isReadOnly)return;let i=r.current+n;switch(e.type){case`dayPeriod`:if(b(S,n))t.setSegment(`dayPeriod`,0);else if(b(C,n))t.setSegment(`dayPeriod`,1);else break;u.focusNext();break;case`era`:{let e=T.find(e=>b(e.formatted,n));e&&(t.setSegment(`era`,e.era),u.focusNext());break}case`day`:case`hour`:case`minute`:case`second`:case`month`:case`year`:{if(!g.isValidPartialNumber(i))return;let a=g.parse(i),o=a;if(e.maxValue!==void 0&&a>e.maxValue&&(o=g.parse(n)),isNaN(a))return;t.setSegment(e.type,o),e.maxValue!==void 0&&(Number(a+`0`)>e.maxValue||i.length>=String(e.maxValue).length)?(r.current=``,u.focusNext()):r.current=i;break}}},D=()=>{r.current=``,n.current&&ic(n.current,{containingElement:Gs(n.current)}),window.getSelection()?.collapse(n.current)};nc((0,v.useRef)(typeof document<`u`?document:null),`selectionchange`,()=>{let e=window.getSelection();e?.anchorNode&&ps(n.current,e?.anchorNode)&&ms()===n.current&&e.collapse(n.current)});let O=(0,v.useRef)(``);nc(n,`beforeinput`,r=>{if(n.current)switch(r.preventDefault(),r.inputType){case`deleteContentBackward`:case`deleteContentForward`:g.isValidPartialNumber(e.text)&&!t.isReadOnly&&_();break;case`insertCompositionText`:O.current=n.current.textContent,n.current.textContent=n.current.textContent;break;default:r.data!=null&&E(r.data)}}),nc(n,`input`,e=>{let{inputType:t,data:r}=e;t===`insertCompositionText`&&(n.current&&(n.current.textContent=O.current),r!=null&&(b(S,r)||b(C,r))&&E(r))}),Io(()=>{let e=n.current;return()=>{ms()===e&&(u.focusPrevious()||u.focusNext())}},[n,u]);let k=go()||e.type===`timeZoneName`?{role:`textbox`,"aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e!==(0,v.useMemo)(()=>t.segments.find(e=>e.isEditable),[t.segments])&&!t.isInvalid&&(l=void 0);let A=es(),j=!t.isDisabled&&!t.isReadOnly&&e.isEditable,M=Fs({"aria-label":`${e.type===`literal`?``:o.of(e.type)}${s?`, ${s}`:``}${c?`, `:``}`,"aria-labelledby":c});if(e.type===`literal`)return{segmentProps:{"aria-hidden":!0}};let N={caretColor:`transparent`};if(a===`rtl`){N.unicodeBidi=`embed`;let t=f[e.type];(t===`numeric`||t===`2-digit`)&&(N.direction=`ltr`)}return{segmentProps:U(h,M,{id:A,...k,...y,"aria-invalid":t.isInvalid?`true`:void 0,"aria-describedby":l,"aria-readonly":t.isReadOnly||!e.isEditable?`true`:void 0,"data-placeholder":e.isPlaceholder||void 0,contentEditable:j,suppressContentEditableWarning:j,spellCheck:j?`false`:void 0,autoCorrect:j?`off`:void 0,enterKeyHint:j?`next`:void 0,inputMode:t.isDisabled||e.type===`dayPeriod`||e.type===`era`||!j?void 0:`numeric`,tabIndex:t.isDisabled?void 0:0,onFocus:D,style:N,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}function aj(e){e.sort();let t=e[0],n=e[e.length-1];for(let e=0;e`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.maxValue} \u{623}\u{648} \u{642}\u{628}\u{644} \u{630}\u{644}\u{643}.`,rangeReversed:`تاريخ البدء يجب أن يكون قبل تاريخ الانتهاء.`,rangeUnderflow:e=>`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.minValue} \u{623}\u{648} \u{628}\u{639}\u{62F} \u{630}\u{644}\u{643}.`,unavailableDate:`البيانات المحددة غير متاحة.`};var sj={};sj={rangeOverflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.maxValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{440}\u{430}\u{43D}\u{43D}\u{430}.`,rangeReversed:`Началната дата трябва да е преди крайната.`,rangeUnderflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.minValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{43A}\u{44A}\u{441}\u{43D}\u{43E}.`,unavailableDate:`Избраната дата не е налична.`};var cj={};cj={rangeOverflow:e=>`Hodnota mus\xed b\xfdt ${e.maxValue} nebo d\u{159}\xedv\u{11B}j\u{161}\xed.`,rangeReversed:`Datum zahájení musí předcházet datu ukončení.`,rangeUnderflow:e=>`Hodnota mus\xed b\xfdt ${e.minValue} nebo pozd\u{11B}j\u{161}\xed.`,unavailableDate:`Vybrané datum není k dispozici.`};var lj={};lj={rangeOverflow:e=>`V\xe6rdien skal v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:`Startdatoen skal være før slutdatoen.`,rangeUnderflow:e=>`V\xe6rdien skal v\xe6re ${e.minValue} eller nyere.`,unavailableDate:`Den valgte dato er ikke tilgængelig.`};var uj={};uj={rangeOverflow:e=>`Der Wert muss ${e.maxValue} oder fr\xfcher sein.`,rangeReversed:`Das Startdatum muss vor dem Enddatum liegen.`,rangeUnderflow:e=>`Der Wert muss ${e.minValue} oder sp\xe4ter sein.`,unavailableDate:`Das ausgewählte Datum ist nicht verfügbar.`};var dj={};dj={rangeOverflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.maxValue} \u{3AE} \u{3C0}\u{3B1}\u{3BB}\u{3B1}\u{3B9}\u{3CC}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,rangeReversed:`Η ημερομηνία έναρξης πρέπει να είναι πριν από την ημερομηνία λήξης.`,rangeUnderflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.minValue} \u{3AE} \u{3BC}\u{3B5}\u{3C4}\u{3B1}\u{3B3}\u{3B5}\u{3BD}\u{3AD}\u{3C3}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,unavailableDate:`Η επιλεγμένη ημερομηνία δεν είναι διαθέσιμη.`};var fj={};fj={rangeUnderflow:e=>`Value must be ${e.minValue} or later.`,rangeOverflow:e=>`Value must be ${e.maxValue} or earlier.`,rangeReversed:`Start date must be before end date.`,unavailableDate:`Selected date unavailable.`};var pj={};pj={rangeOverflow:e=>`El valor debe ser ${e.maxValue} o anterior.`,rangeReversed:`La fecha de inicio debe ser anterior a la fecha de finalización.`,rangeUnderflow:e=>`El valor debe ser ${e.minValue} o posterior.`,unavailableDate:`Fecha seleccionada no disponible.`};var mj={};mj={rangeOverflow:e=>`V\xe4\xe4rtus peab olema ${e.maxValue} v\xf5i varasem.`,rangeReversed:`Alguskuupäev peab olema enne lõppkuupäeva.`,rangeUnderflow:e=>`V\xe4\xe4rtus peab olema ${e.minValue} v\xf5i hilisem.`,unavailableDate:`Valitud kuupäev pole saadaval.`};var hj={};hj={rangeOverflow:e=>`Arvon on oltava ${e.maxValue} tai sit\xe4 aikaisempi.`,rangeReversed:`Aloituspäivän on oltava ennen lopetuspäivää.`,rangeUnderflow:e=>`Arvon on oltava ${e.minValue} tai sit\xe4 my\xf6h\xe4isempi.`,unavailableDate:`Valittu päivämäärä ei ole käytettävissä.`};var gj={};gj={rangeOverflow:e=>`La valeur doit \xeatre ${e.maxValue} ou ant\xe9rieure.`,rangeReversed:`La date de début doit être antérieure à la date de fin.`,rangeUnderflow:e=>`La valeur doit \xeatre ${e.minValue} ou ult\xe9rieure.`,unavailableDate:`La date sélectionnée n’est pas disponible.`};var _j={};_j={rangeOverflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.maxValue} \u{5D0}\u{5D5} \u{5DE}\u{5D5}\u{5E7}\u{5D3}\u{5DD} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,rangeReversed:`תאריך ההתחלה חייב להיות לפני תאריך הסיום.`,rangeUnderflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.minValue} \u{5D0}\u{5D5} \u{5DE}\u{5D0}\u{5D5}\u{5D7}\u{5E8} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,unavailableDate:`התאריך הנבחר אינו זמין.`};var vj={};vj={rangeOverflow:e=>`Vrijednost mora biti ${e.maxValue} ili ranije.`,rangeReversed:`Datum početka mora biti prije datuma završetka.`,rangeUnderflow:e=>`Vrijednost mora biti ${e.minValue} ili kasnije.`,unavailableDate:`Odabrani datum nije dostupan.`};var yj={};yj={rangeOverflow:e=>`Az \xe9rt\xe9knek ${e.maxValue} vagy kor\xe1bbinak kell lennie.`,rangeReversed:`A kezdő dátumnak a befejező dátumnál korábbinak kell lennie.`,rangeUnderflow:e=>`Az \xe9rt\xe9knek ${e.minValue} vagy k\xe9s\u{151}bbinek kell lennie.`,unavailableDate:`A kiválasztott dátum nem érhető el.`};var bj={};bj={rangeOverflow:e=>`Il valore deve essere ${e.maxValue} o precedente.`,rangeReversed:`La data di inizio deve essere antecedente alla data di fine.`,rangeUnderflow:e=>`Il valore deve essere ${e.minValue} o successivo.`,unavailableDate:`Data selezionata non disponibile.`};var xj={};xj={rangeOverflow:e=>`\u{5024}\u{306F} ${e.maxValue} \u{4EE5}\u{4E0B}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,rangeReversed:`開始日は終了日より前にする必要があります。`,rangeUnderflow:e=>`\u{5024}\u{306F} ${e.minValue} \u{4EE5}\u{4E0A}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,unavailableDate:`選択した日付は使用できません。`};var Sj={};Sj={rangeOverflow:e=>`\u{AC12}\u{C740} ${e.maxValue} \u{C774}\u{C804}\u{C774}\u{C5B4}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,rangeReversed:`시작일은 종료일 이전이어야 합니다.`,rangeUnderflow:e=>`\u{AC12}\u{C740} ${e.minValue} \u{C774}\u{D6C4}\u{C5EC}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,unavailableDate:`선택한 날짜를 사용할 수 없습니다.`};var Cj={};Cj={rangeOverflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.maxValue} arba ankstesn\u{117}.`,rangeReversed:`Pradžios data turi būti ankstesnė nei pabaigos data.`,rangeUnderflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.minValue} arba naujesn\u{117}.`,unavailableDate:`Pasirinkta data nepasiekiama.`};var wj={};wj={rangeOverflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.maxValue} vai agr\u{101}kai.`,rangeReversed:`Sākuma datumam ir jābūt pirms beigu datuma.`,rangeUnderflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.minValue} vai v\u{113}l\u{101}kai.`,unavailableDate:`Atlasītais datums nav pieejams.`};var Tj={};Tj={rangeOverflow:e=>`Verdien m\xe5 v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:`Startdatoen må være før sluttdatoen.`,rangeUnderflow:e=>`Verdien m\xe5 v\xe6re ${e.minValue} eller senere.`,unavailableDate:`Valgt dato utilgjengelig.`};var Ej={};Ej={rangeOverflow:e=>`Waarde moet ${e.maxValue} of eerder zijn.`,rangeReversed:`De startdatum moet voor de einddatum liggen.`,rangeUnderflow:e=>`Waarde moet ${e.minValue} of later zijn.`,unavailableDate:`Geselecteerde datum niet beschikbaar.`};var Dj={};Dj={rangeOverflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.maxValue} lub wcze\u{15B}niejsz\u{105}.`,rangeReversed:`Data rozpoczęcia musi być wcześniejsza niż data zakończenia.`,rangeUnderflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.minValue} lub p\xf3\u{17A}niejsz\u{105}.`,unavailableDate:`Wybrana data jest niedostępna.`};var Oj={};Oj={rangeOverflow:e=>`O valor deve ser ${e.maxValue} ou anterior.`,rangeReversed:`A data inicial deve ser anterior à data final.`,rangeUnderflow:e=>`O valor deve ser ${e.minValue} ou posterior.`,unavailableDate:`Data selecionada indisponível.`};var kj={};kj={rangeOverflow:e=>`O valor tem de ser ${e.maxValue} ou anterior.`,rangeReversed:`A data de início deve ser anterior à data de fim.`,rangeUnderflow:e=>`O valor tem de ser ${e.minValue} ou posterior.`,unavailableDate:`Data selecionada indisponível.`};var Aj={};Aj={rangeOverflow:e=>`Valoarea trebuie s\u{103} fie ${e.maxValue} sau anterioar\u{103}.`,rangeReversed:`Data de început trebuie să fie anterioară datei de sfârșit.`,rangeUnderflow:e=>`Valoarea trebuie s\u{103} fie ${e.minValue} sau ulterioar\u{103}.`,unavailableDate:`Data selectată nu este disponibilă.`};var jj={};jj={rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{43F}\u{43E}\u{437}\u{436}\u{435} ${e.maxValue}.`,rangeReversed:`Дата начала должна предшествовать дате окончания.`,rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{44C}\u{448}\u{435} ${e.minValue}.`,unavailableDate:`Выбранная дата недоступна.`};var Mj={};Mj={rangeOverflow:e=>`Hodnota mus\xed by\u{165} ${e.maxValue} alebo skor\u{161}ia.`,rangeReversed:`Dátum začiatku musí byť skorší ako dátum konca.`,rangeUnderflow:e=>`Hodnota mus\xed by\u{165} ${e.minValue} alebo neskor\u{161}ia.`,unavailableDate:`Vybratý dátum je nedostupný.`};var Nj={};Nj={rangeOverflow:e=>`Vrednost mora biti ${e.maxValue} ali starej\u{161}a.`,rangeReversed:`Začetni datum mora biti pred končnim datumom.`,rangeUnderflow:e=>`Vrednost mora biti ${e.minValue} ali novej\u{161}a.`,unavailableDate:`Izbrani datum ni na voljo.`};var Pj={};Pj={rangeOverflow:e=>`Vrednost mora da bude ${e.maxValue} ili starija.`,rangeReversed:`Datum početka mora biti pre datuma završetka.`,rangeUnderflow:e=>`Vrednost mora da bude ${e.minValue} ili novija.`,unavailableDate:`Izabrani datum nije dostupan.`};var Fj={};Fj={rangeOverflow:e=>`V\xe4rdet m\xe5ste vara ${e.maxValue} eller tidigare.`,rangeReversed:`Startdatumet måste vara före slutdatumet.`,rangeUnderflow:e=>`V\xe4rdet m\xe5ste vara ${e.minValue} eller senare.`,unavailableDate:`Det valda datumet är inte tillgängligt.`};var Ij={};Ij={rangeOverflow:e=>`De\u{11F}er, ${e.maxValue} veya \xf6ncesi olmal\u{131}d\u{131}r.`,rangeReversed:`Başlangıç tarihi bitiş tarihinden önce olmalıdır.`,rangeUnderflow:e=>`De\u{11F}er, ${e.minValue} veya sonras\u{131} olmal\u{131}d\u{131}r.`,unavailableDate:`Seçilen tarih kullanılamıyor.`};var Lj={};Lj={rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{43F}\u{456}\u{437}\u{43D}\u{456}\u{448}\u{435} ${e.maxValue}.`,rangeReversed:`Дата початку має передувати даті завершення.`,rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{456}\u{448}\u{435} ${e.minValue}.`,unavailableDate:`Вибрана дата недоступна.`};var Rj={};Rj={rangeOverflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{65E5}\u{671F}\u{3002}`,rangeReversed:`开始日期必须早于结束日期。`,rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{65E5}\u{671F}\u{3002}`,unavailableDate:`所选日期不可用。`};var zj={};zj={rangeOverflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{3002}`,rangeReversed:`開始日期必須在結束日期之前。`,rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{3002}`,unavailableDate:`所選日期無法使用。`};var Bj={};Bj={"ar-AE":oj,"bg-BG":sj,"cs-CZ":cj,"da-DK":lj,"de-DE":uj,"el-GR":dj,"en-US":fj,"es-ES":pj,"et-EE":mj,"fi-FI":hj,"fr-FR":gj,"he-IL":_j,"hr-HR":vj,"hu-HU":yj,"it-IT":bj,"ja-JP":xj,"ko-KR":Sj,"lt-LT":Cj,"lv-LV":wj,"nb-NO":Tj,"nl-NL":Ej,"pl-PL":Dj,"pt-BR":Oj,"pt-PT":kj,"ro-RO":Aj,"ru-RU":jj,"sk-SK":Mj,"sl-SI":Nj,"sr-SP":Pj,"sv-SE":Fj,"tr-TR":Ij,"uk-UA":Lj,"zh-CN":Rj,"zh-TW":zj};function Vj(e){return e&&e.__esModule?e.default:e}var Hj=new q_(Vj(Bj));function Uj(){let e=typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e=`en-US`}return e}function Wj(e,t,n,r,i){let a=e!=null&&n!=null&&e.compare(n)>0,o=e!=null&&t!=null&&e.compare(t)<0,s=e!=null&&r?.(e)||!1,c=a||o||s,l=[];if(c){let e=Uj(),r=new $_(e,q_.getGlobalDictionaryForPackage(`@react-stately/datepicker`)||Hj),c=new Qk(e,Jj({},i)),u=c.resolvedOptions().timeZone;o&&t!=null&&l.push(r.format(`rangeUnderflow`,{minValue:c.format(t.toDate(u))})),a&&n!=null&&l.push(r.format(`rangeOverflow`,{maxValue:c.format(n.toDate(u))})),s&&l.push(r.format(`unavailableDate`))}return{isInvalid:c,validationErrors:l,validationDetails:{badInput:s,customError:!1,patternMismatch:!1,rangeOverflow:a,rangeUnderflow:o,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!c}}}function Gj(e,t,n,r,i){let a=BS(Wj(e?.start??null,t,n,r,i),Wj(e?.end??null,t,n,r,i));if(e?.end!=null&&e.start!=null&&e.end.compare(e.start)<0){let e=q_.getGlobalDictionaryForPackage(`@react-stately/datepicker`)||Hj;a=BS(a,{isInvalid:!0,validationErrors:[e.getStringForLocale(`rangeReversed`,Uj())],validationDetails:{...kS,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})}return a}var Kj={year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`2-digit`,second:`2-digit`},qj={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`};function Jj(e,t){e={...t.shouldForceLeadingZeros?qj:Kj,...e};let n=t.granularity||`minute`,r=Object.keys(e),i=r.indexOf(t.maxGranularity??`year`);i<0&&(i=0);let a=r.indexOf(n);if(a<0&&(a=2),i>a)throw Error(`maxGranularity must be greater than granularity`);let o=r.slice(i,a+1).reduce((t,n)=>(t[n]=e[n],t),{});return t.hourCycle!=null&&(o.hour12=t.hourCycle===12),o.timeZone=t.timeZone||`UTC`,(n===`hour`||n===`minute`||n===`second`)&&t.timeZone&&!t.hideTimeZone&&(o.timeZoneName=`short`),t.showEra&&i===0&&(o.era=`short`),o}function Yj(e){return e&&`hour`in e?e:new BO}function Xj(e,t){if(e===null)return null;if(e)return XD(e,t)}function Zj(e,t,n,r){if(e)return Xj(e,n);let i=XD(hD(r??SD()).set({hour:0,minute:0,second:0,millisecond:0}),n);return t===`year`||t===`month`||t===`day`?qD(i):r?i:JD(i)}function Qj(e,t){let n=e&&`timeZone`in e?e.timeZone:void 0,r=e&&`minute`in e?`minute`:`day`;if(e&&t&&!(t in e))throw Error(`Invalid granularity `+t+` for value `+e.toString());let[i,a]=(0,v.useState)([r,n]);e&&(i[0]!==r||i[1]!==n)&&a([r,n]),t||=e?r:i[0];let o=e?n:i[1];return[t,o]}var $j=new q_({ach:{year:`mwaka`,month:`dwe`,day:`nino`},af:{year:`jjjj`,month:`mm`,day:`dd`},am:{year:`ዓዓዓዓ`,month:`ሚሜ`,day:`ቀቀ`},an:{year:`aaaa`,month:`mm`,day:`dd`},ar:{year:`سنة`,month:`شهر`,day:`يوم`},ast:{year:`aaaa`,month:`mm`,day:`dd`},az:{year:`iiii`,month:`aa`,day:`gg`},be:{year:`гггг`,month:`мм`,day:`дд`},bg:{year:`гггг`,month:`мм`,day:`дд`},bn:{year:`yyyy`,month:`মিমি`,day:`dd`},br:{year:`bbbb`,month:`mm`,day:`dd`},bs:{year:`gggg`,month:`mm`,day:`dd`},ca:{year:`aaaa`,month:`mm`,day:`dd`},cak:{year:`jjjj`,month:`ii`,day:`q'q'`},ckb:{year:`ساڵ`,month:`مانگ`,day:`ڕۆژ`},cs:{year:`rrrr`,month:`mm`,day:`dd`},cy:{year:`bbbb`,month:`mm`,day:`dd`},da:{year:`åååå`,month:`mm`,day:`dd`},de:{year:`jjjj`,month:`mm`,day:`tt`},dsb:{year:`llll`,month:`mm`,day:`źź`},el:{year:`εεεε`,month:`μμ`,day:`ηη`},en:{year:`yyyy`,month:`mm`,day:`dd`},eo:{year:`jjjj`,month:`mm`,day:`tt`},es:{year:`aaaa`,month:`mm`,day:`dd`},et:{year:`aaaa`,month:`kk`,day:`pp`},eu:{year:`uuuu`,month:`hh`,day:`ee`},fa:{year:`سال`,month:`ماه`,day:`روز`},ff:{year:`hhhh`,month:`ll`,day:`ññ`},fi:{year:`vvvv`,month:`kk`,day:`pp`},fr:{year:`aaaa`,month:`mm`,day:`jj`},fy:{year:`jjjj`,month:`mm`,day:`dd`},ga:{year:`bbbb`,month:`mm`,day:`ll`},gd:{year:`bbbb`,month:`mm`,day:`ll`},gl:{year:`aaaa`,month:`mm`,day:`dd`},he:{year:`שנה`,month:`חודש`,day:`יום`},hr:{year:`gggg`,month:`mm`,day:`dd`},hsb:{year:`llll`,month:`mm`,day:`dd`},hu:{year:`éééé`,month:`hh`,day:`nn`},ia:{year:`aaaa`,month:`mm`,day:`dd`},id:{year:`tttt`,month:`bb`,day:`hh`},is:{year:`áááá`,month:`mm`,day:`dd`},it:{year:`aaaa`,month:`mm`,day:`gg`},ja:{year:`年`,month:`月`,day:`日`},ka:{year:`წწწწ`,month:`თთ`,day:`რრ`},kk:{year:`жжжж`,month:`аа`,day:`кк`},kn:{year:`ವವವವ`,month:`ಮಿಮೀ`,day:`ದಿದಿ`},ko:{year:`연도`,month:`월`,day:`일`},lb:{year:`jjjj`,month:`mm`,day:`dd`},lo:{year:`ປປປປ`,month:`ດດ`,day:`ວວ`},lt:{year:`mmmm`,month:`mm`,day:`dd`},lv:{year:`gggg`,month:`mm`,day:`dd`},meh:{year:`aaaa`,month:`mm`,day:`dd`},ml:{year:`വർഷം`,month:`മാസം`,day:`തീയതി`},ms:{year:`tttt`,month:`mm`,day:`hh`},nb:{year:`åååå`,month:`mm`,day:`dd`},nl:{year:`jjjj`,month:`mm`,day:`dd`},nn:{year:`åååå`,month:`mm`,day:`dd`},no:{year:`åååå`,month:`mm`,day:`dd`},oc:{year:`aaaa`,month:`mm`,day:`jj`},pl:{year:`rrrr`,month:`mm`,day:`dd`},pt:{year:`aaaa`,month:`mm`,day:`dd`},rm:{year:`oooo`,month:`mm`,day:`dd`},ro:{year:`aaaa`,month:`ll`,day:`zz`},ru:{year:`гггг`,month:`мм`,day:`дд`},sc:{year:`aaaa`,month:`mm`,day:`dd`},scn:{year:`aaaa`,month:`mm`,day:`jj`},sk:{year:`rrrr`,month:`mm`,day:`dd`},sl:{year:`llll`,month:`mm`,day:`dd`},sr:{year:`гггг`,month:`мм`,day:`дд`},"sr-Latn":{year:`gggg`,month:`mm`,day:`dd`},sv:{year:`åååå`,month:`mm`,day:`dd`},szl:{year:`rrrr`,month:`mm`,day:`dd`},tg:{year:`сссс`,month:`мм`,day:`рр`},th:{year:`ปปปป`,month:`ดด`,day:`วว`},tr:{year:`yyyy`,month:`aa`,day:`gg`},uk:{year:`рррр`,month:`мм`,day:`дд`},"zh-CN":{year:`年`,month:`月`,day:`日`},"zh-TW":{year:`年`,month:`月`,day:`日`}},`en`);function eM(e,t,n){return e===`era`||e===`dayPeriod`?t:e===`year`||e===`month`||e===`day`?$j.getStringForLocale(e,n):`––`}var tM=class e{constructor(e,t,n){if(this.era=n?.era??null,this.calendar=e,this.year=n?.year??null,this.month=n?.month??null,this.day=n?.day??null,this.hour=n?.hour??null,this.hourCycle=t,this.dayPeriod=null,this.minute=n?.minute??null,this.second=n?.second??null,this.millisecond=n?.millisecond??null,this.offset=`offset`in(n??{})?n.offset:null,this.hour!=null){let[e,n]=rM(this.hour,t);this.dayPeriod=e,this.hour=n}}copy(){let t=new e(this.calendar,this.hourCycle);return t.era=this.era,t.year=this.year,t.month=this.month,t.day=this.day,t.hour=this.hour,t.dayPeriod=this.dayPeriod,t.minute=this.minute,t.second=this.second,t.millisecond=this.millisecond,t.offset=this.offset,t}isComplete(e){return e.every(e=>this[e]!=null)}validate(e,t){return t.every(t=>{if((t===`hour`||t===`dayPeriod`)&&`hour`in e){let[t,n]=rM(e.hour,this.hourCycle);return this.dayPeriod===t&&this.hour===n}return this[t]===e[t]})}isCleared(e){return e.every(e=>this[e]===null)}set(e,t,n){let r=this.copy();return r[e]=t,e===`hour`&&r.dayPeriod==null&&`hour`in n&&(r.dayPeriod=rM(n.hour,this.hourCycle)[0]),e===`year`&&r.era==null&&(r.era=n.era),e!==`second`&&e!==`literal`&&e!==`timeZoneName`&&(r.offset=null),r}clear(e){let t=this.copy();return t[e]=null,e===`year`&&(t.era=null),t.offset=null,t}cycle(e,t,n,r){let i=this.copy();if(i[e]==null&&e!==`dayPeriod`&&e!==`era`){if(e===`hour`&&`hour`in n){let[e,t]=rM(n.hour,this.hourCycle);i.dayPeriod=e,i.hour=t}else i[e]=n[e];return e===`year`&&i.era==null&&(i.era=n.era),i}switch(e){case`era`:{let e=this.calendar.getEras(),n=e.indexOf(i.era);n=nM(n,t,0,e.length-1),i.era=e[n];break}case`year`:{let r=new zO(this.calendar,this.era??n.era,this.year??n.year,this.month??1,this.day??1);r=r.cycle(e,t,{round:e===`year`}),i.era=r.era,i.year=r.year;break}case`month`:i.month=nM(i.month??1,t,1,this.calendar.getMaximumMonthsInYear());break;case`day`:i.day=nM(i.day??1,t,1,this.calendar.getMaximumDaysInMonth());break;case`hour`:{let e=r.some(e=>[`year`,`month`,`day`].includes(e));if(`timeZone`in n&&(!e||i.year!=null&&i.month!=null&&i.day!=null)){let e=this.toValue(n);e=e.cycle(`hour`,t,{hourCycle:this.hourCycle===`h12`?12:24,round:!1});let[r,a]=rM(e.hour,this.hourCycle);i.hour=a,i.dayPeriod=r,i.offset=e.offset}else{let e=i.hour??0,r=this.getSegmentLimits(`hour`);i.hour=nM(e,t,r.minValue,r.maxValue),i.dayPeriod==null&&`hour`in n&&(i.dayPeriod=rM(n.hour,this.hourCycle)[0])}break}case`dayPeriod`:i.dayPeriod=nM(i.dayPeriod??0,t,0,1);break;case`minute`:i.minute=nM(i.minute??0,t,0,59,!0);break;case`second`:i.second=nM(i.second??0,t,0,59,!0)}return i}toValue(e){if(`hour`in e){let t=this.hour;t==null?(this.hourCycle===`h12`||this.hourCycle===`h11`)&&(t=this.dayPeriod===1?12:0):t=iM(t,this.dayPeriod??0,this.hourCycle);let n=e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day,hour:t??e.hour,minute:this.minute??e.minute,second:this.second??e.second,millisecond:this.millisecond??e.millisecond});return`offset`in n&&this.offset!=null&&n.offset!==this.offset&&(n=n.add({milliseconds:n.offset-this.offset})),n}return e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day})}getSegmentLimits(e){switch(e){case`era`:{let e=this.calendar.getEras();return{value:this.era==null?e.length-1:e.indexOf(this.era),minValue:0,maxValue:e.length-1}}case`year`:return{value:this.year,minValue:1,maxValue:9999};case`month`:return{value:this.month,minValue:1,maxValue:this.calendar.getMaximumMonthsInYear()};case`day`:return{value:this.day,minValue:1,maxValue:this.calendar.getMaximumDaysInMonth()};case`dayPeriod`:return{value:this.dayPeriod,minValue:0,maxValue:1};case`hour`:{let e=0,t=23;return this.hourCycle===`h12`?(e=1,t=12):this.hourCycle===`h11`&&(e=0,t=11),{value:this.hour,minValue:e,maxValue:t}}case`minute`:return{value:this.minute,minValue:0,maxValue:59};case`second`:return{value:this.second,minValue:0,maxValue:59}}}};function nM(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e0?Math.ceil(e/i)*i:Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,er&&(e=n+(e-r-1));return e}function rM(e,t){let n=+(e>=12);switch(t){case`h11`:e>=12&&(e-=12);break;case`h12`:e===0?e=12:e>12&&(e-=12);break;case`h23`:n=null;break;case`h24`:e+=1,n=null}return[n,e]}function iM(e,t,n){switch(n){case`h11`:t===1&&(e+=12);break;case`h12`:e===12&&(e=0),t===1&&(e+=12);break;case`h24`:--e}return e}var aM={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},oM={year:5,month:2,day:7,hour:2,minute:15,second:15},sM={dayperiod:`dayPeriod`,relatedYear:`year`,yearName:`literal`,unknown:`literal`};function cM(e){let{locale:t,createCalendar:n,hideTimeZone:r,isDisabled:i=!1,isReadOnly:a=!1,isRequired:o=!1,minValue:s,maxValue:c,isDateUnavailable:l}=e,u=e.value||e.defaultValue||e.placeholderValue||null,[d,f]=Qj(u,e.granularity),p=f||`UTC`;if(u&&!(d in u))throw Error(`Invalid granularity `+d+` for value `+u.toString());let[m,h]=(0,v.useMemo)(()=>{let r=new Qk(t,{dateStyle:`short`,timeStyle:`short`,hour12:e.hourCycle==null?void 0:e.hourCycle===12}).resolvedOptions();return[n(r.calendar),r.hourCycle]},[t,e.hourCycle,n]),[g,_]=sh(e.value,e.defaultValue??null,e.onChange),[y]=(0,v.useState)(g),b=(0,v.useMemo)(()=>Xj(g,m)??null,[g,m]),[x,S]=(0,v.useState)(()=>new tM(m,h,b)),C=m.identifier===`gregory`&&x.era===`BC`,w=(0,v.useMemo)(()=>({granularity:d,maxGranularity:e.maxGranularity??`year`,timeZone:f,hideTimeZone:r,hourCycle:e.hourCycle,showEra:C,shouldForceLeadingZeros:e.shouldForceLeadingZeros}),[e.maxGranularity,d,e.hourCycle,e.shouldForceLeadingZeros,f,r,C]),T=(0,v.useMemo)(()=>Jj({},w),[w]),E=(0,v.useMemo)(()=>new Qk(t,T),[t,T]),D=(0,v.useMemo)(()=>E.resolvedOptions(),[E]),O=(0,v.useMemo)(()=>Zj(e.placeholderValue,d,m,f),[e.placeholderValue,d,m,f]),k=(0,v.useMemo)(()=>{let t=h===`h11`||h===`h12`,n=[`era`,`year`,`month`,`day`,`hour`,...t?[`dayPeriod`]:[],`minute`,`second`],r=n.indexOf(e.maxGranularity||`era`),i=n.indexOf(d===`hour`&&t?`dayPeriod`:d);return n.slice(r,i+1)},[e.maxGranularity,d,h]),[A,j]=(0,v.useState)(b),[M,N]=(0,v.useState)(m),[P,ee]=(0,v.useState)(h);(b!==A||h!==P||!dD(m,M))&&(x=new tM(m,h,b),j(b),N(m),ee(h),S(x));let F=t=>{if(!(e.isDisabled||e.isReadOnly)){if(t==null||t instanceof tM&&t.isCleared(k))S(new tM(m,h,b)),_(null);else if(!(t instanceof tM))t=XD(t,u?.calendar||new aD),S(new tM(m,h,b)),_(t);else{if(t.isComplete(k)){let e=t.toValue(b??O);if(t.validate(e,k)){let t=XD(e,u?.calendar||new aD);if(!g||t.compare(g)!==0){S(new tM(m,h,b)),_(t);return}}}S(t)}}},I=(0,v.useMemo)(()=>x.toValue(b??O).toDate(p),[x,p,b,O]),L=(0,v.useMemo)(()=>lM(I,x,E,D,m,t,d),[I,E,D,x,m,t,d]),te=(e,t)=>{F(x.cycle(e,t,O,k))},R=(0,v.useMemo)(()=>Wj(g,s,c,l,w),[g,s,c,l,w]),z=PS({...e,value:g,builtinValidation:R}),B=z.displayValidation.isInvalid,ne=e.validationState||(B?`invalid`:null);return{...z,value:b,defaultValue:e.defaultValue??y,dateValue:I,calendar:m,setValue:F,segments:L,dateFormatter:E,validationState:ne,isInvalid:B,granularity:d,maxGranularity:e.maxGranularity??`year`,isDisabled:i,isReadOnly:a,isRequired:o,increment(e){te(e,1)},decrement(e){te(e,-1)},incrementPage(e){te(e,oM[e]||1)},decrementPage(e){te(e,-(oM[e]||1))},incrementToMax(e){let t=e===`hour`&&h===`h12`?11:x.getSegmentLimits(e).maxValue;F(x.set(e,t,O))},decrementToMin(e){let t=e===`hour`&&h===`h12`?12:x.getSegmentLimits(e).minValue;F(x.set(e,t,O))},setSegment(e,t){F(x.set(e,t,O))},confirmPlaceholder(){if(!(e.isDisabled||e.isReadOnly)&&x.isComplete(k)){let e=XD(x.toValue(b??O),u?.calendar||new aD);(!g||e.compare(g)!==0)&&_(e),S(new tM(m,h,b))}},clearSegment(e){let t=x;e!==`timeZoneName`&&e!==`literal`&&(t=x.clear(e)),F(t)},formatValue(e){if(!b)return``;let n=Jj(e,w);return new Qk(t,n).format(I)},getDateFormatter(e,t){return new Qk(e,Jj({},{...w,...t}))}}}function lM(e,t,n,r,i,a,o){let s=[`hour`,`minute`,`second`],c=n.formatToParts(e),l=new cp(a,{useGrouping:!1}),u=new cp(a,{useGrouping:!1,minimumIntegerDigits:2});for(let e of c)if(e.type===`year`||e.type===`month`||e.type===`day`||e.type===`hour`){let n=t[e.type]??0;e.value=r[e.type]===`2-digit`?u.format(n):l.format(n)}let d=[];for(let e of c){let n=sM[e.type]||e.type,r=aM[n];n===`era`&&i.getEras().length===1&&(r=!1);let c=aM[n]&&t[e.type]==null,l=aM[n]?eM(n,e.value,a):null,u={type:n,text:c?l:e.value,...t.getSegmentLimits(n),isPlaceholder:c,placeholder:l,isEditable:r};n===`hour`?(d.push({type:`literal`,text:`⁦`,isPlaceholder:!1,placeholder:``,isEditable:!1}),d.push(u),n===o&&d.push({type:`literal`,text:`⁩`,isPlaceholder:!1,placeholder:``,isEditable:!1})):s.includes(n)&&n===o?(d.push(u),d.push({type:`literal`,text:`⁩`,isPlaceholder:!1,placeholder:``,isEditable:!1})):d.push(u)}return d}function uM(e){let{placeholderValue:t=new BO,minValue:n,maxValue:r,defaultValue:i,granularity:a,validate:o}=e,[s,c]=sh(e.value,i??null,e.onChange),l=s||t,u=l&&`day`in l?l:void 0,d=i&&`timeZone`in i?i.timeZone:void 0,f=(0,v.useMemo)(()=>{let e=l&&`timeZone`in l?l.timeZone:void 0;return(e||d)&&t?ZD(dM(t),e||d):dM(t)},[t,l,d]),p=(0,v.useMemo)(()=>dM(n,u),[n,u]),m=(0,v.useMemo)(()=>dM(r,u),[r,u]),h=(0,v.useMemo)(()=>s&&`day`in s?YD(s):s,[s]),g=(0,v.useMemo)(()=>s==null?null:dM(s),[s]),_=(0,v.useMemo)(()=>i==null?null:dM(i),[i]),y=e=>{c(u||d?e:e&&YD(e))};return{...cM({...e,value:g,defaultValue:_,minValue:p,maxValue:m,onChange:y,granularity:a||`minute`,maxGranularity:`hour`,placeholderValue:f??void 0,createCalendar:()=>new aD,validate:(0,v.useCallback)(()=>o?.(s),[o,s])}),timeValue:h}}function dM(e,t=gD(SD())){return e?`day`in e?e:JD(t,e):null}var fM=(0,v.createContext)(null),pM=(0,v.createContext)(null),mM=(0,v.createContext)(null),hM=(0,v.createContext)(null),gM=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,fM);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,{locale:i}=rp(),a=cM({...e,locale:i,createCalendar:Xk,validationBehavior:r}),o=(0,v.useRef)(null),[s,c]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),l=(0,v.useRef)(null),{labelProps:u,fieldProps:d,inputProps:f,descriptionProps:p,errorMessageProps:m,...h}=ZA({...Lf(e),label:c,inputRef:l,validationBehavior:r},a,o),g=Mf({...Lf(e),values:{state:a,isInvalid:a.isInvalid,isDisabled:a.isDisabled,isReadOnly:a.isReadOnly,isRequired:e.isRequired||!1},defaultClassName:`react-aria-DateField`}),_=W(e,{global:!0});return delete _.id,v.createElement(jf,{values:[[mM,a],[ES,{...d,ref:o,isInvalid:a.isInvalid,isDisabled:a.isDisabled}],[dT,{...f,ref:l}],[Wf,{...u,ref:s,elementType:`span`}],[sb,{slots:{description:p,errorMessage:m}}],[OS,h]]},v.createElement(q.div,{..._,...g,ref:t,slot:e.slot||void 0,"data-invalid":a.isInvalid||void 0,"data-disabled":a.isDisabled||void 0,"data-readonly":a.isReadOnly||void 0,"data-required":e.isRequired||void 0}),v.createElement(lA,{autoComplete:e.autoComplete,name:e.name,isDisabled:e.isDisabled,state:a}))}),_M=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,pM);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,{locale:i}=rp(),a=uM({...e,locale:i,validationBehavior:r}),o=(0,v.useRef)(null),[s,c]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),l=(0,v.useRef)(null),{labelProps:u,fieldProps:d,inputProps:f,descriptionProps:p,errorMessageProps:m,...h}=QA({...Lf(e),label:c,inputRef:l,validationBehavior:r},a,o),g=Mf({...e,values:{state:a,isInvalid:a.isInvalid,isDisabled:a.isDisabled,isReadOnly:a.isReadOnly,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TimeField`}),_=W(e,{global:!0});return delete _.id,v.createElement(jf,{values:[[hM,a],[ES,{...d,ref:o,isInvalid:a.isInvalid,isDisabled:a.isDisabled}],[dT,{...f,ref:l}],[Wf,{...u,ref:s,elementType:`span`}],[sb,{slots:{description:p,errorMessage:m}}],[OS,h]]},v.createElement(q.div,{..._,...g,ref:t,slot:e.slot||void 0,"data-invalid":a.isInvalid||void 0,"data-disabled":a.isDisabled||void 0,"data-readonly":a.isReadOnly||void 0,"data-required":e.isRequired||void 0}))}),vM=(0,v.forwardRef)(function(e,t){let n=(0,v.useContext)(mM),r=(0,v.useContext)(hM);return n||r?v.createElement(bM,{...e,ref:t}):v.createElement(yM,{...e,ref:t})}),yM=(0,v.forwardRef)((e,t)=>{let[n,r]=Ff({slot:e.slot},t,fM),{locale:i}=rp(),a=cM({...n,locale:i,createCalendar:Xk}),o=(0,v.useRef)(null),{fieldProps:s,inputProps:c}=ZA({...n,inputRef:o},a,r);return v.createElement(jf,{values:[[mM,a],[dT,{...c,ref:o}],[ES,{...s,ref:r,isInvalid:a.isInvalid,isDisabled:a.isDisabled}]]},v.createElement(bM,e))}),bM=(0,v.forwardRef)((e,t)=>{let{className:n,children:r}=e,i=(0,v.useContext)(mM),a=(0,v.useContext)(hM),o=i??a;return v.createElement(v.Fragment,null,v.createElement(DS,{...e,ref:t,slot:e.slot||void 0,className:n??`react-aria-DateInput`,isReadOnly:o.isReadOnly,isInvalid:o.isInvalid,isDisabled:o.isDisabled},o.segments.map((e,t)=>(0,v.cloneElement)(r(e),{key:t}))),v.createElement(pT,{className:``}))}),xM=(0,v.forwardRef)(function({segment:e,...t},n){let r=(0,v.useContext)(mM),i=(0,v.useContext)(hM),a=r??i,o=Is(n),{segmentProps:s}=ij(e,a,o),{focusProps:c,isFocused:l,isFocusVisible:u}=Jm(),{hoverProps:d,isHovered:f}=eh({...t,isDisabled:a.isDisabled||e.type===`literal`}),p=Mf({...t,values:{...e,isReadOnly:a.isReadOnly,isInvalid:a.isInvalid,isDisabled:a.isDisabled,isHovered:f,isFocused:l,isFocusVisible:u},defaultChildren:e.text,defaultClassName:`react-aria-DateSegment`});return v.createElement(q.span,{...U(W(t,{global:!0}),s,c,d),...p,style:s.style,ref:o,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":a.isInvalid||void 0,"data-readonly":a.isReadOnly||void 0,"data-disabled":a.isDisabled||void 0,"data-type":e.type,"data-hovered":f||void 0,"data-focused":l||void 0,"data-focus-visible":u||void 0})}),SM=(0,v.createContext)({}),CM=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=v.useMemo(()=>Zd({fullWidth:n,variant:r}),[n,r]);return(0,G.jsx)(SM,{value:{slots:a},children:(0,G.jsx)(DS,{className:J(t,a?.base()),"data-slot":`date-input-group`,...i,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})},wM=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SM);return(0,G.jsx)(K.div,{className:Y(r?.prefix,t),"data-slot":`date-input-group-prefix`,...n,children:e})},TM=({className:e,...t})=>{let{slots:n}=(0,v.use)(SM);return(0,G.jsx)(vM,{className:J(e,n?.input()),"data-slot":`date-input-group-input`,...t})},EM=({className:e,segment:t,...n})=>{let{slots:r}=(0,v.use)(SM);return(0,G.jsx)(xM,{className:Y(r?.segment,e),"data-slot":`date-input-group-segment`,segment:t,...n})},DM=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SM);return(0,G.jsx)(K.div,{className:Y(r?.inputContainer,t),"data-slot":`date-input-group-input-container`,...n,children:e})},OM=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(SM);return(0,G.jsx)(K.div,{className:Y(r?.suffix,t),"data-slot":`date-input-group-suffix`,...n,children:e})};function kM({children:e,className:t,fullWidth:n,...r}){let i=v.useMemo(()=>Yd({fullWidth:n}),[n]);return(0,G.jsx)(gM,{"data-required":yh(r.isRequired),"data-slot":`date-field`,...r,className:J(t,i),children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})}var AM=Object.assign(kM,{Root:kM,Group:CM,Input:TM,InputContainer:DM,Segment:EM,Prefix:wM,Suffix:OM}),jM={};jM={dateRange:e=>`${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,dateSelected:e=>`${e.date} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`,finishRangeSelectionPrompt:`انقر لإنهاء عملية تحديد نطاق التاريخ`,maximumDate:`آخر تاريخ متاح`,minimumDate:`أول تاريخ متاح`,next:`التالي`,previous:`السابق`,selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.dateRange}`,startRangeSelectionPrompt:`انقر لبدء عملية تحديد نطاق التاريخ`,todayDate:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date}`,todayDateSelected:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date} \u{645}\u{62D}\u{62F}\u{62F}`};var MM={};MM={dateRange:e=>`${e.startDate} \u{434}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{435} ${e.date}`,finishRangeSelectionPrompt:`Натиснете, за да довършите избора на времеви интервал`,maximumDate:`Последна налична дата`,minimumDate:`Първа налична дата`,next:`Напред`,previous:`Назад`,selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:`Натиснете, за да пристъпите към избора на времеви интервал`,todayDate:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date}`,todayDateSelected:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date} \u{441}\u{430} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{438}`};var NM={};NM={dateRange:e=>`${e.startDate} a\u{17E} ${e.endDate}`,dateSelected:e=>`Vybr\xe1no ${e.date}`,finishRangeSelectionPrompt:`Kliknutím dokončíte výběr rozsahu dat`,maximumDate:`Poslední dostupné datum`,minimumDate:`První dostupné datum`,next:`Další`,previous:`Předchozí`,selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknutím zahájíte výběr rozsahu dat`,todayDate:e=>`Dnes, ${e.date}`,todayDateSelected:e=>`Dnes, vybr\xe1no ${e.date}`};var PM={};PM={dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:`Klik for at fuldføre valg af datoområde`,maximumDate:`Sidste ledige dato`,minimumDate:`Første ledige dato`,next:`Næste`,previous:`Forrige`,selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.dateRange}`,startRangeSelectionPrompt:`Klik for at starte valg af datoområde`,todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`};var FM={};FM={dateRange:e=>`${e.startDate} bis ${e.endDate}`,dateSelected:e=>`${e.date} ausgew\xe4hlt`,finishRangeSelectionPrompt:`Klicken, um die Auswahl des Datumsbereichs zu beenden`,maximumDate:`Letztes verfügbares Datum`,minimumDate:`Erstes verfügbares Datum`,next:`Weiter`,previous:`Zurück`,selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.dateRange}`,startRangeSelectionPrompt:`Klicken, um die Auswahl des Datumsbereichs zu beginnen`,todayDate:e=>`Heute, ${e.date}`,todayDateSelected:e=>`Heute, ${e.date} ausgew\xe4hlt`};var IM={};IM={dateRange:e=>`${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,dateSelected:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} ${e.date}`,finishRangeSelectionPrompt:`Κάντε κλικ για να ολοκληρώσετε την επιλογή εύρους ημερομηνιών`,maximumDate:`Τελευταία διαθέσιμη ημερομηνία`,minimumDate:`Πρώτη διαθέσιμη ημερομηνία`,next:`Επόμενο`,previous:`Προηγούμενο`,selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.dateRange}`,startRangeSelectionPrompt:`Κάντε κλικ για να ξεκινήσετε την επιλογή εύρους ημερομηνιών`,todayDate:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, ${e.date}`,todayDateSelected:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, \u{3B5}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3C4}\u{3B7}\u{3BA}\u{3B5} ${e.date}`};var LM={};LM={previous:`Previous`,next:`Next`,selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.dateRange}`,todayDate:e=>`Today, ${e.date}`,todayDateSelected:e=>`Today, ${e.date} selected`,dateSelected:e=>`${e.date} selected`,startRangeSelectionPrompt:`Click to start selecting date range`,finishRangeSelectionPrompt:`Click to finish selecting date range`,minimumDate:`First available date`,maximumDate:`Last available date`,dateRange:e=>`${e.startDate} to ${e.endDate}`};var RM={};RM={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} seleccionado`,finishRangeSelectionPrompt:`Haga clic para terminar de seleccionar rango de fechas`,maximumDate:`Última fecha disponible`,minimumDate:`Primera fecha disponible`,next:`Siguiente`,previous:`Anterior`,selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo seleccionado: ${e.dateRange}`,startRangeSelectionPrompt:`Haga clic para comenzar a seleccionar un rango de fechas`,todayDate:e=>`Hoy, ${e.date}`,todayDateSelected:e=>`Hoy, ${e.date} seleccionado`};var zM={};zM={dateRange:e=>`${e.startDate} kuni ${e.endDate}`,dateSelected:e=>`${e.date} valitud`,finishRangeSelectionPrompt:`Klõpsake kuupäevavahemiku valimise lõpetamiseks`,maximumDate:`Viimane saadaolev kuupäev`,minimumDate:`Esimene saadaolev kuupäev`,next:`Järgmine`,previous:`Eelmine`,selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.dateRange}`,startRangeSelectionPrompt:`Klõpsake kuupäevavahemiku valimiseks`,todayDate:e=>`T\xe4na, ${e.date}`,todayDateSelected:e=>`T\xe4na, ${e.date} valitud`};var BM={};BM={dateRange:e=>`${e.startDate} \u{2013} ${e.endDate}`,dateSelected:e=>`${e.date} valittu`,finishRangeSelectionPrompt:`Lopeta päivämääräalueen valinta napsauttamalla tätä.`,maximumDate:`Viimeinen varattavissa oleva päivämäärä`,minimumDate:`Ensimmäinen varattavissa oleva päivämäärä`,next:`Seuraava`,previous:`Edellinen`,selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.dateRange}`,startRangeSelectionPrompt:`Aloita päivämääräalueen valinta napsauttamalla tätä.`,todayDate:e=>`T\xe4n\xe4\xe4n, ${e.date}`,todayDateSelected:e=>`T\xe4n\xe4\xe4n, ${e.date} valittu`};var VM={};VM={dateRange:e=>`${e.startDate} \xe0 ${e.endDate}`,dateSelected:e=>`${e.date} s\xe9lectionn\xe9`,finishRangeSelectionPrompt:`Cliquer pour finir de sélectionner la plage de dates`,maximumDate:`Dernière date disponible`,minimumDate:`Première date disponible`,next:`Suivant`,previous:`Précédent`,selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.dateRange}`,startRangeSelectionPrompt:`Cliquer pour commencer à sélectionner la plage de dates`,todayDate:e=>`Aujourd'hui, ${e.date}`,todayDateSelected:e=>`Aujourd\u{2019}hui, ${e.date} s\xe9lectionn\xe9`};var HM={};HM={dateRange:e=>`${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,dateSelected:e=>`${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`,finishRangeSelectionPrompt:`חץ כדי לסיים את בחירת טווח התאריכים`,maximumDate:`תאריך פנוי אחרון`,minimumDate:`תאריך פנוי ראשון`,next:`הבא`,previous:`הקודם`,selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.dateRange}`,startRangeSelectionPrompt:`לחץ כדי להתחיל בבחירת טווח התאריכים`,todayDate:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date}`,todayDateSelected:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`};var UM={};UM={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} odabran`,finishRangeSelectionPrompt:`Kliknite da dovršite raspon odabranih datuma`,maximumDate:`Posljednji raspoloživi datum`,minimumDate:`Prvi raspoloživi datum`,next:`Sljedeći`,previous:`Prethodni`,selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknite da započnete raspon odabranih datuma`,todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, odabran ${e.date}`};var WM={};WM={dateRange:e=>`${e.startDate}\u{2013}${e.endDate}`,dateSelected:e=>`${e.date} kiv\xe1lasztva`,finishRangeSelectionPrompt:`Kattintson a dátumtartomány kijelölésének befejezéséhez`,maximumDate:`Utolsó elérhető dátum`,minimumDate:`Az első elérhető dátum`,next:`Következő`,previous:`Előző`,selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.dateRange}`,startRangeSelectionPrompt:`Kattintson a dátumtartomány kijelölésének indításához`,todayDate:e=>`Ma, ${e.date}`,todayDateSelected:e=>`Ma, ${e.date} kijel\xf6lve`};var GM={};GM={dateRange:e=>`Da ${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selezionata`,finishRangeSelectionPrompt:`Fai clic per completare la selezione dell’intervallo di date`,maximumDate:`Ultima data disponibile`,minimumDate:`Prima data disponibile`,next:`Successivo`,previous:`Precedente`,selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: ${e.dateRange}`,startRangeSelectionPrompt:`Fai clic per selezionare l’intervallo di date`,todayDate:e=>`Oggi, ${e.date}`,todayDateSelected:e=>`Oggi, ${e.date} selezionata`};var KM={};KM={dateRange:e=>`${e.startDate} \u{304B}\u{3089} ${e.endDate}`,dateSelected:e=>`${e.date} \u{3092}\u{9078}\u{629E}`,finishRangeSelectionPrompt:`クリックして日付範囲の選択を終了`,maximumDate:`最終利用可能日`,minimumDate:`最初の利用可能日`,next:`次へ`,previous:`前へ`,selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.dateRange}`,startRangeSelectionPrompt:`クリックして日付範囲の選択を開始`,todayDate:e=>`\u{672C}\u{65E5}\u{3001}${e.date}`,todayDateSelected:e=>`\u{672C}\u{65E5}\u{3001}${e.date} \u{3092}\u{9078}\u{629E}`};var qM={};qM={dateRange:e=>`${e.startDate} ~ ${e.endDate}`,dateSelected:e=>`${e.date} \u{C120}\u{D0DD}\u{B428}`,finishRangeSelectionPrompt:`날짜 범위 선택을 완료하려면 클릭하십시오.`,maximumDate:`마지막으로 사용 가능한 일자`,minimumDate:`처음으로 사용 가능한 일자`,next:`다음`,previous:`이전`,selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.dateRange}`,startRangeSelectionPrompt:`날짜 범위 선택을 시작하려면 클릭하십시오.`,todayDate:e=>`\u{C624}\u{B298}, ${e.date}`,todayDateSelected:e=>`\u{C624}\u{B298}, ${e.date} \u{C120}\u{D0DD}\u{B428}`};var JM={};JM={dateRange:e=>`Nuo ${e.startDate} iki ${e.endDate}`,dateSelected:e=>`Pasirinkta ${e.date}`,finishRangeSelectionPrompt:`Spustelėkite, kad baigtumėte pasirinkti datų intervalą`,maximumDate:`Paskutinė galima data`,minimumDate:`Pirmoji galima data`,next:`Paskesnis`,previous:`Ankstesnis`,selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: ${e.dateRange}`,startRangeSelectionPrompt:`Spustelėkite, kad pradėtumėte pasirinkti datų intervalą`,todayDate:e=>`\u{160}iandien, ${e.date}`,todayDateSelected:e=>`\u{160}iandien, pasirinkta ${e.date}`};var YM={};YM={dateRange:e=>`No ${e.startDate} l\u{12B}dz ${e.endDate}`,dateSelected:e=>`Atlas\u{12B}ts: ${e.date}`,finishRangeSelectionPrompt:`Noklikšķiniet, lai pabeigtu datumu diapazona atlasi`,maximumDate:`Pēdējais pieejamais datums`,minimumDate:`Pirmais pieejamais datums`,next:`Tālāk`,previous:`Atpakaļ`,selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: ${e.dateRange}`,startRangeSelectionPrompt:`Noklikšķiniet, lai sāktu datumu diapazona atlasi`,todayDate:e=>`\u{160}odien, ${e.date}`,todayDateSelected:e=>`Atlas\u{12B}ta \u{161}odiena, ${e.date}`};var XM={};XM={dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:`Klikk for å fullføre valg av datoområde`,maximumDate:`Siste tilgjengelige dato`,minimumDate:`Første tilgjengelige dato`,next:`Neste`,previous:`Forrige`,selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.dateRange}`,startRangeSelectionPrompt:`Klikk for å starte valg av datoområde`,todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`};var ZM={};ZM={dateRange:e=>`${e.startDate} tot ${e.endDate}`,dateSelected:e=>`${e.date} geselecteerd`,finishRangeSelectionPrompt:`Klik om de selectie van het datumbereik te voltooien`,maximumDate:`Laatste beschikbare datum`,minimumDate:`Eerste beschikbare datum`,next:`Volgende`,previous:`Vorige`,selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.dateRange}`,startRangeSelectionPrompt:`Klik om het datumbereik te selecteren`,todayDate:e=>`Vandaag, ${e.date}`,todayDateSelected:e=>`Vandaag, ${e.date} geselecteerd`};var QM={};QM={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`Wybrano ${e.date}`,finishRangeSelectionPrompt:`Kliknij, aby zakończyć wybór zakresu dat`,maximumDate:`Ostatnia dostępna data`,minimumDate:`Pierwsza dostępna data`,next:`Dalej`,previous:`Wstecz`,selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknij, aby rozpocząć wybór zakresu dat`,todayDate:e=>`Dzisiaj, ${e.date}`,todayDateSelected:e=>`Dzisiaj wybrano ${e.date}`};var $M={};$M={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:`Clique para concluir a seleção do intervalo de datas`,maximumDate:`Última data disponível`,minimumDate:`Primeira data disponível`,next:`Próximo`,previous:`Anterior`,selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:`Clique para iniciar a seleção do intervalo de datas`,todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`};var eN={};eN={dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:`Clique para terminar de selecionar o intervalo de datas`,maximumDate:`Última data disponível`,minimumDate:`Primeira data disponível`,next:`Próximo`,previous:`Anterior`,selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:`Clique para começar a selecionar o intervalo de datas`,todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`};var tN={};tN={dateRange:e=>`De la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,dateSelected:e=>`${e.date} selectat\u{103}`,finishRangeSelectionPrompt:`Apăsaţi pentru a finaliza selecţia razei pentru dată`,maximumDate:`Ultima dată disponibilă`,minimumDate:`Prima dată disponibilă`,next:`Următorul`,previous:`Înainte`,selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: ${e.dateRange}`,startRangeSelectionPrompt:`Apăsaţi pentru a începe selecţia razei pentru dată`,todayDate:e=>`Ast\u{103}zi, ${e.date}`,todayDateSelected:e=>`Azi, ${e.date} selectat\u{103}`};var nN={};nN={dateRange:e=>`\u{421} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:`Щелкните, чтобы завершить выбор диапазона дат`,maximumDate:`Последняя доступная дата`,minimumDate:`Первая доступная дата`,next:`Далее`,previous:`Назад`,selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:`Щелкните, чтобы начать выбор диапазона дат`,todayDate:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`};var rN={};rN={dateRange:e=>`Od ${e.startDate} do ${e.endDate}`,dateSelected:e=>`Vybrat\xfd d\xe1tum ${e.date}`,finishRangeSelectionPrompt:`Kliknutím dokončíte výber rozsahu dátumov`,maximumDate:`Posledný dostupný dátum`,minimumDate:`Prvý dostupný dátum`,next:`Nasledujúce`,previous:`Predchádzajúce`,selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknutím spustíte výber rozsahu dátumov`,todayDate:e=>`Dnes ${e.date}`,todayDateSelected:e=>`Vybrat\xfd dne\u{161}n\xfd d\xe1tum ${e.date}`};var iN={};iN={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izbrano`,finishRangeSelectionPrompt:`Kliknite za dokončanje izbire datumskega obsega`,maximumDate:`Zadnji razpoložljivi datum`,minimumDate:`Prvi razpoložljivi datum`,next:`Naprej`,previous:`Nazaj`,selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknite za začetek izbire datumskega obsega`,todayDate:e=>`Danes, ${e.date}`,todayDateSelected:e=>`Danes, ${e.date} izbrano`};var aN={};aN={dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izabran`,finishRangeSelectionPrompt:`Kliknite da dovršite opseg izabranih datuma`,maximumDate:`Zadnji raspoloživi datum`,minimumDate:`Prvi raspoloživi datum`,next:`Sledeći`,previous:`Prethodni`,selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani period: ${e.dateRange}`,startRangeSelectionPrompt:`Kliknite da započnete opseg izabranih datuma`,todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, izabran ${e.date}`};var oN={};oN={dateRange:e=>`${e.startDate} till ${e.endDate}`,dateSelected:e=>`${e.date} har valts`,finishRangeSelectionPrompt:`Klicka för att avsluta val av datumintervall`,maximumDate:`Sista tillgängliga datum`,minimumDate:`Första tillgängliga datum`,next:`Nästa`,previous:`Föregående`,selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.dateRange}`,startRangeSelectionPrompt:`Klicka för att välja datumintervall`,todayDate:e=>`Idag, ${e.date}`,todayDateSelected:e=>`Idag, ${e.date} har valts`};var sN={};sN={dateRange:e=>`${e.startDate} - ${e.endDate}`,dateSelected:e=>`${e.date} se\xe7ildi`,finishRangeSelectionPrompt:`Tarih aralığı seçimini tamamlamak için tıklayın`,maximumDate:`Son müsait tarih`,minimumDate:`İlk müsait tarih`,next:`Sonraki`,previous:`Önceki`,selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.dateRange}`,startRangeSelectionPrompt:`Tarih aralığı seçimini başlatmak için tıklayın`,todayDate:e=>`Bug\xfcn, ${e.date}`,todayDateSelected:e=>`Bug\xfcn, ${e.date} se\xe7ildi`};var cN={};cN={dateRange:e=>`${e.startDate} \u{2014} ${e.endDate}`,dateSelected:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:`Натисніть, щоб завершити вибір діапазону дат`,maximumDate:`Остання доступна дата`,minimumDate:`Перша доступна дата`,next:`Наступний`,previous:`Попередній`,selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:`Натисніть, щоб почати вибір діапазону дат`,todayDate:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`};var lN={};lN={dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9009}\u{62E9} ${e.date}`,finishRangeSelectionPrompt:`单击以完成选择日期范围`,maximumDate:`最后一个可用日期`,minimumDate:`第一个可用日期`,next:`下一页`,previous:`上一页`,selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:`单击以开始选择日期范围`,todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9009}\u{62E9}\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`};var uN={};uN={dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9078}\u{53D6} ${e.date}`,finishRangeSelectionPrompt:`按一下以完成選取日期範圍`,maximumDate:`最後一個可用日期`,minimumDate:`第一個可用日期`,next:`下一頁`,previous:`上一頁`,selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:`按一下以開始選取日期範圍`,todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9078}\u{53D6}\u{4ECA}\u{5929}\u{FF0C}${e.date}`};var dN={};dN={"ar-AE":jM,"bg-BG":MM,"cs-CZ":NM,"da-DK":PM,"de-DE":FM,"el-GR":IM,"en-US":LM,"es-ES":RM,"et-EE":zM,"fi-FI":BM,"fr-FR":VM,"he-IL":HM,"hr-HR":UM,"hu-HU":WM,"it-IT":GM,"ja-JP":KM,"ko-KR":qM,"lt-LT":JM,"lv-LV":YM,"nb-NO":XM,"nl-NL":ZM,"pl-PL":QM,"pt-BR":$M,"pt-PT":eN,"ro-RO":tN,"ru-RU":nN,"sk-SK":rN,"sl-SI":iN,"sr-SP":aN,"sv-SE":oN,"tr-TR":sN,"uk-UA":cN,"zh-CN":lN,"zh-TW":uN};function fN(e){return e&&e.__esModule?e.default:e}var pN=new WeakMap;function mN(e){return e?.calendar.identifier===`gregory`&&e.era===`BC`?`short`:void 0}function hN(e){let t=rv(fN(dN),`@react-aria/calendar`),n,r;`highlightedRange`in e?{start:n,end:r}=e.highlightedRange||{}:(n=Array.isArray(e.value)?e.value[0]:e.value??void 0,r=Array.isArray(e.value)?e.value.at(-1):e.value??void 0);let i=$A({weekday:`long`,month:`long`,year:`numeric`,day:`numeric`,era:mN(n)||mN(r),timeZone:e.timeZone}),{locale:a}=rp(),o=(0,v.useMemo)(()=>new Intl.ListFormat(a),[a]),s=`anchorDate`in e?e.anchorDate:null;return(0,v.useMemo)(()=>{if(!s&&n&&r){if(sD(n,r)){let r=i.format(n.toDate(e.timeZone));return t.format(`selectedDateDescription`,{date:r})}if(`highlightedRange`in e){let a=_N(i,t,n,r,e.timeZone);return t.format(`selectedRangeDescription`,{dateRange:a})}if(Array.isArray(e.value)){let n=e.value.map(t=>i.format(t.toDate(e.timeZone))),r=o.format(n);return t.format(`selectedDateDescription`,{date:r})}}return``},[n,r,s,e,t,i,o])}function gN(e,t,n,r){let i=rv(fN(dN),`@react-aria/calendar`),a=mN(e)||mN(t),o=$A({month:`long`,year:`numeric`,era:a,calendar:e.calendar.identifier,timeZone:n}),s=$A({month:`long`,year:`numeric`,day:`numeric`,era:a,calendar:e.calendar.identifier,timeZone:n});return(0,v.useMemo)(()=>{if(sD(e,wD(e))){let a=e,s=t;if(e.calendar.getFormattableMonth&&(a=e.calendar.getFormattableMonth(e)),t.calendar.getFormattableMonth&&(s=t.calendar.getFormattableMonth(t)),sD(t,TD(e)))return o.format(a.toDate(n));if(sD(t,TD(t)))return r?_N(o,i,a,s,n):o.formatRange(a.toDate(n),s.toDate(n))}return r?_N(s,i,e,t,n):s.formatRange(e.toDate(n),t.toDate(n))},[e,t,o,s,i,n,r])}function _N(e,t,n,r,i){let a=e.formatRangeToParts(n.toDate(i),r.toDate(i)),o=-1;for(let e=0;eo&&(c+=a[e].value);return t.format(`dateRange`,{startDate:s,endDate:c})}function vN(e){return e&&e.__esModule?e.default:e}function yN(e,t){let n=rv(vN(dN),`@react-aria/calendar`),r=W(e),i=gN(t.visibleRange.start,t.visibleRange.end,t.timeZone,!1),a=gN(t.visibleRange.start,t.visibleRange.end,t.timeZone,!0);zs(()=>{t.isFocused||Op(a)},[a]);let o=hN(t);zs(()=>{o&&Op(o,`polite`,4e3)},[o]);let s=ns([!!e.errorMessage,e.isInvalid,e.validationState]);pN.set(t,{ariaLabel:e[`aria-label`],ariaLabelledBy:e[`aria-labelledby`],errorMessageId:s,selectedDateDescription:o});let[c,l]=(0,v.useState)(!1),u=e.isDisabled||t.isNextVisibleRangeInvalid();u&&c&&(l(!1),t.setFocused(!0));let[d,f]=(0,v.useState)(!1),p=e.isDisabled||t.isPreviousVisibleRangeInvalid();return p&&d&&(f(!1),t.setFocused(!0)),{calendarProps:U(r,Fs({id:e.id,"aria-label":[e[`aria-label`],a].filter(Boolean).join(`, `),"aria-labelledby":e[`aria-labelledby`]}),{role:`application`,"aria-details":e[`aria-details`]||void 0,"aria-describedby":e[`aria-describedby`]||void 0}),nextButtonProps:{onPress:()=>t.focusNextPage(),"aria-label":n.format(`next`),isDisabled:u,onFocusChange:l},prevButtonProps:{onPress:()=>t.focusPreviousPage(),"aria-label":n.format(`previous`),isDisabled:p,onFocusChange:f},errorMessageProps:{id:s},title:i}}function bN(e,t){let{startDate:n=t.visibleRange.start,endDate:r=t.visibleRange.end,firstDayOfWeek:i}=e,{direction:a}=rp(),{keyboardProps:o}=Sm({shortcuts:{End:()=>{t.focusSectionEnd()},Home:()=>{t.focusSectionStart()},Escape:()=>(`setAnchorDate`in t&&t.setAnchorDate(null),!1)}}),{keyboardProps:s}=Sm({shortcuts:{Enter:()=>{t.selectFocusedDate()}," ":()=>{t.selectFocusedDate()},PageUp:()=>{t.focusPreviousSection()},"Shift+PageUp":()=>{t.focusPreviousSection(!0)},PageDown:()=>{t.focusNextSection()},"Shift+PageDown":()=>{t.focusNextSection(!0)},ArrowLeft:()=>{a===`rtl`?t.focusNextDay():t.focusPreviousDay()},ArrowUp:()=>{t.focusPreviousRow()},ArrowRight:()=>{a===`rtl`?t.focusPreviousDay():t.focusNextDay()},ArrowDown:()=>{t.focusNextRow()}},allowRepeats:!0}),c=gN(n,r,t.timeZone,!0),{ariaLabel:l,ariaLabelledBy:u}=pN.get(t),d=Fs({"aria-label":[l,c].filter(Boolean).join(`, `),"aria-labelledby":u}),f=$A({weekday:e.weekdayStyle||`narrow`,timeZone:t.timeZone}),{locale:p}=rp(),m=(0,v.useMemo)(()=>{let e=t.visibleDuration.days&&t.visibleDuration.days<7,r=e?n:DD(gD(t.timeZone),p,i),a=e?t.visibleDuration.days:7;return[...Array(a).keys()].map(e=>{let n=r.add({days:e}).toDate(t.timeZone);return f.format(n)})},[p,t.timeZone,f,i,n,t.visibleDuration.days]),h=t.getWeeksInMonth(n);return{gridProps:U(d,{role:`grid`,"aria-readonly":t.isReadOnly||void 0,"aria-disabled":t.isDisabled||void 0,"aria-multiselectable":`highlightedRange`in t||t.selectionMode===`multiple`||void 0,onFocus:()=>t.setFocused(!0),onBlur:()=>t.setFocused(!1)},o,s),headerProps:{"aria-hidden":!0},weekDays:m,weeksInMonth:h}}function xN(e){return e&&e.__esModule?e.default:e}function SN(e,t,n){let{date:r,isDisabled:i}=e,{errorMessageId:a,selectedDateDescription:o}=pN.get(t),s=rv(xN(dN),`@react-aria/calendar`),c=$A({weekday:`long`,day:`numeric`,month:`long`,year:`numeric`,era:mN(r),timeZone:t.timeZone}),l=t.isCellFocused(r)&&!e.isOutsideMonth;i=i||t.isCellDisabled(r)||!!e.isOutsideMonth;let u=t.isCellUnavailable(r),d=!i&&!u,f=t.isSelected(r)&&d,p=!1;t.isValueInvalid&&(`highlightedRange`in t?p=!t.anchorDate&&t.highlightedRange!=null&&r.compare(t.highlightedRange.start)>=0&&r.compare(t.highlightedRange.end)<=0:Array.isArray(t.value)?p=t.value.some(e=>sD(e,r)):t.value&&(p=sD(t.value,r))),p&&!i&&(f=!0),r=sc(r,uD);let m=(0,v.useMemo)(()=>r.toDate(t.timeZone),[r,t.timeZone]),h=fD(r,t.timeZone),g=(0,v.useMemo)(()=>{let e=``;return`highlightedRange`in t&&t.value&&!t.anchorDate&&(sD(r,t.value.start)||sD(r,t.value.end))&&(e=o+`, `),e+=c.format(m),h?e=s.format(f?`todayDateSelected`:`todayDate`,{date:e}):f&&(e=s.format(`dateSelected`,{date:e})),t.minValue&&sD(r,t.minValue)?e+=`, `+s.format(`minimumDate`):t.maxValue&&sD(r,t.maxValue)&&(e+=`, `+s.format(`maximumDate`)),e},[c,m,s,f,h,r,t,o]),_=``;`anchorDate`in t&&l&&!t.isReadOnly&&d&&(_=t.anchorDate?s.format(`finishRangeSelectionPrompt`):s.format(`startRangeSelectionPrompt`));let y=tc(_),b=(0,v.useRef)(!1),x=(0,v.useRef)(!1),S=(0,v.useRef)(void 0),{pressProps:C,isPressed:w}=Rm({shouldCancelOnPointerExit:`anchorDate`in t&&!!t.anchorDate,preventFocusOnPress:!0,isDisabled:!d||t.isReadOnly,onPressStart(e){if(t.isReadOnly){t.setFocusedDate(r),t.setFocused(!0);return}if(`highlightedRange`in t&&!t.anchorDate&&(e.pointerType===`mouse`||e.pointerType===`touch`)){if(t.highlightedRange&&!p){if(sD(r,t.highlightedRange.start)){t.setAnchorDate(t.highlightedRange.end),t.setFocusedDate(r),t.setFocused(!0),t.setDragging(!0),x.current=!0;return}if(sD(r,t.highlightedRange.end)){t.setAnchorDate(t.highlightedRange.start),t.setFocusedDate(r),t.setFocused(!0),t.setDragging(!0),x.current=!0;return}}let n=()=>{t.setDragging(!0),S.current=void 0,t.selectDate(r),t.setFocusedDate(r),t.setFocused(!0),b.current=!0};e.pointerType===`touch`?S.current=setTimeout(n,200):n()}},onPressEnd(){x.current=!1,b.current=!1,clearTimeout(S.current),S.current=void 0},onPress(){!(`anchorDate`in t)&&!t.isReadOnly&&(t.selectDate(r),t.setFocusedDate(r),t.setFocused(!0))},onPressUp(e){t.isReadOnly||(`anchorDate`in t&&S.current&&(t.selectDate(r),t.setFocusedDate(r),t.setFocused(!0)),`anchorDate`in t&&(x.current?t.setAnchorDate(r):t.anchorDate&&!b.current?(t.selectDate(r),t.setFocusedDate(r),t.setFocused(!0)):e.pointerType===`keyboard`&&!t.anchorDate?(t.selectDate(r),t.focusNearestAvailableDate(r)):e.pointerType===`virtual`&&(t.selectDate(r),t.setFocusedDate(r),t.setFocused(!0))))}}),T;i||(T=sD(r,t.focusedDate)?0:-1),(0,v.useEffect)(()=>{l&&n.current&&(So(n.current),em()!==`pointer`&&ms()===n.current&&ic(n.current,{containingElement:Gs(n.current)}))},[l,n]);let E=$A({day:`numeric`,timeZone:t.timeZone,calendar:r.calendar.identifier}),D=(0,v.useMemo)(()=>E.formatToParts(m).find(e=>e.type===`day`).value,[E,m]);return{cellProps:{role:`gridcell`,"aria-disabled":!d||void 0,"aria-selected":f||void 0,"aria-invalid":p||void 0},buttonProps:U(C,{onFocus(){i||(t.setFocusedDate(r),t.setFocused(!0))},tabIndex:T,role:`button`,"aria-disabled":!d||void 0,"aria-label":g,"aria-invalid":p||void 0,"aria-describedby":[p?a:void 0,y[`aria-describedby`]].filter(Boolean).join(` `)||void 0,onPointerEnter(e){`highlightDate`in t&&(e.pointerType!==`touch`||t.isDragging)&&d&&t.highlightDate(r)},onPointerDown(e){let t=H(e);t instanceof HTMLElement&&`releasePointerCapture`in t&&(`hasPointerCapture`in t?t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId):t.releasePointerCapture(e.pointerId))},onContextMenu(e){e.preventDefault()}}),isPressed:w,isFocused:l,isSelected:f,isDisabled:i,isUnavailable:u,isOutsideVisibleRange:r.compare(t.visibleRange.start)<0||r.compare(t.visibleRange.end)>0,isInvalid:p,formattedDate:D}}function CN(e,t){let n=$A({year:e.format?.year||`numeric`,era:e.format?.era||(t.focusedDate.calendar.identifier===`gregory`&&t.focusedDate.era===`BC`?`short`:void 0),calendar:t.focusedDate.calendar.identifier,timeZone:t.timeZone}),r=e.visibleYears||20,i=t.focusedDate.subtract({years:Math.floor(r/2)}),a=t.focusedDate.add({years:Math.ceil(r/2)-1});t.maxValue&&a.compare(t.maxValue)>0&&(a=qD(t.maxValue),i=a.subtract({years:r-1})),t.minValue&&i.compare(t.minValue)<0&&(i=qD(t.minValue),a=i.add({years:r-1}),t.maxValue&&a.compare(t.maxValue)>0&&(a=qD(t.maxValue)));let o=[],s=i,c=0;for(;s.compare(a)<=0;)lD(s,t.focusedDate)&&(c=o.length),o.push({id:o.length,date:s,formatted:n.format(s.toDate(t.timeZone))}),s=s.add({years:1});let{locale:l}=rp();return{"aria-label":(0,v.useMemo)(()=>new Intl.DisplayNames(l,{type:`dateTimeField`}).of(`year`),[l]),value:c,onChange:e=>{e!=null&&t.setFocusedDate(o[e].date)},items:o}}function wN(e,t){let n=(0,v.useMemo)(()=>{let n=t.visibleRange.start;return e.offset&&(n=n.add(e.offset)),n},[t.visibleRange.start,e.offset]),r=t.visibleDuration.days||t.visibleDuration.weeks,i=$A({day:e.format?.day||(r?`numeric`:void 0),month:e.format?.month||`long`,year:e.format?.year||`numeric`,era:e.format?.era||n&&n.calendar.identifier===`gregory`&&n.era===`BC`?`short`:void 0,calendar:t.visibleRange?.start.calendar.identifier,timeZone:t.timeZone});return(0,v.useMemo)(()=>{if(r)return i.formatRange(n.toDate(t.timeZone),t.visibleRange.end.toDate(t.timeZone));let e=n.calendar.getFormattableMonth?n.calendar.getFormattableMonth(n):n;return i.format(e.toDate(t.timeZone))},[i,r,n,t.timeZone,t.visibleRange.end])}function TN(e,t,n){let{commitBehavior:r=`select`,...i}=e,a=yN(i,t),o=(0,v.useRef)(!1),s=(0,v.useRef)(typeof window<`u`?window:null);nc(s,`pointerdown`,e=>{o.current=e.width===0&&e.height===0});let c={clear:()=>t.clearSelection(),reset:()=>t.setAnchorDate(null),select:()=>t.commitSelection()};return nc(s,`pointerup`,e=>{if(o.current){o.current=!1;return}if(t.setDragging(!1),!t.anchorDate)return;let i=e.target;n.current&&gs(n.current)&&(!ps(n.current,i)||!i.closest(`button, [role="button"]`))&&c[r]()}),a.calendarProps.onBlur=e=>{n.current&&(!e.relatedTarget||!ps(n.current,e.relatedTarget))&&t.anchorDate&&c[r]()},nc(n,`touchmove`,e=>{t.isDragging&&e.preventDefault()},{passive:!1,capture:!0}),a}function EN(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function DN(e,t,n,r,i){let a={};for(let e in t)a[e]=Math.floor(t[e]/2),a[e]>0&&t[e]%2==0&&a[e]--;return AN(e,ON(e,t,n).subtract(a),t,n,r,i)}function ON(e,t,n,r,i){let a=e;return t.years?a=ED(e):t.months?a=wD(e):(t.weeks||t.days&&t.days>7)&&(a=DD(e,n)),AN(e,a,t,n,r,i)}function kN(e,t,n,r,i){let a={...t};return a.days?a.days--:a.weeks?a.weeks--:a.months?a.months--:a.years&&a.years--,AN(e,ON(e,t,n).subtract(a),t,n,r,i)}function AN(e,t,n,r,i,a){if(i&&e.compare(i)>=0){let e=FD(t,ON(qD(i),n,r));e&&(t=e)}if(a&&e.compare(a)<=0){let e=PD(t,kN(qD(a),n,r));e&&(t=e)}return t}function jN(e,t,n){if(t){let n=FD(e,qD(t));n&&(e=n)}if(n){let t=PD(e,qD(n));t&&(e=t)}return e}function MN(e,t,n){if(!n)return e;for(;e.compare(t)>=0&&n(e);)e=e.subtract({days:1});return e.compare(t)>=0?e:null}function NN(e,t){return e===t||e.days===t.days&&e.weeks===t.weeks&&e.months===t.months&&e.years===t.years}function PN(e){let t=(0,v.useMemo)(()=>new Qk(e.locale),[e.locale]),n=(0,v.useMemo)(()=>t.resolvedOptions(),[t]),{locale:r,createCalendar:i,visibleDuration:a={months:1},minValue:o,maxValue:s,selectionAlignment:c,isDateUnavailable:l,pageBehavior:u=`visible`,selectionMode:d=`single`,firstDayOfWeek:f,weeksInMonth:p}=e,m=(0,v.useMemo)(()=>i(n.calendar),[i,n.calendar]),[h,g]=sh(e.value,e.defaultValue??null,e.onChange),_=(0,v.useMemo)(()=>Array.isArray(h)?h.map(e=>XD(qD(e),m)):h?XD(qD(h),m):null,[h,m]),y=(0,v.useMemo)(()=>{let e=Array.isArray(h)?h[0]:h;return e&&`timeZone`in e?e.timeZone:n.timeZone},[h,n.timeZone]),[b,x]=sh((0,v.useMemo)(()=>e.focusedValue?jN(XD(qD(e.focusedValue),m),o,s):void 0,[e.focusedValue,m,o,s]),(0,v.useMemo)(()=>e.defaultFocusedValue?jN(XD(qD(e.defaultFocusedValue),m),o,s):jN(_?Array.isArray(_)?_[0]:_:XD(gD(y),m),o,s),[e.defaultFocusedValue,_,y,m,o,s]),e.onFocusChange),S=()=>{switch(c){case`start`:return ON(b,a,r,o,s);case`end`:return kN(b,a,r,o,s);default:return DN(b,a,r,o,s)}},[C,w]=(0,v.useState)(S),[T,E]=(0,v.useState)(e.autoFocus||!1),[D,O]=(0,v.useState)(a);NN(a,D)||(O(a),w(S()));let k=(0,v.useMemo)(()=>{let e={...a};return e.days?e.days--:e.days=-1,C.add(e)},[C,a]),[A,j]=(0,v.useState)(m);if(!dD(m,A)){let e=XD(b,m);w(DN(e,a,r,o,s)),x(e),j(m)}EN(b,o,s)?x(jN(b,o,s)):b.compare(C)<0?w(kN(b,a,r,o,s)):b.compare(k)>0&&w(ON(b,a,r,o,s));function M(e){e=jN(e,o,s),x(e)}function N(e){let t=MN(jN(e,o,s),C,l);if(!t)return null;let n=Array.isArray(h)?h[0]:h,r=XD(t,n?.calendar||new aD);return n&&`hour`in n?n.set(r):r}function P(t){if(!e.isDisabled&&!e.isReadOnly){if(t===null){g(d===`multiple`?[]:null);return}if(Array.isArray(t))g(t.map(N).filter(Boolean));else{let e=N(t);e&&g(e)}}}let ee=(0,v.useMemo)(()=>_?Array.isArray(_)?_.some(e=>l?.(e)||EN(e,o,s)):l?.(_)||EN(_,o,s):!1,[_,l,o,s]),F=e.isInvalid||e.validationState===`invalid`||ee,I=F?`invalid`:null,L=(0,v.useMemo)(()=>u===`visible`?a:FN(a),[u,a]);return{isDisabled:e.isDisabled??!1,isReadOnly:e.isReadOnly??!1,value:_,setValue:P,selectionMode:d,visibleDuration:a,visibleRange:{start:C,end:k},minValue:o,maxValue:s,focusedDate:b,timeZone:y,validationState:I,isValueInvalid:F,setFocusedDate(e){M(e)},focusNextDay(){M(b.add({days:1}))},focusPreviousDay(){M(b.subtract({days:1}))},focusNextRow(){a.days?this.focusNextPage():(a.weeks||a.months||a.years)&&M(b.add({weeks:1}))},focusPreviousRow(){a.days?this.focusPreviousPage():(a.weeks||a.months||a.years)&&M(b.subtract({weeks:1}))},focusNextPage(){let e=C.add(L);x(jN(b.add(L),o,s)),w(ON(AN(b,e,L,r,o,s),L,r))},focusPreviousPage(){let e=C.subtract(L);x(jN(b.subtract(L),o,s)),w(ON(AN(b,e,L,r,o,s),L,r))},focusSectionStart(){a.days?M(C):a.weeks?M(DD(b,r)):(a.months||a.years)&&M(wD(b))},focusSectionEnd(){a.days?M(k):a.weeks?M(OD(b,r)):(a.months||a.years)&&M(TD(b))},focusNextSection(e){if(!e&&!a.days){M(b.add(FN(a)));return}a.days?this.focusNextPage():a.weeks?M(b.add({months:1})):(a.months||a.years)&&M(b.add({years:1}))},focusPreviousSection(e){if(!e&&!a.days){M(b.subtract(FN(a)));return}a.days?this.focusPreviousPage():a.weeks?M(b.subtract({months:1})):(a.months||a.years)&&M(b.subtract({years:1}))},selectFocusedDate(){l&&l(b)||this.selectDate(b)},selectDate(t){if(!(e.isDisabled||e.isReadOnly)){if(d===`multiple`&&t!=null){let e=N(t);if(!e)return;let n=[];Array.isArray(h)?n=h:h!=null&&(n=[h]);let r=n.findIndex(t=>sD(t,e)),i=r>=0?n.slice(0,r).concat(n.slice(r+1)):[...n,e];g(i)}else P(t)}},isFocused:T,setFocused:E,isInvalid(e){return EN(e,o,s)},isSelected(e){return!_||this.isCellDisabled(e)||this.isCellUnavailable(e)?!1:Array.isArray(_)?_.some(t=>sD(t,e)):sD(e,_)},isCellFocused(e){return T&&b&&sD(e,b)},isCellDisabled(t){return e.isDisabled||t.compare(C)<0||t.compare(k)>0||this.isInvalid(t)},isCellUnavailable(t){return e.isDateUnavailable?e.isDateUnavailable(t):!1},isPreviousVisibleRangeInvalid(){let e=C.subtract({days:1});return sD(e,C)||this.isInvalid(e)},isNextVisibleRangeInvalid(){let e=k.add({days:1});return sD(e,k)||this.isInvalid(e)},getDatesInWeek(e,t=C){let n=t.add({weeks:e}),i=[],o=a.days&&a.days<7?a.days:7;if(o===7){n=DD(n,r,f);let e=mD(n,r,f);for(let t=0;t0&&(m=`start`)}let h=(0,v.useMemo)(()=>{let t=e.isDateUnavailable;if(t)return e=>t(e,f)},[e.isDateUnavailable,f]),g=(0,v.useCallback)(t=>t&&h&&!e.allowsNonContiguousRanges?{start:zN(t,h,o,-1),end:zN(t,h,o,1)}:null,[h,o,e.allowsNonContiguousRanges]),_=(0,v.useMemo)(()=>g(f),[g,f]),y=(0,v.useMemo)(()=>FD(s,_?.start),[s,_]),b=(0,v.useMemo)(()=>PD(c,_?.end),[c,_]),x=PN({...l,value:u&&u.start,createCalendar:i,locale:a,visibleDuration:o,minValue:y,maxValue:b,selectionAlignment:e.selectionAlignment||m,isDateUnavailable:h}),S=f?LN(f,x.focusedDate):u&&LN(u.start,u.end),C=t=>{if(e.isReadOnly)return;let n=MN(jN(t,y,b),x.visibleRange.start,h);if(n){if(!f)p(n);else{let e=LN(f,n);e&&d({start:RN(e.start,u?.start),end:RN(e.end,u?.end)}),p(null)}}},[w,T]=(0,v.useState)(!1),E=(0,v.useMemo)(()=>!u||f?!1:h&&(h(u.start)||h(u.end))?!0:EN(u.start,s,c)||EN(u.end,s,c),[h,u,f,s,c]),D=e.isInvalid||e.validationState===`invalid`||E,O=D?`invalid`:null;return{...x,value:u,setValue:d,anchorDate:f,setAnchorDate:p,highlightedRange:S,validationState:O,isValueInvalid:D,selectFocusedDate(){x.isCellUnavailable(x.focusedDate)||C(x.focusedDate)},commitSelection(){C(x.focusedDate)},selectDate:C,highlightDate(e){f&&x.setFocusedDate(e)},isSelected(e){return!!(S&&e.compare(S.start)>=0&&e.compare(S.end)<=0&&!x.isCellDisabled(e)&&!x.isCellUnavailable(e))},isInvalid(e){return x.isInvalid(e)||EN(e,_?.start,_?.end)},isDragging:w,setDragging:T,clearSelection(){p(null),d(null)},focusNearestAvailableDate(e){let t=g(e),n=e=>this.isInvalid(e)||EN(e,t?.start,t?.end),r=e.add({days:1});n(r)&&(r=e.subtract({days:1})),n(r)||(this.setFocusedDate(r),this.setFocused(!0))}}}function LN(e,t){return!e||!t?null:(t.compare(e)<0&&([e,t]=[t,e]),{start:qD(e),end:qD(t)})}function RN(e,t){return e=XD(e,t?.calendar||new aD),t&&`hour`in t?t.set(e):e}function zN(e,t,n,r){let i=e.add({days:r}),a=e.subtract(n),o=e.add(n);for(;(r<0?i.compare(a)>=0:i.compare(o)<=0)&&!t(i);)i=i.add({days:r});if(t(i))return i.add({days:-r})}var BN=(0,v.createContext)(null),VN=(0,v.createContext)(null),HN=(0,v.createContext)(null),UN=(0,v.createContext)(null),WN=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,VN);let{locale:n}=rp(),r=IN({...e,locale:n,createCalendar:e.createCalendar||Xk}),{calendarProps:i,prevButtonProps:a,nextButtonProps:o,errorMessageProps:s,title:c}=TN(e,r,t),l=Mf({...e,values:{state:r,isDisabled:e.isDisabled||!1,isInvalid:r.isValueInvalid},defaultClassName:`react-aria-RangeCalendar`}),u=W(e,{global:!0});return v.createElement(q.div,{...U(l,u,i),ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":r.isValueInvalid||void 0},v.createElement(jf,{values:[[th,{slots:{previous:a,next:o}}],[_h,{"aria-hidden":!0,level:2,children:c}],[UN,r],[VN,e],[sb,{slots:{errorMessage:s}}]]},v.createElement(ov,null,v.createElement(`h2`,null,i[`aria-label`])),l.children,v.createElement(ov,null,v.createElement(`button`,{"aria-label":o[`aria-label`],disabled:o.isDisabled,onClick:()=>r.focusNextPage(),tabIndex:-1}))))}),GN=(0,v.createContext)(null),KN=(0,v.forwardRef)(function(e,t){let n=(0,v.useContext)(HN),r=(0,v.useContext)(UN),i=Pf(BN),a=Pf(VN),o=n??r,s=o.visibleRange.start;e.offset&&(s=s.add(e.offset));let c=i?.firstDayOfWeek??a?.firstDayOfWeek,{gridProps:l,headerProps:u,weekDays:d,weeksInMonth:f}=bN({startDate:s,endDate:TD(s),weekdayStyle:e.weekdayStyle,firstDayOfWeek:c},o),p=W(e,{global:!0});return v.createElement(GN.Provider,{value:{headerProps:u,weekDays:d,startDate:s,weeksInMonth:f}},v.createElement(q.table,{render:e.render,...U(p,l),ref:t,style:e.style,cellPadding:0,className:e.className??`react-aria-CalendarGrid`},typeof e.children==`function`?v.createElement(v.Fragment,null,v.createElement(JN,null,e=>v.createElement(XN,null,e)),v.createElement(QN,null,e.children)):e.children))});function qN(e,t){let{children:n,style:r,className:i}=e,{headerProps:a,weekDays:o}=(0,v.useContext)(GN),s=W(e,{global:!0});return v.createElement(q.thead,{render:e.render,...U(s,a),ref:t,style:r,className:i??`react-aria-CalendarGridHeader`},v.createElement(`tr`,null,o.map((e,t)=>v.cloneElement(n(e),{key:t}))))}var JN=(0,v.forwardRef)(qN);function YN(e,t){let{children:n,style:r,className:i}=e,a=W(e,{global:!0});return v.createElement(q.th,{render:e.render,...a,ref:t,style:r,className:i||`react-aria-CalendarHeaderCell`},n)}var XN=(0,v.forwardRef)(YN);function ZN(e,t){let{children:n,style:r,className:i}=e,a=(0,v.useContext)(HN),o=(0,v.useContext)(UN),s=a??o,{startDate:c,weeksInMonth:l}=(0,v.useContext)(GN),u=W(e,{global:!0});return v.createElement(q.tbody,{render:e.render,...u,ref:t,style:r,className:i??`react-aria-CalendarGridBody`},[...Array(l).keys()].map(e=>v.createElement(`tr`,{key:e},s.getDatesInWeek(e,c).map((e,t)=>e?v.cloneElement(n(e),{key:t}):v.createElement(`td`,{key:t})))))}var QN=(0,v.forwardRef)(ZN),$N=(0,v.forwardRef)(function({date:e,...t},n){let r=(0,v.useContext)(HN),i=(0,v.useContext)(UN),a=r??i,{startDate:o}=(0,v.useContext)(GN)??{startDate:a.visibleRange.start},s=a.visibleDuration.days||a.visibleDuration.weeks?!1:!cD(o,e),c=fD(e,a.timeZone),l=(0,v.useRef)(null),{cellProps:u,buttonProps:d,...f}=SN({date:e,isOutsideMonth:s},a,l),{hoverProps:p,isHovered:m}=eh({...t,isDisabled:f.isDisabled||f.isUnavailable}),{focusProps:h,isFocusVisible:g}=Jm();g&&=f.isFocused;let _=!1,y=!1;`highlightedRange`in a&&a.highlightedRange&&(_=sD(e,a.highlightedRange.start),y=sD(e,a.highlightedRange.end));let b=Mf({...t,defaultChildren:f.formattedDate,defaultClassName:`react-aria-CalendarCell`,values:{date:e,isHovered:m,isOutsideMonth:s,isFocusVisible:g,isSelectionStart:_,isSelectionEnd:y,isToday:c,...f}}),x={"data-focused":f.isFocused||void 0,"data-hovered":m||void 0,"data-pressed":f.isPressed||void 0,"data-unavailable":f.isUnavailable||void 0,"data-disabled":f.isDisabled||void 0,"data-focus-visible":g||void 0,"data-outside-visible-range":f.isOutsideVisibleRange||void 0,"data-outside-month":s||void 0,"data-selected":f.isSelected||void 0,"data-selection-start":_||void 0,"data-selection-end":y||void 0,"data-invalid":f.isInvalid||void 0,"data-today":c||void 0},S=W(t,{global:!0});return v.createElement(`td`,{...u,ref:n},v.createElement(q.div,{...U(S,d,h,p,x,b),ref:l}))}),eP=(0,v.forwardRef)(function(e,t){let{offset:n,format:r,className:i=`react-aria-CalendarHeading`,...a}=e,o=v.useContext(HN),s=v.useContext(UN),c=wN({offset:n,format:r},o||s);return v.createElement(vh,{...a,className:i,ref:t},c)});function tP(e){return e&&e.__esModule?e.default:e}function nP(e,t,n){let r=rv(tP(WA),`@react-aria/datepicker`),{isInvalid:i,validationErrors:a,validationDetails:o}=t.displayValidation,{labelProps:s,fieldProps:c,descriptionProps:l,errorMessageProps:u}=XC({...e,labelElementType:`span`,isInvalid:i,errorMessage:e.errorMessage||a}),d=c[`aria-labelledby`]||c.id,{locale:f}=rp(),p=t.formatValue(f,{month:`long`}),m=tc(p?r.format(`selectedRangeDescription`,{startDate:p.start,endDate:p.end}):``),h={"aria-label":r.format(`startDate`),"aria-labelledby":d},g={"aria-label":r.format(`endDate`),"aria-labelledby":d},_=es(),y=es(),b=GA(t,n),x=[m[`aria-describedby`],c[`aria-describedby`]].filter(Boolean).join(` `)||void 0,S=(0,v.useMemo)(()=>Ug(n,{accept:e=>e.id!==_}),[n,_]),C={[XA]:S,[YA]:`presentation`,"aria-describedby":x,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},w=W(e),T=(0,v.useRef)(!1),{focusWithinProps:E}=qm({...e,isDisabled:t.isOpen,onBlurWithin:t=>{ps(document.getElementById(y),t.relatedTarget)||(T.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{T.current||(T.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}}),D=(0,v.useRef)(jS),O=(0,v.useRef)(jS);return{groupProps:U(w,b,c,m,E,{role:`group`,"aria-disabled":e.isDisabled||null,"aria-describedby":x,onKeyDown(n){t.isOpen||e.onKeyDown&&e.onKeyDown(n)},onKeyUp(n){t.isOpen||e.onKeyUp&&e.onKeyUp(n)}}),labelProps:{...s,onClick:()=>{S.focusFirst()}},buttonProps:{...m,id:_,"aria-haspopup":`dialog`,"aria-label":r.format(`calendar`),"aria-labelledby":`${_} ${d}`,"aria-describedby":x,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:y,"aria-labelledby":`${_} ${d}`},startFieldProps:{...h,...C,value:t.value?.start??null,defaultValue:t.defaultValue?.start,onChange:e=>t.setDateTime(`start`,e),autoFocus:e.autoFocus,name:e.startName,form:e.form,[NS]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){D.current=e,t.updateValidation(BS(e,O.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...g,...C,value:t.value?.end??null,defaultValue:t.defaultValue?.end,onChange:e=>t.setDateTime(`end`,e),name:e.endName,form:e.form,[NS]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){O.current=e,t.updateValidation(BS(D.current,e))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:l,errorMessageProps:u,calendarProps:{autoFocus:!0,value:t.dateRange?.start&&t.dateRange.end?t.dateRange:null,onChange:t.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:t.dateRange?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:typeof e.errorMessage==`function`?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(` `),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:i,validationErrors:a,validationDetails:o}}function rP(e){let t=gv(e),[n,r]=sh(e.value,e.defaultValue||null,e.onChange),[i]=(0,v.useState)(n),[a,o]=(0,v.useState)(()=>n||{start:null,end:null});n==null&&a.start&&a.end&&(a={start:null,end:null},o(a));let s=n||a,c=e=>{s=e||{start:null,end:null},o(s),iP(s)?r(s):r(null)},[l,u]=Qj(s?.start||s?.end||e.placeholderValue||null,e.granularity),d=l===`hour`||l===`minute`||l===`second`,f=e.shouldCloseOnSelect??!0,[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(null);s&&iP(s)&&(p=s,`hour`in s.start&&(h=s));let _=(e,t)=>{c({start:`timeZone`in t.start?t.start.set(qD(e.start)):JD(e.start,t.start),end:`timeZone`in t.end?t.end.set(qD(e.end)):JD(e.end,t.end)}),m(null),g(null),D.commitValidation()},y=n=>{let r=typeof f==`function`?f():f;d?iP(n)&&(r||h?.start&&h?.end)?_(n,{start:h?.start||Yj(e.placeholderValue),end:h?.end||Yj(e.placeholderValue)}):m(n):iP(n)?(c(n),D.commitValidation()):m(n),r&&t.setOpen(!1)},b=e=>{iP(p)&&iP(e)?_(p,e):g(e)},x=s?.start?.calendar.identifier===`gregory`&&s.start.era===`BC`||s?.end?.calendar.identifier===`gregory`&&s.end.era===`BC`,S=(0,v.useMemo)(()=>({granularity:l,timeZone:u,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:x}),[l,e.hourCycle,e.shouldForceLeadingZeros,u,e.hideTimeZone,x]),{minValue:C,maxValue:w,isDateUnavailable:T}=e,E=(0,v.useMemo)(()=>Gj(s,C,w,T?e=>T(e,null):void 0,S),[s,C,w,T,S]),D=PS({...e,value:n,name:(0,v.useMemo)(()=>[e.startName,e.endName].filter(e=>e!=null),[e.startName,e.endName]),builtinValidation:E}),O=D.displayValidation.isInvalid,k=e.validationState||(O?`invalid`:null);return{...D,value:s,defaultValue:e.defaultValue??i,setValue:c,dateRange:p,timeRange:h,granularity:l,hasTime:d,setDate(e,t){y(e===`start`?{start:t,end:p?.end??null}:{start:p?.start??null,end:t})},setTime(e,t){b(e===`start`?{start:t,end:h?.end??null}:{start:h?.start??null,end:t})},setDateTime(e,t){c(e===`start`?{start:t,end:s?.end??null}:{start:s?.start??null,end:t})},setDateRange:y,setTimeRange:b,...t,setOpen(n){!n&&!(s?.start&&s?.end)&&iP(p)&&d&&_(p,{start:h?.start||Yj(e.placeholderValue),end:h?.end||Yj(e.placeholderValue)}),t.setOpen(n)},validationState:k,isInvalid:O,formatValue(t,n){if(!s||!s.start||!s.end)return null;let r=`timeZone`in s.start?s.start.timeZone:void 0,i=e.granularity||(s.start&&`minute`in s.start?`minute`:`day`),a=`timeZone`in s.end?s.end.timeZone:void 0,o=e.granularity||(s.end&&`minute`in s.end?`minute`:`day`),c=Jj(n,{granularity:i,timeZone:r,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:s.start.calendar.identifier===`gregory`&&s.start.era===`BC`||s.end.calendar.identifier===`gregory`&&s.end.era===`BC`}),l=s.start.toDate(r||`UTC`),u=s.end.toDate(a||`UTC`),d=new Qk(t,c),f;if(r===a&&i===o&&s.start.compare(s.end)!==0){try{let e=d.formatRangeToParts(l,u),t=-1;for(let n=0;nt&&(r+=e[i].value);return{start:n,end:r}}catch{}f=d}else f=new Qk(t,Jj(n,{granularity:o,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:d.format(l),end:f.format(u)}},getDateFormatter(e,t){return new Qk(e,Jj({},{...S,...t}))}}}function iP(e){return e?.start!=null&&e.end!=null}var aP=(0,v.createContext)(null),oP=(0,v.createContext)(null),sP=[ES,th,Wf,sb],cP=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,aP);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,i=rP({...e,validationBehavior:r}),a=(0,v.useRef)(null),[o,s]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),{groupProps:c,labelProps:l,startFieldProps:u,endFieldProps:d,buttonProps:f,dialogProps:p,calendarProps:m,descriptionProps:h,errorMessageProps:g,..._}=nP({...Lf(e),label:s,validationBehavior:r},i,a),{focusProps:y,isFocused:b,isFocusVisible:x}=Jm({within:!0}),S=Mf({...e,values:{state:i,isFocusWithin:b,isFocusVisible:x,isDisabled:e.isDisabled||!1,isInvalid:i.isInvalid,isOpen:i.isOpen,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-DateRangePicker`}),C=W(e,{global:!0});return delete C.id,v.createElement(jf,{values:[[oP,i],[ES,{...c,ref:a,isInvalid:i.isInvalid}],[th,{...f,isPressed:i.isOpen}],[Wf,{...l,ref:o,elementType:`span`}],[VN,m],[cS,i],[_v,{trigger:`DateRangePicker`,triggerRef:a,placement:`bottom start`,clearContexts:sP}],[sS,p],[fM,{slots:{start:u,end:d}}],[sb,{slots:{description:h,errorMessage:g}}],[OS,_]]},v.createElement(q.div,{...U(C,S,y),ref:t,slot:e.slot||void 0,"data-focus-within":b||void 0,"data-invalid":i.isInvalid||void 0,"data-focus-visible":x||void 0,"data-disabled":e.isDisabled||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-open":i.isOpen||void 0}))}),lP=(0,v.createContext)({triggerRef:{current:null}}),uP=({children:e,className:t,onOpenChange:n,...r})=>{let i=v.useMemo(()=>Xd(),[]),a=(0,v.useRef)(null),[o,s]=v.useState(!1),c=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(!o)return;let e=e=>{!e.metaKey&&!e.ctrlKey&&!e.altKey&&(c.current=!0)};return window.addEventListener(`keydown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0)}},[o]);let l=e=>{s(e),!e&&c.current&&window.requestAnimationFrame(()=>{a.current?.focus()}),c.current=!1,n?.(e)};return(0,G.jsx)(lP,{value:{slots:i,triggerRef:a},children:(0,G.jsx)(cP,{"data-required":yh(r.isRequired),"data-slot":`date-range-picker`,...r,className:J(t,i?.base()),onOpenChange:l,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})};uP.displayName=`HeroUI.DateRangePicker`;var dP=({children:e,className:t,ref:n,...r})=>{let{slots:i,triggerRef:a}=(0,v.use)(lP),o=ys(v.useCallback(e=>{a.current=e},[a]),n);return(0,G.jsx)(nh,{ref:o,className:J(t,i?.trigger()),"data-slot":`date-range-picker-trigger`,...r,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})};dP.displayName=`HeroUI.DateRangePicker.Trigger`;var fP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(lP);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(r?.triggerIndicator,t),"data-slot":`date-range-picker-trigger-indicator`,...n,children:e||(0,G.jsx)(Mh,{})})};fP.displayName=`HeroUI.DateRangePicker.TriggerIndicator`;var pP=({children:e=` - `,className:t,...n})=>{let{slots:r}=(0,v.use)(lP);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(r?.rangeSeparator,t),"data-slot":`date-range-picker-range-separator`,...n,children:e})};pP.displayName=`HeroUI.DateRangePicker.RangeSeparator`;var mP=({children:e,className:t,placement:n=`bottom`,...r})=>{let{slots:i}=(0,v.use)(lP);return(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(yv,{...r,className:J(t,i?.popover()),"data-slot":`date-range-picker-popover`,placement:n,children:e})})};mP.displayName=`HeroUI.DateRangePicker.Popover`;var hP=Object.assign(uP,{Root:uP,Trigger:dP,TriggerIndicator:fP,RangeSeparator:pP,Popover:mP}),gP=8,_P=.3,vP=.5;function yP(e,t){let n=(0,v.use)(cS),r=(0,v.useRef)(null),i=(0,v.useRef)(!1),a=(0,v.useRef)(!1),o=(0,v.useRef)(0),s=(0,v.useRef)(0),c=(0,v.useRef)(0),l=(0,v.useRef)(0),u=(0,v.useRef)(0),d=e===`top`||e===`bottom`,f=(0,v.useCallback)(e=>d?e.clientY:e.clientX,[d]),p=(0,v.useCallback)(t=>{switch(e){case`bottom`:return Math.max(0,t);case`top`:return Math.min(0,t);case`right`:return Math.max(0,t);case`left`:return Math.min(0,t);default:return t}},[e]),m=(0,v.useCallback)(e=>{t&&e.button===0&&(e.target.closest(`input, textarea, button, [role='button'], select, a, [data-slot='drawer-body']`)||(i.current=!0,a.current=!1,o.current=f(e),u.current=o.current,l.current=Date.now(),s.current=0,c.current=0))},[f,t]),h=(0,v.useCallback)(e=>{if(!i.current||!r.current)return;let t=f(e),n=t-o.current,m=p(n);if(!a.current){if(Math.abs(n)0&&(c.current=(t-u.current)/g,l.current=h,u.current=t);let _=d?`Y`:`X`;r.current.style.transform=`translate${_}(${m}px)`},[f,p,d]),g=(0,v.useCallback)(e=>{if(!i.current)return;i.current=!1;let t=r.current;if(!t||!a.current){a.current=!1;return}a.current=!1;try{t.releasePointerCapture(e.pointerId)}catch{}let o=d?t.offsetHeight:t.offsetWidth,l=Math.abs(s.current),u=Math.abs(c.current);(l>o*_P||u>vP)&&n?n.close():(t.style.transition=`transform 300ms cubic-bezier(0.32, 0.72, 0, 1)`,t.style.transform=``,t.addEventListener(`transitionend`,()=>{t.style.transition=``},{once:!0})),s.current=0,c.current=0},[d,n]);return{dialogRef:r,dragHandlers:t?{onPointerDown:m,onPointerMove:h,onPointerUp:g}:{}}}var bP=(0,v.createContext)({}),xP=({children:e,state:t,...n})=>{let r=(0,v.useMemo)(()=>({slots:$d(),placement:void 0,isDismissable:!0}),[]),i=(0,v.useMemo)(()=>t?{isOpen:t.isOpen,onOpenChange:t.setOpen}:{},[t]);return(0,G.jsx)(bP,{value:r,children:(0,G.jsx)(lS,{"data-slot":`drawer-root`,...U(n,i),children:e})})};xP.displayName=`HeroUI.Drawer`;var SP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bP);return(0,G.jsx)(nh,{className:J(t,r?.trigger()),"data-slot":`drawer-trigger`,...n,children:e})};SP.displayName=`HeroUI.Drawer.Trigger`;var CP=({children:e,className:t,isDismissable:n=!0,variant:r,...i})=>{let{slots:a}=(0,v.use)(bP),o=(0,v.useMemo)(()=>$d({variant:r}),[r]),s=(0,v.useMemo)(()=>({slots:{...a,...o},isDismissable:n}),[a,o,n]);return(0,G.jsx)(gS,{className:J(t,o?.backdrop()),"data-slot":`drawer-backdrop`,isDismissable:n,...i,children:t=>(0,G.jsx)(bP,{value:s,children:typeof e==`function`?e(t):e})})};CP.displayName=`HeroUI.Drawer.Backdrop`;var wP=({children:e,className:t,placement:n=`bottom`,...r})=>{let{isDismissable:i,slots:a}=(0,v.use)(bP),o=(0,v.useMemo)(()=>$d({placement:n}),[n]),s=(0,v.useMemo)(()=>({placement:n,isDismissable:i,slots:{...a,...o}}),[a,n,i,o]);return(0,G.jsx)(mS,{className:J(t,o?.content()),"data-placement":n,"data-slot":`drawer-content`,...r,children:t=>(0,G.jsx)(bP,{value:s,children:typeof e==`function`?e(t):e})})};wP.displayName=`HeroUI.Drawer.Content`;var TP=({children:e,className:t,...n})=>{let{isDismissable:r=!0,placement:i,slots:a}=(0,v.use)(bP),{dialogRef:o,dragHandlers:s}=yP(i,r);return(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(uS,{ref:o,className:Y(a?.dialog,t),"data-placement":i,"data-slot":`drawer-dialog`,style:r?{touchAction:`none`}:void 0,...s,...n,children:e})})};TP.displayName=`HeroUI.Drawer.Dialog`;var EP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bP);return(0,G.jsx)(K.div,{className:Y(r?.header,t),"data-slot":`drawer-header`,...n,children:e})};EP.displayName=`HeroUI.Drawer.Header`;var DP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bP);return(0,G.jsx)(K.div,{className:Y(r?.body,t),"data-slot":`drawer-body`,style:{touchAction:`pan-y`},...n,children:e})};DP.displayName=`HeroUI.Drawer.Body`;var OP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bP);return(0,G.jsx)(K.div,{className:Y(r?.footer,t),"data-slot":`drawer-footer`,...n,children:e})};OP.displayName=`HeroUI.Drawer.Footer`;var kP=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bP);return(0,G.jsx)(vh,{className:Y(r?.heading,t),"data-slot":`drawer-heading`,slot:`title`,...n,children:e})};kP.displayName=`HeroUI.Drawer.Heading`;var AP=({className:e,...t})=>{let{slots:n}=(0,v.use)(bP);return(0,G.jsx)(K.div,{"aria-hidden":`true`,className:Y(n?.handle,e),"data-slot":`drawer-handle`,...t,children:(0,G.jsx)(`div`,{"data-slot":`drawer-handle-bar`})})};AP.displayName=`HeroUI.Drawer.Handle`;var jP=({className:e,...t})=>{let{slots:n}=(0,v.use)(bP);return(0,G.jsx)(xS,{className:J(e,n?.closeTrigger()),"data-slot":`drawer-close-trigger`,slot:`close`,...t})};jP.displayName=`HeroUI.Drawer.CloseTrigger`;var MP=Object.assign(xP,{Root:xP,Trigger:SP,Backdrop:CP,Content:wP,Dialog:TP,Header:EP,Heading:kP,Body:DP,Footer:OP,Handle:AP,CloseTrigger:jP});function NP(e){let{progressBarProps:t,labelProps:n}=wp(e);return{meterProps:{...t,role:`meter progressbar`},labelProps:n}}var PP=(0,v.createContext)(null),FP=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,PP);let{value:n=0,minValue:r=0,maxValue:i=100}=e;n=Oc(n,r,i);let a=i-r,[o,s]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),{meterProps:c,labelProps:l}=NP({...e,label:s}),u=a===0?0:(n-r)/a*100,d=Mf({...e,defaultClassName:`react-aria-Meter`,values:{percentage:u,valueText:c[`aria-valuetext`]}}),f=W(e,{global:!0});return v.createElement(q.div,{...U(f,d,c),ref:t,slot:e.slot||void 0},v.createElement(Wf.Provider,{value:{...l,ref:o,elementType:`span`}},d.children))});function IP({children:e,className:t,fullWidth:n,...r}){let i=v.useMemo(()=>Tf({fullWidth:n}),[n]);return(0,G.jsx)(_M,{"data-required":yh(r.isRequired),"data-slot":`time-field`,...r,className:J(t,i),children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})}var LP=Object.assign(IP,{Root:IP,Group:CM,Input:TM,InputContainer:DM,Segment:EM,Prefix:wM,Suffix:OM}),RP=e=>{let{containerRef:t,isEnabled:n,offset:r,onVisibilityChange:i,orientation:a,visibility:o}=e,s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useCallback)(()=>{let e=t.current;if(!e)return;let n=a===`vertical`,o=n?e.scrollTop:Math.abs(e.scrollLeft),l=n?e.scrollHeight:e.scrollWidth,u=n?e.clientHeight:e.clientWidth,d=o>r,f=o+u+r{c.current=null,n?d&&f?(e.dataset.topBottomScroll=`true`,delete e.dataset.topScroll,delete e.dataset.bottomScroll,i?.(`both`)):(e.dataset.topScroll=String(d),e.dataset.bottomScroll=String(f),delete e.dataset.topBottomScroll,i&&i(d?`top`:f?`bottom`:`none`)):d&&f?(e.dataset.leftRightScroll=`true`,delete e.dataset.leftScroll,delete e.dataset.rightScroll,i?.(`both`)):(e.dataset.leftScroll=String(d),e.dataset.rightScroll=String(f),delete e.dataset.leftRightScroll,i&&i(d?`left`:f?`right`:`none`))}))},[t,a,r,i]);(0,v.useEffect)(()=>{let e=t.current;if(!e||!n||o!==`auto`)return;l(),e.addEventListener(`scroll`,l,{passive:!0});let r=new ResizeObserver(l);return r.observe(e),()=>{e.removeEventListener(`scroll`,l),r.disconnect(),c.current!==null&&(cancelAnimationFrame(c.current),c.current=null),s.current=null}},[t,o,n,l])},zP=globalThis?.document?v.useLayoutEffect:v.useEffect,BP=({children:e,className:t,hideScrollBar:n=!1,isEnabled:r=!0,offset:i=0,onVisibilityChange:a,orientation:o=`vertical`,ref:s,size:c=40,variant:l=`fade`,visibility:u=`auto`,...d})=>{let f=(0,v.useRef)(null);RP({containerRef:f,isEnabled:r,offset:i,onVisibilityChange:a,orientation:o,visibility:u}),zP(()=>{let e=f.current;!e||u===`auto`||(delete e.dataset.topScroll,delete e.dataset.bottomScroll,delete e.dataset.topBottomScroll,delete e.dataset.leftScroll,delete e.dataset.rightScroll,delete e.dataset.leftRightScroll,u===`both`?e.dataset[o===`vertical`?`topBottomScroll`:`leftRightScroll`]=`true`:u!==`none`&&(e.dataset[`${u}Scroll`]=`true`))},[u,o]);let p=(0,v.useMemo)(()=>hf({hideScrollBar:n,orientation:o,variant:l}),[o,n,l]),m={"--scroll-shadow-size":`${c}px`,...d.style};return(0,G.jsx)(`div`,{ref:ys(f,s),className:p.base({className:t}),"data-orientation":o,"data-scroll-shadow-size":c,"data-slot":`scroll-shadow`,style:m,...d,children:e})};BP.displayName=`HeroUI.ScrollShadow`;var VP=Object.assign(BP,{Root:BP}),HP=({className:e,orientation:t,variant:n,...r})=>{let i=Pf(ab),a=t??i?.orientation??`horizontal`;return(0,G.jsx)(ob,{"data-orientation":a,"data-slot":`separator`,orientation:a,className:vf({orientation:a,variant:n,className:e}),...r})},UP=Object.assign(HP,{Root:HP}),WP=new Map;function GP(e,t,n=!0){let r=Jo();return v.useMemo(()=>{if(t!==void 0)return t;if(!r){if(n&&WP.has(e))return WP.get(e);try{let t=document.documentElement,r=getComputedStyle(t).getPropertyValue(e).trim()||void 0;return n&&WP.set(e,r),r}catch{return}}},[e,t,r,n])}var KP=({animationType:e,className:t,...n})=>{let r=GP(`--skeleton-animation`,e),i=v.useMemo(()=>yf({animationType:r}),[r]);return(0,G.jsx)(K.div,{className:i.base({className:t}),...n})},qP=Object.assign(KP,{Root:KP}),JP=(0,v.createContext)({}),YP=({children:e,className:t,fullWidth:n,isDetached:r=!1,isDisabled:i,orientation:a,size:o,...s})=>{let c=Pf(Ow),l=a??c?.orientation??`horizontal`,u=v.useMemo(()=>Df({fullWidth:n,isDetached:r,orientation:l}),[n,r,l]);return(0,G.jsx)(JP,{value:{slots:u,size:o,isDisabled:i},children:(0,G.jsx)(Aw,{className:J(t,u.base()),"data-slot":`toggle-button-group`,isDisabled:i,orientation:l,...s,children:e})})},XP=({className:e,...t})=>{let{slots:n}=(0,v.use)(JP);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(n?.separator,e),"data-slot":`toggle-button-group-separator`,...t})},ZP=({children:e,className:t,isIconOnly:n,size:r,style:i,variant:a,...o})=>{let s=(0,v.use)(JP),c=Ef({isIconOnly:n,size:r??s?.size,variant:a});return(0,G.jsx)(Nw,{className:J(t,c),"data-slot":`toggle-button`,style:i,...o,children:t=>typeof e==`function`?e(t):e})},QP=Object.assign(ZP,{Root:ZP});function $P(e,t,n){let{labelProps:r,inputProps:i,isSelected:a,...o}=Uw(e,t,n);return{labelProps:r,inputProps:{...i,role:`switch`,checked:a},isSelected:a,...o}}var eF=(0,v.createContext)(null),tF=(0,v.createContext)(null),nF=(0,v.createContext)(null),rF=(0,v.forwardRef)(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=Ff(r,t,eF);let{validationBehavior:i}=Pf(VS)||{},a=e.validationBehavior??i??`native`,o=Is(ys(n,e.inputRef===void 0?null:e.inputRef)),s=jw(e),c=$P({...Lf(e),children:typeof e.children==`function`||e.children,validationBehavior:a},s,o),{descriptionProps:l,errorMessageProps:u,isSelected:d,isDisabled:f,isReadOnly:p,isInvalid:m,validationDetails:h,validationErrors:g}=c,_=Mf({...e,defaultClassName:`react-aria-SwitchField`,values:{isSelected:d,isDisabled:f,isReadOnly:p,isInvalid:m,isRequired:e.isRequired||!1,state:s}}),y=W(e,{global:!0});return delete y.id,delete y.onClick,v.createElement(q.div,{...U(y,_),ref:t,slot:e.slot||void 0,"data-selected":d||void 0,"data-disabled":f||void 0,"data-readonly":p||void 0,"data-invalid":m||void 0,"data-required":e.isRequired||void 0},v.createElement(jf,{values:[[tF,s],[nF,{...c,inputRef:o,defaultClassName:`react-aria-SwitchButton`,isRequired:e.isRequired}],[sb,{slots:{description:l,errorMessage:u}}],[OS,{isInvalid:m,validationDetails:h,validationErrors:g}]]},_.children))}),iF=(0,v.forwardRef)(function(e,t){let{labelProps:n,inputProps:r,isSelected:i,isDisabled:a,isReadOnly:o,isPressed:s,isInvalid:c,inputRef:l,defaultClassName:u,isRequired:d}=(0,v.useContext)(nF),{isFocused:f,isFocusVisible:p,focusProps:m}=Jm(),h=a||o,g=(0,v.useContext)(tF),{hoverProps:_,isHovered:y}=eh({...e,isDisabled:h}),b=Mf({...e,defaultClassName:u,values:{isSelected:i,isPressed:s,isHovered:y,isFocused:f,isFocusVisible:p,isDisabled:a,isReadOnly:o,isInvalid:c,isRequired:d||!1,state:g}}),x=W(e,{global:!0});return delete x.id,delete x.onClick,v.createElement(q.label,{...U(x,n,_,b),ref:t,slot:e.slot||void 0,"data-selected":i||void 0,"data-pressed":s||void 0,"data-hovered":y||void 0,"data-focused":f||void 0,"data-focus-visible":p||void 0,"data-disabled":a||void 0,"data-readonly":o||void 0,"data-invalid":c||void 0,"data-required":d||void 0},v.createElement(ov,{elementType:`span`},v.createElement(`input`,{...U(r,m),ref:l})),b.children)}),aF=(0,v.createContext)({}),oF=({children:e,className:t,size:n,...r})=>{let i=v.useMemo(()=>bf({size:n}),[n]);return(0,G.jsx)(rF,{"data-slot":`switch`,...r,className:J(t,i.base()),children:t=>(0,G.jsx)(aF,{value:{slots:i,state:t},children:typeof e==`function`?e(t):e})})};oF.displayName=`HeroUI.Switch`;var sF=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aF);return(0,G.jsx)(iF,{"data-slot":`switch-content`,...n,className:J(t,r?.content()),children:e})};sF.displayName=`HeroUI.Switch.Content`;var cF=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aF);return(0,G.jsx)(K.span,{className:Y(r?.control,t),"data-slot":`switch-control`,...n,children:e})};cF.displayName=`HeroUI.Switch.Control`;var lF=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aF);return(0,G.jsx)(K.span,{className:Y(r?.thumb,t),"data-slot":`switch-thumb`,...n,children:e})};lF.displayName=`HeroUI.Switch.Thumb`;var uF=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aF);return(0,G.jsx)(K.span,{className:Y(r?.icon,t),"data-slot":`switch-icon`,...n,children:e})};uF.displayName=`HeroUI.Switch.Icon`;var dF=Object.assign(oF,{Root:oF,Content:sF,Control:cF,Thumb:lF,Icon:uF}),fF=new WeakMap;function pF(e,t,n){return e?(typeof t==`string`&&(t=t.replace(/\s+/g,``)),`${fF.get(e)}-${n}-${t}`):``}function mF(e,t,n){let{key:r,isDisabled:i,shouldSelectOnPressUp:a}=e,{selectionManager:o,selectedKey:s}=t,c=r===s,l=i||t.isDisabled||t.selectionManager.isDisabled(r),u=t.collection.getItem(r),{itemProps:d,isPressed:f}=fx({selectionManager:o,key:r,ref:n,isDisabled:l,shouldSelectOnPressUp:a??u?.props.href!=null,linkBehavior:`selection`}),p=pF(t,r,`tab`),m=pF(t,r,`tabpanel`),{tabIndex:h}=d,g=W(u?.props,{labelable:!0});delete g.id;let _=Po(u?.props),{focusableProps:v}=Em({...u?.props,isDisabled:l},n);return{tabProps:U(g,v,_,d,{id:p,"aria-selected":c,"aria-disabled":l||void 0,"aria-controls":c?m:void 0,tabIndex:l?void 0:h,role:`tab`}),isSelected:c,isDisabled:l,isPressed:f}}function hF(e,t){let n=t?.isDisabled,[r,i]=(0,v.useState)(!1);return Io(()=>{if(e?.current&&!n){let t=()=>{if(e.current){let t=Hg(e.current,{tabbable:!0});i(!!t.nextNode())}};t();let n=new MutationObserver(t);return n.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`tabIndex`,`disabled`]}),()=>{n.disconnect()}}}),!n&&r}function gF(e,t,n){let r=hF(n)?void 0:0,i=pF(t,e.id??t?.selectedKey,`tabpanel`);return{tabPanelProps:U(Fs({...e,id:i,"aria-labelledby":pF(t,t?.selectedKey,`tab`)}),{tabIndex:r,role:`tabpanel`,"aria-describedby":e[`aria-describedby`],"aria-details":e[`aria-details`]})}}var _F=class{constructor(e,t,n,r=new Set){this.collection=e,this.flipDirection=t===`rtl`&&n===`horizontal`,this.disabledKeys=r,this.tabDirection=n===`horizontal`}getKeyLeftOf(e){return this.flipDirection?this.getNextKey(e):this.getPreviousKey(e)}getKeyRightOf(e){return this.flipDirection?this.getPreviousKey(e):this.getNextKey(e)}isDisabled(e){return this.disabledKeys.has(e)||!!this.collection.getItem(e)?.props?.isDisabled}getFirstKey(){let e=this.collection.getFirstKey();return e!=null&&this.isDisabled(e)&&(e=this.getNextKey(e)),e}getLastKey(){let e=this.collection.getLastKey();return e!=null&&this.isDisabled(e)&&(e=this.getPreviousKey(e)),e}getKeyAbove(e){return this.tabDirection?null:this.getPreviousKey(e)}getKeyBelow(e){return this.tabDirection?null:this.getNextKey(e)}getNextKey(e){let t=e;do t=this.collection.getKeyAfter(t),t??=this.collection.getFirstKey();while(t!=null&&this.isDisabled(t)&&t!==e);return t}getPreviousKey(e){let t=e;do t=this.collection.getKeyBefore(t),t??=this.collection.getLastKey();while(t!=null&&this.isDisabled(t)&&t!==e);return t}};function vF(e,t,n){let{orientation:r=`horizontal`,keyboardActivation:i=`automatic`}=e,{collection:a,selectionManager:o,disabledKeys:s}=t,{direction:c}=rp(),{collectionProps:l}=ax({ref:n,selectionManager:o,keyboardDelegate:(0,v.useMemo)(()=>new _F(a,c,r,s),[a,s,r,c]),selectOnFocus:i===`automatic`,disallowEmptySelection:!0,scrollRef:n,linkBehavior:`selection`}),u=es();return fF.set(t,u),{tabListProps:{...U(l,Fs({...e,id:u})),role:`tablist`,"aria-orientation":r,tabIndex:void 0}}}function yF(e){let[t,n]=sh(e.selectedKey,e.defaultSelectedKey??null,e.onSelectionChange),r=(0,v.useMemo)(()=>t==null?[]:[t],[t]),{collection:i,disabledKeys:a,selectionManager:o}=IC({...e,selectionMode:`single`,disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:r,onSelectionChange:r=>{if(r===`all`)return;let i=r.values().next().value??null;i===t&&e.onSelectionChange&&e.onSelectionChange(i),n(i)}});return{collection:i,disabledKeys:a,selectionManager:o,selectedKey:t,setSelectedKey:n,selectedItem:t==null?null:i.getItem(t)}}function bF(e){let t=yF({...e,onSelectionChange:e.onSelectionChange?t=>{t!=null&&e.onSelectionChange?.(t)}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:e.defaultSelectedKey??xF(e.collection,e.disabledKeys?new Set(e.disabledKeys):new Set)??void 0}),{selectionManager:n,collection:r,selectedKey:i}=t,a=(0,v.useRef)(i);return(0,v.useEffect)(()=>{let o=i;e.selectedKey==null&&(n.isEmpty||o==null||!r.getItem(o))&&(o=xF(r,t.disabledKeys),o!=null&&n.setSelectedKeys([o])),(o!=null&&n.focusedKey==null||!n.isFocused&&o!==a.current)&&n.setFocusedKey(o),a.current=o}),{...t,isDisabled:e.isDisabled||!1}}function xF(e,t){let n=null;if(e){for(n=e.getFirstKey();n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n!==e.getLastKey();)n=e.getKeyAfter(n);n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n===e.getLastKey()&&(n=e.getFirstKey())}return n}var SF=(0,v.createContext)(null),CF=(0,v.createContext)(null),wF=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,SF);let{children:n,orientation:r=`horizontal`}=e;return n=(0,v.useMemo)(()=>typeof n==`function`?n({orientation:r,defaultChildren:null}):n,[n,r]),v.createElement(Rv,{content:n},n=>v.createElement(TF,{props:e,collection:n,tabsRef:t}))});function TF({props:e,tabsRef:t,collection:n}){let{orientation:r=`horizontal`}=e,i=bF({...e,collection:n,children:void 0}),{focusProps:a,isFocused:o,isFocusVisible:s}=Jm({within:!0}),c=(0,v.useMemo)(()=>({orientation:r,isFocusWithin:o,isFocusVisible:s}),[r,o,s]),l=Mf({...e,defaultClassName:`react-aria-Tabs`,values:c}),u=W(e,{global:!0});return v.createElement(q.div,{...U(u,l,a),ref:t,slot:e.slot||void 0,"data-focused":o||void 0,"data-orientation":r,"data-focus-visible":s||void 0,"data-disabled":i.isDisabled||void 0},v.createElement(jf,{values:[[SF,e],[CF,i]]},l.children))}var EF=(0,v.forwardRef)(function(e,t){return(0,v.useContext)(CF)?v.createElement(DF,{props:e,forwardedRef:t}):v.createElement(Xv,e)});function DF({props:e,forwardedRef:t}){let n=(0,v.useContext)(CF),{CollectionRoot:r}=(0,v.useContext)(ny),{orientation:i=`horizontal`,keyboardActivation:a=`automatic`}=Pf(SF),o=Is(t),{tabListProps:s}=vF({...e,orientation:i,keyboardActivation:a},n,o),c=Mf({...e,children:null,defaultClassName:`react-aria-TabList`,values:{orientation:i,state:n}}),l=W(e,{global:!0});return delete l.id,v.createElement(q.div,{...U(l,c,s),ref:o,"data-orientation":i||void 0},v.createElement(eb,null,v.createElement(r,{collection:n.collection,persistedKeys:ry(n.selectionManager.focusedKey)})))}var OF=Kv(class extends xv{static{this.type=`item`}},(e,t,n)=>{let r=(0,v.useContext)(CF),i=Is(t),{tabProps:a,isSelected:o,isDisabled:s,isPressed:c}=mF({key:n.key,...e},r,i),{focusProps:l,isFocused:u,isFocusVisible:d}=Jm(),{hoverProps:f,isHovered:p}=eh({isDisabled:s,onHoverStart:e.onHoverStart,onHoverEnd:e.onHoverEnd,onHoverChange:e.onHoverChange}),m=Mf({...e,id:void 0,children:n.rendered,defaultClassName:`react-aria-Tab`,values:{isSelected:o,isDisabled:s,isFocused:u,isFocusVisible:d,isPressed:c,isHovered:p}}),h=n.props.href?q.a:q.div,g=W(e,{global:!0});return delete g.id,delete g.onClick,v.createElement(h,{...U(g,m,a,l,f),ref:i,"data-selected":o||void 0,"data-disabled":s||void 0,"data-focused":u||void 0,"data-focus-visible":d||void 0,"data-pressed":c||void 0,"data-hovered":p||void 0},v.createElement(nb.Provider,{value:{isSelected:o}},m.children))}),kF=Hf(function(e,t){let n=(0,v.useContext)(CF),r=Is(t),i=n.selectedKey===e.id,[a,o]=(0,v.useState)(n.selectedKey==null?null:i);a==null&&n.selectedKey!=null?o(i):!i&&a&&o(!1);let s=pc(r,i);return!i&&!e.shouldForceMount&&!s?null:v.createElement(AF,{...e,tabPanelRef:r,isInitiallySelected:a||!1,isExiting:s})});function AF(e){let t=(0,v.useContext)(CF),{id:n,tabPanelRef:r,isInitiallySelected:i,isExiting:a,...o}=e,{tabPanelProps:s}=gF(e,t,r),{focusProps:c,isFocused:l,isFocusVisible:u}=Jm(),d=t.selectedKey===e.id,f=fc(r)&&!i,p=Mf({...e,defaultClassName:`react-aria-TabPanel`,values:{isFocused:l,isFocusVisible:u,isInert:uc(!d),isEntering:f,isExiting:a,state:t}}),m=W(o,{global:!0});delete m.id;let h=d?U(m,s,c,p):U(m,p);return v.createElement(q.div,{...h,ref:r,"data-focused":l||void 0,"data-focus-visible":u||void 0,inert:uc(!d||e.inert),"data-inert":d?void 0:`true`,"data-entering":f||void 0,"data-exiting":a||void 0},v.createElement(jf,{values:[[SF,null],[CF,null]]},v.createElement(ny.Provider,{value:$v},p.children)))}var jF=(0,v.createContext)({}),MF=XE(`tabs.listContainer`),NF=({children:e,className:t,orientation:n=`horizontal`,variant:r,...i})=>{let a=v.useMemo(()=>Sf({variant:r}),[r]);return(0,G.jsx)(jF,{value:{orientation:n,slots:a},children:(0,G.jsx)(wF,{...i,className:J(t,a.base()),"data-slot":`tabs`,orientation:n,children:e})})},PF=({children:e,className:t,render:n,...r})=>(0,G.jsx)(MF.Injector,{...r,className:t,render:n,children:e}),FF=({children:e,className:t,...n})=>{let{orientation:r=`horizontal`,slots:i}=(0,v.use)(jF),a=(0,v.useRef)(null),o=r===`vertical`,[s,c]=MF.useSlot(n),l=(0,v.useCallback)(e=>{let t=a.current;if(!t)return;let n=o?t.clientHeight:t.clientWidth,r=o?t.scrollHeight:t.scrollWidth,i=Math.max(0,r-n),s=!o&&getComputedStyle(t).direction===`rtl`,c=e*n*.8*(s?-1:1),l=o?t.scrollTop:t.scrollLeft,u=Math.min(s?0:i,Math.max(s?-i:0,l+c));u!==l&&t.scrollTo({behavior:`smooth`,[o?`top`:`left`]:u})},[o]);if(!s)return(0,G.jsx)(EF,{...c,className:J(t,i?.tabList()),"data-slot":`tabs-list`,children:e});let{className:u,render:d,...f}=s;return(0,G.jsx)(EF,{...c,className:J(t,i?.tabList()),"data-slot":`tabs-list`,render:e=>{let{children:t,className:n,ref:s,...c}=e;return(0,G.jsxs)(K.div,{className:Y(i?.tabListContainer,u),"data-slot":`tabs-list-container`,render:d,...f,children:[(0,G.jsx)(VP,{ref:a,hideScrollBar:!0,className:Y(i?.scroller),orientation:r,size:64,children:(0,G.jsx)(`div`,{...c,ref:s,className:n,children:t})}),(0,G.jsx)(`button`,{"aria-label":o?`Scroll tabs up`:`Scroll tabs left`,className:Y(i?.scrollPrev),tabIndex:-1,type:`button`,onClick:()=>l(-1),children:o?(0,G.jsx)(xh,{}):(0,G.jsx)(Sh,{})}),(0,G.jsx)(`button`,{"aria-label":o?`Scroll tabs down`:`Scroll tabs right`,className:Y(i?.scrollNext),tabIndex:-1,type:`button`,onClick:()=>l(1),children:o?(0,G.jsx)(bh,{}):(0,G.jsx)(Ch,{})})]})},children:e})},IF=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(jF);return(0,G.jsx)(OF,{...n,className:J(t,r?.tab()),"data-slot":`tabs-tab`,children:e})},LF=Object.assign(NF,{Root:NF,ListContainer:PF,List:FF,Tab:IF,Indicator:({className:e,...t})=>{let{slots:n}=(0,v.use)(jF);return(0,G.jsx)(rb,{className:Y(n?.tabIndicator,e),"data-slot":`tabs-indicator`,...t})},Separator:({className:e,...t})=>{let{slots:n}=(0,v.use)(jF);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(n?.separator,e),"data-slot":`tabs-separator`,...t})},Panel:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(jF);return(0,G.jsx)(kF,{...n,className:J(t,r?.tabPanel()),"data-slot":`tabs-panel`,children:e})}}),RF={};RF={deselectedItem:e=>`${e.item} \u{63A}\u{64A}\u{631} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`,longPressToSelect:`اضغط مطولًا للدخول إلى وضع التحديد.`,select:`تحديد`,selectedAll:`جميع العناصر المحددة.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`لم يتم تحديد عناصر`,one:()=>`${t.number(e.count)} \u{639}\u{646}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}`,other:()=>`${t.number(e.count)} \u{639}\u{646}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}`})}.`,selectedItem:e=>`${e.item} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`};var zF={};zF={deselectedItem:e=>`${e.item} \u{43D}\u{435} \u{435} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}.`,longPressToSelect:`Натиснете и задръжте за да влезете в избирателен режим.`,select:`Изберете`,selectedAll:`Всички елементи са избрани.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Няма избрани елементи`,one:()=>`${t.number(e.count)} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}`,other:()=>`${t.number(e.count)} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{438} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}\u{438}`})}.`,selectedItem:e=>`${e.item} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}.`};var BF={};BF={deselectedItem:e=>`Polo\u{17E}ka ${e.item} nen\xed vybr\xe1na.`,longPressToSelect:`Dlouhým stisknutím přejdete do režimu výběru.`,select:`Vybrat`,selectedAll:`Vybrány všechny položky.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nevybrány žádné položky`,one:()=>`Vybr\xe1na ${t.number(e.count)} polo\u{17E}ka`,other:()=>`Vybr\xe1no ${t.number(e.count)} polo\u{17E}ek`})}.`,selectedItem:e=>`Vybr\xe1na polo\u{17E}ka ${e.item}.`};var VF={};VF={deselectedItem:e=>`${e.item} ikke valgt.`,longPressToSelect:`Lav et langt tryk for at aktivere valgtilstand.`,select:`Vælg`,selectedAll:`Alle elementer valgt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ingen elementer valgt`,one:()=>`${t.number(e.count)} element valgt`,other:()=>`${t.number(e.count)} elementer valgt`})}.`,selectedItem:e=>`${e.item} valgt.`};var HF={};HF={deselectedItem:e=>`${e.item} nicht ausgew\xe4hlt.`,longPressToSelect:`Gedrückt halten, um Auswahlmodus zu öffnen.`,select:`Auswählen`,selectedAll:`Alle Elemente ausgewählt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Keine Elemente ausgewählt`,one:()=>`${t.number(e.count)} Element ausgew\xe4hlt`,other:()=>`${t.number(e.count)} Elemente ausgew\xe4hlt`})}.`,selectedItem:e=>`${e.item} ausgew\xe4hlt.`};var UF={};UF={deselectedItem:e=>`\u{394}\u{3B5}\u{3BD} \u{3B5}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} \u{3C4}\u{3BF} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3BF} ${e.item}.`,longPressToSelect:`Πατήστε παρατεταμένα για να μπείτε σε λειτουργία επιλογής.`,select:`Επιλογή`,selectedAll:`Επιλέχθηκαν όλα τα στοιχεία.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Δεν επιλέχθηκαν στοιχεία`,one:()=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} ${t.number(e.count)} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3BF}`,other:()=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B1}\u{3BD} ${t.number(e.count)} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3B1}`})}.`,selectedItem:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} \u{3C4}\u{3BF} \u{3C3}\u{3C4}\u{3BF}\u{3B9}\u{3C7}\u{3B5}\u{3AF}\u{3BF} ${e.item}.`};var WF={};WF={deselectedItem:e=>`${e.item} not selected.`,select:`Select`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`No items selected`,one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:`All items selected.`,selectedItem:e=>`${e.item} selected.`,longPressToSelect:`Long press to enter selection mode.`};var GF={};GF={deselectedItem:e=>`${e.item} no seleccionado.`,longPressToSelect:`Mantenga pulsado para abrir el modo de selección.`,select:`Seleccionar`,selectedAll:`Todos los elementos seleccionados.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ningún elemento seleccionado`,one:()=>`${t.number(e.count)} elemento seleccionado`,other:()=>`${t.number(e.count)} elementos seleccionados`})}.`,selectedItem:e=>`${e.item} seleccionado.`};var KF={};KF={deselectedItem:e=>`${e.item} pole valitud.`,longPressToSelect:`Valikurežiimi sisenemiseks vajutage pikalt.`,select:`Vali`,selectedAll:`Kõik üksused valitud.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Üksusi pole valitud`,one:()=>`${t.number(e.count)} \xfcksus valitud`,other:()=>`${t.number(e.count)} \xfcksust valitud`})}.`,selectedItem:e=>`${e.item} valitud.`};var qF={};qF={deselectedItem:e=>`Kohdetta ${e.item} ei valittu.`,longPressToSelect:`Siirry valintatilaan painamalla pitkään.`,select:`Valitse`,selectedAll:`Kaikki kohteet valittu.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ei yhtään kohdetta valittu`,one:()=>`${t.number(e.count)} kohde valittu`,other:()=>`${t.number(e.count)} kohdetta valittu`})}.`,selectedItem:e=>`${e.item} valittu.`};var JF={};JF={deselectedItem:e=>`${e.item} non s\xe9lectionn\xe9.`,longPressToSelect:`Appuyez de manière prolongée pour passer en mode de sélection.`,select:`Sélectionner`,selectedAll:`Tous les éléments sélectionnés.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Aucun élément sélectionné`,one:()=>`${t.number(e.count)} \xe9l\xe9ment s\xe9lectionn\xe9`,other:()=>`${t.number(e.count)} \xe9l\xe9ments s\xe9lectionn\xe9s`})}.`,selectedItem:e=>`${e.item} s\xe9lectionn\xe9.`};var YF={};YF={deselectedItem:e=>`${e.item} \u{5DC}\u{5D0} \u{5E0}\u{5D1}\u{5D7}\u{5E8}.`,longPressToSelect:`הקשה ארוכה לכניסה למצב בחירה.`,select:`בחר`,selectedAll:`כל הפריטים נבחרו.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`לא נבחרו פריטים`,one:()=>`\u{5E4}\u{5E8}\u{5D9}\u{5D8} ${t.number(e.count)} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`,other:()=>`${t.number(e.count)} \u{5E4}\u{5E8}\u{5D9}\u{5D8}\u{5D9}\u{5DD} \u{5E0}\u{5D1}\u{5D7}\u{5E8}\u{5D5}`})}.`,selectedItem:e=>`${e.item} \u{5E0}\u{5D1}\u{5D7}\u{5E8}.`};var XF={};XF={deselectedItem:e=>`Stavka ${e.item} nije odabrana.`,longPressToSelect:`Dugo pritisnite za ulazak u način odabira.`,select:`Odaberite`,selectedAll:`Odabrane su sve stavke.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nije odabrana nijedna stavka`,one:()=>`Odabrana je ${t.number(e.count)} stavka`,other:()=>`Odabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`Stavka ${e.item} je odabrana.`};var ZF={};ZF={deselectedItem:e=>`${e.item} nincs kijel\xf6lve.`,longPressToSelect:`Nyomja hosszan a kijelöléshez.`,select:`Kijelölés`,selectedAll:`Az összes elem kijelölve.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Egy elem sincs kijelölve`,one:()=>`${t.number(e.count)} elem kijel\xf6lve`,other:()=>`${t.number(e.count)} elem kijel\xf6lve`})}.`,selectedItem:e=>`${e.item} kijel\xf6lve.`};var QF={};QF={deselectedItem:e=>`${e.item} non selezionato.`,longPressToSelect:`Premi a lungo per passare alla modalità di selezione.`,select:`Seleziona`,selectedAll:`Tutti gli elementi selezionati.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nessun elemento selezionato`,one:()=>`${t.number(e.count)} elemento selezionato`,other:()=>`${t.number(e.count)} elementi selezionati`})}.`,selectedItem:e=>`${e.item} selezionato.`};var $F={};$F={deselectedItem:e=>`${e.item} \u{304C}\u{9078}\u{629E}\u{3055}\u{308C}\u{3066}\u{3044}\u{307E}\u{305B}\u{3093}\u{3002}`,longPressToSelect:`長押しして選択モードを開きます。`,select:`選択`,selectedAll:`すべての項目を選択しました。`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`項目が選択されていません`,one:()=>`${t.number(e.count)} \u{9805}\u{76EE}\u{3092}\u{9078}\u{629E}\u{3057}\u{307E}\u{3057}\u{305F}`,other:()=>`${t.number(e.count)} \u{9805}\u{76EE}\u{3092}\u{9078}\u{629E}\u{3057}\u{307E}\u{3057}\u{305F}`})}\u{3002}`,selectedItem:e=>`${e.item} \u{3092}\u{9078}\u{629E}\u{3057}\u{307E}\u{3057}\u{305F}\u{3002}`};var eI={};eI={deselectedItem:e=>`${e.item}\u{C774}(\u{AC00}) \u{C120}\u{D0DD}\u{B418}\u{C9C0} \u{C54A}\u{C558}\u{C2B5}\u{B2C8}\u{B2E4}.`,longPressToSelect:`선택 모드로 들어가려면 길게 누르십시오.`,select:`선택`,selectedAll:`모든 항목이 선택되었습니다.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`선택된 항목이 없습니다`,one:()=>`${t.number(e.count)}\u{AC1C} \u{D56D}\u{BAA9}\u{C774} \u{C120}\u{D0DD}\u{B418}\u{C5C8}\u{C2B5}\u{B2C8}\u{B2E4}`,other:()=>`${t.number(e.count)}\u{AC1C} \u{D56D}\u{BAA9}\u{C774} \u{C120}\u{D0DD}\u{B418}\u{C5C8}\u{C2B5}\u{B2C8}\u{B2E4}`})}.`,selectedItem:e=>`${e.item}\u{C774}(\u{AC00}) \u{C120}\u{D0DD}\u{B418}\u{C5C8}\u{C2B5}\u{B2C8}\u{B2E4}.`};var tI={};tI={deselectedItem:e=>`${e.item} nepasirinkta.`,longPressToSelect:`Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.`,select:`Pasirinkti`,selectedAll:`Pasirinkti visi elementai.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nepasirinktas nė vienas elementas`,one:()=>`Pasirinktas ${t.number(e.count)} elementas`,other:()=>`Pasirinkta element\u{173}: ${t.number(e.count)}`})}.`,selectedItem:e=>`Pasirinkta: ${e.item}.`};var nI={};nI={deselectedItem:e=>`Vienums ${e.item} nav atlas\u{12B}ts.`,longPressToSelect:`Ilgi turiet nospiestu. lai ieslēgtu atlases režīmu.`,select:`Atlasīt`,selectedAll:`Atlasīti visi vienumi.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nav atlasīts neviens vienums`,one:()=>`Atlas\u{12B}to vienumu skaits: ${t.number(e.count)}`,other:()=>`Atlas\u{12B}to vienumu skaits: ${t.number(e.count)}`})}.`,selectedItem:e=>`Atlas\u{12B}ts vienums ${e.item}.`};var rI={};rI={deselectedItem:e=>`${e.item} er ikke valgt.`,longPressToSelect:`Bruk et langt trykk for å gå inn i valgmodus.`,select:`Velg`,selectedAll:`Alle elementer er valgt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Ingen elementer er valgt`,one:()=>`${t.number(e.count)} element er valgt`,other:()=>`${t.number(e.count)} elementer er valgt`})}.`,selectedItem:e=>`${e.item} er valgt.`};var iI={};iI={deselectedItem:e=>`${e.item} niet geselecteerd.`,longPressToSelect:`Druk lang om de selectiemodus te openen.`,select:`Selecteren`,selectedAll:`Alle items geselecteerd.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Geen items geselecteerd`,one:()=>`${t.number(e.count)} item geselecteerd`,other:()=>`${t.number(e.count)} items geselecteerd`})}.`,selectedItem:e=>`${e.item} geselecteerd.`};var aI={};aI={deselectedItem:e=>`Nie zaznaczono ${e.item}.`,longPressToSelect:`Naciśnij i przytrzymaj, aby wejść do trybu wyboru.`,select:`Zaznacz`,selectedAll:`Wszystkie zaznaczone elementy.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nie zaznaczono żadnych elementów`,one:()=>`${t.number(e.count)} zaznaczony element`,other:()=>`${t.number(e.count)} zaznaczonych element\xf3w`})}.`,selectedItem:e=>`Zaznaczono ${e.item}.`};var oI={};oI={deselectedItem:e=>`${e.item} n\xe3o selecionado.`,longPressToSelect:`Mantenha pressionado para entrar no modo de seleção.`,select:`Selecionar`,selectedAll:`Todos os itens selecionados.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nenhum item selecionado`,one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var sI={};sI={deselectedItem:e=>`${e.item} n\xe3o selecionado.`,longPressToSelect:`Prima continuamente para entrar no modo de seleção.`,select:`Selecionar`,selectedAll:`Todos os itens selecionados.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nenhum item selecionado`,one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var cI={};cI={deselectedItem:e=>`${e.item} neselectat.`,longPressToSelect:`Apăsați lung pentru a intra în modul de selectare.`,select:`Selectare`,selectedAll:`Toate elementele selectate.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Niciun element selectat`,one:()=>`${t.number(e.count)} element selectat`,other:()=>`${t.number(e.count)} elemente selectate`})}.`,selectedItem:e=>`${e.item} selectat.`};var lI={};lI={deselectedItem:e=>`${e.item} \u{43D}\u{435} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`,longPressToSelect:`Нажмите и удерживайте для входа в режим выбора.`,select:`Выбрать`,selectedAll:`Выбраны все элементы.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Нет выбранных элементов`,one:()=>`${t.number(e.count)} \u{44D}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}`,other:()=>`${t.number(e.count)} \u{44D}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}\u{43E}\u{432} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E}`})}.`,selectedItem:e=>`${e.item} \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`};var uI={};uI={deselectedItem:e=>`Nevybrat\xe9 polo\u{17E}ky: ${e.item}.`,longPressToSelect:`Dlhším stlačením prejdite do režimu výberu.`,select:`Vybrať`,selectedAll:`Všetky vybraté položky.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Žiadne vybraté položky`,one:()=>`${t.number(e.count)} vybrat\xe1 polo\u{17E}ka`,other:()=>`Po\u{10D}et vybrat\xfdch polo\u{17E}iek:${t.number(e.count)}`})}.`,selectedItem:e=>`Vybrat\xe9 polo\u{17E}ky: ${e.item}.`};var dI={};dI={deselectedItem:e=>`Element ${e.item} ni izbran.`,longPressToSelect:`Za izbirni način pritisnite in dlje časa držite.`,select:`Izberite`,selectedAll:`Vsi elementi so izbrani.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Noben element ni izbran`,one:()=>`${t.number(e.count)} element je izbran`,other:()=>`${t.number(e.count)} elementov je izbranih`})}.`,selectedItem:e=>`Element ${e.item} je izbran.`};var fI={};fI={deselectedItem:e=>`${e.item} nije izabrano.`,longPressToSelect:`Dugo pritisnite za ulazak u režim biranja.`,select:`Izaberite`,selectedAll:`Izabrane su sve stavke.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Nije izabrana nijedna stavka`,one:()=>`Izabrana je ${t.number(e.count)} stavka`,other:()=>`Izabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`${e.item} je izabrano.`};var pI={};pI={deselectedItem:e=>`${e.item} ej markerat.`,longPressToSelect:`Tryck länge när du vill öppna väljarläge.`,select:`Markera`,selectedAll:`Alla markerade objekt.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Inga markerade objekt`,one:()=>`${t.number(e.count)} markerat objekt`,other:()=>`${t.number(e.count)} markerade objekt`})}.`,selectedItem:e=>`${e.item} markerat.`};var mI={};mI={deselectedItem:e=>`${e.item} se\xe7ilmedi.`,longPressToSelect:`Seçim moduna girmek için uzun basın.`,select:`Seç`,selectedAll:`Tüm ögeler seçildi.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Hiçbir öge seçilmedi`,one:()=>`${t.number(e.count)} \xf6ge se\xe7ildi`,other:()=>`${t.number(e.count)} \xf6ge se\xe7ildi`})}.`,selectedItem:e=>`${e.item} se\xe7ildi.`};var hI={};hI={deselectedItem:e=>`${e.item} \u{43D}\u{435} \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`,longPressToSelect:`Виконайте довге натиснення, щоб перейти в режим вибору.`,select:`Вибрати`,selectedAll:`Усі елементи вибрано.`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`Жодних елементів не вибрано`,one:()=>`${t.number(e.count)} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442} \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}`,other:()=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{435}\u{43B}\u{435}\u{43C}\u{435}\u{43D}\u{442}\u{456}\u{432}: ${t.number(e.count)}`})}.`,selectedItem:e=>`${e.item} \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}.`};var gI={};gI={deselectedItem:e=>`\u{672A}\u{9009}\u{62E9} ${e.item}\u{3002}`,longPressToSelect:`长按以进入选择模式。`,select:`选择`,selectedAll:`已选择所有项目。`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`未选择项目`,one:()=>`\u{5DF2}\u{9009}\u{62E9} ${t.number(e.count)} \u{4E2A}\u{9879}\u{76EE}`,other:()=>`\u{5DF2}\u{9009}\u{62E9} ${t.number(e.count)} \u{4E2A}\u{9879}\u{76EE}`})}\u{3002}`,selectedItem:e=>`\u{5DF2}\u{9009}\u{62E9} ${e.item}\u{3002}`};var _I={};_I={deselectedItem:e=>`\u{672A}\u{9078}\u{53D6}\u{300C}${e.item}\u{300D}\u{3002}`,longPressToSelect:`長按以進入選擇模式。`,select:`選取`,selectedAll:`已選取所有項目。`,selectedCount:(e,t)=>`${t.plural(e.count,{"=0":`未選取任何項目`,one:()=>`\u{5DF2}\u{9078}\u{53D6} ${t.number(e.count)} \u{500B}\u{9805}\u{76EE}`,other:()=>`\u{5DF2}\u{9078}\u{53D6} ${t.number(e.count)} \u{500B}\u{9805}\u{76EE}`})}\u{3002}`,selectedItem:e=>`\u{5DF2}\u{9078}\u{53D6}\u{300C}${e.item}\u{300D}\u{3002}`};var vI={};vI={"ar-AE":RF,"bg-BG":zF,"cs-CZ":BF,"da-DK":VF,"de-DE":HF,"el-GR":UF,"en-US":WF,"es-ES":GF,"et-EE":KF,"fi-FI":qF,"fr-FR":JF,"he-IL":YF,"hr-HR":XF,"hu-HU":ZF,"it-IT":QF,"ja-JP":$F,"ko-KR":eI,"lt-LT":tI,"lv-LV":nI,"nb-NO":rI,"nl-NL":iI,"pl-PL":aI,"pt-BR":oI,"pt-PT":sI,"ro-RO":cI,"ru-RU":lI,"sk-SK":uI,"sl-SI":dI,"sr-SP":fI,"sv-SE":pI,"tr-TR":mI,"uk-UA":hI,"zh-CN":gI,"zh-TW":_I};function yI(e){return e&&e.__esModule?e.default:e}function bI(e,t){let{getRowText:n=e=>t.collection.getTextValue?.(e)??t.collection.getItem(e)?.textValue}=e,r=rv(yI(vI),`@react-aria/grid`),i=t.selectionManager.rawSelection,a=(0,v.useRef)(i),o=(0,v.useCallback)(()=>{if(!t.selectionManager.isFocused||i===a.current){a.current=i;return}let e=xI(i,a.current),o=xI(a.current,i),s=t.selectionManager.selectionBehavior===`replace`,c=[];if(t.selectionManager.selectedKeys.size===1&&s){let e=t.selectionManager.selectedKeys.keys().next().value;if(e!=null&&t.collection.getItem(e)){let t=n(e);t&&c.push(r.format(`selectedItem`,{item:t}))}}else if(e.size===1&&o.size===0){let t=e.keys().next().value;if(t!=null){let e=n(t);e&&c.push(r.format(`selectedItem`,{item:e}))}}else if(o.size===1&&e.size===0){let e=o.keys().next().value;if(e!=null&&t.collection.getItem(e)){let t=n(e);t&&c.push(r.format(`deselectedItem`,{item:t}))}}t.selectionManager.selectionMode===`multiple`&&(c.length===0||i===`all`||i.size>1||a.current===`all`||a.current?.size>1)&&c.push(i===`all`?r.format(`selectedAll`):r.format(`selectedCount`,{count:i.size})),c.length>0&&Op(c.join(` `)),a.current=i},[i,t.selectionManager.selectedKeys,t.selectionManager.isFocused,t.selectionManager.selectionBehavior,t.selectionManager.selectionMode,t.collection,n,r]);zs(()=>{if(t.selectionManager.isFocused)o();else{let e=requestAnimationFrame(o);return()=>cancelAnimationFrame(e)}},[i,t.selectionManager.isFocused])}function xI(e,t){let n=new Set;if(e===`all`||t===`all`)return n;for(let r of e.keys())t.has(r)||n.add(r);return n}function SI(e){return e&&e.__esModule?e.default:e}function CI(e){let t=rv(SI(vI),`@react-aria/grid`),n=rm(),r=(n===`pointer`||n===`virtual`||n==null)&&typeof window<`u`&&`ontouchstart`in window;return tc((0,v.useMemo)(()=>{let n=e.selectionManager.selectionMode,i=e.selectionManager.selectionBehavior,a;return r&&(a=t.format(`longPressToSelect`)),i===`replace`&&n!==`none`&&e.hasItemActions?a:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,r]))}var wI=Object.assign(YP,{Root:YP,Separator:XP}),TI=(0,v.createContext)({}),EI=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,TI);let{toolbarProps:n}=ww(e,t),r=Mf({...e,values:{orientation:e.orientation||`horizontal`},defaultClassName:`react-aria-Toolbar`}),i=W(e,{global:!0});return delete i.id,v.createElement(q.div,{...U(i,r,n),ref:t,slot:e.slot||void 0,"data-orientation":e.orientation||`horizontal`},r.children)}),DI=({children:e,className:t,isAttached:n,orientation:r=`horizontal`,...i})=>{let a=v.useMemo(()=>Of({isAttached:n,orientation:r}),[n,r]);return(0,G.jsx)(Ow.Provider,{value:{orientation:r},children:(0,G.jsx)(ab.Provider,{value:{orientation:r===`horizontal`?`vertical`:`horizontal`},children:(0,G.jsx)(EI,{className:J(t,a),"data-slot":`toolbar`,orientation:r,...i,children:e})})})};DI.displayName=`HeroUI.Toolbar`;var OI=Object.assign(DI,{Root:DI}),kI=v.createContext(null);function AI(e){let{children:t}=e,n=(0,v.useContext)(kI),[r,i]=(0,v.useState)(0),a=(0,v.useMemo)(()=>({parent:n,modalCount:r,addModal(){i(e=>e+1),n&&n.addModal()},removeModal(){i(e=>e-1),n&&n.removeModal()}}),[n,r]);return v.createElement(kI.Provider,{value:a},t)}function jI(){let e=(0,v.useContext)(kI);return{modalProviderProps:{"aria-hidden":e&&e.modalCount>0?!0:void 0}}}function MI(e){let{modalProviderProps:t}=jI();return v.createElement(`div`,{"data-overlay-container":!0,...e,...t})}function NI(e){return v.createElement(AI,null,v.createElement(MI,e))}function PI(e){let t=Jo(),{portalContainer:n=t?null:document.body,...r}=e,{getContainer:i}=fv();if(!e.portalContainer&&i&&(n=i()),v.useEffect(()=>{if(n?.closest(`[data-overlay-container]`))throw Error(`An OverlayContainer must not be inside another container. Please change the portalContainer prop.`)},[n]),!n)return null;let a=v.createElement(NI,r);return dc.createPortal(a,n)}var FI=1500,II=500,LI={},RI=0,zI=!1,BI=null,VI=null;function HI(e={}){let{delay:t=FI,closeDelay:n=II}=e,{isOpen:r,open:i,close:a}=gv(e),[o,s]=(0,v.useState)(!1),c=(0,v.useMemo)(()=>`${++RI}`,[]),l=(0,v.useRef)(null),u=(0,v.useRef)(a),d=()=>{LI[c]=m},f=()=>{for(let e in LI)e!==c&&(LI[e](!0,!0),delete LI[e])},p=e=>{l.current&&clearTimeout(l.current),l.current=null,f(),d(),s(!!e),zI=!0,i(),BI&&=(clearTimeout(BI),null),VI&&=(clearTimeout(VI),null)},m=(e,t)=>{s(!!t),e||n<=0?(l.current&&clearTimeout(l.current),l.current=null,u.current()):l.current||=setTimeout(()=>{l.current=null,u.current()},n),BI&&=(clearTimeout(BI),null),zI&&(VI&&clearTimeout(VI),VI=setTimeout(()=>{delete LI[c],VI=null,zI=!1},Math.max(II,n)))},h=()=>{f(),d(),!r&&!zI?(BI&&clearTimeout(BI),BI=setTimeout(()=>{BI=null,zI=!0,p(!1)},t)):r||p(!0)};return(0,v.useEffect)(()=>{u.current=a},[a]),(0,v.useEffect)(()=>()=>{l.current&&clearTimeout(l.current),LI[c]&&delete LI[c]},[c]),{isOpen:r,shouldSkipAnimation:o,open:e=>{!e&&t>0&&!l.current?h():p(zI)},close:m}}function UI(e,t){let n=W(e,{labelable:!0}),{hoverProps:r}=eh({onHoverStart:()=>t?.open(!0),onHoverEnd:()=>t?.close()});return{tooltipProps:U(n,r,{role:`tooltip`})}}function WI(e,t,n){let{isDisabled:r,trigger:i,shouldCloseOnPress:a=!0}=e,o=es(),s=(0,v.useRef)(!1),c=(0,v.useRef)(!1),l=()=>{(s.current||c.current)&&t.open(c.current)},u=e=>{!s.current&&!c.current&&t.close(e)};(0,v.useEffect)(()=>{let e=e=>{n&&n.current&&e.key===`Escape`&&(e.stopPropagation(),t.close(!0))};if(t.isOpen)return document.addEventListener(`keydown`,e,!0),()=>{document.removeEventListener(`keydown`,e,!0)}},[n,t]);let d=()=>{i!==`focus`&&(em()===`pointer`?s.current=!0:s.current=!1,l())},f=()=>{i!==`focus`&&(c.current=!1,s.current=!1,u())},p=()=>{a&&(c.current=!1,s.current=!1,u(!0))},m=()=>{$p()&&(c.current=!0,l())},h=()=>{c.current=!1,s.current=!1,u(!0)},{hoverProps:g}=eh({isDisabled:r,onHoverStart:d,onHoverEnd:f}),{focusableProps:_}=Em({isDisabled:r,onFocus:m,onBlur:h},n);return{triggerProps:{"aria-describedby":t.isOpen?o:void 0,...U(_,g,{onPointerDown:p,onKeyDown:p}),tabIndex:void 0},tooltipProps:{id:o}}}var GI=(0,v.createContext)(null),KI=(0,v.createContext)(null);function qI(e){let t=HI(e),n=(0,v.useRef)(null),{triggerProps:r,tooltipProps:i}=WI(e,t,n);return v.createElement(jf,{values:[[GI,t],[KI,{...i,triggerRef:n}]]},v.createElement(Tm,{...r,ref:n},e.children))}var JI=(0,v.forwardRef)(function({UNSTABLE_portalContainer:e,...t},n){[t,n]=Ff(t,n,KI);let r=(0,v.useContext)(GI),i=HI(t),a=t.isOpen!=null||t.defaultOpen!=null||!r?i:r,o=pc(n,a.isOpen),s=t.isExiting||!a.shouldSkipAnimation&&o||!1;return!a.isOpen&&!s?null:v.createElement(PI,{portalContainer:e},v.createElement(YI,{...t,tooltipRef:n,isExiting:s}))});function YI(e){let t=(0,v.useContext)(GI),n=(0,v.useRef)(null),{overlayProps:r,arrowProps:i,placement:a,triggerAnchorPoint:o}=gg({placement:e.placement||`top`,targetRef:e.triggerRef,overlayRef:e.tooltipRef,arrowRef:n,offset:e.offset,crossOffset:e.crossOffset,isOpen:t.isOpen,arrowBoundaryOffset:e.arrowBoundaryOffset,shouldFlip:e.shouldFlip,containerPadding:e.containerPadding,onClose:()=>t.close(!0)}),s=fc(e.tooltipRef,!!a),c=e.isEntering||!t.shouldSkipAnimation&&s||!1,l=Mf({...e,defaultClassName:`react-aria-Tooltip`,values:{placement:a,isEntering:c,isExiting:e.isExiting,state:t}});e=U(e,r);let{tooltipProps:u}=UI(e,t),d=W(e,{global:!0});return v.createElement(q.div,{...U(d,l,u),ref:e.tooltipRef,style:{...r.style,"--trigger-anchor-point":o?`${o.x}px ${o.y}px`:void 0,...l.style},"data-placement":a??void 0,"data-entering":c||void 0,"data-exiting":e.isExiting||void 0},v.createElement(Lh.Provider,{value:{...i,placement:a,ref:n}},l.children))}var XI=e=>{if(!e)return;let t=e.trim(),n=parseFloat(t);if(!Number.isNaN(n))return t.endsWith(`ms`)?n:t.endsWith(`s`)?n*1e3:n},ZI=(0,v.createContext)({}),QI=({children:e,shouldSkipAnimation:t})=>{let n=(0,v.use)(GI);return!n||t?e:(0,G.jsx)(GI,{value:{...n,shouldSkipAnimation:!1},children:e})},$I=({children:e,closeDelay:t,delay:n,shouldSkipAnimation:r=!1,...i})=>{let a=v.useMemo(()=>kf(),[]),o=GP(`--tooltip-delay`),s=GP(`--tooltip-close-delay`),c=n??XI(o),l=t??XI(s);return(0,G.jsx)(ZI,{value:{slots:a},children:(0,G.jsx)(qI,{closeDelay:l,"data-slot":`tooltip-root`,delay:c,...i,children:(0,G.jsx)(QI,{shouldSkipAnimation:r,children:e})})})},eL=Object.assign($I,{Root:$I,Trigger:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(ZI),i=(0,v.useRef)(null),{focusableProps:a}=Em({},i);return(0,G.jsx)(K.div,{ref:i,className:Y(r?.trigger,t),"data-slot":`tooltip-trigger`,role:`button`,...U(a,n),children:e})},Content:({children:e,className:t,offset:n,showArrow:r=!1,...i})=>{let{slots:a}=(0,v.use)(ZI),o=n||(r?7:3);return(0,G.jsx)(JI,{...i,className:J(t,a?.base()),offset:o,children:e})},Arrow:({children:e,className:t,...n})=>{let r=(0,G.jsx)(`svg`,{"data-slot":`overlay-arrow`,fill:`none`,height:`12`,viewBox:`0 0 12 12`,width:`12`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M0 0C5.48483 8 6.5 8 12 0Z`})}),i=v.isValidElement(e)?v.cloneElement(e,{"data-slot":`overlay-arrow`}):r;return(0,G.jsx)(Rh,{"data-slot":`tooltip-arrow`,...n,className:t,children:i})}}),tL=(0,v.createContext)({}),nL=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i},rL=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,tL);let{hoverProps:n,isHovered:r}=eh(e),{isFocused:i,isFocusVisible:a,focusProps:o}=Jm({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,c=Mf({...e,values:{isHovered:r,isFocused:i,isFocusVisible:a,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:`react-aria-TextArea`});return v.createElement(q.textarea,{...U(nL(e),o,n),...c,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":a||void 0,"data-invalid":s||void 0})}),iL=(0,v.createContext)(null),aL=Hf(function(e,t){[e,t]=Ff(e,t,iL);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,i=(0,v.useRef)(null);[e,i]=Ff(e,i,Yy);let[a,o]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),[s,c]=(0,v.useState)(`input`),{labelProps:l,inputProps:u,descriptionProps:d,errorMessageProps:f,...p}=mT({...Lf(e),inputElementType:s,label:o,validationBehavior:r},i),m=(0,v.useCallback)(e=>{i.current=e,e&&c(e instanceof HTMLTextAreaElement?`textarea`:`input`)},[i]),h=Mf({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:p.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TextField`}),g=W(e,{global:!0});return delete g.id,v.createElement(q.div,{...g,...h,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":p.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},v.createElement(jf,{values:[[Wf,{...l,ref:a}],[dT,{...u,ref:m}],[tL,{...u,ref:m}],[ES,{role:`presentation`,isInvalid:p.isInvalid,isDisabled:e.isDisabled||!1}],[sb,{slots:{description:d,errorMessage:f}}],[OS,p]]},h.children))}),oL=(0,v.createContext)({}),sL=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=v.useMemo(()=>Cf({fullWidth:n}),[n]);return(0,G.jsx)(aL,{"data-slot":`textfield`,...i,className:J(t,a),children:t=>(0,G.jsx)(oL,{value:{variant:r},children:(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})},cL=({className:e,fullWidth:t,variant:n,...r})=>{let i=(0,v.use)(oL),a=(0,v.use)(ZE),o=n??i.variant??a.variant;return(0,G.jsx)(pT,{className:J(e,nf({fullWidth:t,variant:o})),"data-slot":`input`,...r})},lL=Object.assign(cL,{Root:cL}),uL=(0,v.createContext)({}),dL=({children:e,className:t,fullWidth:n,onClick:r,variant:i,...a})=>{let o=(0,v.use)(oL),s=i??o?.variant,c=v.useRef(null),l=v.useMemo(()=>rf({fullWidth:n,variant:s}),[n,s]),u=e=>{let t=e.target,n=c.current?.querySelector(`input`);n&&t!==n&&!n.contains(t)&&n.focus(),r?.(e)};return(0,G.jsx)(uL,{value:{slots:l},children:(0,G.jsx)(DS,{...a,ref:c,className:J(t,l?.base()),"data-slot":`input-group`,onClick:u,children:t=>typeof e==`function`?e(t):e})})},fL=Object.assign(dL,{Root:dL,Input:({className:e,...t})=>{let{slots:n}=(0,v.use)(uL);return(0,G.jsx)(pT,{className:J(e,n?.input()),"data-slot":`input-group-input`,...t})},TextArea:({className:e,...t})=>{let{slots:n}=(0,v.use)(uL);return(0,G.jsx)(rL,{className:J(e,n?.input()),"data-slot":`input-group-textarea`,...t})},Prefix:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(uL);return(0,G.jsx)(`div`,{className:Y(r?.prefix,t),"data-slot":`input-group-prefix`,...n,children:e})},Suffix:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(uL);return(0,G.jsx)(`div`,{className:Y(r?.suffix,t),"data-slot":`input-group-suffix`,...n,children:e})}}),pL=({className:e,fullWidth:t,variant:n,...r})=>{let i=(0,v.use)(oL),a=n??i?.variant;return(0,G.jsx)(rL,{"data-slot":`textarea`,className:J(e,wf({fullWidth:t,variant:a})),...r})},mL=Object.assign(pL,{Root:pL}),hL=Object.assign(sL,{Root:sL}),gL={};gL={"Clear search":`مسح البحث`};var _L={};_L={"Clear search":`Изчистване на търсене`};var vL={};vL={"Clear search":`Vymazat hledání`};var yL={};yL={"Clear search":`Ryd søgning`};var bL={};bL={"Clear search":`Suche zurücksetzen`};var xL={};xL={"Clear search":`Απαλοιφή αναζήτησης`};var SL={};SL={"Clear search":`Clear search`};var CL={};CL={"Clear search":`Borrar búsqueda`};var wL={};wL={"Clear search":`Tühjenda otsing`};var TL={};TL={"Clear search":`Tyhjennä haku`};var EL={};EL={"Clear search":`Effacer la recherche`};var DL={};DL={"Clear search":`נקה חיפוש`};var OL={};OL={"Clear search":`Obriši pretragu`};var kL={};kL={"Clear search":`Keresés törlése`};var AL={};AL={"Clear search":`Cancella ricerca`};var jL={};jL={"Clear search":`検索をクリア`};var ML={};ML={"Clear search":`검색 지우기`};var NL={};NL={"Clear search":`Išvalyti iešką`};var PL={};PL={"Clear search":`Notīrīt meklēšanu`};var FL={};FL={"Clear search":`Tøm søk`};var IL={};IL={"Clear search":`Zoekactie wissen`};var LL={};LL={"Clear search":`Wyczyść zawartość wyszukiwania`};var RL={};RL={"Clear search":`Limpar pesquisa`};var zL={};zL={"Clear search":`Limpar pesquisa`};var BL={};BL={"Clear search":`Ştergeţi căutarea`};var VL={};VL={"Clear search":`Очистить поиск`};var HL={};HL={"Clear search":`Vymazať vyhľadávanie`};var UL={};UL={"Clear search":`Počisti iskanje`};var WL={};WL={"Clear search":`Obriši pretragu`};var GL={};GL={"Clear search":`Rensa sökning`};var KL={};KL={"Clear search":`Aramayı temizle`};var qL={};qL={"Clear search":`Очистити пошук`};var JL={};JL={"Clear search":`清除搜索`};var YL={};YL={"Clear search":`清除搜尋條件`};var XL={};XL={"ar-AE":gL,"bg-BG":_L,"cs-CZ":vL,"da-DK":yL,"de-DE":bL,"el-GR":xL,"en-US":SL,"es-ES":CL,"et-EE":wL,"fi-FI":TL,"fr-FR":EL,"he-IL":DL,"hr-HR":OL,"hu-HU":kL,"it-IT":AL,"ja-JP":jL,"ko-KR":ML,"lt-LT":NL,"lv-LV":PL,"nb-NO":FL,"nl-NL":IL,"pl-PL":LL,"pt-BR":RL,"pt-PT":zL,"ro-RO":BL,"ru-RU":VL,"sk-SK":HL,"sl-SI":UL,"sr-SP":WL,"sv-SE":GL,"tr-TR":KL,"uk-UA":qL,"zh-CN":JL,"zh-TW":YL};function ZL(e){return e&&e.__esModule?e.default:e}function QL(e,t,n){let r=rv(ZL(XL),`@react-aria/searchfield`),{isDisabled:i,isReadOnly:a,onSubmit:o,onClear:s,type:c=`search`}=e,{keyboardProps:l}=Sm({isDisabled:i||a,shortcuts:{Enter:()=>{if(o){o(t.value);return}return!1},Escape:()=>{if(t.value===``&&(!n.current||n.current.value===``))return!1;t.setValue(``),s?.()}}}),u=()=>{t.setValue(``),s&&s()},d=()=>{n.current?.focus()},{labelProps:f,inputProps:p,descriptionProps:m,errorMessageProps:h,...g}=mT({...e,value:t.value,onChange:t.setValue,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,type:c},n);return{labelProps:f,inputProps:U(l,{...p,defaultValue:void 0}),clearButtonProps:{"aria-label":r.format(`Clear search`),excludeFromTabOrder:!0,preventFocusOnPress:!0,isDisabled:i||a,onPress:u,onPressStart:d},descriptionProps:m,errorMessageProps:h,...g}}function $L(e){let[t,n]=sh(eR(e.value),eR(e.defaultValue)||``,e.onChange);return{value:t,setValue:n}}function eR(e){if(e!=null)return e.toString()}var tR=(0,v.createContext)(null),nR=Hf(function(e,t){[e,t]=Ff(e,t,tR);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,i=(0,v.useRef)(null);[e,i]=Ff(e,i,Yy);let[a,o]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),s=$L({...e,validationBehavior:r}),{labelProps:c,inputProps:l,clearButtonProps:u,descriptionProps:d,errorMessageProps:f,...p}=QL({...Lf(e),label:o,validationBehavior:r},s,i),m=Mf({...e,values:{isEmpty:s.value===``,isDisabled:e.isDisabled||!1,isInvalid:p.isInvalid||!1,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1,state:s},defaultClassName:`react-aria-SearchField`}),h=W(e,{global:!0});return delete h.id,v.createElement(q.div,{...h,...m,ref:t,slot:e.slot||void 0,"data-empty":s.value===``||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":p.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},v.createElement(jf,{values:[[Wf,{...c,ref:a}],[dT,{...l,ref:i}],[th,u],[sb,{slots:{description:d,errorMessage:f}}],[ES,{isInvalid:p.isInvalid,isDisabled:e.isDisabled||!1}],[OS,p]]},m.children))}),rR=(0,v.createContext)({}),iR=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=v.useMemo(()=>gf({fullWidth:n,variant:r}),[n,r]);return(0,G.jsx)(rR,{value:{slots:a},children:(0,G.jsx)(nR,{"data-slot":`search-field`,...i,className:J(t,a?.base()),children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})},aR=Object.assign(iR,{Root:iR,Group:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rR);return(0,G.jsx)(DS,{className:J(t,r?.group()),"data-slot":`search-field-group`,...n,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})},Input:({className:e,...t})=>{let{slots:n}=(0,v.use)(rR);return(0,G.jsx)(pT,{className:J(e,n?.input()),"data-slot":`search-field-input`,...t})},SearchIcon:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rR);return e&&v.isValidElement(e)?v.cloneElement(e,{...n,className:Y(r?.searchIcon,t),"data-slot":`search-field-search-icon`}):(0,G.jsx)(jh,{className:Y(r?.searchIcon,t),"data-slot":`search-field-search-icon`,...n})},ClearButton:({className:e,...t})=>{let{slots:n}=(0,v.use)(rR);return(0,G.jsx)(xS,{className:J(e,n?.clearButton()),"data-slot":`search-field-clear-button`,slot:`clear`,...t})}}),oR=({children:e,className:t,isDisabled:n,isInvalid:r,isRequired:i,...a})=>(0,G.jsx)(Gf,{className:af({isRequired:i,isDisabled:n,isInvalid:r,className:t}),"data-slot":`label`,...a,children:e}),sR=Object.assign(oR,{Root:oR}),cR=({children:e,className:t,...n})=>_w(`description`)?(0,G.jsx)(cb,{className:Qd({className:t}),"data-slot":`description`,slot:`description`,...n,children:e}):null,lR=Object.assign(cR,{Root:cR}),uR=({children:e,className:t,...n})=>(0,G.jsx)(K.div,{className:tf({className:t}),"data-slot":`empty-state`,...n,children:e||`No results found`}),dR=Object.assign(uR,{Root:uR});function fR(e){return e&&e.__esModule?e.default:e}function pR(e,t){let{key:n}=e,r=t.selectionManager,i=es(),a=!t.selectionManager.canSelectItem(n),o=t.selectionManager.isSelected(n);return{checkboxProps:{id:i,"aria-label":rv(fR(vI),`@react-aria/grid`).format(`select`),isSelected:o,isDisabled:a,onChange:()=>r.toggleSelection(n)}}}for(var mR=(0,v.createContext)(null),hR=(0,v.createContext)(null),gR=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,mR);let{validationBehavior:n}=Pf(VS)||{},r=e.validationBehavior??n??`native`,{locale:i}=rp(),a=VE({...e,locale:i,validationBehavior:r}),o=(0,v.useRef)(null),[s,c]=If(!e[`aria-label`]&&!e[`aria-labelledby`]),{labelProps:l,groupProps:u,inputProps:d,incrementButtonProps:f,decrementButtonProps:p,descriptionProps:m,errorMessageProps:h,...g}=RE({...Lf(e),label:c,validationBehavior:r},a,o),_=Mf({...e,values:{state:a,isDisabled:e.isDisabled||!1,isInvalid:g.isInvalid||!1,isRequired:e.isRequired||!1,isReadOnly:e.isReadOnly||!1},defaultClassName:`react-aria-NumberField`}),y=W(e,{global:!0});return delete y.id,v.createElement(jf,{values:[[hR,a],[ES,u],[dT,{...d,ref:o}],[Wf,{...l,ref:s}],[th,{slots:{increment:f,decrement:p}}],[sb,{slots:{description:m,errorMessage:h}}],[OS,g]]},v.createElement(q.div,{...y,..._,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-invalid":g.isInvalid||void 0}),e.name&&v.createElement(`input`,{type:`hidden`,name:e.name,form:e.form,value:isNaN(a.numberValue)?``:a.numberValue,disabled:e.isDisabled||void 0}))}),_R=10,vR=5,yR=class{setup(e,t,n){this.delegate=e,this.state=t,this.direction=n}getDropTargetFromPoint(e,t,n){let r=this.delegate.getDropTargetFromPoint(e,t,n);return!r||r.type===`root`?r:this.resolveDropTarget(r,e,t,n)}resolveDropTarget(e,t,n,r){let i=this.pointerTracking,a=n-i.lastY,o=t-i.lastX,s=i.yDirection,c=i.xDirection;if(Math.abs(a)>vR&&(s=a>0?`down`:`up`,i.yDirection=s,i.lastY=n),Math.abs(o)>_R&&(c=o>0?`right`:`left`,i.xDirection=c,i.lastX=t),e.dropPosition===`before`){let t=this.state.collection.getKeyBefore(e.key);for(;t!=null;){let e=this.state.collection.getItem(t);if(e?.type===`item`)break;t=e?.parentKey??null}if(t!=null){let n={type:`item`,key:t,dropPosition:`after`};r(n)&&(e=n)}}let l=this.getPotentialTargets(e,r);if(l.length===0)return{type:`root`};let u;return l.length>1?u=this.selectTarget(l,e,t,n,s,c):(u=l[0],i.boundaryContext=null),u}getPotentialTargets(e,t){if(e.dropPosition===`on`)return[e];let n=e,r=this.state.collection,i=r.getItem(n.key);for(;i&&i?.type!==`item`&&i.nextKey!=null;)n.key=i.nextKey,i=r.getItem(i.nextKey);let a=[n];if(i&&i.hasChildNodes&&this.state.expandedKeys.has(i.key)&&r.getChildren&&n.dropPosition===`after`){let e=i.firstChildKey==null?null:r.getItem(i.firstChildKey);for(;e&&e.type!==`item`;)e=e.nextKey==null?null:r.getItem(e.nextKey);if(e?.type===`item`){let n={type:`item`,key:e.key,dropPosition:`before`};return t(n)?[n]:[]}}if(i?.nextKey!=null)return[e];let o=i?.parentKey,s=[];for(;o!=null;){let e=r.getItem(o),n=e?.nextKey==null?null:r.getItem(e.nextKey);if(!n||n.parentKey!==o){let e={type:`item`,key:o,dropPosition:`after`};if(t(e)&&s.push(e),n)break}o=e?.parentKey}if(s.length>0&&a.push(...s),a.length===1){let e=r.getKeyAfter(n.key),a=e==null?null:r.getItem(e);if(e!=null&&a&&i&&a.level!=null&&i.level!=null&&a.level>i.level){let n={type:`item`,key:e,dropPosition:`before`};if(t(n))return[n]}}return a.filter(t)}selectTarget(e,t,n,r,i,a){if(e.length<2)return e[0];let o=this.pointerTracking,s=this.state.collection.getItem(t.key)?.parentKey;if(s==null)return e[0];(!o.boundaryContext||o.boundaryContext.parentKey!==s)&&(o.boundaryContext={parentKey:s,preferredTargetIndex:o.yDirection===`up`?e.length-1:0,lastSwitchY:r,lastSwitchX:n});let c=o.boundaryContext,l=Math.abs(n-c.lastSwitchX);if(Math.abs(r-c.lastSwitchY)>vR&&i){let t=c.preferredTargetIndex||0;i===`down`&&t===0?c.preferredTargetIndex=e.length-1:i===`up`&&t===e.length-1&&(c.preferredTargetIndex=0),o.xDirection=null}if(l>_R&&a){let t=c.preferredTargetIndex||0;a===`left`?this.direction===`ltr`?t0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):a===`right`&&(this.direction===`ltr`?t>0&&(c.preferredTargetIndex=t-1,c.lastSwitchX=n):t{let i=this.keyMap.get(r.key);e.visitNode&&(r=e.visitNode(r)),this.keyMap.set(r.key,r);let a=new Set,o=null,s=!1;if(r.type===`item`){for(let e of r.childNodes)if(e.props?.colSpan!==void 0){s=!0;break}}for(let e of r.childNodes)e.type===`cell`&&s&&(e.colspan=e.props?.colSpan,e.colSpan=e.props?.colSpan,e.colIndex=o?(o.colIndex??o.index)+(o.colSpan??1):e.index),e.type===`cell`&&e.parentKey==null&&(e.parentKey=r.key),a.add(e.key),o?(o.nextKey=e.key,e.prevKey=o.key):e.prevKey=null,t(e),o=e;if(o&&(o.nextKey=null),i)for(let e of i.childNodes)a.has(e.key)||n(e)},n=e=>{this.keyMap.delete(e.key);for(let t of e.childNodes)this.keyMap.get(t.key)===t&&n(t)},r=null;for(let[n,i]of e.items.entries()){let e={...i,level:i.level??0,key:i.key??`row-`+n,type:i.type??`row`,value:i.value??null,hasChildNodes:!0,childNodes:[...i.childNodes],rendered:i.rendered,textValue:i.textValue??``,index:i.index??n};r?(r.nextKey=e.key,e.prevKey=r.key):e.prevKey=null,this.rows.push(e),t(e),r=e}r&&(r.nextKey=null)}*[Symbol.iterator](){yield*[...this.rows]}get size(){return[...this.rows].length}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let t=this.keyMap.get(e);return t?t.prevKey??null:null}getKeyAfter(e){let t=this.keyMap.get(e);return t?t.nextKey??null:null}getFirstKey(){return[...this.rows][0]?.key}getLastKey(){let e=[...this.rows];return e[e.length-1]?.key}getItem(e){return this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}getChildren(e){return this.keyMap.get(e)?.childNodes||[]}},xR=`row-header-column-`+Math.random().toString(36).slice(2),SR=`row-header-column-`+Math.random().toString(36).slice(2);xR===SR;)SR=`row-header-column-`+Math.random().toString(36).slice(2);function CR(e,t){if(t.length===0)return[];let n=[],r=new Map;for(let i of t){let t=i.parentKey,a=[i];for(;t!=null;){let n=e.get(t);if(!n)break;if(r.has(n)){n.colSpan??=0,n.colSpan++,n.colspan=n.colSpan;let{column:e,index:t}=r.get(n);if(t>a.length)break;for(let n=t;ne.length)),a=Array(i).fill(0).map(()=>[]),o=0;for(let e of n){let t=i-1;for(let n of e){if(n){let e=a[t],r=e.reduce((e,t)=>e+(t.colSpan??1),0);if(r0&&(e[e.length-1].nextKey=i.key,i.prevKey=e[e.length-1].key),e.push(i)}e.length>0&&(e[e.length-1].nextKey=n.key,n.prevKey=e[e.length-1].key),n.level=t,n.colIndex=o,e.push(n)}t--}o++}let s=0;for(let e of a){let n=e.reduce((e,t)=>e+(t.colSpan??1),0);if(n({type:`headerrow`,key:`headerrow-`+t,index:t,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:e,textValue:``}))}var wR=class extends bR{constructor(e,t,n){let r=new Set,i=null,a=[];if(n?.showSelectionCheckboxes){let e={type:`column`,key:xR,value:null,textValue:``,level:0,index:+!!n?.showDragButtons,hasChildNodes:!1,rendered:null,childNodes:[],props:{isSelectionCell:!0}};a.unshift(e)}if(n?.showDragButtons){let e={type:`column`,key:SR,value:null,textValue:``,level:0,index:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isDragButtonCell:!0}};a.unshift(e)}let o=[],s=new Map,c=e=>{switch(e.type){case`body`:i=e;break;case`column`:s.set(e.key,e),e.hasChildNodes||(a.push(e),e.props.isRowHeader&&r.add(e.key));break;case`item`:o.push(e);return}for(let t of e.childNodes)c(t)};for(let t of e)c(t);let l=CR(s,a);if(l.forEach((e,t)=>o.splice(t,0,e)),super({columnCount:a.length,items:o,visitNode:e=>(e.column=a[e.index],e)}),this._size=0,this.columns=a,this.rowHeaderColumnKeys=r,this.body=i,this.headerRows=l,this._size=[...i.childNodes].length,this.rowHeaderColumnKeys.size===0){let e=this.columns.find(e=>!e.props?.isDragButtonCell&&!e.props?.isSelectionCell);e&&this.rowHeaderColumnKeys.add(e.key)}}*[Symbol.iterator](){yield*this.body.childNodes}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey??null}getKeyAfter(e){return this.keyMap.get(e)?.nextKey??null}getFirstKey(){return gx(this.body.childNodes)?.key??null}getLastKey(){return vx(this.body.childNodes)?.key??null}getItem(e){return e===this.body.key?this.body:this.keyMap.get(e)??null}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}getChildren(e){if(e===this.body.key)return this.body.childNodes;let t=this.getItem(e);return t?.type===`item`?[...t.childNodes].filter(e=>e.type===`cell`):super.getChildren(e)}getTextValue(e){let t=this.getItem(e);if(!t)return``;if(t.textValue)return t.textValue;let n=this.rowHeaderColumnKeys;if(n){let e=[];for(let r of t.childNodes){let t=this.columns[r.index];if(n.has(t.key)&&r.textValue&&e.push(r.textValue),e.length===n.size)break}return e.join(` `)}return``}};function TR(e){return e!=null&&(!isNaN(e)||String(e).match(/^(\d+)(?=%$)/)!==null)}function ER(e){if(!e||typeof e==`number`)return 1;let t=e.match(/^(.+)(?=fr$)/);return t?parseFloat(t[0]):1}function DR(e,t){if(typeof e==`string`){let n=e.match(/^(\d+)(?=%$)/);if(!n)throw Error(`Only percentages or numbers are supported for static column widths`);return t*(parseFloat(n[0])/100)}return e}function OR(e,t){return e==null?2**53-1:DR(e,t)}function kR(e,t){return e==null?0:DR(e,t)}function AR(e,t,n,r,i){let a=e,o=Math.floor(e),s=e-o>0;e=o;let c=!1,l=t.map((t,a)=>{let o=n.get(t.key)==null?t.width??t.defaultWidth??r?.(a)??`1fr`:n.get(t.key)??`1fr`,s=!1,l=0,u=0,d=0;TR(o)?(l=DR(o,e),s=!0):(u=ER(o),u<=0&&(s=!0));let f=kR(t.minWidth??i?.(a)??0,e),p=OR(t.maxWidth,e),m=Math.max(f,Math.min(l,p));return s?d=m:l>m&&(s=!0,d=m),s||(c=!0),{frozen:s,baseSize:l,hypotheticalMainSize:m,min:f,max:p,flex:u,targetMainSize:d,violation:0}});for(;c;){let t=0,n=0;l.forEach(e=>{e.frozen?t+=e.targetMainSize:(t+=e.baseSize,n+=e.flex)});let r=e-t;r>0&&l.forEach(e=>{if(!e.frozen){let t=e.flex/n;e.targetMainSize=e.baseSize+t*r}});let i=0;l.forEach(e=>{if(e.violation=0,!e.frozen){let{min:t,max:n,targetMainSize:r}=e;e.targetMainSize=Math.max(t,Math.min(r,n)),e.violation=e.targetMainSize-r,i+=e.violation}}),c=!1,l.forEach(e=>{i===0||Math.sign(i)===Math.sign(e.violation)?e.frozen=!0:e.frozen||(c=!0)})}let u=jR(l);if(s&&u.length>0){let e=a.toString().split(`.`)[1],t=u[u.length-1].toString();u[u.length-1]=Number(t+`.`+e)}return u}function jR(e){let t=0,n=0,r=[];return e.forEach(function(e){let i=e.targetMainSize,a=Math.round(i+t)-n;t+=i,n+=a,r.push(a)}),r}var MR=class{constructor(e){this.columnWidths=new Map,this.columnMinWidths=new Map,this.columnMaxWidths=new Map,this.getDefaultWidth=e?.getDefaultWidth??(()=>`1fr`),this.getDefaultMinWidth=e?.getDefaultMinWidth??(()=>75)}splitColumnsIntoControlledAndUncontrolled(e){return e.reduce((e,t)=>(t.props.width==null?e[1].set(t.key,t):e[0].set(t.key,t),e),[new Map,new Map])}recombineColumns(e,t,n,r){return new Map(e.map(e=>n.has(e.key)?[e.key,t.get(e.key)]:[e.key,r.get(e.key).props.width]))}getInitialUncontrolledWidths(e){return new Map(Array.from(e).map(([e,t])=>[e,t.props.defaultWidth??this.getDefaultWidth?.(t)??`1fr`]))}getColumnWidth(e){return this.columnWidths.get(e)??0}getColumnMinWidth(e){return this.columnMinWidths.get(e)??0}getColumnMaxWidth(e){return this.columnMaxWidths.get(e)??0}resizeColumnWidth(e,t,n,r){let i=this.columnWidths,a=!0,o=new Map;return r=Math.max(this.getColumnMinWidth(n),Math.min(this.getColumnMaxWidth(n),Math.floor(r))),e.columns.forEach(e=>{e.key===n?(o.set(e.key,r),a=!1):a?o.set(e.key,i.get(e.key)??0):o.set(e.key,e.props.width??t.get(e.key))}),o}buildColumnWidths(e,t,n){return this.columnWidths=new Map,this.columnMinWidths=new Map,this.columnMaxWidths=new Map,AR(e,t.columns.map(e=>({...e.props,key:e.key})),n,e=>this.getDefaultWidth(t.columns[e]),e=>this.getDefaultMinWidth(t.columns[e])).forEach((n,r)=>{let i=t.columns[r].key,a=t.columns[r];this.columnWidths.set(i,n),this.columnMinWidths.set(i,kR(a.props.minWidth??this.getDefaultMinWidth(a),e)),this.columnMaxWidths.set(i,OR(a.props.maxWidth,e))}),this.columnWidths}};function NR(e,t){let{getDefaultWidth:n,getDefaultMinWidth:r,tableWidth:i=0}=e,[a,o]=(0,v.useState)(null),s=(0,v.useMemo)(()=>new MR({getDefaultWidth:n,getDefaultMinWidth:r}),[n,r]),[c,l]=(0,v.useMemo)(()=>s.splitColumnsIntoControlledAndUncontrolled(t.collection.columns),[t.collection.columns,s]),[u,d]=(0,v.useState)(()=>s.getInitialUncontrolledWidths(l)),[f,p]=(0,v.useState)(t.collection.columns);t.collection.columns!==f&&((t.collection.columns.length!==f.length||t.collection.columns.some((e,t)=>e.key!==f[t].key))&&d(s.getInitialUncontrolledWidths(l)),p(t.collection.columns));let m=(0,v.useMemo)(()=>s.recombineColumns(t.collection.columns,u,l,c),[t.collection.columns,u,l,c,s]),h=(0,v.useCallback)(e=>{o(e)},[o]),g=(0,v.useCallback)((e,n)=>{let r=s.resizeColumnWidth(t.collection,u,e,n),i=new Map(Array.from(l).map(([e])=>[e,r.get(e)]));return i.set(e,n),d(i),r},[l,d,s,t.collection,u]),_=(0,v.useCallback)(()=>{o(null)},[o]),y=(0,v.useMemo)(()=>s.buildColumnWidths(i,t.collection,m),[i,t.collection,m,s]);return(0,v.useMemo)(()=>({resizingColumn:a,updateResizedColumns:g,startResize:h,endResize:_,getColumnWidth:e=>s.getColumnWidth(e),getColumnMinWidth:e=>s.getColumnMinWidth(e),getColumnMaxWidth:e=>s.getColumnMaxWidth(e),tableState:t,columnWidths:y}),[s,y,a,g,h,_,t])}function PR(e){let{collection:t,focusMode:n}=e,r=e.UNSAFE_selectionState||Hx(e),i=(0,v.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),a=r.setFocusedKey;r.setFocusedKey=(e,r)=>{if(n===`cell`&&e!=null){let n=t.getItem(e);if(n?.type===`item`){let i=hx(n,t);e=r===`last`?vx(i)?.key??null:gx(i)?.key??null}}a(e,r)};let o=(0,v.useMemo)(()=>new Px(t,r),[t,r]),s=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(r.focusedKey!=null&&s.current&&!t.getItem(r.focusedKey)){let e=s.current.getItem(r.focusedKey),n=e?.parentKey!=null&&(e.type===`cell`||e.type===`rowheader`||e.type===`column`)?s.current.getItem(e.parentKey):e;if(!n){r.setFocusedKey(null);return}let i=s.current.rows,a=t.rows,c=i.length-a.length,l=Math.min(c>1?Math.max(n.index-c+1,0):n.index,a.length-1),u=null;for(let e=Math.max(0,l);e=0;e--)if(!o.isDisabled(a[e].key)&&a[e].type!==`headerrow`){u=a[e];break}}if(u){let i=u.hasChildNodes?[...hx(u,t)]:[],a=u.hasChildNodes&&n!==e&&e&&e.index({showSelectionCheckboxes:i&&r!==`none`,showDragButtons:a,selectionMode:r,columns:[]}),[e.children,i,r,a]),c=Bx(e,(0,v.useCallback)(e=>new wR(e,null,s),[s]),s),{disabledKeys:l,selectionManager:u}=PR({...e,collection:c,disabledBehavior:e.disabledBehavior||`selection`}),[d,f]=sh(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,e.onExpandedChange);return{collection:c,disabledKeys:l,selectionManager:u,showSelectionCheckboxes:e.showSelectionCheckboxes||!1,sortDescriptor:e.sortDescriptor??null,isKeyboardNavigationDisabled:c.size===0||t,setKeyboardNavigationDisabled:n,sort(t,n){e.onSortChange?.({column:t,direction:n??(e.sortDescriptor?.column===t?FR[e.sortDescriptor.direction]:`ascending`)})},expandedKeys:d,toggleKey(e){f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},treeColumn:o}}function LR(e,t){let n=(0,v.useMemo)(()=>t?e.collection.filter(t):e.collection,[e.collection,t]),r=e.selectionManager.withCollection(n);return{...e,collection:n,selectionManager:r}}var RR=class{constructor(e){if(this.collection=e.collection,this.disabledKeys=e.disabledKeys,this.disabledBehavior=e.disabledBehavior||`all`,this.direction=e.direction,this.collator=e.collator,!e.layout&&!e.ref)throw Error(`Either a layout or a ref must be specified.`);this.layoutDelegate=e.layoutDelegate||(e.layout?new zR(e.layout):new ox(e.ref)),this.focusMode=e.focusMode??`row`}isCell(e){return e.type===`cell`}isRow(e){return e.type===`row`||e.type===`item`}isDisabled(e){return this.disabledBehavior===`all`&&(e.props?.isDisabled||this.disabledKeys.has(e.key))&&e.props?.disabledBehavior!==`selection`}findPreviousKey(e,t,n=!1){let r=e==null?this.collection.getLastKey():this.collection.getKeyBefore(e);for(;r!=null;){let e=this.collection.getItem(r);if(!e)return null;if((n||!this.isDisabled(e))&&(!t||t(e)))return r;r=this.collection.getKeyBefore(r)}return null}findNextKey(e,t,n=!1){let r=e==null?this.collection.getFirstKey():this.collection.getKeyAfter(e);for(;r!=null;){let e=this.collection.getItem(r);if(!e)return null;if((n||!this.isDisabled(e))&&(!t||t(e)))return r;if(r=this.collection.getKeyAfter(r),r==null)return null}return null}getKeyForItemInRowByIndex(e,t=0){if(t<0)return null;let n=this.collection.getItem(e);if(!n)return null;let r=0;for(let e of hx(n,this.collection)){if(e.colSpan&&e.colSpan+r>t||(e.colSpan&&(r=r+e.colSpan-1),r===t))return e.key??null;r++}return null}getKeyBelow(e,t){let n=e,r=this.collection.getItem(n);if(!r||(this.isCell(r)&&(n=r.parentKey??null),n==null))return null;if(n=this.findNextKey(n,e=>e.type===`item`,t?.includeDisabled),n!=null){if(this.isCell(r)){let e=r.colIndex?r.colIndex:r.index;return this.getKeyForItemInRowByIndex(n,e)}if(this.focusMode===`row`)return n}return null}getKeyAbove(e,t){let n=e,r=this.collection.getItem(n);if(!r||(this.isCell(r)&&(n=r.parentKey??null),n==null))return null;if(n=this.findPreviousKey(n,e=>e.type===`item`,t?.includeDisabled),n!=null){if(this.isCell(r)){let e=r.colIndex?r.colIndex:r.index;return this.getKeyForItemInRowByIndex(n,e)}if(this.focusMode===`row`)return n}return null}getKeyRightOf(e){let t=this.collection.getItem(e);if(!t)return null;if(this.isRow(t)){let e=hx(t,this.collection);return(this.direction===`rtl`?vx(e)?.key:gx(e)?.key)??null}if(this.isCell(t)&&t.parentKey!=null){let n=this.collection.getItem(t.parentKey);if(!n)return null;let r=hx(n,this.collection),i=(this.direction===`rtl`?_x(r,t.index-1):_x(r,t.index+1))??null;return i?i.key??null:this.focusMode===`row`?t.parentKey??null:(this.direction===`rtl`?this.getFirstKey(e):this.getLastKey(e))??null}return null}getKeyLeftOf(e){let t=this.collection.getItem(e);if(!t)return null;if(this.isRow(t)){let e=hx(t,this.collection);return(this.direction===`rtl`?gx(e)?.key:vx(e)?.key)??null}if(this.isCell(t)&&t.parentKey!=null){let n=this.collection.getItem(t.parentKey);if(!n)return null;let r=hx(n,this.collection),i=(this.direction===`rtl`?_x(r,t.index+1):_x(r,t.index-1))??null;return i?i.key??null:this.focusMode===`row`?t.parentKey??null:(this.direction===`rtl`?this.getLastKey(e):this.getFirstKey(e))??null}return null}getFirstKey(e,t){let n=e??null,r;if(n!=null){if(r=this.collection.getItem(n),!r)return null;if(this.isCell(r)&&!t&&r.parentKey!=null){let e=this.collection.getItem(r.parentKey);return e?gx(hx(e,this.collection))?.key??null:null}}if(n=this.findNextKey(void 0,e=>e.type===`item`),n!=null&&(r&&this.isCell(r)&&t||this.focusMode===`cell`)){let e=this.collection.getItem(n);if(!e)return null;n=gx(hx(e,this.collection))?.key??null}return n}getLastKey(e,t){let n=e??null,r;if(n!=null){if(r=this.collection.getItem(n),!r)return null;if(this.isCell(r)&&!t&&r.parentKey!=null){let e=this.collection.getItem(r.parentKey);return e?vx(hx(e,this.collection))?.key??null:null}}if(n=this.findPreviousKey(void 0,e=>e.type===`item`),n!=null&&(r&&this.isCell(r)&&t||this.focusMode===`cell`)){let e=this.collection.getItem(n);if(!e)return null;n=vx(hx(e,this.collection))?.key??null}return n}getKeyPageAbove(e){let t=e,n=this.layoutDelegate.getItemRect(t);if(!n)return null;let r=Math.max(0,n.y+n.height-this.layoutDelegate.getVisibleRect().height);for(;n&&n.y>r&&t!=null&&(t=this.getKeyAbove(t)??null,t!=null);)n=this.layoutDelegate.getItemRect(t);return t}getKeyPageBelow(e){let t=e,n=this.layoutDelegate.getItemRect(t);if(!n)return null;let r=this.layoutDelegate.getVisibleRect().height,i=Math.min(this.layoutDelegate.getContentSize().height,n.y+r);for(;n&&n.y+n.heighte.type===`item`),n==null&&!a&&(n=this.getFirstKey(),a=!0)}return null}},zR=class{constructor(e){this.layout=e}getContentSize(){return this.layout.getContentSize()}getItemRect(e){return this.layout.getLayoutInfo(e)?.rect||null}getVisibleRect(){return this.layout.virtualizer.visibleRect}},BR=new WeakMap;function VR(e,t,n){let{isVirtualized:r,disallowTypeAhead:i,keyboardDelegate:a,focusMode:o,scrollRef:s,getRowText:c,onRowAction:l,onCellAction:u,escapeKeyBehavior:d=`clearSelection`,shouldSelectOnPressUp:f,keyboardNavigationBehavior:p=`arrow`}=e,{selectionManager:m}=t;!e[`aria-label`]&&!e[`aria-labelledby`]&&console.warn(`An aria-label or aria-labelledby prop is required for accessibility.`);let h=lx({usage:`search`,sensitivity:`base`}),{direction:g}=rp(),_=t.selectionManager.disabledBehavior,y=(0,v.useMemo)(()=>a||new RR({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:_,ref:n,direction:g,collator:h,focusMode:o}),[a,t.collection,t.disabledKeys,_,n,g,h,o]),{collectionProps:b}=ax({ref:n,selectionManager:m,keyboardDelegate:y,isVirtualized:r,scrollRef:s,disallowTypeAhead:i,escapeKeyBehavior:d}),x=es(e.id);BR.set(t,{keyboardDelegate:y,actions:{onRowAction:l,onCellAction:u},shouldSelectOnPressUp:f,keyboardNavigationBehavior:p});let S=CI({selectionManager:m,hasItemActions:!!(l||u)}),C=W(e,{labelable:!0}),w=(0,v.useCallback)(e=>{if(m.isFocused){ps(e.currentTarget,H(e))||m.setFocused(!1);return}ps(e.currentTarget,H(e))&&m.setFocused(!0)},[m]),T=(0,v.useMemo)(()=>({onBlur:b.onBlur,onFocus:w}),[w,b.onBlur]),E=hF(n,{isDisabled:t.collection.size!==0}),D=U(C,{role:`grid`,id:x,"aria-multiselectable":m.selectionMode===`multiple`?`true`:void 0},t.isKeyboardNavigationDisabled?T:b,t.collection.size===0&&{tabIndex:E?-1:0}||void 0,S);return r&&(D[`aria-rowcount`]=t.collection.size,D[`aria-colcount`]=t.collection.columnCount),bI({getRowText:c},t),{gridProps:D}}var HR=new WeakMap;function UR(e){return typeof e==`string`?e.replace(/\s*/g,``):``+e}function WR(e,t){let n=HR.get(e);if(!n)throw Error(`Unknown grid`);return`${n}-${UR(t)}`}function GR(e,t,n){let r=HR.get(e);if(!r)throw Error(`Unknown grid`);return`${r}-${UR(t)}-${UR(n)}`}function KR(e,t){return[...e.collection.rowHeaderColumnKeys].map(n=>GR(e,t,n)).join(` `)}var qR={};qR={ascending:`تصاعدي`,ascendingSort:e=>`\u{62A}\u{631}\u{62A}\u{64A}\u{628} \u{62D}\u{633}\u{628} \u{627}\u{644}\u{639}\u{645}\u{648}\u{62F} ${e.columnName} \u{628}\u{62A}\u{631}\u{62A}\u{64A}\u{628} \u{62A}\u{635}\u{627}\u{639}\u{62F}\u{64A}`,collapse:`طي`,columnSize:e=>`${e.value} \u{628}\u{627}\u{644}\u{628}\u{643}\u{633}\u{644}`,descending:`تنازلي`,descendingSort:e=>`\u{62A}\u{631}\u{62A}\u{64A}\u{628} \u{62D}\u{633}\u{628} \u{627}\u{644}\u{639}\u{645}\u{648}\u{62F} ${e.columnName} \u{628}\u{62A}\u{631}\u{62A}\u{64A}\u{628} \u{62A}\u{646}\u{627}\u{632}\u{644}\u{64A}`,expand:`تمديد`,resizerDescription:`اضغط على مفتاح Enter لبدء تغيير الحجم`,select:`تحديد`,selectAll:`تحديد الكل`,sortable:`عمود قابل للترتيب`};var JR={};JR={ascending:`възходящ`,ascendingSort:e=>`\u{441}\u{43E}\u{440}\u{442}\u{438}\u{440}\u{430}\u{43D}\u{43E} \u{43F}\u{43E} \u{43A}\u{43E}\u{43B}\u{43E}\u{43D}\u{430} ${e.columnName} \u{432}\u{44A}\u{432} \u{432}\u{44A}\u{437}\u{445}\u{43E}\u{434}\u{44F}\u{449} \u{440}\u{435}\u{434}`,collapse:`Свиване`,columnSize:e=>`${e.value} \u{43F}\u{438}\u{43A}\u{441}\u{435}\u{43B}\u{430}`,descending:`низходящ`,descendingSort:e=>`\u{441}\u{43E}\u{440}\u{442}\u{438}\u{440}\u{430}\u{43D}\u{43E} \u{43F}\u{43E} \u{43A}\u{43E}\u{43B}\u{43E}\u{43D}\u{430} ${e.columnName} \u{432} \u{43D}\u{438}\u{437}\u{445}\u{43E}\u{434}\u{44F}\u{449} \u{440}\u{435}\u{434}`,expand:`Разширяване`,resizerDescription:`Натиснете „Enter“, за да започнете да преоразмерявате`,select:`Изберете`,selectAll:`Изберете всичко`,sortable:`сортираща колона`};var YR={};YR={ascending:`vzestupně`,ascendingSort:e=>`\u{159}azeno vzestupn\u{11B} podle sloupce ${e.columnName}`,collapse:`Sbalit`,columnSize:e=>`${e.value} pixel\u{16F}`,descending:`sestupně`,descendingSort:e=>`\u{159}azeno sestupn\u{11B} podle sloupce ${e.columnName}`,expand:`Roztáhnout`,resizerDescription:`Stisknutím klávesy Enter začnete měnit velikost`,select:`Vybrat`,selectAll:`Vybrat vše`,sortable:`sloupec s možností řazení`};var XR={};XR={ascending:`stigende`,ascendingSort:e=>`sorteret efter kolonne ${e.columnName} i stigende r\xe6kkef\xf8lge`,collapse:`Skjul`,columnSize:e=>`${e.value} pixels`,descending:`faldende`,descendingSort:e=>`sorteret efter kolonne ${e.columnName} i faldende r\xe6kkef\xf8lge`,expand:`Udvid`,resizerDescription:`Tryk på Enter for at ændre størrelse`,select:`Vælg`,selectAll:`Vælg alle`,sortable:`sorterbar kolonne`};var ZR={};ZR={ascending:`aufsteigend`,ascendingSort:e=>`sortiert nach Spalte ${e.columnName} in aufsteigender Reihenfolge`,collapse:`Reduzieren`,columnSize:e=>`${e.value} Pixel`,descending:`absteigend`,descendingSort:e=>`sortiert nach Spalte ${e.columnName} in absteigender Reihenfolge`,expand:`Erweitern`,resizerDescription:`Eingabetaste zum Starten der Größenänderung drücken`,select:`Auswählen`,selectAll:`Alles auswählen`,sortable:`sortierbare Spalte`};var QR={};QR={ascending:`αύξουσα`,ascendingSort:e=>`\u{3B4}\u{3B9}\u{3B1}\u{3BB}\u{3BF}\u{3B3}\u{3AE} \u{3B1}\u{3BD}\u{3AC} \u{3C3}\u{3C4}\u{3AE}\u{3BB}\u{3B7} ${e.columnName} \u{3C3}\u{3B5} \u{3B1}\u{3CD}\u{3BE}\u{3BF}\u{3C5}\u{3C3}\u{3B1} \u{3C3}\u{3B5}\u{3B9}\u{3C1}\u{3AC}`,collapse:`Σύμπτυξη`,columnSize:e=>`${e.value} pixel`,descending:`φθίνουσα`,descendingSort:e=>`\u{3B4}\u{3B9}\u{3B1}\u{3BB}\u{3BF}\u{3B3}\u{3AE} \u{3B1}\u{3BD}\u{3AC} \u{3C3}\u{3C4}\u{3AE}\u{3BB}\u{3B7} ${e.columnName} \u{3C3}\u{3B5} \u{3C6}\u{3B8}\u{3AF}\u{3BD}\u{3BF}\u{3C5}\u{3C3}\u{3B1} \u{3C3}\u{3B5}\u{3B9}\u{3C1}\u{3AC}`,expand:`Ανάπτυξη`,resizerDescription:`Πατήστε Enter για έναρξη της αλλαγής μεγέθους`,select:`Επιλογή`,selectAll:`Επιλογή όλων`,sortable:`Στήλη διαλογής`};var $R={};$R={select:`Select`,selectAll:`Select All`,sortable:`sortable column`,ascending:`ascending`,descending:`descending`,ascendingSort:e=>`sorted by column ${e.columnName} in ascending order`,descendingSort:e=>`sorted by column ${e.columnName} in descending order`,columnSize:e=>`${e.value} pixels`,resizerDescription:`Press Enter to start resizing`,expand:`Expand`,collapse:`Collapse`};var ez={};ez={ascending:`ascendente`,ascendingSort:e=>`ordenado por columna ${e.columnName} en sentido ascendente`,collapse:`Contraer`,columnSize:e=>`${e.value} p\xedxeles`,descending:`descendente`,descendingSort:e=>`ordenado por columna ${e.columnName} en orden descendente`,expand:`Ampliar`,resizerDescription:`Pulse Intro para empezar a redimensionar`,select:`Seleccionar`,selectAll:`Seleccionar todos`,sortable:`columna ordenable`};var tz={};tz={ascending:`tõusev järjestus`,ascendingSort:e=>`sorditud veeru j\xe4rgi ${e.columnName} t\xf5usvas j\xe4rjestuses`,collapse:`Ahenda`,columnSize:e=>`${e.value} pikslit`,descending:`laskuv järjestus`,descendingSort:e=>`sorditud veeru j\xe4rgi ${e.columnName} laskuvas j\xe4rjestuses`,expand:`Laienda`,resizerDescription:`Suuruse muutmise alustamiseks vajutage klahvi Enter`,select:`Vali`,selectAll:`Vali kõik`,sortable:`sorditav veerg`};var nz={};nz={ascending:`nouseva`,ascendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan nousevassa j\xe4rjestyksess\xe4`,collapse:`Pienennä`,columnSize:e=>`${e.value} pikseli\xe4`,descending:`laskeva`,descendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan laskevassa j\xe4rjestyksess\xe4`,expand:`Laajenna`,resizerDescription:`Aloita koon muutos painamalla Enter-näppäintä`,select:`Valitse`,selectAll:`Valitse kaikki`,sortable:`lajiteltava sarake`};var rz={};rz={ascending:`croissant`,ascendingSort:e=>`tri\xe9 en fonction de la colonne\xa0${e.columnName} par ordre croissant`,collapse:`Réduire`,columnSize:e=>`${e.value}\xa0pixels`,descending:`décroissant`,descendingSort:e=>`tri\xe9 en fonction de la colonne\xa0${e.columnName} par ordre d\xe9croissant`,expand:`Développer`,resizerDescription:`Appuyez sur Entrée pour commencer le redimensionnement.`,select:`Sélectionner`,selectAll:`Sélectionner tout`,sortable:`colonne triable`};var iz={};iz={ascending:`עולה`,ascendingSort:e=>`\u{5DE}\u{5D5}\u{5D9}\u{5DF} \u{5DC}\u{5E4}\u{5D9} \u{5E2}\u{5DE}\u{5D5}\u{5D3}\u{5D4} ${e.columnName} \u{5D1}\u{5E1}\u{5D3}\u{5E8} \u{5E2}\u{5D5}\u{5DC}\u{5D4}`,collapse:`כווץ`,columnSize:e=>`${e.value} \u{5E4}\u{5D9}\u{5E7}\u{5E1}\u{5DC}\u{5D9}\u{5DD}`,descending:`יורד`,descendingSort:e=>`\u{5DE}\u{5D5}\u{5D9}\u{5DF} \u{5DC}\u{5E4}\u{5D9} \u{5E2}\u{5DE}\u{5D5}\u{5D3}\u{5D4} ${e.columnName} \u{5D1}\u{5E1}\u{5D3}\u{5E8} \u{5D9}\u{5D5}\u{5E8}\u{5D3}`,expand:`הרחב`,resizerDescription:`הקש Enter כדי לשנות את הגודל`,select:`בחר`,selectAll:`בחר הכול`,sortable:`עמודה שניתן למיין`};var az={};az={ascending:`rastući`,ascendingSort:e=>`razvrstano po stupcima ${e.columnName} rastu\u{107}em redoslijedom`,collapse:`Sažmi`,columnSize:e=>`${e.value} piksela`,descending:`padajući`,descendingSort:e=>`razvrstano po stupcima ${e.columnName} padaju\u{107}im redoslijedom`,expand:`Proširi`,resizerDescription:`Pritisnite Enter da biste započeli promenu veličine`,select:`Odaberite`,selectAll:`Odaberite sve`,sortable:`stupac koji se može razvrstati`};var oz={};oz={ascending:`növekvő`,ascendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, n\xf6vekv\u{151} sorrendben`,collapse:`Összecsukás`,columnSize:e=>`${e.value} k\xe9ppont`,descending:`csökkenő`,descendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, cs\xf6kken\u{151} sorrendben`,expand:`Kibontás`,resizerDescription:`Nyomja le az Enter billentyűt az átméretezés megkezdéséhez`,select:`Kijelölés`,selectAll:`Összes kijelölése`,sortable:`rendezendő oszlop`};var sz={};sz={ascending:`crescente`,ascendingSort:e=>`in ordine crescente in base alla colonna ${e.columnName}`,collapse:`Comprimi`,columnSize:e=>`${e.value} pixel`,descending:`decrescente`,descendingSort:e=>`in ordine decrescente in base alla colonna ${e.columnName}`,expand:`Espandi`,resizerDescription:`Premi Invio per iniziare a ridimensionare`,select:`Seleziona`,selectAll:`Seleziona tutto`,sortable:`colonna ordinabile`};var cz={};cz={ascending:`昇順`,ascendingSort:e=>`\u{5217} ${e.columnName} \u{3092}\u{6607}\u{9806}\u{3067}\u{4E26}\u{3079}\u{66FF}\u{3048}`,collapse:`折りたたむ`,columnSize:e=>`${e.value} \u{30D4}\u{30AF}\u{30BB}\u{30EB}`,descending:`降順`,descendingSort:e=>`\u{5217} ${e.columnName} \u{3092}\u{964D}\u{9806}\u{3067}\u{4E26}\u{3079}\u{66FF}\u{3048}`,expand:`展開`,resizerDescription:`Enter キーを押してサイズ変更を開始`,select:`選択`,selectAll:`すべて選択`,sortable:`並べ替え可能な列`};var lz={};lz={ascending:`오름차순`,ascendingSort:e=>`${e.columnName} \u{C5F4}\u{C744} \u{AE30}\u{C900}\u{C73C}\u{B85C} \u{C624}\u{B984}\u{CC28}\u{C21C}\u{C73C}\u{B85C} \u{C815}\u{B82C}\u{B428}`,collapse:`접기`,columnSize:e=>`${e.value} \u{D53D}\u{C140}`,descending:`내림차순`,descendingSort:e=>`${e.columnName} \u{C5F4}\u{C744} \u{AE30}\u{C900}\u{C73C}\u{B85C} \u{B0B4}\u{B9BC}\u{CC28}\u{C21C}\u{C73C}\u{B85C} \u{C815}\u{B82C}\u{B428}`,expand:`펼치기`,resizerDescription:`크기 조정을 시작하려면 Enter를 누르세요.`,select:`선택`,selectAll:`모두 선택`,sortable:`정렬 가능한 열`};var uz={};uz={ascending:`didėjančia tvarka`,ascendingSort:e=>`surikiuota pagal stulpel\u{12F} ${e.columnName} did\u{117}jan\u{10D}ia tvarka`,collapse:`Sutraukti`,columnSize:e=>`${e.value} piks.`,descending:`mažėjančia tvarka`,descendingSort:e=>`surikiuota pagal stulpel\u{12F} ${e.columnName} ma\u{17E}\u{117}jan\u{10D}ia tvarka`,expand:`Išskleisti`,resizerDescription:`Paspauskite „Enter“, kad pradėtumėte keisti dydį`,select:`Pasirinkti`,selectAll:`Pasirinkti viską`,sortable:`rikiuojamas stulpelis`};var dz={};dz={ascending:`augošā secībā`,ascendingSort:e=>`k\u{101}rtots p\u{113}c kolonnas ${e.columnName} augo\u{161}\u{101} sec\u{12B}b\u{101}`,collapse:`Sakļaut`,columnSize:e=>`${e.value} pikse\u{13C}i`,descending:`dilstošā secībā`,descendingSort:e=>`k\u{101}rtots p\u{113}c kolonnas ${e.columnName} dilsto\u{161}\u{101} sec\u{12B}b\u{101}`,expand:`Izvērst`,resizerDescription:`Nospiediet Enter, lai sāktu izmēru mainīšanu`,select:`Atlasīt`,selectAll:`Atlasīt visu`,sortable:`kārtojamā kolonna`};var fz={};fz={ascending:`stigende`,ascendingSort:e=>`sortert etter kolonne ${e.columnName} i stigende rekkef\xf8lge`,collapse:`Skjul`,columnSize:e=>`${e.value} piksler`,descending:`synkende`,descendingSort:e=>`sortert etter kolonne ${e.columnName} i synkende rekkef\xf8lge`,expand:`Utvid`,resizerDescription:`Trykk på Enter for å starte størrelsesendring`,select:`Velg`,selectAll:`Velg alle`,sortable:`kolonne som kan sorteres`};var pz={};pz={ascending:`oplopend`,ascendingSort:e=>`gesorteerd in oplopende volgorde in kolom ${e.columnName}`,collapse:`Samenvouwen`,columnSize:e=>`${e.value} pixels`,descending:`aflopend`,descendingSort:e=>`gesorteerd in aflopende volgorde in kolom ${e.columnName}`,expand:`Uitvouwen`,resizerDescription:`Druk op Enter om het formaat te wijzigen`,select:`Selecteren`,selectAll:`Alles selecteren`,sortable:`sorteerbare kolom`};var mz={};mz={ascending:`rosnąco`,ascendingSort:e=>`posortowano wed\u{142}ug kolumny ${e.columnName} w porz\u{105}dku rosn\u{105}cym`,collapse:`Zwiń`,columnSize:e=>`Liczba pikseli: ${e.value}`,descending:`malejąco`,descendingSort:e=>`posortowano wed\u{142}ug kolumny ${e.columnName} w porz\u{105}dku malej\u{105}cym`,expand:`Rozwiń`,resizerDescription:`Naciśnij Enter, aby rozpocząć zmienianie rozmiaru`,select:`Zaznacz`,selectAll:`Zaznacz wszystko`,sortable:`kolumna z możliwością sortowania`};var hz={};hz={ascending:`crescente`,ascendingSort:e=>`classificado pela coluna ${e.columnName} em ordem crescente`,collapse:`Recolher`,columnSize:e=>`${e.value} pixels`,descending:`decrescente`,descendingSort:e=>`classificado pela coluna ${e.columnName} em ordem decrescente`,expand:`Expandir`,resizerDescription:`Pressione Enter para começar a redimensionar`,select:`Selecionar`,selectAll:`Selecionar tudo`,sortable:`coluna classificável`};var gz={};gz={ascending:`ascendente`,ascendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem ascendente`,collapse:`Colapsar`,columnSize:e=>`${e.value} pixels`,descending:`descendente`,descendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem descendente`,expand:`Expandir`,resizerDescription:`Prima Enter para iniciar o redimensionamento`,select:`Selecionar`,selectAll:`Selecionar tudo`,sortable:`Coluna ordenável`};var _z={};_z={ascending:`crescătoare`,ascendingSort:e=>`sortate dup\u{103} coloana ${e.columnName} \xeen ordine cresc\u{103}toare`,collapse:`Restrângeți`,columnSize:e=>`${e.value} pixeli`,descending:`descrescătoare`,descendingSort:e=>`sortate dup\u{103} coloana ${e.columnName} \xeen ordine descresc\u{103}toare`,expand:`Extindeți`,resizerDescription:`Apăsați pe Enter pentru a începe redimensionarea`,select:`Selectare`,selectAll:`Selectare totală`,sortable:`coloană sortabilă`};var vz={};vz={ascending:`возрастание`,ascendingSort:e=>`\u{441}\u{43E}\u{440}\u{442}\u{438}\u{440}\u{43E}\u{432}\u{430}\u{442}\u{44C} \u{441}\u{442}\u{43E}\u{43B}\u{431}\u{435}\u{446} ${e.columnName} \u{432} \u{43F}\u{43E}\u{440}\u{44F}\u{434}\u{43A}\u{435} \u{432}\u{43E}\u{437}\u{440}\u{430}\u{441}\u{442}\u{430}\u{43D}\u{438}\u{44F}`,collapse:`Свернуть`,columnSize:e=>`${e.value} \u{43F}\u{438}\u{43A}\u{441}.`,descending:`убывание`,descendingSort:e=>`\u{441}\u{43E}\u{440}\u{442}\u{438}\u{440}\u{43E}\u{432}\u{430}\u{442}\u{44C} \u{441}\u{442}\u{43E}\u{43B}\u{431}\u{435}\u{446} ${e.columnName} \u{432} \u{43F}\u{43E}\u{440}\u{44F}\u{434}\u{43A}\u{435} \u{443}\u{431}\u{44B}\u{432}\u{430}\u{43D}\u{438}\u{44F}`,expand:`Развернуть`,resizerDescription:`Нажмите клавишу Enter для начала изменения размеров`,select:`Выбрать`,selectAll:`Выбрать все`,sortable:`сортируемый столбец`};var yz={};yz={ascending:`vzostupne`,ascendingSort:e=>`zoraden\xe9 zostupne pod\u{13E}a st\u{13A}pca ${e.columnName}`,collapse:`Zbaliť`,columnSize:e=>`Po\u{10D}et pixelov: ${e.value}`,descending:`zostupne`,descendingSort:e=>`zoraden\xe9 zostupne pod\u{13E}a st\u{13A}pca ${e.columnName}`,expand:`Rozbaliť`,resizerDescription:`Stlačením klávesu Enter začnete zmenu veľkosti`,select:`Vybrať`,selectAll:`Vybrať všetko`,sortable:`zoraditeľný stĺpec`};var bz={};bz={ascending:`naraščajoče`,ascendingSort:e=>`razvr\u{161}\u{10D}eno po stolpcu ${e.columnName} v nara\u{161}\u{10D}ajo\u{10D}em vrstnem redu`,collapse:`Strni`,columnSize:e=>`${e.value} slikovnih pik`,descending:`padajoče`,descendingSort:e=>`razvr\u{161}\u{10D}eno po stolpcu ${e.columnName} v padajo\u{10D}em vrstnem redu`,expand:`Razširi`,resizerDescription:`Pritisnite tipko Enter da začnete spreminjati velikost`,select:`Izberite`,selectAll:`Izberite vse`,sortable:`razvrstljivi stolpec`};var xz={};xz={ascending:`rastući`,ascendingSort:e=>`sortirano po kolonama ${e.columnName} rastu\u{107}im redosledom`,collapse:`Skupi`,columnSize:e=>`${e.value} piksela`,descending:`padajući`,descendingSort:e=>`sortirano po kolonama ${e.columnName} padaju\u{107}im redosledom`,expand:`Proširi`,resizerDescription:`Pritisnite Enter da biste započeli promenu veličine`,select:`Izaberite`,selectAll:`Izaberite sve`,sortable:`kolona koja se može sortirati`};var Sz={};Sz={ascending:`stigande`,ascendingSort:e=>`sorterat p\xe5 kolumn ${e.columnName} i stigande ordning`,collapse:`Dölj`,columnSize:e=>`${e.value} pixlar`,descending:`fallande`,descendingSort:e=>`sorterat p\xe5 kolumn ${e.columnName} i fallande ordning`,expand:`Expandera`,resizerDescription:`Tryck på Retur för att börja ändra storlek`,select:`Markera`,selectAll:`Markera allt`,sortable:`sorterbar kolumn`};var Cz={};Cz={ascending:`artan sırada`,ascendingSort:e=>`${e.columnName} s\xfctuna g\xf6re artan d\xfczende s\u{131}rala`,collapse:`Daralt`,columnSize:e=>`${e.value} piksel`,descending:`azalan sırada`,descendingSort:e=>`${e.columnName} s\xfctuna g\xf6re azalan d\xfczende s\u{131}rala`,expand:`Genişlet`,resizerDescription:`Yeniden boyutlandırmak için Enter'a basın`,select:`Seç`,selectAll:`Tümünü Seç`,sortable:`Sıralanabilir sütun`};var wz={};wz={ascending:`висхідний`,ascendingSort:e=>`\u{432}\u{456}\u{434}\u{441}\u{43E}\u{440}\u{442}\u{43E}\u{432}\u{430}\u{43D}\u{43E} \u{437}\u{430} \u{441}\u{442}\u{43E}\u{432}\u{43F}\u{446}\u{435}\u{43C} ${e.columnName} \u{443} \u{432}\u{438}\u{441}\u{445}\u{456}\u{434}\u{43D}\u{43E}\u{43C}\u{443} \u{43F}\u{43E}\u{440}\u{44F}\u{434}\u{43A}\u{443}`,collapse:`Згорнути`,columnSize:e=>`${e.value} \u{43F}\u{456}\u{43A}\u{441}.`,descending:`низхідний`,descendingSort:e=>`\u{432}\u{456}\u{434}\u{441}\u{43E}\u{440}\u{442}\u{43E}\u{432}\u{430}\u{43D}\u{43E} \u{437}\u{430} \u{441}\u{442}\u{43E}\u{432}\u{43F}\u{446}\u{435}\u{43C} ${e.columnName} \u{443} \u{43D}\u{438}\u{437}\u{445}\u{456}\u{434}\u{43D}\u{43E}\u{43C}\u{443} \u{43F}\u{43E}\u{440}\u{44F}\u{434}\u{43A}\u{443}`,expand:`Розгорнути`,resizerDescription:`Натисніть Enter, щоб почати зміну розміру`,select:`Вибрати`,selectAll:`Вибрати все`,sortable:`сортувальний стовпець`};var Tz={};Tz={ascending:`升序`,ascendingSort:e=>`\u{6309}\u{5217} ${e.columnName} \u{5347}\u{5E8F}\u{6392}\u{5E8F}`,collapse:`折叠`,columnSize:e=>`${e.value} \u{50CF}\u{7D20}`,descending:`降序`,descendingSort:e=>`\u{6309}\u{5217} ${e.columnName} \u{964D}\u{5E8F}\u{6392}\u{5E8F}`,expand:`扩展`,resizerDescription:`按 Enter 开始调整大小。`,select:`选择`,selectAll:`全选`,sortable:`可排序的列`};var Ez={};Ez={ascending:`遞增`,ascendingSort:e=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${e.columnName}\u{300D}\u{6B04}\u{905E}\u{589E}\u{6392}\u{5E8F}`,collapse:`收合`,columnSize:e=>`${e.value} \u{50CF}\u{7D20}`,descending:`遞減`,descendingSort:e=>`\u{5DF2}\u{4F9D}\u{64DA}\u{300C}${e.columnName}\u{300D}\u{6B04}\u{905E}\u{6E1B}\u{6392}\u{5E8F}`,expand:`展開`,resizerDescription:`按 Enter 鍵以開始調整大小`,select:`選取`,selectAll:`全選`,sortable:`可排序的欄`};var Dz={};Dz={"ar-AE":qR,"bg-BG":JR,"cs-CZ":YR,"da-DK":XR,"de-DE":ZR,"el-GR":QR,"en-US":$R,"es-ES":ez,"et-EE":tz,"fi-FI":nz,"fr-FR":rz,"he-IL":iz,"hr-HR":az,"hu-HU":oz,"it-IT":sz,"ja-JP":cz,"ko-KR":lz,"lt-LT":uz,"lv-LV":dz,"nb-NO":fz,"nl-NL":pz,"pl-PL":mz,"pt-BR":hz,"pt-PT":gz,"ro-RO":_z,"ru-RU":vz,"sk-SK":yz,"sl-SI":bz,"sr-SP":xz,"sv-SE":Sz,"tr-TR":Cz,"uk-UA":wz,"zh-CN":Tz,"zh-TW":Ez};var Oz=class extends RR{isCell(e){return e.type===`cell`||e.type===`rowheader`||e.type===`column`}getKeyBelow(e,t){let n=this.collection.getItem(e);if(!n)return null;if(n.type===`column`){let e=gx(hx(n,this.collection));if(e)return e.key;let t=this.getFirstKey();return t==null||!this.collection.getItem(t)?null:super.getKeyForItemInRowByIndex(t,n.index)}return super.getKeyBelow(e,t)}getKeyAbove(e,t){let n=this.collection.getItem(e);if(!n)return null;if(n.type===`column`){let e=n.parentKey==null?null:this.collection.getItem(n.parentKey);return e&&e.type===`column`?e.key:null}let r=super.getKeyAbove(e,t),i=r==null?null:this.collection.getItem(r);return i&&i.type!==`headerrow`?r:this.isCell(n)?this.collection.columns[n.index].key:this.collection.columns[0].key}findNextColumnKey(e){let t=this.findNextKey(e.key,e=>e.type===`column`);if(t!=null)return t;let n=this.collection.headerRows[e.level];for(let e of hx(n,this.collection))if(e.type===`column`)return e.key;return null}findPreviousColumnKey(e){let t=this.findPreviousKey(e.key,e=>e.type===`column`);if(t!=null)return t;let n=this.collection.headerRows[e.level],r=[...hx(n,this.collection)];for(let e=r.length-1;e>=0;e--){let t=r[e];if(t.type===`column`)return t.key}return null}getKeyRightOf(e){let t=this.collection.getItem(e);return t?t.type===`column`?this.direction===`rtl`?this.findPreviousColumnKey(t):this.findNextColumnKey(t):super.getKeyRightOf(e):null}getKeyLeftOf(e){let t=this.collection.getItem(e);return t?t.type===`column`?this.direction===`rtl`?this.findNextColumnKey(t):this.findPreviousColumnKey(t):super.getKeyLeftOf(e):null}getKeyForSearch(e,t){if(!this.collator)return null;let n=this.collection,r=t??this.getFirstKey();if(r==null)return null;let i=n.getItem(r);i?.type===`cell`&&(r=i.parentKey??null);let a=!1;for(;r!=null;){let o=n.getItem(r);if(!o)return null;if(o.textValue){let t=o.textValue.slice(0,e.length);if(this.collator.compare(t,e)===0)return o.key}for(let r of hx(o,this.collection)){let a=n.columns[r.index];if(n.rowHeaderColumnKeys.has(a.key)&&r.textValue){let a=r.textValue.slice(0,e.length);if(this.collator.compare(a,e)===0)return(t==null?i:n.getItem(t))?.type===`cell`?r.key:o.key}}r=this.getKeyBelow(r),r==null&&!a&&(r=this.getFirstKey(),a=!0)}return null}};function kz(e){return e&&e.__esModule?e.default:e}function Az(e,t,n){let{keyboardDelegate:r,isVirtualized:i,layoutDelegate:a,layout:o}=e,s=lx({usage:`search`,sensitivity:`base`}),{direction:c}=rp(),l=t.selectionManager.disabledBehavior,u=(0,v.useMemo)(()=>r||new Oz({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:l,ref:n,direction:c,collator:s,layoutDelegate:a,layout:o}),[r,t.collection,t.disabledKeys,l,n,c,s,a,o]),d=es(e.id);HR.set(t,d);let{gridProps:f}=VR({...e,id:d,keyboardDelegate:u},t,n);i&&(f[`aria-rowcount`]=t.collection.size+t.collection.headerRows.length),t.treeColumn!=null&&(f.role=`treegrid`);let{column:p,direction:m}=t.sortDescriptor||{},h=rv(kz(Dz),`@react-aria/table`),g=(0,v.useMemo)(()=>{let e=t.collection.columns.find(e=>e.key===p)?.textValue??``;return m&&p?h.format(`${m}Sort`,{columnName:e}):void 0},[m,p,t.collection.columns]),_=tc(g);return zs(()=>{g&&Op(g,`assertive`,500)},[g]),{gridProps:U(f,_,{"aria-describedby":[_[`aria-describedby`],f[`aria-describedby`]].filter(Boolean).join(` `)})}}function jz(e,t,n){let{node:r,isVirtualized:i,focusMode:a,allowsArrowNavigation:o,shouldSelectOnPressUp:s,onAction:c}=e,{direction:l}=rp(),{keyboardDelegate:u,actions:{onCellAction:d},keyboardNavigationBehavior:f}=BR.get(t),p=a??(f===`tab`?`cell`:`child`),m=(0,v.useRef)(null),h=()=>{if(n.current){let e=Hg(n.current);if(p===`child`){if(gs(n.current)&&n.current!==ms(is(n.current)))return;let r=t.selectionManager.childFocusStrategy===`last`?Mz(e):e.firstChild();if(r){sm(r);return}}(m.current!=null&&r.key!==m.current||!gs(n.current))&&sm(n.current)}},{itemProps:g,isPressed:_}=fx({selectionManager:t.selectionManager,key:r.key,ref:n,isVirtualized:i,focus:h,shouldSelectOnPressUp:s,onAction:d?()=>d(r.key):c,isDisabled:t.collection.size===0}),y=U(g,{role:`gridcell`,onKeyDownCapture:f!==`tab`||o?e=>{let i=ms(is(n.current));if(!ps(e.currentTarget,H(e))||t.isKeyboardNavigationDisabled||!n.current||!i)return;let a=Hg(n.current);switch(a.currentNode=i,e.key){case`ArrowLeft`:{let t=l===`rtl`?a.nextNode():a.previousNode();if(p===`child`&&t===n.current&&(t=null),e.preventDefault(),e.stopPropagation(),t)sm(t),ic(t,{containingElement:Gs(n.current)});else{if(u.getKeyLeftOf?.(r.key)!==r.key){n.current.parentElement?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent));break}p===`cell`&&l===`rtl`?(sm(n.current),ic(n.current,{containingElement:Gs(n.current)})):(a.currentNode=n.current,t=l===`rtl`?a.firstChild():Mz(a),t&&(sm(t),ic(t,{containingElement:Gs(n.current)})))}break}case`ArrowRight`:{let t=l===`rtl`?a.previousNode():a.nextNode();if(p===`child`&&t===n.current&&(t=null),e.preventDefault(),e.stopPropagation(),t)sm(t),ic(t,{containingElement:Gs(n.current)});else{if(u.getKeyRightOf?.(r.key)!==r.key){n.current.parentElement?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent));break}p===`cell`&&l===`ltr`?(sm(n.current),ic(n.current,{containingElement:Gs(n.current)})):(a.currentNode=n.current,t=l===`rtl`?Mz(a):a.firstChild(),t&&(sm(t),ic(t,{containingElement:Gs(n.current)})))}break}case`ArrowUp`:case`ArrowDown`:!e.altKey&&ps(n.current,H(e))&&(e.stopPropagation(),e.preventDefault(),n.current.parentElement?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent)))}}:void 0,onKeyDown:f===`tab`?e=>{let r=ms(is(n.current));if(!(!ps(e.currentTarget,H(e))||t.isKeyboardNavigationDisabled||!n.current||!r)){if(f===`tab`&&H(e)!==n.current&&e.key!==`Tab`){e.stopPropagation();return}if(e.key===`Tab`&&f===`tab`){let t=Hg(n.current,{tabbable:!0});t.currentNode=r,(e.shiftKey?t.previousNode():t.nextNode())&&e.stopPropagation()}}}:void 0,"aria-colspan":r.colSpan,"aria-colindex":r.colIndex==null?void 0:r.colIndex+1,colSpan:i?void 0:r.colSpan,onFocus:e=>{if(m.current=r.key,H(e)!==n.current){$p()||t.selectionManager.setFocusedKey(r.key);return}p===`child`&&e.relatedTarget&&ps(n.current,e.relatedTarget)||requestAnimationFrame(()=>{p===`child`&&ms(is(n.current))===n.current&&h()})},...p===`child`&&f===`tab`?{tabIndex:-1}:{}});return i&&(y[`aria-colindex`]=(r.colIndex??r.index)+1),s&&y.tabIndex!=null&&y.onPointerDown==null&&(y.onPointerDown=e=>{let t=e.currentTarget,n=t.getAttribute(`tabindex`);t.removeAttribute(`tabindex`),requestAnimationFrame(()=>{n!=null&&t.setAttribute(`tabindex`,n)})}),{gridCellProps:y,isPressed:_}}function Mz(e){let t=null,n=null;do n=e.lastChild(),n&&(t=n);while(n);return t}function Nz(e){return e&&e.__esModule?e.default:e}function Pz(e,t,n){let{node:r}=e,i=r.props.allowsSorting,{gridCellProps:a}=jz({focusMode:`child`,...e},t,n),o=r.props.isSelectionCell&&t.selectionManager.selectionMode===`single`,{pressProps:s,isPressed:c}=Rm({isDisabled:!i||o,onPress(){t.sort(r.key)},ref:n}),{focusableProps:l}=Em({},n),u,d=t.sortDescriptor?.column===r.key,f=t.sortDescriptor?.direction;r.props.allowsSorting&&!bo()&&(u=d?f:`none`);let p=rv(Nz(Dz),`@react-aria/table`),m;i&&(m=`${p.format(`sortable`)}`,d&&f&&bo()&&(m=`${m}, ${p.format(f)}`));let h=tc(m),g=t.collection.size===0;return(0,v.useEffect)(()=>{g&&t.selectionManager.focusedKey===r.key&&t.selectionManager.setFocusedKey(null)},[g,t.selectionManager,r.key]),{columnHeaderProps:{...U(l,a,s,h,g?{tabIndex:-1}:null),role:`columnheader`,id:WR(t,r.key),"aria-colspan":r.colSpan&&r.colSpan>1?r.colSpan:void 0,"aria-sort":u},isPressed:c}}function Fz(e,t,n){let{node:r,isVirtualized:i,shouldSelectOnPressUp:a,onAction:o}=e,{actions:s,shouldSelectOnPressUp:c}=BR.get(t),l=s.onRowAction?()=>s.onRowAction?.(r.key):o,{itemProps:u,...d}=fx({selectionManager:t.selectionManager,key:r.key,ref:n,isVirtualized:i,shouldSelectOnPressUp:c||a,onAction:l||r?.props?.onAction?rs(r?.props?.onAction,l):void 0,isDisabled:t.collection.size===0}),f=t.selectionManager.isSelected(r.key),p={role:`row`,"aria-selected":t.selectionManager.selectionMode===`none`?void 0:f,"aria-disabled":d.isDisabled||void 0,...u};return i&&(p[`aria-rowindex`]=r.index+1),{rowProps:p,...d}}function Iz(e){return e&&e.__esModule?e.default:e}var Lz={expand:{ltr:`ArrowRight`,rtl:`ArrowLeft`},collapse:{ltr:`ArrowLeft`,rtl:`ArrowRight`}};function Rz(e,t,n){let{node:r,isVirtualized:i}=e,{rowProps:a,...o}=Fz(e,t,n),{direction:s}=rp();i&&t.treeColumn==null?a[`aria-rowindex`]=r.index+1+t.collection.headerRows.length:delete a[`aria-rowindex`];let c=t.treeColumn!=null&&(t.expandedKeys===`all`||t.expandedKeys.has(r.key)),l=rv(Iz(Dz),`@react-aria/table`),u=Fs({"aria-label":c?l.format(`collapse`):l.format(`expand`),"aria-labelledby":KR(t,r.key)}),d={},f={};if(t.treeColumn!=null){let e=t.collection.getItem(r.key);if(e!=null){let n=zz(t.collection,r),i=e.props?.hasChildRows||e.props?.UNSTABLE_childItems||n?.type!==`cell`,a=t.collection.getItem(r.parentKey),c=a.type===`tablebody`||a.type===`body`,l=zz(t.collection,a);for(;l&&l.type!==`item`&&l.prevKey!=null;)l=t.collection.getItem(l.prevKey);d={onKeyDown:n=>{n.key===Lz.expand[s]&&t.selectionManager.focusedKey===e.key&&i&&t.expandedKeys!==`all`&&!t.expandedKeys.has(e.key)?(t.toggleKey(e.key),n.stopPropagation()):n.key===Lz.collapse[s]&&t.selectionManager.focusedKey===e.key&&(t.expandedKeys===`all`?t.expandedKeys===`all`&&(t.toggleKey(e.key),n.stopPropagation()):i&&t.expandedKeys.has(e.key)?(t.toggleKey(e.key),n.stopPropagation()):!t.expandedKeys.has(e.key)&&e.parentKey!=null&&e.level>0&&(t.selectionManager.setFocusedKey(e.parentKey),n.stopPropagation()))},"aria-expanded":i?t.expandedKeys===`all`||t.expandedKeys.has(r.key):void 0,"aria-level":e.level+1,"aria-posinset":e.index-(c?0:t.collection.columnCount)+1,"aria-setsize":l.index-(c?0:t.collection.columnCount)+1},f={isDisabled:o.isDisabled,onPress:()=>{o.isDisabled||(t.toggleKey(r.key),t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(r.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...u}}}let p=No(r.props),m=o.hasAction?p:{};return{rowProps:{...U(a,d,m),"aria-labelledby":KR(t,r.key)},expandButtonProps:f,...o}}function zz(e,t){return`lastChildKey`in t?t.lastChildKey==null?null:e.getItem(t.lastChildKey):Array.from(t.childNodes).findLast(e=>e.parentKey===t.key)}function Bz(e,t,n){let{node:r,isVirtualized:i}=e,a={role:`row`};return i&&t.treeColumn==null&&(a[`aria-rowindex`]=r.index+1),{rowProps:a}}function Vz(e,t,n){let{gridCellProps:r,isPressed:i}=jz(e,t,n),a=e.node.column?.key;return a!=null&&t.collection.rowHeaderColumnKeys.has(a)&&(r.role=`rowheader`,r.id=GR(t,e.node.parentKey,a)),{gridCellProps:r,isPressed:i}}function Hz(e){return e&&e.__esModule?e.default:e}function Uz(e,t){let{key:n}=e,{checkboxProps:r}=pR(e,t);return{checkboxProps:{...r,"aria-labelledby":`${r.id} ${KR(t,n)}`}}}function Wz(e){let{isEmpty:t,isSelectAll:n,selectionMode:r}=e.selectionManager;return{checkboxProps:{"aria-label":rv(Hz(Dz),`@react-aria/table`).format(r===`single`?`select`:`selectAll`),isSelected:n,isDisabled:r!==`multiple`||e.collection.size===0||e.collection.rows.length===1&&e.collection.rows[0].type===`loader`,isIndeterminate:!t&&!n,onChange:()=>e.selectionManager.toggleSelectAll()}}}function Gz(e){return e&&e.__esModule?e.default:e}function Kz(e,t,n){let{column:r,triggerRef:i,isDisabled:a,onResizeStart:o,onResize:s,onResizeEnd:c,"aria-label":l}=e,u=rv(Gz(Dz),`@react-aria/table`),d=es(),f=t.resizingColumn===r.key,p=(0,v.useRef)(f),m=(0,v.useRef)(null),h=(0,v.useRef)(!1),g=t.tableState.isKeyboardNavigationDisabled,[_,y]=(0,v.useState)(!1),{direction:b}=rp(),x=(0,v.useCallback)(e=>{p.current||(m.current=t.updateResizedColumns(e.key,t.getColumnWidth(e.key)),t.startResize(e.key),t.tableState.setKeyboardNavigationDisabled(!0),o?.(m.current)),p.current=!0},[t,o]),S=(0,v.useCallback)((e,n)=>{let r=t.updateResizedColumns(e.key,n);s?.(r),m.current=r},[t,s]),C=(0,v.useCallback)(e=>{p.current&&(m.current??=t.updateResizedColumns(e.key,t.getColumnWidth(e.key)),t.endResize(),t.tableState.setKeyboardNavigationDisabled(!1),c?.(m.current),p.current=!1,i?.current&&!h.current&&sm(i.current)),m.current=null},[t,i,c]),w=()=>{if(g){C(r);return}return!1},{keyboardProps:T}=Sm({shortcuts:{Escape:()=>w(),Enter:()=>{g?C(r):x(r)}," ":()=>w(),Tab:()=>w()}}),E=(0,v.useRef)(0),{moveProps:D}=uT({onMoveStart(e){E.current=t.getColumnWidth(r.key),e.pointerType===`mouse`&&y(!0),x(r)},onMove(e){let{deltaX:t,deltaY:n,pointerType:i}=e;b===`rtl`&&(t*=-1),i===`keyboard`&&(n!==0&&t===0&&(t=n*-1),t*=10),t!==0&&(E.current+=t,S(r,E.current))},onMoveEnd(e){let{pointerType:t}=e;E.current=0,y(!1),(t===`mouse`||t===`touch`&&h.current)&&C(r)}}),O=(0,v.useCallback)(e=>{g&&D.onKeyDown?.(e)},[g,D]),k=Math.floor(t.getColumnMinWidth(r.key)),A=Math.floor(t.getColumnMaxWidth(r.key));A===1/0&&(A=2**53-1);let j=Math.floor(t.getColumnWidth(r.key)),M=rm();M===`virtual`&&typeof window<`u`&&`ontouchstart`in window&&(M=`touch`);let N=tc(i?.current==null&&(M===`keyboard`||M===`virtual`)&&!f?u.format(`resizerDescription`):void 0),P={"aria-label":l,"aria-orientation":`horizontal`,"aria-labelledby":`${d} ${WR(t.tableState,r.key)}`,"aria-valuetext":u.format(`columnSize`,{value:j}),type:`range`,min:k,max:A,value:j,...N},ee=(0,v.useCallback)(()=>{n.current&&sm(n.current)},[n]),F=t.resizingColumn,I=(0,v.useRef)(null),L=Rs(x);(0,v.useEffect)(()=>{if(I.current!==F&&F!=null&&F===r.key){h.current=ms()===n.current,L(r);let e=setTimeout(()=>ee(),0),t=setTimeout(ee,400);return()=>{clearTimeout(e),clearTimeout(t)}}I.current=F},[F,r,ee,n]);let te=e=>{let n=t.getColumnWidth(r.key),i=parseFloat(H(e).value);i=i>n?n+10:n-10,S(r,i)},{pressProps:R}=Rm({preventFocusOnPress:!0,onPressStart:e=>{if(!(e.ctrlKey||e.altKey||e.metaKey||e.shiftKey||e.pointerType===`keyboard`)){if(e.pointerType===`virtual`&&t.resizingColumn!=null){C(r);return}ee(),e.pointerType!==`virtual`&&x(r)}},onPress:e=>{(e.pointerType===`touch`&&h.current||e.pointerType===`mouse`)&&t.resizingColumn!=null&&C(r)}}),{visuallyHiddenProps:z}=av();return{resizerProps:U(T,{...D,onKeyDown:O},R,{style:{touchAction:`none`}}),inputProps:U(z,{id:d,onBlur:()=>{C(r)},onChange:te,disabled:a},P),isResizing:f,isMouseResizing:_}}function qz(){return{rowGroupProps:{role:`rowgroup`}}}function Jz(){return qz()}function Yz(e){return e&&e.__esModule?e.default:e}var Xz=class extends Ev{withExpandedKeys(e){let t=this.clone();return t.expandedKeys=e,t.frozen=this.frozen,t.rows=Array.from(t.getRows()),t}addNode(e){super.addNode(e),this.columnsDirty||=e.type===`column`,e.type===`tableheader`&&(this.head=e)}getRows(){let e=[];for(let t of this)(t.type===`tablebody`||t.type===`tablefooter`)&&e.push(...this.getChildren(t.key));return e}get body(){for(let e of this)if(e.type===`tablebody`)return e;return new _B(-2)}commit(e,t,n=!1){this.updateColumns(n),this.firstKey=e,this.lastKey=t,this.rows=[];for(let e of this.getRows()){let t=e.lastChildKey;if(t!=null){let e=this.getItem(t);for(;e&&e.type!==`cell`;)e=e.prevKey==null?null:this.getItem(e.prevKey);if(e){let t=(e.colIndex??e.index)+(e.colSpan??1);if(t!==this.columns.length&&!n)throw Error(`Cell count must match column count. Found ${t} cells and ${this.columns.length} columns.`)}}this.rows.push(e)}super.commit(e,t,n)}updateColumns(e){if(!this.columnsDirty)return;this.rowHeaderColumnKeys=new Set,this.columns=[];let t=new Map,n=e=>{e.type===`column`&&(t.set(e.key,e),e.hasChildNodes||(e.index=this.columns.length,this.columns.push(e),e.props.isRowHeader&&this.rowHeaderColumnKeys.add(e.key)));for(let t of this.getChildren(e.key))n(t)};for(let e of this.getChildren(this.head.key))n(e);if(this.headerRows=CR(t,this.columns),this.columnsDirty=!1,this.rowHeaderColumnKeys.size===0&&this.columns.length>0&&!e)throw Error(`A table must have at least one Column with the isRowHeader prop set to true`)}get columnCount(){return this.columns.length}*[Symbol.iterator](){let e=this.firstKey;for(;e!=null;){let t=this.getItem(e);t&&(yield t),e=t?.nextKey??null}}getFirstKey(){for(let e of this)if(e.type===`tablebody`)return e.firstChildKey??null;return null}getLastKey(){let e=this.lastKey;if(e==null)return null;let t=this.getItem(e);for(;t?.lastChildKey!=null&&(t.type!==`item`||this.expandedKeys.has(t.key));)t=this.getItem(t.lastChildKey);return t?.key}getKeyAfter(e){let t=this.getItem(e);if(t?.type===`column`)return t.nextKey??null;if(!t)return null;if(t.type===`item`&&t.firstChildKey!=null&&this.expandedKeys.has(t.key)){let e=this.getItem(t.firstChildKey);for(;e;){if(e.type===`item`)return e.key;e=e.nextKey==null?null:this.getItem(e.nextKey)}}return super.getKeyAfter(e)}getKeyBefore(e){let t=this.getItem(e);if(t?.type===`column`)return t.prevKey??null;if(!t)return null;let n=null;if(t.prevKey!=null){for(t=this.getItem(t.prevKey);t&&(t.type!==`item`||this.expandedKeys.has(t.key))&&t.lastChildKey!=null;)t=this.getItem(t.lastChildKey);n=t?.key??null}return n??=t.parentKey,n!=null&&this.getItem(n)?.type===`tableheader`?null:n}getChildren(e){let t=this.getItem(e);if(!t){for(let t of this.headerRows)if(t.key===e)return t.childNodes}let n=this;return t?.type===`tablebody`||t?.type===`tablefooter`?{*[Symbol.iterator](){let e=t.firstChildKey,r=e==null?null:n.getItem(e);for(;r;){yield r;let e=n.getKeyAfter(r.key);if(r=e==null?null:n.getItem(e),r&&r.parentKey===t.parentKey)break}}}:{*[Symbol.iterator](){let t=n.getItem(e),r=t?.firstChildKey==null?null:n.getItem(t.firstChildKey);for(;r&&(yield r,r=r.nextKey==null?null:n.getItem(r.nextKey),t?.type!==`item`||r?.type===`cell`););}}}clone(){let e=super.clone();return e.headerRows=this.headerRows,e.columns=this.columns,e.rows=this.rows,e.rowHeaderColumnKeys=this.rowHeaderColumnKeys,e.head=this.head,e}getTextValue(e){let t=this.getItem(e);if(!t)return``;if(t.textValue)return t.textValue;let n=this.rowHeaderColumnKeys,r=[];for(let t of this.getChildren(e)){let e=this.columns[t.index];if(n.has(e.key)&&t.textValue&&r.push(t.textValue),r.length===n.size)break}return r.join(` `)}constructor(...e){super(...e),this.headerRows=[],this.columns=[],this.rows=[],this.rowHeaderColumnKeys=new Set,this.head=new sB(-1),this.columnsDirty=!0,this.expandedKeys=new Set}},Zz=(0,v.createContext)(null),Qz=(0,v.forwardRef)(function(e,t){let n=Is(t),r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)(0);Io(()=>{let e=r.current;for(;e&&e!==n.current&&!Ws(e);)e=e.parentElement;i.current=e},[n]),Hs({ref:i,box:`border-box`,onResize(){o(i.current?.clientWidth??0)}}),Io(()=>{o(i.current?.clientWidth??0)},[]);let s=(0,v.useMemo)(()=>({tableRef:r,scrollRef:i,tableWidth:a,useTableColumnResizeState:NR,onResizeStart:e.onResizeStart,onResize:e.onResize,onResizeEnd:e.onResizeEnd}),[r,a,e.onResizeStart,e.onResize,e.onResizeEnd]);return v.createElement(q.div,{render:e.render,...W(e,{global:!0}),ref:n,className:e.className||`react-aria-ResizableTableContainer`,style:e.style,onScroll:e.onScroll},v.createElement(Zz.Provider,{value:s},e.children))}),$z=(0,v.createContext)(null),eB=(0,v.createContext)(null),tB=(0,v.createContext)(null),nB=(0,v.forwardRef)(function(e,t){[e,t]=Ff(e,t,$z);let n=Hx(e),{selectionBehavior:r,selectionMode:i,disallowEmptySelection:a}=n,o=!!e.dragAndDropHooks?.useDraggableCollectionState,s=(0,v.useMemo)(()=>({selectionBehavior:i===`none`?null:r,selectionMode:i,disallowEmptySelection:a,allowsDragging:o}),[r,i,a,o]),c=v.createElement(oB.Provider,{value:s},v.createElement(Xv,e));return v.createElement(Rv,{content:c,createCollection:()=>new Xz},r=>v.createElement(aB,{props:e,forwardedRef:t,selectionState:n,collection:r}))}),rB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.table,{...e,ref:t})}),iB={expand:{ltr:`ArrowRight`,rtl:`ArrowLeft`},collapse:{ltr:`ArrowLeft`,rtl:`ArrowRight`}};function aB({props:e,forwardedRef:t,selectionState:n,collection:r}){[e,t]=Ff(e,t,Jy);let{shouldUseVirtualFocus:i,disallowTypeAhead:a,filter:o,...s}=e,c=(0,v.useContext)(Zz);t=Is((0,v.useMemo)(()=>ys(t,c?.tableRef),[t,c?.tableRef]));let[l,u]=sh(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,e.onExpandedChange);r=(0,v.useMemo)(()=>r.withExpandedKeys(l),[r,l]);let d=IR({...s,collection:r,children:void 0,UNSAFE_selectionState:n,expandedKeys:l,onExpandedChange:u}),f=LR(d,o),{isVirtualized:p,layoutDelegate:m,dropTargetDelegate:h,CollectionRoot:g}=(0,v.useContext)(ny),{dragAndDropHooks:_}=e,{gridProps:y}=Az({...s,layoutDelegate:m,isVirtualized:p},f,t),b=f.selectionManager,x=!!_?.useDraggableCollectionState,S=!!_?.useDroppableCollectionState;(0,v.useRef)(x),(0,v.useRef)(S),(0,v.useEffect)(()=>{},[x,S]);let C,w,T,E=!1,D=null,O=(0,v.useRef)(null),{direction:k}=rp(),[A]=(0,v.useState)(()=>new yR);if(x&&_){C=_.useDraggableCollectionState({collection:f.collection,selectionManager:b,preview:_.renderDragPreview?O:void 0}),_.useDraggableCollection({},C,t);let e=_.DragPreview;D=_.renderDragPreview?v.createElement(e,{ref:O},_.renderDragPreview):null}if(S&&_){w=_.useDroppableCollectionState({collection:f.collection,selectionManager:b});let e=new sx({collection:f.collection,disabledKeys:b.disabledKeys,disabledBehavior:b.disabledBehavior,ref:t,layoutDelegate:m}),n=_.dropTargetDelegate||h||new _.ListDropTargetDelegate(r.rows,t);A.setup(n,d,k),T=_.useDroppableCollection({keyboardDelegate:e,dropTargetDelegate:A,onDropActivate:e=>{if(e.target.type===`item`){let t=e.target.key,n=d.collection.getItem(t),r=l.has(t);n&&n.hasChildNodes&&(!r||_?.isVirtualDragging?.())&&d.toggleKey(t)}},onKeyDown:e=>{let t=w?.target;if(t&&t.type===`item`&&t.dropPosition===`on`){let n=d.collection.getItem(t.key);(e.key===iB.expand[k]&&n?.hasChildNodes&&!d.expandedKeys.has(t.key)||e.key===iB.collapse[k]&&n?.hasChildNodes&&d.expandedKeys.has(t.key))&&d.toggleKey(t.key)}}},w,t),E=w.isDropTarget({type:`root`})}let{focusProps:j,isFocused:M,isFocusVisible:N}=Jm(),P=Mf({...e,children:void 0,defaultClassName:`react-aria-Table`,values:{isDropTarget:E,isFocused:M,isFocusVisible:N,state:f}}),ee=!!(x&&!C?.isDisabled),F=P.style,I=null;c&&(I=c.useTableColumnResizeState({tableWidth:c.tableWidth},f),p||(F={...F,tableLayout:`fixed`,width:`min-content`}));let L=W(e,{global:!0});return v.createElement(jf,{values:[[eB,f],[tB,I],[wC,{dragAndDropHooks:_,dragState:C,dropState:w}],[TC,{render:DB}],[Jy,null],[Yy,null]]},v.createElement(Sg,null,v.createElement(rB,{...U(L,P,y,j,T?.collectionProps),style:F,ref:t,slot:e.slot||void 0,onScroll:e.onScroll,"data-allows-dragging":ee||void 0,"data-drop-target":E||void 0,"data-focused":M||void 0,"data-focus-visible":N||void 0},v.createElement(eb,null,v.createElement(g,{collection:f.collection,scrollRef:c?.scrollRef??t,persistedKeys:OC(b,_,w)})))),D)}var oB=(0,v.createContext)(null),sB=class extends xv{static{this.type=`tableheader`}},cB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.thead,{...e,ref:t})}),lB=qv(sB,(e,t)=>{let n=(0,v.useContext)(eB).collection,r=jv({items:n.headerRows,children:(0,v.useCallback)(e=>{switch(e.type){case`headerrow`:return v.createElement(dB,{item:e});default:throw Error(`Unsupported node type in TableHeader: `+e.type)}},[])}),{rowGroupProps:i}=Jz(),{hoverProps:a,isHovered:o}=eh({onHoverStart:e.onHoverStart,onHoverChange:e.onHoverChange,onHoverEnd:e.onHoverEnd}),s=Mf({...e,children:void 0,defaultClassName:`react-aria-TableHeader`,values:{isHovered:o}});return v.createElement(cB,{...U(W(e,{global:!0}),i,a),...s,ref:t,"data-hovered":o||void 0},r)},e=>v.createElement(Xv,{dependencies:e.dependencies,items:e.columns},e.children)),uB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(`div`,{...e,ref:t}):v.createElement(`tr`,{...e,ref:t})});function dB({item:e}){let t=(0,v.useRef)(null),n=(0,v.useContext)(eB),{isVirtualized:r,CollectionBranch:i}=(0,v.useContext)(ny),{rowProps:a}=Bz({node:e,isVirtualized:r},n,t),{checkboxProps:o}=Wz(n);return v.createElement(uB,{...a,ref:t},v.createElement(jf,{values:[[Kw,{slots:{selection:o}}],[qw,{slots:{selection:o}}]]},v.createElement(i,{collection:n.collection,parent:e})))}var fB=class extends xv{static{this.type=`column`}},pB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.th,{...e,ref:t})}),mB=Kv(fB,(e,t,n)=>{let r=Is(t),i=(0,v.useContext)(eB),{isVirtualized:a}=(0,v.useContext)(ny),{columnHeaderProps:o,isPressed:s}=Pz({node:n,isVirtualized:a,focusMode:e.focusMode,allowsArrowNavigation:e.allowsArrowNavigation},i,r),{isFocused:c,isFocusVisible:l,focusProps:u}=Jm(),d=(0,v.useContext)(tB),f=!1;d&&(f=d.resizingColumn===n.key);let{hoverProps:p,isHovered:m}=eh({isDisabled:!e.allowsSorting}),h=Mf({...e,id:void 0,children:n.rendered,defaultClassName:`react-aria-Column`,values:{isHovered:m,isPressed:s,isFocused:c,isFocusVisible:l,allowsSorting:n.props.allowsSorting,sortDirection:i.sortDescriptor?.column===n.key?i.sortDescriptor.direction:void 0,isResizing:f,startResize:()=>{if(d)d.startResize(n.key),i.setKeyboardNavigationDisabled(!0);else throw Error(`Wrap your
in a to enable column resizing`)},sort:e=>{i.sort(n.key,e)}}}),g=h.style;d&&(g={...g,width:d.getColumnWidth(n.key)});let _=W(e,{global:!0});return delete _.id,v.createElement(pB,{...U(_,o,u,p),...h,style:g,ref:r,"data-hovered":m||void 0,"data-pressed":s||void 0,"data-focused":c||void 0,"data-focus-visible":l||void 0,"data-resizing":f||void 0,"data-allows-sorting":n.props.allowsSorting||void 0,"data-sort-direction":i.sortDescriptor?.column===n.key?i.sortDescriptor.direction:void 0},v.createElement(jf,{values:[[hB,{column:n,triggerRef:r}],[ny,$v]]},h.children))}),hB=(0,v.createContext)(null),gB=(0,v.forwardRef)(function(e,t){let n=(0,v.useContext)(tB);if(!n)throw Error(`Wrap your
in a to enable column resizing`);let r=rv(Yz(CC),`react-aria-components`),{onResizeStart:i,onResize:a,onResizeEnd:o}=(0,v.useContext)(Zz),{column:s,triggerRef:c}=(0,v.useContext)(hB),l=(0,v.useRef)(null),{resizerProps:u,inputProps:d,isResizing:f,isMouseResizing:p}=Kz({column:s,"aria-label":e[`aria-label`]||r.format(`tableResizer`),onResizeStart:i,onResize:a,onResizeEnd:o,triggerRef:c},n,l),{focusProps:m,isFocused:h,isFocusVisible:g}=Jm(),{hoverProps:_,isHovered:y}=eh(e),b=n.getColumnMinWidth(s.key)>=n.getColumnWidth(s.key),x=n.getColumnMaxWidth(s.key)<=n.getColumnWidth(s.key),{direction:S}=rp(),C=`both`;C=b?S===`rtl`?`right`:`left`:x?S===`rtl`?`left`:`right`:`both`;let w=Is(t),[T,E]=(0,v.useState)(``);(0,v.useEffect)(()=>{if(!w.current)return;let e=window.getComputedStyle(w.current);E(e.cursor)},[w,C]);let D=Mf({...e,defaultClassName:`react-aria-ColumnResizer`,values:{isFocused:h,isFocusVisible:g,isResizing:f,isHovered:y,resizableDirection:C}}),O=W(e,{global:!0});return v.createElement(q.div,{ref:w,role:`presentation`,...U(O,D,u,_),"data-hovered":y||void 0,"data-focused":h||void 0,"data-focus-visible":g||void 0,"data-resizing":f||void 0,"data-resizable-direction":C},D.children,v.createElement(`input`,{ref:l,...U(d,m)}),f&&p&&dc.createPortal(v.createElement(`div`,{style:{position:`fixed`,top:0,left:0,bottom:0,right:0,cursor:T},"data-testid":`cursor-overlay`}),document.body))}),_B=class extends Sv{static{this.type=`tablebody`}},vB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.tbody,{...e,ref:t})}),yB=qv(_B,(e,t,n)=>{let r=(0,v.useContext)(eB),{isVirtualized:i}=(0,v.useContext)(ny),a=r.collection,{CollectionBranch:o}=(0,v.useContext)(ny),{dragAndDropHooks:s,dropState:c}=(0,v.useContext)(wC),l=!!s?.useDroppableCollectionState&&!c?.isDisabled,u=l&&!!c&&(c.isDropTarget({type:`root`})??!1),d=a.size===0,f={isDropTarget:u,isEmpty:d},p=Mf({...e,id:void 0,children:void 0,defaultClassName:`react-aria-TableBody`,values:f}),m,h=a.columnCount;if(d&&e.renderEmptyState&&r){let t={},n={},r={};i?(n[`aria-colspan`]=h,r={display:`contents`}):n.colSpan=h,m=v.createElement(SB,{role:`row`,...t,style:r},v.createElement(TB,{role:`rowheader`,...n,style:r},e.renderEmptyState(f)))}let{rowGroupProps:g}=Jz(),_=W(e,{global:!0});return v.createElement(vB,{...U(_,p,g),ref:t,"data-empty":d||void 0},l&&v.createElement(MB,null),v.createElement(o,{collection:a,parent:n,renderDropIndicator:DC(s,c)}),m)});(class extends Sv{static{this.type=`tablefooter`}});var bB=(0,v.createContext)({isFocusVisibleWithinRow:!1}),xB=class extends xv{static{this.type=`item`}filter(e,t,n){let r=e.getChildren(this.key);for(let i of r)if(n(i.textValue,i)){let n=this.clone();return t.addDescendants(n,e),n}return null}},SB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.tr,{...e,ref:t})}),CB=qv(xB,(e,t,n)=>{let r=Is(t),i=(0,v.useContext)(eB),{dragAndDropHooks:a,dragState:o,dropState:s}=(0,v.useContext)(wC),{isVirtualized:c,CollectionBranch:l}=(0,v.useContext)(ny),u=o&&!(o.isDisabled||o.selectionManager.isDisabled(n.key)),{rowProps:d,expandButtonProps:f,...p}=Rz({node:n,shouldSelectOnPressUp:!!o,isVirtualized:c},i,r),{isFocused:m,isFocusVisible:h,focusProps:g}=Jm(),{isFocusVisible:_,focusProps:y}=Jm({within:!0}),{hoverProps:b,isHovered:x}=eh({isDisabled:!p.allowsSelection&&!p.hasAction&&!u,onHoverStart:e.onHoverStart,onHoverChange:e.onHoverChange,onHoverEnd:e.onHoverEnd}),{checkboxProps:S}=Uz({key:n.key},i),C;o&&a&&(C=a.useDraggableItem({key:n.key,hasDragButton:!0},o));let w,T=(0,v.useRef)(null),{visuallyHiddenProps:E}=av();s&&a&&(w=a.useDropIndicator({target:{type:`item`,key:n.key,dropPosition:`on`}},s,T));let D=(0,v.useRef)(null);(0,v.useEffect)(()=>{o&&D.current},[]);let O=o&&o.isDragging(n.key),{children:k,...A}=e,j=e.hasChildItems||i.collection.getItem(n.lastChildKey)?.type!==`cell`,M=j&&i.expandedKeys.has(n.key),N=Mf({...A,id:void 0,defaultClassName:`react-aria-Row`,defaultStyle:{"--table-row-level":n.level+1},values:{...p,state:i,isHovered:x,isFocused:m,isFocusVisible:h,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,isDragging:O,isDropTarget:w?.isDropTarget,isFocusVisibleWithin:_,id:n.key,hasChildItems:j,isExpanded:M,level:n.level+1}}),P=W(e,{global:!0});return delete P.id,delete P.onClick,v.createElement(v.Fragment,null,w&&!w.isHidden&&v.createElement(SB,{role:`row`,style:{height:0}},v.createElement(TB,{role:`gridcell`,colSpan:i.collection.columnCount,style:{padding:0}},v.createElement(`div`,{role:`button`,...E,...w.dropIndicatorProps,ref:T}))),v.createElement(SB,{...U(P,N,d,g,b,C?.dragProps,y),ref:r,"data-disabled":p.isDisabled||void 0,"data-selected":p.isSelected||void 0,"data-hovered":x||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":h||void 0,"data-pressed":p.isPressed||void 0,"data-dragging":O||void 0,"data-drop-target":w?.isDropTarget||void 0,"data-selection-mode":i.selectionManager.selectionMode===`none`?void 0:i.selectionManager.selectionMode,"data-focus-visible-within":_||void 0,"data-expanded":M||void 0,"data-has-child-items":j||void 0,"data-level":n.level+1},v.createElement(jf,{values:[[Kw,{slots:{[Af]:{},selection:S}}],[qw,{slots:{[Af]:{},selection:S}}],[th,{slots:{[Af]:{},chevron:f,drag:{...C?.dragButtonProps,ref:D,style:{pointerEvents:`none`}}}}],[nb,{isSelected:p.isSelected}],[bB,{isFocusVisibleWithinRow:_}]]},v.createElement(l,{collection:i.collection,parent:n}))))},e=>{if(e.id==null&&typeof e.children==`function`)throw Error(`No id detected for the Row element. The Row element requires a id to be provided to it when the cells are rendered dynamically.`);let t=[e.value].concat(e.dependencies);return v.createElement(Xv,{dependencies:t,items:e.columns,idScope:e.id},e.children)}),wB=class extends xv{static{this.type=`cell`}},TB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.td,{...e,ref:t})}),EB=Kv(wB,(e,t,n)=>{let r=Is(t),i=(0,v.useContext)(eB),{dragState:a}=(0,v.useContext)(wC),{isVirtualized:o}=(0,v.useContext)(ny);n.column=i.collection.columns[n.index];let{gridCellProps:s,isPressed:c}=Vz({node:n,shouldSelectOnPressUp:!!a,isVirtualized:o,focusMode:e.focusMode,allowsArrowNavigation:e.allowsArrowNavigation},i,r),{isFocused:l,isFocusVisible:u,focusProps:d}=Jm(),{hoverProps:f,isHovered:p}=eh({}),{isFocusVisibleWithinRow:m}=(0,v.useContext)(bB),h=n.parentKey!=null&&i.selectionManager.isSelected(n.parentKey),g=n.colIndex||n.index,_=i.collection.getItem(n.parentKey),y=_.props.hasChildItems||i.collection.getItem(_.lastChildKey)?.type!==`cell`,b=y&&i.expandedKeys.has(n.parentKey),x=i.selectionManager.isDisabled(n.parentKey),S=Mf({...e,id:void 0,defaultClassName:`react-aria-Cell`,values:{isFocused:l,isFocusVisible:u,isFocusVisibleWithinRow:m,isPressed:c,isHovered:p,isSelected:h,id:n.key,columnIndex:g,hasChildItems:y,isExpanded:b,isDisabled:x,level:_.level+1,isTreeColumn:n.column.key===i.treeColumn}}),C=W(e,{global:!0});return delete C.id,v.createElement(TB,{...U(C,S,s,d,f),ref:r,"data-focused":l||void 0,"data-focus-visible":u||void 0,"data-focus-visible-within-row":m||void 0,"data-pressed":c||void 0,"data-selected":h||void 0,"data-column-index":g,"data-expanded":b||void 0,"data-has-child-items":y||void 0,"data-level":_.level+1,"data-tree-column":n.column.key===i.treeColumn||void 0,"data-disabled":x||void 0},v.createElement(ny.Provider,{value:$v},S.children))});function DB(e,t){t=Is(t);let{dragAndDropHooks:n,dropState:r}=(0,v.useContext)(wC),i=(0,v.useRef)(null),{dropIndicatorProps:a,isHidden:o,isDropTarget:s}=n.useDropIndicator(e,r,i);if(o)return null;let c=r&&e.target.type===`item`?(r.collection.getItem(e.target.key)?.level||0)+1:1;return v.createElement(jB,{...e,dropIndicatorProps:a,isDropTarget:s,buttonRef:i,level:c,ref:t})}var OB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.tr,{...e,ref:t})}),kB=(0,v.forwardRef)(function(e,t){let{isVirtualized:n}=(0,v.useContext)(ny);return n?v.createElement(q.div,{...e,ref:t}):v.createElement(q.td,{...e,ref:t})});function AB(e,t){let{dropIndicatorProps:n,isDropTarget:r,buttonRef:i,level:a,...o}=e,s=(0,v.useContext)(eB),{visuallyHiddenProps:c}=av(),l=Mf({...o,defaultClassName:`react-aria-DropIndicator`,defaultStyle:{"--table-row-level":a+1},values:{isDropTarget:r}});return v.createElement(OB,{...W(e,{global:!0}),...l,role:`row`,ref:t,"data-drop-target":r||void 0,"aria-level":a},v.createElement(kB,{role:`gridcell`,colSpan:s.collection.columnCount,style:{padding:0}},v.createElement(`div`,{...c,role:`button`,...n,ref:i}),l.children))}var jB=(0,v.forwardRef)(AB);function MB(){let e=(0,v.useContext)(eB),{dragAndDropHooks:t,dropState:n}=(0,v.useContext)(wC),r=(0,v.useRef)(null),{dropIndicatorProps:i}=t.useDropIndicator({target:{type:`root`}},n,r),a=n.isDropTarget({type:`root`}),{visuallyHiddenProps:o}=av();return!a&&i[`aria-hidden`]?null:v.createElement(SB,{role:`row`,"aria-hidden":i[`aria-hidden`],style:{height:0}},v.createElement(TB,{role:`gridcell`,colSpan:e.collection.columnCount,style:{padding:0}},v.createElement(`div`,{role:`button`,...o,...i,ref:r})))}var NB=Kv(Cv,function(e,t,n){let r=(0,v.useContext)(eB),{isVirtualized:i}=(0,v.useContext)(ny),{isLoading:a,onLoadMore:o,scrollOffset:s,...c}=e,l=r.collection.columns.length,u=(0,v.useRef)(null);lc((0,v.useMemo)(()=>({onLoadMore:o,collection:r?.collection,sentinelRef:u,scrollOffset:s}),[o,s,r?.collection]),u);let d=Mf({...c,id:void 0,children:n.rendered,defaultClassName:`react-aria-TableLoadingIndicator`,defaultStyle:{"--table-row-level":n.level+1},values:void 0}),f={},p={},m={};return i?(p[`aria-colspan`]=l,m={display:`contents`}):p.colSpan=l,v.createElement(v.Fragment,null,v.createElement(SB,{style:{height:0},inert:uc(!0)},v.createElement(TB,{style:{padding:0,border:0}},v.createElement(`div`,{"data-testid":`loadMoreSentinel`,ref:u,style:{position:`relative`,height:1,width:1}}))),a&&d.children&&v.createElement(SB,{...U(W(e,{global:!0}),f),...d,role:`row`,ref:t,"aria-level":n.level+1,"data-level":n.level+1},v.createElement(TB,{role:`rowheader`,...p,style:m},d.children)))}),PB=({...e})=>(0,G.jsx)(HS,{...e}),FB=Object.assign(PB,{Root:PB}),IB=(0,v.createContext)({}),LB=({children:e,className:t,status:n,...r})=>{let i=v.useMemo(()=>zd({status:n}),[n]);return(0,G.jsx)(IB,{value:{slots:i,status:n},children:(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(K.div,{className:i?.base({className:t}),"data-slot":`alert-root`,...r,children:e})})})},RB=Object.assign(LB,{Root:LB,Indicator:({children:e,className:t,...n})=>{let{slots:r,status:i}=(0,v.use)(IB),a=()=>{switch(i){case`accent`:return(0,G.jsx)(Th,{"data-slot":`alert-default-icon`});case`success`:return(0,G.jsx)(Oh,{"data-slot":`alert-default-icon`});case`warning`:return(0,G.jsx)(Eh,{"data-slot":`alert-default-icon`});case`danger`:return(0,G.jsx)(Dh,{"data-slot":`alert-default-icon`});default:return(0,G.jsx)(Th,{"data-slot":`alert-default-icon`})}};return(0,G.jsx)(K.div,{className:Y(r?.indicator,t),"data-slot":`alert-indicator`,...n,children:e??a()})},Content:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(IB);return(0,G.jsx)(K.div,{className:Y(r?.content,t),"data-slot":`alert-content`,...n,children:e})},Title:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(IB);return(0,G.jsx)(K.p,{className:Y(r?.title,t),"data-slot":`alert-title`,...n,children:e})},Description:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(IB);return(0,G.jsx)(K.span,{className:Y(r?.description,t),"data-slot":`alert-description`,...n,children:e})}}),zB=(0,v.createContext)({}),BB=({children:e,className:t,variant:n,...r})=>{let i=v.useMemo(()=>sf({variant:n}),[n]);return(0,G.jsx)(KC,{className:J(t,i.item()),"data-slot":`list-box-item`,...r,children:t=>(0,G.jsx)(zB,{value:{slots:i,state:t},children:typeof e==`function`?e(t):e})})},VB=({children:e,className:t,...n})=>{let{slots:r,state:i}=(0,v.use)(zB),a=i?.isSelected,o=typeof e==`function`?e(i??{}):e||(0,G.jsx)(`svg`,{"aria-hidden":`true`,"data-slot":`list-box-item-indicator--checkmark`,fill:`none`,role:`presentation`,stroke:`currentColor`,strokeDasharray:22,strokeDashoffset:a?44:66,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 17 18`,children:(0,G.jsx)(`polyline`,{points:`1 9 7 14 15 4`})});return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(r?.indicator,t),"data-slot":`list-box-item-indicator`,"data-visible":a||void 0,...n,children:o})},HB=Object.assign(BB,{Root:BB,Indicator:VB}),UB=({children:e,className:t,...n})=>{let r=v.useMemo(()=>cf({class:typeof t==`string`?t:void 0}),[t]);return(0,G.jsx)(GC,{className:r,...n,children:e})};function WB({className:e,variant:t,...n}){let r=v.useMemo(()=>of({variant:t}),[t]);return(0,G.jsx)(VC,{className:J(e,r),"data-slot":`list-box`,...n})}var GB=Object.assign(WB,{Root:WB,Item:HB,ItemIndicator:VB,Section:UB}),KB=(0,v.createContext)({}),qB=({children:e,className:t,variant:n,...r})=>{let i=v.useMemo(()=>uf({variant:n}),[n]);return(0,G.jsx)(aS,{className:J(t,i.item()),"data-slot":`menu-item`,...r,children:t=>(0,G.jsx)(KB,{value:{slots:i,state:t},children:typeof e==`function`?e(t):e})})},JB=({children:e,className:t,type:n=`checkmark`,...r})=>{let{slots:i,state:a}=(0,v.use)(KB),o=a?.isSelected,s=typeof e==`function`?e(a??{}):e||(n===`dot`?(0,G.jsx)(`svg`,{"aria-hidden":`true`,"data-slot":`menu-item-indicator--dot`,fill:`currentColor`,fillRule:`evenodd`,role:`presentation`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{clipRule:`evenodd`,d:`M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14`,fillRule:`evenodd`})}):(0,G.jsx)(`svg`,{"aria-hidden":`true`,"data-slot":`menu-item-indicator--checkmark`,fill:`none`,role:`presentation`,stroke:`currentColor`,strokeDasharray:22,strokeDashoffset:o?44:66,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 17 18`,children:(0,G.jsx)(`polyline`,{points:`1 9 7 14 15 4`})}));return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(i?.indicator,t),"data-slot":`menu-item-indicator`,"data-type":n,"data-visible":o||void 0,...r,children:s})},YB=({children:e,className:t,...n})=>{let{slots:r,state:i}=(0,v.use)(KB);if(!i?.hasSubmenu)return null;let a=e??(0,G.jsx)(Ch,{});return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(r?.submenuIndicator,t),"data-slot":`submenu-indicator`,...n,children:a})},XB=({children:e,className:t,...n})=>{let r=v.useMemo(()=>df({class:typeof t==`string`?t:void 0}),[t]);return(0,G.jsx)(rS,{className:r,...n,children:e})},ZB=(0,v.createContext)({}),QB=({children:e,...t})=>{let n=v.useMemo(()=>ef(),[]);return(0,G.jsx)(ZB,{value:{slots:n},children:(0,G.jsx)(Xx,{...t,children:e})})},$B=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(ZB);return(0,G.jsx)(nh,{className:J(t,r?.trigger()),"data-slot":`dropdown-trigger`,...n,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})},eV=({children:e,className:t,placement:n,...r})=>{let{slots:i}=(0,v.use)(ZB);return(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(yv,{...r,className:J(t,i?.popover()),"data-slot":`dropdown-popover`,placement:n,children:e})})};function tV({className:e,...t}){let{slots:n}=(0,v.use)(ZB);return(0,G.jsx)($x,{className:J(e,n?.menu()),"data-selection-mode":t.selectionMode,"data-slot":`dropdown-menu`,...t})}var nV=Object.assign(QB,{Root:QB,Trigger:$B,Popover:eV,Menu:tV,Section:e=>(0,G.jsx)(XB,{...e}),Item:e=>(0,G.jsx)(qB,{...e}),ItemIndicator:e=>(0,G.jsx)(JB,{...e}),SubmenuIndicator:e=>(0,G.jsx)(YB,{...e}),SubmenuTrigger:({children:e,...t})=>(0,G.jsx)(Qx,{"data-slot":`dropdown-submenu-trigger`,...t,children:e})}),rV=(0,v.createContext)({}),iV=({children:e,state:t,...n})=>{let r=(0,v.useMemo)(()=>({slots:ff(),placement:void 0}),[]),i=(0,v.useMemo)(()=>t?{isOpen:t.isOpen,onOpenChange:t.setOpen}:{},[t]);return(0,G.jsx)(rV,{value:r,children:(0,G.jsx)(lS,{"data-slot":`modal-root`,...U(n,i),children:e})})},Z=Object.assign(iV,{Root:iV,Trigger:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(yS,{children:(0,G.jsx)(K.div,{className:Y(r?.trigger,t),"data-slot":`modal-trigger`,role:`button`,...n,children:e})})},Backdrop:({children:e,className:t,isDismissable:n=!0,onClick:r,variant:i,...a})=>{let{slots:o}=(0,v.use)(rV),s=(0,v.useMemo)(()=>ff({variant:i}),[i]),c=(0,v.useMemo)(()=>({slots:{...o,...s}}),[o,s]);return(0,G.jsx)(gS,{className:J(t,s?.backdrop()),"data-slot":`modal-backdrop`,isDismissable:n,onClick:e=>{e.stopPropagation(),r?.(e)},...a,children:t=>(0,G.jsxs)(rV,{value:c,children:[typeof e==`function`?e(t):e,` `]})})},Container:({children:e,className:t,placement:n=`auto`,scroll:r,size:i,...a})=>{let{slots:o}=(0,v.use)(rV),s=(0,v.useMemo)(()=>ff({scroll:r,size:i}),[r,i]),c=(0,v.useMemo)(()=>({placement:n,slots:{...o,...s}}),[o,n,s]);return(0,G.jsx)(mS,{className:J(t,s?.container()),"data-placement":n,"data-slot":`modal-container`,...a,children:t=>(0,G.jsx)(rV,{value:c,children:typeof e==`function`?e(t):e})})},Dialog:({children:e,className:t,...n})=>{let{placement:r,slots:i}=(0,v.use)(rV);return(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(uS,{className:Y(i?.dialog,t),"data-placement":r,"data-slot":`modal-dialog`,...n,children:e})})},Header:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(K.div,{className:Y(r?.header,t),"data-slot":`modal-header`,...n,children:e})},Icon:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(K.div,{className:Y(r?.icon,t),"data-slot":`modal-icon`,...n,children:e})},Heading:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(vh,{className:Y(r?.heading,t),"data-slot":`modal-heading`,slot:`title`,...n,children:e})},Body:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(K.div,{className:Y(r?.body,t),"data-slot":`modal-body`,...n,children:e})},Footer:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(rV);return(0,G.jsx)(K.div,{className:Y(r?.footer,t),"data-slot":`modal-footer`,...n,children:e})},CloseTrigger:({className:e,...t})=>{let{slots:n}=(0,v.use)(rV);return(0,G.jsx)(xS,{className:J(e,n?.closeTrigger()),"data-slot":`modal-close-trigger`,slot:`close`,...t})}}),aV=(0,v.createContext)({}),oV=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=v.useMemo(()=>pf({fullWidth:n,variant:r}),[n,r]);return(0,G.jsx)(aV,{value:{slots:a},children:(0,G.jsx)(gR,{"data-slot":`number-field`,...i,className:J(t,a?.base()),children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})},sV=Object.assign(oV,{Root:oV,Group:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aV);return(0,G.jsx)(DS,{className:J(t,r?.group()),"data-slot":`number-field-group`,...n,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})},Input:({className:e,...t})=>{let{slots:n}=(0,v.use)(aV);return(0,G.jsx)(pT,{className:J(e,n?.input()),"data-slot":`number-field-input`,...t})},IncrementButton:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aV);return(0,G.jsx)(nh,{className:J(t,r?.incrementButton()),"data-slot":`number-field-increment-button`,slot:`increment`,...n,children:e&&v.isValidElement(e)?e:(0,G.jsx)(Ah,{"data-slot":`number-field-increment-button-icon`})})},DecrementButton:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(aV);return(0,G.jsx)(nh,{className:J(t,r?.decrementButton()),"data-slot":`number-field-decrement-button`,slot:`decrement`,...n,children:e&&v.isValidElement(e)?e:(0,G.jsx)(kh,{"data-slot":`number-field-decrement-button-icon`})})}}),cV=(0,v.createContext)({}),lV=({children:e,className:t,size:n,...r})=>{let i=v.useMemo(()=>mf({size:n}),[n]);return(0,G.jsx)(cV,{value:{slots:i},children:(0,G.jsx)(K.nav,{"aria-label":`pagination`,"data-slot":`pagination`,role:`navigation`,...r,className:Y(i.base,t),children:e})})};lV.displayName=`HeroUI.Pagination`;var uV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(cV);return(0,G.jsx)(K.div,{className:Y(r?.summary,t),"data-slot":`pagination-summary`,dir:`auto`,...n,children:e})};uV.displayName=`HeroUI.Pagination.Summary`;var dV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(cV);return(0,G.jsx)(K.ul,{className:Y(r?.content,t),"data-slot":`pagination-content`,...n,children:e})};dV.displayName=`HeroUI.Pagination.Content`;var fV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(cV);return(0,G.jsx)(K.li,{className:Y(r?.item,t),"data-slot":`pagination-item`,...n,children:e})};fV.displayName=`HeroUI.Pagination.Item`;var pV=({children:e,className:t,isActive:n,...r})=>{let{slots:i}=(0,v.use)(cV);return(0,G.jsx)(nh,{"aria-current":n?`page`:void 0,className:J(t,i?.link()),"data-active":n?`true`:void 0,"data-slot":`pagination-link`,...r,children:e})};pV.displayName=`HeroUI.Pagination.Link`;var mV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(cV),i=`${r?.link()??``} pagination__link--nav`.trim();return(0,G.jsx)(nh,{className:J(t,i),"data-slot":`pagination-previous`,...n,children:e})};mV.displayName=`HeroUI.Pagination.Previous`;var hV=({children:e,className:t,...n})=>(0,G.jsx)(K.span,{"aria-hidden":`true`,className:t,"data-slot":`pagination-previous-icon`,...n,children:e??(0,G.jsx)(Sh,{})});hV.displayName=`HeroUI.Pagination.PreviousIcon`;var gV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(cV),i=`${r?.link()??``} pagination__link--nav`.trim();return(0,G.jsx)(nh,{className:J(t,i),"data-slot":`pagination-next`,...n,children:e})};gV.displayName=`HeroUI.Pagination.Next`;var _V=({children:e,className:t,...n})=>(0,G.jsx)(K.span,{"aria-hidden":`true`,className:t,"data-slot":`pagination-next-icon`,...n,children:e??(0,G.jsx)(Ch,{})});_V.displayName=`HeroUI.Pagination.NextIcon`;var vV=({className:e,...t})=>{let{slots:n}=(0,v.use)(cV);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(n?.ellipsis,e),"data-slot":`pagination-ellipsis`,...t,children:`…`})};vV.displayName=`HeroUI.Pagination.Ellipsis`;var yV=Object.assign(lV,{Content:dV,Ellipsis:vV,Item:fV,Link:pV,Next:gV,NextIcon:_V,Previous:mV,PreviousIcon:hV,Root:lV,Summary:uV}),bV=(0,v.createContext)({}),xV=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=v.useMemo(()=>_f({fullWidth:n,variant:r}),[n,r]);return(0,G.jsx)(vw,{children:(0,G.jsx)(bV,{value:{slots:a},children:(0,G.jsx)(dw,{"data-slot":`select`,...i,className:J(t,a?.base()),children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})})})},SV=Object.assign(xV,{Root:xV,Trigger:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bV);return(0,G.jsx)(nh,{className:J(t,r?.trigger()),"data-slot":`select-trigger`,...n,children:t=>(0,G.jsx)(G.Fragment,{children:typeof e==`function`?e(t):e})})},Value:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bV);return(0,G.jsx)(hw,{className:J(t,r?.value()),"data-slot":`select-value`,...n,children:e})},Indicator:({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(bV),i=(0,v.use)(uw);return e&&v.isValidElement(e)?v.cloneElement(e,{...n,className:Y(r?.indicator,t),"data-slot":`select-indicator`,"data-open":yh(i?.isOpen)}):(0,G.jsx)(bh,{className:Y(r?.indicator,t),"data-open":yh(i?.isOpen),"data-slot":`select-default-indicator`,...n})},Popover:({children:e,className:t,placement:n=`bottom`,...r})=>{let{slots:i}=(0,v.use)(bV);return(0,G.jsx)(Nh,{value:{variant:`default`},children:(0,G.jsx)(yv,{...r,className:J(t,i?.popover()),"data-slot":`select-popover`,placement:n,children:e})})}}),CV=(0,v.createContext)({}),wV=({children:e,className:t,color:n,size:r,...i})=>{let a=v.useMemo(()=>lf({color:n,size:r}),[n,r]);return(0,G.jsx)(FP,{"data-slot":`meter`,...i,className:J(t,a.base()),children:t=>(0,G.jsx)(CV,{value:{slots:a,state:t},children:typeof e==`function`?e(t):e})})};wV.displayName=`HeroUI.Meter`;var TV=({children:e,className:t,...n})=>{let{slots:r,state:i}=(0,v.use)(CV);return(0,G.jsx)(K.span,{className:Y(r?.output,t),"data-slot":`meter-output`,...n,children:e??i?.valueText})};TV.displayName=`HeroUI.Meter.Output`;var EV=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(CV);return(0,G.jsx)(K.div,{className:Y(r?.track,t),"data-slot":`meter-track`,...n,children:e})};EV.displayName=`HeroUI.Meter.Track`;var DV=({className:e,style:t,...n})=>{let{slots:r,state:i}=(0,v.use)(CV);return(0,G.jsx)(K.div,{className:Y(r?.fill,e),"data-slot":`meter-fill`,style:{...t,width:`${i?.percentage??0}%`},...n})};DV.displayName=`HeroUI.Meter.Fill`;var OV=Object.assign(wV,{Root:wV,Output:TV,Track:EV,Fill:DV}),kV=(0,v.createContext)({}),AV=({children:e,className:t,variant:n,...r})=>{let i=v.useMemo(()=>xf({variant:n}),[n]);return(0,G.jsx)(kV,{value:{slots:i},children:(0,G.jsx)(K.div,{className:i.base({className:t}),"data-slot":`table`,...r,children:e})})};AV.displayName=`HeroUI.Table`;var jV=({className:e,...t})=>{let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(K.div,{className:Y(n?.scrollContainer,e),"data-slot":`table-scroll-container`,...t})};jV.displayName=`HeroUI.Table.ScrollContainer`;function MV({className:e,...t}){let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(nB,{className:J(e,n?.content()),"data-slot":`table-content`,...t})}MV.displayName=`HeroUI.Table.Content`;function NV({className:e,...t}){let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(lB,{className:J(e,n?.header()),"data-slot":`table-header`,...t})}NV.displayName=`HeroUI.Table.Header`;var PV=({className:e,ref:t,...n})=>{let{slots:r}=(0,v.use)(kV);return(0,G.jsx)(mB,{ref:t,className:J(e,r?.column()),"data-slot":`table-column`,...n})};PV.displayName=`HeroUI.Table.Column`;function FV({className:e,...t}){let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(yB,{className:J(e,n?.body()),"data-slot":`table-body`,...t})}FV.displayName=`HeroUI.Table.Body`;function IV({className:e,...t}){let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(CB,{className:J(e,n?.row()),"data-slot":`table-row`,...t})}IV.displayName=`HeroUI.Table.Row`;var LV=({className:e,ref:t,...n})=>{let{slots:r}=(0,v.use)(kV);return(0,G.jsx)(EB,{ref:t,className:J(e,r?.cell()),"data-slot":`table-cell`,...n})};LV.displayName=`HeroUI.Table.Cell`;var RV=({className:e,...t})=>{let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(K.div,{className:Y(n?.footer,e),"data-slot":`table-footer`,...t})};RV.displayName=`HeroUI.Table.Footer`;var zV=({className:e,ref:t,...n})=>(0,G.jsx)(Qz,{ref:t,className:Ld(`table__resizable-container`,e),"data-slot":`table-resizable-container`,...n});zV.displayName=`HeroUI.Table.ResizableContainer`;var BV=({className:e,ref:t,...n})=>{let{slots:r}=(0,v.use)(kV);return(0,G.jsx)(gB,{ref:t,className:J(e,r?.columnResizer()),"data-slot":`table-column-resizer`,...n})};BV.displayName=`HeroUI.Table.ColumnResizer`;var VV=({className:e,ref:t,...n})=>{let{slots:r}=(0,v.use)(kV);return(0,G.jsx)(NB,{ref:t,className:Y(r?.loadMore,e),"data-slot":`table-load-more`,...n})};VV.displayName=`HeroUI.Table.LoadMore`;var HV=({className:e,...t})=>{let{slots:n}=(0,v.use)(kV);return(0,G.jsx)(K.div,{className:Y(n?.loadMoreContent,e),"data-slot":`table-load-more-content`,...t})};HV.displayName=`HeroUI.Table.LoadMoreContent`;var UV=({children:e,className:t,indicator:n,ref:r,showIndicator:i=!0,sortDirection:a,...o})=>{let{slots:s}=(0,v.use)(kV),c=i&&!!a,l=null;if(c){if(n===void 0)l=(0,G.jsx)(xh,{className:s?.sortableColumnIndicator(),"data-direction":a,"data-slot":`table-sortable-column-indicator`});else if(v.isValidElement(n)){let e=n;l=v.cloneElement(e,{className:Y(s?.sortableColumnIndicator,e.props.className),"data-direction":a,"data-slot":`table-sortable-column-indicator`})}else l=n}return(0,G.jsxs)(`span`,{ref:r,className:Y(s?.sortableColumnHeader,t),"data-direction":a,"data-slot":`table-sortable-column-header`,...o,children:[e,l]})};UV.displayName=`HeroUI.Table.SortableColumnHeader`;var Q=Object.assign(AV,{Body:FV,Cell:LV,Collection:Xv,Column:PV,ColumnResizer:BV,Content:MV,Footer:RV,Header:NV,LoadMore:VV,LoadMoreContent:HV,ResizableContainer:zV,Root:AV,Row:IV,ScrollContainer:jV,SortableColumnHeader:UV}),WV=(0,v.createContext)(null);function GV(){let e=(0,v.use)(WV);if(!e)throw Error(`useYearPicker must be used within a or component.`);return e}function KV(){let e=(0,v.use)(HN),t=(0,v.use)(UN),n=e??t;if(!n)throw Error(`useCalendarOrRangeState must be used within a or component.`);return n}function qV(e){switch(e){case`buddhist`:return 543;case`ethiopic`:case`ethioaa`:return-8;case`coptic`:return-284;case`hebrew`:return 3760;case`indian`:return-78;case`islamic-civil`:case`islamic-tbla`:case`islamic-umalqura`:return-579;case`persian`:return-600;default:return 0}}function JV(e,t){let n=[];if(!e||!t)return n;let r=ED(e);for(;r.compare(t)<=0;)n.push(r),r=ED(r.add({years:1}));return n}function YV(e,t,n,r=`short`,i=`UTC`){let a=new Intl.DateTimeFormat(t,{weekday:r,timeZone:i}),o=DD(e,t,n),s=[],c=o;for(let e=0;e<7;e++){s.push(a.format(c.toDate(i)));let e=c.add({days:1});if(sD(c,e))break;c=e}for(;s.length<7;)s.push(``);return s}function XV(e,t){let n=[],r=e;for(let e=0;e<7;e++){n.push(r.compare(t)>0?null:r);let e=r.add({days:1});if(sD(r,e)){for(;n.length<7;)n.push(null);return n}r=e}return n}function ZV(e,t,n,r){let i=[],a=DD(e,n,r);for(i.push(XV(a,t)),a=a.add({weeks:1});a.compare(t)<=0;){i.push(XV(a,t));let e=a.add({weeks:1});if(sD(a,e))break;a=e}return i}var QV=v.createContext(null);function $V(){let e=v.use(QV);if(!e)throw Error(`CalendarYearPicker trigger components must be used within .`);return e}var eH=({children:e,className:t,onKeyDown:n,onPress:r,...i})=>{let{isYearPickerOpen:a,setIsYearPickerOpen:o}=GV(),s=wN({},KV()),c=v.useMemo(()=>Ud(),[]),l=v.useCallback(()=>{o(!a)},[a,o]),u=e=>{n?.(e),!e.defaultPrevented&&e.key===`Escape`&&a&&(e.preventDefault(),o(!1))},d=v.useMemo(()=>({isOpen:a,monthYear:s,toggle:l}),[l,a,s]),f=v.useMemo(()=>({...d,slots:c}),[c,d]);return(0,G.jsx)(QV,{value:f,children:(0,G.jsx)(nh,{"aria-expanded":a,"aria-label":`${s}, year selector`,className:J(t,c.trigger()),"data-open":a||void 0,"data-slot":`calendar-year-picker-trigger`,slot:null,onKeyDown:u,onPress:e=>{r?.(e),l()},...i,children:typeof e==`function`?e(d):e})})};eH.displayName=`HeroUI.CalendarYearPicker.Trigger`;var tH=({children:e,className:t,format:n,offset:r,...i})=>{let{monthYear:a,slots:o,...s}=$V(),c=KV(),l=wN({format:n,offset:r},c);return(0,G.jsx)(K.span,{className:Y(o.triggerHeading,t),"data-slot":`calendar-year-picker-trigger-heading`,...i,children:typeof e==`function`?e({monthYear:a,...s}):e||l})};tH.displayName=`HeroUI.CalendarYearPicker.TriggerHeading`;var nH=({children:e,className:t,...n})=>{let{monthYear:r,slots:i,...a}=$V();return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(i.triggerIndicator,t),"data-slot":`calendar-year-picker-trigger-indicator`,...n,children:typeof e==`function`?e({monthYear:r,...a}):e||(0,G.jsx)(Ch,{height:`1em`,width:`1em`})})};nH.displayName=`HeroUI.CalendarYearPicker.TriggerIndicator`;var rH=v.createContext(null);function iH(){let e=v.use(rH);if(!e)throw Error(`CalendarYearPicker components must be used within .`);return e}var aH=({children:e,className:t,format:n,onKeyDown:r,visibleYears:i,...a})=>{let{calendarGridSlot:o,calendarRef:s,isYearPickerOpen:c,setIsYearPickerOpen:l}=GV(),u=KV(),d=v.useRef(null),f=v.useMemo(()=>Ud(),[]),{"aria-label":p,items:m,onChange:h,value:g}=CN({format:n,visibleYears:v.useMemo(()=>i??(!u.minValue||!u.maxValue?20:JV(u.minValue,u.maxValue).length),[u.maxValue,u.minValue,i])},u),_=m.map(e=>`${e.id}:${e.date.year}`).join(`|`),y=m.map(e=>e.date.year),b=new Map(m.map(e=>[e.date.year,e])),x=m[g]?.date.year??u.focusedDate.year,S=v.useCallback(e=>b.get(e)?.formatted??String(e),[b]),[C,w]=v.useState(x),T=v.useRef(!1);v.useEffect(()=>{let e=d.current;if(!e)return;let t=s.current?.querySelector(`[data-slot='${o}']`);t&&(e.style.top=`${t.offsetTop}px`,e.style.height=`${t.offsetHeight}px`)},[o,s,u.focusedDate]);let E=v.useCallback(e=>{let t=d.current;if(!t)return;let n=t.querySelector(`[data-year='${e}']`);n&&n.focus()},[]);v.useEffect(()=>{let e=c&&!T.current;if(T.current=c,!e||y.length===0)return;let[t]=y;if(t==null)return;let n=y.includes(x)?x:t;w(n);let r=requestAnimationFrame(()=>{E(n)});return()=>{cancelAnimationFrame(r)}},[E,x,c,_,y.length]),v.useEffect(()=>{if(!c||y.length===0)return;let[e]=y;e!=null&&(y.includes(C)||w(e))},[C,c,_,y]);let D=v.useCallback(e=>{let t=b.get(e);t!=null&&(l(!1),h(t.id))},[b,h,l]),O=e=>{if(r?.(e),e.defaultPrevented)return;if(e.key===`Escape`&&c){e.preventDefault(),l(!1);return}if(!c||y.length===0)return;let t=y.indexOf(C);if(t===-1)return;let n=t;switch(e.key){case`ArrowRight`:n=Math.min(t+1,y.length-1);break;case`ArrowLeft`:n=Math.max(t-1,0);break;case`ArrowDown`:n=Math.min(t+3,y.length-1);break;case`ArrowUp`:n=Math.max(t-3,0);break;case`Home`:n=0;break;case`End`:n=y.length-1;break;default:return}if(n!==t){let t=y[n];if(t==null)return;e.preventDefault(),w(t),E(t)}},k=v.useMemo(()=>({activeYear:C,focusedYear:x,getFormattedYear:S,isYearPickerOpen:c,selectYear:D,setActiveYear:w,slots:f,years:y}),[C,x,S,D,c,f,y]);return(0,G.jsx)(rH,{value:k,children:(0,G.jsx)(K.div,{ref:d,"aria-hidden":!c,"aria-label":p,className:Y(f.yearGrid,t),"data-open":c||void 0,"data-slot":`calendar-year-picker-grid`,role:`listbox`,tabIndex:-1,onKeyDown:O,...a,children:e})})};aH.displayName=`HeroUI.CalendarYearPicker.Grid`;var oH=({children:e})=>{let{focusedYear:t,getFormattedYear:n,isYearPickerOpen:r,selectYear:i,years:a}=iH(),o=new Date().getFullYear();return(0,G.jsx)(G.Fragment,{children:a.map(a=>{let s=a===t,c={formattedYear:n(a),isCurrentYear:a===o,isOpen:r,isSelected:s,selectYear:()=>i(a),year:a};return(0,G.jsx)(v.Fragment,{children:typeof e==`function`?e(c):(0,G.jsx)(sH,{year:a})},a)})})};oH.displayName=`HeroUI.CalendarYearPicker.GridBody`;var sH=({children:e,className:t,excludeFromTabOrder:n,onFocus:r,onPress:i,year:a,...o})=>{let{activeYear:s,focusedYear:c,getFormattedYear:l,isYearPickerOpen:u,selectYear:d,setActiveYear:f,slots:p}=iH(),m=a===c,h=a===s,g=l(a),_={formattedYear:g,isCurrentYear:a===new Date().getFullYear(),isOpen:u,isSelected:m,selectYear:()=>d(a),year:a};return(0,G.jsx)(nh,{"aria-label":g,"aria-selected":m,className:J(t,p.yearCell()),"data-selected":m||void 0,"data-slot":`calendar-year-picker-year-cell`,"data-year":a,excludeFromTabOrder:n??!(u&&h),slot:null,onFocus:e=>{r?.(e),f(a)},onPress:e=>{i?.(e),d(a)},...o,children:typeof e==`function`?e(_):e||g})};sH.displayName=`HeroUI.CalendarYearPicker.Cell`;function cH({children:e,className:t,"data-slot":n=`calendar-grid-body`,firstDayOfWeek:r,visibleRange:i}){let{locale:a}=rp(),o=v.useMemo(()=>ZV(i.start,i.end,a,r),[r,a,i.end,i.start]);return(0,G.jsx)(K.tbody,{className:t,"data-slot":n,children:o.map((t,n)=>(0,G.jsx)(`tr`,{children:t.map((t,n)=>t?v.cloneElement(e(t),{key:n}):(0,G.jsx)(`td`,{},n))},n))})}function lH({children:e,className:t,"data-slot":n=`calendar-grid-header`,firstDayOfWeek:r,timeZone:i=`UTC`,visibleRange:a,weekdayStyle:o=`short`}){let{locale:s}=rp(),c=v.useMemo(()=>YV(a.start,s,r,o,i),[r,s,i,a.start,o]);return(0,G.jsx)(K.thead,{"aria-hidden":!0,className:t,"data-slot":n,children:(0,G.jsx)(`tr`,{children:c.map((t,n)=>v.cloneElement(e(t),{key:n}))})})}var uH=(0,v.createContext)({});function dH({children:e,className:t,defaultYearPickerOpen:n=!1,firstDayOfWeek:r,isYearPickerOpen:i,maxValue:a,minValue:o,onYearPickerOpenChange:s,visibleDuration:c,...l}){let u=c?.weeks!=null,d=c?.days!=null,f=c?.days,{locale:p}=rp(),m=v.useMemo(()=>Wd(),[]),h=v.useRef(null),[g,_]=sh(i,n,s),y=v.useMemo(()=>{let e=new Qk(p).resolvedOptions().calendar;return Xk(e)},[p]),b=v.useMemo(()=>qV(y.identifier),[y.identifier]),x=o??new zO(y,1900+b,1,1),S=a??new zO(y,2099+b,12,31);return(0,G.jsx)(WV,{value:{calendarGridSlot:`range-calendar-grid`,isYearPickerOpen:g,setIsYearPickerOpen:_,calendarRef:h},children:(0,G.jsx)(WN,{ref:h,"data-slot":`range-calendar`,firstDayOfWeek:r,maxValue:S,minValue:x,visibleDuration:c,...l,className:J(t,Ld(m.base(),u&&`range-calendar--week-view`,d&&`range-calendar--day-view`)),children:t=>(0,G.jsx)(uH,{value:{dayView:d&&f!=null?{days:f,firstDayOfWeek:r,timeZone:t.state.timeZone,visibleRange:t.state.visibleRange}:void 0,slots:m},children:typeof e==`function`?e(t):e})})})}dH.displayName=`HeroUI.RangeCalendar`;var fH=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(uH);return(0,G.jsx)(K.header,{className:Y(r?.header,t),"data-slot":`range-calendar-header`,...n,children:e})};fH.displayName=`HeroUI.RangeCalendar.Header`;var pH=({className:e,...t})=>{let{slots:n}=(0,v.use)(uH);return(0,G.jsx)(eP,{"data-slot":`range-calendar-heading`,...t,className:Y(n?.heading,e)})};pH.displayName=`HeroUI.RangeCalendar.Heading`;var mH=({children:e,className:t,slot:n,...r})=>{let{slots:i}=(0,v.use)(uH);return(0,G.jsx)(nh,{"data-slot":`range-calendar-nav-button`,slot:n,...r,className:J(t,i?.navButton()),children:e||(n===`previous`?(0,G.jsx)(Sh,{className:i?.navButtonIcon(),"data-slot":`range-calendar-nav-button-icon`}):(0,G.jsx)(Ch,{className:i?.navButtonIcon(),"data-slot":`range-calendar-nav-button-icon`}))})};mH.displayName=`HeroUI.RangeCalendar.NavButton`;var hH=({children:e,className:t,weekdayStyle:n=`short`,...r})=>{let i=(0,v.use)(uH),{dayView:a,slots:o}=i,s=v.useMemo(()=>({...i,dayView:a?{...a,weekdayStyle:n}:void 0}),[a,i,n]);return(0,G.jsx)(uH,{value:s,children:(0,G.jsx)(KN,{"data-slot":`range-calendar-grid`,weekdayStyle:n,...r,className:Y(o?.grid,t),children:e})})};hH.displayName=`HeroUI.RangeCalendar.Grid`;var gH=({children:e,className:t,...n})=>{let{dayView:r,slots:i}=(0,v.use)(uH);return r&&r.days>=7&&typeof e==`function`?(0,G.jsx)(lH,{className:Y(i?.gridHeader,t),"data-slot":`range-calendar-grid-header`,firstDayOfWeek:r.firstDayOfWeek,timeZone:r.timeZone,visibleRange:r.visibleRange,weekdayStyle:r.weekdayStyle,children:e}):(0,G.jsx)(JN,{"data-slot":`range-calendar-grid-header`,...n,className:Y(i?.gridHeader,t),children:e})};gH.displayName=`HeroUI.RangeCalendar.GridHeader`;var _H=({children:e,className:t,...n})=>{let{dayView:r,slots:i}=(0,v.use)(uH);return r&&r.days>=7&&typeof e==`function`?(0,G.jsx)(cH,{className:Y(i?.gridBody,t),"data-slot":`range-calendar-grid-body`,firstDayOfWeek:r.firstDayOfWeek,visibleRange:r.visibleRange,children:e}):(0,G.jsx)(QN,{"data-slot":`range-calendar-grid-body`,...n,className:Y(i?.gridBody,t),children:e})};_H.displayName=`HeroUI.RangeCalendar.GridBody`;var vH=({className:e,...t})=>{let{slots:n}=(0,v.use)(uH);return(0,G.jsx)(XN,{"data-slot":`range-calendar-header-cell`,...t,className:Y(n?.headerCell,e)})};vH.displayName=`HeroUI.RangeCalendar.HeaderCell`;var yH=({children:e,className:t,...n})=>{let{slots:r}=(0,v.use)(uH);return(0,G.jsx)($N,{"data-slot":`range-calendar-cell`,...n,className:J(t,r?.cell()),children:t=>{let{formattedDate:n,isDisabled:r,isHovered:i,isPressed:a,isSelectionEnd:o,isSelectionStart:s}=t,c=typeof e==`function`?e(t):e||n;return(0,G.jsx)(`span`,{className:`range-calendar__cell-button`,"data-disabled":yh(r),"data-hovered":yh(i),"data-pressed":yh(a),"data-selected":yh(s||o),"data-slot":`range-calendar-cell-button`,children:c})}})};yH.displayName=`HeroUI.RangeCalendar.Cell`;var bH=({className:e,...t})=>{let{slots:n}=(0,v.use)(uH);return(0,G.jsx)(K.span,{"aria-hidden":`true`,className:Y(n?.cellIndicator,e),"data-slot":`range-calendar-cell-indicator`,...t})};bH.displayName=`HeroUI.RangeCalendar.CellIndicator`;var xH=Object.assign(dH,{Root:dH,Header:fH,Heading:pH,NavButton:mH,Grid:hH,GridHeader:gH,GridBody:_H,HeaderCell:vH,Cell:yH,CellIndicator:bH,YearPickerTrigger:eH,YearPickerTriggerHeading:tH,YearPickerTriggerIndicator:nH,YearPickerGrid:aH,YearPickerGridBody:oH,YearPickerCell:sH}),SH={en:{brandSub:`login state gateway`,controlPlane:`control plane`,workspace:`Workspace`,develop:`Develop`,system:`System`,runtimeSnapshot:`Runtime and scheduler snapshot`,routesHint:`OpenAI / Anthropic-compatible routes`,clientConfig:`Client configuration`,clientConfigHint:`Use the same console key as Bearer token`,providerPrefixHint:`Pin a provider with a qoder/, workbuddy/, trae/, devin/, command/, codex/, zhipu/, qwenwork/, or kimi/ model prefix. A named API key can also limit which providers are listed and routed. Bare IDs follow the cross-provider pool setting on System.`,authentication:`Authentication`,curlExample:`curl example`,quickTestHint:`Send a real request through the selected account`,response:`Response`,providerCatalog:`Model catalog`,providerCatalogMeta:`SIGNED-IN / LIVE`,accountPool:`Account pool`,accountCreateHint:`Create an isolated runtime first, then sign in with browser or PAT.`,credentialImportHint:`Only credential bundles exported from this console, with matching user blob and machine ID.`,accountEmptyHint:`Create an account runtime to begin.`,oauthDeviceFlow:`OAuth device flow`,navOverview:`Overview`,navAuth:`Accounts`,navProviders:`Models`,navAccess:`Access & try`,navAccounts:`Accounts`,checkinDefaultsTitle:`Automatic check-in`,checkinDefaultsHint:`Set a default time for each provider. Accounts following the default pick up changes automatically; custom times stay unchanged.`,checkinDisabledAccountsTitle:`Check in disabled accounts`,checkinDisabledAccountsHint:`When enabled, accounts disabled for chat can still run their opted-in automatic check-in. Manual check-in remains unavailable for disabled accounts.`,checkinDisabledAccountsStatus:`Current status`,checkinDisabledAccountsAriaLabel:`Allow automatic check-in for disabled accounts`,checkinInherit:`Follow provider default`,checkinDefaultValue:`Provider default: {time}`,checkinCustom:`Account override`,checkinScheduleHint:`Uses the displayed timezone, normally within about 90 seconds of the chosen time; sequential account processing can take longer. Earlier failures retry once around 21:00. Disabled campaigns are skipped for the day. Chat is unaffected.`,checkinTimeInvalid:`Enter a valid check-in time (HH:mm).`,checkinRecordSkipped:`Activity unavailable`,navUsage:`Usage`,usageTitle:`Usage`,usageLead:`Requests, latency, tokens and credits by model, account and provider.`,usageByModel:`Models`,usageByAccount:`Accounts`,usageByProvider:`Providers`,usageColRequests:`Requests`,usageColSuccess:`Success`,usageColTokens:`Tokens`,usageColCacheWrite:`Cache write`,usageColCredits:`Credits`,usageRowCount:`{count} rows`,usageEmpty:`No requests in this window.`,usageStatsTab:`Stats`,usageCostTab:`Quota`,usageCostLead:`Subscription quota and token usage by model across every provider.`,usageWindow:`Window`,usageWindow24h:`24h`,usageWindow7d:`7d`,usageWindowTotal:`All retained`,usageCredits:`Quota used`,usageCreditsHint:`Subscription credits across all providers`,usageEstCost:`Equivalent cost`,usageTotalTokens:`Total tokens`,usageRequests:`Requests`,usageModelCount:`{count} models`,usageCacheHitRate:`Cache hit`,usageTokenSplitNote:`hit / miss / output`,usageChartTitle:`Usage over time`,usageChartHint:`Stacked by model. Switch between quota and tokens.`,usageChartEmpty:`No usage in this window.`,usageBreakdownTitle:`By model`,usageBreakdownHint:`Tokens and subscription credits for every model.`,usageColInputHit:`Input · cache hit`,usageColInputMiss:`Input · cache miss`,usageColOutput:`Output`,usageColCost:`Equiv. cost`,usageUnpricedCost:`no list price`,usageColSplit:`Peak / off-peak`,usageTotals:`Total`,usageRetentionHint:`Request logs are pruned on a schedule, so “All retained” covers only what is still stored.`,usageRenderNote:`Optional DeepSeek official list-price estimate in CNY. Subscription accounts do not bill this way — for comparison only.`,usagePeakNote:`Peak = Beijing time Mon–Fri 09:00–12:00 & 14:00–18:00; off-peak is half. Holidays are not handled.`,usageUnpricedHint:`No list-price row (quota and tokens only): {models}`,usageNoteTitle:`How this is calculated`,usagePriceTitle:`DeepSeek official price table`,usagePriceHit:`Cache hit`,usagePriceMiss:`Cache miss`,usagePriceOutput:`Output`,usagePriceBandOff:`Off-peak`,usagePriceBandPeak:`Peak`,usageOffPeak:`Off-peak`,usagePeak:`Peak`,usageChartMetric:`Chart metric`,usageEstimateTitle:`DeepSeek list-price estimate`,usageEstimateHint:`Optional CNY comparison for priced models. Collapsed by default.`,usageEstimateChartTitle:`List-price trend`,usageEstimateChartEmpty:`No priced DeepSeek usage in this window.`,chartMetricRequests:`Requests`,chartMetricTokens:`Tokens`,chartMetricLatency:`p95 latency`,chartInput:`Input`,chartOutput:`Output`,chartCacheRead:`Cache read`,chartTotal:`Total`,navLogs:`Logs`,navKeys:`API keys`,navSystem:`System settings`,sidebarFoot:`Gateway for CLI logins`,sidebarInFlight:`In flight: {count}`,systemSettingsTitle:`System settings`,systemSettingsLead:`Manage cross-provider routing, provider check-in defaults, updates, SQLite protection, and the console API key.`,crossProviderModelPoolTitle:`Cross-provider model pool`,crossProviderModelPoolHint:`When enabled, bare model IDs can route across matching Qoder, WorkBuddy, and Trae accounts. When disabled, bare IDs are rejected and requests must use a provider-prefixed model ID.`,crossProviderModelPoolStatus:`Current status`,crossProviderModelPoolAriaLabel:`Enable cross-provider model pool`,workbuddyCheckinSettingsTitle:`WorkBuddy check-in`,workbuddyCheckinSettingsHint:`Default first daily check-in time for new WorkBuddy accounts. Existing accounts keep their own time until you edit them.`,workbuddyCheckinSettingsFieldHint:`Uses server local time. New WorkBuddy accounts inherit this unless you set a different time on the account.`,routingStrategyTitle:`Account routing strategy`,routingStrategyHint:`Choose how ready accounts share traffic. Fill-first keeps traffic on the highest-priority account until it is unavailable. Earliest-expiry-first only ranks accounts inside the same provider by their nearest credit-package expiry; providers without package expiry keep the existing rotation.`,routingStrategy:`Strategy`,routingRoundRobin:`Round robin`,routingWeightedRoundRobin:`Weighted round robin`,routingFillFirst:`Fill first`,routingFEFO:`Earliest expiry first (FEFO)`,routingWeight:`Routing weight`,sessionAffinityTTL:`Session TTL`,sessionAffinityHits:`Sticky hits`,sessionAffinityMisses:`Sticky misses`,sessionAffinityEscapes:`Sticky escapes`,lastSessionMiss:`Last miss`,lastSessionEscape:`Last escape`,checkUpdates:`Check updates`,versionUpdate:`Version update`,latestVersionHint:`Download the latest version first, then apply it when you are ready.`,updateAvailable:`Update available`,settingsTabGeneral:`General`,settingsTabRouting:`Routing`,settingsTabSecurity:`Security & data`,settingsTabUpdates:`Updates`,sidebarNewVersion:`New version {version}`,sidebarReleaseNotes:`Release notes`,sidebarGoToUpdate:`History & rollback`,upToDate:`Up to date`,currentVersion:`Current version`,latestVersion:`Latest version`,skippedBetweenLabel:`Versions in between`,releaseNotes:`What changed`,updateNoNotes:`No notes for this version.`,versionHistory:`Version history`,versionCurrentBadge:`Current`,versionLatestBadge:`Latest`,restoreThisVersion:`Restore this version`,restoreVersionTitle:`Restore {version}?`,restoreVersionHint:`The service will switch back to this version. New requests pause only while it restarts.`,updaterReady:`Updates are ready on this host`,updaterUnavailable:`Updates are not available on this host`,updaterNeedsHost:`This process cannot replace its own container`,updaterUnavailableHint:`This page can check for new versions, but this host cannot apply them until updates are set up.`,updaterNeedInstall:`Install the host updater from deploy/install-updater.sh or deploy/install-updater.ps1 so it can talk to Docker.`,updaterNeedCompose:`Linux needs the updater socket mounted into the container. Docker Desktop uses a loopback updater URL instead of a Unix socket.`,updaterNeedRelease:`The running build must be a published GitHub release, not a local or development image.`,updateNow:`Download update`,applyUpdateNow:`Update now`,cancelUpdate:`Cancel download`,discardPreparedImage:`Discard this update`,updateReadyHint:`The update is downloaded. Apply it when you want to restart; new requests pause only then.`,updateReadyTargetHint:`Ready to switch to {version}. New requests pause only during the restart.`,updateNewerReleaseHint:`A newer version is available ({latest}). Update now, or discard this download and start again.`,updateStagedUnavailableHint:`Update the host updater first to use the staged update flow.`,updateLegacyOneShotHint:`This host will download and apply the update in one step. Later versions can download first, then wait for Update now.`,rollbackToVersion:`Restore an older version`,rollbackToVersionHint:`You can restore one of the three most recent versions before the one running now.`,updateReloadingIn:`Refreshing in {seconds}s`,updateInProgress:`Updating…`,updatePreparingImage:`Downloading update…`,updatePreparingImageHint:`Downloading the update in the background. This host stays on the current version until you tap Update now. Cancel if the download hangs.`,updateApplyingHint:`Applying the update. This page will refresh when it is ready.`,updateInProgressHint:`The service is updating and will refresh automatically when it is ready.`,updateUnavailableHint:`Updates are temporarily unavailable. Please try again later.`,updateFailedHint:`The update could not be completed. Please try again.`,updateCheckFailedHint:`Unable to check for updates. Please try again later.`,updatePreparingHint:`Getting the update ready: checking the version and saving a backup. Existing connections may be interrupted; clients can retry.`,updateRunningHint:`The update is running. This page will refresh when it is ready.`,updateReloadingHint:`Update complete. Refreshing this page…`,updateElapsed:`{seconds}s elapsed`,sqliteProtection:`SQLite protection`,sqliteProtectionHint:`Your data stays in place, and a verified backup is created before the update.`,sqliteBackupBeforeUpdate:`Verified backup before the update`,sqliteKeepFive:`Keep the five most recent backups`,sqliteRollbackTogether:`Restore the database and previous version together if the update fails`,updateStatus:`Update status`,noUpdateJob:`No update job yet`,confirmUpdate:`Update now`,confirmUpdateHint:`New requests pause briefly while a backup is created. Existing connections may be interrupted; clients can retry them.`,updateState_idle:`Idle`,updateState_unavailable:`Unavailable`,updateState_queued:`Waiting to start`,updateState_preparing:`Getting ready`,updateState_preparing_image:`Downloading update`,updateState_checking:`Checking version`,updateState_backing_up:`Saving a backup`,updateState_submitting:`Starting update`,updateState_running:`Updating`,updateState_pulling:`Downloading update`,updateState_host_binary:`Downloading update helper`,updateState_image_ready:`Download complete`,updateState_ready_to_apply:`Ready to update`,updateState_recreating:`Restarting`,updateState_health_checking:`Checking that it started`,updateState_rolling_back:`Restoring previous version`,updateState_succeeded:`Updated`,updateState_rolled_back:`Restored previous version`,updateState_failed:`Update failed`,checking:`checking`,refresh:`Refresh`,apiKey:`API key`,apiKeyPh:`API key`,needApiKey:`Sign in with the console password to load data.`,loginTitle:`Enter the console`,loginLead:`This host already has a running CLI2API proxy. Use the same API key your clients send to /v1.`,loginDesc:`Same key as Authorization: Bearer on the API.`,loginFormTitle:`Continue`,loginPassword:`Console password`,loginPasswordPh:`API key`,loginNeedKey:`Password is empty.`,loginBadKey:`That key does not match this host.`,loginSubmit:`Continue`,loggingInConsole:`Checking…`,loginHint:`Self-hosted only. Account login happens after this, on Accounts.`,showPassword:`Show password`,hidePassword:`Hide password`,signOut:`Sign out`,checkingSession:`Checking session…`,refreshing:`Refreshing`,pages:{home:{title:`Overview`,desc:`Runtime health, request volume, and ready endpoints.`},auth:{title:`Auth`,desc:`Browser device-flow login, PAT login, and session rewarm.`},providers:{title:`Models`,desc:`Models from signed-in accounts, plus per-model defaults for context and reasoning.`},access:{title:`Access & try`,desc:`Multi-turn chat in the main panel; expand Raw API below to debug.`},accounts:{title:`Accounts`,desc:`One login per account. Browser sign-in first; PAT only when needed.`},usage:{title:`Usage`,desc:`Usage by model, account and provider.`},logs:{title:`Logs`,desc:`Recent proxy requests and process output.`},keys:{title:`API keys`,desc:`Create client keys and limit them to selected providers.`},system:{title:`System settings`,desc:`Cross-provider routing, managed updates, SQLite protection, and the console API key.`},login:{title:`Enter the console`,desc:`Same API key as /v1.`}},logsLead:`Request history and runtime output from this host.`,logsRequests:`Request history`,logsRuntime:`Runtime logs`,logsEmptyRequests:`No requests recorded yet.`,logsEmptyRuntime:`No runtime lines captured yet.`,logsSearchRuntime:`Search runtime output…`,logsSearchRequestId:`Find a request id`,logsSearchModel:`Find a model`,logsSearchAccount:`Find an account`,logsFilterIdAll:`All request IDs`,logsNoFilterOptions:`No matching options`,logsClear:`Clear history`,logsClearConfirm:`Delete all request history on this host?`,logsColTime:`Time`,logsColAccount:`Account`,logsColProvider:`Provider`,logsColModel:`Model`,logsColReasoning:`Reasoning`,logsColStatus:`Status`,logsColLatency:`Latency`,logsColTTFT:`First token`,logsColTokens:`Tokens`,logsTokensIn:`in`,logsTokensOut:`out`,logsTokensPoints:`{value} pts`,logsColStream:`Mode`,logsStreamYes:`stream`,logsStreamNo:`sync`,logsFilterAll:`All`,logsFilterOk:`OK`,logsFilterIncomplete:`Incomplete`,logsFilterError:`Error`,logsFilterCanceled:`Canceled`,logsFilterAccountAll:`All accounts`,logsFilterProviderAll:`All providers`,logsFilterModelAll:`All models`,logsFilterKindAll:`All errors`,logsFilterStreamAll:`All modes`,logsTimeRange:`Time`,logsTimeAll:`All time`,logsTime1h:`1 hour`,logsTime24h:`24 hours`,logsTime7d:`7 days`,logsTimeCustom:`Custom`,logsTimeFrom:`From`,logsTimeTo:`To`,logsKindQuota:`Quota`,logsKindRateLimit:`Rate limit`,logsKindAuth:`Auth`,logsKindNotReady:`Not ready`,logsKindUnavailable:`Unavailable`,logsKindInvalidRequest:`Invalid request`,logsKindModelNotAvailable:`Model missing`,logsPageSize:`Per page`,logsPage:`Page {page} / {pages}`,logsPrevPage:`Previous`,logsNextPage:`Next`,logsNoMatch:`No requests match these filters.`,logsLevelAll:`All`,logsLevelInfo:`Info`,logsLevelWarn:`Warn`,logsLevelError:`Error`,logsAttempts:`Attempts`,logsRouting:`Routing`,logsRouting_pool:`Pool`,logsRouting_pin:`Pinned`,logsRouting_sticky:`Session sticky`,logsRouting_sticky_escape:`Session escape`,logsNoAttempts:`No attempt details.`,logsStreamDiagnostics:`Stream diagnostics`,logsMessageShape:`Message shape`,logsMessageCount:`Messages`,logsEmptyMessageIndexes:`Empty indexes`,logsMessageRoles:`Roles`,logsCancellationSource:`Cancellation source`,logsUpstreamStatus:`Upstream status`,logsSSEEvents:`SSE events`,logsBytesRead:`Bytes read`,logsLastEvent:`Last event`,logsStreamComplete:`Completed with [DONE]`,logsUsageDetail:`Consumption`,logsCreditConsumed:`Points consumed`,logsDetailTitle:`Request detail`,logsRuntimeDetailTitle:`Runtime log detail`,logsRuntimeLevel:`Level`,logsRuntimeSource:`Source`,logsRuntimeMessage:`Message`,logsShownTotal:`{shown} / {total}`,logsAutoRefresh:`Live`,failedLogs:`Failed to load logs: {msg}`,homeEyebrow:`Runtime`,homeDisplay:`Gateway pulse`,homeLead:`Runtime health plus request volume, latency, and tokens from this host.`,metricRequests:`Requests`,metricSuccess:`Success`,metricLatency:`p95`,metricTokens:`Tokens`,statsWindow1h:`1h`,statsWindow24h:`24h`,statsWindow7d:`7d`,statsWindow30d:`30d`,statsWindowCustom:`Custom`,statsWindowToday:`Today`,statsRefreshPause:`Pause auto-refresh`,statsRefreshResume:`Resume auto-refresh`,statsRefreshAuto:`Refreshing every 30s · click to pause`,statsRefreshPaused:`Auto-refresh paused · click to resume`,statsDragHint:`Drag to open logs for a range`,statsWindowHint:`{window} window`,statsTraffic:`Traffic`,statsTrafficHint:`Completed chat requests in the selected window`,statsEmptyTraffic:`No requests in this window yet.`,statsLatencyP50:`p50`,statsLatencyP95:`p95`,statsLatencyAvg:`avg`,statsTTFB:`TTFB`,statsPool:`Account pool`,statsPoolHint:`Ready workers and remaining quota`,statsCooling:`cooling`,statsTopModels:`Top models`,statsTopAccounts:`Top accounts`,statsTopProviders:`Providers`,statsTopProvidersHint:`Request share by account family`,statsNoProviders:`No provider traffic yet.`,statsErrorMix:`Error mix`,statsStatusMix:`Outcomes & errors`,statsStatusMixHint:`Request status, failure kinds and busiest accounts`,statsCoolingDetails:`Cooling down · reason · remaining · backoff`,statsBackoffLevel:`Restart backoff level`,statsAffinityHit:`Affinity hit`,statsAffinityHint:`{hits} hits · {misses} misses · {bindings} bindings`,metricCacheHit:`Cache hit rate`,metricCacheHitDetail:`{read} cached / {prompt} prompt`,metricStreaming:`Streaming share`,metricStreamingDetail:`{count} of {total} requests`,metricCanceled:`Canceled`,metricCanceledDetail:`{rate} of requests`,statsErrorMixHint:`Classified failures in this window`,statsNoModels:`No model traffic yet.`,statsNoAccounts:`No account traffic yet.`,statsNoErrors:`No classified errors.`,statsUnknown:`unknown`,statsUnassigned:`unassigned`,resTitle:`Resources`,resHint:`Host process memory and CPU`,resServer:`Server`,resWorkers:`Workers`,resEmpty:`No worker processes yet.`,resGoroutines:`goroutines`,resCpuLifetime:`lifetime avg`,failedStats:`Failed to load stats: {msg}`,homeNote:`Signed into the local console. Account logins live on the Accounts page.`,metricRuntime:`Runtime`,metricAccounts:`Accounts`,metricModels:`Models`,metricAuth:`Auth`,metricPort:`Port`,serviceDetail:`Service detail`,endpoints:`Endpoints`,copyBaseUrl:`Copy Base URL`,copied:`Copied`,copy:`Copy`,open:`Open`,waitingOverview:`Waiting for overview…`,signIn:`Sign in`,connectQoder:`Connect account`,rewarm:`Rewarm`,rewarming:`Rewarming`,refreshAccount:`Refresh`,refreshingAccount:`Refreshing`,stepBrowserTitle:`Browser device flow`,stepBrowserDesc:`Opens account selection. Finish in the browser, then this page polls until the session is ready.`,startBrowserLogin:`Sign in with browser`,starting:`Starting…`,quotaLoading:`Getting quota…`,quotaUnavailable:`Quota unavailable`,authUrl:`Auth URL`,openAuthUrl:`Open link`,stepPatTitle:`Personal access token`,stepPatDesc:`Optional fallback when browser flow is inconvenient.`,pat:`PAT`,pasteToken:`paste token`,loginWithPat:`Login with PAT`,loggingIn:`Logging in…`,localState:`Local state`,raw:`Raw`,noAuthSnapshot:`No auth snapshot yet.`,catalog:`Catalog`,availableModels:`Available models`,modelsPulled:`Pulled from`,filter:`Filter`,filterPh:`glm / qwen / deepseek`,providerFilterAll:`All providers`,accountStatusFilter:`Account status`,connection:`Connection`,apiPlayground:`Access & try`,apiPlaygroundHint:`Pick an account and model, chat in the main panel, or open Raw API below for JSON and curl.`,readyAccounts:`{ready} of {total} accounts ready`,baseUrl:`Base URL`,externalClients:`External clients`,protocol:`Protocol`,quickTest:`Quick test`,requestBuilder:`Request builder`,responseInspector:`Response inspector`,responseInspectorHint:`Raw JSON from the local proxy`,requestIdle:`Idle`,requestComplete:`Complete`,requestFailed:`Request failed`,responseReceived:`Response received`,responseEmptyTitle:`No response yet`,responseEmptyHint:`Choose a route, write a prompt, and send the request. The raw response appears here.`,sendRequest:`Send request`,promptPlaceholder:`Write a message for the model`,promptHelper:`This test uses a non-streaming Chat Completions request.`,accessTabChat:`Chat`,accessTabApi:`Native API`,accessTabsLabel:`Access modes`,chatTryEmptyTitle:`No reply yet`,chatTryEmptyHint:`Write a message below. Account and model live in the composer. Session clears when you leave.`,chatTryHelper:`Enter to send · Shift+Enter for a new line. Attachments stay in this turn.`,chatTrySend:`Send`,chatTryStop:`Stop`,chatTryStreaming:`Streaming…`,chatTryUserLabel:`You`,chatTryAssistantLabel:`Assistant`,chatTryCreditsUsed:`Used {amount} credits`,chatTryUsageTokens:`{prompt} → {completion}`,chatTryUsageFoot:`{tokens} · {amount} credits`,nativeApiHint:`Non-streaming request, raw JSON response, and a matching curl command.`,rawApiShow:`Show raw API`,rawApiHide:`Hide raw API`,chatAttach:`Attach file`,chatAttachRemove:`Remove attachment`,chatAttachUnsupported:`Unsupported file type: {names}`,thinkingPhaseScan:`Scanning`,thinkingPhasePlan:`Planning`,thinkingPhaseDraft:`Drafting`,thinkingDone:`Thought`,thinkingElapsed:`{n}s`,toolCallGroup:`Used {n} tools`,chatDemoLoad:`Preview sample`,thinkingChars:`{count} chars`,thinkingWorking:`Thinking`,toolCallRunning:`Running`,toolCallSuccess:`Done`,toolCallError:`Error`,toolCallUntitled:`tool`,toolCallArgs:`Arguments`,toolCallArgsEmpty:`(empty)`,autoAccountHint:`The scheduler chooses an available account.`,fixedAccountHint:`This request is pinned to the selected account.`,modelRoutingHint:`Uses the public model ID exposed by this proxy.`,accountModelHint:`Only models this account currently serves. A pinned request fails if the ID is missing here.`,noAccountModels:`This account has no models to send.`,accountModels:`Available models`,accountModelsTitle:`Models on {name}`,accountModelsHint:`Live catalog from this account. Requests pinned here only use these IDs.`,accountModelsEmpty:`This account has not published a model catalog yet.`,accountModelsError:`Could not load models: {msg}`,noAccountsForTest:`No account runtime is available. Add and sign in to an account before testing.`,curlGeneratedHint:`Generated from the current account, model, and prompt`,prompt:`Prompt`,model:`Model`,send:`Send`,waitingRequest:`Waiting for a request…`,requesting:`Requesting…`,endpointOpenAI:`OpenAI Compatible`,endpointChat:`Chat Completions`,endpointBaseHint:`Use this path as the base URL in OpenAI-compatible clients.`,endpointChatHint:`OpenAI-compatible chat. Prefix the model ID to pin one provider, for example qoder/glm-5.2.`,endpointMessages:`Anthropic Messages`,endpointMessagesHint:`Stateless Anthropic Messages. Use a provider-prefixed model ID to pin one family.`,endpointResponses:`OpenAI Responses`,endpointResponsesHint:`Stateless OpenAI Responses. Use a provider-prefixed model ID to pin one family.`,endpointModels:`Models`,endpointModelsHint:`Public model IDs. Named API keys only see models from their allowed providers.`,endpointHealth:`Health`,endpointHealthHint:`Check whether the local proxy is responding.`,endpointCount:`{count} API routes`,endpointReady:`Available now`,endpointBaseLabel:`Client base URL`,endpointAuthLabel:`Bearer API key`,hasUserBlob:`Has user blob`,userBlobBytes:`User blob bytes`,machineId:`Machine ID`,sessionHot:`Session hot`,upstreamEndpoint:`Upstream endpoint`,rewarmCount:`Rewarm count`,proxy:`Proxy`,endpoint:`Endpoint`,lastError:`Last error`,running:`Running`,down:`Down`,hot:`Hot`,up:`Up`,ready:`Ready`,missing:`Missing`,degraded:`Degraded`,error:`Error`,yes:`yes`,no:`no`,modelCol:`Model`,mappedKeyCol:`Upstream key`,requestIdCol:`Request ID`,providerCol:`Provider`,qoderKeyCol:`Upstream key`,routedTo:`Upstream model {model}`,stateCol:`State`,contextWindowCol:`Context window`,modelDefaultsCol:`Context and reasoning`,contextConfigHint:`These are defaults. If a request sets Max context or reasoning, that request wins.`,qoderContextHint:`Default context window used when the request omits context length / max input tokens.`,contextInvalid:`Context window must be an integer between 1,024 and 4,000,000 tokens.`,contextSaved:`Saved context window for {model}.`,contextReset:`Restored the default context window for {model}.`,contextMaxOn:`Enabled Max context for {model}.`,contextMaxOff:`Disabled Max context for {model}.`,contextMaxUnavailable:`This model has no Max context switch.`,maxMode:`Max context`,maxModeHint:`Trae larger context window, often 200k to 1M. Not a plan or quota. Used only when the request omits is_max_mode; an explicit request still wins. Unsupported models never send this switch.`,qoderMaxModeHint:`Qoder larger context window. Not a plan or quota. When on, requests use the model’s largest window; when off (or when a request sets its own context) the default window applies.`,catalogWindow:`Catalog size`,catalogWindowHint:`This Trae model has no Max-context switch. The number is the catalog window.`,workbuddyContextHint:`WorkBuddy desktop default and optional context budgets from the catalog. This is a local compact budget, not Trae is_max_mode. Chat requests do not send a window switch.`,reasoningLevels:`Reasoning intensity`,reasoningHint:`Default thinking effort when the request omits reasoning_effort and related flags. This does not lock every call to that level, and it does not cap a higher client value. A level the model does not allow falls back to an allowed option.`,reasoningFixed:`Fixed thinking: {type}`,noReasoningLevels:`This model has no selectable reasoning levels.`,reasoningSaved:`Saved default reasoning for {model}: {level}.`,reasoningLevel_none:`Off`,reasoningLevel_low:`Low`,reasoningLevel_medium:`Medium`,reasoningLevel_high:`High`,reasoningLevel_xhigh:`Extra high`,reasoningLevel_max:`Max effort`,modelDetails:`Details`,promptMaxTokens:`Prompt max`,maxOutputTokens:`Output max`,actions:`Actions`,save:`Save`,custom:`Custom`,defaultValue:`Default`,resetDefault:`Restore default`,fallback:`fallback`,modelFree:`(free)`,shownTotal:`{shown} shown / {total} total`,noModelsYet:`No models yet`,noModelsMatch:`No models match this filter.`,noProviders:`No providers loaded.`,failedOverview:`Failed to load overview: {msg}`,pastePatFirst:`Paste a PAT first`,patDone:`PAT login completed`,loginOpenMsg:`Open the auth URL to finish login`,idle:`idle`,menu:`Menu`,toggleSidebar:`Toggle sidebar`,accountsTitle:`Accounts`,accountsDesc:`One login per account. Chat round-robins and fails over.`,noAccounts:`No accounts yet. Add one to start serving chat.`,accountCount:`Accounts`,signedIn:`Signed in`,enabledAccounts:`Enabled`,availableAccounts:`Available`,needsAttention:`Needs attention`,searchAccounts:`Search name, ID, UID, provider, or auth type`,filterAll:`All`,shownAccounts:`{shown} / {total}`,noAccountsMatch:`No accounts match this filter.`,clearFilters:`Clear filters`,more:`More actions`,partialCooling:`Partial model cooldown`,runtimeState:`Runtime state`,maxInflight:`Max concurrency`,priority:`Priority`,updatedAt:`Updated`,enabledState:`Enabled`,cooling:`Cooling down`,dead:`Recovering`,authFailed:`Auth failed`,patFallback:`PAT fallback`,usePat:`Use PAT`,account:`Account`,autoAccount:`Auto (round-robin)`,cooldown:`Cooldown`,inFlight:`In-flight`,liveConcurrency:`Concurrency`,liveRpm:`Last 60s`,liveRpmUnit:`req`,liveRpmHint:`started in the last minute`,liveTrace:`Trend`,livePeak:`peak {n}`,liveSaturated:`Saturated`,restarts:`Restarts`,dropSystemPrompt:`Drop system prompt`,dropSystemPromptHint:`Strip caller system prompts before sending; WorkBuddy still gets an empty leading system slot so Global does not reject the request`,autoCheckin:`Daily check-in`,autoCheckinHint:`Run the daily WorkBuddy credit check-in at the configured local time. Failed attempts retry around 21:00. Off by default.`,autoCheckinCreateHint:`WorkBuddy only. Enable automatic daily credit check-ins. The first attempt uses this account time, or the system default if left unchanged.`,autoCheckinTime:`Check-in time`,autoCheckinTimeHint:`Uses server local time and runs within about 14 minutes after the selected time. Failed attempts retry around 21:00. New accounts start from the system default.`,checkinNow:`Check in now`,lastCheckin:`Last check-in`,lastCheckinNone:`No check-in yet`,checkinStatus:`Check-in`,checkinToday:`Checked in today`,checkinPending:`Not checked in today`,checkinFailed:`Check-in failed`,checkinRecords:`Check-in records`,checkinRecordsTitle:`Check-in records · {name}`,checkinRecordsHint:`The latest 20 check-in attempts for this account.`,checkinRecordsEmpty:`No check-in records yet`,checkinRecordsCount:`{count} records`,checkinRecordSuccess:`Success`,checkinRecordAlready:`Already checked in`,checkinRecordFailed:`Failed`,refreshCredits:`Refresh credits`,expiryDistTitle:`Credit expiry distribution`,expiryDistHint:`Grouped by calendar day · colour marks the account · FEFO: upstream burns the soonest-expiring credits first`,expiryDistExpand:`Show all {n} days`,expiryDistCollapse:`Show less`,expiryDistDayTotal:`{n} credits expire`,expiryDistColAccount:`Account`,expiryDistColSoonest:`Soonest`,expiryDistColDaysLeft:`Days left`,expiryDistColBatch:`Expiring`,expiryDistColDaily:`Daily burn`,expiryDistDays:`{n}d`,expiryDistFoot:`"Daily burn" = credits expiring on the soonest day ÷ days until then — the pace needed to use them before they lapse.`,expiryDistExpired:`Expired`,usageDetailTitle:`Usage breakdown`,usageDetailHint:`Same window as above · tokens, cache hit rate and latency per dimension`,usageDimNote:`{n} rows (top 20) · request count includes failed attempts · scope differs from the Usage page top-N / missing-metric rules`,usageDimAccount:`By account`,usageDimModel:`By model`,usageDimRealm:`By realm`,usageSortTotal:`Total tokens`,usageSortRequests:`Requests`,usageSortErrors:`Errors`,usageSortLatency:`Latency`,usageColAccount:`Account`,usageColModel:`Model`,usageColRealm:`Realm`,usageColErrors:`Errors`,usageColPrompt:`Prompt`,usageColCacheHit:`Cache hit`,usageColCompletion:`Completion`,usageColTotal:`Total`,usageColAvgLatency:`Avg latency`,usageCreditTitle:`Credit deduction history`,usageCreditHint:`Summed from upstream usage.credit · requests without a credit reading are not counted`,usageCreditEmpty:`No credit deductions yet; token-only history from before the upgrade is never filled with made-up credits.`,usageCreditNote:`{accounts} accounts · {models} model rate groups · only tokens observed alongside credits are counted`,usageCreditKpiCredits:`Credits deducted`,usageCreditKpiCreditsSub:`from upstream usage.credit`,usageCreditKpiTokens:`Matched tokens`,usageCreditKpiTokensSub:`tokens observed with credits`,usageCreditKpiAvg:`Avg credits / 1M tokens`,usageCreditKpiAvgSub:`lower is cheaper`,usageCreditKpiSamples:`Valid samples`,usageCreditKpiSamplesSub:`rows missing the field are excluded`,usageCreditKpiCache:`Cache hit rate`,usageCreditKpiCacheSub:`hit / (hit + miss) · low hit multiplies cost`,usageCreditColRate:`Rate`,usageCreditColCredits:`Credits`,usageCreditColSampleTokens:`Sample tokens`,usageCreditColPer1M:`Credits / 1M`,quota:`Quota`,quotaUsed:`Used`,quotaRemaining:`Remaining`,quotaDaily:`Daily quota`,quotaWeekly:`Weekly quota`,quotaMonthly:`Monthly quota`,quotaFiveHour:`5-Hour Limit`,quotaWeeklyLimit:`Weekly Limit`,quotaPlan:`Plan`,quotaMonthlyLimit:`Monthly Limit`,quotaUsedPercent:`{n}% used`,quotaResetsSoon:`Resets soon`,quotaResetsInMinutes:`Resets in {n} minutes`,quotaResetsInHours:`Resets in {n} hours`,quotaExpiresOn:`{amount}{unit} expire on {date}`,quotaAddOn:`Add-on`,quotaResourcePackage:`Resource package`,quotaExceeded:`Quota exceeded`,errorKind:`Error kind`,qoderLoginHint:`This signs in the upstream account only. It does not change the console password.`,needQoderLogin:`Needs account login`,waitingQoderLogin:`Waiting for account login…`,qoderLoginDone:`Account login completed`,rewarmDone:`Rewarm completed`,accountsSigned:`{n} / {total} accounts ready`,addAccount:`Add account`,batchImport:`Batch import`,batchImportLoading:`Importing WorkBuddy accounts…`,batchImportUnrecognized:`Could not recognize this credential file format.`,batchImportConfirmTitle:`Confirm batch import`,batchImportConfirmHint:`Detected from {file}. Review and confirm before importing.`,batchImportConfirmHintNoFile:`Review the detected format, then confirm to import.`,batchImportRegion:`WorkBuddy region`,batchImportRegionPickHint:`Region was unclear — pick CN or Global before importing.`,batchImportRegionMixed:`This pack mixes CN and Global domains. Split it, or pick one region to force.`,batchImportRegionUnknown:`Region not detected from domains — please confirm.`,batchImportUnknownFormat:`Unknown format field; guessed from shape.`,batchImportProviderUnsupported:`Batch import for this provider is not supported yet. Detection is ready for a future release.`,batchImportConfirmAction:`Import`,batchImportFormatUnknown:`Unknown format`,batchImportProviderUnknown:`Unknown provider`,accountName:`Account name`,accountNameRequired:`Enter an account name.`,accountCreated:`Account created. Session is starting.`,importCredential:`Import native credential`,accountImported:`Credential imported and runtime started.`,accountImportBatch:`Imported {n} accounts.`,accountImportPartial:`Imported {ok}, failed {fail}.`,credentialCopied:`Credential bundle copied.`,addAccountTitle:`Add account`,accountType:`Account type`,loginMethod:`Login method`,accountTypeHint:`Choose the upstream login family for this isolated runtime.`,accountTypeQoderGlobal:`Qoder Global`,accountTypeQoderGlobalHint:`Qoder Global via browser, PAT, or imported credential`,accountTypeQoderCN:`Qoder CN`,accountTypeQoderCNHint:`Qoder China via browser, PAT, or imported credential`,accountTypeWorkBuddyCN:`WorkBuddy CN`,accountTypeWorkBuddyCNHint:`CodeBuddy CN via browser login or imported credential`,accountTypeWorkBuddyGlobal:`WorkBuddy Global`,accountTypeWorkBuddyGlobalHint:`WorkBuddy Global via browser login or imported credential`,accountTypeTraeCN:`Trae CN Solo`,accountTypeTraeCNHint:`Trae China Solo via browser login or imported credential`,accountTypeDevinGlobal:`Devin (experimental)`,accountTypeDevinGlobalHint:`Experimental Devin Global via browser OAuth or session token import`,accountTypeCommandGlobal:`Command Code`,accountTypeCommandGlobalHint:`Command Code via a pasted user_… key. Speaks the CLI /alpha/generate protocol, so every plan works, including the $1 Go plan.`,accountTypeCodexGlobal:`Codex`,accountTypeCodexGlobalHint:`OpenAI Codex via Codex CLI OAuth, Sign in with ChatGPT, or an imported credential`,accountTypeZhipuCN:`Zhipu GLM`,accountTypeZhipuCNHint:`Zhipu GLM with an API key. Choose pay-as-you-go or Coding Plan, the same way the upstream account is billed.`,accountTypeQwenworkGlobal:`QwenWork International`,accountTypeQwenworkGlobalHint:`QwenWork international (qwenwork.ai) via browser OAuth or imported credential. The authorization link is single-use: open it directly in a browser already signed in to the target account, and do not send it through chat tools.`,accountTypeQwenworkCN:`QwenWork CN`,accountTypeQwenworkCNHint:`千问办公 China (qwenwork.cn) via browser OAuth or imported credential. The authorization link is single-use: open it directly in a browser already signed in to the target account, and do not send it through chat tools. The CN region has not yet been verified with a real account.`,accountTypeKimiCN:`Kimi Code CN`,accountTypeKimiCNHint:`Kimi Code China subscription via device-code sign-in against auth.kimi.com. Uses the same OAuth client as the official CLI, so the login you already completed with Kimi Code can be pasted in as its credential JSON.`,addAccountDesc:`Create an isolated account session. Each account keeps its own runtime home.`,tabBrowser:`Browser login`,tabPat:`PAT`,tabImport:`Import credential`,recommended:`Recommended`,wizardSettings:`Account settings`,wizardAdvanced:`Advanced options`,wizardContinue:`Continue`,wizardBack:`Back`,wizardSettingsHint:`Set these before login. You can still change them later from Edit on the account card.`,editAccount:`Edit`,editAccountTitle:`Edit {name}`,editAccountHint:`Change the display name, concurrency, routing priority, outbound proxy, model aliases, and check-in time when supported.`,accountModelAliases:`Aliases`,accountModelAliasesHint:`A name this account answers as. The request is rewritten to this account's real model after the account is picked.`,accountModelAliasTargetPlaceholder:`real model on this account`,modelAliasName:`Alias`,modelAliasTarget:`Real model`,modelAliasAdd:`Add`,modelAliasRemove:`Remove`,modelAliasPlaceholder:`kimi-k3`,enabledModels:`Models`,enabledModelsHint:`Leave unrestricted to serve the whole catalog. Restrict to choose which models this account may serve.`,restrictModels:`Only selected models`,allModels:`All models`,modelPickerSearch:`Search models`,modelPickerCount:`{selected} / {total} selected`,modelPickerSelectAll:`Select all`,modelPickerClear:`Clear`,modelPickerOffline:`Offline`,modelPickerRemove:`Remove {model}`,modelPickerNoMatch:`No matching models.`,maxInflightInvalid:`Concurrency must be an integer from 1 to 32.`,priorityInvalid:`Priority must be an integer from 1 to 100.`,wizardNamePh:`Account name`,maxInflightHint:`How many chats this account may run at once. Changing it later restarts the worker.`,priorityHint:`Higher numbers are preferred when routing later uses this field. Default 50.`,proxyUrl:`Proxy URL`,proxyUrlPlaceholder:`http://127.0.0.1:7890, direct`,proxyUrlHint:`Blank inherits the global proxy. Use direct or none to bypass proxies for this account. Qoder supports HTTP(S) only; WorkBuddy/Trae also support SOCKS5.`,proxySettingsTitle:`Outbound proxy`,proxySettingsHint:`Set the default proxy for upstream requests. Global proxies support HTTP(S) only. SOCKS5 is available for WorkBuddy/Trae account-level proxies. Account-level settings override it.`,dropSystemPromptCreateHint:`WorkBuddy only. Strip caller system prompts, then send an empty leading system slot so Global still accepts the request.`,wizardBrowserLead:`Shows the authorization URL. Open or copy it, finish in the browser, and this wizard continues automatically.`,wizardCodexBrowserLead:`Choose Codex CLI or Sign in with ChatGPT, then open the authorization URL. ChatGPT website logins need Sign in with ChatGPT; the CLI flow cannot refresh those tokens.`,codexLoginMethod:`Codex login`,codexLoginCli:`Codex CLI`,codexLoginCliHint:`Official Codex CLI OAuth. Use this for CLI-issued credentials.`,codexLoginChatGPT:`Sign in with ChatGPT`,codexLoginChatGPTHint:`ChatGPT website login. Stores a separate token that refreshes at a different endpoint.`,startCodexCliLogin:`Start Codex CLI login`,startCodexChatGPTLogin:`Sign in with ChatGPT`,wizardStartBrowser:`Start browser login`,wizardStartingSession:`Starting the account session…`,wizardWaitingBrowser:`Waiting for authorization in the browser…`,wizardCallbackLead:`If the browser stays on 127.0.0.1 and this console never finishes, copy the full address-bar URL here.`,wizardCallbackPh:`Paste the full http://127.0.0.1…/authorize?… URL`,wizardSubmitCallback:`Submit callback URL`,wizardStartingWorker:`Authorization received. Starting account session…`,wizardAccountReady:`Account is ready.`,wizardLoginTimeout:`Timed out waiting for browser login. You can retry from the account card.`,wizardPatLead:`Use a personal access token when the browser flow is inconvenient.`,wizardPatLeadCN:`Create a PAT at qoder.com.cn/account/integrations, then paste it here.`,wizardPatLeadCommand:`Paste your Command Code key (it looks like user_…, from commandcode.ai/settings).`,zhipuApiKey:`API key`,zhipuApiKeyPh:`Paste the key from open.bigmodel.cn`,zhipuAccountMode:`Account mode`,zhipuModePayg:`Pay as you go`,zhipuModePaygHint:`Billed by token. Uses the standard GLM endpoint.`,zhipuModeCoding:`Coding Plan`,zhipuModeCodingHint:`Subscription plan. Uses the Coding Plan endpoint and shows its quota.`,zhipuOrganization:`Organization ID`,zhipuOrganizationPh:`Optional, for a team Coding Plan`,zhipuProject:`Project ID`,zhipuProjectPh:`Optional`,zhipuCreate:`Add Zhipu account`,zhipuKeyRequired:`Paste the Zhipu API key first.`,wizardPatPh:`Paste personal access token`,wizardCreateAndLogin:`Create and sign in`,wizardImportLead:`Paste a credential JSON export. WorkBuddy hub packages import every account in the file.`,wizardImportPh:`Paste credential JSON`,wizardChooseFile:`Choose file`,wizardBadJson:`That does not look like a valid credential bundle.`,reLogin:`Sign in`,cancel:`Cancel`,close:`Close`,create:`Create`,import:`Import`,export:`Export`,enable:`Enable`,disable:`Disable`,disabled:`Disabled`,delete:`Delete`,holdToDelete:`Hold to delete`,trendHalfHint:`Second half of the window vs the first half`,toastRefreshingAccount:`Refreshing account…`,toastAccountRefreshed:`Account refreshed`,toastRefreshingCredits:`Refreshing credits…`,toastCreditsRefreshed:`Credits refreshed`,toastAccountAdded:`Account added`,toastAccountDeleted:`Account deleted`,toastClearingLogs:`Clearing request logs…`,toastLogsCleared:`Request logs cleared`,toastKeyDeleted:`API key deleted`,toastFailed:`Operation failed`,deleteAccountConfirm:`Delete account {name}? This removes its local runtime and stored credential.`,edit:`Edit`,enabled:`Enabled`,keysLead:`Client keys call /v1. Leave providers empty to allow every family. The console key stays on System.`,keysCreate:`Create key`,keysEmpty:`No client keys yet`,keysEmptyHint:`Create a named key for OpenAI-compatible clients. It cannot sign in to this console.`,keysCreateTitle:`Create API key`,keysCreateHint:`The secret is shown once. Store it in the client that will call /v1.`,keysEditTitle:`Edit API key`,keysEditHint:`Rename the key or change which providers it may route to.`,keysName:`Name`,keysNamePh:`CI bot`,keysNameRequired:`Name is required.`,keysProviders:`Providers`,keysProvidersHint:`Restrict this key to specific provider regions. Leave all unchecked to allow every provider.`,keysAllProviders:`All providers`,keysAllRegions:`All regions`,keysProvidersNotLoaded:`Provider list is still loading. Saving is disabled so the key permissions stay unchanged.`,keysProvidersLoadFailed:`Failed to load provider list: {message}`,keysLastUsed:`Last used {time}`,keysNeverUsed:`Not used yet`,keysSecretTitle:`Store this secret now`,keysSecretHint:`This value is not stored in plaintext. It will not be shown again.`,keysSecretOnce:`Copy the key before closing this dialog.`,keysDeleteConfirm:`Delete API key {name}? Clients using it will fail immediately.`,consoleKeyTitle:`Console API key`,consoleKeyHint:`This is the administrator key used to sign in here.`,consoleKeyLead:`It can call every provider and manage accounts, keys, and updates. Client keys live on the API keys page.`,consoleKeyRotate:`Rotate key`,consoleKeyRotateHint:`Rotating signs you out of other sessions and restarts Qoder workers so they pick up the new secret.`,consoleKeyRotateNow:`Rotate now`,consoleKeySecretTitle:`New console key`,consoleKeySecretHint:`This browser session is already updated. Copy the key for any other clients that used the old console secret.`},zh:{brandSub:`登录态网关`,controlPlane:`控制平面`,workspace:`工作区`,develop:`开发`,system:`系统`,runtimeSnapshot:`运行时与调度器快照`,routesHint:`OpenAI / Anthropic 兼容端点`,clientConfig:`客户端配置`,clientConfigHint:`使用与控制台相同的密钥作为 Bearer Token`,providerPrefixHint:`用 qoder/、workbuddy/、trae/、devin/、command/、codex/、zhipu/、qwenwork/ 或 kimi/ 前缀指定供应商。客户端 API 密钥也可以限制可见和可调度的供应商。不带前缀时是否跨供应商,由系统设置里的模型池决定。`,authentication:`认证方式`,curlExample:`curl 示例`,quickTestHint:`通过所选账号发送一条真实请求`,response:`响应`,providerCatalog:`模型目录`,providerCatalogMeta:`已登录 / 实时`,accountPool:`账号池`,accountCreateHint:`先创建隔离运行时,再通过浏览器或 PAT 登录。`,credentialImportHint:`仅支持从本控制台导出、且 user blob 与 machine ID 匹配的凭证包。`,accountEmptyHint:`创建一个账号运行时后即可开始。`,oauthDeviceFlow:`OAuth 浏览器登录`,navOverview:`概览`,navAuth:`账号`,navProviders:`模型`,navAccess:`接入与调试`,navAccounts:`账号`,checkinDefaultsTitle:`自动签到`,checkinDefaultsHint:`按供应商设置默认时间。跟随默认的账号会立即采用新时间,账号自定义时间不受影响。`,checkinDisabledAccountsTitle:`停用账号也自动签到`,checkinDisabledAccountsHint:`开启后,停用聊天功能的账号仍可执行已开启的自动签到;停用账号仍不可手动签到。`,checkinDisabledAccountsStatus:`当前状态`,checkinDisabledAccountsAriaLabel:`允许停用账号自动签到`,checkinInherit:`跟随供应商默认`,checkinDefaultValue:`供应商默认:{time}`,checkinCustom:`账号自定义`,checkinScheduleHint:`按显示的时区执行,通常在设定时间后的约 90 秒内开始,多账号顺序处理可能延后;较早的失败会在约 21:00 重试一次,活动未开放则当天跳过。签到不影响聊天。`,checkinTimeInvalid:`请输入有效的签到时间(HH:mm)。`,checkinRecordSkipped:`活动未开放`,navUsage:`用量`,usageTitle:`用量`,usageLead:`按模型、账号与供应商查看请求、延迟、token 与积分。`,usageByModel:`模型`,usageByAccount:`账号`,usageByProvider:`供应商`,usageColRequests:`请求`,usageColSuccess:`成功率`,usageColTokens:`Tokens`,usageColCacheWrite:`缓存写入`,usageColCredits:`积分`,usageRowCount:`{count} 行`,usageEmpty:`该时间窗口内没有请求。`,usageStatsTab:`统计`,usageCostTab:`额度`,usageCostLead:`按模型汇总各供应商的订阅额度与 token 用量。`,usageWindow:`时间范围`,usageWindow24h:`24 小时`,usageWindow7d:`7 天`,usageWindowTotal:`全部留存`,usageCredits:`已用额度`,usageCreditsHint:`所有 provider 合计消耗的订阅额度`,usageEstCost:`折合费用`,usageTotalTokens:`Token 总量`,usageRequests:`请求数`,usageModelCount:`{count} 个模型`,usageCacheHitRate:`缓存命中`,usageTokenSplitNote:`命中 / 未命中 / 输出`,usageChartTitle:`用量趋势`,usageChartHint:`按模型堆叠。可在额度与 token 之间切换。`,usageChartEmpty:`该时间范围内暂无用量。`,usageBreakdownTitle:`按模型明细`,usageBreakdownHint:`每个模型的 token 与订阅额度。`,usageColInputHit:`输入·缓存命中`,usageColInputMiss:`输入·缓存未命中`,usageColOutput:`输出`,usageColCost:`折合费用`,usageUnpricedCost:`无官方价`,usageColSplit:`高峰 / 闲时`,usageTotals:`合计`,usageRetentionHint:`请求日志按计划清理,因此「全部留存」只覆盖仍在库内的部分。`,usageRenderNote:`可选的 DeepSeek 官方列表价人民币折算。订阅账号并不按此计费——仅供对比。`,usagePeakNote:`高峰按北京时间周一至周五 09:00-12:00、14:00-18:00 估算;闲时为高峰一半。未处理法定节假日及调休。`,usageUnpricedHint:`以下模型没有列表价行,只计入额度与 token:{models}`,usageNoteTitle:`计算说明`,usagePriceTitle:`DeepSeek 官方价格表`,usagePriceHit:`缓存命中`,usagePriceMiss:`缓存未命中`,usagePriceOutput:`输出`,usagePriceBandOff:`闲时`,usagePriceBandPeak:`高峰`,usageOffPeak:`闲时`,usagePeak:`高峰`,usageChartMetric:`图表指标`,usageEstimateTitle:`DeepSeek 官方列表价折算`,usageEstimateHint:`有官方价的模型可查看人民币对比;默认折叠。`,usageEstimateChartTitle:`列表价趋势`,usageEstimateChartEmpty:`该时间范围内暂无 DeepSeek 计价用量。`,chartMetricRequests:`请求`,chartMetricTokens:`Tokens`,chartMetricLatency:`p95 延迟`,chartInput:`输入`,chartOutput:`输出`,chartCacheRead:`缓存读取`,chartTotal:`合计`,navLogs:`日志`,navKeys:`API 密钥`,navSystem:`系统设置`,sidebarFoot:`CLI 登录态网关`,sidebarInFlight:`当前并发 {count}`,systemSettingsTitle:`系统设置`,systemSettingsLead:`管理跨 Provider 路由、各供应商签到默认时间、系统更新、SQLite 保护和控制台管理员密钥。`,crossProviderModelPoolTitle:`跨 Provider 模型池`,crossProviderModelPoolHint:`开启后,不带 Provider 前缀的模型 ID 可以在匹配的 Qoder、WorkBuddy 和 Trae 账号之间调度;关闭后 bare ID 会被拒绝,必须使用带 Provider 前缀的模型 ID。`,crossProviderModelPoolStatus:`当前状态`,crossProviderModelPoolAriaLabel:`开启跨 Provider 模型池`,workbuddyCheckinSettingsTitle:`WorkBuddy 签到`,workbuddyCheckinSettingsHint:`新建 WorkBuddy 账号时使用的默认首次签到时间。已有账号会保留各自的时间,直到你单独修改。`,workbuddyCheckinSettingsFieldHint:`使用服务器本地时间。新建 WorkBuddy 账号会继承这里的时间,账号编辑页仍可单独覆盖。`,routingStrategyTitle:`账号调度策略`,routingStrategyHint:`选择就绪账号如何分担流量。填满优先会持续使用最高优先级账号,直到它不可用。最早到期优先只在同一供应商内部按最近的积分包到期日排序;没有积分包到期信息的供应商保持原有轮询。`,routingStrategy:`策略`,routingRoundRobin:`轮询`,routingWeightedRoundRobin:`加权轮询`,routingFillFirst:`填满优先`,routingFEFO:`最早到期优先(FEFO)`,routingWeight:`调度权重`,sessionAffinityTTL:`会话 TTL`,sessionAffinityHits:`粘性命中`,sessionAffinityMisses:`粘性未命中`,sessionAffinityEscapes:`粘性逃逸`,lastSessionMiss:`最近未命中`,lastSessionEscape:`最近逃逸`,checkUpdates:`检查更新`,versionUpdate:`版本更新`,latestVersionHint:`先下载最新版本,准备好后再点立即更新。`,updateAvailable:`有可用更新`,settingsTabGeneral:`常规`,settingsTabRouting:`路由调度`,settingsTabSecurity:`安全与数据`,settingsTabUpdates:`版本更新`,sidebarNewVersion:`新版本 {version}`,sidebarReleaseNotes:`更新日志`,sidebarGoToUpdate:`历史版本与回滚`,upToDate:`已是最新版本`,currentVersion:`当前版本`,latestVersion:`最新版本`,skippedBetweenLabel:`中间经过的版本`,releaseNotes:`更新内容`,updateNoNotes:`这个版本还没有说明。`,versionHistory:`历史版本`,versionCurrentBadge:`当前`,versionLatestBadge:`最新`,restoreThisVersion:`恢复此版本`,restoreVersionTitle:`恢复到 {version}?`,restoreVersionHint:`服务会切回这个版本。只有重启时才会暂停新请求。`,updaterReady:`这台机器可以更新`,updaterUnavailable:`这台机器暂时不能更新`,updaterNeedsHost:`当前进程不能替换自己的容器`,updaterUnavailableHint:`这一页可以检查新版本,但还不能在这台机器上安装更新。`,updaterNeedInstall:`用 deploy/install-updater.sh 或 deploy/install-updater.ps1 安装宿主机更新器,让它能调用 Docker。`,updaterNeedCompose:`Linux 需要把更新器 socket 挂进容器。Docker Desktop 用本机回环地址,而不是 Unix socket。`,updaterNeedRelease:`当前运行的必须是已发布的 GitHub Release,不能是本地或开发镜像。`,updateNow:`下载更新`,applyUpdateNow:`立即更新`,cancelUpdate:`取消下载`,discardPreparedImage:`放弃这次更新`,updateReadyHint:`更新已经下载好。点立即更新才会重启;在此之前不会暂停新请求。`,updateReadyTargetHint:`可以切换到 {version}。只有重启时才会暂停新请求。`,updateNewerReleaseHint:`又有更新的版本({latest})。可以先立即更新,或放弃这次下载后重新开始。`,updateStagedUnavailableHint:`请先更新宿主机更新器,才能使用分阶段更新。`,updateLegacyOneShotHint:`这台机器会一次下载并完成更新。之后的版本可以先下载,再点立即更新。`,rollbackToVersion:`恢复旧版本`,rollbackToVersionHint:`可以恢复到当前版本之前最近的三个版本。`,updateReloadingIn:`{seconds}s 后刷新`,updateInProgress:`更新中…`,updatePreparingImage:`正在下载更新…`,updatePreparingImageHint:`正在后台下载更新。当前版本会继续运行,下载完成后点立即更新才会切换。下载卡住时可以取消。`,updateApplyingHint:`正在安装更新。完成后会自动刷新这个页面。`,updateInProgressHint:`系统正在更新,准备就绪后会自动刷新页面。`,updateUnavailableHint:`暂时无法更新,请稍后重试。`,updateFailedHint:`更新未完成,请重试。`,updateCheckFailedHint:`暂时无法检查更新,请稍后重试。`,updatePreparingHint:`正在准备更新:检查版本并保存备份。现有连接可能会被中断,客户端可自行重试。`,updateRunningHint:`正在更新。完成后会自动刷新这个页面。`,updateReloadingHint:`更新完成,正在刷新页面…`,updateElapsed:`已用时 {seconds}s`,sqliteProtection:`SQLite 保护`,sqliteProtectionHint:`数据会留在原处,并在更新前创建经过校验的备份。`,sqliteBackupBeforeUpdate:`更新前创建并校验备份`,sqliteKeepFive:`保留最近 5 份备份`,sqliteRollbackTogether:`失败时同时恢复数据库和上一版本`,updateStatus:`更新状态`,noUpdateJob:`暂无更新任务`,confirmUpdate:`立即更新`,confirmUpdateHint:`系统会短暂停止接收新请求并保存备份。现有连接可能会被中断,客户端可自行重试。`,updateState_idle:`空闲`,updateState_unavailable:`不可用`,updateState_queued:`等待开始`,updateState_preparing:`准备中`,updateState_preparing_image:`正在下载更新`,updateState_checking:`正在检查版本`,updateState_backing_up:`正在保存备份`,updateState_submitting:`正在开始更新`,updateState_running:`正在更新`,updateState_pulling:`正在下载更新`,updateState_host_binary:`正在下载更新程序`,updateState_image_ready:`下载完成`,updateState_ready_to_apply:`可以立即更新`,updateState_recreating:`正在重启`,updateState_health_checking:`正在确认启动`,updateState_rolling_back:`正在恢复上一版本`,updateState_succeeded:`更新完成`,updateState_rolled_back:`已恢复上一版本`,updateState_failed:`更新失败`,checking:`检查中`,refresh:`刷新`,apiKey:`API Key`,apiKeyPh:`API Key`,needApiKey:`先用控制台密码登录才能加载数据。`,loginTitle:`进入控制台`,loginLead:`这台机器上的 CLI2API 代理已经在运行。请输入客户端访问 /v1 时使用的 API Key。`,loginDesc:`和接口 Authorization: Bearer 是同一把钥匙。`,loginFormTitle:`继续`,loginPassword:`控制台密码`,loginPasswordPh:`API Key`,loginNeedKey:`密码是空的。`,loginBadKey:`这把钥匙对不上这台机器。`,loginSubmit:`进入`,loggingInConsole:`核对中…`,loginHint:`只解锁本机控制台。账号登录在进入后的「账号」页。`,showPassword:`显示密码`,hidePassword:`隐藏密码`,signOut:`退出`,checkingSession:`正在检查登录态…`,refreshing:`刷新中`,pages:{home:{title:`概览`,desc:`查看运行状态、请求量与可用端点。`},auth:{title:`授权`,desc:`浏览器 device-flow 登录、PAT 登录,以及会话 rewarm。`},providers:{title:`模型`,desc:`已登录账号可用的模型,以及每个模型的上下文和推理默认值。`},access:{title:`接入与调试`,desc:`主区多轮对话试玩;下方可展开原始 API 调试。`},accounts:{title:`账号`,desc:`一个账号一个登录态。先走浏览器登录;浏览器不方便再用 PAT。`},usage:{title:`用量`,desc:`按模型、账号与供应商统计用量。`},logs:{title:`日志`,desc:`查看近期代理请求和进程输出。`},keys:{title:`API 密钥`,desc:`创建客户端密钥,并限制可用的供应商。`},system:{title:`系统设置`,desc:`管理跨 Provider 路由、系统更新、SQLite 保护和控制台管理员密钥。`},login:{title:`进入控制台`,desc:`和 /v1 使用同一把 API Key。`}},logsLead:`本机请求历史与运行时输出。`,logsRequests:`请求历史`,logsRuntime:`运行日志`,logsEmptyRequests:`还没有请求记录。`,logsEmptyRuntime:`还没有捕获到运行输出。`,logsSearchRuntime:`搜索运行输出…`,logsSearchRequestId:`搜索请求 ID`,logsSearchModel:`搜索模型`,logsSearchAccount:`搜索账号`,logsFilterIdAll:`全部请求 ID`,logsNoFilterOptions:`没有匹配项`,logsClear:`清空历史`,logsClearConfirm:`删除本机全部请求历史?`,logsColTime:`时间`,logsColAccount:`账号`,logsColProvider:`供应商`,logsColModel:`模型`,logsColReasoning:`推理`,logsColStatus:`状态`,logsColLatency:`延迟`,logsColTTFT:`首字`,logsColTokens:`Tokens`,logsTokensIn:`输入`,logsTokensOut:`输出`,logsTokensPoints:`{value} 点`,logsColStream:`模式`,logsStreamYes:`流式`,logsStreamNo:`同步`,logsFilterAll:`全部`,logsFilterOk:`成功`,logsFilterIncomplete:`未完成`,logsFilterError:`失败`,logsFilterCanceled:`取消`,logsFilterAccountAll:`全部账号`,logsFilterProviderAll:`全部供应商`,logsFilterModelAll:`全部模型`,logsFilterKindAll:`全部错误`,logsFilterStreamAll:`全部模式`,logsTimeRange:`时间`,logsTimeAll:`全部时间`,logsTime1h:`1 小时`,logsTime24h:`24 小时`,logsTime7d:`7 天`,logsTimeCustom:`自定义`,logsTimeFrom:`开始`,logsTimeTo:`结束`,logsKindQuota:`额度`,logsKindRateLimit:`限流`,logsKindAuth:`鉴权`,logsKindNotReady:`未就绪`,logsKindUnavailable:`不可用`,logsKindInvalidRequest:`非法请求`,logsKindModelNotAvailable:`模型不可用`,logsPageSize:`每页`,logsPage:`第 {page} / {pages} 页`,logsPrevPage:`上一页`,logsNextPage:`下一页`,logsNoMatch:`没有符合当前筛选的请求。`,logsLevelAll:`全部`,logsLevelInfo:`信息`,logsLevelWarn:`警告`,logsLevelError:`错误`,logsAttempts:`尝试记录`,logsRouting:`路由方式`,logsRouting_pool:`常规池`,logsRouting_pin:`显式指定`,logsRouting_sticky:`会话粘性`,logsRouting_sticky_escape:`粘性逃逸`,logsNoAttempts:`没有尝试详情。`,logsStreamDiagnostics:`流诊断`,logsMessageShape:`消息结构`,logsMessageCount:`消息数`,logsEmptyMessageIndexes:`空内容下标`,logsMessageRoles:`角色顺序`,logsCancellationSource:`取消来源`,logsUpstreamStatus:`上游状态`,logsSSEEvents:`SSE 事件数`,logsBytesRead:`读取字节数`,logsLastEvent:`最后事件`,logsStreamComplete:`已收到 [DONE]`,logsUsageDetail:`本次消耗`,logsCreditConsumed:`消耗点数`,logsDetailTitle:`请求详情`,logsRuntimeDetailTitle:`运行日志详情`,logsRuntimeLevel:`级别`,logsRuntimeSource:`来源`,logsRuntimeMessage:`日志内容`,logsShownTotal:`{shown} / {total}`,logsAutoRefresh:`实时`,failedLogs:`加载日志失败:{msg}`,homeEyebrow:`运行时`,homeDisplay:`网关状态`,homeLead:`运行状态之外,还能看到本机请求量、延迟和 token。`,metricRequests:`请求`,metricSuccess:`成功率`,metricLatency:`p95`,metricTokens:`Tokens`,statsWindow1h:`1小时`,statsWindow24h:`24小时`,statsWindow7d:`7天`,statsWindow30d:`30天`,statsWindowCustom:`自定义`,statsWindowToday:`今天`,statsRefreshPause:`暂停自动刷新`,statsRefreshResume:`恢复自动刷新`,statsRefreshAuto:`每 30 秒刷新 · 点击暂停`,statsRefreshPaused:`自动刷新已暂停 · 点击恢复`,statsDragHint:`拖选时间段查看日志`,statsWindowHint:`{window}窗口`,statsTraffic:`流量`,statsTrafficHint:`所选时间窗口内的已完成聊天请求`,statsEmptyTraffic:`这个时间窗口还没有请求。`,statsLatencyP50:`p50`,statsLatencyP95:`p95`,statsLatencyAvg:`平均`,statsTTFB:`TTFB`,statsPool:`账号池`,statsPoolHint:`就绪 worker 与剩余额度`,statsCooling:`冷却中`,statsTopModels:`热门模型`,statsTopAccounts:`热门账号`,statsTopProviders:`供应商`,statsTopProvidersHint:`按账号类型统计请求量`,statsNoProviders:`还没有供应商流量。`,statsErrorMix:`错误构成`,statsStatusMix:`结果与错误`,statsStatusMixHint:`请求状态、失败类型与热门账号`,statsCoolingDetails:`冷却中 · 原因 · 剩余 · 退避`,statsBackoffLevel:`重启退避等级`,statsAffinityHit:`会话亲和命中`,statsAffinityHint:`命中 {hits} · 未命中 {misses} · 绑定 {bindings}`,metricCacheHit:`缓存命中率`,metricCacheHitDetail:`缓存 {read} / 输入 {prompt}`,metricStreaming:`流式占比`,metricStreamingDetail:`{total} 次请求中 {count} 次`,metricCanceled:`已取消`,metricCanceledDetail:`占请求 {rate}`,statsErrorMixHint:`该窗口内已分类的失败`,statsNoModels:`还没有模型流量。`,statsNoAccounts:`还没有账号流量。`,statsNoErrors:`没有分类错误。`,statsUnknown:`未知`,statsUnassigned:`未分配`,resTitle:`资源占用`,resHint:`主机进程内存与 CPU`,resServer:`主进程`,resWorkers:`Worker`,resEmpty:`还没有 worker 进程。`,resGoroutines:`个协程`,resCpuLifetime:`生命周期均值`,failedStats:`加载统计失败:{msg}`,homeNote:`已登录本机控制台。账号登录在「账号」页。`,metricRuntime:`运行状态`,metricAccounts:`账号`,metricModels:`模型`,metricAuth:`登录态`,metricPort:`端口`,serviceDetail:`服务详情`,endpoints:`可用端点`,copyBaseUrl:`复制 Base URL`,copied:`已复制`,copy:`复制`,open:`打开`,waitingOverview:`等待概览数据…`,signIn:`登录`,connectQoder:`连接账号`,rewarm:`Rewarm`,rewarming:`Rewarm 中`,refreshAccount:`刷新`,refreshingAccount:`刷新中`,stepBrowserTitle:`浏览器 Device Flow`,stepBrowserDesc:`打开账号选择页。浏览器完成授权后,本页会轮询直到会话就绪。`,startBrowserLogin:`用浏览器登录`,starting:`启动中…`,quotaLoading:`额度获取中…`,quotaUnavailable:`额度不可用`,authUrl:`授权链接`,openAuthUrl:`打开链接`,stepPatTitle:`个人访问令牌`,stepPatDesc:`浏览器流程不方便时,可用 PAT 作为备选。`,pat:`PAT`,pasteToken:`粘贴 token`,loginWithPat:`使用 PAT 登录`,loggingIn:`登录中…`,localState:`本地状态`,raw:`原始数据`,noAuthSnapshot:`暂无授权快照。`,catalog:`目录`,availableModels:`可用模型`,modelsPulled:`来源`,filter:`筛选`,filterPh:`glm / qwen / deepseek`,providerFilterAll:`全部供应商`,accountStatusFilter:`账号状态`,connection:`连接信息`,apiPlayground:`接入与调试`,apiPlaygroundHint:`选择账号与模型,主区对话试玩;下方可展开原始 API 查看 JSON 与 curl。`,readyAccounts:`{ready} / {total} 个账号就绪`,baseUrl:`Base URL`,externalClients:`外部客户端`,protocol:`协议`,quickTest:`快速测试`,requestBuilder:`请求编排`,responseInspector:`响应检查`,responseInspectorHint:`本地代理返回的原始 JSON`,requestIdle:`等待请求`,requestComplete:`请求完成`,requestFailed:`请求失败`,responseReceived:`已收到响应`,responseEmptyTitle:`还没有响应`,responseEmptyHint:`选择路由、填写提示词并发送请求,原始响应会显示在这里。`,sendRequest:`发送请求`,promptPlaceholder:`输入要发送给模型的内容`,promptHelper:`测试请求使用非流式 Chat Completions。`,accessTabChat:`对话`,accessTabApi:`原生 API`,accessTabsLabel:`接入方式`,chatTryEmptyTitle:`还没有回复`,chatTryEmptyHint:`在下方输入消息。账号与模型在输入框底栏。离开页面后会话清空。`,chatTryHelper:`Enter 发送 · Shift+Enter 换行。附件随本轮发送。`,chatTrySend:`发送`,chatTryStop:`停止`,chatTryStreaming:`生成中…`,chatTryUserLabel:`你`,chatTryAssistantLabel:`助手`,chatTryCreditsUsed:`消耗 {amount} credits`,chatTryUsageTokens:`{prompt} → {completion}`,chatTryUsageFoot:`{tokens} · {amount} credits`,nativeApiHint:`非流式请求、原始 JSON 响应,以及对应的 curl 命令。`,rawApiShow:`展开原始 API`,rawApiHide:`收起原始 API`,chatAttach:`添加附件`,chatAttachRemove:`移除附件`,chatAttachUnsupported:`不支持的文件类型:{names}`,thinkingPhaseScan:`检索中`,thinkingPhasePlan:`规划中`,thinkingPhaseDraft:`起草中`,thinkingDone:`已思考`,thinkingElapsed:`{n}s`,toolCallGroup:`用了 {n} 个工具`,chatDemoLoad:`预览样例`,thinkingChars:`{count} 字`,thinkingWorking:`思考中`,toolCallRunning:`进行中`,toolCallSuccess:`完成`,toolCallError:`失败`,toolCallUntitled:`工具`,toolCallArgs:`参数`,toolCallArgsEmpty:`(空)`,autoAccountHint:`由调度器选择一个可用账号。`,fixedAccountHint:`本次请求固定发送到所选账号。`,modelRoutingHint:`使用当前代理暴露的公开模型 ID。`,accountModelHint:`只列出该账号当前能提供的模型。钉死账号后,目录里没有的 ID 会请求失败。`,noAccountModels:`这个账号目前没有可发送的模型。`,accountModels:`可用模型`,accountModelsTitle:`{name} 的模型`,accountModelsHint:`该账号的实时目录。钉到此账号的请求只会使用这些 ID。`,accountModelsEmpty:`这个账号还没有公布模型目录。`,accountModelsError:`无法加载模型:{msg}`,noAccountsForTest:`暂无可用账号运行时,请先添加账号并完成登录。`,curlGeneratedHint:`根据当前账号、模型和提示词实时生成`,prompt:`提示词`,model:`模型`,send:`发送`,waitingRequest:`等待请求…`,requesting:`请求中…`,endpointOpenAI:`OpenAI 兼容`,endpointChat:`Chat Completions`,endpointBaseHint:`在 OpenAI 兼容客户端中,将此地址作为 Base URL。`,endpointChatHint:`OpenAI 兼容对话。模型 ID 加前缀即可指定供应商,例如 qoder/glm-5.2。`,endpointMessages:`Anthropic Messages`,endpointMessagesHint:`无状态 Anthropic Messages。使用带供应商前缀的模型 ID 即可钉死一家。`,endpointResponses:`OpenAI Responses`,endpointResponsesHint:`无状态 OpenAI Responses。使用带供应商前缀的模型 ID 即可钉死一家。`,endpointModels:`模型列表`,endpointModelsHint:`公开模型 ID。客户端 API 密钥只会看到其允许供应商的模型。`,endpointHealth:`健康检查`,endpointHealthHint:`检查本地代理是否正在响应。`,endpointCount:`{count} 个 API 端点`,endpointReady:`当前可用`,endpointBaseLabel:`客户端 Base URL`,endpointAuthLabel:`Bearer API Key`,hasUserBlob:`已有 user blob`,userBlobBytes:`user blob 大小`,machineId:`Machine ID`,sessionHot:`会话热状态`,upstreamEndpoint:`上游端点`,rewarmCount:`Rewarm 次数`,proxy:`Proxy`,endpoint:`端点`,lastError:`最近错误`,running:`运行中`,down:`离线`,hot:`热就绪`,up:`在线`,ready:`就绪`,missing:`缺失`,degraded:`降级`,error:`错误`,yes:`是`,no:`否`,modelCol:`模型`,mappedKeyCol:`上游 Key`,requestIdCol:`请求 ID`,providerCol:`供应商`,qoderKeyCol:`上游 Key`,routedTo:`上游模型 {model}`,stateCol:`状态`,contextWindowCol:`上下文窗口`,modelDefaultsCol:`上下文与推理`,contextConfigHint:`这里改的是默认值。请求里如果指定了更大上下文或推理强度,仍以请求为准。`,qoderContextHint:`请求没写上下文长度时使用的默认窗口。`,contextInvalid:`上下文窗口必须是 1,024 到 4,000,000 之间的整数。`,contextSaved:`已保存 {model} 的上下文窗口。`,contextReset:`已恢复 {model} 的默认上下文窗口。`,contextMaxOn:`已开启 {model} 的更大上下文。`,contextMaxOff:`已关闭 {model} 的更大上下文。`,contextMaxUnavailable:`这个模型没有更大上下文开关。`,maxMode:`更大上下文`,maxModeHint:`Trae 的更大上下文窗口,常见是 200k 提到 1M,不是套餐也不是额度。只在请求没带 is_max_mode 时使用;请求里写了仍以请求为准。模型不支持时不会发送这个开关。`,qoderMaxModeHint:`Qoder 的更大上下文窗口,不是套餐也不是额度。开启时请求使用该模型的最大窗口;关闭时(或请求自带上下文窗口时)使用默认窗口。`,catalogWindow:`目录默认窗口`,catalogWindowHint:`这个 Trae 模型没有更大上下文开关,数字是目录里的默认窗口。`,workbuddyContextHint:`WorkBuddy 桌面端目录里的默认窗口和可选窗口,用于本地压缩预算,不是 Trae 的 is_max_mode。聊天请求不会发送窗口开关。`,reasoningLevels:`推理强度`,reasoningHint:`请求没指定推理强度时使用的默认档位。选了不会强制每次都走这一档,也不会限制客户端改用其他允许档位。不在列表里的值会回退到可用档位,而不是锁死。`,reasoningFixed:`固定思考:{type}`,noReasoningLevels:`这个模型没有可选的推理档位。`,reasoningSaved:`已保存 {model} 的默认推理强度:{level}。`,reasoningLevel_none:`关闭`,reasoningLevel_low:`低`,reasoningLevel_medium:`中`,reasoningLevel_high:`高`,reasoningLevel_xhigh:`极高`,reasoningLevel_max:`最强推理`,modelDetails:`详情`,promptMaxTokens:`输入上限`,maxOutputTokens:`输出上限`,actions:`操作`,save:`保存`,custom:`自定义`,defaultValue:`默认`,resetDefault:`恢复默认`,fallback:`回退`,modelFree:`免费`,shownTotal:`显示 {shown} / 共 {total}`,noModelsYet:`暂无模型`,noModelsMatch:`没有匹配的模型。`,noProviders:`尚未加载供应商。`,failedOverview:`概览加载失败:{msg}`,pastePatFirst:`请先粘贴 PAT`,patDone:`PAT 登录完成`,loginOpenMsg:`请在浏览器打开授权链接完成登录`,idle:`空闲`,menu:`菜单`,toggleSidebar:`收起侧栏`,accountsTitle:`账号`,accountsDesc:`一个账号一个登录态。Chat 会 round-robin,失败切下一个。`,noAccounts:`还没有账号,添加一个即可开始服务。`,accountCount:`账号`,signedIn:`已登录`,enabledAccounts:`已启用`,availableAccounts:`可用`,needsAttention:`需处理`,searchAccounts:`搜索名称、账号 ID、UID、提供方或认证类型`,filterAll:`全部`,shownAccounts:`{shown} / {total}`,noAccountsMatch:`没有符合当前条件的账号。`,clearFilters:`清除筛选`,more:`更多操作`,partialCooling:`部分模型冷却`,runtimeState:`运行状态`,maxInflight:`最大并发`,priority:`优先级`,updatedAt:`更新于`,enabledState:`已启用`,cooling:`冷却中`,dead:`恢复中`,authFailed:`登录失败`,patFallback:`PAT 备选`,usePat:`用 PAT`,account:`账号`,autoAccount:`自动(轮询)`,cooldown:`冷却`,inFlight:`进行中`,liveConcurrency:`当前并发`,liveRpm:`近 60 秒`,liveRpmUnit:`次`,liveRpmHint:`最近一分钟发起`,liveTrace:`走势`,livePeak:`峰值 {n}`,liveSaturated:`已满载`,restarts:`重启次数`,dropSystemPrompt:`丢弃系统提示词`,dropSystemPromptHint:`发送前剥离调用方的系统提示词;仍会补一条空的 system,避免国际版要求第一条必须是系统提示词`,autoCheckin:`每日签到`,autoCheckinHint:`按账号配置的本地时间自动领取 WorkBuddy 积分;失败会在约 21:00 重试。默认关闭。`,autoCheckinCreateHint:`仅 WorkBuddy。开启后按该账号的签到时间自动领取积分;未改时间时使用系统默认。`,autoCheckinTime:`签到时间`,autoCheckinTimeHint:`使用服务器本地时间,并在所选时间后的约 14 分钟内执行;首次失败会在约 21:00 重试。新建账号默认继承系统设置。`,checkinNow:`立即签到`,lastCheckin:`最近签到`,lastCheckinNone:`还没有签到记录`,checkinStatus:`签到`,checkinToday:`今日已签到`,checkinPending:`今日未签到`,checkinFailed:`签到异常`,checkinRecords:`签到记录`,checkinRecordsTitle:`签到记录 · {name}`,checkinRecordsHint:`显示该账号最近 20 次签到结果。`,checkinRecordsEmpty:`还没有签到记录`,checkinRecordsCount:`{count} 条记录`,checkinRecordSuccess:`成功`,checkinRecordAlready:`已签到`,checkinRecordFailed:`失败`,refreshCredits:`刷新积分`,expiryDistTitle:`积分到期分布`,expiryDistHint:`按自然日聚合 · 颜色区分账号 · FEFO:上游按失效时刻先后优先扣减`,expiryDistExpand:`展开全部 {n} 天`,expiryDistCollapse:`收起`,expiryDistDayTotal:`到期 {n} 积分`,expiryDistColAccount:`账号`,expiryDistColSoonest:`最近到期`,expiryDistColDaysLeft:`距到期`,expiryDistColBatch:`该日到期`,expiryDistColDaily:`日均需耗`,expiryDistDays:`{n} 天`,expiryDistFoot:`「日均需耗」= 最近到期那天的积分 ÷ 距该日天数,即到期前需要消耗的速度。`,expiryDistExpired:`已过期`,usageDetailTitle:`用量明细`,usageDetailHint:`与上方同一时间窗口 · 按维度看 token、缓存命中率与延迟`,usageDimNote:`共 {n} 行(最多 20)· 请求数含失败尝试 · 口径与用量页 top-N / 缺测规则不同`,usageDimAccount:`按账号`,usageDimModel:`按模型`,usageDimRealm:`按域`,usageSortTotal:`合计 Token`,usageSortRequests:`请求数`,usageSortErrors:`失败数`,usageSortLatency:`平均延迟`,usageColAccount:`账号`,usageColModel:`模型`,usageColRealm:`域`,usageColErrors:`失败`,usageColPrompt:`Prompt`,usageColCacheHit:`缓存命中率`,usageColCompletion:`Completion`,usageColTotal:`合计`,usageColAvgLatency:`均延迟`,usageCreditTitle:`积分扣除历史`,usageCreditHint:`按上游 usage.credit 累计 · 未观测到积分的请求不计入`,usageCreditEmpty:`暂无积分扣除记录;升级前仅含 Token 的历史不会伪造积分。`,usageCreditNote:`{accounts} 个账号 · {models} 个模型倍率分组 · 仅统计与积分同时观测到的 Token`,usageCreditKpiCredits:`扣除积分`,usageCreditKpiCreditsSub:`按上游 usage.credit 累计`,usageCreditKpiTokens:`匹配 Token`,usageCreditKpiTokensSub:`与积分同时观测到的 Token`,usageCreditKpiAvg:`平均积分 / 1M Token`,usageCreditKpiAvgSub:`越低越划算`,usageCreditKpiSamples:`有效积分样本`,usageCreditKpiSamplesSub:`缺字段的历史不参与折算`,usageCreditKpiCache:`缓存命中率`,usageCreditKpiCacheSub:`命中 /(命中+未命中)· 低命中意味着费用翻倍`,usageCreditColRate:`积分倍率`,usageCreditColCredits:`扣除积分`,usageCreditColSampleTokens:`有效样本 Token`,usageCreditColPer1M:`积分 / 1M`,quota:`额度`,quotaUsed:`已用`,quotaRemaining:`剩余`,quotaDaily:`日额度`,quotaWeekly:`周额度`,quotaMonthly:`月额度`,quotaFiveHour:`5 小时额度`,quotaWeeklyLimit:`周额度`,quotaPlan:`订阅`,quotaMonthlyLimit:`月额度`,quotaUsedPercent:`{n}%`,quotaResetsSoon:`即将重置`,quotaResetsInMinutes:`{n} 分钟后重置`,quotaResetsInHours:`{n} 小时后重置`,quotaExpiresOn:`{amount}{unit} 将于 {date} 到期`,quotaAddOn:`附加包`,quotaResourcePackage:`资源包`,quotaExceeded:`额度已用尽`,errorKind:`错误类型`,qoderLoginHint:`这里登录的是该账号的上游登录态,不会改控制台密码。`,needQoderLogin:`需要账号登录`,waitingQoderLogin:`等待账号登录完成…`,qoderLoginDone:`账号登录完成`,rewarmDone:`Rewarm 完成`,accountsSigned:`{n} / {total} 个账号就绪`,addAccount:`添加账号`,batchImport:`批量导入`,batchImportLoading:`正在导入 WorkBuddy 账号…`,batchImportUnrecognized:`无法识别此凭证文件格式。`,batchImportConfirmTitle:`确认批量导入`,batchImportConfirmHint:`已从 {file} 识别。请核对后再导入。`,batchImportConfirmHintNoFile:`请核对识别结果,确认后再导入。`,batchImportRegion:`WorkBuddy 区`,batchImportRegionPickHint:`未能明确识别区,请先选择国内版或国际版。`,batchImportRegionMixed:`此包同时含国内与国际域名。请拆分后导入,或强制选择一个区。`,batchImportRegionUnknown:`未从域名识别出区,请确认。`,batchImportUnknownFormat:`未知 format 字段,已按形状猜测。`,batchImportProviderUnsupported:`该供应商暂不支持批量导入。识别结果已保留,便于后续扩展。`,batchImportConfirmAction:`导入`,batchImportFormatUnknown:`未知格式`,batchImportProviderUnknown:`未知供应商`,accountName:`账号名称`,accountNameRequired:`请输入账号名称。`,accountCreated:`账号已创建,会话正在启动。`,importCredential:`导入原生凭证`,accountImported:`凭证已导入,运行时已启动。`,accountImportBatch:`已导入 {n} 个账号。`,accountImportPartial:`成功 {ok},失败 {fail}。`,credentialCopied:`凭证包已复制。`,addAccountTitle:`添加账号`,accountType:`账号类型`,loginMethod:`登录方式`,accountTypeHint:`选择这个隔离运行时使用的上游登录类型。`,accountTypeQoderGlobal:`Qoder 国际版`,accountTypeQoderGlobalHint:`Qoder 国际版:浏览器、PAT 或导入凭证`,accountTypeQoderCN:`Qoder 国内版`,accountTypeQoderCNHint:`Qoder 中国大陆版:浏览器、PAT 或导入凭证`,accountTypeWorkBuddyCN:`WorkBuddy 国内版`,accountTypeWorkBuddyCNHint:`CodeBuddy 国内版:浏览器登录或导入凭证`,accountTypeWorkBuddyGlobal:`WorkBuddy 国际版`,accountTypeWorkBuddyGlobalHint:`WorkBuddy 国际版:浏览器登录或导入凭证`,accountTypeTraeCN:`Trae 国内版(Solo)`,accountTypeTraeCNHint:`Trae 国内 Solo:浏览器登录或导入凭证`,accountTypeDevinGlobal:`Devin(实验性)`,accountTypeDevinGlobalHint:`实验性 Devin 国际版:浏览器 OAuth 或导入 session token`,accountTypeCommandGlobal:`Command Code`,accountTypeCommandGlobalHint:`粘贴 user_… 密钥接入。走 CLI 的 /alpha/generate 协议,所有档位均可用(含 $1 Go 套餐)。`,accountTypeCodexGlobal:`Codex`,accountTypeCodexGlobalHint:`OpenAI Codex:Codex CLI OAuth、Sign in with ChatGPT,或导入凭证`,accountTypeZhipuCN:`智谱 GLM`,accountTypeZhipuCNHint:`填写智谱 API Key。按量付费或 Coding Plan 与上游账号的计费方式一致。`,accountTypeQwenworkGlobal:`QwenWork 国际版`,accountTypeQwenworkGlobalHint:`QwenWork 国际版(qwenwork.ai),浏览器授权或导入凭证。授权链接只能使用一次:请在已登录目标账号的浏览器窗口里直接打开,不要经聊天工具发送。`,accountTypeQwenworkCN:`千问办公 国内版`,accountTypeQwenworkCNHint:`千问办公国内版(qwenwork.cn),浏览器授权或导入凭证。授权链接只能使用一次:请在已登录目标账号的浏览器窗口里直接打开,不要经聊天工具发送。国内版尚未经真实账号验收。`,accountTypeKimiCN:`Kimi Code 国内版`,accountTypeKimiCNHint:`Kimi Code 中国区订阅,走 auth.kimi.com 的设备码授权,与官方 CLI 使用同一个 OAuth 客户端。已在本机登录 Kimi Code 的,可直接粘贴它的凭证 JSON 导入。`,addAccountDesc:`创建一个隔离会话并登录。每个账号使用独立的运行时目录。`,tabBrowser:`浏览器登录`,tabPat:`PAT`,tabImport:`导入凭证`,recommended:`推荐`,wizardSettings:`账号设置`,wizardAdvanced:`高级选项`,wizardContinue:`继续`,wizardBack:`返回`,wizardSettingsHint:`登录前先设好这些选项,之后仍可在账号卡片上点编辑修改。`,editAccount:`编辑`,editAccountTitle:`编辑 {name}`,editAccountHint:`修改显示名称、并发、调度优先级、代理出口和模型别名;支持签到的账号还可设置签到时间。`,accountModelAliases:`别名`,accountModelAliasesHint:`这个账号对外应答的名字。选中这个账号后,请求会换成它自己的真实模型。`,accountModelAliasTargetPlaceholder:`这个账号上的真实模型`,modelAliasName:`外号`,modelAliasTarget:`真实模型`,modelAliasAdd:`添加`,modelAliasRemove:`移除`,modelAliasPlaceholder:`kimi-k3`,enabledModels:`可用模型`,enabledModelsHint:`不限制时使用整个目录。限制后,这个账号只接选中的模型。`,restrictModels:`仅选中`,allModels:`全部模型`,modelPickerSearch:`搜索模型`,modelPickerCount:`已选 {selected} / 共 {total}`,modelPickerSelectAll:`全选`,modelPickerClear:`清空`,modelPickerOffline:`已下线`,modelPickerRemove:`移除 {model}`,modelPickerNoMatch:`没有匹配的模型。`,maxInflightInvalid:`并发必须是 1 到 32 之间的整数。`,priorityInvalid:`优先级必须是 1 到 100 之间的整数。`,wizardNamePh:`账号名称`,maxInflightHint:`这个账号同时能跑多少条对话。之后改并发会重启该账号的 worker。`,priorityHint:`数字越大,之后调度会越优先选这个账号。默认 50。`,proxyUrl:`代理地址`,proxyUrlPlaceholder:`http://127.0.0.1:7890、direct`,proxyUrlHint:`留空继承全局代理;填写 direct 或 none 可让此账号直连。Qoder 仅支持 HTTP(S),WorkBuddy/Trae 额外支持 SOCKS5。`,proxySettingsTitle:`统一代理出口`,proxySettingsHint:`设置所有上游请求的默认代理;全局代理支持 HTTP(S),SOCKS5 仅支持 WorkBuddy/Trae 的账号级代理;账号级代理优先于全局代理。`,dropSystemPromptCreateHint:`仅 WorkBuddy。剥离调用方系统提示词后仍补一条空的 system,避免国际版拒绝请求。`,wizardBrowserLead:`会展示授权地址。打开或复制后在浏览器完成授权,向导会自动继续。`,wizardCodexBrowserLead:`先选 Codex CLI 或 Sign in with ChatGPT,再打开授权地址。ChatGPT 网页登录必须走后者,CLI 流刷新不了那种 token。`,codexLoginMethod:`Codex 登录方式`,codexLoginCli:`Codex CLI`,codexLoginCliHint:`官方 Codex CLI OAuth,适合 CLI 签发的凭证。`,codexLoginChatGPT:`Sign in with ChatGPT`,codexLoginChatGPTHint:`ChatGPT 网页登录。凭证单独存储,刷新走另一套 token 端点。`,startCodexCliLogin:`开始 Codex CLI 登录`,startCodexChatGPTLogin:`Sign in with ChatGPT`,wizardStartBrowser:`开始浏览器登录`,wizardStartingSession:`正在启动账号会话…`,wizardWaitingBrowser:`正在等待浏览器完成授权…`,wizardCallbackLead:`如果浏览器停在 127.0.0.1,而控制台一直没有完成,把地址栏完整 URL 粘贴到这里。`,wizardCallbackPh:`粘贴完整的 http://127.0.0.1…/authorize?… 地址`,wizardSubmitCallback:`提交回调地址`,wizardStartingWorker:`已收到授权,正在启动账号会话…`,wizardAccountReady:`账号已就绪。`,wizardLoginTimeout:`等待浏览器登录超时,可在账号卡片重试。`,wizardPatLead:`浏览器流程不方便时,可用个人访问令牌登录。`,wizardPatLeadCN:`在 qoder.com.cn/account/integrations 创建 PAT,然后粘贴到这里。`,wizardPatLeadCommand:`粘贴你的 Command Code 密钥(形如 user_…,来自 commandcode.ai/settings)。`,zhipuApiKey:`API Key`,zhipuApiKeyPh:`粘贴 open.bigmodel.cn 的密钥`,zhipuAccountMode:`账号类型`,zhipuModePayg:`按量付费`,zhipuModePaygHint:`按 token 计费,走标准 GLM 端点。`,zhipuModeCoding:`Coding Plan`,zhipuModeCodingHint:`编程套餐。走 Coding Plan 端点,并显示套餐额度。`,zhipuOrganization:`组织 ID`,zhipuOrganizationPh:`可选,团队版 Coding Plan 才需要`,zhipuProject:`项目 ID`,zhipuProjectPh:`可选`,zhipuCreate:`添加智谱账号`,zhipuKeyRequired:`请先粘贴智谱 API Key。`,wizardPatPh:`粘贴个人访问令牌`,wizardCreateAndLogin:`创建并登录`,wizardImportLead:`粘贴凭证 JSON。WorkBuddy hub 导出包会一次性导入其中全部账号。`,wizardImportPh:`粘贴凭证 JSON`,wizardChooseFile:`选择文件`,wizardBadJson:`这看起来不是有效的凭证包。`,reLogin:`登录`,cancel:`取消`,close:`关闭`,create:`创建`,import:`导入`,export:`导出`,enable:`启用`,disable:`停用`,disabled:`已停用`,delete:`删除`,holdToDelete:`按住删除`,trendHalfHint:`所选时间窗口后半段对比前半段`,toastRefreshingAccount:`正在刷新账号…`,toastAccountRefreshed:`账号已刷新`,toastRefreshingCredits:`正在刷新积分…`,toastCreditsRefreshed:`积分已刷新`,toastAccountAdded:`账号已添加`,toastAccountDeleted:`账号已删除`,toastClearingLogs:`正在清空请求日志…`,toastLogsCleared:`请求日志已清空`,toastKeyDeleted:`API Key 已删除`,toastFailed:`操作失败`,deleteAccountConfirm:`确定删除账号 {name} 吗?这会移除它的本地运行时和已保存凭据。`,edit:`编辑`,enabled:`已启用`,keysLead:`客户端密钥只用于 /v1。供应商留空表示全部可用。控制台管理员密钥在系统页。`,keysCreate:`创建密钥`,keysEmpty:`还没有客户端密钥`,keysEmptyHint:`为 OpenAI 兼容客户端创建命名密钥。它不能登录这个控制台。`,keysCreateTitle:`创建 API 密钥`,keysCreateHint:`明文密钥只显示一次,请保存在会调用 /v1 的客户端里。`,keysEditTitle:`编辑 API 密钥`,keysEditHint:`可以改名称,或限制它能调度到哪些供应商。`,keysName:`名称`,keysNamePh:`CI 机器人`,keysNameRequired:`请填写名称。`,keysProviders:`供应商`,keysProvidersHint:`可将 Key 限制到特定供应商区域(如国内版 / 国际版)。全部不勾选表示允许所有供应商。`,keysAllProviders:`全部供应商`,keysAllRegions:`全区域`,keysProvidersNotLoaded:`供应商列表仍在加载中。已禁用保存,以保证 Key 权限不会被意外更改。`,keysProvidersLoadFailed:`供应商列表加载失败:{message}`,keysLastUsed:`最近使用 {time}`,keysNeverUsed:`尚未使用`,keysSecretTitle:`请立刻保存这把密钥`,keysSecretHint:`服务端只存哈希,关闭后无法再查看明文。`,keysSecretOnce:`关闭弹窗前请先复制。`,keysDeleteConfirm:`确定删除 API 密钥 {name} 吗?正在使用它的客户端会立刻失败。`,consoleKeyTitle:`控制台 API 密钥`,consoleKeyHint:`这是登录本控制台的管理员密钥。`,consoleKeyLead:`它可以调用全部供应商,并管理账号、密钥和更新。客户端密钥在「API 密钥」页。`,consoleKeyRotate:`轮换密钥`,consoleKeyRotateHint:`轮换后其他会话会失效,并重启 Qoder worker 以使用新密钥。`,consoleKeyRotateNow:`立即轮换`,consoleKeySecretTitle:`新的控制台密钥`,consoleKeySecretHint:`当前浏览器会话已更新。如果还有客户端在用旧的控制台密钥,请把新值复制过去。`}};function CH(e,t,n={}){let r=SH[e]||SH.en,i=SH.en,a=r[t];return a??=i[t],typeof a==`string`?a.replace(/\{(\w+)\}/g,(e,t)=>n[t]==null?`{${t}}`:String(n[t])):t}function wH(e,t){return((SH[e]||SH.en).pages||SH.en.pages)[t]||{title:t,desc:``}}var TH=(0,v.createContext)(null);function EH({children:e}){let[t,n]=(0,v.useState)(()=>localStorage.getItem(`cli2api_lang`)===`en`?`en`:`zh`),r=(0,v.useMemo)(()=>({lang:t,setLang:e=>{let t=e===`en`?`en`:`zh`;localStorage.setItem(`cli2api_lang`,t),document.documentElement.lang=t===`zh`?`zh-CN`:`en`,n(t)},t:(e,n)=>CH(t,e,n),page:e=>wH(t,e)}),[t]);return(0,G.jsx)(TH.Provider,{value:r,children:e})}function DH(){let e=(0,v.useContext)(TH);if(!e)throw Error(`useI18n must be used within I18nProvider`);return e}var OH=`cli2api_key`,kH=(0,v.createContext)(null);function AH({children:e}){let[t,n]=(0,v.useState)(()=>localStorage.getItem(OH)||``),r=(0,v.useMemo)(()=>({apiKey:t,setApiKey:e=>{let t=String(e||``).trim();t?localStorage.setItem(OH,t):localStorage.removeItem(OH),n(t)},signOut:()=>{localStorage.removeItem(OH),n(``)}}),[t]);return(0,G.jsx)(kH.Provider,{value:r,children:e})}function jH(){let e=(0,v.useContext)(kH);if(!e)throw Error(`useApiKey must be used within ApiKeyProvider`);return e}function MH(){return(localStorage.getItem(OH)||``).trim()}var NH=class extends Error{status;code;constructor(e,t,n){super(e),this.name=`ApiError`,this.status=t,this.code=n}};function PH(e){if(e instanceof NH)return e.status===401||e.code===`invalid_api_key`;let t=e instanceof Error?e.message:String(e||``);return/invalid_api_key|unauthorized|Missing\/invalid API key/i.test(t)}async function FH(e,t={},n){let r=new Headers(t.headers||{});t.body&&!(t.body instanceof FormData)&&!r.has(`Content-Type`)&&r.set(`Content-Type`,`application/json`);let i=(n??MH()).trim();i&&!r.has(`Authorization`)&&r.set(`Authorization`,`Bearer ${i}`);let a=await fetch(e,{...t,headers:r}),o=await a.text(),s;try{s=o?JSON.parse(o):null}catch{s=o}if(!a.ok){let e=typeof s==`string`?s:o,t=/]/i.test(e);throw new NH(s?.error?.message||s?.message||(t?`${a.status} ${a.statusText}`:e||a.statusText),a.status,s?.error?.code)}return s}function IH(e){return FH(`/api/overview/summary`,{},e)}function LH(e=!1){return FH(`/api/accounts?refresh=${e?`1`:`0`}`)}function RH(e,t){if(!e)throw Error(`account id required`);let n={};return t&&(n.login_method=t),FH(`/api/accounts/${encodeURIComponent(e)}/login/device`,{method:`POST`,body:JSON.stringify(n)})}function zH(e){if(!e)throw Error(`account id required`);return FH(`/api/accounts/${encodeURIComponent(e)}/login/status`)}function BH(e,t){if(!e)throw Error(`account id required`);return FH(`/api/accounts/${encodeURIComponent(e)}/login/callback`,{method:`POST`,body:JSON.stringify({callback_url:t})})}function VH(e,t){if(!t)throw Error(`account id required`);return FH(`/api/accounts/${encodeURIComponent(t)}/login/pat`,{method:`POST`,body:JSON.stringify({pat:e})})}var HH=3e4,UH=new Map;function WH(e,t){return`${e||`*`}@${t||`merged`}`}function GH(e,t=!1,n){let r=new URLSearchParams;t&&r.set(`refresh`,`1`),e&&r.set(`account`,e),n&&r.set(`view`,n);let i=r.toString();return FH(`/api/models${i?`?${i}`:``}`)}function KH(e,t){let n=WH(e,t),r=UH.get(n);if(r&&Date.now()-r.at(UH.set(n,{data:e,at:Date.now()}),e)).finally(()=>{let e=UH.get(n);e?.pending===i&&UH.set(n,{data:e.data,at:e.at})});return UH.set(n,{data:r?.data||{},at:r?.at||0,pending:i}),i}function qH(e,t){let n=WH(e,t);return UH.delete(n),GH(e,!0,t).then(e=>(UH.set(n,{data:e,at:Date.now()}),e))}function JH(e,t,n,r){return FH(`/api/models/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PATCH`,body:JSON.stringify(e===`qoder`&&n&&r?{max_mode:n,context_length:r}:{max_mode:n})})}function YH(e,t,n){return FH(`/api/models/${e}/${encodeURIComponent(t)}`,{method:`PATCH`,body:JSON.stringify({reasoning_effort:n})})}function XH(e,t){if(!e)throw Error(`account id required`);let n=t?.quota?`?quota=1`:``;return FH(`/api/accounts/${encodeURIComponent(e)}/refresh${n}`,{method:`POST`,body:`{}`})}function ZH(e,t,n){let r={};return n&&(r[`X-Qoder-Account`]=n),FH(`/api/chat`,{method:`POST`,headers:r,body:JSON.stringify({model:e,stream:!1,messages:[{role:`user`,content:t}]})})}function QH(e,t){if(!Array.isArray(t))return e;let n=e.map(e=>({...e,function:e.function?{...e.function}:void 0}));for(let e of t){if(!e||typeof e!=`object`)continue;let t=e,r=typeof t.index==`number`?t.index:n.length;for(;n.length<=r;)n.push({index:n.length,function:{name:``,arguments:``}});let i=n[r];i.index=r,typeof t.id==`string`&&t.id&&(i.id=t.id),typeof t.type==`string`&&t.type&&(i.type=t.type);let a=t.function;if(a&&typeof a==`object`){let e=a;i.function||={name:``,arguments:``},typeof e.name==`string`&&e.name&&(i.function.name=e.name),typeof e.arguments==`string`&&e.arguments&&(i.function.arguments=(i.function.arguments||``)+e.arguments)}}return n}function $H(e){return typeof e==`string`?[{role:`user`,content:e}]:e}async function eU(e,t,n,r={}){let i={"Content-Type":`application/json`};n&&(i[`X-Qoder-Account`]=n);let a=MH().trim();a&&(i.Authorization=`Bearer ${a}`);let o=$H(t),s=await fetch(`/api/chat`,{method:`POST`,headers:i,body:JSON.stringify({model:e,stream:!0,messages:o}),signal:r.signal});if(!s.ok){let e=await s.text(),t;try{t=e?JSON.parse(e):null}catch{t=e}let n=typeof t==`string`?t:e,r=/]/i.test(n);throw new NH(t?.error?.message||t?.message||(r?`${s.status} ${s.statusText}`:n||s.statusText),s.status,t?.error?.code)}let c=s.body?.getReader();if(!c)throw Error(`No response body`);let l=new TextDecoder,u=``,d=``,f=``,p=[],m=e=>{for(let t of[`credits`,`credit`,`consumed_credits`,`ConsumedCredits`]){let n=e[t];if(typeof n==`number`&&Number.isFinite(n))return n}},h=e=>{let t=e.trim();if(!t.startsWith(`data:`))return!1;let n=t.slice(5).trim();if(!n)return!1;if(n===`[DONE]`)return!0;try{let e=JSON.parse(n),t=e?.usage;if(t&&typeof t==`object`){let e=t,n={prompt_tokens:typeof e.prompt_tokens==`number`?e.prompt_tokens:void 0,completion_tokens:typeof e.completion_tokens==`number`?e.completion_tokens:void 0,total_tokens:typeof e.total_tokens==`number`?e.total_tokens:void 0,credits:m(e),source:typeof e.source==`string`?e.source:void 0};r.onUsage?.(n)}let i=e?.choices?.[0]?.delta;if(!i||typeof i!=`object`)return!1;let a=i.content;typeof a==`string`&&a&&(d+=a,r.onContent?.(a,d));let o=i.reasoning_content;typeof o==`string`&&o&&(f+=o,r.onReasoning?.(o,f)),i.tool_calls&&(p=QH(p,i.tool_calls),r.onToolCalls?.(p))}catch{}return!1};for(;;){let{done:e,value:t}=await c.read();if(e)break;u+=l.decode(t,{stream:!0});let n=u.split(` `);u=n.pop()||``;for(let e of n)if(h(e))return d}return u.trim()&&h(u),d}function tU(){return FH(`/api/providers`)}function nU(e,t=`qoder`,n=`global`,r){return FH(`/api/accounts`,{method:`POST`,body:JSON.stringify({name:e,provider:t,region:n,enabled:!0,max_inflight:r?.max_inflight??4,priority:r?.priority??50,drop_system_prompt:r?.drop_system_prompt,workbuddy_auto_checkin:r?.workbuddy_auto_checkin,workbuddy_checkin_time:r?.workbuddy_checkin_time,auto_checkin:r?.auto_checkin,checkin_time:r?.checkin_time,proxy_url:r?.proxy_url})})}function rU(e){return FH(`/api/accounts/${encodeURIComponent(e)}/checkin`,{method:`POST`,body:`{}`})}function iU(e){return FH(`/api/accounts/${encodeURIComponent(e)}/checkins`)}function aU(e,t){return FH(`/api/accounts/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)})}function oU(e){return FH(`/api/accounts/${encodeURIComponent(e)}`,{method:`DELETE`})}function sU(e){return FH(`/api/accounts/import`,{method:`POST`,body:JSON.stringify(e)})}function cU(e){return FH(`/api/accounts/${encodeURIComponent(e)}/export`)}var lU=(0,v.createContext)(null);function uU({children:e}){let{apiKey:t,signOut:n}=jH(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!!t),[s,c]=(0,v.useState)(null),l=(0,v.useCallback)(async(e,r)=>{let a=e??t;if(!a)throw i(null),c(null),o(!1),Error(`missing_api_key`);let s=!!r?.silent;s||o(!0);try{let e=await IH(a);return i(e),c(null),e}catch(e){let t=e instanceof Error?e.message:String(e);throw s||i(null),c(t),PH(e)&&n(),e}finally{s||o(!1)}},[t,n]);(0,v.useEffect)(()=>{if(!t){i(null),o(!1),c(null);return}l(void 0,{refreshQuota:!1}).catch(()=>void 0)},[t,l]);let u=(0,v.useMemo)(()=>({overview:r,loading:a,error:s,refresh:l,setOverview:i}),[r,a,s,l]);return(0,G.jsx)(lU.Provider,{value:u,children:e})}function dU(){let e=(0,v.useContext)(lU);if(!e)throw Error(`useOverview must be used within OverviewProvider`);return e}var fU=`cli2api_theme`,pU=(0,v.createContext)(null);function mU(){let e=localStorage.getItem(fU);return e===`light`||e===`dark`?e:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function hU({children:e}){let[t,n]=(0,v.useState)(mU);(0,v.useEffect)(()=>{let e=document.documentElement;e.dataset.theme=t,e.classList.toggle(`dark`,t===`dark`),e.classList.toggle(`light`,t===`light`),e.style.colorScheme=t;let n=_U()??(t===`dark`?`#0A0A0A`:`#FAFAFA`);document.querySelectorAll(`meta[name="theme-color"]`).forEach(e=>{e.setAttribute(`content`,n)})},[t]);let r=(0,v.useMemo)(()=>({theme:t,setTheme:e=>{localStorage.setItem(fU,e),n(e)},toggleTheme:()=>{n(e=>{let t=e===`dark`?`light`:`dark`;return localStorage.setItem(fU,t),t})}}),[t]);return(0,G.jsx)(pU.Provider,{value:r,children:e})}function gU(){let e=(0,v.useContext)(pU);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}function _U(){let e=document.createElement(`div`);e.style.cssText=`position:absolute;visibility:hidden;background:var(--background)`,document.body.appendChild(e);let t=getComputedStyle(e).backgroundColor;return e.remove(),t&&t!==`rgba(0, 0, 0, 0)`?t:null}function vU({title:e,desc:t,onMenu:n}){let{lang:r,setLang:i,t:a}=DH(),{loading:o,refresh:s,overview:c}=dU(),{signOut:l}=jH(),{theme:u,toggleTheme:d}=gU(),f=ot(),p=!!c?.worker?.ok;return(0,G.jsx)(`header`,{className:`relative z-20 shrink-0 border-b border-separator bg-background`,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1480px] items-center gap-4 px-4 py-2 sm:px-6 lg:px-8`,children:[(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,className:`lg:hidden`,onPress:n,"aria-label":a(`menu`),children:(0,G.jsx)(oa,{size:17})}),(0,G.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,G.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-3`,children:[(0,G.jsx)(`span`,{className:`status-dot translate-y-[-1px]`,"data-state":p?`ok`:`danger`}),(0,G.jsx)(`h1`,{className:`truncate text-title font-semibold`,children:e}),(0,G.jsx)(`p`,{className:`hidden truncate text-body text-muted xl:block`,children:t})]})}),(0,G.jsxs)(OI,{isAttached:!0,children:[(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,isPending:o,onPress:()=>void s().catch(()=>void 0),"aria-label":a(`refresh`),children:(0,G.jsx)(Jr,{size:15})})}),(0,G.jsx)(eL.Content,{children:a(`refresh`)})]}),(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,onPress:()=>i(r===`zh`?`en`:`zh`),"aria-label":r===`zh`?`English`:`中文`,children:(0,G.jsx)(Xi,{size:15})})}),(0,G.jsx)(eL.Content,{children:r===`zh`?`English`:`中文`})]}),(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,onPress:d,"aria-label":u===`dark`?`Light mode`:`Dark mode`,children:u===`dark`?(0,G.jsx)(Wa,{size:15}):(0,G.jsx)(fa,{size:15})})}),(0,G.jsx)(eL.Content,{children:u===`dark`?`Light mode`:`Dark mode`})]}),(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,onPress:()=>{l(),f(`/login`,{replace:!0})},"aria-label":a(`signOut`),children:(0,G.jsx)(Ma,{size:15})})}),(0,G.jsx)(eL.Content,{children:a(`signOut`)})]})]})]})})}function yU({update:e}){let{t}=DH(),{info:n,submitting:r,reloadIn:i,elapsed:a,readyToApply:o,busy:s,justUpdated:c,targetVersion:l,newerThanPrepared:u,updateStateText:d,canPrepare:f,canApply:p,canCancel:m,primaryLabel:h,statusHint:g,prepareUpdate:_,confirmUpdate:v,cancelPreparedUpdate:y}=e;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`grid overflow-hidden rounded-lg bg-surface-secondary sm:grid-cols-[1fr_auto_1fr]`,children:[(0,G.jsxs)(`div`,{className:`p-4`,children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:t(`currentVersion`)}),(0,G.jsx)(`div`,{className:`mono mt-2 text-section font-semibold`,children:n?.current_version||`—`})]}),(0,G.jsx)(`div`,{className:`hidden items-center border-x border-separator px-4 text-muted sm:flex`,children:(0,G.jsx)(Kr,{size:18})}),(0,G.jsxs)(`div`,{className:`border-t border-separator p-4 sm:border-t-0`,children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:t(`latestVersion`)}),(0,G.jsx)(`div`,{className:`mono mt-2 text-section font-semibold`,children:n?.next_version||`—`})]})]}),(0,G.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center justify-end gap-3`,children:[m?(0,G.jsx)(X,{size:`sm`,variant:`ghost`,isDisabled:r,onPress:()=>void y(),children:t(o?`discardPreparedImage`:`cancelUpdate`)}):null,(0,G.jsxs)(X,{isDisabled:!f&&!p||i!=null,isPending:r||s||i!=null,onPress:()=>void(p?v():_()),children:[(0,G.jsx)(Kr,{size:16}),h]})]}),!n?.agent?.available&&!s?(0,G.jsx)(`p`,{className:`mt-3 text-right text-caption text-muted`,children:t(`updateUnavailableHint`)}):null,n?.agent?.available&&!n.agent.staged_update&&!s?(0,G.jsx)(`p`,{className:`mt-3 text-right text-caption text-muted`,children:t(`updateLegacyOneShotHint`)}):null,o||s||i!=null||c?(0,G.jsxs)(`div`,{className:`mt-4 rounded-lg border px-3 py-3 border-separator bg-surface-secondary`,role:`status`,"aria-live":`polite`,children:[d?(0,G.jsxs)(`p`,{className:`text-caption font-medium text-foreground`,children:[d,l?` · ${l}`:``,a?` · ${t(`updateElapsed`,{seconds:a})}`:``]}):null,(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:g}),u?(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-warning`,children:t(`updateNewerReleaseHint`,{latest:n?.next_version||``})}):null,n?.update?.error||n?.agent?.error?(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-danger`,children:n?.update?.error||n?.agent?.error}):null]}):null]})}function bU({status:e=`danger`,title:t,description:n}){return(0,G.jsxs)(RB,{status:e,children:[(0,G.jsx)(RB.Indicator,{}),(0,G.jsxs)(RB.Content,{children:[(0,G.jsx)(RB.Title,{children:t}),n?(0,G.jsx)(RB.Description,{children:n}):null]})]})}function xU(e=!1){return FH(`/api/system/update${e?`?force=1`:``}`)}function SU(){return FH(`/api/system/settings`)}function CU(e){return FH(`/api/system/settings`,{method:`PATCH`,body:JSON.stringify(e)})}function wU(){return FH(`/api/system/update/prepare`,{method:`POST`,body:`{}`})}function TU(){return FH(`/api/system/update/apply`,{method:`POST`,body:`{}`})}function EU(){return FH(`/api/system/update/cancel`,{method:`POST`,body:`{}`})}function DU(e){return FH(`/api/system/update/rollback`,{method:`POST`,body:JSON.stringify({version:e})})}function OU(){return FH(`/api/system/resources`)}var kU=new Set([`preparing`,`preparing_image`,`checking`,`backing_up`,`submitting`,`running`,`queued`,`pulling`,`host_binary`,`image_ready`,`recreating`,`rolling_back`]),AU=new Set([`backing_up`,`running`]),jU=new Set([`recreating`,`rolling_back`]),MU=new Set([`queued`,`pulling`,`host_binary`,`image_ready`,`preparing`,`recreating`,`checking`,`rolling_back`]);function NU(){let{t:e}=DH(),[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!0),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(()=>Date.now()),[_,y]=(0,v.useState)(``),b=(0,v.useCallback)(async(t=!1,r=!1)=>{t&&!r&&o(!0);try{let i=await xU(t);n(i),y(e=>e||i.current_version||``),i.update?.state===`failed`||i.update?.state===`rolled_back`||i.agent?.state===`failed`||i.agent?.state===`rolled_back`?u(i.update?.error||i.agent?.error||e(`updateFailedHint`)):r||u(``)}catch(t){r||u(t instanceof Error?t.message:e(`updateCheckFailedHint`))}finally{i(!1),t&&!r&&o(!1)}},[e]);(0,v.useEffect)(()=>{let e=window.setTimeout(()=>void b(!1),0);return()=>window.clearTimeout(e)},[b]);let x=t?.agent?.state||`unavailable`,S=t?.update?.state||``,C=AU.has(S)||jU.has(x)||!!(t?.update?.backup_path&&kU.has(S)),w=!C&&(S===`ready_to_apply`||x===`ready_to_apply`),T=!!d?.job_id&&t?.update?.job_id!==d?.job_id&&!w&&!C,E=!C&&!w&&(kU.has(S)||kU.has(x)||T),D=E||C,O=!!((S===`succeeded`||x===`succeeded`)&&_&&t?.current_version&&t.current_version!==_);O&&p==null&&m(3);let k=t?.update?.target_version||t?.agent?.target_version||``,A=!!(w&&t?.next_version&&k&&t.next_version!==k),j=t?.update?.started_at||t?.agent?.started_at,M=j&&D?Math.max(0,Math.round((h-Date.parse(j))/1e3)):0,N=O?`succeeded`:w?`ready_to_apply`:D&&MU.has(x)?x:S||x,P=N?e(`updateState_${N}`):``,ee=P.startsWith(`updateState_`)?N:P;(0,v.useEffect)(()=>{if(p!=null||!D&&!O)return;let e=window.setInterval(()=>void b(!1,!0),2e3);return()=>window.clearInterval(e)},[D,O,b,p]),(0,v.useEffect)(()=>{if(!D)return;let e=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(e)},[D]),(0,v.useEffect)(()=>{if(p==null)return;if(p<=0){window.location.reload();return}let e=window.setTimeout(()=>m(e=>e==null?e:e-1),1e3);return()=>window.clearTimeout(e)},[p]);let F=!!(t?.managed&&t?.has_update&&t?.next_version&&t?.agent?.available&&!w&&!D&&!s&&p==null),I=!!(w&&t?.agent?.available&&!C&&!s&&p==null),L=!!(t?.agent?.available&&(E||w)&&!C&&!s&&p==null),te=!!(t?.managed&&t?.agent?.available&&(t.rollback_versions?.length??0)>0&&!w&&!D&&!s&&p==null),R=p==null?e(I?`applyUpdateNow`:C?`updateInProgress`:E||s?`updatePreparingImage`:`updateNow`):e(`updateReloadingIn`,{seconds:p}),z=p==null?w?e(`updateReadyTargetHint`,{version:k||t?.next_version||``}):e(C?`updateApplyingHint`:`updatePreparingImageHint`):e(`updateReloadingHint`);async function B(){c(!0),f(null),u(``);try{let e=await wU();f(e),await b(!1,!0)}catch(t){u(t instanceof Error?t.message:e(`updateFailedHint`)),await b(!1,!0)}finally{c(!1)}}async function ne(){c(!0),u(``);try{let e=await TU();f(e),await b(!1,!0)}catch(t){u(t instanceof Error?t.message:e(`updateFailedHint`)),await b(!1,!0)}finally{c(!1)}}async function re(t){c(!0),f(null),u(``);try{let e=await DU(t);f(e),await b(!1,!0)}catch(t){u(t instanceof Error?t.message:e(`updateFailedHint`)),await b(!1,!0)}finally{c(!1)}}async function ie(){c(!0),u(``);try{await EU(),f(null),await b(!0,!0)}catch(t){u(t instanceof Error?t.message:e(`updateFailedHint`)),await b(!1,!0)}finally{c(!1)}}return{info:t,loading:r,checking:a,submitting:s,error:l,setError:u,reloadIn:p,load:b,elapsed:M,readyToApply:w,busy:D,justUpdated:O,targetVersion:k,newerThanPrepared:A,updateStateText:ee,canPrepare:F,canApply:I,canCancel:L,canRollback:te,primaryLabel:R,statusHint:z,prepareUpdate:B,confirmUpdate:ne,cancelPreparedUpdate:ie,rollbackTo:re}}var PU=/^(#{1,3})\s+(english|en|中文|chinese|zh|zh-cn|zh-hans)\s*$/i,FU=/`([^`]+)`|\*\*([^*]+)\*\*|\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g,IU=new Set([`中文`,`chinese`,`zh`,`zh-cn`,`zh-hans`]),LU=new Set([`english`,`en`]);function RU(e,t){let n=e.trim().toLowerCase();return t===`zh`?IU.has(n):LU.has(n)}function zU(e){let t=e.split(/\r?\n/),n=[];return t.forEach((e,t)=>{let r=PU.exec(e.trim());r&&n.push({index:t,title:r[2]})}),n.length?n.map((e,r)=>{let i=e.index+1,a=r+1RU(e,t));return i?i[1].trim():r[0]?.[1]?.trim()||n}function VU(e){let t=[],n=0;for(let r of e.matchAll(FU)){let i=r.index??0;i>n&&t.push({type:`text`,value:e.slice(n,i)}),r[1]==null?r[2]==null?r[3]!=null&&r[4]!=null&&t.push({type:`link`,value:r[3],href:r[4]}):t.push({type:`strong`,value:r[2]}):t.push({type:`code`,value:r[1]}),n=i+r[0].length}return n to !!TX(e)).sort(([e],[t])=>e.localeCompare(t))}function DX(e){return e.enabled?e.status===`quota_exhausted`||e.quota?.exceeded?`quota_exhausted`:e.status===`cooling`||TX(e.down_until||e.cooldown_until)?`cooling`:e.status===`dead`||e.runtime_state===`dead`?`dead`:e.status===`auth_failed`||e.runtime_state===`auth_failed`?`auth_failed`:e.status===`login_required`?`login`:(e.status===`starting`||e.runtime_state===`starting`)&&!e.hot&&!e.ready?e.quota?`starting`:`loading`:e.status===`ready`?e.hot?`hot`:`ready`:e.hot?`hot`:e.ready?`ready`:(e.status===`error`||e.status,`unavailable`):`disabled`}function OX(e){return e===`hot`?12:e===`ready`?9:e===`cooling`?5:e===`login`?3:e===`loading`||e===`starting`?6:e===`unavailable`?2:e===`auth_failed`?3:e===`dead`?2:1}function kX(e){return e===`hot`||e===`ready`?`ok`:e===`cooling`||e===`quota_exhausted`||e===`loading`||e===`starting`?`warn`:e===`auth_failed`||e===`unavailable`||e===`dead`||e===`login`?`danger`:`muted`}function AX(e){return e==null||!Number.isFinite(e)?`—`:Math.abs(e)>=1e3?`${(e/1e3).toFixed(e%1e3==0?0:1)}k`:String(Math.round(e*100)/100)}function jX(e){let t=e.percentage??0;return Number.isFinite(t)?Math.min(1,Math.max(0,t/100)):0}function MX(e){let t=e.percentage??0;return e.exceeded?`danger`:t>=80?`warn`:`ok`}function NX(e){return(e.windows??[]).filter(e=>!!e.id)}var PX={free:`Free`,go:`Go`,plus:`Plus`,pro:`Pro`,prolite:`Pro Lite`,promax:`Pro Max`,team:`Team`,business:`Business`,enterprise:`Enterprise`,edu:`Edu`,edu_plus:`Edu Plus`,edu_pro:`Edu Pro`,education:`Education`};function FX(e){let t=e?.trim().toLowerCase()??``;return!t||t===`unknown`||t===`guest`?``:PX[t]??t.replace(/[_-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function IX(e,t){return e.id===`daily`?t(`quotaDaily`):e.id===`weekly`?t(`quotaWeekly`):e.id===`monthly`?t(`quotaMonthly`):e.id===`fiveHour`?t(`quotaFiveHour`):e.id===`weeklyLimit`?t(`quotaWeeklyLimit`):e.id===`monthlyLimit`?t(`quotaMonthlyLimit`):e.label||t(`quota`)}function LX(e,t){if(!e)return``;let n=Date.parse(e)-Date.now();if(!Number.isFinite(n)||n<=0)return t(`quotaResetsSoon`);let r=Math.max(1,Math.ceil(n/6e4));return r<60?t(`quotaResetsInMinutes`,{n:r}):t(`quotaResetsInHours`,{n:Math.round(r/60)})}function RX(e,t){if(!e.expires_at||e.expires_at<=0||!Number.isFinite(e.expires_at))return``;let n=new Date(e.expires_at*1e3);if(Number.isNaN(n.getTime()))return``;let r=`${n.getFullYear()}/${n.getMonth()+1}/${n.getDate()}`;return t(`quotaExpiresOn`,{amount:e.expiring_remain&&e.expiring_remain>0?`${AX(e.expiring_remain)} `:``,unit:e.unit||`credits`,date:r})}var zX=864e5,BX=8;function VX(e){return`var(--chart-${e%BX+1})`}function HX(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function UX(e){return e<10?`0${e}`:String(e)}function WX(e){let t=new Date(e);return`${t.getFullYear()}-${UX(t.getMonth()+1)}-${UX(t.getDate())}`}function GX({accounts:e,t}){let[n,r]=(0,v.useState)(!1),{buckets:i,rows:a,todayStart:o,maxTotal:s}=(0,v.useMemo)(()=>{let t=HX(new Date),n=new Map;e.forEach((e,t)=>n.set(e.id,VX(t)));let r=new Map,i=[];for(let a of e){let e=a.quota?.packages??[],o=n.get(a.id)||VX(0),s=a.name||a.id,c=e.filter(e=>(e.remain??0)>0&&(e.ends_at??0)>0),l=0,u=0,d=0,f=0;for(let e of c){let n=e.ends_at*1e3,i=e.remain??0;d+=i;let c=HX(new Date(n)),u=c{let e=new Date(c);return{day:p,label:`${e.getMonth()+1}/${e.getDate()}`,ts:c,segments:[],total:0}})(),r.set(p,m));let h=m.segments.find(e=>e.id===a.id);h?h.remain+=i:m.segments.push({id:a.id,name:s,color:o,remain:i}),m.total+=i}if(l){let e=WX(HX(new Date(l)));for(let t of c)WX(HX(new Date(t.ends_at*1e3)))===e&&(u+=t.remain??0)}let p=l?Math.max(0,Math.round((HX(new Date(l))-t)/zX)):-1;i.push({id:a.id,name:s,color:o,remain:d,expiredRemain:f,soonest:l?Math.floor(l/1e3):0,soonestRemain:u,daysLeft:p,dailyBurn:l?u/Math.max(p,1):0,packs:c.length})}i.sort((e,t)=>e.soonest&&t.soonest?e.soonest-t.soonest:e.soonest?-1:t.soonest?1:t.remain-e.remain);let a=[...r.values()].sort((e,t)=>e.ts-t.ts);return{buckets:a,rows:i,todayStart:t,maxTotal:a.reduce((e,t)=>Math.max(e,t.total),0)}},[e]);if(!a.some(e=>e.packs>0))return null;let c=n?i:i.slice(0,8);return(0,G.jsxs)(zw,{className:`overflow-hidden p-0`,"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-separator px-4 py-4 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between sm:px-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`expiryDistTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:t(`expiryDistHint`)})]}),i.length>8?(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:()=>r(e=>!e),children:n?t(`expiryDistCollapse`):t(`expiryDistExpand`,{n:i.length})}):null]}),(0,G.jsxs)(`div`,{className:`space-y-4 p-4 sm:space-y-3 sm:p-5`,children:[(0,G.jsx)(`div`,{className:`space-y-2.5 sm:space-y-1.5`,children:c.map(e=>{let n=e.ts===o,r=s>0?e.total/s*100:0;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:grid sm:grid-cols-[52px_minmax(0,1fr)_auto] sm:items-center sm:gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 sm:contents`,children:[(0,G.jsx)(`span`,{className:`mono text-caption ${e.day===`__expired__`?`font-semibold text-danger`:n?`font-semibold text-foreground`:`text-muted`}`,children:e.day===`__expired__`?t(`expiryDistExpired`):e.label}),(0,G.jsx)(`span`,{className:`mono text-caption text-foreground sm:hidden`,children:AX(e.total)})]}),(0,G.jsx)(`div`,{className:`h-2.5 w-full rounded-full bg-surface-tertiary`,role:`img`,"aria-label":`${e.day} ${t(`expiryDistDayTotal`,{n:AX(e.total)})}`,title:e.day,children:(0,G.jsx)(`div`,{className:`flex h-full items-stretch overflow-hidden rounded-full`,style:{width:`${r}%`},children:e.segments.map(t=>(0,G.jsx)(`span`,{style:{width:`${t.remain/e.total*100}%`,backgroundColor:t.color},title:`${t.name} · ${AX(t.remain)}`},t.id))})}),(0,G.jsx)(`span`,{className:`mono hidden text-caption text-foreground sm:inline`,children:AX(e.total)})]},e.day)})}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1.5 pt-1`,children:a.filter(e=>e.remain>0).map(e=>(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-caption text-muted`,children:[(0,G.jsx)(`i`,{className:`size-2 rounded-[3px]`,style:{backgroundColor:e.color}}),(0,G.jsx)(`span`,{className:`max-w-[120px] truncate`,children:e.name})]},e.id))}),(0,G.jsx)(`div`,{className:`divide-y divide-separator md:hidden`,children:a.filter(e=>e.packs>0).map(e=>{let n=e.daysLeft>=0&&e.daysLeft<=2,r=e.daysLeft>=0&&e.daysLeft<=7,i=e.soonest?new Date(e.soonest*1e3):null,a=e.expiredRemain>0&&e.daysLeft<0||n?`font-semibold text-danger`:r?`text-warning`:`text-muted`,o=e.daysLeft>=0?t(`expiryDistDays`,{n:e.daysLeft}):e.expiredRemain>0?t(`expiryDistExpired`):`—`;return(0,G.jsxs)(`article`,{className:`space-y-3 py-3.5`,children:[(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`i`,{className:`size-2 shrink-0 rounded-[3px]`,style:{backgroundColor:e.color}}),(0,G.jsx)(`span`,{className:`truncate text-body font-medium text-foreground`,children:e.name})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:t(`expiryDistColSoonest`)}),(0,G.jsx)(`div`,{className:`mono text-body text-muted`,children:i?`${i.getMonth()+1}/${i.getDate()}`:`—`})]}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:t(`expiryDistColDaysLeft`)}),(0,G.jsx)(`div`,{className:`mono text-body ${a}`,children:o})]}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:t(`expiryDistColBatch`)}),(0,G.jsx)(`div`,{className:`mono text-body text-foreground`,children:AX(e.soonestRemain)})]}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:t(`expiryDistColDaily`)}),(0,G.jsx)(`div`,{className:`mono text-body text-foreground`,children:e.soonest?AX(e.dailyBurn):`—`})]})]})]},e.id)})}),(0,G.jsx)(Q,{"aria-label":t(`expiryDistTitle`),className:`hidden md:block`,children:(0,G.jsx)(Q.ScrollContainer,{className:`min-w-0 overflow-x-auto`,children:(0,G.jsxs)(Q.Content,{className:`min-w-[32rem]`,children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:t(`expiryDistColAccount`)}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-center`,children:t(`expiryDistColSoonest`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-center`,children:t(`expiryDistColDaysLeft`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-center`,children:t(`expiryDistColBatch`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-center`,children:t(`expiryDistColDaily`)})})]}),(0,G.jsx)(Q.Body,{children:a.filter(e=>e.packs>0).map(e=>{let n=e.daysLeft>=0&&e.daysLeft<=2,r=e.daysLeft>=0&&e.daysLeft<=7,i=e.soonest?new Date(e.soonest*1e3):null;return(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`i`,{className:`size-2 shrink-0 rounded-[3px]`,style:{backgroundColor:e.color}}),(0,G.jsx)(`span`,{className:`max-w-[150px] truncate text-foreground`,children:e.name})]})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-center text-muted`,children:i?`${i.getMonth()+1}/${i.getDate()}`:`—`})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-center ${e.expiredRemain>0&&e.daysLeft<0||n?`font-semibold text-danger`:r?`text-warning`:`text-muted`}`,children:e.daysLeft>=0?t(`expiryDistDays`,{n:e.daysLeft}):e.expiredRemain>0?t(`expiryDistExpired`):`—`})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-center text-foreground`,children:AX(e.soonestRemain)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-center text-foreground`,children:e.soonest?AX(e.dailyBurn):`—`})})]},e.id)})})]})})}),(0,G.jsx)(`p`,{className:`text-caption text-muted`,children:t(`expiryDistFoot`)})]})]})}var KX={"--toggle-button-bg-selected":`transparent`,"--toggle-button-bg-selected-hover":`transparent`,"--toggle-button-bg-selected-pressed":`transparent`};function qX({value:e,onChange:t,options:n,ariaLabel:r,className:i}){let a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(!1);return(0,v.useLayoutEffect)(()=>{let e=a.current,t=o.current;if(!e||!t)return;let n=n=>{let r=e.querySelector(`[data-selected="true"]`);if(!r){eY.set(t,{autoAlpha:0});return}let i=e.getBoundingClientRect(),a=r.getBoundingClientRect();eY.to(t,{x:a.left-i.left,y:a.top-i.top,width:a.width,height:a.height,autoAlpha:1,duration:n?aY(tY.base):0,ease:nY.out,overwrite:!0})};n(s.current),s.current=!0;let r=new ResizeObserver(()=>n(!1));return r.observe(e),()=>{r.disconnect(),eY.killTweensOf(t)}},[e,n]),(0,G.jsxs)(`div`,{ref:a,className:`filter-toggle relative inline-flex ${i??``}`,children:[(0,G.jsx)(`span`,{ref:o,"aria-hidden":!0,className:`filter-toggle__pill pointer-events-none absolute left-0 top-0 opacity-0`}),(0,G.jsx)(wI,{"aria-label":r,size:`sm`,selectionMode:`single`,disallowEmptySelection:!0,selectedKeys:new Set([e]),onSelectionChange:n=>{let r=[...n][0];typeof r==`string`&&r!==e&&t(r)},children:n.map(e=>(0,G.jsxs)(QP,{id:e.id,className:`relative z-[1]`,style:KX,children:[e.icon,e.label]},e.id))})]})}function JX(e,t){let n=e.toFixed(t);return n.includes(`.`)?n.replace(/0+$/,``).replace(/\.$/,``):n}function YX(e){let t=Number(e||0);return Number.isFinite(t)?t>=1e9?`${JX(t/1e9,2)}B`:t>=1e6?`${JX(t/1e6,2)}M`:t>=1e3?`${JX(t/1e3,1)}k`:String(Math.round(t)):`—`}function XX(e){let t=Number(e||0);return Number.isFinite(t)?JX(t,2):`—`}function ZX(e,t,n){if(!t||!n)return`—`;let r=Number(e||0);return Number.isFinite(r)?`${JX(r,4)} / 1M`:`—`}function QX(e){let t=Number(e||0);return t?t>=1e3?`${JX(t/1e3,2)}s`:`${Math.round(t)}ms`:`—`}function $X(e){if(e==null)return`—`;let t=Number(e);return!Number.isFinite(t)||t<0?`—`:`x${JX(t,2)}`}function eZ(e){let t=(e||``).trim().toLowerCase().replace(/\s*credits?$/,``).replace(/^x/,``);if(t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function tZ(e,t){if(!e.length||!t)return null;let n=t.indexOf(`/`),r=n>=0?t.slice(0,n).toLowerCase():``,i=n>=0?t.slice(n+1):t,a=e.filter(e=>e.id===t||e.id===i||e.native_model===i);if(!a.length)return null;let o=a.map(e=>({rate:eZ(e.credits),cn:/credits?\s*$/i.test((e.credits||``).trim())})),s=o,c=r.includes(`cn`)?!0:!/(^|[-_])(gl|global|intl)([-_]|$)/.test(r)&&null;if(c!==null){let e=o.filter(e=>e.cn===c);e.length&&(s=e)}let l=s.map(e=>e.rate).filter(e=>e!==null);if(!l.length)return null;let u=l.filter(e=>e>0);return u.length?Math.max(...u):l[0]}function nZ(e,t){let n=Number(e||0),r=n+Number(t||0);return r?n/r*100:null}function rZ({hit:e,miss:t}){let n=nZ(e,t);return n==null?(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:`—`}):(0,G.jsxs)(`div`,{className:`mono text-right ${n>=90?`text-success`:n>=80?`text-warning`:`text-danger`}`,title:`${YX(e)} / ${YX(e+t)}`,children:[JX(n,1),`%`]})}function iZ(e){let t=Number(e||0);return Number.isFinite(t)?t:0}function aZ(e,t){let n=e.slice(),r=e=>iZ(String(t===`requests`?e.requests:t===`errors`?e.errors:t===`latency`?e.avg_latency_ms??0:e.total_tokens));return n.sort((e,t)=>r(t)-r(e)),n}function oZ(e,t){return e.find(e=>e.id===t)?.name||t.slice(0,8)}function sZ({usage:e,accounts:t,loading:n,t:r}){let[i,a]=(0,v.useState)(`account`),[o,s]=(0,v.useState)(`total`),c=(0,v.useMemo)(()=>e?aZ((i===`model`?e.by_model:i===`realm`?e.by_realm:e.by_account)||[],o):[],[e,i,o]),l=i===`account`,u=l?8:7;return(0,G.jsxs)(zw,{"data-gsap-reveal":!0,"data-skeleton-swap":`stats`,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-separator px-5 py-4 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:r(`usageDetailTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:r(`usageDetailHint`)})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(qX,{value:i,onChange:e=>a(e),ariaLabel:r(`usageDetailTitle`),options:[{id:`account`,label:r(`usageDimAccount`)},{id:`model`,label:r(`usageDimModel`)},{id:`realm`,label:r(`usageDimRealm`)}]}),(0,G.jsx)(qX,{value:o,onChange:e=>s(e),ariaLabel:r(`usageDetailHint`),options:[{id:`total`,label:r(`usageSortTotal`)},{id:`requests`,label:r(`usageSortRequests`)},{id:`errors`,label:r(`usageSortErrors`)},{id:`latency`,label:r(`usageSortLatency`)}]})]})]}),(0,G.jsx)(`div`,{className:`divide-y divide-separator md:hidden`,children:n?Array.from({length:4}).map((e,t)=>(0,G.jsxs)(`div`,{className:`space-y-3 px-5 py-4`,children:[(0,G.jsx)($,{className:`h-4 w-32`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:Array.from({length:4}).map((e,t)=>(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)($,{className:`h-3 w-12`}),(0,G.jsx)($,{className:`h-4 w-16`})]},t))})]},`skeleton-${t}`)):c.length===0?(0,G.jsx)(`div`,{className:`px-5 py-8 text-body text-muted`,children:r(`usageEmpty`)}):c.map(e=>{let n=i===`account`?oZ(t,e.key):e.key||`—`,a=i===`account`?e.realm:``,o=[{label:r(`usageColRequests`),value:YX(e.requests)},{label:r(`usageColErrors`),value:e.errors?YX(e.errors):`—`,tone:e.errors?`text-warning`:`text-muted`},{label:r(`usageColPrompt`),value:YX(e.prompt_tokens),tone:`text-muted`},{label:r(`usageColCacheHit`),value:nZ(e.cache_hit_tokens,e.cache_miss_tokens)==null?`—`:`${JX(nZ(e.cache_hit_tokens,e.cache_miss_tokens),1)}%`},{label:r(`usageColCompletion`),value:YX(e.completion_tokens),tone:`text-muted`},{label:r(`usageColTotal`),value:YX(e.total_tokens)}];return l&&o.push({label:r(`usageColAvgLatency`),value:QX(e.avg_latency_ms),tone:`text-muted`}),(0,G.jsxs)(`article`,{className:`space-y-3 px-5 py-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-foreground`,children:n}),a?(0,G.jsx)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:a}):null]}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:o.map(e=>(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e.label}),(0,G.jsx)(`div`,{className:`mono text-body ${e.tone??`text-foreground`}`,children:e.value})]},e.label))})]},e.key)})}),(0,G.jsx)(Q,{"aria-label":r(`usageDetailTitle`),className:`hidden md:block`,children:(0,G.jsx)(Q.ScrollContainer,{className:`min-w-0 overflow-x-auto`,children:(0,G.jsxs)(Q.Content,{className:`min-w-[44rem]`,children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:r(i===`model`?`usageColModel`:i===`realm`?`usageColRealm`:`usageColAccount`)}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColRequests`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColErrors`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColPrompt`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColCacheHit`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColCompletion`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColTotal`)})}),l?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColAvgLatency`)})})}):null]}),(0,G.jsx)(Q.Body,{children:n?Array.from({length:4}).map((e,t)=>(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)($,{className:`h-4 w-32`})}),Array.from({length:u-1}).map((e,t)=>(0,G.jsx)(Q.Cell,{children:(0,G.jsx)($,{className:`ml-auto h-4 w-12`})},t))]},`skeleton-${t}`)):c.length===0?(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-body text-muted`,children:r(`usageEmpty`)})}),Array.from({length:u-1}).map((e,t)=>(0,G.jsx)(Q.Cell,{children:null},t))]}):c.map(e=>{let n=i===`account`?oZ(t,e.key):e.key||`—`,r=i===`account`?e.realm:``;return(0,G.jsxs)(Q.Row,{children:[(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`div`,{className:`text-foreground`,children:n}),r?(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:r}):null]}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-foreground`,children:YX(e.requests)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right ${e.errors?`text-warning`:`text-muted`}`,children:e.errors?YX(e.errors):`—`})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:YX(e.prompt_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(rZ,{hit:e.cache_hit_tokens,miss:e.cache_miss_tokens})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:YX(e.completion_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-foreground`,children:YX(e.total_tokens)})}),l?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:QX(e.avg_latency_ms)})})}):null]},e.key)})})]})})}),(0,G.jsx)(`p`,{className:`px-5 py-3 text-caption text-muted`,children:r(`usageDimNote`,{n:c.length})})]})}function cZ({label:e,value:t,sub:n,tone:r}){return(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-tertiary px-3 py-2.5`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e}),(0,G.jsx)(`div`,{className:`mono mt-1 text-body font-semibold ${r??`text-foreground`}`,children:t}),(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-caption text-muted`,title:n,children:n})]})}function lZ({usage:e,accounts:t,models:n,loading:r,t:i}){let[a,o]=(0,v.useState)(`account`),s=e?.totals,c=(0,v.useMemo)(()=>e&&(a===`model`?e.credit_by_model:e.credit_by_account)||[],[e,a]),l=a===`model`,u=l?7:6;return(0,G.jsxs)(zw,{"data-gsap-reveal":!0,"data-skeleton-swap":`stats`,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-separator px-5 py-4 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:i(`usageCreditTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:i(`usageCreditHint`)})]}),(0,G.jsx)(qX,{value:a,onChange:e=>o(e),ariaLabel:i(`usageCreditTitle`),options:[{id:`account`,label:i(`usageDimAccount`)},{id:`model`,label:i(`usageDimModel`)}]})]}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-3 border-b border-separator px-5 py-4 sm:grid-cols-3 sm:gap-2.5 xl:grid-cols-5`,children:r||!s?Array.from({length:5}).map((e,t)=>(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-tertiary px-3 py-2.5`,children:[(0,G.jsx)($,{className:`h-3 w-16`}),(0,G.jsx)($,{className:`mt-2 h-5 w-20`})]},t)):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(cZ,{label:i(`usageCreditKpiCredits`),value:XX(s.credits),sub:i(`usageCreditKpiCreditsSub`)}),(0,G.jsx)(cZ,{label:i(`usageCreditKpiTokens`),value:YX(s.credit_tokens),sub:i(`usageCreditKpiTokensSub`)}),(0,G.jsx)(cZ,{label:i(`usageCreditKpiAvg`),value:ZX(s.credits_per_1m_tokens,s.credit_samples,s.credit_tokens),sub:i(`usageCreditKpiAvgSub`),tone:`text-success`}),(0,G.jsx)(cZ,{label:i(`usageCreditKpiSamples`),value:String(s.credit_samples||0),sub:i(`usageCreditKpiSamplesSub`)}),(0,G.jsx)(cZ,{label:i(`usageCreditKpiCache`),value:nZ(s.cache_hit_tokens,s.cache_miss_tokens)==null?`—`:`${JX(nZ(s.cache_hit_tokens,s.cache_miss_tokens),1)}%`,sub:i(`usageCreditKpiCacheSub`)})]})}),(0,G.jsx)(`div`,{className:`divide-y divide-separator md:hidden`,children:r?Array.from({length:4}).map((e,t)=>(0,G.jsxs)(`div`,{className:`space-y-3 px-5 py-4`,children:[(0,G.jsx)($,{className:`h-4 w-32`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:Array.from({length:4}).map((e,t)=>(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)($,{className:`h-3 w-12`}),(0,G.jsx)($,{className:`h-4 w-16`})]},t))})]},`skeleton-${t}`)):c.length===0?(0,G.jsx)(`div`,{className:`px-5 py-8 text-body text-muted`,children:i(`usageCreditEmpty`)}):c.map(e=>{let r=l?e.key||`—`:oZ(t,e.key),a=!l&&e.realm?e.realm:``,o=[];return l&&o.push({label:i(`usageCreditColRate`),value:$X(e.rate??tZ(n,e.key)),tone:`text-muted`}),o.push({label:i(`usageColRequests`),value:YX(e.requests)},{label:i(`usageCreditColCredits`),value:XX(e.credits)},{label:i(`usageCreditColSampleTokens`),value:YX(e.credit_tokens),tone:`text-muted`},{label:i(`usageCreditColPer1M`),value:ZX(e.credits_per_1m_tokens,e.credit_samples,e.credit_tokens),tone:`text-muted`},{label:i(`usageColCacheHit`),value:nZ(e.cache_hit_tokens,e.cache_miss_tokens)==null?`—`:`${JX(nZ(e.cache_hit_tokens,e.cache_miss_tokens),1)}%`}),(0,G.jsxs)(`article`,{className:`space-y-3 px-5 py-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-foreground`,children:r}),a?(0,G.jsx)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:a}):null]}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:o.map(e=>(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e.label}),(0,G.jsx)(`div`,{className:`mono text-body ${e.tone??`text-foreground`}`,children:e.value})]},e.label))})]},e.key)})}),(0,G.jsx)(Q,{"aria-label":i(`usageCreditTitle`),className:`hidden md:block`,children:(0,G.jsx)(Q.ScrollContainer,{className:`min-w-0 overflow-x-auto`,children:(0,G.jsxs)(Q.Content,{className:`min-w-[40rem]`,children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:i(l?`usageColModel`:`usageColAccount`)}),l?(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageCreditColRate`)})}):null,(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageColRequests`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageCreditColCredits`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageCreditColSampleTokens`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageCreditColPer1M`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageColCacheHit`)})})]}),(0,G.jsx)(Q.Body,{children:r?Array.from({length:4}).map((e,t)=>(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)($,{className:`h-4 w-32`})}),Array.from({length:u-1}).map((e,t)=>(0,G.jsx)(Q.Cell,{children:(0,G.jsx)($,{className:`ml-auto h-4 w-12`})},t))]},`skeleton-${t}`)):c.length===0?(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-body text-muted`,children:i(`usageCreditEmpty`)})}),Array.from({length:u-1}).map((e,t)=>(0,G.jsx)(Q.Cell,{children:null},t))]}):c.map(e=>{let r=l?e.key||`—`:oZ(t,e.key),i=!l&&e.realm?e.realm:``;return(0,G.jsxs)(Q.Row,{children:[(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`div`,{className:`text-foreground`,children:r}),i?(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:i}):null]}),l?(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:$X(e.rate??tZ(n,e.key))})}):null,(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-foreground`,children:YX(e.requests)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-foreground`,children:XX(e.credits)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:YX(e.credit_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:ZX(e.credits_per_1m_tokens,e.credit_samples,e.credit_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(rZ,{hit:e.cache_hit_tokens,miss:e.cache_miss_tokens})})]},e.key)})})]})})}),(0,G.jsx)(`p`,{className:`px-5 py-3 text-caption text-muted`,children:i(`usageCreditNote`,{accounts:e?.credit_by_account?.length??0,models:e?.credit_by_model?.length??0})})]})}function uZ(e,t=!1){if(!e)return;let n=e.toDate(SD());if(Number.isFinite(n.getTime()))return t&&n.setSeconds(59,999),n.toISOString()}function dZ(e){if(!e)return null;let t=Date.parse(e);if(!Number.isFinite(t))return null;try{return JD(jO(new Date(t).toISOString()))}catch{return null}}function fZ({value:e,onChange:t,ariaLabel:n,fromLabel:r,toLabel:i,className:a}){return(0,G.jsx)(hP,{className:a,granularity:`minute`,hourCycle:24,shouldForceLeadingZeros:!0,value:e,onChange:e=>t(e),"aria-label":n,children:({state:e})=>(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(AM.Group,{className:`w-full min-w-0`,variant:`secondary`,children:[(0,G.jsx)(AM.Input,{className:`min-w-0`,slot:`start`,"aria-label":r,children:e=>(0,G.jsx)(AM.Segment,{segment:e})}),(0,G.jsx)(hP.RangeSeparator,{}),(0,G.jsx)(AM.Input,{className:`min-w-0`,slot:`end`,"aria-label":i,children:e=>(0,G.jsx)(AM.Segment,{segment:e})}),(0,G.jsx)(AM.Suffix,{children:(0,G.jsx)(hP.Trigger,{children:(0,G.jsx)(hP.TriggerIndicator,{})})})]}),(0,G.jsxs)(hP.Popover,{className:`flex w-[20.5rem] max-w-[calc(100vw-2rem)] flex-col gap-3 p-3`,children:[(0,G.jsxs)(xH,{"aria-label":n,children:[(0,G.jsxs)(xH.Header,{children:[(0,G.jsxs)(xH.YearPickerTrigger,{children:[(0,G.jsx)(xH.YearPickerTriggerHeading,{}),(0,G.jsx)(xH.YearPickerTriggerIndicator,{})]}),(0,G.jsx)(xH.NavButton,{slot:`previous`}),(0,G.jsx)(xH.NavButton,{slot:`next`})]}),(0,G.jsxs)(xH.Grid,{children:[(0,G.jsx)(xH.GridHeader,{children:e=>(0,G.jsx)(xH.HeaderCell,{children:e})}),(0,G.jsx)(xH.GridBody,{children:e=>(0,G.jsx)(xH.Cell,{date:e})})]}),(0,G.jsx)(xH.YearPickerGrid,{children:(0,G.jsx)(xH.YearPickerGridBody,{children:({year:e})=>(0,G.jsx)(xH.YearPickerCell,{year:e})})})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(sR,{className:`text-xs`,children:r}),(0,G.jsx)(LP,{"aria-label":r,granularity:`minute`,hourCycle:24,value:e.timeRange?.start??null,onChange:t=>e.setTimeRange({start:t,end:e.timeRange?.end}),children:(0,G.jsx)(LP.Group,{className:`w-[7.5rem]`,variant:`secondary`,children:(0,G.jsx)(LP.Input,{children:e=>(0,G.jsx)(LP.Segment,{segment:e})})})})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(sR,{className:`text-xs`,children:i}),(0,G.jsx)(LP,{"aria-label":i,granularity:`minute`,hourCycle:24,value:e.timeRange?.end??null,onChange:t=>e.setTimeRange({start:e.timeRange?.start,end:t}),children:(0,G.jsx)(LP.Group,{className:`w-[7.5rem]`,variant:`secondary`,children:(0,G.jsx)(LP.Input,{children:e=>(0,G.jsx)(LP.Segment,{segment:e})})})})]})]})]})]})})}var pZ={today:`statsWindowToday`,1:`statsWindow1h`,24:`statsWindow24h`,168:`statsWindow7d`,720:`statsWindow30d`,custom:`statsWindowCustom`};function mZ(e,t){if(e===`today`){let e=new Date;return e.setHours(0,0,0,0),{from:e.toISOString()}}if(e===`custom`){let e=uZ(t?.start),n=uZ(t?.end,!0);return e&&n?{from:e,to:n}:null}if(e===`720`){let e=new Date;return{from:new Date(e.getTime()-2592e6).toISOString(),to:e.toISOString()}}return{hours:Number(e)}}function hZ({value:e,onChange:t,custom:n,onCustomChange:r,onBusy:i,t:a}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(qX,{value:e,onChange:r=>{let a=r;e!==a&&((a!==`custom`||n)&&i?.(),t(a))},ariaLabel:a(`statsTraffic`),options:Object.keys(pZ).map(e=>({id:e,label:a(pZ[e])}))}),e===`custom`?(0,G.jsx)(fZ,{className:`w-[min(100%,24rem)]`,value:n,onChange:e=>{e&&i?.(),r(e)},ariaLabel:a(`statsWindowCustom`),fromLabel:a(`logsTimeFrom`),toLabel:a(`logsTimeTo`)}):null]})}function gZ(e,t,n){let r=new URLSearchParams;for(let[t,n]of Object.entries(e))n&&r.set(t,n);let i=Date.parse(t),a=Date.parse(n);return Number.isFinite(i)&&Number.isFinite(a)&&(r.set(`from`,new Date(Math.floor(i/6e4)*6e4).toISOString()),r.set(`to`,new Date(Math.ceil(a/6e4)*6e4-6e4).toISOString())),`/logs?${r}`}function _Z(e){let t=String(e||``).toLowerCase();return!t||t===`qoder`||t===`qoder-global`||t===`qoder-cn`}function vZ(e){return String(e||``).toLowerCase()===`workbuddy`}function yZ(e){return String(e||``).toLowerCase()===`trae`}function bZ(e){return String(e||``).toLowerCase()===`devin`}function xZ(e){return String(e||``).toLowerCase()===`command`}function SZ(e){return String(e||``).toLowerCase()===`zhipu`}function CZ(e){return String(e||``).toLowerCase()===`qwenwork`}function wZ(e){return String(e||``).toLowerCase()===`kimi`}function TZ(e,t){let n=String(e||``).toLowerCase();return vZ(n)?`WorkBuddy`:yZ(n)?`Trae`:bZ(n)?`Devin`:xZ(n)?`Command Code`:SZ(n)?`Zhipu GLM`:CZ(n)?`QwenWork`:wZ(n)?`Kimi Code`:_Z(n)?`Qoder`:e||t(`account`)}function EZ(e,t,n){let r=String(e||``).toLowerCase(),i=String(t||``).toLowerCase();return vZ(r)?n(i===`global`?`accountTypeWorkBuddyGlobal`:`accountTypeWorkBuddyCN`):yZ(r)?n(`accountTypeTraeCN`):bZ(r)?n(`accountTypeDevinGlobal`):xZ(r)?n(`accountTypeCommandGlobal`):SZ(r)?n(`accountTypeZhipuCN`):CZ(r)?n(i===`cn`?`accountTypeQwenworkCN`:`accountTypeQwenworkGlobal`):wZ(r)?n(`accountTypeKimiCN`):_Z(r)?n(i===`cn`?`accountTypeQoderCN`:`accountTypeQoderGlobal`):e||n(`account`)}function DZ(e,t){let n=t??!!e.max_mode,r=e.catalog_context_length||e.default_context_length||e.context_length||0,i=e.catalog_context_length_max||0;return n&&i>0?{context_length:i,prompt_max_tokens:e.prompt_max_tokens_max||e.prompt_max_tokens,max_output_tokens:e.max_output_tokens_max||e.max_output_tokens}:{context_length:r,prompt_max_tokens:e.prompt_max_tokens,max_output_tokens:e.max_output_tokens}}function OZ({size:e=16,className:t=``}){return(0,G.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-[22%] bg-[#0a84ff] text-white ${t}`.trim(),style:{width:e,height:e,fontSize:Math.max(9,Math.round(e*.55)),fontWeight:650,lineHeight:1},"aria-hidden":`true`,children:`C`})}function kZ({size:e=16,className:t=``}){return(0,G.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,className:`block shrink-0 text-foreground ${t}`.trim(),"aria-hidden":`true`,children:(0,G.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.086.457a6.1 6.1 0 0 1 3.046-.415q2 .23 3.564 1.7a.12.12 0 0 0 .107.029q2.112-.519 4.061.366l.063.03l.154.076q2.036 1.055 2.918 3.198a5.6 5.6 0 0 1 .421 2.126 5.7 5.7 0 0 1-.18 1.631.17.17 0 0 0 .04.155 6 6 0 0 1 1.578 2.891q.577 2.852-1.183 5.14l-.182.22a6.06 6.06 0 0 1-2.934 1.851.16.16 0 0 0-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451q-2.374-.012-4.21-1.736a.14.14 0 0 0-.14-.032 5.9 5.9 0 0 1-1.604-.185 5.9 5.9 0 0 1-2.595-.622 6.06 6.06 0 0 1-2.146-1.781c-.203-.269-.404-.522-.551-.821a8 8 0 0 1-.495-1.283 6.1 6.1 0 0 1-.017-3.064.2.2 0 0 0 .008-.074.1.1 0 0 0-.037-.064 6 6 0 0 1-1.38-2.202 5.2 5.2 0 0 1-.333-1.589 6.9 6.9 0 0 1 .188-2.132q.675-2.226 2.577-3.493.424-.282.802-.438.429-.179.861-.304a.13.13 0 0 0 .087-.087A6 6 0 0 1 5.635 2.31Q6.655 1.04 8.086.457m-.804 7.85a.848.848 0 0 0-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 0 0 1.46.864l1.94-3.272a.85.85 0 0 0 .007-.854zm5.446 6.24a.849.849 0 0 0 0 1.695h4.848a.849.849 0 0 0 0-1.696z`})})}function AZ({size:e=16,className:t=``}){return(0,G.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-[22%] bg-[#1a1a1a] text-white ${t}`.trim(),style:{width:e,height:e,fontSize:Math.max(9,Math.round(e*.55)),fontWeight:650,lineHeight:1},"aria-hidden":`true`,children:`D`})}function jZ({size:e=16,className:t=``}){return(0,G.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,className:`block shrink-0 text-foreground ${t}`.trim(),"aria-hidden":`true`,children:(0,G.jsx)(`path`,{fill:`currentColor`,d:`M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79Z`})})}var MZ=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAJ5ElEQVR42u2dXUxUZxrH/wKDDDCM4CJBZJZNxMpGDMGYXsAWeikapF6Jqc02kUhWTWsTIQHjNk22yWCyN5INrk22rbsc71ZNpXfb0sJ+Gcxmma2mNpt1XMsaLd2ZoY7D5164btfiBx8zzDnv+f1uiWeG9/x8eN7neT9WFRaunROAIWQwBIDQAAgNgNAACA0IDYDQAAgNgNAACA0IDYDQAAgNgNAACA0IDYDQAAgNgNAACA0IDYDQAAgNgNAACA0IDYDQAAgNgNAA35LFEDyZ6uotKi8PqL6+ToFAuQoK/PL7/fL7CyRJ4fBNRaMRhcM3FQ6HFQqFNDoaUiQSYfDSxCqO031U4Lq6OjU1Nam6eov8fv+inxGJRDQ6GtLAwIAs6xxyI/TK0tTUpJ07d6iurk6BQCCpz45EIurrO62+vtOIjdCpIxAIqLPzWEokRmyEXjHq6+vU0dGh+vq6tHw+YiN00iJyb++ptImM2Aid1NSitbXVlt8vEomoq+u4LMvCRIR+Oq2trersPLYiOfJyCYfD6u4+rkuXBjASoZ0VlZ/G0NCwenp6NDQ0jJkI/aCOfPbs+46IyogtWt9Po739oAYHP3a8zNKDaszFixd08eIF20xkidArSGdnhzo7O4x9SZZlKRg8qXA4jLGmC/322z9Te/tBV7ysvr7TCgZ7KPWZKnRv7ynt29fqqhdGDdtQod0oM2IbKrSb0gzEXhyZXm/um06bAL7++muY/F9ycnJUX1+nPXteUiQSVSgUIkI75cvu29eq3t5TWKyndx0PHz7i2hq2Y4QOBAIaHPxoSYvu3YhbmzOOENrv92tw8CMjmiaILTqFnZ0dyKzldx2rq7cQoe3yQkB0HZ0uNKlG6ggGe4ws9dlaaOrNSyM2e0+3pu4oOntPX07dnffzzasDKvMUazY2ZVwN27ZCV1dv0eDgx9i5AK4lbuhy/Joux6/q1vRdXUvcWNC/K8sq1nbvZpXeX6N/9X+m3/zyrOPFtq3QLJ18egT+c/yqfjcx8j+Jk8GmyfWaOPOFRt4bRGgmgqnnfPRTnY99osvxayn9nJmxuKI/v6r7g7cRmuicXG5N3dEvxn+b1Ei8UCZHxvXvt/6qmbE4QhOdkyPy+dinaf0ec7Fpxd65rm+sf4jDGpdAR0eH3L4Ww7LO6Z2KQWVvK0p/xPNlqeBolTLyPYqduS46hVpc3dnNqYZlWWpublEw2GO775bftlFrTmwlQmuRG13dGpWDwZO2P3DGu6tMM2NxW0dqhE4zo6Mh7d//imNa0fltGyXJtlJn2Gky6LalocFgjxoaGh23riK/baMt8ntbC93U1OQqmbu6um2ZKy+UNSe2KsPnQWg98Sy6vXLLHsD9+19RX99pR/8emaVe5R/YiNB6wm4UN6QbkUhEzc27jTmUMa+1QpmlXoSen27scI3Mo6NmbWL1tVUitB6zss50TJRZelDKs1OUtoXQdXVmN1MOHz5ipMwPyWksQWj9X3fQ5B0pwWCP+vvNPqE/b28FQn87ISw39kX391uOLs1pERUPz6YChJak8vKAse3s7u7jcgvZtUUIbWqEflhrdtNZczkNJQj9MIc2MW82eRL4OEg5DBV6aGjY8V1ALXHddOZ6L0L7/QUyrUTnVrJKcxHatFTDzfeg2KHBgtBJPng8aS/GhivZENpl0TmZVY1VviwGFaGVtpqzGyeCRGiZe91a0l9MvoeBRej05M6WdS65L8XnIeVA6PRF52R3BO22aB6hSTdkQtcNoeW++0tSsV4ja5OPwUVopeGko3MyeV0EQrtsMjgwkJrNrp5KhEboFWZ4ODXpRva2IiocCJ2e/DkVrK5dy+Ai9MozMPBhSp5r1yO2EFpmt7pTsaouw+exzVYmhHYRoVDI+N3TCE3+LFP25SG061KOmynJnWmoILQxKYfdzohDaLmrqaIkL0ZiMojQxghNdDZI6Egk6riSXbKjs3dXGSaaI3TE1S9gzU+3YiFCm0H2tiJyZ9OETkUJzEkX74BhQkej7ozQvrZKtlqZKLTbDjWUHizgf3iBJRiYQ7tJ6gyfR/4T1Zhnch06FBp1zYDnt21ki5XpQg8N/d4Vg+3dVcaKOjcIPTw8LDfkzf6jP8Q4NwgdDodTtuFUNjnzrfBkLXsF3bSW49KlD42VeW3f85To3Ca0ZVnGHRaOzC5fbRcMnkRmMEdoU6I0MiO0MVEamRF6XpS2LGfejZ3XWqHiX9cjM0LPj9JOSz0K3qhSwdEqSnMIrcfWpZubWxyxVjqz1Kt1FxrpACL0QqTebWupfW2VWnehkRQDobXgpaXd3cdtJ3Xurg1ad6GRJaAIvXj6+y01N++2TU6dWeqV/0Q1URmhlxepm5tbUnYEFyB02nLqrq5u1+8UB4MOmunrO62amtqkX0UMCK10btsKBnvSInZBZh7WIHRqxW5oeHHFuou+jFysQejU59eHDh1RTU3tikwcN6/+PuYg9MpNHJubd6dU7LKs72EOQmtFT9hPpdjPrQ5gDkKbI/Z2bxXmIHT6xT506EhSOo5V5NAILZusta6pqV12c8aXkavt3s3Yg9AypjnT4nsBexBaxjRniNAI7QixF0qZp1gtvh9hEELbX+yFdh1/UvQSA4fQckTXsaGh8ZmlPqI0QjuGB2uwn13DJkojtExqzpR5ipEaoZ0t9nebM4eK9rC+Q9LMWByhnSh2TU3tvK7jr8q6XC+1HYTO9Hpz30RTLekCe8s6p0QioerqLSrOLdJ2b5U+nPijJuembP3d52LTWrU6I+nPjAT/prnJWYR2KolEQsPDw3r33feUSCT0Yk29NuSV6HL8qm2ljn9wS18f/4vuf3JbWaW5ylyfnN3r37z/dyX+cCftv9+qwsK1c6iZHPx+v9rbD6rx1R16baJXsdl7tkoHIm+NKjHylb57m63vQKWytxUt69l3Xx7WbGwKoU0V++U3XtVnLfd1LXEj7SJPnPlC9z745zPPG8ndtUF5eysWdT7fzFhcXx+7oqnPo7YYe4ROIYUb1ir/QKWmmwpX/LMnR8YVv3TrmSI/7h7FvL0VCxJ7Ziyur9r/ZIvJIEKvID94/jlFf7xmWX/WFxotJ0fGFTtzfdmSZfg88u4sU05DiTybCh6Re6n/WRDaMLK3FSmnoUS5Ozck7djdyZFx3R+8rckr4yn9s/9w8jjzZdzWY4zQSs/1yFmbfMppKFHOCyULrjTMxaY19XlUU9ejmhwZ1+SVcVtMxBAa5gmeWepVZqlXGT7PIz+bjU1pbmJa02P3bB8dERqA1jcAQgNCAyA0AEIDIDQAQgNCAyA0AEIDIDQAQgNCAyA0AEIDIDQAQgNCAyA0AEIDIDQgNABCAyA0AEIDIDQgNABCAyA0AEIDLIj/ABWOKFxbGBRBAAAAAElFTkSuQmCC`;function NZ({size:e=16,className:t=``}){return(0,G.jsx)(`img`,{src:MZ,alt:``,width:e,height:e,className:`block shrink-0 rounded-[22%] ${t}`.trim(),draggable:!1})}function PZ({size:e=16,className:t=``}){let n=Math.max(2,Math.round(e*.14));return(0,G.jsxs)(`span`,{className:`inline-flex shrink-0 items-baseline justify-center rounded-[22%] bg-[#18181B] text-white ${t}`.trim(),style:{width:e,height:e,fontSize:Math.max(9,Math.round(e*.5)),fontWeight:650,lineHeight:1},"aria-hidden":`true`,children:[(0,G.jsx)(`span`,{style:{alignSelf:`center`},children:`Q`}),(0,G.jsx)(`span`,{style:{alignSelf:`center`,width:n,height:n,marginLeft:Math.max(0,Math.round(e*.03)),borderRadius:`50%`,background:`#22D3EE`}})]})}function FZ({size:e=16,className:t=``}){return(0,G.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-[22%] bg-[#1a1a1a] text-white ${t}`.trim(),style:{width:e,height:e,fontSize:Math.max(9,Math.round(e*.55)),fontWeight:650,lineHeight:1},"aria-hidden":`true`,children:`T`})}var IZ=`/assets/workbuddy-mark-D1Gu2IKl.svg`;function LZ({size:e=16,className:t=``}){return(0,G.jsx)(`img`,{src:IZ,alt:``,width:e,height:e,className:`block shrink-0 ${t}`.trim(),draggable:!1})}function RZ({size:e=16,className:t=``}){return(0,G.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,className:`block shrink-0 text-foreground ${t}`.trim(),"aria-hidden":`true`,children:(0,G.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M11.991 23.503a.24.24 0 0 0-.244.248a.24.24 0 0 0 .244.249a.24.24 0 0 0 .245-.249a.24.24 0 0 0-.22-.247zM9.671 5.365a1.697 1.697 0 0 1 1.099 2.132l-.071.172l-.016.04l-.018.054c-.07.16-.104.32-.104.498c-.035.71.47 1.279 1.186 1.314h.366c1.309.053 2.338 1.173 2.286 2.523c-.052 1.332-1.152 2.38-2.478 2.327h-.174c-.715.018-1.274.64-1.239 1.368c0 .124.018.23.053.337c.209.373.54.658.96.8c.75.23 1.517-.125 1.9-.782l.018-.035c.402-.64 1.17-.96 1.92-.711c.854.284 1.378 1.226 1.099 2.167a1.66 1.66 0 0 1-2.077 1.102a1.7 1.7 0 0 1-.907-.711l-.017-.035c-.2-.323-.463-.58-.851-.711l-.056-.018a1.646 1.646 0 0 0-1.954.746a1.66 1.66 0 0 1-1.065.764a1.677 1.677 0 0 1-1.989-1.279c-.209-.906.332-1.83 1.257-2.043a1.5 1.5 0 0 1 .296-.035h.018c.68-.071 1.151-.622 1.116-1.333a1.3 1.3 0 0 0-.227-.693a2.5 2.5 0 0 1-.366-1.403a2.4 2.4 0 0 1 .366-1.208c.14-.195.21-.444.227-.693c.018-.71-.506-1.261-1.186-1.332l-.07-.018a1.4 1.4 0 0 1-.299-.07l-.05-.019a1.7 1.7 0 0 1-1.047-2.114a1.68 1.68 0 0 1 2.094-1.101m-5.575 10.11c.26-.264.639-.367.994-.27s.633.379.728.74c.095.362-.007.748-.267 1.013c-.402.41-1.053.41-1.455 0a1.06 1.06 0 0 1 0-1.482zm14.845-.294c.359-.09.738.024.992.297c.254.274.344.665.237 1.025s-.396.634-.756.718c-.551.128-1.1-.22-1.23-.781a1.05 1.05 0 0 1 .757-1.26zm-.064-4.39c.314.32.49.753.49 1.206s-.176.886-.49 1.206c-.315.32-.74.5-1.185.5c-.444 0-.87-.18-1.184-.5a1.727 1.727 0 0 1 0-2.412a1.654 1.654 0 0 1 2.369 0m-11.243.163c.364.484.447 1.128.218 1.691a1.665 1.665 0 0 1-2.188.923c-.855-.36-1.26-1.358-.907-2.228a1.68 1.68 0 0 1 1.33-1.038a1.66 1.66 0 0 1 1.547.652m11.545-4.221c.368 0 .708.2.892.524s.184.724 0 1.048a1.03 1.03 0 0 1-.892.524a1.04 1.04 0 0 1-1.03-1.048a1.04 1.04 0 0 1 1.03-1.048m-14.358 0c.368 0 .707.2.891.524s.184.724 0 1.048a1.03 1.03 0 0 1-.891.524a1.04 1.04 0 0 1-1.03-1.048c0-.579.461-1.048 1.03-1.048m10.031-1.475c.925 0 1.675.764 1.675 1.706s-.75 1.705-1.675 1.705s-1.674-.763-1.674-1.705s.75-1.706 1.674-1.706m-2.626-.684c.362-.082.653-.356.761-.718a1.06 1.06 0 0 0-.238-1.028a1.02 1.02 0 0 0-.996-.294c-.547.14-.881.7-.752 1.257c.13.558.675.907 1.225.783m0 16.876c.359-.087.644-.36.75-.72a1.06 1.06 0 0 0-.237-1.019a1.02 1.02 0 0 0-.985-.301a1.04 1.04 0 0 0-.762.717c-.108.361-.017.754.239 1.028c.245.263.606.377.953.305zM17.19 3.5a.63.63 0 0 0 .628-.64a.63.63 0 0 0-.628-.64a.63.63 0 0 0-.628.64c0 .355.28.64.628.64m-10.38 0a.63.63 0 0 0 .628-.64c0-.355-.28-.64-.628-.64a.63.63 0 0 0-.628.64c0 .355.279.64.628.64m-5.182 7.852a.63.63 0 0 0-.628.64c0 .354.28.639.628.639a.63.63 0 0 0 .627-.606l.001-.034a.62.62 0 0 0-.628-.64zm5.182 9.13a.63.63 0 0 0-.628.64c0 .355.279.64.628.64a.63.63 0 0 0 .628-.64c0-.355-.28-.64-.628-.64m10.38.018a.63.63 0 0 0-.628.64c0 .355.28.64.628.64a.63.63 0 0 0 .628-.64a.63.63 0 0 0-.628-.64m5.182-9.148a.63.63 0 0 0-.628.64c0 .354.279.639.628.639a.63.63 0 0 0 .628-.64c0-.355-.28-.64-.628-.64zm-.384-4.992a.24.24 0 0 0 .244-.249a.24.24 0 0 0-.244-.249a.24.24 0 0 0-.244.249c0 .142.122.249.244.249M11.991.497a.24.24 0 0 0 .245-.248A.24.24 0 0 0 11.99 0a.24.24 0 0 0-.244.249c0 .133.108.236.223.247zM2.011 6.36a.24.24 0 0 0 .245-.249a.24.24 0 0 0-.244-.249a.24.24 0 0 0-.244.249a.24.24 0 0 0 .244.249zm0 11.263a.24.24 0 0 0-.243.248a.24.24 0 0 0 .244.249a.24.24 0 0 0 .244-.249a.25.25 0 0 0-.244-.248zm19.995-.018a.24.24 0 0 0-.245.248a.24.24 0 0 0 .245.25a.24.24 0 0 0 .244-.25a.25.25 0 0 0-.244-.248z`})})}function zZ({provider:e,size:t=16,className:n=``}){let r=String(e||``).toLowerCase();return r===`workbuddy`?(0,G.jsx)(LZ,{size:t,className:n}):r===`trae`?(0,G.jsx)(FZ,{size:t,className:n}):r===`devin`?(0,G.jsx)(AZ,{size:t,className:n}):r===`command`?(0,G.jsx)(OZ,{size:t,className:n}):r===`codex`?(0,G.jsx)(kZ,{size:t,className:n}):r===`zhipu`?(0,G.jsx)(RZ,{size:t,className:n}):r===`qwenwork`?(0,G.jsx)(PZ,{size:t,className:n}):r===`kimi`?(0,G.jsx)(jZ,{size:t,className:n}):(0,G.jsx)(NZ,{size:t,className:n})}var BZ=(0,v.lazy)(()=>C(()=>import(`./LiveSparkline-g4J_1uGD.js`).then(e=>({default:e.LiveSparkline})),__vite__mapDeps([0,1,2])));function VZ({live:e,samples:t,t:n}){let r=e?.in_flight??null,i=e?.capacity??0,a=r!=null&&i>0?r/i:0,o=i>0&&r!=null&&r>=i;return(0,G.jsxs)(`div`,{"data-testid":`live-strip`,className:`flex min-h-11 flex-wrap items-center gap-x-5 gap-y-2 overflow-hidden rounded-lg bg-surface-secondary px-4 py-2.5 text-caption text-muted sm:h-11 sm:gap-x-6 sm:gap-y-1 sm:py-0`,children:[(0,G.jsx)(`span`,{className:`inline-flex items-center`,children:(0,G.jsx)(`span`,{className:`status-dot`,"data-state":r==null?``:o?`warn`:r>0?`ok`:``})}),(0,G.jsxs)(`span`,{className:`inline-flex flex-col gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[n(`liveConcurrency`),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,G.jsxs)(`span`,{className:`mono tabular text-body font-semibold ${o?`text-warning`:`text-foreground`}`,children:[r??`—`,(0,G.jsxs)(`span`,{className:`font-normal text-muted`,children:[`/`,e?i:`—`]})]}),(0,G.jsx)(`span`,{className:`inline-block h-[3px] w-12 overflow-hidden rounded-[2px] bg-separator`,children:(0,G.jsx)(`span`,{className:`block h-full ${o?`bg-warning`:`bg-foreground/60`}`,style:{width:`${Math.min(100,a*100)}%`}})})]})]}),(0,G.jsxs)(`span`,{className:`inline-flex flex-col gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[n(`liveRpm`),(0,G.jsx)(`span`,{className:`mono tabular text-body font-semibold text-foreground`,children:e?.rpm??`—`})]}),(0,G.jsxs)(`span`,{className:`inline-flex flex-col gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[n(`liveTrace`),(0,G.jsx)(v.Suspense,{fallback:(0,G.jsx)(`span`,{className:`inline-block h-6 w-[120px]`}),children:(0,G.jsx)(BZ,{samples:t,capacity:i,label:n(`liveTrace`)})})]})]})}var HZ=2500;Math.round(6e4/HZ);function UZ(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)([]);return(0,v.useEffect)(()=>{let e=!1,n=null,i=()=>{document.hidden||OY().then(n=>{e||(t(n),r(e=>[...e,{at:Date.now(),value:n.in_flight}].slice(-24)))}).catch(()=>{})},a=()=>{n||document.hidden||(i(),n=setInterval(i,HZ))},o=()=>{n&&clearInterval(n),n=null},s=()=>document.hidden?o():a();return a(),document.addEventListener(`visibilitychange`,s),()=>{e=!0,o(),document.removeEventListener(`visibilitychange`,s)}},[]),{live:e,samples:n}}var WZ=(0,v.lazy)(()=>C(()=>import(`./TrafficChart-jYJwrZhA.js`).then(e=>({default:e.TrafficChart})),__vite__mapDeps([3,1,4]))),GZ=3e4,KZ={window:{from:``,to:``,hours:24},totals:{requests:0,ok:0,incomplete:0,error:0,canceled:0,streaming:0,success_rate:0},latency:{},tokens:{prompt:0,completion:0,cache_read:0,total:0},status:[],errors:[],models:[],accounts:[],providers:[],series:[]};function qZ(e,t){return!e||e===`(unknown)`?t(`statsUnknown`):TZ(e,t)}function JZ(e,t,n){return!t||t===`(unassigned)`?n:e.find(e=>e.id===t)?.name||t}var YZ=new Set([`quota`,`rate_limit`,`auth`,`not_ready`,`unavailable`,`invalid_request`,`model_not_available`]);function XZ(e,t){let n={quota:`logsKindQuota`,rate_limit:`logsKindRateLimit`,auth:`logsKindAuth`,not_ready:`logsKindNotReady`,unavailable:`logsKindUnavailable`,invalid_request:`logsKindInvalidRequest`,model_not_available:`logsKindModelNotAvailable`};return n[e]?t(n[e]):e}var ZZ=[`ok`,`incomplete`,`error`,`canceled`],QZ={ok:`bg-success`,incomplete:`bg-warning`,error:`bg-danger`,canceled:`bg-muted`},$Z={ok:`logsFilterOk`,incomplete:`logsFilterIncomplete`,error:`logsFilterError`,canceled:`logsFilterCanceled`};function eQ(e,t){return t>0?e/t:null}function tQ(e,t){if(!e)return null;let n=Date.parse(e);if(!Number.isFinite(n))return null;let r=Math.max(0,Math.round((n-t)/1e3));if(r<=0)return null;let i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60;return i?`${i}h ${a}m`:a?`${a}m ${String(o).padStart(2,`0`)}s`:`${o}s`}function nQ(e,t){let n=[e.down_until,e.cooldown_until].filter(e=>!!e).filter(e=>Date.parse(e)>t);return n.length?n.reduce((e,t)=>Date.parse(e)>=Date.parse(t)?e:t):null}function rQ(e,t){return t?`danger`:(e??0)>=80?`warning`:`ok`}function iQ(){let{lang:e,t}=DH(),{overview:n,loading:r,error:i}=dU(),[a,o]=(0,v.useState)(`today`),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),d=ot(),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(!0),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(!0),[T,E]=(0,v.useState)([]),[D,O]=(0,v.useState)(!0),[k,A]=(0,v.useState)(0),[j,M]=(0,v.useState)([]),[N,P]=(0,v.useState)(null),[ee,F]=(0,v.useState)(()=>Date.now()),{live:I,samples:L}=UZ(),te=new Map((I?.accounts??[]).map(e=>[e.id,e])),R=!!n?.proxy?.ok,z=!!n?.worker?.ok,B=n?.worker?.ready_count??0,ne=n?.worker?.hot_count??0,re=n?.worker?.cooling_count??0,ie=I?.in_flight??n?.worker?.in_flight??0,V=f??KZ,ae=n?.routing?.session_affinity,oe=(ae?.hits??0)+(ae?.misses??0),se=eQ(ae?.hits??0,oe),ce=T.map(e=>({account:e,until:nQ(e,ee)})).filter(e=>e.until!=null),le=ce.length>0;(0,v.useEffect)(()=>{if(!le)return;let e=setInterval(()=>F(Date.now()),1e3);return()=>clearInterval(e)},[le]),(0,v.useEffect)(()=>{let e=!1;return Promise.allSettled([LH(!1),GH(),GH(void 0,!1,`regional`)]).then(([t,n,r])=>{e||(t.status===`fulfilled`&&E(t.value.data||[]),n.status===`fulfilled`&&A((n.value.data||[]).length),r.status===`fulfilled`&&M(r.value.data||[]))}).finally(()=>{e||O(!1)}),()=>{e=!0}},[]);let ue=s?.start?.toString()??``,de=s?.end?.toString()??``,fe=(0,v.useRef)(0),pe=(0,v.useCallback)(e=>{let t=mZ(a,s);if(!t){_(!1);return}let n=++fe.current;tX(t).then(e=>{n===fe.current&&(p(e),h(``))}).catch(t=>{n!==fe.current||e||(p(null),h(t instanceof Error?t.message:String(t)))}).finally(()=>{n===fe.current&&_(!1)})},[a,ue,de]);(0,v.useEffect)(()=>(pe(!1),()=>{fe.current++}),[pe]);let me=(0,v.useRef)(0),he=(0,v.useCallback)(e=>{let t=mZ(a,s)??{},n=++me.current;nX(t).then(e=>{n===me.current&&(b(e),S(``))}).catch(t=>{n!==me.current||e||(b(null),S(t instanceof Error?t.message:String(t)))}).finally(()=>{n===me.current&&w(!1)})},[a,ue,de]);(0,v.useEffect)(()=>(he(!1),()=>{me.current++}),[he]),(0,v.useEffect)(()=>{if(l)return;let e=Date.now(),t=()=>{document.hidden||(e=Date.now(),pe(!0),he(!0))},n=setInterval(t,GZ),r=()=>{!document.hidden&&Date.now()-e>=GZ&&t()};return document.addEventListener(`visibilitychange`,r),()=>{clearInterval(n),document.removeEventListener(`visibilitychange`,r)}},[l,pe,he]),(0,v.useEffect)(()=>{let e=!1,t=()=>{OU().then(t=>{e||P(t)}).catch(()=>{})};t();let n=setInterval(t,5e3);return()=>{e=!0,clearInterval(n)}},[]);let ge=Math.floor(V.series.length/2),_e=(e,t)=>e.reduce((e,n)=>e+n[t],0),ve=V.series.slice(0,ge),ye=V.series.slice(ge),be=((e,t)=>e>0?(t-e)/e:null)(_e(ve,`requests`),_e(ye,`requests`)),xe=_e(ve,`requests`)?_e(ve,`ok`)/_e(ve,`requests`):null,Se=_e(ye,`requests`)?_e(ye,`ok`)/_e(ye,`requests`):null,Ce=xe!=null&&Se!=null?Se-xe:null,we=[{label:t(`metricRequests`),value:V.totals.requests,kind:`compact`,detail:t(`statsWindowHint`,{window:t(pZ[a])}),ok:V.totals.requests>0,trend:be},{label:t(`metricSuccess`),value:V.totals.success_rate,kind:`percent`,detail:`${V.totals.ok} ${t(`logsFilterOk`)} · ${V.totals.incomplete} ${t(`logsFilterIncomplete`)} · ${V.totals.error} ${t(`logsFilterError`)}`,ok:V.totals.requests===0||V.totals.success_rate>=.9,trend:Ce},{label:t(`metricLatency`),value:V.latency.p95_ms??V.latency.avg_ms,kind:`ms`,detail:`p50 ${cX(V.latency.p50_ms)} · avg ${cX(V.latency.avg_ms)}`,ok:V.latency.p95_ms==null||V.latency.p95_ms<8e3,trend:null},{label:t(`metricTokens`),value:V.tokens.total,kind:`compact`,detail:`${sX(V.tokens.prompt)} / ${sX(V.tokens.completion)}`,ok:!0,trend:null}],Te=eQ(V.tokens.cache_read,V.tokens.prompt),Ee=eQ(V.totals.streaming,V.totals.requests),De=[{label:t(`metricCacheHit`),value:Te,kind:`percent`,detail:t(`metricCacheHitDetail`,{read:sX(V.tokens.cache_read),prompt:sX(V.tokens.prompt)})},{label:t(`metricStreaming`),value:Ee,kind:`percent`,detail:t(`metricStreamingDetail`,{count:V.totals.streaming,total:V.totals.requests})},{label:t(`metricCanceled`),value:V.totals.canceled,kind:`int`,detail:t(`metricCanceledDetail`,{rate:uX(eQ(V.totals.canceled,V.totals.requests)??0)})}],Oe=ZZ.map(e=>({key:e,count:V.status.find(t=>t.key===e)?.count??V.totals[e]??0})),ke=e=>gZ(e,V.window.from,V.window.to);return r&&!n?(0,G.jsx)(mY,{}):(0,G.jsxs)(`div`,{className:`space-y-5 sm:space-y-4`,children:[(0,G.jsxs)(`section`,{className:`grid gap-3 pb-1 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{"data-gsap-reveal":!0,className:`text-title font-semibold`,children:t(`homeDisplay`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:t(`homeLead`)})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(hZ,{value:a,onChange:o,custom:s,onCustomChange:c,onBusy:()=>{_(!0),w(!0)},t}),(0,G.jsxs)(eL,{delay:300,children:[(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,"aria-label":t(l?`statsRefreshResume`:`statsRefreshPause`),"aria-pressed":l,onPress:()=>u(e=>!e),children:l?(0,G.jsx)(Sa,{size:14}):(0,G.jsx)(va,{size:14})}),(0,G.jsx)(eL.Content,{children:t(l?`statsRefreshPaused`:`statsRefreshAuto`)})]}),(0,G.jsxs)(`div`,{className:`text-left sm:text-right`,children:[(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:n?.time||`—`}),(0,G.jsxs)(`div`,{className:`mt-1 inline-flex items-center gap-2 text-body font-medium`,children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":R&&z?`ok`:`danger`}),t(R&&z?`running`:`degraded`)]})]})]})]}),i?(0,G.jsx)(bU,{title:t(`failedOverview`,{msg:i})}):null,(0,G.jsx)(VZ,{live:I,samples:L,t}),(0,G.jsx)(`section`,{"data-gsap-reveal":!0,className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-4`,children:we.map(e=>(0,G.jsxs)(zw,{className:`gap-0 p-3.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-body text-muted`,children:e.label}),(0,G.jsx)(`span`,{className:`status-dot`,"data-state":e.ok?`ok`:`danger`})]}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`tabular text-metric font-medium leading-none`,children:g?(0,G.jsx)($,{className:`h-7 w-24`}):e.value==null?`—`:(0,G.jsx)(SX,{value:e.value,kind:e.kind})}),!g&&e.trend!=null?(0,G.jsx)(cQ,{value:e.trend,hint:t(`trendHalfHint`)}):null]}),(0,G.jsx)(`div`,{className:`mono mt-2 truncate text-caption text-muted`,children:g?(0,G.jsx)($,{className:`h-3 w-28`}):e.detail})]},e.label))}),(0,G.jsx)(`section`,{className:`grid gap-3 sm:grid-cols-3`,children:De.map(e=>(0,G.jsx)(zw,{className:`gap-0 p-3.5`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body text-muted`,children:e.label}),(0,G.jsx)(`div`,{className:`mono mt-0.5 truncate text-caption text-muted`,children:g?(0,G.jsx)($,{className:`h-3 w-28`}):e.detail})]}),(0,G.jsx)(`div`,{className:`tabular text-section font-semibold sm:shrink-0`,children:g?(0,G.jsx)($,{className:`h-5 w-12`}):e.value==null?`—`:(0,G.jsx)(SX,{value:e.value,kind:e.kind})})]})},e.label))}),(0,G.jsx)(`section`,{className:`grid gap-3`,children:(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`statsTraffic`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`statsTrafficHint`)})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:V.totals.error?`warning`:`success`,children:uX(V.totals.success_rate)})]}),(0,G.jsxs)(`div`,{className:`space-y-4 p-4`,children:[m?(0,G.jsx)(`div`,{className:`text-body text-danger`,children:t(`failedStats`,{msg:m})}):g?(0,G.jsx)(fY,{}):V.series.some(e=>e.requests>0)?(0,G.jsx)(v.Suspense,{fallback:(0,G.jsx)(fY,{}),children:(0,G.jsx)(WZ,{series:V.series,lang:e,emptyLabel:t(`statsEmptyTraffic`),okLabel:t(`logsFilterOk`),errorLabel:t(`logsFilterError`),selectHint:t(`statsDragHint`),labels:{requests:t(`chartMetricRequests`),tokens:t(`chartMetricTokens`),latency:t(`chartMetricLatency`),input:t(`chartInput`),output:t(`chartOutput`),cacheRead:t(`chartCacheRead`),p50:t(`statsLatencyP50`),p95:t(`statsLatencyP95`),total:t(`chartTotal`)},onSelectRange:(e,t)=>d(gZ({},e,t))})}):(0,G.jsx)(wX,{emptyLabel:t(`statsEmptyTraffic`)}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-4 pt-3 sm:grid-cols-4 sm:gap-3`,children:[[t(`statsLatencyP50`),cX(V.latency.p50_ms)],[t(`statsLatencyP95`),cX(V.latency.p95_ms)],[t(`statsLatencyAvg`),cX(V.latency.avg_ms)],[t(`statsTTFB`),cX(V.latency.ttfb_avg_ms)]].map(([e,t])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e}),(0,G.jsx)(`div`,{className:`mono mt-1 text-body font-medium`,children:g?(0,G.jsx)($,{className:`h-4 w-16`}):t})]},String(e)))})]})]})}),(0,G.jsx)(GX,{accounts:T,t}),(0,G.jsx)(sZ,{usage:y,accounts:T,loading:C,t}),x?(0,G.jsx)(bU,{title:t(`failedStats`,{msg:x})}):null,(0,G.jsx)(lZ,{usage:y,accounts:T,models:j,loading:C,t}),(0,G.jsxs)(`section`,{className:`grid gap-3 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,.85fr)]`,children:[(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`statsPool`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`statsPoolHint`)})]}),(0,G.jsxs)(Cn,{to:`/accounts`,className:`inline-flex items-center gap-1 text-caption font-medium text-muted hover:text-foreground`,children:[t(`navAccounts`),(0,G.jsx)(ei,{size:12})]})]}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-y-1 border-b border-separator sm:grid-cols-4 sm:gap-y-0`,children:[[t(`ready`),B,`ok`],[t(`hot`),ne,ne?`ok`:``],[t(`inFlight`),ie,ie?`ok`:``],[t(`statsAffinityHit`),se==null?`—`:uX(se),``,ae?t(`statsAffinityHint`,{hits:ae.hits??0,misses:ae.misses??0,bindings:ae.bindings??0}):``]].map(([e,t,n,r])=>(0,G.jsxs)(`div`,{className:`px-4 py-3 sm:py-2.5`,title:r?String(r):void 0,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2 sm:mt-1`,children:[(0,G.jsx)(`span`,{className:`mono text-section font-semibold`,children:t}),n?(0,G.jsx)(`span`,{className:`status-dot`,"data-state":n}):null]})]},String(e)))}),!D&&ce.length?(0,G.jsxs)(`div`,{className:`border-b border-separator px-4 py-2.5`,children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:t(`statsCoolingDetails`)}),(0,G.jsx)(`div`,{className:`mt-2 space-y-1.5`,children:ce.map(({account:e,until:n})=>(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-caption sm:flex-row sm:items-center sm:gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`status-dot shrink-0`,"data-state":`warn`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name||e.id})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pl-4 sm:contents sm:pl-0`,children:[(0,G.jsx)(`span`,{className:`mono shrink-0 text-muted`,children:e.last_error_kind?XZ(e.last_error_kind,t):t(`statsUnknown`)}),(0,G.jsx)(`span`,{className:`mono shrink-0 tabular sm:w-16 sm:text-right`,children:tQ(n,ee)??`—`}),(0,G.jsx)(`span`,{className:`mono shrink-0 text-muted sm:w-12 sm:text-right`,title:t(`statsBackoffLevel`),children:e.restart_backoff_level?`L${e.restart_backoff_level}`:`—`})]})]},e.id))})]}):null,(0,G.jsx)(`div`,{className:`divide-y divide-separator`,children:D?(0,G.jsx)(dY,{}):T.length===0?(0,G.jsx)(`div`,{className:`px-4 py-6 text-body text-muted`,children:t(`noAccounts`)}):T.slice(0,6).map(e=>{let n=e.quota,r=rQ(n?.percentage,n?.exceeded),i=te.get(e.id),a=i?.in_flight??e.in_flight??e.inFlight??0,o=i?.max_inflight||e.max_inflight||4,s=a>=o;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-2.5 px-4 py-3 sm:flex-row sm:items-center sm:gap-3 sm:py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3 sm:items-center`,children:[(0,G.jsx)(`span`,{className:`status-dot mt-1.5 shrink-0 sm:mt-0`,"data-state":e.ready?`ok`:`danger`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(zZ,{provider:e.provider,size:14}),(0,G.jsx)(`div`,{className:`truncate text-body font-medium`,children:e.name||e.id})]}),(0,G.jsxs)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:[EZ(e.provider,e.region,t),` · `,e.hot?t(`hot`):e.ready?t(`ready`):t(`degraded`)]})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 pl-6 sm:shrink-0 sm:pl-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,title:t(s?`liveSaturated`:`inFlight`),"data-testid":`account-inflight`,children:[(0,G.jsx)(`span`,{className:`text-caption text-muted sm:hidden`,children:t(`inFlight`)}),(0,G.jsxs)(`span`,{className:`mono text-caption tabular ${s?`text-warning`:`text-muted`}`,children:[a,`/`,o]}),(0,G.jsx)(`span`,{className:`inline-block h-[2px] w-10 overflow-hidden rounded-[1px] bg-separator`,children:(0,G.jsx)(`span`,{className:`block h-full ${s?`bg-warning`:`bg-foreground/50`}`,style:{width:`${Math.min(100,a/o*100)}%`}})})]}),n?(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,title:t(`quota`),children:[(0,G.jsx)(`span`,{className:`text-caption text-muted sm:hidden`,children:t(`quota`)}),(0,G.jsxs)(`span`,{className:`mono text-caption tabular text-muted`,children:[Math.round(n.percentage??0),`%`]}),(0,G.jsx)(`span`,{className:`inline-block h-[2px] w-10 overflow-hidden rounded-[1px] bg-separator`,children:(0,G.jsx)(`span`,{className:`block h-full ${r===`danger`?`bg-danger`:r===`warning`?`bg-warning`:`bg-success`}`,style:{width:`${Math.min(100,Math.max(0,n.percentage??0))}%`}})})]}):null]})]},e.id)})}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-t border-separator px-4 py-2.5 text-caption text-muted`,children:[(0,G.jsxs)(`span`,{children:[t(`metricModels`),` `,k]}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-x-2 gap-y-1`,children:[[`qoder`,`workbuddy`,`trae`].map(e=>{let t=T.filter(t=>String(t.provider||`qoder`).toLowerCase()===e).length;return t?(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,G.jsx)(zZ,{provider:e,size:11}),t]},e):null}),(0,G.jsx)(`span`,{children:re?`${re} ${t(`statsCooling`)}`:`${T.length} ${t(`accountCount`)}`})]})]})]}),(0,G.jsx)(oQ,{resources:N,t})]}),(0,G.jsxs)(`section`,{className:`grid gap-3 xl:grid-cols-2 2xl:grid-cols-3`,children:[(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`statsTopProviders`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`statsTopProvidersHint`)})]})}),g?(0,G.jsx)(dY,{}):(0,G.jsx)(sQ,{empty:t(`statsNoProviders`),items:(V.providers||[]).map(e=>({key:e.key,label:qZ(e.key,t),count:e.count,meta:`${e.ok}/${e.count}`,mark:e.key===`(unknown)`?void 0:e.key,href:e.key===`(unknown)`?void 0:ke({provider:e.key})}))})]}),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`statsTopModels`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`providerCatalog`)})]})}),g?(0,G.jsx)(dY,{rows:4}):(0,G.jsx)(sQ,{empty:t(`statsNoModels`),items:V.models.map(e=>({key:e.key,label:e.key===`(unknown)`?t(`statsUnknown`):e.key,count:e.count,href:e.key===`(unknown)`?void 0:ke({model:e.key}),meta:e.latency_avg_ms==null?`${e.ok}/${e.count}`:cX(e.latency_avg_ms)}))})]}),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`statsStatusMix`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`statsStatusMixHint`)})]})}),g?(0,G.jsx)(dY,{rows:4}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(lQ,{items:Oe,t}),(0,G.jsx)(`div`,{className:`border-t border-separator px-4 pt-2.5 text-caption font-medium text-muted`,children:t(`statsErrorMix`)}),(0,G.jsx)(sQ,{empty:t(`statsNoErrors`),danger:!0,items:V.errors.map(e=>({key:e.key,label:XZ(e.key,t),count:e.count,href:YZ.has(e.key)?ke({error_kind:e.key}):void 0}))}),(0,G.jsx)(`div`,{className:`border-t border-separator px-4 pt-2.5 text-caption font-medium text-muted`,children:t(`statsTopAccounts`)}),(0,G.jsx)(sQ,{empty:t(`statsNoAccounts`),items:V.accounts.slice(0,5).map(e=>({key:e.key,label:JZ(T,e.key,t(`statsUnassigned`)),count:e.count,href:!e.key||e.key===`(unassigned)`?void 0:ke({account:e.key}),meta:`${e.ok}/${e.count}`}))})]})]})]})]})}function aQ(e,t){return e>=2147483648||t>=200?`danger`:e>=1073741824||t>=100?`warning`:`ok`}function oQ({resources:e,t}){let n=[...e?.workers??[]].sort((e,t)=>t.rss_bytes-e.rss_bytes),r=e?.server;return(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`resTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`resHint`)})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:e?`success`:`default`,children:e?lX(e.total_rss_bytes):`—`})]}),(0,G.jsx)(`div`,{className:`divide-y divide-separator`,children:e?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`px-4 py-2.5`,children:(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`status-dot shrink-0`,"data-state":aQ(r?.rss_bytes??0,r?.cpu_percent??0)}),(0,G.jsx)(`div`,{className:`truncate text-body font-medium`,children:t(`resServer`)}),(0,G.jsxs)(`span`,{className:`mono text-caption text-muted`,children:[`pid `,r?.pid]})]}),(0,G.jsxs)(`div`,{className:`mono shrink-0 text-caption text-muted`,children:[lX(r?.rss_bytes),` · `,(r?.cpu_percent??0).toFixed(1),`%`]})]})}),n.length===0?(0,G.jsx)(`div`,{className:`px-4 py-3 text-body text-muted`,children:t(`resEmpty`)}):n.map(e=>(0,G.jsx)(`div`,{className:`px-4 py-2.5`,children:(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`status-dot shrink-0`,"data-state":aQ(e.rss_bytes,e.cpu_percent)}),(0,G.jsx)(`div`,{className:`truncate text-body font-medium`,children:e.label||e.account_id}),(0,G.jsxs)(`span`,{className:`mono text-caption text-muted`,children:[`pid `,e.pid]})]}),(0,G.jsxs)(`div`,{className:`mono shrink-0 text-caption text-muted`,children:[lX(e.rss_bytes),` · `,e.cpu_percent.toFixed(1),`%`]})]})},e.pid))]}):(0,G.jsx)(dY,{rows:3})}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-t border-separator px-4 py-2.5 text-caption text-muted`,children:[(0,G.jsxs)(`span`,{className:`mono`,children:[r?.goroutines??0,` `,t(`resGoroutines`)]}),(0,G.jsx)(`span`,{className:`mono`,children:e?.sampled_at?new Date(e.sampled_at).toLocaleTimeString():`—`})]})]})}function sQ({items:e,empty:t,danger:n}){let r=(0,v.useRef)(null),i=Math.max(1,...e.map(e=>e.count)),a=e.map(e=>`${e.key}:${e.count}`).join(`|`);return(0,v.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=eY.context(()=>{let e=eY.matchMedia();e.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(`[data-rank-fill]`,{clearProps:`transform`})}),e.add(`(prefers-reduced-motion: no-preference)`,()=>{let e=eY.utils.toArray(`[data-rank-fill]`);e.length&&eY.fromTo(e,{scaleX:0},{scaleX:1,duration:.38,ease:`power2.out`,stagger:.05,transformOrigin:`0% 50%`})})},e);return()=>t.revert()},[a]),e.length?(0,G.jsx)(`div`,{ref:r,className:`divide-y divide-separator`,children:e.map(e=>{let t=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e.mark?(0,G.jsx)(zZ,{provider:e.mark,size:14}):null,(0,G.jsx)(`div`,{className:`truncate text-body font-medium`,children:e.label})]}),(0,G.jsx)(`div`,{className:`mono shrink-0 text-caption text-muted`,children:e.meta?`${e.count} · ${e.meta}`:e.count})]}),(0,G.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-[2px] bg-separator`,children:(0,G.jsx)(`div`,{"data-rank-fill":!0,className:`h-full origin-left rounded-[2px] ${n?`bg-danger`:`bg-success`}`,style:{width:`${Math.max(6,e.count/i*100)}%`}})})]});return e.href?(0,G.jsx)(Cn,{to:e.href,className:`rank-row block px-4 py-2.5`,title:e.label,children:t},e.key):(0,G.jsx)(`div`,{className:`px-4 py-2.5`,children:t},e.key)})}):(0,G.jsx)(`div`,{className:`px-4 py-6 text-body text-muted`,children:t})}function cQ({value:e,hint:t}){let n=Math.abs(e)<.005?`flat`:e>0?`up`:`down`;return(0,G.jsxs)(`span`,{className:`trend-chip`,"data-tone":n,title:t,children:[(0,G.jsx)(n===`down`?Xa:n===`up`?Qa:gi,{size:12,weight:`bold`}),e>0?`+`:``,(e*100).toFixed(1),`%`]})}function lQ({items:e,t}){let n=e.reduce((e,t)=>e+t.count,0);return n?(0,G.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,G.jsx)(`div`,{className:`flex h-2 gap-px overflow-hidden rounded-[3px] bg-separator`,role:`img`,"aria-label":e.map(e=>`${t($Z[e.key])} ${e.count}`).join(`, `),children:e.filter(e=>e.count>0).map(e=>(0,G.jsx)(`div`,{className:QZ[e.key],style:{width:`${e.count/n*100}%`,minWidth:2}},e.key))}),(0,G.jsx)(`div`,{className:`mt-3 grid grid-cols-2 gap-x-4 gap-y-1.5`,children:e.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-caption`,children:[(0,G.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-[2px] ${QZ[e.key]}`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted`,children:t($Z[e.key])}),(0,G.jsx)(`span`,{className:`mono tabular`,children:e.count}),(0,G.jsx)(`span`,{className:`mono w-10 text-right tabular text-muted`,children:uX(e.count/n)})]},e.key))})]}):(0,G.jsx)(`div`,{className:`px-4 py-3 text-body text-muted`,children:t(`statsEmptyTraffic`)})}function uQ(e){return e?e>=1e6?`${(e/1e6).toString().replace(/\.0$/,``)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e):`—`}function dQ({model:e,t,onClose:n}){if(!e)return null;let r=e.reasoning_options||[],i=e.catalog_context_length||e.default_context_length||e.context_length,a=e.catalog_context_length_max,o=fX(e),s=pX(e),c=String(e.provider||e.owned_by||`qoder`).trim().toLowerCase(),l=EZ(c,String(e.region||e.regions?.[0]||``).trim().toLowerCase()||void 0,t),u=c===`trae`?DZ(e):void 0;return(0,G.jsx)(Z.Root,{isOpen:!0,onOpenChange:e=>{e||n()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{size:`md`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`text-section`,children:e.display_name||e.id}),s?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`success`,children:t(`modelFree`)}):null]}),(0,G.jsx)(`div`,{className:`mono mt-1 text-caption text-muted`,children:e.id}),(0,G.jsxs)(`div`,{className:`mt-1 text-caption text-muted`,children:[l,o?` · ${o}`:``]})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":t(`close`),className:`grid size-8 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Body,{className:`space-y-4 px-5 pb-5`,children:[(0,G.jsxs)(`section`,{children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:t(`contextWindowCol`)}),(0,G.jsxs)(`div`,{className:`mt-1 text-body`,children:[uQ(i),a&&a!==i?` → ${uQ(a)}`:``]}),e.supports_max_mode?(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t(c===`qoder`?`qoderMaxModeHint`:`maxModeHint`)}):null,!e.supports_max_mode&&a&&a!==i?(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t(`workbuddyContextHint`)}):null,u?u.prompt_max_tokens?(0,G.jsxs)(`div`,{className:`mt-1 text-caption text-muted`,children:[t(`promptMaxTokens`),`: `,uQ(u.prompt_max_tokens)]}):null:e.prompt_max_tokens?(0,G.jsxs)(`div`,{className:`mt-1 text-caption text-muted`,children:[t(`promptMaxTokens`),`: `,uQ(e.prompt_max_tokens)]}):null,u?u.max_output_tokens?(0,G.jsxs)(`div`,{className:`text-caption text-muted`,children:[t(`maxOutputTokens`),`: `,uQ(u.max_output_tokens)]}):null:e.max_output_tokens?(0,G.jsxs)(`div`,{className:`text-caption text-muted`,children:[t(`maxOutputTokens`),`: `,uQ(e.max_output_tokens)]}):null]}),(0,G.jsxs)(`section`,{children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:t(`reasoningLevels`)}),r.length?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t(`reasoningHint`)}),(0,G.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:r.map(n=>{let r=`reasoningLevel_${n}`,i=t(r);return(0,G.jsxs)(lT,{size:`sm`,variant:`soft`,color:n===(e.reasoning_effort||e.reasoning_default)?`success`:`default`,children:[i===r?n:i,n===e.reasoning_default?` · ${t(`defaultValue`)}`:``,n===e.reasoning_effort&&n!==e.reasoning_default?` · ${t(`custom`)}`:``]},n)})})]}):(0,G.jsx)(`div`,{className:`mt-1 text-body text-muted`,children:e.reasoning_type?t(`reasoningFixed`,{type:e.reasoning_type}):t(`noReasoningLevels`)})]})]})]})})})})}function fQ({isSelected:e,isDisabled:t,ariaLabel:n,label:r,size:i=`sm`,onChange:a}){return(0,G.jsx)(dF,{size:i,isSelected:e,isDisabled:t,onChange:a,children:(0,G.jsxs)(dF.Content,{children:[(0,G.jsx)(dF.Control,{children:(0,G.jsx)(dF.Thumb,{})}),r?(0,G.jsx)(sR,{children:r}):(0,G.jsx)(`span`,{className:`sr-only`,children:n})]})})}function pQ({title:e,hint:t,action:n,icon:r,className:i}){return(0,G.jsx)(`div`,{className:`grid min-h-56 place-items-center px-6 py-12 text-center ${i||``}`,children:(0,G.jsxs)(`div`,{className:`max-w-sm`,children:[r?(0,G.jsx)(`div`,{className:`mb-3 flex justify-center text-muted`,children:r}):null,(0,G.jsx)(dR,{className:`p-0 text-body font-medium text-foreground`,children:e}),t?(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t}):null,n?(0,G.jsx)(`div`,{className:`mt-5 flex justify-center`,children:n}):null]})})}var mQ=`__all__`;function hQ({value:e,onChange:t,ariaLabel:n,options:r,className:i}){let a=r.map(e=>({id:e.id||mQ,label:e.label})),o=e||mQ,s=a.find(e=>e.id===o);return(0,G.jsxs)(SV,{className:i??`w-fit min-w-36`,"aria-label":n,value:o,onChange:e=>{typeof e==`string`&&t(e===mQ?``:e)},children:[(0,G.jsxs)(SV.Trigger,{className:`min-w-0 w-full items-center`,children:[(0,G.jsx)(SV.Value,{className:`min-w-0 truncate`,children:({defaultChildren:e,isPlaceholder:t})=>t||!s?e:(0,G.jsx)(`span`,{className:`truncate`,children:s.label})}),(0,G.jsx)(SV.Indicator,{})]}),(0,G.jsx)(SV.Popover,{className:`max-h-72 min-w-36`,children:(0,G.jsx)(GB,{children:a.map(e=>(0,G.jsxs)(GB.Item,{id:e.id,textValue:e.label,children:[(0,G.jsx)(sR,{className:`block truncate`,children:e.label}),(0,G.jsx)(GB.ItemIndicator,{})]},e.id))})})]})}var gQ=[20,50,100],_Q=[20,50,100];function vQ(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=[1];e>3&&n.push(`gap`);let r=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let e=r;e<=i;e++)n.push(e);return e{let t=Number([...e][0]);d.includes(t)&&u(t)},"aria-label":a,children:d.map(e=>(0,G.jsx)(QP,{id:String(e),children:e},e))})]}),(0,G.jsxs)(yV,{size:`sm`,className:`w-fit`,children:[(0,G.jsx)(yV.Summary,{className:`mono text-caption`,children:o}),(0,G.jsxs)(yV.Content,{children:[(0,G.jsx)(yV.Item,{children:(0,G.jsx)(yV.Previous,{isDisabled:i||t<=1,onPress:()=>l(Math.max(1,t-1)),"aria-label":s,children:(0,G.jsx)(yV.PreviousIcon,{})})}),f.map((e,n)=>e===`gap`?(0,G.jsx)(yV.Item,{children:(0,G.jsx)(yV.Ellipsis,{})},`gap-${n}`):(0,G.jsx)(yV.Item,{children:(0,G.jsx)(yV.Link,{isActive:e===t,isDisabled:i,onPress:()=>l(e),children:e})},e)),(0,G.jsx)(yV.Item,{children:(0,G.jsx)(yV.Next,{isDisabled:i||t>=n,onPress:()=>l(Math.min(n,t+1)),"aria-label":c,children:(0,G.jsx)(yV.NextIcon,{})})})]})]})]})}function bQ({value:e,onChange:t,placeholder:n,ariaLabel:r,className:i}){return(0,G.jsx)(aR,{"aria-label":r,value:e,onChange:t,className:i,children:(0,G.jsxs)(aR.Group,{children:[(0,G.jsx)(aR.SearchIcon,{}),(0,G.jsx)(aR.Input,{placeholder:n}),(0,G.jsx)(aR.ClearButton,{})]})})}function xQ(e){let t=[];for(let n of e)for(let e of n.regions||[])e?.id&&t.push({value:`${n.id}:${e.id}`,provider:n.id,region:e.id});return t}function SQ(e){return e.settings_key||e.id}function CQ(e){return String(e.provider||e.owned_by||`qoder`).trim().toLowerCase()}function wQ(e){let t=String(e.region||``).trim().toLowerCase();if(t)return t;let n=e.regions||[];return String(n[0]||``).trim().toLowerCase()}function TQ(e){return`${CQ(e)}:${wQ(e)||`any`}:${e.settings_key||e.id}:${e.native_model||e.mapped_key||``}`}function EQ(e){let t=e.route_display_name||``;return t&&t!==(e.display_name||e.id)?t:``}function DQ(e,t){let n=`reasoningLevel_${t}`,r=e(n);return r===n?t:r}function OQ({label:e,hint:t}){return(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(`span`,{className:`cursor-help text-caption text-muted`,children:e})}),(0,G.jsx)(eL.Content,{children:(0,G.jsx)(`p`,{className:`max-w-xs text-caption leading-5`,children:t})})]})}function kQ({model:e,saving:t,t:n,variant:r=`table`,onToggleTraeMax:i,onReasoningChange:a}){let o=CQ(e),s=r===`card`,c=s?`w-full min-w-0`:`w-full max-w-[7.5rem] min-w-0`;return(0,G.jsxs)(`div`,{className:s?`flex min-w-0 flex-col gap-3`:`flex min-w-0 flex-col gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,G.jsxs)(`span`,{className:`mono text-caption text-muted`,children:[uQ(e.catalog_context_length||e.context_length),e.catalog_context_length_max&&e.catalog_context_length_max!==(e.catalog_context_length||e.context_length)?` → ${uQ(e.catalog_context_length_max)}`:``]}),o===`workbuddy`&&e.catalog_context_length_max&&e.catalog_context_length_max!==(e.catalog_context_length||e.context_length)?(0,G.jsx)(OQ,{label:n(`catalogWindow`),hint:n(`workbuddyContextHint`)}):null]}),(o===`trae`||o===`qoder`)&&e.supports_max_mode?(0,G.jsxs)(`div`,{className:s?`flex flex-col gap-1.5`:`flex items-center gap-2`,children:[s?(0,G.jsx)(OQ,{label:`${n(`maxMode`)}${e.catalog_context_length_max?` ${uQ(e.catalog_context_length_max)}`:``}`,hint:n(o===`qoder`?`qoderMaxModeHint`:`maxModeHint`)}):null,(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(fQ,{isSelected:!!e.max_mode,isDisabled:t,ariaLabel:`${e.id} ${n(`maxMode`)}`,onChange:t=>i(e,t)}),s?null:(0,G.jsx)(OQ,{label:`${n(`maxMode`)}${e.catalog_context_length_max?` ${uQ(e.catalog_context_length_max)}`:``}`,hint:n(o===`qoder`?`qoderMaxModeHint`:`maxModeHint`)})]})]}):null,(e.reasoning_options||[]).length>1?(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,G.jsx)(OQ,{label:n(`reasoningLevels`),hint:n(`reasoningHint`)}),(0,G.jsx)(hQ,{className:c,ariaLabel:`${e.id} ${n(`reasoningLevels`)}`,value:e.reasoning_effort||e.reasoning_default||e.reasoning_options?.[0]||``,onChange:t=>{t&&a(e,t)},options:(e.reasoning_options||[]).map(e=>({id:e,label:DQ(n,e)}))})]}):(e.reasoning_options||[]).length===1?(0,G.jsx)(OQ,{label:`${n(`reasoningLevels`)} ${DQ(n,e.reasoning_options[0])}`,hint:n(`reasoningHint`)}):e.reasoning_type?(0,G.jsx)(`span`,{className:`text-caption text-muted`,children:n(`reasoningFixed`,{type:e.reasoning_type})}):o===`trae`&&!e.supports_max_mode?(0,G.jsx)(OQ,{label:n(`catalogWindow`),hint:n(`catalogWindowHint`)}):null]})}function AQ({model:e,t,onDetails:n}){return(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:()=>n(e),children:[(0,G.jsx)(ea,{size:14}),t(`modelDetails`)]})}function jQ(){let{t:e}=DH(),{overview:t,loading:n}=dU(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(1),[d,f]=(0,v.useState)(50),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(null),[w,T]=(0,v.useState)([]),[E,D]=(0,v.useState)(!0);(0,v.useEffect)(()=>{let e=!1;return KH(void 0,`regional`).then(t=>{e||T(t.data||[])}).catch(()=>void 0).finally(()=>{e||D(!1)}),tU().then(t=>{e||c(xQ(t.data||[]))}).catch(()=>void 0),()=>{e=!0}},[]);let O=(0,v.useMemo)(()=>{let t=r.trim().toLowerCase(),[n,i]=a.includes(`:`)?a.split(`:`,2):[a,``];return w.filter(r=>{let a=CQ(r),o=wQ(r);if(n&&a!==n||i&&o!==i)return!1;if(!t)return!0;let s=EZ(a,o||void 0,e);return`${r.display_name||``} ${r.id} ${r.mapped_key||``} ${a} ${s} ${r.owned_by||``} ${o} ${r.credits||``} ${r.free?`free`:``}`.toLowerCase().includes(t)})},[r,w,a,e]),k=[r,a,d].join(`\0`),[A,j]=(0,v.useState)(k);A!==k&&(j(k),u(1));let M=Math.max(1,Math.ceil(O.length/d)),N=Math.min(A===k?Math.max(1,l):1,M);l!==N&&u(N);let P=(0,v.useMemo)(()=>{let e=(N-1)*d;return O.slice(e,e+d)},[N,O,d]),ee=O.length===0?0:(N-1)*d+1,F=Math.min(O.length,N*d),I=O.length?e(`logsShownTotal`,{shown:`${ee}–${F}`,total:O.length}):e(`shownTotal`,{shown:0,total:w.length});if(n&&!t||E)return(0,G.jsx)(vY,{});function L(e,t){let n=SQ(e),r=CQ(e),i=w.map(e=>{if(SQ(e)!==n||CQ(e)!==r)return e;let i=e.reasoning_effort||e.reasoning_default||``,a=e.catalog_context_length||e.default_context_length||e.context_length||0,o=e.catalog_context_length_max||0;return{...e,max_mode:t,context_length:t&&o?o:a,default_context_length:a,context_custom:r===`qoder`?t:t||!!(i&&i!==e.reasoning_default)}});T(i)}function te(e,t){let n=SQ(e),r=CQ(e),i=w.map(e=>SQ(e)!==n||CQ(e)!==r?e:{...e,reasoning_effort:t,context_custom:!!e.max_mode||!!(t&&t!==e.reasoning_default)});T(i)}async function R(){m(!0),y(``),x(!1);try{let e=await qH(void 0,`regional`);T(e.data||[])}catch(e){x(!0),y(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function z(t,n){let r=CQ(t);if(r!==`trae`&&r!==`workbuddy`&&r!==`kimi`)return;let i=SQ(t);g(i),y(``),x(!1);try{await YH(r,i,n),te(t,n),y(e(`reasoningSaved`,{model:t.id,level:DQ(e,n)}))}catch(e){x(!0),y(e instanceof Error?e.message:String(e))}finally{g(``)}}async function B(t,n){if(!t.supports_max_mode){x(!0),y(e(`contextMaxUnavailable`));return}let r=SQ(t),i=CQ(t);g(r),y(``),x(!1);try{await JH(i,r,n,t.catalog_context_length_max),L(t,n),y(e(n?`contextMaxOn`:`contextMaxOff`,{model:t.id}))}catch(e){x(!0),y(e instanceof Error?e.message:String(e))}finally{g(``)}}return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(`section`,{className:`grid gap-5 pb-6 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end`,children:[(0,G.jsxs)(`div`,{"data-gsap-reveal":!0,children:[(0,G.jsx)(`h2`,{className:`text-title font-semibold`,children:e(`availableModels`)}),(0,G.jsx)(`p`,{className:`mt-1 text-body text-muted`,children:w.length?I:e(`noModelsYet`)})]}),(0,G.jsxs)(`div`,{"data-gsap-reveal":!0,className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center`,children:[(0,G.jsx)(bQ,{className:`w-full min-w-0 sm:w-72`,value:r,onChange:i,placeholder:e(`filterPh`),ariaLabel:e(`filter`)}),(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(hQ,{ariaLabel:e(`providerCol`),value:a,onChange:o,options:[{id:``,label:e(`providerFilterAll`)},...s.map(t=>({id:t.value,label:EZ(t.provider,t.region,e)}))]}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:p,onPress:()=>void R(),children:[(0,G.jsx)(Jr,{size:14}),e(p?`refreshing`:`refresh`)]})]})]})]}),_?(0,G.jsx)(bU,{status:b?`danger`:`success`,title:_}):null,(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-separator px-4 py-4 sm:items-center sm:px-5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-surface-secondary text-muted`,children:(0,G.jsx)(Mi,{size:16})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-body font-semibold`,children:e(`providerCatalog`)}),(0,G.jsx)(`div`,{className:`mt-0.5 text-caption leading-5 text-muted`,children:e(`contextConfigHint`)})]})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,className:`shrink-0`,children:O.length})]}),p||n?(0,G.jsx)(pY,{}):O.length===0?(0,G.jsx)(pQ,{icon:(0,G.jsx)(ua,{size:22}),title:w.length?e(`noModelsMatch`):e(`noProviders`),hint:w.length?r||a||e(`noModelsMatch`):e(`noModelsYet`)}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`divide-y divide-separator lg:hidden`,children:P.map(t=>{let n=SQ(t),r=h===n,i=CQ(t),a=EZ(i,wQ(t)||void 0,e),o=fX(t),s=pX(t);return(0,G.jsxs)(`article`,{className:`space-y-3 px-4 py-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,G.jsx)(`span`,{className:`status-dot mt-1.5`,"data-state":t.stale?void 0:`ok`}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`truncate font-medium`,children:t.display_name||t.id}),s?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`success`,children:e(`modelFree`)}):null,o?(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:o}):null]}),(0,G.jsx)(`div`,{className:`mono mt-0.5 truncate text-caption text-muted`,children:t.id}),EQ(t)?(0,G.jsx)(`div`,{className:`mt-0.5 text-caption text-muted`,children:e(`routedTo`,{model:EQ(t)})}):null]})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:t.context_custom||t.stale?`warning`:`success`,children:t.context_custom?e(`custom`):e(`defaultValue`)})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-caption`,children:[(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(zZ,{provider:i,size:14}),(0,G.jsx)(`span`,{className:`font-medium`,children:a})]}),(0,G.jsx)(`span`,{className:`mono break-all text-muted`,children:t.mapped_key||t.native_model||t.id})]}),(0,G.jsx)(kQ,{model:t,saving:r,t:e,variant:`card`,onToggleTraeMax:(e,t)=>void B(e,t),onReasoningChange:(e,t)=>void z(e,t)}),(0,G.jsx)(AQ,{model:t,t:e,onDetails:C})]},TQ(t))})}),(0,G.jsx)(Q,{className:`hidden min-w-0 lg:block`,children:(0,G.jsx)(Q.ScrollContainer,{className:`min-w-0 overflow-x-auto`,children:(0,G.jsxs)(Q.Content,{"aria-label":e(`availableModels`),className:`min-w-[68rem]`,children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:e(`modelCol`)}),(0,G.jsx)(Q.Column,{children:e(`requestIdCol`)}),(0,G.jsx)(Q.Column,{children:e(`providerCol`)}),(0,G.jsx)(Q.Column,{children:e(`qoderKeyCol`)}),(0,G.jsx)(Q.Column,{children:e(`modelDefaultsCol`)}),(0,G.jsx)(Q.Column,{children:e(`stateCol`)}),(0,G.jsx)(Q.Column,{children:e(`actions`)})]}),(0,G.jsx)(Q.Body,{children:P.map(t=>{let n=SQ(t),r=h===n,i=CQ(t),a=EZ(i,wQ(t)||void 0,e),o=fX(t),s=pX(t);return(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":t.stale?void 0:`ok`}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`font-medium`,children:t.display_name||t.id}),s?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`success`,children:e(`modelFree`)}):null,o?(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:o}):null]}),EQ(t)?(0,G.jsx)(`div`,{className:`mt-0.5 text-caption text-muted`,children:e(`routedTo`,{model:EQ(t)})}):null]})]})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-caption font-medium`,children:t.id})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(zZ,{provider:i,size:14}),(0,G.jsx)(`span`,{className:`text-caption font-medium`,children:a})]})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:t.mapped_key||t.native_model||t.id})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(kQ,{model:t,saving:r,t:e,variant:`table`,onToggleTraeMax:(e,t)=>void B(e,t),onReasoningChange:(e,t)=>void z(e,t)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:t.context_custom||t.stale?`warning`:`success`,children:t.context_custom?e(`custom`):e(`defaultValue`)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(AQ,{model:t,t:e,onDetails:C})})]},TQ(t))})})]})})})]})]}),(0,G.jsx)(dQ,{model:S?w.find(e=>SQ(e)===SQ(S))||S:null,t:e,onClose:()=>C(null)}),(0,G.jsx)(yQ,{total:O.length,page:N,pageCount:M,pageSize:d,loading:p,pageSizeLabel:e(`logsPageSize`),pageLabel:e(`logsPage`,{page:N,pages:M}),prevLabel:e(`logsPrevPage`),nextLabel:e(`logsNextPage`),onPage:u,onPageSize:f})]})}function MQ({copied:e,size:t=14,className:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(!0);return(0,v.useLayoutEffect)(()=>{let t=e?i.current:r.current,n=e?r.current:i.current;if(!t||!n)return;let o={autoAlpha:1,scale:1,filter:`blur(0px)`},s={autoAlpha:0,scale:.5,filter:`blur(4px)`};if(a.current||iY()){a.current=!1,eY.set(t,o),eY.set(n,s);return}eY.to(n,{...s,duration:tY.fast,ease:nY.out,overwrite:!0}),eY.fromTo(t,s,{...o,duration:tY.base,ease:nY.soft,delay:tY.instant/2,overwrite:!0})},[e]),(0,G.jsxs)(`span`,{className:`relative inline-grid place-items-center ${n??``}`,style:{width:t,height:t},children:[(0,G.jsx)(`span`,{ref:r,className:`col-start-1 row-start-1 inline-flex`,children:(0,G.jsx)(Oi,{size:t})}),(0,G.jsx)(`span`,{ref:i,className:`col-start-1 row-start-1 inline-flex text-success`,children:(0,G.jsx)(vi,{size:t})})]})}async function NQ(e){if(!e)return!1;try{if(typeof navigator<`u`&&navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`-1000px`,t.style.opacity=`0`,document.body.appendChild(t),t.focus(),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function PQ(){return`${location.protocol}//${location.host}`}function FQ(e){return e?/^https?:\/\//i.test(e)?e:e.startsWith(`/`)?`${PQ()}${e}`:`${PQ()}/${e}`:PQ()}function IQ({access:e}){let{t}=DH(),[n,r]=(0,v.useState)(``),i=FQ(e?.openai_base_url||`/v1`),a=(0,v.useMemo)(()=>[{name:t(`endpointOpenAI`),url:i,method:`BASE`,hint:t(`endpointBaseHint`),icon:(0,G.jsx)(oi,{size:15})},{name:t(`endpointChat`),url:FQ(e?.chat_completions||`${i}/chat/completions`),method:`POST`,hint:t(`endpointChatHint`),icon:(0,G.jsx)(ga,{size:15})},{name:t(`endpointMessages`),url:FQ(e?.messages||`${i}/messages`),method:`POST`,hint:t(`endpointMessagesHint`),icon:(0,G.jsx)(ga,{size:15})},{name:t(`endpointResponses`),url:FQ(e?.responses||`${i}/responses`),method:`POST`,hint:t(`endpointResponsesHint`),icon:(0,G.jsx)(ga,{size:15})},{name:t(`endpointModels`),url:FQ(e?.models||`${i}/models`),method:`GET`,hint:t(`endpointModelsHint`),icon:(0,G.jsx)(ca,{size:15})},{name:t(`endpointHealth`),url:FQ(e?.health||`/health`),method:`GET`,hint:t(`endpointHealthHint`),icon:(0,G.jsx)(Qi,{size:15})}],[e,i,t]);return(0,G.jsxs)(`section`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface`,children:[(0,G.jsx)(`div`,{className:`flex items-start justify-between gap-4 px-5 py-4 sm:px-6`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`endpoints`)}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,children:t(`endpointCount`,{count:a.length-1})})]}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t(`routesHint`)})]})}),(0,G.jsx)(`div`,{className:`grid gap-2 px-3 pb-3 sm:grid-cols-2 sm:px-4 sm:pb-4 lg:grid-cols-3`,children:a.map(e=>(0,G.jsxs)(`div`,{className:`group min-w-0 rounded-xl bg-surface-secondary/40 p-3 transition-colors hover:bg-surface-secondary/70`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,G.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-lg bg-surface text-muted`,children:e.icon}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`truncate text-body font-semibold`,children:e.name}),(0,G.jsx)(`code`,{className:`mono mt-0.5 block truncate text-caption text-muted`,children:e.url})]})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,children:e.method})]}),(0,G.jsx)(`p`,{className:`mt-2 text-caption leading-5 text-muted`,children:e.hint}),(0,G.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2`,children:[(0,G.jsx)(`span`,{className:`text-caption font-medium text-muted`,children:e.method===`BASE`?t(`endpointBaseLabel`):t(`endpointAuthLabel`)}),(0,G.jsxs)(`div`,{className:`flex gap-1`,children:[(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,"aria-label":t(`copy`),onPress:()=>{NQ(e.url),r(e.name),window.setTimeout(()=>r(``),1100)},children:(0,G.jsx)(MQ,{copied:n===e.name})}),(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,"aria-label":t(`open`),onPress:()=>window.open(e.url,`_blank`,`noopener,noreferrer`),children:(0,G.jsx)(Qr,{size:14})})]})]})]},e.name))})]})}var LQ=new Set(`txt.md.markdown.json.csv.tsv.yml.yaml.toml.xml.html.htm.css.scss.js.jsx.ts.tsx.mjs.cjs.py.go.rs.java.kt.swift.c.h.cpp.hpp.sh.bash.zsh.sql.graphql.env.ini.conf.log.rst.tex`.split(`.`)),RQ=new Set([`image/png`,`image/jpeg`,`image/jpg`,`image/gif`,`image/webp`]);function zQ(e){let t=e.lastIndexOf(`.`);return t>=0?e.slice(t+1).toLowerCase():``}function BQ(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}async function VQ(e){let t=zQ(e.name),n=e.type||`application/octet-stream`,r=`${e.name}-${e.size}-${e.lastModified}-${Math.random().toString(36).slice(2,8)}`;if(RQ.has(n)||[`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(t)){let t=await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||``)),r.onerror=()=>n(r.error||Error(`read failed`)),r.readAsDataURL(e)});return{id:r,name:e.name,mime:n,kind:`image`,dataUrl:t,size:e.size}}if(LQ.has(t)||n.startsWith(`text/`)||n===`application/json`){let t=await e.text();return{id:r,name:e.name,mime:n,kind:`text`,text:t,size:e.size}}return null}function HQ({ariaLabel:e,value:t,onChange:n,placeholder:r,isDisabled:i,options:a,className:o,tone:s=`default`}){let c=a.find(e=>e.id===t),l=s===`muted`?`text-muted hover:text-foreground`:`text-foreground`;return(0,G.jsxs)(SV,{className:o??`w-auto max-w-[11rem] min-w-0`,"aria-label":e,value:t||null,placeholder:r,isDisabled:i,onChange:e=>{typeof e==`string`&&e&&n(e)},children:[(0,G.jsxs)(SV.Trigger,{className:`h-7 min-h-7 gap-1 rounded-md border-0 bg-transparent px-1.5 shadow-none items-center hover:bg-surface data-[focus-visible=true]:bg-surface ${l}`,children:[(0,G.jsx)(SV.Value,{className:`min-w-0 truncate text-caption font-medium`,children:({defaultChildren:e,isPlaceholder:t})=>t||!c?e:(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[c.icon?(0,G.jsx)(`span`,{className:`grid size-3.5 shrink-0 place-items-center opacity-80`,children:c.icon}):null,(0,G.jsx)(`span`,{className:`truncate`,children:c.label})]})}),(0,G.jsx)(SV.Indicator,{className:`size-2.5 opacity-50`})]}),(0,G.jsx)(SV.Popover,{placement:`top end`,className:`max-h-72 min-w-48`,children:(0,G.jsx)(GB,{children:a.map(e=>(0,G.jsxs)(GB.Item,{id:e.id,textValue:e.textValue,className:`gap-2`,children:[e.icon?(0,G.jsx)(`span`,{className:`grid size-5 shrink-0 place-items-center`,children:e.icon}):null,(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(sR,{className:`block truncate text-caption`,children:e.label}),e.hint?(0,G.jsx)(`span`,{className:`block truncate text-caption text-muted`,children:e.hint}):null]}),(0,G.jsx)(GB.ItemIndicator,{})]},e.id))})})]})}function UQ({value:e,onChange:t,attachments:n,onAttachmentsChange:r,disabled:i,streaming:a,canSend:o,onSend:s,onStop:c,accountValue:l,onAccountChange:u,accountOptions:d,modelValue:f,onModelChange:p,modelOptions:m,modelsLoading:h}){let{t:g}=DH(),_=(0,v.useRef)(null);async function y(e){if(!e?.length)return;let t=[],i=[];for(let n of Array.from(e))try{let e=await VQ(n);e?t.push(e):i.push(n.name)}catch{i.push(n.name)}t.length&&r([...n,...t]),i.length&&window.alert(g(`chatAttachUnsupported`,{names:i.join(`, `)})),_.current&&(_.current.value=``)}function b(e){e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),!a&&o&&s())}return(0,G.jsxs)(`div`,{className:`border-t border-separator/60 p-3 sm:p-4`,children:[(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl bg-surface-secondary/80`,children:[n.length?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2 px-3 pt-3`,children:n.map(e=>(0,G.jsxs)(`span`,{className:`inline-flex max-w-[14rem] items-center gap-2 rounded-xl bg-surface px-1.5 py-1.5 text-caption text-foreground`,children:[e.kind===`image`&&e.dataUrl?(0,G.jsx)(`img`,{src:e.dataUrl,alt:``,className:`size-8 shrink-0 rounded-lg object-cover`}):(0,G.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-muted`,children:(0,G.jsx)(Wi,{size:14})}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block truncate font-medium`,children:e.name}),(0,G.jsx)(`span`,{className:`mono text-muted`,children:BQ(e.size)})]}),(0,G.jsx)(`button`,{type:`button`,className:`grid size-6 shrink-0 place-items-center rounded-md text-muted hover:bg-surface-secondary hover:text-foreground`,"aria-label":g(`chatAttachRemove`),onClick:()=>r(n.filter(t=>t.id!==e.id)),children:(0,G.jsx)(oo,{size:12})})]},e.id))}):null,(0,G.jsx)(mL,{fullWidth:!0,rows:3,className:`min-h-20 resize-none border-0 bg-transparent px-3.5 py-3 text-body leading-[1.65] shadow-none focus-visible:ring-0`,value:e,onChange:e=>t(e.target.value),onKeyDown:b,placeholder:g(`promptPlaceholder`),"aria-label":g(`prompt`),disabled:i||a}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pb-2 pt-0.5`,children:[(0,G.jsx)(`input`,{ref:_,type:`file`,className:`hidden`,multiple:!0,accept:`.txt,.md,.json,.csv,.yml,.yaml,.toml,.xml,.html,.css,.js,.jsx,.ts,.tsx,.py,.go,.rs,.sh,.sql,.png,.jpg,.jpeg,.gif,.webp,text/*,image/png,image/jpeg,image/gif,image/webp,application/json`,onChange:e=>void y(e.target.files)}),(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,className:`size-7 min-w-7 shrink-0`,"aria-label":g(`chatAttach`),isDisabled:i||a,onPress:()=>_.current?.click(),children:(0,G.jsx)(wa,{size:15})}),(0,G.jsx)(`div`,{className:`min-w-0 flex-1`}),(0,G.jsx)(HQ,{ariaLabel:g(`account`),value:l,onChange:u,options:d,isDisabled:i||a,tone:`muted`,className:`w-auto max-w-[8.5rem] min-w-0`}),(0,G.jsx)(HQ,{ariaLabel:g(`model`),value:f,onChange:p,placeholder:g(h?`requesting`:`model`),options:m,isDisabled:i||a||h||!m.length,className:`w-auto max-w-[10.5rem] min-w-0`}),a?(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`secondary`,className:`size-7 shrink-0 rounded-full`,"aria-label":g(`chatTryStop`),onPress:c,children:(0,G.jsx)(Ha,{size:13,weight:`fill`})}):(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,className:`size-7 shrink-0 rounded-full transition-transform active:scale-95 disabled:active:scale-100`,"aria-label":g(`chatTrySend`),isDisabled:!o||i,onPress:s,children:(0,G.jsx)(ga,{size:13,weight:`fill`})})]})]}),(0,G.jsx)(`p`,{className:`mt-2 px-1 text-caption leading-5 text-muted`,children:g(`chatTryHelper`)})]})}function WQ({text:e,streaming:t,defaultOpen:n}){let{t:r}=DH(),[i,a]=(0,v.useState)(!!n),[o,s]=(0,v.useState)(0),c=(0,v.useRef)(0);if((0,v.useEffect)(()=>{t?a(!1):n!=null&&a(!!n)},[t,n]),(0,v.useEffect)(()=>{if(!t)return;let e=Date.now();s(0);let n=window.setInterval(()=>{let t=Math.floor((Date.now()-e)/1e3);s(t),c.current=t},250);return()=>window.clearInterval(n)},[t]),(0,v.useEffect)(()=>{!t&&o===0&&c.current>0&&s(c.current)},[t,o]),!e&&!t)return null;let l=iY(),u=t?o:o||c.current;return(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-xl`,children:[(0,G.jsx)(`button`,{type:`button`,className:`inline-flex max-w-full items-center gap-1.5 rounded-full bg-surface-secondary px-2.5 py-1 text-left text-caption text-muted`,"aria-expanded":i,onClick:()=>a(e=>!e),children:t?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(wi,{size:12,className:`shrink-0 text-muted ${l?``:`animate-spin`}`}),(0,G.jsx)(`span`,{className:l?``:`access-thinking-shimmer`,children:r(`thinkingWorking`)}),(0,G.jsxs)(`span`,{className:`mono text-muted/80`,children:[o,`s`]})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(fi,{size:11,className:`shrink-0 transition-transform ${i?`rotate-90`:``}`}),(0,G.jsx)(`span`,{children:r(`thinkingDone`)}),u>0?(0,G.jsx)(`span`,{className:`mono text-muted/80`,children:r(`thinkingElapsed`,{n:u})}):null,!u&&e?(0,G.jsx)(`span`,{className:`mono text-muted/80`,children:r(`thinkingChars`,{count:e.length})}):null]})}),i&&e?(0,G.jsx)(`div`,{className:`mt-1.5`,children:(0,G.jsx)(`pre`,{className:`max-h-52 overflow-auto whitespace-pre-wrap break-words rounded-xl bg-surface-secondary/80 px-3 py-2 text-caption leading-5 text-muted`,children:e})}):null]})}function GQ(e,t){return t(e===`running`?`toolCallRunning`:e===`error`?`toolCallError`:`toolCallSuccess`)}function KQ({status:e}){return e===`running`?(0,G.jsx)(Ia,{size:12,className:`animate-spin text-muted`}):e===`error`?(0,G.jsx)(io,{size:12,weight:`fill`,className:`text-danger`}):(0,G.jsx)(bi,{size:12,weight:`fill`,className:`text-success`})}function qQ(e){if(!e.trim())return``;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function JQ({call:e,forceOpen:t}){let{t:n}=DH(),[r,i]=(0,v.useState)(e.status===`error`||!!t),[a,o]=(0,v.useState)(!1),s=(0,v.useMemo)(()=>qQ(e.arguments||``),[e.arguments]);(0,v.useEffect)(()=>{e.status===`error`&&i(!0)},[e.status]),(0,v.useEffect)(()=>{t&&i(!0)},[t]);async function c(){s&&(await NQ(s),o(!0),window.setTimeout(()=>o(!1),1200))}return(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-lg`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-2 py-1.5 text-left`,"aria-expanded":r,onClick:()=>i(e=>!e),children:[(0,G.jsx)(fi,{size:11,className:`shrink-0 text-muted transition-transform ${r?`rotate-90`:``}`}),(0,G.jsx)(`span`,{className:`mono min-w-0 flex-1 truncate text-caption font-medium text-foreground`,children:e.name||n(`toolCallUntitled`)}),(0,G.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-caption text-muted`,children:[(0,G.jsx)(KQ,{status:e.status}),GQ(e.status,n)]})]}),r?(0,G.jsxs)(`div`,{className:`space-y-1.5 px-2 pb-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:n(`toolCallArgs`)}),(0,G.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-caption text-muted hover:bg-surface-secondary hover:text-foreground`,onClick:e=>{e.stopPropagation(),c()},children:[(0,G.jsx)(Ai,{size:12}),n(a?`copied`:`copy`)]})]}),(0,G.jsx)(`pre`,{className:`mono max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-lg bg-surface-secondary/80 px-2.5 py-2 text-caption leading-5 text-muted`,children:s||n(`toolCallArgsEmpty`)})]}):null]})}function YQ({calls:e}){let{t}=DH(),n=e.some(e=>e.status===`error`),r=e.some(e=>e.status===`running`),[i,a]=(0,v.useState)(n||r||e.length===1);return(0,v.useEffect)(()=>{(n||r)&&a(!0)},[n,r]),e.length?e.length===1?(0,G.jsx)(`div`,{className:`rounded-xl bg-surface-secondary/70`,children:(0,G.jsx)(JQ,{call:e[0],forceOpen:e[0].status===`error`})}):(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-surface-secondary/70`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-caption text-muted`,"aria-expanded":i,onClick:()=>a(e=>!e),children:[(0,G.jsx)(fi,{size:11,className:`shrink-0 transition-transform ${i?`rotate-90`:``}`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-foreground`,children:t(`toolCallGroup`,{n:e.length})}),r?(0,G.jsx)(Ia,{size:12,className:`animate-spin`}):null]}),i?(0,G.jsx)(`div`,{className:`space-y-0.5 border-t border-separator/40 px-0.5 py-1`,children:e.map(e=>(0,G.jsx)(JQ,{call:e},`${e.index}-${e.id||e.name}`))}):null]}):null}function XQ({message:e}){return e.attachments?.length?(0,G.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.attachments.map(e=>(0,G.jsxs)(`span`,{className:`inline-flex max-w-[12rem] items-center gap-1.5 rounded-xl bg-surface/70 px-1.5 py-1 text-caption text-muted`,children:[e.kind===`image`&&e.dataUrl?(0,G.jsx)(`img`,{src:e.dataUrl,alt:``,className:`size-7 shrink-0 rounded-lg object-cover`}):(0,G.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-lg bg-surface`,children:(0,G.jsx)(Wi,{size:12})}),(0,G.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))}):null}function ZQ({message:e}){let{t}=DH(),n=e.usage;if(!n||n.credits==null)return null;let r=n.prompt_tokens,i=n.completion_tokens,a=typeof r==`number`||typeof i==`number`?t(`chatTryUsageTokens`,{prompt:sX(r??0),completion:sX(i??0)}):``;return(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:a?t(`chatTryUsageFoot`,{tokens:a,amount:_X(n.credits)}):t(`chatTryCreditsUsed`,{amount:_X(n.credits)})})}function QQ({message:e}){let{t}=DH(),[n,r]=(0,v.useState)(!1);if(e.role===`user`)return(0,G.jsx)(`div`,{className:`ml-auto max-w-[92%] sm:max-w-[78%]`,children:(0,G.jsxs)(`div`,{className:`rounded-2xl rounded-br-md bg-surface-secondary/90 px-3.5 py-2.5`,children:[e.content?(0,G.jsx)(`div`,{className:`whitespace-pre-wrap break-words text-body leading-[1.65] text-foreground`,children:e.content}):null,(0,G.jsx)(XQ,{message:e})]})});let i=e.status===`streaming`&&!e.content&&!e.reasoning&&!e.toolCalls?.length,a=!!e.content&&e.status===`done`;async function o(){e.content&&(await NQ(e.content),r(!0),window.setTimeout(()=>r(!1),1200))}return(0,G.jsxs)(`div`,{className:`max-w-[96%] space-y-2 sm:max-w-[88%]`,children:[e.reasoning||e.status===`streaming`?(0,G.jsx)(WQ,{text:e.reasoning||``,streaming:e.status===`streaming`&&(!e.content||!!e.reasoning),defaultOpen:e.reasoningOpen}):null,e.toolCalls?.length?(0,G.jsx)(YQ,{calls:e.toolCalls}):null,e.status===`error`?(0,G.jsx)(bU,{status:`danger`,title:t(`requestFailed`),description:e.error||``}):i?(0,G.jsxs)(`div`,{className:`space-y-2.5 pt-0.5`,children:[(0,G.jsx)(qP,{className:`h-3 w-28 rounded-md`}),(0,G.jsx)(qP,{className:`h-3 w-full rounded-md`}),(0,G.jsx)(qP,{className:`h-3 w-[86%] rounded-md`}),(0,G.jsx)(qP,{className:`h-3 w-[68%] rounded-md`})]}):e.content?(0,G.jsx)(`div`,{className:`whitespace-pre-wrap break-words rounded-2xl rounded-tl-md bg-surface-secondary/50 px-3.5 py-2.5 text-body leading-[1.65] text-foreground`,children:e.content}):null,a||e.usage&&e.usage.credits!=null?(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 px-0.5`,children:[a?(0,G.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-caption text-muted hover:text-foreground`,onClick:()=>void o(),children:[(0,G.jsx)(Ai,{size:12}),t(n?`copied`:`copy`)]}):null,(0,G.jsx)(ZQ,{message:e})]}):null]})}function $Q({messages:e,busy:t,onLoadDemo:n}){let{t:r}=DH(),i=(0,v.useRef)(null);return(0,v.useEffect)(()=>{i.current?.scrollIntoView({block:`end`})},[e,t]),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-4 py-5 sm:px-6 sm:py-6`,"aria-live":`polite`,"aria-busy":t,children:[e.length?(0,G.jsx)(`div`,{className:`space-y-5`,children:e.map(e=>(0,G.jsx)(QQ,{message:e},e.id))}):(0,G.jsx)(pQ,{className:`min-h-64`,title:r(`chatTryEmptyTitle`),hint:r(`chatTryEmptyHint`),action:n?(0,G.jsx)(`button`,{type:`button`,className:`rounded-lg bg-surface-secondary px-3 py-1.5 text-caption font-medium text-foreground hover:bg-surface-tertiary`,onClick:n,children:r(`chatDemoLoad`)}):void 0}),(0,G.jsx)(`div`,{ref:i})]})}function e$({open:e,onOpenChange:t,chatPath:n,prompt:r,onPromptChange:i,onTest:a,requestState:o,elapsedMs:s,output:c,responseStatus:l,curl:u,copiedCurl:d,onCopyCurl:f,canSend:p}){let{t:m}=DH();return(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`text-body font-semibold`,children:m(`accessTabApi`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption leading-5 text-muted`,children:m(`nativeApiHint`)})]}),(0,G.jsx)(X,{size:`sm`,variant:e?`secondary`:`ghost`,onPress:()=>t(!e),children:m(e?`rawApiHide`:`rawApiShow`)})]}),e?(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(`div`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface`,children:(0,G.jsxs)(`div`,{className:`grid xl:grid-cols-[minmax(440px,.92fr)_minmax(0,1.08fr)]`,children:[(0,G.jsxs)(`div`,{className:`xl:border-r xl:border-separator`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 sm:px-6`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:m(`requestBuilder`)}),(0,G.jsxs)(`p`,{className:`mt-0.5 text-caption text-muted`,children:[`POST `,n]})]}),(0,G.jsxs)(`div`,{className:`space-y-5 px-5 pb-5 sm:px-6 sm:pb-6`,children:[(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-muted`,children:m(`prompt`)}),(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:r.length})]}),(0,G.jsx)(mL,{fullWidth:!0,rows:9,className:`min-h-56 resize-y px-4 py-3 text-body leading-6`,value:r,onChange:e=>i(e.target.value),placeholder:m(`promptPlaceholder`),"aria-label":m(`prompt`)}),(0,G.jsx)(`p`,{className:`text-caption leading-5 text-muted`,children:m(`promptHelper`)})]}),(0,G.jsxs)(X,{fullWidth:!0,isPending:o===`loading`,isDisabled:!p,onPress:a,children:[(0,G.jsx)(ga,{size:16}),m(o===`loading`?`requesting`:`sendRequest`)]})]})]}),(0,G.jsxs)(`div`,{className:`flex min-h-[480px] min-w-0 flex-col bg-surface-secondary/40`,"aria-live":`polite`,"aria-busy":o===`loading`,children:[(0,G.jsxs)(`div`,{className:`flex min-h-14 items-center justify-between gap-4 px-5 py-3.5 sm:px-6`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:m(`responseInspector`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:m(`responseInspectorHint`)})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s===null?null:(0,G.jsxs)(`span`,{className:`mono flex items-center gap-1.5 text-caption text-muted`,children:[(0,G.jsx)(Ei,{size:12}),s,` ms`]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:o===`success`?`success`:o===`error`?`danger`:void 0,children:l})]})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 px-5 pb-5 sm:px-6 sm:pb-6`,children:o===`idle`?(0,G.jsx)(pQ,{className:`min-h-72`,icon:(0,G.jsx)(oi,{size:21}),title:m(`responseEmptyTitle`),hint:m(`responseEmptyHint`)}):o===`loading`?(0,G.jsxs)(`div`,{className:`space-y-3 pt-1`,children:[(0,G.jsx)(qP,{className:`h-3 w-32 rounded-lg`}),(0,G.jsx)(qP,{className:`h-3 w-full rounded-lg`}),(0,G.jsx)(qP,{className:`h-3 w-[88%] rounded-lg`}),(0,G.jsx)(qP,{className:`h-3 w-[72%] rounded-lg`}),(0,G.jsx)(qP,{className:`mt-7 h-3 w-[92%] rounded-lg`}),(0,G.jsx)(qP,{className:`h-3 w-[64%] rounded-lg`})]}):o===`error`?(0,G.jsx)(`div`,{className:`space-y-3`,children:(0,G.jsx)(bU,{status:`danger`,title:m(`requestFailed`),description:c})}):(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-caption font-medium text-success`,children:[(0,G.jsx)(bi,{size:15,weight:`fill`}),m(`responseReceived`)]}),(0,G.jsx)(`pre`,{className:`mono overflow-x-auto whitespace-pre-wrap break-words text-caption leading-6 text-muted`,children:c})]})})]})]})}),(0,G.jsxs)(`section`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 px-5 py-3.5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-body font-semibold`,children:m(`curlExample`)}),(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-caption text-muted`,children:m(`curlGeneratedHint`)})]}),(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:f,children:[(0,G.jsx)(MQ,{copied:d}),m(d?`copied`:`copy`)]})]}),(0,G.jsx)(`pre`,{className:`mono max-h-80 overflow-auto whitespace-pre-wrap px-5 pb-5 text-caption leading-6 text-muted`,children:u})]})]}):null]})}function t$(e,t){let n=t.filter(e=>e.kind===`text`),r=t.filter(e=>e.kind===`image`&&e.dataUrl),i=e.trim();for(let e of n){let t=e.text??``;i=`${i}${i?` +`;function wX({emptyLabel:e}){return(0,G.jsx)(`div`,{className:`grid min-h-56 place-items-center rounded-lg bg-surface-secondary px-4 text-body text-muted`,children:e})}function TX(e){if(!e)return``;let t=Date.parse(e)-Date.now();if(!Number.isFinite(t)||t<=0)return``;let n=Math.ceil(t/1e3);return n<60?`${n}s`:`${Math.ceil(n/60)}m`}function EX(e){return Object.entries(e.model_cooldowns??{}).filter(([,e])=>!!TX(e)).sort(([e],[t])=>e.localeCompare(t))}function DX(e){return e.enabled?e.status===`quota_exhausted`||e.quota?.exceeded?`quota_exhausted`:e.status===`cooling`||TX(e.down_until||e.cooldown_until)?`cooling`:e.status===`dead`||e.runtime_state===`dead`?`dead`:e.status===`auth_failed`||e.runtime_state===`auth_failed`?`auth_failed`:e.status===`login_required`?`login`:(e.status===`starting`||e.runtime_state===`starting`)&&!e.hot&&!e.ready?e.quota?`starting`:`loading`:e.status===`ready`?e.hot?`hot`:`ready`:e.hot?`hot`:e.ready?`ready`:(e.status===`error`||e.status,`unavailable`):`disabled`}function OX(e){return e===`hot`?12:e===`ready`?9:e===`cooling`?5:e===`login`?3:e===`loading`||e===`starting`?6:e===`unavailable`?2:e===`auth_failed`?3:e===`dead`?2:1}function kX(e){return e===`hot`||e===`ready`?`ok`:e===`cooling`||e===`quota_exhausted`||e===`loading`||e===`starting`?`warn`:e===`auth_failed`||e===`unavailable`||e===`dead`||e===`login`?`danger`:`muted`}function AX(e){return e==null||!Number.isFinite(e)?`—`:Math.abs(e)>=1e3?`${(e/1e3).toFixed(e%1e3==0?0:1)}k`:String(Math.round(e*100)/100)}function jX(e){let t=e.percentage??0;return Number.isFinite(t)?Math.min(1,Math.max(0,t/100)):0}function MX(e){let t=e.percentage??0;return e.exceeded?`danger`:t>=80?`warn`:`ok`}function NX(e){return(e.windows??[]).filter(e=>!!e.id)}var PX={free:`Free`,go:`Go`,plus:`Plus`,pro:`Pro`,prolite:`Pro Lite`,promax:`Pro Max`,team:`Team`,business:`Business`,enterprise:`Enterprise`,edu:`Edu`,edu_plus:`Edu Plus`,edu_pro:`Edu Pro`,education:`Education`};function FX(e){let t=e?.trim().toLowerCase()??``;return!t||t===`unknown`||t===`guest`?``:PX[t]??t.replace(/[_-]+/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function IX(e,t){return e.id===`daily`?t(`quotaDaily`):e.id===`weekly`?t(`quotaWeekly`):e.id===`monthly`?t(`quotaMonthly`):e.id===`fiveHour`?t(`quotaFiveHour`):e.id===`weeklyLimit`?t(`quotaWeeklyLimit`):e.id===`monthlyLimit`?t(`quotaMonthlyLimit`):e.label||t(`quota`)}function LX(e,t){if(!e)return``;let n=Date.parse(e)-Date.now();if(!Number.isFinite(n)||n<=0)return t(`quotaResetsSoon`);let r=Math.max(1,Math.ceil(n/6e4));return r<60?t(`quotaResetsInMinutes`,{n:r}):t(`quotaResetsInHours`,{n:Math.round(r/60)})}function RX(e,t){if(!e.expires_at||e.expires_at<=0||!Number.isFinite(e.expires_at))return``;let n=new Date(e.expires_at*1e3);if(Number.isNaN(n.getTime()))return``;let r=`${n.getFullYear()}/${n.getMonth()+1}/${n.getDate()}`;return t(`quotaExpiresOn`,{amount:e.expiring_remain&&e.expiring_remain>0?`${AX(e.expiring_remain)} `:``,unit:e.unit||`credits`,date:r})}var zX=864e5,BX=8;function VX(e){return`var(--chart-${e%BX+1})`}function HX(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function UX(e){return e<10?`0${e}`:String(e)}function WX(e){let t=new Date(e);return`${t.getFullYear()}-${UX(t.getMonth()+1)}-${UX(t.getDate())}`}function GX({accounts:e,t}){let[n,r]=(0,v.useState)(!1),{buckets:i,rows:a,todayStart:o,maxTotal:s}=(0,v.useMemo)(()=>{let t=HX(new Date),n=new Map;e.forEach((e,t)=>n.set(e.id,VX(t)));let r=new Map,i=[];for(let a of e){let e=a.quota?.packages??[],o=n.get(a.id)||VX(0),s=a.name||a.id,c=e.filter(e=>(e.remain??0)>0&&(e.ends_at??0)>0),l=0,u=0,d=0,f=0;for(let e of c){let n=e.ends_at*1e3,i=e.remain??0;d+=i;let c=HX(new Date(n)),u=c{let e=new Date(c);return{day:p,label:`${e.getMonth()+1}/${e.getDate()}`,ts:c,segments:[],total:0}})(),r.set(p,m));let h=m.segments.find(e=>e.id===a.id);h?h.remain+=i:m.segments.push({id:a.id,name:s,color:o,remain:i}),m.total+=i}if(l){let e=WX(HX(new Date(l)));for(let t of c)WX(HX(new Date(t.ends_at*1e3)))===e&&(u+=t.remain??0)}let p=l?Math.max(0,Math.round((HX(new Date(l))-t)/zX)):-1;i.push({id:a.id,name:s,color:o,remain:d,expiredRemain:f,soonest:l?Math.floor(l/1e3):0,soonestRemain:u,daysLeft:p,dailyBurn:l?u/Math.max(p,1):0,packs:c.length})}i.sort((e,t)=>e.soonest&&t.soonest?e.soonest-t.soonest:e.soonest?-1:t.soonest?1:t.remain-e.remain);let a=[...r.values()].sort((e,t)=>e.ts-t.ts);return{buckets:a,rows:i,todayStart:t,maxTotal:a.reduce((e,t)=>Math.max(e,t.total),0)}},[e]);if(!a.some(e=>e.packs>0))return null;let c=n?i:i.slice(0,8);return(0,G.jsxs)(zw,{className:`overflow-hidden p-0`,"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-separator px-4 py-4 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between sm:px-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`expiryDistTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:t(`expiryDistHint`)})]}),i.length>8?(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:()=>r(e=>!e),children:n?t(`expiryDistCollapse`):t(`expiryDistExpand`,{n:i.length})}):null]}),(0,G.jsxs)(`div`,{className:`space-y-4 p-4 sm:space-y-3 sm:p-5`,children:[(0,G.jsx)(`div`,{className:`space-y-2.5 sm:space-y-1.5`,children:c.map(e=>{let n=e.ts===o,r=s>0?e.total/s*100:0;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:grid sm:grid-cols-[52px_minmax(0,1fr)_auto] sm:items-center sm:gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 sm:contents`,children:[(0,G.jsx)(`span`,{className:`mono text-caption ${e.day===`__expired__`?`font-semibold text-danger`:n?`font-semibold text-foreground`:`text-muted`}`,children:e.day===`__expired__`?t(`expiryDistExpired`):e.label}),(0,G.jsx)(`span`,{className:`mono text-caption text-foreground sm:hidden`,children:AX(e.total)})]}),(0,G.jsx)(`div`,{className:`h-2.5 w-full rounded-full bg-surface-tertiary`,role:`img`,"aria-label":`${e.day} ${t(`expiryDistDayTotal`,{n:AX(e.total)})}`,title:e.day,children:(0,G.jsx)(`div`,{className:`flex h-full items-stretch overflow-hidden rounded-full`,style:{width:`${r}%`},children:e.segments.map(t=>(0,G.jsx)(`span`,{style:{width:`${t.remain/e.total*100}%`,backgroundColor:t.color},title:`${t.name} · ${AX(t.remain)}`},t.id))})}),(0,G.jsx)(`span`,{className:`mono hidden text-caption text-foreground sm:inline`,children:AX(e.total)})]},e.day)})}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-1.5 pt-1`,children:a.filter(e=>e.remain>0).map(e=>(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-caption text-muted`,children:[(0,G.jsx)(`i`,{className:`size-2 rounded-[3px]`,style:{backgroundColor:e.color}}),(0,G.jsx)(`span`,{className:`max-w-[120px] truncate`,children:e.name})]},e.id))}),(0,G.jsx)(`div`,{className:`divide-y divide-separator md:hidden`,children:a.filter(e=>e.packs>0).map(e=>{let n=e.daysLeft>=0&&e.daysLeft<=2,r=e.daysLeft>=0&&e.daysLeft<=7,i=e.soonest?new Date(e.soonest*1e3):null,a=e.expiredRemain>0&&e.daysLeft<0||n?`font-semibold text-danger`:r?`text-warning`:`text-muted`,o=e.daysLeft>=0?t(`expiryDistDays`,{n:e.daysLeft}):e.expiredRemain>0?t(`expiryDistExpired`):`—`;return(0,G.jsxs)(`article`,{className:`space-y-3 py-3.5`,children:[(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`i`,{className:`size-2 shrink-0 rounded-[3px]`,style:{backgroundColor:e.color}}),(0,G.jsx)(`span`,{className:`truncate text-body font-medium text-foreground`,children:e.name})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:t(`expiryDistColSoonest`)}),(0,G.jsx)(`div`,{className:`mono text-body text-muted`,children:i?`${i.getMonth()+1}/${i.getDate()}`:`—`})]}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:t(`expiryDistColDaysLeft`)}),(0,G.jsx)(`div`,{className:`mono text-body ${a}`,children:o})]}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:t(`expiryDistColBatch`)}),(0,G.jsx)(`div`,{className:`mono text-body text-foreground`,children:AX(e.soonestRemain)})]}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:t(`expiryDistColDaily`)}),(0,G.jsx)(`div`,{className:`mono text-body text-foreground`,children:e.soonest?AX(e.dailyBurn):`—`})]})]})]},e.id)})}),(0,G.jsx)(Q,{"aria-label":t(`expiryDistTitle`),className:`hidden md:block`,children:(0,G.jsx)(Q.ScrollContainer,{className:`min-w-0 overflow-x-auto`,children:(0,G.jsxs)(Q.Content,{className:`min-w-[32rem]`,children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:t(`expiryDistColAccount`)}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-center`,children:t(`expiryDistColSoonest`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-center`,children:t(`expiryDistColDaysLeft`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-center`,children:t(`expiryDistColBatch`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-center`,children:t(`expiryDistColDaily`)})})]}),(0,G.jsx)(Q.Body,{children:a.filter(e=>e.packs>0).map(e=>{let n=e.daysLeft>=0&&e.daysLeft<=2,r=e.daysLeft>=0&&e.daysLeft<=7,i=e.soonest?new Date(e.soonest*1e3):null;return(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`i`,{className:`size-2 shrink-0 rounded-[3px]`,style:{backgroundColor:e.color}}),(0,G.jsx)(`span`,{className:`max-w-[150px] truncate text-foreground`,children:e.name})]})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-center text-muted`,children:i?`${i.getMonth()+1}/${i.getDate()}`:`—`})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-center ${e.expiredRemain>0&&e.daysLeft<0||n?`font-semibold text-danger`:r?`text-warning`:`text-muted`}`,children:e.daysLeft>=0?t(`expiryDistDays`,{n:e.daysLeft}):e.expiredRemain>0?t(`expiryDistExpired`):`—`})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-center text-foreground`,children:AX(e.soonestRemain)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-center text-foreground`,children:e.soonest?AX(e.dailyBurn):`—`})})]},e.id)})})]})})}),(0,G.jsx)(`p`,{className:`text-caption text-muted`,children:t(`expiryDistFoot`)})]})]})}var KX={"--toggle-button-bg-selected":`transparent`,"--toggle-button-bg-selected-hover":`transparent`,"--toggle-button-bg-selected-pressed":`transparent`};function qX({value:e,onChange:t,options:n,ariaLabel:r,className:i}){let a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(!1);return(0,v.useLayoutEffect)(()=>{let e=a.current,t=o.current;if(!e||!t)return;let n=n=>{let r=e.querySelector(`[data-selected="true"]`);if(!r){eY.set(t,{autoAlpha:0});return}let i=e.getBoundingClientRect(),a=r.getBoundingClientRect();eY.to(t,{x:a.left-i.left,y:a.top-i.top,width:a.width,height:a.height,autoAlpha:1,duration:n?aY(tY.base):0,ease:nY.out,overwrite:!0})};n(s.current),s.current=!0;let r=new ResizeObserver(()=>n(!1));return r.observe(e),()=>{r.disconnect(),eY.killTweensOf(t)}},[e,n]),(0,G.jsxs)(`div`,{ref:a,className:`filter-toggle relative inline-flex ${i??``}`,children:[(0,G.jsx)(`span`,{ref:o,"aria-hidden":!0,className:`filter-toggle__pill pointer-events-none absolute left-0 top-0 opacity-0`}),(0,G.jsx)(wI,{"aria-label":r,size:`sm`,selectionMode:`single`,disallowEmptySelection:!0,selectedKeys:new Set([e]),onSelectionChange:n=>{let r=[...n][0];typeof r==`string`&&r!==e&&t(r)},children:n.map(e=>(0,G.jsxs)(QP,{id:e.id,className:`relative z-[1]`,style:KX,children:[e.icon,e.label]},e.id))})]})}function JX(e,t){let n=e.toFixed(t);return n.includes(`.`)?n.replace(/0+$/,``).replace(/\.$/,``):n}function YX(e){let t=Number(e||0);return Number.isFinite(t)?t>=1e9?`${JX(t/1e9,2)}B`:t>=1e6?`${JX(t/1e6,2)}M`:t>=1e3?`${JX(t/1e3,1)}k`:String(Math.round(t)):`—`}function XX(e){let t=Number(e||0);return Number.isFinite(t)?JX(t,2):`—`}function ZX(e,t,n){if(!t||!n)return`—`;let r=Number(e||0);return Number.isFinite(r)?`${JX(r,4)} / 1M`:`—`}function QX(e){let t=Number(e||0);return t?t>=1e3?`${JX(t/1e3,2)}s`:`${Math.round(t)}ms`:`—`}function $X(e){if(e==null)return`—`;let t=Number(e);return!Number.isFinite(t)||t<0?`—`:`x${JX(t,2)}`}function eZ(e){let t=(e||``).trim().toLowerCase().replace(/\s*credits?$/,``).replace(/^x/,``);if(t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null}function tZ(e,t){if(!e.length||!t)return null;let n=t.indexOf(`/`),r=n>=0?t.slice(0,n).toLowerCase():``,i=n>=0?t.slice(n+1):t,a=e.filter(e=>e.id===t||e.id===i||e.native_model===i);if(!a.length)return null;let o=a.map(e=>({rate:eZ(e.credits),cn:/credits?\s*$/i.test((e.credits||``).trim())})),s=o,c=r.includes(`cn`)?!0:!/(^|[-_])(gl|global|intl)([-_]|$)/.test(r)&&null;if(c!==null){let e=o.filter(e=>e.cn===c);e.length&&(s=e)}let l=s.map(e=>e.rate).filter(e=>e!==null);if(!l.length)return null;let u=l.filter(e=>e>0);return u.length?Math.max(...u):l[0]}function nZ(e,t){let n=Number(e||0),r=n+Number(t||0);return r?n/r*100:null}function rZ({hit:e,miss:t}){let n=nZ(e,t);return n==null?(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:`—`}):(0,G.jsxs)(`div`,{className:`mono text-right ${n>=90?`text-success`:n>=80?`text-warning`:`text-danger`}`,title:`${YX(e)} / ${YX(e+t)}`,children:[JX(n,1),`%`]})}function iZ(e){let t=Number(e||0);return Number.isFinite(t)?t:0}function aZ(e,t){let n=e.slice(),r=e=>iZ(String(t===`requests`?e.requests:t===`errors`?e.errors:t===`latency`?e.avg_latency_ms??0:e.total_tokens));return n.sort((e,t)=>r(t)-r(e)),n}function oZ(e,t){return e.find(e=>e.id===t)?.name||t.slice(0,8)}function sZ({usage:e,accounts:t,loading:n,t:r}){let[i,a]=(0,v.useState)(`account`),[o,s]=(0,v.useState)(`total`),c=(0,v.useMemo)(()=>e?aZ((i===`model`?e.by_model:i===`realm`?e.by_realm:e.by_account)||[],o):[],[e,i,o]),l=i===`account`,u=l?8:7;return(0,G.jsxs)(zw,{"data-gsap-reveal":!0,"data-skeleton-swap":`stats`,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-separator px-5 py-4 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:r(`usageDetailTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:r(`usageDetailHint`)})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(qX,{value:i,onChange:e=>a(e),ariaLabel:r(`usageDetailTitle`),options:[{id:`account`,label:r(`usageDimAccount`)},{id:`model`,label:r(`usageDimModel`)},{id:`realm`,label:r(`usageDimRealm`)}]}),(0,G.jsx)(qX,{value:o,onChange:e=>s(e),ariaLabel:r(`usageDetailHint`),options:[{id:`total`,label:r(`usageSortTotal`)},{id:`requests`,label:r(`usageSortRequests`)},{id:`errors`,label:r(`usageSortErrors`)},{id:`latency`,label:r(`usageSortLatency`)}]})]})]}),(0,G.jsx)(`div`,{className:`divide-y divide-separator md:hidden`,children:n?Array.from({length:4}).map((e,t)=>(0,G.jsxs)(`div`,{className:`space-y-3 px-5 py-4`,children:[(0,G.jsx)($,{className:`h-4 w-32`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:Array.from({length:4}).map((e,t)=>(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)($,{className:`h-3 w-12`}),(0,G.jsx)($,{className:`h-4 w-16`})]},t))})]},`skeleton-${t}`)):c.length===0?(0,G.jsx)(`div`,{className:`px-5 py-8 text-body text-muted`,children:r(`usageEmpty`)}):c.map(e=>{let n=i===`account`?oZ(t,e.key):e.key||`—`,a=i===`account`?e.realm:``,o=[{label:r(`usageColRequests`),value:YX(e.requests)},{label:r(`usageColErrors`),value:e.errors?YX(e.errors):`—`,tone:e.errors?`text-warning`:`text-muted`},{label:r(`usageColPrompt`),value:YX(e.prompt_tokens),tone:`text-muted`},{label:r(`usageColCacheHit`),value:nZ(e.cache_hit_tokens,e.cache_miss_tokens)==null?`—`:`${JX(nZ(e.cache_hit_tokens,e.cache_miss_tokens),1)}%`},{label:r(`usageColCompletion`),value:YX(e.completion_tokens),tone:`text-muted`},{label:r(`usageColTotal`),value:YX(e.total_tokens)}];return l&&o.push({label:r(`usageColAvgLatency`),value:QX(e.avg_latency_ms),tone:`text-muted`}),(0,G.jsxs)(`article`,{className:`space-y-3 px-5 py-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-foreground`,children:n}),a?(0,G.jsx)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:a}):null]}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:o.map(e=>(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e.label}),(0,G.jsx)(`div`,{className:`mono text-body ${e.tone??`text-foreground`}`,children:e.value})]},e.label))})]},e.key)})}),(0,G.jsx)(Q,{"aria-label":r(`usageDetailTitle`),className:`hidden md:block`,children:(0,G.jsx)(Q.ScrollContainer,{className:`min-w-0 overflow-x-auto`,children:(0,G.jsxs)(Q.Content,{className:`min-w-[44rem]`,children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:r(i===`model`?`usageColModel`:i===`realm`?`usageColRealm`:`usageColAccount`)}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColRequests`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColErrors`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColPrompt`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColCacheHit`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColCompletion`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColTotal`)})}),l?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:r(`usageColAvgLatency`)})})}):null]}),(0,G.jsx)(Q.Body,{children:n?Array.from({length:4}).map((e,t)=>(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)($,{className:`h-4 w-32`})}),Array.from({length:u-1}).map((e,t)=>(0,G.jsx)(Q.Cell,{children:(0,G.jsx)($,{className:`ml-auto h-4 w-12`})},t))]},`skeleton-${t}`)):c.length===0?(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-body text-muted`,children:r(`usageEmpty`)})}),Array.from({length:u-1}).map((e,t)=>(0,G.jsx)(Q.Cell,{children:null},t))]}):c.map(e=>{let n=i===`account`?oZ(t,e.key):e.key||`—`,r=i===`account`?e.realm:``;return(0,G.jsxs)(Q.Row,{children:[(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`div`,{className:`text-foreground`,children:n}),r?(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:r}):null]}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-foreground`,children:YX(e.requests)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right ${e.errors?`text-warning`:`text-muted`}`,children:e.errors?YX(e.errors):`—`})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:YX(e.prompt_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(rZ,{hit:e.cache_hit_tokens,miss:e.cache_miss_tokens})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:YX(e.completion_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-foreground`,children:YX(e.total_tokens)})}),l?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:QX(e.avg_latency_ms)})})}):null]},e.key)})})]})})}),(0,G.jsx)(`p`,{className:`px-5 py-3 text-caption text-muted`,children:r(`usageDimNote`,{n:c.length})})]})}function cZ({label:e,value:t,sub:n,tone:r}){return(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-tertiary px-3 py-2.5`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e}),(0,G.jsx)(`div`,{className:`mono mt-1 text-body font-semibold ${r??`text-foreground`}`,children:t}),(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-caption text-muted`,title:n,children:n})]})}function lZ({usage:e,accounts:t,models:n,loading:r,t:i}){let[a,o]=(0,v.useState)(`account`),s=e?.totals,c=(0,v.useMemo)(()=>e&&(a===`model`?e.credit_by_model:e.credit_by_account)||[],[e,a]),l=a===`model`,u=l?7:6;return(0,G.jsxs)(zw,{"data-gsap-reveal":!0,"data-skeleton-swap":`stats`,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-separator px-5 py-4 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:i(`usageCreditTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:i(`usageCreditHint`)})]}),(0,G.jsx)(qX,{value:a,onChange:e=>o(e),ariaLabel:i(`usageCreditTitle`),options:[{id:`account`,label:i(`usageDimAccount`)},{id:`model`,label:i(`usageDimModel`)}]})]}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-3 border-b border-separator px-5 py-4 sm:grid-cols-3 sm:gap-2.5 xl:grid-cols-5`,children:r||!s?Array.from({length:5}).map((e,t)=>(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-tertiary px-3 py-2.5`,children:[(0,G.jsx)($,{className:`h-3 w-16`}),(0,G.jsx)($,{className:`mt-2 h-5 w-20`})]},t)):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(cZ,{label:i(`usageCreditKpiCredits`),value:XX(s.credits),sub:i(`usageCreditKpiCreditsSub`)}),(0,G.jsx)(cZ,{label:i(`usageCreditKpiTokens`),value:YX(s.credit_tokens),sub:i(`usageCreditKpiTokensSub`)}),(0,G.jsx)(cZ,{label:i(`usageCreditKpiAvg`),value:ZX(s.credits_per_1m_tokens,s.credit_samples,s.credit_tokens),sub:i(`usageCreditKpiAvgSub`),tone:`text-success`}),(0,G.jsx)(cZ,{label:i(`usageCreditKpiSamples`),value:String(s.credit_samples||0),sub:i(`usageCreditKpiSamplesSub`)}),(0,G.jsx)(cZ,{label:i(`usageCreditKpiCache`),value:nZ(s.cache_hit_tokens,s.cache_miss_tokens)==null?`—`:`${JX(nZ(s.cache_hit_tokens,s.cache_miss_tokens),1)}%`,sub:i(`usageCreditKpiCacheSub`)})]})}),(0,G.jsx)(`div`,{className:`divide-y divide-separator md:hidden`,children:r?Array.from({length:4}).map((e,t)=>(0,G.jsxs)(`div`,{className:`space-y-3 px-5 py-4`,children:[(0,G.jsx)($,{className:`h-4 w-32`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:Array.from({length:4}).map((e,t)=>(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)($,{className:`h-3 w-12`}),(0,G.jsx)($,{className:`h-4 w-16`})]},t))})]},`skeleton-${t}`)):c.length===0?(0,G.jsx)(`div`,{className:`px-5 py-8 text-body text-muted`,children:i(`usageCreditEmpty`)}):c.map(e=>{let r=l?e.key||`—`:oZ(t,e.key),a=!l&&e.realm?e.realm:``,o=[];return l&&o.push({label:i(`usageCreditColRate`),value:$X(e.rate??tZ(n,e.key)),tone:`text-muted`}),o.push({label:i(`usageColRequests`),value:YX(e.requests)},{label:i(`usageCreditColCredits`),value:XX(e.credits)},{label:i(`usageCreditColSampleTokens`),value:YX(e.credit_tokens),tone:`text-muted`},{label:i(`usageCreditColPer1M`),value:ZX(e.credits_per_1m_tokens,e.credit_samples,e.credit_tokens),tone:`text-muted`},{label:i(`usageColCacheHit`),value:nZ(e.cache_hit_tokens,e.cache_miss_tokens)==null?`—`:`${JX(nZ(e.cache_hit_tokens,e.cache_miss_tokens),1)}%`}),(0,G.jsxs)(`article`,{className:`space-y-3 px-5 py-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-foreground`,children:r}),a?(0,G.jsx)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:a}):null]}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:o.map(e=>(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e.label}),(0,G.jsx)(`div`,{className:`mono text-body ${e.tone??`text-foreground`}`,children:e.value})]},e.label))})]},e.key)})}),(0,G.jsx)(Q,{"aria-label":i(`usageCreditTitle`),className:`hidden md:block`,children:(0,G.jsx)(Q.ScrollContainer,{className:`min-w-0 overflow-x-auto`,children:(0,G.jsxs)(Q.Content,{className:`min-w-[40rem]`,children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:i(l?`usageColModel`:`usageColAccount`)}),l?(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageCreditColRate`)})}):null,(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageColRequests`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageCreditColCredits`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageCreditColSampleTokens`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageCreditColPer1M`)})}),(0,G.jsx)(Q.Column,{children:(0,G.jsx)(`div`,{className:`text-right`,children:i(`usageColCacheHit`)})})]}),(0,G.jsx)(Q.Body,{children:r?Array.from({length:4}).map((e,t)=>(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)($,{className:`h-4 w-32`})}),Array.from({length:u-1}).map((e,t)=>(0,G.jsx)(Q.Cell,{children:(0,G.jsx)($,{className:`ml-auto h-4 w-12`})},t))]},`skeleton-${t}`)):c.length===0?(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-body text-muted`,children:i(`usageCreditEmpty`)})}),Array.from({length:u-1}).map((e,t)=>(0,G.jsx)(Q.Cell,{children:null},t))]}):c.map(e=>{let r=l?e.key||`—`:oZ(t,e.key),i=!l&&e.realm?e.realm:``;return(0,G.jsxs)(Q.Row,{children:[(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`div`,{className:`text-foreground`,children:r}),i?(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:i}):null]}),l?(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:$X(e.rate??tZ(n,e.key))})}):null,(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-foreground`,children:YX(e.requests)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-foreground`,children:XX(e.credits)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:YX(e.credit_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`div`,{className:`mono text-right text-muted`,children:ZX(e.credits_per_1m_tokens,e.credit_samples,e.credit_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(rZ,{hit:e.cache_hit_tokens,miss:e.cache_miss_tokens})})]},e.key)})})]})})}),(0,G.jsx)(`p`,{className:`px-5 py-3 text-caption text-muted`,children:i(`usageCreditNote`,{accounts:e?.credit_by_account?.length??0,models:e?.credit_by_model?.length??0})})]})}function uZ(e,t=!1){if(!e)return;let n=e.toDate(SD());if(Number.isFinite(n.getTime()))return t&&n.setSeconds(59,999),n.toISOString()}function dZ(e){if(!e)return null;let t=Date.parse(e);if(!Number.isFinite(t))return null;try{return JD(jO(new Date(t).toISOString()))}catch{return null}}function fZ({value:e,onChange:t,ariaLabel:n,fromLabel:r,toLabel:i,className:a}){return(0,G.jsx)(hP,{className:a,granularity:`minute`,hourCycle:24,shouldForceLeadingZeros:!0,value:e,onChange:e=>t(e),"aria-label":n,children:({state:e})=>(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(AM.Group,{className:`w-full min-w-0`,variant:`secondary`,children:[(0,G.jsx)(AM.Input,{className:`min-w-0`,slot:`start`,"aria-label":r,children:e=>(0,G.jsx)(AM.Segment,{segment:e})}),(0,G.jsx)(hP.RangeSeparator,{}),(0,G.jsx)(AM.Input,{className:`min-w-0`,slot:`end`,"aria-label":i,children:e=>(0,G.jsx)(AM.Segment,{segment:e})}),(0,G.jsx)(AM.Suffix,{children:(0,G.jsx)(hP.Trigger,{children:(0,G.jsx)(hP.TriggerIndicator,{})})})]}),(0,G.jsxs)(hP.Popover,{className:`flex w-[20.5rem] max-w-[calc(100vw-2rem)] flex-col gap-3 p-3`,children:[(0,G.jsxs)(xH,{"aria-label":n,children:[(0,G.jsxs)(xH.Header,{children:[(0,G.jsxs)(xH.YearPickerTrigger,{children:[(0,G.jsx)(xH.YearPickerTriggerHeading,{}),(0,G.jsx)(xH.YearPickerTriggerIndicator,{})]}),(0,G.jsx)(xH.NavButton,{slot:`previous`}),(0,G.jsx)(xH.NavButton,{slot:`next`})]}),(0,G.jsxs)(xH.Grid,{children:[(0,G.jsx)(xH.GridHeader,{children:e=>(0,G.jsx)(xH.HeaderCell,{children:e})}),(0,G.jsx)(xH.GridBody,{children:e=>(0,G.jsx)(xH.Cell,{date:e})})]}),(0,G.jsx)(xH.YearPickerGrid,{children:(0,G.jsx)(xH.YearPickerGridBody,{children:({year:e})=>(0,G.jsx)(xH.YearPickerCell,{year:e})})})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(sR,{className:`text-xs`,children:r}),(0,G.jsx)(LP,{"aria-label":r,granularity:`minute`,hourCycle:24,value:e.timeRange?.start??null,onChange:t=>e.setTimeRange({start:t,end:e.timeRange?.end}),children:(0,G.jsx)(LP.Group,{className:`w-[7.5rem]`,variant:`secondary`,children:(0,G.jsx)(LP.Input,{children:e=>(0,G.jsx)(LP.Segment,{segment:e})})})})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(sR,{className:`text-xs`,children:i}),(0,G.jsx)(LP,{"aria-label":i,granularity:`minute`,hourCycle:24,value:e.timeRange?.end??null,onChange:t=>e.setTimeRange({start:e.timeRange?.start,end:t}),children:(0,G.jsx)(LP.Group,{className:`w-[7.5rem]`,variant:`secondary`,children:(0,G.jsx)(LP.Input,{children:e=>(0,G.jsx)(LP.Segment,{segment:e})})})})]})]})]})]})})}var pZ={today:`statsWindowToday`,1:`statsWindow1h`,24:`statsWindow24h`,168:`statsWindow7d`,720:`statsWindow30d`,custom:`statsWindowCustom`};function mZ(e,t){if(e===`today`){let e=new Date;return e.setHours(0,0,0,0),{from:e.toISOString()}}if(e===`custom`){let e=uZ(t?.start),n=uZ(t?.end,!0);return e&&n?{from:e,to:n}:null}if(e===`720`){let e=new Date;return{from:new Date(e.getTime()-2592e6).toISOString(),to:e.toISOString()}}return{hours:Number(e)}}function hZ({value:e,onChange:t,custom:n,onCustomChange:r,onBusy:i,t:a}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(qX,{value:e,onChange:r=>{let a=r;e!==a&&((a!==`custom`||n)&&i?.(),t(a))},ariaLabel:a(`statsTraffic`),options:Object.keys(pZ).map(e=>({id:e,label:a(pZ[e])}))}),e===`custom`?(0,G.jsx)(fZ,{className:`w-[min(100%,24rem)]`,value:n,onChange:e=>{e&&i?.(),r(e)},ariaLabel:a(`statsWindowCustom`),fromLabel:a(`logsTimeFrom`),toLabel:a(`logsTimeTo`)}):null]})}function gZ(e,t,n){let r=new URLSearchParams;for(let[t,n]of Object.entries(e))n&&r.set(t,n);let i=Date.parse(t),a=Date.parse(n);return Number.isFinite(i)&&Number.isFinite(a)&&(r.set(`from`,new Date(Math.floor(i/6e4)*6e4).toISOString()),r.set(`to`,new Date(Math.ceil(a/6e4)*6e4-6e4).toISOString())),`/logs?${r}`}function _Z(e){let t=String(e||``).toLowerCase();return!t||t===`qoder`||t===`qoder-global`||t===`qoder-cn`}function vZ(e){return String(e||``).toLowerCase()===`workbuddy`}function yZ(e){return String(e||``).toLowerCase()===`trae`}function bZ(e){return String(e||``).toLowerCase()===`devin`}function xZ(e){return String(e||``).toLowerCase()===`command`}function SZ(e){return String(e||``).toLowerCase()===`zhipu`}function CZ(e){return String(e||``).toLowerCase()===`qwenwork`}function wZ(e){return String(e||``).toLowerCase()===`kimi`}function TZ(e,t){let n=String(e||``).toLowerCase();return vZ(n)?`WorkBuddy`:yZ(n)?`Trae`:bZ(n)?`Devin`:xZ(n)?`Command Code`:SZ(n)?`Zhipu GLM`:CZ(n)?`QwenWork`:wZ(n)?`Kimi Code`:_Z(n)?`Qoder`:e||t(`account`)}function EZ(e,t,n){let r=String(e||``).toLowerCase(),i=String(t||``).toLowerCase();return vZ(r)?n(i===`global`?`accountTypeWorkBuddyGlobal`:`accountTypeWorkBuddyCN`):yZ(r)?n(`accountTypeTraeCN`):bZ(r)?n(`accountTypeDevinGlobal`):xZ(r)?n(`accountTypeCommandGlobal`):SZ(r)?n(`accountTypeZhipuCN`):CZ(r)?n(i===`cn`?`accountTypeQwenworkCN`:`accountTypeQwenworkGlobal`):wZ(r)?n(`accountTypeKimiCN`):_Z(r)?n(i===`cn`?`accountTypeQoderCN`:`accountTypeQoderGlobal`):e||n(`account`)}function DZ(e,t){let n=t??!!e.max_mode,r=e.catalog_context_length||e.default_context_length||e.context_length||0,i=e.catalog_context_length_max||0;return n&&i>0?{context_length:i,prompt_max_tokens:e.prompt_max_tokens_max||e.prompt_max_tokens,max_output_tokens:e.max_output_tokens_max||e.max_output_tokens}:{context_length:r,prompt_max_tokens:e.prompt_max_tokens,max_output_tokens:e.max_output_tokens}}function OZ({size:e=16,className:t=``}){return(0,G.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-[22%] bg-[#0a84ff] text-white ${t}`.trim(),style:{width:e,height:e,fontSize:Math.max(9,Math.round(e*.55)),fontWeight:650,lineHeight:1},"aria-hidden":`true`,children:`C`})}function kZ({size:e=16,className:t=``}){return(0,G.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,className:`block shrink-0 text-foreground ${t}`.trim(),"aria-hidden":`true`,children:(0,G.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.086.457a6.1 6.1 0 0 1 3.046-.415q2 .23 3.564 1.7a.12.12 0 0 0 .107.029q2.112-.519 4.061.366l.063.03l.154.076q2.036 1.055 2.918 3.198a5.6 5.6 0 0 1 .421 2.126 5.7 5.7 0 0 1-.18 1.631.17.17 0 0 0 .04.155 6 6 0 0 1 1.578 2.891q.577 2.852-1.183 5.14l-.182.22a6.06 6.06 0 0 1-2.934 1.851.16.16 0 0 0-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451q-2.374-.012-4.21-1.736a.14.14 0 0 0-.14-.032 5.9 5.9 0 0 1-1.604-.185 5.9 5.9 0 0 1-2.595-.622 6.06 6.06 0 0 1-2.146-1.781c-.203-.269-.404-.522-.551-.821a8 8 0 0 1-.495-1.283 6.1 6.1 0 0 1-.017-3.064.2.2 0 0 0 .008-.074.1.1 0 0 0-.037-.064 6 6 0 0 1-1.38-2.202 5.2 5.2 0 0 1-.333-1.589 6.9 6.9 0 0 1 .188-2.132q.675-2.226 2.577-3.493.424-.282.802-.438.429-.179.861-.304a.13.13 0 0 0 .087-.087A6 6 0 0 1 5.635 2.31Q6.655 1.04 8.086.457m-.804 7.85a.848.848 0 0 0-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 0 0 1.46.864l1.94-3.272a.85.85 0 0 0 .007-.854zm5.446 6.24a.849.849 0 0 0 0 1.695h4.848a.849.849 0 0 0 0-1.696z`})})}function AZ({size:e=16,className:t=``}){return(0,G.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-[22%] bg-[#1a1a1a] text-white ${t}`.trim(),style:{width:e,height:e,fontSize:Math.max(9,Math.round(e*.55)),fontWeight:650,lineHeight:1},"aria-hidden":`true`,children:`D`})}function jZ({size:e=16,className:t=``}){return(0,G.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,className:`block shrink-0 text-foreground ${t}`.trim(),"aria-hidden":`true`,children:(0,G.jsx)(`path`,{fill:`currentColor`,d:`M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79Z`})})}var MZ=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAJ5ElEQVR42u2dXUxUZxrH/wKDDDCM4CJBZJZNxMpGDMGYXsAWeikapF6Jqc02kUhWTWsTIQHjNk22yWCyN5INrk22rbsc71ZNpXfb0sJ+Gcxmma2mNpt1XMsaLd2ZoY7D5164btfiBx8zzDnv+f1uiWeG9/x8eN7neT9WFRaunROAIWQwBIDQAAgNgNAACA0IDYDQAAgNgNAACA0IDYDQAAgNgNAACA0IDYDQAAgNgNAACA0IDYDQAAgNgNAACA0IDYDQAAgNgNAA35LFEDyZ6uotKi8PqL6+ToFAuQoK/PL7/fL7CyRJ4fBNRaMRhcM3FQ6HFQqFNDoaUiQSYfDSxCqO031U4Lq6OjU1Nam6eov8fv+inxGJRDQ6GtLAwIAs6xxyI/TK0tTUpJ07d6iurk6BQCCpz45EIurrO62+vtOIjdCpIxAIqLPzWEokRmyEXjHq6+vU0dGh+vq6tHw+YiN00iJyb++ptImM2Aid1NSitbXVlt8vEomoq+u4LMvCRIR+Oq2trersPLYiOfJyCYfD6u4+rkuXBjASoZ0VlZ/G0NCwenp6NDQ0jJkI/aCOfPbs+46IyogtWt9Po739oAYHP3a8zNKDaszFixd08eIF20xkidArSGdnhzo7O4x9SZZlKRg8qXA4jLGmC/322z9Te/tBV7ysvr7TCgZ7KPWZKnRv7ynt29fqqhdGDdtQod0oM2IbKrSb0gzEXhyZXm/um06bAL7++muY/F9ycnJUX1+nPXteUiQSVSgUIkI75cvu29eq3t5TWKyndx0PHz7i2hq2Y4QOBAIaHPxoSYvu3YhbmzOOENrv92tw8CMjmiaILTqFnZ0dyKzldx2rq7cQoe3yQkB0HZ0uNKlG6ggGe4ws9dlaaOrNSyM2e0+3pu4oOntPX07dnffzzasDKvMUazY2ZVwN27ZCV1dv0eDgx9i5AK4lbuhy/Joux6/q1vRdXUvcWNC/K8sq1nbvZpXeX6N/9X+m3/zyrOPFtq3QLJ18egT+c/yqfjcx8j+Jk8GmyfWaOPOFRt4bRGgmgqnnfPRTnY99osvxayn9nJmxuKI/v6r7g7cRmuicXG5N3dEvxn+b1Ei8UCZHxvXvt/6qmbE4QhOdkyPy+dinaf0ec7Fpxd65rm+sf4jDGpdAR0eH3L4Ww7LO6Z2KQWVvK0p/xPNlqeBolTLyPYqduS46hVpc3dnNqYZlWWpublEw2GO775bftlFrTmwlQmuRG13dGpWDwZO2P3DGu6tMM2NxW0dqhE4zo6Mh7d//imNa0fltGyXJtlJn2Gky6LalocFgjxoaGh23riK/baMt8ntbC93U1OQqmbu6um2ZKy+UNSe2KsPnQWg98Sy6vXLLHsD9+19RX99pR/8emaVe5R/YiNB6wm4UN6QbkUhEzc27jTmUMa+1QpmlXoSen27scI3Mo6NmbWL1tVUitB6zss50TJRZelDKs1OUtoXQdXVmN1MOHz5ipMwPyWksQWj9X3fQ5B0pwWCP+vvNPqE/b28FQn87ISw39kX391uOLs1pERUPz6YChJak8vKAse3s7u7jcgvZtUUIbWqEflhrdtNZczkNJQj9MIc2MW82eRL4OEg5DBV6aGjY8V1ALXHddOZ6L0L7/QUyrUTnVrJKcxHatFTDzfeg2KHBgtBJPng8aS/GhivZENpl0TmZVY1VviwGFaGVtpqzGyeCRGiZe91a0l9MvoeBRej05M6WdS65L8XnIeVA6PRF52R3BO22aB6hSTdkQtcNoeW++0tSsV4ja5OPwUVopeGko3MyeV0EQrtsMjgwkJrNrp5KhEboFWZ4ODXpRva2IiocCJ2e/DkVrK5dy+Ai9MozMPBhSp5r1yO2EFpmt7pTsaouw+exzVYmhHYRoVDI+N3TCE3+LFP25SG061KOmynJnWmoILQxKYfdzohDaLmrqaIkL0ZiMojQxghNdDZI6Egk6riSXbKjs3dXGSaaI3TE1S9gzU+3YiFCm0H2tiJyZ9OETkUJzEkX74BhQkej7ozQvrZKtlqZKLTbDjWUHizgf3iBJRiYQ7tJ6gyfR/4T1Zhnch06FBp1zYDnt21ki5XpQg8N/d4Vg+3dVcaKOjcIPTw8LDfkzf6jP8Q4NwgdDodTtuFUNjnzrfBkLXsF3bSW49KlD42VeW3f85To3Ca0ZVnGHRaOzC5fbRcMnkRmMEdoU6I0MiO0MVEamRF6XpS2LGfejZ3XWqHiX9cjM0LPj9JOSz0K3qhSwdEqSnMIrcfWpZubWxyxVjqz1Kt1FxrpACL0QqTebWupfW2VWnehkRQDobXgpaXd3cdtJ3Xurg1ad6GRJaAIvXj6+y01N++2TU6dWeqV/0Q1URmhlxepm5tbUnYEFyB02nLqrq5u1+8UB4MOmunrO62amtqkX0UMCK10btsKBnvSInZBZh7WIHRqxW5oeHHFuou+jFysQejU59eHDh1RTU3tikwcN6/+PuYg9MpNHJubd6dU7LKs72EOQmtFT9hPpdjPrQ5gDkKbI/Z2bxXmIHT6xT506EhSOo5V5NAILZusta6pqV12c8aXkavt3s3Yg9AypjnT4nsBexBaxjRniNAI7QixF0qZp1gtvh9hEELbX+yFdh1/UvQSA4fQckTXsaGh8ZmlPqI0QjuGB2uwn13DJkojtExqzpR5ipEaoZ0t9nebM4eK9rC+Q9LMWByhnSh2TU3tvK7jr8q6XC+1HYTO9Hpz30RTLekCe8s6p0QioerqLSrOLdJ2b5U+nPijJuembP3d52LTWrU6I+nPjAT/prnJWYR2KolEQsPDw3r33feUSCT0Yk29NuSV6HL8qm2ljn9wS18f/4vuf3JbWaW5ylyfnN3r37z/dyX+cCftv9+qwsK1c6iZHPx+v9rbD6rx1R16baJXsdl7tkoHIm+NKjHylb57m63vQKWytxUt69l3Xx7WbGwKoU0V++U3XtVnLfd1LXEj7SJPnPlC9z745zPPG8ndtUF5eysWdT7fzFhcXx+7oqnPo7YYe4ROIYUb1ir/QKWmmwpX/LMnR8YVv3TrmSI/7h7FvL0VCxJ7Ziyur9r/ZIvJIEKvID94/jlFf7xmWX/WFxotJ0fGFTtzfdmSZfg88u4sU05DiTybCh6Re6n/WRDaMLK3FSmnoUS5Ozck7djdyZFx3R+8rckr4yn9s/9w8jjzZdzWY4zQSs/1yFmbfMppKFHOCyULrjTMxaY19XlUU9ejmhwZ1+SVcVtMxBAa5gmeWepVZqlXGT7PIz+bjU1pbmJa02P3bB8dERqA1jcAQgNCAyA0AEIDIDQAQgNCAyA0AEIDIDQAQgNCAyA0AEIDIDQAQgNCAyA0AEIDIDQgNABCAyA0AEIDIDQgNABCAyA0AEIDLIj/ABWOKFxbGBRBAAAAAElFTkSuQmCC`;function NZ({size:e=16,className:t=``}){return(0,G.jsx)(`img`,{src:MZ,alt:``,width:e,height:e,className:`block shrink-0 rounded-[22%] ${t}`.trim(),draggable:!1})}function PZ({size:e=16,className:t=``}){let n=Math.max(2,Math.round(e*.14));return(0,G.jsxs)(`span`,{className:`inline-flex shrink-0 items-baseline justify-center rounded-[22%] bg-[#18181B] text-white ${t}`.trim(),style:{width:e,height:e,fontSize:Math.max(9,Math.round(e*.5)),fontWeight:650,lineHeight:1},"aria-hidden":`true`,children:[(0,G.jsx)(`span`,{style:{alignSelf:`center`},children:`Q`}),(0,G.jsx)(`span`,{style:{alignSelf:`center`,width:n,height:n,marginLeft:Math.max(0,Math.round(e*.03)),borderRadius:`50%`,background:`#22D3EE`}})]})}function FZ({size:e=16,className:t=``}){return(0,G.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-[22%] bg-[#1a1a1a] text-white ${t}`.trim(),style:{width:e,height:e,fontSize:Math.max(9,Math.round(e*.55)),fontWeight:650,lineHeight:1},"aria-hidden":`true`,children:`T`})}var IZ=`/assets/workbuddy-mark-D1Gu2IKl.svg`;function LZ({size:e=16,className:t=``}){return(0,G.jsx)(`img`,{src:IZ,alt:``,width:e,height:e,className:`block shrink-0 ${t}`.trim(),draggable:!1})}function RZ({size:e=16,className:t=``}){return(0,G.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,className:`block shrink-0 text-foreground ${t}`.trim(),"aria-hidden":`true`,children:(0,G.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M11.991 23.503a.24.24 0 0 0-.244.248a.24.24 0 0 0 .244.249a.24.24 0 0 0 .245-.249a.24.24 0 0 0-.22-.247zM9.671 5.365a1.697 1.697 0 0 1 1.099 2.132l-.071.172l-.016.04l-.018.054c-.07.16-.104.32-.104.498c-.035.71.47 1.279 1.186 1.314h.366c1.309.053 2.338 1.173 2.286 2.523c-.052 1.332-1.152 2.38-2.478 2.327h-.174c-.715.018-1.274.64-1.239 1.368c0 .124.018.23.053.337c.209.373.54.658.96.8c.75.23 1.517-.125 1.9-.782l.018-.035c.402-.64 1.17-.96 1.92-.711c.854.284 1.378 1.226 1.099 2.167a1.66 1.66 0 0 1-2.077 1.102a1.7 1.7 0 0 1-.907-.711l-.017-.035c-.2-.323-.463-.58-.851-.711l-.056-.018a1.646 1.646 0 0 0-1.954.746a1.66 1.66 0 0 1-1.065.764a1.677 1.677 0 0 1-1.989-1.279c-.209-.906.332-1.83 1.257-2.043a1.5 1.5 0 0 1 .296-.035h.018c.68-.071 1.151-.622 1.116-1.333a1.3 1.3 0 0 0-.227-.693a2.5 2.5 0 0 1-.366-1.403a2.4 2.4 0 0 1 .366-1.208c.14-.195.21-.444.227-.693c.018-.71-.506-1.261-1.186-1.332l-.07-.018a1.4 1.4 0 0 1-.299-.07l-.05-.019a1.7 1.7 0 0 1-1.047-2.114a1.68 1.68 0 0 1 2.094-1.101m-5.575 10.11c.26-.264.639-.367.994-.27s.633.379.728.74c.095.362-.007.748-.267 1.013c-.402.41-1.053.41-1.455 0a1.06 1.06 0 0 1 0-1.482zm14.845-.294c.359-.09.738.024.992.297c.254.274.344.665.237 1.025s-.396.634-.756.718c-.551.128-1.1-.22-1.23-.781a1.05 1.05 0 0 1 .757-1.26zm-.064-4.39c.314.32.49.753.49 1.206s-.176.886-.49 1.206c-.315.32-.74.5-1.185.5c-.444 0-.87-.18-1.184-.5a1.727 1.727 0 0 1 0-2.412a1.654 1.654 0 0 1 2.369 0m-11.243.163c.364.484.447 1.128.218 1.691a1.665 1.665 0 0 1-2.188.923c-.855-.36-1.26-1.358-.907-2.228a1.68 1.68 0 0 1 1.33-1.038a1.66 1.66 0 0 1 1.547.652m11.545-4.221c.368 0 .708.2.892.524s.184.724 0 1.048a1.03 1.03 0 0 1-.892.524a1.04 1.04 0 0 1-1.03-1.048a1.04 1.04 0 0 1 1.03-1.048m-14.358 0c.368 0 .707.2.891.524s.184.724 0 1.048a1.03 1.03 0 0 1-.891.524a1.04 1.04 0 0 1-1.03-1.048c0-.579.461-1.048 1.03-1.048m10.031-1.475c.925 0 1.675.764 1.675 1.706s-.75 1.705-1.675 1.705s-1.674-.763-1.674-1.705s.75-1.706 1.674-1.706m-2.626-.684c.362-.082.653-.356.761-.718a1.06 1.06 0 0 0-.238-1.028a1.02 1.02 0 0 0-.996-.294c-.547.14-.881.7-.752 1.257c.13.558.675.907 1.225.783m0 16.876c.359-.087.644-.36.75-.72a1.06 1.06 0 0 0-.237-1.019a1.02 1.02 0 0 0-.985-.301a1.04 1.04 0 0 0-.762.717c-.108.361-.017.754.239 1.028c.245.263.606.377.953.305zM17.19 3.5a.63.63 0 0 0 .628-.64a.63.63 0 0 0-.628-.64a.63.63 0 0 0-.628.64c0 .355.28.64.628.64m-10.38 0a.63.63 0 0 0 .628-.64c0-.355-.28-.64-.628-.64a.63.63 0 0 0-.628.64c0 .355.279.64.628.64m-5.182 7.852a.63.63 0 0 0-.628.64c0 .354.28.639.628.639a.63.63 0 0 0 .627-.606l.001-.034a.62.62 0 0 0-.628-.64zm5.182 9.13a.63.63 0 0 0-.628.64c0 .355.279.64.628.64a.63.63 0 0 0 .628-.64c0-.355-.28-.64-.628-.64m10.38.018a.63.63 0 0 0-.628.64c0 .355.28.64.628.64a.63.63 0 0 0 .628-.64a.63.63 0 0 0-.628-.64m5.182-9.148a.63.63 0 0 0-.628.64c0 .354.279.639.628.639a.63.63 0 0 0 .628-.64c0-.355-.28-.64-.628-.64zm-.384-4.992a.24.24 0 0 0 .244-.249a.24.24 0 0 0-.244-.249a.24.24 0 0 0-.244.249c0 .142.122.249.244.249M11.991.497a.24.24 0 0 0 .245-.248A.24.24 0 0 0 11.99 0a.24.24 0 0 0-.244.249c0 .133.108.236.223.247zM2.011 6.36a.24.24 0 0 0 .245-.249a.24.24 0 0 0-.244-.249a.24.24 0 0 0-.244.249a.24.24 0 0 0 .244.249zm0 11.263a.24.24 0 0 0-.243.248a.24.24 0 0 0 .244.249a.24.24 0 0 0 .244-.249a.25.25 0 0 0-.244-.248zm19.995-.018a.24.24 0 0 0-.245.248a.24.24 0 0 0 .245.25a.24.24 0 0 0 .244-.25a.25.25 0 0 0-.244-.248z`})})}function zZ({provider:e,size:t=16,className:n=``}){let r=String(e||``).toLowerCase();return r===`workbuddy`?(0,G.jsx)(LZ,{size:t,className:n}):r===`trae`?(0,G.jsx)(FZ,{size:t,className:n}):r===`devin`?(0,G.jsx)(AZ,{size:t,className:n}):r===`command`?(0,G.jsx)(OZ,{size:t,className:n}):r===`codex`?(0,G.jsx)(kZ,{size:t,className:n}):r===`zhipu`?(0,G.jsx)(RZ,{size:t,className:n}):r===`qwenwork`?(0,G.jsx)(PZ,{size:t,className:n}):r===`kimi`?(0,G.jsx)(jZ,{size:t,className:n}):(0,G.jsx)(NZ,{size:t,className:n})}var BZ=(0,v.lazy)(()=>C(()=>import(`./LiveSparkline-CiMyj7tn.js`).then(e=>({default:e.LiveSparkline})),__vite__mapDeps([0,1,2])));function VZ({live:e,samples:t,t:n}){let r=e?.in_flight??null,i=e?.capacity??0,a=r!=null&&i>0?r/i:0,o=i>0&&r!=null&&r>=i;return(0,G.jsxs)(`div`,{"data-testid":`live-strip`,className:`flex min-h-11 flex-wrap items-center gap-x-5 gap-y-2 overflow-hidden rounded-lg bg-surface-secondary px-4 py-2.5 text-caption text-muted sm:h-11 sm:gap-x-6 sm:gap-y-1 sm:py-0`,children:[(0,G.jsx)(`span`,{className:`inline-flex items-center`,children:(0,G.jsx)(`span`,{className:`status-dot`,"data-state":r==null?``:o?`warn`:r>0?`ok`:``})}),(0,G.jsxs)(`span`,{className:`inline-flex flex-col gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[n(`liveConcurrency`),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,G.jsxs)(`span`,{className:`mono tabular text-body font-semibold ${o?`text-warning`:`text-foreground`}`,children:[r??`—`,(0,G.jsxs)(`span`,{className:`font-normal text-muted`,children:[`/`,e?i:`—`]})]}),(0,G.jsx)(`span`,{className:`inline-block h-[3px] w-12 overflow-hidden rounded-[2px] bg-separator`,children:(0,G.jsx)(`span`,{className:`block h-full ${o?`bg-warning`:`bg-foreground/60`}`,style:{width:`${Math.min(100,a*100)}%`}})})]})]}),(0,G.jsxs)(`span`,{className:`inline-flex flex-col gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[n(`liveRpm`),(0,G.jsx)(`span`,{className:`mono tabular text-body font-semibold text-foreground`,children:e?.rpm??`—`})]}),(0,G.jsxs)(`span`,{className:`inline-flex flex-col gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[n(`liveTrace`),(0,G.jsx)(v.Suspense,{fallback:(0,G.jsx)(`span`,{className:`inline-block h-6 w-[120px]`}),children:(0,G.jsx)(BZ,{samples:t,capacity:i,label:n(`liveTrace`)})})]})]})}var HZ=2500;Math.round(6e4/HZ);function UZ(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)([]);return(0,v.useEffect)(()=>{let e=!1,n=null,i=()=>{document.hidden||OY().then(n=>{e||(t(n),r(e=>[...e,{at:Date.now(),value:n.in_flight}].slice(-24)))}).catch(()=>{})},a=()=>{n||document.hidden||(i(),n=setInterval(i,HZ))},o=()=>{n&&clearInterval(n),n=null},s=()=>document.hidden?o():a();return a(),document.addEventListener(`visibilitychange`,s),()=>{e=!0,o(),document.removeEventListener(`visibilitychange`,s)}},[]),{live:e,samples:n}}var WZ=(0,v.lazy)(()=>C(()=>import(`./TrafficChart-DKxQTayd.js`).then(e=>({default:e.TrafficChart})),__vite__mapDeps([3,1,4]))),GZ=3e4,KZ={window:{from:``,to:``,hours:24},totals:{requests:0,ok:0,incomplete:0,error:0,canceled:0,streaming:0,success_rate:0},latency:{},tokens:{prompt:0,completion:0,cache_read:0,total:0},status:[],errors:[],models:[],accounts:[],providers:[],series:[]};function qZ(e,t){return!e||e===`(unknown)`?t(`statsUnknown`):TZ(e,t)}function JZ(e,t,n){return!t||t===`(unassigned)`?n:e.find(e=>e.id===t)?.name||t}var YZ=new Set([`quota`,`rate_limit`,`auth`,`not_ready`,`unavailable`,`invalid_request`,`model_not_available`]);function XZ(e,t){let n={quota:`logsKindQuota`,rate_limit:`logsKindRateLimit`,auth:`logsKindAuth`,not_ready:`logsKindNotReady`,unavailable:`logsKindUnavailable`,invalid_request:`logsKindInvalidRequest`,model_not_available:`logsKindModelNotAvailable`};return n[e]?t(n[e]):e}var ZZ=[`ok`,`incomplete`,`error`,`canceled`],QZ={ok:`bg-success`,incomplete:`bg-warning`,error:`bg-danger`,canceled:`bg-muted`},$Z={ok:`logsFilterOk`,incomplete:`logsFilterIncomplete`,error:`logsFilterError`,canceled:`logsFilterCanceled`};function eQ(e,t){return t>0?e/t:null}function tQ(e,t){if(!e)return null;let n=Date.parse(e);if(!Number.isFinite(n))return null;let r=Math.max(0,Math.round((n-t)/1e3));if(r<=0)return null;let i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60;return i?`${i}h ${a}m`:a?`${a}m ${String(o).padStart(2,`0`)}s`:`${o}s`}function nQ(e,t){let n=[e.down_until,e.cooldown_until].filter(e=>!!e).filter(e=>Date.parse(e)>t);return n.length?n.reduce((e,t)=>Date.parse(e)>=Date.parse(t)?e:t):null}function rQ(e,t){return t?`danger`:(e??0)>=80?`warning`:`ok`}function iQ(){let{lang:e,t}=DH(),{overview:n,loading:r,error:i}=dU(),[a,o]=(0,v.useState)(`today`),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),d=ot(),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(!0),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(!0),[T,E]=(0,v.useState)([]),[D,O]=(0,v.useState)(!0),[k,A]=(0,v.useState)(0),[j,M]=(0,v.useState)([]),[N,P]=(0,v.useState)(null),[ee,F]=(0,v.useState)(()=>Date.now()),{live:I,samples:L}=UZ(),te=new Map((I?.accounts??[]).map(e=>[e.id,e])),R=!!n?.proxy?.ok,z=!!n?.worker?.ok,B=n?.worker?.ready_count??0,ne=n?.worker?.hot_count??0,re=n?.worker?.cooling_count??0,ie=I?.in_flight??n?.worker?.in_flight??0,V=f??KZ,ae=n?.routing?.session_affinity,oe=(ae?.hits??0)+(ae?.misses??0),se=eQ(ae?.hits??0,oe),ce=T.map(e=>({account:e,until:nQ(e,ee)})).filter(e=>e.until!=null),le=ce.length>0;(0,v.useEffect)(()=>{if(!le)return;let e=setInterval(()=>F(Date.now()),1e3);return()=>clearInterval(e)},[le]),(0,v.useEffect)(()=>{let e=!1;return Promise.allSettled([LH(!1),GH(),GH(void 0,!1,`regional`)]).then(([t,n,r])=>{e||(t.status===`fulfilled`&&E(t.value.data||[]),n.status===`fulfilled`&&A((n.value.data||[]).length),r.status===`fulfilled`&&M(r.value.data||[]))}).finally(()=>{e||O(!1)}),()=>{e=!0}},[]);let ue=s?.start?.toString()??``,de=s?.end?.toString()??``,fe=(0,v.useRef)(0),pe=(0,v.useCallback)(e=>{let t=mZ(a,s);if(!t){_(!1);return}let n=++fe.current;tX(t).then(e=>{n===fe.current&&(p(e),h(``))}).catch(t=>{n!==fe.current||e||(p(null),h(t instanceof Error?t.message:String(t)))}).finally(()=>{n===fe.current&&_(!1)})},[a,ue,de]);(0,v.useEffect)(()=>(pe(!1),()=>{fe.current++}),[pe]);let me=(0,v.useRef)(0),he=(0,v.useCallback)(e=>{let t=mZ(a,s)??{},n=++me.current;nX(t).then(e=>{n===me.current&&(b(e),S(``))}).catch(t=>{n!==me.current||e||(b(null),S(t instanceof Error?t.message:String(t)))}).finally(()=>{n===me.current&&w(!1)})},[a,ue,de]);(0,v.useEffect)(()=>(he(!1),()=>{me.current++}),[he]),(0,v.useEffect)(()=>{if(l)return;let e=Date.now(),t=()=>{document.hidden||(e=Date.now(),pe(!0),he(!0))},n=setInterval(t,GZ),r=()=>{!document.hidden&&Date.now()-e>=GZ&&t()};return document.addEventListener(`visibilitychange`,r),()=>{clearInterval(n),document.removeEventListener(`visibilitychange`,r)}},[l,pe,he]),(0,v.useEffect)(()=>{let e=!1,t=()=>{OU().then(t=>{e||P(t)}).catch(()=>{})};t();let n=setInterval(t,5e3);return()=>{e=!0,clearInterval(n)}},[]);let ge=Math.floor(V.series.length/2),_e=(e,t)=>e.reduce((e,n)=>e+n[t],0),ve=V.series.slice(0,ge),ye=V.series.slice(ge),be=((e,t)=>e>0?(t-e)/e:null)(_e(ve,`requests`),_e(ye,`requests`)),xe=_e(ve,`requests`)?_e(ve,`ok`)/_e(ve,`requests`):null,Se=_e(ye,`requests`)?_e(ye,`ok`)/_e(ye,`requests`):null,Ce=xe!=null&&Se!=null?Se-xe:null,we=[{label:t(`metricRequests`),value:V.totals.requests,kind:`compact`,detail:t(`statsWindowHint`,{window:t(pZ[a])}),ok:V.totals.requests>0,trend:be},{label:t(`metricSuccess`),value:V.totals.success_rate,kind:`percent`,detail:`${V.totals.ok} ${t(`logsFilterOk`)} · ${V.totals.incomplete} ${t(`logsFilterIncomplete`)} · ${V.totals.error} ${t(`logsFilterError`)}`,ok:V.totals.requests===0||V.totals.success_rate>=.9,trend:Ce},{label:t(`metricLatency`),value:V.latency.p95_ms??V.latency.avg_ms,kind:`ms`,detail:`p50 ${cX(V.latency.p50_ms)} · avg ${cX(V.latency.avg_ms)}`,ok:V.latency.p95_ms==null||V.latency.p95_ms<8e3,trend:null},{label:t(`metricTokens`),value:V.tokens.total,kind:`compact`,detail:`${sX(V.tokens.prompt)} / ${sX(V.tokens.completion)}`,ok:!0,trend:null}],Te=eQ(V.tokens.cache_read,V.tokens.prompt),Ee=eQ(V.totals.streaming,V.totals.requests),De=[{label:t(`metricCacheHit`),value:Te,kind:`percent`,detail:t(`metricCacheHitDetail`,{read:sX(V.tokens.cache_read),prompt:sX(V.tokens.prompt)})},{label:t(`metricStreaming`),value:Ee,kind:`percent`,detail:t(`metricStreamingDetail`,{count:V.totals.streaming,total:V.totals.requests})},{label:t(`metricCanceled`),value:V.totals.canceled,kind:`int`,detail:t(`metricCanceledDetail`,{rate:uX(eQ(V.totals.canceled,V.totals.requests)??0)})}],Oe=ZZ.map(e=>({key:e,count:V.status.find(t=>t.key===e)?.count??V.totals[e]??0})),ke=e=>gZ(e,V.window.from,V.window.to);return r&&!n?(0,G.jsx)(mY,{}):(0,G.jsxs)(`div`,{className:`space-y-5 sm:space-y-4`,children:[(0,G.jsxs)(`section`,{className:`grid gap-3 pb-1 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{"data-gsap-reveal":!0,className:`text-title font-semibold`,children:t(`homeDisplay`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:t(`homeLead`)})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(hZ,{value:a,onChange:o,custom:s,onCustomChange:c,onBusy:()=>{_(!0),w(!0)},t}),(0,G.jsxs)(eL,{delay:300,children:[(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,"aria-label":t(l?`statsRefreshResume`:`statsRefreshPause`),"aria-pressed":l,onPress:()=>u(e=>!e),children:l?(0,G.jsx)(Sa,{size:14}):(0,G.jsx)(va,{size:14})}),(0,G.jsx)(eL.Content,{children:t(l?`statsRefreshPaused`:`statsRefreshAuto`)})]}),(0,G.jsxs)(`div`,{className:`text-left sm:text-right`,children:[(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:n?.time||`—`}),(0,G.jsxs)(`div`,{className:`mt-1 inline-flex items-center gap-2 text-body font-medium`,children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":R&&z?`ok`:`danger`}),t(R&&z?`running`:`degraded`)]})]})]})]}),i?(0,G.jsx)(bU,{title:t(`failedOverview`,{msg:i})}):null,(0,G.jsx)(VZ,{live:I,samples:L,t}),(0,G.jsx)(`section`,{"data-gsap-reveal":!0,className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-4`,children:we.map(e=>(0,G.jsxs)(zw,{className:`gap-0 p-3.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-body text-muted`,children:e.label}),(0,G.jsx)(`span`,{className:`status-dot`,"data-state":e.ok?`ok`:`danger`})]}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`tabular text-metric font-medium leading-none`,children:g?(0,G.jsx)($,{className:`h-7 w-24`}):e.value==null?`—`:(0,G.jsx)(SX,{value:e.value,kind:e.kind})}),!g&&e.trend!=null?(0,G.jsx)(cQ,{value:e.trend,hint:t(`trendHalfHint`)}):null]}),(0,G.jsx)(`div`,{className:`mono mt-2 truncate text-caption text-muted`,children:g?(0,G.jsx)($,{className:`h-3 w-28`}):e.detail})]},e.label))}),(0,G.jsx)(`section`,{className:`grid gap-3 sm:grid-cols-3`,children:De.map(e=>(0,G.jsx)(zw,{className:`gap-0 p-3.5`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body text-muted`,children:e.label}),(0,G.jsx)(`div`,{className:`mono mt-0.5 truncate text-caption text-muted`,children:g?(0,G.jsx)($,{className:`h-3 w-28`}):e.detail})]}),(0,G.jsx)(`div`,{className:`tabular text-section font-semibold sm:shrink-0`,children:g?(0,G.jsx)($,{className:`h-5 w-12`}):e.value==null?`—`:(0,G.jsx)(SX,{value:e.value,kind:e.kind})})]})},e.label))}),(0,G.jsx)(`section`,{className:`grid gap-3`,children:(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`statsTraffic`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`statsTrafficHint`)})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:V.totals.error?`warning`:`success`,children:uX(V.totals.success_rate)})]}),(0,G.jsxs)(`div`,{className:`space-y-4 p-4`,children:[m?(0,G.jsx)(`div`,{className:`text-body text-danger`,children:t(`failedStats`,{msg:m})}):g?(0,G.jsx)(fY,{}):V.series.some(e=>e.requests>0)?(0,G.jsx)(v.Suspense,{fallback:(0,G.jsx)(fY,{}),children:(0,G.jsx)(WZ,{series:V.series,lang:e,emptyLabel:t(`statsEmptyTraffic`),okLabel:t(`logsFilterOk`),errorLabel:t(`logsFilterError`),selectHint:t(`statsDragHint`),labels:{requests:t(`chartMetricRequests`),tokens:t(`chartMetricTokens`),latency:t(`chartMetricLatency`),input:t(`chartInput`),output:t(`chartOutput`),cacheRead:t(`chartCacheRead`),p50:t(`statsLatencyP50`),p95:t(`statsLatencyP95`),total:t(`chartTotal`)},onSelectRange:(e,t)=>d(gZ({},e,t))})}):(0,G.jsx)(wX,{emptyLabel:t(`statsEmptyTraffic`)}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-4 pt-3 sm:grid-cols-4 sm:gap-3`,children:[[t(`statsLatencyP50`),cX(V.latency.p50_ms)],[t(`statsLatencyP95`),cX(V.latency.p95_ms)],[t(`statsLatencyAvg`),cX(V.latency.avg_ms)],[t(`statsTTFB`),cX(V.latency.ttfb_avg_ms)]].map(([e,t])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e}),(0,G.jsx)(`div`,{className:`mono mt-1 text-body font-medium`,children:g?(0,G.jsx)($,{className:`h-4 w-16`}):t})]},String(e)))})]})]})}),(0,G.jsx)(GX,{accounts:T,t}),(0,G.jsx)(sZ,{usage:y,accounts:T,loading:C,t}),x?(0,G.jsx)(bU,{title:t(`failedStats`,{msg:x})}):null,(0,G.jsx)(lZ,{usage:y,accounts:T,models:j,loading:C,t}),(0,G.jsxs)(`section`,{className:`grid gap-3 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,.85fr)]`,children:[(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`statsPool`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`statsPoolHint`)})]}),(0,G.jsxs)(Cn,{to:`/accounts`,className:`inline-flex items-center gap-1 text-caption font-medium text-muted hover:text-foreground`,children:[t(`navAccounts`),(0,G.jsx)(ei,{size:12})]})]}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-y-1 border-b border-separator sm:grid-cols-4 sm:gap-y-0`,children:[[t(`ready`),B,`ok`],[t(`hot`),ne,ne?`ok`:``],[t(`inFlight`),ie,ie?`ok`:``],[t(`statsAffinityHit`),se==null?`—`:uX(se),``,ae?t(`statsAffinityHint`,{hits:ae.hits??0,misses:ae.misses??0,bindings:ae.bindings??0}):``]].map(([e,t,n,r])=>(0,G.jsxs)(`div`,{className:`px-4 py-3 sm:py-2.5`,title:r?String(r):void 0,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e}),(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2 sm:mt-1`,children:[(0,G.jsx)(`span`,{className:`mono text-section font-semibold`,children:t}),n?(0,G.jsx)(`span`,{className:`status-dot`,"data-state":n}):null]})]},String(e)))}),!D&&ce.length?(0,G.jsxs)(`div`,{className:`border-b border-separator px-4 py-2.5`,children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:t(`statsCoolingDetails`)}),(0,G.jsx)(`div`,{className:`mt-2 space-y-1.5`,children:ce.map(({account:e,until:n})=>(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-caption sm:flex-row sm:items-center sm:gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`status-dot shrink-0`,"data-state":`warn`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name||e.id})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pl-4 sm:contents sm:pl-0`,children:[(0,G.jsx)(`span`,{className:`mono shrink-0 text-muted`,children:e.last_error_kind?XZ(e.last_error_kind,t):t(`statsUnknown`)}),(0,G.jsx)(`span`,{className:`mono shrink-0 tabular sm:w-16 sm:text-right`,children:tQ(n,ee)??`—`}),(0,G.jsx)(`span`,{className:`mono shrink-0 text-muted sm:w-12 sm:text-right`,title:t(`statsBackoffLevel`),children:e.restart_backoff_level?`L${e.restart_backoff_level}`:`—`})]})]},e.id))})]}):null,(0,G.jsx)(`div`,{className:`divide-y divide-separator`,children:D?(0,G.jsx)(dY,{}):T.length===0?(0,G.jsx)(`div`,{className:`px-4 py-6 text-body text-muted`,children:t(`noAccounts`)}):T.slice(0,6).map(e=>{let n=e.quota,r=rQ(n?.percentage,n?.exceeded),i=te.get(e.id),a=i?.in_flight??e.in_flight??e.inFlight??0,o=i?.max_inflight||e.max_inflight||4,s=a>=o;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-2.5 px-4 py-3 sm:flex-row sm:items-center sm:gap-3 sm:py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3 sm:items-center`,children:[(0,G.jsx)(`span`,{className:`status-dot mt-1.5 shrink-0 sm:mt-0`,"data-state":e.ready?`ok`:`danger`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(zZ,{provider:e.provider,size:14}),(0,G.jsx)(`div`,{className:`truncate text-body font-medium`,children:e.name||e.id})]}),(0,G.jsxs)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:[EZ(e.provider,e.region,t),` · `,e.hot?t(`hot`):e.ready?t(`ready`):t(`degraded`)]})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 pl-6 sm:shrink-0 sm:pl-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,title:t(s?`liveSaturated`:`inFlight`),"data-testid":`account-inflight`,children:[(0,G.jsx)(`span`,{className:`text-caption text-muted sm:hidden`,children:t(`inFlight`)}),(0,G.jsxs)(`span`,{className:`mono text-caption tabular ${s?`text-warning`:`text-muted`}`,children:[a,`/`,o]}),(0,G.jsx)(`span`,{className:`inline-block h-[2px] w-10 overflow-hidden rounded-[1px] bg-separator`,children:(0,G.jsx)(`span`,{className:`block h-full ${s?`bg-warning`:`bg-foreground/50`}`,style:{width:`${Math.min(100,a/o*100)}%`}})})]}),n?(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,title:t(`quota`),children:[(0,G.jsx)(`span`,{className:`text-caption text-muted sm:hidden`,children:t(`quota`)}),(0,G.jsxs)(`span`,{className:`mono text-caption tabular text-muted`,children:[Math.round(n.percentage??0),`%`]}),(0,G.jsx)(`span`,{className:`inline-block h-[2px] w-10 overflow-hidden rounded-[1px] bg-separator`,children:(0,G.jsx)(`span`,{className:`block h-full ${r===`danger`?`bg-danger`:r===`warning`?`bg-warning`:`bg-success`}`,style:{width:`${Math.min(100,Math.max(0,n.percentage??0))}%`}})})]}):null]})]},e.id)})}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-t border-separator px-4 py-2.5 text-caption text-muted`,children:[(0,G.jsxs)(`span`,{children:[t(`metricModels`),` `,k]}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-x-2 gap-y-1`,children:[[`qoder`,`workbuddy`,`trae`].map(e=>{let t=T.filter(t=>String(t.provider||`qoder`).toLowerCase()===e).length;return t?(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,G.jsx)(zZ,{provider:e,size:11}),t]},e):null}),(0,G.jsx)(`span`,{children:re?`${re} ${t(`statsCooling`)}`:`${T.length} ${t(`accountCount`)}`})]})]})]}),(0,G.jsx)(oQ,{resources:N,t})]}),(0,G.jsxs)(`section`,{className:`grid gap-3 xl:grid-cols-2 2xl:grid-cols-3`,children:[(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`statsTopProviders`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`statsTopProvidersHint`)})]})}),g?(0,G.jsx)(dY,{}):(0,G.jsx)(sQ,{empty:t(`statsNoProviders`),items:(V.providers||[]).map(e=>({key:e.key,label:qZ(e.key,t),count:e.count,meta:`${e.ok}/${e.count}`,mark:e.key===`(unknown)`?void 0:e.key,href:e.key===`(unknown)`?void 0:ke({provider:e.key})}))})]}),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`statsTopModels`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`providerCatalog`)})]})}),g?(0,G.jsx)(dY,{rows:4}):(0,G.jsx)(sQ,{empty:t(`statsNoModels`),items:V.models.map(e=>({key:e.key,label:e.key===`(unknown)`?t(`statsUnknown`):e.key,count:e.count,href:e.key===`(unknown)`?void 0:ke({model:e.key}),meta:e.latency_avg_ms==null?`${e.ok}/${e.count}`:cX(e.latency_avg_ms)}))})]}),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`statsStatusMix`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`statsStatusMixHint`)})]})}),g?(0,G.jsx)(dY,{rows:4}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(lQ,{items:Oe,t}),(0,G.jsx)(`div`,{className:`border-t border-separator px-4 pt-2.5 text-caption font-medium text-muted`,children:t(`statsErrorMix`)}),(0,G.jsx)(sQ,{empty:t(`statsNoErrors`),danger:!0,items:V.errors.map(e=>({key:e.key,label:XZ(e.key,t),count:e.count,href:YZ.has(e.key)?ke({error_kind:e.key}):void 0}))}),(0,G.jsx)(`div`,{className:`border-t border-separator px-4 pt-2.5 text-caption font-medium text-muted`,children:t(`statsTopAccounts`)}),(0,G.jsx)(sQ,{empty:t(`statsNoAccounts`),items:V.accounts.slice(0,5).map(e=>({key:e.key,label:JZ(T,e.key,t(`statsUnassigned`)),count:e.count,href:!e.key||e.key===`(unassigned)`?void 0:ke({account:e.key}),meta:`${e.ok}/${e.count}`}))})]})]})]})]})}function aQ(e,t){return e>=2147483648||t>=200?`danger`:e>=1073741824||t>=100?`warning`:`ok`}function oQ({resources:e,t}){let n=[...e?.workers??[]].sort((e,t)=>t.rss_bytes-e.rss_bytes),r=e?.server;return(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-4 py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`resTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:t(`resHint`)})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:e?`success`:`default`,children:e?lX(e.total_rss_bytes):`—`})]}),(0,G.jsx)(`div`,{className:`divide-y divide-separator`,children:e?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`px-4 py-2.5`,children:(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`status-dot shrink-0`,"data-state":aQ(r?.rss_bytes??0,r?.cpu_percent??0)}),(0,G.jsx)(`div`,{className:`truncate text-body font-medium`,children:t(`resServer`)}),(0,G.jsxs)(`span`,{className:`mono text-caption text-muted`,children:[`pid `,r?.pid]})]}),(0,G.jsxs)(`div`,{className:`mono shrink-0 text-caption text-muted`,children:[lX(r?.rss_bytes),` · `,(r?.cpu_percent??0).toFixed(1),`%`]})]})}),n.length===0?(0,G.jsx)(`div`,{className:`px-4 py-3 text-body text-muted`,children:t(`resEmpty`)}):n.map(e=>(0,G.jsx)(`div`,{className:`px-4 py-2.5`,children:(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`status-dot shrink-0`,"data-state":aQ(e.rss_bytes,e.cpu_percent)}),(0,G.jsx)(`div`,{className:`truncate text-body font-medium`,children:e.label||e.account_id}),(0,G.jsxs)(`span`,{className:`mono text-caption text-muted`,children:[`pid `,e.pid]})]}),(0,G.jsxs)(`div`,{className:`mono shrink-0 text-caption text-muted`,children:[lX(e.rss_bytes),` · `,e.cpu_percent.toFixed(1),`%`]})]})},e.pid))]}):(0,G.jsx)(dY,{rows:3})}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between border-t border-separator px-4 py-2.5 text-caption text-muted`,children:[(0,G.jsxs)(`span`,{className:`mono`,children:[r?.goroutines??0,` `,t(`resGoroutines`)]}),(0,G.jsx)(`span`,{className:`mono`,children:e?.sampled_at?new Date(e.sampled_at).toLocaleTimeString():`—`})]})]})}function sQ({items:e,empty:t,danger:n}){let r=(0,v.useRef)(null),i=Math.max(1,...e.map(e=>e.count)),a=e.map(e=>`${e.key}:${e.count}`).join(`|`);return(0,v.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=eY.context(()=>{let e=eY.matchMedia();e.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(`[data-rank-fill]`,{clearProps:`transform`})}),e.add(`(prefers-reduced-motion: no-preference)`,()=>{let e=eY.utils.toArray(`[data-rank-fill]`);e.length&&eY.fromTo(e,{scaleX:0},{scaleX:1,duration:.38,ease:`power2.out`,stagger:.05,transformOrigin:`0% 50%`})})},e);return()=>t.revert()},[a]),e.length?(0,G.jsx)(`div`,{ref:r,className:`divide-y divide-separator`,children:e.map(e=>{let t=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e.mark?(0,G.jsx)(zZ,{provider:e.mark,size:14}):null,(0,G.jsx)(`div`,{className:`truncate text-body font-medium`,children:e.label})]}),(0,G.jsx)(`div`,{className:`mono shrink-0 text-caption text-muted`,children:e.meta?`${e.count} · ${e.meta}`:e.count})]}),(0,G.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-[2px] bg-separator`,children:(0,G.jsx)(`div`,{"data-rank-fill":!0,className:`h-full origin-left rounded-[2px] ${n?`bg-danger`:`bg-success`}`,style:{width:`${Math.max(6,e.count/i*100)}%`}})})]});return e.href?(0,G.jsx)(Cn,{to:e.href,className:`rank-row block px-4 py-2.5`,title:e.label,children:t},e.key):(0,G.jsx)(`div`,{className:`px-4 py-2.5`,children:t},e.key)})}):(0,G.jsx)(`div`,{className:`px-4 py-6 text-body text-muted`,children:t})}function cQ({value:e,hint:t}){let n=Math.abs(e)<.005?`flat`:e>0?`up`:`down`;return(0,G.jsxs)(`span`,{className:`trend-chip`,"data-tone":n,title:t,children:[(0,G.jsx)(n===`down`?Xa:n===`up`?Qa:gi,{size:12,weight:`bold`}),e>0?`+`:``,(e*100).toFixed(1),`%`]})}function lQ({items:e,t}){let n=e.reduce((e,t)=>e+t.count,0);return n?(0,G.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,G.jsx)(`div`,{className:`flex h-2 gap-px overflow-hidden rounded-[3px] bg-separator`,role:`img`,"aria-label":e.map(e=>`${t($Z[e.key])} ${e.count}`).join(`, `),children:e.filter(e=>e.count>0).map(e=>(0,G.jsx)(`div`,{className:QZ[e.key],style:{width:`${e.count/n*100}%`,minWidth:2}},e.key))}),(0,G.jsx)(`div`,{className:`mt-3 grid grid-cols-2 gap-x-4 gap-y-1.5`,children:e.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-caption`,children:[(0,G.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-[2px] ${QZ[e.key]}`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted`,children:t($Z[e.key])}),(0,G.jsx)(`span`,{className:`mono tabular`,children:e.count}),(0,G.jsx)(`span`,{className:`mono w-10 text-right tabular text-muted`,children:uX(e.count/n)})]},e.key))})]}):(0,G.jsx)(`div`,{className:`px-4 py-3 text-body text-muted`,children:t(`statsEmptyTraffic`)})}function uQ(e){return e?e>=1e6?`${(e/1e6).toString().replace(/\.0$/,``)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e):`—`}function dQ({model:e,t,onClose:n}){if(!e)return null;let r=e.reasoning_options||[],i=e.catalog_context_length||e.default_context_length||e.context_length,a=e.catalog_context_length_max,o=fX(e),s=pX(e),c=String(e.provider||e.owned_by||`qoder`).trim().toLowerCase(),l=EZ(c,String(e.region||e.regions?.[0]||``).trim().toLowerCase()||void 0,t),u=c===`trae`?DZ(e):void 0;return(0,G.jsx)(Z.Root,{isOpen:!0,onOpenChange:e=>{e||n()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{size:`md`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`text-section`,children:e.display_name||e.id}),s?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`success`,children:t(`modelFree`)}):null]}),(0,G.jsx)(`div`,{className:`mono mt-1 text-caption text-muted`,children:e.id}),(0,G.jsxs)(`div`,{className:`mt-1 text-caption text-muted`,children:[l,o?` · ${o}`:``]})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":t(`close`),className:`grid size-8 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Body,{className:`space-y-4 px-5 pb-5`,children:[(0,G.jsxs)(`section`,{children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:t(`contextWindowCol`)}),(0,G.jsxs)(`div`,{className:`mt-1 text-body`,children:[uQ(i),a&&a!==i?` → ${uQ(a)}`:``]}),e.supports_max_mode?(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t(c===`qoder`?`qoderMaxModeHint`:`maxModeHint`)}):null,!e.supports_max_mode&&a&&a!==i?(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t(`workbuddyContextHint`)}):null,u?u.prompt_max_tokens?(0,G.jsxs)(`div`,{className:`mt-1 text-caption text-muted`,children:[t(`promptMaxTokens`),`: `,uQ(u.prompt_max_tokens)]}):null:e.prompt_max_tokens?(0,G.jsxs)(`div`,{className:`mt-1 text-caption text-muted`,children:[t(`promptMaxTokens`),`: `,uQ(e.prompt_max_tokens)]}):null,u?u.max_output_tokens?(0,G.jsxs)(`div`,{className:`text-caption text-muted`,children:[t(`maxOutputTokens`),`: `,uQ(u.max_output_tokens)]}):null:e.max_output_tokens?(0,G.jsxs)(`div`,{className:`text-caption text-muted`,children:[t(`maxOutputTokens`),`: `,uQ(e.max_output_tokens)]}):null]}),(0,G.jsxs)(`section`,{children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:t(`reasoningLevels`)}),r.length?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t(`reasoningHint`)}),(0,G.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:r.map(n=>{let r=`reasoningLevel_${n}`,i=t(r);return(0,G.jsxs)(lT,{size:`sm`,variant:`soft`,color:n===(e.reasoning_effort||e.reasoning_default)?`success`:`default`,children:[i===r?n:i,n===e.reasoning_default?` · ${t(`defaultValue`)}`:``,n===e.reasoning_effort&&n!==e.reasoning_default?` · ${t(`custom`)}`:``]},n)})})]}):(0,G.jsx)(`div`,{className:`mt-1 text-body text-muted`,children:e.reasoning_type?t(`reasoningFixed`,{type:e.reasoning_type}):t(`noReasoningLevels`)})]})]})]})})})})}function fQ({isSelected:e,isDisabled:t,ariaLabel:n,label:r,size:i=`sm`,onChange:a}){return(0,G.jsx)(dF,{size:i,isSelected:e,isDisabled:t,onChange:a,children:(0,G.jsxs)(dF.Content,{children:[(0,G.jsx)(dF.Control,{children:(0,G.jsx)(dF.Thumb,{})}),r?(0,G.jsx)(sR,{children:r}):(0,G.jsx)(`span`,{className:`sr-only`,children:n})]})})}function pQ({title:e,hint:t,action:n,icon:r,className:i}){return(0,G.jsx)(`div`,{className:`grid min-h-56 place-items-center px-6 py-12 text-center ${i||``}`,children:(0,G.jsxs)(`div`,{className:`max-w-sm`,children:[r?(0,G.jsx)(`div`,{className:`mb-3 flex justify-center text-muted`,children:r}):null,(0,G.jsx)(dR,{className:`p-0 text-body font-medium text-foreground`,children:e}),t?(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t}):null,n?(0,G.jsx)(`div`,{className:`mt-5 flex justify-center`,children:n}):null]})})}var mQ=`__all__`;function hQ({value:e,onChange:t,ariaLabel:n,options:r,className:i}){let a=r.map(e=>({id:e.id||mQ,label:e.label})),o=e||mQ,s=a.find(e=>e.id===o);return(0,G.jsxs)(SV,{className:i??`w-fit min-w-36`,"aria-label":n,value:o,onChange:e=>{typeof e==`string`&&t(e===mQ?``:e)},children:[(0,G.jsxs)(SV.Trigger,{className:`min-w-0 w-full items-center`,children:[(0,G.jsx)(SV.Value,{className:`min-w-0 truncate`,children:({defaultChildren:e,isPlaceholder:t})=>t||!s?e:(0,G.jsx)(`span`,{className:`truncate`,children:s.label})}),(0,G.jsx)(SV.Indicator,{})]}),(0,G.jsx)(SV.Popover,{className:`max-h-72 min-w-36`,children:(0,G.jsx)(GB,{children:a.map(e=>(0,G.jsxs)(GB.Item,{id:e.id,textValue:e.label,children:[(0,G.jsx)(sR,{className:`block truncate`,children:e.label}),(0,G.jsx)(GB.ItemIndicator,{})]},e.id))})})]})}var gQ=[20,50,100],_Q=[20,50,100];function vQ(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=[1];e>3&&n.push(`gap`);let r=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let e=r;e<=i;e++)n.push(e);return e{let t=Number([...e][0]);d.includes(t)&&u(t)},"aria-label":a,children:d.map(e=>(0,G.jsx)(QP,{id:String(e),children:e},e))})]}),(0,G.jsxs)(yV,{size:`sm`,className:`w-fit`,children:[(0,G.jsx)(yV.Summary,{className:`mono text-caption`,children:o}),(0,G.jsxs)(yV.Content,{children:[(0,G.jsx)(yV.Item,{children:(0,G.jsx)(yV.Previous,{isDisabled:i||t<=1,onPress:()=>l(Math.max(1,t-1)),"aria-label":s,children:(0,G.jsx)(yV.PreviousIcon,{})})}),f.map((e,n)=>e===`gap`?(0,G.jsx)(yV.Item,{children:(0,G.jsx)(yV.Ellipsis,{})},`gap-${n}`):(0,G.jsx)(yV.Item,{children:(0,G.jsx)(yV.Link,{isActive:e===t,isDisabled:i,onPress:()=>l(e),children:e})},e)),(0,G.jsx)(yV.Item,{children:(0,G.jsx)(yV.Next,{isDisabled:i||t>=n,onPress:()=>l(Math.min(n,t+1)),"aria-label":c,children:(0,G.jsx)(yV.NextIcon,{})})})]})]})]})}function bQ({value:e,onChange:t,placeholder:n,ariaLabel:r,className:i}){return(0,G.jsx)(aR,{"aria-label":r,value:e,onChange:t,className:i,children:(0,G.jsxs)(aR.Group,{children:[(0,G.jsx)(aR.SearchIcon,{}),(0,G.jsx)(aR.Input,{placeholder:n}),(0,G.jsx)(aR.ClearButton,{})]})})}function xQ(e){let t=[];for(let n of e)for(let e of n.regions||[])e?.id&&t.push({value:`${n.id}:${e.id}`,provider:n.id,region:e.id});return t}function SQ(e){return e.settings_key||e.id}function CQ(e){return String(e.provider||e.owned_by||`qoder`).trim().toLowerCase()}function wQ(e){let t=String(e.region||``).trim().toLowerCase();if(t)return t;let n=e.regions||[];return String(n[0]||``).trim().toLowerCase()}function TQ(e){return`${CQ(e)}:${wQ(e)||`any`}:${e.settings_key||e.id}:${e.native_model||e.mapped_key||``}`}function EQ(e){let t=e.route_display_name||``;return t&&t!==(e.display_name||e.id)?t:``}function DQ(e,t){let n=`reasoningLevel_${t}`,r=e(n);return r===n?t:r}function OQ({label:e,hint:t}){return(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(`span`,{className:`cursor-help text-caption text-muted`,children:e})}),(0,G.jsx)(eL.Content,{children:(0,G.jsx)(`p`,{className:`max-w-xs text-caption leading-5`,children:t})})]})}function kQ({model:e,saving:t,t:n,variant:r=`table`,onToggleTraeMax:i,onReasoningChange:a}){let o=CQ(e),s=r===`card`,c=s?`w-full min-w-0`:`w-full max-w-[7.5rem] min-w-0`;return(0,G.jsxs)(`div`,{className:s?`flex min-w-0 flex-col gap-3`:`flex min-w-0 flex-col gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,G.jsxs)(`span`,{className:`mono text-caption text-muted`,children:[uQ(e.catalog_context_length||e.context_length),e.catalog_context_length_max&&e.catalog_context_length_max!==(e.catalog_context_length||e.context_length)?` → ${uQ(e.catalog_context_length_max)}`:``]}),o===`workbuddy`&&e.catalog_context_length_max&&e.catalog_context_length_max!==(e.catalog_context_length||e.context_length)?(0,G.jsx)(OQ,{label:n(`catalogWindow`),hint:n(`workbuddyContextHint`)}):null]}),(o===`trae`||o===`qoder`)&&e.supports_max_mode?(0,G.jsxs)(`div`,{className:s?`flex flex-col gap-1.5`:`flex items-center gap-2`,children:[s?(0,G.jsx)(OQ,{label:`${n(`maxMode`)}${e.catalog_context_length_max?` ${uQ(e.catalog_context_length_max)}`:``}`,hint:n(o===`qoder`?`qoderMaxModeHint`:`maxModeHint`)}):null,(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(fQ,{isSelected:!!e.max_mode,isDisabled:t,ariaLabel:`${e.id} ${n(`maxMode`)}`,onChange:t=>i(e,t)}),s?null:(0,G.jsx)(OQ,{label:`${n(`maxMode`)}${e.catalog_context_length_max?` ${uQ(e.catalog_context_length_max)}`:``}`,hint:n(o===`qoder`?`qoderMaxModeHint`:`maxModeHint`)})]})]}):null,(e.reasoning_options||[]).length>1?(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,G.jsx)(OQ,{label:n(`reasoningLevels`),hint:n(`reasoningHint`)}),(0,G.jsx)(hQ,{className:c,ariaLabel:`${e.id} ${n(`reasoningLevels`)}`,value:e.reasoning_effort||e.reasoning_default||e.reasoning_options?.[0]||``,onChange:t=>{t&&a(e,t)},options:(e.reasoning_options||[]).map(e=>({id:e,label:DQ(n,e)}))})]}):(e.reasoning_options||[]).length===1?(0,G.jsx)(OQ,{label:`${n(`reasoningLevels`)} ${DQ(n,e.reasoning_options[0])}`,hint:n(`reasoningHint`)}):e.reasoning_type?(0,G.jsx)(`span`,{className:`text-caption text-muted`,children:n(`reasoningFixed`,{type:e.reasoning_type})}):o===`trae`&&!e.supports_max_mode?(0,G.jsx)(OQ,{label:n(`catalogWindow`),hint:n(`catalogWindowHint`)}):null]})}function AQ({model:e,t,onDetails:n}){return(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:()=>n(e),children:[(0,G.jsx)(ea,{size:14}),t(`modelDetails`)]})}function jQ(){let{t:e}=DH(),{overview:t,loading:n}=dU(),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(1),[d,f]=(0,v.useState)(50),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(null),[w,T]=(0,v.useState)([]),[E,D]=(0,v.useState)(!0);(0,v.useEffect)(()=>{let e=!1;return KH(void 0,`regional`).then(t=>{e||T(t.data||[])}).catch(()=>void 0).finally(()=>{e||D(!1)}),tU().then(t=>{e||c(xQ(t.data||[]))}).catch(()=>void 0),()=>{e=!0}},[]);let O=(0,v.useMemo)(()=>{let t=r.trim().toLowerCase(),[n,i]=a.includes(`:`)?a.split(`:`,2):[a,``];return w.filter(r=>{let a=CQ(r),o=wQ(r);if(n&&a!==n||i&&o!==i)return!1;if(!t)return!0;let s=EZ(a,o||void 0,e);return`${r.display_name||``} ${r.id} ${r.mapped_key||``} ${a} ${s} ${r.owned_by||``} ${o} ${r.credits||``} ${r.free?`free`:``}`.toLowerCase().includes(t)})},[r,w,a,e]),k=[r,a,d].join(`\0`),[A,j]=(0,v.useState)(k);A!==k&&(j(k),u(1));let M=Math.max(1,Math.ceil(O.length/d)),N=Math.min(A===k?Math.max(1,l):1,M);l!==N&&u(N);let P=(0,v.useMemo)(()=>{let e=(N-1)*d;return O.slice(e,e+d)},[N,O,d]),ee=O.length===0?0:(N-1)*d+1,F=Math.min(O.length,N*d),I=O.length?e(`logsShownTotal`,{shown:`${ee}–${F}`,total:O.length}):e(`shownTotal`,{shown:0,total:w.length});if(n&&!t||E)return(0,G.jsx)(vY,{});function L(e,t){let n=SQ(e),r=CQ(e),i=w.map(e=>{if(SQ(e)!==n||CQ(e)!==r)return e;let i=e.reasoning_effort||e.reasoning_default||``,a=e.catalog_context_length||e.default_context_length||e.context_length||0,o=e.catalog_context_length_max||0;return{...e,max_mode:t,context_length:t&&o?o:a,default_context_length:a,context_custom:r===`qoder`?t:t||!!(i&&i!==e.reasoning_default)}});T(i)}function te(e,t){let n=SQ(e),r=CQ(e),i=w.map(e=>SQ(e)!==n||CQ(e)!==r?e:{...e,reasoning_effort:t,context_custom:!!e.max_mode||!!(t&&t!==e.reasoning_default)});T(i)}async function R(){m(!0),y(``),x(!1);try{let e=await qH(void 0,`regional`);T(e.data||[])}catch(e){x(!0),y(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function z(t,n){let r=CQ(t);if(r!==`trae`&&r!==`workbuddy`&&r!==`kimi`)return;let i=SQ(t);g(i),y(``),x(!1);try{await YH(r,i,n),te(t,n),y(e(`reasoningSaved`,{model:t.id,level:DQ(e,n)}))}catch(e){x(!0),y(e instanceof Error?e.message:String(e))}finally{g(``)}}async function B(t,n){if(!t.supports_max_mode){x(!0),y(e(`contextMaxUnavailable`));return}let r=SQ(t),i=CQ(t);g(r),y(``),x(!1);try{await JH(i,r,n,t.catalog_context_length_max),L(t,n),y(e(n?`contextMaxOn`:`contextMaxOff`,{model:t.id}))}catch(e){x(!0),y(e instanceof Error?e.message:String(e))}finally{g(``)}}return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(`section`,{className:`grid gap-5 pb-6 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end`,children:[(0,G.jsxs)(`div`,{"data-gsap-reveal":!0,children:[(0,G.jsx)(`h2`,{className:`text-title font-semibold`,children:e(`availableModels`)}),(0,G.jsx)(`p`,{className:`mt-1 text-body text-muted`,children:w.length?I:e(`noModelsYet`)})]}),(0,G.jsxs)(`div`,{"data-gsap-reveal":!0,className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center`,children:[(0,G.jsx)(bQ,{className:`w-full min-w-0 sm:w-72`,value:r,onChange:i,placeholder:e(`filterPh`),ariaLabel:e(`filter`)}),(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(hQ,{ariaLabel:e(`providerCol`),value:a,onChange:o,options:[{id:``,label:e(`providerFilterAll`)},...s.map(t=>({id:t.value,label:EZ(t.provider,t.region,e)}))]}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:p,onPress:()=>void R(),children:[(0,G.jsx)(Jr,{size:14}),e(p?`refreshing`:`refresh`)]})]})]})]}),_?(0,G.jsx)(bU,{status:b?`danger`:`success`,title:_}):null,(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-separator px-4 py-4 sm:items-center sm:px-5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-surface-secondary text-muted`,children:(0,G.jsx)(Mi,{size:16})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-body font-semibold`,children:e(`providerCatalog`)}),(0,G.jsx)(`div`,{className:`mt-0.5 text-caption leading-5 text-muted`,children:e(`contextConfigHint`)})]})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,className:`shrink-0`,children:O.length})]}),p||n?(0,G.jsx)(pY,{}):O.length===0?(0,G.jsx)(pQ,{icon:(0,G.jsx)(ua,{size:22}),title:w.length?e(`noModelsMatch`):e(`noProviders`),hint:w.length?r||a||e(`noModelsMatch`):e(`noModelsYet`)}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`divide-y divide-separator lg:hidden`,children:P.map(t=>{let n=SQ(t),r=h===n,i=CQ(t),a=EZ(i,wQ(t)||void 0,e),o=fX(t),s=pX(t);return(0,G.jsxs)(`article`,{className:`space-y-3 px-4 py-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,G.jsx)(`span`,{className:`status-dot mt-1.5`,"data-state":t.stale?void 0:`ok`}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`truncate font-medium`,children:t.display_name||t.id}),s?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`success`,children:e(`modelFree`)}):null,o?(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:o}):null]}),(0,G.jsx)(`div`,{className:`mono mt-0.5 truncate text-caption text-muted`,children:t.id}),EQ(t)?(0,G.jsx)(`div`,{className:`mt-0.5 text-caption text-muted`,children:e(`routedTo`,{model:EQ(t)})}):null]})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:t.context_custom||t.stale?`warning`:`success`,children:t.context_custom?e(`custom`):e(`defaultValue`)})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-caption`,children:[(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(zZ,{provider:i,size:14}),(0,G.jsx)(`span`,{className:`font-medium`,children:a})]}),(0,G.jsx)(`span`,{className:`mono break-all text-muted`,children:t.mapped_key||t.native_model||t.id})]}),(0,G.jsx)(kQ,{model:t,saving:r,t:e,variant:`card`,onToggleTraeMax:(e,t)=>void B(e,t),onReasoningChange:(e,t)=>void z(e,t)}),(0,G.jsx)(AQ,{model:t,t:e,onDetails:C})]},TQ(t))})}),(0,G.jsx)(Q,{className:`hidden min-w-0 lg:block`,children:(0,G.jsx)(Q.ScrollContainer,{className:`min-w-0 overflow-x-auto`,children:(0,G.jsxs)(Q.Content,{"aria-label":e(`availableModels`),className:`min-w-[68rem]`,children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:e(`modelCol`)}),(0,G.jsx)(Q.Column,{children:e(`requestIdCol`)}),(0,G.jsx)(Q.Column,{children:e(`providerCol`)}),(0,G.jsx)(Q.Column,{children:e(`qoderKeyCol`)}),(0,G.jsx)(Q.Column,{children:e(`modelDefaultsCol`)}),(0,G.jsx)(Q.Column,{children:e(`stateCol`)}),(0,G.jsx)(Q.Column,{children:e(`actions`)})]}),(0,G.jsx)(Q.Body,{children:P.map(t=>{let n=SQ(t),r=h===n,i=CQ(t),a=EZ(i,wQ(t)||void 0,e),o=fX(t),s=pX(t);return(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":t.stale?void 0:`ok`}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`font-medium`,children:t.display_name||t.id}),s?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`success`,children:e(`modelFree`)}):null,o?(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:o}):null]}),EQ(t)?(0,G.jsx)(`div`,{className:`mt-0.5 text-caption text-muted`,children:e(`routedTo`,{model:EQ(t)})}):null]})]})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-caption font-medium`,children:t.id})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(zZ,{provider:i,size:14}),(0,G.jsx)(`span`,{className:`text-caption font-medium`,children:a})]})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:t.mapped_key||t.native_model||t.id})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(kQ,{model:t,saving:r,t:e,variant:`table`,onToggleTraeMax:(e,t)=>void B(e,t),onReasoningChange:(e,t)=>void z(e,t)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:t.context_custom||t.stale?`warning`:`success`,children:t.context_custom?e(`custom`):e(`defaultValue`)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(AQ,{model:t,t:e,onDetails:C})})]},TQ(t))})})]})})})]})]}),(0,G.jsx)(dQ,{model:S?w.find(e=>SQ(e)===SQ(S))||S:null,t:e,onClose:()=>C(null)}),(0,G.jsx)(yQ,{total:O.length,page:N,pageCount:M,pageSize:d,loading:p,pageSizeLabel:e(`logsPageSize`),pageLabel:e(`logsPage`,{page:N,pages:M}),prevLabel:e(`logsPrevPage`),nextLabel:e(`logsNextPage`),onPage:u,onPageSize:f})]})}function MQ({copied:e,size:t=14,className:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(!0);return(0,v.useLayoutEffect)(()=>{let t=e?i.current:r.current,n=e?r.current:i.current;if(!t||!n)return;let o={autoAlpha:1,scale:1,filter:`blur(0px)`},s={autoAlpha:0,scale:.5,filter:`blur(4px)`};if(a.current||iY()){a.current=!1,eY.set(t,o),eY.set(n,s);return}eY.to(n,{...s,duration:tY.fast,ease:nY.out,overwrite:!0}),eY.fromTo(t,s,{...o,duration:tY.base,ease:nY.soft,delay:tY.instant/2,overwrite:!0})},[e]),(0,G.jsxs)(`span`,{className:`relative inline-grid place-items-center ${n??``}`,style:{width:t,height:t},children:[(0,G.jsx)(`span`,{ref:r,className:`col-start-1 row-start-1 inline-flex`,children:(0,G.jsx)(Oi,{size:t})}),(0,G.jsx)(`span`,{ref:i,className:`col-start-1 row-start-1 inline-flex text-success`,children:(0,G.jsx)(vi,{size:t})})]})}async function NQ(e){if(!e)return!1;try{if(typeof navigator<`u`&&navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`-1000px`,t.style.opacity=`0`,document.body.appendChild(t),t.focus(),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function PQ(){return`${location.protocol}//${location.host}`}function FQ(e){return e?/^https?:\/\//i.test(e)?e:e.startsWith(`/`)?`${PQ()}${e}`:`${PQ()}/${e}`:PQ()}function IQ({access:e}){let{t}=DH(),[n,r]=(0,v.useState)(``),i=FQ(e?.openai_base_url||`/v1`),a=(0,v.useMemo)(()=>[{name:t(`endpointOpenAI`),url:i,method:`BASE`,hint:t(`endpointBaseHint`),icon:(0,G.jsx)(oi,{size:15})},{name:t(`endpointChat`),url:FQ(e?.chat_completions||`${i}/chat/completions`),method:`POST`,hint:t(`endpointChatHint`),icon:(0,G.jsx)(ga,{size:15})},{name:t(`endpointMessages`),url:FQ(e?.messages||`${i}/messages`),method:`POST`,hint:t(`endpointMessagesHint`),icon:(0,G.jsx)(ga,{size:15})},{name:t(`endpointResponses`),url:FQ(e?.responses||`${i}/responses`),method:`POST`,hint:t(`endpointResponsesHint`),icon:(0,G.jsx)(ga,{size:15})},{name:t(`endpointModels`),url:FQ(e?.models||`${i}/models`),method:`GET`,hint:t(`endpointModelsHint`),icon:(0,G.jsx)(ca,{size:15})},{name:t(`endpointHealth`),url:FQ(e?.health||`/health`),method:`GET`,hint:t(`endpointHealthHint`),icon:(0,G.jsx)(Qi,{size:15})}],[e,i,t]);return(0,G.jsxs)(`section`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface`,children:[(0,G.jsx)(`div`,{className:`flex items-start justify-between gap-4 px-5 py-4 sm:px-6`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:t(`endpoints`)}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,children:t(`endpointCount`,{count:a.length-1})})]}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t(`routesHint`)})]})}),(0,G.jsx)(`div`,{className:`grid gap-2 px-3 pb-3 sm:grid-cols-2 sm:px-4 sm:pb-4 lg:grid-cols-3`,children:a.map(e=>(0,G.jsxs)(`div`,{className:`group min-w-0 rounded-xl bg-surface-secondary/40 p-3 transition-colors hover:bg-surface-secondary/70`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,G.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-lg bg-surface text-muted`,children:e.icon}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`truncate text-body font-semibold`,children:e.name}),(0,G.jsx)(`code`,{className:`mono mt-0.5 block truncate text-caption text-muted`,children:e.url})]})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,children:e.method})]}),(0,G.jsx)(`p`,{className:`mt-2 text-caption leading-5 text-muted`,children:e.hint}),(0,G.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2`,children:[(0,G.jsx)(`span`,{className:`text-caption font-medium text-muted`,children:e.method===`BASE`?t(`endpointBaseLabel`):t(`endpointAuthLabel`)}),(0,G.jsxs)(`div`,{className:`flex gap-1`,children:[(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,"aria-label":t(`copy`),onPress:()=>{NQ(e.url),r(e.name),window.setTimeout(()=>r(``),1100)},children:(0,G.jsx)(MQ,{copied:n===e.name})}),(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,"aria-label":t(`open`),onPress:()=>window.open(e.url,`_blank`,`noopener,noreferrer`),children:(0,G.jsx)(Qr,{size:14})})]})]})]},e.name))})]})}var LQ=new Set(`txt.md.markdown.json.csv.tsv.yml.yaml.toml.xml.html.htm.css.scss.js.jsx.ts.tsx.mjs.cjs.py.go.rs.java.kt.swift.c.h.cpp.hpp.sh.bash.zsh.sql.graphql.env.ini.conf.log.rst.tex`.split(`.`)),RQ=new Set([`image/png`,`image/jpeg`,`image/jpg`,`image/gif`,`image/webp`]);function zQ(e){let t=e.lastIndexOf(`.`);return t>=0?e.slice(t+1).toLowerCase():``}function BQ(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}async function VQ(e){let t=zQ(e.name),n=e.type||`application/octet-stream`,r=`${e.name}-${e.size}-${e.lastModified}-${Math.random().toString(36).slice(2,8)}`;if(RQ.has(n)||[`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(t)){let t=await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||``)),r.onerror=()=>n(r.error||Error(`read failed`)),r.readAsDataURL(e)});return{id:r,name:e.name,mime:n,kind:`image`,dataUrl:t,size:e.size}}if(LQ.has(t)||n.startsWith(`text/`)||n===`application/json`){let t=await e.text();return{id:r,name:e.name,mime:n,kind:`text`,text:t,size:e.size}}return null}function HQ({ariaLabel:e,value:t,onChange:n,placeholder:r,isDisabled:i,options:a,className:o,tone:s=`default`}){let c=a.find(e=>e.id===t),l=s===`muted`?`text-muted hover:text-foreground`:`text-foreground`;return(0,G.jsxs)(SV,{className:o??`w-auto max-w-[11rem] min-w-0`,"aria-label":e,value:t||null,placeholder:r,isDisabled:i,onChange:e=>{typeof e==`string`&&e&&n(e)},children:[(0,G.jsxs)(SV.Trigger,{className:`h-7 min-h-7 gap-1 rounded-md border-0 bg-transparent px-1.5 shadow-none items-center hover:bg-surface data-[focus-visible=true]:bg-surface ${l}`,children:[(0,G.jsx)(SV.Value,{className:`min-w-0 truncate text-caption font-medium`,children:({defaultChildren:e,isPlaceholder:t})=>t||!c?e:(0,G.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[c.icon?(0,G.jsx)(`span`,{className:`grid size-3.5 shrink-0 place-items-center opacity-80`,children:c.icon}):null,(0,G.jsx)(`span`,{className:`truncate`,children:c.label})]})}),(0,G.jsx)(SV.Indicator,{className:`size-2.5 opacity-50`})]}),(0,G.jsx)(SV.Popover,{placement:`top end`,className:`max-h-72 min-w-48`,children:(0,G.jsx)(GB,{children:a.map(e=>(0,G.jsxs)(GB.Item,{id:e.id,textValue:e.textValue,className:`gap-2`,children:[e.icon?(0,G.jsx)(`span`,{className:`grid size-5 shrink-0 place-items-center`,children:e.icon}):null,(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(sR,{className:`block truncate text-caption`,children:e.label}),e.hint?(0,G.jsx)(`span`,{className:`block truncate text-caption text-muted`,children:e.hint}):null]}),(0,G.jsx)(GB.ItemIndicator,{})]},e.id))})})]})}function UQ({value:e,onChange:t,attachments:n,onAttachmentsChange:r,disabled:i,streaming:a,canSend:o,onSend:s,onStop:c,accountValue:l,onAccountChange:u,accountOptions:d,modelValue:f,onModelChange:p,modelOptions:m,modelsLoading:h}){let{t:g}=DH(),_=(0,v.useRef)(null);async function y(e){if(!e?.length)return;let t=[],i=[];for(let n of Array.from(e))try{let e=await VQ(n);e?t.push(e):i.push(n.name)}catch{i.push(n.name)}t.length&&r([...n,...t]),i.length&&window.alert(g(`chatAttachUnsupported`,{names:i.join(`, `)})),_.current&&(_.current.value=``)}function b(e){e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),!a&&o&&s())}return(0,G.jsxs)(`div`,{className:`border-t border-separator/60 p-3 sm:p-4`,children:[(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl bg-surface-secondary/80`,children:[n.length?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2 px-3 pt-3`,children:n.map(e=>(0,G.jsxs)(`span`,{className:`inline-flex max-w-[14rem] items-center gap-2 rounded-xl bg-surface px-1.5 py-1.5 text-caption text-foreground`,children:[e.kind===`image`&&e.dataUrl?(0,G.jsx)(`img`,{src:e.dataUrl,alt:``,className:`size-8 shrink-0 rounded-lg object-cover`}):(0,G.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-muted`,children:(0,G.jsx)(Wi,{size:14})}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block truncate font-medium`,children:e.name}),(0,G.jsx)(`span`,{className:`mono text-muted`,children:BQ(e.size)})]}),(0,G.jsx)(`button`,{type:`button`,className:`grid size-6 shrink-0 place-items-center rounded-md text-muted hover:bg-surface-secondary hover:text-foreground`,"aria-label":g(`chatAttachRemove`),onClick:()=>r(n.filter(t=>t.id!==e.id)),children:(0,G.jsx)(oo,{size:12})})]},e.id))}):null,(0,G.jsx)(mL,{fullWidth:!0,rows:3,className:`min-h-20 resize-none border-0 bg-transparent px-3.5 py-3 text-body leading-[1.65] shadow-none focus-visible:ring-0`,value:e,onChange:e=>t(e.target.value),onKeyDown:b,placeholder:g(`promptPlaceholder`),"aria-label":g(`prompt`),disabled:i||a}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pb-2 pt-0.5`,children:[(0,G.jsx)(`input`,{ref:_,type:`file`,className:`hidden`,multiple:!0,accept:`.txt,.md,.json,.csv,.yml,.yaml,.toml,.xml,.html,.css,.js,.jsx,.ts,.tsx,.py,.go,.rs,.sh,.sql,.png,.jpg,.jpeg,.gif,.webp,text/*,image/png,image/jpeg,image/gif,image/webp,application/json`,onChange:e=>void y(e.target.files)}),(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,className:`size-7 min-w-7 shrink-0`,"aria-label":g(`chatAttach`),isDisabled:i||a,onPress:()=>_.current?.click(),children:(0,G.jsx)(wa,{size:15})}),(0,G.jsx)(`div`,{className:`min-w-0 flex-1`}),(0,G.jsx)(HQ,{ariaLabel:g(`account`),value:l,onChange:u,options:d,isDisabled:i||a,tone:`muted`,className:`w-auto max-w-[8.5rem] min-w-0`}),(0,G.jsx)(HQ,{ariaLabel:g(`model`),value:f,onChange:p,placeholder:g(h?`requesting`:`model`),options:m,isDisabled:i||a||h||!m.length,className:`w-auto max-w-[10.5rem] min-w-0`}),a?(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`secondary`,className:`size-7 shrink-0 rounded-full`,"aria-label":g(`chatTryStop`),onPress:c,children:(0,G.jsx)(Ha,{size:13,weight:`fill`})}):(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,className:`size-7 shrink-0 rounded-full transition-transform active:scale-95 disabled:active:scale-100`,"aria-label":g(`chatTrySend`),isDisabled:!o||i,onPress:s,children:(0,G.jsx)(ga,{size:13,weight:`fill`})})]})]}),(0,G.jsx)(`p`,{className:`mt-2 px-1 text-caption leading-5 text-muted`,children:g(`chatTryHelper`)})]})}function WQ({text:e,streaming:t,defaultOpen:n}){let{t:r}=DH(),[i,a]=(0,v.useState)(!!n),[o,s]=(0,v.useState)(0),c=(0,v.useRef)(0);if((0,v.useEffect)(()=>{t?a(!1):n!=null&&a(!!n)},[t,n]),(0,v.useEffect)(()=>{if(!t)return;let e=Date.now();s(0);let n=window.setInterval(()=>{let t=Math.floor((Date.now()-e)/1e3);s(t),c.current=t},250);return()=>window.clearInterval(n)},[t]),(0,v.useEffect)(()=>{!t&&o===0&&c.current>0&&s(c.current)},[t,o]),!e&&!t)return null;let l=iY(),u=t?o:o||c.current;return(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-xl`,children:[(0,G.jsx)(`button`,{type:`button`,className:`inline-flex max-w-full items-center gap-1.5 rounded-full bg-surface-secondary px-2.5 py-1 text-left text-caption text-muted`,"aria-expanded":i,onClick:()=>a(e=>!e),children:t?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(wi,{size:12,className:`shrink-0 text-muted ${l?``:`animate-spin`}`}),(0,G.jsx)(`span`,{className:l?``:`access-thinking-shimmer`,children:r(`thinkingWorking`)}),(0,G.jsxs)(`span`,{className:`mono text-muted/80`,children:[o,`s`]})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(fi,{size:11,className:`shrink-0 transition-transform ${i?`rotate-90`:``}`}),(0,G.jsx)(`span`,{children:r(`thinkingDone`)}),u>0?(0,G.jsx)(`span`,{className:`mono text-muted/80`,children:r(`thinkingElapsed`,{n:u})}):null,!u&&e?(0,G.jsx)(`span`,{className:`mono text-muted/80`,children:r(`thinkingChars`,{count:e.length})}):null]})}),i&&e?(0,G.jsx)(`div`,{className:`mt-1.5`,children:(0,G.jsx)(`pre`,{className:`max-h-52 overflow-auto whitespace-pre-wrap break-words rounded-xl bg-surface-secondary/80 px-3 py-2 text-caption leading-5 text-muted`,children:e})}):null]})}function GQ(e,t){return t(e===`running`?`toolCallRunning`:e===`error`?`toolCallError`:`toolCallSuccess`)}function KQ({status:e}){return e===`running`?(0,G.jsx)(Ia,{size:12,className:`animate-spin text-muted`}):e===`error`?(0,G.jsx)(io,{size:12,weight:`fill`,className:`text-danger`}):(0,G.jsx)(bi,{size:12,weight:`fill`,className:`text-success`})}function qQ(e){if(!e.trim())return``;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function JQ({call:e,forceOpen:t}){let{t:n}=DH(),[r,i]=(0,v.useState)(e.status===`error`||!!t),[a,o]=(0,v.useState)(!1),s=(0,v.useMemo)(()=>qQ(e.arguments||``),[e.arguments]);(0,v.useEffect)(()=>{e.status===`error`&&i(!0)},[e.status]),(0,v.useEffect)(()=>{t&&i(!0)},[t]);async function c(){s&&(await NQ(s),o(!0),window.setTimeout(()=>o(!1),1200))}return(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-lg`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-2 py-1.5 text-left`,"aria-expanded":r,onClick:()=>i(e=>!e),children:[(0,G.jsx)(fi,{size:11,className:`shrink-0 text-muted transition-transform ${r?`rotate-90`:``}`}),(0,G.jsx)(`span`,{className:`mono min-w-0 flex-1 truncate text-caption font-medium text-foreground`,children:e.name||n(`toolCallUntitled`)}),(0,G.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-caption text-muted`,children:[(0,G.jsx)(KQ,{status:e.status}),GQ(e.status,n)]})]}),r?(0,G.jsxs)(`div`,{className:`space-y-1.5 px-2 pb-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:n(`toolCallArgs`)}),(0,G.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-caption text-muted hover:bg-surface-secondary hover:text-foreground`,onClick:e=>{e.stopPropagation(),c()},children:[(0,G.jsx)(Ai,{size:12}),n(a?`copied`:`copy`)]})]}),(0,G.jsx)(`pre`,{className:`mono max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-lg bg-surface-secondary/80 px-2.5 py-2 text-caption leading-5 text-muted`,children:s||n(`toolCallArgsEmpty`)})]}):null]})}function YQ({calls:e}){let{t}=DH(),n=e.some(e=>e.status===`error`),r=e.some(e=>e.status===`running`),[i,a]=(0,v.useState)(n||r||e.length===1);return(0,v.useEffect)(()=>{(n||r)&&a(!0)},[n,r]),e.length?e.length===1?(0,G.jsx)(`div`,{className:`rounded-xl bg-surface-secondary/70`,children:(0,G.jsx)(JQ,{call:e[0],forceOpen:e[0].status===`error`})}):(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-surface-secondary/70`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-caption text-muted`,"aria-expanded":i,onClick:()=>a(e=>!e),children:[(0,G.jsx)(fi,{size:11,className:`shrink-0 transition-transform ${i?`rotate-90`:``}`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-foreground`,children:t(`toolCallGroup`,{n:e.length})}),r?(0,G.jsx)(Ia,{size:12,className:`animate-spin`}):null]}),i?(0,G.jsx)(`div`,{className:`space-y-0.5 border-t border-separator/40 px-0.5 py-1`,children:e.map(e=>(0,G.jsx)(JQ,{call:e},`${e.index}-${e.id||e.name}`))}):null]}):null}function XQ({message:e}){return e.attachments?.length?(0,G.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.attachments.map(e=>(0,G.jsxs)(`span`,{className:`inline-flex max-w-[12rem] items-center gap-1.5 rounded-xl bg-surface/70 px-1.5 py-1 text-caption text-muted`,children:[e.kind===`image`&&e.dataUrl?(0,G.jsx)(`img`,{src:e.dataUrl,alt:``,className:`size-7 shrink-0 rounded-lg object-cover`}):(0,G.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-lg bg-surface`,children:(0,G.jsx)(Wi,{size:12})}),(0,G.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))}):null}function ZQ({message:e}){let{t}=DH(),n=e.usage;if(!n||n.credits==null)return null;let r=n.prompt_tokens,i=n.completion_tokens,a=typeof r==`number`||typeof i==`number`?t(`chatTryUsageTokens`,{prompt:sX(r??0),completion:sX(i??0)}):``;return(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:a?t(`chatTryUsageFoot`,{tokens:a,amount:_X(n.credits)}):t(`chatTryCreditsUsed`,{amount:_X(n.credits)})})}function QQ({message:e}){let{t}=DH(),[n,r]=(0,v.useState)(!1);if(e.role===`user`)return(0,G.jsx)(`div`,{className:`ml-auto max-w-[92%] sm:max-w-[78%]`,children:(0,G.jsxs)(`div`,{className:`rounded-2xl rounded-br-md bg-surface-secondary/90 px-3.5 py-2.5`,children:[e.content?(0,G.jsx)(`div`,{className:`whitespace-pre-wrap break-words text-body leading-[1.65] text-foreground`,children:e.content}):null,(0,G.jsx)(XQ,{message:e})]})});let i=e.status===`streaming`&&!e.content&&!e.reasoning&&!e.toolCalls?.length,a=!!e.content&&e.status===`done`;async function o(){e.content&&(await NQ(e.content),r(!0),window.setTimeout(()=>r(!1),1200))}return(0,G.jsxs)(`div`,{className:`max-w-[96%] space-y-2 sm:max-w-[88%]`,children:[e.reasoning||e.status===`streaming`?(0,G.jsx)(WQ,{text:e.reasoning||``,streaming:e.status===`streaming`&&(!e.content||!!e.reasoning),defaultOpen:e.reasoningOpen}):null,e.toolCalls?.length?(0,G.jsx)(YQ,{calls:e.toolCalls}):null,e.status===`error`?(0,G.jsx)(bU,{status:`danger`,title:t(`requestFailed`),description:e.error||``}):i?(0,G.jsxs)(`div`,{className:`space-y-2.5 pt-0.5`,children:[(0,G.jsx)(qP,{className:`h-3 w-28 rounded-md`}),(0,G.jsx)(qP,{className:`h-3 w-full rounded-md`}),(0,G.jsx)(qP,{className:`h-3 w-[86%] rounded-md`}),(0,G.jsx)(qP,{className:`h-3 w-[68%] rounded-md`})]}):e.content?(0,G.jsx)(`div`,{className:`whitespace-pre-wrap break-words rounded-2xl rounded-tl-md bg-surface-secondary/50 px-3.5 py-2.5 text-body leading-[1.65] text-foreground`,children:e.content}):null,a||e.usage&&e.usage.credits!=null?(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 px-0.5`,children:[a?(0,G.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-caption text-muted hover:text-foreground`,onClick:()=>void o(),children:[(0,G.jsx)(Ai,{size:12}),t(n?`copied`:`copy`)]}):null,(0,G.jsx)(ZQ,{message:e})]}):null]})}function $Q({messages:e,busy:t,onLoadDemo:n}){let{t:r}=DH(),i=(0,v.useRef)(null);return(0,v.useEffect)(()=>{i.current?.scrollIntoView({block:`end`})},[e,t]),(0,G.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-4 py-5 sm:px-6 sm:py-6`,"aria-live":`polite`,"aria-busy":t,children:[e.length?(0,G.jsx)(`div`,{className:`space-y-5`,children:e.map(e=>(0,G.jsx)(QQ,{message:e},e.id))}):(0,G.jsx)(pQ,{className:`min-h-64`,title:r(`chatTryEmptyTitle`),hint:r(`chatTryEmptyHint`),action:n?(0,G.jsx)(`button`,{type:`button`,className:`rounded-lg bg-surface-secondary px-3 py-1.5 text-caption font-medium text-foreground hover:bg-surface-tertiary`,onClick:n,children:r(`chatDemoLoad`)}):void 0}),(0,G.jsx)(`div`,{ref:i})]})}function e$({open:e,onOpenChange:t,chatPath:n,prompt:r,onPromptChange:i,onTest:a,requestState:o,elapsedMs:s,output:c,responseStatus:l,curl:u,copiedCurl:d,onCopyCurl:f,canSend:p}){let{t:m}=DH();return(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h3`,{className:`text-body font-semibold`,children:m(`accessTabApi`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption leading-5 text-muted`,children:m(`nativeApiHint`)})]}),(0,G.jsx)(X,{size:`sm`,variant:e?`secondary`:`ghost`,onPress:()=>t(!e),children:m(e?`rawApiHide`:`rawApiShow`)})]}),e?(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(`div`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface`,children:(0,G.jsxs)(`div`,{className:`grid xl:grid-cols-[minmax(440px,.92fr)_minmax(0,1.08fr)]`,children:[(0,G.jsxs)(`div`,{className:`xl:border-r xl:border-separator`,children:[(0,G.jsxs)(`div`,{className:`px-5 py-4 sm:px-6`,children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:m(`requestBuilder`)}),(0,G.jsxs)(`p`,{className:`mt-0.5 text-caption text-muted`,children:[`POST `,n]})]}),(0,G.jsxs)(`div`,{className:`space-y-5 px-5 pb-5 sm:px-6 sm:pb-6`,children:[(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-muted`,children:m(`prompt`)}),(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:r.length})]}),(0,G.jsx)(mL,{fullWidth:!0,rows:9,className:`min-h-56 resize-y px-4 py-3 text-body leading-6`,value:r,onChange:e=>i(e.target.value),placeholder:m(`promptPlaceholder`),"aria-label":m(`prompt`)}),(0,G.jsx)(`p`,{className:`text-caption leading-5 text-muted`,children:m(`promptHelper`)})]}),(0,G.jsxs)(X,{fullWidth:!0,isPending:o===`loading`,isDisabled:!p,onPress:a,children:[(0,G.jsx)(ga,{size:16}),m(o===`loading`?`requesting`:`sendRequest`)]})]})]}),(0,G.jsxs)(`div`,{className:`flex min-h-[480px] min-w-0 flex-col bg-surface-secondary/40`,"aria-live":`polite`,"aria-busy":o===`loading`,children:[(0,G.jsxs)(`div`,{className:`flex min-h-14 items-center justify-between gap-4 px-5 py-3.5 sm:px-6`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:m(`responseInspector`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:m(`responseInspectorHint`)})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s===null?null:(0,G.jsxs)(`span`,{className:`mono flex items-center gap-1.5 text-caption text-muted`,children:[(0,G.jsx)(Ei,{size:12}),s,` ms`]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:o===`success`?`success`:o===`error`?`danger`:void 0,children:l})]})]}),(0,G.jsx)(`div`,{className:`min-h-0 flex-1 px-5 pb-5 sm:px-6 sm:pb-6`,children:o===`idle`?(0,G.jsx)(pQ,{className:`min-h-72`,icon:(0,G.jsx)(oi,{size:21}),title:m(`responseEmptyTitle`),hint:m(`responseEmptyHint`)}):o===`loading`?(0,G.jsxs)(`div`,{className:`space-y-3 pt-1`,children:[(0,G.jsx)(qP,{className:`h-3 w-32 rounded-lg`}),(0,G.jsx)(qP,{className:`h-3 w-full rounded-lg`}),(0,G.jsx)(qP,{className:`h-3 w-[88%] rounded-lg`}),(0,G.jsx)(qP,{className:`h-3 w-[72%] rounded-lg`}),(0,G.jsx)(qP,{className:`mt-7 h-3 w-[92%] rounded-lg`}),(0,G.jsx)(qP,{className:`h-3 w-[64%] rounded-lg`})]}):o===`error`?(0,G.jsx)(`div`,{className:`space-y-3`,children:(0,G.jsx)(bU,{status:`danger`,title:m(`requestFailed`),description:c})}):(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-caption font-medium text-success`,children:[(0,G.jsx)(bi,{size:15,weight:`fill`}),m(`responseReceived`)]}),(0,G.jsx)(`pre`,{className:`mono overflow-x-auto whitespace-pre-wrap break-words text-caption leading-6 text-muted`,children:c})]})})]})]})}),(0,G.jsxs)(`section`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 px-5 py-3.5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-body font-semibold`,children:m(`curlExample`)}),(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-caption text-muted`,children:m(`curlGeneratedHint`)})]}),(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:f,children:[(0,G.jsx)(MQ,{copied:d}),m(d?`copied`:`copy`)]})]}),(0,G.jsx)(`pre`,{className:`mono max-h-80 overflow-auto whitespace-pre-wrap px-5 pb-5 text-caption leading-6 text-muted`,children:u})]})]}):null]})}function t$(e,t){let n=t.filter(e=>e.kind===`text`),r=t.filter(e=>e.kind===`image`&&e.dataUrl),i=e.trim();for(let e of n){let t=e.text??``;i=`${i}${i?` `:``}--- file: ${e.name} ---\n${t}`}if(!r.length)return i;let a=[];i&&a.push({type:`text`,text:i});for(let e of r)a.push({type:`image_url`,image_url:{url:e.dataUrl}});return a}function n$(e,t){let n=[];for(let t of e)if(!(t.status===`error`&&t.role===`assistant`&&!t.content)){if(t.role===`user`){n.push({role:`user`,content:t$(t.content,t.attachments||[])});continue}t.content&&n.push({role:`assistant`,content:t.content})}return[...n,t]}var r$=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mNkYPhfz0AEYBxVSF+FABJADveWkH6aAAAAAElFTkSuQmCC`;function i$(){return[{id:`demo-user-1`,role:`user`,content:`Summarize the attached screenshot and look up the endpoint.`,attachments:[{id:`demo-img-1`,name:`screenshot.png`,mime:`image/png`,kind:`image`,dataUrl:r$,size:2048},{id:`demo-txt-1`,name:`notes.md`,mime:`text/markdown`,kind:`text`,text:`# notes placeholder`,size:128}],status:`done`},{id:`demo-assistant-1`,role:`assistant`,content:`The screenshot shows the Access playground. I looked up the chat completions route and drafted a short summary below.`,reasoning:`User attached a UI screenshot and a notes file. @@ -93,4 +93,4 @@ Keep the reply short and ops-console toned.`,toolCalls:[{index:0,id:`call_demo_l -H "Authorization: Bearer $CLI2API_API_KEY" \\ -H ${o$(`Content-Type: application/json`)}${L?` \\ -H ${o$(`X-Qoder-Account: ${L}`)}`:``} \\ - -d ${o$(JSON.stringify(V))}`,[d,V,L]);if(n&&!t)return(0,G.jsx)(bY,{});async function oe(e,t){await NQ(e),I(t),window.setTimeout(()=>I(``),1100)}async function se(){let e=performance.now();N(`loading`),ee(null),j(``);try{let e=await ZH(V.model,V.messages[0].content,L||void 0);j(JSON.stringify(e,null,2)),N(`success`)}catch(e){j(e instanceof Error?e.message:String(e)),N(`error`)}finally{ee(Math.round(performance.now()-e))}}function ce(){k.current?.abort(),k.current=null}function le(e,t){E(n=>n.map(n=>{if(n.id!==e)return n;let r=typeof t==`function`?t(n):t;return{...n,...r}}))}async function ue(){let e=x.trim();if(!e&&!C.length||!re||z||D===`loading`)return;ce();let t=new AbortController;k.current=t;let n=C,r={id:s$(`user`),role:`user`,content:e,attachments:n,status:`done`},i=s$(`assistant`),a={id:i,role:`assistant`,content:``,status:`streaming`},o=T;E([...o,r,a]),S(``),w([]),O(`loading`);let s=n$(o,{role:`user`,content:t$(e,n)});try{await eU(re,s,L||void 0,{signal:t.signal,onContent:(e,t)=>le(i,{content:t}),onReasoning:(e,t)=>le(i,{reasoning:t}),onToolCalls:e=>le(i,{toolCalls:c$(e,!0)}),onUsage:e=>le(i,{usage:e})}),le(i,e=>({status:`done`,toolCalls:e.toolCalls?.map(e=>({...e,status:`success`}))})),O(`success`)}catch(e){if(t.signal.aborted){le(i,e=>({status:`done`,toolCalls:e.toolCalls?.map(e=>({...e,status:`success`}))})),O(`success`);return}le(i,{status:`error`,error:e instanceof Error?e.message:String(e)}),O(`error`)}finally{k.current===t&&(k.current=null)}}let de=e(M===`success`?`requestComplete`:M===`error`?`requestFailed`:M===`loading`?`requesting`:`requestIdle`),fe=l$()!=null,pe=[{id:`auto`,textValue:e(`autoAccount`),label:e(`autoAccount`),icon:(0,G.jsx)(ni,{size:14,className:`text-muted`})},...s.map(t=>({id:t.id,textValue:`${t.name||t.id} ${EZ(t.provider,t.region,e)}`,label:t.name||t.id,hint:EZ(t.provider,t.region,e),icon:(0,G.jsx)(zZ,{provider:t.provider,size:14})}))],me=s.length||!fe?pe:[{id:`auto`,textValue:e(`autoAccount`),label:e(`autoAccount`),icon:(0,G.jsx)(ni,{size:14,className:`text-muted`})},{id:`demo-wb`,textValue:`wb-demo WorkBuddy`,label:`wb-demo`,hint:`WorkBuddy`}],he=R.map(t=>{let n=fX(t),r=pX(t),i=t.display_name||t.id,a=r?e(`modelFree`):n,o=t.provider||t.owned_by||``;return{id:t.id,textValue:`${i} ${t.id} ${o} ${n} ${r?`free`:``}`,label:a?`${i} ${a}`:i,hint:[t.id,o,a].filter(Boolean).join(` · `)}}),ge=he.length||!fe?he:d$.map(t=>{let n=fX(t),r=pX(t),i=t.display_name||t.id,a=r?e(`modelFree`):n;return{id:t.id,textValue:`${i} ${t.id} ${t.provider} ${n} ${r?`free`:``}`,label:a?`${i} ${a}`:i,hint:[t.id,t.provider,a].filter(Boolean).join(` · `)}}),_e=!!((x.trim()||C.length)&&re&&!z&&(s.length||fe));function ve(){E(i$()),O(`idle`)}return(0,G.jsxs)(`div`,{className:`space-y-5`,children:[(0,G.jsxs)(`section`,{className:`grid gap-3 pb-1 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-title font-semibold`,children:e(`apiPlayground`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:e(`apiPlaygroundHint`)})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-caption text-muted`,children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":ie.length?`ok`:void 0}),(0,G.jsx)(`span`,{children:e(`readyAccounts`,{ready:ie.length,total:s.length})})]})]}),(0,G.jsx)(`section`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3 sm:px-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:e(`baseUrl`)}),(0,G.jsx)(`code`,{className:`mono mt-0.5 block truncate text-body font-medium text-foreground`,children:l})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,"aria-label":e(`copyBaseUrl`),onPress:()=>void oe(l,`base`),children:(0,G.jsx)(MQ,{copied:F===`base`,size:15})}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:ie.length?`success`:`warning`,children:ie.length?e(`endpointReady`):e(`degraded`)})]})]})}),s.length?null:(0,G.jsx)(`p`,{className:`px-1 text-caption text-muted`,children:e(`noAccountsForTest`)}),B?(0,G.jsx)(`p`,{className:`px-1 text-caption text-danger`,children:B}):null,(0,G.jsx)(`section`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface`,children:(0,G.jsxs)(`div`,{className:`flex min-h-[640px] flex-col md:min-h-[72vh]`,children:[(0,G.jsx)($Q,{messages:T,busy:D===`loading`,onLoadDemo:ve}),(0,G.jsx)(UQ,{value:x,onChange:S,attachments:C,onAttachmentsChange:w,disabled:!s.length&&l$()==null,streaming:D===`loading`,canSend:_e,onSend:()=>void ue(),onStop:ce,accountValue:L||`auto`,onAccountChange:e=>h(e===`auto`?``:e),accountOptions:me,modelValue:re,onModelChange:p,modelOptions:ge,modelsLoading:z})]})}),(0,G.jsx)(e$,{open:r,onOpenChange:i,chatPath:u,prompt:y,onPromptChange:b,onTest:()=>void se(),requestState:M,elapsedMs:P,output:A,responseStatus:de,curl:ae,copiedCurl:F===`curl`,onCopyCurl:()=>void oe(ae,`curl`),canSend:!!(y.trim()&&re&&!z)}),(0,G.jsx)(IQ,{access:t?.access})]})}function p$(e){(0,v.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let n=eY.context(()=>{eY.matchMedia().add(`(prefers-reduced-motion: no-preference)`,()=>{let e=eY.utils.toArray(`.meter__fill`);e.length&&eY.from(e,{scaleX:0,transformOrigin:`left center`,duration:tY.calm,ease:nY.emphasized,stagger:rY.base,clearProps:`transform,transformOrigin`})})},t);return()=>n.revert()},[e])}function m$(e,t,n,r,i,a){return[e.has_add_on&&e.add_on_available!==!1?`${n} ${AX(e.add_on_used)} / ${AX(e.add_on_total)} ${e.add_on_unit||`credits`}`:``,e.has_resource_package&&e.resource_package_available!==!1?`${r} ${t} ${AX(e.resource_package_remaining)} ${e.resource_package_unit||`credits`}`:``,a===`workbuddy`?RX(e,i):``].filter(Boolean)}function h$({window:e,t,extra:n}){let r=Math.round(e.percentage??0),i=IX(e,t),a=t(`quotaUsedPercent`,{n:r}),o=LX(e.reset_at,t),s=`${i} · ${a}${o?` · ${o}`:``}`,c=jX(e),l=MX(e),u=l===`danger`?`danger`:l===`warn`?`warning`:`success`;return(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{className:`block w-full min-w-0`,children:(0,G.jsxs)(`div`,{className:`w-full min-w-0 cursor-help`,children:[(0,G.jsxs)(OV,{className:`account-meter account-meter--window w-full`,color:u,size:`md`,minValue:0,maxValue:100,value:Math.round(c*100),"aria-label":i,valueLabel:s,children:[(0,G.jsxs)(OV.Output,{className:`flex w-full items-baseline justify-between gap-3 text-caption`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:i}),(0,G.jsx)(`span`,{className:`mono shrink-0 text-foreground/70`,children:a})]}),(0,G.jsx)(OV.Track,{children:(0,G.jsx)(OV.Fill,{})})]}),o?(0,G.jsx)(`div`,{className:`mt-1 text-caption leading-4 text-muted`,children:o}):null]})}),(0,G.jsx)(eL.Content,{children:(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsx)(`div`,{children:s}),n?.map(e=>(0,G.jsx)(`div`,{children:e},e))]})})]})}function g$({quota:e,t,label:n,usedLabel:r,remainingLabel:i,addOnLabel:a,resourcePackageLabel:o,exceededLabel:s,provider:c}){let l=e.unit||`credits`,u=`${AX(e.used)} / ${AX(e.total)}`,d=`${AX(e.remaining)}`,f=m$(e,i,a,o,t,c),p=NX(e),m=c===`codex`?FX(e.plan):``,h=jX(e),g=MX(e),_=g===`danger`?`danger`:g===`warn`?`warning`:`success`,y=(0,v.useRef)(null);p$(y);let b=`${r} ${u} ${l} · ${i} ${d} ${l}${f.length?` · ${f.join(` · `)}`:``}`;return p.length>0?(0,G.jsxs)(`div`,{ref:y,className:`account-quota-windows flex w-full min-w-0 flex-col gap-3`,children:[m?(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-caption`,children:[(0,G.jsx)(`span`,{className:`text-muted`,children:t(`quotaPlan`)}),(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:m})]}):null,p.map((e,n)=>(0,G.jsx)(`div`,{className:`w-full min-w-0`,children:(0,G.jsx)(h$,{window:e,t,extra:n===0?f:void 0})},e.id||String(n)))]}):(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(`div`,{ref:y,className:`w-full cursor-help`,children:(0,G.jsxs)(OV,{className:`account-meter w-full`,color:_,size:`md`,minValue:0,maxValue:100,value:Math.round(h*100),"aria-label":n,valueLabel:b,children:[(0,G.jsxs)(OV.Output,{className:`flex w-full items-baseline justify-between text-caption`,children:[(0,G.jsxs)(`span`,{className:`text-body font-semibold leading-5 text-foreground tabular-nums`,children:[e.exceeded?(0,G.jsx)(`span`,{className:`mr-1.5 text-danger`,children:s}):null,d,(0,G.jsx)(`span`,{className:`ml-1 text-caption font-normal text-foreground/60`,children:l})]}),(0,G.jsxs)(`span`,{className:`mono text-foreground/55`,children:[r,` `,u]})]}),(0,G.jsx)(OV.Track,{children:(0,G.jsx)(OV.Fill,{})})]})})}),(0,G.jsx)(eL.Content,{children:(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsxs)(`div`,{children:[r,` `,u,` `,l]}),(0,G.jsxs)(`div`,{children:[i,` `,d,` `,l]}),f.map(e=>(0,G.jsx)(`div`,{children:e},e))]})})]})}function _$({state:e,stateCopy:t,t:n}){let r=(0,v.useRef)(null),i=OX(e),a=kX(e);return(0,v.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=eY.context(()=>{let e=eY.utils.toArray(`[data-runtime-seg]`),t=e.filter((e,t)=>tt>=i),r=eY.matchMedia();r.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(t,{scaleY:1,autoAlpha:1}),eY.set(n,{scaleY:.32,autoAlpha:.45})}),r.add(`(prefers-reduced-motion: no-preference)`,()=>{eY.set(e,{transformOrigin:`center bottom`}),eY.to(n,{scaleY:.32,autoAlpha:.45,duration:tY.fast,ease:nY.out,overwrite:!0}),eY.to(t,{scaleY:1,autoAlpha:1,duration:tY.base,ease:nY.out,stagger:{amount:.08,from:`start`},overwrite:!0})})},e);return()=>t.revert()},[i,e]),(0,G.jsxs)(`div`,{ref:r,className:`flex items-center gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 text-caption font-medium text-foreground/75`,children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":a===`muted`?void 0:a===`warn`?`warn`:a}),(0,G.jsx)(`span`,{children:n(`runtimeState`)})]}),(0,G.jsx)(`div`,{className:`runtime-meter min-w-[80px] flex-1`,role:`meter`,"aria-label":n(`runtimeState`),"aria-valuemin":0,"aria-valuemax":12,"aria-valuenow":i,"aria-valuetext":t,children:Array.from({length:12},(e,t)=>(0,G.jsx)(`span`,{"data-runtime-seg":!0,"data-on":t{if(!M&&!N&&P.length===0)return;let e=window.setInterval(()=>A(e=>e+1),1e3);return()=>window.clearInterval(e)},[M,N,P.length]);let ee=v$(j,j===`dead`?N:M,o),F=j===`hot`||j===`ready`?`success`:j===`cooling`?`warning`:j===`quota_exhausted`||j===`login`||j===`unavailable`||j===`dead`||j===`auth_failed`?`danger`:void 0,I=e.last_error||e.lastError,L=e.last_error_kind||e.kind,te=EZ(e.provider,e.region,o),R=e.last_checkin_status,z=R===`success`?`checkinRecordSuccess`:R===`already`?`checkinRecordAlready`:R===`skipped`?`checkinRecordSkipped`:R===`error`?`checkinRecordFailed`:`lastCheckinNone`;return(0,v.useLayoutEffect)(()=>{let e=T.current;if(!e)return;let t=k.current;if(k.current=j,!t||t===j)return;let n=eY.context(()=>{let t=eY.matchMedia();t.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(e,{scale:1,autoAlpha:1})}),t.add(`(prefers-reduced-motion: no-preference)`,()=>{eY.fromTo(e,{scale:.94,autoAlpha:.65},{scale:1,autoAlpha:1,duration:.2,ease:`power2.out`,overwrite:!0})})},e);return()=>n.revert()},[j]),(0,v.useLayoutEffect)(()=>{let e=E.current;if(!e||!n)return;let t=eY.context(()=>{let t=eY.matchMedia();t.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(e,{autoAlpha:1,y:0})}),t.add(`(prefers-reduced-motion: no-preference)`,()=>{eY.fromTo(e,{autoAlpha:0,y:-6},{autoAlpha:1,y:0,duration:.2,ease:`power3.out`,overwrite:!0})})},e);return()=>t.revert()},[n]),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,"data-state":j,className:`account-card overflow-hidden p-0`,children:[(0,G.jsxs)(zw.Header,{className:`flex-row items-start justify-between gap-2.5 px-4 pt-3.5 pb-2`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,G.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-surface-tertiary`,children:(0,G.jsx)(zZ,{provider:e.provider,size:20})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(zw.Title,{className:`truncate text-body leading-5`,children:e.name||e.id}),(0,G.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-secondary px-1.5 py-px text-caption text-muted`,children:te})]}),(0,G.jsx)(zw.Description,{className:`mono truncate text-caption leading-4 text-foreground/60`,title:`${e.id}${e.remote_uid?` · UID ${e.remote_uid}`:``}`,children:e.remote_uid?`UID ${e.remote_uid}`:e.id})]})]}),(0,G.jsxs)(`div`,{className:`flex max-w-[48%] shrink-0 flex-wrap justify-end gap-1.5`,children:[(0,G.jsx)(`span`,{ref:T,children:P.length&&j===`cooling`?(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(`span`,{className:`inline-flex cursor-help`,children:(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:F,children:ee})})}),(0,G.jsx)(eL.Content,{children:(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`div`,{className:`font-medium`,children:o(`partialCooling`)}),P.map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-caption`,children:[(0,G.jsx)(`span`,{children:e}),(0,G.jsx)(`span`,{className:`mono text-foreground/65`,children:TX(t)})]},e))]})})]}):(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:F,children:ee})}),P.length&&j!==`cooling`?(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(`span`,{className:`inline-flex cursor-help`,children:(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`warning`,children:o(`partialCooling`)})})}),(0,G.jsx)(eL.Content,{children:(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`div`,{className:`font-medium`,children:o(`partialCooling`)}),P.map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-caption`,children:[(0,G.jsx)(`span`,{children:e}),(0,G.jsx)(`span`,{className:`mono text-foreground/65`,children:TX(t)})]},e))]})})]}):null]})]}),(0,G.jsxs)(zw.Content,{className:`gap-1.5 px-4 pb-3`,children:[(0,G.jsx)(_$,{state:j,stateCopy:ee,t:o}),e.quota?(0,G.jsx)(g$,{quota:e.quota,t:o,label:o(`quota`),usedLabel:o(`quotaUsed`),remainingLabel:o(`quotaRemaining`),addOnLabel:o(`quotaAddOn`),resourcePackageLabel:o(`quotaResourcePackage`),exceededLabel:o(`quotaExceeded`),provider:e.provider}):(0,G.jsx)(`span`,{className:`text-caption text-foreground/65`,children:o(j===`hot`||j===`ready`||j===`loading`||j===`starting`?`quotaLoading`:`quotaUnavailable`)}),I?(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsxs)(`div`,{className:`flex w-full cursor-help gap-2 rounded-lg bg-surface-secondary p-2 text-left text-caption leading-5 text-foreground`,children:[(0,G.jsx)(io,{size:14,className:`mt-0.5 shrink-0 text-danger`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[L?(0,G.jsx)(`div`,{className:`mono mb-0.5 truncate text-caption opacity-75`,children:L}):null,(0,G.jsx)(`p`,{className:`break-words line-clamp-3`,children:I})]})]})}),(0,G.jsx)(eL.Content,{children:(0,G.jsxs)(`div`,{className:`max-w-md whitespace-pre-wrap break-words`,children:[L?(0,G.jsx)(`div`,{className:`mono mb-1 text-caption opacity-75`,children:L}):null,I]})})]}):null]}),n&&e.enabled?(0,G.jsxs)(`section`,{ref:E,className:`grid gap-3 bg-surface-secondary/55 px-3 py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:o(`oauthDeviceFlow`)}),(0,G.jsx)(`p`,{className:`mt-1.5 text-caption leading-5 text-muted`,children:e.provider===`codex`?o(`wizardCodexBrowserLead`):o(`qoderLoginHint`)}),(0,G.jsx)(`div`,{className:`mt-2.5 flex flex-wrap gap-2`,children:e.provider===`codex`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(X,{size:`sm`,isPending:t===`device`,onPress:()=>c(`cli`),children:[(0,G.jsx)(Oa,{size:14}),o(`startCodexCliLogin`)]}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:t===`device`,onPress:()=>c(`chatgpt`),children:[(0,G.jsx)(Oa,{size:14}),o(`startCodexChatGPTLogin`)]})]}):(0,G.jsxs)(X,{size:`sm`,isPending:t===`device`,onPress:()=>c(),children:[(0,G.jsx)(Oa,{size:14}),o(`startBrowserLogin`)]})}),(e.provider===`trae`||e.provider===`codex`||e.provider===`devin`)&&f&&d?(0,G.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,G.jsx)(`p`,{className:`text-caption leading-4 text-muted`,children:o(`wizardCallbackLead`)}),(0,G.jsx)(mL,{className:`h-24 w-full resize-none font-mono text-caption leading-5`,value:u||``,onChange:e=>d(e.target.value),placeholder:o(`wizardCallbackPh`),"aria-label":o(`wizardCallbackPh`)}),(0,G.jsx)(X,{size:`sm`,variant:`secondary`,isPending:t===`callback`,onPress:f,children:o(`wizardSubmitCallback`)})]}):null]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:o(`patFallback`)}),(0,G.jsxs)(`div`,{className:`mt-2.5 flex flex-col gap-2 sm:flex-row`,children:[(0,G.jsxs)(hL,{className:`flex-1`,type:`password`,value:a,onChange:s,children:[(0,G.jsx)(sR,{className:`sr-only`,children:o(`pat`)}),(0,G.jsx)(lL,{placeholder:o(`pasteToken`),"aria-label":o(`pat`)})]}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:t===`pat`,onPress:l,children:[(0,G.jsx)(na,{size:14}),o(`usePat`)]})]})]}),r||i?(0,G.jsxs)(`div`,{className:`text-caption`,children:[r?(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-1 text-caption font-medium text-muted`,children:o(`authUrl`)}),(0,G.jsx)(`code`,{className:`mono block break-all text-foreground`,children:r}),(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,onPress:()=>window.open(r,`_blank`,`noopener,noreferrer`),children:[(0,G.jsx)(Qr,{size:14}),o(`openAuthUrl`)]}),(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:()=>{NQ(r).then(e=>{e&&(O(!0),window.setTimeout(()=>O(!1),1100))})},children:[(0,G.jsx)(MQ,{copied:D}),o(D?`copied`:`copy`)]})]})]}):null,i?(0,G.jsx)(`p`,{className:`mt-1 text-muted`,children:i}):null]}):null]}):null,b?(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-t border-separator px-4 py-2 text-caption text-muted`,children:[(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsxs)(`span`,{className:`flex cursor-help items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:o(`lastCheckin`)}),(0,G.jsx)(`span`,{className:R===`error`?`text-danger`:``,children:o(z)})]})}),(0,G.jsxs)(eL.Content,{children:[e.last_checkin_at?new Date(e.last_checkin_at).toLocaleString():o(`lastCheckinNone`),e.last_checkin_msg?` · ${e.last_checkin_msg}`:``]})]}),(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsxs)(`span`,{className:`flex cursor-help items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:o(`autoCheckin`)}),(0,G.jsx)(`span`,{className:`mono text-caption text-foreground/55`,children:e.checkin_time||_}),(0,G.jsx)(fQ,{isSelected:!!e.auto_checkin,isDisabled:!!t,ariaLabel:o(`autoCheckin`),onChange:e=>y?.(e)})]})}),(0,G.jsx)(eL.Content,{children:e.checkin_time?o(`checkinCustom`):o(`checkinInherit`)})]})]}):null,(0,G.jsxs)(zw.Footer,{className:`flex flex-wrap items-center gap-1.5 bg-surface-secondary px-4 py-2`,children:[m?(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`secondary`,isPending:t===`refresh`,onPress:m,"aria-label":o(`refreshAccount`),children:(0,G.jsx)(Jr,{size:15})})}),(0,G.jsx)(eL.Content,{children:o(`refreshAccount`)})]}):null,(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:n?`secondary`:`ghost`,isDisabled:!e.enabled,onPress:C,"aria-label":o(`authentication`),children:(0,G.jsx)(na,{size:15})})}),(0,G.jsx)(eL.Content,{children:o(`authentication`)})]}),(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,onPress:w,"aria-label":o(`accountModels`),children:(0,G.jsx)(Mi,{size:15})})}),(0,G.jsx)(eL.Content,{children:o(`accountModels`)})]}),(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,onPress:S,"aria-label":o(`editAccount`),children:(0,G.jsx)(ba,{size:15})})}),(0,G.jsx)(eL.Content,{children:o(`editAccount`)})]}),b?(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,isDisabled:!e.enabled||!!t,isPending:t===`checkin`,onPress:b,"aria-label":o(`checkinNow`),children:(0,G.jsx)(ci,{size:15})})}),(0,G.jsx)(eL.Content,{children:o(`checkinNow`)})]}):null,(0,G.jsxs)(nV,{children:[(0,G.jsx)(nV.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`secondary`,"aria-label":o(`more`),children:(0,G.jsx)(Ii,{size:16})})}),(0,G.jsx)(nV.Popover,{placement:`bottom end`,children:(0,G.jsxs)(nV.Menu,{"aria-label":o(`more`),onAction:e=>{e===`export`&&p(),e===`checkin-records`&&x?.(),e===`delete`&&h()},children:[e.auth_type===`none`?null:(0,G.jsxs)(nV.Item,{id:`export`,textValue:o(`export`),children:[(0,G.jsx)(Oi,{size:15}),o(`export`)]}),x?(0,G.jsxs)(nV.Item,{id:`checkin-records`,textValue:o(`checkinRecords`),children:[(0,G.jsx)(ca,{size:15}),o(`checkinRecords`)]}):null,(0,G.jsxs)(nV.Item,{id:`delete`,textValue:o(`delete`),className:`text-danger`,children:[(0,G.jsx)(Ja,{size:15}),o(`delete`)]})]})})]}),(0,G.jsx)(`div`,{className:`ml-auto flex shrink-0 flex-nowrap items-center gap-3 whitespace-nowrap`,children:(0,G.jsx)(fQ,{isSelected:!!e.enabled,isDisabled:t===`toggle`,ariaLabel:e.enabled?o(`disable`):o(`enable`),label:e.enabled?o(`enabledState`):o(`disabled`),onChange:g})})]})]})}function b$(e,t){return e.status===`success`?{label:t(`checkinRecordSuccess`),color:`success`}:e.status===`already`?{label:t(`checkinRecordAlready`),color:`warning`}:e.status===`skipped`?{label:t(`checkinRecordSkipped`),color:`default`}:{label:t(`checkinRecordFailed`),color:`danger`}}function x$(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function S$({account:e,t,onClose:n}){let[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(!!e?.id),[s,c]=(0,v.useState)(``),l=e?.id||``,u=t(`checkinRecordsTitle`,{name:e?.name||e?.id||``});async function d(){if(l){o(!0),c(``);try{let e=await iU(l);i(e.data||[])}catch(e){i([]),c(e instanceof Error?e.message:String(e))}finally{o(!1)}}}return(0,v.useEffect)(()=>{l&&d()},[l]),(0,G.jsx)(Z.Root,{isOpen:!!e,onOpenChange:e=>{e||n()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{size:`lg`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:u}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t(`checkinRecordsHint`)})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":t(`close`),className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Body,{className:`px-5 pb-2`,children:[s?(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(bU,{title:s})}):null,a?(0,G.jsxs)(`div`,{className:`space-y-2 py-1`,children:[(0,G.jsx)($,{className:`h-16 w-full`}),(0,G.jsx)($,{className:`h-16 w-full`}),(0,G.jsx)($,{className:`h-16 w-full`})]}):r.length?(0,G.jsx)(`div`,{className:`divide-y divide-separator overflow-hidden rounded-lg bg-surface-secondary`,children:r.map(e=>{let n=b$(e,t);return(0,G.jsxs)(`div`,{className:`flex items-start gap-3 px-3 py-3`,children:[(0,G.jsx)(`span`,{className:`status-dot mt-1.5 shrink-0`,"data-state":e.status===`error`?`warn`:`ok`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:n.color,children:n.label}),(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:x$(e.created_at)})]}),(0,G.jsx)(`p`,{className:`mt-1 break-words text-caption leading-5 text-foreground/75`,children:e.message||`—`})]})]},e.id)})}):(0,G.jsx)(pQ,{className:`min-h-44 rounded-3xl bg-surface-secondary`,title:t(`checkinRecordsEmpty`),hint:t(`checkinRecordsHint`)})]}),(0,G.jsxs)(Z.Footer,{className:`justify-between px-5 pb-5`,children:[(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:t(`checkinRecordsCount`,{count:r.length})}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:n,children:t(`close`)}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:a,onPress:()=>void d(),children:[(0,G.jsx)(Jr,{size:14}),t(`refresh`)]})]})]})]})})})})}function C$(e){let t=e.route_display_name||``;return t&&t!==(e.display_name||e.id)?t:``}function w$({account:e,t,onClose:n}){let[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(!!e?.id),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),d=e?.id||``,f=t(`accountModelsTitle`,{name:e?.name||e?.id||``}),p=e?EZ(e.provider,e.region,t):``;async function m(e=!1){if(d){e?c(!0):(o(!0),i([])),u(``);try{let t=await(e?qH(d):GH(d));i(t.data||[])}catch(e){i([]),u(e instanceof Error?e.message:String(e))}finally{o(!1),c(!1)}}}return(0,v.useEffect)(()=>{if(!d)return;let e=!1;return GH(d).then(t=>{e||(i(t.data||[]),u(``),o(!1))}).catch(t=>{e||(i([]),u(t instanceof Error?t.message:String(t)),o(!1))}),()=>{e=!0}},[d]),(0,G.jsx)(Z.Root,{isOpen:!!e,onOpenChange:e=>{e||n()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{size:`lg`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:f}),(0,G.jsx)(`p`,{className:`mt-1 text-caption font-normal leading-5 text-muted`,children:t(`accountModelsHint`)}),e?(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-caption text-muted`,children:[(0,G.jsx)(zZ,{provider:e.provider,size:14}),(0,G.jsx)(`span`,{children:p}),(0,G.jsx)(`span`,{className:`text-border`,children:`·`}),(0,G.jsx)(`span`,{className:`mono`,children:e.id})]}):null]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":t(`close`),className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Body,{className:`px-5 pb-2`,children:[l?(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(bU,{title:t(`accountModelsError`,{msg:l})})}):null,a||s?(0,G.jsxs)(`div`,{className:`space-y-2 py-1`,children:[(0,G.jsx)($,{className:`h-14 w-full`}),(0,G.jsx)($,{className:`h-14 w-full`}),(0,G.jsx)($,{className:`h-14 w-full`})]}):r.length?(0,G.jsx)(`ul`,{className:`divide-y divide-separator overflow-hidden rounded-lg bg-surface-secondary`,children:r.map(n=>{let r=n.provider||n.owned_by||e?.provider||`qoder`,i=C$(n),a=fX(n),o=pX(n);return(0,G.jsxs)(`li`,{className:`flex items-start gap-3 px-3 py-2.5`,children:[(0,G.jsx)(`span`,{className:`status-dot mt-1.5`,"data-state":n.stale?void 0:`ok`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`truncate text-body font-medium`,children:n.display_name||n.id}),o?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`success`,children:t(`modelFree`)}):null,a?(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:a}):null,n.stale?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`warning`,children:t(`fallback`)}):null]}),(0,G.jsx)(`div`,{className:`mono mt-0.5 truncate text-caption text-muted`,children:n.id}),i?(0,G.jsx)(`div`,{className:`mt-0.5 text-caption text-muted`,children:t(`routedTo`,{model:i})}):null]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 pt-0.5 text-caption text-muted`,children:[(0,G.jsx)(zZ,{provider:r,size:12}),(0,G.jsx)(`span`,{children:r})]})]},n.id)})}):(0,G.jsx)(pQ,{className:`min-h-48 rounded-3xl bg-surface-secondary`,icon:(0,G.jsx)(Mi,{size:22}),title:t(`accountModelsEmpty`),hint:t(`noModelsYet`)})]}),(0,G.jsxs)(Z.Footer,{className:`justify-between px-5 pb-5`,children:[(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:a?t(`refreshing`):t(`shownTotal`,{shown:r.length,total:r.length})}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:n,children:t(`close`)}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:s,onPress:()=>void m(!0),children:[(0,G.jsx)(Jr,{size:14}),t(s?`refreshing`:`refresh`)]})]})]})]})})})})}var T$=`w-28`;function E$({label:e,hint:t,labelWidthClass:n=T$,htmlFor:r,align:i=`center`,children:a}){return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex gap-3 ${i===`start`?`items-start`:`items-center`}`,children:[(0,G.jsx)(sR,{htmlFor:r,className:`${n} shrink-0 ${i===`start`?`pt-2`:``} text-body font-medium text-foreground`,children:e}),(0,G.jsx)(`div`,{className:`min-w-0 flex-1 [&_[data-slot=input]]:w-full [&_[data-slot=textarea]]:w-full`,children:a})]}),t?(0,G.jsx)(`p`,{className:`mt-1.5 pl-[7.75rem] text-caption leading-5 text-muted`,children:t}):null]})}function D$({catalog:e,selected:t,onChange:n,isDisabled:r,t:i}){let[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(t),l=(0,v.useMemo)(()=>new Set(t),[t]),u=(0,v.useMemo)(()=>{let t=new Set(s),n=a.trim().toLowerCase(),r=(e||[]).filter(e=>!n||e.toLowerCase().includes(n));return[...r.filter(e=>t.has(e)),...r.filter(e=>!t.has(e))]},[e,a,s]),d=(0,v.useMemo)(()=>{if(!e)return[];let n=new Set(e);return t.filter(e=>!n.has(e))},[e,t]),f=e?.length??0,p=t.filter(e=>!d.includes(e)).length;function m(e){o(e),c(t)}function h(e,r){n(r?[...t,e]:t.filter(t=>t!==e))}function g(){let e=new Set(t);u.forEach(t=>e.add(t)),n([...e])}function _(){let e=new Set(u);n(t.filter(t=>!e.has(t)))}return(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(aR,{"aria-label":i(`modelPickerSearch`),value:a,onChange:m,isDisabled:r,className:`min-w-0 flex-1 basis-48`,children:(0,G.jsxs)(aR.Group,{children:[(0,G.jsx)(aR.SearchIcon,{}),(0,G.jsx)(aR.Input,{placeholder:i(`modelPickerSearch`)}),(0,G.jsx)(aR.ClearButton,{})]})}),(0,G.jsx)(`span`,{className:`mono shrink-0 text-caption text-muted`,children:i(`modelPickerCount`,{selected:p,total:f})}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,isDisabled:r||u.length===0,onPress:g,children:[(0,G.jsx)(Si,{size:14}),i(`modelPickerSelectAll`)]}),(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,isDisabled:r||t.length===0,onPress:_,children:[(0,G.jsx)(Ra,{size:14}),i(`modelPickerClear`)]})]})]}),(0,G.jsxs)(`div`,{className:`max-h-[300px] overflow-y-auto overscroll-contain rounded-lg bg-surface-secondary p-1`,children:[e===null?(0,G.jsx)(`p`,{className:`px-2.5 py-2 text-caption text-muted`,children:i(`refreshing`)}):null,d.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-2.5 py-1.5`,children:[(0,G.jsx)(`span`,{className:`mono min-w-0 flex-1 truncate text-body text-muted line-through`,children:e}),(0,G.jsx)(`span`,{className:`shrink-0 text-caption text-warning`,children:i(`modelPickerOffline`)}),(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,isDisabled:r,"aria-label":i(`modelPickerRemove`,{model:e}),onPress:()=>h(e,!1),children:(0,G.jsx)(oo,{size:14})})]},`offline-${e}`)),u.map(e=>(0,G.jsx)(aT,{isSelected:l.has(e),isDisabled:r,onChange:t=>h(e,t),className:`flex w-full cursor-pointer rounded-md px-2.5 py-1.5 transition-colors hover:bg-default`,children:(0,G.jsxs)(aT.Content,{className:`flex min-w-0 flex-1 items-center gap-2.5`,children:[(0,G.jsx)(aT.Control,{children:(0,G.jsx)(aT.Indicator,{})}),(0,G.jsx)(`span`,{className:`mono min-w-0 truncate text-body text-foreground`,children:e})]})},e)),e!==null&&u.length===0?(0,G.jsx)(`p`,{className:`px-2.5 py-2 text-caption text-muted`,children:i(f===0?`noAccountModels`:`modelPickerNoMatch`)}):null]})]})}function O$(e){let[t,n]=(0,v.useState)(e);e&&!t&&n(!0);let r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(e);return(0,v.useLayoutEffect)(()=>{let t=r.current,o=i.current;if(!t||!o)return;if(a.current){a.current=!1;return}eY.killTweensOf([t,o]);let s=t.getBoundingClientRect().height;if(e){eY.set(t,{overflow:`hidden`});let e=t.scrollHeight;eY.fromTo(t,{height:s===e?0:s},{height:e,duration:aY(tY.base),ease:nY.out,onComplete:()=>eY.set(t,{clearProps:`height,overflow`})}),eY.fromTo(o,{autoAlpha:0,y:-6},{autoAlpha:1,y:0,duration:aY(tY.base),ease:nY.out})}else eY.set(t,{overflow:`hidden`,height:s}),eY.to(o,{autoAlpha:0,y:-4,duration:aY(tY.fast),ease:nY.inOut}),eY.to(t,{height:0,duration:aY(tY.fast+.04),ease:nY.inOut,onComplete:()=>n(!1)});return()=>{eY.killTweensOf([t,o])}},[e,t]),{mounted:t,outerRef:r,innerRef:i}}function k$({account:e,checkinDefaultTime:t,checkinTimezone:n,busy:r,t:i,onClose:a,onSave:o}){let[s,c]=(0,v.useState)(e?.name||``),[l,u]=(0,v.useState)(e?.max_inflight??4),[d,f]=(0,v.useState)(e?.priority??50),[p,m]=(0,v.useState)(e?.proxy_url||``),[h,g]=(0,v.useState)(!!e?.drop_system_prompt),[_,y]=(0,v.useState)(Object.entries(e?.model_aliases||{}).map(([e,t])=>({alias:e,model:t}))),[b,x]=(0,v.useState)({alias:``,model:``}),[S,C]=(0,v.useState)(!!e?.models_restricted),[w,T]=(0,v.useState)(e?.enabled_models||[]),{mounted:E,outerRef:D,innerRef:O}=O$(S),[k,A]=(0,v.useState)(null),[j,M]=(0,v.useState)(!e?.checkin_time),[N,P]=(0,v.useState)(e?.checkin_time||null),[ee,F]=(0,v.useState)(``);(0,v.useEffect)(()=>{if(!e?.id)return;let t=!1;return GH(e.id).then(e=>{t||A(e.data||[])}).catch(()=>{t||A([])}),()=>{t=!0}},[e?.id]);let I=i(`editAccountTitle`,{name:e?.name||e?.id||``}),L=e?EZ(e.provider,e.region,i):``;async function te(n){n?.preventDefault();let r=s.trim();if(!r){F(i(`accountNameRequired`));return}if(!Number.isInteger(l)||l<1||l>32){F(i(`maxInflightInvalid`));return}if(!Number.isInteger(d)||d<1||d>100){F(i(`priorityInvalid`));return}if(t!==void 0&&!j&&!/^([01]\d|2[0-3]):[0-5]\d$/.test(N??t)){F(i(`checkinTimeInvalid`));return}F(``);try{await o({name:r,max_inflight:l,priority:d,proxy_url:p.trim(),checkin_time:t===void 0?void 0:j?``:N??t,drop_system_prompt:e?.provider===`workbuddy`?h:void 0,model_aliases:Object.fromEntries(_.filter(e=>e.alias.trim()&&e.model.trim()).map(e=>[e.alias.trim(),e.model.trim()])),enabled_models:S?w:[],set_model_routing:!0}),a()}catch(e){F(e instanceof Error?e.message:String(e))}}return(0,G.jsx)(Z.Root,{isOpen:!!e,onOpenChange:e=>{!e&&!r&&a()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`lg`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{className:`w-full sm:w-[42rem] sm:max-w-[calc(100vw-2rem)]`,children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-6 pt-6`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:I}),(0,G.jsx)(`p`,{className:`mt-1.5 text-body font-normal leading-6 text-muted`,children:i(`editAccountHint`)}),e?(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(lT,{size:`sm`,variant:`soft`,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(zZ,{provider:e.provider,size:14}),(0,G.jsx)(`span`,{children:L})]})}),(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:e.id})]}):null]}),(0,G.jsx)(Z.CloseTrigger,{isDisabled:r,"aria-label":i(`close`),className:`grid size-9 shrink-0 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:18})})]}),(0,G.jsxs)(Z.Body,{className:`px-6 pb-2 pt-1`,children:[ee?(0,G.jsxs)(RB,{status:`danger`,className:`mb-4`,children:[(0,G.jsx)(RB.Indicator,{}),(0,G.jsx)(RB.Content,{children:(0,G.jsx)(RB.Title,{children:ee})})]}):null,(0,G.jsxs)(FB,{className:`space-y-4`,onSubmit:e=>void te(e),children:[(0,G.jsx)(E$,{label:i(`accountName`),children:(0,G.jsx)(lL,{value:s,onChange:e=>c(e.target.value),placeholder:i(`wizardNamePh`),"aria-label":i(`accountName`),disabled:r,autoFocus:!0})}),(0,G.jsx)(E$,{label:i(`maxInflight`),hint:i(`maxInflightHint`),children:(0,G.jsx)(sV,{value:l,onChange:e=>u(e??4),minValue:1,maxValue:32,isDisabled:r,isRequired:!0,children:(0,G.jsxs)(sV.Group,{children:[(0,G.jsx)(sV.DecrementButton,{}),(0,G.jsx)(sV.Input,{"aria-label":i(`maxInflight`)}),(0,G.jsx)(sV.IncrementButton,{})]})})}),(0,G.jsx)(E$,{label:i(`priority`),hint:i(`priorityHint`),children:(0,G.jsx)(sV,{value:d,onChange:e=>f(e??50),minValue:1,maxValue:100,isDisabled:r,isRequired:!0,children:(0,G.jsxs)(sV.Group,{children:[(0,G.jsx)(sV.DecrementButton,{}),(0,G.jsx)(sV.Input,{"aria-label":i(`priority`)}),(0,G.jsx)(sV.IncrementButton,{})]})})}),(0,G.jsx)(E$,{label:i(`proxyUrl`),hint:i(`proxyUrlHint`),children:(0,G.jsx)(lL,{value:p,onChange:e=>m(e.target.value),placeholder:i(`proxyUrlPlaceholder`),"aria-label":i(`proxyUrl`),disabled:r})}),e?.provider===`workbuddy`?(0,G.jsx)(E$,{label:i(`dropSystemPrompt`),hint:i(`dropSystemPromptHint`),children:(0,G.jsx)(fQ,{isSelected:h,isDisabled:r,ariaLabel:i(`dropSystemPrompt`),onChange:g})}):null,(0,G.jsx)(E$,{align:`start`,label:i(`accountModelAliases`),hint:i(`accountModelAliasesHint`),children:(0,G.jsxs)(`div`,{className:`space-y-2`,children:[_.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsxs)(`span`,{className:`mono min-w-0 truncate text-body`,children:[e.alias,` → `,e.model]}),(0,G.jsx)(X,{size:`sm`,variant:`ghost`,isDisabled:r,onPress:()=>y(t=>t.filter(t=>t.alias!==e.alias)),children:i(`modelAliasRemove`)})]},e.alias)),(0,G.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_1fr_auto]`,children:[(0,G.jsx)(lL,{"aria-label":i(`modelAliasName`),value:b.alias,onChange:e=>x(t=>({...t,alias:e.target.value})),placeholder:i(`modelAliasPlaceholder`),disabled:r}),(0,G.jsx)(lL,{"aria-label":i(`modelAliasTarget`),value:b.model,onChange:e=>x(t=>({...t,model:e.target.value})),placeholder:i(`accountModelAliasTargetPlaceholder`),disabled:r}),(0,G.jsx)(X,{size:`sm`,variant:`secondary`,isDisabled:r||!b.alias.trim()||!b.model.trim(),onPress:()=>{y(e=>[...e.filter(e=>e.alias!==b.alias.trim()),{alias:b.alias.trim(),model:b.model.trim()}]),x({alias:``,model:``})},children:i(`modelAliasAdd`)})]})]})}),(0,G.jsxs)(`section`,{className:`space-y-3 pt-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-foreground`,children:i(`enabledModels`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption leading-5 text-muted`,children:i(`enabledModelsHint`)})]}),(0,G.jsx)(fQ,{isSelected:S,isDisabled:r,ariaLabel:i(`restrictModels`),label:i(S?`restrictModels`:`allModels`),onChange:C})]}),E?(0,G.jsx)(`div`,{ref:D,children:(0,G.jsx)(`div`,{ref:O,children:(0,G.jsx)(D$,{catalog:k?k.map(e=>e.id):null,selected:w,onChange:T,isDisabled:r,t:i})})}):null]}),t===void 0?null:(0,G.jsx)(E$,{label:i(`autoCheckinTime`),hint:i(`checkinScheduleHint`),children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)(fQ,{isSelected:j,isDisabled:r,onChange:M,ariaLabel:i(`checkinInherit`),label:i(`checkinInherit`)}),(0,G.jsxs)(`p`,{className:`text-caption text-muted`,children:[i(`checkinDefaultValue`,{time:t}),` · `,(0,G.jsx)(`span`,{className:`mono`,children:n})]}),j?null:(0,G.jsx)(lL,{type:`time`,value:N??t,onChange:e=>P(e.target.value),"aria-label":i(`autoCheckinTime`),disabled:r,required:!0})]})})]})]}),(0,G.jsxs)(Z.Footer,{className:`justify-end gap-2 px-6 pb-6`,children:[(0,G.jsx)(X,{variant:`ghost`,isDisabled:r,onPress:a,children:i(`cancel`)}),(0,G.jsx)(X,{isPending:r,onPress:()=>void te(),children:i(`save`)})]})]})})})})}var A$={1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-3`};function j$({options:e,value:t,onChange:n,ariaLabel:r,columns:i=2,className:a=``}){let o=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{let e=o.current;if(!e)return;let t=eY.context(()=>{let e=eY.matchMedia();e.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(`[data-option-tile]`,{autoAlpha:1,y:0})}),e.add(`(prefers-reduced-motion: no-preference)`,()=>{eY.fromTo(`[data-option-tile]`,{autoAlpha:0,y:8},{autoAlpha:1,y:0,duration:.32,stagger:.035,ease:`power3.out`,overwrite:!0})})},e);return()=>t.revert()},[e.length]),(0,G.jsx)(`div`,{ref:o,role:`radiogroup`,"aria-label":r,className:`grid gap-3 ${A$[i]} ${a}`.trim(),children:e.map(e=>{let r=e.value===t;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-option-tile":``,"data-selected":r||void 0,disabled:e.disabled,title:e.hint,onClick:()=>n(e.value),className:`flex h-16 min-w-0 items-center gap-3 rounded-xl bg-surface shadow-surface px-4 text-left transition-colors hover:bg-surface-secondary disabled:cursor-not-allowed disabled:opacity-50 data-selected:border-accent data-selected:bg-accent-soft`,children:[e.icon?(0,G.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground [&_svg]:size-[18px]`,children:e.icon}):null,(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body font-medium leading-5 text-foreground`,children:e.label})]},e.value)})})}function M$(e,t){let n={...e},r=n.format===`workbuddy-accounts`||Array.isArray(n.accounts);return n.format?r&&(n.format=`workbuddy-accounts`):n.format=r?`workbuddy-accounts`:`workbuddy-oauth-v1`,{...n,name:t.name?.trim()||n.name,enabled:t.enabled??!0,provider:`workbuddy`,region:t.region,max_inflight:t.max_inflight??4,priority:t.priority??50,drop_system_prompt:t.drop_system_prompt??!0,...t.proxy_url!=null&&t.proxy_url!==``?{proxy_url:t.proxy_url}:{}}}function N$(e,t){let n=typeof e?.succeeded==`number`?e.succeeded:e?.id||e?1:0,r=typeof e?.failed==`number`?e.failed:0,i=(e?.errors||[]).slice(0,3).map(e=>e.message||`index ${e.index}`).filter(Boolean).join(`; `),a;return a=r>0?t(`accountImportPartial`).replace(`{ok}`,String(n)).replace(`{fail}`,String(r))+(i?` — ${i}`:``):n>1?t(`accountImportBatch`).replace(`{n}`,String(n)):t(`accountImported`),{succeeded:n,failed:r,message:a}}async function P$(e,t){return sU(M$(e,t))}var F$={global:`Global`,cn:`CN`},I$={"qoder-global":`accountTypeQoderGlobal`,"qoder-cn":`accountTypeQoderCN`,"workbuddy-cn":`accountTypeWorkBuddyCN`,"workbuddy-global":`accountTypeWorkBuddyGlobal`,"trae-cn":`accountTypeTraeCN`,"devin-global":`accountTypeDevinGlobal`,"command-global":`accountTypeCommandGlobal`,"codex-global":`accountTypeCodexGlobal`,"zhipu-cn":`accountTypeZhipuCN`,"qwenwork-global":`accountTypeQwenworkGlobal`,"qwenwork-cn":`accountTypeQwenworkCN`,"kimi-cn":`accountTypeKimiCN`},L$={"qoder-global":`accountTypeQoderGlobalHint`,"qoder-cn":`accountTypeQoderCNHint`,"workbuddy-cn":`accountTypeWorkBuddyCNHint`,"workbuddy-global":`accountTypeWorkBuddyGlobalHint`,"trae-cn":`accountTypeTraeCNHint`,"devin-global":`accountTypeDevinGlobalHint`,"command-global":`accountTypeCommandGlobalHint`,"codex-global":`accountTypeCodexGlobalHint`,"zhipu-cn":`accountTypeZhipuCNHint`,"qwenwork-global":`accountTypeQwenworkGlobalHint`,"qwenwork-cn":`accountTypeQwenworkCNHint`,"kimi-cn":`accountTypeKimiCNHint`};function R$({ariaLabel:e}){return(0,G.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,"aria-busy":`true`,"aria-label":e,children:Array.from({length:6},(e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-xl bg-surface-secondary px-3 py-2.5`,children:[(0,G.jsx)(qP,{className:`size-7 shrink-0 rounded-lg`}),(0,G.jsx)(qP,{className:`h-4 w-20 rounded-lg`})]},t))})}async function z$(){let e=(await tU().catch(()=>null))?.data||[],t=[];for(let n of e)for(let e of n.regions)t.push({id:`${n.id}-${e.id}`,provider:n.id,region:e.id,descriptor:n});return t}function B$(e,t){let n=I$[e.id];if(n){let e=t(n);if(e!==n)return e}let r=e.descriptor.regions.find(t=>t.id===e.region)?.label||F$[e.region]||``,i=e.descriptor.regions.length>1&&r?` ${r}`:``;return`${e.descriptor.label}${i}`.trim()}function V$(e,t){if(!e)return``;let n=L$[e.id];if(!n)return``;let r=t(n);return r===n?``:r}function H$({phase:e,busy:t,tab:n,forTab:r}){return e===`done`?(0,G.jsx)(bi,{size:16,className:`text-success`}):t&&n===r?(0,G.jsx)(uY,{size:16,loading:!0}):null}var U$=90,W$=2e3;function G$({isOpen:e,onClose:t,onAdded:n}){let{t:r}=DH(),[i,a]=(0,v.useState)(`method`),[o,s]=(0,v.useState)(`browser`),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(4),[x,S]=(0,v.useState)(50),[C,w]=(0,v.useState)(!0),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(`payg`),[N,P]=(0,v.useState)(``),[ee,F]=(0,v.useState)(``),[I,L]=(0,v.useState)(``),[te,R]=(0,v.useState)(`idle`),[z,B]=(0,v.useState)(``),[ne,re]=(0,v.useState)(``),[ie,V]=(0,v.useState)(!1),[ae,oe]=(0,v.useState)(``),[se,ce]=(0,v.useState)(`cli`),le=(0,v.useRef)(null),ue=(0,v.useRef)(null),de=(0,v.useRef)(null),fe=(0,v.useRef)(``),pe=(0,v.useRef)(null),me=(0,v.useRef)(null);function he(){pe.current!==null&&(window.clearTimeout(pe.current),pe.current=null)}(0,v.useEffect)(()=>()=>he(),[]),(0,v.useEffect)(()=>{if(!e)return;let t=!1;return p(!0),d([]),l(``),z$().then(e=>{t||(d(e),l(e[0]?.id||``),s(`browser`))}).finally(()=>{t||p(!1)}),()=>{t=!0}},[e]);let ge=u.find(e=>e.id===c),_e=!!ge&&!f,ve=ge?.descriptor.capabilities?.pat_login!==!1,ye=ge?.descriptor.capabilities?.import_export!==!1,be=ge?.descriptor.capabilities?.browser_login!==!1,xe=ge?.provider===`workbuddy`,Se=ge?.provider===`trae`||ge?.provider===`devin`||ge?.provider===`codex`,Ce=te===`busy`||te===`polling`,we=!!fe.current||Ce,Te=te===`done`,Ee=V$(ge,r);(0,v.useEffect)(()=>{o===`pat`&&!ve&&s(`browser`),o===`import`&&!ye&&s(`browser`)},[ye,ve,o]),(0,v.useEffect)(()=>{be||(ve?s(`pat`):ye&&s(`import`))},[be,ye,ve]);function De(){return!Number.isInteger(y)||y<1||y>32?4:y}function Oe(){return!Number.isInteger(x)||x<1||x>100?50:x}function ke(){return{max_inflight:De(),priority:Oe(),drop_system_prompt:xe?C:ge?.provider!==`kimi`,proxy_url:T.trim()}}function Ae(){he(),a(`method`),s(`browser`),l(``),d([]),p(!1),_(``),b(4),S(50),w(!0),E(``),O(``),A(``),M(`payg`),P(``),F(``),L(``),h(!1),R(`idle`),B(``),re(``),V(!1),oe(``),ce(`cli`),fe.current=``}function je(){Ce||(Ae(),t())}function Me(){Ae(),t()}(0,v.useLayoutEffect)(()=>{let t=le.current;if(e||(de.current=null),!t||!e)return;let n=eY.context(()=>{let e=eY.matchMedia();e.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(t,{autoAlpha:1,x:0,y:0})}),e.add(`(prefers-reduced-motion: no-preference)`,()=>{let e=de.current,n=e&&e!==i?i===`login`?1:-1:0;eY.fromTo(t,{autoAlpha:0,x:20*n,y:n?0:12},{autoAlpha:1,x:0,y:0,duration:tY.slow,ease:nY.out,overwrite:!0}),n&&ue.current&&eY.fromTo(ue.current,{autoAlpha:0,y:6},{autoAlpha:1,y:0,duration:tY.base,ease:nY.out,overwrite:!0})})},t);return de.current=i,()=>n.revert()},[e,i]);function Ne(e){if(Ce||!_e)return;let t=u.find(t=>t.id===e);l(e),s(t?.provider===`zhipu`?`pat`:`browser`),B(``),a(`login`)}async function Pe(){if(fe.current)return fe.current;if(!ge)throw Error(r(`accountTypeHint`));let e=ke(),t=await nU(g.trim()||r(`account`),ge.provider,ge.region,e),n=t?.id||t?.data?.id;if(!n)throw Error(`create account returned no id`);return fe.current=n,n}async function Fe(){B(``),re(``);try{R(`busy`);let e=await Pe();B(r(`wizardStartingSession`)),R(`polling`);let t=await RH(e,ge?.provider===`codex`?se:void 0);t.authUrl&&re(t.authUrl),B(r(`wizardWaitingBrowser`));for(let t=0;t{pe.current=window.setTimeout(e,W$)});let n=(await zH(e)).login||{};if(n.message&&B(n.message),n.status===`ok`)break;if(n.status===`error`)throw Error(n.message||`login failed`);if(t===89)throw Error(r(`wizardLoginTimeout`))}R(`done`),B(r(`wizardAccountReady`)),n(),window.setTimeout(Me,900)}catch(e){R(`idle`),B(e instanceof Error?e.message:String(e))}}async function Ie(){let e=ae.trim();if(!e){B(r(`wizardCallbackPh`));return}try{R(`busy`);let t=await Pe();he(),await BH(t,e),R(`done`),B(r(`wizardAccountReady`)),n(),window.setTimeout(Me,900)}catch(e){R(`polling`),B(e instanceof Error?e.message:String(e))}}async function Le(){let e=N.trim();if(!e){B(r(`zhipuKeyRequired`));return}if(!ge){B(r(`accountTypeHint`));return}B(``);try{R(`busy`);let t=ke();await sU({format:`zhipu-key-v1`,api_key:e,mode:j,organization:j===`coding`?ee.trim():``,project:j===`coding`?I.trim():``,name:g.trim()||r(`accountTypeZhipuCN`),enabled:!0,provider:ge.provider,region:ge.region,max_inflight:t.max_inflight,priority:t.priority,drop_system_prompt:t.drop_system_prompt,proxy_url:t.proxy_url}),R(`done`),B(r(`wizardAccountReady`)),n(),window.setTimeout(Me,700)}catch(e){R(`idle`),B(e instanceof Error?e.message:String(e))}}async function Re(){let e=D.trim();if(!e){B(r(`pastePatFirst`));return}B(``);try{R(`busy`);let t=await Pe();B(r(`wizardStartingSession`)),await VH(e,t),R(`done`),B(r(`patDone`)),n(),window.setTimeout(Me,700)}catch(e){R(`idle`),B(e instanceof Error?e.message:String(e))}}async function ze(){B(``);let e;try{e=JSON.parse(k)}catch{B(r(`wizardBadJson`));return}if(!e||typeof e!=`object`){B(r(`wizardBadJson`));return}if(!ge){B(r(`accountTypeHint`));return}if(ge.provider===`qoder`&&(typeof e.user_blob!=`string`||typeof e.machine_id!=`string`)){B(r(`wizardBadJson`));return}let t=ke(),i;ge.provider===`workbuddy`?i=M$(e,{region:ge.region===`global`?`global`:`cn`,name:g.trim()||void 0,enabled:!0,max_inflight:t.max_inflight,priority:t.priority,drop_system_prompt:t.drop_system_prompt,proxy_url:t.proxy_url}):(e.format||(ge.descriptor.id===`trae`?e.format=`trae-oauth-v1`:ge.descriptor.id===`devin`?e.format=`devin-session-v1`:ge.descriptor.id===`command`?e.format=`command-key-v1`:ge.descriptor.id===`qwenwork`?e.format=`qwenwork-oauth-v1`:e.format=`qoder-native-v1`),i={...e,name:g.trim()||e.name,enabled:!0,provider:ge.provider,region:ge.region,max_inflight:t.max_inflight,priority:t.priority,drop_system_prompt:t.drop_system_prompt});try{R(`busy`);let{failed:e,message:t}=N$(await sU(i),r);R(`done`),B(t),n(),window.setTimeout(Me,e>0?1600:700)}catch(e){R(`idle`),B(e instanceof Error?e.message:String(e))}}function Be(){me.current?.click()}function Ve(e){let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>A(String(n.result||``)),n.readAsText(t),e.target.value=``}let He=e=>Ce&&o===e,Ue=u.map(e=>({value:e.id,label:B$(e,r),hint:V$(e,r),icon:(0,G.jsx)(zZ,{provider:e.provider,size:18}),disabled:we})),We=ge?.provider===`zhipu`,Ge=[ge?.descriptor.capabilities?.browser_login===!1?null:{value:`browser`,label:r(`tabBrowser`),icon:(0,G.jsx)(Oa,{size:16})},ve?{value:`pat`,label:r(`tabPat`),icon:(0,G.jsx)(na,{size:16})}:null,ye?{value:`import`,label:r(`tabImport`),icon:(0,G.jsx)(Hi,{size:16})}:null].filter(Boolean),Ke=r(o===`browser`?ge?.provider===`codex`?`wizardCodexBrowserLead`:`wizardBrowserLead`:o===`pat`?ge?.provider===`command`?`wizardPatLeadCommand`:ge?.region===`cn`&&ge?.provider===`qoder`?`wizardPatLeadCN`:`wizardPatLead`:`wizardImportLead`);return(0,G.jsx)(Z.Root,{isOpen:e,onOpenChange:e=>{e||je()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,isDismissable:!Ce,children:(0,G.jsx)(Z.Container,{size:`lg`,scroll:`inside`,className:`sm:max-w-4xl`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`relative items-center justify-center px-12 pt-5 text-center`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:r(`addAccountTitle`)}),(0,G.jsx)(`p`,{ref:ue,className:`mt-1 text-caption font-normal leading-5 text-muted`,children:i===`method`?r(`addAccountDesc`):Ee||r(`addAccountDesc`)})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":r(`close`),className:`absolute right-4 top-4 grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsx)(Z.Body,{className:`px-6 pb-2`,children:(0,G.jsx)(`div`,{ref:le,children:i===`method`?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(`section`,{className:`space-y-2.5`,children:f?(0,G.jsx)(R$,{ariaLabel:r(`accountType`)}):_e?(0,G.jsx)(j$,{ariaLabel:r(`accountType`),columns:2,value:``,onChange:Ne,options:Ue}):(0,G.jsx)(`p`,{className:`rounded-lg bg-surface-secondary/45 px-3.5 py-3 text-caption leading-5 text-muted`,children:r(`accountTypeHint`)})})}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg bg-surface-secondary/45 px-3 py-2.5`,children:[(0,G.jsx)(`span`,{className:`shrink-0`,children:(0,G.jsx)(zZ,{provider:ge?.provider,size:18})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`truncate text-body font-medium text-foreground`,children:ge?B$(ge,r):r(`accountType`)}),(0,G.jsx)(`div`,{className:`truncate text-caption text-muted`,children:Ee})]}),(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:()=>a(`method`),isDisabled:Ce||!!fe.current,children:[(0,G.jsx)(ui,{size:12}),r(`wizardBack`)]})]}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,G.jsx)(E$,{label:r(`accountName`),children:(0,G.jsx)(lL,{value:g,onChange:e=>_(e.target.value),placeholder:r(`wizardNamePh`),"aria-label":r(`accountName`),disabled:we,autoFocus:!0})}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>h(e=>!e),"aria-expanded":m,className:`inline-flex items-center gap-1 text-caption font-medium text-muted transition-colors hover:text-foreground`,children:[(0,G.jsx)(fi,{size:12,className:`transition-transform duration-200 ${m?`rotate-90`:``}`}),r(`wizardAdvanced`)]}),m?(0,G.jsxs)(`div`,{className:`space-y-3 rounded-lg bg-surface-secondary px-3.5 py-3.5`,children:[(0,G.jsx)(E$,{label:r(`maxInflight`),hint:r(`maxInflightHint`),children:(0,G.jsx)(sV,{value:y,onChange:e=>b(e??4),minValue:1,maxValue:32,isDisabled:we,isRequired:!0,children:(0,G.jsxs)(sV.Group,{children:[(0,G.jsx)(sV.DecrementButton,{}),(0,G.jsx)(sV.Input,{"aria-label":r(`maxInflight`)}),(0,G.jsx)(sV.IncrementButton,{})]})})}),(0,G.jsx)(E$,{label:r(`priority`),hint:r(`priorityHint`),children:(0,G.jsx)(sV,{value:x,onChange:e=>S(e??50),minValue:1,maxValue:100,isDisabled:we,isRequired:!0,children:(0,G.jsxs)(sV.Group,{children:[(0,G.jsx)(sV.DecrementButton,{}),(0,G.jsx)(sV.Input,{"aria-label":r(`priority`)}),(0,G.jsx)(sV.IncrementButton,{})]})})}),(0,G.jsx)(E$,{label:r(`proxyUrl`),hint:r(`proxyUrlHint`),children:(0,G.jsx)(lL,{value:T,onChange:e=>E(e.target.value),placeholder:r(`proxyUrlPlaceholder`),"aria-label":r(`proxyUrl`),disabled:we})}),xe?(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-muted`,children:r(`dropSystemPrompt`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption leading-5 text-muted`,children:r(`dropSystemPromptCreateHint`)})]}),(0,G.jsx)(fQ,{isSelected:C,isDisabled:we,ariaLabel:r(`dropSystemPrompt`),onChange:w})]}):null]}):null]}),We?(0,G.jsxs)(`div`,{className:`mt-4 flex flex-col gap-4`,children:[(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`span`,{className:`text-body font-medium text-muted`,children:r(`zhipuAccountMode`)}),(0,G.jsx)(j$,{ariaLabel:r(`zhipuAccountMode`),columns:2,value:j,onChange:e=>{Ce||M(e)},options:[{value:`payg`,label:r(`zhipuModePayg`),hint:r(`zhipuModePaygHint`),disabled:Ce},{value:`coding`,label:r(`zhipuModeCoding`),hint:r(`zhipuModeCodingHint`),disabled:Ce}]})]}),(0,G.jsx)(E$,{label:r(`zhipuApiKey`),children:(0,G.jsx)(lL,{type:`password`,value:N,onChange:e=>P(e.target.value),placeholder:r(`zhipuApiKeyPh`),"aria-label":r(`zhipuApiKey`),disabled:Ce})}),j===`coding`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(E$,{label:r(`zhipuOrganization`),children:(0,G.jsx)(lL,{value:ee,onChange:e=>F(e.target.value),placeholder:r(`zhipuOrganizationPh`),"aria-label":r(`zhipuOrganization`),disabled:Ce})}),(0,G.jsx)(E$,{label:r(`zhipuProject`),children:(0,G.jsx)(lL,{value:I,onChange:e=>L(e.target.value),placeholder:r(`zhipuProjectPh`),"aria-label":r(`zhipuProject`),disabled:Ce})})]}):null,z?(0,G.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-surface-secondary px-3 py-2 text-caption`,children:[Te?(0,G.jsx)(bi,{size:14,className:`shrink-0 text-success`}):null,(0,G.jsx)(`span`,{className:Te?`font-medium text-foreground`:`text-muted`,children:z})]}):null,(0,G.jsx)(X,{className:`w-full`,isPending:te===`busy`,onPress:()=>void Le(),isDisabled:Te,children:Te?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(bi,{size:15}),r(`wizardAccountReady`)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(na,{size:15}),r(`zhipuCreate`)]})})]}):null,We?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(qX,{className:`mt-3`,value:o,onChange:e=>{!Ce&&e!==o&&(s(e),B(``),re(``),V(!1))},ariaLabel:r(`authentication`),options:Ge.map(e=>({id:e.value,label:e.label,icon:e.icon}))}),(0,G.jsx)(`p`,{className:`mt-2 min-h-5 text-caption leading-5 text-muted`,children:Ke}),(0,G.jsx)(`div`,{className:`mt-3 flex flex-col gap-4`,children:o===`browser`?(0,G.jsxs)(G.Fragment,{children:[ge?.provider===`codex`?(0,G.jsx)(j$,{ariaLabel:r(`codexLoginMethod`),columns:2,value:se,onChange:e=>{Ce||ce(e)},options:[{value:`cli`,label:r(`codexLoginCli`),hint:r(`codexLoginCliHint`),disabled:Ce||!!fe.current},{value:`chatgpt`,label:r(`codexLoginChatGPT`),hint:r(`codexLoginChatGPTHint`),disabled:Ce||!!fe.current}]}):null,ne?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-3 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-caption`,children:[(0,G.jsx)(H$,{phase:te,busy:Ce,tab:o,forTab:`browser`}),(0,G.jsx)(`span`,{className:`text-muted`,children:z||r(`loginOpenMsg`)})]}),(0,G.jsx)(`code`,{className:`mono mt-2 block break-all text-caption leading-5 text-foreground`,children:ne}),(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,onPress:()=>window.open(ne,`_blank`,`noopener,noreferrer`),children:[(0,G.jsx)(Qr,{size:14}),r(`openAuthUrl`)]}),(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:()=>{NQ(ne).then(e=>{e&&(V(!0),window.setTimeout(()=>V(!1),1100))})},children:[(0,G.jsx)(MQ,{copied:ie}),r(ie?`copied`:`copy`)]})]})]}):null,z&&!ne?(0,G.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-surface-secondary px-3 py-2 text-caption`,children:[Te?(0,G.jsx)(bi,{size:14,className:`shrink-0 text-success`}):null,(0,G.jsx)(`span`,{className:Te?`font-medium text-foreground`:`text-muted`,children:z})]}):null,Se?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`p`,{className:`text-caption leading-4 text-muted`,children:r(`wizardCallbackLead`)}),(0,G.jsx)(mL,{className:`h-28 w-full resize-none font-mono text-caption leading-5`,value:ae,onChange:e=>oe(e.target.value),placeholder:r(`wizardCallbackPh`),"aria-label":r(`wizardCallbackPh`),disabled:Te}),(0,G.jsx)(X,{className:`w-full`,variant:`secondary`,isPending:te===`busy`&&!!ae.trim(),onPress:()=>void Ie(),isDisabled:Te,children:r(`wizardSubmitCallback`)})]}):null,(0,G.jsx)(X,{className:`w-full`,isPending:He(`browser`),onPress:()=>void Fe(),children:Te?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(bi,{size:15}),r(`wizardAccountReady`)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Oa,{size:15}),r(`wizardStartBrowser`)]})})]}):o===`pat`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(E$,{label:r(`tabPat`),children:(0,G.jsx)(lL,{type:`password`,value:D,onChange:e=>O(e.target.value),placeholder:r(`wizardPatPh`),"aria-label":r(`wizardPatPh`),disabled:Ce})}),z?(0,G.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-surface-secondary px-3 py-2 text-caption`,children:[Te?(0,G.jsx)(bi,{size:14,className:`shrink-0 text-success`}):null,(0,G.jsx)(`span`,{className:Te?`font-medium text-foreground`:`text-muted`,children:z})]}):null,(0,G.jsx)(X,{className:`w-full`,isPending:He(`pat`),onPress:()=>void Re(),children:Te?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(bi,{size:15}),r(`patDone`)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(na,{size:15}),r(`wizardCreateAndLogin`)]})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`span`,{className:`text-caption font-medium text-muted`,children:`JSON`}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,onPress:Be,isDisabled:Ce,children:[(0,G.jsx)(Hi,{size:13}),r(`wizardChooseFile`)]}),(0,G.jsx)(`input`,{ref:me,type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:Ve})]}),(0,G.jsx)(mL,{className:`min-h-32 font-mono text-caption`,value:k,onChange:e=>A(e.target.value),placeholder:r(`wizardImportPh`),"aria-label":r(`tabImport`),disabled:Ce}),z?(0,G.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-surface-secondary px-3 py-2 text-caption`,children:[Te?(0,G.jsx)(bi,{size:14,className:`shrink-0 text-success`}):null,(0,G.jsx)(`span`,{className:Te?`font-medium text-foreground`:`text-muted`,children:z})]}):null,(0,G.jsx)(X,{className:`w-full`,isPending:He(`import`),onPress:()=>void ze(),children:Te?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(bi,{size:15}),r(`accountImported`)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Hi,{size:15}),r(`importCredential`)]})})]})})]})]})})}),(0,G.jsx)(Z.Footer,{className:`justify-end px-5 pb-5`,children:(0,G.jsx)(X,{variant:`ghost`,onPress:je,isDisabled:Ce,children:r(`cancel`)})})]})})})})}function K$({isOpen:e,title:t,description:n,confirmLabel:r,cancelLabel:i,closeLabel:a,isPending:o,status:s=`danger`,confirmVariant:c=`danger`,onClose:l,onConfirm:u}){return(0,G.jsx)(wS.Root,{isOpen:e,onOpenChange:e=>{!e&&!o&&l()},children:(0,G.jsx)(wS.Backdrop,{variant:`blur`,isDismissable:!o,children:(0,G.jsx)(wS.Container,{placement:`center`,size:`sm`,children:(0,G.jsxs)(wS.Dialog,{children:[(0,G.jsxs)(wS.Header,{className:`items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(wS.Icon,{status:s}),(0,G.jsx)(`div`,{children:(0,G.jsx)(wS.Heading,{children:t})})]}),(0,G.jsx)(wS.CloseTrigger,{isDisabled:o,"aria-label":a})]}),(0,G.jsx)(wS.Body,{children:(0,G.jsx)(`p`,{className:`text-body leading-6 text-muted`,children:n})}),(0,G.jsxs)(wS.Footer,{children:[(0,G.jsx)(X,{size:`sm`,variant:`ghost`,isDisabled:o,onPress:l,children:i}),(0,G.jsx)(X,{size:`sm`,variant:c,isPending:o,onPress:u,children:r})]})]})})})})}function q$(e,t){return e===`region_mixed`?t(`batchImportRegionMixed`):e===`region_unknown`?t(`batchImportRegionUnknown`):e===`unknown_format`?t(`batchImportUnknownFormat`):``}function J$({isOpen:e,detection:t,fileName:n,isPending:r,t:i,onClose:a,onConfirm:o}){let[s,c]=(0,v.useState)(`cn`);(0,v.useEffect)(()=>{t&&(t.region===`cn`||t.region===`global`?c(t.region):c(`cn`))},[t]);let l=!!t?.batchImportSupported,u=t?.provider,d=t?.format||i(`batchImportFormatUnknown`),f=u?TZ(u,i):i(`batchImportProviderUnknown`),p=(t?.warnings||[]).map(e=>q$(e,i)).filter(Boolean);return(0,G.jsx)(Z.Root,{isOpen:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,isDismissable:!r,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`sm`,scroll:`inside`,className:`mx-3 w-full max-w-[min(100%,24rem)] sm:mx-0`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:i(`batchImportConfirmTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 break-all text-caption leading-5 text-muted`,children:n?i(`batchImportConfirmHint`,{file:n}):i(`batchImportConfirmHintNoFile`)})]}),(0,G.jsx)(Z.CloseTrigger,{isDisabled:r,"aria-label":i(`close`),className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Body,{className:`space-y-4 px-5 pb-2`,children:[(0,G.jsx)(`div`,{className:`rounded-xl bg-surface-secondary px-3.5 py-3`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[u?(0,G.jsx)(zZ,{provider:u,size:18}):null,(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-foreground`,children:f}),(0,G.jsx)(`div`,{className:`mono mt-0.5 truncate text-caption text-muted`,children:d})]})]})}),l?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-muted`,children:i(`batchImportRegion`)}),(0,G.jsx)(qX,{value:s,onChange:e=>{(e===`cn`||e===`global`)&&c(e)},ariaLabel:i(`batchImportRegion`),options:[{id:`cn`,label:i(`accountTypeWorkBuddyCN`)},{id:`global`,label:i(`accountTypeWorkBuddyGlobal`)}]}),t?.regionAmbiguous?(0,G.jsx)(`p`,{className:`text-caption leading-5 text-muted`,children:i(`batchImportRegionPickHint`)}):null]}):(0,G.jsx)(`p`,{className:`text-body leading-6 text-muted`,children:i(`batchImportProviderUnsupported`)}),p.length?(0,G.jsx)(`ul`,{className:`space-y-1 text-caption leading-5 text-muted`,children:p.map(e=>(0,G.jsx)(`li`,{children:e},e))}):null]}),(0,G.jsxs)(Z.Footer,{className:`flex-col-reverse gap-2 px-5 pb-5 sm:flex-row sm:justify-end`,children:[(0,G.jsx)(X,{size:`sm`,variant:`ghost`,className:`w-full sm:w-auto`,isDisabled:r,onPress:a,children:i(l?`cancel`:`close`)}),l?(0,G.jsx)(X,{size:`sm`,className:`w-full sm:w-auto`,isPending:r,onPress:()=>o(s),children:i(`batchImportConfirmAction`)}):null]})]})})})})}var Y$={"workbuddy-accounts":`workbuddy`,"workbuddy-oauth-v1":`workbuddy`,"qoder-native-v1":`qoder`,"trae-oauth-v1":`trae`,"devin-session-v1":`devin`,"command-key-v1":`command`,"codex-oauth-v1":`codex`,"zhipu-key-v1":`zhipu`,"qwenwork-oauth-v1":`qwenwork`},X$=[`codebuddy.cn`],Z$=[`workbuddy.ai`,`workbuddy.com`];function Q$(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function $$(e){let t=[],n=e=>{typeof e==`string`&&e.trim()&&t.push(e.trim().toLowerCase())};if(n(e.domain),Q$(e.account)&&n(e.account.domain),Array.isArray(e.accounts))for(let t of e.accounts)Q$(t)&&n(t.domain);return t}function e1(e){return X$.some(t=>e.includes(t))}function t1(e){return Z$.some(t=>e.includes(t))}function n1(e){return typeof e.accessToken==`string`||typeof e.access_token==`string`||typeof e.refreshToken==`string`||typeof e.refresh_token==`string`}function r1(e){return Q$(e)?n1(e)||typeof e.domain==`string`||typeof e.uid==`string`:!1}function i1(e){let t=$$(e);if(t.length===0)return{region:`cn`,ambiguous:!0,warning:`region_unknown`};let n=t.some(e1),r=t.some(t1);return n&&r?{region:null,ambiguous:!0,warning:`region_mixed`}:n?{region:`cn`,ambiguous:!1}:r?{region:`global`,ambiguous:!1}:{region:`cn`,ambiguous:!0,warning:`region_unknown`}}function a1(e){return Array.isArray(e.accounts)&&e.accounts.some(r1)?{format:`workbuddy-accounts`,provider:`workbuddy`,confidence:`medium`}:(typeof e.user_blob==`string`||typeof e.userBlob==`string`)&&(typeof e.machine_id==`string`||typeof e.machineId==`string`)?{format:`qoder-native-v1`,provider:`qoder`,confidence:`medium`}:typeof e.session_token==`string`||typeof e.sessionToken==`string`?{format:`devin-session-v1`,provider:`devin`,confidence:`low`}:n1(e)||Q$(e.account)&&n1(e.account)||Q$(e.auth)?{format:`workbuddy-oauth-v1`,provider:`workbuddy`,confidence:`low`}:typeof e.api_key==`string`||typeof e.apiKey==`string`?typeof e.organization==`string`||typeof e.project==`string`?{format:`zhipu-key-v1`,provider:`zhipu`,confidence:`low`}:{format:`command-key-v1`,provider:`command`,confidence:`low`}:{format:null,provider:null,confidence:`low`}}function o1(e){if(!Q$(e))return{format:null,provider:null,region:null,regionAmbiguous:!0,confidence:`low`,warnings:[`not_object`],batchImportSupported:!1};let t=[],n=typeof e.format==`string`?e.format.trim():``,r=n||null,i=r?Y$[r]??null:null,a=r&&i?`high`:`low`;if(!i){let o=a1(e);r||=o.format,i=o.provider,a=n&&!Y$[n]?`low`:o.confidence,n&&!Y$[n]&&t.push(`unknown_format`)}i===`workbuddy`&&Array.isArray(e.accounts)&&(r=`workbuddy-accounts`);let o=null,s=!1;if(i===`workbuddy`){let n=i1(e);o=n.region,s=n.ambiguous,n.warning&&t.push(n.warning)}return{format:r,provider:i,region:o,regionAmbiguous:s,confidence:a,warnings:t,batchImportSupported:i===`workbuddy`}}function s1(e){let t;try{t=JSON.parse(e)}catch{throw Error(`bad_json`)}if(!Q$(t))throw Error(`bad_json`);return t}var c1=`__all__`,l1=[],u1=2;function d1(){let{t:e}=DH(),[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(!0),d=s,f=d.length>0,[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(null),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(null),[O,k]=(0,v.useState)({}),[A,j]=(0,v.useState)({}),[M,N]=(0,v.useState)({}),[P,ee]=(0,v.useState)({}),[F,I]=(0,v.useState)(null),[L,te]=(0,v.useState)(null),[R,z]=(0,v.useState)(null),[B,ne]=(0,v.useState)(null),[re,ie]=(0,v.useState)(null),[V,ae]=(0,v.useState)(``),[oe,se]=(0,v.useState)(`all`),[ce,le]=(0,v.useState)(``),[ue,de]=(0,v.useState)(1),[fe,pe]=(0,v.useState)(20),[me,he]=(0,v.useState)({}),[ge,_e]=(0,v.useState)({}),[ve,ye]=(0,v.useState)({}),[be,xe]=(0,v.useState)({}),[Se,Ce]=(0,v.useState)(!1),we=(0,v.useCallback)(async(e=!1)=>{try{let t=(await LH(e)).data||l1;return c(t),t}finally{u(!1)}},[]),Te=(0,v.useCallback)(async(e,t=!0)=>{let n=[...new Set(e)];if(n.length)for(let e=0;e{try{let n=await XH(e,{quota:t});c(t=>t.map(t=>t.id===e?n:t))}catch(t){N(n=>({...n,[e]:t instanceof Error?t.message:String(t)}))}}))}},[]);(0,v.useEffect)(()=>{we(!1).catch(()=>void 0)},[we]),(0,v.useEffect)(()=>{let e=!0;return Promise.all([tU(),SU()]).then(([t,r])=>{e&&(n(t.data||[]),i(r))}).catch(t=>{e&&o(t instanceof Error?t.message:String(t))}),()=>{e=!1}},[]);function Ee(e){return t.find(t=>t.id===e.provider)?.regions.find(t=>t.id===e.region)?.checkin}function De(e){let t=Ee(e)?.timezone;return t===`Local`?r?.timezone:t}let Oe=(0,v.useMemo)(()=>d.map(e=>{let t=me[e.id],n=ge[e.id],r=ve[e.id],i=be[e.id],a=e;return t!==void 0&&(a={...a,enabled:t}),n!==void 0&&(a={...a,name:n}),r!==void 0&&(a={...a,max_inflight:r}),i!==void 0&&(a={...a,priority:i}),a}),[me,ve,ge,be,d]),ke=(0,v.useMemo)(()=>{let e={all:Oe.length,available:0,attention:0,disabled:0};for(let t of Oe){let n=DX(t);n===`hot`||n===`ready`?e.available+=1:n===`disabled`&&(e.disabled+=1),t.enabled&&n!==`hot`&&n!==`ready`&&(e.attention+=1)}return e},[Oe]),Ae=(0,v.useMemo)(()=>{let e=new Map;for(let t of Oe){let n=String(t.provider||`qoder`).toLowerCase();e.set(n,(e.get(n)||0)+1)}return[...e.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))},[Oe]),je=Oe.find(e=>e.id===F),Me=Oe.find(e=>e.id===L)||null,Ne=Oe.find(e=>e.id===R)||null,Pe=Oe.find(e=>e.id===B)||null,Fe=(0,v.useMemo)(()=>{let e=V.trim().toLowerCase();return Oe.filter(t=>{let n=DX(t);return!(oe===`all`||oe===`available`&&(n===`hot`||n===`ready`)||oe===`attention`&&t.enabled&&n!==`hot`&&n!==`ready`||oe===`disabled`&&n===`disabled`)||ce&&String(t.provider||`qoder`).toLowerCase()!==ce?!1:!e||[t.name,t.id,t.remote_uid,t.provider,t.auth_type].some(t=>String(t||``).toLowerCase().includes(e))})},[Oe,oe,ce,V]),Ie=[V,oe,ce,fe].join(`\0`),[Le,Re]=(0,v.useState)(Ie);Le!==Ie&&(Re(Ie),de(1));let ze=Math.max(1,Math.ceil(Fe.length/fe)),Be=Math.min(Le===Ie?Math.max(1,ue):1,ze);ue!==Be&&de(Be);let Ve=(0,v.useMemo)(()=>{let e=(Be-1)*fe;return Fe.slice(e,e+fe)},[Be,Fe,fe]);if(l&&!f)return(0,G.jsx)(_Y,{});async function He(e,t,n){D({id:e,kind:t}),N(t=>({...t,[e]:``}));try{return await n(),!0}catch(t){return N(n=>({...n,[e]:t instanceof Error?t.message:String(t)})),!1}finally{D(null)}}async function Ue(t,n){ie(t),await He(t,`device`,async()=>{N(n=>({...n,[t]:e(`wizardStartingSession`)}));let r=await RH(t,n);r.authUrl&&ee(e=>({...e,[t]:r.authUrl||``}));for(let n=0;n<60;n++){await new Promise(e=>window.setTimeout(e,2e3));let n=(await zH(t)).login||{};if(N(r=>({...r,[t]:n.message||e(`waitingQoderLogin`)})),n.status===`ok`||n.status===`error`)break}await we(!1),await Te([t])})}async function We(t){let n=(A[t]||``).trim();if(!n){N(n=>({...n,[t]:e(`wizardCallbackPh`)}));return}await He(t,`callback`,async()=>{N(n=>({...n,[t]:e(`wizardStartingSession`)})),await BH(t,n),j(e=>({...e,[t]:``})),await we(!1),await Te([t])})&&(ie(e=>e===t?null:e),N(e=>({...e,[t]:``})))}async function Ge(t){let n=(O[t]||``).trim();if(!n){N(n=>({...n,[t]:e(`pastePatFirst`)}));return}await He(t,`pat`,async()=>{N(n=>({...n,[t]:e(`wizardStartingSession`)})),await VH(n,t),k(e=>({...e,[t]:``})),await we(!1),await Te([t])})}async function Ke(t){await He(t,`export`,async()=>{let n=await cU(t);await NQ(JSON.stringify(n,null,2)),N(n=>({...n,[t]:e(`credentialCopied`)}))})}async function qe(e,t){he(n=>({...n,[e]:t})),await He(e,`toggle`,async()=>{await aU(e,{enabled:t}),await we(!1)}),he(t=>{let n={...t};return delete n[e],n})}async function Je(t){JY({id:`refresh-${t}`,type:`loading`,title:e(`toastRefreshingAccount`)}),D({id:t,kind:`refresh`}),N(e=>{let n={...e};return delete n[t],n});try{await Te([t]),JY({id:`refresh-${t}`,type:`success`,title:e(`toastAccountRefreshed`)})}catch(n){throw JY({id:`refresh-${t}`,type:`error`,title:e(`toastFailed`),description:n instanceof Error?n.message:String(n)}),n}finally{D(null)}}async function Ye(){Ce(!0),JY({id:`refresh-credits`,type:`loading`,title:e(`toastRefreshingCredits`)});try{await Te(s.map(e=>e.id)),JY({id:`refresh-credits`,type:`success`,title:e(`toastCreditsRefreshed`)})}catch(t){throw JY({id:`refresh-credits`,type:`error`,title:e(`toastFailed`),description:t instanceof Error?t.message:String(t)}),t}finally{Ce(!1)}}function Xe(){h||(y(!1),x(null),C(null),T(``))}async function Ze(t){let n=t.target.files?.[0];if(t.target.value=``,n)try{let t=s1(await n.text()),r=o1(t);if(!r.provider){JY({type:`error`,title:e(`batchImportUnrecognized`)});return}C(t),x(r),T(n.name),y(!0)}catch(t){let n=t instanceof Error?t.message:String(t);JY({type:`error`,title:e(n===`bad_json`?`wizardBadJson`:`batchImportUnrecognized`),description:n===`bad_json`?void 0:n})}}async function Qe(t){if(!S||!b?.batchImportSupported||h)return;g(!0);let n=`batch-import-accounts`;JY({id:n,type:`loading`,title:e(`batchImportLoading`)});try{let{succeeded:r,failed:i,message:a}=N$(await P$(S,{region:t}),e);JY({id:n,type:i>0&&r===0?`error`:i>0?`info`:`success`,title:a}),y(!1),x(null),C(null),T(``),r>0&&await we(!1)}catch(t){JY({id:n,type:`error`,title:e(`toastFailed`),description:t instanceof Error?t.message:String(t)})}finally{g(!1)}}async function $e(e,t){await He(e,`toggle`,async()=>{await aU(e,{auto_checkin:t}),await we(!1)})}async function et(e){await He(e,`checkin`,async()=>{try{await rU(e)}finally{await we(!1)}})}async function tt(t,n){if(!t)throw Error(e(`accountNameRequired`));_e(e=>({...e,[t]:n.name})),ye(e=>({...e,[t]:n.max_inflight})),xe(e=>({...e,[t]:n.priority})),D({id:t,kind:`settings`});try{await aU(t,n),await we(!1)}catch(e){throw e instanceof Error?e:Error(String(e))}finally{D(null),_e(e=>{let n={...e};return delete n[t],n}),ye(e=>{let n={...e};return delete n[t],n}),xe(e=>{let n={...e};return delete n[t],n})}}return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[a?(0,G.jsx)(bU,{title:a}):null,(0,G.jsxs)(`section`,{"data-gsap-reveal":!0,className:`flex flex-wrap items-center gap-2`,children:[d.length?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(qX,{value:oe,onChange:e=>se(e),ariaLabel:e(`accountStatusFilter`),options:[{id:`all`,label:(0,G.jsxs)(G.Fragment,{children:[e(`filterAll`),(0,G.jsx)(`span`,{className:`mono text-muted`,children:ke.all})]})},{id:`available`,label:(0,G.jsxs)(G.Fragment,{children:[e(`availableAccounts`),(0,G.jsx)(`span`,{className:`mono text-muted`,children:ke.available})]})},{id:`attention`,label:(0,G.jsxs)(G.Fragment,{children:[e(`needsAttention`),(0,G.jsx)(`span`,{className:`mono ${ke.attention?`text-danger`:`text-muted`}`,children:ke.attention})]})},{id:`disabled`,label:(0,G.jsxs)(G.Fragment,{children:[e(`disabled`),(0,G.jsx)(`span`,{className:`mono text-muted`,children:ke.disabled})]})}]}),(0,G.jsxs)(SV,{className:`w-48`,"aria-label":e(`providerFilterAll`),value:ce||c1,onChange:e=>{typeof e==`string`&&le(e===c1?``:e)},children:[(0,G.jsxs)(SV.Trigger,{className:`items-center`,children:[(0,G.jsx)(SV.Value,{className:`min-w-0 truncate`}),(0,G.jsx)(SV.Indicator,{})]}),(0,G.jsx)(SV.Popover,{children:(0,G.jsxs)(GB,{children:[(0,G.jsxs)(GB.Item,{id:c1,textValue:e(`providerFilterAll`),children:[(0,G.jsxs)(sR,{className:`flex items-center gap-2`,children:[e(`providerFilterAll`),(0,G.jsx)(`span`,{className:`mono text-muted`,children:d.length})]}),(0,G.jsx)(GB.ItemIndicator,{})]}),Ae.map(([t,n])=>(0,G.jsxs)(GB.Item,{id:t,textValue:TZ(t,e),children:[(0,G.jsxs)(sR,{className:`flex items-center gap-2`,children:[(0,G.jsx)(zZ,{provider:t,size:13}),TZ(t,e),(0,G.jsx)(`span`,{className:`mono text-muted`,children:n})]}),(0,G.jsx)(GB.ItemIndicator,{})]},t))]})})]}),(0,G.jsx)(bQ,{className:`w-full sm:w-60`,value:V,onChange:ae,placeholder:e(`searchAccounts`),ariaLabel:e(`searchAccounts`)})]}):null,(0,G.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:ml-auto sm:w-auto`,children:[(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:Se,onPress:()=>void Ye(),children:[(0,G.jsx)(ni,{size:14}),e(`refreshCredits`)]}),(0,G.jsxs)(`label`,{htmlFor:`accounts-batch-import-file`,className:`button button--sm button--secondary inline-flex items-center gap-1.5 ${h||_?`pointer-events-none opacity-60`:`cursor-pointer`}`,children:[h?(0,G.jsx)(uY,{size:14,loading:!0}):(0,G.jsx)(eo,{size:14}),e(`batchImport`)]}),(0,G.jsx)(`input`,{id:`accounts-batch-import-file`,type:`file`,accept:`.json,application/json,text/json`,disabled:h||_,className:`sr-only`,onChange:e=>void Ze(e)}),(0,G.jsxs)(X,{size:`sm`,onPress:()=>m(!0),children:[(0,G.jsx)(wa,{size:14}),e(`addAccount`)]})]})]}),(0,G.jsx)(G$,{isOpen:p,onClose:()=>m(!1),onAdded:()=>{JY({type:`success`,title:e(`toastAccountAdded`)}),we(!1)}}),(0,G.jsx)(J$,{isOpen:_,detection:b,fileName:w,isPending:h,t:e,onClose:Xe,onConfirm:e=>{Qe(e)}}),(0,G.jsx)(w$,{account:Me,t:e,onClose:()=>te(null)},L??`closed`),(0,G.jsx)(S$,{account:Ne,t:e,onClose:()=>z(null)},R??`closed`),(0,G.jsx)(k$,{account:Pe,checkinDefaultTime:Pe&&Ee(Pe)?r?.checkin_times[Pe.provider||``]:void 0,checkinTimezone:Pe?De(Pe):void 0,busy:!!(E&&E.id===B&&E.kind===`settings`),t:e,onClose:()=>ne(null),onSave:e=>tt(B||``,e)},B??`closed`),(0,G.jsx)(K$,{isOpen:!!je,title:e(`delete`),description:e(`deleteAccountConfirm`,{name:je?.name||je?.id||``}),confirmLabel:e(`delete`),cancelLabel:e(`cancel`),closeLabel:e(`close`),isPending:E?.id===F&&E.kind===`delete`,onClose:()=>I(null),onConfirm:()=>{if(!je)return;let t=je.id;I(null),He(t,`delete`,async()=>{await oU(t),await we(!1)}).then(t=>{t&&JY({type:`success`,title:e(`toastAccountDeleted`)})})}}),f?null:(0,G.jsx)(pQ,{className:`rounded-3xl bg-surface-secondary`,icon:(0,G.jsx)(uY,{size:28}),title:e(`noAccounts`),hint:e(`accountEmptyHint`),action:(0,G.jsxs)(X,{size:`sm`,onPress:()=>m(!0),children:[(0,G.jsx)(wa,{size:14}),e(`addAccount`)]})}),f&&!Fe.length?(0,G.jsx)(pQ,{className:`rounded-3xl bg-surface-secondary`,icon:(0,G.jsx)(ua,{size:22}),title:e(`noAccountsMatch`),action:(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:()=>{ae(``),se(`all`),le(``)},children:e(`clearFilters`)})}):null,(0,G.jsx)(`section`,{className:`grid auto-rows-[minmax(280px,auto)] gap-2.5 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4`,children:Ve.map(t=>(0,G.jsx)(y$,{account:t,busyKind:E?.id===t.id?E.kind:``,authPanelOpen:re===t.id,authUrl:P[t.id],note:M[t.id],pat:O[t.id]||``,t:e,onPatChange:e=>k(n=>({...n,[t.id]:e})),callbackUrl:A[t.id]||``,onCallbackChange:e=>j(n=>({...n,[t.id]:e})),onSubmitCallback:()=>void We(t.id),onDeviceLogin:e=>void Ue(t.id,e),onPatLogin:()=>void Ge(t.id),onExport:()=>void Ke(t.id),onRefresh:()=>void Je(t.id),onDelete:()=>I(t.id),onToggle:e=>void qe(t.id,e),checkinDefaultTime:r?.checkin_times[t.provider||``],onToggleAutoCheckin:Ee(t)?e=>void $e(t.id,e):void 0,onCheckin:Ee(t)?()=>void et(t.id):void 0,onViewCheckins:Ee(t)?()=>z(t.id):void 0,onEdit:()=>ne(t.id),onToggleAuthPanel:()=>ie(e=>e===t.id?null:t.id),onViewModels:()=>te(t.id)},t.id))}),Fe.length?(0,G.jsx)(yQ,{total:Fe.length,page:Be,pageCount:ze,pageSize:fe,pageSizes:_Q,loading:!1,pageSizeLabel:e(`logsPageSize`),pageLabel:e(`logsPage`,{page:Be,pages:ze}),prevLabel:e(`logsPrevPage`),nextLabel:e(`logsNextPage`),onPage:de,onPageSize:pe}):null]})}function f1(){let{t:e,lang:t,setLang:n}=DH(),{setApiKey:r}=jH(),{overview:i,refresh:a}=dU(),{theme:o,toggleTheme:s}=gU(),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(``),g=ot(),_=rt().state?.from||`/`,y=(0,v.useRef)(null);if(EY(y,`login`),i)return(0,G.jsx)(jt,{to:_===`/login`?`/`:_,replace:!0});async function b(t){t.preventDefault();let n=c.trim();if(!n){h(e(`loginNeedKey`));return}p(!0),h(``);try{r(n),await a(n),g(_===`/login`?`/`:_,{replace:!0})}catch(t){h(PH(t)?e(`loginBadKey`):t instanceof Error?t.message:String(t))}finally{p(!1)}}return(0,G.jsxs)(`div`,{className:`relative min-h-dvh overflow-hidden bg-background text-foreground`,children:[(0,G.jsx)(`div`,{className:`absolute inset-x-0 top-0 h-px bg-border`}),(0,G.jsxs)(`main`,{ref:y,className:`relative z-10 mx-auto grid min-h-dvh w-full max-w-[1480px] lg:grid-cols-[minmax(0,1fr)_minmax(480px,45%)]`,children:[(0,G.jsxs)(`section`,{className:`flex min-h-[52vh] flex-col border-separator px-5 py-6 sm:px-10 sm:py-8 lg:min-h-dvh lg:border-r lg:px-14 lg:py-10 xl:px-20`,children:[(0,G.jsxs)(`header`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(uY,{size:36}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`font-semibold`,children:`CLI2API`}),(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e(`controlPlane`)})]})]}),(0,G.jsxs)(OI,{isAttached:!0,children:[(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,onPress:()=>n(t===`zh`?`en`:`zh`),"aria-label":t===`zh`?`English`:`中文`,children:(0,G.jsx)(Xi,{size:15})})}),(0,G.jsx)(eL.Content,{children:t===`zh`?`English`:`中文`})]}),(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,onPress:s,"aria-label":o===`dark`?`Light mode`:`Dark mode`,children:o===`dark`?(0,G.jsx)(Wa,{size:15}):(0,G.jsx)(fa,{size:15})})}),(0,G.jsx)(eL.Content,{children:o===`dark`?`Light mode`:`Dark mode`})]})]})]}),(0,G.jsxs)(`div`,{className:`my-auto max-w-3xl py-16 lg:py-24`,children:[(0,G.jsx)(`p`,{"data-gsap-reveal":!0,className:`mb-5 mono text-caption text-muted`,children:`:3010`}),(0,G.jsx)(`h1`,{"data-gsap-reveal":!0,className:`max-w-3xl text-[clamp(2.25rem,4vw,3.6rem)] font-semibold leading-[0.98] tracking-[-0.045em] text-balance`,children:e(`loginTitle`)}),(0,G.jsx)(`p`,{"data-gsap-reveal":!0,className:`mt-6 max-w-xl text-section font-normal text-muted sm:text-title sm:font-normal`,children:e(`loginLead`)}),(0,G.jsx)(`p`,{"data-gsap-reveal":!0,className:`mt-10 max-w-xl pt-5 text-body leading-6 text-muted`,children:e(`loginHint`)})]}),(0,G.jsxs)(`footer`,{className:`hidden items-center justify-between text-caption text-muted lg:flex`,children:[(0,G.jsx)(`span`,{children:e(`loginHint`)}),(0,G.jsx)(`span`,{children:e(`routesHint`)})]})]}),(0,G.jsx)(`section`,{className:`flex items-center px-5 py-10 sm:px-10 lg:px-12 xl:px-16`,children:(0,G.jsx)(zw,{"data-gsap-reveal":!0,className:`w-full p-0`,children:(0,G.jsxs)(`form`,{onSubmit:e=>void b(e),children:[(0,G.jsx)(zw.Header,{className:`border-b border-separator px-6 py-6 sm:px-8`,children:(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,G.jsx)(uY,{size:28,loading:f}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(zw.Title,{className:`text-title`,children:e(`loginFormTitle`)}),(0,G.jsx)(zw.Description,{className:`mt-1`,children:e(`loginDesc`)})]})]})}),(0,G.jsxs)(zw.Content,{className:`space-y-5 px-6 py-7 sm:px-8 sm:py-8`,children:[(0,G.jsxs)(hL,{name:`console-password`,className:`w-full`,isInvalid:!!m,children:[(0,G.jsx)(sR,{children:e(`loginPassword`)}),(0,G.jsxs)(fL,{children:[(0,G.jsx)(fL.Input,{id:`console-password`,type:u?`text`:`password`,value:c,onChange:e=>l(e.target.value),placeholder:e(`loginPasswordPh`),autoComplete:`current-password`,autoFocus:!0,"aria-label":e(`loginPassword`),spellCheck:!1}),(0,G.jsx)(fL.Suffix,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,type:`button`,"aria-label":e(u?`hidePassword`:`showPassword`),onPress:()=>d(e=>!e),children:u?(0,G.jsx)(Bi,{size:16}):(0,G.jsx)(Ri,{size:16})})})]})]}),m?(0,G.jsx)(bU,{title:m}):(0,G.jsx)(`p`,{className:`text-caption text-muted`,children:e(`loginHint`)}),(0,G.jsxs)(X,{type:`submit`,fullWidth:!0,size:`lg`,isPending:f,children:[e(f?`loggingInConsole`:`loginSubmit`),f?null:(0,G.jsx)(Xr,{size:17})]})]})]})})})]})]})}function p1(){return FH(`/api/keys`)}function m1(e){return FH(`/api/keys`,{method:`POST`,body:JSON.stringify(e)})}function h1(e,t){return FH(`/api/keys/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)})}function g1(e){return FH(`/api/keys/${encodeURIComponent(e)}`,{method:`DELETE`})}function _1(){return FH(`/api/system/console-key`)}function v1(){return FH(`/api/system/console-key`,{method:`POST`,body:JSON.stringify({rotate:!0})})}function y1({settings:e,onSaved:t}){let{t:n}=DH(),r=ot(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)({}),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``);(0,v.useEffect)(()=>{let e=!0;return tU().then(t=>{e&&a((t.data||[]).filter(e=>e.regions.some(e=>e.checkin)))}).catch(t=>{e&&d(String(t))}),()=>{e=!1}},[]);async function f(n,r){if(!(!e||r===e.checkin_times[n])){l(!0),d(``);try{t(await CU({checkin_times:{[n]:r}}))}catch(e){d(e instanceof Error?e.message:String(e))}finally{s(e=>{let t={...e};return delete t[n],t}),l(!1)}}}return(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(zw.Header,{children:[(0,G.jsx)(zw.Title,{children:n(`checkinDefaultsTitle`)}),(0,G.jsx)(zw.Description,{children:n(`checkinDefaultsHint`)})]}),(0,G.jsxs)(zw.Content,{className:`space-y-4`,children:[u?(0,G.jsx)(bU,{title:u}):null,!e||!i?(0,G.jsx)($,{className:`h-24 w-full`}):i.map(t=>(0,G.jsx)(E$,{label:t.label,hint:t.regions.filter(e=>e.checkin).map(t=>`${t.label} · ${t.checkin?.timezone===`Local`?e.timezone:t.checkin?.timezone}`).join(` / `),children:(0,G.jsx)(lL,{type:`time`,value:o[t.id]??e.checkin_times[t.id]??``,disabled:c,"aria-label":`${t.label} ${n(`autoCheckinTime`)}`,onChange:e=>s(n=>({...n,[t.id]:e.target.value})),onBlur:e=>void f(t.id,e.target.value)})},t.id))]}),(0,G.jsx)(zw.Footer,{children:(0,G.jsx)(X,{variant:`secondary`,onPress:()=>r(`/accounts`),children:n(`navAccounts`)})})]})}function b1(e,t){if(!e)return``;let n=new Date(e);return Number.isNaN(n.getTime())?``:n.toLocaleDateString(t===`zh`?`zh-CN`:`en-US`,{year:`numeric`,month:`short`,day:`numeric`})}function x1({releases:e,currentVersion:t,nextVersion:n,rollbackTags:r,canRollback:i,submitting:a,onRestore:o}){let{t:s,lang:c}=DH();if(!e.length)return null;let l=n&&n!==t?n:t,u=e.some(e=>e.tag_name===l)?l:e[0]?.tag_name,d=new Set(r);return(0,G.jsxs)(`div`,{className:`mt-5`,children:[(0,G.jsx)(`div`,{className:`mb-2`,children:(0,G.jsx)(`p`,{className:`text-caption font-medium text-foreground`,children:s(`versionHistory`)})}),(0,G.jsx)(Ih,{className:`rounded-lg bg-surface-secondary`,hideSeparator:!0,defaultExpandedKeys:u?[u]:[],children:e.map(e=>{let r=e.tag_name,l=r===t,u=!!(n&&r===n&&n!==t),f=i&&d.has(r)&&!l,p=b1(e.published_at,c);return(0,G.jsxs)(Ih.Item,{id:r,children:[(0,G.jsx)(Ih.Heading,{children:(0,G.jsxs)(Ih.Trigger,{className:`items-center gap-3 px-3 py-2.5 text-left`,children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`mono text-body font-semibold`,children:r}),l?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`success`,children:s(`versionCurrentBadge`)}):null,u?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`warning`,children:s(`versionLatestBadge`)}):null,p?(0,G.jsx)(`span`,{className:`truncate text-caption text-muted`,children:p}):null]}),(0,G.jsx)(Ih.Indicator,{})]})}),(0,G.jsx)(Ih.Panel,{children:(0,G.jsxs)(Ih.Body,{className:`px-3 pb-3`,children:[(0,G.jsx)(`div`,{className:`release-notes-box release-notes-box--compact`,children:(0,G.jsx)(KU,{markdown:BU(e.body,c),emptyLabel:s(`updateNoNotes`)})}),f?(0,G.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,G.jsx)(X,{size:`sm`,variant:`ghost`,isDisabled:a,onPress:()=>o(r),children:s(`restoreThisVersion`)})}):null]})})]},r)})})]})}function S1(e){let t=new Set,n=[];for(let r of e){let e=r.tag_name?.trim();!e||t.has(e)||(t.add(e),n.push({...r,tag_name:e}))}return n}function C1(e,t,n,r,i){return r?.length?S1(r):S1([...n?[n]:t?[{tag_name:t}]:[],...e?[{tag_name:e}]:[],...i||[]])}var w1=[`general`,`routing`,`security`,`updates`];function T1(){let{t:e}=DH(),[t,n]=kn(),r=t.get(`tab`),i=r&&w1.includes(r)?r:`general`,a=e=>n(e===`general`?{}:{tab:e},{replace:!0}),{setApiKey:o}=jH(),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)(``),E=NU(),{info:D,loading:O,checking:k,submitting:A,error:j,setError:M,load:N,canRollback:P,rollbackTo:ee}=E,F=(0,v.useMemo)(()=>C1(D?.current_version||``,D?.next_version,D?.release,D?.recent_releases,D?.rollback_versions),[D?.current_version,D?.next_version,D?.release,D?.recent_releases,D?.rollback_versions]),I=(0,v.useMemo)(()=>(D?.rollback_versions||[]).map(e=>e.tag_name),[D?.rollback_versions]);(0,v.useEffect)(()=>{let e=window.setTimeout(()=>{_1().then(c).catch(()=>void 0),SU().then(e=>{u(e),f(e.proxy_url||``)}).catch(e=>M(e instanceof Error?e.message:String(e)))},0);return()=>window.clearTimeout(e)},[M]);async function L(e){let t=l?.cross_provider_model_pool??!0;u(t=>t&&{...t,cross_provider_model_pool:e}),m(!0),M(``);try{u(await CU({cross_provider_model_pool:e}))}catch(e){u(e=>e&&{...e,cross_provider_model_pool:t}),M(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function te(e){let t=l?.checkin_disabled_accounts??!1;u(t=>t&&{...t,checkin_disabled_accounts:e}),m(!0),M(``);try{u(await CU({checkin_disabled_accounts:e}))}catch(e){u(e=>e&&{...e,checkin_disabled_accounts:t}),M(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function R(e){let t=l?.proxy_url||``;if(e===t){f(t);return}let n=d;f(e),u(t=>t&&{...t,proxy_url:e}),m(!0),M(``);try{let t=await CU({proxy_url:e});u(t),f(t.proxy_url||``)}catch(e){f(n),u(e=>e&&{...e,proxy_url:t}),M(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function z(e){let t=l?.routing_strategy||`round-robin`;u(t=>t&&{...t,routing_strategy:e}),m(!0),M(``);try{u(await CU({routing_strategy:e}))}catch(e){u(e=>e&&{...e,routing_strategy:t}),M(e instanceof Error?e.message:String(e))}finally{m(!1)}}return O&&!D?(0,G.jsx)(TY,{}):(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(`section`,{className:`flex flex-wrap items-end justify-between gap-4 pb-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{"data-gsap-reveal":!0,className:`text-title font-semibold`,children:e(`systemSettingsTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:e(`systemSettingsLead`)})]}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:k,onPress:()=>void N(!0),children:[(0,G.jsx)(Jr,{size:15}),e(`checkUpdates`)]})]}),j?(0,G.jsx)(bU,{title:j}):null,(0,G.jsxs)(LF,{selectedKey:i,onSelectionChange:e=>a(String(e)),children:[(0,G.jsx)(LF.ListContainer,{className:`w-fit max-w-full overflow-x-auto`,children:(0,G.jsxs)(LF.List,{"aria-label":e(`systemSettingsTitle`),children:[(0,G.jsxs)(IF,{id:`general`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{}),(0,G.jsx)(Ji,{size:13}),e(`settingsTabGeneral`)]}),(0,G.jsxs)(IF,{id:`routing`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{}),(0,G.jsx)(ii,{size:13}),e(`settingsTabRouting`)]}),(0,G.jsxs)(IF,{id:`security`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{}),(0,G.jsx)(Oa,{size:13}),e(`settingsTabSecurity`)]}),(0,G.jsxs)(IF,{id:`updates`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{}),(0,G.jsx)(Kr,{size:13}),e(`settingsTabUpdates`)]})]})}),(0,G.jsx)(LF.Panel,{id:`general`,className:`pt-5`,children:(0,G.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-2 items-start`,children:[(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(Pa,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`proxySettingsTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`proxySettingsHint`)})]})]}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-1.5`,children:[(0,G.jsx)(sR,{className:`text-body font-medium text-muted`,children:e(`proxyUrl`)}),(0,G.jsx)(lL,{value:d,onChange:e=>f(e.target.value),onBlur:e=>void R(e.target.value.trim()),placeholder:e(`proxyUrlPlaceholder`),disabled:p||!l}),(0,G.jsx)(lR,{className:`text-caption leading-5 text-muted`,children:e(`proxyUrlHint`)})]})]}),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(bi,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`checkinDisabledAccountsTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`checkinDisabledAccountsHint`)})]})]}),(0,G.jsx)(fQ,{isSelected:l?.checkin_disabled_accounts??!1,isDisabled:p||!l,ariaLabel:e(`checkinDisabledAccountsAriaLabel`),onChange:e=>void te(e)})]}),(0,G.jsxs)(`div`,{className:`mt-4 flex items-center justify-between pt-3 text-caption text-muted`,children:[(0,G.jsx)(`span`,{children:e(`checkinDisabledAccountsStatus`)}),(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:l?.checkin_disabled_accounts?e(`enabled`):e(`disabled`)})]})]}),(0,G.jsx)(y1,{settings:l,onSaved:u})]})}),(0,G.jsx)(LF.Panel,{id:`routing`,className:`pt-5`,children:(0,G.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-2 items-start`,children:[(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(Pa,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`routingStrategyTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`routingStrategyHint`)})]})]}),(0,G.jsx)(`div`,{className:`mt-4 pt-4`,children:(0,G.jsx)(E$,{label:e(`routingStrategy`),children:(0,G.jsxs)(SV,{fullWidth:!0,"aria-label":e(`routingStrategy`),value:l?.routing_strategy||`round-robin`,isDisabled:p||!l,onChange:e=>{typeof e==`string`&&e&&z(e)},children:[(0,G.jsxs)(SV.Trigger,{className:`items-center`,children:[(0,G.jsx)(SV.Value,{className:`min-w-0 truncate`}),(0,G.jsx)(SV.Indicator,{})]}),(0,G.jsx)(SV.Popover,{children:(0,G.jsxs)(GB,{children:[(0,G.jsxs)(GB.Item,{id:`round-robin`,textValue:`round-robin`,children:[(0,G.jsx)(sR,{children:e(`routingRoundRobin`)}),(0,G.jsx)(GB.ItemIndicator,{})]}),(0,G.jsxs)(GB.Item,{id:`weighted-round-robin`,textValue:`weighted-round-robin`,children:[(0,G.jsx)(sR,{children:e(`routingWeightedRoundRobin`)}),(0,G.jsx)(GB.ItemIndicator,{})]}),(0,G.jsxs)(GB.Item,{id:`fill-first`,textValue:`fill-first`,children:[(0,G.jsx)(sR,{children:e(`routingFillFirst`)}),(0,G.jsx)(GB.ItemIndicator,{})]})]})})]})})}),(0,G.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2 pt-3 text-caption text-muted sm:grid-cols-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`mono block text-body font-medium text-foreground`,children:l?.session_affinity?.ttl_seconds?`${Math.round(l.session_affinity.ttl_seconds/60)}m`:`—`}),e(`sessionAffinityTTL`)]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`mono block text-body font-medium text-foreground`,children:l?.session_affinity?.hits??0}),e(`sessionAffinityHits`)]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`mono block text-body font-medium text-foreground`,children:l?.session_affinity?.misses??0}),e(`sessionAffinityMisses`)]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`mono block text-body font-medium text-foreground`,children:l?.session_affinity?.escapes??0}),e(`sessionAffinityEscapes`)]})]}),l?.session_affinity?.last_escape_reason?(0,G.jsxs)(lR,{className:`mt-3 text-caption`,children:[e(`lastSessionEscape`),`: `,l.session_affinity.last_escape_reason]}):null,l?.session_affinity?.last_miss_reason?(0,G.jsxs)(lR,{className:`mt-1 text-caption`,children:[e(`lastSessionMiss`),`: `,l.session_affinity.last_miss_reason]}):null]}),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(Pa,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`crossProviderModelPoolTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`crossProviderModelPoolHint`)})]})]}),(0,G.jsx)(fQ,{isSelected:l?.cross_provider_model_pool??!0,isDisabled:p||!l,ariaLabel:e(`crossProviderModelPoolAriaLabel`),onChange:e=>void L(e)})]}),(0,G.jsxs)(`div`,{className:`mt-4 flex items-center justify-between pt-3 text-caption text-muted`,children:[(0,G.jsx)(`span`,{children:e(`crossProviderModelPoolStatus`)}),(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:l?.cross_provider_model_pool?e(`enabled`):e(`disabled`)})]})]})]})}),(0,G.jsx)(LF.Panel,{id:`security`,className:`pt-5`,children:(0,G.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-2 items-start`,children:[(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(na,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`consoleKeyTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`consoleKeyHint`)})]})]})}),(0,G.jsx)(`code`,{className:`mono mt-4 block rounded-lg bg-surface-secondary px-3 py-2 text-caption text-muted`,children:s?.prefix||`—`}),(0,G.jsx)(`p`,{className:`mt-3 text-caption leading-5 text-muted`,children:e(`consoleKeyLead`)}),(0,G.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,G.jsx)(X,{size:`sm`,variant:`ghost`,isPending:h,onPress:()=>y(!0),children:e(`consoleKeyRotate`)})})]}),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(Pi,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`sqliteProtection`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`sqliteProtectionHint`)})]})]}),(0,G.jsx)(Oa,{size:18,className:`text-success`})]}),(0,G.jsx)(`div`,{className:`mono mt-4 rounded-lg bg-surface-secondary px-3 py-2 text-caption text-muted`,children:`/data`}),(0,G.jsxs)(`div`,{className:`mt-3 grid gap-2 text-caption text-muted`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(bi,{size:14,className:`text-muted`}),e(`sqliteBackupBeforeUpdate`)]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(bi,{size:14,className:`text-muted`}),e(`sqliteKeepFive`)]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(bi,{size:14,className:`text-muted`}),e(`sqliteRollbackTogether`)]})]})]})]})}),(0,G.jsx)(LF.Panel,{id:`updates`,className:`pt-5`,children:(0,G.jsx)(`div`,{className:`grid gap-5`,children:(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-5 py-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`versionUpdate`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:e(`latestVersionHint`)})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:D?.has_update?`warning`:`success`,children:D?.has_update?e(`updateAvailable`):e(`upToDate`)})]}),(0,G.jsxs)(`div`,{className:`px-5 py-5`,children:[(0,G.jsx)(yU,{update:E}),(0,G.jsx)(x1,{releases:F,currentVersion:D?.current_version||``,nextVersion:D?.next_version,rollbackTags:I,canRollback:P,submitting:A,onRestore:T})]})]})})})]}),(0,G.jsx)(K$,{isOpen:!!w,title:e(`restoreVersionTitle`,{version:w}),description:e(`restoreVersionHint`),confirmLabel:e(`restoreThisVersion`),cancelLabel:e(`cancel`),closeLabel:e(`close`),isPending:A,status:`warning`,confirmVariant:`primary`,onClose:()=>{A||T(``)},onConfirm:()=>{let e=w;T(``),ee(e)}}),(0,G.jsx)(Z.Root,{isOpen:_,onOpenChange:e=>{!e&&!h&&y(!1)},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,isDismissable:!h,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`sm`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:e(`consoleKeyRotate`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`consoleKeyRotateHint`)})]}),(0,G.jsx)(Z.CloseTrigger,{isDisabled:h,"aria-label":e(`close`),className:`grid size-8 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Footer,{className:`justify-end`,children:[(0,G.jsx)(X,{variant:`ghost`,isDisabled:h,onPress:()=>y(!1),children:e(`cancel`)}),(0,G.jsx)(X,{variant:`danger`,isPending:h,onPress:()=>{g(!0),v1().then(e=>{c(e),x(e.secret||``),e.secret&&o(e.secret),y(!1)}).catch(e=>{M(e instanceof Error?e.message:String(e))}).finally(()=>g(!1))},children:e(`consoleKeyRotateNow`)})]})]})})})}),(0,G.jsx)(Z.Root,{isOpen:!!b,onOpenChange:e=>{e||x(``)},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`lg`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-6 pt-6`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:e(`consoleKeySecretTitle`)}),(0,G.jsx)(`p`,{className:`mt-1.5 text-body leading-6 text-muted`,children:e(`consoleKeySecretHint`)})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":e(`close`),className:`grid size-9 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:18})})]}),(0,G.jsx)(Z.Body,{className:`px-6 pb-2`,children:(0,G.jsx)(`code`,{className:`mono block break-all rounded-lg bg-surface-secondary px-3 py-3 text-body`,children:b})}),(0,G.jsxs)(Z.Footer,{className:`justify-end`,children:[(0,G.jsx)(X,{variant:`ghost`,onPress:()=>x(``),children:e(`close`)}),(0,G.jsxs)(X,{onPress:()=>{NQ(b),C(!0),window.setTimeout(()=>C(!1),1200)},children:[(0,G.jsx)(Oi,{size:14}),e(S?`copied`:`copy`)]})]})]})})})})]})}var E1=`__all__`;function D1(e,t){let n=t.trim().toLowerCase();return!n||e.label.toLowerCase().includes(n)||e.id.toLowerCase().includes(n)}function O1({value:e,onChange:t,ariaLabel:n,options:r,allLabel:i,searchPlaceholder:a,emptyLabel:o,loadOptions:s,className:c}){let[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)([]),[p,m]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(!s)return;let e=!1,t=window.setTimeout(()=>{m(!0),s(l.trim()).then(t=>{e||f(t)}).catch(()=>{e||f([])}).finally(()=>{e||m(!1)})},l.trim()?280:0);return()=>{e=!0,window.clearTimeout(t)}},[s,l]);let h=e||E1,g=(0,v.useMemo)(()=>{let t=s?d:r.filter(e=>D1(e,l)),n=new Map;l.trim()||n.set(E1,{id:E1,label:i});for(let e of t)!e.id||e.id===E1||n.set(e.id,e);if(e){let t=r.find(t=>t.id===e)||d.find(t=>t.id===e)||{id:e,label:e};n.set(e,t)}return[...n.values()]},[i,s,r,l,d,e]),_=g.find(e=>e.id===h)||(e?{id:e,label:e}:{id:E1,label:i});return(0,G.jsxs)(Sw,{className:[`w-fit`,c].filter(Boolean).join(` `),"aria-label":n,value:h,onChange:e=>{typeof e==`string`&&(t(e===E1?``:e),u(``))},onClear:()=>{t(``),u(``)},children:[(0,G.jsxs)(Sw.Trigger,{className:`min-w-44 items-center`,children:[(0,G.jsx)(Sw.Value,{className:`min-w-0 truncate`,children:({defaultChildren:e,isPlaceholder:t})=>t?e:(0,G.jsx)(`span`,{className:`truncate`,children:_.label})}),e?(0,G.jsx)(Sw.ClearButton,{}):null,(0,G.jsx)(Sw.Indicator,{})]}),(0,G.jsx)(Sw.Popover,{className:`min-w-56`,children:(0,G.jsxs)(Sw.Filter,{inputValue:l,onInputChange:u,filter:()=>!0,children:[(0,G.jsx)(aR,{"aria-label":a,className:`px-2 pt-2`,autoFocus:!0,children:(0,G.jsxs)(aR.Group,{children:[(0,G.jsx)(aR.SearchIcon,{}),(0,G.jsx)(aR.Input,{placeholder:a}),(0,G.jsx)(aR.ClearButton,{})]})}),(0,G.jsx)(GB,{children:g.length===0?(0,G.jsx)(GB.Item,{id:`__empty__`,textValue:o,isDisabled:!0,children:(0,G.jsx)(sR,{className:`block truncate text-muted`,children:p?a:o})}):g.map(e=>(0,G.jsxs)(GB.Item,{id:e.id,textValue:e.label,children:[(0,G.jsx)(sR,{className:`block truncate`,children:e.label}),e.id!==E1&&e.id!==e.label?(0,G.jsx)(`span`,{className:`mono mt-0.5 block truncate text-caption text-muted`,children:e.id}):null,(0,G.jsx)(GB.ItemIndicator,{})]},e.id))})]})})]})}function k1(e){return e===`ok`?`success`:e===`streaming`||e===`started`||e===`incomplete`?`warning`:e===`error`||e===`canceled`?`danger`:`default`}function A1(e){if(e===`error`)return`danger`;if(e!==`warn`)return`ok`}function j1(e){return e===`error`?`danger`:e===`warn`?`warning`:e===`info`?`success`:`default`}function M1(e,t=`zh`){if(!e)return`—`;let n=new Date(e);return Number.isFinite(n.getTime())?new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}).format(n):e}function N1(e){let t=e.requested_reasoning?.trim()||``,n=e.resolved_reasoning?.trim()||``;return!t&&!n?``:t&&n&&t!==n?`${t} → ${n}`:n||t}function P1({log:e,inLabel:t,outLabel:n,pointsLabel:r}){let i=e.prompt_tokens,a=e.completion_tokens,o=e.credits??e.usage_detail?.credit,s=o!=null&&Number.isFinite(o)?L1(o):null;return i==null&&a==null&&s==null?(0,G.jsx)(`span`,{className:`mono text-xs text-muted`,children:`—`}):(0,G.jsxs)(`div`,{className:`leading-4`,children:[i!=null||a!=null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`mono text-xs`,children:[i??0,` / `,a??0]}),(0,G.jsxs)(`div`,{className:`mt-0.5 text-caption text-muted`,children:[t,` / `,n]})]}):null,s==null?null:(0,G.jsx)(`div`,{className:`mono text-caption text-success ${i!=null||a!=null?`mt-0.5`:``}`,children:r?r(s):s})]})}function F1(){return(0,G.jsxs)(`div`,{className:`space-y-5`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,G.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:Array.from({length:8},(e,t)=>(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)($,{className:`h-3 w-20`}),(0,G.jsx)($,{className:`h-5 w-36 max-w-full`})]},t))}),(0,G.jsxs)(`div`,{className:`space-y-3 rounded-lg bg-surface-secondary px-3 py-3`,children:[(0,G.jsx)($,{className:`h-3 w-24`}),(0,G.jsx)($,{className:`h-4 w-full`}),(0,G.jsx)($,{className:`h-4 w-4/5`})]}),(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)($,{className:`h-3 w-20`}),(0,G.jsx)($,{className:`h-16 w-full`})]})]})}function I1(e){return e==null?`—`:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function L1(e){return e==null||!Number.isFinite(e)?`—`:String(Math.round(e*1e4)/1e4)}var R1=[`all`,`ok`,`incomplete`,`error`,`canceled`],z1=[`all`,`quota`,`rate_limit`,`auth`,`not_ready`,`unavailable`,`invalid_request`,`model_not_available`],B1=[`all`,`1h`,`24h`,`7d`,`custom`];function V1(e){let t=(e,t,n)=>t.includes(e??``)?e:n,n=dZ(e.get(`from`)),r=dZ(e.get(`to`)),i=n&&r?{start:n,end:r}:null,a=e.get(`stream`);return{requestFilter:t(e.get(`status`),R1,`all`),requestId:e.get(`id`)??``,accountFilter:e.get(`account`)??``,modelFilter:e.get(`model`)??``,providerFilter:e.get(`provider`)??``,streamFilter:a===`stream`||a===`true`?`stream`:a===`sync`||a===`false`?`sync`:`all`,errorKind:t(e.get(`error_kind`),z1,`all`),timeRange:i?`custom`:t(e.get(`range`),B1,`1h`),customRange:i}}function H1(e){let t=new URLSearchParams;e.requestFilter!==`all`&&t.set(`status`,e.requestFilter),e.requestId&&t.set(`id`,e.requestId),e.accountFilter&&t.set(`account`,e.accountFilter),e.modelFilter&&t.set(`model`,e.modelFilter),e.providerFilter&&t.set(`provider`,e.providerFilter),e.streamFilter!==`all`&&t.set(`stream`,e.streamFilter),e.errorKind!==`all`&&t.set(`error_kind`,e.errorKind);let n=e.timeRange===`custom`?uZ(e.customRange?.start):void 0,r=e.timeRange===`custom`?uZ(e.customRange?.end,!0):void 0;return n&&r?(t.set(`from`,n),t.set(`to`,r)):e.timeRange!==`1h`&&t.set(`range`,e.timeRange),t.toString()}function U1(e){if(e===`all`||e===`custom`)return{from:void 0,to:void 0};let t=new Date,n=new Date(t);return e===`1h`&&n.setHours(n.getHours()-1),e===`24h`&&n.setHours(n.getHours()-24),e===`7d`&&n.setDate(n.getDate()-7),{from:n.toISOString(),to:t.toISOString()}}function W1(){let{t:e,lang:t}=DH(),[n,r]=kn(),[i]=(0,v.useState)(()=>V1(new URLSearchParams(window.location.search))),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(`requests`),[d,f]=(0,v.useState)(!0),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(i.requestFilter),[b,x]=(0,v.useState)(`all`),[S,C]=(0,v.useState)(i.requestId),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(i.accountFilter),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(i.modelFilter),[M,N]=(0,v.useState)(i.providerFilter),[P,ee]=(0,v.useState)(i.streamFilter),[F,I]=(0,v.useState)(i.errorKind),[L,te]=(0,v.useState)(i.timeRange),[R,z]=(0,v.useState)(i.customRange),[B,ne]=(0,v.useState)(1),[re,ie]=(0,v.useState)(50),[V,ae]=(0,v.useState)(1),[oe,se]=(0,v.useState)(50),[ce,le]=(0,v.useState)([]),[ue,de]=(0,v.useState)(0),[fe,pe]=(0,v.useState)([]),[me,he]=(0,v.useState)(0),[ge,_e]=(0,v.useState)(null),[ve,ye]=(0,v.useState)(!1),[be,xe]=(0,v.useState)(null),[Se,Ce]=(0,v.useState)(!1),[we,Te]=(0,v.useState)(!1),[Ee,De]=(0,v.useState)(``),Oe=(0,v.useRef)(0),[ke,Ae]=(0,v.useState)(!1),[je,Me]=(0,v.useState)(!1),Ne=n.toString(),Pe=H1({requestFilter:_,requestId:S,accountFilter:E,modelFilter:A,providerFilter:M,streamFilter:P,errorKind:F,timeRange:L,customRange:R}),Fe=(0,v.useRef)(Ne);(0,v.useEffect)(()=>{if(Ne===Fe.current)return;Fe.current=Ne;let e=V1(new URLSearchParams(Ne));y(e.requestFilter),C(e.requestId),D(e.accountFilter),j(e.modelFilter),N(e.providerFilter),ee(e.streamFilter),I(e.errorKind),te(e.timeRange),z(e.customRange)},[Ne]),(0,v.useEffect)(()=>{Pe!==Fe.current&&(Fe.current=Pe,r(Pe,{replace:!0}))},[Pe,r]),(0,v.useEffect)(()=>{let e=!1;return Promise.allSettled([LH(!1),GH()]).then(([t,n])=>{e||(t.status===`fulfilled`&&o(t.value.data||[]),n.status===`fulfilled`&&c(n.value.data||[]))}),()=>{e=!0}},[]);let Ie=(0,v.useMemo)(()=>{let e=new Map;for(let t of a||[])e.set(t.id,t.name||t.id);return e},[a]),Le=(0,v.useMemo)(()=>{let e=new Map;for(let t of a||[])e.set(t.id,{provider:t.provider,region:t.region});return e},[a]);function Re(t){let n=t.account_id?Le.get(t.account_id):void 0,r=t.provider||n?.provider;return r?EZ(r,n?.region,e):`—`}function ze(t){switch(t){case`pin`:return e(`logsRouting_pin`);case`sticky`:return e(`logsRouting_sticky`);case`sticky_escape`:return e(`logsRouting_sticky_escape`);default:return e(`logsRouting_pool`)}}let Be=(0,v.useMemo)(()=>(a||[]).map(e=>({id:e.id,label:e.name||e.id})),[a]),Ve=(0,v.useMemo)(()=>{let t=new Set;for(let e of a||[])e.provider&&t.add(e.provider);return M&&t.add(M),[{id:``,label:e(`logsFilterProviderAll`)},...[...t].sort().map(t=>({id:t,label:TZ(t,e)}))]},[a,M,e]),He=(0,v.useMemo)(()=>{let e=new Map;for(let t of s||[])e.has(t.id)||e.set(t.id,{id:t.id,label:t.display_name||t.id});return[...e.values()]},[s]),Ue=(0,v.useCallback)(async e=>((await rX({q:e||void 0,limit:20,offset:0})).items||[]).map(e=>({id:e.id,label:e.id})),[]),We=!!(S||_!==`all`||E||A||M||P!==`all`||F!==`all`||L!==`1h`),Ge=[_,S,E,A,M,P,F,L,R?.start?.toString()??``,R?.end?.toString()??``,re].join(`\0`),Ke=[b,w,O,oe].join(`\0`),[qe,Je]=(0,v.useState)(Ge),[Ye,Xe]=(0,v.useState)(Ke);qe!==Ge&&(Je(Ge),ne(1)),Ye!==Ke&&(Xe(Ke),ae(1));let Ze=Math.max(1,Math.ceil(ue/re)),Qe=Math.min(qe===Ge?Math.max(1,B):1,Ze);B!==Qe&&ne(Qe);let $e=Math.max(1,Math.ceil(me/oe)),et=Math.min(Ye===Ke?Math.max(1,V):1,$e);V!==et&&ae(et);let tt=(0,v.useCallback)(async(e=!1)=>{e||f(!0);try{let e=S?{from:void 0,to:void 0}:L===`custom`?{from:uZ(R?.start),to:uZ(R?.end,!0)}:U1(L),t=await rX({status:_===`all`?void 0:_,id:S||void 0,account:E||void 0,model:A||void 0,provider:M||void 0,stream:P===`all`?void 0:P===`stream`,error_kind:F===`all`?void 0:F,from:e.from,to:e.to,limit:re,offset:(Qe-1)*re});le(t.items||[]),de(t.total||0),g(``)}catch(t){e||g(t instanceof Error?t.message:String(t))}finally{e||(f(!1),m(!0))}},[_,S,E,A,M,P,F,L,R,Qe,re]),nt=(0,v.useCallback)(async(e=!1)=>{e||f(!0);try{let e=await oX({level:b===`all`?void 0:b,q:w.trim()||void 0,account:O||void 0,limit:oe,offset:(et-1)*oe});pe(e.items||[]),he(e.total??0),g(``)}catch(t){e||g(t instanceof Error?t.message:String(t))}finally{e||(f(!1),m(!0))}},[b,w,O,et,oe]),rt=(0,v.useCallback)(async(e=!1)=>{l===`requests`?await tt(e):await nt(e)},[l,tt,nt]);(0,v.useEffect)(()=>{f(!0);let e=l===`runtime`&&w.trim()?280:0,t=window.setTimeout(()=>void rt(!1),e);return()=>window.clearTimeout(t)},[rt,l,w]),(0,v.useEffect)(()=>{if(l!==`runtime`||et!==1)return;let e=window.setInterval(()=>void nt(!0),3e3);return()=>window.clearInterval(e)},[l,et,nt]);let it=ue===0?0:(Qe-1)*re+1,at=Math.min(ue,Qe*re),ot=me===0?0:(et-1)*oe+1,st=Math.min(me,et*oe),ct=(0,v.useMemo)(()=>l===`requests`?e(`logsShownTotal`,{shown:ce.length?`${it}–${at}`:0,total:ue}):e(`logsShownTotal`,{shown:fe.length?`${ot}–${st}`:0,total:me}),[l,ce.length,fe.length,it,at,ue,ot,st,me,e]);function lt(){C(``),y(`all`),D(``),j(``),N(``),ee(`all`),I(`all`),te(`1h`),z(null),ne(1)}async function ut(e){let t=++Oe.current;xe(e),De(``),Te(!0),Ce(!0);try{let n=await iX(e.id);if(Oe.current!==t)return;xe(n)}catch(e){if(Oe.current!==t)return;De(e instanceof Error?e.message:String(e))}finally{Oe.current===t&&Te(!1)}}function dt(e){_e(e),ye(!0)}async function ft(){Me(!0),JY({id:`logs-clear`,type:`loading`,title:e(`toastClearingLogs`)});try{await aX(),Ae(!1),await tt(!1),JY({id:`logs-clear`,type:`success`,title:e(`toastLogsCleared`)})}catch(t){g(t instanceof Error?t.message:String(t)),JY({id:`logs-clear`,type:`error`,title:e(`toastFailed`),description:t instanceof Error?t.message:String(t)})}finally{Me(!1)}}let pt=d&&(l===`requests`?ce.length===0:fe.length===0);return d&&!p?(0,G.jsx)(CY,{}):(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(`section`,{className:`flex flex-wrap items-end justify-between gap-4 pb-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-title font-semibold`,children:e(`navLogs`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:e(`logsLead`)})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l===`requests`?(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:()=>Ae(!0),isDisabled:je||ue===0,children:[(0,G.jsx)(Ja,{size:14}),e(`logsClear`)]}):null,(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:d,onPress:()=>void rt(!1),children:[(0,G.jsx)(Jr,{size:15}),e(`refresh`)]})]})]}),h?(0,G.jsx)(bU,{title:e(`failedLogs`,{msg:h})}):null,(0,G.jsxs)(LF,{selectedKey:l,onSelectionChange:e=>u(String(e)),children:[(0,G.jsx)(LF.ListContainer,{className:`w-fit`,children:(0,G.jsxs)(LF.List,{children:[(0,G.jsxs)(IF,{id:`requests`,className:`gap-1.5`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),(0,G.jsx)(Ea,{size:13}),e(`logsRequests`)]}),(0,G.jsxs)(IF,{id:`runtime`,className:`gap-1.5`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),(0,G.jsx)(Ka,{size:13}),e(`logsRuntime`)]})]})}),(0,G.jsxs)(LF.Panel,{id:`requests`,"data-tab-panel":`requests`,className:`space-y-4 pt-5`,children:[(0,G.jsxs)(`div`,{className:`data-toolbar flex flex-col gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(qX,{value:_,onChange:e=>y(e),ariaLabel:e(`logsFilterAll`),options:[{id:`all`,label:e(`logsFilterAll`)},{id:`ok`,label:e(`logsFilterOk`)},{id:`incomplete`,label:e(`logsFilterIncomplete`)},{id:`error`,label:e(`logsFilterError`)},{id:`canceled`,label:e(`logsFilterCanceled`)}]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[We?(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:lt,children:e(`clearFilters`)}):null,(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:ct})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(O1,{ariaLabel:e(`logsColAccount`),value:E,onChange:D,options:Be,allLabel:e(`logsFilterAccountAll`),searchPlaceholder:e(`logsSearchAccount`),emptyLabel:e(`logsNoFilterOptions`)}),(0,G.jsx)(O1,{ariaLabel:e(`logsColModel`),value:A,onChange:j,options:He,allLabel:e(`logsFilterModelAll`),searchPlaceholder:e(`logsSearchModel`),emptyLabel:e(`logsNoFilterOptions`)}),(0,G.jsx)(hQ,{ariaLabel:e(`logsColProvider`),value:M,onChange:N,options:Ve}),(0,G.jsx)(O1,{ariaLabel:e(`logsSearchRequestId`),value:S,onChange:C,options:S?[{id:S,label:S}]:[],allLabel:e(`logsFilterIdAll`),searchPlaceholder:e(`logsSearchRequestId`),emptyLabel:e(`logsNoFilterOptions`),loadOptions:Ue,className:`min-w-56`}),(0,G.jsx)(qX,{value:P,onChange:e=>ee(e),ariaLabel:e(`logsFilterStreamAll`),options:[{id:`all`,label:e(`logsFilterStreamAll`)},{id:`stream`,label:e(`logsStreamYes`)},{id:`sync`,label:e(`logsStreamNo`)}]}),(0,G.jsx)(hQ,{ariaLabel:e(`errorKind`),value:F===`all`?``:F,onChange:e=>I(e||`all`),options:[{id:``,label:e(`logsFilterKindAll`)},{id:`quota`,label:e(`logsKindQuota`)},{id:`rate_limit`,label:e(`logsKindRateLimit`)},{id:`auth`,label:e(`logsKindAuth`)},{id:`not_ready`,label:e(`logsKindNotReady`)},{id:`unavailable`,label:e(`logsKindUnavailable`)},{id:`invalid_request`,label:e(`logsKindInvalidRequest`)},{id:`model_not_available`,label:e(`logsKindModelNotAvailable`)}]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:e(`logsTimeRange`)}),(0,G.jsx)(qX,{value:L,onChange:e=>te(e),ariaLabel:e(`logsTimeRange`),options:[{id:`all`,label:e(`logsTimeAll`)},{id:`1h`,label:e(`logsTime1h`)},{id:`24h`,label:e(`logsTime24h`)},{id:`7d`,label:e(`logsTime7d`)},{id:`custom`,label:e(`logsTimeCustom`)}]}),L===`custom`?(0,G.jsx)(fZ,{className:`w-[min(100%,42rem)]`,value:R,onChange:z,ariaLabel:e(`logsTimeRange`),fromLabel:e(`logsTimeFrom`),toLabel:e(`logsTimeTo`)}):null]})]}),(0,G.jsx)(zw,{className:`overflow-hidden p-0`,"aria-busy":d,children:pt?(0,G.jsx)(xY,{}):ce.length===0?(0,G.jsx)(pQ,{icon:(0,G.jsx)(ua,{size:22}),title:e(We?`logsNoMatch`:`logsEmptyRequests`),action:We?(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:lt,children:e(`clearFilters`)}):null}):(0,G.jsx)(Q,{children:(0,G.jsx)(Q.ScrollContainer,{children:(0,G.jsxs)(Q.Content,{"aria-label":e(`logsRequests`),children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:e(`logsColTime`)}),(0,G.jsx)(Q.Column,{children:e(`logsColModel`)}),(0,G.jsx)(Q.Column,{children:e(`logsColReasoning`)}),(0,G.jsx)(Q.Column,{children:e(`logsColProvider`)}),(0,G.jsx)(Q.Column,{children:e(`logsColAccount`)}),(0,G.jsx)(Q.Column,{children:e(`logsColStatus`)}),(0,G.jsx)(Q.Column,{children:e(`logsColStream`)}),(0,G.jsx)(Q.Column,{children:e(`logsColLatency`)}),(0,G.jsx)(Q.Column,{children:e(`logsColTTFT`)}),(0,G.jsx)(Q.Column,{children:e(`logsColTokens`)})]}),(0,G.jsx)(Q.Body,{children:ce.map(n=>(0,G.jsxs)(Q.Row,{className:`cursor-pointer`,onAction:()=>void ut(n),children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`div`,{className:`py-1`,children:[(0,G.jsx)(`div`,{className:`mono text-xs`,children:M1(n.created_at,t)}),(0,G.jsx)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:n.id})]})}),(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`div`,{className:`text-body font-medium`,children:n.requested_model||`—`}),n.mapped_model&&n.mapped_model!==n.requested_model?(0,G.jsx)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:n.mapped_model}):null]}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:N1(n)||`—`})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-xs`,children:Re(n)})}),(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`span`,{className:`text-xs`,children:n.account_id?Ie.get(n.account_id)||n.account_id:`—`}),n.account_id&&Ie.get(n.account_id)&&Ie.get(n.account_id)!==n.account_id?(0,G.jsx)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:n.account_id}):null]}),(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:k1(n.status),children:n.status}),n.error_kind?(0,G.jsx)(`div`,{className:`mono mt-1 text-caption text-muted`,children:n.error_kind}):null]}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-xs text-muted`,children:n.stream?e(`logsStreamYes`):e(`logsStreamNo`)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:I1(n.latency_ms)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:I1(n.ttfb_ms)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(P1,{log:n,inLabel:e(`logsTokensIn`),outLabel:e(`logsTokensOut`),pointsLabel:t=>e(`logsTokensPoints`,{value:t})})})]},n.id))})]})})})}),(0,G.jsx)(yQ,{total:ue,page:Qe,pageCount:Ze,pageSize:re,loading:d,pageSizeLabel:e(`logsPageSize`),pageLabel:e(`logsPage`,{page:Qe,pages:Ze}),prevLabel:e(`logsPrevPage`),nextLabel:e(`logsNextPage`),onPage:ne,onPageSize:ie})]}),(0,G.jsxs)(LF.Panel,{id:`runtime`,"data-tab-panel":`runtime`,className:`space-y-4 pt-5`,children:[(0,G.jsxs)(`div`,{className:`data-toolbar flex flex-wrap items-center justify-between gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(bQ,{className:`sm:w-72`,value:w,onChange:T,placeholder:e(`logsSearchRuntime`),ariaLabel:e(`logsSearchRuntime`)}),(0,G.jsx)(O1,{ariaLabel:e(`logsColAccount`),value:O,onChange:k,options:Be,allLabel:e(`logsFilterAccountAll`),searchPlaceholder:e(`logsSearchAccount`),emptyLabel:e(`logsNoFilterOptions`)}),(0,G.jsx)(qX,{value:b,onChange:e=>x(e),ariaLabel:e(`logsLevelAll`),options:[{id:`all`,label:e(`logsLevelAll`)},{id:`info`,label:e(`logsLevelInfo`)},{id:`warn`,label:e(`logsLevelWarn`)},{id:`error`,label:e(`logsLevelError`)}]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:[et===1?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":`ok`}),e(`logsAutoRefresh`)]}):null,(0,G.jsx)(`span`,{className:`mono`,children:ct})]})]}),(0,G.jsx)(zw,{className:`overflow-hidden p-0`,"aria-busy":d,children:pt?(0,G.jsx)(SY,{}):fe.length===0?(0,G.jsx)(pQ,{icon:(0,G.jsx)(Ka,{size:22}),title:e(`logsEmptyRuntime`)}):(0,G.jsx)(`div`,{className:`divide-y divide-separator`,children:fe.map(e=>(0,G.jsxs)(`div`,{className:`grid cursor-pointer gap-2 px-5 py-3 transition-colors hover:bg-surface-secondary/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:grid-cols-[150px_72px_minmax(0,1fr)] sm:items-start`,role:`button`,tabIndex:0,onClick:()=>dt(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),dt(e))},children:[(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:M1(e.time,t)}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":A1(e.level)}),(0,G.jsx)(`span`,{className:`font-medium text-muted`,children:e.level})]}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[e.account_id?(0,G.jsx)(`div`,{className:`mono mb-1 text-caption text-muted`,children:e.account_id}):null,(0,G.jsx)(`div`,{className:`mono break-all text-xs leading-5 text-foreground`,children:e.message})]})]},e.id))})}),(0,G.jsx)(yQ,{total:me,page:et,pageCount:$e,pageSize:oe,loading:d,pageSizeLabel:e(`logsPageSize`),pageLabel:e(`logsPage`,{page:et,pages:$e}),prevLabel:e(`logsPrevPage`),nextLabel:e(`logsNextPage`),onPage:ae,onPageSize:se})]})]}),(0,G.jsx)(Z.Root,{isOpen:ve,onOpenChange:e=>{ye(e),e||_e(null)},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{size:`lg`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{className:`w-full max-w-4xl`,children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:e(`logsRuntimeDetailTitle`)}),(0,G.jsx)(`p`,{className:`mono mt-1 text-caption text-muted`,children:ge?`#${ge.id}`:`—`})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":e(`close`),className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Body,{className:`space-y-5 px-5 pb-5`,children:[(0,G.jsx)(`dl`,{className:`grid gap-3 sm:grid-cols-2`,children:[[e(`logsColTime`),ge?M1(ge.time,t):`—`],[e(`logsRuntimeLevel`),ge?.level||`—`],[e(`logsRuntimeSource`),ge?.source||`—`],[e(`logsColAccount`),ge?.account_id||`—`]].map(([t,n])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:t}),(0,G.jsx)(`dd`,{className:`mt-1 break-all text-body font-medium`,children:t===e(`logsRuntimeLevel`)&&ge?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:j1(ge.level),children:ge.level}):n})]},String(t)))}),(0,G.jsxs)(`section`,{className:`space-y-2`,children:[(0,G.jsx)(`div`,{className:`text-xs font-medium text-muted`,children:e(`logsRuntimeMessage`)}),(0,G.jsx)(`pre`,{className:`mono max-h-[min(38rem,60vh)] overflow-auto whitespace-pre-wrap break-words rounded-lg bg-surface-secondary px-4 py-3 text-xs leading-6 text-foreground`,children:ge?.message||`—`})]})]})]})})})}),(0,G.jsx)(Z.Root,{isOpen:Se,onOpenChange:e=>{Ce(e),e||(Oe.current+=1,Te(!1),De(``),xe(null))},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{size:`lg`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{className:`w-full max-w-4xl`,children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:e(`logsDetailTitle`)}),(0,G.jsx)(`p`,{className:`mono mt-1 text-caption text-muted`,children:be?.id})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":e(`close`),className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsx)(Z.Body,{className:`space-y-4 px-5 pb-5`,children:we?(0,G.jsx)(F1,{}):Ee?(0,G.jsx)(bU,{title:e(`requestFailed`),description:Ee}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`dl`,{className:`grid gap-3 sm:grid-cols-2`,children:[[[e(`logsColStatus`),be?.status||`—`],[e(`logsColModel`),be?.requested_model||`—`],[e(`logsColReasoning`),be&&N1(be)||`—`],[e(`logsColProvider`),be?Re(be):`—`],[e(`logsColAccount`),be?.account_id?Ie.get(be.account_id)||be.account_id:`—`],[e(`logsColLatency`),I1(be?.latency_ms)],[e(`logsColTTFT`),I1(be?.ttfb_ms)],[e(`logsColStream`),be?.stream?e(`logsStreamYes`):e(`logsStreamNo`)],[e(`logsRouting`),be?ze(be.routing):`—`]].map(([e,t])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e}),(0,G.jsx)(`dd`,{className:`mt-1 break-all text-body font-medium`,children:t})]},String(e))),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e(`logsColTokens`)}),(0,G.jsx)(`dd`,{className:`mt-1`,children:be?(0,G.jsx)(P1,{log:be,inLabel:e(`logsTokensIn`),outLabel:e(`logsTokensOut`),pointsLabel:t=>e(`logsTokensPoints`,{value:t})}):`—`})]})]}),be&&be.message_count?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-3 py-3 text-xs`,children:[(0,G.jsx)(`div`,{className:`font-medium text-muted`,children:e(`logsMessageShape`)}),(0,G.jsxs)(`dl`,{className:`mt-2 grid gap-2 sm:grid-cols-2`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e(`logsMessageCount`)}),(0,G.jsx)(`dd`,{className:`mono mt-0.5`,children:be.message_count})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e(`logsEmptyMessageIndexes`)}),(0,G.jsx)(`dd`,{className:`mono mt-0.5 break-all`,children:be.empty_message_indexes?.length?be.empty_message_indexes.join(`, `):`—`})]}),(0,G.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e(`logsMessageRoles`)}),(0,G.jsx)(`dd`,{className:`mono mt-0.5 break-all`,children:be.message_roles?.join(` → `)||`—`})]})]})]}):null,be?.error_message?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-3 py-2 text-xs leading-5 text-muted`,children:[be.error_kind?(0,G.jsx)(`span`,{className:`mono mr-2 text-muted`,children:be.error_kind}):null,be.error_message]}):null,be?.stream_diagnostic?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-3 py-3 text-xs`,children:[(0,G.jsx)(`div`,{className:`font-medium text-muted`,children:e(`logsStreamDiagnostics`)}),(0,G.jsx)(`dl`,{className:`mt-2 grid gap-2 sm:grid-cols-2`,children:[[e(`logsCancellationSource`),be.stream_diagnostic.cancellation_source||`—`],[e(`logsUpstreamStatus`),be.stream_diagnostic.upstream_status??`—`],[e(`logsSSEEvents`),be.stream_diagnostic.sse_event_count],[e(`logsBytesRead`),be.stream_diagnostic.bytes_read],[e(`logsLastEvent`),be.stream_diagnostic.last_event||`—`],[e(`logsStreamComplete`),be.stream_diagnostic.saw_done?`yes`:`no`]].map(([e,t])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e}),(0,G.jsx)(`dd`,{className:`mono mt-0.5 break-all`,children:t})]},String(e)))}),be.stream_diagnostic.context_err||be.stream_diagnostic.relay_error?(0,G.jsxs)(`div`,{className:`mt-2 space-y-1 break-all text-muted`,children:[be.stream_diagnostic.context_err?(0,G.jsxs)(`div`,{children:[`context: `,be.stream_diagnostic.context_err]}):null,be.stream_diagnostic.relay_error?(0,G.jsxs)(`div`,{children:[`relay: `,be.stream_diagnostic.relay_error]}):null]}):null]}):null,be?.usage_detail?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-3 py-3 text-xs`,children:[(0,G.jsx)(`div`,{className:`font-medium text-muted`,children:e(`logsUsageDetail`)}),(0,G.jsx)(`dl`,{className:`mt-2 grid gap-2 sm:grid-cols-2`,children:[[e(`logsCreditConsumed`),`${L1(be.usage_detail.credit)} ${be.usage_detail.unit||`credits`}`],[e(`logsColProvider`),be.usage_detail.provider||`—`]].map(([e,t])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e}),(0,G.jsx)(`dd`,{className:`mono mt-0.5 break-all`,children:t})]},String(e)))})]}):null,(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-xs font-medium text-muted`,children:e(`logsAttempts`)}),be?.attempts?.length?(0,G.jsx)(`div`,{className:`mt-2 divide-y divide-separator overflow-hidden rounded-lg bg-surface-secondary`,children:be.attempts.map(e=>(0,G.jsxs)(`div`,{className:`grid gap-1 px-3 py-2.5 text-xs sm:grid-cols-[48px_minmax(0,1fr)_auto]`,children:[(0,G.jsxs)(`div`,{className:`mono text-muted`,children:[`#`,e.attempt_index]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`font-medium`,children:e.account_id||`—`}),(0,G.jsx)(`div`,{className:`mt-0.5 text-muted`,children:e.error_message||e.status})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:k1(e.status===`failover`?`canceled`:e.status),children:e.status})]},e.id))}):(0,G.jsx)(`p`,{className:`mt-2 text-xs text-muted`,children:e(`logsNoAttempts`)})]})]})})]})})})}),(0,G.jsx)(K$,{isOpen:ke,title:e(`logsClear`),description:e(`logsClearConfirm`),confirmLabel:e(`logsClear`),cancelLabel:e(`close`),closeLabel:e(`close`),isPending:je,onClose:()=>Ae(!1),onConfirm:()=>void ft()})]})}function G1(){return FH(`/api/usage/pricing`)}function K1(e={}){let t=new URLSearchParams;return e.from&&t.set(`from`,e.from),e.to&&t.set(`to`,e.to),FH(`/api/usage/cost${t.toString()?`?${t}`:``}`)}var q1=(0,v.lazy)(()=>C(()=>import(`./CostChart-zKBs-QQq.js`).then(e=>({default:e.CostChart})),__vite__mapDeps([5,1,4,2]))),J1={window:{from:``,to:``,hours:24},currency:`CNY`,models:[],totals:{id:`total`,label:``,vendor:``,currency:`CNY`,requests:0,cache_hit:0,cache_miss:0,output:0,total_tokens:0,cost:0,cost_off_peak:0,cost_peak:0,peak_requests:0,credits:0,priced:!1},series:[]};function Y1(e,t){if(!t)return`0%`;let n=e/t*100;return`${n>=10?n.toFixed(0):n.toFixed(1)}%`}function X1(){let{t:e,lang:t}=DH(),[n,r]=(0,v.useState)(`all`),[i,a]=(0,v.useState)(`credits`),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!0),[f,p]=(0,v.useState)(``);(0,v.useEffect)(()=>{let e=!1;return G1().then(t=>{e||l(t)}).catch(()=>{}),()=>{e=!0}},[]);let m=(0,v.useCallback)(async()=>{d(!0);try{let e=await K1(n===`all`?{}:{from:new Date(Date.now()-Number(n)*3600*1e3).toISOString(),to:new Date().toISOString()});s(e),p(``)}catch(e){s(null),p(e instanceof Error?e.message:String(e))}finally{d(!1)}},[n]);(0,v.useEffect)(()=>{m()},[m]);let h=o??J1,g=h.totals,_=g.requests>0&&h.models.length>0,y=h.models.filter(e=>e.priced),b=g.cost>0,x=[{label:e(`usageCredits`),value:_X(g.credits),detail:e(`usageCreditsHint`)},{label:e(`usageTotalTokens`),value:sX(g.total_tokens),detail:`${sX(g.cache_hit)} / ${sX(g.cache_miss)} / ${sX(g.output)} ${e(`usageTokenSplitNote`)}`},{label:e(`usageRequests`),value:String(g.requests),detail:e(`usageModelCount`,{count:h.models.length})},{label:e(`usageCacheHitRate`),value:Y1(g.cache_hit,g.cache_hit+g.cache_miss),detail:sX(g.cache_hit)}],S=i===`credits`?_X(g.credits):i===`tokens`?sX(g.total_tokens):hX(g.cost);return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(`section`,{className:`flex flex-wrap items-center justify-end gap-3 pb-2`,children:[(0,G.jsx)(qX,{value:n,onChange:e=>r(e),ariaLabel:e(`usageWindow`),options:[{id:`24`,label:e(`usageWindow24h`)},{id:`168`,label:e(`usageWindow7d`)},{id:`all`,label:e(`usageWindowTotal`)}]}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,onPress:()=>void m(),isDisabled:u,children:[(0,G.jsx)(Jr,{size:14}),e(`refresh`)]})]}),f?(0,G.jsx)(bU,{title:e(`failedStats`,{msg:f})}):null,(0,G.jsx)(`section`,{className:`grid gap-3 sm:grid-cols-2 sm:gap-4 xl:grid-cols-4`,children:x.map(e=>(0,G.jsxs)(zw,{className:`gap-0 p-4`,children:[(0,G.jsx)(`div`,{className:`text-body text-muted`,children:e.label}),(0,G.jsx)(`div`,{className:`tabular mt-1.5 text-section font-semibold`,children:u?(0,G.jsx)($,{className:`h-5 w-16`}):e.value}),(0,G.jsx)(`div`,{className:`mono mt-1 truncate text-caption text-muted`,children:u?(0,G.jsx)($,{className:`h-3 w-24`}):e.detail||`\xA0`})]},e.label))}),(0,G.jsxs)(zw,{className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-separator px-5 py-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold tracking-[-0.015em]`,children:e(`usageChartTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:e(`usageChartHint`)})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(qX,{value:i,onChange:e=>a(e),ariaLabel:e(`usageChartMetric`),options:[{id:`credits`,label:e(`usageColCredits`)},{id:`tokens`,label:e(`usageColTokens`)}]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`default`,children:S})]})]}),(0,G.jsx)(`div`,{className:`p-5`,children:u?(0,G.jsx)(`div`,{className:`grid h-72 place-items-center`,children:(0,G.jsx)($,{className:`h-56 w-full`})}):_?(0,G.jsx)(v.Suspense,{fallback:(0,G.jsx)(`div`,{className:`grid h-72 place-items-center`,children:(0,G.jsx)($,{className:`h-56 w-full`})}),children:(0,G.jsx)(q1,{series:h.series,models:h.models,lang:t,emptyLabel:e(`usageChartEmpty`),totalLabel:e(`usageTotals`),metric:i})}):(0,G.jsx)(pQ,{title:e(`usageEmpty`),hint:e(`usageRetentionHint`)})})]}),(0,G.jsxs)(zw,{className:`overflow-hidden p-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-5 py-4`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold tracking-[-0.015em]`,children:e(`usageBreakdownTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:e(`usageBreakdownHint`)})]})}),u?(0,G.jsx)(`div`,{className:`space-y-3 p-5`,children:[0,1,2].map(e=>(0,G.jsx)($,{className:`h-9 w-full`},e))}):_?(0,G.jsx)(Q,{children:(0,G.jsx)(Q.ScrollContainer,{children:(0,G.jsxs)(Q.Content,{"aria-label":e(`usageBreakdownTitle`),children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:e(`usageColModel`)}),(0,G.jsx)(Q.Column,{children:e(`usageColRequests`)}),(0,G.jsx)(Q.Column,{children:e(`usageColInputHit`)}),(0,G.jsx)(Q.Column,{children:e(`usageColInputMiss`)}),(0,G.jsx)(Q.Column,{children:e(`usageColOutput`)}),(0,G.jsx)(Q.Column,{children:e(`usageColTokens`)}),(0,G.jsx)(Q.Column,{children:e(`usageColCredits`)})]}),(0,G.jsxs)(Q.Body,{children:[h.models.map(e=>(0,G.jsxs)(Q.Row,{children:[(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:e.label}),(0,G.jsx)(`div`,{className:`mono mt-0.5 text-[10px] text-muted`,children:e.id})]}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:e.requests})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:sX(e.cache_hit)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:sX(e.cache_miss)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:sX(e.output)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:sX(e.total_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:_X(e.credits)})})]},e.id)),(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-sm font-semibold`,children:e(`usageTotals`)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:g.requests})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:sX(g.cache_hit)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:sX(g.cache_miss)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:sX(g.output)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:sX(g.total_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:_X(g.credits)})})]})]})]})})}):(0,G.jsx)(pQ,{title:e(`usageEmpty`),hint:e(`usageRetentionHint`)})]}),(0,G.jsx)(Ih,{className:`rounded-xl bg-surface-secondary`,hideSeparator:!0,defaultExpandedKeys:[],children:(0,G.jsxs)(Ih.Item,{id:`deepseek-estimate`,children:[(0,G.jsx)(Ih.Heading,{children:(0,G.jsxs)(Ih.Trigger,{className:`items-center gap-3 px-5 py-4 text-left`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block font-semibold tracking-[-0.015em]`,children:e(`usageEstimateTitle`)}),(0,G.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted`,children:e(`usageEstimateHint`)})]}),b?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`default`,children:hX(g.cost)}):null,(0,G.jsx)(Ih.Indicator,{})]})}),(0,G.jsx)(Ih.Panel,{children:(0,G.jsxs)(Ih.Body,{className:`space-y-5 px-5 pb-5`,children:[(0,G.jsx)(`p`,{className:`text-xs leading-6 text-muted`,children:e(`usageRenderNote`)}),b?(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,G.jsx)(`h4`,{className:`text-sm font-medium`,children:e(`usageEstimateChartTitle`)}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`default`,children:hX(g.cost)})]}),(0,G.jsx)(v.Suspense,{fallback:(0,G.jsx)($,{className:`h-56 w-full`}),children:(0,G.jsx)(q1,{series:h.series,models:y.length?y:h.models,lang:t,emptyLabel:e(`usageEstimateChartEmpty`),totalLabel:e(`usageTotals`),metric:`cost`})})]}):null,y.length?(0,G.jsx)(Q,{children:(0,G.jsx)(Q.ScrollContainer,{children:(0,G.jsxs)(Q.Content,{"aria-label":e(`usageEstimateTitle`),children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:e(`usageColModel`)}),(0,G.jsx)(Q.Column,{children:e(`usageColSplit`)}),(0,G.jsx)(Q.Column,{children:e(`usageColCost`)})]}),(0,G.jsxs)(Q.Body,{children:[y.map(e=>(0,G.jsxs)(Q.Row,{children:[(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:e.label}),(0,G.jsx)(`div`,{className:`mono mt-0.5 text-[10px] text-muted`,children:e.id})]}),(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`span`,{className:`mono text-xs text-muted`,children:[hX(e.cost_peak),` / `,hX(e.cost_off_peak)]})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-sm font-semibold`,children:hX(e.cost)})})]},e.id)),(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-sm font-semibold`,children:e(`usageTotals`)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`span`,{className:`mono text-xs text-muted`,children:[hX(g.cost_peak),` / `,hX(g.cost_off_peak)]})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-sm font-semibold`,children:hX(g.cost)})})]})]})]})})}):(0,G.jsx)(`p`,{className:`text-xs text-muted`,children:e(`usageEstimateChartEmpty`)}),(0,G.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{className:`mb-2 text-sm font-medium`,children:e(`usagePriceTitle`)}),(0,G.jsx)(`p`,{className:`mb-3 text-xs text-muted`,children:e(`usagePeakNote`)}),(0,G.jsxs)(`div`,{className:`divide-y divide-separator rounded-lg bg-background`,children:[(c?.models??[]).map(t=>(0,G.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:t.label}),(0,G.jsx)(`span`,{className:`mono text-[10px] text-muted`,children:t.currency})]}),(0,G.jsx)(`div`,{className:`mono mt-1 text-[10px] text-muted`,children:t.id}),(0,G.jsxs)(`div`,{className:`mt-2 grid grid-cols-2 gap-2 text-[11px]`,children:[(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-2.5 py-2`,children:[(0,G.jsx)(`div`,{className:`text-[10px] text-muted`,children:e(`usagePriceBandOff`)}),(0,G.jsxs)(`div`,{className:`mono mt-0.5`,children:[gX(t.off_peak.cache_hit),` · `,gX(t.off_peak.cache_miss),` · `,gX(t.off_peak.output)]}),(0,G.jsxs)(`div`,{className:`mt-1 text-[9px] text-muted`,children:[e(`usagePriceHit`),` · `,e(`usagePriceMiss`),` · `,e(`usagePriceOutput`)]})]}),(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-2.5 py-2`,children:[(0,G.jsx)(`div`,{className:`text-[10px] text-muted`,children:e(`usagePriceBandPeak`)}),(0,G.jsxs)(`div`,{className:`mono mt-0.5`,children:[gX(t.peak.cache_hit),` · `,gX(t.peak.cache_miss),` · `,gX(t.peak.output)]}),(0,G.jsxs)(`div`,{className:`mt-1 text-[9px] text-muted`,children:[e(`usagePriceHit`),` · `,e(`usagePriceMiss`),` · `,e(`usagePriceOutput`)]})]})]})]},t.id)),c?.models?.length?null:(0,G.jsx)(`div`,{className:`px-4 py-6 text-sm text-muted`,children:e(`usageEmpty`)})]})]}),(0,G.jsxs)(`div`,{className:`space-y-3 text-xs leading-6 text-muted`,children:[(0,G.jsx)(`h4`,{className:`text-sm font-medium text-foreground`,children:e(`usageNoteTitle`)}),(0,G.jsx)(`p`,{children:e(`usageRetentionHint`)}),(0,G.jsx)(`p`,{children:e(`usagePeakNote`)}),h.unpriced?.length?(0,G.jsx)(`p`,{children:e(`usageUnpricedHint`,{models:h.unpriced.join(`, `)})}):null,c?.note?(0,G.jsx)(`p`,{className:`mono text-[10px]`,children:c.note}):null]})]})]})})]})})]})}var Z1=500,Q1={model:`model`,account:`account`,provider:`provider`};function $1(e,t,n){let r=e.prompt_tokens??0,i=e.completion_tokens??0,a=e.key===`(unknown)`||e.key===`(unassigned)`||!e.key;return{key:e.key,label:n,count:e.count,success:e.count?e.ok/e.count:0,p95:e.latency_p95_ms??null,tokens:r+i,prompt:r,completion:i,credits:e.credits??0,cache_write:e.cache_write_tokens??0,cache_read:e.cache_read_tokens??0,filter:a?void 0:{[Q1[t]]:e.key}}}function e0(e,t,n){let r=n===`ascending`?1:-1;return[...e].sort((e,n)=>{if(t===`label`)return r*e.label.localeCompare(n.label);let i=e[t],a=n[t];return i==null&&a==null?0:i==null?1:a==null?-1:r*(i-a)||e.label.localeCompare(n.label)})}function t0(e){return e?e>=1e3?sX(e):String(Math.round(e*100)/100):`0`}function n0(){let{t:e}=DH(),t=ot(),[n,r]=(0,v.useState)(`stats`),[i,a]=(0,v.useState)(`model`),[o,s]=(0,v.useState)(`24`),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(!0),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)([]),[y,b]=(0,v.useState)(`count`),[x,S]=(0,v.useState)(`descending`),C=(0,v.useRef)(0);(0,v.useEffect)(()=>{let e=!1;return LH(!1).then(t=>{e||_(t.data||[])}).catch(()=>{}),()=>{e=!0}},[]);let w=c?.start?.toString()??``,T=c?.end?.toString()??``;(0,v.useEffect)(()=>{let e=mZ(o,c);if(!e){p(!1);return}let t=++C.current;tX({...e,dim:[i],limit:Z1}).then(e=>{t===C.current&&(d(e),h(``))}).catch(e=>{t===C.current&&(d(null),h(e instanceof Error?e.message:String(e)))}).finally(()=>{t===C.current&&p(!1)})},[i,o,w,T]);let E=(0,v.useMemo)(()=>{let t=new Map(g.map(e=>[e.id,e.name||e.id]));return e0(((i===`model`?u?.models:i===`account`?u?.accounts:u?.providers)??[]).map(n=>{let r=n.key===`(unknown)`?e(`statsUnknown`):n.key===`(unassigned)`?e(`statsUnassigned`):i===`account`?t.get(n.key)||n.key:i===`provider`?TZ(n.key,e):n.key;return $1(n,i,r)}),y,x)},[u,i,g,y,x,e]),D=u?.totals,O=u?.tokens,k=[{id:`label`,label:e(i===`model`?`logsColModel`:i===`account`?`logsColAccount`:`logsColProvider`)},{id:`count`,label:e(`usageColRequests`),numeric:!0},{id:`success`,label:e(`usageColSuccess`),numeric:!0},{id:`p95`,label:e(`statsLatencyP95`),numeric:!0},{id:`tokens`,label:e(`usageColTokens`),numeric:!0},{id:`cache_write`,label:e(`usageColCacheWrite`),numeric:!0},{id:`credits`,label:e(`usageColCredits`),numeric:!0}],A=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`section`,{className:`flex flex-wrap items-center justify-end gap-3 pb-1`,children:(0,G.jsx)(hZ,{value:o,onChange:s,custom:c,onCustomChange:l,onBusy:()=>p(!0),t:e})}),m?(0,G.jsx)(bU,{title:e(`failedStats`,{msg:m})}):null,(0,G.jsx)(`section`,{className:`grid gap-3 sm:grid-cols-2 sm:gap-4 xl:grid-cols-5`,children:[[e(`usageColRequests`),D?sX(D.requests):`—`,e(`statsWindowHint`,{window:e(pZ[o])})],[e(`usageColSuccess`),D?uX(D.success_rate):`—`,D?`${D.ok} / ${D.requests}`:``],[e(`usageColTokens`),O?sX(O.total):`—`,O?`${sX(O.prompt)} / ${sX(O.completion)}`:``],[e(`usageColCacheWrite`),O?sX(O.cache_write??0):`—`,O?`${e(`chartCacheRead`)} ${sX(O.cache_read)}`:``],[e(`usageColCredits`),D?t0(D.credits??0):`—`,``]].map(([e,t,n])=>(0,G.jsxs)(zw,{className:`gap-0 p-4`,children:[(0,G.jsx)(`div`,{className:`text-body text-muted`,children:e}),(0,G.jsx)(`div`,{className:`tabular mt-1.5 text-section font-semibold`,children:f?(0,G.jsx)($,{className:`h-5 w-16`}):t}),(0,G.jsx)(`div`,{className:`mono mt-1 truncate text-caption text-muted`,children:f?(0,G.jsx)($,{className:`h-3 w-24`}):n||`\xA0`})]},e))}),(0,G.jsxs)(zw,{className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-separator px-5 py-3 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between`,children:[(0,G.jsx)(LF,{selectedKey:i,onSelectionChange:e=>{p(!0),a(String(e))},children:(0,G.jsx)(LF.ListContainer,{className:`w-fit`,children:(0,G.jsxs)(LF.List,{"aria-label":e(`usageTitle`),children:[(0,G.jsxs)(IF,{id:`model`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),(0,G.jsx)(Mi,{size:14}),e(`usageByModel`)]}),(0,G.jsxs)(IF,{id:`account`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),(0,G.jsx)(no,{size:14}),e(`usageByAccount`)]}),(0,G.jsxs)(IF,{id:`provider`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),(0,G.jsx)(Ba,{size:14}),e(`usageByProvider`)]})]})})}),(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:f?``:e(`usageRowCount`,{count:E.length})})]}),f?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`divide-y divide-separator md:hidden`,"aria-busy":`true`,children:Array.from({length:4},(e,t)=>(0,G.jsxs)(`div`,{className:`space-y-3 px-5 py-4`,children:[(0,G.jsx)($,{className:`h-4 w-40`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:Array.from({length:4},(e,t)=>(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)($,{className:`h-3 w-12`}),(0,G.jsx)($,{className:`h-4 w-16`})]},t))})]},t))}),(0,G.jsx)(`div`,{className:`hidden divide-y divide-separator md:block`,"aria-busy":`true`,children:Array.from({length:6},(e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-6 px-5 py-3.5`,children:[(0,G.jsx)($,{className:`h-4 w-40`}),(0,G.jsx)(`div`,{className:`flex-1`}),Array.from({length:6},(e,t)=>(0,G.jsx)($,{className:`h-4 w-14`},t))]},t))})]}):E.length===0?(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-5 py-10 text-body text-muted`,children:[(0,G.jsx)(mi,{size:16}),e(`usageEmpty`)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`divide-y divide-separator md:hidden`,children:E.map(n=>{let r=!!(n.filter&&u),a=[{label:e(`usageColRequests`),value:String(n.count)},{label:e(`usageColSuccess`),value:uX(n.success),tone:n.success<.9?`text-warning`:void 0},{label:e(`statsLatencyP95`),value:cX(n.p95)},{label:e(`usageColTokens`),value:sX(n.tokens),sub:`${sX(n.prompt)} / ${sX(n.completion)}`},{label:e(`usageColCacheWrite`),value:sX(n.cache_write)},{label:e(`usageColCredits`),value:t0(n.credits)}];return(0,G.jsxs)(`article`,{className:`space-y-3 px-5 py-4 ${r?`cursor-pointer`:``}`,onClick:r?()=>t(gZ(n.filter??{},u.window.from,u.window.to)):void 0,onKeyDown:r?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t(gZ(n.filter??{},u.window.from,u.window.to)))}:void 0,role:r?`button`:void 0,tabIndex:r?0:void 0,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[i===`provider`&&n.filter?(0,G.jsx)(zZ,{provider:n.key,size:14}):null,(0,G.jsx)(`span`,{className:`truncate text-body font-medium`,children:n.label})]}),i===`account`&&n.label!==n.key?(0,G.jsx)(`div`,{className:`mono truncate text-caption text-muted`,children:n.key}):null,(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:a.map(e=>(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e.label}),(0,G.jsx)(`div`,{className:`mono text-body ${e.tone??`text-foreground`}`,children:e.value}),`sub`in e&&e.sub?(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:e.sub}):null]},e.label))})]},n.key)})}),(0,G.jsx)(Q,{className:`usage-table hidden md:block`,children:(0,G.jsx)(Q.ScrollContainer,{className:`min-w-0 overflow-x-auto`,children:(0,G.jsxs)(Q.Content,{"aria-label":e(`usageTitle`),className:`min-w-[48rem]`,sortDescriptor:{column:y,direction:x},onSortChange:e=>{b(String(e.column)),S(e.direction)},children:[(0,G.jsx)(Q.Header,{children:k.map(e=>(0,G.jsx)(Q.Column,{id:e.id,allowsSorting:!0,isRowHeader:e.id===`label`,className:e.numeric?`text-right`:void 0,children:({sortDirection:t})=>(0,G.jsx)(Q.SortableColumnHeader,{sortDirection:t,className:e.numeric?`justify-end`:void 0,children:e.label})},e.id))}),(0,G.jsx)(Q.Body,{children:E.map(e=>(0,G.jsxs)(Q.Row,{id:e.key,className:e.filter&&u?`cursor-pointer`:void 0,onAction:e.filter&&u?()=>t(gZ(e.filter??{},u.window.from,u.window.to)):void 0,children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[i===`provider`&&e.filter?(0,G.jsx)(zZ,{provider:e.key,size:14}):null,(0,G.jsx)(`span`,{className:`truncate text-body font-medium`,children:e.label}),i===`account`&&e.label!==e.key?(0,G.jsx)(`span`,{className:`mono truncate text-caption text-muted`,children:e.key}):null]})}),(0,G.jsx)(Q.Cell,{className:`mono text-right text-body`,children:e.count}),(0,G.jsx)(Q.Cell,{className:`mono text-right text-body`,children:(0,G.jsx)(`span`,{className:e.success<.9?`text-warning`:void 0,children:uX(e.success)})}),(0,G.jsx)(Q.Cell,{className:`mono text-right text-body`,children:cX(e.p95)}),(0,G.jsxs)(Q.Cell,{className:`text-right`,children:[(0,G.jsx)(`div`,{className:`mono text-body`,children:sX(e.tokens)}),(0,G.jsxs)(`div`,{className:`mono text-caption text-muted`,children:[sX(e.prompt),` / `,sX(e.completion)]})]}),(0,G.jsx)(Q.Cell,{className:`mono text-right text-body`,children:sX(e.cache_write)}),(0,G.jsx)(Q.Cell,{className:`mono text-right text-body`,children:t0(e.credits)})]},e.key))})]})})})]})]})]});return(0,G.jsxs)(`div`,{className:`space-y-6 sm:space-y-6`,children:[(0,G.jsxs)(`section`,{className:`pb-1`,children:[(0,G.jsx)(`h2`,{className:`text-title font-semibold`,children:e(`usageTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:e(n===`cost`?`usageCostLead`:`usageLead`)})]}),(0,G.jsxs)(LF,{selectedKey:n,onSelectionChange:e=>r(String(e)),children:[(0,G.jsx)(LF.ListContainer,{className:`w-fit`,children:(0,G.jsxs)(LF.List,{"aria-label":e(`usageTitle`),children:[(0,G.jsxs)(IF,{id:`stats`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),e(`usageStatsTab`)]}),(0,G.jsxs)(IF,{id:`cost`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),e(`usageCostTab`)]})]})}),(0,G.jsx)(LF.Panel,{id:`stats`,className:`space-y-6 pt-5`,children:A}),(0,G.jsx)(LF.Panel,{id:`cost`,className:`pt-5`,children:(0,G.jsx)(X1,{})})]})]})}var r0=1.1;function i0({label:e,onConfirm:t,isPending:n,children:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>{a.current?.kill()},[]),(0,G.jsxs)(eL,{delay:300,children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsxs)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,"aria-label":e,isPending:n,className:`relative overflow-hidden`,onPressStart:()=>{let e=i.current;!e||n||(a.current?.kill(),a.current=eY.to(e,{scaleX:1,duration:r0*(1-Number(eY.getProperty(e,`scaleX`))),ease:nY.linear,onComplete:()=>{a.current=null,eY.to(e,{scaleX:0,duration:iY()?0:tY.base,ease:nY.out,delay:tY.fast}),t()}}))},onPressEnd:()=>{let e=i.current;!e||!a.current||(a.current.kill(),a.current=null,eY.to(e,{scaleX:0,duration:iY()?0:tY.base,ease:nY.soft}))},children:[(0,G.jsx)(`span`,{ref:i,"aria-hidden":!0,className:`pointer-events-none absolute inset-0 origin-left scale-x-0 bg-danger/20`}),(0,G.jsx)(`span`,{className:`relative inline-flex`,children:r})]})}),(0,G.jsx)(eL.Content,{children:e})]})}function a0(e){let t=[];for(let n of e)for(let e of n.regions||[])e?.id&&t.push({value:`${n.id}:${e.id}`,provider:n.id,region:e.id});return t}function o0(e,t){let n=e.indexOf(`:`),r=n===-1?e:e.slice(0,n),i=n===-1?``:e.slice(n+1);return i?EZ(r,i,t):TZ(r,t)}function s0(e){let t=e.indexOf(`:`);return t===-1?e:e.slice(0,t)}function c0(e,t){let n=[],r=new Set(e.filter(e=>!e.includes(`:`)).map(e=>e.toLowerCase()));for(let t of e)t.includes(`:`)&&n.push(t);for(let e of t)r.has(e.provider)&&!n.includes(e.value)&&n.push(e.value);return n}function l0(e,t){return e.length?e.map(e=>o0(e,t)).join(` · `):t(`keysAllProviders`)}function u0(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function d0(){let{t:e}=DH(),[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(!0),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(!1);(0,v.useEffect)(()=>{tU().then(e=>{let t=a0(e.data||[]);n(t),i(t.length>0),o(``)}).catch(e=>{o(e instanceof Error?e.message:String(e))})},[]);async function w(){u(!0);try{let e=await p1();c(e.data||[]),m(``)}catch(e){m(e instanceof Error?e.message:String(e))}finally{u(!1)}}(0,v.useEffect)(()=>{let e=window.setTimeout(()=>void w(),0);return()=>window.clearTimeout(e)},[]);async function T(e){await NQ(e),C(!0),window.setTimeout(()=>C(!1),1200)}async function E(e,t){f(e.id),c(n=>n.map(n=>n.id===e.id?{...n,enabled:t}:n));try{let n=await h1(e.id,{enabled:t});c(t=>t.map(t=>t.id===e.id?{...t,...n,secret:void 0}:t))}catch(e){m(e instanceof Error?e.message:String(e)),await w()}finally{f(``)}}async function D(t){f(t.id);try{await g1(t.id),c(e=>e.filter(e=>e.id!==t.id)),JY({type:`success`,title:e(`toastKeyDeleted`)})}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(``)}}return l&&!s.length?(0,G.jsx)(yY,{}):(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(`section`,{className:`flex flex-wrap items-end justify-between gap-4 pb-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{"data-gsap-reveal":!0,className:`text-title font-semibold`,children:e(`navKeys`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:e(`keysLead`)})]}),(0,G.jsxs)(X,{size:`sm`,isDisabled:!r,onPress:()=>g(!0),children:[(0,G.jsx)(wa,{size:14}),e(`keysCreate`)]})]}),p?(0,G.jsx)(bU,{title:p}):null,a?(0,G.jsx)(bU,{title:e(`keysProvidersLoadFailed`,{message:a})}):null,l?(0,G.jsx)(`section`,{className:`grid gap-2.5 lg:grid-cols-2 xl:grid-cols-3`,"aria-busy":!0,children:Array.from({length:Math.max(3,s.length)},(e,t)=>(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface p-3`,children:[(0,G.jsx)($,{className:`h-4 w-28`}),(0,G.jsx)($,{className:`mt-2 h-3 w-40`}),(0,G.jsx)($,{className:`mt-4 h-6 w-24`}),(0,G.jsx)($,{className:`mt-6 h-8 w-full`})]},t))}):s.length?(0,G.jsx)(`section`,{className:`grid gap-2.5 lg:grid-cols-2 xl:grid-cols-3`,children:s.map(t=>(0,G.jsxs)(zw,{className:`overflow-hidden p-0`,children:[(0,G.jsxs)(zw.Header,{className:`flex-row items-start justify-between gap-3 px-3 pt-3 pb-2.5`,children:[(0,G.jsx)(`div`,{className:`min-w-0`,children:(0,G.jsx)(zw.Title,{className:`truncate text-body`,children:t.name})}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:t.enabled?`success`:`default`,children:t.enabled?e(`enabled`):e(`disabled`)})]}),(0,G.jsxs)(zw.Content,{className:`space-y-2.5 px-3 pb-2.5`,children:[(0,G.jsx)(`div`,{className:`mono w-full rounded-lg bg-surface-secondary px-3 py-2 text-body text-foreground`,title:t.prefix,children:t.prefix}),(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:(t.providers.length?t.providers:[`all`]).map(t=>(0,G.jsx)(lT,{size:`sm`,variant:`soft`,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t===`all`?(0,G.jsx)(na,{size:12}):(0,G.jsx)(zZ,{provider:s0(t),size:12}),(0,G.jsx)(`span`,{children:t===`all`?e(`keysAllProviders`):o0(t,e)})]})},t))}),(0,G.jsx)(`p`,{className:`text-caption leading-5 text-muted`,children:t.last_used_at?e(`keysLastUsed`,{time:u0(t.last_used_at)}):e(`keysNeverUsed`)})]}),(0,G.jsxs)(zw.Footer,{className:`gap-1.5 bg-surface-secondary px-3 py-2`,children:[(0,G.jsx)(X,{size:`sm`,variant:`ghost`,isDisabled:!r,onPress:()=>y(t),children:e(`edit`)}),(0,G.jsx)(i0,{label:e(`holdToDelete`),isPending:d===t.id,onConfirm:()=>void D(t),children:(0,G.jsx)(Ja,{size:14})}),(0,G.jsx)(`div`,{className:`ml-auto`,children:(0,G.jsx)(fQ,{isSelected:t.enabled,isDisabled:d===t.id,ariaLabel:e(`enable`),onChange:e=>void E(t,e)})})]})]},t.id))}):(0,G.jsx)(pQ,{className:`rounded-3xl bg-surface-secondary`,icon:(0,G.jsx)(uY,{size:28}),title:e(`keysEmpty`),hint:e(`keysEmptyHint`),action:(0,G.jsxs)(X,{size:`sm`,isDisabled:!r,onPress:()=>g(!0),children:[(0,G.jsx)(wa,{size:14}),e(`keysCreate`)]})}),(0,G.jsx)(f0,{isOpen:h,title:e(`keysCreateTitle`),hint:e(`keysCreateHint`),options:t,t:e,onClose:()=>g(!1),onSave:async e=>{let t=await m1(e);c(e=>[t,...e.map(e=>({...e,secret:void 0}))]),g(!1),x(t)}}),(0,G.jsx)(f0,{isOpen:!!_,title:e(`keysEditTitle`),hint:e(`keysEditHint`),initial:_,options:t,t:e,onClose:()=>y(null),onSave:async e=>{if(!_)return;let t=await h1(_.id,e);c(e=>e.map(e=>e.id===_.id?{...e,...t,secret:void 0}:e)),y(null)}}),(0,G.jsx)(Z.Root,{isOpen:!!b?.secret,onOpenChange:e=>{e||x(null)},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`lg`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-6 pt-6`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:e(`keysSecretTitle`)}),(0,G.jsx)(`p`,{className:`mt-1.5 text-body leading-6 text-muted`,children:e(`keysSecretHint`)})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":e(`close`),className:`grid size-9 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:18})})]}),(0,G.jsxs)(Z.Body,{className:`px-6 pb-2`,children:[(0,G.jsxs)(RB,{status:`warning`,className:`mb-4`,children:[(0,G.jsx)(RB.Indicator,{}),(0,G.jsx)(RB.Content,{children:(0,G.jsx)(RB.Title,{children:e(`keysSecretOnce`)})})]}),(0,G.jsx)(`code`,{className:`mono block break-all rounded-lg bg-surface-secondary px-3 py-3 text-body`,children:b?.secret})]}),(0,G.jsxs)(Z.Footer,{className:`justify-end`,children:[(0,G.jsx)(X,{variant:`ghost`,onPress:()=>x(null),children:e(`close`)}),(0,G.jsxs)(X,{onPress:()=>{b?.secret&&T(b.secret)},children:[(0,G.jsx)(Oi,{size:14}),e(S?`copied`:`copy`)]})]})]})})})})]})}function f0({isOpen:e,title:t,hint:n,initial:r,options:i,t:a,onClose:o,onSave:s}){let[c,l]=(0,v.useState)(r?.name||``),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)(new Set),[m,h]=(0,v.useState)(!0),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(!e)return;l(r?.name||``),d(c0(r?.providers||[],i));let t=new Set((r?.providers||[]).filter(e=>!e.includes(`:`)).map(e=>e.toLowerCase()));p(t),h(!0),_(``)},[r,e,i]);function x(e){let t=i.find(t=>t.value===e);h(!1),d(n=>n.includes(e)?(t&&p(e=>{let n=new Set(e);return n.delete(t.provider),n}),n.filter(t=>t!==e)):[...n,e])}async function S(e){e?.preventDefault();let t=c.trim();if(!t){_(a(`keysNameRequired`));return}if(!i.length){_(a(`keysProvidersNotLoaded`));return}b(!0),_(``);try{await s({name:t,providers:m?r?.providers||[]:u})}catch(e){_(e instanceof Error?e.message:String(e))}finally{b(!1)}}return(0,G.jsx)(Z.Root,{isOpen:e,onOpenChange:e=>{!e&&!y&&o()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`lg`,scroll:`inside`,children:(0,G.jsx)(Z.Dialog,{className:`sm:min-w-[32rem]`,children:(0,G.jsxs)(FB,{onSubmit:S,children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-6 pt-6`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:t}),(0,G.jsx)(`p`,{className:`mt-1.5 text-body leading-6 text-muted`,children:n})]}),(0,G.jsx)(Z.CloseTrigger,{isDisabled:y,"aria-label":a(`close`),className:`grid size-9 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:18})})]}),(0,G.jsxs)(Z.Body,{className:`space-y-5 px-6 pb-2 pt-1`,children:[g?(0,G.jsxs)(RB,{status:`danger`,children:[(0,G.jsx)(RB.Indicator,{}),(0,G.jsx)(RB.Content,{children:(0,G.jsx)(RB.Title,{children:g})})]}):null,(0,G.jsx)(E$,{label:a(`keysName`),children:(0,G.jsx)(lL,{value:c,onChange:e=>l(e.target.value),placeholder:a(`keysNamePh`),"aria-label":a(`keysName`)})}),(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(sR,{className:`text-body font-medium text-muted`,children:a(`keysProviders`)}),(0,G.jsx)(lR,{className:`text-caption leading-5 text-muted`,children:a(`keysProvidersHint`)}),i.length?(0,G.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:i.map(e=>{let t=u.includes(e.value),n=f.has(e.provider);return(0,G.jsx)(aT,{isSelected:t,onChange:()=>x(e.value),className:`rounded-xl bg-surface-secondary px-3 py-2.5 data-selected:border-accent data-selected:bg-accent-soft`,children:(0,G.jsxs)(aT.Content,{className:`flex items-center gap-2.5`,children:[(0,G.jsx)(aT.Control,{children:(0,G.jsx)(aT.Indicator,{})}),(0,G.jsx)(zZ,{provider:e.provider,size:16}),(0,G.jsx)(`span`,{className:`text-body font-medium`,children:EZ(e.provider,e.region,a)}),n?(0,G.jsx)(`span`,{className:`rounded-md bg-surface-secondary px-1.5 py-0.5 text-caption font-medium text-muted`,children:a(`keysAllRegions`)}):null]})},e.value)})}):(0,G.jsx)(`p`,{className:`rounded-lg bg-surface-secondary px-3 py-2.5 text-caption leading-5 text-muted`,children:a(`keysProvidersNotLoaded`)}),(0,G.jsx)(`p`,{className:`text-caption text-muted`,children:l0(u,a)})]})]}),(0,G.jsxs)(Z.Footer,{className:`justify-end`,children:[(0,G.jsx)(X,{variant:`ghost`,isDisabled:y,onPress:o,children:a(`cancel`)}),(0,G.jsx)(X,{type:`submit`,isPending:y,isDisabled:!i.length,children:a(r?`save`:`create`)})]})]})})})})})}function p0(){return(0,G.jsx)(hU,{children:(0,G.jsx)(EH,{children:(0,G.jsx)(AH,{children:(0,G.jsx)(uU,{children:(0,G.jsx)(Sn,{children:(0,G.jsxs)(Ft,{children:[(0,G.jsx)(Nt,{path:`/login`,element:(0,G.jsx)(f1,{})}),(0,G.jsx)(Nt,{element:(0,G.jsx)(eX,{}),children:(0,G.jsxs)(Nt,{element:(0,G.jsx)($Y,{}),children:[(0,G.jsx)(Nt,{path:`/`,element:(0,G.jsx)(iQ,{})}),(0,G.jsx)(Nt,{path:`/auth`,element:(0,G.jsx)(jt,{to:`/accounts`,replace:!0})}),(0,G.jsx)(Nt,{path:`/providers`,element:(0,G.jsx)(jQ,{})}),(0,G.jsx)(Nt,{path:`/access`,element:(0,G.jsx)(f$,{})}),(0,G.jsx)(Nt,{path:`/accounts`,element:(0,G.jsx)(d1,{})}),(0,G.jsx)(Nt,{path:`/checkins`,element:(0,G.jsx)(jt,{to:`/accounts`,replace:!0})}),(0,G.jsx)(Nt,{path:`/usage`,element:(0,G.jsx)(n0,{})}),(0,G.jsx)(Nt,{path:`/logs`,element:(0,G.jsx)(W1,{})}),(0,G.jsx)(Nt,{path:`/keys`,element:(0,G.jsx)(d0,{})}),(0,G.jsx)(Nt,{path:`/system`,element:(0,G.jsx)(T1,{})}),(0,G.jsx)(Nt,{path:`*`,element:(0,G.jsx)(jt,{to:`/`,replace:!0})})]})})]})})})})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(v.StrictMode,{children:(0,G.jsx)(p0,{})}));export{_X as a,Pv as c,h as d,d as f,l as h,sX as i,Mc as l,s as m,wX as n,cX as o,o as p,hX as r,eY as s,qX as t,Ss as u}; \ No newline at end of file + -d ${o$(JSON.stringify(V))}`,[d,V,L]);if(n&&!t)return(0,G.jsx)(bY,{});async function oe(e,t){await NQ(e),I(t),window.setTimeout(()=>I(``),1100)}async function se(){let e=performance.now();N(`loading`),ee(null),j(``);try{let e=await ZH(V.model,V.messages[0].content,L||void 0);j(JSON.stringify(e,null,2)),N(`success`)}catch(e){j(e instanceof Error?e.message:String(e)),N(`error`)}finally{ee(Math.round(performance.now()-e))}}function ce(){k.current?.abort(),k.current=null}function le(e,t){E(n=>n.map(n=>{if(n.id!==e)return n;let r=typeof t==`function`?t(n):t;return{...n,...r}}))}async function ue(){let e=x.trim();if(!e&&!C.length||!re||z||D===`loading`)return;ce();let t=new AbortController;k.current=t;let n=C,r={id:s$(`user`),role:`user`,content:e,attachments:n,status:`done`},i=s$(`assistant`),a={id:i,role:`assistant`,content:``,status:`streaming`},o=T;E([...o,r,a]),S(``),w([]),O(`loading`);let s=n$(o,{role:`user`,content:t$(e,n)});try{await eU(re,s,L||void 0,{signal:t.signal,onContent:(e,t)=>le(i,{content:t}),onReasoning:(e,t)=>le(i,{reasoning:t}),onToolCalls:e=>le(i,{toolCalls:c$(e,!0)}),onUsage:e=>le(i,{usage:e})}),le(i,e=>({status:`done`,toolCalls:e.toolCalls?.map(e=>({...e,status:`success`}))})),O(`success`)}catch(e){if(t.signal.aborted){le(i,e=>({status:`done`,toolCalls:e.toolCalls?.map(e=>({...e,status:`success`}))})),O(`success`);return}le(i,{status:`error`,error:e instanceof Error?e.message:String(e)}),O(`error`)}finally{k.current===t&&(k.current=null)}}let de=e(M===`success`?`requestComplete`:M===`error`?`requestFailed`:M===`loading`?`requesting`:`requestIdle`),fe=l$()!=null,pe=[{id:`auto`,textValue:e(`autoAccount`),label:e(`autoAccount`),icon:(0,G.jsx)(ni,{size:14,className:`text-muted`})},...s.map(t=>({id:t.id,textValue:`${t.name||t.id} ${EZ(t.provider,t.region,e)}`,label:t.name||t.id,hint:EZ(t.provider,t.region,e),icon:(0,G.jsx)(zZ,{provider:t.provider,size:14})}))],me=s.length||!fe?pe:[{id:`auto`,textValue:e(`autoAccount`),label:e(`autoAccount`),icon:(0,G.jsx)(ni,{size:14,className:`text-muted`})},{id:`demo-wb`,textValue:`wb-demo WorkBuddy`,label:`wb-demo`,hint:`WorkBuddy`}],he=R.map(t=>{let n=fX(t),r=pX(t),i=t.display_name||t.id,a=r?e(`modelFree`):n,o=t.provider||t.owned_by||``;return{id:t.id,textValue:`${i} ${t.id} ${o} ${n} ${r?`free`:``}`,label:a?`${i} ${a}`:i,hint:[t.id,o,a].filter(Boolean).join(` · `)}}),ge=he.length||!fe?he:d$.map(t=>{let n=fX(t),r=pX(t),i=t.display_name||t.id,a=r?e(`modelFree`):n;return{id:t.id,textValue:`${i} ${t.id} ${t.provider} ${n} ${r?`free`:``}`,label:a?`${i} ${a}`:i,hint:[t.id,t.provider,a].filter(Boolean).join(` · `)}}),_e=!!((x.trim()||C.length)&&re&&!z&&(s.length||fe));function ve(){E(i$()),O(`idle`)}return(0,G.jsxs)(`div`,{className:`space-y-5`,children:[(0,G.jsxs)(`section`,{className:`grid gap-3 pb-1 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-title font-semibold`,children:e(`apiPlayground`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:e(`apiPlaygroundHint`)})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-caption text-muted`,children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":ie.length?`ok`:void 0}),(0,G.jsx)(`span`,{children:e(`readyAccounts`,{ready:ie.length,total:s.length})})]})]}),(0,G.jsx)(`section`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3 sm:px-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:e(`baseUrl`)}),(0,G.jsx)(`code`,{className:`mono mt-0.5 block truncate text-body font-medium text-foreground`,children:l})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,"aria-label":e(`copyBaseUrl`),onPress:()=>void oe(l,`base`),children:(0,G.jsx)(MQ,{copied:F===`base`,size:15})}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:ie.length?`success`:`warning`,children:ie.length?e(`endpointReady`):e(`degraded`)})]})]})}),s.length?null:(0,G.jsx)(`p`,{className:`px-1 text-caption text-muted`,children:e(`noAccountsForTest`)}),B?(0,G.jsx)(`p`,{className:`px-1 text-caption text-danger`,children:B}):null,(0,G.jsx)(`section`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface`,children:(0,G.jsxs)(`div`,{className:`flex min-h-[640px] flex-col md:min-h-[72vh]`,children:[(0,G.jsx)($Q,{messages:T,busy:D===`loading`,onLoadDemo:ve}),(0,G.jsx)(UQ,{value:x,onChange:S,attachments:C,onAttachmentsChange:w,disabled:!s.length&&l$()==null,streaming:D===`loading`,canSend:_e,onSend:()=>void ue(),onStop:ce,accountValue:L||`auto`,onAccountChange:e=>h(e===`auto`?``:e),accountOptions:me,modelValue:re,onModelChange:p,modelOptions:ge,modelsLoading:z})]})}),(0,G.jsx)(e$,{open:r,onOpenChange:i,chatPath:u,prompt:y,onPromptChange:b,onTest:()=>void se(),requestState:M,elapsedMs:P,output:A,responseStatus:de,curl:ae,copiedCurl:F===`curl`,onCopyCurl:()=>void oe(ae,`curl`),canSend:!!(y.trim()&&re&&!z)}),(0,G.jsx)(IQ,{access:t?.access})]})}function p$(e){(0,v.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let n=eY.context(()=>{eY.matchMedia().add(`(prefers-reduced-motion: no-preference)`,()=>{let e=eY.utils.toArray(`.meter__fill`);e.length&&eY.from(e,{scaleX:0,transformOrigin:`left center`,duration:tY.calm,ease:nY.emphasized,stagger:rY.base,clearProps:`transform,transformOrigin`})})},t);return()=>n.revert()},[e])}function m$(e,t,n,r,i,a){return[e.has_add_on&&e.add_on_available!==!1?`${n} ${AX(e.add_on_used)} / ${AX(e.add_on_total)} ${e.add_on_unit||`credits`}`:``,e.has_resource_package&&e.resource_package_available!==!1?`${r} ${t} ${AX(e.resource_package_remaining)} ${e.resource_package_unit||`credits`}`:``,a===`workbuddy`?RX(e,i):``].filter(Boolean)}function h$({window:e,t,extra:n}){let r=Math.round(e.percentage??0),i=IX(e,t),a=t(`quotaUsedPercent`,{n:r}),o=LX(e.reset_at,t),s=`${i} · ${a}${o?` · ${o}`:``}`,c=jX(e),l=MX(e),u=l===`danger`?`danger`:l===`warn`?`warning`:`success`;return(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{className:`block w-full min-w-0`,children:(0,G.jsxs)(`div`,{className:`w-full min-w-0 cursor-help`,children:[(0,G.jsxs)(OV,{className:`account-meter account-meter--window w-full`,color:u,size:`md`,minValue:0,maxValue:100,value:Math.round(c*100),"aria-label":i,valueLabel:s,children:[(0,G.jsxs)(OV.Output,{className:`flex w-full items-baseline justify-between gap-3 text-caption`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:i}),(0,G.jsx)(`span`,{className:`mono shrink-0 text-foreground/70`,children:a})]}),(0,G.jsx)(OV.Track,{children:(0,G.jsx)(OV.Fill,{})})]}),o?(0,G.jsx)(`div`,{className:`mt-1 text-caption leading-4 text-muted`,children:o}):null]})}),(0,G.jsx)(eL.Content,{children:(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsx)(`div`,{children:s}),n?.map(e=>(0,G.jsx)(`div`,{children:e},e))]})})]})}function g$({quota:e,t,label:n,usedLabel:r,remainingLabel:i,addOnLabel:a,resourcePackageLabel:o,exceededLabel:s,provider:c}){let l=e.unit||`credits`,u=`${AX(e.used)} / ${AX(e.total)}`,d=`${AX(e.remaining)}`,f=m$(e,i,a,o,t,c),p=NX(e),m=c===`codex`?FX(e.plan):``,h=jX(e),g=MX(e),_=g===`danger`?`danger`:g===`warn`?`warning`:`success`,y=(0,v.useRef)(null);p$(y);let b=`${r} ${u} ${l} · ${i} ${d} ${l}${f.length?` · ${f.join(` · `)}`:``}`;return p.length>0?(0,G.jsxs)(`div`,{ref:y,className:`account-quota-windows flex w-full min-w-0 flex-col gap-3`,children:[m?(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-caption`,children:[(0,G.jsx)(`span`,{className:`text-muted`,children:t(`quotaPlan`)}),(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:m})]}):null,p.map((e,n)=>(0,G.jsx)(`div`,{className:`w-full min-w-0`,children:(0,G.jsx)(h$,{window:e,t,extra:n===0?f:void 0})},e.id||String(n)))]}):(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(`div`,{ref:y,className:`w-full cursor-help`,children:(0,G.jsxs)(OV,{className:`account-meter w-full`,color:_,size:`md`,minValue:0,maxValue:100,value:Math.round(h*100),"aria-label":n,valueLabel:b,children:[(0,G.jsxs)(OV.Output,{className:`flex w-full items-baseline justify-between text-caption`,children:[(0,G.jsxs)(`span`,{className:`text-body font-semibold leading-5 text-foreground tabular-nums`,children:[e.exceeded?(0,G.jsx)(`span`,{className:`mr-1.5 text-danger`,children:s}):null,d,(0,G.jsx)(`span`,{className:`ml-1 text-caption font-normal text-foreground/60`,children:l})]}),(0,G.jsxs)(`span`,{className:`mono text-foreground/55`,children:[r,` `,u]})]}),(0,G.jsx)(OV.Track,{children:(0,G.jsx)(OV.Fill,{})})]})})}),(0,G.jsx)(eL.Content,{children:(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsxs)(`div`,{children:[r,` `,u,` `,l]}),(0,G.jsxs)(`div`,{children:[i,` `,d,` `,l]}),f.map(e=>(0,G.jsx)(`div`,{children:e},e))]})})]})}function _$({state:e,stateCopy:t,t:n}){let r=(0,v.useRef)(null),i=OX(e),a=kX(e);return(0,v.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=eY.context(()=>{let e=eY.utils.toArray(`[data-runtime-seg]`),t=e.filter((e,t)=>tt>=i),r=eY.matchMedia();r.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(t,{scaleY:1,autoAlpha:1}),eY.set(n,{scaleY:.32,autoAlpha:.45})}),r.add(`(prefers-reduced-motion: no-preference)`,()=>{eY.set(e,{transformOrigin:`center bottom`}),eY.to(n,{scaleY:.32,autoAlpha:.45,duration:tY.fast,ease:nY.out,overwrite:!0}),eY.to(t,{scaleY:1,autoAlpha:1,duration:tY.base,ease:nY.out,stagger:{amount:.08,from:`start`},overwrite:!0})})},e);return()=>t.revert()},[i,e]),(0,G.jsxs)(`div`,{ref:r,className:`flex items-center gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 text-caption font-medium text-foreground/75`,children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":a===`muted`?void 0:a===`warn`?`warn`:a}),(0,G.jsx)(`span`,{children:n(`runtimeState`)})]}),(0,G.jsx)(`div`,{className:`runtime-meter min-w-[80px] flex-1`,role:`meter`,"aria-label":n(`runtimeState`),"aria-valuemin":0,"aria-valuemax":12,"aria-valuenow":i,"aria-valuetext":t,children:Array.from({length:12},(e,t)=>(0,G.jsx)(`span`,{"data-runtime-seg":!0,"data-on":t{if(!M&&!N&&P.length===0)return;let e=window.setInterval(()=>A(e=>e+1),1e3);return()=>window.clearInterval(e)},[M,N,P.length]);let ee=v$(j,j===`dead`?N:M,o),F=j===`hot`||j===`ready`?`success`:j===`cooling`?`warning`:j===`quota_exhausted`||j===`login`||j===`unavailable`||j===`dead`||j===`auth_failed`?`danger`:void 0,I=e.last_error||e.lastError,L=e.last_error_kind||e.kind,te=EZ(e.provider,e.region,o),R=e.last_checkin_status,z=R===`success`?`checkinRecordSuccess`:R===`already`?`checkinRecordAlready`:R===`skipped`?`checkinRecordSkipped`:R===`error`?`checkinRecordFailed`:`lastCheckinNone`;return(0,v.useLayoutEffect)(()=>{let e=T.current;if(!e)return;let t=k.current;if(k.current=j,!t||t===j)return;let n=eY.context(()=>{let t=eY.matchMedia();t.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(e,{scale:1,autoAlpha:1})}),t.add(`(prefers-reduced-motion: no-preference)`,()=>{eY.fromTo(e,{scale:.94,autoAlpha:.65},{scale:1,autoAlpha:1,duration:.2,ease:`power2.out`,overwrite:!0})})},e);return()=>n.revert()},[j]),(0,v.useLayoutEffect)(()=>{let e=E.current;if(!e||!n)return;let t=eY.context(()=>{let t=eY.matchMedia();t.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(e,{autoAlpha:1,y:0})}),t.add(`(prefers-reduced-motion: no-preference)`,()=>{eY.fromTo(e,{autoAlpha:0,y:-6},{autoAlpha:1,y:0,duration:.2,ease:`power3.out`,overwrite:!0})})},e);return()=>t.revert()},[n]),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,"data-state":j,className:`account-card overflow-hidden p-0`,children:[(0,G.jsxs)(zw.Header,{className:`flex-row items-start justify-between gap-2.5 px-4 pt-3.5 pb-2`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,G.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-surface-tertiary`,children:(0,G.jsx)(zZ,{provider:e.provider,size:20})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(zw.Title,{className:`truncate text-body leading-5`,children:e.name||e.id}),(0,G.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-secondary px-1.5 py-px text-caption text-muted`,children:te})]}),(0,G.jsx)(zw.Description,{className:`mono truncate text-caption leading-4 text-foreground/60`,title:`${e.id}${e.remote_uid?` · UID ${e.remote_uid}`:``}`,children:e.remote_uid?`UID ${e.remote_uid}`:e.id})]})]}),(0,G.jsxs)(`div`,{className:`flex max-w-[48%] shrink-0 flex-wrap justify-end gap-1.5`,children:[(0,G.jsx)(`span`,{ref:T,children:P.length&&j===`cooling`?(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(`span`,{className:`inline-flex cursor-help`,children:(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:F,children:ee})})}),(0,G.jsx)(eL.Content,{children:(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`div`,{className:`font-medium`,children:o(`partialCooling`)}),P.map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-caption`,children:[(0,G.jsx)(`span`,{children:e}),(0,G.jsx)(`span`,{className:`mono text-foreground/65`,children:TX(t)})]},e))]})})]}):(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:F,children:ee})}),P.length&&j!==`cooling`?(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(`span`,{className:`inline-flex cursor-help`,children:(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`warning`,children:o(`partialCooling`)})})}),(0,G.jsx)(eL.Content,{children:(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`div`,{className:`font-medium`,children:o(`partialCooling`)}),P.map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-caption`,children:[(0,G.jsx)(`span`,{children:e}),(0,G.jsx)(`span`,{className:`mono text-foreground/65`,children:TX(t)})]},e))]})})]}):null]})]}),(0,G.jsxs)(zw.Content,{className:`gap-1.5 px-4 pb-3`,children:[(0,G.jsx)(_$,{state:j,stateCopy:ee,t:o}),e.quota?(0,G.jsx)(g$,{quota:e.quota,t:o,label:o(`quota`),usedLabel:o(`quotaUsed`),remainingLabel:o(`quotaRemaining`),addOnLabel:o(`quotaAddOn`),resourcePackageLabel:o(`quotaResourcePackage`),exceededLabel:o(`quotaExceeded`),provider:e.provider}):(0,G.jsx)(`span`,{className:`text-caption text-foreground/65`,children:o(j===`hot`||j===`ready`||j===`loading`||j===`starting`?`quotaLoading`:`quotaUnavailable`)}),I?(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsxs)(`div`,{className:`flex w-full cursor-help gap-2 rounded-lg bg-surface-secondary p-2 text-left text-caption leading-5 text-foreground`,children:[(0,G.jsx)(io,{size:14,className:`mt-0.5 shrink-0 text-danger`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[L?(0,G.jsx)(`div`,{className:`mono mb-0.5 truncate text-caption opacity-75`,children:L}):null,(0,G.jsx)(`p`,{className:`break-words line-clamp-3`,children:I})]})]})}),(0,G.jsx)(eL.Content,{children:(0,G.jsxs)(`div`,{className:`max-w-md whitespace-pre-wrap break-words`,children:[L?(0,G.jsx)(`div`,{className:`mono mb-1 text-caption opacity-75`,children:L}):null,I]})})]}):null]}),n&&e.enabled?(0,G.jsxs)(`section`,{ref:E,className:`grid gap-3 bg-surface-secondary/55 px-3 py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:o(`oauthDeviceFlow`)}),(0,G.jsx)(`p`,{className:`mt-1.5 text-caption leading-5 text-muted`,children:e.provider===`codex`?o(`wizardCodexBrowserLead`):o(`qoderLoginHint`)}),(0,G.jsx)(`div`,{className:`mt-2.5 flex flex-wrap gap-2`,children:e.provider===`codex`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(X,{size:`sm`,isPending:t===`device`,onPress:()=>c(`cli`),children:[(0,G.jsx)(Oa,{size:14}),o(`startCodexCliLogin`)]}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:t===`device`,onPress:()=>c(`chatgpt`),children:[(0,G.jsx)(Oa,{size:14}),o(`startCodexChatGPTLogin`)]})]}):(0,G.jsxs)(X,{size:`sm`,isPending:t===`device`,onPress:()=>c(),children:[(0,G.jsx)(Oa,{size:14}),o(`startBrowserLogin`)]})}),(e.provider===`trae`||e.provider===`codex`||e.provider===`devin`)&&f&&d?(0,G.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,G.jsx)(`p`,{className:`text-caption leading-4 text-muted`,children:o(`wizardCallbackLead`)}),(0,G.jsx)(mL,{className:`h-24 w-full resize-none font-mono text-caption leading-5`,value:u||``,onChange:e=>d(e.target.value),placeholder:o(`wizardCallbackPh`),"aria-label":o(`wizardCallbackPh`)}),(0,G.jsx)(X,{size:`sm`,variant:`secondary`,isPending:t===`callback`,onPress:f,children:o(`wizardSubmitCallback`)})]}):null]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-caption font-medium text-muted`,children:o(`patFallback`)}),(0,G.jsxs)(`div`,{className:`mt-2.5 flex flex-col gap-2 sm:flex-row`,children:[(0,G.jsxs)(hL,{className:`flex-1`,type:`password`,value:a,onChange:s,children:[(0,G.jsx)(sR,{className:`sr-only`,children:o(`pat`)}),(0,G.jsx)(lL,{placeholder:o(`pasteToken`),"aria-label":o(`pat`)})]}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:t===`pat`,onPress:l,children:[(0,G.jsx)(na,{size:14}),o(`usePat`)]})]})]}),r||i?(0,G.jsxs)(`div`,{className:`text-caption`,children:[r?(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-1 text-caption font-medium text-muted`,children:o(`authUrl`)}),(0,G.jsx)(`code`,{className:`mono block break-all text-foreground`,children:r}),(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,onPress:()=>window.open(r,`_blank`,`noopener,noreferrer`),children:[(0,G.jsx)(Qr,{size:14}),o(`openAuthUrl`)]}),(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:()=>{NQ(r).then(e=>{e&&(O(!0),window.setTimeout(()=>O(!1),1100))})},children:[(0,G.jsx)(MQ,{copied:D}),o(D?`copied`:`copy`)]})]})]}):null,i?(0,G.jsx)(`p`,{className:`mt-1 text-muted`,children:i}):null]}):null]}):null,b?(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-t border-separator px-4 py-2 text-caption text-muted`,children:[(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsxs)(`span`,{className:`flex cursor-help items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:o(`lastCheckin`)}),(0,G.jsx)(`span`,{className:R===`error`?`text-danger`:``,children:o(z)})]})}),(0,G.jsxs)(eL.Content,{children:[e.last_checkin_at?new Date(e.last_checkin_at).toLocaleString():o(`lastCheckinNone`),e.last_checkin_msg?` · ${e.last_checkin_msg}`:``]})]}),(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsxs)(`span`,{className:`flex cursor-help items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:o(`autoCheckin`)}),(0,G.jsx)(`span`,{className:`mono text-caption text-foreground/55`,children:e.checkin_time||_}),(0,G.jsx)(fQ,{isSelected:!!e.auto_checkin,isDisabled:!!t,ariaLabel:o(`autoCheckin`),onChange:e=>y?.(e)})]})}),(0,G.jsx)(eL.Content,{children:e.checkin_time?o(`checkinCustom`):o(`checkinInherit`)})]})]}):null,(0,G.jsxs)(zw.Footer,{className:`flex flex-wrap items-center gap-1.5 bg-surface-secondary px-4 py-2`,children:[m?(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`secondary`,isPending:t===`refresh`,onPress:m,"aria-label":o(`refreshAccount`),children:(0,G.jsx)(Jr,{size:15})})}),(0,G.jsx)(eL.Content,{children:o(`refreshAccount`)})]}):null,(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:n?`secondary`:`ghost`,isDisabled:!e.enabled,onPress:C,"aria-label":o(`authentication`),children:(0,G.jsx)(na,{size:15})})}),(0,G.jsx)(eL.Content,{children:o(`authentication`)})]}),(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,onPress:w,"aria-label":o(`accountModels`),children:(0,G.jsx)(Mi,{size:15})})}),(0,G.jsx)(eL.Content,{children:o(`accountModels`)})]}),(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,onPress:S,"aria-label":o(`editAccount`),children:(0,G.jsx)(ba,{size:15})})}),(0,G.jsx)(eL.Content,{children:o(`editAccount`)})]}),b?(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,isDisabled:!e.enabled||!!t,isPending:t===`checkin`,onPress:b,"aria-label":o(`checkinNow`),children:(0,G.jsx)(ci,{size:15})})}),(0,G.jsx)(eL.Content,{children:o(`checkinNow`)})]}):null,(0,G.jsxs)(nV,{children:[(0,G.jsx)(nV.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`secondary`,"aria-label":o(`more`),children:(0,G.jsx)(Ii,{size:16})})}),(0,G.jsx)(nV.Popover,{placement:`bottom end`,children:(0,G.jsxs)(nV.Menu,{"aria-label":o(`more`),onAction:e=>{e===`export`&&p(),e===`checkin-records`&&x?.(),e===`delete`&&h()},children:[e.auth_type===`none`?null:(0,G.jsxs)(nV.Item,{id:`export`,textValue:o(`export`),children:[(0,G.jsx)(Oi,{size:15}),o(`export`)]}),x?(0,G.jsxs)(nV.Item,{id:`checkin-records`,textValue:o(`checkinRecords`),children:[(0,G.jsx)(ca,{size:15}),o(`checkinRecords`)]}):null,(0,G.jsxs)(nV.Item,{id:`delete`,textValue:o(`delete`),className:`text-danger`,children:[(0,G.jsx)(Ja,{size:15}),o(`delete`)]})]})})]}),(0,G.jsx)(`div`,{className:`ml-auto flex shrink-0 flex-nowrap items-center gap-3 whitespace-nowrap`,children:(0,G.jsx)(fQ,{isSelected:!!e.enabled,isDisabled:t===`toggle`,ariaLabel:e.enabled?o(`disable`):o(`enable`),label:e.enabled?o(`enabledState`):o(`disabled`),onChange:g})})]})]})}function b$(e,t){return e.status===`success`?{label:t(`checkinRecordSuccess`),color:`success`}:e.status===`already`?{label:t(`checkinRecordAlready`),color:`warning`}:e.status===`skipped`?{label:t(`checkinRecordSkipped`),color:`default`}:{label:t(`checkinRecordFailed`),color:`danger`}}function x$(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function S$({account:e,t,onClose:n}){let[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(!!e?.id),[s,c]=(0,v.useState)(``),l=e?.id||``,u=t(`checkinRecordsTitle`,{name:e?.name||e?.id||``});async function d(){if(l){o(!0),c(``);try{let e=await iU(l);i(e.data||[])}catch(e){i([]),c(e instanceof Error?e.message:String(e))}finally{o(!1)}}}return(0,v.useEffect)(()=>{l&&d()},[l]),(0,G.jsx)(Z.Root,{isOpen:!!e,onOpenChange:e=>{e||n()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{size:`lg`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:u}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:t(`checkinRecordsHint`)})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":t(`close`),className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Body,{className:`px-5 pb-2`,children:[s?(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(bU,{title:s})}):null,a?(0,G.jsxs)(`div`,{className:`space-y-2 py-1`,children:[(0,G.jsx)($,{className:`h-16 w-full`}),(0,G.jsx)($,{className:`h-16 w-full`}),(0,G.jsx)($,{className:`h-16 w-full`})]}):r.length?(0,G.jsx)(`div`,{className:`divide-y divide-separator overflow-hidden rounded-lg bg-surface-secondary`,children:r.map(e=>{let n=b$(e,t);return(0,G.jsxs)(`div`,{className:`flex items-start gap-3 px-3 py-3`,children:[(0,G.jsx)(`span`,{className:`status-dot mt-1.5 shrink-0`,"data-state":e.status===`error`?`warn`:`ok`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:n.color,children:n.label}),(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:x$(e.created_at)})]}),(0,G.jsx)(`p`,{className:`mt-1 break-words text-caption leading-5 text-foreground/75`,children:e.message||`—`})]})]},e.id)})}):(0,G.jsx)(pQ,{className:`min-h-44 rounded-3xl bg-surface-secondary`,title:t(`checkinRecordsEmpty`),hint:t(`checkinRecordsHint`)})]}),(0,G.jsxs)(Z.Footer,{className:`justify-between px-5 pb-5`,children:[(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:t(`checkinRecordsCount`,{count:r.length})}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:n,children:t(`close`)}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:a,onPress:()=>void d(),children:[(0,G.jsx)(Jr,{size:14}),t(`refresh`)]})]})]})]})})})})}function C$(e){let t=e.route_display_name||``;return t&&t!==(e.display_name||e.id)?t:``}function w$({account:e,t,onClose:n}){let[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(!!e?.id),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),d=e?.id||``,f=t(`accountModelsTitle`,{name:e?.name||e?.id||``}),p=e?EZ(e.provider,e.region,t):``;async function m(e=!1){if(d){e?c(!0):(o(!0),i([])),u(``);try{let t=await(e?qH(d):GH(d));i(t.data||[])}catch(e){i([]),u(e instanceof Error?e.message:String(e))}finally{o(!1),c(!1)}}}return(0,v.useEffect)(()=>{if(!d)return;let e=!1;return GH(d).then(t=>{e||(i(t.data||[]),u(``),o(!1))}).catch(t=>{e||(i([]),u(t instanceof Error?t.message:String(t)),o(!1))}),()=>{e=!0}},[d]),(0,G.jsx)(Z.Root,{isOpen:!!e,onOpenChange:e=>{e||n()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{size:`lg`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:f}),(0,G.jsx)(`p`,{className:`mt-1 text-caption font-normal leading-5 text-muted`,children:t(`accountModelsHint`)}),e?(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-caption text-muted`,children:[(0,G.jsx)(zZ,{provider:e.provider,size:14}),(0,G.jsx)(`span`,{children:p}),(0,G.jsx)(`span`,{className:`text-border`,children:`·`}),(0,G.jsx)(`span`,{className:`mono`,children:e.id})]}):null]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":t(`close`),className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Body,{className:`px-5 pb-2`,children:[l?(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(bU,{title:t(`accountModelsError`,{msg:l})})}):null,a||s?(0,G.jsxs)(`div`,{className:`space-y-2 py-1`,children:[(0,G.jsx)($,{className:`h-14 w-full`}),(0,G.jsx)($,{className:`h-14 w-full`}),(0,G.jsx)($,{className:`h-14 w-full`})]}):r.length?(0,G.jsx)(`ul`,{className:`divide-y divide-separator overflow-hidden rounded-lg bg-surface-secondary`,children:r.map(n=>{let r=n.provider||n.owned_by||e?.provider||`qoder`,i=C$(n),a=fX(n),o=pX(n);return(0,G.jsxs)(`li`,{className:`flex items-start gap-3 px-3 py-2.5`,children:[(0,G.jsx)(`span`,{className:`status-dot mt-1.5`,"data-state":n.stale?void 0:`ok`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`truncate text-body font-medium`,children:n.display_name||n.id}),o?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`success`,children:t(`modelFree`)}):null,a?(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:a}):null,n.stale?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`warning`,children:t(`fallback`)}):null]}),(0,G.jsx)(`div`,{className:`mono mt-0.5 truncate text-caption text-muted`,children:n.id}),i?(0,G.jsx)(`div`,{className:`mt-0.5 text-caption text-muted`,children:t(`routedTo`,{model:i})}):null]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 pt-0.5 text-caption text-muted`,children:[(0,G.jsx)(zZ,{provider:r,size:12}),(0,G.jsx)(`span`,{children:r})]})]},n.id)})}):(0,G.jsx)(pQ,{className:`min-h-48 rounded-3xl bg-surface-secondary`,icon:(0,G.jsx)(Mi,{size:22}),title:t(`accountModelsEmpty`),hint:t(`noModelsYet`)})]}),(0,G.jsxs)(Z.Footer,{className:`justify-between px-5 pb-5`,children:[(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:a?t(`refreshing`):t(`shownTotal`,{shown:r.length,total:r.length})}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:n,children:t(`close`)}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:s,onPress:()=>void m(!0),children:[(0,G.jsx)(Jr,{size:14}),t(s?`refreshing`:`refresh`)]})]})]})]})})})})}var T$=`w-28`;function E$({label:e,hint:t,labelWidthClass:n=T$,htmlFor:r,align:i=`center`,children:a}){return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex gap-3 ${i===`start`?`items-start`:`items-center`}`,children:[(0,G.jsx)(sR,{htmlFor:r,className:`${n} shrink-0 ${i===`start`?`pt-2`:``} text-body font-medium text-foreground`,children:e}),(0,G.jsx)(`div`,{className:`min-w-0 flex-1 [&_[data-slot=input]]:w-full [&_[data-slot=textarea]]:w-full`,children:a})]}),t?(0,G.jsx)(`p`,{className:`mt-1.5 pl-[7.75rem] text-caption leading-5 text-muted`,children:t}):null]})}function D$({catalog:e,selected:t,onChange:n,isDisabled:r,t:i}){let[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(t),l=(0,v.useMemo)(()=>new Set(t),[t]),u=(0,v.useMemo)(()=>{let t=new Set(s),n=a.trim().toLowerCase(),r=(e||[]).filter(e=>!n||e.toLowerCase().includes(n));return[...r.filter(e=>t.has(e)),...r.filter(e=>!t.has(e))]},[e,a,s]),d=(0,v.useMemo)(()=>{if(!e)return[];let n=new Set(e);return t.filter(e=>!n.has(e))},[e,t]),f=e?.length??0,p=t.filter(e=>!d.includes(e)).length;function m(e){o(e),c(t)}function h(e,r){n(r?[...t,e]:t.filter(t=>t!==e))}function g(){let e=new Set(t);u.forEach(t=>e.add(t)),n([...e])}function _(){let e=new Set(u);n(t.filter(t=>!e.has(t)))}return(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(aR,{"aria-label":i(`modelPickerSearch`),value:a,onChange:m,isDisabled:r,className:`min-w-0 flex-1 basis-48`,children:(0,G.jsxs)(aR.Group,{children:[(0,G.jsx)(aR.SearchIcon,{}),(0,G.jsx)(aR.Input,{placeholder:i(`modelPickerSearch`)}),(0,G.jsx)(aR.ClearButton,{})]})}),(0,G.jsx)(`span`,{className:`mono shrink-0 text-caption text-muted`,children:i(`modelPickerCount`,{selected:p,total:f})}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,isDisabled:r||u.length===0,onPress:g,children:[(0,G.jsx)(Si,{size:14}),i(`modelPickerSelectAll`)]}),(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,isDisabled:r||t.length===0,onPress:_,children:[(0,G.jsx)(Ra,{size:14}),i(`modelPickerClear`)]})]})]}),(0,G.jsxs)(`div`,{className:`max-h-[300px] overflow-y-auto overscroll-contain rounded-lg bg-surface-secondary p-1`,children:[e===null?(0,G.jsx)(`p`,{className:`px-2.5 py-2 text-caption text-muted`,children:i(`refreshing`)}):null,d.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-2.5 py-1.5`,children:[(0,G.jsx)(`span`,{className:`mono min-w-0 flex-1 truncate text-body text-muted line-through`,children:e}),(0,G.jsx)(`span`,{className:`shrink-0 text-caption text-warning`,children:i(`modelPickerOffline`)}),(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,isDisabled:r,"aria-label":i(`modelPickerRemove`,{model:e}),onPress:()=>h(e,!1),children:(0,G.jsx)(oo,{size:14})})]},`offline-${e}`)),u.map(e=>(0,G.jsx)(aT,{isSelected:l.has(e),isDisabled:r,onChange:t=>h(e,t),className:`flex w-full cursor-pointer rounded-md px-2.5 py-1.5 transition-colors hover:bg-default`,children:(0,G.jsxs)(aT.Content,{className:`flex min-w-0 flex-1 items-center gap-2.5`,children:[(0,G.jsx)(aT.Control,{children:(0,G.jsx)(aT.Indicator,{})}),(0,G.jsx)(`span`,{className:`mono min-w-0 truncate text-body text-foreground`,children:e})]})},e)),e!==null&&u.length===0?(0,G.jsx)(`p`,{className:`px-2.5 py-2 text-caption text-muted`,children:i(f===0?`noAccountModels`:`modelPickerNoMatch`)}):null]})]})}function O$(e){let[t,n]=(0,v.useState)(e);e&&!t&&n(!0);let r=(0,v.useRef)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(e);return(0,v.useLayoutEffect)(()=>{let t=r.current,o=i.current;if(!t||!o)return;if(a.current){a.current=!1;return}eY.killTweensOf([t,o]);let s=t.getBoundingClientRect().height;if(e){eY.set(t,{overflow:`hidden`});let e=t.scrollHeight;eY.fromTo(t,{height:s===e?0:s},{height:e,duration:aY(tY.base),ease:nY.out,onComplete:()=>eY.set(t,{clearProps:`height,overflow`})}),eY.fromTo(o,{autoAlpha:0,y:-6},{autoAlpha:1,y:0,duration:aY(tY.base),ease:nY.out})}else eY.set(t,{overflow:`hidden`,height:s}),eY.to(o,{autoAlpha:0,y:-4,duration:aY(tY.fast),ease:nY.inOut}),eY.to(t,{height:0,duration:aY(tY.fast+.04),ease:nY.inOut,onComplete:()=>n(!1)});return()=>{eY.killTweensOf([t,o])}},[e,t]),{mounted:t,outerRef:r,innerRef:i}}function k$({account:e,checkinDefaultTime:t,checkinTimezone:n,busy:r,t:i,onClose:a,onSave:o}){let[s,c]=(0,v.useState)(e?.name||``),[l,u]=(0,v.useState)(e?.max_inflight??4),[d,f]=(0,v.useState)(e?.priority??50),[p,m]=(0,v.useState)(e?.proxy_url||``),[h,g]=(0,v.useState)(!!e?.drop_system_prompt),[_,y]=(0,v.useState)(Object.entries(e?.model_aliases||{}).map(([e,t])=>({alias:e,model:t}))),[b,x]=(0,v.useState)({alias:``,model:``}),[S,C]=(0,v.useState)(!!e?.models_restricted),[w,T]=(0,v.useState)(e?.enabled_models||[]),{mounted:E,outerRef:D,innerRef:O}=O$(S),[k,A]=(0,v.useState)(null),[j,M]=(0,v.useState)(!e?.checkin_time),[N,P]=(0,v.useState)(e?.checkin_time||null),[ee,F]=(0,v.useState)(``);(0,v.useEffect)(()=>{if(!e?.id)return;let t=!1;return GH(e.id).then(e=>{t||A(e.data||[])}).catch(()=>{t||A([])}),()=>{t=!0}},[e?.id]);let I=i(`editAccountTitle`,{name:e?.name||e?.id||``}),L=e?EZ(e.provider,e.region,i):``;async function te(n){n?.preventDefault();let r=s.trim();if(!r){F(i(`accountNameRequired`));return}if(!Number.isInteger(l)||l<1||l>32){F(i(`maxInflightInvalid`));return}if(!Number.isInteger(d)||d<1||d>100){F(i(`priorityInvalid`));return}if(t!==void 0&&!j&&!/^([01]\d|2[0-3]):[0-5]\d$/.test(N??t)){F(i(`checkinTimeInvalid`));return}F(``);try{await o({name:r,max_inflight:l,priority:d,proxy_url:p.trim(),checkin_time:t===void 0?void 0:j?``:N??t,drop_system_prompt:e?.provider===`workbuddy`?h:void 0,model_aliases:Object.fromEntries(_.filter(e=>e.alias.trim()&&e.model.trim()).map(e=>[e.alias.trim(),e.model.trim()])),enabled_models:S?w:[],set_model_routing:!0}),a()}catch(e){F(e instanceof Error?e.message:String(e))}}return(0,G.jsx)(Z.Root,{isOpen:!!e,onOpenChange:e=>{!e&&!r&&a()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`lg`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{className:`w-full sm:w-[42rem] sm:max-w-[calc(100vw-2rem)]`,children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-6 pt-6`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:I}),(0,G.jsx)(`p`,{className:`mt-1.5 text-body font-normal leading-6 text-muted`,children:i(`editAccountHint`)}),e?(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(lT,{size:`sm`,variant:`soft`,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(zZ,{provider:e.provider,size:14}),(0,G.jsx)(`span`,{children:L})]})}),(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:e.id})]}):null]}),(0,G.jsx)(Z.CloseTrigger,{isDisabled:r,"aria-label":i(`close`),className:`grid size-9 shrink-0 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:18})})]}),(0,G.jsxs)(Z.Body,{className:`px-6 pb-2 pt-1`,children:[ee?(0,G.jsxs)(RB,{status:`danger`,className:`mb-4`,children:[(0,G.jsx)(RB.Indicator,{}),(0,G.jsx)(RB.Content,{children:(0,G.jsx)(RB.Title,{children:ee})})]}):null,(0,G.jsxs)(FB,{className:`space-y-4`,onSubmit:e=>void te(e),children:[(0,G.jsx)(E$,{label:i(`accountName`),children:(0,G.jsx)(lL,{value:s,onChange:e=>c(e.target.value),placeholder:i(`wizardNamePh`),"aria-label":i(`accountName`),disabled:r,autoFocus:!0})}),(0,G.jsx)(E$,{label:i(`maxInflight`),hint:i(`maxInflightHint`),children:(0,G.jsx)(sV,{value:l,onChange:e=>u(e??4),minValue:1,maxValue:32,isDisabled:r,isRequired:!0,children:(0,G.jsxs)(sV.Group,{children:[(0,G.jsx)(sV.DecrementButton,{}),(0,G.jsx)(sV.Input,{"aria-label":i(`maxInflight`)}),(0,G.jsx)(sV.IncrementButton,{})]})})}),(0,G.jsx)(E$,{label:i(`priority`),hint:i(`priorityHint`),children:(0,G.jsx)(sV,{value:d,onChange:e=>f(e??50),minValue:1,maxValue:100,isDisabled:r,isRequired:!0,children:(0,G.jsxs)(sV.Group,{children:[(0,G.jsx)(sV.DecrementButton,{}),(0,G.jsx)(sV.Input,{"aria-label":i(`priority`)}),(0,G.jsx)(sV.IncrementButton,{})]})})}),(0,G.jsx)(E$,{label:i(`proxyUrl`),hint:i(`proxyUrlHint`),children:(0,G.jsx)(lL,{value:p,onChange:e=>m(e.target.value),placeholder:i(`proxyUrlPlaceholder`),"aria-label":i(`proxyUrl`),disabled:r})}),e?.provider===`workbuddy`?(0,G.jsx)(E$,{label:i(`dropSystemPrompt`),hint:i(`dropSystemPromptHint`),children:(0,G.jsx)(fQ,{isSelected:h,isDisabled:r,ariaLabel:i(`dropSystemPrompt`),onChange:g})}):null,(0,G.jsx)(E$,{align:`start`,label:i(`accountModelAliases`),hint:i(`accountModelAliasesHint`),children:(0,G.jsxs)(`div`,{className:`space-y-2`,children:[_.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsxs)(`span`,{className:`mono min-w-0 truncate text-body`,children:[e.alias,` → `,e.model]}),(0,G.jsx)(X,{size:`sm`,variant:`ghost`,isDisabled:r,onPress:()=>y(t=>t.filter(t=>t.alias!==e.alias)),children:i(`modelAliasRemove`)})]},e.alias)),(0,G.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_1fr_auto]`,children:[(0,G.jsx)(lL,{"aria-label":i(`modelAliasName`),value:b.alias,onChange:e=>x(t=>({...t,alias:e.target.value})),placeholder:i(`modelAliasPlaceholder`),disabled:r}),(0,G.jsx)(lL,{"aria-label":i(`modelAliasTarget`),value:b.model,onChange:e=>x(t=>({...t,model:e.target.value})),placeholder:i(`accountModelAliasTargetPlaceholder`),disabled:r}),(0,G.jsx)(X,{size:`sm`,variant:`secondary`,isDisabled:r||!b.alias.trim()||!b.model.trim(),onPress:()=>{y(e=>[...e.filter(e=>e.alias!==b.alias.trim()),{alias:b.alias.trim(),model:b.model.trim()}]),x({alias:``,model:``})},children:i(`modelAliasAdd`)})]})]})}),(0,G.jsxs)(`section`,{className:`space-y-3 pt-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-foreground`,children:i(`enabledModels`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption leading-5 text-muted`,children:i(`enabledModelsHint`)})]}),(0,G.jsx)(fQ,{isSelected:S,isDisabled:r,ariaLabel:i(`restrictModels`),label:i(S?`restrictModels`:`allModels`),onChange:C})]}),E?(0,G.jsx)(`div`,{ref:D,children:(0,G.jsx)(`div`,{ref:O,children:(0,G.jsx)(D$,{catalog:k?k.map(e=>e.id):null,selected:w,onChange:T,isDisabled:r,t:i})})}):null]}),t===void 0?null:(0,G.jsx)(E$,{label:i(`autoCheckinTime`),hint:i(`checkinScheduleHint`),children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)(fQ,{isSelected:j,isDisabled:r,onChange:M,ariaLabel:i(`checkinInherit`),label:i(`checkinInherit`)}),(0,G.jsxs)(`p`,{className:`text-caption text-muted`,children:[i(`checkinDefaultValue`,{time:t}),` · `,(0,G.jsx)(`span`,{className:`mono`,children:n})]}),j?null:(0,G.jsx)(lL,{type:`time`,value:N??t,onChange:e=>P(e.target.value),"aria-label":i(`autoCheckinTime`),disabled:r,required:!0})]})})]})]}),(0,G.jsxs)(Z.Footer,{className:`justify-end gap-2 px-6 pb-6`,children:[(0,G.jsx)(X,{variant:`ghost`,isDisabled:r,onPress:a,children:i(`cancel`)}),(0,G.jsx)(X,{isPending:r,onPress:()=>void te(),children:i(`save`)})]})]})})})})}var A$={1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-3`};function j$({options:e,value:t,onChange:n,ariaLabel:r,columns:i=2,className:a=``}){let o=(0,v.useRef)(null);return(0,v.useLayoutEffect)(()=>{let e=o.current;if(!e)return;let t=eY.context(()=>{let e=eY.matchMedia();e.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(`[data-option-tile]`,{autoAlpha:1,y:0})}),e.add(`(prefers-reduced-motion: no-preference)`,()=>{eY.fromTo(`[data-option-tile]`,{autoAlpha:0,y:8},{autoAlpha:1,y:0,duration:.32,stagger:.035,ease:`power3.out`,overwrite:!0})})},e);return()=>t.revert()},[e.length]),(0,G.jsx)(`div`,{ref:o,role:`radiogroup`,"aria-label":r,className:`grid gap-3 ${A$[i]} ${a}`.trim(),children:e.map(e=>{let r=e.value===t;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-option-tile":``,"data-selected":r||void 0,disabled:e.disabled,title:e.hint,onClick:()=>n(e.value),className:`flex h-16 min-w-0 items-center gap-3 rounded-xl bg-surface shadow-surface px-4 text-left transition-colors hover:bg-surface-secondary disabled:cursor-not-allowed disabled:opacity-50 data-selected:border-accent data-selected:bg-accent-soft`,children:[e.icon?(0,G.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground [&_svg]:size-[18px]`,children:e.icon}):null,(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body font-medium leading-5 text-foreground`,children:e.label})]},e.value)})})}function M$(e,t){let n={...e},r=n.format===`workbuddy-accounts`||Array.isArray(n.accounts);return n.format?r&&(n.format=`workbuddy-accounts`):n.format=r?`workbuddy-accounts`:`workbuddy-oauth-v1`,{...n,name:t.name?.trim()||n.name,enabled:t.enabled??!0,provider:`workbuddy`,region:t.region,max_inflight:t.max_inflight??4,priority:t.priority??50,drop_system_prompt:t.drop_system_prompt??!0,...t.proxy_url!=null&&t.proxy_url!==``?{proxy_url:t.proxy_url}:{}}}function N$(e,t){let n=typeof e?.succeeded==`number`?e.succeeded:e?.id||e?1:0,r=typeof e?.failed==`number`?e.failed:0,i=(e?.errors||[]).slice(0,3).map(e=>e.message||`index ${e.index}`).filter(Boolean).join(`; `),a;return a=r>0?t(`accountImportPartial`).replace(`{ok}`,String(n)).replace(`{fail}`,String(r))+(i?` — ${i}`:``):n>1?t(`accountImportBatch`).replace(`{n}`,String(n)):t(`accountImported`),{succeeded:n,failed:r,message:a}}async function P$(e,t){return sU(M$(e,t))}var F$={global:`Global`,cn:`CN`},I$={"qoder-global":`accountTypeQoderGlobal`,"qoder-cn":`accountTypeQoderCN`,"workbuddy-cn":`accountTypeWorkBuddyCN`,"workbuddy-global":`accountTypeWorkBuddyGlobal`,"trae-cn":`accountTypeTraeCN`,"devin-global":`accountTypeDevinGlobal`,"command-global":`accountTypeCommandGlobal`,"codex-global":`accountTypeCodexGlobal`,"zhipu-cn":`accountTypeZhipuCN`,"qwenwork-global":`accountTypeQwenworkGlobal`,"qwenwork-cn":`accountTypeQwenworkCN`,"kimi-cn":`accountTypeKimiCN`},L$={"qoder-global":`accountTypeQoderGlobalHint`,"qoder-cn":`accountTypeQoderCNHint`,"workbuddy-cn":`accountTypeWorkBuddyCNHint`,"workbuddy-global":`accountTypeWorkBuddyGlobalHint`,"trae-cn":`accountTypeTraeCNHint`,"devin-global":`accountTypeDevinGlobalHint`,"command-global":`accountTypeCommandGlobalHint`,"codex-global":`accountTypeCodexGlobalHint`,"zhipu-cn":`accountTypeZhipuCNHint`,"qwenwork-global":`accountTypeQwenworkGlobalHint`,"qwenwork-cn":`accountTypeQwenworkCNHint`,"kimi-cn":`accountTypeKimiCNHint`};function R$({ariaLabel:e}){return(0,G.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,"aria-busy":`true`,"aria-label":e,children:Array.from({length:6},(e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-xl bg-surface-secondary px-3 py-2.5`,children:[(0,G.jsx)(qP,{className:`size-7 shrink-0 rounded-lg`}),(0,G.jsx)(qP,{className:`h-4 w-20 rounded-lg`})]},t))})}async function z$(){let e=(await tU().catch(()=>null))?.data||[],t=[];for(let n of e)for(let e of n.regions)t.push({id:`${n.id}-${e.id}`,provider:n.id,region:e.id,descriptor:n});return t}function B$(e,t){let n=I$[e.id];if(n){let e=t(n);if(e!==n)return e}let r=e.descriptor.regions.find(t=>t.id===e.region)?.label||F$[e.region]||``,i=e.descriptor.regions.length>1&&r?` ${r}`:``;return`${e.descriptor.label}${i}`.trim()}function V$(e,t){if(!e)return``;let n=L$[e.id];if(!n)return``;let r=t(n);return r===n?``:r}function H$({phase:e,busy:t,tab:n,forTab:r}){return e===`done`?(0,G.jsx)(bi,{size:16,className:`text-success`}):t&&n===r?(0,G.jsx)(uY,{size:16,loading:!0}):null}var U$=90,W$=2e3;function G$({isOpen:e,onClose:t,onAdded:n}){let{t:r}=DH(),[i,a]=(0,v.useState)(`method`),[o,s]=(0,v.useState)(`browser`),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(4),[x,S]=(0,v.useState)(50),[C,w]=(0,v.useState)(!0),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(`payg`),[N,P]=(0,v.useState)(``),[ee,F]=(0,v.useState)(``),[I,L]=(0,v.useState)(``),[te,R]=(0,v.useState)(`idle`),[z,B]=(0,v.useState)(``),[ne,re]=(0,v.useState)(``),[ie,V]=(0,v.useState)(!1),[ae,oe]=(0,v.useState)(``),[se,ce]=(0,v.useState)(`cli`),le=(0,v.useRef)(null),ue=(0,v.useRef)(null),de=(0,v.useRef)(null),fe=(0,v.useRef)(``),pe=(0,v.useRef)(null),me=(0,v.useRef)(null);function he(){pe.current!==null&&(window.clearTimeout(pe.current),pe.current=null)}(0,v.useEffect)(()=>()=>he(),[]),(0,v.useEffect)(()=>{if(!e)return;let t=!1;return p(!0),d([]),l(``),z$().then(e=>{t||(d(e),l(e[0]?.id||``),s(`browser`))}).finally(()=>{t||p(!1)}),()=>{t=!0}},[e]);let ge=u.find(e=>e.id===c),_e=!!ge&&!f,ve=ge?.descriptor.capabilities?.pat_login!==!1,ye=ge?.descriptor.capabilities?.import_export!==!1,be=ge?.descriptor.capabilities?.browser_login!==!1,xe=ge?.provider===`workbuddy`,Se=ge?.provider===`trae`||ge?.provider===`devin`||ge?.provider===`codex`,Ce=te===`busy`||te===`polling`,we=!!fe.current||Ce,Te=te===`done`,Ee=V$(ge,r);(0,v.useEffect)(()=>{o===`pat`&&!ve&&s(`browser`),o===`import`&&!ye&&s(`browser`)},[ye,ve,o]),(0,v.useEffect)(()=>{be||(ve?s(`pat`):ye&&s(`import`))},[be,ye,ve]);function De(){return!Number.isInteger(y)||y<1||y>32?4:y}function Oe(){return!Number.isInteger(x)||x<1||x>100?50:x}function ke(){return{max_inflight:De(),priority:Oe(),drop_system_prompt:xe?C:ge?.provider!==`kimi`,proxy_url:T.trim()}}function Ae(){he(),a(`method`),s(`browser`),l(``),d([]),p(!1),_(``),b(4),S(50),w(!0),E(``),O(``),A(``),M(`payg`),P(``),F(``),L(``),h(!1),R(`idle`),B(``),re(``),V(!1),oe(``),ce(`cli`),fe.current=``}function je(){Ce||(Ae(),t())}function Me(){Ae(),t()}(0,v.useLayoutEffect)(()=>{let t=le.current;if(e||(de.current=null),!t||!e)return;let n=eY.context(()=>{let e=eY.matchMedia();e.add(`(prefers-reduced-motion: reduce)`,()=>{eY.set(t,{autoAlpha:1,x:0,y:0})}),e.add(`(prefers-reduced-motion: no-preference)`,()=>{let e=de.current,n=e&&e!==i?i===`login`?1:-1:0;eY.fromTo(t,{autoAlpha:0,x:20*n,y:n?0:12},{autoAlpha:1,x:0,y:0,duration:tY.slow,ease:nY.out,overwrite:!0}),n&&ue.current&&eY.fromTo(ue.current,{autoAlpha:0,y:6},{autoAlpha:1,y:0,duration:tY.base,ease:nY.out,overwrite:!0})})},t);return de.current=i,()=>n.revert()},[e,i]);function Ne(e){if(Ce||!_e)return;let t=u.find(t=>t.id===e);l(e),s(t?.provider===`zhipu`?`pat`:`browser`),B(``),a(`login`)}async function Pe(){if(fe.current)return fe.current;if(!ge)throw Error(r(`accountTypeHint`));let e=ke(),t=await nU(g.trim()||r(`account`),ge.provider,ge.region,e),n=t?.id||t?.data?.id;if(!n)throw Error(`create account returned no id`);return fe.current=n,n}async function Fe(){B(``),re(``);try{R(`busy`);let e=await Pe();B(r(`wizardStartingSession`)),R(`polling`);let t=await RH(e,ge?.provider===`codex`?se:void 0);t.authUrl&&re(t.authUrl),B(r(`wizardWaitingBrowser`));for(let t=0;t{pe.current=window.setTimeout(e,W$)});let n=(await zH(e)).login||{};if(n.message&&B(n.message),n.status===`ok`)break;if(n.status===`error`)throw Error(n.message||`login failed`);if(t===89)throw Error(r(`wizardLoginTimeout`))}R(`done`),B(r(`wizardAccountReady`)),n(),window.setTimeout(Me,900)}catch(e){R(`idle`),B(e instanceof Error?e.message:String(e))}}async function Ie(){let e=ae.trim();if(!e){B(r(`wizardCallbackPh`));return}try{R(`busy`);let t=await Pe();he(),await BH(t,e),R(`done`),B(r(`wizardAccountReady`)),n(),window.setTimeout(Me,900)}catch(e){R(`polling`),B(e instanceof Error?e.message:String(e))}}async function Le(){let e=N.trim();if(!e){B(r(`zhipuKeyRequired`));return}if(!ge){B(r(`accountTypeHint`));return}B(``);try{R(`busy`);let t=ke();await sU({format:`zhipu-key-v1`,api_key:e,mode:j,organization:j===`coding`?ee.trim():``,project:j===`coding`?I.trim():``,name:g.trim()||r(`accountTypeZhipuCN`),enabled:!0,provider:ge.provider,region:ge.region,max_inflight:t.max_inflight,priority:t.priority,drop_system_prompt:t.drop_system_prompt,proxy_url:t.proxy_url}),R(`done`),B(r(`wizardAccountReady`)),n(),window.setTimeout(Me,700)}catch(e){R(`idle`),B(e instanceof Error?e.message:String(e))}}async function Re(){let e=D.trim();if(!e){B(r(`pastePatFirst`));return}B(``);try{R(`busy`);let t=await Pe();B(r(`wizardStartingSession`)),await VH(e,t),R(`done`),B(r(`patDone`)),n(),window.setTimeout(Me,700)}catch(e){R(`idle`),B(e instanceof Error?e.message:String(e))}}async function ze(){B(``);let e;try{e=JSON.parse(k)}catch{B(r(`wizardBadJson`));return}if(!e||typeof e!=`object`){B(r(`wizardBadJson`));return}if(!ge){B(r(`accountTypeHint`));return}if(ge.provider===`qoder`&&(typeof e.user_blob!=`string`||typeof e.machine_id!=`string`)){B(r(`wizardBadJson`));return}let t=ke(),i;ge.provider===`workbuddy`?i=M$(e,{region:ge.region===`global`?`global`:`cn`,name:g.trim()||void 0,enabled:!0,max_inflight:t.max_inflight,priority:t.priority,drop_system_prompt:t.drop_system_prompt,proxy_url:t.proxy_url}):(e.format||(ge.descriptor.id===`trae`?e.format=`trae-oauth-v1`:ge.descriptor.id===`devin`?e.format=`devin-session-v1`:ge.descriptor.id===`command`?e.format=`command-key-v1`:ge.descriptor.id===`qwenwork`?e.format=`qwenwork-oauth-v1`:e.format=`qoder-native-v1`),i={...e,name:g.trim()||e.name,enabled:!0,provider:ge.provider,region:ge.region,max_inflight:t.max_inflight,priority:t.priority,drop_system_prompt:t.drop_system_prompt});try{R(`busy`);let{failed:e,message:t}=N$(await sU(i),r);R(`done`),B(t),n(),window.setTimeout(Me,e>0?1600:700)}catch(e){R(`idle`),B(e instanceof Error?e.message:String(e))}}function Be(){me.current?.click()}function Ve(e){let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>A(String(n.result||``)),n.readAsText(t),e.target.value=``}let He=e=>Ce&&o===e,Ue=u.map(e=>({value:e.id,label:B$(e,r),hint:V$(e,r),icon:(0,G.jsx)(zZ,{provider:e.provider,size:18}),disabled:we})),We=ge?.provider===`zhipu`,Ge=[ge?.descriptor.capabilities?.browser_login===!1?null:{value:`browser`,label:r(`tabBrowser`),icon:(0,G.jsx)(Oa,{size:16})},ve?{value:`pat`,label:r(`tabPat`),icon:(0,G.jsx)(na,{size:16})}:null,ye?{value:`import`,label:r(`tabImport`),icon:(0,G.jsx)(Hi,{size:16})}:null].filter(Boolean),Ke=r(o===`browser`?ge?.provider===`codex`?`wizardCodexBrowserLead`:`wizardBrowserLead`:o===`pat`?ge?.provider===`command`?`wizardPatLeadCommand`:ge?.region===`cn`&&ge?.provider===`qoder`?`wizardPatLeadCN`:`wizardPatLead`:`wizardImportLead`);return(0,G.jsx)(Z.Root,{isOpen:e,onOpenChange:e=>{e||je()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,isDismissable:!Ce,children:(0,G.jsx)(Z.Container,{size:`lg`,scroll:`inside`,className:`sm:max-w-4xl`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`relative items-center justify-center px-12 pt-5 text-center`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:r(`addAccountTitle`)}),(0,G.jsx)(`p`,{ref:ue,className:`mt-1 text-caption font-normal leading-5 text-muted`,children:i===`method`?r(`addAccountDesc`):Ee||r(`addAccountDesc`)})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":r(`close`),className:`absolute right-4 top-4 grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsx)(Z.Body,{className:`px-6 pb-2`,children:(0,G.jsx)(`div`,{ref:le,children:i===`method`?(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(`section`,{className:`space-y-2.5`,children:f?(0,G.jsx)(R$,{ariaLabel:r(`accountType`)}):_e?(0,G.jsx)(j$,{ariaLabel:r(`accountType`),columns:2,value:``,onChange:Ne,options:Ue}):(0,G.jsx)(`p`,{className:`rounded-lg bg-surface-secondary/45 px-3.5 py-3 text-caption leading-5 text-muted`,children:r(`accountTypeHint`)})})}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg bg-surface-secondary/45 px-3 py-2.5`,children:[(0,G.jsx)(`span`,{className:`shrink-0`,children:(0,G.jsx)(zZ,{provider:ge?.provider,size:18})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`truncate text-body font-medium text-foreground`,children:ge?B$(ge,r):r(`accountType`)}),(0,G.jsx)(`div`,{className:`truncate text-caption text-muted`,children:Ee})]}),(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:()=>a(`method`),isDisabled:Ce||!!fe.current,children:[(0,G.jsx)(ui,{size:12}),r(`wizardBack`)]})]}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,G.jsx)(E$,{label:r(`accountName`),children:(0,G.jsx)(lL,{value:g,onChange:e=>_(e.target.value),placeholder:r(`wizardNamePh`),"aria-label":r(`accountName`),disabled:we,autoFocus:!0})}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>h(e=>!e),"aria-expanded":m,className:`inline-flex items-center gap-1 text-caption font-medium text-muted transition-colors hover:text-foreground`,children:[(0,G.jsx)(fi,{size:12,className:`transition-transform duration-200 ${m?`rotate-90`:``}`}),r(`wizardAdvanced`)]}),m?(0,G.jsxs)(`div`,{className:`space-y-3 rounded-lg bg-surface-secondary px-3.5 py-3.5`,children:[(0,G.jsx)(E$,{label:r(`maxInflight`),hint:r(`maxInflightHint`),children:(0,G.jsx)(sV,{value:y,onChange:e=>b(e??4),minValue:1,maxValue:32,isDisabled:we,isRequired:!0,children:(0,G.jsxs)(sV.Group,{children:[(0,G.jsx)(sV.DecrementButton,{}),(0,G.jsx)(sV.Input,{"aria-label":r(`maxInflight`)}),(0,G.jsx)(sV.IncrementButton,{})]})})}),(0,G.jsx)(E$,{label:r(`priority`),hint:r(`priorityHint`),children:(0,G.jsx)(sV,{value:x,onChange:e=>S(e??50),minValue:1,maxValue:100,isDisabled:we,isRequired:!0,children:(0,G.jsxs)(sV.Group,{children:[(0,G.jsx)(sV.DecrementButton,{}),(0,G.jsx)(sV.Input,{"aria-label":r(`priority`)}),(0,G.jsx)(sV.IncrementButton,{})]})})}),(0,G.jsx)(E$,{label:r(`proxyUrl`),hint:r(`proxyUrlHint`),children:(0,G.jsx)(lL,{value:T,onChange:e=>E(e.target.value),placeholder:r(`proxyUrlPlaceholder`),"aria-label":r(`proxyUrl`),disabled:we})}),xe?(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-muted`,children:r(`dropSystemPrompt`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption leading-5 text-muted`,children:r(`dropSystemPromptCreateHint`)})]}),(0,G.jsx)(fQ,{isSelected:C,isDisabled:we,ariaLabel:r(`dropSystemPrompt`),onChange:w})]}):null]}):null]}),We?(0,G.jsxs)(`div`,{className:`mt-4 flex flex-col gap-4`,children:[(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`span`,{className:`text-body font-medium text-muted`,children:r(`zhipuAccountMode`)}),(0,G.jsx)(j$,{ariaLabel:r(`zhipuAccountMode`),columns:2,value:j,onChange:e=>{Ce||M(e)},options:[{value:`payg`,label:r(`zhipuModePayg`),hint:r(`zhipuModePaygHint`),disabled:Ce},{value:`coding`,label:r(`zhipuModeCoding`),hint:r(`zhipuModeCodingHint`),disabled:Ce}]})]}),(0,G.jsx)(E$,{label:r(`zhipuApiKey`),children:(0,G.jsx)(lL,{type:`password`,value:N,onChange:e=>P(e.target.value),placeholder:r(`zhipuApiKeyPh`),"aria-label":r(`zhipuApiKey`),disabled:Ce})}),j===`coding`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(E$,{label:r(`zhipuOrganization`),children:(0,G.jsx)(lL,{value:ee,onChange:e=>F(e.target.value),placeholder:r(`zhipuOrganizationPh`),"aria-label":r(`zhipuOrganization`),disabled:Ce})}),(0,G.jsx)(E$,{label:r(`zhipuProject`),children:(0,G.jsx)(lL,{value:I,onChange:e=>L(e.target.value),placeholder:r(`zhipuProjectPh`),"aria-label":r(`zhipuProject`),disabled:Ce})})]}):null,z?(0,G.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-surface-secondary px-3 py-2 text-caption`,children:[Te?(0,G.jsx)(bi,{size:14,className:`shrink-0 text-success`}):null,(0,G.jsx)(`span`,{className:Te?`font-medium text-foreground`:`text-muted`,children:z})]}):null,(0,G.jsx)(X,{className:`w-full`,isPending:te===`busy`,onPress:()=>void Le(),isDisabled:Te,children:Te?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(bi,{size:15}),r(`wizardAccountReady`)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(na,{size:15}),r(`zhipuCreate`)]})})]}):null,We?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(qX,{className:`mt-3`,value:o,onChange:e=>{!Ce&&e!==o&&(s(e),B(``),re(``),V(!1))},ariaLabel:r(`authentication`),options:Ge.map(e=>({id:e.value,label:e.label,icon:e.icon}))}),(0,G.jsx)(`p`,{className:`mt-2 min-h-5 text-caption leading-5 text-muted`,children:Ke}),(0,G.jsx)(`div`,{className:`mt-3 flex flex-col gap-4`,children:o===`browser`?(0,G.jsxs)(G.Fragment,{children:[ge?.provider===`codex`?(0,G.jsx)(j$,{ariaLabel:r(`codexLoginMethod`),columns:2,value:se,onChange:e=>{Ce||ce(e)},options:[{value:`cli`,label:r(`codexLoginCli`),hint:r(`codexLoginCliHint`),disabled:Ce||!!fe.current},{value:`chatgpt`,label:r(`codexLoginChatGPT`),hint:r(`codexLoginChatGPTHint`),disabled:Ce||!!fe.current}]}):null,ne?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-3 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-caption`,children:[(0,G.jsx)(H$,{phase:te,busy:Ce,tab:o,forTab:`browser`}),(0,G.jsx)(`span`,{className:`text-muted`,children:z||r(`loginOpenMsg`)})]}),(0,G.jsx)(`code`,{className:`mono mt-2 block break-all text-caption leading-5 text-foreground`,children:ne}),(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,onPress:()=>window.open(ne,`_blank`,`noopener,noreferrer`),children:[(0,G.jsx)(Qr,{size:14}),r(`openAuthUrl`)]}),(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:()=>{NQ(ne).then(e=>{e&&(V(!0),window.setTimeout(()=>V(!1),1100))})},children:[(0,G.jsx)(MQ,{copied:ie}),r(ie?`copied`:`copy`)]})]})]}):null,z&&!ne?(0,G.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-surface-secondary px-3 py-2 text-caption`,children:[Te?(0,G.jsx)(bi,{size:14,className:`shrink-0 text-success`}):null,(0,G.jsx)(`span`,{className:Te?`font-medium text-foreground`:`text-muted`,children:z})]}):null,Se?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`p`,{className:`text-caption leading-4 text-muted`,children:r(`wizardCallbackLead`)}),(0,G.jsx)(mL,{className:`h-28 w-full resize-none font-mono text-caption leading-5`,value:ae,onChange:e=>oe(e.target.value),placeholder:r(`wizardCallbackPh`),"aria-label":r(`wizardCallbackPh`),disabled:Te}),(0,G.jsx)(X,{className:`w-full`,variant:`secondary`,isPending:te===`busy`&&!!ae.trim(),onPress:()=>void Ie(),isDisabled:Te,children:r(`wizardSubmitCallback`)})]}):null,(0,G.jsx)(X,{className:`w-full`,isPending:He(`browser`),onPress:()=>void Fe(),children:Te?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(bi,{size:15}),r(`wizardAccountReady`)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Oa,{size:15}),r(`wizardStartBrowser`)]})})]}):o===`pat`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(E$,{label:r(`tabPat`),children:(0,G.jsx)(lL,{type:`password`,value:D,onChange:e=>O(e.target.value),placeholder:r(`wizardPatPh`),"aria-label":r(`wizardPatPh`),disabled:Ce})}),z?(0,G.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-surface-secondary px-3 py-2 text-caption`,children:[Te?(0,G.jsx)(bi,{size:14,className:`shrink-0 text-success`}):null,(0,G.jsx)(`span`,{className:Te?`font-medium text-foreground`:`text-muted`,children:z})]}):null,(0,G.jsx)(X,{className:`w-full`,isPending:He(`pat`),onPress:()=>void Re(),children:Te?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(bi,{size:15}),r(`patDone`)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(na,{size:15}),r(`wizardCreateAndLogin`)]})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`span`,{className:`text-caption font-medium text-muted`,children:`JSON`}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,onPress:Be,isDisabled:Ce,children:[(0,G.jsx)(Hi,{size:13}),r(`wizardChooseFile`)]}),(0,G.jsx)(`input`,{ref:me,type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:Ve})]}),(0,G.jsx)(mL,{className:`min-h-32 font-mono text-caption`,value:k,onChange:e=>A(e.target.value),placeholder:r(`wizardImportPh`),"aria-label":r(`tabImport`),disabled:Ce}),z?(0,G.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-surface-secondary px-3 py-2 text-caption`,children:[Te?(0,G.jsx)(bi,{size:14,className:`shrink-0 text-success`}):null,(0,G.jsx)(`span`,{className:Te?`font-medium text-foreground`:`text-muted`,children:z})]}):null,(0,G.jsx)(X,{className:`w-full`,isPending:He(`import`),onPress:()=>void ze(),children:Te?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(bi,{size:15}),r(`accountImported`)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Hi,{size:15}),r(`importCredential`)]})})]})})]})]})})}),(0,G.jsx)(Z.Footer,{className:`justify-end px-5 pb-5`,children:(0,G.jsx)(X,{variant:`ghost`,onPress:je,isDisabled:Ce,children:r(`cancel`)})})]})})})})}function K$({isOpen:e,title:t,description:n,confirmLabel:r,cancelLabel:i,closeLabel:a,isPending:o,status:s=`danger`,confirmVariant:c=`danger`,onClose:l,onConfirm:u}){return(0,G.jsx)(wS.Root,{isOpen:e,onOpenChange:e=>{!e&&!o&&l()},children:(0,G.jsx)(wS.Backdrop,{variant:`blur`,isDismissable:!o,children:(0,G.jsx)(wS.Container,{placement:`center`,size:`sm`,children:(0,G.jsxs)(wS.Dialog,{children:[(0,G.jsxs)(wS.Header,{className:`items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(wS.Icon,{status:s}),(0,G.jsx)(`div`,{children:(0,G.jsx)(wS.Heading,{children:t})})]}),(0,G.jsx)(wS.CloseTrigger,{isDisabled:o,"aria-label":a})]}),(0,G.jsx)(wS.Body,{children:(0,G.jsx)(`p`,{className:`text-body leading-6 text-muted`,children:n})}),(0,G.jsxs)(wS.Footer,{children:[(0,G.jsx)(X,{size:`sm`,variant:`ghost`,isDisabled:o,onPress:l,children:i}),(0,G.jsx)(X,{size:`sm`,variant:c,isPending:o,onPress:u,children:r})]})]})})})})}function q$(e,t){return e===`region_mixed`?t(`batchImportRegionMixed`):e===`region_unknown`?t(`batchImportRegionUnknown`):e===`unknown_format`?t(`batchImportUnknownFormat`):``}function J$({isOpen:e,detection:t,fileName:n,isPending:r,t:i,onClose:a,onConfirm:o}){let[s,c]=(0,v.useState)(`cn`);(0,v.useEffect)(()=>{t&&(t.region===`cn`||t.region===`global`?c(t.region):c(`cn`))},[t]);let l=!!t?.batchImportSupported,u=t?.provider,d=t?.format||i(`batchImportFormatUnknown`),f=u?TZ(u,i):i(`batchImportProviderUnknown`),p=(t?.warnings||[]).map(e=>q$(e,i)).filter(Boolean);return(0,G.jsx)(Z.Root,{isOpen:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,isDismissable:!r,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`sm`,scroll:`inside`,className:`mx-3 w-full max-w-[min(100%,24rem)] sm:mx-0`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:i(`batchImportConfirmTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 break-all text-caption leading-5 text-muted`,children:n?i(`batchImportConfirmHint`,{file:n}):i(`batchImportConfirmHintNoFile`)})]}),(0,G.jsx)(Z.CloseTrigger,{isDisabled:r,"aria-label":i(`close`),className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Body,{className:`space-y-4 px-5 pb-2`,children:[(0,G.jsx)(`div`,{className:`rounded-xl bg-surface-secondary px-3.5 py-3`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[u?(0,G.jsx)(zZ,{provider:u,size:18}):null,(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-foreground`,children:f}),(0,G.jsx)(`div`,{className:`mono mt-0.5 truncate text-caption text-muted`,children:d})]})]})}),l?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`div`,{className:`text-body font-medium text-muted`,children:i(`batchImportRegion`)}),(0,G.jsx)(qX,{value:s,onChange:e=>{(e===`cn`||e===`global`)&&c(e)},ariaLabel:i(`batchImportRegion`),options:[{id:`cn`,label:i(`accountTypeWorkBuddyCN`)},{id:`global`,label:i(`accountTypeWorkBuddyGlobal`)}]}),t?.regionAmbiguous?(0,G.jsx)(`p`,{className:`text-caption leading-5 text-muted`,children:i(`batchImportRegionPickHint`)}):null]}):(0,G.jsx)(`p`,{className:`text-body leading-6 text-muted`,children:i(`batchImportProviderUnsupported`)}),p.length?(0,G.jsx)(`ul`,{className:`space-y-1 text-caption leading-5 text-muted`,children:p.map(e=>(0,G.jsx)(`li`,{children:e},e))}):null]}),(0,G.jsxs)(Z.Footer,{className:`flex-col-reverse gap-2 px-5 pb-5 sm:flex-row sm:justify-end`,children:[(0,G.jsx)(X,{size:`sm`,variant:`ghost`,className:`w-full sm:w-auto`,isDisabled:r,onPress:a,children:i(l?`cancel`:`close`)}),l?(0,G.jsx)(X,{size:`sm`,className:`w-full sm:w-auto`,isPending:r,onPress:()=>o(s),children:i(`batchImportConfirmAction`)}):null]})]})})})})}var Y$={"workbuddy-accounts":`workbuddy`,"workbuddy-oauth-v1":`workbuddy`,"qoder-native-v1":`qoder`,"trae-oauth-v1":`trae`,"devin-session-v1":`devin`,"command-key-v1":`command`,"codex-oauth-v1":`codex`,"zhipu-key-v1":`zhipu`,"qwenwork-oauth-v1":`qwenwork`},X$=[`codebuddy.cn`],Z$=[`workbuddy.ai`,`workbuddy.com`];function Q$(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function $$(e){let t=[],n=e=>{typeof e==`string`&&e.trim()&&t.push(e.trim().toLowerCase())};if(n(e.domain),Q$(e.account)&&n(e.account.domain),Array.isArray(e.accounts))for(let t of e.accounts)Q$(t)&&n(t.domain);return t}function e1(e){return X$.some(t=>e.includes(t))}function t1(e){return Z$.some(t=>e.includes(t))}function n1(e){return typeof e.accessToken==`string`||typeof e.access_token==`string`||typeof e.refreshToken==`string`||typeof e.refresh_token==`string`}function r1(e){return Q$(e)?n1(e)||typeof e.domain==`string`||typeof e.uid==`string`:!1}function i1(e){let t=$$(e);if(t.length===0)return{region:`cn`,ambiguous:!0,warning:`region_unknown`};let n=t.some(e1),r=t.some(t1);return n&&r?{region:null,ambiguous:!0,warning:`region_mixed`}:n?{region:`cn`,ambiguous:!1}:r?{region:`global`,ambiguous:!1}:{region:`cn`,ambiguous:!0,warning:`region_unknown`}}function a1(e){return Array.isArray(e.accounts)&&e.accounts.some(r1)?{format:`workbuddy-accounts`,provider:`workbuddy`,confidence:`medium`}:(typeof e.user_blob==`string`||typeof e.userBlob==`string`)&&(typeof e.machine_id==`string`||typeof e.machineId==`string`)?{format:`qoder-native-v1`,provider:`qoder`,confidence:`medium`}:typeof e.session_token==`string`||typeof e.sessionToken==`string`?{format:`devin-session-v1`,provider:`devin`,confidence:`low`}:n1(e)||Q$(e.account)&&n1(e.account)||Q$(e.auth)?{format:`workbuddy-oauth-v1`,provider:`workbuddy`,confidence:`low`}:typeof e.api_key==`string`||typeof e.apiKey==`string`?typeof e.organization==`string`||typeof e.project==`string`?{format:`zhipu-key-v1`,provider:`zhipu`,confidence:`low`}:{format:`command-key-v1`,provider:`command`,confidence:`low`}:{format:null,provider:null,confidence:`low`}}function o1(e){if(!Q$(e))return{format:null,provider:null,region:null,regionAmbiguous:!0,confidence:`low`,warnings:[`not_object`],batchImportSupported:!1};let t=[],n=typeof e.format==`string`?e.format.trim():``,r=n||null,i=r?Y$[r]??null:null,a=r&&i?`high`:`low`;if(!i){let o=a1(e);r||=o.format,i=o.provider,a=n&&!Y$[n]?`low`:o.confidence,n&&!Y$[n]&&t.push(`unknown_format`)}i===`workbuddy`&&Array.isArray(e.accounts)&&(r=`workbuddy-accounts`);let o=null,s=!1;if(i===`workbuddy`){let n=i1(e);o=n.region,s=n.ambiguous,n.warning&&t.push(n.warning)}return{format:r,provider:i,region:o,regionAmbiguous:s,confidence:a,warnings:t,batchImportSupported:i===`workbuddy`}}function s1(e){let t;try{t=JSON.parse(e)}catch{throw Error(`bad_json`)}if(!Q$(t))throw Error(`bad_json`);return t}var c1=`__all__`,l1=[],u1=2;function d1(){let{t:e}=DH(),[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(!0),d=s,f=d.length>0,[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(null),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(null),[O,k]=(0,v.useState)({}),[A,j]=(0,v.useState)({}),[M,N]=(0,v.useState)({}),[P,ee]=(0,v.useState)({}),[F,I]=(0,v.useState)(null),[L,te]=(0,v.useState)(null),[R,z]=(0,v.useState)(null),[B,ne]=(0,v.useState)(null),[re,ie]=(0,v.useState)(null),[V,ae]=(0,v.useState)(``),[oe,se]=(0,v.useState)(`all`),[ce,le]=(0,v.useState)(``),[ue,de]=(0,v.useState)(1),[fe,pe]=(0,v.useState)(20),[me,he]=(0,v.useState)({}),[ge,_e]=(0,v.useState)({}),[ve,ye]=(0,v.useState)({}),[be,xe]=(0,v.useState)({}),[Se,Ce]=(0,v.useState)(!1),we=(0,v.useCallback)(async(e=!1)=>{try{let t=(await LH(e)).data||l1;return c(t),t}finally{u(!1)}},[]),Te=(0,v.useCallback)(async(e,t=!0)=>{let n=[...new Set(e)];if(n.length)for(let e=0;e{try{let n=await XH(e,{quota:t});c(t=>t.map(t=>t.id===e?n:t))}catch(t){N(n=>({...n,[e]:t instanceof Error?t.message:String(t)}))}}))}},[]);(0,v.useEffect)(()=>{we(!1).catch(()=>void 0)},[we]),(0,v.useEffect)(()=>{let e=!0;return Promise.all([tU(),SU()]).then(([t,r])=>{e&&(n(t.data||[]),i(r))}).catch(t=>{e&&o(t instanceof Error?t.message:String(t))}),()=>{e=!1}},[]);function Ee(e){return t.find(t=>t.id===e.provider)?.regions.find(t=>t.id===e.region)?.checkin}function De(e){let t=Ee(e)?.timezone;return t===`Local`?r?.timezone:t}let Oe=(0,v.useMemo)(()=>d.map(e=>{let t=me[e.id],n=ge[e.id],r=ve[e.id],i=be[e.id],a=e;return t!==void 0&&(a={...a,enabled:t}),n!==void 0&&(a={...a,name:n}),r!==void 0&&(a={...a,max_inflight:r}),i!==void 0&&(a={...a,priority:i}),a}),[me,ve,ge,be,d]),ke=(0,v.useMemo)(()=>{let e={all:Oe.length,available:0,attention:0,disabled:0};for(let t of Oe){let n=DX(t);n===`hot`||n===`ready`?e.available+=1:n===`disabled`&&(e.disabled+=1),t.enabled&&n!==`hot`&&n!==`ready`&&(e.attention+=1)}return e},[Oe]),Ae=(0,v.useMemo)(()=>{let e=new Map;for(let t of Oe){let n=String(t.provider||`qoder`).toLowerCase();e.set(n,(e.get(n)||0)+1)}return[...e.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))},[Oe]),je=Oe.find(e=>e.id===F),Me=Oe.find(e=>e.id===L)||null,Ne=Oe.find(e=>e.id===R)||null,Pe=Oe.find(e=>e.id===B)||null,Fe=(0,v.useMemo)(()=>{let e=V.trim().toLowerCase();return Oe.filter(t=>{let n=DX(t);return!(oe===`all`||oe===`available`&&(n===`hot`||n===`ready`)||oe===`attention`&&t.enabled&&n!==`hot`&&n!==`ready`||oe===`disabled`&&n===`disabled`)||ce&&String(t.provider||`qoder`).toLowerCase()!==ce?!1:!e||[t.name,t.id,t.remote_uid,t.provider,t.auth_type].some(t=>String(t||``).toLowerCase().includes(e))})},[Oe,oe,ce,V]),Ie=[V,oe,ce,fe].join(`\0`),[Le,Re]=(0,v.useState)(Ie);Le!==Ie&&(Re(Ie),de(1));let ze=Math.max(1,Math.ceil(Fe.length/fe)),Be=Math.min(Le===Ie?Math.max(1,ue):1,ze);ue!==Be&&de(Be);let Ve=(0,v.useMemo)(()=>{let e=(Be-1)*fe;return Fe.slice(e,e+fe)},[Be,Fe,fe]);if(l&&!f)return(0,G.jsx)(_Y,{});async function He(e,t,n){D({id:e,kind:t}),N(t=>({...t,[e]:``}));try{return await n(),!0}catch(t){return N(n=>({...n,[e]:t instanceof Error?t.message:String(t)})),!1}finally{D(null)}}async function Ue(t,n){ie(t),await He(t,`device`,async()=>{N(n=>({...n,[t]:e(`wizardStartingSession`)}));let r=await RH(t,n);r.authUrl&&ee(e=>({...e,[t]:r.authUrl||``}));for(let n=0;n<60;n++){await new Promise(e=>window.setTimeout(e,2e3));let n=(await zH(t)).login||{};if(N(r=>({...r,[t]:n.message||e(`waitingQoderLogin`)})),n.status===`ok`||n.status===`error`)break}await we(!1),await Te([t])})}async function We(t){let n=(A[t]||``).trim();if(!n){N(n=>({...n,[t]:e(`wizardCallbackPh`)}));return}await He(t,`callback`,async()=>{N(n=>({...n,[t]:e(`wizardStartingSession`)})),await BH(t,n),j(e=>({...e,[t]:``})),await we(!1),await Te([t])})&&(ie(e=>e===t?null:e),N(e=>({...e,[t]:``})))}async function Ge(t){let n=(O[t]||``).trim();if(!n){N(n=>({...n,[t]:e(`pastePatFirst`)}));return}await He(t,`pat`,async()=>{N(n=>({...n,[t]:e(`wizardStartingSession`)})),await VH(n,t),k(e=>({...e,[t]:``})),await we(!1),await Te([t])})}async function Ke(t){await He(t,`export`,async()=>{let n=await cU(t);await NQ(JSON.stringify(n,null,2)),N(n=>({...n,[t]:e(`credentialCopied`)}))})}async function qe(e,t){he(n=>({...n,[e]:t})),await He(e,`toggle`,async()=>{await aU(e,{enabled:t}),await we(!1)}),he(t=>{let n={...t};return delete n[e],n})}async function Je(t){JY({id:`refresh-${t}`,type:`loading`,title:e(`toastRefreshingAccount`)}),D({id:t,kind:`refresh`}),N(e=>{let n={...e};return delete n[t],n});try{await Te([t]),JY({id:`refresh-${t}`,type:`success`,title:e(`toastAccountRefreshed`)})}catch(n){throw JY({id:`refresh-${t}`,type:`error`,title:e(`toastFailed`),description:n instanceof Error?n.message:String(n)}),n}finally{D(null)}}async function Ye(){Ce(!0),JY({id:`refresh-credits`,type:`loading`,title:e(`toastRefreshingCredits`)});try{await Te(s.map(e=>e.id)),JY({id:`refresh-credits`,type:`success`,title:e(`toastCreditsRefreshed`)})}catch(t){throw JY({id:`refresh-credits`,type:`error`,title:e(`toastFailed`),description:t instanceof Error?t.message:String(t)}),t}finally{Ce(!1)}}function Xe(){h||(y(!1),x(null),C(null),T(``))}async function Ze(t){let n=t.target.files?.[0];if(t.target.value=``,n)try{let t=s1(await n.text()),r=o1(t);if(!r.provider){JY({type:`error`,title:e(`batchImportUnrecognized`)});return}C(t),x(r),T(n.name),y(!0)}catch(t){let n=t instanceof Error?t.message:String(t);JY({type:`error`,title:e(n===`bad_json`?`wizardBadJson`:`batchImportUnrecognized`),description:n===`bad_json`?void 0:n})}}async function Qe(t){if(!S||!b?.batchImportSupported||h)return;g(!0);let n=`batch-import-accounts`;JY({id:n,type:`loading`,title:e(`batchImportLoading`)});try{let{succeeded:r,failed:i,message:a}=N$(await P$(S,{region:t}),e);JY({id:n,type:i>0&&r===0?`error`:i>0?`info`:`success`,title:a}),y(!1),x(null),C(null),T(``),r>0&&await we(!1)}catch(t){JY({id:n,type:`error`,title:e(`toastFailed`),description:t instanceof Error?t.message:String(t)})}finally{g(!1)}}async function $e(e,t){await He(e,`toggle`,async()=>{await aU(e,{auto_checkin:t}),await we(!1)})}async function et(e){await He(e,`checkin`,async()=>{try{await rU(e)}finally{await we(!1)}})}async function tt(t,n){if(!t)throw Error(e(`accountNameRequired`));_e(e=>({...e,[t]:n.name})),ye(e=>({...e,[t]:n.max_inflight})),xe(e=>({...e,[t]:n.priority})),D({id:t,kind:`settings`});try{await aU(t,n),await we(!1)}catch(e){throw e instanceof Error?e:Error(String(e))}finally{D(null),_e(e=>{let n={...e};return delete n[t],n}),ye(e=>{let n={...e};return delete n[t],n}),xe(e=>{let n={...e};return delete n[t],n})}}return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[a?(0,G.jsx)(bU,{title:a}):null,(0,G.jsxs)(`section`,{"data-gsap-reveal":!0,className:`flex flex-wrap items-center gap-2`,children:[d.length?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(qX,{value:oe,onChange:e=>se(e),ariaLabel:e(`accountStatusFilter`),options:[{id:`all`,label:(0,G.jsxs)(G.Fragment,{children:[e(`filterAll`),(0,G.jsx)(`span`,{className:`mono text-muted`,children:ke.all})]})},{id:`available`,label:(0,G.jsxs)(G.Fragment,{children:[e(`availableAccounts`),(0,G.jsx)(`span`,{className:`mono text-muted`,children:ke.available})]})},{id:`attention`,label:(0,G.jsxs)(G.Fragment,{children:[e(`needsAttention`),(0,G.jsx)(`span`,{className:`mono ${ke.attention?`text-danger`:`text-muted`}`,children:ke.attention})]})},{id:`disabled`,label:(0,G.jsxs)(G.Fragment,{children:[e(`disabled`),(0,G.jsx)(`span`,{className:`mono text-muted`,children:ke.disabled})]})}]}),(0,G.jsxs)(SV,{className:`w-48`,"aria-label":e(`providerFilterAll`),value:ce||c1,onChange:e=>{typeof e==`string`&&le(e===c1?``:e)},children:[(0,G.jsxs)(SV.Trigger,{className:`items-center`,children:[(0,G.jsx)(SV.Value,{className:`min-w-0 truncate`}),(0,G.jsx)(SV.Indicator,{})]}),(0,G.jsx)(SV.Popover,{children:(0,G.jsxs)(GB,{children:[(0,G.jsxs)(GB.Item,{id:c1,textValue:e(`providerFilterAll`),children:[(0,G.jsxs)(sR,{className:`flex items-center gap-2`,children:[e(`providerFilterAll`),(0,G.jsx)(`span`,{className:`mono text-muted`,children:d.length})]}),(0,G.jsx)(GB.ItemIndicator,{})]}),Ae.map(([t,n])=>(0,G.jsxs)(GB.Item,{id:t,textValue:TZ(t,e),children:[(0,G.jsxs)(sR,{className:`flex items-center gap-2`,children:[(0,G.jsx)(zZ,{provider:t,size:13}),TZ(t,e),(0,G.jsx)(`span`,{className:`mono text-muted`,children:n})]}),(0,G.jsx)(GB.ItemIndicator,{})]},t))]})})]}),(0,G.jsx)(bQ,{className:`w-full sm:w-60`,value:V,onChange:ae,placeholder:e(`searchAccounts`),ariaLabel:e(`searchAccounts`)})]}):null,(0,G.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:ml-auto sm:w-auto`,children:[(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:Se,onPress:()=>void Ye(),children:[(0,G.jsx)(ni,{size:14}),e(`refreshCredits`)]}),(0,G.jsxs)(`label`,{htmlFor:`accounts-batch-import-file`,className:`button button--sm button--secondary inline-flex items-center gap-1.5 ${h||_?`pointer-events-none opacity-60`:`cursor-pointer`}`,children:[h?(0,G.jsx)(uY,{size:14,loading:!0}):(0,G.jsx)(eo,{size:14}),e(`batchImport`)]}),(0,G.jsx)(`input`,{id:`accounts-batch-import-file`,type:`file`,accept:`.json,application/json,text/json`,disabled:h||_,className:`sr-only`,onChange:e=>void Ze(e)}),(0,G.jsxs)(X,{size:`sm`,onPress:()=>m(!0),children:[(0,G.jsx)(wa,{size:14}),e(`addAccount`)]})]})]}),(0,G.jsx)(G$,{isOpen:p,onClose:()=>m(!1),onAdded:()=>{JY({type:`success`,title:e(`toastAccountAdded`)}),we(!1)}}),(0,G.jsx)(J$,{isOpen:_,detection:b,fileName:w,isPending:h,t:e,onClose:Xe,onConfirm:e=>{Qe(e)}}),(0,G.jsx)(w$,{account:Me,t:e,onClose:()=>te(null)},L??`closed`),(0,G.jsx)(S$,{account:Ne,t:e,onClose:()=>z(null)},R??`closed`),(0,G.jsx)(k$,{account:Pe,checkinDefaultTime:Pe&&Ee(Pe)?r?.checkin_times[Pe.provider||``]:void 0,checkinTimezone:Pe?De(Pe):void 0,busy:!!(E&&E.id===B&&E.kind===`settings`),t:e,onClose:()=>ne(null),onSave:e=>tt(B||``,e)},B??`closed`),(0,G.jsx)(K$,{isOpen:!!je,title:e(`delete`),description:e(`deleteAccountConfirm`,{name:je?.name||je?.id||``}),confirmLabel:e(`delete`),cancelLabel:e(`cancel`),closeLabel:e(`close`),isPending:E?.id===F&&E.kind===`delete`,onClose:()=>I(null),onConfirm:()=>{if(!je)return;let t=je.id;I(null),He(t,`delete`,async()=>{await oU(t),await we(!1)}).then(t=>{t&&JY({type:`success`,title:e(`toastAccountDeleted`)})})}}),f?null:(0,G.jsx)(pQ,{className:`rounded-3xl bg-surface-secondary`,icon:(0,G.jsx)(uY,{size:28}),title:e(`noAccounts`),hint:e(`accountEmptyHint`),action:(0,G.jsxs)(X,{size:`sm`,onPress:()=>m(!0),children:[(0,G.jsx)(wa,{size:14}),e(`addAccount`)]})}),f&&!Fe.length?(0,G.jsx)(pQ,{className:`rounded-3xl bg-surface-secondary`,icon:(0,G.jsx)(ua,{size:22}),title:e(`noAccountsMatch`),action:(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:()=>{ae(``),se(`all`),le(``)},children:e(`clearFilters`)})}):null,(0,G.jsx)(`section`,{className:`grid auto-rows-[minmax(280px,auto)] gap-2.5 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4`,children:Ve.map(t=>(0,G.jsx)(y$,{account:t,busyKind:E?.id===t.id?E.kind:``,authPanelOpen:re===t.id,authUrl:P[t.id],note:M[t.id],pat:O[t.id]||``,t:e,onPatChange:e=>k(n=>({...n,[t.id]:e})),callbackUrl:A[t.id]||``,onCallbackChange:e=>j(n=>({...n,[t.id]:e})),onSubmitCallback:()=>void We(t.id),onDeviceLogin:e=>void Ue(t.id,e),onPatLogin:()=>void Ge(t.id),onExport:()=>void Ke(t.id),onRefresh:()=>void Je(t.id),onDelete:()=>I(t.id),onToggle:e=>void qe(t.id,e),checkinDefaultTime:r?.checkin_times[t.provider||``],onToggleAutoCheckin:Ee(t)?e=>void $e(t.id,e):void 0,onCheckin:Ee(t)?()=>void et(t.id):void 0,onViewCheckins:Ee(t)?()=>z(t.id):void 0,onEdit:()=>ne(t.id),onToggleAuthPanel:()=>ie(e=>e===t.id?null:t.id),onViewModels:()=>te(t.id)},t.id))}),Fe.length?(0,G.jsx)(yQ,{total:Fe.length,page:Be,pageCount:ze,pageSize:fe,pageSizes:_Q,loading:!1,pageSizeLabel:e(`logsPageSize`),pageLabel:e(`logsPage`,{page:Be,pages:ze}),prevLabel:e(`logsPrevPage`),nextLabel:e(`logsNextPage`),onPage:de,onPageSize:pe}):null]})}function f1(){let{t:e,lang:t,setLang:n}=DH(),{setApiKey:r}=jH(),{overview:i,refresh:a}=dU(),{theme:o,toggleTheme:s}=gU(),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(``),g=ot(),_=rt().state?.from||`/`,y=(0,v.useRef)(null);if(EY(y,`login`),i)return(0,G.jsx)(jt,{to:_===`/login`?`/`:_,replace:!0});async function b(t){t.preventDefault();let n=c.trim();if(!n){h(e(`loginNeedKey`));return}p(!0),h(``);try{r(n),await a(n),g(_===`/login`?`/`:_,{replace:!0})}catch(t){h(PH(t)?e(`loginBadKey`):t instanceof Error?t.message:String(t))}finally{p(!1)}}return(0,G.jsxs)(`div`,{className:`relative min-h-dvh overflow-hidden bg-background text-foreground`,children:[(0,G.jsx)(`div`,{className:`absolute inset-x-0 top-0 h-px bg-border`}),(0,G.jsxs)(`main`,{ref:y,className:`relative z-10 mx-auto grid min-h-dvh w-full max-w-[1480px] lg:grid-cols-[minmax(0,1fr)_minmax(480px,45%)]`,children:[(0,G.jsxs)(`section`,{className:`flex min-h-[52vh] flex-col border-separator px-5 py-6 sm:px-10 sm:py-8 lg:min-h-dvh lg:border-r lg:px-14 lg:py-10 xl:px-20`,children:[(0,G.jsxs)(`header`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(uY,{size:36}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`font-semibold`,children:`CLI2API`}),(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e(`controlPlane`)})]})]}),(0,G.jsxs)(OI,{isAttached:!0,children:[(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,onPress:()=>n(t===`zh`?`en`:`zh`),"aria-label":t===`zh`?`English`:`中文`,children:(0,G.jsx)(Xi,{size:15})})}),(0,G.jsx)(eL.Content,{children:t===`zh`?`English`:`中文`})]}),(0,G.jsxs)(eL,{children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,onPress:s,"aria-label":o===`dark`?`Light mode`:`Dark mode`,children:o===`dark`?(0,G.jsx)(Wa,{size:15}):(0,G.jsx)(fa,{size:15})})}),(0,G.jsx)(eL.Content,{children:o===`dark`?`Light mode`:`Dark mode`})]})]})]}),(0,G.jsxs)(`div`,{className:`my-auto max-w-3xl py-16 lg:py-24`,children:[(0,G.jsx)(`p`,{"data-gsap-reveal":!0,className:`mb-5 mono text-caption text-muted`,children:`:3010`}),(0,G.jsx)(`h1`,{"data-gsap-reveal":!0,className:`max-w-3xl text-[clamp(2.25rem,4vw,3.6rem)] font-semibold leading-[0.98] tracking-[-0.045em] text-balance`,children:e(`loginTitle`)}),(0,G.jsx)(`p`,{"data-gsap-reveal":!0,className:`mt-6 max-w-xl text-section font-normal text-muted sm:text-title sm:font-normal`,children:e(`loginLead`)}),(0,G.jsx)(`p`,{"data-gsap-reveal":!0,className:`mt-10 max-w-xl pt-5 text-body leading-6 text-muted`,children:e(`loginHint`)})]}),(0,G.jsxs)(`footer`,{className:`hidden items-center justify-between text-caption text-muted lg:flex`,children:[(0,G.jsx)(`span`,{children:e(`loginHint`)}),(0,G.jsx)(`span`,{children:e(`routesHint`)})]})]}),(0,G.jsx)(`section`,{className:`flex items-center px-5 py-10 sm:px-10 lg:px-12 xl:px-16`,children:(0,G.jsx)(zw,{"data-gsap-reveal":!0,className:`w-full p-0`,children:(0,G.jsxs)(`form`,{onSubmit:e=>void b(e),children:[(0,G.jsx)(zw.Header,{className:`border-b border-separator px-6 py-6 sm:px-8`,children:(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,G.jsx)(uY,{size:28,loading:f}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(zw.Title,{className:`text-title`,children:e(`loginFormTitle`)}),(0,G.jsx)(zw.Description,{className:`mt-1`,children:e(`loginDesc`)})]})]})}),(0,G.jsxs)(zw.Content,{className:`space-y-5 px-6 py-7 sm:px-8 sm:py-8`,children:[(0,G.jsxs)(hL,{name:`console-password`,className:`w-full`,isInvalid:!!m,children:[(0,G.jsx)(sR,{children:e(`loginPassword`)}),(0,G.jsxs)(fL,{children:[(0,G.jsx)(fL.Input,{id:`console-password`,type:u?`text`:`password`,value:c,onChange:e=>l(e.target.value),placeholder:e(`loginPasswordPh`),autoComplete:`current-password`,autoFocus:!0,"aria-label":e(`loginPassword`),spellCheck:!1}),(0,G.jsx)(fL.Suffix,{children:(0,G.jsx)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,type:`button`,"aria-label":e(u?`hidePassword`:`showPassword`),onPress:()=>d(e=>!e),children:u?(0,G.jsx)(Bi,{size:16}):(0,G.jsx)(Ri,{size:16})})})]})]}),m?(0,G.jsx)(bU,{title:m}):(0,G.jsx)(`p`,{className:`text-caption text-muted`,children:e(`loginHint`)}),(0,G.jsxs)(X,{type:`submit`,fullWidth:!0,size:`lg`,isPending:f,children:[e(f?`loggingInConsole`:`loginSubmit`),f?null:(0,G.jsx)(Xr,{size:17})]})]})]})})})]})]})}function p1(){return FH(`/api/keys`)}function m1(e){return FH(`/api/keys`,{method:`POST`,body:JSON.stringify(e)})}function h1(e,t){return FH(`/api/keys/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)})}function g1(e){return FH(`/api/keys/${encodeURIComponent(e)}`,{method:`DELETE`})}function _1(){return FH(`/api/system/console-key`)}function v1(){return FH(`/api/system/console-key`,{method:`POST`,body:JSON.stringify({rotate:!0})})}function y1({settings:e,onSaved:t}){let{t:n}=DH(),r=ot(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)({}),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``);(0,v.useEffect)(()=>{let e=!0;return tU().then(t=>{e&&a((t.data||[]).filter(e=>e.regions.some(e=>e.checkin)))}).catch(t=>{e&&d(String(t))}),()=>{e=!1}},[]);async function f(n,r){if(!(!e||r===e.checkin_times[n])){l(!0),d(``);try{t(await CU({checkin_times:{[n]:r}}))}catch(e){d(e instanceof Error?e.message:String(e))}finally{s(e=>{let t={...e};return delete t[n],t}),l(!1)}}}return(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(zw.Header,{children:[(0,G.jsx)(zw.Title,{children:n(`checkinDefaultsTitle`)}),(0,G.jsx)(zw.Description,{children:n(`checkinDefaultsHint`)})]}),(0,G.jsxs)(zw.Content,{className:`space-y-4`,children:[u?(0,G.jsx)(bU,{title:u}):null,!e||!i?(0,G.jsx)($,{className:`h-24 w-full`}):i.map(t=>(0,G.jsx)(E$,{label:t.label,hint:t.regions.filter(e=>e.checkin).map(t=>`${t.label} · ${t.checkin?.timezone===`Local`?e.timezone:t.checkin?.timezone}`).join(` / `),children:(0,G.jsx)(lL,{type:`time`,value:o[t.id]??e.checkin_times[t.id]??``,disabled:c,"aria-label":`${t.label} ${n(`autoCheckinTime`)}`,onChange:e=>s(n=>({...n,[t.id]:e.target.value})),onBlur:e=>void f(t.id,e.target.value)})},t.id))]}),(0,G.jsx)(zw.Footer,{children:(0,G.jsx)(X,{variant:`secondary`,onPress:()=>r(`/accounts`),children:n(`navAccounts`)})})]})}function b1(e,t){if(!e)return``;let n=new Date(e);return Number.isNaN(n.getTime())?``:n.toLocaleDateString(t===`zh`?`zh-CN`:`en-US`,{year:`numeric`,month:`short`,day:`numeric`})}function x1({releases:e,currentVersion:t,nextVersion:n,rollbackTags:r,canRollback:i,submitting:a,onRestore:o}){let{t:s,lang:c}=DH();if(!e.length)return null;let l=n&&n!==t?n:t,u=e.some(e=>e.tag_name===l)?l:e[0]?.tag_name,d=new Set(r);return(0,G.jsxs)(`div`,{className:`mt-5`,children:[(0,G.jsx)(`div`,{className:`mb-2`,children:(0,G.jsx)(`p`,{className:`text-caption font-medium text-foreground`,children:s(`versionHistory`)})}),(0,G.jsx)(Ih,{className:`rounded-lg bg-surface-secondary`,hideSeparator:!0,defaultExpandedKeys:u?[u]:[],children:e.map(e=>{let r=e.tag_name,l=r===t,u=!!(n&&r===n&&n!==t),f=i&&d.has(r)&&!l,p=b1(e.published_at,c);return(0,G.jsxs)(Ih.Item,{id:r,children:[(0,G.jsx)(Ih.Heading,{children:(0,G.jsxs)(Ih.Trigger,{className:`items-center gap-3 px-3 py-2.5 text-left`,children:[(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`mono text-body font-semibold`,children:r}),l?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`success`,children:s(`versionCurrentBadge`)}):null,u?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`warning`,children:s(`versionLatestBadge`)}):null,p?(0,G.jsx)(`span`,{className:`truncate text-caption text-muted`,children:p}):null]}),(0,G.jsx)(Ih.Indicator,{})]})}),(0,G.jsx)(Ih.Panel,{children:(0,G.jsxs)(Ih.Body,{className:`px-3 pb-3`,children:[(0,G.jsx)(`div`,{className:`release-notes-box release-notes-box--compact`,children:(0,G.jsx)(KU,{markdown:BU(e.body,c),emptyLabel:s(`updateNoNotes`)})}),f?(0,G.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,G.jsx)(X,{size:`sm`,variant:`ghost`,isDisabled:a,onPress:()=>o(r),children:s(`restoreThisVersion`)})}):null]})})]},r)})})]})}function S1(e){let t=new Set,n=[];for(let r of e){let e=r.tag_name?.trim();!e||t.has(e)||(t.add(e),n.push({...r,tag_name:e}))}return n}function C1(e,t,n,r,i){return r?.length?S1(r):S1([...n?[n]:t?[{tag_name:t}]:[],...e?[{tag_name:e}]:[],...i||[]])}var w1=[`general`,`routing`,`security`,`updates`];function T1(){let{t:e}=DH(),[t,n]=kn(),r=t.get(`tab`),i=r&&w1.includes(r)?r:`general`,a=e=>n(e===`general`?{}:{tab:e},{replace:!0}),{setApiKey:o}=jH(),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)(``),E=NU(),{info:D,loading:O,checking:k,submitting:A,error:j,setError:M,load:N,canRollback:P,rollbackTo:ee}=E,F=(0,v.useMemo)(()=>C1(D?.current_version||``,D?.next_version,D?.release,D?.recent_releases,D?.rollback_versions),[D?.current_version,D?.next_version,D?.release,D?.recent_releases,D?.rollback_versions]),I=(0,v.useMemo)(()=>(D?.rollback_versions||[]).map(e=>e.tag_name),[D?.rollback_versions]);(0,v.useEffect)(()=>{let e=window.setTimeout(()=>{_1().then(c).catch(()=>void 0),SU().then(e=>{u(e),f(e.proxy_url||``)}).catch(e=>M(e instanceof Error?e.message:String(e)))},0);return()=>window.clearTimeout(e)},[M]);async function L(e){let t=l?.cross_provider_model_pool??!0;u(t=>t&&{...t,cross_provider_model_pool:e}),m(!0),M(``);try{u(await CU({cross_provider_model_pool:e}))}catch(e){u(e=>e&&{...e,cross_provider_model_pool:t}),M(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function te(e){let t=l?.checkin_disabled_accounts??!1;u(t=>t&&{...t,checkin_disabled_accounts:e}),m(!0),M(``);try{u(await CU({checkin_disabled_accounts:e}))}catch(e){u(e=>e&&{...e,checkin_disabled_accounts:t}),M(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function R(e){let t=l?.proxy_url||``;if(e===t){f(t);return}let n=d;f(e),u(t=>t&&{...t,proxy_url:e}),m(!0),M(``);try{let t=await CU({proxy_url:e});u(t),f(t.proxy_url||``)}catch(e){f(n),u(e=>e&&{...e,proxy_url:t}),M(e instanceof Error?e.message:String(e))}finally{m(!1)}}async function z(e){let t=l?.routing_strategy||`round-robin`;u(t=>t&&{...t,routing_strategy:e}),m(!0),M(``);try{u(await CU({routing_strategy:e}))}catch(e){u(e=>e&&{...e,routing_strategy:t}),M(e instanceof Error?e.message:String(e))}finally{m(!1)}}return O&&!D?(0,G.jsx)(TY,{}):(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(`section`,{className:`flex flex-wrap items-end justify-between gap-4 pb-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{"data-gsap-reveal":!0,className:`text-title font-semibold`,children:e(`systemSettingsTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:e(`systemSettingsLead`)})]}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:k,onPress:()=>void N(!0),children:[(0,G.jsx)(Jr,{size:15}),e(`checkUpdates`)]})]}),j?(0,G.jsx)(bU,{title:j}):null,(0,G.jsxs)(LF,{selectedKey:i,onSelectionChange:e=>a(String(e)),children:[(0,G.jsx)(LF.ListContainer,{className:`w-fit max-w-full overflow-x-auto`,children:(0,G.jsxs)(LF.List,{"aria-label":e(`systemSettingsTitle`),children:[(0,G.jsxs)(IF,{id:`general`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{}),(0,G.jsx)(Ji,{size:13}),e(`settingsTabGeneral`)]}),(0,G.jsxs)(IF,{id:`routing`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{}),(0,G.jsx)(ii,{size:13}),e(`settingsTabRouting`)]}),(0,G.jsxs)(IF,{id:`security`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{}),(0,G.jsx)(Oa,{size:13}),e(`settingsTabSecurity`)]}),(0,G.jsxs)(IF,{id:`updates`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{}),(0,G.jsx)(Kr,{size:13}),e(`settingsTabUpdates`)]})]})}),(0,G.jsx)(LF.Panel,{id:`general`,className:`pt-5`,children:(0,G.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-2 items-start`,children:[(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(Pa,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`proxySettingsTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`proxySettingsHint`)})]})]}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-1.5`,children:[(0,G.jsx)(sR,{className:`text-body font-medium text-muted`,children:e(`proxyUrl`)}),(0,G.jsx)(lL,{value:d,onChange:e=>f(e.target.value),onBlur:e=>void R(e.target.value.trim()),placeholder:e(`proxyUrlPlaceholder`),disabled:p||!l}),(0,G.jsx)(lR,{className:`text-caption leading-5 text-muted`,children:e(`proxyUrlHint`)})]})]}),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(bi,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`checkinDisabledAccountsTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`checkinDisabledAccountsHint`)})]})]}),(0,G.jsx)(fQ,{isSelected:l?.checkin_disabled_accounts??!1,isDisabled:p||!l,ariaLabel:e(`checkinDisabledAccountsAriaLabel`),onChange:e=>void te(e)})]}),(0,G.jsxs)(`div`,{className:`mt-4 flex items-center justify-between pt-3 text-caption text-muted`,children:[(0,G.jsx)(`span`,{children:e(`checkinDisabledAccountsStatus`)}),(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:l?.checkin_disabled_accounts?e(`enabled`):e(`disabled`)})]})]}),(0,G.jsx)(y1,{settings:l,onSaved:u})]})}),(0,G.jsx)(LF.Panel,{id:`routing`,className:`pt-5`,children:(0,G.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-2 items-start`,children:[(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(Pa,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`routingStrategyTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`routingStrategyHint`)})]})]}),(0,G.jsx)(`div`,{className:`mt-4 pt-4`,children:(0,G.jsx)(E$,{label:e(`routingStrategy`),children:(0,G.jsxs)(SV,{fullWidth:!0,"aria-label":e(`routingStrategy`),value:l?.routing_strategy||`round-robin`,isDisabled:p||!l,onChange:e=>{typeof e==`string`&&e&&z(e)},children:[(0,G.jsxs)(SV.Trigger,{className:`items-center`,children:[(0,G.jsx)(SV.Value,{className:`min-w-0 truncate`}),(0,G.jsx)(SV.Indicator,{})]}),(0,G.jsx)(SV.Popover,{children:(0,G.jsxs)(GB,{children:[(0,G.jsxs)(GB.Item,{id:`round-robin`,textValue:`round-robin`,children:[(0,G.jsx)(sR,{children:e(`routingRoundRobin`)}),(0,G.jsx)(GB.ItemIndicator,{})]}),(0,G.jsxs)(GB.Item,{id:`weighted-round-robin`,textValue:`weighted-round-robin`,children:[(0,G.jsx)(sR,{children:e(`routingWeightedRoundRobin`)}),(0,G.jsx)(GB.ItemIndicator,{})]}),(0,G.jsxs)(GB.Item,{id:`fill-first`,textValue:`fill-first`,children:[(0,G.jsx)(sR,{children:e(`routingFillFirst`)}),(0,G.jsx)(GB.ItemIndicator,{})]}),(0,G.jsxs)(GB.Item,{id:`fefo`,textValue:`fefo`,children:[(0,G.jsx)(sR,{children:e(`routingFEFO`)}),(0,G.jsx)(GB.ItemIndicator,{})]})]})})]})})}),(0,G.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2 pt-3 text-caption text-muted sm:grid-cols-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`mono block text-body font-medium text-foreground`,children:l?.session_affinity?.ttl_seconds?`${Math.round(l.session_affinity.ttl_seconds/60)}m`:`—`}),e(`sessionAffinityTTL`)]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`mono block text-body font-medium text-foreground`,children:l?.session_affinity?.hits??0}),e(`sessionAffinityHits`)]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`mono block text-body font-medium text-foreground`,children:l?.session_affinity?.misses??0}),e(`sessionAffinityMisses`)]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`mono block text-body font-medium text-foreground`,children:l?.session_affinity?.escapes??0}),e(`sessionAffinityEscapes`)]})]}),l?.session_affinity?.last_escape_reason?(0,G.jsxs)(lR,{className:`mt-3 text-caption`,children:[e(`lastSessionEscape`),`: `,l.session_affinity.last_escape_reason]}):null,l?.session_affinity?.last_miss_reason?(0,G.jsxs)(lR,{className:`mt-1 text-caption`,children:[e(`lastSessionMiss`),`: `,l.session_affinity.last_miss_reason]}):null]}),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(Pa,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`crossProviderModelPoolTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`crossProviderModelPoolHint`)})]})]}),(0,G.jsx)(fQ,{isSelected:l?.cross_provider_model_pool??!0,isDisabled:p||!l,ariaLabel:e(`crossProviderModelPoolAriaLabel`),onChange:e=>void L(e)})]}),(0,G.jsxs)(`div`,{className:`mt-4 flex items-center justify-between pt-3 text-caption text-muted`,children:[(0,G.jsx)(`span`,{children:e(`crossProviderModelPoolStatus`)}),(0,G.jsx)(`span`,{className:`font-medium text-foreground`,children:l?.cross_provider_model_pool?e(`enabled`):e(`disabled`)})]})]})]})}),(0,G.jsx)(LF.Panel,{id:`security`,className:`pt-5`,children:(0,G.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-2 items-start`,children:[(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(na,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`consoleKeyTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`consoleKeyHint`)})]})]})}),(0,G.jsx)(`code`,{className:`mono mt-4 block rounded-lg bg-surface-secondary px-3 py-2 text-caption text-muted`,children:s?.prefix||`—`}),(0,G.jsx)(`p`,{className:`mt-3 text-caption leading-5 text-muted`,children:e(`consoleKeyLead`)}),(0,G.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,G.jsx)(X,{size:`sm`,variant:`ghost`,isPending:h,onPress:()=>y(!0),children:e(`consoleKeyRotate`)})})]}),(0,G.jsxs)(zw,{"data-gsap-reveal":!0,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-surface-secondary text-foreground`,children:(0,G.jsx)(Pi,{size:15})}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`sqliteProtection`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`sqliteProtectionHint`)})]})]}),(0,G.jsx)(Oa,{size:18,className:`text-success`})]}),(0,G.jsx)(`div`,{className:`mono mt-4 rounded-lg bg-surface-secondary px-3 py-2 text-caption text-muted`,children:`/data`}),(0,G.jsxs)(`div`,{className:`mt-3 grid gap-2 text-caption text-muted`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(bi,{size:14,className:`text-muted`}),e(`sqliteBackupBeforeUpdate`)]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(bi,{size:14,className:`text-muted`}),e(`sqliteKeepFive`)]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(bi,{size:14,className:`text-muted`}),e(`sqliteRollbackTogether`)]})]})]})]})}),(0,G.jsx)(LF.Panel,{id:`updates`,className:`pt-5`,children:(0,G.jsx)(`div`,{className:`grid gap-5`,children:(0,G.jsxs)(zw,{"data-gsap-reveal":!0,className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-5 py-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold`,children:e(`versionUpdate`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-caption text-muted`,children:e(`latestVersionHint`)})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:D?.has_update?`warning`:`success`,children:D?.has_update?e(`updateAvailable`):e(`upToDate`)})]}),(0,G.jsxs)(`div`,{className:`px-5 py-5`,children:[(0,G.jsx)(yU,{update:E}),(0,G.jsx)(x1,{releases:F,currentVersion:D?.current_version||``,nextVersion:D?.next_version,rollbackTags:I,canRollback:P,submitting:A,onRestore:T})]})]})})})]}),(0,G.jsx)(K$,{isOpen:!!w,title:e(`restoreVersionTitle`,{version:w}),description:e(`restoreVersionHint`),confirmLabel:e(`restoreThisVersion`),cancelLabel:e(`cancel`),closeLabel:e(`close`),isPending:A,status:`warning`,confirmVariant:`primary`,onClose:()=>{A||T(``)},onConfirm:()=>{let e=w;T(``),ee(e)}}),(0,G.jsx)(Z.Root,{isOpen:_,onOpenChange:e=>{!e&&!h&&y(!1)},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,isDismissable:!h,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`sm`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:e(`consoleKeyRotate`)}),(0,G.jsx)(`p`,{className:`mt-1 text-caption leading-5 text-muted`,children:e(`consoleKeyRotateHint`)})]}),(0,G.jsx)(Z.CloseTrigger,{isDisabled:h,"aria-label":e(`close`),className:`grid size-8 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Footer,{className:`justify-end`,children:[(0,G.jsx)(X,{variant:`ghost`,isDisabled:h,onPress:()=>y(!1),children:e(`cancel`)}),(0,G.jsx)(X,{variant:`danger`,isPending:h,onPress:()=>{g(!0),v1().then(e=>{c(e),x(e.secret||``),e.secret&&o(e.secret),y(!1)}).catch(e=>{M(e instanceof Error?e.message:String(e))}).finally(()=>g(!1))},children:e(`consoleKeyRotateNow`)})]})]})})})}),(0,G.jsx)(Z.Root,{isOpen:!!b,onOpenChange:e=>{e||x(``)},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`lg`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-6 pt-6`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:e(`consoleKeySecretTitle`)}),(0,G.jsx)(`p`,{className:`mt-1.5 text-body leading-6 text-muted`,children:e(`consoleKeySecretHint`)})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":e(`close`),className:`grid size-9 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:18})})]}),(0,G.jsx)(Z.Body,{className:`px-6 pb-2`,children:(0,G.jsx)(`code`,{className:`mono block break-all rounded-lg bg-surface-secondary px-3 py-3 text-body`,children:b})}),(0,G.jsxs)(Z.Footer,{className:`justify-end`,children:[(0,G.jsx)(X,{variant:`ghost`,onPress:()=>x(``),children:e(`close`)}),(0,G.jsxs)(X,{onPress:()=>{NQ(b),C(!0),window.setTimeout(()=>C(!1),1200)},children:[(0,G.jsx)(Oi,{size:14}),e(S?`copied`:`copy`)]})]})]})})})})]})}var E1=`__all__`;function D1(e,t){let n=t.trim().toLowerCase();return!n||e.label.toLowerCase().includes(n)||e.id.toLowerCase().includes(n)}function O1({value:e,onChange:t,ariaLabel:n,options:r,allLabel:i,searchPlaceholder:a,emptyLabel:o,loadOptions:s,className:c}){let[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)([]),[p,m]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(!s)return;let e=!1,t=window.setTimeout(()=>{m(!0),s(l.trim()).then(t=>{e||f(t)}).catch(()=>{e||f([])}).finally(()=>{e||m(!1)})},l.trim()?280:0);return()=>{e=!0,window.clearTimeout(t)}},[s,l]);let h=e||E1,g=(0,v.useMemo)(()=>{let t=s?d:r.filter(e=>D1(e,l)),n=new Map;l.trim()||n.set(E1,{id:E1,label:i});for(let e of t)!e.id||e.id===E1||n.set(e.id,e);if(e){let t=r.find(t=>t.id===e)||d.find(t=>t.id===e)||{id:e,label:e};n.set(e,t)}return[...n.values()]},[i,s,r,l,d,e]),_=g.find(e=>e.id===h)||(e?{id:e,label:e}:{id:E1,label:i});return(0,G.jsxs)(Sw,{className:[`w-fit`,c].filter(Boolean).join(` `),"aria-label":n,value:h,onChange:e=>{typeof e==`string`&&(t(e===E1?``:e),u(``))},onClear:()=>{t(``),u(``)},children:[(0,G.jsxs)(Sw.Trigger,{className:`min-w-44 items-center`,children:[(0,G.jsx)(Sw.Value,{className:`min-w-0 truncate`,children:({defaultChildren:e,isPlaceholder:t})=>t?e:(0,G.jsx)(`span`,{className:`truncate`,children:_.label})}),e?(0,G.jsx)(Sw.ClearButton,{}):null,(0,G.jsx)(Sw.Indicator,{})]}),(0,G.jsx)(Sw.Popover,{className:`min-w-56`,children:(0,G.jsxs)(Sw.Filter,{inputValue:l,onInputChange:u,filter:()=>!0,children:[(0,G.jsx)(aR,{"aria-label":a,className:`px-2 pt-2`,autoFocus:!0,children:(0,G.jsxs)(aR.Group,{children:[(0,G.jsx)(aR.SearchIcon,{}),(0,G.jsx)(aR.Input,{placeholder:a}),(0,G.jsx)(aR.ClearButton,{})]})}),(0,G.jsx)(GB,{children:g.length===0?(0,G.jsx)(GB.Item,{id:`__empty__`,textValue:o,isDisabled:!0,children:(0,G.jsx)(sR,{className:`block truncate text-muted`,children:p?a:o})}):g.map(e=>(0,G.jsxs)(GB.Item,{id:e.id,textValue:e.label,children:[(0,G.jsx)(sR,{className:`block truncate`,children:e.label}),e.id!==E1&&e.id!==e.label?(0,G.jsx)(`span`,{className:`mono mt-0.5 block truncate text-caption text-muted`,children:e.id}):null,(0,G.jsx)(GB.ItemIndicator,{})]},e.id))})]})})]})}function k1(e){return e===`ok`?`success`:e===`streaming`||e===`started`||e===`incomplete`?`warning`:e===`error`||e===`canceled`?`danger`:`default`}function A1(e){if(e===`error`)return`danger`;if(e!==`warn`)return`ok`}function j1(e){return e===`error`?`danger`:e===`warn`?`warning`:e===`info`?`success`:`default`}function M1(e,t=`zh`){if(!e)return`—`;let n=new Date(e);return Number.isFinite(n.getTime())?new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}).format(n):e}function N1(e){let t=e.requested_reasoning?.trim()||``,n=e.resolved_reasoning?.trim()||``;return!t&&!n?``:t&&n&&t!==n?`${t} → ${n}`:n||t}function P1({log:e,inLabel:t,outLabel:n,pointsLabel:r}){let i=e.prompt_tokens,a=e.completion_tokens,o=e.credits??e.usage_detail?.credit,s=o!=null&&Number.isFinite(o)?L1(o):null;return i==null&&a==null&&s==null?(0,G.jsx)(`span`,{className:`mono text-xs text-muted`,children:`—`}):(0,G.jsxs)(`div`,{className:`leading-4`,children:[i!=null||a!=null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`mono text-xs`,children:[i??0,` / `,a??0]}),(0,G.jsxs)(`div`,{className:`mt-0.5 text-caption text-muted`,children:[t,` / `,n]})]}):null,s==null?null:(0,G.jsx)(`div`,{className:`mono text-caption text-success ${i!=null||a!=null?`mt-0.5`:``}`,children:r?r(s):s})]})}function F1(){return(0,G.jsxs)(`div`,{className:`space-y-5`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,G.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:Array.from({length:8},(e,t)=>(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)($,{className:`h-3 w-20`}),(0,G.jsx)($,{className:`h-5 w-36 max-w-full`})]},t))}),(0,G.jsxs)(`div`,{className:`space-y-3 rounded-lg bg-surface-secondary px-3 py-3`,children:[(0,G.jsx)($,{className:`h-3 w-24`}),(0,G.jsx)($,{className:`h-4 w-full`}),(0,G.jsx)($,{className:`h-4 w-4/5`})]}),(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)($,{className:`h-3 w-20`}),(0,G.jsx)($,{className:`h-16 w-full`})]})]})}function I1(e){return e==null?`—`:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function L1(e){return e==null||!Number.isFinite(e)?`—`:String(Math.round(e*1e4)/1e4)}var R1=[`all`,`ok`,`incomplete`,`error`,`canceled`],z1=[`all`,`quota`,`rate_limit`,`auth`,`not_ready`,`unavailable`,`invalid_request`,`model_not_available`],B1=[`all`,`1h`,`24h`,`7d`,`custom`];function V1(e){let t=(e,t,n)=>t.includes(e??``)?e:n,n=dZ(e.get(`from`)),r=dZ(e.get(`to`)),i=n&&r?{start:n,end:r}:null,a=e.get(`stream`);return{requestFilter:t(e.get(`status`),R1,`all`),requestId:e.get(`id`)??``,accountFilter:e.get(`account`)??``,modelFilter:e.get(`model`)??``,providerFilter:e.get(`provider`)??``,streamFilter:a===`stream`||a===`true`?`stream`:a===`sync`||a===`false`?`sync`:`all`,errorKind:t(e.get(`error_kind`),z1,`all`),timeRange:i?`custom`:t(e.get(`range`),B1,`1h`),customRange:i}}function H1(e){let t=new URLSearchParams;e.requestFilter!==`all`&&t.set(`status`,e.requestFilter),e.requestId&&t.set(`id`,e.requestId),e.accountFilter&&t.set(`account`,e.accountFilter),e.modelFilter&&t.set(`model`,e.modelFilter),e.providerFilter&&t.set(`provider`,e.providerFilter),e.streamFilter!==`all`&&t.set(`stream`,e.streamFilter),e.errorKind!==`all`&&t.set(`error_kind`,e.errorKind);let n=e.timeRange===`custom`?uZ(e.customRange?.start):void 0,r=e.timeRange===`custom`?uZ(e.customRange?.end,!0):void 0;return n&&r?(t.set(`from`,n),t.set(`to`,r)):e.timeRange!==`1h`&&t.set(`range`,e.timeRange),t.toString()}function U1(e){if(e===`all`||e===`custom`)return{from:void 0,to:void 0};let t=new Date,n=new Date(t);return e===`1h`&&n.setHours(n.getHours()-1),e===`24h`&&n.setHours(n.getHours()-24),e===`7d`&&n.setDate(n.getDate()-7),{from:n.toISOString(),to:t.toISOString()}}function W1(){let{t:e,lang:t}=DH(),[n,r]=kn(),[i]=(0,v.useState)(()=>V1(new URLSearchParams(window.location.search))),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(`requests`),[d,f]=(0,v.useState)(!0),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(i.requestFilter),[b,x]=(0,v.useState)(`all`),[S,C]=(0,v.useState)(i.requestId),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(i.accountFilter),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(i.modelFilter),[M,N]=(0,v.useState)(i.providerFilter),[P,ee]=(0,v.useState)(i.streamFilter),[F,I]=(0,v.useState)(i.errorKind),[L,te]=(0,v.useState)(i.timeRange),[R,z]=(0,v.useState)(i.customRange),[B,ne]=(0,v.useState)(1),[re,ie]=(0,v.useState)(50),[V,ae]=(0,v.useState)(1),[oe,se]=(0,v.useState)(50),[ce,le]=(0,v.useState)([]),[ue,de]=(0,v.useState)(0),[fe,pe]=(0,v.useState)([]),[me,he]=(0,v.useState)(0),[ge,_e]=(0,v.useState)(null),[ve,ye]=(0,v.useState)(!1),[be,xe]=(0,v.useState)(null),[Se,Ce]=(0,v.useState)(!1),[we,Te]=(0,v.useState)(!1),[Ee,De]=(0,v.useState)(``),Oe=(0,v.useRef)(0),[ke,Ae]=(0,v.useState)(!1),[je,Me]=(0,v.useState)(!1),Ne=n.toString(),Pe=H1({requestFilter:_,requestId:S,accountFilter:E,modelFilter:A,providerFilter:M,streamFilter:P,errorKind:F,timeRange:L,customRange:R}),Fe=(0,v.useRef)(Ne);(0,v.useEffect)(()=>{if(Ne===Fe.current)return;Fe.current=Ne;let e=V1(new URLSearchParams(Ne));y(e.requestFilter),C(e.requestId),D(e.accountFilter),j(e.modelFilter),N(e.providerFilter),ee(e.streamFilter),I(e.errorKind),te(e.timeRange),z(e.customRange)},[Ne]),(0,v.useEffect)(()=>{Pe!==Fe.current&&(Fe.current=Pe,r(Pe,{replace:!0}))},[Pe,r]),(0,v.useEffect)(()=>{let e=!1;return Promise.allSettled([LH(!1),GH()]).then(([t,n])=>{e||(t.status===`fulfilled`&&o(t.value.data||[]),n.status===`fulfilled`&&c(n.value.data||[]))}),()=>{e=!0}},[]);let Ie=(0,v.useMemo)(()=>{let e=new Map;for(let t of a||[])e.set(t.id,t.name||t.id);return e},[a]),Le=(0,v.useMemo)(()=>{let e=new Map;for(let t of a||[])e.set(t.id,{provider:t.provider,region:t.region});return e},[a]);function Re(t){let n=t.account_id?Le.get(t.account_id):void 0,r=t.provider||n?.provider;return r?EZ(r,n?.region,e):`—`}function ze(t){switch(t){case`pin`:return e(`logsRouting_pin`);case`sticky`:return e(`logsRouting_sticky`);case`sticky_escape`:return e(`logsRouting_sticky_escape`);default:return e(`logsRouting_pool`)}}let Be=(0,v.useMemo)(()=>(a||[]).map(e=>({id:e.id,label:e.name||e.id})),[a]),Ve=(0,v.useMemo)(()=>{let t=new Set;for(let e of a||[])e.provider&&t.add(e.provider);return M&&t.add(M),[{id:``,label:e(`logsFilterProviderAll`)},...[...t].sort().map(t=>({id:t,label:TZ(t,e)}))]},[a,M,e]),He=(0,v.useMemo)(()=>{let e=new Map;for(let t of s||[])e.has(t.id)||e.set(t.id,{id:t.id,label:t.display_name||t.id});return[...e.values()]},[s]),Ue=(0,v.useCallback)(async e=>((await rX({q:e||void 0,limit:20,offset:0})).items||[]).map(e=>({id:e.id,label:e.id})),[]),We=!!(S||_!==`all`||E||A||M||P!==`all`||F!==`all`||L!==`1h`),Ge=[_,S,E,A,M,P,F,L,R?.start?.toString()??``,R?.end?.toString()??``,re].join(`\0`),Ke=[b,w,O,oe].join(`\0`),[qe,Je]=(0,v.useState)(Ge),[Ye,Xe]=(0,v.useState)(Ke);qe!==Ge&&(Je(Ge),ne(1)),Ye!==Ke&&(Xe(Ke),ae(1));let Ze=Math.max(1,Math.ceil(ue/re)),Qe=Math.min(qe===Ge?Math.max(1,B):1,Ze);B!==Qe&&ne(Qe);let $e=Math.max(1,Math.ceil(me/oe)),et=Math.min(Ye===Ke?Math.max(1,V):1,$e);V!==et&&ae(et);let tt=(0,v.useCallback)(async(e=!1)=>{e||f(!0);try{let e=S?{from:void 0,to:void 0}:L===`custom`?{from:uZ(R?.start),to:uZ(R?.end,!0)}:U1(L),t=await rX({status:_===`all`?void 0:_,id:S||void 0,account:E||void 0,model:A||void 0,provider:M||void 0,stream:P===`all`?void 0:P===`stream`,error_kind:F===`all`?void 0:F,from:e.from,to:e.to,limit:re,offset:(Qe-1)*re});le(t.items||[]),de(t.total||0),g(``)}catch(t){e||g(t instanceof Error?t.message:String(t))}finally{e||(f(!1),m(!0))}},[_,S,E,A,M,P,F,L,R,Qe,re]),nt=(0,v.useCallback)(async(e=!1)=>{e||f(!0);try{let e=await oX({level:b===`all`?void 0:b,q:w.trim()||void 0,account:O||void 0,limit:oe,offset:(et-1)*oe});pe(e.items||[]),he(e.total??0),g(``)}catch(t){e||g(t instanceof Error?t.message:String(t))}finally{e||(f(!1),m(!0))}},[b,w,O,et,oe]),rt=(0,v.useCallback)(async(e=!1)=>{l===`requests`?await tt(e):await nt(e)},[l,tt,nt]);(0,v.useEffect)(()=>{f(!0);let e=l===`runtime`&&w.trim()?280:0,t=window.setTimeout(()=>void rt(!1),e);return()=>window.clearTimeout(t)},[rt,l,w]),(0,v.useEffect)(()=>{if(l!==`runtime`||et!==1)return;let e=window.setInterval(()=>void nt(!0),3e3);return()=>window.clearInterval(e)},[l,et,nt]);let it=ue===0?0:(Qe-1)*re+1,at=Math.min(ue,Qe*re),ot=me===0?0:(et-1)*oe+1,st=Math.min(me,et*oe),ct=(0,v.useMemo)(()=>l===`requests`?e(`logsShownTotal`,{shown:ce.length?`${it}–${at}`:0,total:ue}):e(`logsShownTotal`,{shown:fe.length?`${ot}–${st}`:0,total:me}),[l,ce.length,fe.length,it,at,ue,ot,st,me,e]);function lt(){C(``),y(`all`),D(``),j(``),N(``),ee(`all`),I(`all`),te(`1h`),z(null),ne(1)}async function ut(e){let t=++Oe.current;xe(e),De(``),Te(!0),Ce(!0);try{let n=await iX(e.id);if(Oe.current!==t)return;xe(n)}catch(e){if(Oe.current!==t)return;De(e instanceof Error?e.message:String(e))}finally{Oe.current===t&&Te(!1)}}function dt(e){_e(e),ye(!0)}async function ft(){Me(!0),JY({id:`logs-clear`,type:`loading`,title:e(`toastClearingLogs`)});try{await aX(),Ae(!1),await tt(!1),JY({id:`logs-clear`,type:`success`,title:e(`toastLogsCleared`)})}catch(t){g(t instanceof Error?t.message:String(t)),JY({id:`logs-clear`,type:`error`,title:e(`toastFailed`),description:t instanceof Error?t.message:String(t)})}finally{Me(!1)}}let pt=d&&(l===`requests`?ce.length===0:fe.length===0);return d&&!p?(0,G.jsx)(CY,{}):(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(`section`,{className:`flex flex-wrap items-end justify-between gap-4 pb-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-title font-semibold`,children:e(`navLogs`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:e(`logsLead`)})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l===`requests`?(0,G.jsxs)(X,{size:`sm`,variant:`ghost`,onPress:()=>Ae(!0),isDisabled:je||ue===0,children:[(0,G.jsx)(Ja,{size:14}),e(`logsClear`)]}):null,(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,isPending:d,onPress:()=>void rt(!1),children:[(0,G.jsx)(Jr,{size:15}),e(`refresh`)]})]})]}),h?(0,G.jsx)(bU,{title:e(`failedLogs`,{msg:h})}):null,(0,G.jsxs)(LF,{selectedKey:l,onSelectionChange:e=>u(String(e)),children:[(0,G.jsx)(LF.ListContainer,{className:`w-fit`,children:(0,G.jsxs)(LF.List,{children:[(0,G.jsxs)(IF,{id:`requests`,className:`gap-1.5`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),(0,G.jsx)(Ea,{size:13}),e(`logsRequests`)]}),(0,G.jsxs)(IF,{id:`runtime`,className:`gap-1.5`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),(0,G.jsx)(Ka,{size:13}),e(`logsRuntime`)]})]})}),(0,G.jsxs)(LF.Panel,{id:`requests`,"data-tab-panel":`requests`,className:`space-y-4 pt-5`,children:[(0,G.jsxs)(`div`,{className:`data-toolbar flex flex-col gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(qX,{value:_,onChange:e=>y(e),ariaLabel:e(`logsFilterAll`),options:[{id:`all`,label:e(`logsFilterAll`)},{id:`ok`,label:e(`logsFilterOk`)},{id:`incomplete`,label:e(`logsFilterIncomplete`)},{id:`error`,label:e(`logsFilterError`)},{id:`canceled`,label:e(`logsFilterCanceled`)}]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[We?(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:lt,children:e(`clearFilters`)}):null,(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:ct})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(O1,{ariaLabel:e(`logsColAccount`),value:E,onChange:D,options:Be,allLabel:e(`logsFilterAccountAll`),searchPlaceholder:e(`logsSearchAccount`),emptyLabel:e(`logsNoFilterOptions`)}),(0,G.jsx)(O1,{ariaLabel:e(`logsColModel`),value:A,onChange:j,options:He,allLabel:e(`logsFilterModelAll`),searchPlaceholder:e(`logsSearchModel`),emptyLabel:e(`logsNoFilterOptions`)}),(0,G.jsx)(hQ,{ariaLabel:e(`logsColProvider`),value:M,onChange:N,options:Ve}),(0,G.jsx)(O1,{ariaLabel:e(`logsSearchRequestId`),value:S,onChange:C,options:S?[{id:S,label:S}]:[],allLabel:e(`logsFilterIdAll`),searchPlaceholder:e(`logsSearchRequestId`),emptyLabel:e(`logsNoFilterOptions`),loadOptions:Ue,className:`min-w-56`}),(0,G.jsx)(qX,{value:P,onChange:e=>ee(e),ariaLabel:e(`logsFilterStreamAll`),options:[{id:`all`,label:e(`logsFilterStreamAll`)},{id:`stream`,label:e(`logsStreamYes`)},{id:`sync`,label:e(`logsStreamNo`)}]}),(0,G.jsx)(hQ,{ariaLabel:e(`errorKind`),value:F===`all`?``:F,onChange:e=>I(e||`all`),options:[{id:``,label:e(`logsFilterKindAll`)},{id:`quota`,label:e(`logsKindQuota`)},{id:`rate_limit`,label:e(`logsKindRateLimit`)},{id:`auth`,label:e(`logsKindAuth`)},{id:`not_ready`,label:e(`logsKindNotReady`)},{id:`unavailable`,label:e(`logsKindUnavailable`)},{id:`invalid_request`,label:e(`logsKindInvalidRequest`)},{id:`model_not_available`,label:e(`logsKindModelNotAvailable`)}]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:e(`logsTimeRange`)}),(0,G.jsx)(qX,{value:L,onChange:e=>te(e),ariaLabel:e(`logsTimeRange`),options:[{id:`all`,label:e(`logsTimeAll`)},{id:`1h`,label:e(`logsTime1h`)},{id:`24h`,label:e(`logsTime24h`)},{id:`7d`,label:e(`logsTime7d`)},{id:`custom`,label:e(`logsTimeCustom`)}]}),L===`custom`?(0,G.jsx)(fZ,{className:`w-[min(100%,42rem)]`,value:R,onChange:z,ariaLabel:e(`logsTimeRange`),fromLabel:e(`logsTimeFrom`),toLabel:e(`logsTimeTo`)}):null]})]}),(0,G.jsx)(zw,{className:`overflow-hidden p-0`,"aria-busy":d,children:pt?(0,G.jsx)(xY,{}):ce.length===0?(0,G.jsx)(pQ,{icon:(0,G.jsx)(ua,{size:22}),title:e(We?`logsNoMatch`:`logsEmptyRequests`),action:We?(0,G.jsx)(X,{size:`sm`,variant:`ghost`,onPress:lt,children:e(`clearFilters`)}):null}):(0,G.jsx)(Q,{children:(0,G.jsx)(Q.ScrollContainer,{children:(0,G.jsxs)(Q.Content,{"aria-label":e(`logsRequests`),children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:e(`logsColTime`)}),(0,G.jsx)(Q.Column,{children:e(`logsColModel`)}),(0,G.jsx)(Q.Column,{children:e(`logsColReasoning`)}),(0,G.jsx)(Q.Column,{children:e(`logsColProvider`)}),(0,G.jsx)(Q.Column,{children:e(`logsColAccount`)}),(0,G.jsx)(Q.Column,{children:e(`logsColStatus`)}),(0,G.jsx)(Q.Column,{children:e(`logsColStream`)}),(0,G.jsx)(Q.Column,{children:e(`logsColLatency`)}),(0,G.jsx)(Q.Column,{children:e(`logsColTTFT`)}),(0,G.jsx)(Q.Column,{children:e(`logsColTokens`)})]}),(0,G.jsx)(Q.Body,{children:ce.map(n=>(0,G.jsxs)(Q.Row,{className:`cursor-pointer`,onAction:()=>void ut(n),children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`div`,{className:`py-1`,children:[(0,G.jsx)(`div`,{className:`mono text-xs`,children:M1(n.created_at,t)}),(0,G.jsx)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:n.id})]})}),(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`div`,{className:`text-body font-medium`,children:n.requested_model||`—`}),n.mapped_model&&n.mapped_model!==n.requested_model?(0,G.jsx)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:n.mapped_model}):null]}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:N1(n)||`—`})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-xs`,children:Re(n)})}),(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`span`,{className:`text-xs`,children:n.account_id?Ie.get(n.account_id)||n.account_id:`—`}),n.account_id&&Ie.get(n.account_id)&&Ie.get(n.account_id)!==n.account_id?(0,G.jsx)(`div`,{className:`mono mt-0.5 text-caption text-muted`,children:n.account_id}):null]}),(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:k1(n.status),children:n.status}),n.error_kind?(0,G.jsx)(`div`,{className:`mono mt-1 text-caption text-muted`,children:n.error_kind}):null]}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-xs text-muted`,children:n.stream?e(`logsStreamYes`):e(`logsStreamNo`)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:I1(n.latency_ms)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:I1(n.ttfb_ms)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(P1,{log:n,inLabel:e(`logsTokensIn`),outLabel:e(`logsTokensOut`),pointsLabel:t=>e(`logsTokensPoints`,{value:t})})})]},n.id))})]})})})}),(0,G.jsx)(yQ,{total:ue,page:Qe,pageCount:Ze,pageSize:re,loading:d,pageSizeLabel:e(`logsPageSize`),pageLabel:e(`logsPage`,{page:Qe,pages:Ze}),prevLabel:e(`logsPrevPage`),nextLabel:e(`logsNextPage`),onPage:ne,onPageSize:ie})]}),(0,G.jsxs)(LF.Panel,{id:`runtime`,"data-tab-panel":`runtime`,className:`space-y-4 pt-5`,children:[(0,G.jsxs)(`div`,{className:`data-toolbar flex flex-wrap items-center justify-between gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(bQ,{className:`sm:w-72`,value:w,onChange:T,placeholder:e(`logsSearchRuntime`),ariaLabel:e(`logsSearchRuntime`)}),(0,G.jsx)(O1,{ariaLabel:e(`logsColAccount`),value:O,onChange:k,options:Be,allLabel:e(`logsFilterAccountAll`),searchPlaceholder:e(`logsSearchAccount`),emptyLabel:e(`logsNoFilterOptions`)}),(0,G.jsx)(qX,{value:b,onChange:e=>x(e),ariaLabel:e(`logsLevelAll`),options:[{id:`all`,label:e(`logsLevelAll`)},{id:`info`,label:e(`logsLevelInfo`)},{id:`warn`,label:e(`logsLevelWarn`)},{id:`error`,label:e(`logsLevelError`)}]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:[et===1?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":`ok`}),e(`logsAutoRefresh`)]}):null,(0,G.jsx)(`span`,{className:`mono`,children:ct})]})]}),(0,G.jsx)(zw,{className:`overflow-hidden p-0`,"aria-busy":d,children:pt?(0,G.jsx)(SY,{}):fe.length===0?(0,G.jsx)(pQ,{icon:(0,G.jsx)(Ka,{size:22}),title:e(`logsEmptyRuntime`)}):(0,G.jsx)(`div`,{className:`divide-y divide-separator`,children:fe.map(e=>(0,G.jsxs)(`div`,{className:`grid cursor-pointer gap-2 px-5 py-3 transition-colors hover:bg-surface-secondary/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:grid-cols-[150px_72px_minmax(0,1fr)] sm:items-start`,role:`button`,tabIndex:0,onClick:()=>dt(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),dt(e))},children:[(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:M1(e.time,t)}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`status-dot`,"data-state":A1(e.level)}),(0,G.jsx)(`span`,{className:`font-medium text-muted`,children:e.level})]}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[e.account_id?(0,G.jsx)(`div`,{className:`mono mb-1 text-caption text-muted`,children:e.account_id}):null,(0,G.jsx)(`div`,{className:`mono break-all text-xs leading-5 text-foreground`,children:e.message})]})]},e.id))})}),(0,G.jsx)(yQ,{total:me,page:et,pageCount:$e,pageSize:oe,loading:d,pageSizeLabel:e(`logsPageSize`),pageLabel:e(`logsPage`,{page:et,pages:$e}),prevLabel:e(`logsPrevPage`),nextLabel:e(`logsNextPage`),onPage:ae,onPageSize:se})]})]}),(0,G.jsx)(Z.Root,{isOpen:ve,onOpenChange:e=>{ye(e),e||_e(null)},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{size:`lg`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{className:`w-full max-w-4xl`,children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:e(`logsRuntimeDetailTitle`)}),(0,G.jsx)(`p`,{className:`mono mt-1 text-caption text-muted`,children:ge?`#${ge.id}`:`—`})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":e(`close`),className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsxs)(Z.Body,{className:`space-y-5 px-5 pb-5`,children:[(0,G.jsx)(`dl`,{className:`grid gap-3 sm:grid-cols-2`,children:[[e(`logsColTime`),ge?M1(ge.time,t):`—`],[e(`logsRuntimeLevel`),ge?.level||`—`],[e(`logsRuntimeSource`),ge?.source||`—`],[e(`logsColAccount`),ge?.account_id||`—`]].map(([t,n])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:t}),(0,G.jsx)(`dd`,{className:`mt-1 break-all text-body font-medium`,children:t===e(`logsRuntimeLevel`)&&ge?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:j1(ge.level),children:ge.level}):n})]},String(t)))}),(0,G.jsxs)(`section`,{className:`space-y-2`,children:[(0,G.jsx)(`div`,{className:`text-xs font-medium text-muted`,children:e(`logsRuntimeMessage`)}),(0,G.jsx)(`pre`,{className:`mono max-h-[min(38rem,60vh)] overflow-auto whitespace-pre-wrap break-words rounded-lg bg-surface-secondary px-4 py-3 text-xs leading-6 text-foreground`,children:ge?.message||`—`})]})]})]})})})}),(0,G.jsx)(Z.Root,{isOpen:Se,onOpenChange:e=>{Ce(e),e||(Oe.current+=1,Te(!1),De(``),xe(null))},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{size:`lg`,scroll:`inside`,children:(0,G.jsxs)(Z.Dialog,{className:`w-full max-w-4xl`,children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-5 pt-5`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:e(`logsDetailTitle`)}),(0,G.jsx)(`p`,{className:`mono mt-1 text-caption text-muted`,children:be?.id})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":e(`close`),className:`grid size-8 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-surface-secondary hover:text-foreground`,children:(0,G.jsx)(oo,{size:16})})]}),(0,G.jsx)(Z.Body,{className:`space-y-4 px-5 pb-5`,children:we?(0,G.jsx)(F1,{}):Ee?(0,G.jsx)(bU,{title:e(`requestFailed`),description:Ee}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`dl`,{className:`grid gap-3 sm:grid-cols-2`,children:[[[e(`logsColStatus`),be?.status||`—`],[e(`logsColModel`),be?.requested_model||`—`],[e(`logsColReasoning`),be&&N1(be)||`—`],[e(`logsColProvider`),be?Re(be):`—`],[e(`logsColAccount`),be?.account_id?Ie.get(be.account_id)||be.account_id:`—`],[e(`logsColLatency`),I1(be?.latency_ms)],[e(`logsColTTFT`),I1(be?.ttfb_ms)],[e(`logsColStream`),be?.stream?e(`logsStreamYes`):e(`logsStreamNo`)],[e(`logsRouting`),be?ze(be.routing):`—`]].map(([e,t])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e}),(0,G.jsx)(`dd`,{className:`mt-1 break-all text-body font-medium`,children:t})]},String(e))),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e(`logsColTokens`)}),(0,G.jsx)(`dd`,{className:`mt-1`,children:be?(0,G.jsx)(P1,{log:be,inLabel:e(`logsTokensIn`),outLabel:e(`logsTokensOut`),pointsLabel:t=>e(`logsTokensPoints`,{value:t})}):`—`})]})]}),be&&be.message_count?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-3 py-3 text-xs`,children:[(0,G.jsx)(`div`,{className:`font-medium text-muted`,children:e(`logsMessageShape`)}),(0,G.jsxs)(`dl`,{className:`mt-2 grid gap-2 sm:grid-cols-2`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e(`logsMessageCount`)}),(0,G.jsx)(`dd`,{className:`mono mt-0.5`,children:be.message_count})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e(`logsEmptyMessageIndexes`)}),(0,G.jsx)(`dd`,{className:`mono mt-0.5 break-all`,children:be.empty_message_indexes?.length?be.empty_message_indexes.join(`, `):`—`})]}),(0,G.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e(`logsMessageRoles`)}),(0,G.jsx)(`dd`,{className:`mono mt-0.5 break-all`,children:be.message_roles?.join(` → `)||`—`})]})]})]}):null,be?.error_message?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-3 py-2 text-xs leading-5 text-muted`,children:[be.error_kind?(0,G.jsx)(`span`,{className:`mono mr-2 text-muted`,children:be.error_kind}):null,be.error_message]}):null,be?.stream_diagnostic?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-3 py-3 text-xs`,children:[(0,G.jsx)(`div`,{className:`font-medium text-muted`,children:e(`logsStreamDiagnostics`)}),(0,G.jsx)(`dl`,{className:`mt-2 grid gap-2 sm:grid-cols-2`,children:[[e(`logsCancellationSource`),be.stream_diagnostic.cancellation_source||`—`],[e(`logsUpstreamStatus`),be.stream_diagnostic.upstream_status??`—`],[e(`logsSSEEvents`),be.stream_diagnostic.sse_event_count],[e(`logsBytesRead`),be.stream_diagnostic.bytes_read],[e(`logsLastEvent`),be.stream_diagnostic.last_event||`—`],[e(`logsStreamComplete`),be.stream_diagnostic.saw_done?`yes`:`no`]].map(([e,t])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e}),(0,G.jsx)(`dd`,{className:`mono mt-0.5 break-all`,children:t})]},String(e)))}),be.stream_diagnostic.context_err||be.stream_diagnostic.relay_error?(0,G.jsxs)(`div`,{className:`mt-2 space-y-1 break-all text-muted`,children:[be.stream_diagnostic.context_err?(0,G.jsxs)(`div`,{children:[`context: `,be.stream_diagnostic.context_err]}):null,be.stream_diagnostic.relay_error?(0,G.jsxs)(`div`,{children:[`relay: `,be.stream_diagnostic.relay_error]}):null]}):null]}):null,be?.usage_detail?(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-3 py-3 text-xs`,children:[(0,G.jsx)(`div`,{className:`font-medium text-muted`,children:e(`logsUsageDetail`)}),(0,G.jsx)(`dl`,{className:`mt-2 grid gap-2 sm:grid-cols-2`,children:[[e(`logsCreditConsumed`),`${L1(be.usage_detail.credit)} ${be.usage_detail.unit||`credits`}`],[e(`logsColProvider`),be.usage_detail.provider||`—`]].map(([e,t])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{className:`text-caption text-muted`,children:e}),(0,G.jsx)(`dd`,{className:`mono mt-0.5 break-all`,children:t})]},String(e)))})]}):null,(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-xs font-medium text-muted`,children:e(`logsAttempts`)}),be?.attempts?.length?(0,G.jsx)(`div`,{className:`mt-2 divide-y divide-separator overflow-hidden rounded-lg bg-surface-secondary`,children:be.attempts.map(e=>(0,G.jsxs)(`div`,{className:`grid gap-1 px-3 py-2.5 text-xs sm:grid-cols-[48px_minmax(0,1fr)_auto]`,children:[(0,G.jsxs)(`div`,{className:`mono text-muted`,children:[`#`,e.attempt_index]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`font-medium`,children:e.account_id||`—`}),(0,G.jsx)(`div`,{className:`mt-0.5 text-muted`,children:e.error_message||e.status})]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:k1(e.status===`failover`?`canceled`:e.status),children:e.status})]},e.id))}):(0,G.jsx)(`p`,{className:`mt-2 text-xs text-muted`,children:e(`logsNoAttempts`)})]})]})})]})})})}),(0,G.jsx)(K$,{isOpen:ke,title:e(`logsClear`),description:e(`logsClearConfirm`),confirmLabel:e(`logsClear`),cancelLabel:e(`close`),closeLabel:e(`close`),isPending:je,onClose:()=>Ae(!1),onConfirm:()=>void ft()})]})}function G1(){return FH(`/api/usage/pricing`)}function K1(e={}){let t=new URLSearchParams;return e.from&&t.set(`from`,e.from),e.to&&t.set(`to`,e.to),FH(`/api/usage/cost${t.toString()?`?${t}`:``}`)}var q1=(0,v.lazy)(()=>C(()=>import(`./CostChart-5urt0nTO.js`).then(e=>({default:e.CostChart})),__vite__mapDeps([5,1,4,2]))),J1={window:{from:``,to:``,hours:24},currency:`CNY`,models:[],totals:{id:`total`,label:``,vendor:``,currency:`CNY`,requests:0,cache_hit:0,cache_miss:0,output:0,total_tokens:0,cost:0,cost_off_peak:0,cost_peak:0,peak_requests:0,credits:0,priced:!1},series:[]};function Y1(e,t){if(!t)return`0%`;let n=e/t*100;return`${n>=10?n.toFixed(0):n.toFixed(1)}%`}function X1(){let{t:e,lang:t}=DH(),[n,r]=(0,v.useState)(`all`),[i,a]=(0,v.useState)(`credits`),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!0),[f,p]=(0,v.useState)(``);(0,v.useEffect)(()=>{let e=!1;return G1().then(t=>{e||l(t)}).catch(()=>{}),()=>{e=!0}},[]);let m=(0,v.useCallback)(async()=>{d(!0);try{let e=await K1(n===`all`?{}:{from:new Date(Date.now()-Number(n)*3600*1e3).toISOString(),to:new Date().toISOString()});s(e),p(``)}catch(e){s(null),p(e instanceof Error?e.message:String(e))}finally{d(!1)}},[n]);(0,v.useEffect)(()=>{m()},[m]);let h=o??J1,g=h.totals,_=g.requests>0&&h.models.length>0,y=h.models.filter(e=>e.priced),b=g.cost>0,x=[{label:e(`usageCredits`),value:_X(g.credits),detail:e(`usageCreditsHint`)},{label:e(`usageTotalTokens`),value:sX(g.total_tokens),detail:`${sX(g.cache_hit)} / ${sX(g.cache_miss)} / ${sX(g.output)} ${e(`usageTokenSplitNote`)}`},{label:e(`usageRequests`),value:String(g.requests),detail:e(`usageModelCount`,{count:h.models.length})},{label:e(`usageCacheHitRate`),value:Y1(g.cache_hit,g.cache_hit+g.cache_miss),detail:sX(g.cache_hit)}],S=i===`credits`?_X(g.credits):i===`tokens`?sX(g.total_tokens):hX(g.cost);return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(`section`,{className:`flex flex-wrap items-center justify-end gap-3 pb-2`,children:[(0,G.jsx)(qX,{value:n,onChange:e=>r(e),ariaLabel:e(`usageWindow`),options:[{id:`24`,label:e(`usageWindow24h`)},{id:`168`,label:e(`usageWindow7d`)},{id:`all`,label:e(`usageWindowTotal`)}]}),(0,G.jsxs)(X,{size:`sm`,variant:`secondary`,onPress:()=>void m(),isDisabled:u,children:[(0,G.jsx)(Jr,{size:14}),e(`refresh`)]})]}),f?(0,G.jsx)(bU,{title:e(`failedStats`,{msg:f})}):null,(0,G.jsx)(`section`,{className:`grid gap-3 sm:grid-cols-2 sm:gap-4 xl:grid-cols-4`,children:x.map(e=>(0,G.jsxs)(zw,{className:`gap-0 p-4`,children:[(0,G.jsx)(`div`,{className:`text-body text-muted`,children:e.label}),(0,G.jsx)(`div`,{className:`tabular mt-1.5 text-section font-semibold`,children:u?(0,G.jsx)($,{className:`h-5 w-16`}):e.value}),(0,G.jsx)(`div`,{className:`mono mt-1 truncate text-caption text-muted`,children:u?(0,G.jsx)($,{className:`h-3 w-24`}):e.detail||`\xA0`})]},e.label))}),(0,G.jsxs)(zw,{className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-separator px-5 py-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold tracking-[-0.015em]`,children:e(`usageChartTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:e(`usageChartHint`)})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(qX,{value:i,onChange:e=>a(e),ariaLabel:e(`usageChartMetric`),options:[{id:`credits`,label:e(`usageColCredits`)},{id:`tokens`,label:e(`usageColTokens`)}]}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`default`,children:S})]})]}),(0,G.jsx)(`div`,{className:`p-5`,children:u?(0,G.jsx)(`div`,{className:`grid h-72 place-items-center`,children:(0,G.jsx)($,{className:`h-56 w-full`})}):_?(0,G.jsx)(v.Suspense,{fallback:(0,G.jsx)(`div`,{className:`grid h-72 place-items-center`,children:(0,G.jsx)($,{className:`h-56 w-full`})}),children:(0,G.jsx)(q1,{series:h.series,models:h.models,lang:t,emptyLabel:e(`usageChartEmpty`),totalLabel:e(`usageTotals`),metric:i})}):(0,G.jsx)(pQ,{title:e(`usageEmpty`),hint:e(`usageRetentionHint`)})})]}),(0,G.jsxs)(zw,{className:`overflow-hidden p-0`,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-between gap-3 border-b border-separator px-5 py-4`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`font-semibold tracking-[-0.015em]`,children:e(`usageBreakdownTitle`)}),(0,G.jsx)(`p`,{className:`mt-0.5 text-xs text-muted`,children:e(`usageBreakdownHint`)})]})}),u?(0,G.jsx)(`div`,{className:`space-y-3 p-5`,children:[0,1,2].map(e=>(0,G.jsx)($,{className:`h-9 w-full`},e))}):_?(0,G.jsx)(Q,{children:(0,G.jsx)(Q.ScrollContainer,{children:(0,G.jsxs)(Q.Content,{"aria-label":e(`usageBreakdownTitle`),children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:e(`usageColModel`)}),(0,G.jsx)(Q.Column,{children:e(`usageColRequests`)}),(0,G.jsx)(Q.Column,{children:e(`usageColInputHit`)}),(0,G.jsx)(Q.Column,{children:e(`usageColInputMiss`)}),(0,G.jsx)(Q.Column,{children:e(`usageColOutput`)}),(0,G.jsx)(Q.Column,{children:e(`usageColTokens`)}),(0,G.jsx)(Q.Column,{children:e(`usageColCredits`)})]}),(0,G.jsxs)(Q.Body,{children:[h.models.map(e=>(0,G.jsxs)(Q.Row,{children:[(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:e.label}),(0,G.jsx)(`div`,{className:`mono mt-0.5 text-[10px] text-muted`,children:e.id})]}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:e.requests})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:sX(e.cache_hit)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:sX(e.cache_miss)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:sX(e.output)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs`,children:sX(e.total_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:_X(e.credits)})})]},e.id)),(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-sm font-semibold`,children:e(`usageTotals`)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:g.requests})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:sX(g.cache_hit)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:sX(g.cache_miss)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:sX(g.output)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:sX(g.total_tokens)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-xs font-semibold`,children:_X(g.credits)})})]})]})]})})}):(0,G.jsx)(pQ,{title:e(`usageEmpty`),hint:e(`usageRetentionHint`)})]}),(0,G.jsx)(Ih,{className:`rounded-xl bg-surface-secondary`,hideSeparator:!0,defaultExpandedKeys:[],children:(0,G.jsxs)(Ih.Item,{id:`deepseek-estimate`,children:[(0,G.jsx)(Ih.Heading,{children:(0,G.jsxs)(Ih.Trigger,{className:`items-center gap-3 px-5 py-4 text-left`,children:[(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block font-semibold tracking-[-0.015em]`,children:e(`usageEstimateTitle`)}),(0,G.jsx)(`span`,{className:`mt-0.5 block text-xs text-muted`,children:e(`usageEstimateHint`)})]}),b?(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`default`,children:hX(g.cost)}):null,(0,G.jsx)(Ih.Indicator,{})]})}),(0,G.jsx)(Ih.Panel,{children:(0,G.jsxs)(Ih.Body,{className:`space-y-5 px-5 pb-5`,children:[(0,G.jsx)(`p`,{className:`text-xs leading-6 text-muted`,children:e(`usageRenderNote`)}),b?(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,G.jsx)(`h4`,{className:`text-sm font-medium`,children:e(`usageEstimateChartTitle`)}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:`default`,children:hX(g.cost)})]}),(0,G.jsx)(v.Suspense,{fallback:(0,G.jsx)($,{className:`h-56 w-full`}),children:(0,G.jsx)(q1,{series:h.series,models:y.length?y:h.models,lang:t,emptyLabel:e(`usageEstimateChartEmpty`),totalLabel:e(`usageTotals`),metric:`cost`})})]}):null,y.length?(0,G.jsx)(Q,{children:(0,G.jsx)(Q.ScrollContainer,{children:(0,G.jsxs)(Q.Content,{"aria-label":e(`usageEstimateTitle`),children:[(0,G.jsxs)(Q.Header,{children:[(0,G.jsx)(Q.Column,{isRowHeader:!0,children:e(`usageColModel`)}),(0,G.jsx)(Q.Column,{children:e(`usageColSplit`)}),(0,G.jsx)(Q.Column,{children:e(`usageColCost`)})]}),(0,G.jsxs)(Q.Body,{children:[y.map(e=>(0,G.jsxs)(Q.Row,{children:[(0,G.jsxs)(Q.Cell,{children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:e.label}),(0,G.jsx)(`div`,{className:`mono mt-0.5 text-[10px] text-muted`,children:e.id})]}),(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`span`,{className:`mono text-xs text-muted`,children:[hX(e.cost_peak),` / `,hX(e.cost_off_peak)]})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-sm font-semibold`,children:hX(e.cost)})})]},e.id)),(0,G.jsxs)(Q.Row,{children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`text-sm font-semibold`,children:e(`usageTotals`)})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`span`,{className:`mono text-xs text-muted`,children:[hX(g.cost_peak),` / `,hX(g.cost_off_peak)]})}),(0,G.jsx)(Q.Cell,{children:(0,G.jsx)(`span`,{className:`mono text-sm font-semibold`,children:hX(g.cost)})})]})]})]})})}):(0,G.jsx)(`p`,{className:`text-xs text-muted`,children:e(`usageEstimateChartEmpty`)}),(0,G.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{className:`mb-2 text-sm font-medium`,children:e(`usagePriceTitle`)}),(0,G.jsx)(`p`,{className:`mb-3 text-xs text-muted`,children:e(`usagePeakNote`)}),(0,G.jsxs)(`div`,{className:`divide-y divide-separator rounded-lg bg-background`,children:[(c?.models??[]).map(t=>(0,G.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium`,children:t.label}),(0,G.jsx)(`span`,{className:`mono text-[10px] text-muted`,children:t.currency})]}),(0,G.jsx)(`div`,{className:`mono mt-1 text-[10px] text-muted`,children:t.id}),(0,G.jsxs)(`div`,{className:`mt-2 grid grid-cols-2 gap-2 text-[11px]`,children:[(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-2.5 py-2`,children:[(0,G.jsx)(`div`,{className:`text-[10px] text-muted`,children:e(`usagePriceBandOff`)}),(0,G.jsxs)(`div`,{className:`mono mt-0.5`,children:[gX(t.off_peak.cache_hit),` · `,gX(t.off_peak.cache_miss),` · `,gX(t.off_peak.output)]}),(0,G.jsxs)(`div`,{className:`mt-1 text-[9px] text-muted`,children:[e(`usagePriceHit`),` · `,e(`usagePriceMiss`),` · `,e(`usagePriceOutput`)]})]}),(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary px-2.5 py-2`,children:[(0,G.jsx)(`div`,{className:`text-[10px] text-muted`,children:e(`usagePriceBandPeak`)}),(0,G.jsxs)(`div`,{className:`mono mt-0.5`,children:[gX(t.peak.cache_hit),` · `,gX(t.peak.cache_miss),` · `,gX(t.peak.output)]}),(0,G.jsxs)(`div`,{className:`mt-1 text-[9px] text-muted`,children:[e(`usagePriceHit`),` · `,e(`usagePriceMiss`),` · `,e(`usagePriceOutput`)]})]})]})]},t.id)),c?.models?.length?null:(0,G.jsx)(`div`,{className:`px-4 py-6 text-sm text-muted`,children:e(`usageEmpty`)})]})]}),(0,G.jsxs)(`div`,{className:`space-y-3 text-xs leading-6 text-muted`,children:[(0,G.jsx)(`h4`,{className:`text-sm font-medium text-foreground`,children:e(`usageNoteTitle`)}),(0,G.jsx)(`p`,{children:e(`usageRetentionHint`)}),(0,G.jsx)(`p`,{children:e(`usagePeakNote`)}),h.unpriced?.length?(0,G.jsx)(`p`,{children:e(`usageUnpricedHint`,{models:h.unpriced.join(`, `)})}):null,c?.note?(0,G.jsx)(`p`,{className:`mono text-[10px]`,children:c.note}):null]})]})]})})]})})]})}var Z1=500,Q1={model:`model`,account:`account`,provider:`provider`};function $1(e,t,n){let r=e.prompt_tokens??0,i=e.completion_tokens??0,a=e.key===`(unknown)`||e.key===`(unassigned)`||!e.key;return{key:e.key,label:n,count:e.count,success:e.count?e.ok/e.count:0,p95:e.latency_p95_ms??null,tokens:r+i,prompt:r,completion:i,credits:e.credits??0,cache_write:e.cache_write_tokens??0,cache_read:e.cache_read_tokens??0,filter:a?void 0:{[Q1[t]]:e.key}}}function e0(e,t,n){let r=n===`ascending`?1:-1;return[...e].sort((e,n)=>{if(t===`label`)return r*e.label.localeCompare(n.label);let i=e[t],a=n[t];return i==null&&a==null?0:i==null?1:a==null?-1:r*(i-a)||e.label.localeCompare(n.label)})}function t0(e){return e?e>=1e3?sX(e):String(Math.round(e*100)/100):`0`}function n0(){let{t:e}=DH(),t=ot(),[n,r]=(0,v.useState)(`stats`),[i,a]=(0,v.useState)(`model`),[o,s]=(0,v.useState)(`24`),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(!0),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)([]),[y,b]=(0,v.useState)(`count`),[x,S]=(0,v.useState)(`descending`),C=(0,v.useRef)(0);(0,v.useEffect)(()=>{let e=!1;return LH(!1).then(t=>{e||_(t.data||[])}).catch(()=>{}),()=>{e=!0}},[]);let w=c?.start?.toString()??``,T=c?.end?.toString()??``;(0,v.useEffect)(()=>{let e=mZ(o,c);if(!e){p(!1);return}let t=++C.current;tX({...e,dim:[i],limit:Z1}).then(e=>{t===C.current&&(d(e),h(``))}).catch(e=>{t===C.current&&(d(null),h(e instanceof Error?e.message:String(e)))}).finally(()=>{t===C.current&&p(!1)})},[i,o,w,T]);let E=(0,v.useMemo)(()=>{let t=new Map(g.map(e=>[e.id,e.name||e.id]));return e0(((i===`model`?u?.models:i===`account`?u?.accounts:u?.providers)??[]).map(n=>{let r=n.key===`(unknown)`?e(`statsUnknown`):n.key===`(unassigned)`?e(`statsUnassigned`):i===`account`?t.get(n.key)||n.key:i===`provider`?TZ(n.key,e):n.key;return $1(n,i,r)}),y,x)},[u,i,g,y,x,e]),D=u?.totals,O=u?.tokens,k=[{id:`label`,label:e(i===`model`?`logsColModel`:i===`account`?`logsColAccount`:`logsColProvider`)},{id:`count`,label:e(`usageColRequests`),numeric:!0},{id:`success`,label:e(`usageColSuccess`),numeric:!0},{id:`p95`,label:e(`statsLatencyP95`),numeric:!0},{id:`tokens`,label:e(`usageColTokens`),numeric:!0},{id:`cache_write`,label:e(`usageColCacheWrite`),numeric:!0},{id:`credits`,label:e(`usageColCredits`),numeric:!0}],A=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`section`,{className:`flex flex-wrap items-center justify-end gap-3 pb-1`,children:(0,G.jsx)(hZ,{value:o,onChange:s,custom:c,onCustomChange:l,onBusy:()=>p(!0),t:e})}),m?(0,G.jsx)(bU,{title:e(`failedStats`,{msg:m})}):null,(0,G.jsx)(`section`,{className:`grid gap-3 sm:grid-cols-2 sm:gap-4 xl:grid-cols-5`,children:[[e(`usageColRequests`),D?sX(D.requests):`—`,e(`statsWindowHint`,{window:e(pZ[o])})],[e(`usageColSuccess`),D?uX(D.success_rate):`—`,D?`${D.ok} / ${D.requests}`:``],[e(`usageColTokens`),O?sX(O.total):`—`,O?`${sX(O.prompt)} / ${sX(O.completion)}`:``],[e(`usageColCacheWrite`),O?sX(O.cache_write??0):`—`,O?`${e(`chartCacheRead`)} ${sX(O.cache_read)}`:``],[e(`usageColCredits`),D?t0(D.credits??0):`—`,``]].map(([e,t,n])=>(0,G.jsxs)(zw,{className:`gap-0 p-4`,children:[(0,G.jsx)(`div`,{className:`text-body text-muted`,children:e}),(0,G.jsx)(`div`,{className:`tabular mt-1.5 text-section font-semibold`,children:f?(0,G.jsx)($,{className:`h-5 w-16`}):t}),(0,G.jsx)(`div`,{className:`mono mt-1 truncate text-caption text-muted`,children:f?(0,G.jsx)($,{className:`h-3 w-24`}):n||`\xA0`})]},e))}),(0,G.jsxs)(zw,{className:`overflow-hidden p-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-separator px-5 py-3 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between`,children:[(0,G.jsx)(LF,{selectedKey:i,onSelectionChange:e=>{p(!0),a(String(e))},children:(0,G.jsx)(LF.ListContainer,{className:`w-fit`,children:(0,G.jsxs)(LF.List,{"aria-label":e(`usageTitle`),children:[(0,G.jsxs)(IF,{id:`model`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),(0,G.jsx)(Mi,{size:14}),e(`usageByModel`)]}),(0,G.jsxs)(IF,{id:`account`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),(0,G.jsx)(no,{size:14}),e(`usageByAccount`)]}),(0,G.jsxs)(IF,{id:`provider`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),(0,G.jsx)(Ba,{size:14}),e(`usageByProvider`)]})]})})}),(0,G.jsx)(`span`,{className:`mono text-caption text-muted`,children:f?``:e(`usageRowCount`,{count:E.length})})]}),f?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`divide-y divide-separator md:hidden`,"aria-busy":`true`,children:Array.from({length:4},(e,t)=>(0,G.jsxs)(`div`,{className:`space-y-3 px-5 py-4`,children:[(0,G.jsx)($,{className:`h-4 w-40`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:Array.from({length:4},(e,t)=>(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)($,{className:`h-3 w-12`}),(0,G.jsx)($,{className:`h-4 w-16`})]},t))})]},t))}),(0,G.jsx)(`div`,{className:`hidden divide-y divide-separator md:block`,"aria-busy":`true`,children:Array.from({length:6},(e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-6 px-5 py-3.5`,children:[(0,G.jsx)($,{className:`h-4 w-40`}),(0,G.jsx)(`div`,{className:`flex-1`}),Array.from({length:6},(e,t)=>(0,G.jsx)($,{className:`h-4 w-14`},t))]},t))})]}):E.length===0?(0,G.jsxs)(`div`,{className:`flex items-center gap-2 px-5 py-10 text-body text-muted`,children:[(0,G.jsx)(mi,{size:16}),e(`usageEmpty`)]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`divide-y divide-separator md:hidden`,children:E.map(n=>{let r=!!(n.filter&&u),a=[{label:e(`usageColRequests`),value:String(n.count)},{label:e(`usageColSuccess`),value:uX(n.success),tone:n.success<.9?`text-warning`:void 0},{label:e(`statsLatencyP95`),value:cX(n.p95)},{label:e(`usageColTokens`),value:sX(n.tokens),sub:`${sX(n.prompt)} / ${sX(n.completion)}`},{label:e(`usageColCacheWrite`),value:sX(n.cache_write)},{label:e(`usageColCredits`),value:t0(n.credits)}];return(0,G.jsxs)(`article`,{className:`space-y-3 px-5 py-4 ${r?`cursor-pointer`:``}`,onClick:r?()=>t(gZ(n.filter??{},u.window.from,u.window.to)):void 0,onKeyDown:r?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t(gZ(n.filter??{},u.window.from,u.window.to)))}:void 0,role:r?`button`:void 0,tabIndex:r?0:void 0,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[i===`provider`&&n.filter?(0,G.jsx)(zZ,{provider:n.key,size:14}):null,(0,G.jsx)(`span`,{className:`truncate text-body font-medium`,children:n.label})]}),i===`account`&&n.label!==n.key?(0,G.jsx)(`div`,{className:`mono truncate text-caption text-muted`,children:n.key}):null,(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-3`,children:a.map(e=>(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,G.jsx)(`div`,{className:`text-caption text-muted`,children:e.label}),(0,G.jsx)(`div`,{className:`mono text-body ${e.tone??`text-foreground`}`,children:e.value}),`sub`in e&&e.sub?(0,G.jsx)(`div`,{className:`mono text-caption text-muted`,children:e.sub}):null]},e.label))})]},n.key)})}),(0,G.jsx)(Q,{className:`usage-table hidden md:block`,children:(0,G.jsx)(Q.ScrollContainer,{className:`min-w-0 overflow-x-auto`,children:(0,G.jsxs)(Q.Content,{"aria-label":e(`usageTitle`),className:`min-w-[48rem]`,sortDescriptor:{column:y,direction:x},onSortChange:e=>{b(String(e.column)),S(e.direction)},children:[(0,G.jsx)(Q.Header,{children:k.map(e=>(0,G.jsx)(Q.Column,{id:e.id,allowsSorting:!0,isRowHeader:e.id===`label`,className:e.numeric?`text-right`:void 0,children:({sortDirection:t})=>(0,G.jsx)(Q.SortableColumnHeader,{sortDirection:t,className:e.numeric?`justify-end`:void 0,children:e.label})},e.id))}),(0,G.jsx)(Q.Body,{children:E.map(e=>(0,G.jsxs)(Q.Row,{id:e.key,className:e.filter&&u?`cursor-pointer`:void 0,onAction:e.filter&&u?()=>t(gZ(e.filter??{},u.window.from,u.window.to)):void 0,children:[(0,G.jsx)(Q.Cell,{children:(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[i===`provider`&&e.filter?(0,G.jsx)(zZ,{provider:e.key,size:14}):null,(0,G.jsx)(`span`,{className:`truncate text-body font-medium`,children:e.label}),i===`account`&&e.label!==e.key?(0,G.jsx)(`span`,{className:`mono truncate text-caption text-muted`,children:e.key}):null]})}),(0,G.jsx)(Q.Cell,{className:`mono text-right text-body`,children:e.count}),(0,G.jsx)(Q.Cell,{className:`mono text-right text-body`,children:(0,G.jsx)(`span`,{className:e.success<.9?`text-warning`:void 0,children:uX(e.success)})}),(0,G.jsx)(Q.Cell,{className:`mono text-right text-body`,children:cX(e.p95)}),(0,G.jsxs)(Q.Cell,{className:`text-right`,children:[(0,G.jsx)(`div`,{className:`mono text-body`,children:sX(e.tokens)}),(0,G.jsxs)(`div`,{className:`mono text-caption text-muted`,children:[sX(e.prompt),` / `,sX(e.completion)]})]}),(0,G.jsx)(Q.Cell,{className:`mono text-right text-body`,children:sX(e.cache_write)}),(0,G.jsx)(Q.Cell,{className:`mono text-right text-body`,children:t0(e.credits)})]},e.key))})]})})})]})]})]});return(0,G.jsxs)(`div`,{className:`space-y-6 sm:space-y-6`,children:[(0,G.jsxs)(`section`,{className:`pb-1`,children:[(0,G.jsx)(`h2`,{className:`text-title font-semibold`,children:e(`usageTitle`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:e(n===`cost`?`usageCostLead`:`usageLead`)})]}),(0,G.jsxs)(LF,{selectedKey:n,onSelectionChange:e=>r(String(e)),children:[(0,G.jsx)(LF.ListContainer,{className:`w-fit`,children:(0,G.jsxs)(LF.List,{"aria-label":e(`usageTitle`),children:[(0,G.jsxs)(IF,{id:`stats`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),e(`usageStatsTab`)]}),(0,G.jsxs)(IF,{id:`cost`,className:`gap-1.5 whitespace-nowrap`,children:[(0,G.jsx)(LF.Indicator,{className:`transition-none`}),e(`usageCostTab`)]})]})}),(0,G.jsx)(LF.Panel,{id:`stats`,className:`space-y-6 pt-5`,children:A}),(0,G.jsx)(LF.Panel,{id:`cost`,className:`pt-5`,children:(0,G.jsx)(X1,{})})]})]})}var r0=1.1;function i0({label:e,onConfirm:t,isPending:n,children:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>{a.current?.kill()},[]),(0,G.jsxs)(eL,{delay:300,children:[(0,G.jsx)(eL.Trigger,{children:(0,G.jsxs)(X,{isIconOnly:!0,size:`sm`,variant:`ghost`,"aria-label":e,isPending:n,className:`relative overflow-hidden`,onPressStart:()=>{let e=i.current;!e||n||(a.current?.kill(),a.current=eY.to(e,{scaleX:1,duration:r0*(1-Number(eY.getProperty(e,`scaleX`))),ease:nY.linear,onComplete:()=>{a.current=null,eY.to(e,{scaleX:0,duration:iY()?0:tY.base,ease:nY.out,delay:tY.fast}),t()}}))},onPressEnd:()=>{let e=i.current;!e||!a.current||(a.current.kill(),a.current=null,eY.to(e,{scaleX:0,duration:iY()?0:tY.base,ease:nY.soft}))},children:[(0,G.jsx)(`span`,{ref:i,"aria-hidden":!0,className:`pointer-events-none absolute inset-0 origin-left scale-x-0 bg-danger/20`}),(0,G.jsx)(`span`,{className:`relative inline-flex`,children:r})]})}),(0,G.jsx)(eL.Content,{children:e})]})}function a0(e){let t=[];for(let n of e)for(let e of n.regions||[])e?.id&&t.push({value:`${n.id}:${e.id}`,provider:n.id,region:e.id});return t}function o0(e,t){let n=e.indexOf(`:`),r=n===-1?e:e.slice(0,n),i=n===-1?``:e.slice(n+1);return i?EZ(r,i,t):TZ(r,t)}function s0(e){let t=e.indexOf(`:`);return t===-1?e:e.slice(0,t)}function c0(e,t){let n=[],r=new Set(e.filter(e=>!e.includes(`:`)).map(e=>e.toLowerCase()));for(let t of e)t.includes(`:`)&&n.push(t);for(let e of t)r.has(e.provider)&&!n.includes(e.value)&&n.push(e.value);return n}function l0(e,t){return e.length?e.map(e=>o0(e,t)).join(` · `):t(`keysAllProviders`)}function u0(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function d0(){let{t:e}=DH(),[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(!0),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(!1);(0,v.useEffect)(()=>{tU().then(e=>{let t=a0(e.data||[]);n(t),i(t.length>0),o(``)}).catch(e=>{o(e instanceof Error?e.message:String(e))})},[]);async function w(){u(!0);try{let e=await p1();c(e.data||[]),m(``)}catch(e){m(e instanceof Error?e.message:String(e))}finally{u(!1)}}(0,v.useEffect)(()=>{let e=window.setTimeout(()=>void w(),0);return()=>window.clearTimeout(e)},[]);async function T(e){await NQ(e),C(!0),window.setTimeout(()=>C(!1),1200)}async function E(e,t){f(e.id),c(n=>n.map(n=>n.id===e.id?{...n,enabled:t}:n));try{let n=await h1(e.id,{enabled:t});c(t=>t.map(t=>t.id===e.id?{...t,...n,secret:void 0}:t))}catch(e){m(e instanceof Error?e.message:String(e)),await w()}finally{f(``)}}async function D(t){f(t.id);try{await g1(t.id),c(e=>e.filter(e=>e.id!==t.id)),JY({type:`success`,title:e(`toastKeyDeleted`)})}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(``)}}return l&&!s.length?(0,G.jsx)(yY,{}):(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(`section`,{className:`flex flex-wrap items-end justify-between gap-4 pb-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{"data-gsap-reveal":!0,className:`text-title font-semibold`,children:e(`navKeys`)}),(0,G.jsx)(`p`,{className:`mt-1 max-w-2xl text-body leading-6 text-muted`,children:e(`keysLead`)})]}),(0,G.jsxs)(X,{size:`sm`,isDisabled:!r,onPress:()=>g(!0),children:[(0,G.jsx)(wa,{size:14}),e(`keysCreate`)]})]}),p?(0,G.jsx)(bU,{title:p}):null,a?(0,G.jsx)(bU,{title:e(`keysProvidersLoadFailed`,{message:a})}):null,l?(0,G.jsx)(`section`,{className:`grid gap-2.5 lg:grid-cols-2 xl:grid-cols-3`,"aria-busy":!0,children:Array.from({length:Math.max(3,s.length)},(e,t)=>(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-3xl bg-surface shadow-surface p-3`,children:[(0,G.jsx)($,{className:`h-4 w-28`}),(0,G.jsx)($,{className:`mt-2 h-3 w-40`}),(0,G.jsx)($,{className:`mt-4 h-6 w-24`}),(0,G.jsx)($,{className:`mt-6 h-8 w-full`})]},t))}):s.length?(0,G.jsx)(`section`,{className:`grid gap-2.5 lg:grid-cols-2 xl:grid-cols-3`,children:s.map(t=>(0,G.jsxs)(zw,{className:`overflow-hidden p-0`,children:[(0,G.jsxs)(zw.Header,{className:`flex-row items-start justify-between gap-3 px-3 pt-3 pb-2.5`,children:[(0,G.jsx)(`div`,{className:`min-w-0`,children:(0,G.jsx)(zw.Title,{className:`truncate text-body`,children:t.name})}),(0,G.jsx)(lT,{size:`sm`,variant:`soft`,color:t.enabled?`success`:`default`,children:t.enabled?e(`enabled`):e(`disabled`)})]}),(0,G.jsxs)(zw.Content,{className:`space-y-2.5 px-3 pb-2.5`,children:[(0,G.jsx)(`div`,{className:`mono w-full rounded-lg bg-surface-secondary px-3 py-2 text-body text-foreground`,title:t.prefix,children:t.prefix}),(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:(t.providers.length?t.providers:[`all`]).map(t=>(0,G.jsx)(lT,{size:`sm`,variant:`soft`,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t===`all`?(0,G.jsx)(na,{size:12}):(0,G.jsx)(zZ,{provider:s0(t),size:12}),(0,G.jsx)(`span`,{children:t===`all`?e(`keysAllProviders`):o0(t,e)})]})},t))}),(0,G.jsx)(`p`,{className:`text-caption leading-5 text-muted`,children:t.last_used_at?e(`keysLastUsed`,{time:u0(t.last_used_at)}):e(`keysNeverUsed`)})]}),(0,G.jsxs)(zw.Footer,{className:`gap-1.5 bg-surface-secondary px-3 py-2`,children:[(0,G.jsx)(X,{size:`sm`,variant:`ghost`,isDisabled:!r,onPress:()=>y(t),children:e(`edit`)}),(0,G.jsx)(i0,{label:e(`holdToDelete`),isPending:d===t.id,onConfirm:()=>void D(t),children:(0,G.jsx)(Ja,{size:14})}),(0,G.jsx)(`div`,{className:`ml-auto`,children:(0,G.jsx)(fQ,{isSelected:t.enabled,isDisabled:d===t.id,ariaLabel:e(`enable`),onChange:e=>void E(t,e)})})]})]},t.id))}):(0,G.jsx)(pQ,{className:`rounded-3xl bg-surface-secondary`,icon:(0,G.jsx)(uY,{size:28}),title:e(`keysEmpty`),hint:e(`keysEmptyHint`),action:(0,G.jsxs)(X,{size:`sm`,isDisabled:!r,onPress:()=>g(!0),children:[(0,G.jsx)(wa,{size:14}),e(`keysCreate`)]})}),(0,G.jsx)(f0,{isOpen:h,title:e(`keysCreateTitle`),hint:e(`keysCreateHint`),options:t,t:e,onClose:()=>g(!1),onSave:async e=>{let t=await m1(e);c(e=>[t,...e.map(e=>({...e,secret:void 0}))]),g(!1),x(t)}}),(0,G.jsx)(f0,{isOpen:!!_,title:e(`keysEditTitle`),hint:e(`keysEditHint`),initial:_,options:t,t:e,onClose:()=>y(null),onSave:async e=>{if(!_)return;let t=await h1(_.id,e);c(e=>e.map(e=>e.id===_.id?{...e,...t,secret:void 0}:e)),y(null)}}),(0,G.jsx)(Z.Root,{isOpen:!!b?.secret,onOpenChange:e=>{e||x(null)},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`lg`,children:(0,G.jsxs)(Z.Dialog,{children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-6 pt-6`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:e(`keysSecretTitle`)}),(0,G.jsx)(`p`,{className:`mt-1.5 text-body leading-6 text-muted`,children:e(`keysSecretHint`)})]}),(0,G.jsx)(Z.CloseTrigger,{"aria-label":e(`close`),className:`grid size-9 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:18})})]}),(0,G.jsxs)(Z.Body,{className:`px-6 pb-2`,children:[(0,G.jsxs)(RB,{status:`warning`,className:`mb-4`,children:[(0,G.jsx)(RB.Indicator,{}),(0,G.jsx)(RB.Content,{children:(0,G.jsx)(RB.Title,{children:e(`keysSecretOnce`)})})]}),(0,G.jsx)(`code`,{className:`mono block break-all rounded-lg bg-surface-secondary px-3 py-3 text-body`,children:b?.secret})]}),(0,G.jsxs)(Z.Footer,{className:`justify-end`,children:[(0,G.jsx)(X,{variant:`ghost`,onPress:()=>x(null),children:e(`close`)}),(0,G.jsxs)(X,{onPress:()=>{b?.secret&&T(b.secret)},children:[(0,G.jsx)(Oi,{size:14}),e(S?`copied`:`copy`)]})]})]})})})})]})}function f0({isOpen:e,title:t,hint:n,initial:r,options:i,t:a,onClose:o,onSave:s}){let[c,l]=(0,v.useState)(r?.name||``),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)(new Set),[m,h]=(0,v.useState)(!0),[g,_]=(0,v.useState)(``),[y,b]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(!e)return;l(r?.name||``),d(c0(r?.providers||[],i));let t=new Set((r?.providers||[]).filter(e=>!e.includes(`:`)).map(e=>e.toLowerCase()));p(t),h(!0),_(``)},[r,e,i]);function x(e){let t=i.find(t=>t.value===e);h(!1),d(n=>n.includes(e)?(t&&p(e=>{let n=new Set(e);return n.delete(t.provider),n}),n.filter(t=>t!==e)):[...n,e])}async function S(e){e?.preventDefault();let t=c.trim();if(!t){_(a(`keysNameRequired`));return}if(!i.length){_(a(`keysProvidersNotLoaded`));return}b(!0),_(``);try{await s({name:t,providers:m?r?.providers||[]:u})}catch(e){_(e instanceof Error?e.message:String(e))}finally{b(!1)}}return(0,G.jsx)(Z.Root,{isOpen:e,onOpenChange:e=>{!e&&!y&&o()},children:(0,G.jsx)(Z.Backdrop,{variant:`blur`,children:(0,G.jsx)(Z.Container,{placement:`center`,size:`lg`,scroll:`inside`,children:(0,G.jsx)(Z.Dialog,{className:`sm:min-w-[32rem]`,children:(0,G.jsxs)(FB,{onSubmit:S,children:[(0,G.jsxs)(Z.Header,{className:`items-start justify-between gap-4 px-6 pt-6`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Z.Heading,{className:`text-section font-semibold`,children:t}),(0,G.jsx)(`p`,{className:`mt-1.5 text-body leading-6 text-muted`,children:n})]}),(0,G.jsx)(Z.CloseTrigger,{isDisabled:y,"aria-label":a(`close`),className:`grid size-9 place-items-center rounded-lg text-muted hover:bg-surface-secondary`,children:(0,G.jsx)(oo,{size:18})})]}),(0,G.jsxs)(Z.Body,{className:`space-y-5 px-6 pb-2 pt-1`,children:[g?(0,G.jsxs)(RB,{status:`danger`,children:[(0,G.jsx)(RB.Indicator,{}),(0,G.jsx)(RB.Content,{children:(0,G.jsx)(RB.Title,{children:g})})]}):null,(0,G.jsx)(E$,{label:a(`keysName`),children:(0,G.jsx)(lL,{value:c,onChange:e=>l(e.target.value),placeholder:a(`keysNamePh`),"aria-label":a(`keysName`)})}),(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(sR,{className:`text-body font-medium text-muted`,children:a(`keysProviders`)}),(0,G.jsx)(lR,{className:`text-caption leading-5 text-muted`,children:a(`keysProvidersHint`)}),i.length?(0,G.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:i.map(e=>{let t=u.includes(e.value),n=f.has(e.provider);return(0,G.jsx)(aT,{isSelected:t,onChange:()=>x(e.value),className:`rounded-xl bg-surface-secondary px-3 py-2.5 data-selected:border-accent data-selected:bg-accent-soft`,children:(0,G.jsxs)(aT.Content,{className:`flex items-center gap-2.5`,children:[(0,G.jsx)(aT.Control,{children:(0,G.jsx)(aT.Indicator,{})}),(0,G.jsx)(zZ,{provider:e.provider,size:16}),(0,G.jsx)(`span`,{className:`text-body font-medium`,children:EZ(e.provider,e.region,a)}),n?(0,G.jsx)(`span`,{className:`rounded-md bg-surface-secondary px-1.5 py-0.5 text-caption font-medium text-muted`,children:a(`keysAllRegions`)}):null]})},e.value)})}):(0,G.jsx)(`p`,{className:`rounded-lg bg-surface-secondary px-3 py-2.5 text-caption leading-5 text-muted`,children:a(`keysProvidersNotLoaded`)}),(0,G.jsx)(`p`,{className:`text-caption text-muted`,children:l0(u,a)})]})]}),(0,G.jsxs)(Z.Footer,{className:`justify-end`,children:[(0,G.jsx)(X,{variant:`ghost`,isDisabled:y,onPress:o,children:a(`cancel`)}),(0,G.jsx)(X,{type:`submit`,isPending:y,isDisabled:!i.length,children:a(r?`save`:`create`)})]})]})})})})})}function p0(){return(0,G.jsx)(hU,{children:(0,G.jsx)(EH,{children:(0,G.jsx)(AH,{children:(0,G.jsx)(uU,{children:(0,G.jsx)(Sn,{children:(0,G.jsxs)(Ft,{children:[(0,G.jsx)(Nt,{path:`/login`,element:(0,G.jsx)(f1,{})}),(0,G.jsx)(Nt,{element:(0,G.jsx)(eX,{}),children:(0,G.jsxs)(Nt,{element:(0,G.jsx)($Y,{}),children:[(0,G.jsx)(Nt,{path:`/`,element:(0,G.jsx)(iQ,{})}),(0,G.jsx)(Nt,{path:`/auth`,element:(0,G.jsx)(jt,{to:`/accounts`,replace:!0})}),(0,G.jsx)(Nt,{path:`/providers`,element:(0,G.jsx)(jQ,{})}),(0,G.jsx)(Nt,{path:`/access`,element:(0,G.jsx)(f$,{})}),(0,G.jsx)(Nt,{path:`/accounts`,element:(0,G.jsx)(d1,{})}),(0,G.jsx)(Nt,{path:`/checkins`,element:(0,G.jsx)(jt,{to:`/accounts`,replace:!0})}),(0,G.jsx)(Nt,{path:`/usage`,element:(0,G.jsx)(n0,{})}),(0,G.jsx)(Nt,{path:`/logs`,element:(0,G.jsx)(W1,{})}),(0,G.jsx)(Nt,{path:`/keys`,element:(0,G.jsx)(d0,{})}),(0,G.jsx)(Nt,{path:`/system`,element:(0,G.jsx)(T1,{})}),(0,G.jsx)(Nt,{path:`*`,element:(0,G.jsx)(jt,{to:`/`,replace:!0})})]})})]})})})})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(v.StrictMode,{children:(0,G.jsx)(p0,{})}));export{_X as a,Pv as c,h as d,d as f,l as h,sX as i,Mc as l,s as m,wX as n,cX as o,o as p,hX as r,eY as s,qX as t,Ss as u}; \ No newline at end of file diff --git a/internal/webui/static/index.html b/internal/webui/static/index.html index 06964af7..97764599 100644 --- a/internal/webui/static/index.html +++ b/internal/webui/static/index.html @@ -19,7 +19,7 @@ - +