@carlonicora/nextjs-jsonapi 2.2.3 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BlockNoteEditor-ADT6II2V.mjs → BlockNoteEditor-3PS3HYVI.mjs} +12 -11
- package/dist/BlockNoteEditor-3PS3HYVI.mjs.map +1 -0
- package/dist/{BlockNoteEditor-QTIDATPF.js → BlockNoteEditor-PNAVMGHB.js} +27 -26
- package/dist/BlockNoteEditor-PNAVMGHB.js.map +1 -0
- package/dist/billing/index.js +357 -357
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-DLTMYGLR.mjs → chunk-EQEW64CH.mjs} +12 -1
- package/dist/chunk-EQEW64CH.mjs.map +1 -0
- package/dist/{chunk-YEPE2HT6.mjs → chunk-FSMXD3N7.mjs} +7 -6
- package/dist/{chunk-YEPE2HT6.mjs.map → chunk-FSMXD3N7.mjs.map} +1 -1
- package/dist/{chunk-7DJOQTNN.mjs → chunk-MN2BUSEU.mjs} +2 -2
- package/dist/{chunk-LANOKEFZ.js → chunk-OHJQYVSI.js} +7 -7
- package/dist/{chunk-LANOKEFZ.js.map → chunk-OHJQYVSI.js.map} +1 -1
- package/dist/{chunk-F3BPNQDB.js → chunk-QYUYQO2M.js} +738 -737
- package/dist/chunk-QYUYQO2M.js.map +1 -0
- package/dist/{chunk-KSU6CCW6.js → chunk-X5TPKMBS.js} +13 -2
- package/dist/chunk-X5TPKMBS.js.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +8 -1
- package/dist/components/index.d.ts +8 -1
- 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 +11 -1
- package/dist/core/index.d.ts +11 -1
- package/dist/core/index.js +4 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +3 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +71 -71
- package/dist/features/tokenusage/index.mjs +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/editors/BlockNoteEditor.tsx +12 -6
- package/src/features/assistant/components/containers/AssistantPageContainer.tsx +8 -1
- package/src/features/company/data/entity-ai-status.ts +13 -0
- package/src/features/company/data/index.ts +1 -0
- package/dist/BlockNoteEditor-ADT6II2V.mjs.map +0 -1
- package/dist/BlockNoteEditor-QTIDATPF.js.map +0 -1
- package/dist/chunk-DLTMYGLR.mjs.map +0 -1
- package/dist/chunk-F3BPNQDB.js.map +0 -1
- package/dist/chunk-KSU6CCW6.js.map +0 -1
- /package/dist/{chunk-7DJOQTNN.mjs.map → chunk-MN2BUSEU.mjs.map} +0 -0
|
@@ -23,13 +23,13 @@ var _chunkYBZVWLPHjs = require('../../chunk-YBZVWLPH.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkQYUYQO2Mjs = require('../../chunk-QYUYQO2M.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkOHJQYVSIjs = require('../../chunk-OHJQYVSI.js');
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkX5TPKMBSjs = require('../../chunk-X5TPKMBS.js');
|
|
33
33
|
require('../../chunk-LXKSUWAV.js');
|
|
34
34
|
require('../../chunk-IBS6NI7D.js');
|
|
35
35
|
require('../../chunk-FPO4DLZN.js');
|
|
@@ -43,7 +43,7 @@ var _react = require('react');
|
|
|
43
43
|
var _jsxruntime = require('react/jsx-runtime');
|
|
44
44
|
var HelpContext = _react.createContext.call(void 0, null);
|
|
45
45
|
function HelpProvider({ children }) {
|
|
46
|
-
const cfg =
|
|
46
|
+
const cfg = _chunkOHJQYVSIjs._getStaticHelpContent.call(void 0, );
|
|
47
47
|
if (!cfg) {
|
|
48
48
|
throw new Error(
|
|
49
49
|
"Help content not configured \u2014 call configureJsonApi({ helpContent: {...} }) before importing help components."
|
|
@@ -75,29 +75,29 @@ var _lucidereact = require('lucide-react');
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
function HelpAssistantSheet({ open, onOpenChange }) {
|
|
78
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
79
|
-
|
|
78
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.Sheet, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
79
|
+
_chunkQYUYQO2Mjs.SheetContent,
|
|
80
80
|
{
|
|
81
81
|
side: "right",
|
|
82
82
|
className: "flex w-full flex-col data-[side=right]:sm:max-w-2xl data-[side=right]:lg:max-w-3xl",
|
|
83
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
83
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.AssistantProvider, { manageUrl: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HelpAssistantSheetBody, {}) })
|
|
84
84
|
}
|
|
85
85
|
) });
|
|
86
86
|
}
|
|
87
87
|
_chunk7QVYU63Ejs.__name.call(void 0, HelpAssistantSheet, "HelpAssistantSheet");
|
|
88
88
|
function HelpAssistantSheetBody() {
|
|
89
89
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
90
|
-
const ctx =
|
|
90
|
+
const ctx = _chunkQYUYQO2Mjs.useAssistantContext.call(void 0, );
|
|
91
91
|
const showThread = !!ctx.assistant || ctx.sending || ctx.messages.length > 0;
|
|
92
92
|
const send = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (content) => ctx.sendMessage(content, { howToMode: true }), "send");
|
|
93
93
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
94
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
95
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
96
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
94
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.SheetHeader, { children: [
|
|
95
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SheetTitle, { children: t("help.askAi.sheet.title") }),
|
|
96
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SheetDescription, { children: t("help.askAi.sheet.subtitle") })
|
|
97
97
|
] }),
|
|
98
|
-
!showThread ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
98
|
+
!showThread ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.AssistantEmptyState, { onSend: send }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
99
99
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
100
|
-
|
|
100
|
+
_chunkQYUYQO2Mjs.AssistantThread,
|
|
101
101
|
{
|
|
102
102
|
messages: ctx.messages,
|
|
103
103
|
sending: ctx.sending,
|
|
@@ -107,7 +107,7 @@ function HelpAssistantSheetBody() {
|
|
|
107
107
|
onRetry: ctx.retrySend
|
|
108
108
|
}
|
|
109
109
|
),
|
|
110
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
110
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.AssistantComposer, { onSend: send, disabled: ctx.sending })
|
|
111
111
|
] })
|
|
112
112
|
] });
|
|
113
113
|
}
|
|
@@ -117,20 +117,20 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpAssistantSheetBody, "HelpAssistantSheet
|
|
|
117
117
|
|
|
118
118
|
function HelpAskAi() {
|
|
119
119
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
120
|
-
const { currentUser } =
|
|
120
|
+
const { currentUser } = _chunkQYUYQO2Mjs.useCurrentUserContext.call(void 0, );
|
|
121
121
|
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
122
122
|
const disabled = !currentUser;
|
|
123
123
|
if (disabled) {
|
|
124
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
125
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
124
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.Tooltip, { children: [
|
|
125
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.TooltipTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.Button, { variant: "outline", size: "sm", disabled: true }), children: [
|
|
126
126
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SparklesIcon, { className: "h-4 w-4" }),
|
|
127
127
|
t("help.askAi.button")
|
|
128
128
|
] }),
|
|
129
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
129
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TooltipContent, { children: t("help.askAi.loginTooltip") })
|
|
130
130
|
] });
|
|
131
131
|
}
|
|
132
132
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
133
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
133
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
134
134
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SparklesIcon, { className: "h-4 w-4" }),
|
|
135
135
|
t("help.askAi.button")
|
|
136
136
|
] }),
|
|
@@ -143,7 +143,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpAskAi, "HelpAskAi");
|
|
|
143
143
|
|
|
144
144
|
function HelpHeader() {
|
|
145
145
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
146
|
-
const { currentUser } =
|
|
146
|
+
const { currentUser } = _chunkQYUYQO2Mjs.useCurrentUserContext.call(void 0, );
|
|
147
147
|
const { brand } = useHelp();
|
|
148
148
|
const logo = _optionalChain([brand, 'optionalAccess', _ => _.logo]);
|
|
149
149
|
const label = _nullishCoalesce(_optionalChain([brand, 'optionalAccess', _2 => _2.label]), () => ( "Help"));
|
|
@@ -159,7 +159,7 @@ function HelpHeader() {
|
|
|
159
159
|
] }),
|
|
160
160
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
161
161
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, HelpAskAi, {}),
|
|
162
|
-
currentUser ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _link2.default, { href: appHref, className:
|
|
162
|
+
currentUser ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _link2.default, { href: appHref, className: _chunkQYUYQO2Mjs.buttonVariants.call(void 0, { variant: "outline", size: "sm" }), children: t("help.header.openApp") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _link2.default, { href: "/login", className: _chunkQYUYQO2Mjs.buttonVariants.call(void 0, { variant: "outline", size: "sm" }), children: t("help.header.login") })
|
|
163
163
|
] })
|
|
164
164
|
] });
|
|
165
165
|
}
|
|
@@ -201,12 +201,12 @@ _chunk7QVYU63Ejs.__name.call(void 0, useHelpFilter, "useHelpFilter");
|
|
|
201
201
|
|
|
202
202
|
function HelpSideNav() {
|
|
203
203
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
204
|
-
const generateUrl =
|
|
204
|
+
const generateUrl = _chunkQYUYQO2Mjs.usePageUrlGenerator.call(void 0, );
|
|
205
205
|
const pathname = _navigation.usePathname.call(void 0, );
|
|
206
206
|
const [articles, setArticles] = _react.useState.call(void 0, []);
|
|
207
207
|
_react.useEffect.call(void 0, () => {
|
|
208
208
|
let active = true;
|
|
209
|
-
|
|
209
|
+
_chunkX5TPKMBSjs.HowToService.findPublished().then((list) => active && setArticles(list)).catch(() => active && setArticles([]));
|
|
210
210
|
return () => {
|
|
211
211
|
active = false;
|
|
212
212
|
};
|
|
@@ -282,7 +282,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpSideNav, "HelpSideNav");
|
|
|
282
282
|
function HelpArticleBody(props) {
|
|
283
283
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
284
284
|
const format = _nextintl.useFormatter.call(void 0, );
|
|
285
|
-
const generateUrl =
|
|
285
|
+
const generateUrl = _chunkQYUYQO2Mjs.usePageUrlGenerator.call(void 0, );
|
|
286
286
|
const { howToType, title, summary, updatedAt, prev, next, children } = props;
|
|
287
287
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "article", { className: "prose dark:prose-invert max-w-none", children: [
|
|
288
288
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "nav", { className: "text-muted-foreground mb-2 text-xs", children: [
|
|
@@ -339,7 +339,7 @@ function HelpTOC({ headings }) {
|
|
|
339
339
|
}, [headings]);
|
|
340
340
|
if (headings.length === 0) return null;
|
|
341
341
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "nav", { "aria-label": t("help.toc.title"), className: "hidden lg:block", children: [
|
|
342
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
342
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.MicroLabel, { className: "mb-2", children: t("help.toc.title") }),
|
|
343
343
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "space-y-1 text-sm", children: headings.map((h) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { style: { paddingLeft: `${(h.depth - 2) * 0.75}rem` }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
344
344
|
"a",
|
|
345
345
|
{
|
|
@@ -360,13 +360,13 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpTOC, "HelpTOC");
|
|
|
360
360
|
|
|
361
361
|
function HelpHint({ contextKey }) {
|
|
362
362
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
363
|
-
const generateUrl =
|
|
363
|
+
const generateUrl = _chunkQYUYQO2Mjs.usePageUrlGenerator.call(void 0, );
|
|
364
364
|
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
365
365
|
const [picked, setPicked] = _react.useState.call(void 0, null);
|
|
366
366
|
const [articles, setArticles] = _react.useState.call(void 0, []);
|
|
367
367
|
_react.useEffect.call(void 0, () => {
|
|
368
368
|
let active2 = true;
|
|
369
|
-
|
|
369
|
+
_chunkX5TPKMBSjs.HowToService.findPublished().then((list) => active2 && setArticles(list)).catch(() => active2 && setArticles([]));
|
|
370
370
|
return () => {
|
|
371
371
|
active2 = false;
|
|
372
372
|
};
|
|
@@ -378,7 +378,7 @@ function HelpHint({ contextKey }) {
|
|
|
378
378
|
if (matches.length === 0) return null;
|
|
379
379
|
const active = _nullishCoalesce(picked, () => ( (matches.length === 1 ? matches[0] : null)));
|
|
380
380
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
381
|
-
|
|
381
|
+
_chunkQYUYQO2Mjs.Sheet,
|
|
382
382
|
{
|
|
383
383
|
open,
|
|
384
384
|
onOpenChange: (o) => {
|
|
@@ -386,11 +386,11 @@ function HelpHint({ contextKey }) {
|
|
|
386
386
|
if (!o) setPicked(null);
|
|
387
387
|
},
|
|
388
388
|
children: [
|
|
389
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
390
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
391
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
392
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
393
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
389
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SheetTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.Button, { variant: "ghost", size: "icon-sm", "aria-label": t("help.hint.trigger") }), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.HelpCircleIcon, { className: "h-4 w-4" }) }),
|
|
390
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.SheetContent, { side: "right", className: "w-full max-w-md sm:max-w-lg", children: [
|
|
391
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.SheetHeader, { children: [
|
|
392
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SheetTitle, { children: active ? active.name : t("help.hint.pickArticle") }),
|
|
393
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SheetDescription, { children: _nullishCoalesce(_optionalChain([active, 'optionalAccess', _4 => _4.summary]), () => ( "")) })
|
|
394
394
|
] }),
|
|
395
395
|
active ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mt-4 space-y-3", children: [
|
|
396
396
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm", children: active.summary }),
|
|
@@ -422,18 +422,18 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpHint, "HelpHint");
|
|
|
422
422
|
|
|
423
423
|
function HelpSearchResultRow({ result, onSelect }) {
|
|
424
424
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
425
|
-
const generateUrl =
|
|
425
|
+
const generateUrl = _chunkQYUYQO2Mjs.usePageUrlGenerator.call(void 0, );
|
|
426
426
|
const [article, setArticle] = _react.useState.call(void 0, null);
|
|
427
427
|
_react.useEffect.call(void 0, () => {
|
|
428
428
|
let active = true;
|
|
429
|
-
|
|
429
|
+
_chunkX5TPKMBSjs.HowToService.findOne({ id: result.id }).then((a) => active && setArticle(a)).catch(() => active && setArticle(null));
|
|
430
430
|
return () => {
|
|
431
431
|
active = false;
|
|
432
432
|
};
|
|
433
433
|
}, [result.id]);
|
|
434
434
|
if (!article) {
|
|
435
435
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
436
|
-
|
|
436
|
+
_chunkQYUYQO2Mjs.CommandItem,
|
|
437
437
|
{
|
|
438
438
|
value: result.id,
|
|
439
439
|
disabled: true,
|
|
@@ -442,7 +442,7 @@ function HelpSearchResultRow({ result, onSelect }) {
|
|
|
442
442
|
}
|
|
443
443
|
);
|
|
444
444
|
}
|
|
445
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
445
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CommandItem, { value: result.id, onSelect, className: "cursor-pointer p-0", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
446
446
|
_link2.default,
|
|
447
447
|
{
|
|
448
448
|
href: generateUrl({ page: `/help/${article.howToType}/${article.slug}` }),
|
|
@@ -23,13 +23,13 @@ import {
|
|
|
23
23
|
useAssistantContext,
|
|
24
24
|
useCurrentUserContext,
|
|
25
25
|
usePageUrlGenerator
|
|
26
|
-
} from "../../chunk-
|
|
26
|
+
} from "../../chunk-FSMXD3N7.mjs";
|
|
27
27
|
import {
|
|
28
28
|
_getStaticHelpContent
|
|
29
|
-
} from "../../chunk-
|
|
29
|
+
} from "../../chunk-MN2BUSEU.mjs";
|
|
30
30
|
import {
|
|
31
31
|
HowToService
|
|
32
|
-
} from "../../chunk-
|
|
32
|
+
} from "../../chunk-EQEW64CH.mjs";
|
|
33
33
|
import "../../chunk-AUXK7QSA.mjs";
|
|
34
34
|
import "../../chunk-C7C7VY4F.mjs";
|
|
35
35
|
import "../../chunk-E5YA5Z5X.mjs";
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
30
|
-
require('../../chunk-
|
|
29
|
+
var _chunkQYUYQO2Mjs = require('../../chunk-QYUYQO2M.js');
|
|
30
|
+
require('../../chunk-OHJQYVSI.js');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
@@ -39,7 +39,7 @@ require('../../chunk-LANOKEFZ.js');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunkX5TPKMBSjs = require('../../chunk-X5TPKMBS.js');
|
|
43
43
|
require('../../chunk-LXKSUWAV.js');
|
|
44
44
|
require('../../chunk-IBS6NI7D.js');
|
|
45
45
|
require('../../chunk-FPO4DLZN.js');
|
|
@@ -64,7 +64,7 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
64
64
|
};
|
|
65
65
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
66
66
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
67
|
-
|
|
67
|
+
_chunkQYUYQO2Mjs.DateRangeSelector,
|
|
68
68
|
{
|
|
69
69
|
onDateChange: (range) => {
|
|
70
70
|
if (!_optionalChain([range, 'optionalAccess', _ => _.from]) || !_optionalChain([range, 'optionalAccess', _2 => _2.to])) return;
|
|
@@ -99,16 +99,16 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
99
99
|
}
|
|
100
100
|
),
|
|
101
101
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
102
|
-
|
|
102
|
+
_chunkQYUYQO2Mjs.Select,
|
|
103
103
|
{
|
|
104
104
|
items: companyItems,
|
|
105
105
|
value: _nullishCoalesce(companyId, () => ( ALL_COMPANIES)),
|
|
106
106
|
onValueChange: (value) => onChange({ companyId: !value || value === ALL_COMPANIES ? void 0 : value }),
|
|
107
107
|
children: [
|
|
108
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
109
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
110
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
111
|
-
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
108
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
|
|
109
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.SelectContent, { children: [
|
|
110
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
|
|
111
|
+
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SelectItem, { value: company.id, children: company.label }, company.id))
|
|
112
112
|
] })
|
|
113
113
|
]
|
|
114
114
|
}
|
|
@@ -131,13 +131,13 @@ function Segmented({
|
|
|
131
131
|
children: options.map((option) => {
|
|
132
132
|
const selected = option.value === value;
|
|
133
133
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
134
|
-
|
|
134
|
+
_chunkQYUYQO2Mjs.Button,
|
|
135
135
|
{
|
|
136
136
|
type: "button",
|
|
137
137
|
size: "sm",
|
|
138
138
|
variant: selected ? "default" : "ghost",
|
|
139
139
|
"aria-pressed": selected,
|
|
140
|
-
className:
|
|
140
|
+
className: _chunkX5TPKMBSjs.cn.call(void 0, !selected && "text-muted-foreground"),
|
|
141
141
|
onClick: () => onSelect(option.value),
|
|
142
142
|
children: option.label
|
|
143
143
|
},
|
|
@@ -157,36 +157,36 @@ function withFilters(endpoint, filters) {
|
|
|
157
157
|
return endpoint;
|
|
158
158
|
}
|
|
159
159
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters, "withFilters");
|
|
160
|
-
var TokenUsageAdminService = class extends
|
|
160
|
+
var TokenUsageAdminService = class extends _chunkX5TPKMBSjs.AbstractService {
|
|
161
161
|
static {
|
|
162
162
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageAdminService");
|
|
163
163
|
}
|
|
164
164
|
/** Six rows: {customer, platform, total} × {current, previous}. */
|
|
165
165
|
static async getSummary(filters) {
|
|
166
|
-
const endpoint = withFilters(new (0,
|
|
166
|
+
const endpoint = withFilters(new (0, _chunkX5TPKMBSjs.EndpointCreator)({ endpoint: _chunkX5TPKMBSjs.Modules.TokenUsageAdminSummary }), filters);
|
|
167
167
|
return this.callApi({
|
|
168
|
-
type:
|
|
168
|
+
type: _chunkX5TPKMBSjs.Modules.TokenUsageAdminSummary,
|
|
169
169
|
method: "GET" /* GET */,
|
|
170
170
|
endpoint: endpoint.generate()
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
static async getTimeline(params) {
|
|
174
|
-
const endpoint = withFilters(new (0,
|
|
174
|
+
const endpoint = withFilters(new (0, _chunkX5TPKMBSjs.EndpointCreator)({ endpoint: _chunkX5TPKMBSjs.Modules.TokenUsageAdminTimeline }), params);
|
|
175
175
|
endpoint.addAdditionalParam("granularity", params.granularity);
|
|
176
176
|
endpoint.addAdditionalParam("stackBy", params.stackBy);
|
|
177
177
|
return this.callApi({
|
|
178
|
-
type:
|
|
178
|
+
type: _chunkX5TPKMBSjs.Modules.TokenUsageAdminTimeline,
|
|
179
179
|
method: "GET" /* GET */,
|
|
180
180
|
endpoint: endpoint.generate()
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
static async getBreakdown(params) {
|
|
184
|
-
const endpoint = withFilters(new (0,
|
|
184
|
+
const endpoint = withFilters(new (0, _chunkX5TPKMBSjs.EndpointCreator)({ endpoint: _chunkX5TPKMBSjs.Modules.TokenUsageAdminBreakdown }), params);
|
|
185
185
|
endpoint.addAdditionalParam("dimension", params.dimension);
|
|
186
186
|
endpoint.addAdditionalParam("scope", params.scope);
|
|
187
187
|
if (params.limit !== void 0) endpoint.addAdditionalParam("limit", String(params.limit));
|
|
188
188
|
return this.callApi({
|
|
189
|
-
type:
|
|
189
|
+
type: _chunkX5TPKMBSjs.Modules.TokenUsageAdminBreakdown,
|
|
190
190
|
method: "GET" /* GET */,
|
|
191
191
|
endpoint: endpoint.generate()
|
|
192
192
|
});
|
|
@@ -212,7 +212,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
212
212
|
topN = DEFAULT_TOP_N
|
|
213
213
|
}) => {
|
|
214
214
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
215
|
-
const generateUrl =
|
|
215
|
+
const generateUrl = _chunkQYUYQO2Mjs.usePageUrlGenerator.call(void 0, );
|
|
216
216
|
const [filters, setFilterState] = _react.useState.call(void 0, () => {
|
|
217
217
|
const range = defaultRange();
|
|
218
218
|
return {
|
|
@@ -330,7 +330,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
330
330
|
error
|
|
331
331
|
]
|
|
332
332
|
);
|
|
333
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
333
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
|
|
334
334
|
}, "TokenUsageAdminProvider");
|
|
335
335
|
var useTokenUsageAdmin = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
336
336
|
const ctx = _react.useContext.call(void 0, TokenUsageAdminContext);
|
|
@@ -399,7 +399,7 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
399
399
|
const averagePerCall = totalCurrent.calls ? totalCurrent.cost / totalCurrent.calls : 0;
|
|
400
400
|
const cacheHit = cacheHitPercentage(totalCurrent.cached, totalCurrent.tokensIn);
|
|
401
401
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
402
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
402
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkX5TPKMBSjs.cn.call(void 0, "grid gap-3", singleCustomerMode ? "sm:grid-cols-1" : "sm:grid-cols-2"), children: [
|
|
403
403
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
404
|
LeadTile,
|
|
405
405
|
{
|
|
@@ -458,7 +458,7 @@ function LeadTile({
|
|
|
458
458
|
delta,
|
|
459
459
|
previousLabel
|
|
460
460
|
}) {
|
|
461
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
461
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.CardContent, { className: "grid gap-1", children: [
|
|
462
462
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
463
463
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: value }),
|
|
464
464
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
@@ -474,7 +474,7 @@ function SupportingTile({
|
|
|
474
474
|
value,
|
|
475
475
|
delta
|
|
476
476
|
}) {
|
|
477
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
477
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.CardContent, { className: "grid gap-1", children: [
|
|
478
478
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
479
479
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-2", children: [
|
|
480
480
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: value }),
|
|
@@ -493,7 +493,7 @@ function Delta({ testId, delta }) {
|
|
|
493
493
|
"span",
|
|
494
494
|
{
|
|
495
495
|
"data-testid": testId,
|
|
496
|
-
className:
|
|
496
|
+
className: _chunkX5TPKMBSjs.cn.call(void 0,
|
|
497
497
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
498
498
|
increased ? "text-success" : "text-destructive"
|
|
499
499
|
),
|
|
@@ -566,13 +566,13 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
566
566
|
// The package's <Table> wraps itself in an `overflow-x-clip` container, which
|
|
567
567
|
// would swallow the overflow before this scroller ever saw it — hence the
|
|
568
568
|
// child override. Wide metric tables must scroll, never widen the page.
|
|
569
|
-
/* @__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,
|
|
570
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
569
|
+
/* @__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, _chunkQYUYQO2Mjs.Table, { children: [
|
|
570
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableHead, { className: _chunkX5TPKMBSjs.cn.call(void 0, column.numeric && "text-right"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
571
571
|
"button",
|
|
572
572
|
{
|
|
573
573
|
type: "button",
|
|
574
574
|
onClick: () => toggleSort(column.key),
|
|
575
|
-
className:
|
|
575
|
+
className: _chunkX5TPKMBSjs.cn.call(void 0,
|
|
576
576
|
"hover:text-primary inline-flex items-center gap-1 text-xs font-medium",
|
|
577
577
|
column.numeric && "flex-row-reverse"
|
|
578
578
|
),
|
|
@@ -582,20 +582,20 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
582
582
|
]
|
|
583
583
|
}
|
|
584
584
|
) }, column.key)) }) }),
|
|
585
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
585
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableBody, { children: sortedRows.map((row) => {
|
|
586
586
|
const value = metricValue(row, metric);
|
|
587
587
|
const share = total > 0 ? value / total * 100 : 0;
|
|
588
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
589
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
590
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
591
|
-
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
592
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
593
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
594
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
595
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
596
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
597
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
598
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
588
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
|
|
589
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
|
|
590
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
|
|
591
|
+
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableCell, { className: "text-right text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : formatDecimal(row.activeUsers, 0) }),
|
|
592
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableCell, { className: "text-right text-xs tabular-nums", children: formatDecimal(row.calls, 0) }),
|
|
593
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableCell, { className: "text-right text-xs tabular-nums", children: formatDecimal(row.tokensIn, 0) }),
|
|
594
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableCell, { className: "text-right text-xs tabular-nums", children: formatDecimal(row.tokensOut, 0) }),
|
|
595
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableCell, { className: "text-right text-xs tabular-nums", children: formatPercent(cacheHitPercentage(row.cached, row.tokensIn)) }),
|
|
596
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableCell, { className: "text-right text-xs tabular-nums", children: formatMetricValue(row.cost, "cost") }),
|
|
597
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableCell, { className: "text-right text-xs tabular-nums", children: formatMetricValue(row.credits, "credits") }),
|
|
598
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.TableCell, { className: "text-right text-xs tabular-nums", children: formatPercent(share) })
|
|
599
599
|
] }, row.id);
|
|
600
600
|
}) })
|
|
601
601
|
] }) })
|
|
@@ -789,7 +789,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
789
789
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, children: [
|
|
790
790
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
|
|
791
791
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
|
|
792
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
792
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.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: [
|
|
793
793
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
|
|
794
794
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
795
795
|
_recharts.XAxis,
|
|
@@ -813,17 +813,17 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
813
813
|
}
|
|
814
814
|
),
|
|
815
815
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
816
|
-
|
|
816
|
+
_chunkQYUYQO2Mjs.ChartTooltip,
|
|
817
817
|
{
|
|
818
818
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
819
|
-
|
|
819
|
+
_chunkQYUYQO2Mjs.ChartTooltipContent,
|
|
820
820
|
{
|
|
821
821
|
labelFormatter: (value) => formatBucket.format(/* @__PURE__ */ new Date(`${String(value)}T00:00:00.000Z`))
|
|
822
822
|
}
|
|
823
823
|
)
|
|
824
824
|
}
|
|
825
825
|
),
|
|
826
|
-
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
826
|
+
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.ChartLegendContent, {}) }) : null,
|
|
827
827
|
seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
828
828
|
_recharts.Bar,
|
|
829
829
|
{
|
|
@@ -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, _chunkQYUYQO2Mjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.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, _chunkQYUYQO2Mjs.RoundPageContainer, { 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, _chunkQYUYQO2Mjs.RoundPageContainer, { 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 }),
|
|
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, _chunkQYUYQO2Mjs.Card, { children: [
|
|
879
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.CardHeader, { children: [
|
|
880
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
|
|
881
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.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
|
+
_chunkQYUYQO2Mjs.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, _chunkQYUYQO2Mjs.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SelectValue, {}) }),
|
|
893
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.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, _chunkQYUYQO2Mjs.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, _chunkQYUYQO2Mjs.Card, { children: [
|
|
903
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardTitle, { children: t("token_usage.admin.by_company") }) }),
|
|
904
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.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, _chunkQYUYQO2Mjs.Card, { children: [
|
|
907
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardTitle, { children: t("token_usage.admin.by_user") }) }),
|
|
908
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.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: _chunkX5TPKMBSjs.cn.call(void 0, "grid gap-4", !singleCustomerMode && "md:grid-cols-2"), children: [
|
|
912
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.Card, { children: [
|
|
913
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
|
|
914
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.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
|
-
!singleCustomerMode && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
925
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
926
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
924
|
+
!singleCustomerMode && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQYUYQO2Mjs.Card, { children: [
|
|
925
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
|
|
926
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.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, _chunkQYUYQO2Mjs.Card, { children: [
|
|
938
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardTitle, { children: t("token_usage.admin.detail") }) }),
|
|
939
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQYUYQO2Mjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
|
|
940
940
|
] })
|
|
941
941
|
] }) });
|
|
942
942
|
}
|
|
@@ -1008,5 +1008,5 @@ var TOKEN_USAGE_ADMIN_I18N_KEYS = [
|
|
|
1008
1008
|
|
|
1009
1009
|
|
|
1010
1010
|
|
|
1011
|
-
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TokenUsageAdminBreakdown =
|
|
1011
|
+
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TokenUsageAdminBreakdown = _chunkX5TPKMBSjs.TokenUsageAdminBreakdown; exports.TokenUsageAdminBreakdownModule = _chunkX5TPKMBSjs.TokenUsageAdminBreakdownModule; exports.TokenUsageAdminContainer = TokenUsageAdminContainer; exports.TokenUsageAdminFilterBar = TokenUsageAdminFilterBar; exports.TokenUsageAdminProvider = TokenUsageAdminProvider; exports.TokenUsageAdminService = TokenUsageAdminService; exports.TokenUsageAdminSummary = _chunkX5TPKMBSjs.TokenUsageAdminSummary; exports.TokenUsageAdminSummaryModule = _chunkX5TPKMBSjs.TokenUsageAdminSummaryModule; exports.TokenUsageAdminTiles = TokenUsageAdminTiles; exports.TokenUsageAdminTimeline = _chunkX5TPKMBSjs.TokenUsageAdminTimeline; exports.TokenUsageAdminTimelineModule = _chunkX5TPKMBSjs.TokenUsageAdminTimelineModule; exports.TokenUsageBreakdownTable = TokenUsageBreakdownTable; exports.TokenUsageRankedBar = TokenUsageRankedBar; exports.TokenUsageTimelineChart = TokenUsageTimelineChart; exports.useTokenUsageAdmin = useTokenUsageAdmin;
|
|
1012
1012
|
//# sourceMappingURL=index.js.map
|