@locusgraph/loop 0.2.0 → 0.3.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 (75) hide show
  1. package/dist/agent/pulse/gradient-label.js +12 -62
  2. package/dist/agent/pulse/marks/bars-mark.js +15 -37
  3. package/dist/agent/pulse/marks/glyph-mark.js +15 -54
  4. package/dist/agent/pulse/marks/locus-mark.js +12 -36
  5. package/dist/agent/pulse/marks/orb-mark.js +9 -19
  6. package/dist/agent/pulse/marks/spinner-mark.js +20 -29
  7. package/dist/agent/pulse/pulse.js +36 -123
  8. package/dist/agent/pulse/use-loop-animation.js +12 -33
  9. package/dist/agent/steps/step-icon.js +26 -96
  10. package/dist/agent/steps/steps.js +47 -210
  11. package/dist/agent/thinking/thinking.js +2 -2
  12. package/dist/agent/tool/json-block.js +11 -31
  13. package/dist/agent/tool/tool-status.js +12 -35
  14. package/dist/approval/inbox/inbox-row.js +76 -301
  15. package/dist/approval/inbox/inbox.js +39 -190
  16. package/dist/approval/inbox/virtual-inbox-list.js +26 -102
  17. package/dist/approval/memory/memory-review.js +36 -170
  18. package/dist/approval/memory/memory-row.js +50 -185
  19. package/dist/approval/plan/plan-review.js +73 -223
  20. package/dist/approval/plan/plan-step-row.js +76 -180
  21. package/dist/approval/plan/question-choices.js +44 -130
  22. package/dist/approval/plan/question.js +38 -154
  23. package/dist/approval/run/run-bar.js +39 -123
  24. package/dist/approval/shared/risk-badge.js +9 -24
  25. package/dist/approval/shared/use-focus-on-mount.js +5 -21
  26. package/dist/approval/spend/raise-cap-form.js +48 -221
  27. package/dist/approval/spend/spend-gate.js +40 -155
  28. package/dist/approval/spend/spend-meter.js +86 -313
  29. package/dist/approval/tool/approval.js +35 -194
  30. package/dist/approval/tool/args/args-editor.js +46 -204
  31. package/dist/approval/tool/args/args-field.js +55 -238
  32. package/dist/approval/tool/deny-form.js +36 -123
  33. package/dist/approval/tool/tool-inputs.js +24 -89
  34. package/dist/chat/chat/use-stick-to-bottom.js +60 -113
  35. package/dist/chat/chat/virtual-chat-items.js +34 -127
  36. package/dist/chat/composer/composer-actions.js +46 -129
  37. package/dist/chat/composer/use-auto-grow.js +8 -23
  38. package/dist/chat/files/files.js +66 -291
  39. package/dist/chat/reply/fenced-code.js +10 -32
  40. package/dist/chat/reply/markdown-components.js +2 -2
  41. package/dist/chat/reply/reply.js +24 -99
  42. package/dist/chat/turn/turn.js +46 -197
  43. package/dist/cost/context.js +65 -282
  44. package/dist/cost/cost-steps.js +42 -195
  45. package/dist/cost/cost.js +108 -497
  46. package/dist/cost/model-picker.js +42 -172
  47. package/dist/cost/shared/context-breakdown.js +65 -281
  48. package/dist/cost/shared/meter-marks.js +34 -92
  49. package/dist/cost/shared/model-option-row.js +35 -158
  50. package/dist/cost/shared/step-cost-row.js +37 -222
  51. package/dist/memory/cite.js +58 -179
  52. package/dist/memory/memorized.js +43 -195
  53. package/dist/memory/recall.js +68 -263
  54. package/dist/memory/shared/disclosure.d.ts +2 -2
  55. package/dist/memory/shared/disclosure.js +1 -1
  56. package/dist/memory/shared/source-mark.js +10 -38
  57. package/dist/memory/sources.js +52 -230
  58. package/dist/shared/decision-summary.js +35 -117
  59. package/dist/shared/panel-empty.js +15 -73
  60. package/dist/shared/panel.js +65 -239
  61. package/dist/shared/status-dot.js +10 -32
  62. package/dist/thread/actions/action-button.js +10 -53
  63. package/dist/thread/actions/branch-switcher.js +21 -95
  64. package/dist/thread/canvas/canvas.js +1 -1
  65. package/dist/thread/canvas/version-switcher.js +31 -126
  66. package/dist/thread/code/code.js +2 -2
  67. package/dist/thread/code/copy-code-button.js +24 -56
  68. package/dist/thread/history/history.js +1 -1
  69. package/dist/thread/history/row/history-row.js +18 -97
  70. package/dist/thread/history/row/thread-item-menu.js +19 -72
  71. package/dist/thread/history/row/thread-title-editor.js +29 -72
  72. package/dist/thread/history/virtual-history-list.js +46 -82
  73. package/dist/thread/starters/starters.js +27 -87
  74. package/dist/thread/use-copied.js +10 -38
  75. package/package.json +3 -3
@@ -1,4 +1,3 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn, MessageAvatar, MessageContent, MessageFooter, Message as MessageRow } from "@locusgraph/components";
3
2
  import { Thinking } from "../../agent/thinking/thinking.js";
4
3
  import { Tool } from "../../agent/tool/tool.js";
@@ -13,24 +12,14 @@ const roleLabels = {
13
12
  assistant: "Assistant said",
14
13
  system: "System note"
15
14
  };
16
- function UserText(t0) {
17
- const $ = _c(2);
18
- const {
19
- part
20
- } = t0;
21
- let t1;
22
- if ($[0] !== part.text) {
23
- t1 = /*#__PURE__*/_jsx("div", {
24
- "data-slot": "message-user-text",
25
- className: "max-w-[85%] bg-muted px-3.5 py-2 text-sm leading-relaxed whitespace-pre-wrap wrap-break-word text-foreground",
26
- children: part.text
27
- });
28
- $[0] = part.text;
29
- $[1] = t1;
30
- } else {
31
- t1 = $[1];
32
- }
33
- return t1;
15
+ function UserText({
16
+ part
17
+ }) {
18
+ return /*#__PURE__*/_jsx("div", {
19
+ "data-slot": "message-user-text",
20
+ className: "max-w-[85%] bg-muted px-3.5 py-2 text-sm leading-relaxed whitespace-pre-wrap wrap-break-word text-foreground",
21
+ children: part.text
22
+ });
34
23
  }
35
24
  function partClassName(role, kind) {
36
25
  if (role === "user") {
@@ -71,183 +60,43 @@ function renderSegment(segment, isUser, renderers) {
71
60
  });
72
61
  }
73
62
  }
74
- export function Turn(t0) {
75
- const $ = _c(52);
76
- let avatar;
77
- let className;
78
- let footer;
79
- let message;
80
- let props;
81
- let renderReasoning;
82
- let renderSources;
83
- let renderTool;
84
- if ($[0] !== t0) {
85
- ({
86
- message,
87
- avatar,
88
- footer,
89
- renderReasoning,
90
- renderTool,
91
- renderSources,
92
- className,
93
- ...props
94
- } = t0);
95
- $[0] = t0;
96
- $[1] = avatar;
97
- $[2] = className;
98
- $[3] = footer;
99
- $[4] = message;
100
- $[5] = props;
101
- $[6] = renderReasoning;
102
- $[7] = renderSources;
103
- $[8] = renderTool;
104
- } else {
105
- avatar = $[1];
106
- className = $[2];
107
- footer = $[3];
108
- message = $[4];
109
- props = $[5];
110
- renderReasoning = $[6];
111
- renderSources = $[7];
112
- renderTool = $[8];
113
- }
63
+ export function Turn({
64
+ message,
65
+ avatar,
66
+ footer,
67
+ renderReasoning,
68
+ renderTool,
69
+ renderSources,
70
+ className,
71
+ ...props
72
+ }) {
114
73
  const isUser = message.role === "user";
115
- let T0;
116
- let T1;
117
- let t1;
118
- let t2;
119
- let t3;
120
- let t4;
121
- let t5;
122
- let t6;
123
- let t7;
124
- let t8;
125
- let t9;
126
- if ($[9] !== avatar || $[10] !== className || $[11] !== isUser || $[12] !== message.parts || $[13] !== message.role || $[14] !== props || $[15] !== renderReasoning || $[16] !== renderSources || $[17] !== renderTool) {
127
- const renderers = {
128
- renderReasoning,
129
- renderTool,
130
- renderSources
131
- };
132
- T1 = MessageRow;
133
- t3 = message.role;
134
- t4 = isUser ? "end" : "start";
135
- t5 = roleLabels[message.role];
136
- t6 = "article";
137
- if ($[29] !== className) {
138
- t7 = cn("gap-3 data-[role=system]:text-muted-foreground", className);
139
- $[29] = className;
140
- $[30] = t7;
141
- } else {
142
- t7 = $[30];
143
- }
144
- t8 = props;
145
- if ($[31] !== avatar) {
146
- t9 = avatar && /*#__PURE__*/_jsx(MessageAvatar, {
147
- className: "mt-0.5 self-start group-has-data-[slot=message-footer]/message:translate-y-0",
148
- children: avatar
149
- });
150
- $[31] = avatar;
151
- $[32] = t9;
152
- } else {
153
- t9 = $[32];
154
- }
155
- T0 = MessageContent;
156
- const t10 = isUser && "items-end gap-2";
157
- if ($[33] !== t10) {
158
- t1 = cn("gap-4", t10);
159
- $[33] = t10;
160
- $[34] = t1;
161
- } else {
162
- t1 = $[34];
163
- }
164
- t2 = groupParts(message.parts).map(segment => /*#__PURE__*/_jsx("div", {
165
- "data-slot": "message-part",
166
- "data-kind": segment.kind,
167
- className: cn("flex min-w-0 flex-col", partClassName(message.role, segment.kind)),
168
- children: renderSegment(segment, isUser, renderers)
169
- }, segment.key));
170
- $[9] = avatar;
171
- $[10] = className;
172
- $[11] = isUser;
173
- $[12] = message.parts;
174
- $[13] = message.role;
175
- $[14] = props;
176
- $[15] = renderReasoning;
177
- $[16] = renderSources;
178
- $[17] = renderTool;
179
- $[18] = T0;
180
- $[19] = T1;
181
- $[20] = t1;
182
- $[21] = t2;
183
- $[22] = t3;
184
- $[23] = t4;
185
- $[24] = t5;
186
- $[25] = t6;
187
- $[26] = t7;
188
- $[27] = t8;
189
- $[28] = t9;
190
- } else {
191
- T0 = $[18];
192
- T1 = $[19];
193
- t1 = $[20];
194
- t2 = $[21];
195
- t3 = $[22];
196
- t4 = $[23];
197
- t5 = $[24];
198
- t6 = $[25];
199
- t7 = $[26];
200
- t8 = $[27];
201
- t9 = $[28];
202
- }
203
- let t10;
204
- if ($[35] !== footer) {
205
- t10 = footer && /*#__PURE__*/_jsx(MessageFooter, {
206
- className: "px-0",
207
- children: footer
208
- });
209
- $[35] = footer;
210
- $[36] = t10;
211
- } else {
212
- t10 = $[36];
213
- }
214
- let t11;
215
- if ($[37] !== T0 || $[38] !== t1 || $[39] !== t10 || $[40] !== t2) {
216
- t11 = /*#__PURE__*/_jsxs(T0, {
217
- className: t1,
218
- children: [t2, t10]
219
- });
220
- $[37] = T0;
221
- $[38] = t1;
222
- $[39] = t10;
223
- $[40] = t2;
224
- $[41] = t11;
225
- } else {
226
- t11 = $[41];
227
- }
228
- let t12;
229
- if ($[42] !== T1 || $[43] !== t11 || $[44] !== t3 || $[45] !== t4 || $[46] !== t5 || $[47] !== t6 || $[48] !== t7 || $[49] !== t8 || $[50] !== t9) {
230
- t12 = /*#__PURE__*/_jsxs(T1, {
231
- "data-role": t3,
232
- align: t4,
233
- "aria-label": t5,
234
- role: t6,
235
- className: t7,
236
- ...t8,
237
- children: [t9, t11]
238
- });
239
- $[42] = T1;
240
- $[43] = t11;
241
- $[44] = t3;
242
- $[45] = t4;
243
- $[46] = t5;
244
- $[47] = t6;
245
- $[48] = t7;
246
- $[49] = t8;
247
- $[50] = t9;
248
- $[51] = t12;
249
- } else {
250
- t12 = $[51];
251
- }
252
- return t12;
74
+ const renderers = {
75
+ renderReasoning,
76
+ renderTool,
77
+ renderSources
78
+ };
79
+ return /*#__PURE__*/_jsxs(MessageRow, {
80
+ "data-role": message.role,
81
+ align: isUser ? "end" : "start",
82
+ "aria-label": roleLabels[message.role],
83
+ role: "article",
84
+ className: cn("gap-3 data-[role=system]:text-muted-foreground", className),
85
+ ...props,
86
+ children: [avatar && /*#__PURE__*/_jsx(MessageAvatar, {
87
+ className: "mt-0.5 self-start group-has-data-[slot=message-footer]/message:translate-y-0",
88
+ children: avatar
89
+ }), /*#__PURE__*/_jsxs(MessageContent, {
90
+ className: cn("gap-4", isUser && "items-end gap-2"),
91
+ children: [groupParts(message.parts).map(segment => /*#__PURE__*/_jsx("div", {
92
+ "data-slot": "message-part",
93
+ "data-kind": segment.kind,
94
+ className: cn("flex min-w-0 flex-col", partClassName(message.role, segment.kind)),
95
+ children: renderSegment(segment, isUser, renderers)
96
+ }, segment.key)), footer && /*#__PURE__*/_jsx(MessageFooter, {
97
+ className: "px-0",
98
+ children: footer
99
+ })]
100
+ })]
101
+ });
253
102
  }
@@ -1,4 +1,3 @@
1
- import { c as _c } from "react/compiler-runtime";
2
1
  import { cn, HoverCard, HoverCardContent, HoverCardTrigger } from "@locusgraph/components";
3
2
  import { formatCount, nearLimitPercent, quotaPercent } from "@locusgraph/utils";
4
3
  import { ContextBreakdown } from "./shared/context-breakdown.js";
@@ -18,217 +17,71 @@ const statusTone = {
18
17
  near: "text-warn",
19
18
  full: "text-destructive"
20
19
  };
21
- function RingContent(t0) {
22
- const $ = _c(8);
23
- const {
24
- percent,
25
- status
26
- } = t0;
27
- let t1;
28
- if ($[0] !== percent || $[1] !== status) {
29
- t1 = /*#__PURE__*/_jsx(MeterRing, {
20
+ function RingContent({
21
+ percent,
22
+ status
23
+ }) {
24
+ return /*#__PURE__*/_jsxs(_Fragment, {
25
+ children: [/*#__PURE__*/_jsx(MeterRing, {
30
26
  percent: percent,
31
27
  status: status
32
- });
33
- $[0] = percent;
34
- $[1] = status;
35
- $[2] = t1;
36
- } else {
37
- t1 = $[2];
38
- }
39
- let t2;
40
- if ($[3] !== percent) {
41
- t2 = /*#__PURE__*/_jsxs("span", {
28
+ }), /*#__PURE__*/_jsxs("span", {
42
29
  className: "font-mono text-[11px] tabular-nums",
43
30
  children: [percent, "%"]
44
- });
45
- $[3] = percent;
46
- $[4] = t2;
47
- } else {
48
- t2 = $[4];
49
- }
50
- let t3;
51
- if ($[5] !== t1 || $[6] !== t2) {
52
- t3 = /*#__PURE__*/_jsxs(_Fragment, {
53
- children: [t1, t2]
54
- });
55
- $[5] = t1;
56
- $[6] = t2;
57
- $[7] = t3;
58
- } else {
59
- t3 = $[7];
60
- }
61
- return t3;
31
+ })]
32
+ });
62
33
  }
63
- function BarContent(t0) {
64
- const $ = _c(22);
65
- const {
66
- label,
67
- usedTokens,
68
- limitTokens,
69
- percent,
70
- status
71
- } = t0;
72
- let t1;
73
- if ($[0] !== label) {
74
- t1 = /*#__PURE__*/_jsx("span", {
75
- className: "eyebrow",
76
- children: label
77
- });
78
- $[0] = label;
79
- $[1] = t1;
80
- } else {
81
- t1 = $[1];
82
- }
83
- const t2 = status === "ok" && "text-foreground";
84
- let t3;
85
- if ($[2] !== t2) {
86
- t3 = cn(t2);
87
- $[2] = t2;
88
- $[3] = t3;
89
- } else {
90
- t3 = $[3];
91
- }
92
- let t4;
93
- if ($[4] !== usedTokens) {
94
- t4 = formatTokensShort(usedTokens);
95
- $[4] = usedTokens;
96
- $[5] = t4;
97
- } else {
98
- t4 = $[5];
99
- }
100
- let t5;
101
- if ($[6] !== limitTokens) {
102
- t5 = formatTokensShort(limitTokens);
103
- $[6] = limitTokens;
104
- $[7] = t5;
105
- } else {
106
- t5 = $[7];
107
- }
108
- let t6;
109
- if ($[8] !== percent || $[9] !== t3 || $[10] !== t4 || $[11] !== t5) {
110
- t6 = /*#__PURE__*/_jsxs("span", {
111
- className: t3,
112
- children: [percent, "% \xB7 ", t4, " / ", t5]
113
- });
114
- $[8] = percent;
115
- $[9] = t3;
116
- $[10] = t4;
117
- $[11] = t5;
118
- $[12] = t6;
119
- } else {
120
- t6 = $[12];
121
- }
122
- let t7;
123
- if ($[13] !== t1 || $[14] !== t6) {
124
- t7 = /*#__PURE__*/_jsxs("span", {
34
+ function BarContent({
35
+ label,
36
+ usedTokens,
37
+ limitTokens,
38
+ percent,
39
+ status
40
+ }) {
41
+ return /*#__PURE__*/_jsxs(_Fragment, {
42
+ children: [/*#__PURE__*/_jsxs("span", {
125
43
  className: "flex items-baseline justify-between gap-4 font-mono text-[11px] tabular-nums",
126
- children: [t1, t6]
127
- });
128
- $[13] = t1;
129
- $[14] = t6;
130
- $[15] = t7;
131
- } else {
132
- t7 = $[15];
133
- }
134
- let t8;
135
- if ($[16] !== percent || $[17] !== status) {
136
- t8 = /*#__PURE__*/_jsx(MeterBar, {
44
+ children: [/*#__PURE__*/_jsx("span", {
45
+ className: "locus-eyebrow",
46
+ children: label
47
+ }), /*#__PURE__*/_jsxs("span", {
48
+ className: cn(status === "ok" && "text-foreground"),
49
+ children: [percent, "% \xB7 ", formatTokensShort(usedTokens), " / ", formatTokensShort(limitTokens)]
50
+ })]
51
+ }), /*#__PURE__*/_jsx(MeterBar, {
137
52
  percent: percent,
138
53
  status: status
139
- });
140
- $[16] = percent;
141
- $[17] = status;
142
- $[18] = t8;
143
- } else {
144
- t8 = $[18];
145
- }
146
- let t9;
147
- if ($[19] !== t7 || $[20] !== t8) {
148
- t9 = /*#__PURE__*/_jsxs(_Fragment, {
149
- children: [t7, t8]
150
- });
151
- $[19] = t7;
152
- $[20] = t8;
153
- $[21] = t9;
154
- } else {
155
- t9 = $[21];
156
- }
157
- return t9;
54
+ })]
55
+ });
158
56
  }
159
- export function Context(t0) {
160
- const $ = _c(43);
161
- const {
162
- usedTokens,
163
- limitTokens,
164
- breakdown,
165
- variant: t1,
166
- label: t2,
167
- className
168
- } = t0;
169
- const variant = t1 === undefined ? "bar" : t1;
170
- const label = t2 === undefined ? "Context" : t2;
171
- let t3;
172
- if ($[0] !== limitTokens || $[1] !== usedTokens) {
173
- t3 = quotaPercent({
174
- used: usedTokens,
175
- included: limitTokens
176
- });
177
- $[0] = limitTokens;
178
- $[1] = usedTokens;
179
- $[2] = t3;
180
- } else {
181
- t3 = $[2];
182
- }
183
- const percent = t3;
184
- let t4;
185
- if ($[3] !== limitTokens || $[4] !== usedTokens) {
186
- t4 = contextStatus(usedTokens, limitTokens);
187
- $[3] = limitTokens;
188
- $[4] = usedTokens;
189
- $[5] = t4;
190
- } else {
191
- t4 = $[5];
192
- }
193
- const status = t4;
194
- let t5;
195
- if ($[6] !== usedTokens) {
196
- t5 = formatCount(usedTokens);
197
- $[6] = usedTokens;
198
- $[7] = t5;
199
- } else {
200
- t5 = $[7];
201
- }
202
- let t6;
203
- if ($[8] !== limitTokens) {
204
- t6 = formatCount(limitTokens);
205
- $[8] = limitTokens;
206
- $[9] = t6;
207
- } else {
208
- t6 = $[9];
209
- }
210
- const summary = `${t5} of ${t6} tokens`;
57
+ export function Context({
58
+ usedTokens,
59
+ limitTokens,
60
+ breakdown,
61
+ variant = "bar",
62
+ label = "Context",
63
+ className
64
+ }) {
65
+ const percent = quotaPercent({
66
+ used: usedTokens,
67
+ included: limitTokens
68
+ });
69
+ const status = contextStatus(usedTokens, limitTokens);
70
+ const summary = `${formatCount(usedTokens)} of ${formatCount(limitTokens)} tokens`;
211
71
  const hasBreakdown = breakdown !== undefined && breakdown.length > 0;
212
- const t7 = `${label} window`;
213
- const t8 = `${percent}%, ${summary}`;
214
- const t9 = hasBreakdown ? 0 : undefined;
215
- const t10 = statusTone[status];
216
- const t11 = variant === "ring" ? "inline-flex h-6 items-center gap-1.5 rounded-full px-2 transition-colors duration-150 motion-reduce:transition-none" : "flex w-full flex-col gap-2";
217
- const t12 = variant === "ring" && hasBreakdown && "cursor-default hover:bg-accent";
218
- let t13;
219
- if ($[10] !== className || $[11] !== t10 || $[12] !== t11 || $[13] !== t12) {
220
- t13 = cn("outline-none focus-visible:ring-2 focus-visible:ring-ring/70", t10, t11, t12, className);
221
- $[10] = className;
222
- $[11] = t10;
223
- $[12] = t11;
224
- $[13] = t12;
225
- $[14] = t13;
226
- } else {
227
- t13 = $[14];
228
- }
229
- let t14;
230
- if ($[15] !== label || $[16] !== limitTokens || $[17] !== percent || $[18] !== status || $[19] !== usedTokens || $[20] !== variant) {
231
- t14 = variant === "ring" ? /*#__PURE__*/_jsx(RingContent, {
72
+ const meter = /*#__PURE__*/_jsx("div", {
73
+ "data-slot": "context",
74
+ "data-status": status,
75
+ "data-variant": variant,
76
+ role: "meter",
77
+ "aria-label": `${label} window`,
78
+ "aria-valuemin": 0,
79
+ "aria-valuemax": 100,
80
+ "aria-valuenow": percent,
81
+ "aria-valuetext": `${percent}%, ${summary}`,
82
+ tabIndex: hasBreakdown ? 0 : undefined,
83
+ className: cn("outline-none focus-visible:ring-2 focus-visible:ring-ring/70", statusTone[status], variant === "ring" ? "inline-flex h-6 items-center gap-1.5 rounded-full px-2 transition-colors duration-150 motion-reduce:transition-none" : "flex w-full flex-col gap-2", variant === "ring" && hasBreakdown && "cursor-default hover:bg-accent", className),
84
+ children: variant === "ring" ? /*#__PURE__*/_jsx(RingContent, {
232
85
  percent: percent,
233
86
  status: status
234
87
  }) : /*#__PURE__*/_jsx(BarContent, {
@@ -237,63 +90,16 @@ export function Context(t0) {
237
90
  limitTokens: limitTokens,
238
91
  percent: percent,
239
92
  status: status
240
- });
241
- $[15] = label;
242
- $[16] = limitTokens;
243
- $[17] = percent;
244
- $[18] = status;
245
- $[19] = usedTokens;
246
- $[20] = variant;
247
- $[21] = t14;
248
- } else {
249
- t14 = $[21];
250
- }
251
- let t15;
252
- if ($[22] !== percent || $[23] !== status || $[24] !== t13 || $[25] !== t14 || $[26] !== t7 || $[27] !== t8 || $[28] !== t9 || $[29] !== variant) {
253
- t15 = /*#__PURE__*/_jsx("div", {
254
- "data-slot": "context",
255
- "data-status": status,
256
- "data-variant": variant,
257
- role: "meter",
258
- "aria-label": t7,
259
- "aria-valuemin": 0,
260
- "aria-valuemax": 100,
261
- "aria-valuenow": percent,
262
- "aria-valuetext": t8,
263
- tabIndex: t9,
264
- className: t13,
265
- children: t14
266
- });
267
- $[22] = percent;
268
- $[23] = status;
269
- $[24] = t13;
270
- $[25] = t14;
271
- $[26] = t7;
272
- $[27] = t8;
273
- $[28] = t9;
274
- $[29] = variant;
275
- $[30] = t15;
276
- } else {
277
- t15 = $[30];
278
- }
279
- const meter = t15;
280
- if (!hasBreakdown) {
281
- return meter;
282
- }
283
- let t16;
284
- if ($[31] !== meter) {
285
- t16 = /*#__PURE__*/_jsx(HoverCardTrigger, {
93
+ })
94
+ });
95
+ if (!hasBreakdown) return meter;
96
+ return /*#__PURE__*/_jsxs(HoverCard, {
97
+ openDelay: 100,
98
+ closeDelay: 100,
99
+ children: [/*#__PURE__*/_jsx(HoverCardTrigger, {
286
100
  asChild: true,
287
101
  children: meter
288
- });
289
- $[31] = meter;
290
- $[32] = t16;
291
- } else {
292
- t16 = $[32];
293
- }
294
- let t17;
295
- if ($[33] !== breakdown || $[34] !== label || $[35] !== limitTokens || $[36] !== percent || $[37] !== status || $[38] !== usedTokens) {
296
- t17 = /*#__PURE__*/_jsx(HoverCardContent, {
102
+ }), /*#__PURE__*/_jsx(HoverCardContent, {
297
103
  align: "end",
298
104
  sideOffset: 6,
299
105
  className: "w-72 rounded-none border-0 bg-popover p-0 shadow-overlay ring-1 ring-border",
@@ -305,29 +111,6 @@ export function Context(t0) {
305
111
  status: status,
306
112
  breakdown: breakdown
307
113
  })
308
- });
309
- $[33] = breakdown;
310
- $[34] = label;
311
- $[35] = limitTokens;
312
- $[36] = percent;
313
- $[37] = status;
314
- $[38] = usedTokens;
315
- $[39] = t17;
316
- } else {
317
- t17 = $[39];
318
- }
319
- let t18;
320
- if ($[40] !== t16 || $[41] !== t17) {
321
- t18 = /*#__PURE__*/_jsxs(HoverCard, {
322
- openDelay: 100,
323
- closeDelay: 100,
324
- children: [t16, t17]
325
- });
326
- $[40] = t16;
327
- $[41] = t17;
328
- $[42] = t18;
329
- } else {
330
- t18 = $[42];
331
- }
332
- return t18;
114
+ })]
115
+ });
333
116
  }