@juliantanx/aiusage 1.0.3 → 1.0.4
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/index.js +241 -38
- package/dist/web/_app/immutable/assets/0.DDbFsqNI.css +1 -0
- package/dist/web/_app/immutable/assets/2.fho1OPpm.css +1 -0
- package/dist/web/_app/immutable/assets/8.9sovMx-u.css +1 -0
- package/dist/web/_app/immutable/assets/9.Doxq00gF.css +1 -0
- package/dist/web/_app/immutable/assets/_layout.RgD-pTKj.css +1 -0
- package/dist/web/_app/immutable/assets/_page.9sovMx-u.css +1 -0
- package/dist/web/_app/immutable/assets/_page.DTuZozBR.css +1 -0
- package/dist/web/_app/immutable/assets/_page.Doxq00gF.css +1 -0
- package/dist/web/_app/immutable/chunks/ToolSelector.DIzQsA4_.js +2 -0
- package/dist/web/_app/immutable/chunks/api.D-M_rVlI.js +1 -0
- package/dist/web/_app/immutable/chunks/{entry.JnN5paQ1.js → entry.-i5eOrF8.js} +1 -1
- package/dist/web/_app/immutable/chunks/{index.Dm-3G3np.js → index.BjVwNvJa.js} +1 -1
- package/dist/web/_app/immutable/chunks/{index.CzqoKkoo.js → index.CUfK07C5.js} +1 -1
- package/dist/web/_app/immutable/chunks/scheduler.DukoKnjQ.js +1 -0
- package/dist/web/_app/immutable/chunks/{stores.6YXFe6HN.js → stores.BJHWQcKv.js} +1 -1
- package/dist/web/_app/immutable/entry/app.Pb7AfjR8.js +2 -0
- package/dist/web/_app/immutable/entry/start.DyuR4tFJ.js +1 -0
- package/dist/web/_app/immutable/nodes/0.BhkxfbMC.js +1 -0
- package/dist/web/_app/immutable/nodes/{1.CA3EXHZg.js → 1.CNO4bJXv.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.BSeUhVCa.js → 10.1LgqVOtM.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.DJXBgSiY.js → 11.BOfGogcw.js} +1 -1
- package/dist/web/_app/immutable/nodes/2.C_8jrQsV.js +3 -0
- package/dist/web/_app/immutable/nodes/{3.Bqg88zQg.js → 3.Lz_pbSpS.js} +1 -1
- package/dist/web/_app/immutable/nodes/{4.B3zrG0ip.js → 4.BCB36ta_.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.CJyBxUXd.js → 5.CykeLKzi.js} +1 -1
- package/dist/web/_app/immutable/nodes/{5.C3h9wXyF.js → 6.De73932o.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.C8xhym7b.js → 7.6OEKXCWR.js} +1 -1
- package/dist/web/_app/immutable/nodes/8.niqPZkB9.js +1 -0
- package/dist/web/_app/immutable/nodes/9.DRZSbXAV.js +1 -0
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +9 -9
- package/package.json +4 -2
- package/dist/web/_app/immutable/assets/0.BTUc0PXb.css +0 -1
- package/dist/web/_app/immutable/assets/7.8R_5Laqi.css +0 -1
- package/dist/web/_app/immutable/assets/_layout.DLyrrG29.css +0 -1
- package/dist/web/_app/immutable/assets/_page.8R_5Laqi.css +0 -1
- package/dist/web/_app/immutable/chunks/ToolSelector.kb97TteP.js +0 -2
- package/dist/web/_app/immutable/chunks/api.DyoIo4nG.js +0 -1
- package/dist/web/_app/immutable/chunks/scheduler.Dx1bs0RQ.js +0 -1
- package/dist/web/_app/immutable/entry/app.MBvJGLMp.js +0 -2
- package/dist/web/_app/immutable/entry/start.BQY9CnVO.js +0 -1
- package/dist/web/_app/immutable/nodes/0.BcLtzgbo.js +0 -1
- package/dist/web/_app/immutable/nodes/7.C950CTxa.js +0 -1
- /package/dist/web/_app/immutable/assets/{8.BcbNCOTS.css → 10.BcbNCOTS.css} +0 -0
- /package/dist/web/_app/immutable/assets/{9.QhlpTtkf.css → 11.QhlpTtkf.css} +0 -0
- /package/dist/web/_app/immutable/assets/{2.I4bgY8QS.css → 5.I4bgY8QS.css} +0 -0
- /package/dist/web/_app/immutable/assets/{5.BeDwa7mS.css → 6.BeDwa7mS.css} +0 -0
- /package/dist/web/_app/immutable/assets/{6.BYQidWiw.css → 7.BYQidWiw.css} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w as d,d as u}from"./index.Dm-3G3np.js";function g(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}const c={en:{nav:{overview:"Overview",tokens:"Tokens",cost:"Cost",models:"Models",toolCalls:"Tool Calls",projects:"Projects",sessions:"Sessions",pricing:"Pricing"},common:{loading:"Loading...",error:"Error",noData:"No data available",noDataHint:"Start using AI tools to see statistics here.",apply:"Apply",all:"All",previous:"Previous",next:"Next",page:"Page",of:"of"},range:{today:"Today",week:"This Week",month:"This Month",last30:"Last 30d",allTime:"All Time",from:"From",to:"To",pickMonth:"Month..."},overview:{title:"Overview",totalTokens:"Total Tokens",totalCost:"Total Cost",activeDays:"Active Days",totalSessions:"Sessions",inputTokens:"Input",outputTokens:"Output",cacheRead:"Cache Read",cacheWrite:"Cache Write",byTool:"By AI Assistant",byProject:"By Project",topToolCalls:"Top Tool Calls",tool:"Tool",tokens:"Tokens",cost:"Cost",noToolData:"No data",noToolCalls:"No tool calls recorded"},tokens:{title:"Tokens",chartTitle:"Token Usage by Day",input:"Input",output:"Output",cacheRead:"Cache Read",cacheWrite:"Cache Write",thinking:"Thinking",date:"Date",total:"Total",noData:"No token data",noDataHint:"No token usage recorded for this period."},projects:{title:"Projects",project:"Project",sessions:"Sessions",tokens:"Tokens",cost:"Cost",share:"Share",noData:"No project data",noDataHint:"No project usage recorded for this period."},cost:{title:"Cost",totalCost:"Total Cost",chartTitle:"Cost by Day",byTool:"By AI Assistant",byModel:"By Model",noData:"No cost data",noDataHint:"No costs recorded for this period."},models:{title:"Models",model:"Model",provider:"Provider",calls:"Calls",tokens:"Tokens",share:"Share",noData:"No model data",noDataHint:"No model usage recorded for this period."},toolCalls:{title:"Tool Calls",noData:"No tool call data",noDataHint:"No tool calls recorded for this period."},sessions:{title:"Sessions",assistant:"AI Assistant",time:"Time",tool:"Tool",model:"Model",input:"Input",output:"Output",cost:"Cost",noData:"No sessions",noDataHint:"No sessions recorded for this period."},theme:{system:"System",dark:"Dark",light:"Light"},pricing:{title:"Pricing",model:"Model",input:"Input",output:"Output",cacheRead:"Cache Read",cacheWrite:"Cache Write",thinking:"Thinking",status:"Status",actions:"Actions",edit:"Edit",save:"Save",cancel:"Cancel",reset:"Reset",recalc:"Recalculate Costs",recalcDone:"Recalculated",default:"Default",override:"Custom",matched:"Matched by prefix",noPrice:"No pricing",perMillion:"/ 1M tokens"},sync:{trigger:"Sync",syncing:"Syncing...",started:"Sync started",inProgress:"Sync already running",complete:"Synced",failed:"Sync failed",notConfigured:"Not configured",lastSync:"Last sync",never:"Never"},device:{allDevices:"All Devices",loading:"Loading..."},tool:{allTools:"All tools"}},zh:{nav:{overview:"概览",tokens:"Token",cost:"费用",models:"模型",toolCalls:"工具调用",projects:"项目",sessions:"会话",pricing:"定价"},common:{loading:"加载中...",error:"错误",noData:"暂无数据",noDataHint:"开始使用 AI 工具后,统计数据将显示在此处。",apply:"应用",all:"全部",previous:"上一页",next:"下一页",page:"第",of:"页,共"},range:{today:"今天",week:"本周",month:"本月",last30:"近 30 天",allTime:"全部",from:"开始",to:"结束",pickMonth:"选择月份..."},overview:{title:"概览",totalTokens:"总 Token",totalCost:"总费用",activeDays:"活跃天数",totalSessions:"会话数",inputTokens:"输入",outputTokens:"输出",cacheRead:"缓存读取",cacheWrite:"缓存写入",byTool:"按 AI 助手",byProject:"按项目",topToolCalls:"常用工具",tool:"工具",tokens:"Token",cost:"费用",noToolData:"暂无数据",noToolCalls:"暂无工具调用记录"},tokens:{title:"Token",chartTitle:"每日 Token 用量",input:"输入",output:"输出",cacheRead:"缓存读取",cacheWrite:"缓存写入",thinking:"思考",date:"日期",total:"合计",noData:"暂无 Token 数据",noDataHint:"当前时间段内无 Token 使用记录。"},projects:{title:"项目",project:"项目",sessions:"会话",tokens:"Token",cost:"费用",share:"占比",noData:"暂无项目数据",noDataHint:"当前时间段内无项目使用记录。"},cost:{title:"费用",totalCost:"总费用",chartTitle:"每日费用",byTool:"按 AI 助手",byModel:"按模型",noData:"暂无费用数据",noDataHint:"当前时间段内无费用记录。"},models:{title:"模型",model:"模型",provider:"提供商",calls:"调用次数",tokens:"Token",share:"占比",noData:"暂无模型数据",noDataHint:"当前时间段内无模型使用记录。"},toolCalls:{title:"工具调用",noData:"暂无工具调用数据",noDataHint:"当前时间段内无工具调用记录。"},sessions:{title:"会话",assistant:"AI 助手",time:"时间",tool:"工具",model:"模型",input:"输入",output:"输出",cost:"费用",noData:"暂无会话",noDataHint:"当前时间段内无会话记录。"},theme:{system:"跟随系统",dark:"深色",light:"浅色"},pricing:{title:"定价管理",model:"模型",input:"输入",output:"输出",cacheRead:"缓存读取",cacheWrite:"缓存写入",thinking:"思考",status:"状态",actions:"操作",edit:"编辑",save:"保存",cancel:"取消",reset:"重置",recalc:"重新计算费用",recalcDone:"已重新计算",default:"默认",override:"自定义",matched:"前缀匹配",noPrice:"无定价",perMillion:"/ 1M tokens"},sync:{trigger:"同步",syncing:"同步中...",started:"已开始同步",inProgress:"同步已在进行中",complete:"已同步",failed:"同步失败",notConfigured:"未配置",lastSync:"上次同步",never:"从未"},device:{allDevices:"全部设备",loading:"加载中..."},tool:{allTools:"全部工具"}}};function p(){return typeof window>"u"?"en":localStorage.getItem("aiusage-lang")||"en"}const l=d(p());function f(){l.update(t=>{const e=t==="en"?"zh":"en";return typeof window<"u"&&localStorage.setItem("aiusage-lang",e),e})}const T=u(l,t=>{const e=c[t]||c.en;return o=>{const n=o.split(".");let a=e;for(const i of n)a=a==null?void 0:a[i];return a||o}});function r(t,e){const o=new URLSearchParams;for(const[a,i]of Object.entries(e))i&&o.set(a,i);const n=o.toString();return n?`${t}?${n}`:t}async function s(t){var o;const e=await fetch(t);if(!e.ok){const n=await e.json().catch(()=>({error:{message:"API error"}}));throw new Error(((o=n.error)==null?void 0:o.message)||`HTTP ${e.status}`)}return e.json()}async function y(t){return s(r("/api/summary",t))}async function m(t){return s(r("/api/tokens",t))}async function k(t){return s(r("/api/cost",t))}async function D(t){return s(r("/api/models",t))}async function v(t){return s(r("/api/tool-calls",t))}async function C(t){var e,o;return s(r("/api/sessions",{...t,page:(e=t.page)==null?void 0:e.toString(),pageSize:(o=t.pageSize)==null?void 0:o.toString()}))}async function S(t){return s(r("/api/projects",t))}async function w(){return s("/api/refresh")}async function P(){return s("/api/pricing")}async function j(t,e){var n;const o=await fetch("/api/pricing",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:t,...e})});if(!o.ok){const a=await o.json().catch(()=>({error:{message:"API error"}}));throw new Error(((n=a.error)==null?void 0:n.message)||`HTTP ${o.status}`)}return o.json()}async function A(t){var o;const e=await fetch(`/api/pricing?model=${encodeURIComponent(t)}`,{method:"DELETE"});if(!e.ok){const n=await e.json().catch(()=>({error:{message:"API error"}}));throw new Error(((o=n.error)==null?void 0:o.message)||`HTTP ${e.status}`)}return e.json()}async function I(){var e;const t=await fetch("/api/pricing/recalc",{method:"POST"});if(!t.ok){const o=await t.json().catch(()=>({error:{message:"API error"}}));throw new Error(((e=o.error)==null?void 0:e.message)||`HTTP ${t.status}`)}return t.json()}async function N(){var e;const t=await fetch("/api/sync",{method:"POST"});if(!t.ok){const o=await t.json().catch(()=>({error:{message:"API error"}}));throw new Error(((e=o.error)==null?void 0:e.message)||`HTTP ${t.status}`)}return t.json()}async function H(){return s("/api/sync")}export{k as a,D as b,P as c,A as d,g as e,y as f,I as g,S as h,C as i,m as j,v as k,H as l,N as m,f as n,l as o,w as r,T as t,j as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function m(){}function k(t,n){for(const e in n)t[e]=n[e];return t}function x(t){return t()}function z(){return Object.create(null)}function w(t){t.forEach(x)}function D(t){return typeof t=="function"}function F(t,n){return t!=t?n==n:t!==n||t&&typeof t=="object"||typeof t=="function"}function M(t){return Object.keys(t).length===0}function j(t,...n){if(t==null){for(const o of n)o(void 0);return m}const e=t.subscribe(...n);return e.unsubscribe?()=>e.unsubscribe():e}function P(t,n,e){t.$$.on_destroy.push(j(n,e))}function S(t,n,e,o){if(t){const u=p(t,n,e,o);return t[0](u)}}function p(t,n,e,o){return t[1]&&o?k(e.ctx.slice(),t[1](o(n))):e.ctx}function U(t,n,e,o){return t[2],n.dirty}function A(t,n,e,o,u,g){if(u){const y=p(n,e,o,g);t.p(y,u)}}function B(t){if(t.ctx.length>32){const n=[],e=t.ctx.length/32;for(let o=0;o<e;o++)n[o]=-1;return n}return-1}let a;function l(t){a=t}function _(){if(!a)throw new Error("Function called outside component initialization");return a}function C(t){_().$$.on_mount.push(t)}function G(t){_().$$.after_update.push(t)}function H(t){_().$$.on_destroy.push(t)}const r=[],h=[];let s=[];const d=[],b=Promise.resolve();let f=!1;function E(){f||(f=!0,b.then(O))}function I(){return E(),b}function v(t){s.push(t)}const i=new Set;let c=0;function O(){if(c!==0)return;const t=a;do{try{for(;c<r.length;){const n=r[c];c++,l(n),q(n.$$)}}catch(n){throw r.length=0,c=0,n}for(l(null),r.length=0,c=0;h.length;)h.pop()();for(let n=0;n<s.length;n+=1){const e=s[n];i.has(e)||(i.add(e),e())}s.length=0}while(r.length);for(;d.length;)d.pop()();f=!1,i.clear(),l(t)}function q(t){if(t.fragment!==null){t.update(),w(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(v)}}function J(t){const n=[],e=[];s.forEach(o=>t.indexOf(o)===-1?n.push(o):e.push(o)),e.forEach(o=>o()),s=n}export{j as a,S as b,P as c,U as d,H as e,G as f,B as g,h,D as i,M as j,a as k,z as l,O as m,m as n,C as o,l as p,J as q,w as r,F as s,I as t,A as u,v,x as w,r as x,E as y};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BcLtzgbo.js","../chunks/scheduler.Dx1bs0RQ.js","../chunks/index.CzqoKkoo.js","../chunks/api.DyoIo4nG.js","../chunks/index.Dm-3G3np.js","../chunks/stores.6YXFe6HN.js","../chunks/entry.JnN5paQ1.js","../assets/0.BTUc0PXb.css","../nodes/1.CA3EXHZg.js","../nodes/2.CJyBxUXd.js","../chunks/ToolSelector.kb97TteP.js","../assets/ToolSelector.HSbC8-q9.css","../assets/2.I4bgY8QS.css","../nodes/3.Bqg88zQg.js","../assets/3.BmO4KrOR.css","../nodes/4.B3zrG0ip.js","../assets/4.TAVgUi8b.css","../nodes/5.C3h9wXyF.js","../assets/5.BeDwa7mS.css","../nodes/6.C8xhym7b.js","../assets/6.BYQidWiw.css","../nodes/7.C950CTxa.js","../assets/7.8R_5Laqi.css","../nodes/8.BSeUhVCa.js","../assets/8.BcbNCOTS.css","../nodes/9.DJXBgSiY.js","../assets/9.QhlpTtkf.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{s as q,f as N,o as B,t as U,h as I}from"../chunks/scheduler.Dx1bs0RQ.js";import{S as W,i as z,d as h,l as g,m as w,C as A,D,a as v,g as F,r as E,j as G,E as R,k as L,u as y,n as O,q as V,o as T,w as p,c as H,e as J,h as K,s as Q,f as X,t as Y}from"../chunks/index.CzqoKkoo.js";const Z="modulepreload",M=function(o,e){return new URL(o,e).href},S={},d=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=M(c,r),c in S)return;S[c]=!0;const a=c.endsWith(".css"),u=a?'[rel="stylesheet"]':"";if(!!r)for(let k=t.length-1;k>=0;k--){const P=t[k];if(P.href===c&&(!a||P.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${u}`))return;const m=document.createElement("link");if(m.rel=a?"stylesheet":Z,a||(m.as="script"),m.crossOrigin="",m.href=c,l&&m.setAttribute("nonce",l),document.head.appendChild(m),a)return new Promise((k,P)=>{m.addEventListener("load",k),m.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${c}`)))})}))}function _(t){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=t,window.dispatchEvent(i),!i.defaultPrevented)throw t}return s.then(t=>{for(const i of t||[])i.status==="rejected"&&_(i.reason);return e().catch(_)})},ae={};function $(o){let e,n,r;var s=o[1][0];function _(t,i){return{props:{data:t[3],form:t[2]}}}return s&&(e=R(s,_(o)),o[12](e)),{c(){e&&y(e.$$.fragment),n=E()},l(t){e&&V(e.$$.fragment,t),n=E()},m(t,i){e&&O(e,t,i),v(t,n,i),r=!0},p(t,i){if(i&2&&s!==(s=t[1][0])){if(e){A();const l=e;g(l.$$.fragment,1,0,()=>{L(l,1)}),D()}s?(e=R(s,_(t)),t[12](e),y(e.$$.fragment),w(e.$$.fragment,1),O(e,n.parentNode,n)):e=null}else if(s){const l={};i&8&&(l.data=t[3]),i&4&&(l.form=t[2]),e.$set(l)}},i(t){r||(e&&w(e.$$.fragment,t),r=!0)},o(t){e&&g(e.$$.fragment,t),r=!1},d(t){t&&h(n),o[12](null),e&&L(e,t)}}}function x(o){let e,n,r;var s=o[1][0];function _(t,i){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=R(s,_(o)),o[11](e)),{c(){e&&y(e.$$.fragment),n=E()},l(t){e&&V(e.$$.fragment,t),n=E()},m(t,i){e&&O(e,t,i),v(t,n,i),r=!0},p(t,i){if(i&2&&s!==(s=t[1][0])){if(e){A();const l=e;g(l.$$.fragment,1,0,()=>{L(l,1)}),D()}s?(e=R(s,_(t)),t[11](e),y(e.$$.fragment),w(e.$$.fragment,1),O(e,n.parentNode,n)):e=null}else if(s){const l={};i&8&&(l.data=t[3]),i&8215&&(l.$$scope={dirty:i,ctx:t}),e.$set(l)}},i(t){r||(e&&w(e.$$.fragment,t),r=!0)},o(t){e&&g(e.$$.fragment,t),r=!1},d(t){t&&h(n),o[11](null),e&&L(e,t)}}}function ee(o){let e,n,r;var s=o[1][1];function _(t,i){return{props:{data:t[4],form:t[2]}}}return s&&(e=R(s,_(o)),o[10](e)),{c(){e&&y(e.$$.fragment),n=E()},l(t){e&&V(e.$$.fragment,t),n=E()},m(t,i){e&&O(e,t,i),v(t,n,i),r=!0},p(t,i){if(i&2&&s!==(s=t[1][1])){if(e){A();const l=e;g(l.$$.fragment,1,0,()=>{L(l,1)}),D()}s?(e=R(s,_(t)),t[10](e),y(e.$$.fragment),w(e.$$.fragment,1),O(e,n.parentNode,n)):e=null}else if(s){const l={};i&16&&(l.data=t[4]),i&4&&(l.form=t[2]),e.$set(l)}},i(t){r||(e&&w(e.$$.fragment,t),r=!0)},o(t){e&&g(e.$$.fragment,t),r=!1},d(t){t&&h(n),o[10](null),e&&L(e,t)}}}function j(o){let e,n=o[6]&&C(o);return{c(){e=K("div"),n&&n.c(),this.h()},l(r){e=H(r,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(e);n&&n.l(s),s.forEach(h),this.h()},h(){T(e,"id","svelte-announcer"),T(e,"aria-live","assertive"),T(e,"aria-atomic","true"),p(e,"position","absolute"),p(e,"left","0"),p(e,"top","0"),p(e,"clip","rect(0 0 0 0)"),p(e,"clip-path","inset(50%)"),p(e,"overflow","hidden"),p(e,"white-space","nowrap"),p(e,"width","1px"),p(e,"height","1px")},m(r,s){v(r,e,s),n&&n.m(e,null)},p(r,s){r[6]?n?n.p(r,s):(n=C(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(r){r&&h(e),n&&n.d()}}}function C(o){let e;return{c(){e=Y(o[7])},l(n){e=X(n,o[7])},m(n,r){v(n,e,r)},p(n,r){r&128&&Q(e,n[7])},d(n){n&&h(e)}}}function te(o){let e,n,r,s,_;const t=[x,$],i=[];function l(a,u){return a[1][1]?0:1}e=l(o),n=i[e]=t[e](o);let c=o[5]&&j(o);return{c(){n.c(),r=G(),c&&c.c(),s=E()},l(a){n.l(a),r=F(a),c&&c.l(a),s=E()},m(a,u){i[e].m(a,u),v(a,r,u),c&&c.m(a,u),v(a,s,u),_=!0},p(a,[u]){let b=e;e=l(a),e===b?i[e].p(a,u):(A(),g(i[b],1,1,()=>{i[b]=null}),D(),n=i[e],n?n.p(a,u):(n=i[e]=t[e](a),n.c()),w(n,1),n.m(r.parentNode,r)),a[5]?c?c.p(a,u):(c=j(a),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null)},i(a){_||(w(n),_=!0)},o(a){g(n),_=!1},d(a){a&&(h(r),h(s)),i[e].d(a),c&&c.d(a)}}}function ne(o,e,n){let{stores:r}=e,{page:s}=e,{constructors:_}=e,{components:t=[]}=e,{form:i}=e,{data_0:l=null}=e,{data_1:c=null}=e;N(r.page.notify);let a=!1,u=!1,b=null;B(()=>{const f=r.page.subscribe(()=>{a&&(n(6,u=!0),U().then(()=>{n(7,b=document.title||"untitled page")}))});return n(5,a=!0),f});function m(f){I[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function k(f){I[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function P(f){I[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return o.$$set=f=>{"stores"in f&&n(8,r=f.stores),"page"in f&&n(9,s=f.page),"constructors"in f&&n(1,_=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,i=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,c=f.data_1)},o.$$.update=()=>{o.$$.dirty&768&&r.page.set(s)},[t,_,i,l,c,a,u,b,r,s,m,k,P]}class le extends W{constructor(e){super(),z(this,e,ne,te,q,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ce=[()=>d(()=>import("../nodes/0.BcLtzgbo.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),()=>d(()=>import("../nodes/1.CA3EXHZg.js"),__vite__mapDeps([8,1,2,5,6,4]),import.meta.url),()=>d(()=>import("../nodes/2.CJyBxUXd.js"),__vite__mapDeps([9,1,2,3,4,10,11,12]),import.meta.url),()=>d(()=>import("../nodes/3.Bqg88zQg.js"),__vite__mapDeps([13,1,2,3,4,10,11,14]),import.meta.url),()=>d(()=>import("../nodes/4.B3zrG0ip.js"),__vite__mapDeps([15,1,2,3,4,10,11,16]),import.meta.url),()=>d(()=>import("../nodes/5.C3h9wXyF.js"),__vite__mapDeps([17,1,2,3,4,18]),import.meta.url),()=>d(()=>import("../nodes/6.C8xhym7b.js"),__vite__mapDeps([19,1,2,3,4,10,11,20]),import.meta.url),()=>d(()=>import("../nodes/7.C950CTxa.js"),__vite__mapDeps([21,1,2,3,4,10,11,22]),import.meta.url),()=>d(()=>import("../nodes/8.BSeUhVCa.js"),__vite__mapDeps([23,1,2,3,4,10,11,24]),import.meta.url),()=>d(()=>import("../nodes/9.DJXBgSiY.js"),__vite__mapDeps([25,1,2,3,4,10,11,26]),import.meta.url)],fe=[],_e={"/":[2],"/cost":[3],"/models":[4],"/pricing":[5],"/projects":[6],"/sessions":[7],"/tokens":[8],"/tool-calls":[9]},ie={handleError:({error:o})=>{console.error(o)},reroute:()=>{},transport:{}},re=Object.fromEntries(Object.entries(ie.transport).map(([o,e])=>[o,e.decode])),ue=!1,me=(o,e)=>re[o](e);export{me as decode,re as decoders,_e as dictionary,ue as hash,ie as hooks,ae as matchers,ce as nodes,le as root,fe as server_loads};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t}from"../chunks/entry.JnN5paQ1.js";export{t as start};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as Te,b as we,r as Ae,u as Ie,g as Ne,d as Pe,c as se,o as De,e as Me}from"../chunks/scheduler.Dx1bs0RQ.js";import{S as Be,i as Le,d as f,v as Re,l as Ce,m as Ve,s as D,o as m,a as R,b as i,x as ce,c as _,e as v,g as N,B as He,f as M,h as d,j as P,t as B,z as q}from"../chunks/index.CzqoKkoo.js";import{e as ye,l as Ue,m as je,n as Oe,t as qe,o as Ke}from"../chunks/api.DyoIo4nG.js";import{p as Ye}from"../chunks/stores.6YXFe6HN.js";import{w as Ee}from"../chunks/index.Dm-3G3np.js";const Se="aiusage-theme";function ue(){return typeof window>"u"?"system":localStorage.getItem(Se)||"system"}function ze(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const fe=Ee(ue()),Fe=Ee(ze());function Ge(){fe.update(s=>s==="system"?"dark":s==="dark"?"light":"system")}function Je(){if(typeof window>"u")return;const s=window.matchMedia("(prefers-color-scheme: dark)");function e(t){const a=t==="system"?ze():t;document.documentElement.setAttribute("data-theme",a),Fe.set(a)}e(ue()),fe.subscribe(t=>{localStorage.setItem(Se,t),e(t)}),s.addEventListener("change",()=>{ue()==="system"&&e("system")})}function ke(s,e,t){const a=s.slice();return a[16]=e[t],a}function be(s){let e,t=s[3](s[16].key)+"",a;return{c(){e=d("a"),a=B(t),this.h()},l(n){e=_(n,"A",{href:!0,class:!0});var o=v(e);a=M(o,t),o.forEach(f),this.h()},h(){m(e,"href",s[16].path),m(e,"class","svelte-1k8za9x"),q(e,"active",s[4].url.pathname===s[16].path)},m(n,o){R(n,e,o),i(e,a)},p(n,o){o&8&&t!==(t=n[3](n[16].key)+"")&&D(a,t),o&144&&q(e,"active",n[4].url.pathname===n[16].path)},d(n){n&&f(e)}}}function Qe(s){let e,t=s[3]("sync.trigger")+"",a;return{c(){e=d("span"),a=B(t),this.h()},l(n){e=_(n,"SPAN",{class:!0});var o=v(e);a=M(o,t),o.forEach(f),this.h()},h(){m(e,"class","sync-label svelte-1k8za9x")},m(n,o){R(n,e,o),i(e,a)},p(n,o){o&8&&t!==(t=n[3]("sync.trigger")+"")&&D(a,t)},d(n){n&&f(e)}}}function We(s){let e,t;return{c(){e=d("span"),t=B(s[2]),this.h()},l(a){e=_(a,"SPAN",{class:!0});var n=v(e);t=M(n,s[2]),n.forEach(f),this.h()},h(){m(e,"class","sync-label svelte-1k8za9x"),q(e,"ok",s[2]===s[3]("sync.complete")),q(e,"err",s[2]===s[3]("sync.failed"))},m(a,n){R(a,e,n),i(e,t)},p(a,n){n&4&&D(t,a[2]),n&12&&q(e,"ok",a[2]===a[3]("sync.complete")),n&12&&q(e,"err",a[2]===a[3]("sync.failed"))},d(a){a&&f(e)}}}function Xe(s){let e,t=s[3]("sync.syncing")+"",a;return{c(){e=d("span"),a=B(t),this.h()},l(n){e=_(n,"SPAN",{class:!0});var o=v(e);a=M(o,t),o.forEach(f),this.h()},h(){m(e,"class","sync-label svelte-1k8za9x")},m(n,o){R(n,e,o),i(e,a)},p(n,o){o&8&&t!==(t=n[3]("sync.syncing")+"")&&D(a,t)},d(n){n&&f(e)}}}function Ze(s){let e,t,a,n,o,K='<span class="logo svelte-1k8za9x">⌘</span> <span class="name svelte-1k8za9x">AIUsage</span>',Y,w,F,S,r,g,y=s[1]?"↻":"⇅",z,C,V,I,k,c,A=s[8][s[5]]+"",W,ae,H,G=s[3](`theme.${s[5]}`)+"",X,Z,le,L,J=s[6]==="en"?"中文":"EN",$,ne,U,b,oe,he,j=ye(s[7]),p=[];for(let l=0;l<j.length;l+=1)p[l]=be(ke(s,j,l));function me(l,h){return l[1]?Xe:l[2]?We:Qe}let x=me(s),T=x(s);const re=s[12].default,E=we(re,s,s[11],null);return{c(){e=d("div"),t=P(),a=d("div"),n=d("header"),o=d("div"),o.innerHTML=K,Y=P(),w=d("nav");for(let l=0;l<p.length;l+=1)p[l].c();F=P(),S=d("div"),r=d("button"),g=d("span"),z=B(y),C=P(),T.c(),I=P(),k=d("button"),c=d("span"),W=B(A),ae=P(),H=d("span"),X=B(G),le=P(),L=d("button"),$=B(J),ne=P(),U=d("main"),E&&E.c(),this.h()},l(l){e=_(l,"DIV",{class:!0}),v(e).forEach(f),t=N(l),a=_(l,"DIV",{class:!0});var h=v(a);n=_(h,"HEADER",{class:!0});var u=v(n);o=_(u,"DIV",{class:!0,"data-svelte-h":!0}),He(o)!=="svelte-1vxrilf"&&(o.innerHTML=K),Y=N(u),w=_(u,"NAV",{class:!0});var Q=v(w);for(let ie=0;ie<p.length;ie+=1)p[ie].l(Q);Q.forEach(f),F=N(u),S=_(u,"DIV",{class:!0});var O=v(S);r=_(O,"BUTTON",{class:!0,title:!0});var ee=v(r);g=_(ee,"SPAN",{class:!0});var pe=v(g);z=M(pe,y),pe.forEach(f),C=N(ee),T.l(ee),ee.forEach(f),I=N(O),k=_(O,"BUTTON",{class:!0,title:!0});var te=v(k);c=_(te,"SPAN",{class:!0});var _e=v(c);W=M(_e,A),_e.forEach(f),ae=N(te),H=_(te,"SPAN",{class:!0});var de=v(H);X=M(de,G),de.forEach(f),te.forEach(f),le=N(O),L=_(O,"BUTTON",{class:!0});var ve=v(L);$=M(ve,J),ve.forEach(f),O.forEach(f),u.forEach(f),ne=N(h),U=_(h,"MAIN",{class:!0});var ge=v(U);E&&E.l(ge),ge.forEach(f),h.forEach(f),this.h()},h(){m(e,"class","grain svelte-1k8za9x"),m(o,"class","brand svelte-1k8za9x"),m(w,"class","svelte-1k8za9x"),m(g,"class","sync-icon svelte-1k8za9x"),m(r,"class","sync-toggle svelte-1k8za9x"),r.disabled=s[1],m(r,"title",V=s[0]?`${s[3]("sync.lastSync")}: ${s[10](s[0].lastSyncAt)}`:s[3]("sync.notConfigured")),m(c,"class","theme-icon svelte-1k8za9x"),m(H,"class","theme-label svelte-1k8za9x"),m(k,"class","theme-toggle svelte-1k8za9x"),m(k,"title",Z=s[3](`theme.${s[5]}`)),m(L,"class","lang-toggle svelte-1k8za9x"),m(S,"class","controls svelte-1k8za9x"),m(n,"class","svelte-1k8za9x"),m(U,"class","svelte-1k8za9x"),m(a,"class","app svelte-1k8za9x")},m(l,h){R(l,e,h),R(l,t,h),R(l,a,h),i(a,n),i(n,o),i(n,Y),i(n,w);for(let u=0;u<p.length;u+=1)p[u]&&p[u].m(w,null);i(n,F),i(n,S),i(S,r),i(r,g),i(g,z),i(r,C),T.m(r,null),i(S,I),i(S,k),i(k,c),i(c,W),i(k,ae),i(k,H),i(H,X),i(S,le),i(S,L),i(L,$),i(a,ne),i(a,U),E&&E.m(U,null),b=!0,oe||(he=[ce(r,"click",s[9]),ce(k,"click",Ge),ce(L,"click",Oe)],oe=!0)},p(l,[h]){if(h&152){j=ye(l[7]);let u;for(u=0;u<j.length;u+=1){const Q=ke(l,j,u);p[u]?p[u].p(Q,h):(p[u]=be(Q),p[u].c(),p[u].m(w,null))}for(;u<p.length;u+=1)p[u].d(1);p.length=j.length}(!b||h&2)&&y!==(y=l[1]?"↻":"⇅")&&D(z,y),x===(x=me(l))&&T?T.p(l,h):(T.d(1),T=x(l),T&&(T.c(),T.m(r,null))),(!b||h&2)&&(r.disabled=l[1]),(!b||h&9&&V!==(V=l[0]?`${l[3]("sync.lastSync")}: ${l[10](l[0].lastSyncAt)}`:l[3]("sync.notConfigured")))&&m(r,"title",V),(!b||h&32)&&A!==(A=l[8][l[5]]+"")&&D(W,A),(!b||h&40)&&G!==(G=l[3](`theme.${l[5]}`)+"")&&D(X,G),(!b||h&40&&Z!==(Z=l[3](`theme.${l[5]}`)))&&m(k,"title",Z),(!b||h&64)&&J!==(J=l[6]==="en"?"中文":"EN")&&D($,J),E&&E.p&&(!b||h&2048)&&Ie(E,re,l,l[11],b?Pe(re,l[11],h,null):Ne(l[11]),null)},i(l){b||(Ve(E,l),b=!0)},o(l){Ce(E,l),b=!1},d(l){l&&(f(e),f(t),f(a)),Re(p,l),T.d(),E&&E.d(l),oe=!1,Ae(he)}}}function $e(s,e,t){let a,n,o,K;se(s,qe,c=>t(3,a=c)),se(s,Ye,c=>t(4,n=c)),se(s,fe,c=>t(5,o=c)),se(s,Ke,c=>t(6,K=c));let{$$slots:Y={},$$scope:w}=e;const F=[{path:"/",key:"nav.overview"},{path:"/tokens",key:"nav.tokens"},{path:"/cost",key:"nav.cost"},{path:"/models",key:"nav.models"},{path:"/tool-calls",key:"nav.toolCalls"},{path:"/projects",key:"nav.projects"},{path:"/sessions",key:"nav.sessions"},{path:"/pricing",key:"nav.pricing"}],S={system:"◐",dark:"●",light:"○"};let r=null,g=!1,y="",z=null;async function C(){try{const c=await Ue();t(0,r=c.status),t(1,g=!!(r!=null&&r.isRunning)),I()}catch{t(0,r=null),t(1,g=!1),I()}}async function V(){var c;t(2,y="");try{const A=await je();t(0,r=A.status),t(1,g=!!((c=A.status)!=null&&c.isRunning)),t(2,y=A.alreadyRunning?a("sync.inProgress"):a("sync.started")),I()}catch{t(2,y=a("sync.failed")),t(1,g=!1),I()}setTimeout(()=>{g||t(2,y="")},3e3)}function I(){z&&(clearInterval(z),z=null),g&&(z=setInterval(async()=>{await C(),r!=null&&r.isRunning||(t(2,y=(r==null?void 0:r.lastSyncStatus)==="ok"?a("sync.complete"):(r==null?void 0:r.lastSyncError)||a("sync.failed")),setTimeout(()=>{t(2,y="")},5e3))},2e3))}function k(c){return c?new Date(c).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):a("sync.never")}return De(()=>{Je(),C()}),Me(()=>{z&&clearInterval(z)}),s.$$set=c=>{"$$scope"in c&&t(11,w=c.$$scope)},[r,g,y,a,n,o,K,F,S,V,k,w,Y]}class lt extends Be{constructor(e){super(),Le(this,e,$e,Ze,Te,{})}}export{lt as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as Ze,c as pe,r as $e}from"../chunks/scheduler.Dx1bs0RQ.js";import{S as ye,i as xe,d as r,k as ze,l as Ve,m as Ae,a as F,n as Pe,b as e,o as B,p as et,g as k,c as _,e as d,q as Re,r as Ye,j as H,h as m,u as we,s as I,f as E,t as T,v as tt,x as Ge}from"../chunks/index.CzqoKkoo.js";import{i as st,e as Je,t as lt}from"../chunks/api.DyoIo4nG.js";import{D as ot,a as at,T as nt,g as Ke,f as ge,b as Qe,s as rt,d as it,e as ft}from"../chunks/ToolSelector.kb97TteP.js";function We(o,t,s){const a=o.slice();return a[11]=t[s],a}function ct(o){let t,s,a,l,u,h=o[4]("sessions.time")+"",g,b,v,i=o[4]("sessions.tool")+"",S,P,R,c=o[4]("sessions.model")+"",n,j,z,U=o[4]("sessions.input")+"",L,W,J,O=o[4]("sessions.output")+"",Y,X,K,V=o[4]("sessions.cost")+"",p,y,Q,$,w,N,x,le=o[4]("common.previous")+"",fe,ce,be,C,oe=o[4]("common.page")+"",ue,Ee,he,Te,ae=o[4]("common.of")+"",_e,De,ne=Math.ceil(o[1].total/se)+"",de,ke,G,re=o[4]("common.next")+"",me,He,ve,qe,Be,ee=Je(o[1].sessions),A=[];for(let f=0;f<ee.length;f+=1)A[f]=Xe(We(o,ee,f));return{c(){t=m("div"),s=m("table"),a=m("thead"),l=m("tr"),u=m("th"),g=T(h),b=H(),v=m("th"),S=T(i),P=H(),R=m("th"),n=T(c),j=H(),z=m("th"),L=T(U),W=H(),J=m("th"),Y=T(O),X=H(),K=m("th"),p=T(V),y=H(),Q=m("tbody");for(let f=0;f<A.length;f+=1)A[f].c();$=H(),w=m("div"),N=m("button"),x=T("← "),fe=T(le),be=H(),C=m("span"),ue=T(oe),Ee=H(),he=T(o[0]),Te=H(),_e=T(ae),De=H(),de=T(ne),ke=H(),G=m("button"),me=T(re),He=T(" →"),this.h()},l(f){t=_(f,"DIV",{class:!0});var D=d(t);s=_(D,"TABLE",{});var q=d(s);a=_(q,"THEAD",{});var ie=d(a);l=_(ie,"TR",{});var M=d(l);u=_(M,"TH",{});var Ne=d(u);g=E(Ne,h),Ne.forEach(r),b=k(M),v=_(M,"TH",{});var Ue=d(v);S=E(Ue,i),Ue.forEach(r),P=k(M),R=_(M,"TH",{});var Oe=d(R);n=E(Oe,c),Oe.forEach(r),j=k(M),z=_(M,"TH",{});var Ce=d(z);L=E(Ce,U),Ce.forEach(r),W=k(M),J=_(M,"TH",{});var Me=d(J);Y=E(Me,O),Me.forEach(r),X=k(M),K=_(M,"TH",{});var Fe=d(K);p=E(Fe,V),Fe.forEach(r),M.forEach(r),ie.forEach(r),y=k(q),Q=_(q,"TBODY",{});var Le=d(Q);for(let je=0;je<A.length;je+=1)A[je].l(Le);Le.forEach(r),q.forEach(r),D.forEach(r),$=k(f),w=_(f,"DIV",{class:!0});var te=d(w);N=_(te,"BUTTON",{class:!0});var Ie=d(N);x=E(Ie,"← "),fe=E(Ie,le),Ie.forEach(r),be=k(te),C=_(te,"SPAN",{class:!0});var Z=d(C);ue=E(Z,oe),Ee=k(Z),he=E(Z,o[0]),Te=k(Z),_e=E(Z,ae),De=k(Z),de=E(Z,ne),Z.forEach(r),ke=k(te),G=_(te,"BUTTON",{class:!0});var Se=d(G);me=E(Se,re),He=E(Se," →"),Se.forEach(r),te.forEach(r),this.h()},h(){B(t,"class","card"),N.disabled=ce=o[0]<=1,B(N,"class","svelte-qmj96z"),B(C,"class","page-info mono svelte-qmj96z"),G.disabled=ve=o[0]*se>=o[1].total,B(G,"class","svelte-qmj96z"),B(w,"class","pagination svelte-qmj96z")},m(f,D){F(f,t,D),e(t,s),e(s,a),e(a,l),e(l,u),e(u,g),e(l,b),e(l,v),e(v,S),e(l,P),e(l,R),e(R,n),e(l,j),e(l,z),e(z,L),e(l,W),e(l,J),e(J,Y),e(l,X),e(l,K),e(K,p),e(s,y),e(s,Q);for(let q=0;q<A.length;q+=1)A[q]&&A[q].m(Q,null);F(f,$,D),F(f,w,D),e(w,N),e(N,x),e(N,fe),e(w,be),e(w,C),e(C,ue),e(C,Ee),e(C,he),e(C,Te),e(C,_e),e(C,De),e(C,de),e(w,ke),e(w,G),e(G,me),e(G,He),qe||(Be=[Ge(N,"click",o[6]),Ge(G,"click",o[5])],qe=!0)},p(f,D){if(D&16&&h!==(h=f[4]("sessions.time")+"")&&I(g,h),D&16&&i!==(i=f[4]("sessions.tool")+"")&&I(S,i),D&16&&c!==(c=f[4]("sessions.model")+"")&&I(n,c),D&16&&U!==(U=f[4]("sessions.input")+"")&&I(L,U),D&16&&O!==(O=f[4]("sessions.output")+"")&&I(Y,O),D&16&&V!==(V=f[4]("sessions.cost")+"")&&I(p,V),D&2){ee=Je(f[1].sessions);let q;for(q=0;q<ee.length;q+=1){const ie=We(f,ee,q);A[q]?A[q].p(ie,D):(A[q]=Xe(ie),A[q].c(),A[q].m(Q,null))}for(;q<A.length;q+=1)A[q].d(1);A.length=ee.length}D&16&&le!==(le=f[4]("common.previous")+"")&&I(fe,le),D&1&&ce!==(ce=f[0]<=1)&&(N.disabled=ce),D&16&&oe!==(oe=f[4]("common.page")+"")&&I(ue,oe),D&1&&I(he,f[0]),D&16&&ae!==(ae=f[4]("common.of")+"")&&I(_e,ae),D&2&&ne!==(ne=Math.ceil(f[1].total/se)+"")&&I(de,ne),D&16&&re!==(re=f[4]("common.next")+"")&&I(me,re),D&3&&ve!==(ve=f[0]*se>=f[1].total)&&(G.disabled=ve)},d(f){f&&(r(t),r($),r(w)),tt(A,f),qe=!1,$e(Be)}}}function ut(o){let t,s,a=o[4]("sessions.noData")+"",l,u,h,g=o[4]("sessions.noDataHint")+"",b;return{c(){t=m("div"),s=m("h2"),l=T(a),u=H(),h=m("p"),b=T(g),this.h()},l(v){t=_(v,"DIV",{class:!0});var i=d(t);s=_(i,"H2",{});var S=d(s);l=E(S,a),S.forEach(r),u=k(i),h=_(i,"P",{});var P=d(h);b=E(P,g),P.forEach(r),i.forEach(r),this.h()},h(){B(t,"class","state-msg")},m(v,i){F(v,t,i),e(t,s),e(s,l),e(t,u),e(t,h),e(h,b)},p(v,i){i&16&&a!==(a=v[4]("sessions.noData")+"")&&I(l,a),i&16&&g!==(g=v[4]("sessions.noDataHint")+"")&&I(b,g)},d(v){v&&r(t)}}}function ht(o){let t,s;return{c(){t=m("div"),s=T(o[2]),this.h()},l(a){t=_(a,"DIV",{class:!0});var l=d(t);s=E(l,o[2]),l.forEach(r),this.h()},h(){B(t,"class","state-msg error")},m(a,l){F(a,t,l),e(t,s)},p(a,l){l&4&&I(s,a[2])},d(a){a&&r(t)}}}function _t(o){let t,s=o[4]("common.loading")+"",a;return{c(){t=m("div"),a=T(s),this.h()},l(l){t=_(l,"DIV",{class:!0});var u=d(t);a=E(u,s),u.forEach(r),this.h()},h(){B(t,"class","state-msg")},m(l,u){F(l,t,u),e(t,a)},p(l,u){u&16&&s!==(s=l[4]("common.loading")+"")&&I(a,s)},d(l){l&&r(t)}}}function Xe(o){let t,s,a=Ke(o[11].ts)+"",l,u,h,g=o[11].tool+"",b,v,i,S=o[11].model+"",P,R,c,n=ge(o[11].inputTokens)+"",j,z,U,L=ge(o[11].outputTokens)+"",W,J,O,Y=Qe(o[11].cost)+"",X,K;return{c(){t=m("tr"),s=m("td"),l=T(a),u=H(),h=m("td"),b=T(g),v=H(),i=m("td"),P=T(S),R=H(),c=m("td"),j=T(n),z=H(),U=m("td"),W=T(L),J=H(),O=m("td"),X=T(Y),K=H(),this.h()},l(V){t=_(V,"TR",{});var p=d(t);s=_(p,"TD",{class:!0});var y=d(s);l=E(y,a),y.forEach(r),u=k(p),h=_(p,"TD",{});var Q=d(h);b=E(Q,g),Q.forEach(r),v=k(p),i=_(p,"TD",{class:!0});var $=d(i);P=E($,S),$.forEach(r),R=k(p),c=_(p,"TD",{class:!0});var w=d(c);j=E(w,n),w.forEach(r),z=k(p),U=_(p,"TD",{class:!0});var N=d(U);W=E(N,L),N.forEach(r),J=k(p),O=_(p,"TD",{class:!0});var x=d(O);X=E(x,Y),x.forEach(r),K=k(p),p.forEach(r),this.h()},h(){B(s,"class","mono"),B(i,"class","mono model svelte-qmj96z"),B(c,"class","mono green"),B(U,"class","mono blue"),B(O,"class","mono accent")},m(V,p){F(V,t,p),e(t,s),e(s,l),e(t,u),e(t,h),e(h,b),e(t,v),e(t,i),e(i,P),e(t,R),e(t,c),e(c,j),e(t,z),e(t,U),e(U,W),e(t,J),e(t,O),e(O,X),e(t,K)},p(V,p){p&2&&a!==(a=Ke(V[11].ts)+"")&&I(l,a),p&2&&g!==(g=V[11].tool+"")&&I(b,g),p&2&&S!==(S=V[11].model+"")&&I(P,S),p&2&&n!==(n=ge(V[11].inputTokens)+"")&&I(j,n),p&2&&L!==(L=ge(V[11].outputTokens)+"")&&I(W,L),p&2&&Y!==(Y=Qe(V[11].cost)+"")&&I(X,Y)},d(V){V&&r(t)}}}function dt(o){let t,s,a,l,u,h,g,b,v,i,S;document.title=t=o[4]("sessions.title")+" — AIUsage",l=new ot({}),h=new at({}),b=new nt({});function P(n,j){var z;return n[3]?_t:n[2]?ht:(z=n[1])!=null&&z.sessions.length?ct:ut}let R=P(o),c=R(o);return{c(){s=H(),a=m("div"),we(l.$$.fragment),u=H(),we(h.$$.fragment),g=H(),we(b.$$.fragment),v=H(),c.c(),i=Ye(),this.h()},l(n){et("svelte-1qvtsma",document.head).forEach(r),s=k(n),a=_(n,"DIV",{class:!0});var z=d(a);Re(l.$$.fragment,z),u=k(z),Re(h.$$.fragment,z),g=k(z),Re(b.$$.fragment,z),z.forEach(r),v=k(n),c.l(n),i=Ye(),this.h()},h(){B(a,"class","filter-bar svelte-qmj96z")},m(n,j){F(n,s,j),F(n,a,j),Pe(l,a,null),e(a,u),Pe(h,a,null),e(a,g),Pe(b,a,null),F(n,v,j),c.m(n,j),F(n,i,j),S=!0},p(n,[j]){(!S||j&16)&&t!==(t=n[4]("sessions.title")+" — AIUsage")&&(document.title=t),R===(R=P(n))&&c?c.p(n,j):(c.d(1),c=R(n),c&&(c.c(),c.m(i.parentNode,i)))},i(n){S||(Ae(l.$$.fragment,n),Ae(h.$$.fragment,n),Ae(b.$$.fragment,n),S=!0)},o(n){Ve(l.$$.fragment,n),Ve(h.$$.fragment,n),Ve(b.$$.fragment,n),S=!1},d(n){n&&(r(s),r(a),r(v),r(i)),ze(l),ze(h),ze(b),c.d(n)}}}const se=50;function mt(o,t,s){let a,l,u,h;pe(o,rt,c=>s(7,a=c)),pe(o,it,c=>s(8,l=c)),pe(o,ft,c=>s(9,u=c)),pe(o,lt,c=>s(4,h=c));let g=null,b=null,v=!0,i=1;async function S(){s(3,v=!0),s(2,b=null);try{s(1,g=await st({...u,device:l,tool:a,page:i,pageSize:se}))}catch(c){s(2,b=c instanceof Error?c.message:"Failed to load data"),s(1,g=null)}finally{s(3,v=!1)}}function P(){g&&i*se<g.total&&s(0,i++,i)}function R(){i>1&&s(0,i--,i)}return o.$$.update=()=>{o.$$.dirty&128&&s(0,i=1),o.$$.dirty&897&&S()},[i,g,b,v,h,P,R,a,l,u]}class Et extends ye{constructor(t){super(),xe(this,t,mt,dt,Ze,{})}}export{Et as component};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|