@carlonicora/nextjs-jsonapi 6.11.0 → 6.12.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/{AbstractService-Ckm2X5fW.d.mts → AbstractService-N0wFgaHD.d.mts} +1 -1
- package/dist/{AbstractService-V3VGQMhL.d.ts → AbstractService-kNAykPDk.d.ts} +1 -1
- package/dist/{BlockNoteEditor-GY5R25YI.js → BlockNoteEditor-CBYKEXAQ.js} +84 -43
- package/dist/BlockNoteEditor-CBYKEXAQ.js.map +1 -0
- package/dist/{BlockNoteEditor-5WM5DX3J.mjs → BlockNoteEditor-N2NBYCPC.mjs} +61 -20
- package/dist/BlockNoteEditor-N2NBYCPC.mjs.map +1 -0
- package/dist/{BlockNoteViewer-UCA3LV3N.mjs → BlockNoteViewer-MTGS6YJV.mjs} +2 -2
- package/dist/{BlockNoteViewer-FLUHEXE6.js → BlockNoteViewer-WGCDB7IJ.js} +3 -3
- package/dist/{BlockNoteViewer-FLUHEXE6.js.map → BlockNoteViewer-WGCDB7IJ.js.map} +1 -1
- package/dist/billing/index.js +491 -491
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-6RLATJ2L.mjs → chunk-4FNGWALA.mjs} +2 -2
- package/dist/{chunk-MP3DV2I5.js → chunk-6NZKWIOR.js} +908 -908
- package/dist/{chunk-MP3DV2I5.js.map → chunk-6NZKWIOR.js.map} +1 -1
- package/dist/{chunk-3PRLRCMF.mjs → chunk-6XJOQFCP.mjs} +5 -5
- package/dist/{chunk-BGLOFZ3K.mjs → chunk-AA52ORW2.mjs} +11 -15
- package/dist/chunk-AA52ORW2.mjs.map +1 -0
- package/dist/{chunk-YP6W4AB5.mjs → chunk-EWCY6QJA.mjs} +2 -2
- package/dist/{chunk-YGEOX2XX.js → chunk-FF4EIQ6H.js} +11 -15
- package/dist/chunk-FF4EIQ6H.js.map +1 -0
- package/dist/{chunk-FNPXCYHO.js → chunk-L6PYFQTO.js} +8 -8
- package/dist/{chunk-FNPXCYHO.js.map → chunk-L6PYFQTO.js.map} +1 -1
- package/dist/{chunk-OHJSI6L2.js → chunk-O3PDL2CV.js} +4 -4
- package/dist/{chunk-OHJSI6L2.js.map → chunk-O3PDL2CV.js.map} +1 -1
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +24 -3
- package/dist/components/index.d.ts +24 -3
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +7 -7
- package/dist/core/index.d.ts +7 -7
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/email-automations/index.js +93 -93
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.d.mts +1 -1
- package/dist/features/analytics/index.d.ts +1 -1
- package/dist/features/analytics/index.js +120 -120
- package/dist/features/analytics/index.mjs +3 -3
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/blog/index.js +150 -150
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.js +16 -16
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.d.mts +1 -1
- package/dist/features/tokenusage/index.d.ts +1 -1
- package/dist/features/tokenusage/index.js +126 -126
- package/dist/features/tokenusage/index.mjs +3 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/{referral-admin.interface-CMwl5NiV.d.ts → referral-admin.interface-CnytdDaQ.d.ts} +1 -1
- package/dist/{referral-admin.interface-C87ApGMR.d.mts → referral-admin.interface-RVO-ZTJz.d.mts} +1 -1
- package/dist/{s3.service-BG136Btz.d.mts → s3.service-CeUsKm-d.d.mts} +1 -1
- package/dist/{s3.service-CsrsRPRn.d.ts → s3.service-SkZnngeR.d.ts} +1 -1
- package/dist/server/index.d.mts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/package.json +8 -3
- package/src/components/editors/BlockNoteEditor.tsx +52 -20
- package/src/components/editors/__tests__/blocknote-editor-options.spec.ts +81 -0
- package/src/components/editors/blockNoteEditorOptions.ts +58 -0
- package/src/core/abstracts/AbstractService.ts +5 -11
- package/src/core/abstracts/ClientAbstractService.ts +5 -11
- package/src/core/abstracts/__tests__/AbstractService.locale.spec.ts +43 -0
- package/src/core/abstracts/__tests__/ClientAbstractService.locale.spec.ts +69 -0
- package/src/i18n/__tests__/config.spec.ts +22 -1
- package/src/i18n/config.ts +5 -0
- package/src/i18n/index.ts +1 -0
- package/dist/BlockNoteEditor-5WM5DX3J.mjs.map +0 -1
- package/dist/BlockNoteEditor-GY5R25YI.js.map +0 -1
- package/dist/chunk-BGLOFZ3K.mjs.map +0 -1
- package/dist/chunk-YGEOX2XX.js.map +0 -1
- /package/dist/{BlockNoteViewer-UCA3LV3N.mjs.map → BlockNoteViewer-MTGS6YJV.mjs.map} +0 -0
- /package/dist/{chunk-6RLATJ2L.mjs.map → chunk-4FNGWALA.mjs.map} +0 -0
- /package/dist/{chunk-3PRLRCMF.mjs.map → chunk-6XJOQFCP.mjs.map} +0 -0
- /package/dist/{chunk-YP6W4AB5.mjs.map → chunk-EWCY6QJA.mjs.map} +0 -0
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
require('../../chunk-
|
|
42
|
+
var _chunk6NZKWIORjs = require('../../chunk-6NZKWIOR.js');
|
|
43
|
+
require('../../chunk-L6PYFQTO.js');
|
|
44
44
|
require('../../chunk-G4JR3SFV.js');
|
|
45
45
|
|
|
46
46
|
|
|
@@ -59,7 +59,7 @@ require('../../chunk-G4JR3SFV.js');
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
var
|
|
62
|
+
var _chunkFF4EIQ6Hjs = require('../../chunk-FF4EIQ6H.js');
|
|
63
63
|
require('../../chunk-GHE4VT2R.js');
|
|
64
64
|
require('../../chunk-LXKSUWAV.js');
|
|
65
65
|
require('../../chunk-JTPRJNT2.js');
|
|
@@ -84,7 +84,7 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
84
84
|
};
|
|
85
85
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
86
86
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "max-md:w-full max-md:[&_#date]:w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
87
|
-
|
|
87
|
+
_chunk6NZKWIORjs.DateRangeSelector,
|
|
88
88
|
{
|
|
89
89
|
onDateChange: (range) => {
|
|
90
90
|
if (!_optionalChain([range, 'optionalAccess', _ => _.from]) || !_optionalChain([range, 'optionalAccess', _2 => _2.to])) return;
|
|
@@ -119,16 +119,16 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
121
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
122
|
-
|
|
122
|
+
_chunk6NZKWIORjs.Select,
|
|
123
123
|
{
|
|
124
124
|
items: companyItems,
|
|
125
125
|
value: _nullishCoalesce(companyId, () => ( ALL_COMPANIES)),
|
|
126
126
|
onValueChange: (value) => onChange({ companyId: !value || value === ALL_COMPANIES ? void 0 : value }),
|
|
127
127
|
children: [
|
|
128
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
129
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
130
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
131
|
-
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
128
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
|
|
129
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.SelectContent, { children: [
|
|
130
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
|
|
131
|
+
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.SelectItem, { value: company.id, children: company.label }, company.id))
|
|
132
132
|
] })
|
|
133
133
|
]
|
|
134
134
|
}
|
|
@@ -151,13 +151,13 @@ function Segmented({
|
|
|
151
151
|
children: options.map((option) => {
|
|
152
152
|
const selected = option.value === value;
|
|
153
153
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
154
|
-
|
|
154
|
+
_chunk6NZKWIORjs.Button,
|
|
155
155
|
{
|
|
156
156
|
type: "button",
|
|
157
157
|
size: "sm",
|
|
158
158
|
variant: selected ? "default" : "ghost",
|
|
159
159
|
"aria-pressed": selected,
|
|
160
|
-
className:
|
|
160
|
+
className: _chunkFF4EIQ6Hjs.cn.call(void 0, !selected && "text-muted-foreground"),
|
|
161
161
|
onClick: () => onSelect(option.value),
|
|
162
162
|
children: option.label
|
|
163
163
|
},
|
|
@@ -177,36 +177,36 @@ function withFilters(endpoint, filters) {
|
|
|
177
177
|
return endpoint;
|
|
178
178
|
}
|
|
179
179
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters, "withFilters");
|
|
180
|
-
var TokenUsageAdminService = class extends
|
|
180
|
+
var TokenUsageAdminService = class extends _chunkFF4EIQ6Hjs.AbstractService {
|
|
181
181
|
static {
|
|
182
182
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageAdminService");
|
|
183
183
|
}
|
|
184
184
|
/** Six rows: {customer, platform, total} × {current, previous}. */
|
|
185
185
|
static async getSummary(filters) {
|
|
186
|
-
const endpoint = withFilters(new (0,
|
|
186
|
+
const endpoint = withFilters(new (0, _chunkFF4EIQ6Hjs.EndpointCreator)({ endpoint: _chunkFF4EIQ6Hjs.Modules.TokenUsageAdminSummary }), filters);
|
|
187
187
|
return this.callApi({
|
|
188
|
-
type:
|
|
188
|
+
type: _chunkFF4EIQ6Hjs.Modules.TokenUsageAdminSummary,
|
|
189
189
|
method: "GET" /* GET */,
|
|
190
190
|
endpoint: endpoint.generate()
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
static async getTimeline(params) {
|
|
194
|
-
const endpoint = withFilters(new (0,
|
|
194
|
+
const endpoint = withFilters(new (0, _chunkFF4EIQ6Hjs.EndpointCreator)({ endpoint: _chunkFF4EIQ6Hjs.Modules.TokenUsageAdminTimeline }), params);
|
|
195
195
|
endpoint.addAdditionalParam("granularity", params.granularity);
|
|
196
196
|
endpoint.addAdditionalParam("stackBy", params.stackBy);
|
|
197
197
|
return this.callApi({
|
|
198
|
-
type:
|
|
198
|
+
type: _chunkFF4EIQ6Hjs.Modules.TokenUsageAdminTimeline,
|
|
199
199
|
method: "GET" /* GET */,
|
|
200
200
|
endpoint: endpoint.generate()
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
203
|
static async getBreakdown(params) {
|
|
204
|
-
const endpoint = withFilters(new (0,
|
|
204
|
+
const endpoint = withFilters(new (0, _chunkFF4EIQ6Hjs.EndpointCreator)({ endpoint: _chunkFF4EIQ6Hjs.Modules.TokenUsageAdminBreakdown }), params);
|
|
205
205
|
endpoint.addAdditionalParam("dimension", params.dimension);
|
|
206
206
|
endpoint.addAdditionalParam("scope", params.scope);
|
|
207
207
|
if (params.limit !== void 0) endpoint.addAdditionalParam("limit", String(params.limit));
|
|
208
208
|
return this.callApi({
|
|
209
|
-
type:
|
|
209
|
+
type: _chunkFF4EIQ6Hjs.Modules.TokenUsageAdminBreakdown,
|
|
210
210
|
method: "GET" /* GET */,
|
|
211
211
|
endpoint: endpoint.generate()
|
|
212
212
|
});
|
|
@@ -343,7 +343,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
343
343
|
error
|
|
344
344
|
]
|
|
345
345
|
);
|
|
346
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
346
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
|
|
347
347
|
}, "TokenUsageAdminProvider");
|
|
348
348
|
var useTokenUsageAdmin = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
349
349
|
const ctx = _react.useContext.call(void 0, TokenUsageAdminContext);
|
|
@@ -364,7 +364,7 @@ var _lucidereact = require('lucide-react');
|
|
|
364
364
|
var ZERO = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
365
365
|
function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
366
366
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
367
|
-
const { decimal, metricValue: formatValue, currency, percent } =
|
|
367
|
+
const { decimal, metricValue: formatValue, currency, percent } = _chunk6NZKWIORjs.useUsageFormatters.call(void 0, );
|
|
368
368
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (scope, window) => _nullishCoalesce(summary.find((r) => r.scope === scope && r.window === window), () => ( ZERO)), "rowFor");
|
|
369
369
|
const customerCurrent = rowFor("customer", "current");
|
|
370
370
|
const customerPrevious = rowFor("customer", "previous");
|
|
@@ -373,16 +373,16 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
373
373
|
const totalCurrent = rowFor("total", "current");
|
|
374
374
|
const totalPrevious = rowFor("total", "previous");
|
|
375
375
|
const averagePerCall = totalCurrent.calls ? totalCurrent.cost / totalCurrent.calls : 0;
|
|
376
|
-
const cacheHit =
|
|
376
|
+
const cacheHit = _chunk6NZKWIORjs.cacheHitPercentage.call(void 0, totalCurrent.cached, totalCurrent.tokensIn);
|
|
377
377
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
378
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
378
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkFF4EIQ6Hjs.cn.call(void 0, "grid gap-3", singleCustomerMode ? "sm:grid-cols-1" : "sm:grid-cols-2"), children: [
|
|
379
379
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
380
380
|
LeadTile,
|
|
381
381
|
{
|
|
382
382
|
testId: "tile-customer",
|
|
383
383
|
label: t("token_usage.admin.customer_spend"),
|
|
384
|
-
value: formatValue(
|
|
385
|
-
delta:
|
|
384
|
+
value: formatValue(_chunk6NZKWIORjs.metricValue.call(void 0, customerCurrent, metric), metric),
|
|
385
|
+
delta: _chunk6NZKWIORjs.percentageDelta.call(void 0, _chunk6NZKWIORjs.metricValue.call(void 0, customerCurrent, metric), _chunk6NZKWIORjs.metricValue.call(void 0, customerPrevious, metric)),
|
|
386
386
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
387
387
|
decimal
|
|
388
388
|
}
|
|
@@ -392,8 +392,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
392
392
|
{
|
|
393
393
|
testId: "tile-platform",
|
|
394
394
|
label: t("token_usage.admin.platform_spend"),
|
|
395
|
-
value: formatValue(
|
|
396
|
-
delta:
|
|
395
|
+
value: formatValue(_chunk6NZKWIORjs.metricValue.call(void 0, platformCurrent, metric), metric),
|
|
396
|
+
delta: _chunk6NZKWIORjs.percentageDelta.call(void 0, _chunk6NZKWIORjs.metricValue.call(void 0, platformCurrent, metric), _chunk6NZKWIORjs.metricValue.call(void 0, platformPrevious, metric)),
|
|
397
397
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
398
398
|
decimal
|
|
399
399
|
}
|
|
@@ -405,8 +405,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
405
405
|
{
|
|
406
406
|
testId: "tile-total",
|
|
407
407
|
label: t("token_usage.admin.total_cost"),
|
|
408
|
-
value: formatValue(
|
|
409
|
-
delta:
|
|
408
|
+
value: formatValue(_chunk6NZKWIORjs.metricValue.call(void 0, totalCurrent, metric), metric),
|
|
409
|
+
delta: _chunk6NZKWIORjs.percentageDelta.call(void 0, _chunk6NZKWIORjs.metricValue.call(void 0, totalCurrent, metric), _chunk6NZKWIORjs.metricValue.call(void 0, totalPrevious, metric)),
|
|
410
410
|
decimal
|
|
411
411
|
}
|
|
412
412
|
),
|
|
@@ -440,7 +440,7 @@ function LeadTile({
|
|
|
440
440
|
previousLabel,
|
|
441
441
|
decimal
|
|
442
442
|
}) {
|
|
443
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
443
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.CardContent, { className: "grid gap-1", children: [
|
|
444
444
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
445
445
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: value }),
|
|
446
446
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
@@ -457,7 +457,7 @@ function SupportingTile({
|
|
|
457
457
|
delta,
|
|
458
458
|
decimal
|
|
459
459
|
}) {
|
|
460
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
460
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.CardContent, { className: "grid gap-1", children: [
|
|
461
461
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
462
462
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-2", children: [
|
|
463
463
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: value }),
|
|
@@ -480,7 +480,7 @@ function Delta({
|
|
|
480
480
|
"span",
|
|
481
481
|
{
|
|
482
482
|
"data-testid": testId,
|
|
483
|
-
className:
|
|
483
|
+
className: _chunkFF4EIQ6Hjs.cn.call(void 0,
|
|
484
484
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
485
485
|
increased ? "text-success" : "text-destructive"
|
|
486
486
|
),
|
|
@@ -501,10 +501,10 @@ _chunk7QVYU63Ejs.__name.call(void 0, Delta, "Delta");
|
|
|
501
501
|
|
|
502
502
|
function TokenUsageBreakdownTable({ rows, metric }) {
|
|
503
503
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
504
|
-
const { decimal, metricValue: formatValue, percent, compare } =
|
|
504
|
+
const { decimal, metricValue: formatValue, percent, compare } = _chunk6NZKWIORjs.useUsageFormatters.call(void 0, );
|
|
505
505
|
const [sort, setSort] = _react.useState.call(void 0, void 0);
|
|
506
506
|
const showActiveUsers = rows.some((row) => row.activeUsers !== void 0);
|
|
507
|
-
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum +
|
|
507
|
+
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum + _chunk6NZKWIORjs.metricValue.call(void 0, row, metric), 0), [rows, metric]);
|
|
508
508
|
const sortValue = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row, key) => {
|
|
509
509
|
switch (key) {
|
|
510
510
|
case "label":
|
|
@@ -514,9 +514,9 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
514
514
|
case "activeUsers":
|
|
515
515
|
return _nullishCoalesce(row.activeUsers, () => ( 0));
|
|
516
516
|
case "cacheHit":
|
|
517
|
-
return
|
|
517
|
+
return _chunk6NZKWIORjs.cacheHitPercentage.call(void 0, row.cached, row.tokensIn);
|
|
518
518
|
case "share":
|
|
519
|
-
return
|
|
519
|
+
return _chunk6NZKWIORjs.metricValue.call(void 0, row, metric);
|
|
520
520
|
default:
|
|
521
521
|
return row[key];
|
|
522
522
|
}
|
|
@@ -554,13 +554,13 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
554
554
|
// The package's <Table> wraps itself in an `overflow-x-clip` container, which
|
|
555
555
|
// would swallow the overflow before this scroller ever saw it — hence the
|
|
556
556
|
// child override. Wide metric tables must scroll, never widen the page.
|
|
557
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-x-auto [&_[data-slot=table-container]]:overflow-x-visible", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
558
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
557
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-x-auto [&_[data-slot=table-container]]:overflow-x-visible", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.Table, { children: [
|
|
558
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableHead, { className: _chunkFF4EIQ6Hjs.cn.call(void 0, column.numeric && "text-end"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
559
559
|
"button",
|
|
560
560
|
{
|
|
561
561
|
type: "button",
|
|
562
562
|
onClick: () => toggleSort(column.key),
|
|
563
|
-
className:
|
|
563
|
+
className: _chunkFF4EIQ6Hjs.cn.call(void 0,
|
|
564
564
|
"hover:text-primary inline-flex items-center gap-1 text-xs font-medium",
|
|
565
565
|
column.numeric && "flex-row-reverse"
|
|
566
566
|
),
|
|
@@ -570,20 +570,20 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
570
570
|
]
|
|
571
571
|
}
|
|
572
572
|
) }, column.key)) }) }),
|
|
573
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
574
|
-
const value =
|
|
573
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableBody, { children: sortedRows.map((row) => {
|
|
574
|
+
const value = _chunk6NZKWIORjs.metricValue.call(void 0, row, metric);
|
|
575
575
|
const share = total > 0 ? value / total * 100 : 0;
|
|
576
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
577
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
578
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
579
|
-
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
580
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
581
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
582
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
583
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
584
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
585
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
586
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
576
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
|
|
577
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
|
|
578
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
|
|
579
|
+
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableCell, { className: "text-end text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
|
|
580
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.calls, 0) }),
|
|
581
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
|
|
582
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
|
|
583
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableCell, { className: "text-end text-xs tabular-nums", children: percent(_chunk6NZKWIORjs.cacheHitPercentage.call(void 0, row.cached, row.tokensIn)) }),
|
|
584
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
|
|
585
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
|
|
586
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TableCell, { className: "text-end text-xs tabular-nums", children: percent(share) })
|
|
587
587
|
] }, row.id);
|
|
588
588
|
}) })
|
|
589
589
|
] }) })
|
|
@@ -617,7 +617,7 @@ var operationDescription = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
|
|
|
617
617
|
|
|
618
618
|
function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes = false }) {
|
|
619
619
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
620
|
-
const { metricValue: formatValue, percent } =
|
|
620
|
+
const { metricValue: formatValue, percent } = _chunk6NZKWIORjs.useUsageFormatters.call(void 0, );
|
|
621
621
|
const renderLabel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row) => {
|
|
622
622
|
if (row.id === "other") return t("token_usage.admin.other");
|
|
623
623
|
if (!labelsAreOperationTypes) return row.label;
|
|
@@ -639,9 +639,9 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
639
639
|
const label = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground truncate text-xs", children: renderLabel(row) });
|
|
640
640
|
const description = renderDescription(row);
|
|
641
641
|
if (!description) return label;
|
|
642
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
642
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.Tooltip, { children: [
|
|
643
643
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
644
|
-
|
|
644
|
+
_chunk6NZKWIORjs.TooltipTrigger,
|
|
645
645
|
{
|
|
646
646
|
"data-testid": `ranked-description-${row.id}`,
|
|
647
647
|
className: "min-w-0 cursor-help justify-self-start truncate",
|
|
@@ -649,19 +649,19 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
649
649
|
children: label
|
|
650
650
|
}
|
|
651
651
|
),
|
|
652
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
652
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.TooltipContent, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs", children: description }) })
|
|
653
653
|
] });
|
|
654
654
|
}, "renderLabelCell");
|
|
655
655
|
if (rows.length === 0) {
|
|
656
656
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground py-6 text-center text-sm", children: emptyLabel });
|
|
657
657
|
}
|
|
658
|
-
const values = rows.map((row) =>
|
|
658
|
+
const values = rows.map((row) => _chunk6NZKWIORjs.metricValue.call(void 0, row, metric));
|
|
659
659
|
const total = values.reduce((sum, value) => sum + value, 0);
|
|
660
660
|
const max = Math.max(...values, 0);
|
|
661
661
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid gap-0.5", children: rows.map((row, index) => {
|
|
662
662
|
const value = values[index];
|
|
663
663
|
const isOther = row.id === "other";
|
|
664
|
-
const step = isOther ?
|
|
664
|
+
const step = isOther ? _chunk6NZKWIORjs.SEQUENTIAL_RAMP.length - 1 : Math.min(index, _chunk6NZKWIORjs.SEQUENTIAL_RAMP.length - 1);
|
|
665
665
|
const width = max > 0 ? value / max * 100 : 0;
|
|
666
666
|
const share = total > 0 ? value / total * 100 : 0;
|
|
667
667
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-x-3 gap-y-0.5 py-0.5", children: [
|
|
@@ -673,7 +673,7 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
673
673
|
"data-testid": `ranked-fill-${row.id}`,
|
|
674
674
|
"data-ramp-step": String(step),
|
|
675
675
|
className: "h-full rounded-r-[4px]",
|
|
676
|
-
style: { width: `${width}%`, backgroundColor:
|
|
676
|
+
style: { width: `${width}%`, backgroundColor: _chunk6NZKWIORjs.SEQUENTIAL_RAMP[step] }
|
|
677
677
|
}
|
|
678
678
|
) })
|
|
679
679
|
] }),
|
|
@@ -723,7 +723,7 @@ var inferGranularity = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (buc
|
|
|
723
723
|
}, "inferGranularity");
|
|
724
724
|
function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
725
725
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
726
|
-
const { compact, bucketDate, metricValue: formatValue } =
|
|
726
|
+
const { compact, bucketDate, metricValue: formatValue } = _chunk6NZKWIORjs.useUsageFormatters.call(void 0, );
|
|
727
727
|
const { resolvedTheme } = _nextthemes.useTheme.call(void 0, );
|
|
728
728
|
const mode = resolvedTheme === "dark" ? "dark" : "light";
|
|
729
729
|
const { chartData, seriesKeys } = _react.useMemo.call(void 0, () => {
|
|
@@ -731,8 +731,8 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
731
731
|
const totals = /* @__PURE__ */ new Map();
|
|
732
732
|
for (const row of rows) totals.set(row.series, (_nullishCoalesce(totals.get(row.series), () => ( 0))) + metricValue2(row, metric));
|
|
733
733
|
const ranked = [...totals.entries()].sort((a, b) => b[1] - a[1]).map(([series]) => series);
|
|
734
|
-
const named = ranked.slice(0,
|
|
735
|
-
const folded = new Set(ranked.slice(
|
|
734
|
+
const named = ranked.slice(0, _chunk6NZKWIORjs.CATEGORICAL_CEILING);
|
|
735
|
+
const folded = new Set(ranked.slice(_chunk6NZKWIORjs.CATEGORICAL_CEILING));
|
|
736
736
|
const keys = folded.size > 0 ? [...named, OTHER_SERIES] : named;
|
|
737
737
|
const byBucket = /* @__PURE__ */ new Map();
|
|
738
738
|
for (const row of rows) {
|
|
@@ -772,7 +772,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
772
772
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: className ? `text-muted-foreground text-sm ${className}` : "text-muted-foreground text-sm", children: t.has(key) ? t(key) : "No data in the selected period" });
|
|
773
773
|
}
|
|
774
774
|
const granularity = inferGranularity(chartData.map((entry) => entry.bucket));
|
|
775
|
-
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ?
|
|
775
|
+
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ? _chunk6NZKWIORjs.OTHER_COLOR : _chunk6NZKWIORjs.seriesColor.call(void 0, index, mode), "seriesColorFor");
|
|
776
776
|
return (
|
|
777
777
|
// The chart is a coordinate system, not prose: recharts lays the axes and the
|
|
778
778
|
// stacked bars out left-to-right, so the whole chart stays an LTR island even
|
|
@@ -781,7 +781,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
781
781
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, dir: "ltr", children: [
|
|
782
782
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
|
|
783
783
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
|
|
784
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
784
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.ChartContainer, { config: chartConfig, className: "aspect-auto h-72 w-full", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _recharts.BarChart, { accessibilityLayer: true, data: chartData, margin: { top: 8, right: 8, bottom: 0, left: 0 }, children: [
|
|
785
785
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
|
|
786
786
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
787
787
|
_recharts.XAxis,
|
|
@@ -805,10 +805,10 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
805
805
|
}
|
|
806
806
|
),
|
|
807
807
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
808
|
-
|
|
808
|
+
_chunk6NZKWIORjs.ChartTooltip,
|
|
809
809
|
{
|
|
810
810
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
811
|
-
|
|
811
|
+
_chunk6NZKWIORjs.ChartTooltipContent,
|
|
812
812
|
{
|
|
813
813
|
labelFormatter: (value) => bucketDate(String(value), granularity),
|
|
814
814
|
valueFormatter: (value) => formatValue(Number(value), metric),
|
|
@@ -817,7 +817,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
817
817
|
)
|
|
818
818
|
}
|
|
819
819
|
),
|
|
820
|
-
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
820
|
+
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.ChartLegendContent, {}) }) : null,
|
|
821
821
|
seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
822
822
|
_recharts.Bar,
|
|
823
823
|
{
|
|
@@ -869,19 +869,19 @@ function TokenUsageAdminContainer() {
|
|
|
869
869
|
[t]
|
|
870
870
|
);
|
|
871
871
|
if (error) {
|
|
872
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
872
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.RoundPageContainer, { module: _chunkFF4EIQ6Hjs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
873
873
|
}
|
|
874
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
874
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.RoundPageContainer, { module: _chunkFF4EIQ6Hjs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true });
|
|
875
875
|
const emptyLabel = t("token_usage.admin.no_data");
|
|
876
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
876
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.RoundPageContainer, { module: _chunkFF4EIQ6Hjs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
|
|
877
877
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminTiles, { summary, metric: filters.metric, singleCustomerMode: hidePlatform }),
|
|
878
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
879
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
880
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
881
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
878
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.Card, { children: [
|
|
879
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.CardHeader, { children: [
|
|
880
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
|
|
881
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
882
882
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.admin.stack_by") }),
|
|
883
883
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
884
|
-
|
|
884
|
+
_chunk6NZKWIORjs.Select,
|
|
885
885
|
{
|
|
886
886
|
items: stackByItems,
|
|
887
887
|
value: filters.stackBy,
|
|
@@ -889,29 +889,29 @@ function TokenUsageAdminContainer() {
|
|
|
889
889
|
if (value) setFilters({ stackBy: value });
|
|
890
890
|
},
|
|
891
891
|
children: [
|
|
892
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
893
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
892
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.SelectValue, {}) }),
|
|
893
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.SelectItem, { value, children: stackByItems[value] }, value)) })
|
|
894
894
|
]
|
|
895
895
|
}
|
|
896
896
|
)
|
|
897
897
|
] }) })
|
|
898
898
|
] }),
|
|
899
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
899
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
|
|
900
900
|
] }),
|
|
901
901
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
902
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
903
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
904
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
902
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.Card, { children: [
|
|
903
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardTitle, { children: t("token_usage.admin.by_company") }) }),
|
|
904
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
|
|
905
905
|
] }),
|
|
906
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
907
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
908
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
906
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.Card, { children: [
|
|
907
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardTitle, { children: t("token_usage.admin.by_user") }) }),
|
|
908
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
|
|
909
909
|
] })
|
|
910
910
|
] }),
|
|
911
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
912
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
913
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
914
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
911
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkFF4EIQ6Hjs.cn.call(void 0, "grid gap-4", !hidePlatform && "md:grid-cols-2"), children: [
|
|
912
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.Card, { children: [
|
|
913
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
|
|
914
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
915
915
|
TokenUsageRankedBar,
|
|
916
916
|
{
|
|
917
917
|
rows: byCustomerOperation,
|
|
@@ -921,9 +921,9 @@ function TokenUsageAdminContainer() {
|
|
|
921
921
|
}
|
|
922
922
|
) })
|
|
923
923
|
] }),
|
|
924
|
-
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
925
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
926
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
924
|
+
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.Card, { children: [
|
|
925
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
|
|
926
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
927
927
|
TokenUsageRankedBar,
|
|
928
928
|
{
|
|
929
929
|
rows: byOperation,
|
|
@@ -934,9 +934,9 @@ function TokenUsageAdminContainer() {
|
|
|
934
934
|
) })
|
|
935
935
|
] })
|
|
936
936
|
] }),
|
|
937
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
938
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
939
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
937
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.Card, { children: [
|
|
938
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardTitle, { children: t("token_usage.admin.detail") }) }),
|
|
939
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
|
|
940
940
|
] })
|
|
941
941
|
] }) });
|
|
942
942
|
}
|
|
@@ -949,36 +949,36 @@ function withFilters2(endpoint, filters) {
|
|
|
949
949
|
return endpoint;
|
|
950
950
|
}
|
|
951
951
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters2, "withFilters");
|
|
952
|
-
var TokenUsageReportService = class extends
|
|
952
|
+
var TokenUsageReportService = class extends _chunkFF4EIQ6Hjs.AbstractService {
|
|
953
953
|
static {
|
|
954
954
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageReportService");
|
|
955
955
|
}
|
|
956
956
|
/** Two rows: window "current" and "previous". */
|
|
957
957
|
static async getSummary(filters) {
|
|
958
|
-
const endpoint = withFilters2(new (0,
|
|
958
|
+
const endpoint = withFilters2(new (0, _chunkFF4EIQ6Hjs.EndpointCreator)({ endpoint: _chunkFF4EIQ6Hjs.Modules.TokenUsageReportSummary }), filters);
|
|
959
959
|
return this.callApi({
|
|
960
|
-
type:
|
|
960
|
+
type: _chunkFF4EIQ6Hjs.Modules.TokenUsageReportSummary,
|
|
961
961
|
method: "GET" /* GET */,
|
|
962
962
|
endpoint: endpoint.generate()
|
|
963
963
|
});
|
|
964
964
|
}
|
|
965
965
|
static async getTimeline(params) {
|
|
966
|
-
const endpoint = withFilters2(new (0,
|
|
966
|
+
const endpoint = withFilters2(new (0, _chunkFF4EIQ6Hjs.EndpointCreator)({ endpoint: _chunkFF4EIQ6Hjs.Modules.TokenUsageReportTimeline }), params);
|
|
967
967
|
endpoint.addAdditionalParam("granularity", params.granularity);
|
|
968
968
|
return this.callApi({
|
|
969
|
-
type:
|
|
969
|
+
type: _chunkFF4EIQ6Hjs.Modules.TokenUsageReportTimeline,
|
|
970
970
|
method: "GET" /* GET */,
|
|
971
971
|
endpoint: endpoint.generate()
|
|
972
972
|
});
|
|
973
973
|
}
|
|
974
974
|
static async getBreakdown(params) {
|
|
975
|
-
const endpoint = withFilters2(new (0,
|
|
975
|
+
const endpoint = withFilters2(new (0, _chunkFF4EIQ6Hjs.EndpointCreator)({ endpoint: _chunkFF4EIQ6Hjs.Modules.TokenUsageReportBreakdown }), params);
|
|
976
976
|
endpoint.addAdditionalParam("dimension", params.dimension);
|
|
977
977
|
if (params.targetLabel) endpoint.addAdditionalParam("targetLabel", params.targetLabel);
|
|
978
978
|
endpoint.addAdditionalParam("metric", params.metric);
|
|
979
979
|
if (params.limit !== void 0) endpoint.addAdditionalParam("limit", String(params.limit));
|
|
980
980
|
return this.callApi({
|
|
981
|
-
type:
|
|
981
|
+
type: _chunkFF4EIQ6Hjs.Modules.TokenUsageReportBreakdown,
|
|
982
982
|
method: "GET" /* GET */,
|
|
983
983
|
endpoint: endpoint.generate()
|
|
984
984
|
});
|
|
@@ -1057,7 +1057,7 @@ var TOKEN_USAGE_REPORT_I18N_KEYS = [
|
|
|
1057
1057
|
|
|
1058
1058
|
function TokenUsageReportFilterBar({ onChange }) {
|
|
1059
1059
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-help": "tokenusage.filters", className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1060
|
-
|
|
1060
|
+
_chunk6NZKWIORjs.DateRangeSelector,
|
|
1061
1061
|
{
|
|
1062
1062
|
onDateChange: (range) => {
|
|
1063
1063
|
if (!_optionalChain([range, 'optionalAccess', _5 => _5.from]) || !_optionalChain([range, 'optionalAccess', _6 => _6.to])) return;
|
|
@@ -1090,7 +1090,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1090
1090
|
pageUrl = TOKEN_USAGE_REPORT_PAGE_URL
|
|
1091
1091
|
}) => {
|
|
1092
1092
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1093
|
-
const generateUrl =
|
|
1093
|
+
const generateUrl = _chunk6NZKWIORjs.usePageUrlGenerator.call(void 0, );
|
|
1094
1094
|
const [filters, setFilterState] = _react.useState.call(void 0, () => {
|
|
1095
1095
|
const range = defaultRange2();
|
|
1096
1096
|
return { from: _nullishCoalesce(initialFrom, () => ( range.from)), to: _nullishCoalesce(initialTo, () => ( range.to)) };
|
|
@@ -1154,7 +1154,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1154
1154
|
() => ({ summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error }),
|
|
1155
1155
|
[summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error]
|
|
1156
1156
|
);
|
|
1157
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1157
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
|
|
1158
1158
|
}, "TokenUsageReportProvider");
|
|
1159
1159
|
var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
1160
1160
|
const ctx = _react.useContext.call(void 0, TokenUsageReportContext);
|
|
@@ -1174,7 +1174,7 @@ var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (
|
|
|
1174
1174
|
var ZERO2 = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
1175
1175
|
function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
1176
1176
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1177
|
-
const { decimal, metricValue: formatValue } =
|
|
1177
|
+
const { decimal, metricValue: formatValue } = _chunk6NZKWIORjs.useUsageFormatters.call(void 0, );
|
|
1178
1178
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (window) => _nullishCoalesce(summary.find((row) => row.window === window), () => ( ZERO2)), "rowFor");
|
|
1179
1179
|
const current = rowFor("current");
|
|
1180
1180
|
const previous = rowFor("previous");
|
|
@@ -1182,15 +1182,15 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1182
1182
|
const monthlyColor = monthlyPercentage > 75 ? "text-success" : monthlyPercentage >= 5 ? "text-warning" : "text-destructive";
|
|
1183
1183
|
const whole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => decimal(Math.max(0, Math.floor(value)), 0), "whole");
|
|
1184
1184
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
1185
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1185
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.CardContent, { className: "grid gap-1", children: [
|
|
1186
1186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.used_in_period") }),
|
|
1187
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(
|
|
1187
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(_chunk6NZKWIORjs.metricValue.call(void 0, current, metric), metric) }),
|
|
1188
1188
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
1189
1189
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1190
1190
|
Delta2,
|
|
1191
1191
|
{
|
|
1192
1192
|
testId: "tile-used-delta",
|
|
1193
|
-
delta:
|
|
1193
|
+
delta: _chunk6NZKWIORjs.percentageDelta.call(void 0, _chunk6NZKWIORjs.metricValue.call(void 0, current, metric), _chunk6NZKWIORjs.metricValue.call(void 0, previous, metric)),
|
|
1194
1194
|
decimal
|
|
1195
1195
|
}
|
|
1196
1196
|
),
|
|
@@ -1198,21 +1198,21 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1198
1198
|
] })
|
|
1199
1199
|
] }) }),
|
|
1200
1200
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3 sm:grid-cols-3", children: [
|
|
1201
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1201
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.CardContent, { className: "grid gap-1", children: [
|
|
1202
1202
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.monthly_left") }),
|
|
1203
1203
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-baseline gap-1", children: [
|
|
1204
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className:
|
|
1204
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className: _chunkFF4EIQ6Hjs.cn.call(void 0, "text-sm font-medium tabular-nums", monthlyColor), children: whole(balances.availableMonthlyCredits) }),
|
|
1205
1205
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-muted-foreground text-xs tabular-nums", children: [
|
|
1206
1206
|
"/ ",
|
|
1207
1207
|
whole(balances.monthlyCredits)
|
|
1208
1208
|
] })
|
|
1209
1209
|
] })
|
|
1210
1210
|
] }) }),
|
|
1211
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1211
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.CardContent, { className: "grid gap-1", children: [
|
|
1212
1212
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.extra_credits") }),
|
|
1213
1213
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: whole(balances.availableExtraCredits) })
|
|
1214
1214
|
] }) }),
|
|
1215
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1215
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.CardContent, { className: "grid gap-1", children: [
|
|
1216
1216
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.calls") }),
|
|
1217
1217
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: decimal(current.calls, 0) })
|
|
1218
1218
|
] }) })
|
|
@@ -1234,7 +1234,7 @@ function Delta2({
|
|
|
1234
1234
|
"span",
|
|
1235
1235
|
{
|
|
1236
1236
|
"data-testid": testId,
|
|
1237
|
-
className:
|
|
1237
|
+
className: _chunkFF4EIQ6Hjs.cn.call(void 0,
|
|
1238
1238
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
1239
1239
|
increased ? "text-warning" : "text-success"
|
|
1240
1240
|
),
|
|
@@ -1254,21 +1254,21 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1254
1254
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1255
1255
|
const { summary, timeline, byOperation, byTarget, isLoading, error, targetPanelTitleKey } = useTokenUsageReport();
|
|
1256
1256
|
if (error) {
|
|
1257
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1257
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
1258
1258
|
}
|
|
1259
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1259
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.RoundPageContainer, { fullWidth: true, forceHeader: true });
|
|
1260
1260
|
const emptyLabel = t("token_usage.report.no_data");
|
|
1261
1261
|
const targetTitle = targetPanelTitleKey && byTarget.length > 0 ? t(targetPanelTitleKey) : void 0;
|
|
1262
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1262
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
|
|
1263
1263
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportTiles, { summary, metric: "credits", balances }),
|
|
1264
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1265
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1266
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1264
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.Card, { children: [
|
|
1265
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
|
|
1266
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
|
|
1267
1267
|
] }),
|
|
1268
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
1269
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1270
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1271
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1268
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkFF4EIQ6Hjs.cn.call(void 0, "grid gap-4", targetTitle && "md:grid-cols-2"), children: [
|
|
1269
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.Card, { children: [
|
|
1270
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardTitle, { children: t("token_usage.report.by_operation") }) }),
|
|
1271
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1272
1272
|
TokenUsageRankedBar,
|
|
1273
1273
|
{
|
|
1274
1274
|
rows: byOperation,
|
|
@@ -1278,9 +1278,9 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1278
1278
|
}
|
|
1279
1279
|
) })
|
|
1280
1280
|
] }),
|
|
1281
|
-
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1282
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1283
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1281
|
+
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk6NZKWIORjs.Card, { children: [
|
|
1282
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardTitle, { children: targetTitle }) }),
|
|
1283
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6NZKWIORjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
|
|
1284
1284
|
] })
|
|
1285
1285
|
] })
|
|
1286
1286
|
] }) });
|
|
@@ -1320,5 +1320,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, TokenUsageReportContainer, "TokenUsageRepor
|
|
|
1320
1320
|
|
|
1321
1321
|
|
|
1322
1322
|
|
|
1323
|
-
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TOKEN_USAGE_REPORT_I18N_KEYS = TOKEN_USAGE_REPORT_I18N_KEYS; exports.TokenUsageAdminBreakdown =
|
|
1323
|
+
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TOKEN_USAGE_REPORT_I18N_KEYS = TOKEN_USAGE_REPORT_I18N_KEYS; exports.TokenUsageAdminBreakdown = _chunkFF4EIQ6Hjs.TokenUsageAdminBreakdown; exports.TokenUsageAdminBreakdownModule = _chunkFF4EIQ6Hjs.TokenUsageAdminBreakdownModule; exports.TokenUsageAdminContainer = TokenUsageAdminContainer; exports.TokenUsageAdminFilterBar = TokenUsageAdminFilterBar; exports.TokenUsageAdminProvider = TokenUsageAdminProvider; exports.TokenUsageAdminService = TokenUsageAdminService; exports.TokenUsageAdminSummary = _chunkFF4EIQ6Hjs.TokenUsageAdminSummary; exports.TokenUsageAdminSummaryModule = _chunkFF4EIQ6Hjs.TokenUsageAdminSummaryModule; exports.TokenUsageAdminTiles = TokenUsageAdminTiles; exports.TokenUsageAdminTimeline = _chunkFF4EIQ6Hjs.TokenUsageAdminTimeline; exports.TokenUsageAdminTimelineModule = _chunkFF4EIQ6Hjs.TokenUsageAdminTimelineModule; exports.TokenUsageBreakdownTable = TokenUsageBreakdownTable; exports.TokenUsageRankedBar = TokenUsageRankedBar; exports.TokenUsageReportBreakdown = _chunkFF4EIQ6Hjs.TokenUsageReportBreakdown; exports.TokenUsageReportContainer = TokenUsageReportContainer; exports.TokenUsageReportFilterBar = TokenUsageReportFilterBar; exports.TokenUsageReportProvider = TokenUsageReportProvider; exports.TokenUsageReportService = TokenUsageReportService; exports.TokenUsageReportSummary = _chunkFF4EIQ6Hjs.TokenUsageReportSummary; exports.TokenUsageReportTiles = TokenUsageReportTiles; exports.TokenUsageReportTimeline = _chunkFF4EIQ6Hjs.TokenUsageReportTimeline; exports.TokenUsageTimelineChart = TokenUsageTimelineChart; exports.configureTokenUsage = _chunkFF4EIQ6Hjs.configureTokenUsage; exports.createUsageFormatters = _chunk6NZKWIORjs.createUsageFormatters; exports.getTokenUsageCurrency = _chunkFF4EIQ6Hjs.getTokenUsageCurrency; exports.seriesColor = _chunk6NZKWIORjs.seriesColor; exports.seriesTheme = _chunk6NZKWIORjs.seriesTheme; exports.tokenUsageModules = _chunkFF4EIQ6Hjs.tokenUsageModules; exports.useTokenUsageAdmin = useTokenUsageAdmin; exports.useTokenUsageReport = useTokenUsageReport; exports.useUsageFormatters = _chunk6NZKWIORjs.useUsageFormatters;
|
|
1324
1324
|
//# sourceMappingURL=index.js.map
|