@burdenoff/microfe-billing 2026.609.2 → 2026.609.3

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.
@@ -5,19 +5,25 @@ import { formatDateTime as r, formatNumber as i, formatRelativeTime as a } from
5
5
  import { useBillingPermissions as o } from "../../../hooks/useBillingPermissions.js";
6
6
  import { useBillingAccountsForUsage as s, useEnhancedUsagePage as c, useQuotaUsageDetails as l, useWorkspaceQuotaHistory as u, useWorkspaceQuotaOverview as d } from "../hooks/useUsage.js";
7
7
  import { useCallback as ee, useDeferredValue as f, useMemo as p, useState as m } from "react";
8
- import { AlertCircle as h, AlertTriangle as g, CheckCircle as _, ChevronDown as v, ChevronLeft as y, ChevronRight as b, Clock as x, Info as S, Layers as C, Package as w, RefreshCw as T, Search as E, X as D, XCircle as O } from "lucide-react";
9
- import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
10
- import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
8
+ import { AlertCircle as h, AlertTriangle as g, CheckCircle as _, ChevronDown as v, ChevronLeft as y, ChevronRight as b, Clock as x, Info as S, Layers as C, Package as w, RefreshCw as T, Search as te, X as E, XCircle as D } from "lucide-react";
9
+ import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
10
+ import { useI18n as ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
11
  //#region src/billing/modules/usage/pages/UsagePage.tsx
12
- var ne = ({ status: e, className: n = "size-4" }) => {
12
+ function j(e, t) {
13
+ if (t?.displayName && typeof t.displayName == "string") return t.displayName;
14
+ if (t?.label && typeof t.label == "string") return t.label;
15
+ let n = e.split(".");
16
+ return (n.length > 1 ? n.slice(1) : n).map((e) => e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase())).join(" ");
17
+ }
18
+ var re = ({ status: e, className: n = "size-4" }) => {
13
19
  switch (e) {
14
- case "EXHAUSTED": return /* @__PURE__ */ A(O, { className: `${n} ${t.error.icon}` });
15
- case "CRITICAL": return /* @__PURE__ */ A(g, { className: `${n} ${t.error.icon}` });
16
- case "WARNING": return /* @__PURE__ */ A(h, { className: `${n} ${t.warning.icon}` });
17
- case "HEALTHY": return /* @__PURE__ */ A(_, { className: `${n} ${t.success.icon}` });
18
- default: return /* @__PURE__ */ A(S, { className: `${n} ${t.neutral.icon}` });
20
+ case "EXHAUSTED": return /* @__PURE__ */ k(D, { className: `${n} ${t.error.icon}` });
21
+ case "CRITICAL": return /* @__PURE__ */ k(g, { className: `${n} ${t.error.icon}` });
22
+ case "WARNING": return /* @__PURE__ */ k(h, { className: `${n} ${t.warning.icon}` });
23
+ case "HEALTHY": return /* @__PURE__ */ k(_, { className: `${n} ${t.success.icon}` });
24
+ default: return /* @__PURE__ */ k(S, { className: `${n} ${t.neutral.icon}` });
19
25
  }
20
- }, M = ({ status: e }) => /* @__PURE__ */ A("span", {
26
+ }, M = ({ status: e }) => /* @__PURE__ */ k("span", {
21
27
  className: `px-2 py-0.5 text-xs font-medium rounded ${{
22
28
  EXHAUSTED: `${t.error.bg} ${t.error.text}`,
23
29
  CRITICAL: `${t.error.bg} ${t.error.text}`,
@@ -28,9 +34,9 @@ var ne = ({ status: e, className: n = "size-4" }) => {
28
34
  children: e
29
35
  }), N = ({ percentage: e, status: n }) => {
30
36
  let r = Math.min(100, Math.max(0, e));
31
- return /* @__PURE__ */ A("div", {
37
+ return /* @__PURE__ */ k("div", {
32
38
  className: "w-full bg-muted rounded-full h-2.5 overflow-hidden",
33
- children: /* @__PURE__ */ A("div", {
39
+ children: /* @__PURE__ */ k("div", {
34
40
  className: `h-full rounded-full transition-all duration-300 ${{
35
41
  EXHAUSTED: t.error.dot,
36
42
  CRITICAL: t.error.dot,
@@ -67,60 +73,60 @@ var ne = ({ status: e, className: n = "size-4" }) => {
67
73
  red: t.error.icon,
68
74
  gray: t.neutral.icon
69
75
  };
70
- return /* @__PURE__ */ j("button", {
76
+ return /* @__PURE__ */ A("button", {
71
77
  type: "button",
72
78
  onClick: o,
73
79
  className: `border rounded-lg p-4 w-full text-left transition-all ${c[i]} ${o ? "cursor-pointer hover:shadow-md" : ""} ${a ? l[i] : ""}`,
74
- children: [/* @__PURE__ */ j("div", {
80
+ children: [/* @__PURE__ */ A("div", {
75
81
  className: "flex items-center gap-2 mb-2",
76
- children: [/* @__PURE__ */ A("span", {
82
+ children: [/* @__PURE__ */ k("span", {
77
83
  className: u[i],
78
84
  children: r
79
- }), /* @__PURE__ */ A("span", {
85
+ }), /* @__PURE__ */ k("span", {
80
86
  className: "text-sm text-muted-foreground",
81
87
  children: e
82
88
  })]
83
- }), /* @__PURE__ */ A("p", {
89
+ }), /* @__PURE__ */ k("p", {
84
90
  className: "text-2xl font-bold text-foreground",
85
91
  children: n
86
92
  })]
87
93
  });
88
94
  }, F = ({ quota: e, planLabel: t, onClick: n }) => {
89
95
  let r = e.totalLimit != null && e.totalLimit > 0 && !e.noLimit;
90
- return /* @__PURE__ */ j("tr", {
96
+ return /* @__PURE__ */ A("tr", {
91
97
  onClick: n,
92
98
  className: "cursor-pointer hover:bg-muted/40 transition-colors border-b border-border last:border-b-0",
93
99
  children: [
94
- /* @__PURE__ */ j("td", {
100
+ /* @__PURE__ */ A("td", {
95
101
  className: "px-4 py-3",
96
102
  children: [
97
- /* @__PURE__ */ A("span", {
103
+ /* @__PURE__ */ k("span", {
98
104
  className: "text-sm font-medium text-primary hover:underline capitalize",
99
105
  children: e.displayName || e.name.replace(/_/g, " ")
100
106
  }),
101
- /* @__PURE__ */ A("span", {
107
+ /* @__PURE__ */ k("span", {
102
108
  className: "block text-xs font-mono text-muted-foreground mt-0.5",
103
109
  children: e.name
104
110
  }),
105
- e.description && /* @__PURE__ */ A("span", {
111
+ e.description && /* @__PURE__ */ k("span", {
106
112
  className: "block text-xs text-muted-foreground mt-0.5 max-w-[220px] truncate",
107
113
  children: e.description
108
114
  }),
109
- e.quotaCount > 1 && /* @__PURE__ */ j("span", {
115
+ e.quotaCount > 1 && /* @__PURE__ */ A("span", {
110
116
  className: "block text-xs text-muted-foreground mt-0.5",
111
117
  children: [e.quotaCount, " assignments"]
112
118
  })
113
119
  ]
114
120
  }),
115
- t !== void 0 && /* @__PURE__ */ A("td", {
121
+ t !== void 0 && /* @__PURE__ */ k("td", {
116
122
  className: "px-4 py-3 text-sm text-muted-foreground whitespace-nowrap",
117
123
  children: t
118
124
  }),
119
- /* @__PURE__ */ A("td", {
125
+ /* @__PURE__ */ k("td", {
120
126
  className: "px-4 py-3",
121
- children: /* @__PURE__ */ j("div", {
127
+ children: /* @__PURE__ */ A("div", {
122
128
  className: "space-y-1.5",
123
- children: [/* @__PURE__ */ j("span", {
129
+ children: [/* @__PURE__ */ A("span", {
124
130
  className: "text-sm text-foreground tabular-nums",
125
131
  children: [
126
132
  i(e.totalUsed),
@@ -128,57 +134,57 @@ var ne = ({ status: e, className: n = "size-4" }) => {
128
134
  r ? i(e.totalLimit) : "∞",
129
135
  e.unit ? ` ${e.unit}` : ""
130
136
  ]
131
- }), /* @__PURE__ */ A(N, {
137
+ }), /* @__PURE__ */ k(N, {
132
138
  percentage: r ? e.usagePercentage : 0,
133
139
  status: e.status
134
140
  })]
135
141
  })
136
142
  }),
137
- /* @__PURE__ */ A("td", {
143
+ /* @__PURE__ */ k("td", {
138
144
  className: "px-4 py-3 text-sm text-muted-foreground tabular-nums whitespace-nowrap",
139
145
  children: r ? i(e.totalLimit) : "∞"
140
146
  }),
141
- /* @__PURE__ */ A("td", {
147
+ /* @__PURE__ */ k("td", {
142
148
  className: "px-4 py-3",
143
- children: /* @__PURE__ */ A(M, { status: e.status })
149
+ children: /* @__PURE__ */ k(M, { status: e.status })
144
150
  })
145
151
  ]
146
152
  });
147
- }, re = ({ quotas: e, planLabel: t, showPlanColumn: n = !0, onQuotaClick: r }) => /* @__PURE__ */ A("div", {
153
+ }, ie = ({ quotas: e, planLabel: t, showPlanColumn: n = !0, onQuotaClick: r }) => /* @__PURE__ */ k("div", {
148
154
  className: "overflow-x-auto rounded-lg border border-border bg-card",
149
- children: /* @__PURE__ */ j("table", {
155
+ children: /* @__PURE__ */ A("table", {
150
156
  className: "w-full text-left",
151
- children: [/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ j("tr", {
157
+ children: [/* @__PURE__ */ k("thead", { children: /* @__PURE__ */ A("tr", {
152
158
  className: "border-b border-border bg-muted/30",
153
159
  children: [
154
- /* @__PURE__ */ A("th", {
160
+ /* @__PURE__ */ k("th", {
155
161
  className: "px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",
156
162
  children: "Quotas"
157
163
  }),
158
- n && /* @__PURE__ */ A("th", {
164
+ n && /* @__PURE__ */ k("th", {
159
165
  className: "px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",
160
166
  children: "Plan"
161
167
  }),
162
- /* @__PURE__ */ A("th", {
168
+ /* @__PURE__ */ k("th", {
163
169
  className: "px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",
164
170
  children: "Current Usage"
165
171
  }),
166
- /* @__PURE__ */ A("th", {
172
+ /* @__PURE__ */ k("th", {
167
173
  className: "px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",
168
174
  children: "Limit"
169
175
  }),
170
- /* @__PURE__ */ A("th", {
176
+ /* @__PURE__ */ k("th", {
171
177
  className: "px-4 py-2.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",
172
178
  children: "Status"
173
179
  })
174
180
  ]
175
- }) }), /* @__PURE__ */ A("tbody", { children: e.map((e) => /* @__PURE__ */ A(F, {
181
+ }) }), /* @__PURE__ */ k("tbody", { children: e.map((e) => /* @__PURE__ */ k(F, {
176
182
  quota: e,
177
183
  planLabel: n ? t : void 0,
178
184
  onClick: () => r(e)
179
185
  }, e.name)) })]
180
186
  })
181
- }), ie = ({ subscription: e, onQuotaClick: n, defaultExpanded: r = !0 }) => {
187
+ }), I = ({ subscription: e, onQuotaClick: n, defaultExpanded: r = !0 }) => {
182
188
  let [i, a] = m(r), o = {
183
189
  active: `${t.success.bg} ${t.success.text}`,
184
190
  trialing: `${t.info.bg} ${t.info.text}`,
@@ -187,27 +193,27 @@ var ne = ({ status: e, className: n = "size-4" }) => {
187
193
  expired: `${t.neutral.bg} ${t.neutral.text}`,
188
194
  upgraded: `${t.primary.bg} ${t.primary.text}`
189
195
  };
190
- return /* @__PURE__ */ j("div", {
196
+ return /* @__PURE__ */ A("div", {
191
197
  className: "border border-border rounded-lg bg-card overflow-hidden",
192
198
  children: [
193
- /* @__PURE__ */ j("button", {
199
+ /* @__PURE__ */ A("button", {
194
200
  type: "button",
195
201
  onClick: () => a(!i),
196
202
  className: "w-full flex items-center justify-between p-4 hover:bg-muted/50 transition-colors",
197
- children: [/* @__PURE__ */ j("div", {
203
+ children: [/* @__PURE__ */ A("div", {
198
204
  className: "flex items-center gap-3",
199
- children: [/* @__PURE__ */ A(w, { className: "size-5 text-primary" }), /* @__PURE__ */ j("div", {
205
+ children: [/* @__PURE__ */ k(w, { className: "size-5 text-primary" }), /* @__PURE__ */ A("div", {
200
206
  className: "text-left",
201
- children: [/* @__PURE__ */ j("div", {
207
+ children: [/* @__PURE__ */ A("div", {
202
208
  className: "flex items-center gap-2",
203
- children: [/* @__PURE__ */ A("span", {
209
+ children: [/* @__PURE__ */ k("span", {
204
210
  className: "font-medium text-foreground",
205
211
  children: "Subscription"
206
- }), /* @__PURE__ */ A("span", {
212
+ }), /* @__PURE__ */ k("span", {
207
213
  className: `px-2 py-0.5 text-xs font-medium rounded capitalize ${o[e.status.toLowerCase()] || o.active}`,
208
214
  children: e.status
209
215
  })]
210
- }), /* @__PURE__ */ j("p", {
216
+ }), /* @__PURE__ */ A("p", {
211
217
  className: "text-xs text-muted-foreground",
212
218
  children: [
213
219
  e.aggregatedQuotas.length,
@@ -216,20 +222,20 @@ var ne = ({ status: e, className: n = "size-4" }) => {
216
222
  ]
217
223
  })]
218
224
  })]
219
- }), A(i ? v : b, { className: "size-5 text-muted-foreground" })]
225
+ }), k(i ? v : b, { className: "size-5 text-muted-foreground" })]
220
226
  }),
221
- i && e.aggregatedQuotas.length > 0 && /* @__PURE__ */ A("div", {
227
+ i && e.aggregatedQuotas.length > 0 && /* @__PURE__ */ k("div", {
222
228
  className: "border-t border-border",
223
- children: /* @__PURE__ */ A(re, {
229
+ children: /* @__PURE__ */ k(ie, {
224
230
  quotas: e.aggregatedQuotas,
225
231
  planLabel: e.planName || e.productId || void 0,
226
232
  showPlanColumn: !!(e.planName || e.productId),
227
233
  onQuotaClick: n
228
234
  })
229
235
  }),
230
- i && e.aggregatedQuotas.length === 0 && /* @__PURE__ */ A("div", {
236
+ i && e.aggregatedQuotas.length === 0 && /* @__PURE__ */ k("div", {
231
237
  className: "border-t border-border p-6 text-center",
232
- children: /* @__PURE__ */ A("p", {
238
+ children: /* @__PURE__ */ k("p", {
233
239
  className: "text-sm text-muted-foreground",
234
240
  children: "No quotas assigned to this subscription"
235
241
  })
@@ -242,39 +248,39 @@ var ne = ({ status: e, className: n = "size-4" }) => {
242
248
  }, w = () => {
243
249
  s.length > 1 && c((e) => e.slice(0, -1));
244
250
  };
245
- return /* @__PURE__ */ j("div", {
251
+ return /* @__PURE__ */ A("div", {
246
252
  className: "fixed inset-0 z-50 flex items-center justify-center",
247
- children: [/* @__PURE__ */ A("div", {
253
+ children: [/* @__PURE__ */ k("div", {
248
254
  className: "absolute inset-0 bg-overlay-scrim",
249
255
  onClick: o
250
- }), /* @__PURE__ */ j("div", {
256
+ }), /* @__PURE__ */ A("div", {
251
257
  className: "relative bg-background border border-border rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[90vh] overflow-auto",
252
258
  role: "dialog",
253
259
  "aria-modal": "true",
254
260
  "aria-labelledby": "quota-detail-title",
255
261
  children: [
256
- /* @__PURE__ */ j("div", {
262
+ /* @__PURE__ */ A("div", {
257
263
  className: "sticky top-0 bg-background border-b border-border p-4 flex items-center justify-between",
258
- children: [/* @__PURE__ */ j("div", {
264
+ children: [/* @__PURE__ */ A("div", {
259
265
  className: "flex items-center gap-3",
260
- children: [/* @__PURE__ */ A(ne, {
266
+ children: [/* @__PURE__ */ k(re, {
261
267
  status: n.status,
262
268
  className: "size-5"
263
- }), /* @__PURE__ */ j("div", { children: [
264
- /* @__PURE__ */ A("h2", {
269
+ }), /* @__PURE__ */ A("div", { children: [
270
+ /* @__PURE__ */ k("h2", {
265
271
  id: "quota-detail-title",
266
272
  className: "text-lg font-semibold capitalize",
267
273
  children: n.displayName || n.name.replace(/_/g, " ")
268
274
  }),
269
- /* @__PURE__ */ A("p", {
275
+ /* @__PURE__ */ k("p", {
270
276
  className: "text-xs font-mono text-muted-foreground",
271
277
  children: n.name
272
278
  }),
273
- n.description && /* @__PURE__ */ A("p", {
279
+ n.description && /* @__PURE__ */ k("p", {
274
280
  className: "text-sm text-muted-foreground mt-0.5",
275
281
  children: n.description
276
282
  }),
277
- /* @__PURE__ */ j("p", {
283
+ /* @__PURE__ */ A("p", {
278
284
  className: "text-sm text-muted-foreground mt-0.5",
279
285
  children: [
280
286
  n.quotaCount,
@@ -283,33 +289,33 @@ var ne = ({ status: e, className: n = "size-4" }) => {
283
289
  ]
284
290
  })
285
291
  ] })]
286
- }), /* @__PURE__ */ A("button", {
292
+ }), /* @__PURE__ */ k("button", {
287
293
  type: "button",
288
294
  onClick: o,
289
295
  className: "p-1 rounded-md hover:bg-muted/50 transition-colors",
290
296
  "aria-label": "Close quota details",
291
- children: /* @__PURE__ */ A(D, { className: "size-5" })
297
+ children: /* @__PURE__ */ k(E, { className: "size-5" })
292
298
  })]
293
299
  }),
294
- /* @__PURE__ */ j("div", {
300
+ /* @__PURE__ */ A("div", {
295
301
  className: "p-4 border-b border-border",
296
- children: [/* @__PURE__ */ j("div", {
302
+ children: [/* @__PURE__ */ A("div", {
297
303
  className: "mb-4",
298
304
  children: [
299
- /* @__PURE__ */ j("div", {
305
+ /* @__PURE__ */ A("div", {
300
306
  className: "flex items-center justify-between mb-2",
301
- children: [/* @__PURE__ */ A("span", {
307
+ children: [/* @__PURE__ */ k("span", {
302
308
  className: "text-sm text-muted-foreground",
303
309
  children: "Usage"
304
- }), /* @__PURE__ */ A(M, { status: n.status })]
310
+ }), /* @__PURE__ */ k(M, { status: n.status })]
305
311
  }),
306
- /* @__PURE__ */ A(N, {
312
+ /* @__PURE__ */ k(N, {
307
313
  percentage: n.usagePercentage,
308
314
  status: n.status
309
315
  }),
310
- /* @__PURE__ */ j("div", {
316
+ /* @__PURE__ */ A("div", {
311
317
  className: "flex items-center justify-between mt-2 text-sm",
312
- children: [/* @__PURE__ */ j("span", {
318
+ children: [/* @__PURE__ */ A("span", {
313
319
  className: "font-medium",
314
320
  children: [
315
321
  i(n.totalUsed),
@@ -318,44 +324,44 @@ var ne = ({ status: e, className: n = "size-4" }) => {
318
324
  n.totalLimit != null && n.totalLimit > 0 ? i(n.totalLimit) : "∞",
319
325
  n.unit && ` ${n.unit}`
320
326
  ]
321
- }), /* @__PURE__ */ A("span", {
327
+ }), /* @__PURE__ */ k("span", {
322
328
  className: "text-muted-foreground",
323
329
  children: n.totalLimit != null && n.totalLimit > 0 ? `${Math.round(n.usagePercentage)}% used` : "Unlimited"
324
330
  })]
325
331
  })
326
332
  ]
327
- }), n.quotaCount > 1 && /* @__PURE__ */ j("div", {
333
+ }), n.quotaCount > 1 && /* @__PURE__ */ A("div", {
328
334
  className: "mt-4",
329
- children: [/* @__PURE__ */ A("h3", {
335
+ children: [/* @__PURE__ */ k("h3", {
330
336
  className: "text-sm font-medium text-foreground mb-3",
331
337
  children: "Quota Breakdown"
332
- }), /* @__PURE__ */ A("div", {
338
+ }), /* @__PURE__ */ k("div", {
333
339
  className: "border border-border rounded-lg overflow-hidden divide-y divide-border",
334
340
  children: [...n.quotaAssignments].sort((e, t) => (e.endtime ? new Date(e.endtime).getTime() : Infinity) - (t.endtime ? new Date(t.endtime).getTime() : Infinity)).map((e) => {
335
341
  let n = e.endtime ? new Date(e.endtime) : null, r = /* @__PURE__ */ new Date(), a = n && n < r, o = n ? Math.ceil((n.getTime() - r.getTime()) / (1440 * 60 * 1e3)) : null, s = o !== null && o > 0 && o <= 7;
336
- return /* @__PURE__ */ j("div", {
342
+ return /* @__PURE__ */ A("div", {
337
343
  className: `flex items-center justify-between px-3 py-2.5 ${a ? "bg-muted/30" : s ? t.warning.bg : "bg-background"}`,
338
- children: [/* @__PURE__ */ j("div", {
344
+ children: [/* @__PURE__ */ A("div", {
339
345
  className: "flex items-center gap-2",
340
- children: [s && !a && /* @__PURE__ */ A("span", { className: `size-2 rounded-full ${t.warning.dot} animate-pulse` }), /* @__PURE__ */ j("div", {
346
+ children: [s && !a && /* @__PURE__ */ k("span", { className: `size-2 rounded-full ${t.warning.dot} animate-pulse` }), /* @__PURE__ */ A("div", {
341
347
  className: "flex flex-col",
342
- children: [/* @__PURE__ */ A("span", {
348
+ children: [/* @__PURE__ */ k("span", {
343
349
  className: `text-sm ${a ? "text-muted-foreground" : "text-foreground"}`,
344
350
  children: n ? n.toLocaleDateString("en-US", {
345
351
  month: "short",
346
352
  day: "numeric",
347
353
  year: "numeric"
348
354
  }) : "No expiry"
349
- }), /* @__PURE__ */ A("span", {
355
+ }), /* @__PURE__ */ k("span", {
350
356
  className: `text-xs ${a ? "text-destructive" : s ? t.warning.text : "text-muted-foreground"}`,
351
357
  children: a ? "Expired" : o === null ? "Never expires" : o === 0 ? "Expires today" : o === 1 ? "Expires tomorrow" : `${o} days left`
352
358
  })]
353
359
  })]
354
- }), /* @__PURE__ */ A("div", {
360
+ }), /* @__PURE__ */ k("div", {
355
361
  className: "text-right",
356
- children: /* @__PURE__ */ j("span", {
362
+ children: /* @__PURE__ */ A("span", {
357
363
  className: `text-sm font-semibold ${a ? "text-muted-foreground" : "text-foreground"}`,
358
- children: [i(e.used), /* @__PURE__ */ j("span", {
364
+ children: [i(e.used), /* @__PURE__ */ A("span", {
359
365
  className: "text-muted-foreground font-normal",
360
366
  children: [
361
367
  " / ",
@@ -370,34 +376,34 @@ var ne = ({ status: e, className: n = "size-4" }) => {
370
376
  })]
371
377
  })]
372
378
  }),
373
- (S || x.length > 0) && /* @__PURE__ */ j("div", {
379
+ (S || x.length > 0) && /* @__PURE__ */ A("div", {
374
380
  className: "p-4 border-t border-border",
375
- children: [/* @__PURE__ */ A("h3", {
381
+ children: [/* @__PURE__ */ k("h3", {
376
382
  className: "text-sm font-medium text-foreground mb-3",
377
383
  children: "Live Value History"
378
- }), S ? /* @__PURE__ */ A("div", {
384
+ }), S ? /* @__PURE__ */ k("div", {
379
385
  className: "space-y-1.5",
380
386
  children: [
381
387
  1,
382
388
  2,
383
389
  3
384
- ].map((e) => /* @__PURE__ */ A("div", { className: "h-8 bg-muted animate-pulse rounded" }, e))
385
- }) : /* @__PURE__ */ A("div", {
390
+ ].map((e) => /* @__PURE__ */ k("div", { className: "h-8 bg-muted animate-pulse rounded" }, e))
391
+ }) : /* @__PURE__ */ k("div", {
386
392
  className: "space-y-1.5",
387
- children: x.map((e) => /* @__PURE__ */ j("div", {
393
+ children: x.map((e) => /* @__PURE__ */ A("div", {
388
394
  className: "flex items-center justify-between px-3 py-2 bg-muted/30 rounded-md",
389
- children: [/* @__PURE__ */ A("span", {
395
+ children: [/* @__PURE__ */ k("span", {
390
396
  className: "text-xs text-muted-foreground",
391
397
  children: r(e.snapshotAt)
392
- }), /* @__PURE__ */ j("span", {
398
+ }), /* @__PURE__ */ A("span", {
393
399
  className: "text-sm font-medium text-foreground tabular-nums",
394
400
  children: [
395
401
  i(e.value),
396
- n.unit && /* @__PURE__ */ A("span", {
402
+ n.unit && /* @__PURE__ */ k("span", {
397
403
  className: "text-xs text-muted-foreground ml-1",
398
404
  children: n.unit
399
405
  }),
400
- !e.noLimit && e.limit != null && /* @__PURE__ */ j("span", {
406
+ !e.noLimit && e.limit != null && /* @__PURE__ */ A("span", {
401
407
  className: "text-xs text-muted-foreground ml-1",
402
408
  children: ["/ ", i(e.limit)]
403
409
  })
@@ -406,36 +412,36 @@ var ne = ({ status: e, className: n = "size-4" }) => {
406
412
  }, e.id))
407
413
  })]
408
414
  }),
409
- /* @__PURE__ */ j("div", {
415
+ /* @__PURE__ */ A("div", {
410
416
  className: "p-4",
411
417
  children: [
412
- /* @__PURE__ */ A("h3", {
418
+ /* @__PURE__ */ k("h3", {
413
419
  className: "text-sm font-medium text-foreground mb-3",
414
420
  children: "Recent Usage"
415
421
  }),
416
- n.isCollectorBased ? /* @__PURE__ */ A("p", {
422
+ n.isCollectorBased ? /* @__PURE__ */ k("p", {
417
423
  className: "text-sm text-muted-foreground text-center py-6",
418
424
  children: "Usage is tracked via system metrics, individual event records are not available for this quota."
419
- }) : v ? /* @__PURE__ */ A("div", {
425
+ }) : v ? /* @__PURE__ */ k("div", {
420
426
  className: "space-y-2",
421
427
  children: [
422
428
  1,
423
429
  2,
424
430
  3
425
- ].map((e) => /* @__PURE__ */ A("div", { className: "h-12 bg-muted animate-pulse rounded" }, e))
426
- }) : h.length === 0 ? /* @__PURE__ */ A("p", {
431
+ ].map((e) => /* @__PURE__ */ k("div", { className: "h-12 bg-muted animate-pulse rounded" }, e))
432
+ }) : h.length === 0 ? /* @__PURE__ */ k("p", {
427
433
  className: "text-sm text-muted-foreground text-center py-6",
428
434
  children: "No usage records found"
429
- }) : /* @__PURE__ */ A("div", {
435
+ }) : /* @__PURE__ */ k("div", {
430
436
  className: "space-y-2",
431
- children: h.map((e) => /* @__PURE__ */ j("div", {
437
+ children: h.map((e) => /* @__PURE__ */ A("div", {
432
438
  className: "flex items-center justify-between p-3 border border-border rounded-lg",
433
- children: [/* @__PURE__ */ j("div", {
439
+ children: [/* @__PURE__ */ A("div", {
434
440
  className: "flex-1 min-w-0",
435
- children: [/* @__PURE__ */ A("p", {
441
+ children: [/* @__PURE__ */ k("p", {
436
442
  className: "text-sm font-medium text-foreground",
437
443
  children: e.description || "Usage recorded"
438
- }), /* @__PURE__ */ j("p", {
444
+ }), /* @__PURE__ */ A("p", {
439
445
  className: "text-xs text-muted-foreground",
440
446
  children: [
441
447
  a(e.timestamp),
@@ -443,42 +449,42 @@ var ne = ({ status: e, className: n = "size-4" }) => {
443
449
  r(e.timestamp)
444
450
  ]
445
451
  })]
446
- }), /* @__PURE__ */ A("span", {
452
+ }), /* @__PURE__ */ k("span", {
447
453
  className: "text-sm font-medium text-foreground ml-4",
448
454
  children: i(e.amount)
449
455
  })]
450
456
  }, e.id))
451
457
  }),
452
- !n.isCollectorBased && (s.length > 1 || g) && /* @__PURE__ */ j("div", {
458
+ !n.isCollectorBased && (s.length > 1 || g) && /* @__PURE__ */ A("div", {
453
459
  className: "flex items-center justify-center gap-2 mt-4",
454
460
  children: [
455
- /* @__PURE__ */ A("button", {
461
+ /* @__PURE__ */ k("button", {
456
462
  type: "button",
457
463
  onClick: w,
458
464
  disabled: s.length === 1,
459
465
  className: "px-3 py-1.5 text-sm border border-border rounded-md disabled:opacity-50",
460
466
  "aria-label": "Previous usage page",
461
- children: /* @__PURE__ */ A(y, { className: "size-4" })
467
+ children: /* @__PURE__ */ k(y, { className: "size-4" })
462
468
  }),
463
- /* @__PURE__ */ j("span", {
469
+ /* @__PURE__ */ A("span", {
464
470
  className: "text-sm text-muted-foreground",
465
471
  children: ["Page ", ee]
466
472
  }),
467
- /* @__PURE__ */ A("button", {
473
+ /* @__PURE__ */ k("button", {
468
474
  type: "button",
469
475
  onClick: C,
470
476
  disabled: !g,
471
477
  className: "px-3 py-1.5 text-sm border border-border rounded-md disabled:opacity-50",
472
478
  "aria-label": "Next usage page",
473
- children: /* @__PURE__ */ A(b, { className: "size-4" })
479
+ children: /* @__PURE__ */ k(b, { className: "size-4" })
474
480
  })
475
481
  ]
476
482
  })
477
483
  ]
478
484
  }),
479
- /* @__PURE__ */ A("div", {
485
+ /* @__PURE__ */ k("div", {
480
486
  className: "sticky bottom-0 bg-background border-t border-border p-4",
481
- children: /* @__PURE__ */ A("button", {
487
+ children: /* @__PURE__ */ k("button", {
482
488
  type: "button",
483
489
  onClick: o,
484
490
  className: "w-full py-2 px-4 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
@@ -489,28 +495,28 @@ var ne = ({ status: e, className: n = "size-4" }) => {
489
495
  })]
490
496
  });
491
497
  };
492
- function I(e, t) {
498
+ function L(e, t) {
493
499
  return t ? n.HEALTHY : e >= 100 ? n.EXHAUSTED : e >= 90 ? n.CRITICAL : e >= 75 ? n.WARNING : n.HEALTHY;
494
500
  }
495
501
  var oe = ({ workspaceId: e }) => {
496
502
  let { overview: n, isLoading: r, error: a, refetch: o } = d(e);
497
- if (r && n.length === 0) return /* @__PURE__ */ A("div", {
503
+ if (r && n.length === 0) return /* @__PURE__ */ k("div", {
498
504
  className: "space-y-3",
499
505
  children: [
500
506
  1,
501
507
  2,
502
508
  3
503
- ].map((e) => /* @__PURE__ */ A("div", { className: "h-16 bg-muted animate-pulse rounded-lg" }, e))
509
+ ].map((e) => /* @__PURE__ */ k("div", { className: "h-16 bg-muted animate-pulse rounded-lg" }, e))
504
510
  });
505
- if (a) return /* @__PURE__ */ j("div", {
511
+ if (a) return /* @__PURE__ */ A("div", {
506
512
  className: "text-center py-8 space-y-2",
507
513
  children: [
508
- /* @__PURE__ */ A(g, { className: "size-8 text-destructive mx-auto" }),
509
- /* @__PURE__ */ A("p", {
514
+ /* @__PURE__ */ k(g, { className: "size-8 text-destructive mx-auto" }),
515
+ /* @__PURE__ */ k("p", {
510
516
  className: "text-sm text-muted-foreground",
511
517
  children: a.message
512
518
  }),
513
- /* @__PURE__ */ A("button", {
519
+ /* @__PURE__ */ k("button", {
514
520
  type: "button",
515
521
  onClick: () => o(),
516
522
  className: "px-3 py-1.5 text-sm border border-border rounded-md hover:bg-muted/50 transition-colors",
@@ -518,141 +524,148 @@ var oe = ({ workspaceId: e }) => {
518
524
  })
519
525
  ]
520
526
  });
521
- if (n.length === 0) return /* @__PURE__ */ j("div", {
527
+ if (n.length === 0) return /* @__PURE__ */ A("div", {
522
528
  className: "text-center py-12 space-y-2",
523
529
  children: [
524
- /* @__PURE__ */ A(C, { className: "size-10 text-muted-foreground mx-auto opacity-40" }),
525
- /* @__PURE__ */ A("h3", {
530
+ /* @__PURE__ */ k(C, { className: "size-10 text-muted-foreground mx-auto opacity-40" }),
531
+ /* @__PURE__ */ k("h3", {
526
532
  className: "text-base font-medium text-foreground",
527
533
  children: "No workspace quotas assigned"
528
534
  }),
529
- /* @__PURE__ */ A("p", {
535
+ /* @__PURE__ */ k("p", {
530
536
  className: "text-sm text-muted-foreground max-w-sm mx-auto",
531
537
  children: "Quotas are assigned to this workspace after a successful purchase. If you have an active subscription, contact support."
532
538
  })
533
539
  ]
534
540
  });
535
- let s = n.filter((e) => I(e.usagePercentage, e.assignment.noLimit) === "HEALTHY").length, c = n.filter((e) => I(e.usagePercentage, e.assignment.noLimit) === "WARNING").length, l = n.filter((e) => {
536
- let t = I(e.usagePercentage, e.assignment.noLimit);
541
+ let s = n.filter((e) => L(e.usagePercentage, e.assignment.noLimit) === "HEALTHY").length, c = n.filter((e) => L(e.usagePercentage, e.assignment.noLimit) === "WARNING").length, l = n.filter((e) => {
542
+ let t = L(e.usagePercentage, e.assignment.noLimit);
537
543
  return t === "CRITICAL" || t === "EXHAUSTED";
538
544
  }).length;
539
- return /* @__PURE__ */ j("div", {
545
+ return /* @__PURE__ */ A("div", {
540
546
  className: "space-y-4",
541
547
  children: [
542
- /* @__PURE__ */ j("div", {
548
+ /* @__PURE__ */ A("div", {
543
549
  className: "grid grid-cols-3 gap-3",
544
550
  children: [
545
- /* @__PURE__ */ j("div", {
551
+ /* @__PURE__ */ A("div", {
546
552
  className: `border rounded-lg p-3 ${t.success.bg} ${t.success.border}`,
547
- children: [/* @__PURE__ */ j("div", {
553
+ children: [/* @__PURE__ */ A("div", {
548
554
  className: "flex items-center gap-1.5 mb-1",
549
- children: [/* @__PURE__ */ A(_, { className: `size-4 ${t.success.icon}` }), /* @__PURE__ */ A("span", {
555
+ children: [/* @__PURE__ */ k(_, { className: `size-4 ${t.success.icon}` }), /* @__PURE__ */ k("span", {
550
556
  className: "text-xs text-muted-foreground",
551
557
  children: "Healthy"
552
558
  })]
553
- }), /* @__PURE__ */ A("p", {
559
+ }), /* @__PURE__ */ k("p", {
554
560
  className: "text-xl font-bold text-foreground",
555
561
  children: s
556
562
  })]
557
563
  }),
558
- /* @__PURE__ */ j("div", {
564
+ /* @__PURE__ */ A("div", {
559
565
  className: `border rounded-lg p-3 ${t.warning.bg} ${t.warning.border}`,
560
- children: [/* @__PURE__ */ j("div", {
566
+ children: [/* @__PURE__ */ A("div", {
561
567
  className: "flex items-center gap-1.5 mb-1",
562
- children: [/* @__PURE__ */ A(h, { className: `size-4 ${t.warning.icon}` }), /* @__PURE__ */ A("span", {
568
+ children: [/* @__PURE__ */ k(h, { className: `size-4 ${t.warning.icon}` }), /* @__PURE__ */ k("span", {
563
569
  className: "text-xs text-muted-foreground",
564
570
  children: "Warning"
565
571
  })]
566
- }), /* @__PURE__ */ A("p", {
572
+ }), /* @__PURE__ */ k("p", {
567
573
  className: "text-xl font-bold text-foreground",
568
574
  children: c
569
575
  })]
570
576
  }),
571
- /* @__PURE__ */ j("div", {
577
+ /* @__PURE__ */ A("div", {
572
578
  className: `border rounded-lg p-3 ${t.error.bg} ${t.error.border}`,
573
- children: [/* @__PURE__ */ j("div", {
579
+ children: [/* @__PURE__ */ A("div", {
574
580
  className: "flex items-center gap-1.5 mb-1",
575
- children: [/* @__PURE__ */ A(O, { className: `size-4 ${t.error.icon}` }), /* @__PURE__ */ A("span", {
581
+ children: [/* @__PURE__ */ k(D, { className: `size-4 ${t.error.icon}` }), /* @__PURE__ */ k("span", {
576
582
  className: "text-xs text-muted-foreground",
577
583
  children: "Critical / Exhausted"
578
584
  })]
579
- }), /* @__PURE__ */ A("p", {
585
+ }), /* @__PURE__ */ k("p", {
580
586
  className: "text-xl font-bold text-foreground",
581
587
  children: l
582
588
  })]
583
589
  })
584
590
  ]
585
591
  }),
586
- /* @__PURE__ */ A("div", {
592
+ /* @__PURE__ */ k("div", {
587
593
  className: "border border-border rounded-lg overflow-hidden",
588
- children: /* @__PURE__ */ j("table", {
594
+ children: /* @__PURE__ */ A("table", {
589
595
  className: "w-full text-sm",
590
- children: [/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ j("tr", {
596
+ children: [/* @__PURE__ */ k("thead", { children: /* @__PURE__ */ A("tr", {
591
597
  className: "border-b border-border bg-muted/30",
592
598
  children: [
593
- /* @__PURE__ */ A("th", {
599
+ /* @__PURE__ */ k("th", {
594
600
  className: "text-left px-4 py-3 font-medium text-muted-foreground",
595
601
  children: "Quota"
596
602
  }),
597
- /* @__PURE__ */ A("th", {
603
+ /* @__PURE__ */ k("th", {
598
604
  className: "text-left px-4 py-3 font-medium text-muted-foreground hidden sm:table-cell",
599
605
  children: "Product"
600
606
  }),
601
- /* @__PURE__ */ A("th", {
607
+ /* @__PURE__ */ k("th", {
602
608
  className: "text-left px-4 py-3 font-medium text-muted-foreground hidden md:table-cell",
603
609
  children: "Mode"
604
610
  }),
605
- /* @__PURE__ */ A("th", {
611
+ /* @__PURE__ */ k("th", {
606
612
  className: "text-left px-4 py-3 font-medium text-muted-foreground",
607
613
  children: "Usage"
608
614
  }),
609
- /* @__PURE__ */ A("th", {
615
+ /* @__PURE__ */ k("th", {
610
616
  className: "text-left px-4 py-3 font-medium text-muted-foreground hidden sm:table-cell",
611
617
  children: "Limit"
612
618
  }),
613
- /* @__PURE__ */ A("th", {
619
+ /* @__PURE__ */ k("th", {
614
620
  className: "text-left px-4 py-3 font-medium text-muted-foreground",
615
621
  children: "Status"
616
622
  })
617
623
  ]
618
- }) }), /* @__PURE__ */ A("tbody", {
624
+ }) }), /* @__PURE__ */ k("tbody", {
619
625
  className: "divide-y divide-border",
620
626
  children: n.map((e) => {
621
- let { assignment: t, liveStatus: n, effectiveUsed: r, remaining: a, usagePercentage: o } = e, s = I(o, t.noLimit), c = n !== null;
622
- return /* @__PURE__ */ j("tr", {
627
+ let { assignment: t, liveStatus: n, effectiveUsed: r, remaining: a, usagePercentage: o } = e, s = L(o, t.noLimit), c = n !== null;
628
+ return /* @__PURE__ */ A("tr", {
623
629
  className: "hover:bg-muted/20 transition-colors",
624
630
  children: [
625
- /* @__PURE__ */ j("td", {
631
+ /* @__PURE__ */ A("td", {
626
632
  className: "px-4 py-3",
627
- children: [/* @__PURE__ */ A("div", {
628
- className: "font-medium text-foreground",
629
- children: t.quotaName
630
- }), c && /* @__PURE__ */ j("div", {
631
- className: "text-xs text-muted-foreground mt-0.5",
632
- children: ["Live · ", new Date(n.scrapedAt).toLocaleTimeString()]
633
- })]
633
+ children: [
634
+ /* @__PURE__ */ k("div", {
635
+ className: "font-medium text-foreground",
636
+ children: j(t.quotaName)
637
+ }),
638
+ /* @__PURE__ */ k("div", {
639
+ className: "text-xs font-mono text-muted-foreground mt-0.5",
640
+ children: t.quotaName
641
+ }),
642
+ c && /* @__PURE__ */ A("div", {
643
+ className: "text-xs text-muted-foreground mt-0.5",
644
+ children: ["Live · ", new Date(n.scrapedAt).toLocaleTimeString()]
645
+ })
646
+ ]
634
647
  }),
635
- /* @__PURE__ */ A("td", {
648
+ /* @__PURE__ */ k("td", {
636
649
  className: "px-4 py-3 hidden sm:table-cell",
637
- children: /* @__PURE__ */ A("span", {
650
+ children: /* @__PURE__ */ k("span", {
638
651
  className: "text-xs text-muted-foreground bg-muted px-1.5 py-0.5 rounded",
639
652
  children: t.productId
640
653
  })
641
654
  }),
642
- /* @__PURE__ */ A("td", {
655
+ /* @__PURE__ */ k("td", {
643
656
  className: "px-4 py-3 hidden md:table-cell",
644
- children: /* @__PURE__ */ A("span", {
657
+ children: /* @__PURE__ */ k("span", {
645
658
  className: "text-xs text-muted-foreground capitalize",
646
659
  children: t.quotaMode
647
660
  })
648
661
  }),
649
- /* @__PURE__ */ A("td", {
662
+ /* @__PURE__ */ k("td", {
650
663
  className: "px-4 py-3",
651
- children: /* @__PURE__ */ j("div", {
664
+ children: /* @__PURE__ */ A("div", {
652
665
  className: "space-y-1.5",
653
- children: [/* @__PURE__ */ j("div", {
666
+ children: [/* @__PURE__ */ A("div", {
654
667
  className: "text-foreground",
655
- children: [i(r), !t.noLimit && t.limit != null && /* @__PURE__ */ j("span", {
668
+ children: [i(r), !t.noLimit && t.limit != null && /* @__PURE__ */ A("span", {
656
669
  className: "text-muted-foreground",
657
670
  children: [
658
671
  " ",
@@ -660,22 +673,22 @@ var oe = ({ workspaceId: e }) => {
660
673
  i(t.limit)
661
674
  ]
662
675
  })]
663
- }), !t.noLimit && /* @__PURE__ */ A(N, {
676
+ }), !t.noLimit && /* @__PURE__ */ k(N, {
664
677
  percentage: o,
665
678
  status: s
666
679
  })]
667
680
  })
668
681
  }),
669
- /* @__PURE__ */ A("td", {
682
+ /* @__PURE__ */ k("td", {
670
683
  className: "px-4 py-3 hidden sm:table-cell text-foreground",
671
- children: t.noLimit ? /* @__PURE__ */ A("span", {
684
+ children: t.noLimit ? /* @__PURE__ */ k("span", {
672
685
  className: "text-muted-foreground",
673
686
  children: "Unlimited"
674
687
  }) : i(a ?? 0)
675
688
  }),
676
- /* @__PURE__ */ A("td", {
689
+ /* @__PURE__ */ k("td", {
677
690
  className: "px-4 py-3",
678
- children: /* @__PURE__ */ A(M, { status: s })
691
+ children: /* @__PURE__ */ k(M, { status: s })
679
692
  })
680
693
  ]
681
694
  }, t.id);
@@ -683,7 +696,7 @@ var oe = ({ workspaceId: e }) => {
683
696
  })]
684
697
  })
685
698
  }),
686
- /* @__PURE__ */ j("p", {
699
+ /* @__PURE__ */ A("p", {
687
700
  className: "text-xs text-muted-foreground",
688
701
  children: [
689
702
  "Workspace quotas are sourced from the activity service.",
@@ -693,103 +706,103 @@ var oe = ({ workspaceId: e }) => {
693
706
  })
694
707
  ]
695
708
  });
696
- }, L = () => {
697
- let { t: n } = te(), r = (e, t) => {
709
+ }, se = () => {
710
+ let { t: n } = ne(), r = (e, t) => {
698
711
  let r = n(e);
699
712
  return r === e ? t : r;
700
713
  }, i = o(), [a, l] = m(() => {
701
714
  if (!(typeof window > "u")) return new URLSearchParams(window.location.search).get("billingAccountId") || void 0;
702
- }), [u, d] = m(null), [y, b] = m(""), [S, M] = m("all"), [N, F] = m("active"), I = f(y), { billingAccounts: L, isLoading: se } = s(), ce = (L.find((e) => e.isDefault) ?? L[0])?.id, R = a ?? ce, { workspaceId: z, navigate: le } = e(), [B, ue] = m("workspace"), { dashboard: V, pooledQuotas: H, activeSubscriptions: U, pastSubscriptions: W, isLoading: de, isPastSubscriptionsLoading: G, error: fe, refetch: pe, loadMorePastSubscriptions: me, hasMorePastSubscriptions: he, isLoadingMorePast: ge, pastSubscriptionsCount: _e } = c({
715
+ }), [u, d] = m(null), [y, b] = m(""), [S, j] = m("all"), [M, N] = m("active"), F = f(y), { billingAccounts: L, isLoading: se } = s(), ce = (L.find((e) => e.isDefault) ?? L[0])?.id, R = a ?? ce, { workspaceId: z, navigate: le } = e(), [B, ue] = m("workspace"), { dashboard: V, pooledQuotas: H, activeSubscriptions: U, pastSubscriptions: W, isLoading: de, isPastSubscriptionsLoading: G, error: fe, refetch: pe, loadMorePastSubscriptions: me, hasMorePastSubscriptions: he, isLoadingMorePast: ge, pastSubscriptionsCount: K } = c({
703
716
  billingAccountId: R,
704
717
  workspaceId: z,
705
- searchQuery: I || void 0,
706
- viewMode: N
707
- }), K = ee((e) => S === "all" ? !0 : S === "healthy" ? e.status === "HEALTHY" : S === "warning" ? e.status === "WARNING" : S === "critical" ? e.status === "CRITICAL" || e.status === "EXHAUSTED" : !0, [S]), q = p(() => H.filter(K), [H, K]), J = p(() => S === "all" ? U : U.map((e) => ({
718
+ searchQuery: F || void 0,
719
+ viewMode: M
720
+ }), q = ee((e) => S === "all" ? !0 : S === "healthy" ? e.status === "HEALTHY" : S === "warning" ? e.status === "WARNING" : S === "critical" ? e.status === "CRITICAL" || e.status === "EXHAUSTED" : !0, [S]), J = p(() => H.filter(q), [H, q]), Y = p(() => S === "all" ? U : U.map((e) => ({
708
721
  ...e,
709
- aggregatedQuotas: e.aggregatedQuotas.filter(K)
722
+ aggregatedQuotas: e.aggregatedQuotas.filter(q)
710
723
  })).filter((e) => e.aggregatedQuotas.length > 0), [
711
724
  U,
712
725
  S,
713
- K
714
- ]), Y = p(() => S === "all" ? W : W.map((e) => ({
726
+ q
727
+ ]), X = p(() => S === "all" ? W : W.map((e) => ({
715
728
  ...e,
716
- aggregatedQuotas: e.aggregatedQuotas.filter(K)
729
+ aggregatedQuotas: e.aggregatedQuotas.filter(q)
717
730
  })).filter((e) => e.aggregatedQuotas.length > 0), [
718
731
  W,
719
732
  S,
720
- K
721
- ]), X = p(() => N === "active" ? {
722
- active: J,
733
+ q
734
+ ]), Z = p(() => M === "active" ? {
735
+ active: Y,
723
736
  past: []
724
- } : N === "past" ? {
737
+ } : M === "past" ? {
725
738
  active: [],
726
- past: Y
739
+ past: X
727
740
  } : {
728
- active: J,
729
- past: Y
741
+ active: Y,
742
+ past: X
730
743
  }, [
731
- N,
732
- J,
733
- Y
734
- ]), Z = y !== "" || S !== "all", Q = I !== y, ve = () => {
735
- b(""), M("all");
744
+ M,
745
+ Y,
746
+ X
747
+ ]), Q = y !== "" || S !== "all", _e = F !== y, ve = () => {
748
+ b(""), j("all");
736
749
  }, $ = (e) => {
737
- M((t) => t === e ? "all" : e);
750
+ j((t) => t === e ? "all" : e);
738
751
  };
739
- if (!i.canViewUsage) return /* @__PURE__ */ A("div", {
752
+ if (!i.canViewUsage) return /* @__PURE__ */ k("div", {
740
753
  className: "flex items-center justify-center h-full min-h-[400px]",
741
- children: /* @__PURE__ */ j("div", {
754
+ children: /* @__PURE__ */ A("div", {
742
755
  className: "text-center space-y-2",
743
756
  children: [
744
- /* @__PURE__ */ A("div", {
757
+ /* @__PURE__ */ k("div", {
745
758
  className: "size-12 mx-auto rounded-full bg-muted flex items-center justify-center",
746
- children: /* @__PURE__ */ A(g, { className: "size-6 text-muted-foreground" })
759
+ children: /* @__PURE__ */ k(g, { className: "size-6 text-muted-foreground" })
747
760
  }),
748
- /* @__PURE__ */ A("h2", {
761
+ /* @__PURE__ */ k("h2", {
749
762
  className: "text-lg font-semibold text-foreground",
750
763
  children: "Access Denied"
751
764
  }),
752
- /* @__PURE__ */ A("p", {
765
+ /* @__PURE__ */ k("p", {
753
766
  className: "text-sm text-muted-foreground max-w-sm",
754
767
  children: "You don't have permission to view usage data."
755
768
  })
756
769
  ]
757
770
  })
758
771
  });
759
- if ((se || de) && !V) return /* @__PURE__ */ j("div", {
772
+ if ((se || de) && !V) return /* @__PURE__ */ A("div", {
760
773
  className: "space-y-6 p-6",
761
774
  children: [
762
- /* @__PURE__ */ A("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }),
763
- /* @__PURE__ */ A("div", {
775
+ /* @__PURE__ */ k("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }),
776
+ /* @__PURE__ */ k("div", {
764
777
  className: "grid grid-cols-2 sm:grid-cols-4 gap-4",
765
778
  children: [
766
779
  1,
767
780
  2,
768
781
  3,
769
782
  4
770
- ].map((e) => /* @__PURE__ */ A("div", { className: "h-24 bg-muted animate-pulse rounded-lg" }, e))
783
+ ].map((e) => /* @__PURE__ */ k("div", { className: "h-24 bg-muted animate-pulse rounded-lg" }, e))
771
784
  }),
772
- /* @__PURE__ */ A("div", { className: "h-64 bg-muted animate-pulse rounded-lg" })
785
+ /* @__PURE__ */ k("div", { className: "h-64 bg-muted animate-pulse rounded-lg" })
773
786
  ]
774
787
  });
775
- if (fe) return /* @__PURE__ */ A("div", {
788
+ if (fe) return /* @__PURE__ */ k("div", {
776
789
  className: "flex items-center justify-center h-full min-h-[400px]",
777
- children: /* @__PURE__ */ j("div", {
790
+ children: /* @__PURE__ */ A("div", {
778
791
  className: "text-center space-y-4",
779
792
  children: [
780
- /* @__PURE__ */ A("div", {
793
+ /* @__PURE__ */ k("div", {
781
794
  className: "size-12 mx-auto rounded-full bg-destructive/10 flex items-center justify-center",
782
- children: /* @__PURE__ */ A(g, { className: "size-6 text-destructive" })
795
+ children: /* @__PURE__ */ k(g, { className: "size-6 text-destructive" })
783
796
  }),
784
- /* @__PURE__ */ A("h2", {
797
+ /* @__PURE__ */ k("h2", {
785
798
  className: "text-lg font-semibold text-foreground",
786
799
  children: "Failed to load usage data"
787
800
  }),
788
- /* @__PURE__ */ A("p", {
801
+ /* @__PURE__ */ k("p", {
789
802
  className: "text-sm text-muted-foreground",
790
803
  children: fe.message
791
804
  }),
792
- /* @__PURE__ */ A("button", {
805
+ /* @__PURE__ */ k("button", {
793
806
  type: "button",
794
807
  onClick: () => pe(),
795
808
  className: "px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
@@ -799,193 +812,193 @@ var oe = ({ workspaceId: e }) => {
799
812
  })
800
813
  });
801
814
  let ye = L.find((e) => e.id === R);
802
- return /* @__PURE__ */ j("div", {
815
+ return /* @__PURE__ */ A("div", {
803
816
  className: "space-y-6 p-6",
804
817
  children: [
805
- /* @__PURE__ */ j("div", {
818
+ /* @__PURE__ */ A("div", {
806
819
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
807
- children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("h1", {
820
+ children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h1", {
808
821
  className: "text-2xl font-bold text-foreground",
809
822
  children: r("billing.usage.title", "Usage")
810
- }), /* @__PURE__ */ A("p", {
823
+ }), /* @__PURE__ */ k("p", {
811
824
  className: "text-sm text-muted-foreground mt-1",
812
825
  children: "Monitor your resource consumption and quota usage"
813
- })] }), /* @__PURE__ */ j("div", {
826
+ })] }), /* @__PURE__ */ A("div", {
814
827
  className: "flex items-center gap-3",
815
828
  children: [
816
- /* @__PURE__ */ j("div", {
829
+ /* @__PURE__ */ A("div", {
817
830
  className: "flex items-center bg-muted/50 rounded-lg p-1 border border-border",
818
- children: [/* @__PURE__ */ j("button", {
831
+ children: [/* @__PURE__ */ A("button", {
819
832
  type: "button",
820
833
  onClick: () => ue("workspace"),
821
834
  className: `flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-all ${B === "workspace" ? "bg-background text-foreground shadow-sm font-medium" : "text-muted-foreground hover:text-foreground"}`,
822
- children: [/* @__PURE__ */ A(C, { className: "size-3.5" }), "Workspace"]
823
- }), /* @__PURE__ */ j("button", {
835
+ children: [/* @__PURE__ */ k(C, { className: "size-3.5" }), "Workspace"]
836
+ }), /* @__PURE__ */ A("button", {
824
837
  type: "button",
825
838
  onClick: () => ue("global"),
826
839
  className: `flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-all ${B === "global" ? "bg-background text-foreground shadow-sm font-medium" : "text-muted-foreground hover:text-foreground"}`,
827
- children: [/* @__PURE__ */ A(w, { className: "size-3.5" }), "Global"]
840
+ children: [/* @__PURE__ */ k(w, { className: "size-3.5" }), "Global"]
828
841
  })]
829
842
  }),
830
- B === "global" && L.length > 1 && /* @__PURE__ */ A("select", {
843
+ B === "global" && L.length > 1 && /* @__PURE__ */ k("select", {
831
844
  value: R || "",
832
845
  onChange: (e) => l(e.target.value),
833
846
  className: "px-3 py-2 text-sm border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary w-full sm:min-w-[200px]",
834
- children: L.map((e) => /* @__PURE__ */ A("option", {
847
+ children: L.map((e) => /* @__PURE__ */ k("option", {
835
848
  value: e.id,
836
849
  children: e.name
837
850
  }, e.id))
838
851
  }),
839
- /* @__PURE__ */ A("button", {
852
+ /* @__PURE__ */ k("button", {
840
853
  type: "button",
841
854
  onClick: () => B === "workspace" ? void 0 : pe(),
842
855
  className: "p-2 border border-border rounded-md hover:bg-muted/50 transition-colors",
843
856
  title: "Refresh",
844
- children: /* @__PURE__ */ A(T, { className: "size-4" })
857
+ children: /* @__PURE__ */ k(T, { className: "size-4" })
845
858
  })
846
859
  ]
847
860
  })]
848
861
  }),
849
- B === "workspace" && z && /* @__PURE__ */ A(oe, { workspaceId: z }),
850
- B === "workspace" && !z && /* @__PURE__ */ A("div", {
862
+ B === "workspace" && z && /* @__PURE__ */ k(oe, { workspaceId: z }),
863
+ B === "workspace" && !z && /* @__PURE__ */ k("div", {
851
864
  className: "text-center py-12 text-muted-foreground text-sm",
852
865
  children: "No workspace context available."
853
866
  }),
854
- B === "global" && /* @__PURE__ */ j(k, { children: [
855
- /* @__PURE__ */ j("div", {
867
+ B === "global" && /* @__PURE__ */ A(O, { children: [
868
+ /* @__PURE__ */ A("div", {
856
869
  className: "flex flex-col gap-3 sm:flex-row sm:items-center",
857
870
  children: [
858
- /* @__PURE__ */ j("div", {
871
+ /* @__PURE__ */ A("div", {
859
872
  className: "relative flex-1 max-w-md",
860
873
  children: [
861
- /* @__PURE__ */ A(E, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
862
- /* @__PURE__ */ A("input", {
874
+ /* @__PURE__ */ k(te, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
875
+ /* @__PURE__ */ k("input", {
863
876
  type: "text",
864
877
  value: y,
865
878
  onChange: (e) => b(e.target.value),
866
- placeholder: `Search ${N === "past" ? "past" : N === "all" ? "all" : "active"} quotas...`,
879
+ placeholder: `Search ${M === "past" ? "past" : M === "all" ? "all" : "active"} quotas...`,
867
880
  className: "w-full pl-9 pr-3 py-2 text-sm border border-border rounded-md bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary"
868
881
  }),
869
- (y || Q) && /* @__PURE__ */ A("button", {
882
+ (y || _e) && /* @__PURE__ */ k("button", {
870
883
  type: "button",
871
884
  onClick: () => b(""),
872
885
  className: "absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted/50",
873
- children: Q ? /* @__PURE__ */ A(T, { className: "size-3 text-muted-foreground animate-spin" }) : /* @__PURE__ */ A(D, { className: "size-3 text-muted-foreground" })
886
+ children: _e ? /* @__PURE__ */ k(T, { className: "size-3 text-muted-foreground animate-spin" }) : /* @__PURE__ */ k(E, { className: "size-3 text-muted-foreground" })
874
887
  })
875
888
  ]
876
889
  }),
877
- /* @__PURE__ */ j("div", {
890
+ /* @__PURE__ */ A("div", {
878
891
  className: "flex items-center bg-muted/50 rounded-lg p-1 border border-border",
879
- children: [/* @__PURE__ */ j("button", {
892
+ children: [/* @__PURE__ */ A("button", {
880
893
  type: "button",
881
- onClick: () => F("active"),
882
- className: `flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-all ${N === "active" ? "bg-background text-foreground shadow-sm font-medium" : "text-muted-foreground hover:text-foreground"}`,
883
- children: [/* @__PURE__ */ A(w, { className: "size-3.5" }), "Active"]
884
- }), /* @__PURE__ */ j("button", {
894
+ onClick: () => N("active"),
895
+ className: `flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-all ${M === "active" ? "bg-background text-foreground shadow-sm font-medium" : "text-muted-foreground hover:text-foreground"}`,
896
+ children: [/* @__PURE__ */ k(w, { className: "size-3.5" }), "Active"]
897
+ }), /* @__PURE__ */ A("button", {
885
898
  type: "button",
886
- onClick: () => F("past"),
887
- disabled: G && N !== "past",
888
- className: `flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-all ${N === "past" ? "bg-background text-foreground shadow-sm font-medium" : "text-muted-foreground hover:text-foreground"} ${G && N !== "past" ? "opacity-70" : ""}`,
889
- children: [G && N === "past" ? /* @__PURE__ */ A(T, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ A(x, { className: "size-3.5" }), "Past"]
899
+ onClick: () => N("past"),
900
+ disabled: G && M !== "past",
901
+ className: `flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-all ${M === "past" ? "bg-background text-foreground shadow-sm font-medium" : "text-muted-foreground hover:text-foreground"} ${G && M !== "past" ? "opacity-70" : ""}`,
902
+ children: [G && M === "past" ? /* @__PURE__ */ k(T, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ k(x, { className: "size-3.5" }), "Past"]
890
903
  })]
891
904
  }),
892
- Z && /* @__PURE__ */ j("button", {
905
+ Q && /* @__PURE__ */ A("button", {
893
906
  type: "button",
894
907
  onClick: ve,
895
908
  className: "flex items-center gap-1.5 px-3 py-1.5 text-sm text-muted-foreground hover:text-foreground border border-border rounded-md hover:bg-muted/50 transition-colors",
896
- children: [/* @__PURE__ */ A(D, { className: "size-3" }), "Clear filters"]
909
+ children: [/* @__PURE__ */ k(E, { className: "size-3" }), "Clear filters"]
897
910
  })
898
911
  ]
899
912
  }),
900
- ye && /* @__PURE__ */ j("div", {
913
+ ye && /* @__PURE__ */ A("div", {
901
914
  className: "text-sm text-muted-foreground",
902
915
  children: [
903
916
  "Viewing usage for",
904
917
  " ",
905
- /* @__PURE__ */ A("span", {
918
+ /* @__PURE__ */ k("span", {
906
919
  className: "font-medium text-foreground",
907
920
  children: ye.name
908
921
  })
909
922
  ]
910
923
  }),
911
- V && /* @__PURE__ */ j("div", {
924
+ V && /* @__PURE__ */ A("div", {
912
925
  className: "grid grid-cols-2 sm:grid-cols-4 gap-4",
913
926
  children: [
914
- /* @__PURE__ */ A(P, {
927
+ /* @__PURE__ */ k(P, {
915
928
  label: "Total Quotas",
916
929
  value: V.totalQuotas,
917
- icon: /* @__PURE__ */ A(C, { className: "size-5" }),
930
+ icon: /* @__PURE__ */ k(C, { className: "size-5" }),
918
931
  color: "blue",
919
932
  isActive: S === "all",
920
- onClick: () => M("all")
933
+ onClick: () => j("all")
921
934
  }),
922
- /* @__PURE__ */ A(P, {
935
+ /* @__PURE__ */ k(P, {
923
936
  label: "Healthy",
924
937
  value: V.healthyQuotas,
925
- icon: /* @__PURE__ */ A(_, { className: "size-5" }),
938
+ icon: /* @__PURE__ */ k(_, { className: "size-5" }),
926
939
  color: "emerald",
927
940
  isActive: S === "healthy",
928
941
  onClick: () => $("healthy")
929
942
  }),
930
- /* @__PURE__ */ A(P, {
943
+ /* @__PURE__ */ k(P, {
931
944
  label: "Warning",
932
945
  value: V.warningQuotas,
933
- icon: /* @__PURE__ */ A(h, { className: "size-5" }),
946
+ icon: /* @__PURE__ */ k(h, { className: "size-5" }),
934
947
  color: "amber",
935
948
  isActive: S === "warning",
936
949
  onClick: () => $("warning")
937
950
  }),
938
- /* @__PURE__ */ A(P, {
951
+ /* @__PURE__ */ k(P, {
939
952
  label: "Critical / Exhausted",
940
953
  value: V.criticalQuotas + V.exhaustedQuotas,
941
- icon: /* @__PURE__ */ A(g, { className: "size-5" }),
954
+ icon: /* @__PURE__ */ k(g, { className: "size-5" }),
942
955
  color: "red",
943
956
  isActive: S === "critical",
944
957
  onClick: () => $("critical")
945
958
  })
946
959
  ]
947
960
  }),
948
- V && (V.warningQuotas > 0 || V.criticalQuotas > 0 || V.exhaustedQuotas > 0) && /* @__PURE__ */ j("div", {
961
+ V && (V.warningQuotas > 0 || V.criticalQuotas > 0 || V.exhaustedQuotas > 0) && /* @__PURE__ */ A("div", {
949
962
  className: `flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between p-4 rounded-lg border ${V.criticalQuotas > 0 || V.exhaustedQuotas > 0 ? `${t.error.bg} ${t.error.border}` : `${t.warning.bg} ${t.warning.border}`}`,
950
- children: [/* @__PURE__ */ j("div", {
963
+ children: [/* @__PURE__ */ A("div", {
951
964
  className: "flex items-center gap-3",
952
- children: [V.criticalQuotas > 0 || V.exhaustedQuotas > 0 ? /* @__PURE__ */ A(O, { className: `size-5 shrink-0 ${t.error.icon}` }) : /* @__PURE__ */ A(h, { className: `size-5 shrink-0 ${t.warning.icon}` }), /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
965
+ children: [V.criticalQuotas > 0 || V.exhaustedQuotas > 0 ? /* @__PURE__ */ k(D, { className: `size-5 shrink-0 ${t.error.icon}` }) : /* @__PURE__ */ k(h, { className: `size-5 shrink-0 ${t.warning.icon}` }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
953
966
  className: `text-sm font-medium ${V.criticalQuotas > 0 || V.exhaustedQuotas > 0 ? t.error.text : t.warning.text}`,
954
967
  children: V.criticalQuotas > 0 || V.exhaustedQuotas > 0 ? `${V.criticalQuotas + V.exhaustedQuotas} quota${V.criticalQuotas + V.exhaustedQuotas === 1 ? "" : "s"} exhausted or critical` : `${V.warningQuotas} quota${V.warningQuotas === 1 ? "" : "s"} approaching the limit`
955
- }), /* @__PURE__ */ A("p", {
968
+ }), /* @__PURE__ */ k("p", {
956
969
  className: "text-xs text-muted-foreground mt-0.5",
957
970
  children: "Contact support to request a quota increase for your plan."
958
971
  })] })]
959
- }), /* @__PURE__ */ A("button", {
972
+ }), /* @__PURE__ */ k("button", {
960
973
  type: "button",
961
974
  onClick: () => le("/support/tickets"),
962
975
  className: `shrink-0 px-4 py-2 text-sm font-medium rounded-md border transition-colors ${V.criticalQuotas > 0 || V.exhaustedQuotas > 0 ? "bg-destructive text-destructive-foreground border-destructive hover:bg-destructive/90" : "border-status-warning-border text-status-warning-text hover:bg-status-warning-bg-subtle"}`,
963
976
  children: "Request more quota"
964
977
  })]
965
978
  }),
966
- (Z || N !== "active") && /* @__PURE__ */ j("div", {
979
+ (Q || M !== "active") && /* @__PURE__ */ A("div", {
967
980
  className: "flex items-center gap-2 text-sm text-muted-foreground flex-wrap",
968
981
  children: [
969
- /* @__PURE__ */ j("span", { children: [
982
+ /* @__PURE__ */ A("span", { children: [
970
983
  "Showing",
971
984
  " ",
972
- X.active.reduce((e, t) => e + t.aggregatedQuotas.length, 0) + X.past.reduce((e, t) => e + t.aggregatedQuotas.length, 0) + (N === "past" ? 0 : q.length),
985
+ Z.active.reduce((e, t) => e + t.aggregatedQuotas.length, 0) + Z.past.reduce((e, t) => e + t.aggregatedQuotas.length, 0) + (M === "past" ? 0 : J.length),
973
986
  " ",
974
987
  "quotas"
975
988
  ] }),
976
- /* @__PURE__ */ j("span", {
989
+ /* @__PURE__ */ A("span", {
977
990
  className: "px-2 py-0.5 bg-primary/10 text-primary rounded text-xs capitalize",
978
991
  children: [
979
- N === "active" ? "Active" : N === "past" ? "Past" : "All",
992
+ M === "active" ? "Active" : M === "past" ? "Past" : "All",
980
993
  " ",
981
994
  "subscriptions"
982
995
  ]
983
996
  }),
984
- S !== "all" && /* @__PURE__ */ A("span", {
997
+ S !== "all" && /* @__PURE__ */ k("span", {
985
998
  className: "px-2 py-0.5 bg-muted rounded text-xs capitalize",
986
999
  children: S === "critical" ? "Critical / Exhausted" : S
987
1000
  }),
988
- y && /* @__PURE__ */ j("span", {
1001
+ y && /* @__PURE__ */ A("span", {
989
1002
  className: "px-2 py-0.5 bg-muted rounded text-xs",
990
1003
  children: [
991
1004
  "“",
@@ -995,133 +1008,133 @@ var oe = ({ workspaceId: e }) => {
995
1008
  })
996
1009
  ]
997
1010
  }),
998
- X.active.length > 0 && /* @__PURE__ */ j("section", { children: [/* @__PURE__ */ j("h2", {
1011
+ Z.active.length > 0 && /* @__PURE__ */ A("section", { children: [/* @__PURE__ */ A("h2", {
999
1012
  className: "text-lg font-semibold text-foreground mb-4 flex items-center gap-2",
1000
- children: [/* @__PURE__ */ A(w, { className: "size-5 text-primary" }), N === "all" ? "Active Subscription Quotas" : "Subscription Quotas"]
1001
- }), /* @__PURE__ */ A("div", {
1013
+ children: [/* @__PURE__ */ k(w, { className: "size-5 text-primary" }), M === "all" ? "Active Subscription Quotas" : "Subscription Quotas"]
1014
+ }), /* @__PURE__ */ k("div", {
1002
1015
  className: "space-y-4",
1003
- children: X.active.map((e) => /* @__PURE__ */ A(ie, {
1016
+ children: Z.active.map((e) => /* @__PURE__ */ k(I, {
1004
1017
  subscription: e,
1005
1018
  onQuotaClick: d,
1006
1019
  defaultExpanded: !0
1007
1020
  }, e.id))
1008
1021
  })] }),
1009
- X.past.length > 0 && /* @__PURE__ */ j("section", { children: [/* @__PURE__ */ j("h2", {
1022
+ Z.past.length > 0 && /* @__PURE__ */ A("section", { children: [/* @__PURE__ */ A("h2", {
1010
1023
  className: "text-lg font-semibold text-foreground mb-4 flex items-center gap-2",
1011
1024
  children: [
1012
- /* @__PURE__ */ A(x, { className: "size-5 text-muted-foreground" }),
1025
+ /* @__PURE__ */ k(x, { className: "size-5 text-muted-foreground" }),
1013
1026
  "Past Subscription Quotas",
1014
- /* @__PURE__ */ A("span", {
1027
+ /* @__PURE__ */ k("span", {
1015
1028
  className: "text-xs font-normal text-muted-foreground",
1016
1029
  children: "(Canceled / Expired / Upgraded)"
1017
1030
  }),
1018
- _e > 0 && /* @__PURE__ */ j("span", {
1031
+ K > 0 && /* @__PURE__ */ A("span", {
1019
1032
  className: "text-xs font-normal px-2 py-0.5 bg-muted rounded-full",
1020
1033
  children: [
1021
- X.past.length,
1034
+ Z.past.length,
1022
1035
  he ? "+" : "",
1023
1036
  " of ",
1024
- _e
1037
+ K
1025
1038
  ]
1026
1039
  })
1027
1040
  ]
1028
- }), /* @__PURE__ */ j("div", {
1041
+ }), /* @__PURE__ */ A("div", {
1029
1042
  className: "space-y-4",
1030
- children: [X.past.map((e) => /* @__PURE__ */ A(ie, {
1043
+ children: [Z.past.map((e) => /* @__PURE__ */ k(I, {
1031
1044
  subscription: e,
1032
1045
  onQuotaClick: d,
1033
- defaultExpanded: N === "past"
1034
- }, e.id)), he && /* @__PURE__ */ A("div", {
1046
+ defaultExpanded: M === "past"
1047
+ }, e.id)), he && /* @__PURE__ */ k("div", {
1035
1048
  className: "flex justify-center pt-2",
1036
- children: /* @__PURE__ */ A("button", {
1049
+ children: /* @__PURE__ */ k("button", {
1037
1050
  type: "button",
1038
1051
  onClick: me,
1039
1052
  disabled: ge,
1040
1053
  className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted-foreground hover:text-foreground border border-border rounded-md hover:bg-muted/50 transition-colors disabled:opacity-50",
1041
- children: ge ? /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(T, { className: "size-4 animate-spin" }), "Loading…"] }) : /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(v, { className: "size-4" }), "Load more past subscriptions"] })
1054
+ children: ge ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(T, { className: "size-4 animate-spin" }), "Loading…"] }) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(v, { className: "size-4" }), "Load more past subscriptions"] })
1042
1055
  })
1043
1056
  })]
1044
1057
  })] }),
1045
- N !== "past" && q.length > 0 && /* @__PURE__ */ j("section", { children: [/* @__PURE__ */ j("h2", {
1058
+ M !== "past" && J.length > 0 && /* @__PURE__ */ A("section", { children: [/* @__PURE__ */ A("h2", {
1046
1059
  className: "text-lg font-semibold text-foreground mb-4 flex items-center gap-2",
1047
1060
  children: [
1048
- /* @__PURE__ */ A(C, { className: `size-5 ${t.info.icon}` }),
1061
+ /* @__PURE__ */ k(C, { className: `size-5 ${t.info.icon}` }),
1049
1062
  "Pooled Quotas",
1050
- /* @__PURE__ */ A("span", {
1063
+ /* @__PURE__ */ k("span", {
1051
1064
  className: "text-xs font-normal text-muted-foreground",
1052
1065
  children: "(Shared across all products)"
1053
1066
  })
1054
1067
  ]
1055
- }), /* @__PURE__ */ A(re, {
1056
- quotas: q,
1068
+ }), /* @__PURE__ */ k(ie, {
1069
+ quotas: J,
1057
1070
  showPlanColumn: !1,
1058
1071
  onQuotaClick: d
1059
1072
  })] }),
1060
- N === "active" && U.length === 0 && H.length === 0 && !Z && /* @__PURE__ */ j("div", {
1073
+ M === "active" && U.length === 0 && H.length === 0 && !Q && /* @__PURE__ */ A("div", {
1061
1074
  className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
1062
1075
  children: [
1063
- /* @__PURE__ */ A("div", {
1076
+ /* @__PURE__ */ k("div", {
1064
1077
  className: "size-12 rounded-full bg-muted flex items-center justify-center mb-4",
1065
- children: /* @__PURE__ */ A(C, { className: "size-6 text-muted-foreground" })
1078
+ children: /* @__PURE__ */ k(C, { className: "size-6 text-muted-foreground" })
1066
1079
  }),
1067
- /* @__PURE__ */ A("h3", {
1080
+ /* @__PURE__ */ k("h3", {
1068
1081
  className: "text-lg font-medium text-foreground",
1069
1082
  children: "No active quotas found"
1070
1083
  }),
1071
- /* @__PURE__ */ A("p", {
1084
+ /* @__PURE__ */ k("p", {
1072
1085
  className: "text-sm text-muted-foreground mt-1 text-center max-w-sm",
1073
1086
  children: "Quotas will appear here once you have active subscriptions or pooled allocations."
1074
1087
  })
1075
1088
  ]
1076
1089
  }),
1077
- N === "past" && W.length === 0 && !Z && !G && /* @__PURE__ */ j("div", {
1090
+ M === "past" && W.length === 0 && !Q && !G && /* @__PURE__ */ A("div", {
1078
1091
  className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
1079
1092
  children: [
1080
- /* @__PURE__ */ A("div", {
1093
+ /* @__PURE__ */ k("div", {
1081
1094
  className: "size-12 rounded-full bg-muted flex items-center justify-center mb-4",
1082
- children: /* @__PURE__ */ A(x, { className: "size-6 text-muted-foreground" })
1095
+ children: /* @__PURE__ */ k(x, { className: "size-6 text-muted-foreground" })
1083
1096
  }),
1084
- /* @__PURE__ */ A("h3", {
1097
+ /* @__PURE__ */ k("h3", {
1085
1098
  className: "text-lg font-medium text-foreground",
1086
1099
  children: "No past subscriptions"
1087
1100
  }),
1088
- /* @__PURE__ */ A("p", {
1101
+ /* @__PURE__ */ k("p", {
1089
1102
  className: "text-sm text-muted-foreground mt-1 text-center max-w-sm",
1090
1103
  children: "You don't have any canceled, expired, or upgraded subscriptions yet."
1091
1104
  }),
1092
- /* @__PURE__ */ A("button", {
1105
+ /* @__PURE__ */ k("button", {
1093
1106
  type: "button",
1094
- onClick: () => F("active"),
1107
+ onClick: () => N("active"),
1095
1108
  className: "mt-4 px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
1096
1109
  children: "View active subscriptions"
1097
1110
  })
1098
1111
  ]
1099
1112
  }),
1100
- N === "past" && G && /* @__PURE__ */ A("div", {
1113
+ M === "past" && G && /* @__PURE__ */ k("div", {
1101
1114
  className: "space-y-4",
1102
1115
  children: [
1103
1116
  1,
1104
1117
  2,
1105
1118
  3
1106
- ].map((e) => /* @__PURE__ */ A("div", { className: "h-24 bg-muted animate-pulse rounded-lg" }, e))
1119
+ ].map((e) => /* @__PURE__ */ k("div", { className: "h-24 bg-muted animate-pulse rounded-lg" }, e))
1107
1120
  }),
1108
- Z && X.active.length === 0 && X.past.length === 0 && (N === "past" || q.length === 0) && /* @__PURE__ */ j("div", {
1121
+ Q && Z.active.length === 0 && Z.past.length === 0 && (M === "past" || J.length === 0) && /* @__PURE__ */ A("div", {
1109
1122
  className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
1110
1123
  children: [
1111
- /* @__PURE__ */ A("div", {
1124
+ /* @__PURE__ */ k("div", {
1112
1125
  className: "size-12 rounded-full bg-muted flex items-center justify-center mb-4",
1113
- children: S !== "all" && !y ? /* @__PURE__ */ A(ne, {
1126
+ children: S !== "all" && !y ? /* @__PURE__ */ k(re, {
1114
1127
  status: S === "healthy" ? "HEALTHY" : S === "warning" ? "WARNING" : "CRITICAL",
1115
1128
  className: "size-6"
1116
- }) : /* @__PURE__ */ A(E, { className: "size-6 text-muted-foreground" })
1129
+ }) : /* @__PURE__ */ k(te, { className: "size-6 text-muted-foreground" })
1117
1130
  }),
1118
- /* @__PURE__ */ A("h3", {
1131
+ /* @__PURE__ */ k("h3", {
1119
1132
  className: "text-lg font-medium text-foreground",
1120
1133
  children: S !== "all" && !y ? `No ${S === "critical" ? "critical or exhausted" : S} quotas` : "No matching quotas"
1121
1134
  }),
1122
- /* @__PURE__ */ A("p", {
1135
+ /* @__PURE__ */ k("p", {
1123
1136
  className: "text-sm text-muted-foreground mt-1 text-center max-w-sm",
1124
- children: S !== "all" && !y ? /* @__PURE__ */ j(k, { children: ["All your quotas are in a different status.", V && /* @__PURE__ */ j("span", {
1137
+ children: S !== "all" && !y ? /* @__PURE__ */ A(O, { children: ["All your quotas are in a different status.", V && /* @__PURE__ */ A("span", {
1125
1138
  className: "block mt-1",
1126
1139
  children: [
1127
1140
  "You have ",
@@ -1134,28 +1147,28 @@ var oe = ({ workspaceId: e }) => {
1134
1147
  " ",
1135
1148
  "critical quotas."
1136
1149
  ]
1137
- })] }) : /* @__PURE__ */ j(k, { children: [
1150
+ })] }) : /* @__PURE__ */ A(O, { children: [
1138
1151
  "No quotas match your current search or filter criteria in",
1139
1152
  " ",
1140
- N === "past" ? "past" : N === "all" ? "any" : "active",
1153
+ M === "past" ? "past" : M === "all" ? "any" : "active",
1141
1154
  " ",
1142
1155
  "subscriptions.",
1143
- N === "active" && !S.includes("all") && /* @__PURE__ */ A("span", {
1156
+ M === "active" && !S.includes("all") && /* @__PURE__ */ k("span", {
1144
1157
  className: "block mt-1",
1145
1158
  children: "Try switching to “Past” or “All” to search across more subscriptions."
1146
1159
  })
1147
1160
  ] })
1148
1161
  }),
1149
- /* @__PURE__ */ j("div", {
1162
+ /* @__PURE__ */ A("div", {
1150
1163
  className: "flex gap-2 mt-4",
1151
- children: [/* @__PURE__ */ A("button", {
1164
+ children: [/* @__PURE__ */ k("button", {
1152
1165
  type: "button",
1153
1166
  onClick: ve,
1154
1167
  className: "px-4 py-2 text-sm font-medium border border-border rounded-md hover:bg-muted/50 transition-colors",
1155
1168
  children: S === "all" ? "Clear filters" : "Show all quotas"
1156
- }), N === "active" && y && /* @__PURE__ */ A("button", {
1169
+ }), M === "active" && y && /* @__PURE__ */ k("button", {
1157
1170
  type: "button",
1158
- onClick: () => F("all"),
1171
+ onClick: () => N("all"),
1159
1172
  className: "px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
1160
1173
  children: "Search all"
1161
1174
  })]
@@ -1163,7 +1176,7 @@ var oe = ({ workspaceId: e }) => {
1163
1176
  ]
1164
1177
  })
1165
1178
  ] }),
1166
- u && /* @__PURE__ */ A(ae, {
1179
+ u && /* @__PURE__ */ k(ae, {
1167
1180
  quota: u,
1168
1181
  onClose: () => d(null)
1169
1182
  })
@@ -1171,6 +1184,6 @@ var oe = ({ workspaceId: e }) => {
1171
1184
  });
1172
1185
  };
1173
1186
  //#endregion
1174
- export { L as UsagePage };
1187
+ export { se as UsagePage };
1175
1188
 
1176
1189
  //# sourceMappingURL=UsagePage.js.map