@open-mercato/cezar 0.9.0-pr646.708 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +1 -17
  2. package/dist/config.d.ts +0 -14
  3. package/dist/config.js +0 -39
  4. package/dist/config.js.map +1 -1
  5. package/dist/core/claude-ui-mapper.d.ts +0 -9
  6. package/dist/core/claude-ui-mapper.js +2 -31
  7. package/dist/core/claude-ui-mapper.js.map +1 -1
  8. package/dist/core/codex-app-server-runner.js +18 -19
  9. package/dist/core/codex-app-server-runner.js.map +1 -1
  10. package/dist/core/opencode-server-runner.js +5 -25
  11. package/dist/core/opencode-server-runner.js.map +1 -1
  12. package/dist/core/tool-display.d.ts +1 -2
  13. package/dist/core/tool-display.js +1 -6
  14. package/dist/core/tool-display.js.map +1 -1
  15. package/dist/index.js +4 -40
  16. package/dist/index.js.map +1 -1
  17. package/dist/runs/auto-name.js +0 -6
  18. package/dist/runs/auto-name.js.map +1 -1
  19. package/dist/runs/store.js +9 -34
  20. package/dist/runs/store.js.map +1 -1
  21. package/dist/server/capabilities.d.ts +0 -6
  22. package/dist/server/capabilities.js +0 -6
  23. package/dist/server/capabilities.js.map +1 -1
  24. package/dist/server/server.d.ts +0 -8
  25. package/dist/server/server.js +7 -146
  26. package/dist/server/server.js.map +1 -1
  27. package/dist/server-install/engine.d.ts +0 -5
  28. package/dist/server-install/engine.js +0 -6
  29. package/dist/server-install/engine.js.map +1 -1
  30. package/dist/server-install/platforms/ubuntu-vps.d.ts +2 -11
  31. package/dist/server-install/platforms/ubuntu-vps.js +10 -123
  32. package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
  33. package/dist/server-install/types.d.ts +0 -39
  34. package/dist/server-install/types.js +0 -13
  35. package/dist/server-install/types.js.map +1 -1
  36. package/dist/skills-remote.d.ts +0 -11
  37. package/dist/skills-remote.js +2 -31
  38. package/dist/skills-remote.js.map +1 -1
  39. package/dist/skills.d.ts +0 -29
  40. package/dist/skills.js +14 -72
  41. package/dist/skills.js.map +1 -1
  42. package/dist/workflows/run.d.ts +10 -50
  43. package/dist/workflows/run.js +103 -216
  44. package/dist/workflows/run.js.map +1 -1
  45. package/dist/workspace/config.d.ts +0 -30
  46. package/dist/workspace/config.js +0 -5
  47. package/dist/workspace/config.js.map +1 -1
  48. package/dist/workspace/projects-cli.d.ts +0 -2
  49. package/dist/workspace/projects-cli.js +4 -21
  50. package/dist/workspace/projects-cli.js.map +1 -1
  51. package/dist/workspace/projects.d.ts +1 -5
  52. package/dist/workspace/projects.js +8 -5
  53. package/dist/workspace/projects.js.map +1 -1
  54. package/dist/workspace/semaphore.d.ts +2 -53
  55. package/dist/workspace/semaphore.js +5 -93
  56. package/dist/workspace/semaphore.js.map +1 -1
  57. package/package.json +1 -1
  58. package/web/dist/assets/centered-state-zzWBfO_1.js +43 -0
  59. package/web/dist/assets/command-ylf8-fG0.js +1 -0
  60. package/web/dist/assets/compare-variants-BcR3zdtB.js +1 -0
  61. package/web/dist/assets/dialog-BYr_BAil.js +1 -0
  62. package/web/dist/assets/diff-view-DPCR7gon.js +4 -0
  63. package/web/dist/assets/{dist-CqH67S8q.js → dist-Cw_CDvC3.js} +1 -1
  64. package/web/dist/assets/dropdown-menu-C3GD8eLA.js +1 -0
  65. package/web/dist/assets/git-toolbar-CiMaCi03.js +1 -0
  66. package/web/dist/assets/github-BJEZbEOp.js +1 -0
  67. package/web/dist/assets/index-DmW_TYjO.js +16 -0
  68. package/web/dist/assets/index-Qbs-JRWQ.css +2 -0
  69. package/web/dist/assets/loader-circle-CGwIVNTv.js +1 -0
  70. package/web/dist/assets/{project-router-BaWVyqc8.js → project-router-CT8Rt5Eu.js} +1 -1
  71. package/web/dist/assets/prompt-templates-DW7_d8Ys.js +15 -0
  72. package/web/dist/assets/repo-git-BkmyKcvN.js +1 -0
  73. package/web/dist/assets/{run-diff-Cksr4Dk5.js → run-diff-CxIDdRwy.js} +2 -2
  74. package/web/dist/assets/run-header-8nwDIWWO.js +1 -0
  75. package/web/dist/assets/skill-empty-hint-Cl3ESoPu.js +1 -0
  76. package/web/dist/assets/skills-BIpb0mqO.js +1 -0
  77. package/web/dist/assets/{tab-link-vtgjgL_M.js → tab-link-C_bk_Kvn.js} +1 -1
  78. package/web/dist/assets/task-changes-D1bJx2uW.js +1 -0
  79. package/web/dist/assets/task-commits-DlhB21mR.js +1 -0
  80. package/web/dist/assets/task-files-ChJDOFg5.js +2 -0
  81. package/web/dist/assets/task-thread-J7ckxJJh.js +9 -0
  82. package/web/dist/assets/tasks-table--V1pKwuK.js +1 -0
  83. package/web/dist/assets/use-desktop-CuDnWju1.js +3 -0
  84. package/web/dist/assets/workflows-BksgdYAQ.js +11 -0
  85. package/web/dist/assets/x-DgoqYQOJ.js +1 -0
  86. package/web/dist/index.html +12 -6
  87. package/dist/core/v1-text-coalescer.d.ts +0 -36
  88. package/dist/core/v1-text-coalescer.js +0 -72
  89. package/dist/core/v1-text-coalescer.js.map +0 -1
  90. package/web/dist/assets/centered-state-CLmJ67EV.js +0 -43
  91. package/web/dist/assets/commit-list-CSaWuw-x.js +0 -1
  92. package/web/dist/assets/compare-variants-B5BlnpUb.js +0 -1
  93. package/web/dist/assets/diff-view-CYKPGL2w.js +0 -6
  94. package/web/dist/assets/git-toolbar-CDII-3Uv.js +0 -1
  95. package/web/dist/assets/github-C7SNDPf3.js +0 -1
  96. package/web/dist/assets/index-CcfkF2Ey.js +0 -30
  97. package/web/dist/assets/index-DzroxqBG.css +0 -2
  98. package/web/dist/assets/lib-DPEZDBUN.js +0 -1
  99. package/web/dist/assets/repo-git-4l-2tm7d.js +0 -1
  100. package/web/dist/assets/run-header-B3kW2sWC.js +0 -1
  101. package/web/dist/assets/skill-empty-hint-DTUSp6Vl.js +0 -1
  102. package/web/dist/assets/skills-D7hPgl4y.js +0 -1
  103. package/web/dist/assets/task-changes-DvIUGL9a.js +0 -1
  104. package/web/dist/assets/task-commits-QD2JI3zj.js +0 -1
  105. package/web/dist/assets/task-files-BE7JDEwK.js +0 -2
  106. package/web/dist/assets/task-thread-CRjuPhsl.js +0 -9
  107. package/web/dist/assets/textarea-Bj_LCreg.js +0 -1
  108. package/web/dist/assets/use-desktop-4e8LLqMG.js +0 -3
  109. package/web/dist/assets/workflows-bPYx0nbO.js +0 -11
@@ -33,29 +33,14 @@ export interface WorkspaceResourceLimits {
33
33
  maxParallel: number;
34
34
  /** Per-task process-tree memory ceiling in MiB; null = no limit. */
35
35
  memoryLimitMb: number | null;
36
- /**
37
- * Per-project concurrency ceilings, keyed by realpath-normalized project
38
- * root (the registry stores normalized `root`). A root absent from the map
39
- * inherits the workspace `maxParallel`. Optional so older `load` stubs that
40
- * only return the resource slice keep working — an absent map means "no
41
- * project has an override", i.e. every project inherits.
42
- */
43
- projectLimits?: ReadonlyMap<string, number>;
44
36
  }
45
37
  /** One manager's seam into the shared counter. */
46
38
  export interface SemaphoreParticipant {
47
39
  /** Slots this manager currently holds. The #347 exemption lives in the
48
40
  * participant's own accounting: `waiting` runs are already subtracted. */
49
41
  busySlots(): number;
50
- /** Kick the manager's queue — capacity may have appeared. Awaited by
51
- * `release()` so the manager taking a freed slot has registered it before
52
- * the next participant evaluates capacity. */
53
- pump(): void | Promise<void>;
54
- /** Epoch ms of this manager's oldest queued run, or null when its queue is
55
- * empty — `release()`'s ordering key, so a freed slot goes to the
56
- * workspace's longest-waiting run instead of whichever manager happens to
57
- * have registered first. */
58
- oldestQueuedAt(): number | null;
42
+ /** Kick the manager's queue — capacity may have appeared. */
43
+ pump(): void;
59
44
  }
60
45
  export interface WorkspaceSemaphoreOptions {
61
46
  /** Snapshot source for `refresh()` — tests inject a stub; production keeps
@@ -70,11 +55,6 @@ export declare class WorkspaceSemaphore {
70
55
  private readonly participants;
71
56
  private readonly load;
72
57
  private limits;
73
- /** A `release()` sweep is in flight — see `pendingRelease`. */
74
- private broadcasting;
75
- /** A slot freed DURING a sweep. The in-flight sweep may already have pumped
76
- * the manager that should get it, so re-run rather than drop the wakeup. */
77
- private pendingRelease;
78
58
  constructor(options?: WorkspaceSemaphoreOptions);
79
59
  /** Join the shared counter. Returns the unregister handle — the manager's
80
60
  * `dispose()` must call it so a torn-down project stops counting. */
@@ -86,37 +66,6 @@ export declare class WorkspaceSemaphore {
86
66
  maxParallel(): number;
87
67
  /** Cached per-task memory ceiling (MiB), or null for no limit. */
88
68
  memoryLimitMb(): number | null;
89
- /**
90
- * A slot came free somewhere in the workspace: pump EVERY manager,
91
- * longest-waiting-queue first.
92
- *
93
- * This is the counterpart to `busy()` being workspace-wide. A `RunManager`
94
- * only ever pumps itself, so before this existed a freed slot reached
95
- * exactly one project's queue: a run queued in project B stayed `queued`
96
- * while project A's runs came and went, until B happened to start or finish
97
- * a run of its own (or someone saved the workspace config). Every
98
- * slot-freeing transition — a run settling, a session parking at `waiting`
99
- * — routes here instead.
100
- *
101
- * Pumps are awaited in turn so the manager that takes the slot has it
102
- * counted (`starting`) before the next manager evaluates capacity — two
103
- * managers pumping concurrently could both read the same free slot and
104
- * overshoot `maxParallel`. Ordering is best-effort fairness, not a global
105
- * FIFO gate: a manager whose head-of-queue can't start (non-git root,
106
- * spec 006 degradation) must never block the rest of the workspace.
107
- */
108
- release(): Promise<void>;
109
- /**
110
- * The effective per-project concurrency cap for a manager's repo root: the
111
- * project's own `maxParallel` if set in the registry, else the workspace cap
112
- * (`maxParallel()`). Answered from the cached snapshot — the class's
113
- * no-per-tick-file-read invariant is preserved; the only syscall is a
114
- * `realpathSync` to key the lookup the same way the registry normalizes
115
- * `root` (once per `pump()`, alongside the existing `getRepoInfo` stat). A
116
- * root with no registry entry (an ad-hoc run outside the registry) has no
117
- * override and inherits the workspace cap.
118
- */
119
- projectMaxParallel(repoRoot: string): number;
120
69
  /**
121
70
  * The workspace resource-cache hook: re-read the config and pump every
122
71
  * registered manager, so a config change takes effect without a restart.
@@ -1,46 +1,15 @@
1
- import { realpathSync } from 'node:fs';
2
- import { resolve } from 'node:path';
3
1
  import { loadWorkspaceConfig } from './config.js';
4
- /** Realpath-normalize a root the same way the registry does
5
- * (`workspace/projects.ts` `normalizeRoot`), but synchronously — this answers
6
- * a manager's hot-path lookup and must not `await`. A path that cannot be
7
- * realpath'd degrades to `resolve()`, matching the registry's own fallback. */
8
- function normalizeRootSync(root) {
9
- try {
10
- return realpathSync(root);
11
- }
12
- catch {
13
- return resolve(root);
14
- }
15
- }
16
2
  const DEFAULT_LIMITS = { maxParallel: 2, memoryLimitMb: null };
17
3
  /** Production loader: the `resources` slice of `~/.cezar/config.json`
18
- * (schema-defaulted, so a missing/corrupt file yields the zero-config 2/null),
19
- * plus the per-project `maxParallel` overrides built into a root→limit map.
20
- * The registry `root` is already realpath-normalized (`registerProject`), so
21
- * the keys match `normalizeRootSync`'s output at lookup time. */
4
+ * (schema-defaulted, so a missing/corrupt file yields the zero-config 2/null). */
22
5
  async function loadResourceLimits() {
23
- const { resources, projects } = await loadWorkspaceConfig();
24
- const projectLimits = new Map();
25
- for (const project of projects) {
26
- if (typeof project.maxParallel === 'number')
27
- projectLimits.set(project.root, project.maxParallel);
28
- }
29
- return {
30
- maxParallel: resources.maxParallel,
31
- memoryLimitMb: resources.memoryLimitMb,
32
- projectLimits,
33
- };
6
+ const { resources } = await loadWorkspaceConfig();
7
+ return { maxParallel: resources.maxParallel, memoryLimitMb: resources.memoryLimitMb };
34
8
  }
35
9
  export class WorkspaceSemaphore {
36
10
  participants = new Set();
37
11
  load;
38
12
  limits;
39
- /** A `release()` sweep is in flight — see `pendingRelease`. */
40
- broadcasting = false;
41
- /** A slot freed DURING a sweep. The in-flight sweep may already have pumped
42
- * the manager that should get it, so re-run rather than drop the wakeup. */
43
- pendingRelease = false;
44
13
  constructor(options = {}) {
45
14
  this.load = options.load ?? loadResourceLimits;
46
15
  this.limits = { ...DEFAULT_LIMITS, ...options.initial };
@@ -67,63 +36,6 @@ export class WorkspaceSemaphore {
67
36
  memoryLimitMb() {
68
37
  return this.limits.memoryLimitMb;
69
38
  }
70
- /**
71
- * A slot came free somewhere in the workspace: pump EVERY manager,
72
- * longest-waiting-queue first.
73
- *
74
- * This is the counterpart to `busy()` being workspace-wide. A `RunManager`
75
- * only ever pumps itself, so before this existed a freed slot reached
76
- * exactly one project's queue: a run queued in project B stayed `queued`
77
- * while project A's runs came and went, until B happened to start or finish
78
- * a run of its own (or someone saved the workspace config). Every
79
- * slot-freeing transition — a run settling, a session parking at `waiting`
80
- * — routes here instead.
81
- *
82
- * Pumps are awaited in turn so the manager that takes the slot has it
83
- * counted (`starting`) before the next manager evaluates capacity — two
84
- * managers pumping concurrently could both read the same free slot and
85
- * overshoot `maxParallel`. Ordering is best-effort fairness, not a global
86
- * FIFO gate: a manager whose head-of-queue can't start (non-git root,
87
- * spec 006 degradation) must never block the rest of the workspace.
88
- */
89
- async release() {
90
- if (this.broadcasting) {
91
- this.pendingRelease = true;
92
- return;
93
- }
94
- this.broadcasting = true;
95
- try {
96
- do {
97
- this.pendingRelease = false;
98
- const ordered = [...this.participants]
99
- .map((participant) => ({
100
- participant,
101
- // Empty queues sort last — they have nothing to claim the slot with.
102
- since: participant.oldestQueuedAt() ?? Number.MAX_SAFE_INTEGER,
103
- }))
104
- .sort((a, b) => a.since - b.since);
105
- for (const { participant } of ordered)
106
- await participant.pump();
107
- } while (this.pendingRelease);
108
- }
109
- finally {
110
- this.broadcasting = false;
111
- }
112
- }
113
- /**
114
- * The effective per-project concurrency cap for a manager's repo root: the
115
- * project's own `maxParallel` if set in the registry, else the workspace cap
116
- * (`maxParallel()`). Answered from the cached snapshot — the class's
117
- * no-per-tick-file-read invariant is preserved; the only syscall is a
118
- * `realpathSync` to key the lookup the same way the registry normalizes
119
- * `root` (once per `pump()`, alongside the existing `getRepoInfo` stat). A
120
- * root with no registry entry (an ad-hoc run outside the registry) has no
121
- * override and inherits the workspace cap.
122
- */
123
- projectMaxParallel(repoRoot) {
124
- const override = this.limits.projectLimits?.get(normalizeRootSync(repoRoot));
125
- return override ?? this.maxParallel();
126
- }
127
39
  /**
128
40
  * The workspace resource-cache hook: re-read the config and pump every
129
41
  * registered manager, so a config change takes effect without a restart.
@@ -138,8 +50,8 @@ export class WorkspaceSemaphore {
138
50
  catch {
139
51
  // keep the last good snapshot
140
52
  }
141
- // A raised cap is capacity appearing everywhere at once — same sweep.
142
- await this.release();
53
+ for (const participant of [...this.participants])
54
+ participant.pump();
143
55
  }
144
56
  }
145
57
  //# sourceMappingURL=semaphore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"semaphore.js","sourceRoot":"","sources":["../../src/workspace/semaphore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAgDlD;;;gFAGgF;AAChF,SAAS,iBAAiB,CAAC,IAAY;IACrC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAkBD,MAAM,cAAc,GAA4B,EAAE,WAAW,EAAE,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AAExF;;;;kEAIkE;AAClE,KAAK,UAAU,kBAAkB;IAC/B,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,mBAAmB,EAAE,CAAC;IAC5D,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAChD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,QAAQ;YAAE,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACpG,CAAC;IACD,OAAO;QACL,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,aAAa,EAAE,SAAS,CAAC,aAAa;QACtC,aAAa;KACd,CAAC;AACJ,CAAC;AAYD,MAAM,OAAO,kBAAkB;IACZ,YAAY,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC/C,IAAI,CAAyC;IACtD,MAAM,CAA0B;IACxC,+DAA+D;IACvD,YAAY,GAAG,KAAK,CAAC;IAC7B;iFAC6E;IACrE,cAAc,GAAG,KAAK,CAAC;IAE/B,YAAY,OAAO,GAA8B,EAAE;QACjD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,kBAAkB,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1D,CAAC;IAED;0EACsE;IACtE,QAAQ,CAAC,WAAiC;QACxC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACnC,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;IAED;6CACyC;IACzC,IAAI;QACF,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,YAAY;YAAE,KAAK,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC;QAC9E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0CAA0C;IAC1C,WAAW;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACjC,CAAC;IAED,kEAAkE;IAClE,aAAa;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;IACnC,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;YAC3B,OAAO;QACT,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC;YACH,GAAG,CAAC;gBACF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;gBAC5B,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;qBACnC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;oBACrB,WAAW;oBACX,qEAAqE;oBACrE,KAAK,EAAE,WAAW,CAAC,cAAc,EAAE,IAAI,MAAM,CAAC,gBAAgB;iBAC/D,CAAC,CAAC;qBACF,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;gBACrC,KAAK,MAAM,EAAE,WAAW,EAAE,IAAI,OAAO;oBAAE,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;YAClE,CAAC,QAAQ,IAAI,CAAC,cAAc,EAAE;QAChC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC5B,CAAC;IACH,CAAC;IAED;;;;;;;;;OASG;IACH,kBAAkB,CAAC,QAAgB;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7E,OAAO,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,8BAA8B;QAChC,CAAC;QACD,sEAAsE;QACtE,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;CACF"}
1
+ {"version":3,"file":"semaphore.js","sourceRoot":"","sources":["../../src/workspace/semaphore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAiDlD,MAAM,cAAc,GAA4B,EAAE,WAAW,EAAE,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AAExF;mFACmF;AACnF,KAAK,UAAU,kBAAkB;IAC/B,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,mBAAmB,EAAE,CAAC;IAClD,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,aAAa,EAAE,CAAC;AACxF,CAAC;AAYD,MAAM,OAAO,kBAAkB;IACZ,YAAY,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC/C,IAAI,CAAyC;IACtD,MAAM,CAA0B;IAExC,YAAY,OAAO,GAA8B,EAAE;QACjD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,kBAAkB,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1D,CAAC;IAED;0EACsE;IACtE,QAAQ,CAAC,WAAiC;QACxC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACnC,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;IAED;6CACyC;IACzC,IAAI;QACF,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,YAAY;YAAE,KAAK,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC;QAC9E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0CAA0C;IAC1C,WAAW;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACjC,CAAC;IAED,kEAAkE;IAClE,aAAa;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;IACnC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,8BAA8B;QAChC,CAAC;QACD,KAAK,MAAM,WAAW,IAAI,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;YAAE,WAAW,CAAC,IAAI,EAAE,CAAC;IACvE,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/cezar",
3
- "version": "0.9.0-pr646.708",
3
+ "version": "0.9.0",
4
4
  "description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,43 @@
1
+ import{a as e,i as t,o as n,r,s as i,u as a}from"./bundle-mjs-BegPhL5c.js";import{a as o,o as s,t as c}from"./utils-B8s5qIcK.js";var l=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},u=new class extends l{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){return typeof e==`function`?e(t):e}function x(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==C(o,t.options))return!1}else if(!T(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function S(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(w(t.options.mutationKey)!==w(a))return!1}else if(!T(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function C(e,t){return(t?.queryKeyHashFn||w)(e)}function w(e){return JSON.stringify(e,(e,t)=>re(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function T(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>T(e[n],t[n])):!1}var ee=Object.prototype.hasOwnProperty;function te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ne(e)&&ne(t);if(!r&&!(re(e)&&re(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function E(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function re(e){if(!ie(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ie(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ie(e){return Object.prototype.toString.call(e)===`[object Object]`}function ae(e){return new Promise(t=>{f.setTimeout(t,e)})}function oe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:te(e,t)}function se(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ce(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var le=Symbol();function ue(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===le?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function de(e,t){return typeof e==`function`?e(...t):!!e}function fe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var pe=(()=>{let e=()=>m;return{isServer(){return e()},setIsServer(t){e=t}}})();function me(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var he=p;function ge(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=he,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var D=ge(),_e=new class extends l{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ve(e){return Math.min(1e3*2**e,3e4)}function ye(e){return(e??`online`)!==`online`||_e.isOnline()}var be=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function xe(e){let t=!1,n=0,r,i=me(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new be(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>u.isFocused()&&(e.networkMode===`always`||_e.isOnline())&&e.canRun(),d=()=>ye(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(pe.isServer()?0:3),o=e.retryDelay??ve,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ae(s).then(()=>l()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:d,start:()=>(d()?h():m().then(h),i)}}var Se=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pe.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}};function Ce(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{fe(e,()=>t.signal,()=>n=!0)},u=ue(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ce:se;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Te:we,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:we(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function we(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Te(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ee=class extends Se{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ke(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ke(this.options);e.data!==void 0&&(this.setState(Oe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=oe(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>b(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===le||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>y(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ue(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ce(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=xe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof be&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof be){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...De(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Oe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),D.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function De(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ye(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Oe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ke(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ae=class extends l{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=me(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Me(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ne(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ne(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof b(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!E(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Pe(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ie(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(h)),t}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(pe.isServer()||this.#r.isStale||!_(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#d=f.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(pe.isServer()||b(this.options.enabled,this.#t)===!1||!_(this.#p)||this.#p===0)&&(this.#f=f.setInterval(()=>{(this.options.refetchIntervalInBackground||u.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(f.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(f.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Me(e,t),o=i&&Pe(e,n,t,r);(a||o)&&(l={...l,...De(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=oe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=oe(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:Fe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:b(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=me();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!E(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){D.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function je(e,t){return b(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&b(t.retryOnMount,e)===!1)}function Me(e,t){return je(e,t)||e.state.data!==void 0&&Ne(e,t,t.refetchOnMount)}function Ne(e,t,n){if(b(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Fe(e,t)}return!1}function Pe(e,t,n,r){return(e!==t||b(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Fe(e,n)}function Fe(e,t){return b(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}function Ie(e,t){return!E(e.getCurrentResult(),t)}var Le=class extends Se{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Re(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=xe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),D.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Re(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ze=class extends l{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),E(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&w(t.mutationKey)!==w(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Re();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){D.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},O=a(i(),1),k=e(),Be=O.createContext(void 0),A=e=>{let t=O.useContext(Be);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ve=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,k.jsx)(Be.Provider,{value:e,children:t})),He=O.createContext(!1),Ue=()=>O.useContext(He);He.Provider;function We(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ge=O.createContext(We()),Ke=()=>O.useContext(Ge),qe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?de(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Je=e=>{O.useEffect(()=>{e.clearReset()},[e])},Ye=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||de(n,[e.error,r])),Xe=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ze=(e,t)=>e.isLoading&&e.isFetching&&!t,Qe=(e,t)=>e?.suspense&&t.isPending,$e=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function et(e,t,n){let r=Ue(),i=Ke(),a=A(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Xe(o),qe(o,i,s),Je(i);let l=!a.getQueryCache().get(o.queryHash),[u]=O.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(O.useSyncExternalStore(O.useCallback(e=>{let t=f?u.subscribe(D.batchCalls(e)):h;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),O.useEffect(()=>{u.setOptions(o)},[o,u]),Qe(o,d))throw $e(o,u,i);if(Ye({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!pe.isServer()&&Ze(d,r)&&(l?$e(o,u,i):s?.promise)?.catch(h).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function j(e,t){return et(e,Ae,t)}function M(e,t){let n=A(t),[r]=O.useState(()=>new ze(n,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);let i=O.useSyncExternalStore(O.useCallback(e=>r.subscribe(D.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=O.useCallback((e,t)=>{r.mutate(e,t).catch(h)},[r]);if(i.error&&de(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var tt=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,nt=/^[\\/]{2}/;function rt(e,t){return t+e.replace(/\\/g,`/`)}var it=`popstate`;function at(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function ot(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return lt(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:ut(t)}return dt(t,n,null,e)}function N(e,t){if(e===!1||e==null)throw Error(t)}function P(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function st(){return Math.random().toString(36).substring(2,10)}function ct(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function lt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?F(t):t,state:n,key:t&&t.key||r||st(),mask:i}}function ut({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function F(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function dt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=at(e)?e:lt(h.location,e,t);n&&n(r,e),l=u()+1;let d=ct(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=at(e)?e:lt(h.location,e,t);n&&n(r,e),l=u();let i=ct(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ft(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(it,d),c=e,()=>{i.removeEventListener(it,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ft(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),N(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:ut(t);return i=i.replace(/ $/,`%20`),!n&&nt.test(i)&&(i=r+i),new URL(i,r)}function pt(e,t,n=`/`){return mt(e,t,n,!1)}function mt(e,t,n,r,i){let a=I((typeof t==`string`?F(t):t).pathname||`/`,n);if(a==null)return null;let o=i??gt(e),s=null,c=Nt(a);for(let e=0;s==null&&e<o.length;++e)s=kt(o[e],c,r);return s}function ht(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function gt(e){let t=_t(e);return yt(t),t}function _t(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;N(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=L([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(N(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),_t(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Dt(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Mt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of vt(e.path))a(e,t,!0,n)}),t}function vt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=vt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function yt(e){e.sort((e,t)=>e.score===t.score?Ot(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var bt=/^:[\w-]+$/,xt=3,St=2,Ct=1,wt=10,Tt=-2,Et=e=>e===`*`;function Dt(e,t){let n=e.split(`/`),r=n.length;return n.some(Et)&&(r+=Tt),t&&(r+=St),n.filter(e=>!Et(e)).reduce((e,t)=>e+(bt.test(t)?xt:t===``?Ct:wt),r)}function Ot(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function kt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?jt(u,l,s.matcher,s.compiledParams):At(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=At({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:L([a,d.pathname]),pathnameBase:Ht(L([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=L([a,d.pathnameBase]))}return o}function At(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Mt(e.path,e.caseSensitive,e.end);return jt(e,t,n,r)}function jt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Mt(e,t=!1,n=!0){P(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Nt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return P(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function I(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Pt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?F(e):e,a;return n?(n=Bt(n),a=n.startsWith(`/`)?Ft(n.substring(1),`/`):Ft(n,t)):a=t,{pathname:a,search:Ut(r),hash:Wt(i)}}function Ft(e,t){let n=Vt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function It(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Lt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Rt(e){let t=Lt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function zt(e,t,n,r=!1){let i;typeof e==`string`?i=F(e):(i={...e},N(!i.pathname||!i.pathname.includes(`?`),It(`?`,`pathname`,`search`,i)),N(!i.pathname||!i.pathname.includes(`#`),It(`#`,`pathname`,`hash`,i)),N(!i.search||!i.search.includes(`#`),It(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Pt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Bt=e=>e.replace(/[\\/]{2,}/g,`/`),L=e=>Bt(e.join(`/`)),Vt=e=>e.replace(/\/+$/,``),Ht=e=>Vt(e).replace(/^\/*/,`/`),Ut=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Wt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Gt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Kt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function qt(e){return L(e.map(e=>e.route.path).filter(Boolean))||`/`}var Jt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Yt(e,t){let n=e;if(typeof n!=`string`||!tt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Jt)try{let e=new URL(window.location.href),r=nt.test(n)?new URL(rt(n,e.protocol)):new URL(n),a=I(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{P(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Xt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Xt);var Zt=[`GET`,...Xt];new Set(Zt);var Qt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function $t(e){try{return Qt.includes(new URL(e).protocol)}catch{return!1}}var R=O.createContext(null);R.displayName=`DataRouter`;var en=O.createContext(null);en.displayName=`DataRouterState`;var tn=O.createContext(!1);function nn(){return O.useContext(tn)}var rn=O.createContext({isTransitioning:!1});rn.displayName=`ViewTransition`;var an=O.createContext(new Map);an.displayName=`Fetchers`;var on=O.createContext(null);on.displayName=`Await`;var z=O.createContext(null);z.displayName=`Navigation`;var sn=O.createContext(null);sn.displayName=`Location`;var B=O.createContext({outlet:null,matches:[],isDataRoute:!1});B.displayName=`Route`;var cn=O.createContext(null);cn.displayName=`RouteError`;var ln=`REACT_ROUTER_ERROR`,un=`REDIRECT`,dn=`ROUTE_ERROR_RESPONSE`;function fn(e){if(e.startsWith(`${ln}:${un}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function pn(e){if(e.startsWith(`${ln}:${dn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Gt(t.status,t.statusText,t.data)}catch{}}function mn(e,{relative:t}={}){N(V(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=O.useContext(z),{hash:i,pathname:a,search:o}=Sn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:L([n,a])),r.createHref({pathname:s,search:o,hash:i})}function V(){return O.useContext(sn)!=null}function H(){return N(V(),`useLocation() may be used only in the context of a <Router> component.`),O.useContext(sn).location}var hn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function gn(e){O.useContext(z).static||O.useLayoutEffect(e)}function _n(){let{isDataRoute:e}=O.useContext(B);return e?Vn():vn()}function vn(){N(V(),`useNavigate() may be used only in the context of a <Router> component.`);let e=O.useContext(R),{basename:t,navigator:n}=O.useContext(z),{matches:r}=O.useContext(B),{pathname:i}=H(),a=JSON.stringify(Rt(r)),o=O.useRef(!1);return gn(()=>{o.current=!0}),O.useCallback((r,s={})=>{if(P(o.current,hn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=zt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:L([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var yn=O.createContext(null);function bn(e){let t=O.useContext(B).outlet;return O.useMemo(()=>t&&O.createElement(yn.Provider,{value:e},t),[t,e])}function xn(){let{matches:e}=O.useContext(B);return e[e.length-1]?.params??{}}function Sn(e,{relative:t}={}){let{matches:n}=O.useContext(B),{pathname:r}=H(),i=JSON.stringify(Rt(n));return O.useMemo(()=>zt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Cn(e,t){return wn(e,t)}function wn(e,t,n){N(V(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=O.useContext(z),{matches:i}=O.useContext(B),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Un(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
+
3
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=H(),d;if(t){let e=typeof t==`string`?F(t):t;N(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):pt(e,{pathname:p});P(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),P(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=jn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:L([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:L([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?O.createElement(sn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Tn(){let e=Bn(),t=Kt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=O.createElement(O.Fragment,null,O.createElement(`p`,null,`💿 Hey developer 👋`),O.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,O.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,O.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),O.createElement(O.Fragment,null,O.createElement(`h2`,null,`Unexpected Application Error!`),O.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?O.createElement(`pre`,{style:i},n):null,o)}var En=O.createElement(Tn,null),Dn=class extends O.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=pn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:O.createElement(B.Provider,{value:this.props.routeContext},O.createElement(cn.Provider,{value:e,children:this.props.component}));return this.context?O.createElement(kn,{error:e},t):t}};Dn.contextType=tn;var On=new WeakMap;function kn({children:e,error:t}){let{basename:n}=O.useContext(z);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=fn(t.digest);if(e){let r=On.get(t);if(r)throw r;let i=Yt(e.location,n),a=i.absoluteURL||i.to;if($t(a))throw Error(`Invalid redirect location`);if(Jt&&!On.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw On.set(t,n),n}return O.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function An({routeContext:e,match:t,children:n}){let r=O.useContext(R);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),O.createElement(B.Provider,{value:e},n)}function jn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);N(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:qt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||En,o&&(s<0&&c===0?(Un(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?O.createElement(n.route.Component,null):n.route.element?n.route.element:e,O.createElement(An,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?O.createElement(Dn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Mn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Nn(e){let t=O.useContext(R);return N(t,Mn(e)),t}function Pn(e){let t=O.useContext(en);return N(t,Mn(e)),t}function Fn(e){let t=O.useContext(B);return N(t,Mn(e)),t}function In(e){let t=Fn(e),n=t.matches[t.matches.length-1];return N(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ln(){return In(`useRouteId`)}function Rn(){let e=Pn(`useNavigation`);return O.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function zn(){let{matches:e,loaderData:t}=Pn(`useMatches`);return O.useMemo(()=>e.map(e=>ht(e,t)),[e,t])}function Bn(){let e=O.useContext(cn),t=Pn(`useRouteError`),n=In(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Vn(){let{router:e}=Nn(`useNavigate`),t=In(`useNavigate`),n=O.useRef(!1);return gn(()=>{n.current=!0}),O.useCallback(async(r,i={})=>{P(n.current,hn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Hn={};function Un(e,t,n){!t&&!Hn[e]&&(Hn[e]=!0,P(!1,n))}O.memo(Wn);function Wn({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return wn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Gn({to:e,replace:t,state:n,relative:r}){N(V(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=O.useContext(z);P(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=O.useContext(B),{pathname:o}=H(),s=_n(),c=zt(e,Rt(a),o,r===`path`),l=JSON.stringify(c);return O.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Kn(e){return bn(e.context)}function qn(e){N(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Jn({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){N(!V(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=O.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=F(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=O.useMemo(()=>{let e=I(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return P(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:O.createElement(z.Provider,{value:c},O.createElement(sn.Provider,{children:t,value:h}))}function Yn({children:e,location:t}){return Cn(Xn(e),t)}O.Component;function Xn(e,t=[]){let n=[];return O.Children.forEach(e,(e,r)=>{if(!O.isValidElement(e))return;let i=[...t,r];if(e.type===O.Fragment){n.push.apply(n,Xn(e.props.children,i));return}N(e.type===qn,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),N(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Xn(e.props.children,i)),n.push(a)}),n}var Zn=`get`,Qn=`application/x-www-form-urlencoded`;function $n(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function er(e){return $n(e)&&e.tagName.toLowerCase()===`button`}function tr(e){return $n(e)&&e.tagName.toLowerCase()===`form`}function nr(e){return $n(e)&&e.tagName.toLowerCase()===`input`}function rr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ir(e,t){return e.button===0&&(!t||t===`_self`)&&!rr(e)}function ar(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function or(e,t){let n=ar(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var sr=null;function cr(){if(sr===null)try{new FormData(document.createElement(`form`),0),sr=!1}catch{sr=!0}return sr}var lr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ur(e){return e!=null&&!lr.has(e)?(P(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Qn}"`),null):e}function dr(e,t){let n,r,i,a,o;if(tr(e)){let o=e.getAttribute(`action`);r=o?I(o,t):null,n=e.getAttribute(`method`)||Zn,i=ur(e.getAttribute(`enctype`))||Qn,a=new FormData(e)}else if(er(e)||nr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?I(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Zn,i=ur(e.getAttribute(`formenctype`))||ur(o.getAttribute(`enctype`))||Qn,a=new FormData(o,e),!cr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if($n(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Zn,r=null,i=Qn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var fr={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},pr=/[&><\u2028\u2029]/g;function mr(e){return e.replace(pr,e=>fr[e])}function hr(e,t){if(e===!1||e==null)throw Error(t)}function gr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&I(i.pathname,t)===`/`?i.pathname=`${Vt(t)}/_root.${r}`:i.pathname=`${Vt(i.pathname)}.${r}`,i}async function _r(e,n){if(e.id in n)return n[e.id];try{let r=await t(()=>import(e.module),[]);return n[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function vr(e){return e!=null&&typeof e.page==`string`}function yr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function br(e,t,n){return Tr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await _r(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(yr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function xr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Sr(e,t,{includeHydrateFallback:n}={}){return Cr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Cr(e){return[...new Set(e)]}function wr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Tr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!vr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(wr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Er(){let e=O.useContext(R);return hr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Dr(){let e=O.useContext(en);return hr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Or=O.createContext(void 0);Or.displayName=`FrameworkContext`;function kr(){let e=O.useContext(Or);return hr(e,`You must render this element inside a <HydratedRouter> element`),e}function Ar(e,t){let n=O.useContext(Or),[r,i]=O.useState(!1),[a,o]=O.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=O.useRef(null);O.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),O.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:jr(s,p),onBlur:jr(c,m),onMouseEnter:jr(l,p),onMouseLeave:jr(u,m),onTouchStart:jr(d,p)}]:[a,f,{}]:[!1,f,{}]}function jr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Mr({page:e,...t}){let n=nn(),{nonce:r}=kr(),{router:i}=Er(),a=O.useMemo(()=>pt(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?O.createElement(Pr,{page:e,matches:a,...t}):O.createElement(Fr,{page:e,matches:a,...t})):null}function Nr(e){let{manifest:t,routeModules:n}=kr(),[r,i]=O.useState([]);return O.useEffect(()=>{let r=!1;return br(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Pr({page:e,matches:t,...n}){let r=H(),{future:i}=kr(),{basename:a}=Er(),o=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=gr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return O.createElement(O.Fragment,null,o.map(e=>O.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Fr({page:e,matches:t,...n}){let r=H(),{future:i,manifest:a,routeModules:o}=kr(),{basename:s}=Er(),{loaderData:c,matches:l}=Dr(),u=O.useMemo(()=>xr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=O.useMemo(()=>xr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=gr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=O.useMemo(()=>Sr(d,a),[d,a]),m=Nr(d);return O.createElement(O.Fragment,null,f.map(e=>O.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>O.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>O.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ir(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}O.Component;var Lr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Lr&&(window.__reactRouterVersion=`7.18.1`)}catch{}function Rr({basename:e,children:t,useTransitions:n,window:r}){let i=O.useRef();i.current??=ot({window:r,v5Compat:!0});let a=i.current,[o,s]=O.useState({action:a.action,location:a.location}),c=O.useCallback(e=>{n===!1?s(e):O.startTransition(()=>s(e))},[n]);return O.useLayoutEffect(()=>a.listen(c),[a,c]),O.createElement(Jn,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function zr({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=O.useState({action:n.action,location:n.location}),o=O.useCallback(e=>{r===!1?a(e):O.startTransition(()=>a(e))},[r]);return O.useLayoutEffect(()=>n.listen(o),[n,o]),O.createElement(Jn,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}zr.displayName=`unstable_HistoryRouter`;var Br=O.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=O.useContext(z),v=typeof l==`string`&&tt.test(l),y=Yt(l,h);l=y.to;let b=mn(l,{relative:r}),x=H(),S=null;if(o){let e=zt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:L([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=Ar(n,p),ee=qr(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function te(t){e&&e(t),t.defaultPrevented||ee(t)}let E=!(y.isExternal||i),ne=O.createElement(`a`,{...p,...T,href:(E?S:void 0)||y.absoluteURL||b,onClick:E?te:e,ref:Ir(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?O.createElement(O.Fragment,null,ne,O.createElement(Mr,{page:b})):ne});Br.displayName=`Link`;var Vr=O.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Sn(a,{relative:c.relative}),d=H(),f=O.useContext(en),{navigator:p,basename:m}=O.useContext(z),h=f!=null&&ii(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=I(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return O.createElement(Br,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Vr.displayName=`NavLink`;var Hr=O.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Zn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=O.useContext(z),g=Zr(),_=Qr(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&tt.test(s);return O.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?O.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Hr.displayName=`Form`;function Ur({getKey:e,storageKey:t,...n}){let r=O.useContext(Or),{basename:i}=O.useContext(z),a=H(),o=zn();ni({getKey:e,storageKey:t});let s=O.useMemo(()=>{if(!r||!e)return null;let t=ti(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),O.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${mr(JSON.stringify(t||$r))}, ${mr(JSON.stringify(s))})`}})}Ur.displayName=`ScrollRestoration`;function Wr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gr(e){let t=O.useContext(R);return N(t,Wr(e)),t}function Kr(e){let t=O.useContext(en);return N(t,Wr(e)),t}function qr(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=_n(),d=H(),f=Sn(e,{relative:o});return O.useCallback(p=>{if(ir(p,t)){p.preventDefault();let t=n===void 0?ut(d)===ut(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?O.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Jr(e){P(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=O.useRef(ar(e)),n=O.useRef(!1),r=H(),i=O.useMemo(()=>or(r.search,n.current?null:t.current),[r.search]),a=_n();return[i,O.useCallback((e,t)=>{let r=ar(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Yr=0,Xr=()=>`__${String(++Yr)}__`;function Zr(){let{router:e}=Gr(`useSubmit`),{basename:t}=O.useContext(z),n=Ln(),r=e.fetch,i=e.navigate;return O.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=dr(e,t);if(a.navigate===!1){let e=a.fetcherKey||Xr();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Qr(e,{relative:t}={}){let{basename:n}=O.useContext(z),r=O.useContext(B);N(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Sn(e||`.`,{relative:t})},o=H();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:L([n,a.pathname])),ut(a)}var $r=`react-router-scroll-positions`,ei={};function ti(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:I(e.pathname,n)||e.pathname},t)),i??=e.key,i}function ni({getKey:e,storageKey:t}={}){let{router:n}=Gr(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Kr(`useScrollRestoration`),{basename:a}=O.useContext(z),o=H(),s=zn(),c=Rn();O.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),ri(O.useCallback(()=>{if(c.state===`idle`){let t=ti(o,s,a,e);ei[t]=window.scrollY}try{sessionStorage.setItem(t||$r,JSON.stringify(ei))}catch(e){P(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(O.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||$r);e&&(ei=JSON.parse(e))}catch{}},[t]),O.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(ei,()=>window.scrollY,e?(t,n)=>ti(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),O.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{P(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function ri(e,t){let{capture:n}=t||{};O.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ii(e,{relative:t}={}){let n=O.useContext(rn);N(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Gr(`useViewTransitionState`),i=Sn(e,{relative:t});if(!n.isTransitioning)return!1;let a=I(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=I(n.nextLocation.pathname,r)||n.nextLocation.pathname;return At(i.pathname,o)!=null||At(i.pathname,a)!=null}var ai=class extends Error{status;manual;command;exists;constructor(e,t,n={}){super(t,n.cause===void 0?void 0:{cause:n.cause}),this.name=`ApiError`,this.status=e,this.manual=n.manual,this.command=n.command,this.exists=n.exists}};function oi(e){try{return JSON.parse(e)}catch{return}}function si(e){return typeof e==`string`?e:void 0}function ci(e,t,n){let r=oi(n),i=r&&typeof r==`object`?r:{};return new ai(e,si(i.error)??`${e} ${t||`request failed`}`.trim(),{manual:si(i.manual),command:si(i.command),exists:typeof i.exists==`boolean`?i.exists:void 0})}async function li(e,t){try{return await fetch(s(e),t)}catch(t){throw t instanceof DOMException&&t.name===`AbortError`?t:new ai(0,`cannot reach the cezar server (${e})`,{cause:t})}}async function ui(e,t={}){let n=await li(e,t),r=await n.text();if(!n.ok)throw ci(n.status,n.statusText,r);let i=oi(r);if(i===void 0)throw new ai(n.status,`the cezar server answered ${e} with a non-JSON body`);return i}async function di(e,t={}){let n=await li(e,t),r=await n.text();if(!n.ok)throw ci(n.status,n.statusText,r);return r}function U(e,t={}){return ui(e,{method:`GET`,signal:t.signal})}function W(e,t,n){return ui(t,{method:e,...n===void 0?{}:{headers:{"content-type":`application/json`},body:JSON.stringify(n)}})}var G=(e,t=``)=>`/api/runs/${encodeURIComponent(e)}${t}`;function fi(e){return U(`/api/health`,e)}function pi(e){return U(`/api/models?runner=codex`,e)}function mi(e){return U(`/api/launch-key`,e)}function hi(e){return U(`/api/projects`,e)}function gi(e,t){return U(`/api/fs/browse${e===void 0||e===``?``:`?path=${encodeURIComponent(e)}`}`,t)}function _i(e){return U(`/api/runs`,e)}function vi(e,t){return U(`/api/p/${encodeURIComponent(e)}/runs`,t)}function yi(e,t){return U(G(e),t)}function bi(e){return U(`/api/ui-state`,e)}function xi(e){return U(`/api/workflows`,e)}function Si(e){return U(`/api/skills`,e)}function Ci(e){return U(`/api/skills?wait=1`,e)}function wi(){return W(`POST`,`/api/skills/refresh`)}function Ti(e){return U(`/api/todos`,e)}function Ei(e){return U(`/api/repo`,e)}function Di(e){return U(`/api/config`,e)}function Oi(e={}){return U(`/api/agent-config`,e)}function ki(e,t={}){return U(`/api/agent-config/${encodeURIComponent(e)}`,t)}function Ai(e,t){return W(`PUT`,`/api/agent-config/${encodeURIComponent(e)}`,t)}function ji(e){return U(`/api/repo/changes`,e)}function Mi(e,t){return U(`/api/repo/commit/${encodeURIComponent(e)}?structured=1`,t)}function Ni(e,t){return U(G(e,`/commits`),t)}function Pi(e,t,n){return U(G(e,`/commit/${encodeURIComponent(t)}`),n)}function Fi(e={},t){let n=new URLSearchParams;e.limit!==void 0&&n.set(`limit`,String(e.limit)),e.refresh&&n.set(`refresh`,`1`);let r=n.toString();return U(`/api/github${r?`?${r}`:``}`,t)}function Ii(e,t,n={},r){return U(`/api/github/comments/${e}/${t}${n.refresh?`?refresh=1`:``}`,r)}function Li(e,t){return di(G(e,`/diff`),{method:`GET`,signal:t?.signal})}function Ri(e,t){return di(G(e,`/handoff`),{method:`GET`,signal:t?.signal})}function zi(e,t){return U(G(e,`/changes`),t)}function Bi(e,t,n){return U(G(e,`/files?path=${encodeURIComponent(t)}`),n)}function Vi(e,t){return s(G(e,`/files?path=${encodeURIComponent(t)}&raw=1`))}function Hi(e,t){return U(`/api/groups/${encodeURIComponent(e)}`,t)}async function Ui(e){let t=`/api/projects`,n=await li(t,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({root:e})}),r=await n.text(),i=oi(r),a=i?.project;if((n.ok||n.status===409)&&a!=null)return i;throw n.ok?new ai(n.status,`the cezar server answered ${t} without a project`):ci(n.status,n.statusText,r)}function Wi(e){return W(`POST`,`/api/projects/checkout`,e)}function Gi(e){return W(`DELETE`,`/api/projects/${encodeURIComponent(e)}`)}function Ki(e){return W(`POST`,`/api/runs`,e)}function qi(e){return W(`POST`,G(e,`/cancel`))}function Ji(e,t=!0){return W(`POST`,G(e,`/archive`),{archived:t})}function Yi(){return W(`POST`,`/api/runs/archive-finished`)}function Xi(e){return W(`POST`,G(e,`/finish`))}function Zi(e,t={}){let n={};return t.text!==void 0&&(n.text=t.text),t.runner!==void 0&&(n.runner=t.runner),t.model!==void 0&&(n.model=t.model),W(`POST`,G(e,`/continue`),n)}function Qi(e){return W(`POST`,G(e,`/pr`))}function $i(e,t){return W(`PATCH`,G(e),t)}function ea(e){return W(`DELETE`,G(e))}function ta(e){return W(`DELETE`,`/api/todos/${encodeURIComponent(e)}`)}function na(e,t={}){let n={};return t.runner!==void 0&&(n.runner=t.runner),t.model!==void 0&&(n.model=t.model),t.prompt!==void 0&&(n.prompt=t.prompt),W(`POST`,`/api/todos/${encodeURIComponent(e)}/start`,Object.keys(n).length>0?n:void 0)}function ra(e,t){return W(`POST`,`/api/groups/${encodeURIComponent(e)}/pick`,{runId:t})}function ia(e){return W(`POST`,G(e,`/open-in-cli`))}function aa(e){return U(`/api/open-targets`,e)}function oa(e,t){return W(`POST`,G(e,`/open-in`),{target:t})}function sa(e,t){return W(`POST`,G(e,`/open-in`),{target:`default`,path:t})}function ca(e,t){return W(`POST`,G(e,`/git/commit`),{message:t})}function la(e){return W(`POST`,G(e,`/git/push`))}function ua(e,t){return W(`POST`,G(e,`/messages`),{text:t.text??``,images:t.images??[]})}function da(e,t,n){return W(`PATCH`,G(e,`/queued-messages/${encodeURIComponent(t)}`),n)}function fa(e,t){return W(`DELETE`,G(e,`/queued-messages/${encodeURIComponent(t)}`))}function pa(e){return W(`POST`,`/api/repo/branch`,e)}function ma(e){return W(`POST`,`/api/plan`,{task:e})}function ha(e){return W(`POST`,`/api/workflows`,e)}function ga(e){return W(`POST`,`/api/workflows/parse`,{yaml:e})}function _a(e){return W(`DELETE`,`/api/workflows/${encodeURIComponent(e)}`)}function va(e){return W(`PUT`,`/api/ui-state`,e)}function ya(e){return U(`/api/workspace/ui-state`,e)}function ba(e){return W(`PUT`,`/api/workspace/ui-state`,e)}function xa(e){return U(`/api/workspace/config`,e)}function Sa(e){return W(`PUT`,`/api/workspace/config`,e)}function Ca(e){return W(`PUT`,`/api/config`,e)}function wa(e){return U(`/api/worktrees`,e)}function Ta(){return W(`POST`,`/api/worktrees/reclaim`,{})}function Ea(e){return W(`POST`,G(e,`/remove-worktree`))}var K={get health(){return[o(),`health`]},runs:{get all(){return[o(),`runs`]},list:()=>[o(),`runs`,`list`],detail:e=>[o(),`runs`,`detail`,e],diff:e=>[o(),`runs`,`diff`,e],changes:e=>[o(),`runs`,`changes`,e],file:(e,t)=>[o(),`runs`,`files`,e,t],handoff:e=>[o(),`runs`,`handoff`,e],commits:e=>[o(),`runs`,`commits`,e],commit:(e,t)=>[o(),`runs`,`commit`,e,t]},groups:{detail:e=>[o(),`groups`,e]},get todos(){return[o(),`todos`]},get workflows(){return[o(),`workflows`]},get skills(){return[o(),`skills`]},get skillsReady(){return[o(),`skills`,`ready`]},get launchKey(){return[o(),`launch-key`]},get repo(){return[o(),`repo`]},get repoChanges(){return[o(),`repo`,`changes`]},repoCommit:e=>[o(),`repo`,`commit`,e],get uiState(){return[o(),`ui-state`]},get config(){return[o(),`config`]},get agentConfig(){return[o(),`agent-config`]},agentConfigFile:e=>[o(),`agent-config`,`file`,e],get worktrees(){return[o(),`worktrees`]},github:(e={})=>[o(),`github`,e.limit??null],githubComments:(e,t)=>[o(),`github`,`comments`,e,t],get openTargets(){return[o(),`open-targets`]}},q={models:e=>[`workspace`,`models`,e],projects:[`workspace`,`projects`],uiState:[`workspace`,`ui-state`],config:[`workspace`,`config`],fsBrowseRoot:[`workspace`,`fs-browse`],fsBrowse:e=>[...q.fsBrowseRoot,e]};function Da(){return j({queryKey:q.models(`codex`),queryFn:({signal:e})=>pi({signal:e}),staleTime:300*1e3})}function Oa(){return j({queryKey:q.projects,queryFn:({signal:e})=>hi({signal:e})})}function ka(e){return j({queryKey:q.fsBrowse(e),queryFn:({signal:t})=>gi(e??void 0,{signal:t}),retry:!1})}function Aa(){let e=A();return M({mutationFn:e=>Ui(e),onSuccess:()=>e.invalidateQueries({queryKey:q.projects})})}function ja(){let e=A();return M({mutationFn:e=>Gi(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:q.projects})})}function Ma(){let e=A();return M({mutationFn:e=>Wi(e),retry:!1,onSuccess:()=>e.invalidateQueries({queryKey:q.projects})})}function Na(){return j({queryKey:K.health,queryFn:({signal:e})=>fi({signal:e}),refetchInterval:5e3})}function Pa(){return j({queryKey:K.openTargets,queryFn:({signal:e})=>aa({signal:e}),staleTime:5*6e4})}function Fa(){return j({queryKey:K.runs.list(),queryFn:({signal:e})=>_i({signal:e})})}function Ia(e,t=!0,n=!1){return j({queryKey:[n?`default`:e,`runs`,`list`],queryFn:({signal:t})=>vi(e,{signal:t}),enabled:t})}function La(e){return j({queryKey:K.runs.detail(e??``),queryFn:({signal:t})=>yi(e,{signal:t}),enabled:!!e})}function Ra(e){return j({queryKey:K.runs.diff(e??``),queryFn:({signal:t})=>Li(e,{signal:t}),enabled:!!e})}function za(e,t=!1){return j({queryKey:K.runs.changes(e??``),queryFn:({signal:t})=>zi(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?4e3:!1,refetchOnWindowFocus:!0,staleTime:0})}function Ba(e,t){return j({queryKey:K.runs.file(e??``,t??``),queryFn:({signal:n})=>Bi(e,t,{signal:n}),enabled:!!e&&t!==void 0,retry:!1})}function Va(e){return j({queryKey:K.groups.detail(e??``),queryFn:({signal:t})=>Hi(e,{signal:t}),enabled:!!e})}function Ha(e,t=!1){return j({queryKey:K.runs.commits(e??``),queryFn:({signal:t})=>Ni(e,{signal:t}),enabled:!!e,retry:!1,refetchInterval:t?5e3:!1})}function Ua(e,t){return j({queryKey:K.runs.commit(e??``,t??``),queryFn:({signal:n})=>Pi(e,t,{signal:n}),enabled:!!e&&!!t,retry:!1})}function Wa(e,t=!0){return j({queryKey:K.runs.handoff(e??``),queryFn:({signal:t})=>Ri(e,{signal:t}),enabled:!!e&&t})}function Ga(e=!0){return j({queryKey:K.todos,queryFn:({signal:e})=>Ti({signal:e}),enabled:e})}function Ka(){return j({queryKey:K.workflows,queryFn:({signal:e})=>xi({signal:e})})}function qa(e=!0){let t=A(),n=K.skills,r=n[0],i=j({queryKey:n,queryFn:({signal:e})=>Si({signal:e}),enabled:e}),a=j({queryKey:K.skillsReady,queryFn:({signal:e})=>Ci({signal:e}),enabled:e&&i.isSuccess,staleTime:1/0,retry:!1});return(0,O.useEffect)(()=>{Array.isArray(a.data)&&t.setQueryData([r,`skills`],a.data)},[t,a.data,r]),i}function Ja(){return j({queryKey:K.launchKey,queryFn:({signal:e})=>mi({signal:e}),staleTime:1/0})}function Ya(){return j({queryKey:K.repo,queryFn:({signal:e})=>Ei({signal:e})})}function Xa(){return j({queryKey:K.repoChanges,queryFn:({signal:e})=>ji({signal:e}),retry:!1})}function Za(e){return j({queryKey:K.repoCommit(e??``),queryFn:({signal:t})=>Mi(e,{signal:t}),enabled:!!e,retry:!1})}function Qa(){return j({queryKey:K.config,queryFn:({signal:e})=>Di({signal:e})})}function $a(){return j({queryKey:K.worktrees,queryFn:({signal:e})=>wa({signal:e})})}function eo(){return j({queryKey:K.uiState,queryFn:({signal:e})=>bi({signal:e})})}function to(){return j({queryKey:K.agentConfig,queryFn:({signal:e})=>Oi({signal:e})})}function no(e){return j({queryKey:K.agentConfigFile(e??``),queryFn:({signal:t})=>ki(e,{signal:t}),enabled:e!==null})}function ro(e){let t=A(),n=K.agentConfig,r=K.agentConfigFile(e);return M({mutationFn:t=>Ai(e,t),onSuccess:e=>{t.setQueryData(r,e),t.invalidateQueries({queryKey:n})}})}function io(){return j({queryKey:q.uiState,queryFn:({signal:e})=>ya({signal:e})})}function ao(){return j({queryKey:q.config,queryFn:({signal:e})=>xa({signal:e})})}function oo(e){let t=A();return M({mutationFn:t=>$i(e,t),onSuccess:()=>t.invalidateQueries({queryKey:K.runs.all})})}function so(e){let t=A();return M({mutationFn:t=>ua(e,t),onSuccess:()=>t.invalidateQueries({queryKey:K.runs.all})})}function co(e){let t=A();return M({mutationFn:({msgId:t,message:n})=>da(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:K.runs.all})})}function lo(e){let t=A();return M({mutationFn:t=>fa(e,t),onSuccess:()=>t.invalidateQueries({queryKey:K.runs.all})})}function uo(e={},t=!0){return j({queryKey:K.github(e),queryFn:({signal:t})=>Fi({limit:e.limit},{signal:t}),enabled:t})}function fo(e,t,n=!0){return j({queryKey:K.githubComments(e,t),queryFn:({signal:n})=>Ii(e,t,{},{signal:n}),enabled:n,staleTime:6e4})}var po=a(n(),1),mo=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ho=r,go=(e,t)=>n=>{if(t?.variants==null)return ho(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=mo(t)||mo(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ho(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function _o(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function vo(...e){return t=>{let n=!1,r=e.map(e=>{let r=_o(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():_o(e[t],null)}}}}function yo(...e){return O.useCallback(vo(...e),e)}function bo(e){let t=O.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Oo(r)&&typeof Mo==`function`&&(r=Mo(r._payload)),O.Children.forEach(r,e=>{if(Eo(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Oo(n)&&typeof Mo==`function`&&(n=Mo(n._payload)),a=Co(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=O.cloneElement(a,void 0,s):!o&&O.Children.count(r)===1&&O.isValidElement(r)&&(a=r);let c=a?To(a):void 0,l=yo(n,c);if(!a){if(r||r===0)throw Error(o?jo(e):Ao(e));return r}let u=wo(i,a.props??{});return a.type!==O.Fragment&&(u.ref=n?l:c),O.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var xo=bo(`Slot`),So=Symbol.for(`radix.slottable`),Co=(e,t)=>{if(`child`in e.props){let t=e.props.child;return O.isValidElement(t)?O.cloneElement(t,void 0,e.props.children(t.props.children)):null}return O.isValidElement(t)?t:null};function wo(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function To(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Eo(e){return O.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===So}var Do=Symbol.for(`react.lazy`);function Oo(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Do&&`_payload`in e&&ko(e._payload)}function ko(e){return typeof e==`object`&&!!e&&`then`in e}var Ao=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,jo=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Mo=O.use,No=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=bo(`Primitive.${t}`),r=O.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,k.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Po(e,t){e&&po.flushSync(()=>e.dispatchEvent(t))}function Fo(e,t=[]){let n=[];function r(t,r){let i=O.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=O.useMemo(()=>o,Object.values(o));return(0,k.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=O.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>O.createContext(e));return function(n){let r=n?.[e]||t;return O.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Io(i,...t)]}function Io(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function Lo(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var J=globalThis?.document?O.useLayoutEffect:()=>{},Ro=O.useInsertionEffect||J;function zo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Bo({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=O.useRef(e!==void 0);O.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,O.useCallback(t=>{if(s){let n=Vo(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Bo({defaultProp:e,onChange:t}){let[n,r]=O.useState(e),i=O.useRef(n),a=O.useRef(t);return Ro(()=>{a.current=t},[t]),O.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Vo(e){return typeof e==`function`}function Ho(e,t){return O.useReducer((e,n)=>t[e][n]??e,e)}var Uo=e=>{let{present:t,children:n}=e,r=Wo(t),i=typeof n==`function`?n({present:r.isPresent}):O.Children.only(n),a=Ko(r.ref,Jo(i));return typeof n==`function`||r.isPresent?O.cloneElement(i,{ref:a}):null};Uo.displayName=`Presence`;function Wo(e){let[t,n]=O.useState(),r=O.useRef(null),i=O.useRef(e),a=O.useRef(`none`),o=O.useRef(void 0),[s,c]=Ho(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return O.useEffect(()=>{s===`mounted`?(a.current=o.current??qo(r.current),o.current=void 0):a.current=`none`},[s]),J(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=qo(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),J(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=qo(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=qo(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:O.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=qo(t)}else r.current=null;n(e)},[])}}function Go(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ko(...e){let t=O.useRef(e);return t.current=e,O.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Go(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Go(n[e],null)}}},[])}function qo(e){return e?.animationName||`none`}function Jo(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yo=O.useId||(()=>void 0),Xo=0;function Zo(e){let[t,n]=O.useState(Yo());return J(()=>{e||n(e=>e??String(Xo++))},[e]),e||(t?`radix-${t}`:``)}function Y(e){let t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>((...e)=>t.current?.(...e)),[])}var Qo=`DismissableLayer`,$o=`dismissableLayer.update`,es=`dismissableLayer.pointerDownOutside`,ts=`dismissableLayer.focusOutside`,ns,rs=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),is=O.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=O.useContext(rs),[d,f]=O.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=O.useState({}),h=yo(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=O.useRef(!1),C=ls(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:O.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=us(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,ee=Y(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return O.useEffect(()=>{if(T)return p.addEventListener(`keydown`,ee,{capture:!0}),()=>p.removeEventListener(`keydown`,ee,{capture:!0})},[p,T,ee]),O.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ns=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ds(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ns))}},[d,p,n,u]),O.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ds())},[d,u]),O.useEffect(()=>{let e=()=>m({});return document.addEventListener($o,e),()=>document.removeEventListener($o,e)},[]),(0,k.jsx)(No.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Lo(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Lo(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Lo(e.onPointerDownCapture,C.onPointerDownCapture)})});is.displayName=Qo;var as=`DismissableLayerBranch`,os=O.forwardRef((e,t)=>{let n=O.useContext(rs),r=O.useRef(null),i=yo(t,r);return O.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,k.jsx)(No.div,{...e,ref:i})});os.displayName=as;function ss(){let e=O.useContext(rs),[t,n]=O.useState(null);return O.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var cs=()=>!0;function ls(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=cs}=t,s=Y(e),c=O.useRef(!1),l=O.useRef(!1),u=O.useRef(new Map),d=O.useRef(()=>{});return O.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}function p(e){l.current&&u.current.set(e.type,!1)}let m=a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||fs(es,s,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:()=>c.current=!0}}function us(e,t=globalThis?.document){let n=Y(e),r=O.useRef(!1);return O.useEffect(()=>{let e=e=>{e.target&&!r.current&&fs(ts,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ds(){let e=new CustomEvent($o);document.dispatchEvent(e)}function fs(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Po(i,a):i.dispatchEvent(a)}var ps=`focusScope.autoFocusOnMount`,ms=`focusScope.autoFocusOnUnmount`,hs={bubbles:!1,cancelable:!0},gs=`FocusScope`,_s=O.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=O.useState(null),l=Y(i),u=Y(a),d=O.useRef(null),f=yo(t,c),p=O.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;O.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:X(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||X(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&X(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),O.useEffect(()=>{if(s){ws.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ps,hs);s.addEventListener(ps,l),s.dispatchEvent(t),t.defaultPrevented||(vs(Ds(bs(s)),{select:!0}),document.activeElement===e&&X(s))}return()=>{s.removeEventListener(ps,l),setTimeout(()=>{let t=new CustomEvent(ms,hs);s.addEventListener(ms,u),s.dispatchEvent(t),t.defaultPrevented||X(e??document.body,{select:!0}),s.removeEventListener(ms,u),ws.remove(p)},0)}}},[s,l,u,p]);let m=O.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ys(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&X(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&X(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,k.jsx)(No.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});_s.displayName=gs;function vs(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(X(r,{select:t}),document.activeElement!==n)return}function ys(e){let t=bs(e);return[xs(t,e),xs(t.reverse(),e)]}function bs(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xs(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ss(r,{upTo:t})))return r}function Ss(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Cs(e){return e instanceof HTMLInputElement&&`select`in e}function X(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Cs(e)&&t&&e.select()}}var ws=Ts();function Ts(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Es(e,t),e.unshift(t)},remove(t){e=Es(e,t),e[0]?.resume()}}}function Es(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ds(e){return e.filter(e=>e.tagName!==`A`)}var Os=`Portal`,ks=O.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=O.useState(!1);J(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?po.createPortal((0,k.jsx)(No.div,{...r,ref:t}),o):null});ks.displayName=Os;var As=0,js=null;function Ms(){O.useEffect(()=>{js||={start:Ns(),end:Ns()};let{start:e,end:t}=js;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),As++,()=>{As===1&&(js?.start.remove(),js?.end.remove(),js=null),As=Math.max(0,As-1)}},[])}function Ns(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Z=function(){return Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)};function Ps(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Fs(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Is=`right-scroll-bar-position`,Ls=`width-before-scroll-bar`,Rs=`with-scroll-bars-hidden`,zs=`--removed-body-scroll-bar-size`;function Bs(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Vs(e,t){var n=(0,O.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Hs=typeof window<`u`?O.useLayoutEffect:O.useEffect,Us=new WeakMap;function Ws(e,t){var n=Vs(t||null,function(t){return e.forEach(function(e){return Bs(e,t)})});return Hs(function(){var t=Us.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Bs(e,null)}),i.forEach(function(e){r.has(e)||Bs(e,a)})}Us.set(n,e)},[e]),n}function Gs(e){return e}function Ks(e,t){t===void 0&&(t=Gs);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function qs(e){e===void 0&&(e={});var t=Ks(null);return t.options=Z({async:!0,ssr:!1},e),t}var Js=function(e){var t=e.sideCar,n=Ps(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return O.createElement(r,Z({},n))};Js.isSideCarExport=!0;function Ys(e,t){return e.useMedium(t),Js}var Xs=qs(),Zs=function(){},Qs=O.forwardRef(function(e,t){var n=O.useRef(null),r=O.useState({onScrollCapture:Zs,onWheelCapture:Zs,onTouchMoveCapture:Zs}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Ps(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ws([n,t]),C=Z(Z({},b),i);return O.createElement(O.Fragment,null,u&&O.createElement(x,{sideCar:Xs,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?O.cloneElement(O.Children.only(s),Z(Z({},C),{ref:S})):O.createElement(v,Z({},C,{className:c,ref:S}),s))});Qs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Qs.classNames={fullWidth:Ls,zeroRight:Is};var $s,ec=function(){if($s)return $s;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function tc(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ec();return t&&e.setAttribute(`nonce`,t),e}function nc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rc(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ic=function(){var e=0,t=null;return{add:function(n){e==0&&(t=tc())&&(nc(t,n),rc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ac=function(){var e=ic();return function(t,n){O.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oc=function(){var e=ac();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},sc={left:0,top:0,right:0,gap:0},cc=function(e){return parseInt(e||``,10)||0},lc=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[cc(n),cc(r),cc(i)]},uc=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return sc;var t=lc(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dc=oc(),fc=`data-scroll-locked`,pc=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
4
+ .${Rs} {
5
+ overflow: hidden ${r};
6
+ padding-right: ${s}px ${r};
7
+ }
8
+ body[${fc}] {
9
+ overflow: hidden ${r};
10
+ overscroll-behavior: contain;
11
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
12
+ padding-left: ${i}px;
13
+ padding-top: ${a}px;
14
+ padding-right: ${o}px;
15
+ margin-left:0;
16
+ margin-top:0;
17
+ margin-right: ${s}px ${r};
18
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
19
+ }
20
+
21
+ .${Is} {
22
+ right: ${s}px ${r};
23
+ }
24
+
25
+ .${Ls} {
26
+ margin-right: ${s}px ${r};
27
+ }
28
+
29
+ .${Is} .${Is} {
30
+ right: 0 ${r};
31
+ }
32
+
33
+ .${Ls} .${Ls} {
34
+ margin-right: 0 ${r};
35
+ }
36
+
37
+ body[${fc}] {
38
+ ${zs}: ${s}px;
39
+ }
40
+ `},mc=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},hc=function(){O.useEffect(function(){return document.body.setAttribute(fc,(mc()+1).toString()),function(){var e=mc()-1;e<=0?document.body.removeAttribute(fc):document.body.setAttribute(fc,e.toString())}},[])},gc=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;hc();var a=O.useMemo(function(){return uc(i)},[i]);return O.createElement(dc,{styles:pc(a,!t,i,n?``:`!important`)})},_c=!1;if(typeof window<`u`)try{var vc=Object.defineProperty({},"passive",{get:function(){return _c=!0,!0}});window.addEventListener(`test`,vc,vc),window.removeEventListener(`test`,vc,vc)}catch{_c=!1}var Q=_c?{passive:!1}:!1,yc=function(e){return e.tagName===`TEXTAREA`},bc=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!yc(e)&&n[t]===`visible`)},xc=function(e){return bc(e,`overflowY`)},Sc=function(e){return bc(e,`overflowX`)},Cc=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Ec(e,r)){var i=Dc(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wc=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Tc=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Ec=function(e,t){return e===`v`?xc(t):Sc(t)},Dc=function(e,t){return e===`v`?wc(t):Tc(t)},Oc=function(e,t){return e===`h`&&t===`rtl`?-1:1},kc=function(e,t,n,r,i){var a=Oc(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Dc(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Ec(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Ac=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jc=function(e){return[e.deltaX,e.deltaY]},Mc=function(e){return e&&`current`in e?e.current:e},Nc=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Pc=function(e){return`
41
+ .block-interactivity-${e} {pointer-events: none;}
42
+ .allow-interactivity-${e} {pointer-events: all;}
43
+ `},Fc=0,$=[];function Ic(e){var t=O.useRef([]),n=O.useRef([0,0]),r=O.useRef(),i=O.useState(Fc++)[0],a=O.useState(oc)[0],o=O.useRef(e);O.useEffect(function(){o.current=e},[e]),O.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Fs([e.lockRef.current],(e.shards||[]).map(Mc),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=O.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ac(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Cc(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Cc(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return kc(h,t,e,h===`h`?s:c,!0)},[]),c=O.useCallback(function(e){var n=e;if(!(!$.length||$[$.length-1]!==a)){var r=`deltaY`in n?jc(n):Ac(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Nc(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Mc).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=O.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Lc(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=O.useCallback(function(e){n.current=Ac(e),r.current=void 0},[]),d=O.useCallback(function(t){l(t.type,jc(t),t.target,s(t,e.lockRef.current))},[]),f=O.useCallback(function(t){l(t.type,Ac(t),t.target,s(t,e.lockRef.current))},[]);O.useEffect(function(){return $.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Q),document.addEventListener(`touchmove`,c,Q),document.addEventListener(`touchstart`,u,Q),function(){$=$.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Q),document.removeEventListener(`touchmove`,c,Q),document.removeEventListener(`touchstart`,u,Q)}},[]);var p=e.removeScrollBar,m=e.inert;return O.createElement(O.Fragment,null,m?O.createElement(a,{styles:Pc(i)}):null,p?O.createElement(gc,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Lc(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Rc=Ys(Xs,Ic),zc=O.forwardRef(function(e,t){return O.createElement(Qs,Z({},e,{ref:t,sideCar:Rc}))});zc.classNames=Qs.classNames;var Bc=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Vc=new WeakMap,Hc=new WeakMap,Uc={},Wc=0,Gc=function(e){return e&&(e.host||Gc(e.parentNode))},Kc=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Gc(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},qc=function(e,t,n,r){var i=Kc(t,Array.isArray(e)?e:[e]);Uc[n]||(Uc[n]=new WeakMap);var a=Uc[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Vc.get(e)||0)+1,l=(a.get(e)||0)+1;Vc.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Hc.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Wc++,function(){o.forEach(function(e){var t=Vc.get(e)-1,i=a.get(e)-1;Vc.set(e,t),a.set(e,i),t||(Hc.has(e)||e.removeAttribute(r),Hc.delete(e)),i||e.removeAttribute(n)}),Wc--,Wc||(Vc=new WeakMap,Vc=new WeakMap,Hc=new WeakMap,Uc={})}},Jc=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Bc(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),qc(r,i,n,`aria-hidden`)):function(){return null}},Yc=go(`inline-flex shrink-0 items-center justify-center gap-[7px] rounded-md font-semibold whitespace-nowrap transition-[background-color,border-color,opacity,filter] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:brightness-[0.96]`,contrast:`bg-contrast text-contrast-foreground hover:brightness-[0.96]`,outline:`border border-border bg-card hover:bg-muted`,ghost:`text-muted-foreground hover:bg-muted hover:text-foreground`,"danger-ghost":`text-danger hover:bg-danger/10`},size:{default:`h-9 px-3.5 text-[13.5px]`,sm:`h-[30px] rounded-sm px-2.5 text-[12.5px]`,icon:`size-9`,"icon-sm":`size-[30px] rounded-sm`}},defaultVariants:{variant:`primary`,size:`default`}});function Xc({className:e,variant:t=`primary`,size:n=`default`,asChild:r=!1,...i}){return(0,k.jsx)(r?xo:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:c(Yc({variant:t,size:n,className:e})),...i})}var Zc=5e3,Qc=[],$c=1,el=new Set;function tl(e){Qc=e;for(let e of el)e()}function nl(e){return el.add(e),()=>el.delete(e)}function rl(e,t={}){let n={id:$c++,message:e,tone:t.tone??`default`};tl([...Qc,n]),setTimeout(()=>tl(Qc.filter(e=>e.id!==n.id)),Zc)}function il(){let e=(0,O.useSyncExternalStore)(nl,()=>Qc);return e.length===0?null:(0,k.jsx)(`div`,{"data-slot":`toaster`,className:`pointer-events-none fixed inset-x-0 bottom-[calc(16px+env(safe-area-inset-bottom))] z-50 flex flex-col items-center gap-2 px-4`,children:e.map(e=>(0,k.jsx)(`div`,{role:`status`,"data-slot":`toast`,"data-tone":e.tone,className:c(`pointer-events-auto max-w-full rounded-md px-3.5 py-2.5 text-[13px] font-medium shadow-modal`,e.tone===`danger`?`bg-danger text-danger-foreground`:`bg-contrast text-contrast-foreground`),children:e.message},e.id))})}var al={primary:`border-primary/25 bg-primary/15 text-primary`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function ol({icon:e,tone:t=`neutral`,title:n,subtitle:r,children:i,actions:a,backdrop:o=!1,heading:s=`h1`,className:l}){return(0,k.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":t,className:c(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,l),children:[o?(0,k.jsx)(ll,{}):null,(0,k.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,k.jsx)(`div`,{"data-slot":`centered-state-tile`,className:c(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,al[t]),children:e}),(0,k.jsx)(s,{className:`text-2xl font-semibold text-balance text-foreground`,children:n}),r?(0,k.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:r}):null,i?(0,k.jsx)(`div`,{className:`w-full pt-2`,children:i}):null,a?(0,k.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:a}):null]})]})}var sl=[{top:`6%`,left:`14%`,size:2,tone:`violet`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`violet`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`violet`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`violet`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`violet`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`violet`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`violet`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`violet`,opacity:.22}],cl={violet:`bg-violet`,primary:`bg-primary`,pending:`bg-pending`};function ll({className:e}){return(0,k.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:c(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,e),children:sl.map((e,t)=>(0,k.jsx)(`span`,{className:c(`absolute rounded-[1px] motion-safe:animate-pulse`,e.size===3?`size-[3px]`:`size-0.5`,cl[e.tone]),style:{top:e.top,left:e.left,opacity:e.opacity,animationDuration:`3.5s`,animationDelay:`${t%5*700}ms`}},t))})}export{Ua as $,Gn as $t,no as A,mi as At,Pa as B,Ca as Bt,xo as C,le as Cn,Qi as Ct,go as D,Xi as Dt,yo as E,_a as Et,uo as F,ga as Ft,Aa as G,wi as Gt,Ia as H,Sa as Ht,fo as I,$i as It,Ya as J,Vi as Jt,ja as K,Ea as Kt,Va as L,ra as Lt,Qa as M,sa as Mt,co as N,oa as Nt,K as O,Fi as Ot,ka as P,ia as Pt,za as Q,Vr as Qt,Na as R,ma as Rt,Po as S,y as Sn,Ki as St,vo as T,l as Tn,ea as Tt,Oa as U,ba as Ut,oo as V,va as Vt,ro as W,Ta as Wt,Za as X,Rr as Xt,Xa as Y,na as Yt,La as Z,Br as Zt,zo as _,C as _n,Ji as _t,Xc as a,_n as an,Fa as at,Fo as b,h as bn,Zi as bt,zc as c,M as cn,Ga as ct,_s as d,Le as dn,ao as dt,Kn as en,Ha as et,is as f,Ee as fn,io as ft,Uo as g,w as gn,Yi as gt,Zo as h,g as hn,ai as ht,rl as i,H as in,Da as it,Ma as j,Bi as jt,to as k,Ii as kt,Ms as l,Ve as ln,eo as lt,Y as m,D as mn,q as mt,ll as n,Yn as nn,Ba as nt,Yc as o,xn as on,so as ot,ss as p,_e as pn,$a as pt,lo as q,ta as qt,il as r,At as rn,Wa as rt,Jc as s,Jr as sn,qa as st,ol as t,qn as tn,Ra as tt,ks as u,A as un,Ka as ut,J as v,S as vn,qi as vt,bo as w,u as wn,ha as wt,No as x,T as xn,pa as xt,Lo as y,x as yn,ca as yt,Ja as z,la as zt};
@@ -0,0 +1 @@
1
+ import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{T as r,h as i,x as a}from"./centered-state-zzWBfO_1.js";import{r as o,t as s}from"./utils-B8s5qIcK.js";import{a as c,o as l,r as u,t as d}from"./dist-Cw_CDvC3.js";import{i as f,o as p,r as m,s as h,t as g}from"./dialog-BYr_BAil.js";var _=o(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),v=o(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),y=n(t(),1),b=1,x=.9,ee=.8,S=.17,C=.1,w=.999,T=.9999,E=.99,D=/[\\\/_+.#"@\[\(\{&]/,O=/[\\\/_+.#"@\[\(\{&]/g,k=/[\s-]/,A=/[\s-]/g;function j(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?b:E;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=j(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=b:D.test(e.charAt(l-1))?(d*=ee,p=e.slice(i,l-1).match(O),p&&i>0&&(d*=w**+p.length)):k.test(e.charAt(l-1))?(d*=x,m=e.slice(i,l-1).match(A),m&&i>0&&(d*=w**+m.length)):(d*=S,i>0&&(d*=w**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=T)),(d<C&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=j(e,t,n,r,l+1,a+2,o),f*C>d&&(d=f*C)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function M(e){return e.toLowerCase().replace(A,` `)}function N(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,j(e,t,M(e),M(t),0,0,{})}var P=`[cmdk-group=""]`,F=`[cmdk-group-items=""]`,te=`[cmdk-group-heading=""]`,I=`[cmdk-item=""]`,L=`${I}:not([aria-disabled="true"])`,R=`cmdk-item-select`,z=`data-value`,ne=(e,t,n)=>N(e,t,n),B=y.createContext(void 0),V=()=>y.useContext(B),H=y.createContext(void 0),U=()=>y.useContext(H),W=y.createContext(void 0),G=y.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),o=X(()=>new Map),s=X(()=>new Map),c=X(()=>new Set),l=de(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...b}=e,x=i(),ee=i(),S=i(),C=y.useRef(null),w=pe();Y(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,T.emit()}},[f]),Y(()=>{w(6,j)},[]);let T=y.useMemo(()=>({subscribe:e=>(c.current.add(e),()=>c.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(x))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,j),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{c.current.forEach(e=>e())}}),[]),E=y.useMemo(()=>({value:(e,t,r)=>{t!==s.current.get(e)?.value&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=M();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:x,inputId:S,labelId:ee,listInnerRef:C}),[]);function D(e,t){let r=l.current?.filter??ne;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=o.current.get(n),i=0;r.forEach(t=>{let n=e.get(t);i=Math.max(n,i)}),t.push([n,i])});let r=C.current;N().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(F);t?t.appendChild(e.parentElement===t?e:e.closest(`${F} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${F} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${P}[${z}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(z);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(s.current.get(t)?.value??``,s.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of o.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(P)?.querySelector(te))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return C.current?.querySelector(`${I}[aria-selected="true"]`)}function N(){return Array.from(C.current?.querySelectorAll(L)||[])}function V(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(z))}function U(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(z))}function W(e){let t=M()?.closest(P),n;for(;t&&!n;)t=e>0?le(t,P):ue(t,P),n=t?.querySelector(L);n?T.setState(`value`,n.getAttribute(z)):U(e)}let G=()=>V(N().length-1),K=e=>{e.preventDefault(),e.metaKey?G():e.altKey?W(1):U(1)},q=e=>{e.preventDefault(),e.metaKey?V(0):e.altKey?W(-1):U(-1)};return y.createElement(a.div,{ref:t,tabIndex:-1,...b,"cmdk-root":``,onKeyDown:e=>{var t;(t=b.onKeyDown)==null||t.call(b,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&K(e);break;case`ArrowDown`:K(e);break;case`p`:case`k`:v&&e.ctrlKey&&q(e);break;case`ArrowUp`:q(e);break;case`Home`:e.preventDefault(),V(0);break;case`End`:e.preventDefault(),G();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(R);t.dispatchEvent(e)}}}}},y.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:he},u),Q(e,e=>y.createElement(H.Provider,{value:T},y.createElement(B.Provider,{value:E},e))))}),K=y.forwardRef((e,t)=>{let n=i(),o=y.useRef(null),s=y.useContext(W),c=V(),l=de(e),u=l.current?.forceMount??s?.forceMount;Y(()=>{if(!u)return c.item(n,s?.id)},[u]);let d=fe(n,o,[e.value,e.children,o],e.keywords),f=U(),p=Z(e=>e.value&&e.value===d.current),m=Z(e=>u||c.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);y.useEffect(()=>{let t=o.current;if(!(!t||e.disabled))return t.addEventListener(R,h),()=>t.removeEventListener(R,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:v,onSelect:b,forceMount:x,keywords:ee,...S}=e;return y.createElement(a.div,{ref:r(o,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||c.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),q=y.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:s,...c}=e,l=i(),u=y.useRef(null),d=y.useRef(null),f=i(),p=V(),m=Z(e=>s||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));Y(()=>p.group(l),[]),fe(l,u,[e.value,e.heading,d]);let h=y.useMemo(()=>({id:l,forceMount:s}),[s]);return y.createElement(a.div,{ref:r(u,t),...c,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&y.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),Q(e,e=>y.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},y.createElement(W.Provider,{value:h},e))))}),re=y.forwardRef((e,t)=>{let{alwaysRender:n,...i}=e,o=y.useRef(null),s=Z(e=>!e.search);return!n&&!s?null:y.createElement(a.div,{ref:r(o,t),...i,"cmdk-separator":``,role:`separator`})}),ie=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=U(),s=Z(e=>e.search),c=Z(e=>e.selectedItemId),l=V();return y.useEffect(()=>{e.value!=null&&o.setState(`search`,e.value)},[e.value]),y.createElement(a.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:s,onChange:e=>{i||o.setState(`search`,e.target.value),n?.(e.target.value)}})}),ae=y.forwardRef((e,t)=>{let{children:n,label:i=`Suggestions`,...o}=e,s=y.useRef(null),c=y.useRef(null),l=Z(e=>e.selectedItemId),u=V();return y.useEffect(()=>{if(c.current&&s.current){let e=c.current,t=s.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),y.createElement(a.div,{ref:r(s,t),...o,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":i,id:u.listId},Q(e,e=>y.createElement(`div`,{ref:r(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),oe=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return y.createElement(d,{open:n,onOpenChange:r},y.createElement(l,{container:o},y.createElement(c,{"cmdk-overlay":``,className:i}),y.createElement(u,{"aria-label":e.label,"cmdk-dialog":``,className:a},y.createElement(G,{ref:t,...s}))))}),se=y.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?y.createElement(a.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ce=y.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...o}=e;return y.createElement(a.div,{ref:t,...o,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>y.createElement(`div`,{"aria-hidden":!0},e)))}),J=Object.assign(G,{List:ae,Item:K,Input:ie,Group:q,Separator:re,Dialog:oe,Empty:se,Loading:ce});function le(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ue(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function de(e){let t=y.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?y.useEffect:y.useLayoutEffect;function X(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=U(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function fe(e,t,n,r=[]){let i=y.useRef(),a=V();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(z,s),i.current=s}),i}var pe=()=>{let[e,t]=y.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function me(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(me(t),{ref:t.ref},n(t.props.children)):n(t)}var he={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=e();function ge({className:e,...t}){return(0,$.jsx)(J,{"data-slot":`command`,className:s(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function _e({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!0,...a}){return(0,$.jsxs)(g,{...a,children:[(0,$.jsxs)(p,{className:`sr-only`,children:[(0,$.jsx)(h,{children:e}),(0,$.jsx)(f,{children:t})]}),(0,$.jsx)(m,{className:s(`overflow-hidden p-0`,r),showCloseButton:i,children:(0,$.jsx)(ge,{className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function ve({className:e,...t}){return(0,$.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,$.jsx)(v,{className:`size-4 shrink-0 opacity-50`}),(0,$.jsx)(J.Input,{"data-slot":`command-input`,className:s(`flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function ye({className:e,...t}){return(0,$.jsx)(J.List,{"data-slot":`command-list`,className:s(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...t})}function be({...e}){return(0,$.jsx)(J.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function xe({className:e,...t}){return(0,$.jsx)(J.Group,{"data-slot":`command-group`,className:s(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function Se({className:e,...t}){return(0,$.jsx)(J.Separator,{"data-slot":`command-separator`,className:s(`-mx-1 h-px bg-border`,e),...t})}function Ce({className:e,...t}){return(0,$.jsx)(J.Item,{"data-slot":`command-item`,className:s(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function we({className:e,...t}){return(0,$.jsx)(`span`,{"data-slot":`command-shortcut`,className:s(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}export{ve as a,Se as c,_ as d,xe as i,we as l,_e as n,Ce as o,be as r,ye as s,ge as t,v as u};
@@ -0,0 +1 @@
1
+ import{a as e,s as t,u as n}from"./bundle-mjs-BegPhL5c.js";import{L as r,Lt as i,O as a,a as o,at as s,cn as c,ht as l,i as u,on as d,t as f,un as p}from"./centered-state-zzWBfO_1.js";import{t as m}from"./utils-B8s5qIcK.js";import{n as h}from"./loader-circle-CGwIVNTv.js";import{t as g}from"./search-x-BDjaMrzG.js";import{i as _,n as v,r as y,t as b}from"./run-diff-CxIDdRwy.js";import{c as x,t as S}from"./project-router-CT8Rt5Eu.js";import{a as C,p as w,t as T,v as E}from"./tasks-table--V1pKwuK.js";import{P as D,Z as O,_ as k,d as A,dt as j,f as M,g as N,h as P,it as F,m as I,p as L,t as R,u as z,x as B}from"./index-DmW_TYjO.js";var V=n(t(),1),H=e();function U(){let{groupId:e}=d(),t=r(e),n=p();if((0,V.useEffect)(()=>{e&&n.invalidateQueries({queryKey:a.groups.detail(e)})},[n,e,(s().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,H.jsx)(D,{});if(t.isError){let e=t.error instanceof l&&t.error.status===404;return(0,H.jsx)(`div`,{"data-route":`compare`,className:`flex min-h-full flex-col`,children:(0,H.jsx)(f,{icon:e?(0,H.jsx)(g,{}):(0,H.jsx)(F,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load the variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,H.jsx)(o,{asChild:!0,variant:`outline`,children:(0,H.jsx)(S,{to:`/`,children:`Back to tasks`})})})})}return(0,H.jsx)(W,{groupId:e,variants:t.data.runs})}function W({groupId:e,variants:t}){let n=x(),r=p(),[o,s]=(0,V.useState)(null),l=t.every(e=>T.has(e.status)),d=t[0]?w(t[0]):``,f=c({mutationFn:t=>i(e,t),onSuccess:(t,i)=>{r.invalidateQueries({queryKey:a.runs.all}),r.invalidateQueries({queryKey:a.groups.detail(e)}),n(`/tasks/${t.winner?.id??i}`)},onError:e=>u(e.message,{tone:`danger`})});return(0,H.jsxs)(`div`,{"data-route":`compare`,className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-5 md:px-6`,children:[(0,H.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,H.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,H.jsx)(F,{className:`size-5 shrink-0 text-violet`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,title:d,children:d})]}),(0,H.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[t.length,` variants of the same task, each in its own worktree — pick the diff you want to keep. The others are cancelled and archived, their worktrees and branches removed.`]})]}),(0,H.jsx)(`div`,{"data-slot":`compare-columns`,className:m(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,H.jsx)(G,{variant:e,allTerminal:l,pickPending:f.isPending,onPick:()=>s(e)},e.id))}),(0,H.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-2`,children:t.map(e=>(0,H.jsx)(K,{variant:e},e.id))}),(0,H.jsx)(z,{open:o!==null,onOpenChange:e=>!e&&s(null),children:(0,H.jsxs)(L,{children:[(0,H.jsxs)(N,{children:[(0,H.jsxs)(k,{children:[`Pick variant `,o?.variant,`?`]}),(0,H.jsxs)(I,{children:[`Variant `,o?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,H.jsxs)(P,{children:[(0,H.jsx)(M,{children:`Keep comparing`}),(0,H.jsxs)(A,{"data-slot":`confirm-pick`,onClick:()=>{o&&f.mutate(o.id),s(null)},children:[(0,H.jsx)(h,{"aria-hidden":`true`}),`Pick variant `,o?.variant]})]})]})})]})}function G({variant:e,allTerminal:t,pickPending:n,onPick:r}){let i=E(e),a=C(e.costUsd);return(0,H.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-violet/15 font-mono text-xs font-semibold text-violet`,children:e.variant}),(0,H.jsx)(R,{dot:i.tone,pulse:i.pulse,children:i.label}),(0,H.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] text-soft-foreground tabular-nums`,children:[O(e.tokensUsed),a?` · ${a}`:``]})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,H.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,H.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[12.5px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,H.jsx)(B,{children:e.handoffExcerpt})}):(0,H.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,H.jsxs)(o,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,H.jsx)(h,{"aria-hidden":`true`}),`Pick this one`]})]})}function K({variant:e}){let[t,n]=(0,V.useState)(!1);return(0,H.jsxs)(v,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,H.jsxs)(_,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,H.jsx)(j,{className:m(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,H.jsx)(y,{children:(0,H.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,H.jsx)(b,{runId:e.id})})})]})}export{U as CompareVariantsRoute};