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