hackagent-webui 0.5.24.dev63__py3-none-any.whl → 0.5.26.dev65__py3-none-any.whl
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.
- hackagent_webui/__init__.py +1 -1
- hackagent_webui/static/404.html +1 -1
- hackagent_webui/static/VERSION +1 -1
- hackagent_webui/static/_next/static/chunks/109-654aaa36bb44ad55.js +1 -0
- hackagent_webui/static/_next/static/chunks/168-a33d1f7eac818103.js +1 -0
- hackagent_webui/static/_next/static/chunks/210-86c6a66776f43b4f.js +1 -0
- hackagent_webui/static/_next/static/chunks/267-68673a68da8dc0ed.js +1 -0
- hackagent_webui/static/_next/static/chunks/352-9d98107ec1d2a19b.js +17 -0
- hackagent_webui/static/_next/static/chunks/452-93edd5e5c682593d.js +1 -0
- hackagent_webui/static/_next/static/chunks/592-cb13179874c3bab1.js +1 -0
- hackagent_webui/static/_next/static/chunks/630-d567a2d5c62c90f0.js +1 -0
- hackagent_webui/static/_next/static/chunks/704-e457c79de3cc7514.js +1 -0
- hackagent_webui/static/_next/static/chunks/{570-2cfb1925b42e0c87.js → 756-0acdfe10693b8afc.js} +1 -1
- hackagent_webui/static/_next/static/chunks/870-fd9b5a5e5bb99ffa.js +1 -0
- hackagent_webui/static/_next/static/chunks/877.8e1543796718ce2b.js +1 -0
- hackagent_webui/static/_next/static/chunks/918-f236042f5a6cc47e.js +1 -0
- hackagent_webui/static/_next/static/chunks/921-92a9ab4120f81d51.js +1 -0
- hackagent_webui/static/_next/static/chunks/924-5936172175b16f71.js +1 -0
- hackagent_webui/static/_next/static/chunks/app/agents/page-2ede712c1f31dd76.js +1 -0
- hackagent_webui/static/_next/static/chunks/app/api-keys/{page-c328dd1bd8b83c5d.js → page-1c219ac9dd1bcdd4.js} +1 -1
- hackagent_webui/static/_next/static/chunks/app/attacks/page-247041304bc4853c.js +1 -0
- hackagent_webui/static/_next/static/chunks/app/{layout-5bac4852dcc6884b.js → layout-88b65f1463c58138.js} +1 -1
- hackagent_webui/static/_next/static/chunks/app/{page-1c03fd81f0ad4be8.js → page-67fe8c280f18e8a6.js} +1 -1
- hackagent_webui/static/_next/static/chunks/app/profile/{page-ce6924c016301490.js → page-96240b9461a515e9.js} +1 -1
- hackagent_webui/static/_next/static/chunks/app/stats/page-457e2fc0286253b9.js +1 -0
- hackagent_webui/static/_next/static/chunks/{webpack-ecae86322f0a33a1.js → webpack-5f5c255a944acccf.js} +1 -1
- hackagent_webui/static/_next/static/css/99e7387e28657839.css +1 -0
- hackagent_webui/static/agents.html +1 -1
- hackagent_webui/static/agents.txt +5 -5
- hackagent_webui/static/api-keys.html +1 -1
- hackagent_webui/static/api-keys.txt +5 -5
- hackagent_webui/static/attacks.html +1 -1
- hackagent_webui/static/attacks.txt +5 -5
- hackagent_webui/static/campaign-export/runtime.js +64 -64
- hackagent_webui/static/campaign-export/styles.css +1 -1
- hackagent_webui/static/index.html +1 -1
- hackagent_webui/static/index.txt +5 -5
- hackagent_webui/static/profile.html +1 -1
- hackagent_webui/static/profile.txt +5 -5
- hackagent_webui/static/secrets.html +1 -1
- hackagent_webui/static/secrets.txt +5 -5
- hackagent_webui/static/stats.html +1 -1
- hackagent_webui/static/stats.txt +5 -5
- {hackagent_webui-0.5.24.dev63.dist-info → hackagent_webui-0.5.26.dev65.dist-info}/METADATA +1 -1
- hackagent_webui-0.5.26.dev65.dist-info/RECORD +75 -0
- hackagent_webui/static/_next/static/chunks/176-5cc7fc0b6b2515c7.js +0 -1
- hackagent_webui/static/_next/static/chunks/259-252d18d6e44b253a.js +0 -1
- hackagent_webui/static/_next/static/chunks/274-7bcbf1c829f21215.js +0 -1
- hackagent_webui/static/_next/static/chunks/343-a4d2eb0ec9b0ad08.js +0 -1
- hackagent_webui/static/_next/static/chunks/373-2cd9dd2f37667862.js +0 -1
- hackagent_webui/static/_next/static/chunks/41-19701c9e1d5392fe.js +0 -1
- hackagent_webui/static/_next/static/chunks/547-669ff4558f8f62ba.js +0 -1
- hackagent_webui/static/_next/static/chunks/576-18b5984bad944e1f.js +0 -1
- hackagent_webui/static/_next/static/chunks/602-e25fde26bccbeb75.js +0 -17
- hackagent_webui/static/_next/static/chunks/727-3d5d954e608613b1.js +0 -1
- hackagent_webui/static/_next/static/chunks/776-e05722d87e478223.js +0 -1
- hackagent_webui/static/_next/static/chunks/784-27c51ffcb299d644.js +0 -1
- hackagent_webui/static/_next/static/chunks/81-ac2b07fd6ed26676.js +0 -1
- hackagent_webui/static/_next/static/chunks/877.6c5ea5a15f1f6508.js +0 -1
- hackagent_webui/static/_next/static/chunks/924-4691ca4c204d197d.js +0 -1
- hackagent_webui/static/_next/static/chunks/app/agents/page-2e581fcca5116a94.js +0 -1
- hackagent_webui/static/_next/static/chunks/app/attacks/page-b2413be2a8ab61fc.js +0 -1
- hackagent_webui/static/_next/static/chunks/app/stats/page-275a2b415a2f1e9b.js +0 -1
- hackagent_webui/static/_next/static/css/62a118f1cf702f73.css +0 -1
- hackagent_webui-0.5.24.dev63.dist-info/RECORD +0 -76
- /hackagent_webui/static/_next/static/{JAv9qBwf9KELIdya1HLMW → U7s5LqEUH8gEO4-nmwKZH}/_buildManifest.js +0 -0
- /hackagent_webui/static/_next/static/{JAv9qBwf9KELIdya1HLMW → U7s5LqEUH8gEO4-nmwKZH}/_ssgManifest.js +0 -0
- {hackagent_webui-0.5.24.dev63.dist-info → hackagent_webui-0.5.26.dev65.dist-info}/WHEEL +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[840],{18332:(e,t,s)=>{"use strict";s.d(t,{Fc:()=>o,TN:()=>c,XL:()=>i});var a=s(95155);s(12115);var r=s(83101),l=s(64269);let n=(0,r.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:s,...r}=e;return(0,a.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,l.cn)(n({variant:s}),t),...r})}function i(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-title",className:(0,l.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...s})}function c(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-description",className:(0,l.cn)("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...s})}},20243:(e,t,s)=>{"use strict";s.d(t,{E:()=>l});var a=s(95155),r=s(64269);function l(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"skeleton",className:(0,r.cn)("bg-accent animate-pulse rounded-md",t),...s})}},22470:(e,t,s)=>{"use strict";s.d(t,{M:()=>r});var a=s(95155);s(12115);let r=e=>{let{title:t,description:s,action:r,children:l,maxWidth:n="full",compact:o=!1}=e;return(0,a.jsxs)("div",{className:"w-full ".concat({full:"max-w-full","8xl":"max-w-[90rem]","7xl":"max-w-7xl","6xl":"max-w-6xl","5xl":"max-w-5xl","4xl":"max-w-4xl","3xl":"max-w-3xl","2xl":"max-w-2xl"}[n]||"max-w-full"," mx-auto ").concat(o?"py-3 space-y-3":"py-6 space-y-6"),children:[t&&(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 border-b ".concat(o?"px-4 pb-3":"px-6 pb-5"),children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:t}),s&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:s})]}),r&&(0,a.jsx)("div",{className:"flex-shrink-0 pt-0.5",children:r})]}),l]})}},33369:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>Q});var a=s(95155),r=s(12115),l=s(80230),n=s(7831),o=s(41444),i=s(63479),c=s(22470),d=s(56419);function u(e){let t="number"==typeof e?e:Number.parseFloat(String(e));return Number.isFinite(t)&&t>=0?t:0}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}var x=s(87270);function h(e){let{summaries:t,monthLabel:s}=e;return 0===t.length?null:(0,a.jsxs)("section",{className:"border mx-6 mb-6 rounded-lg overflow-hidden","aria-labelledby":"remote-model-pricing-title",children:[(0,a.jsxs)("div",{className:"px-4 py-3 border-b",children:[(0,a.jsxs)("h2",{id:"remote-model-pricing-title",className:"text-sm font-medium",children:["Remote model costs — ",s]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Observed spend from completed API calls. Effective rate is the blended cost per 1M tokens; provider input and output rates may differ."})]}),(0,a.jsxs)(x.XI,{children:[(0,a.jsx)(x.A0,{children:(0,a.jsxs)(x.Hj,{className:"bg-muted/50 hover:bg-muted/50",children:[(0,a.jsx)(x.nd,{className:"pl-4",children:"Model"}),(0,a.jsx)(x.nd,{className:"text-right",children:"Requests"}),(0,a.jsx)(x.nd,{className:"text-right",children:"Input tokens"}),(0,a.jsx)(x.nd,{className:"text-right",children:"Output tokens"}),(0,a.jsx)(x.nd,{className:"text-right",children:"Observed cost"}),(0,a.jsx)(x.nd,{className:"text-right pr-4",children:"Effective rate"})]})}),(0,a.jsx)(x.BF,{children:t.map(e=>(0,a.jsxs)(x.Hj,{children:[(0,a.jsx)(x.nA,{className:"pl-4 font-mono text-xs",children:e.modelId}),(0,a.jsx)(x.nA,{className:"text-right tabular-nums",children:e.requests.toLocaleString()}),(0,a.jsx)(x.nA,{className:"text-right tabular-nums",children:e.inputTokens.toLocaleString()}),(0,a.jsx)(x.nA,{className:"text-right tabular-nums",children:e.outputTokens.toLocaleString()}),(0,a.jsx)(x.nA,{className:"text-right tabular-nums",children:m(e.totalCostUsd)}),(0,a.jsx)(x.nA,{className:"text-right tabular-nums pr-4",children:null===e.effectiveCostPerMillionTokens?"—":"".concat(m(e.effectiveCostPerMillionTokens,4)," / 1M")})]},e.modelId))})]})]})}var g=s(20243),p=s(18332),f=s(3998),j=s(65142),y=s(51834),b=s(82214),v=s(35299),k=s(6132),N=s(55867),w=s(46826),A=s(71360),T=s(50803),I=s(61362),P=s(75426),C=s(96324),S=s(68425),D=s(47734),F=s(73697),E=s(86618),_=s(26265),L=s(33420),K=s(37665),M=s(64269);let U={light:"",dark:".dark"},q=r.createContext(null);function O(){let e=r.useContext(q);if(!e)throw Error("useChart must be used within a <ChartContainer />");return e}function z(e){let{id:t,className:s,children:l,config:n,...o}=e,i=r.useId(),c="chart-".concat(t||i.replace(/:/g,""));return(0,a.jsx)(q.Provider,{value:{config:n},children:(0,a.jsxs)("div",{"data-slot":"chart","data-chart":c,className:(0,M.cn)("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",s),...o,children:[(0,a.jsx)(R,{id:c,config:n}),(0,a.jsx)(_.u,{children:l})]})})}let R=e=>{let{id:t,config:s}=e,r=Object.entries(s).filter(e=>{let[,t]=e;return t.theme||t.color});return r.length?(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:Object.entries(U).map(e=>{let[s,a]=e;return"\n".concat(a," [data-chart=").concat(t,"] {\n").concat(r.map(e=>{var t;let[a,r]=e,l=(null==(t=r.theme)?void 0:t[s])||r.color;return l?" --color-".concat(a,": ").concat(l,";"):null}).join("\n"),"\n}\n")}).join("\n")}}):null},H=L.m;function Y(e){let{active:t,payload:s,className:l,indicator:n="dot",hideLabel:o=!1,hideIndicator:i=!1,label:c,labelFormatter:d,labelClassName:u,formatter:m,color:x,nameKey:h,labelKey:g}=e,{config:p}=O(),f=r.useMemo(()=>{var e;if(o||!(null==s?void 0:s.length))return null;let[t]=s,r="".concat(g||(null==t?void 0:t.dataKey)||(null==t?void 0:t.name)||"value"),l=X(p,t,r),n=g||"string"!=typeof c?null==l?void 0:l.label:(null==(e=p[c])?void 0:e.label)||c;return d?(0,a.jsx)("div",{className:(0,M.cn)("font-medium",u),children:d(n,s)}):n?(0,a.jsx)("div",{className:(0,M.cn)("font-medium",u),children:n}):null},[c,d,s,o,u,p,g]);if(!t||!(null==s?void 0:s.length))return null;let j=1===s.length&&"dot"!==n;return(0,a.jsxs)("div",{className:(0,M.cn)("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",l),children:[j?null:f,(0,a.jsx)("div",{className:"grid gap-1.5",children:s.map((e,t)=>{let s="".concat(h||e.name||e.dataKey||"value"),r=X(p,e,s),l=x||e.payload.fill||e.color;return(0,a.jsx)("div",{className:(0,M.cn)("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5","dot"===n&&"items-center"),children:m&&(null==e?void 0:e.value)!==void 0&&e.name?m(e.value,e.name,e,t,e.payload):(0,a.jsxs)(a.Fragment,{children:[(null==r?void 0:r.icon)?(0,a.jsx)(r.icon,{}):!i&&(0,a.jsx)("div",{className:(0,M.cn)("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",{"h-2.5 w-2.5":"dot"===n,"w-1":"line"===n,"w-0 border-[1.5px] border-dashed bg-transparent":"dashed"===n,"my-0.5":j&&"dashed"===n}),style:{"--color-bg":l,"--color-border":l}}),(0,a.jsxs)("div",{className:(0,M.cn)("flex flex-1 justify-between leading-none",j?"items-end":"items-center"),children:[(0,a.jsxs)("div",{className:"grid gap-1.5",children:[j?f:null,(0,a.jsx)("span",{className:"text-muted-foreground",children:(null==r?void 0:r.label)||e.name})]}),e.value&&(0,a.jsx)("span",{className:"text-foreground font-mono font-medium tabular-nums",children:e.value.toLocaleString()})]})]})},e.dataKey)})})]})}let $=K.s;function B(e){let{className:t,hideIcon:s=!1,payload:r,verticalAlign:l="bottom",nameKey:n}=e,{config:o}=O();return(null==r?void 0:r.length)?(0,a.jsx)("div",{className:(0,M.cn)("flex items-center justify-center gap-4","top"===l?"pb-3":"pt-3",t),children:r.map(e=>{let t="".concat(n||e.dataKey||"value"),r=X(o,e,t);return(0,a.jsxs)("div",{className:(0,M.cn)("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),children:[(null==r?void 0:r.icon)&&!s?(0,a.jsx)(r.icon,{}):(0,a.jsx)("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:e.color}}),null==r?void 0:r.label]},e.value)})}):null}function X(e,t,s){if("object"!=typeof t||null===t)return;let a="payload"in t&&"object"==typeof t.payload&&null!==t.payload?t.payload:void 0,r=s;return s in t&&"string"==typeof t[s]?r=t[s]:a&&s in a&&"string"==typeof a[s]&&(r=a[s]),r in e?e[r]:e[s]}let G=e=>e>=1e9?(e/1e9).toFixed(1).replace(/\.0$/,"")+"B":e>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"M":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"K":e.toString(),J=e=>{let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return"".concat(s,"-").concat(a,"-").concat(r)},V={inputTokens:{label:"Input Tokens",color:"#3b82f6"},outputTokens:{label:"Output Tokens",color:"#a855f7"}},Z={inputTokens:{label:"Input Tokens",color:"#60a5fa"},outputTokens:{label:"Output Tokens",color:"#c084fc"}},W=(0,o.h)("APIKeysPage");function Q(){let{isAuthenticated:e,isLoading:t,user:s,getAccessTokenSilently:o}=(0,l.h)(),{resolvedTheme:m}=(0,i.D)(),_="dark"===m?Z:V,[L,K]=(0,r.useState)([]),[M,U]=(0,r.useState)(!1),[q,O]=(0,r.useState)(null),[R,X]=(0,r.useState)(""),[Q,ee]=(0,r.useState)(null),[et,es]=(0,r.useState)(null),[ea,er]=(0,r.useState)(!1),[el,en]=(0,r.useState)(!1),[eo,ei]=(0,r.useState)([]),[ec,ed]=(0,r.useState)(!1),[eu,em]=(0,r.useState)(""),[ex,eh]=(0,r.useState)(null),eg=(0,r.useRef)(!1),[ep,ef]=(0,r.useState)({}),[ej,ey]=(0,r.useState)({}),[eb,ev]=(0,r.useState)(new Date),ek=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let r of e){var s,a;let e=(null==(s=r.modelIdUsed)?void 0:s.trim())||"Unknown model",l=null!=(a=t.get(e))?a:{modelId:e,requests:0,inputTokens:0,outputTokens:0,totalCostUsd:0};l.requests+=1,l.inputTokens+=u(r.inputTokens),l.outputTokens+=u(r.outputTokens),l.totalCostUsd+=u(r.creditsDeducted),t.set(e,l)}return Array.from(t.values()).map(e=>{let t=e.inputTokens+e.outputTokens,s=Math.round(1e6*e.totalCostUsd)/1e6,a=t>0?s/t*1e6:null;return{...e,totalCostUsd:s,totalTokens:t,effectiveCostPerMillionTokens:null===a?null:Math.round(1e6*a)/1e6}}).sort((e,t)=>t.totalCostUsd-e.totalCostUsd||e.modelId.localeCompare(t.modelId))})(eo),[eo]),eN=(0,r.useCallback)(e=>{let t={},s={};e.forEach(e=>{let a=J(e.timestamp),r=Number(e.inputTokens)||0,l=Number(e.outputTokens)||0,n=0;if("string"==typeof e.creditsDeducted?n=parseFloat(e.creditsDeducted):"number"==typeof e.creditsDeducted&&(n=e.creditsDeducted),n=isNaN(n)?0:n,s[a]||(s[a]={requests:0,inputTokens:0,outputTokens:0,creditsDeducted:0}),s[a].requests+=1,s[a].inputTokens+=r,s[a].outputTokens+=l,s[a].creditsDeducted+=n,e.apiKeyPrefix){let s=e.apiKeyPrefix;t[s]||(t[s]={totalRequests:0,totalInputTokens:0,totalOutputTokens:0,totalCreditsDeducted:0,dailyUsage:{}}),t[s].dailyUsage[a]||(t[s].dailyUsage[a]={requests:0,inputTokens:0,outputTokens:0,creditsDeducted:0}),t[s].totalRequests+=1,t[s].totalInputTokens+=r,t[s].totalOutputTokens+=l,t[s].totalCreditsDeducted+=n,t[s].dailyUsage[a].requests+=1,t[s].dailyUsage[a].inputTokens+=r,t[s].dailyUsage[a].outputTokens+=l,t[s].dailyUsage[a].creditsDeducted+=n}}),ef(t),ey(s),W.debug({processedKeyUsage:t,processedOverallDailyUsage:s},"API logs processed")},[]),ew=(0,r.useCallback)(e=>{let t={},s={};e.forEach(e=>{let a=e.date,r=Number(e.input_tokens)||0,l=Number(e.output_tokens)||0,n=Number(e.requests)||0,o=parseFloat(e.credits_deducted||"0")||0;s[a]={requests:n,inputTokens:r,outputTokens:l,creditsDeducted:o},(e.by_key||[]).forEach(e=>{let s=e.api_key_prefix;if(!s)return;t[s]||(t[s]={totalRequests:0,totalInputTokens:0,totalOutputTokens:0,totalCreditsDeducted:0,dailyUsage:{}}),t[s].dailyUsage[a]||(t[s].dailyUsage[a]={requests:0,inputTokens:0,outputTokens:0,creditsDeducted:0});let r=Number(e.input_tokens)||0,l=Number(e.output_tokens)||0,n=Number(e.requests)||0,o=parseFloat(e.credits_deducted||"0")||0;t[s].totalRequests+=n,t[s].totalInputTokens+=r,t[s].totalOutputTokens+=l,t[s].totalCreditsDeducted+=o,t[s].dailyUsage[a].requests+=n,t[s].dailyUsage[a].inputTokens+=r,t[s].dailyUsage[a].outputTokens+=l,t[s].dailyUsage[a].creditsDeducted+=o})}),ef(t),ey(s),W.debug({days:e.length,keyCount:Object.keys(t).length},"Usage summary processed")},[]),eA=(0,r.useCallback)(async()=>{if(!t&&e){U(!0),O(null),W.debug({},"Attempting to fetch API keys using configured client");try{var s;let e=await o();(0,n.ki)(e);let t=await n.gb.keyList();W.debug({count:null==(s=t.results)?void 0:s.length},"API keys fetched successfully"),K(t.results||[])}catch(t){W.error({err:t},"Failed to fetch API keys");let e=t.message||"Failed to load API keys. Please try again later.";if(t.response){let s=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}W.error({status:s,responseBody:a},"Fetch Keys API Error"),e="Fetch Keys API Error (".concat(s,"): ").concat(a||e)}O(e)}finally{U(!1)}}else t||e||(K([]),U(!1),O(null))},[t,e,o]);(0,r.useEffect)(()=>{eA()},[eA]);let eT=(0,r.useCallback)(async(s,a)=>{if(eg.current)return void W.debug({},"Already fetching API logs, skipping duplicate call");if(!t&&e){var r,l,i;eg.current=!0,ed(!0),em("Fetching usage data..."),eh(null);let{startDate:e,endDate:t}={startDate:J(new Date(r=s,l=a,1)),endDate:J(new Date(r,l+1,0))};W.debug({targetYear:s,targetMonth:a,startDate:e,endDate:t},"Fetching API logs for month");try{let s=await o();(0,n.ki)(s);let a=!1;try{em("Loading monthly usage summary...");let r=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC",l=new URLSearchParams({start_date:e,end_date:t,tz:r,by_key:"true"}),o=(n.DR.basePath||"").replace(/\/$/,""),c=await fetch("".concat(o,"/apilogs/summary?").concat(l.toString()),{method:"GET",headers:{Authorization:"Bearer ".concat(s)}});if(!c.ok){let e=await c.text();throw Error("Summary endpoint error (".concat(c.status,"): ").concat(e))}let d=await c.json();ew(d.days||[]),a=!0,ed(!1),em(""),W.debug({timezone:d.timezone,dayCount:(null==(i=d.days)?void 0:i.length)||0},"Usage summary fetched successfully")}catch(e){W.warn({err:e},"Usage summary endpoint unavailable, falling back to paginated logs")}try{let s=[],r=1,l=!0,o=!1;for(;l&&!o&&r<=50;){a||em("Loading page ".concat(r,"..."));let i=await n.KC.apilogsList({page:r}),c=i.results||[];if(0===c.length){l=!1;break}for(let a of c){let r=J(a.timestamp);if(r<e){o=!0;break}r>=e&&r<=t&&s.push(a)}l=!!i.next,r++}W.debug({totalLogs:s.length,pagesScanned:r-1},"API logs fetched for month"),ei(s),a||eN(s)}catch(e){if(!a)throw e;ei([]),W.warn({err:e},"Model-level pricing details unavailable")}}catch(t){W.error({err:t},"Failed to fetch API logs");let e=t.message||"Failed to load API logs. Please try again later.";if(t.response){let s=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}W.error({status:s,responseBody:a},"Fetch API Logs Error"),e="Fetch API Logs Error (".concat(s,"): ").concat(a||e)}eh(e)}finally{ed(!1),em(""),eg.current=!1}}},[t,e,o,eN,ew]);(0,r.useEffect)(()=>{eT(eb.getFullYear(),eb.getMonth())},[eT,eb]);let eI=async()=>{if(!R.trim())return void alert("Please provide a name for the API key.");er(!0),O(null),es(null),W.debug({},"Attempting to create API key using configured client");try{let e=await o();(0,n.ki)(e);let t=await n.gb.keyCreateRaw({userAPIKeyRequest:{name:R}}),s=await t.raw.json();W.debug({hasKey:!!s.key},"Key creation raw JSON response received");let a=s.key;a?(es(a),en(!0)):(W.warn({responseJson:s},"API did not return the new key in the response body"),O("Key metadata created, but the secret key value was not returned by the API. You might not be able to see the secret.")),X(""),await eA()}catch(t){W.error({err:t},"Failed to create API key");let e=t.message||"Failed to create API key. Please try again.";if(t.response){let s=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}W.error({status:s,responseBody:a},"Create Key API Error"),e="Create Key API Error (".concat(s,"): ").concat(a||e)}O(e)}finally{er(!1)}},eP=async(e,t)=>{let s=String(e);if(confirm('Are you sure you want to delete API Key "'.concat(t,'..."? This action cannot be undone.'))){ee(s),O(null),es(null),W.debug({keyId:s,keyPrefix:t},"Attempting to delete API key using configured client");try{let e=await o();(0,n.ki)(e),await n.gb.keyDestroy({prefix:t}),W.info({keyPrefix:t},"API key deleted successfully"),K(e=>e.filter(e=>String(e.prefix)!==t))}catch(s){W.error({err:s,keyPrefix:t},"Failed to delete API key");let e=s.message||"Failed to delete API key ".concat(t,"... Please try again.");if(s.response){let a=s.response.status,r="Could not read error body";try{r=await s.response.text()}catch(e){}W.error({status:a,responseBody:r,keyPrefix:t},"Delete Key API Error"),e="Delete Key API Error (".concat(a,"): ").concat(r||e)}O(e)}finally{ee(null)}}},eC=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Key";navigator.clipboard.writeText(e).then(()=>{alert("".concat(t," copied to clipboard!"))}).catch(e=>{W.error({err:e},"Failed to copy text to clipboard"),alert("Failed to copy ".concat(t,"."))})};return(0,a.jsxs)(c.M,{title:"API Keys",description:"Manage API keys and monitor usage.",children:[(()=>{let e=eb.getMonth(),t=eb.getFullYear(),s=((e,t)=>{let s=[],a=new Date(e,t,1);for(;a.getMonth()===t;)s.push(J(a)),a.setDate(a.getDate()+1);return s})(t,e),r=J(new Date),l=e===new Date().getMonth()&&t===new Date().getFullYear()?s.filter(e=>e<=r):s,n=l.map(e=>{var t,s;let a=ej[e];return{date:e,inputTokens:null!=(t=null==a?void 0:a.inputTokens)?t:0,outputTokens:null!=(s=null==a?void 0:a.outputTokens)?s:0}}),o=n.some(e=>e.inputTokens>0||e.outputTokens>0),i=n.reduce((e,t)=>e+t.inputTokens,0),c=n.reduce((e,t)=>e+t.outputTokens,0),d=l.reduce((e,t)=>{var s,a;return e+(null!=(a=null==(s=ej[t])?void 0:s.requests)?a:0)},0);return(0,a.jsxs)("div",{className:"border mx-6 mb-6 rounded-lg overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 px-4 py-3 border-b",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(b.A,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("h2",{className:"text-sm font-medium",children:["API Usage — ",eb.toLocaleString("default",{month:"long"})," ",eb.getFullYear()]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Daily token consumption for the selected month."})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,a.jsx)(f.$,{variant:"outline",size:"sm",onClick:()=>ev(e=>new Date(e.getFullYear(),e.getMonth()-1,1)),children:"Previous"}),(0,a.jsx)(f.$,{variant:"outline",size:"sm",onClick:()=>ev(e=>new Date(e.getFullYear(),e.getMonth()+1,1)),disabled:eb.getMonth()===new Date().getMonth()&&eb.getFullYear()===new Date().getFullYear(),children:"Next"})]})]}),!ec&&!ex&&o&&(0,a.jsxs)("div",{className:"grid grid-cols-3 divide-x border-b bg-muted/20",children:[(0,a.jsxs)("div",{className:"px-4 py-2.5",children:[(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Total Tokens"}),(0,a.jsx)("p",{className:"text-lg font-semibold tabular-nums",children:G(i+c)})]}),(0,a.jsxs)("div",{className:"px-4 py-2.5",children:[(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Input / Output"}),(0,a.jsxs)("p",{className:"text-sm font-medium tabular-nums mt-0.5",children:[(0,a.jsx)("span",{style:{color:"hsl(var(--chart-2))"},children:G(i)}),(0,a.jsx)("span",{className:"text-muted-foreground/50 mx-1",children:"/"}),(0,a.jsx)("span",{style:{color:"hsl(var(--chart-3))"},children:G(c)})]})]}),(0,a.jsxs)("div",{className:"px-4 py-2.5",children:[(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"API Requests"}),(0,a.jsx)("p",{className:"text-lg font-semibold tabular-nums",children:d.toLocaleString()})]})]}),(0,a.jsxs)("div",{className:"p-4",children:[ec&&(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[(0,a.jsx)(v.A,{className:"mr-2 h-5 w-5 animate-spin"}),(0,a.jsx)("span",{className:"text-sm",children:eu||"Loading usage data..."})]}),!ec&&ex&&(0,a.jsxs)(p.Fc,{variant:"destructive",children:[(0,a.jsx)(k.A,{className:"h-4 w-4"}),(0,a.jsx)(p.XL,{children:"Error Loading Logs"}),(0,a.jsx)(p.TN,{children:ex})]}),!ec&&!ex&&!o&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,a.jsx)(b.A,{className:"h-8 w-8 mb-3 opacity-25"}),(0,a.jsx)("p",{className:"text-sm",children:"No usage data for this month"})]}),!ec&&!ex&&o&&(0,a.jsx)(z,{config:_,className:"min-h-[220px] w-full",children:(0,a.jsxs)(C.E,{accessibilityLayer:!0,data:n,margin:{top:4,right:8,left:0,bottom:0},children:[(0,a.jsx)(S.d,{vertical:!1,strokeDasharray:"3 3"}),(0,a.jsx)(D.W,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,tick:{fontSize:11},tickFormatter:e=>{var t;return String(parseInt(null!=(t=e.split("-")[2])?t:"0",10))}}),(0,a.jsx)(F.h,{tickLine:!1,axisLine:!1,width:44,tick:{fontSize:11},tickFormatter:G}),(0,a.jsx)(H,{cursor:{fill:"hsl(var(--muted))",opacity:.5},content:(0,a.jsx)(Y,{indicator:"dashed",labelFormatter:e=>{let[t,s,a]=String(null!=e?e:"").split("-").map(Number);return new Date(t,(null!=s?s:1)-1,a).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})},formatter:(e,t)=>[("number"==typeof e?e:0).toLocaleString(),"inputTokens"===t?"Input":"Output"]})}),(0,a.jsx)($,{content:(0,a.jsx)(B,{})}),(0,a.jsx)(E.yP,{dataKey:"inputTokens",stackId:"tokens",fill:_.inputTokens.color,radius:[0,0,3,3],maxBarSize:32}),(0,a.jsx)(E.yP,{dataKey:"outputTokens",stackId:"tokens",fill:_.outputTokens.color,radius:[3,3,0,0],maxBarSize:32})]})})]})]})})(),(0,a.jsx)(h,{summaries:ek,monthLabel:eb.toLocaleString("default",{month:"long",year:"numeric"})}),(0,a.jsxs)("div",{className:"border mx-6",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4 px-4 py-3 border-b",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"API Keys"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Manage your API keys for accessing HackAgent. Keys are used to authenticate your requests."})]}),e&&(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,a.jsx)(j.p,{type:"text",placeholder:"Key name (e.g., My Test Key)",value:R,onChange:e=>X(e.target.value),disabled:ea,className:"w-56"}),(0,a.jsxs)(f.$,{onClick:eI,disabled:ea||!R.trim(),children:[ea?(0,a.jsx)(v.A,{className:"mr-2 h-4 w-4 animate-spin"}):(0,a.jsx)(N.A,{className:"mr-2 h-4 w-4"}),"Create Key"]})]})]}),(0,a.jsxs)("div",{className:"p-4",children:[q&&!el&&(0,a.jsxs)(p.Fc,{variant:"destructive",className:"mb-4",children:[(0,a.jsx)(k.A,{className:"h-4 w-4"}),(0,a.jsx)(p.XL,{children:"Error"}),(0,a.jsx)(p.TN,{children:q})]}),e&&(M&&0===L.length&&!ec?(0,a.jsx)("div",{className:"border rounded-md mt-4",children:(0,a.jsxs)(x.XI,{children:[(0,a.jsx)(x.A0,{children:(0,a.jsxs)(x.Hj,{children:[(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{className:"text-right",children:(0,a.jsx)(g.E,{className:"h-5 w-24"})})]})}),(0,a.jsx)(x.BF,{children:[void 0,void 0].map((e,t)=>(0,a.jsxs)(x.Hj,{children:[(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{className:"text-right",children:(0,a.jsx)(g.E,{className:"h-5 w-20"})})]},t))})]})}):0!==L.length||M?(0,a.jsx)("div",{className:"border overflow-hidden",children:(0,a.jsxs)(x.XI,{children:[(0,a.jsx)(x.r6,{children:"Manage your API keys for accessing HackAgent."}),(0,a.jsx)(x.A0,{children:(0,a.jsxs)(x.Hj,{children:[(0,a.jsx)(x.nd,{children:"Name/Label"}),(0,a.jsx)(x.nd,{children:"Prefix"}),(0,a.jsx)(x.nd,{children:"Created"}),(0,a.jsx)(x.nd,{children:"Total Requests"}),(0,a.jsx)(x.nd,{children:"Total Tokens"}),(0,a.jsx)(x.nd,{children:"Total Credits"}),(0,a.jsx)(x.nd,{className:"text-right",children:"Actions"})]})}),(0,a.jsx)(x.BF,{children:L.map(e=>{let t=e.prefix?ep[e.prefix]:null,s=t?t.totalInputTokens+t.totalOutputTokens:0;return(0,a.jsxs)(x.Hj,{children:[(0,a.jsx)(x.nA,{className:"font-medium",children:e.name||"N/A"}),(0,a.jsx)(x.nA,{className:"font-mono",children:e.prefix}),(0,a.jsx)(x.nA,{children:(e=>{if(!e)return"N/A";try{return("string"==typeof e?new Date(e):e).toLocaleDateString()}catch(e){return"Invalid Date"}})(e.created)}),(0,a.jsx)(x.nA,{children:t?t.totalRequests.toLocaleString():ec?"...":"0"}),(0,a.jsx)(x.nA,{title:t?s.toLocaleString():"0",children:t?G(s):ec?"...":"0"}),(0,a.jsxs)(x.nA,{children:["$",t?t.totalCreditsDeducted.toFixed(2):ec?"...":"0.00"]}),(0,a.jsx)(x.nA,{className:"text-right space-x-2",children:(0,a.jsxs)(f.$,{variant:"destructive",size:"icon",onClick:()=>{var t;return eP(e.id,null!=(t=e.prefix)?t:"N/A")},title:"Delete key",disabled:M||Q===String(e.id),children:[Q===String(e.id)?(0,a.jsx)(v.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(A.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Delete API Key"})]})})]},e.id)})})]})}):(0,a.jsx)(d.p,{icon:N.A,title:"No API keys found",description:"Generate your first API key to start integrating with the HackAgent platform.",action:(0,a.jsxs)(f.$,{onClick:eI,disabled:ea,children:[ea?(0,a.jsx)(v.A,{className:"mr-2 h-4 w-4 animate-spin"}):(0,a.jsx)(w.A,{className:"mr-2 h-4 w-4"}),"Generate API Key"]})})),!e&&!t&&(0,a.jsxs)(p.Fc,{children:[(0,a.jsx)(T.A,{className:"h-4 w-4"}),(0,a.jsx)(p.XL,{children:"Authentication Required"}),(0,a.jsx)(p.TN,{children:"Please log in to manage API keys."})]})]})]}),(0,a.jsx)(y.lG,{open:el,onOpenChange:e=>{en(e),e||es(null)},children:(0,a.jsxs)(y.Cf,{className:"sm:max-w-md",children:[(0,a.jsxs)(y.c7,{children:[(0,a.jsxs)(y.L3,{className:"flex items-center",children:[(0,a.jsx)(I.A,{className:"h-6 w-6 text-green-500 mr-2"}),"API Key Generated Successfully!"]}),(0,a.jsx)(y.rr,{className:"mt-2 text-sm text-muted-foreground",children:"Please copy your new API key. You will not be able to see it again."})]}),et&&(0,a.jsxs)("div",{className:"my-4",children:[(0,a.jsx)("p",{className:"text-sm font-semibold mb-1",children:"Your new API key:"}),(0,a.jsx)("div",{className:"p-2 bg-muted rounded-md font-mono text-sm break-all overflow-x-auto",children:et})]}),(0,a.jsxs)(y.Es,{className:"sm:justify-start mt-4",children:[et&&(0,a.jsxs)(f.$,{type:"button",variant:"secondary",onClick:()=>eC(et,"API Key"),className:"w-full sm:w-auto",children:[(0,a.jsx)(P.A,{className:"mr-2 h-4 w-4"})," Copy Key"]}),(0,a.jsx)(y.HM,{asChild:!0,children:(0,a.jsx)(f.$,{type:"button",variant:"outline",className:"w-full sm:w-auto mt-2 sm:mt-0",children:"Close"})})]})]})})]})}},34105:(e,t,s)=>{"use strict";s.d(t,{c:()=>a});let a=(0,s(12115).createContext)(void 0)},51834:(e,t,s)=>{"use strict";s.d(t,{Cf:()=>u,Es:()=>x,HM:()=>c,L3:()=>h,c7:()=>m,lG:()=>o,rr:()=>g});var a=s(95155);s(12115);var r=s(88292),l=s(65229),n=s(64269);function o(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"dialog",...t})}function i(e){let{...t}=e;return(0,a.jsx)(r.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{...t}=e;return(0,a.jsx)(r.bm,{"data-slot":"dialog-close",...t})}function d(e){let{className:t,...s}=e;return(0,a.jsx)(r.hJ,{"data-slot":"dialog-overlay",className:(0,n.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function u(e){let{className:t,children:s,...o}=e;return(0,a.jsxs)(i,{"data-slot":"dialog-portal",children:[(0,a.jsx)(d,{}),(0,a.jsxs)(r.UC,{"data-slot":"dialog-content",className:(0,n.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...o,children:[s,(0,a.jsxs)(r.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,a.jsx)(l.A,{}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function m(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"dialog-header",className:(0,n.cn)("flex flex-col gap-2 text-center sm:text-left",t),...s})}function x(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"dialog-footer",className:(0,n.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s})}function h(e){let{className:t,...s}=e;return(0,a.jsx)(r.hE,{"data-slot":"dialog-title",className:(0,n.cn)("text-lg leading-none font-semibold",t),...s})}function g(e){let{className:t,...s}=e;return(0,a.jsx)(r.VY,{"data-slot":"dialog-description",className:(0,n.cn)("text-muted-foreground text-sm",t),...s})}},56419:(e,t,s)=>{"use strict";s.d(t,{p:()=>r});var a=s(95155);s(12115);let r=e=>{let{icon:t,title:s,description:r,action:l}=e;return(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center text-center py-12 px-4",children:[(0,a.jsx)("div",{className:"rounded-full bg-muted p-3 mb-4",children:(0,a.jsx)(t,{className:"h-10 w-10 text-muted-foreground"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold mb-2",children:s}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground max-w-sm mb-6",children:r}),l&&(0,a.jsx)("div",{children:l})]})}},63479:(e,t,s)=>{"use strict";s.d(t,{D:()=>n,N:()=>c});var a=s(95155),r=s(12115);let l=(0,r.createContext)({theme:"system",resolvedTheme:"light",setTheme:()=>{}});function n(){return(0,r.useContext)(l)}let o="hackagent-theme";function i(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function c(e){let{children:t}=e,[s,n]=(0,r.useState)("light"),[c,d]=(0,r.useState)("light"),u=e=>{let t=document.documentElement;"dark"===e?t.classList.add("dark"):t.classList.remove("dark")};return(0,r.useEffect)(()=>{var e;let t=null!=(e=localStorage.getItem(o))?e:"light";n(t);let s="system"===t?i():t;d(s),u(s)},[]),(0,r.useEffect)(()=>{let e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{if("system"===s){let e=i();d(e),u(e)}};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[s]),(0,a.jsx)(l.Provider,{value:{theme:s,resolvedTheme:c,setTheme:e=>{localStorage.setItem(o,e),n(e);let t="system"===e?i():e;d(t),u(t)}},children:t})}},65142:(e,t,s)=>{"use strict";s.d(t,{p:()=>l});var a=s(95155);s(12115);var r=s(64269);function l(e){let{className:t,type:s,...l}=e;return(0,a.jsx)("input",{type:s,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...l})}},80230:(e,t,s)=>{"use strict";s.d(t,{h:()=>n});var a=s(12115),r=s(34105);let l=async()=>"";function n(){let e=(0,a.useContext)(r.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:l}}},84443:(e,t,s)=>{Promise.resolve().then(s.bind(s,33369))},87270:(e,t,s)=>{"use strict";s.d(t,{A0:()=>n,BF:()=>o,Hj:()=>i,XI:()=>l,nA:()=>d,nd:()=>c,r6:()=>u});var a=s(95155);s(12115);var r=s(64269);function l(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,a.jsx)("table",{"data-slot":"table",className:(0,r.cn)("w-full caption-bottom text-sm",t),...s})})}function n(e){let{className:t,...s}=e;return(0,a.jsx)("thead",{"data-slot":"table-header",className:(0,r.cn)("[&_tr]:border-b",t),...s})}function o(e){let{className:t,...s}=e;return(0,a.jsx)("tbody",{"data-slot":"table-body",className:(0,r.cn)("[&_tr:last-child]:border-0",t),...s})}function i(e){let{className:t,...s}=e;return(0,a.jsx)("tr",{"data-slot":"table-row",className:(0,r.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...s})}function c(e){let{className:t,...s}=e;return(0,a.jsx)("th",{"data-slot":"table-head",className:(0,r.cn)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s})}function d(e){let{className:t,...s}=e;return(0,a.jsx)("td",{"data-slot":"table-cell",className:(0,r.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s})}function u(e){let{className:t,...s}=e;return(0,a.jsx)("caption",{"data-slot":"table-caption",className:(0,r.cn)("text-muted-foreground mt-4 text-sm",t),...s})}}},e=>{e.O(0,[133,574,176,570,924,441,493,358],()=>e(e.s=84443)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[840],{18332:(e,t,s)=>{"use strict";s.d(t,{Fc:()=>o,TN:()=>c,XL:()=>i});var a=s(95155);s(12115);var r=s(83101),l=s(64269);let n=(0,r.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:s,...r}=e;return(0,a.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,l.cn)(n({variant:s}),t),...r})}function i(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-title",className:(0,l.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...s})}function c(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"alert-description",className:(0,l.cn)("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...s})}},20243:(e,t,s)=>{"use strict";s.d(t,{E:()=>l});var a=s(95155),r=s(64269);function l(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"skeleton",className:(0,r.cn)("bg-accent animate-pulse rounded-md",t),...s})}},22470:(e,t,s)=>{"use strict";s.d(t,{M:()=>r});var a=s(95155);s(12115);let r=e=>{let{title:t,description:s,action:r,children:l,maxWidth:n="full",compact:o=!1}=e;return(0,a.jsxs)("div",{className:"w-full ".concat({full:"max-w-full","8xl":"max-w-[90rem]","7xl":"max-w-7xl","6xl":"max-w-6xl","5xl":"max-w-5xl","4xl":"max-w-4xl","3xl":"max-w-3xl","2xl":"max-w-2xl"}[n]||"max-w-full"," mx-auto ").concat(o?"py-3 space-y-3":"py-6 space-y-6"),children:[t&&(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 border-b ".concat(o?"px-4 pb-3":"px-6 pb-5"),children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:t}),s&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:s})]}),r&&(0,a.jsx)("div",{className:"flex-shrink-0 pt-0.5",children:r})]}),l]})}},33369:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>Q});var a=s(95155),r=s(12115),l=s(80230),n=s(7831),o=s(41444),i=s(63479),c=s(22470),d=s(56419);function u(e){let t="number"==typeof e?e:Number.parseFloat(String(e));return Number.isFinite(t)&&t>=0?t:0}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}var x=s(87270);function h(e){let{summaries:t,monthLabel:s}=e;return 0===t.length?null:(0,a.jsxs)("section",{className:"border mx-6 mb-6 rounded-lg overflow-hidden","aria-labelledby":"remote-model-pricing-title",children:[(0,a.jsxs)("div",{className:"px-4 py-3 border-b",children:[(0,a.jsxs)("h2",{id:"remote-model-pricing-title",className:"text-sm font-medium",children:["Remote model costs — ",s]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Observed spend from completed API calls. Effective rate is the blended cost per 1M tokens; provider input and output rates may differ."})]}),(0,a.jsxs)(x.XI,{children:[(0,a.jsx)(x.A0,{children:(0,a.jsxs)(x.Hj,{className:"bg-muted/50 hover:bg-muted/50",children:[(0,a.jsx)(x.nd,{className:"pl-4",children:"Model"}),(0,a.jsx)(x.nd,{className:"text-right",children:"Requests"}),(0,a.jsx)(x.nd,{className:"text-right",children:"Input tokens"}),(0,a.jsx)(x.nd,{className:"text-right",children:"Output tokens"}),(0,a.jsx)(x.nd,{className:"text-right",children:"Observed cost"}),(0,a.jsx)(x.nd,{className:"text-right pr-4",children:"Effective rate"})]})}),(0,a.jsx)(x.BF,{children:t.map(e=>(0,a.jsxs)(x.Hj,{children:[(0,a.jsx)(x.nA,{className:"pl-4 font-mono text-xs",children:e.modelId}),(0,a.jsx)(x.nA,{className:"text-right tabular-nums",children:e.requests.toLocaleString()}),(0,a.jsx)(x.nA,{className:"text-right tabular-nums",children:e.inputTokens.toLocaleString()}),(0,a.jsx)(x.nA,{className:"text-right tabular-nums",children:e.outputTokens.toLocaleString()}),(0,a.jsx)(x.nA,{className:"text-right tabular-nums",children:m(e.totalCostUsd)}),(0,a.jsx)(x.nA,{className:"text-right tabular-nums pr-4",children:null===e.effectiveCostPerMillionTokens?"—":"".concat(m(e.effectiveCostPerMillionTokens,4)," / 1M")})]},e.modelId))})]})]})}var g=s(20243),p=s(18332),f=s(3998),j=s(65142),y=s(51834),b=s(82214),v=s(35299),k=s(6132),N=s(55867),w=s(46826),A=s(71360),T=s(50803),I=s(61362),P=s(75426),C=s(96324),S=s(68425),D=s(47734),F=s(73697),E=s(86618),_=s(26265),L=s(33420),K=s(37665),M=s(64269);let U={light:"",dark:".dark"},q=r.createContext(null);function O(){let e=r.useContext(q);if(!e)throw Error("useChart must be used within a <ChartContainer />");return e}function z(e){let{id:t,className:s,children:l,config:n,...o}=e,i=r.useId(),c="chart-".concat(t||i.replace(/:/g,""));return(0,a.jsx)(q.Provider,{value:{config:n},children:(0,a.jsxs)("div",{"data-slot":"chart","data-chart":c,className:(0,M.cn)("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",s),...o,children:[(0,a.jsx)(R,{id:c,config:n}),(0,a.jsx)(_.u,{children:l})]})})}let R=e=>{let{id:t,config:s}=e,r=Object.entries(s).filter(e=>{let[,t]=e;return t.theme||t.color});return r.length?(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:Object.entries(U).map(e=>{let[s,a]=e;return"\n".concat(a," [data-chart=").concat(t,"] {\n").concat(r.map(e=>{var t;let[a,r]=e,l=(null==(t=r.theme)?void 0:t[s])||r.color;return l?" --color-".concat(a,": ").concat(l,";"):null}).join("\n"),"\n}\n")}).join("\n")}}):null},H=L.m;function Y(e){let{active:t,payload:s,className:l,indicator:n="dot",hideLabel:o=!1,hideIndicator:i=!1,label:c,labelFormatter:d,labelClassName:u,formatter:m,color:x,nameKey:h,labelKey:g}=e,{config:p}=O(),f=r.useMemo(()=>{var e;if(o||!(null==s?void 0:s.length))return null;let[t]=s,r="".concat(g||(null==t?void 0:t.dataKey)||(null==t?void 0:t.name)||"value"),l=X(p,t,r),n=g||"string"!=typeof c?null==l?void 0:l.label:(null==(e=p[c])?void 0:e.label)||c;return d?(0,a.jsx)("div",{className:(0,M.cn)("font-medium",u),children:d(n,s)}):n?(0,a.jsx)("div",{className:(0,M.cn)("font-medium",u),children:n}):null},[c,d,s,o,u,p,g]);if(!t||!(null==s?void 0:s.length))return null;let j=1===s.length&&"dot"!==n;return(0,a.jsxs)("div",{className:(0,M.cn)("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",l),children:[j?null:f,(0,a.jsx)("div",{className:"grid gap-1.5",children:s.map((e,t)=>{let s="".concat(h||e.name||e.dataKey||"value"),r=X(p,e,s),l=x||e.payload.fill||e.color;return(0,a.jsx)("div",{className:(0,M.cn)("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5","dot"===n&&"items-center"),children:m&&(null==e?void 0:e.value)!==void 0&&e.name?m(e.value,e.name,e,t,e.payload):(0,a.jsxs)(a.Fragment,{children:[(null==r?void 0:r.icon)?(0,a.jsx)(r.icon,{}):!i&&(0,a.jsx)("div",{className:(0,M.cn)("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",{"h-2.5 w-2.5":"dot"===n,"w-1":"line"===n,"w-0 border-[1.5px] border-dashed bg-transparent":"dashed"===n,"my-0.5":j&&"dashed"===n}),style:{"--color-bg":l,"--color-border":l}}),(0,a.jsxs)("div",{className:(0,M.cn)("flex flex-1 justify-between leading-none",j?"items-end":"items-center"),children:[(0,a.jsxs)("div",{className:"grid gap-1.5",children:[j?f:null,(0,a.jsx)("span",{className:"text-muted-foreground",children:(null==r?void 0:r.label)||e.name})]}),e.value&&(0,a.jsx)("span",{className:"text-foreground font-mono font-medium tabular-nums",children:e.value.toLocaleString()})]})]})},e.dataKey)})})]})}let $=K.s;function B(e){let{className:t,hideIcon:s=!1,payload:r,verticalAlign:l="bottom",nameKey:n}=e,{config:o}=O();return(null==r?void 0:r.length)?(0,a.jsx)("div",{className:(0,M.cn)("flex items-center justify-center gap-4","top"===l?"pb-3":"pt-3",t),children:r.map(e=>{let t="".concat(n||e.dataKey||"value"),r=X(o,e,t);return(0,a.jsxs)("div",{className:(0,M.cn)("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),children:[(null==r?void 0:r.icon)&&!s?(0,a.jsx)(r.icon,{}):(0,a.jsx)("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:e.color}}),null==r?void 0:r.label]},e.value)})}):null}function X(e,t,s){if("object"!=typeof t||null===t)return;let a="payload"in t&&"object"==typeof t.payload&&null!==t.payload?t.payload:void 0,r=s;return s in t&&"string"==typeof t[s]?r=t[s]:a&&s in a&&"string"==typeof a[s]&&(r=a[s]),r in e?e[r]:e[s]}let G=e=>e>=1e9?(e/1e9).toFixed(1).replace(/\.0$/,"")+"B":e>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"M":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"K":e.toString(),J=e=>{let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return"".concat(s,"-").concat(a,"-").concat(r)},V={inputTokens:{label:"Input Tokens",color:"#3b82f6"},outputTokens:{label:"Output Tokens",color:"#a855f7"}},Z={inputTokens:{label:"Input Tokens",color:"#60a5fa"},outputTokens:{label:"Output Tokens",color:"#c084fc"}},W=(0,o.h)("APIKeysPage");function Q(){let{isAuthenticated:e,isLoading:t,user:s,getAccessTokenSilently:o}=(0,l.h)(),{resolvedTheme:m}=(0,i.D)(),_="dark"===m?Z:V,[L,K]=(0,r.useState)([]),[M,U]=(0,r.useState)(!1),[q,O]=(0,r.useState)(null),[R,X]=(0,r.useState)(""),[Q,ee]=(0,r.useState)(null),[et,es]=(0,r.useState)(null),[ea,er]=(0,r.useState)(!1),[el,en]=(0,r.useState)(!1),[eo,ei]=(0,r.useState)([]),[ec,ed]=(0,r.useState)(!1),[eu,em]=(0,r.useState)(""),[ex,eh]=(0,r.useState)(null),eg=(0,r.useRef)(!1),[ep,ef]=(0,r.useState)({}),[ej,ey]=(0,r.useState)({}),[eb,ev]=(0,r.useState)(new Date),ek=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let r of e){var s,a;let e=(null==(s=r.modelIdUsed)?void 0:s.trim())||"Unknown model",l=null!=(a=t.get(e))?a:{modelId:e,requests:0,inputTokens:0,outputTokens:0,totalCostUsd:0};l.requests+=1,l.inputTokens+=u(r.inputTokens),l.outputTokens+=u(r.outputTokens),l.totalCostUsd+=u(r.creditsDeducted),t.set(e,l)}return Array.from(t.values()).map(e=>{let t=e.inputTokens+e.outputTokens,s=Math.round(1e6*e.totalCostUsd)/1e6,a=t>0?s/t*1e6:null;return{...e,totalCostUsd:s,totalTokens:t,effectiveCostPerMillionTokens:null===a?null:Math.round(1e6*a)/1e6}}).sort((e,t)=>t.totalCostUsd-e.totalCostUsd||e.modelId.localeCompare(t.modelId))})(eo),[eo]),eN=(0,r.useCallback)(e=>{let t={},s={};e.forEach(e=>{let a=J(e.timestamp),r=Number(e.inputTokens)||0,l=Number(e.outputTokens)||0,n=0;if("string"==typeof e.creditsDeducted?n=parseFloat(e.creditsDeducted):"number"==typeof e.creditsDeducted&&(n=e.creditsDeducted),n=isNaN(n)?0:n,s[a]||(s[a]={requests:0,inputTokens:0,outputTokens:0,creditsDeducted:0}),s[a].requests+=1,s[a].inputTokens+=r,s[a].outputTokens+=l,s[a].creditsDeducted+=n,e.apiKeyPrefix){let s=e.apiKeyPrefix;t[s]||(t[s]={totalRequests:0,totalInputTokens:0,totalOutputTokens:0,totalCreditsDeducted:0,dailyUsage:{}}),t[s].dailyUsage[a]||(t[s].dailyUsage[a]={requests:0,inputTokens:0,outputTokens:0,creditsDeducted:0}),t[s].totalRequests+=1,t[s].totalInputTokens+=r,t[s].totalOutputTokens+=l,t[s].totalCreditsDeducted+=n,t[s].dailyUsage[a].requests+=1,t[s].dailyUsage[a].inputTokens+=r,t[s].dailyUsage[a].outputTokens+=l,t[s].dailyUsage[a].creditsDeducted+=n}}),ef(t),ey(s),W.debug({processedKeyUsage:t,processedOverallDailyUsage:s},"API logs processed")},[]),ew=(0,r.useCallback)(e=>{let t={},s={};e.forEach(e=>{let a=e.date,r=Number(e.input_tokens)||0,l=Number(e.output_tokens)||0,n=Number(e.requests)||0,o=parseFloat(e.credits_deducted||"0")||0;s[a]={requests:n,inputTokens:r,outputTokens:l,creditsDeducted:o},(e.by_key||[]).forEach(e=>{let s=e.api_key_prefix;if(!s)return;t[s]||(t[s]={totalRequests:0,totalInputTokens:0,totalOutputTokens:0,totalCreditsDeducted:0,dailyUsage:{}}),t[s].dailyUsage[a]||(t[s].dailyUsage[a]={requests:0,inputTokens:0,outputTokens:0,creditsDeducted:0});let r=Number(e.input_tokens)||0,l=Number(e.output_tokens)||0,n=Number(e.requests)||0,o=parseFloat(e.credits_deducted||"0")||0;t[s].totalRequests+=n,t[s].totalInputTokens+=r,t[s].totalOutputTokens+=l,t[s].totalCreditsDeducted+=o,t[s].dailyUsage[a].requests+=n,t[s].dailyUsage[a].inputTokens+=r,t[s].dailyUsage[a].outputTokens+=l,t[s].dailyUsage[a].creditsDeducted+=o})}),ef(t),ey(s),W.debug({days:e.length,keyCount:Object.keys(t).length},"Usage summary processed")},[]),eA=(0,r.useCallback)(async()=>{if(!t&&e){U(!0),O(null),W.debug({},"Attempting to fetch API keys using configured client");try{var s;let e=await o();(0,n.ki)(e);let t=await n.gb.keyList();W.debug({count:null==(s=t.results)?void 0:s.length},"API keys fetched successfully"),K(t.results||[])}catch(t){W.error({err:t},"Failed to fetch API keys");let e=t.message||"Failed to load API keys. Please try again later.";if(t.response){let s=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}W.error({status:s,responseBody:a},"Fetch Keys API Error"),e="Fetch Keys API Error (".concat(s,"): ").concat(a||e)}O(e)}finally{U(!1)}}else t||e||(K([]),U(!1),O(null))},[t,e,o]);(0,r.useEffect)(()=>{eA()},[eA]);let eT=(0,r.useCallback)(async(s,a)=>{if(eg.current)return void W.debug({},"Already fetching API logs, skipping duplicate call");if(!t&&e){var r,l,i;eg.current=!0,ed(!0),em("Fetching usage data..."),eh(null);let{startDate:e,endDate:t}={startDate:J(new Date(r=s,l=a,1)),endDate:J(new Date(r,l+1,0))};W.debug({targetYear:s,targetMonth:a,startDate:e,endDate:t},"Fetching API logs for month");try{let s=await o();(0,n.ki)(s);let a=!1;try{em("Loading monthly usage summary...");let r=Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC",l=new URLSearchParams({start_date:e,end_date:t,tz:r,by_key:"true"}),o=(n.DR.basePath||"").replace(/\/$/,""),c=await fetch("".concat(o,"/apilogs/summary?").concat(l.toString()),{method:"GET",headers:{Authorization:"Bearer ".concat(s)}});if(!c.ok){let e=await c.text();throw Error("Summary endpoint error (".concat(c.status,"): ").concat(e))}let d=await c.json();ew(d.days||[]),a=!0,ed(!1),em(""),W.debug({timezone:d.timezone,dayCount:(null==(i=d.days)?void 0:i.length)||0},"Usage summary fetched successfully")}catch(e){W.warn({err:e},"Usage summary endpoint unavailable, falling back to paginated logs")}try{let s=[],r=1,l=!0,o=!1;for(;l&&!o&&r<=50;){a||em("Loading page ".concat(r,"..."));let i=await n.KC.apilogsList({page:r}),c=i.results||[];if(0===c.length){l=!1;break}for(let a of c){let r=J(a.timestamp);if(r<e){o=!0;break}r>=e&&r<=t&&s.push(a)}l=!!i.next,r++}W.debug({totalLogs:s.length,pagesScanned:r-1},"API logs fetched for month"),ei(s),a||eN(s)}catch(e){if(!a)throw e;ei([]),W.warn({err:e},"Model-level pricing details unavailable")}}catch(t){W.error({err:t},"Failed to fetch API logs");let e=t.message||"Failed to load API logs. Please try again later.";if(t.response){let s=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}W.error({status:s,responseBody:a},"Fetch API Logs Error"),e="Fetch API Logs Error (".concat(s,"): ").concat(a||e)}eh(e)}finally{ed(!1),em(""),eg.current=!1}}},[t,e,o,eN,ew]);(0,r.useEffect)(()=>{eT(eb.getFullYear(),eb.getMonth())},[eT,eb]);let eI=async()=>{if(!R.trim())return void alert("Please provide a name for the API key.");er(!0),O(null),es(null),W.debug({},"Attempting to create API key using configured client");try{let e=await o();(0,n.ki)(e);let t=await n.gb.keyCreateRaw({userAPIKeyRequest:{name:R}}),s=await t.raw.json();W.debug({hasKey:!!s.key},"Key creation raw JSON response received");let a=s.key;a?(es(a),en(!0)):(W.warn({responseJson:s},"API did not return the new key in the response body"),O("Key metadata created, but the secret key value was not returned by the API. You might not be able to see the secret.")),X(""),await eA()}catch(t){W.error({err:t},"Failed to create API key");let e=t.message||"Failed to create API key. Please try again.";if(t.response){let s=t.response.status,a="Could not read error body";try{a=await t.response.text()}catch(e){}W.error({status:s,responseBody:a},"Create Key API Error"),e="Create Key API Error (".concat(s,"): ").concat(a||e)}O(e)}finally{er(!1)}},eP=async(e,t)=>{let s=String(e);if(confirm('Are you sure you want to delete API Key "'.concat(t,'..."? This action cannot be undone.'))){ee(s),O(null),es(null),W.debug({keyId:s,keyPrefix:t},"Attempting to delete API key using configured client");try{let e=await o();(0,n.ki)(e),await n.gb.keyDestroy({prefix:t}),W.info({keyPrefix:t},"API key deleted successfully"),K(e=>e.filter(e=>String(e.prefix)!==t))}catch(s){W.error({err:s,keyPrefix:t},"Failed to delete API key");let e=s.message||"Failed to delete API key ".concat(t,"... Please try again.");if(s.response){let a=s.response.status,r="Could not read error body";try{r=await s.response.text()}catch(e){}W.error({status:a,responseBody:r,keyPrefix:t},"Delete Key API Error"),e="Delete Key API Error (".concat(a,"): ").concat(r||e)}O(e)}finally{ee(null)}}},eC=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Key";navigator.clipboard.writeText(e).then(()=>{alert("".concat(t," copied to clipboard!"))}).catch(e=>{W.error({err:e},"Failed to copy text to clipboard"),alert("Failed to copy ".concat(t,"."))})};return(0,a.jsxs)(c.M,{title:"API Keys",description:"Manage API keys and monitor usage.",children:[(()=>{let e=eb.getMonth(),t=eb.getFullYear(),s=((e,t)=>{let s=[],a=new Date(e,t,1);for(;a.getMonth()===t;)s.push(J(a)),a.setDate(a.getDate()+1);return s})(t,e),r=J(new Date),l=e===new Date().getMonth()&&t===new Date().getFullYear()?s.filter(e=>e<=r):s,n=l.map(e=>{var t,s;let a=ej[e];return{date:e,inputTokens:null!=(t=null==a?void 0:a.inputTokens)?t:0,outputTokens:null!=(s=null==a?void 0:a.outputTokens)?s:0}}),o=n.some(e=>e.inputTokens>0||e.outputTokens>0),i=n.reduce((e,t)=>e+t.inputTokens,0),c=n.reduce((e,t)=>e+t.outputTokens,0),d=l.reduce((e,t)=>{var s,a;return e+(null!=(a=null==(s=ej[t])?void 0:s.requests)?a:0)},0);return(0,a.jsxs)("div",{className:"border mx-6 mb-6 rounded-lg overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 px-4 py-3 border-b",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(b.A,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("h2",{className:"text-sm font-medium",children:["API Usage — ",eb.toLocaleString("default",{month:"long"})," ",eb.getFullYear()]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Daily token consumption for the selected month."})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,a.jsx)(f.$,{variant:"outline",size:"sm",onClick:()=>ev(e=>new Date(e.getFullYear(),e.getMonth()-1,1)),children:"Previous"}),(0,a.jsx)(f.$,{variant:"outline",size:"sm",onClick:()=>ev(e=>new Date(e.getFullYear(),e.getMonth()+1,1)),disabled:eb.getMonth()===new Date().getMonth()&&eb.getFullYear()===new Date().getFullYear(),children:"Next"})]})]}),!ec&&!ex&&o&&(0,a.jsxs)("div",{className:"grid grid-cols-3 divide-x border-b bg-muted/20",children:[(0,a.jsxs)("div",{className:"px-4 py-2.5",children:[(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Total Tokens"}),(0,a.jsx)("p",{className:"text-lg font-semibold tabular-nums",children:G(i+c)})]}),(0,a.jsxs)("div",{className:"px-4 py-2.5",children:[(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Input / Output"}),(0,a.jsxs)("p",{className:"text-sm font-medium tabular-nums mt-0.5",children:[(0,a.jsx)("span",{style:{color:"hsl(var(--chart-2))"},children:G(i)}),(0,a.jsx)("span",{className:"text-muted-foreground/50 mx-1",children:"/"}),(0,a.jsx)("span",{style:{color:"hsl(var(--chart-3))"},children:G(c)})]})]}),(0,a.jsxs)("div",{className:"px-4 py-2.5",children:[(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"API Requests"}),(0,a.jsx)("p",{className:"text-lg font-semibold tabular-nums",children:d.toLocaleString()})]})]}),(0,a.jsxs)("div",{className:"p-4",children:[ec&&(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[(0,a.jsx)(v.A,{className:"mr-2 h-5 w-5 animate-spin"}),(0,a.jsx)("span",{className:"text-sm",children:eu||"Loading usage data..."})]}),!ec&&ex&&(0,a.jsxs)(p.Fc,{variant:"destructive",children:[(0,a.jsx)(k.A,{className:"h-4 w-4"}),(0,a.jsx)(p.XL,{children:"Error Loading Logs"}),(0,a.jsx)(p.TN,{children:ex})]}),!ec&&!ex&&!o&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[(0,a.jsx)(b.A,{className:"h-8 w-8 mb-3 opacity-25"}),(0,a.jsx)("p",{className:"text-sm",children:"No usage data for this month"})]}),!ec&&!ex&&o&&(0,a.jsx)(z,{config:_,className:"min-h-[220px] w-full",children:(0,a.jsxs)(C.E,{accessibilityLayer:!0,data:n,margin:{top:4,right:8,left:0,bottom:0},children:[(0,a.jsx)(S.d,{vertical:!1,strokeDasharray:"3 3"}),(0,a.jsx)(D.W,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,tick:{fontSize:11},tickFormatter:e=>{var t;return String(parseInt(null!=(t=e.split("-")[2])?t:"0",10))}}),(0,a.jsx)(F.h,{tickLine:!1,axisLine:!1,width:44,tick:{fontSize:11},tickFormatter:G}),(0,a.jsx)(H,{cursor:{fill:"hsl(var(--muted))",opacity:.5},content:(0,a.jsx)(Y,{indicator:"dashed",labelFormatter:e=>{let[t,s,a]=String(null!=e?e:"").split("-").map(Number);return new Date(t,(null!=s?s:1)-1,a).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})},formatter:(e,t)=>[("number"==typeof e?e:0).toLocaleString(),"inputTokens"===t?"Input":"Output"]})}),(0,a.jsx)($,{content:(0,a.jsx)(B,{})}),(0,a.jsx)(E.yP,{dataKey:"inputTokens",stackId:"tokens",fill:_.inputTokens.color,radius:[0,0,3,3],maxBarSize:32}),(0,a.jsx)(E.yP,{dataKey:"outputTokens",stackId:"tokens",fill:_.outputTokens.color,radius:[3,3,0,0],maxBarSize:32})]})})]})]})})(),(0,a.jsx)(h,{summaries:ek,monthLabel:eb.toLocaleString("default",{month:"long",year:"numeric"})}),(0,a.jsxs)("div",{className:"border mx-6",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4 px-4 py-3 border-b",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"API Keys"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Manage your API keys for accessing HackAgent. Keys are used to authenticate your requests."})]}),e&&(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,a.jsx)(j.p,{type:"text",placeholder:"Key name (e.g., My Test Key)",value:R,onChange:e=>X(e.target.value),disabled:ea,className:"w-56"}),(0,a.jsxs)(f.$,{onClick:eI,disabled:ea||!R.trim(),children:[ea?(0,a.jsx)(v.A,{className:"mr-2 h-4 w-4 animate-spin"}):(0,a.jsx)(N.A,{className:"mr-2 h-4 w-4"}),"Create Key"]})]})]}),(0,a.jsxs)("div",{className:"p-4",children:[q&&!el&&(0,a.jsxs)(p.Fc,{variant:"destructive",className:"mb-4",children:[(0,a.jsx)(k.A,{className:"h-4 w-4"}),(0,a.jsx)(p.XL,{children:"Error"}),(0,a.jsx)(p.TN,{children:q})]}),e&&(M&&0===L.length&&!ec?(0,a.jsx)("div",{className:"border rounded-md mt-4",children:(0,a.jsxs)(x.XI,{children:[(0,a.jsx)(x.A0,{children:(0,a.jsxs)(x.Hj,{children:[(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{children:(0,a.jsx)(g.E,{className:"h-5 w-1/5"})}),(0,a.jsx)(x.nd,{className:"text-right",children:(0,a.jsx)(g.E,{className:"h-5 w-24"})})]})}),(0,a.jsx)(x.BF,{children:[void 0,void 0].map((e,t)=>(0,a.jsxs)(x.Hj,{children:[(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{children:(0,a.jsx)(g.E,{className:"h-5 w-full"})}),(0,a.jsx)(x.nA,{className:"text-right",children:(0,a.jsx)(g.E,{className:"h-5 w-20"})})]},t))})]})}):0!==L.length||M?(0,a.jsx)("div",{className:"border overflow-hidden",children:(0,a.jsxs)(x.XI,{children:[(0,a.jsx)(x.r6,{children:"Manage your API keys for accessing HackAgent."}),(0,a.jsx)(x.A0,{children:(0,a.jsxs)(x.Hj,{children:[(0,a.jsx)(x.nd,{children:"Name/Label"}),(0,a.jsx)(x.nd,{children:"Prefix"}),(0,a.jsx)(x.nd,{children:"Created"}),(0,a.jsx)(x.nd,{children:"Total Requests"}),(0,a.jsx)(x.nd,{children:"Total Tokens"}),(0,a.jsx)(x.nd,{children:"Total Credits"}),(0,a.jsx)(x.nd,{className:"text-right",children:"Actions"})]})}),(0,a.jsx)(x.BF,{children:L.map(e=>{let t=e.prefix?ep[e.prefix]:null,s=t?t.totalInputTokens+t.totalOutputTokens:0;return(0,a.jsxs)(x.Hj,{children:[(0,a.jsx)(x.nA,{className:"font-medium",children:e.name||"N/A"}),(0,a.jsx)(x.nA,{className:"font-mono",children:e.prefix}),(0,a.jsx)(x.nA,{children:(e=>{if(!e)return"N/A";try{return("string"==typeof e?new Date(e):e).toLocaleDateString()}catch(e){return"Invalid Date"}})(e.created)}),(0,a.jsx)(x.nA,{children:t?t.totalRequests.toLocaleString():ec?"...":"0"}),(0,a.jsx)(x.nA,{title:t?s.toLocaleString():"0",children:t?G(s):ec?"...":"0"}),(0,a.jsxs)(x.nA,{children:["$",t?t.totalCreditsDeducted.toFixed(2):ec?"...":"0.00"]}),(0,a.jsx)(x.nA,{className:"text-right space-x-2",children:(0,a.jsxs)(f.$,{variant:"destructive",size:"icon",onClick:()=>{var t;return eP(e.id,null!=(t=e.prefix)?t:"N/A")},title:"Delete key",disabled:M||Q===String(e.id),children:[Q===String(e.id)?(0,a.jsx)(v.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(A.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Delete API Key"})]})})]},e.id)})})]})}):(0,a.jsx)(d.p,{icon:N.A,title:"No API keys found",description:"Generate your first API key to start integrating with the HackAgent platform.",action:(0,a.jsxs)(f.$,{onClick:eI,disabled:ea,children:[ea?(0,a.jsx)(v.A,{className:"mr-2 h-4 w-4 animate-spin"}):(0,a.jsx)(w.A,{className:"mr-2 h-4 w-4"}),"Generate API Key"]})})),!e&&!t&&(0,a.jsxs)(p.Fc,{children:[(0,a.jsx)(T.A,{className:"h-4 w-4"}),(0,a.jsx)(p.XL,{children:"Authentication Required"}),(0,a.jsx)(p.TN,{children:"Please log in to manage API keys."})]})]})]}),(0,a.jsx)(y.lG,{open:el,onOpenChange:e=>{en(e),e||es(null)},children:(0,a.jsxs)(y.Cf,{className:"sm:max-w-md",children:[(0,a.jsxs)(y.c7,{children:[(0,a.jsxs)(y.L3,{className:"flex items-center",children:[(0,a.jsx)(I.A,{className:"h-6 w-6 text-green-500 mr-2"}),"API Key Generated Successfully!"]}),(0,a.jsx)(y.rr,{className:"mt-2 text-sm text-muted-foreground",children:"Please copy your new API key. You will not be able to see it again."})]}),et&&(0,a.jsxs)("div",{className:"my-4",children:[(0,a.jsx)("p",{className:"text-sm font-semibold mb-1",children:"Your new API key:"}),(0,a.jsx)("div",{className:"p-2 bg-muted rounded-md font-mono text-sm break-all overflow-x-auto",children:et})]}),(0,a.jsxs)(y.Es,{className:"sm:justify-start mt-4",children:[et&&(0,a.jsxs)(f.$,{type:"button",variant:"secondary",onClick:()=>eC(et,"API Key"),className:"w-full sm:w-auto",children:[(0,a.jsx)(P.A,{className:"mr-2 h-4 w-4"})," Copy Key"]}),(0,a.jsx)(y.HM,{asChild:!0,children:(0,a.jsx)(f.$,{type:"button",variant:"outline",className:"w-full sm:w-auto mt-2 sm:mt-0",children:"Close"})})]})]})})]})}},34105:(e,t,s)=>{"use strict";s.d(t,{c:()=>a});let a=(0,s(12115).createContext)(void 0)},51834:(e,t,s)=>{"use strict";s.d(t,{Cf:()=>u,Es:()=>x,HM:()=>c,L3:()=>h,c7:()=>m,lG:()=>o,rr:()=>g});var a=s(95155);s(12115);var r=s(88292),l=s(65229),n=s(64269);function o(e){let{...t}=e;return(0,a.jsx)(r.bL,{"data-slot":"dialog",...t})}function i(e){let{...t}=e;return(0,a.jsx)(r.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{...t}=e;return(0,a.jsx)(r.bm,{"data-slot":"dialog-close",...t})}function d(e){let{className:t,...s}=e;return(0,a.jsx)(r.hJ,{"data-slot":"dialog-overlay",className:(0,n.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function u(e){let{className:t,children:s,...o}=e;return(0,a.jsxs)(i,{"data-slot":"dialog-portal",children:[(0,a.jsx)(d,{}),(0,a.jsxs)(r.UC,{"data-slot":"dialog-content",className:(0,n.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...o,children:[s,(0,a.jsxs)(r.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,a.jsx)(l.A,{}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function m(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"dialog-header",className:(0,n.cn)("flex flex-col gap-2 text-center sm:text-left",t),...s})}function x(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"dialog-footer",className:(0,n.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...s})}function h(e){let{className:t,...s}=e;return(0,a.jsx)(r.hE,{"data-slot":"dialog-title",className:(0,n.cn)("text-lg leading-none font-semibold",t),...s})}function g(e){let{className:t,...s}=e;return(0,a.jsx)(r.VY,{"data-slot":"dialog-description",className:(0,n.cn)("text-muted-foreground text-sm",t),...s})}},56419:(e,t,s)=>{"use strict";s.d(t,{p:()=>r});var a=s(95155);s(12115);let r=e=>{let{icon:t,title:s,description:r,action:l}=e;return(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center text-center py-12 px-4",children:[(0,a.jsx)("div",{className:"rounded-full bg-muted p-3 mb-4",children:(0,a.jsx)(t,{className:"h-10 w-10 text-muted-foreground"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold mb-2",children:s}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground max-w-sm mb-6",children:r}),l&&(0,a.jsx)("div",{children:l})]})}},63479:(e,t,s)=>{"use strict";s.d(t,{D:()=>n,N:()=>c});var a=s(95155),r=s(12115);let l=(0,r.createContext)({theme:"system",resolvedTheme:"light",setTheme:()=>{}});function n(){return(0,r.useContext)(l)}let o="hackagent-theme";function i(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function c(e){let{children:t}=e,[s,n]=(0,r.useState)("light"),[c,d]=(0,r.useState)("light"),u=e=>{let t=document.documentElement;"dark"===e?t.classList.add("dark"):t.classList.remove("dark")};return(0,r.useEffect)(()=>{var e;let t=null!=(e=localStorage.getItem(o))?e:"light";n(t);let s="system"===t?i():t;d(s),u(s)},[]),(0,r.useEffect)(()=>{let e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{if("system"===s){let e=i();d(e),u(e)}};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[s]),(0,a.jsx)(l.Provider,{value:{theme:s,resolvedTheme:c,setTheme:e=>{localStorage.setItem(o,e),n(e);let t="system"===e?i():e;d(t),u(t)}},children:t})}},65142:(e,t,s)=>{"use strict";s.d(t,{p:()=>l});var a=s(95155);s(12115);var r=s(64269);function l(e){let{className:t,type:s,...l}=e;return(0,a.jsx)("input",{type:s,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...l})}},80230:(e,t,s)=>{"use strict";s.d(t,{h:()=>n});var a=s(12115),r=s(34105);let l=async()=>"";function n(){let e=(0,a.useContext)(r.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:l}}},84443:(e,t,s)=>{Promise.resolve().then(s.bind(s,33369))},87270:(e,t,s)=>{"use strict";s.d(t,{A0:()=>n,BF:()=>o,Hj:()=>i,XI:()=>l,nA:()=>d,nd:()=>c,r6:()=>u});var a=s(95155);s(12115);var r=s(64269);function l(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,a.jsx)("table",{"data-slot":"table",className:(0,r.cn)("w-full caption-bottom text-sm",t),...s})})}function n(e){let{className:t,...s}=e;return(0,a.jsx)("thead",{"data-slot":"table-header",className:(0,r.cn)("[&_tr]:border-b",t),...s})}function o(e){let{className:t,...s}=e;return(0,a.jsx)("tbody",{"data-slot":"table-body",className:(0,r.cn)("[&_tr:last-child]:border-0",t),...s})}function i(e){let{className:t,...s}=e;return(0,a.jsx)("tr",{"data-slot":"table-row",className:(0,r.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...s})}function c(e){let{className:t,...s}=e;return(0,a.jsx)("th",{"data-slot":"table-head",className:(0,r.cn)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s})}function d(e){let{className:t,...s}=e;return(0,a.jsx)("td",{"data-slot":"table-cell",className:(0,r.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s})}function u(e){let{className:t,...s}=e;return(0,a.jsx)("caption",{"data-slot":"table-caption",className:(0,r.cn)("text-muted-foreground mt-4 text-sm",t),...s})}}},e=>{e.O(0,[133,574,704,756,924,441,493,358],()=>e(e.s=84443)),_N_E=e.O()}]);
|