@kenz1117/dsh-ui-usage-billing 1.0.26 → 1.0.27
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/lib/client.js +3 -3
- package/package.json +8 -8
package/lib/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({id:`@kenz1117/dsh-ui-usage-billing`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});let r=e("react"),i=e("@deepseek-ai/dsh-client-ui-primitives"),a=e("react/jsx-runtime"),o=e("@deepseek-ai/dsh-client-store");function s(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=s(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function c(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=s(e))&&(r&&(r+=` `),r+=t);return r}let l={mode:`combined`,targets:[]},u=`dsh.ui-usage-billing.float`;function d(){try{let e=localStorage.getItem(u);if(e===null)return{...l,targets:[...l.targets]};let t=JSON.parse(e);return{mode:t.mode===`subscription`?`subscription`:`combined`,targets:Array.isArray(t.targets)?t.targets.filter(e=>typeof e==`string`):[]}}catch{return{...l,targets:[...l.targets]}}}function f(e){try{localStorage.setItem(u,JSON.stringify(e))}catch{}}let p={metric:`money`},m=`dsh.ui-usage-billing.card`;function h(){try{let e=localStorage.getItem(m);return e===null?{...p}:{metric:JSON.parse(e).metric===`tokens`?`tokens`:`money`}}catch{return{...p}}}function g(e){try{localStorage.setItem(m,JSON.stringify(e))}catch{}}let _={hideUnidentified:!0},v=`dsh.ui-usage-billing.sites`;function y(){try{let e=localStorage.getItem(v);return e===null?{..._}:{hideUnidentified:JSON.parse(e).hideUnidentified!==!1}}catch{return{..._}}}function b(e){try{localStorage.setItem(v,JSON.stringify(e))}catch{}}let x={show:!0},S=`dsh.ui-usage-billing.livecost`,C=`dsh.ui-usage-billing.livecost-pref`;function ee(){try{let e=localStorage.getItem(S);return e===null?{...x}:{show:JSON.parse(e).show!==!1}}catch{return{...x}}}function w(e){try{localStorage.setItem(S,JSON.stringify(e))}catch{}}let T=`dsh.ui-usage-billing.prices`;function te(){try{let e=localStorage.getItem(T);if(e===null)return[];let t=JSON.parse(e);if(t===null)return[];let n=[],r=(e,t)=>{if(typeof t!=`object`||!t)return;let r=t,i=Number(r.input),a=Number(r.cacheHit),o=Number(r.output);if(![i,a,o].every(e=>Number.isFinite(e)&&e>=0))return;let s=r.offPeak,c;if(typeof s==`object`&&s){let e=s,t=Number(e.input),n=Number(e.cacheHit),r=Number(e.output);[t,n,r].every(e=>Number.isFinite(e)&&e>=0)&&(c={input:t,cacheHit:n,output:r})}n.push({key:e,...typeof r.origin==`string`&&r.origin!==``?{origin:r.origin}:{},input:i,cacheHit:a,output:o,...c===void 0?{}:{offPeak:c},...r.currency===`USD`?{currency:`USD`}:{}})};if(Array.isArray(t))for(let e of t){if(typeof e!=`object`||!e)continue;let t=e;typeof t.key==`string`&&t.key!==``&&r(t.key,e)}else if(typeof t==`object`)for(let[e,n]of Object.entries(t))r(e,n);return n}catch{return[]}}function E(e){try{localStorage.setItem(T,JSON.stringify(e))}catch{}}let D={metric:`ttft`},ne=`dsh.ui-usage-billing.perf`;function O(){try{let e=localStorage.getItem(ne);if(e===null)return{...D};let t=JSON.parse(e);return{metric:t.metric===`tps`?`tps`:`ttft`,...Array.isArray(t.models)?{models:t.models.filter(e=>typeof e==`string`)}:{}}}catch{return{...D}}}function k(e){try{localStorage.setItem(ne,JSON.stringify(e))}catch{}}let re=`@kenz1117/dsh-ui-usage-billing/UsageBilling.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(re)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=re,e.textContent=`.KFXqYa_railButton{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);width:36px;height:36px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:8px;flex:none;justify-content:center;align-items:center;padding:0;transition:border-color .16s,color .16s;display:flex}.KFXqYa_railButton:hover,.KFXqYa_railButton:focus-visible{border-color:var(--dsw-static-blue-500);color:var(--dsw-static-blue-500);outline:none}.KFXqYa_railButton svg{stroke-width:2px;width:18px;height:18px}.KFXqYa_trigger{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);width:100%;min-width:0;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;border-radius:14px;align-items:center;gap:10px;padding:9px 12px;transition:border-color .16s,transform .16s,box-shadow .16s;display:flex;position:relative;overflow:hidden;box-shadow:0 1px 2px #0000000a}.KFXqYa_trigger:hover,.KFXqYa_trigger:focus-visible{border-color:var(--dsw-static-blue-500);box-shadow:0 6px 18px -8px color-mix(in srgb, var(--dsw-static-blue-500) 45%, transparent);outline:none;transform:translateY(-1px)}.KFXqYa_triggerIcon{border:1px solid var(--dsw-alias-border-l1);width:32px;height:32px;color:var(--dsw-alias-label-secondary);opacity:.8;border-radius:8px;flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_triggerIcon svg{stroke-width:2px;width:16px;height:16px}.KFXqYa_triggerMain{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.KFXqYa_triggerPrimary{align-items:baseline;gap:5px;min-width:0;display:inline-flex}.KFXqYa_triggerLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:11px;line-height:15px;overflow:hidden}.KFXqYa_triggerYen{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;font-weight:600;line-height:16px}.KFXqYa_triggerMetric{color:var(--dsw-alias-label-primary);letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:20px;font-weight:700;line-height:24px;overflow:hidden}.KFXqYa_triggerSub{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:10px;line-height:14px;overflow:hidden}.KFXqYa_triggerSpark{flex:none;align-items:flex-end;gap:2px;height:20px;display:flex}.KFXqYa_triggerSparkBar,.KFXqYa_triggerSparkHot{background:var(--dsw-static-blue-500);opacity:.6;border-radius:1px 1px 0 0;width:3px}.KFXqYa_triggerSparkHot{opacity:1}.KFXqYa_triggerWrap{flex:180px;min-width:96px;max-width:100%;display:block;position:relative;container:KFXqYa_billing-trigger/inline-size}@container KFXqYa_billing-trigger (width<=200px){.KFXqYa_trigger{gap:6px;padding:8px 10px}.KFXqYa_triggerSpark{display:none}}@container KFXqYa_billing-trigger (width<=170px){.KFXqYa_triggerSub,.KFXqYa_triggerLabel{display:none}}@container KFXqYa_billing-trigger (width<=110px){.KFXqYa_triggerIcon,.KFXqYa_triggerSpark,.KFXqYa_triggerSub,.KFXqYa_triggerLabel{display:none}.KFXqYa_trigger{justify-content:center;padding:8px 6px}}.KFXqYa_triggerPop{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 80%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 72%, transparent);-webkit-backdrop-filter:blur(14px)saturate(1.3);box-shadow:0 12px 32px #00000029, inset 0 1px 0 color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent);opacity:0;pointer-events:none;z-index:10;border-radius:14px;flex-direction:column;gap:5px;padding:10px 12px;transition:opacity .16s,transform .16s;display:flex;position:absolute;bottom:calc(100% + 8px);left:0;right:0;overflow:hidden;transform:translateY(4px)}.KFXqYa_triggerPop:before{content:"";background:linear-gradient(90deg, transparent 0%, var(--dsw-static-amber-500) 30%, var(--dsw-alias-label-primary) 50%, var(--dsw-static-amber-500) 70%, transparent 100%);opacity:.9;pointer-events:none;background-size:200% 100%;height:1.5px;animation:4s ease-in-out infinite KFXqYa_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}.KFXqYa_triggerWrap:hover .KFXqYa_triggerPop,.KFXqYa_triggerWrap:focus-within .KFXqYa_triggerPop{opacity:1;transform:translateY(0)}.KFXqYa_popHead{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.KFXqYa_popTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:700;line-height:18px}.KFXqYa_metricGrid{grid-template-columns:repeat(3,1fr);gap:10px 8px;display:grid}.KFXqYa_metricCell{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_metricLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_metricValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:12px;font-weight:700;line-height:16px}.KFXqYa_metricValuePrimary{color:var(--dsw-static-amber-500)}.KFXqYa_metricValueSuccess{color:var(--dsw-static-green-500)}.KFXqYa_popModel{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:6px;padding-top:10px;display:flex}.KFXqYa_popModelLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_popModelRow{align-items:center;gap:8px;min-width:0;display:flex}.KFXqYa_popDot{border-radius:999px;flex:none;width:6px;height:6px}.KFXqYa_popDotDirect{background:var(--dsw-static-green-500)}.KFXqYa_popDotSub{background:var(--dsw-static-amber-500)}.KFXqYa_popDotNeutral{background:var(--dsw-alias-label-tertiary)}.KFXqYa_popTagPrimary,.KFXqYa_popTagSub{white-space:nowrap;border-radius:5px;flex:none;align-items:center;height:18px;padding:0 6px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_popTagPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.KFXqYa_popTagSub{background:color-mix(in srgb, var(--dsw-static-amber-500) 18%, transparent);color:var(--dsw-static-amber-500)}.KFXqYa_popModelName{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:16px;overflow:hidden}.KFXqYa_popModelStatus{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;white-space:nowrap;margin-left:auto;font-size:11px;font-weight:600;line-height:16px}.KFXqYa_popModelStatusLow{color:var(--dsw-static-red-500)}.KFXqYa_dashboardModal{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:14px;width:min(760px,100vw - 48px);max-height:min(760px,88vh);animation:.18s ease-out KFXqYa_dashboardIn;box-shadow:0 12px 32px -12px #0000002e,0 2px 8px #0000000f}@keyframes KFXqYa_dashboardIn{0%{opacity:0;transform:translateY(8px)scale(.98)}to{opacity:1;transform:none}}div[role=presentation]:has(>.dsh-billing-modal)>div[aria-hidden=true]:first-child{backdrop-filter:blur(8px)saturate(1.25)}.KFXqYa_dashboard{flex-direction:column;width:100%;max-height:min(760px,88vh);display:flex}.KFXqYa_dashboardHead{border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:12px;padding:12px 18px;display:flex}.KFXqYa_dashboardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:600;line-height:20px}.KFXqYa_dashboardSubtitle{color:var(--dsw-alias-label-caption);margin:2px 0 0;font-size:11px;line-height:16px}.KFXqYa_closeButton{border:1px solid var(--dsw-alias-border-l1);width:32px;height:32px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border-radius:8px;flex:none;justify-content:center;align-items:center;transition:background-color .14s,color .14s;display:inline-flex}.KFXqYa_closeButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.KFXqYa_closeButton svg{stroke-width:2px;width:16px;height:16px}.KFXqYa_dashboardBody{flex-direction:column;gap:14px;padding:16px 24px 24px;display:flex;overflow-y:auto}.KFXqYa_modalFooter{border-top:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:16px;padding:8px 18px;font-size:11px;line-height:16px;display:flex}.KFXqYa_tabNav{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;align-items:center;gap:4px;margin:14px 24px 0;padding:4px;display:flex}.KFXqYa_tabButton{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:7px;padding:6px 14px;font-size:13px;font-weight:500;line-height:20px;transition:background-color .16s,color .16s}.KFXqYa_tabButton:hover,.KFXqYa_tabButton:focus-visible{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 62%, transparent);outline:none}.KFXqYa_tabButtonActive,.KFXqYa_tabButtonActive:hover,.KFXqYa_tabButtonActive:focus-visible{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font-weight:600;box-shadow:0 1px 3px #0000001f}.KFXqYa_tabPanel{flex-direction:column;gap:14px;animation:.14s ease-out KFXqYa_tabPanelIn;display:flex}@keyframes KFXqYa_tabPanelIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.KFXqYa_reconcileNotice{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 78%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 62%, transparent);color:var(--dsw-alias-label-secondary);border-radius:10px;align-items:flex-start;gap:10px;padding:10px 12px;font-size:12px;line-height:1.55;display:flex}.KFXqYa_reconcileIcon{color:var(--dsw-alias-label-tertiary);flex:none;margin-top:1px;display:inline-flex}.KFXqYa_reconcileText{flex:1}.KFXqYa_reconcileDismiss{color:var(--dsw-alias-label-tertiary);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:6px;flex:none;padding:2px 8px;font-size:12px;line-height:1.4;transition:color .15s,background-color .15s}.KFXqYa_reconcileDismiss:hover{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent)}.KFXqYa_hero{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;flex-direction:column;gap:12px;padding:14px 16px;display:flex;position:relative;overflow:hidden}.KFXqYa_heroTop{justify-content:space-between;align-items:center;gap:24px;display:flex}.KFXqYa_heroMain{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_heroLabel{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;font-size:10px;font-weight:500;line-height:14px}.KFXqYa_heroReadout{align-items:baseline;gap:4px;display:flex}.KFXqYa_heroCurrency{letter-spacing:-.01em;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:15px;font-weight:600;line-height:20px}.KFXqYa_heroValue{letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:28px;font-weight:650;line-height:34px}.KFXqYa_heroMeta{color:var(--dsw-alias-label-caption);white-space:nowrap;margin-top:2px;font-size:11px;line-height:15px}.KFXqYa_heroGauge{flex:none;width:72px;height:72px;position:relative}.KFXqYa_heroGaugeSvg{width:100%;height:100%;display:block;transform:rotate(-90deg)}.KFXqYa_heroGaugeTrack{fill:none;stroke:var(--dsw-alias-bg-module-platform);stroke-width:7px}.KFXqYa_heroGaugeArc{fill:none;stroke:var(--dsw-static-blue-500);stroke-width:7px;stroke-linecap:round;transition:stroke-dasharray .26s}.KFXqYa_heroGaugeArcOver{stroke:var(--dsw-static-red-500)}.KFXqYa_heroGaugeCenter{flex-direction:column;justify-content:center;align-items:center;gap:1px;display:flex;position:absolute;inset:0}.KFXqYa_heroGaugePct{letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);font-size:14px;font-weight:700;line-height:18px}.KFXqYa_heroGaugePctOver{color:var(--dsw-static-red-500)}.KFXqYa_heroGaugeLabel{color:var(--dsw-alias-label-tertiary);font-size:9px;line-height:12px}.KFXqYa_heroBudget{border-top:1px solid var(--dsw-alias-border-l1);align-items:center;gap:14px;padding-top:14px;display:flex}.KFXqYa_heroBudgetLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px;line-height:16px}.KFXqYa_heroBudgetTrack{background:var(--dsw-alias-border-l1);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.KFXqYa_heroBudgetFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .22s}.KFXqYa_heroBudgetFillOver{background:var(--dsw-static-red-500)}.KFXqYa_heroBudgetValue{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px;line-height:16px}.KFXqYa_heroSide{border-top:1px solid var(--dsw-alias-border-l1);align-items:stretch;padding-top:12px;display:flex}.KFXqYa_heroSideItem{border-left:1px solid var(--dsw-alias-border-l1);flex-direction:column;flex:1;gap:2px;min-width:0;padding-left:14px;display:flex}.KFXqYa_heroSideItem:first-child{border-left:none;padding-left:0}.KFXqYa_heroSideLabel{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;font-size:10px;font-weight:500;line-height:13px}.KFXqYa_heroSideValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;white-space:nowrap;align-items:baseline;gap:6px;font-size:15px;font-weight:600;line-height:20px;display:inline-flex}.KFXqYa_heroSideSpacer{flex:1;display:block}.KFXqYa_delta{font-variant-numeric:tabular-nums;border-radius:999px;align-items:center;gap:2px;margin-left:6px;padding:1px 7px;font-size:10.5px;font-weight:600;line-height:16px;display:inline-flex}.KFXqYa_deltaUp{color:var(--dsw-static-green-500);background:color-mix(in srgb, var(--dsw-static-green-500) 12%, transparent)}.KFXqYa_deltaDown{color:var(--dsw-static-red-500);background:color-mix(in srgb, var(--dsw-static-red-500) 12%, transparent)}.KFXqYa_unpricedHint{border:1px solid color-mix(in srgb, var(--dsw-static-amber-500) 30%, transparent);background:color-mix(in srgb, var(--dsw-static-amber-500) 8%, transparent);color:var(--dsw-static-amber-500);border-radius:8px;align-items:center;padding:8px 12px;font-size:11.5px;font-weight:500;line-height:17px;display:flex}.KFXqYa_kpiGrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;display:grid}.KFXqYa_kpiTile{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;flex-direction:column;gap:2px;padding:10px 12px;transition:border-color .16s;display:flex;position:relative;overflow:hidden}.KFXqYa_kpiTile:hover{border-color:var(--dsw-alias-border-l2)}.KFXqYa_kpiLabel{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.06em;font-size:10px;font-weight:500;line-height:13px}.KFXqYa_kpiValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:16px;font-weight:650;line-height:22px}.KFXqYa_kpiGreen{color:var(--dsw-static-green-500)}.KFXqYa_kpiDetail{color:var(--dsw-alias-label-caption);white-space:nowrap;text-overflow:ellipsis;font-size:10.5px;line-height:14px;overflow:hidden}.KFXqYa_panel{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;flex-direction:column;gap:8px;padding:12px 14px;transition:border-color .16s;display:flex}.KFXqYa_panelHead{justify-content:space-between;align-items:baseline;gap:10px;display:flex}.KFXqYa_panelHeadControls{align-items:center;gap:8px;display:inline-flex}.KFXqYa_panelTitle{letter-spacing:-.005em;color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:600;line-height:20px}.KFXqYa_panelHint{color:var(--dsw-alias-label-caption);white-space:nowrap;font-size:11px;line-height:16px}.KFXqYa_rangeToggle{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:8px;gap:2px;padding:2px;display:inline-flex}.KFXqYa_rangeButton{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:6px;padding:2px 8px;font-size:11px;line-height:16px;transition:background-color .14s,color .14s}.KFXqYa_rangeButtonActive{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);font-weight:600}.KFXqYa_exportBar{justify-content:flex-end;align-items:center;gap:8px;display:flex}.KFXqYa_exportLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:16px}.KFXqYa_exportButton{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:999px;padding:4px 12px;font-size:11.5px;line-height:16px;transition:border-color .16s,color .16s,background-color .16s}.KFXqYa_exportButton:hover,.KFXqYa_exportButton:focus-visible{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);outline:none}.KFXqYa_shareTrack{background:var(--dsw-alias-bg-module-platform);border-radius:999px;height:10px;display:flex;overflow:hidden}.KFXqYa_shareSeg{height:100%;transition:width .2s}.KFXqYa_shareSegPeak{background:var(--dsw-static-blue-500)}.KFXqYa_shareSegOff{background:color-mix(in srgb, var(--dsw-static-blue-500) 25%, var(--dsw-alias-bg-module-platform))}.KFXqYa_shareSegUser{background:var(--dsw-static-blue-500)}.KFXqYa_shareSegAssistant{background:var(--dsw-static-green-500)}.KFXqYa_shareSegTool{background:var(--dsw-static-amber-500)}.KFXqYa_shareLegend{align-items:center;gap:16px;display:flex}.KFXqYa_shareItem{color:var(--dsw-alias-label-secondary);align-items:baseline;gap:6px;font-size:12px;line-height:17px;display:inline-flex}.KFXqYa_bucketCost{align-items:baseline;gap:3px;display:inline-flex}.KFXqYa_bucketOfficial{color:var(--dsw-static-blue-500);font-weight:600}.KFXqYa_bucketSep{color:var(--dsw-alias-label-dimmed)}.KFXqYa_bucketThird{color:var(--dsw-alias-label-secondary)}.KFXqYa_shareDot{border-radius:50%;flex:none;align-self:center;width:8px;height:8px}.KFXqYa_shareValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_budgetInput{width:64px;color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;text-align:right;background:0 0;border:none;padding:0;font-size:12px;line-height:16px}.KFXqYa_budgetInput:focus-visible{outline:none}.KFXqYa_switch{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);cursor:pointer;border-radius:999px;flex:none;width:30px;height:17px;padding:0;transition:background-color .16s,border-color .16s;position:relative}.KFXqYa_switchOn{border-color:var(--dsw-alias-border-l1);background:var(--dsw-alias-label-primary)}.KFXqYa_switchKnob{background:var(--dsw-static-neutral-bluish-00);border-radius:50%;width:11px;height:11px;transition:transform .16s;position:absolute;top:2px;left:2px}.KFXqYa_switchOn .KFXqYa_switchKnob{transform:translate(13px)}.KFXqYa_budgetFillWarn{background:var(--dsw-static-amber-500)}.KFXqYa_budgetFillOver{background:var(--dsw-static-red-500);animation:1.6s ease-in-out infinite KFXqYa_budgetOverPulse}@keyframes KFXqYa_budgetOverPulse{50%{opacity:.55}}.KFXqYa_chartWrap{width:100%;position:relative}.KFXqYa_chartSvg{width:100%;height:auto;display:block}.KFXqYa_chartEmpty{height:140px;color:var(--dsw-alias-label-caption);justify-content:center;align-items:center;font-size:13px;display:flex}.KFXqYa_emptyRow{text-align:center;color:var(--dsw-alias-label-caption);padding:28px 0;font-size:13px}.KFXqYa_chartGrid{stroke:var(--dsw-alias-border-l1);stroke-width:1px}.KFXqYa_chartAxisLabel{fill:var(--dsw-alias-label-tertiary);font-size:10px}.KFXqYa_chartBar{fill:var(--dsw-static-blue-500);opacity:.7}.KFXqYa_chartBar:hover{opacity:1}.KFXqYa_chartStack{stroke:var(--dsw-alias-bg-layer-1);stroke-width:.75px}.KFXqYa_chartStack:hover{opacity:.9}.KFXqYa_chartLine{stroke:var(--dsw-static-blue-500);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.KFXqYa_chartCrosshair{stroke:var(--dsw-alias-label-dimmed);stroke-width:1px;stroke-dasharray:3 3}.KFXqYa_chartTooltip{pointer-events:none;z-index:2;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);box-shadow:none;white-space:nowrap;border-radius:8px;padding:8px 10px;position:absolute;transform:translate(-50%,calc(-100% - 10px))}.KFXqYa_chartTooltipDate{color:var(--dsw-alias-label-primary);margin-bottom:3px;font-size:11px;font-weight:600}.KFXqYa_chartTooltipRow{color:var(--dsw-alias-label-secondary);align-items:center;gap:5px;font-size:11px;line-height:17px;display:flex}.KFXqYa_chartTooltipRow strong{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_chartTooltipHead{justify-content:space-between;align-items:baseline;gap:14px;margin-bottom:3px;display:flex}.KFXqYa_chartTooltipHead .KFXqYa_chartTooltipDate{margin-bottom:0}.KFXqYa_chartTooltipHead strong{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:11px;font-weight:600}.KFXqYa_chartTooltipSplit{justify-content:space-between;gap:14px}.KFXqYa_chartTooltipLabel{align-items:center;gap:5px;display:flex}.KFXqYa_chartTooltipModelDetail{color:var(--dsw-alias-label-caption);font-variant-numeric:tabular-nums;margin:-2px 0 4px 13px;font-size:10.5px;line-height:14px}.KFXqYa_chartBarPlaceholder{fill:color-mix(in srgb, var(--dsw-alias-label-secondary) 30%, transparent)}.KFXqYa_chartLegendLine{background:var(--dsw-static-blue-500);border-radius:2px;width:10px;height:3px;display:inline-block}.KFXqYa_chartLegendBar{background:var(--dsw-static-blue-500);opacity:.5;border-radius:2px;width:7px;height:7px;display:inline-block}.KFXqYa_chartTooltipSwatch{border-radius:3px;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_chartLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-end;gap:14px;margin-top:2px;font-size:11px;display:flex}.KFXqYa_chartLegend span{align-items:center;gap:5px;display:inline-flex}.KFXqYa_chartLegendItem{font:inherit;color:inherit;cursor:pointer;background:0 0;border:none;align-items:center;gap:5px;padding:0;transition:color .12s;display:inline-flex}.KFXqYa_chartLegendItem:hover{color:var(--dsw-alias-label-secondary)}.KFXqYa_chartLegendItemActive{color:var(--dsw-alias-label-primary);font-weight:600}.KFXqYa_perfBar{align-items:center;margin:10px 0 2px;display:flex}.KFXqYa_perfChips{flex-wrap:wrap;gap:6px;margin:6px 0 2px;display:flex}.KFXqYa_perfChip{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:999px;align-items:center;gap:5px;padding:2px 9px;font-size:11px;line-height:16px;transition:border-color .12s,color .12s,opacity .12s;display:inline-flex}.KFXqYa_perfChip:hover{color:var(--dsw-alias-label-primary)}.KFXqYa_perfChipOff{opacity:.45}.KFXqYa_perfChipDot{border-radius:3px;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_chartHoverDot{stroke:var(--dsw-alias-bg-layer-2);stroke-width:1.5px}.KFXqYa_tableScroll{border:1px solid var(--dsw-alias-border-l1);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:12px;overflow:auto}.KFXqYa_ubAlert{border:1px solid color-mix(in srgb, var(--dsw-static-blue-500) 30%, transparent);background:color-mix(in srgb, var(--dsw-static-blue-500) 8%, transparent);border-radius:10px;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;font-size:12px;line-height:17px;display:flex}.KFXqYa_ubAlertLeft{align-items:center;gap:8px;display:inline-flex}.KFXqYa_ubRate{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_ubAlertNote{color:var(--dsw-alias-label-secondary);margin:0}.KFXqYa_ubTag,.KFXqYa_ubTagSuccess,.KFXqYa_ubTagNeutral,.KFXqYa_ubTagAlert,.KFXqYa_ubTagPromo{white-space:nowrap;border-radius:999px;align-items:center;height:18px;padding:0 7px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_ubTagSuccess{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.KFXqYa_ubTagNeutral{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary)}.KFXqYa_ubTagAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.KFXqYa_ubTagPromo{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500);cursor:help}.KFXqYa_ubExtraRow td{opacity:.72;padding-top:2px;padding-bottom:2px;font-size:12px}.KFXqYa_ubExtraName{color:var(--dsw-alias-label-secondary);margin-left:26px}.KFXqYa_ubExtraNote{color:var(--dsw-alias-label-tertiary);margin-left:8px;font-size:10px}.KFXqYa_ubCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:12px;padding:16px 18px;display:flex}.KFXqYa_ubCardHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.KFXqYa_ubCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_ubCardSub{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_ubTablewrap{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;overflow:auto}.KFXqYa_ubTable{border-collapse:collapse;white-space:nowrap;width:100%;font-size:12.5px}.KFXqYa_ubTable th,.KFXqYa_ubTable td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;padding:9px 12px}.KFXqYa_ubTable tbody tr:last-child td{border-bottom:0}.KFXqYa_ubTable thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;font-size:11px;font-weight:600}.KFXqYa_ubModel{align-items:center;gap:8px;display:inline-flex}.KFXqYa_vendorLogo{object-fit:contain;border-radius:4px;flex:none;width:18px;height:18px}.KFXqYa_vendorLetter{color:#fff;border-radius:4px;flex:none;justify-content:center;align-items:center;width:18px;height:18px;font-size:10px;font-weight:600;line-height:1;display:inline-flex}.KFXqYa_ubModelName{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-weight:500;display:inline-flex}.KFXqYa_ubPricepair{flex-wrap:wrap;gap:6px;display:inline-flex}.KFXqYa_ubChipPeak,.KFXqYa_ubChipOff{font-variant-numeric:tabular-nums;border-radius:999px;align-items:center;gap:5px;height:20px;padding:0 8px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_ubChipLabel{font-size:10px;font-weight:600}.KFXqYa_ubChipPeak{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.KFXqYa_ubChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.KFXqYa_ubNotes{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.KFXqYa_ubNotesItem{align-items:baseline;gap:10px;display:flex}.KFXqYa_ubNotesTerm{color:var(--dsw-alias-label-primary);flex:0 0 72px;font-size:12px;font-weight:500}.KFXqYa_ubNotesDesc{min-width:0;color:var(--dsw-alias-label-secondary);flex:1;font-size:12px;line-height:17px}.KFXqYa_ubCardControlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.KFXqYa_ubTagError{white-space:nowrap;background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);height:18px;color:var(--dsw-static-red-500);border-radius:999px;align-items:center;padding:0 7px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_ubStatGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.KFXqYa_ubStatCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:4px;padding:14px 16px;display:flex}.KFXqYa_ubStatLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_ubStatValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:22px;font-weight:700;line-height:28px}.KFXqYa_ubStatDetail{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.KFXqYa_rowlist{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.KFXqYa_rowline{width:100%;min-width:0;color:var(--dsw-alias-label-primary);text-align:left;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:10px;justify-content:space-between;align-items:center;gap:12px;padding:9px 12px;transition:background-color .14s,border-color .14s;display:flex}.KFXqYa_rowline:hover{background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 60%, transparent);border-color:var(--dsw-alias-border-l1)}.KFXqYa_rowlineName{min-width:0;color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:12.5px;font-weight:500;overflow:hidden}.KFXqYa_rowlineRight{font-variant-numeric:tabular-nums;flex:none;align-items:baseline;gap:8px;display:inline-flex}.KFXqYa_rowlineMuted{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_rowlineChev{color:var(--dsw-alias-label-tertiary);font-size:14px}.KFXqYa_rowlineDrillWrap{padding-left:12px}.KFXqYa_rowlineDrill{border-left:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:12px;padding:6px 12px;font-size:12px;display:flex}.KFXqYa_modelTable{border-collapse:collapse;width:100%;font-size:12.5px}.KFXqYa_modelTable th,.KFXqYa_modelTable td th td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;white-space:nowrap;padding:7px 10px}.KFXqYa_modelTable tbody tr:last-child td tbody tr:last-child td{border-bottom:0}.KFXqYa_modelTable thead th thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;background:0 0;font-size:11px;font-weight:600}.KFXqYa_modelTable tbody tr tbody tr{transition:background-color .12s}.KFXqYa_modelTable tbody tr:hover tbody tr:hover{background:0 0}.KFXqYa_modelTable tbody tr.KFXqYa_modelRowFocusable{cursor:pointer}.KFXqYa_modelTable tbody tr.KFXqYa_modelRowActive,.KFXqYa_modelTable tbody tr.KFXqYa_modelRowActive:hover{background:var(--dsw-alias-interactive-bg-hover)}.KFXqYa_numCol{text-align:right;font-variant-numeric:tabular-nums}.KFXqYa_na{color:var(--dsw-alias-label-dimmed)}.KFXqYa_modelCell{align-items:center;gap:8px;display:inline-flex}.KFXqYa_modelDot{border-radius:50%;flex:none;width:9px;height:9px}.KFXqYa_modelName{color:var(--dsw-alias-label-primary);font-weight:500;line-height:16px;display:block}.KFXqYa_modelProvider{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px;display:block}.KFXqYa_siteRow{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:10px;justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;display:flex}.KFXqYa_siteRowName{align-items:center;gap:8px;min-width:0;display:inline-flex}.KFXqYa_siteKindTag{white-space:nowrap;border-radius:999px;flex:none;align-items:center;padding:1px 7px;font-size:10.5px;font-weight:600;line-height:16px;display:inline-flex}.KFXqYa_siteKindSite{color:var(--dsw-static-blue-500);background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent)}.KFXqYa_siteKindDirect{color:var(--dsw-static-green-500);background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent)}.KFXqYa_siteKindUnknown{color:var(--dsw-static-red-500);background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent)}.KFXqYa_siteRowTitle{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:600;line-height:18px;overflow:hidden}.KFXqYa_siteRowMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.KFXqYa_siteRowCost{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:12.5px;font-weight:700;line-height:18px}.KFXqYa_siteRowCalls{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:11.5px;line-height:17px}.KFXqYa_siteRowCallsLow{color:var(--dsw-static-red-500)}.KFXqYa_flatTag{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px}.KFXqYa_healthDot{border-radius:50%;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_healthOk{background:var(--dsw-static-green-500)}.KFXqYa_healthBad{background:var(--dsw-static-red-500)}.KFXqYa_healthIdle{background:var(--dsw-static-neutral-bluish-400)}.KFXqYa_dashboardRight{align-items:center;gap:8px;min-width:0;display:flex}.KFXqYa_healthBadge{white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:3px 9px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_healthBadgeOk{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2)}.KFXqYa_healthBadgeBad{color:var(--dsw-static-red-500);background:var(--dsw-alias-bg-layer-2)}.KFXqYa_planTag{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;align-items:center;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px;display:inline-flex}.KFXqYa_uncataloguedTag{vertical-align:1px;color:var(--dsw-static-amber-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;margin-left:6px;padding:0 6px;font-size:10px;font-weight:600;line-height:16px;display:inline-block}.KFXqYa_estimatedTag{vertical-align:1px;color:var(--dsw-static-blue-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;margin-left:6px;padding:0 6px;font-size:10px;font-weight:600;line-height:16px;display:inline-block}.KFXqYa_feeBar{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;border-radius:999px;flex-wrap:wrap;align-items:center;gap:8px;padding:6px 12px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_feeBar .KFXqYa_feeSep{color:var(--dsw-alias-label-dimmed)}.KFXqYa_feeCount{color:var(--dsw-alias-label-primary);font-weight:600}.KFXqYa_feeSuffix{color:var(--dsw-alias-label-tertiary)}.KFXqYa_feeItem{color:var(--dsw-alias-label-secondary);white-space:nowrap}.KFXqYa_feeNum{color:var(--dsw-alias-label-primary);font-weight:600}.KFXqYa_feeSep{color:var(--dsw-alias-label-tertiary)}.KFXqYa_feeChipPrimary,.KFXqYa_feeChipOff,.KFXqYa_feeChipAlert,.KFXqYa_feeChipError{font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:999px;align-items:center;height:20px;padding:0 8px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_feeChipPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.KFXqYa_feeChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.KFXqYa_feeChipAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.KFXqYa_feeChipError{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500)}.KFXqYa_balanceCell{align-items:center;gap:6px;display:inline-flex;position:relative}.KFXqYa_balanceDaysBadge{border:1px solid var(--dsw-alias-label-caption);background:color-mix(in srgb, var(--dsw-alias-label-caption) 10%, transparent);min-width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:12px;justify-content:center;align-items:center;padding:0 6px;font-size:10.5px;font-weight:600;line-height:1;display:inline-flex}.KFXqYa_balanceDaysBadge:hover{border-color:var(--dsw-alias-label-secondary);background:color-mix(in srgb, var(--dsw-alias-label-caption) 18%, transparent)}.KFXqYa_balanceDaysBadgeLow{color:var(--dsw-static-red-500);border-color:var(--dsw-static-red-500);background:color-mix(in srgb, var(--dsw-static-red-500) 10%, transparent)}.KFXqYa_balanceDetailPop{z-index:20;background:var(--dsw-alias-bg-layer-3);border:1px solid var(--dsw-alias-label-caption);white-space:nowrap;border-radius:8px;flex-direction:column;gap:6px;min-width:180px;padding:8px 10px;display:inline-flex;position:absolute;top:calc(100% + 6px);right:0;box-shadow:0 6px 20px #0000002e}.KFXqYa_balanceDetailHead{justify-content:space-between;align-items:center;gap:12px;display:flex}.KFXqYa_balanceDetailTitle{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600}.KFXqYa_balanceDetailClose{cursor:pointer;color:var(--dsw-alias-label-caption);background:0 0;border:none;font-size:14px;line-height:1}.KFXqYa_balanceDetailClose:hover{color:var(--dsw-alias-label-primary)}.KFXqYa_balanceDetailGrid{flex-direction:column;gap:4px;display:inline-flex}.KFXqYa_balanceDetailRow{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;justify-content:space-between;gap:16px;font-size:11px;line-height:15px;display:flex}.KFXqYa_balanceDetailLabel{color:var(--dsw-alias-label-caption)}.KFXqYa_balanceDetailValue{color:var(--dsw-alias-label-primary);font-weight:500}body[data-zine-mode] .KFXqYa_trigger,body[data-zine-mode] .KFXqYa_triggerPop,body[data-zine-mode] .KFXqYa_railButton{display:none}body[data-zine-mode] .KFXqYa_dashboardHead{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .KFXqYa_headTitleRow{align-items:center;gap:8px;margin-top:4px;display:flex}body[data-zine-mode] .KFXqYa_dashboardTitle{color:#e8ff00;letter-spacing:.04em;text-transform:uppercase;text-shadow:0 0 8px #e8ff0066;font-weight:900}body[data-zine-mode] .KFXqYa_dashboardSubtitle{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px}body[data-zine-mode] .KFXqYa_closeButton{color:#0a0a05;background:#ff2d95;border:1.5px solid #ff2d95;border-radius:0;box-shadow:0 0 10px #ff2d9573}body[data-zine-mode] .KFXqYa_hero{background:#000;border:2.5px solid #e8ff00;border-radius:0;position:relative;box-shadow:0 0 0 1px #0009,0 0 24px #e8ff002e}body[data-zine-mode] .KFXqYa_heroLabel{color:#c9d98a;letter-spacing:.12em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .KFXqYa_heroValue{color:#e8ff00;letter-spacing:-.02em;text-shadow:0 0 12px #e8ff0073;-webkit-text-fill-color:#e8ff00;background:0 0;font-size:38px;font-weight:900}body[data-zine-mode] .KFXqYa_heroMeta{color:#c9d98a;letter-spacing:.06em;text-transform:uppercase;font-size:10.5px}body[data-zine-mode] .KFXqYa_heroSideLabel{color:#c9d98a;letter-spacing:.1em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .KFXqYa_heroSideValue{color:#e8ff00;text-shadow:0 0 6px #e8ff0059}body[data-zine-mode] .KFXqYa_delta{font-weight:900}body[data-zine-mode] .KFXqYa_deltaUp{color:#ff2d95}body[data-zine-mode] .KFXqYa_deltaDown{color:#c9d98a}body[data-zine-mode] .KFXqYa_tabNav{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .KFXqYa_tabButton{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;border-radius:0;font-size:10.5px;font-weight:900}body[data-zine-mode] .KFXqYa_tabButton:hover,body[data-zine-mode] .KFXqYa_tabButton:focus-visible{color:#e8ff00;background:#e8ff001f}body[data-zine-mode] .KFXqYa_tabButtonActive,body[data-zine-mode] .KFXqYa_tabButtonActive:hover,body[data-zine-mode] .KFXqYa_tabButtonActive:focus-visible{color:#0a0a05;background:#e8ff00;box-shadow:0 0 10px #e8ff0073}body[data-zine-mode] .KFXqYa_panel{background:#000;border:2px solid #e8ff00;border-radius:0}body[data-zine-mode] .KFXqYa_trendPanel{position:relative}body[data-zine-mode] .KFXqYa_panelTitle{color:#e8ff00;letter-spacing:.06em;text-transform:uppercase;text-shadow:0 0 6px #e8ff0066;font-weight:900}body[data-zine-mode] .KFXqYa_panelHint{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .KFXqYa_modelTableScroll{background:#000;border:1.5px solid #e8ff0080;border-radius:0}.KFXqYa_currencyToggle{background:var(--dsw-alias-bg-layer-3);border:none;border-radius:8px;align-items:center;gap:2px;margin-right:8px;padding:2px;display:inline-flex}.KFXqYa_currencyButton{color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;background:0 0;border:0;border-radius:6px;padding:4px 8px;font-size:11px;font-weight:700;line-height:1}.KFXqYa_currencyButtonActive{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}.KFXqYa_subscriptionGrid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin-top:10px;display:grid}.KFXqYa_subscriptionCard{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 75%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 62%, transparent);-webkit-backdrop-filter:blur(12px)saturate(1.3);border-radius:12px;padding:12px 14px;transition:border-color .2s,box-shadow .2s;position:relative;overflow:hidden;box-shadow:0 8px 24px #0000001a}.KFXqYa_subscriptionCard:before{content:"";background:linear-gradient(90deg, transparent 0%, var(--dsw-static-amber-500) 30%, var(--dsw-alias-label-primary) 50%, var(--dsw-static-amber-500) 70%, transparent 100%);opacity:.9;pointer-events:none;background-size:200% 100%;height:1.5px;animation:3.6s ease-in-out infinite KFXqYa_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}@keyframes KFXqYa_subscriptionGoldFlow{0%{background-position:200% 0}to{background-position:-200% 0}}.KFXqYa_subscriptionCard:hover{border-color:color-mix(in srgb, var(--dsw-static-amber-500) 55%, var(--dsw-alias-border-l1));box-shadow:0 10px 30px #00000029}.KFXqYa_subscriptionHead{flex-wrap:wrap;align-items:baseline;gap:6px;margin-bottom:8px;display:flex}.KFXqYa_subscriptionName{font-size:13px;font-weight:700}.KFXqYa_subscriptionPlan{color:var(--dsw-alias-label-secondary);font-size:11px}.KFXqYa_subscriptionPlan[data-kind=code],.KFXqYa_subscriptionPlan[data-kind=token]{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-3);border-radius:999px;padding:1px 8px;font-weight:500}.KFXqYa_subscriptionTier{color:var(--dsw-alias-label-secondary);margin-left:6px}.KFXqYa_subscriptionAuto{color:var(--dsw-static-blue-500);background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, var(--dsw-alias-bg-layer-2));border-radius:999px;margin-left:6px;padding:1px 6px;font-size:10px}.KFXqYa_subscriptionStatus{color:var(--dsw-alias-label-secondary);margin-bottom:6px;font-size:11px}.KFXqYa_subscriptionWindow{align-items:center;gap:10px;margin-top:8px;font-size:11px;display:flex}.KFXqYa_subscriptionWindowLabel{color:var(--dsw-alias-label-secondary);flex:0 0 44px}.KFXqYa_subscriptionTrack{background:var(--dsw-alias-bg-layer-3);border-radius:3px;flex:1;height:6px;overflow:hidden}.KFXqYa_subscriptionFill{background:var(--dsw-static-blue-500);border-radius:3px;height:100%;transition:width .2s;display:block}.KFXqYa_subscriptionFillWarn{background:var(--dsw-static-amber-500)}.KFXqYa_subscriptionFillOver{background:var(--dsw-static-red-500)}.KFXqYa_subscriptionMeta{flex-direction:column;flex:none;align-items:flex-end;gap:2px;display:flex}.KFXqYa_subscriptionPct{text-align:right;font-variant-numeric:tabular-nums;flex:none;min-width:52px}.KFXqYa_subscriptionExhausted{color:var(--dsw-static-red-500);min-width:52px;font-weight:600}.KFXqYa_subscriptionReset{color:var(--dsw-alias-label-caption);white-space:nowrap;flex:none;font-size:10px}.KFXqYa_providerGroupList{flex-direction:column;gap:10px;display:flex}.KFXqYa_providerGroup{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;padding:12px 14px}.KFXqYa_providerGroupHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.KFXqYa_providerGroupTitle{align-items:center;gap:7px;min-width:0;display:inline-flex}.KFXqYa_providerGroupName{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px}.KFXqYa_providerGroupMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.KFXqYa_providerGroupBadge{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;align-items:center;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px;display:inline-flex}.KFXqYa_providerGroupBalance{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;align-items:baseline;gap:6px;font-size:12px;line-height:17px;display:inline-flex}.KFXqYa_providerGroupBalanceLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:17px}.KFXqYa_rounds{margin-top:10px}.KFXqYa_roundsBars{align-items:flex-end;gap:3px;height:124px;padding:16px 2px 0;display:flex;overflow-x:auto}.KFXqYa_roundsBarCol{border-radius:5px 5px 0 0;flex-direction:column;flex:1 0 28px;justify-content:flex-end;align-items:stretch;height:100%;display:flex;position:relative}.KFXqYa_roundsBarColPeak{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent)}.KFXqYa_roundsBarColOff{background:var(--dsw-alias-bg-module-platform)}.KFXqYa_roundsBarLabel{text-align:center;color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;max-width:100%;font-size:9px;line-height:1.2;position:absolute;bottom:0;left:0;right:0;overflow:hidden;transform:translateY(-100%)}.KFXqYa_roundsBarWrap{flex:1;align-items:flex-end;min-height:0;display:flex}.KFXqYa_roundsBar{background:var(--dsw-static-blue-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.KFXqYa_roundsBarFlagged{background:var(--dsw-static-red-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.KFXqYa_roundsFlagMark{background:var(--dsw-static-red-500);border-radius:50%;width:7px;height:7px;position:absolute;top:-3px;right:-3px}.KFXqYa_roundsAxis{color:var(--dsw-alias-label-secondary);justify-content:space-between;margin-top:6px;font-size:10px;display:flex}.KFXqYa_roundsEmpty{color:var(--dsw-alias-label-secondary);margin-top:10px;font-size:12px}.KFXqYa_heatmap{margin-top:10px}.KFXqYa_heatmapGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;display:grid}.KFXqYa_heatmapCellEmpty{background:var(--dsw-alias-bg-layer-1);height:30px;color:var(--dsw-alias-label-dimmed);font-variant-numeric:tabular-nums;border-radius:8px;justify-content:center;align-items:center;font-size:11px;display:flex}.KFXqYa_heatmapCell{font-variant-numeric:tabular-nums;cursor:pointer;border:0;border-radius:8px;justify-content:center;align-items:center;height:30px;padding:0;font-size:11px;display:flex}.KFXqYa_heatmapCell[data-level="0"],.KFXqYa_heatmapCell[data-level="1"],.KFXqYa_heatmapCell[data-level="2"]{color:var(--dsw-alias-label-primary)}.KFXqYa_heatmapCell[data-level="3"],.KFXqYa_heatmapCell[data-level="4"]{color:var(--dsw-static-neutral-bluish-00)}.KFXqYa_heatmapFooter{color:var(--dsw-alias-label-secondary);align-items:center;gap:8px;margin-top:10px;font-size:10px;display:flex}.KFXqYa_heatmapLegend{gap:3px;display:inline-flex}.KFXqYa_heatmapLegend i{border-radius:4px;width:14px;height:14px;display:block}.KFXqYa_heatmapHover{font-variant-numeric:tabular-nums;margin-left:auto}.KFXqYa_heatmapRangeSwitch{gap:4px;margin-left:auto;display:inline-flex}.KFXqYa_heatmapRangeButton{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-text-secondary);cursor:pointer;background:0 0;border-radius:6px;padding:2px 8px;font-size:11px;line-height:1.4}.KFXqYa_heatmapRangeButtonActive{color:var(--dsw-alias-text-primary);border-color:currentColor;font-weight:600}.KFXqYa_heatmapYear{flex-direction:column;gap:6px;display:flex}.KFXqYa_heatmapYearBody{align-items:flex-start;gap:6px;display:flex}.KFXqYa_heatmapYearWeekdays{color:var(--dsw-alias-text-tertiary);flex:none;grid-template-rows:repeat(7,11px);gap:3px;padding-top:12px;font-size:9px;line-height:11px;display:grid}.KFXqYa_heatmapYearWeekday{white-space:nowrap;text-align:right;height:11px}.KFXqYa_heatmapYearMonths{min-width:max-content;color:var(--dsw-alias-text-tertiary);grid-template-columns:repeat(52,11px);gap:3px;font-size:9px;line-height:12px;display:grid;overflow:visible}.KFXqYa_heatmapYearMonth{white-space:nowrap;overflow:visible}.KFXqYa_heatmapYearScroll{padding-bottom:2px;overflow-x:auto}.KFXqYa_heatmapYearGrid{grid-template-rows:repeat(7,11px);grid-auto-flow:column;gap:3px;min-width:max-content;display:grid}.KFXqYa_heatmapYearCell{cursor:pointer;border:0;border-radius:2px;width:11px;height:11px;padding:0}.KFXqYa_triggerPopSubscription{width:auto;left:0;right:0}.KFXqYa_floatSub{flex-direction:column;gap:6px;min-width:0;display:flex}.KFXqYa_floatSubHead{flex-wrap:wrap;align-items:baseline;gap:6px;min-width:0;display:flex}.KFXqYa_floatSubName{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:700}.KFXqYa_floatSubPlan{color:var(--dsw-alias-label-secondary);font-size:10px}.KFXqYa_floatSub .KFXqYa_subscriptionWindow{flex-wrap:wrap;gap:4px 10px}.KFXqYa_floatSub .KFXqYa_subscriptionWindowLabel{flex:none}.KFXqYa_floatSub .KFXqYa_subscriptionMeta{min-width:0;max-width:100%}.KFXqYa_floatSub .KFXqYa_subscriptionPct{min-width:0}.KFXqYa_floatSub .KFXqYa_subscriptionReset{white-space:normal;overflow-wrap:anywhere}.KFXqYa_triggerPopEmpty{color:var(--dsw-alias-label-tertiary);padding:2px 0;font-size:11px;line-height:1.5}.KFXqYa_triggerPopSwitcher{justify-content:flex-end;align-items:center;gap:8px;margin-top:2px;display:flex}.KFXqYa_triggerPopSwitchCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:10px}.KFXqYa_floatModeBtn{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 75%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 60%, transparent);color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;border-radius:10px;flex:1;padding:7px 10px;font-size:12px}.KFXqYa_floatModeBtnOn{border-color:var(--dsw-static-blue-500);color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-static-blue-500) 16%, transparent)}.KFXqYa_floatTarget{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:5px;font-size:12px;display:inline-flex}.KFXqYa_floatTargetLabel{color:var(--dsw-alias-label-secondary)}.KFXqYa_staleNotice{color:var(--dsw-static-amber-500);background:color-mix(in srgb, var(--dsw-static-amber-500) 12%, transparent);border:1px solid color-mix(in srgb, var(--dsw-static-amber-500) 30%, transparent);border-radius:10px;align-items:center;gap:6px;margin:0 0 10px;padding:8px 10px;font-size:11px;display:flex}.KFXqYa_plgHead{align-items:flex-start;gap:12px;display:flex}.KFXqYa_plgIcon{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);width:40px;height:40px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_plgTitle{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_plgNameRow{align-items:center;gap:8px;display:flex}.KFXqYa_plgName{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_plgTag{height:18px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-3);white-space:nowrap;border-radius:5px;align-items:center;padding:0 6px;font-size:10px;font-weight:600;display:inline-flex}.KFXqYa_plgDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.KFXqYa_plgGrid{border-top:1px solid var(--dsw-alias-border-l1);grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding-top:12px;display:grid}.KFXqYa_plgItem{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_plgLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_plgVal{color:var(--dsw-alias-label-primary);word-break:break-all;font-size:12px;line-height:17px}.KFXqYa_plgLink{color:var(--dsw-static-blue-500);word-break:break-all;font-size:12px;line-height:17px;text-decoration:none}.KFXqYa_plgLink:hover{text-decoration:underline}.KFXqYa_tokenPanel{flex-direction:column;gap:14px;display:flex}.KFXqYa_tokenModelBar{background:var(--dsw-alias-bg-layer-2);border-radius:999px;height:8px;overflow:hidden}.KFXqYa_tokenModelParts{height:100%;display:flex}.KFXqYa_tokenModelPartIn{background:var(--dsw-static-blue-500)}.KFXqYa_tokenModelPartOut{background:var(--dsw-static-amber-500)}.KFXqYa_tokenModelShareRow{align-items:center;gap:6px;display:inline-flex}@media (width<=640px){.KFXqYa_kpiGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.KFXqYa_hero{gap:14px}.KFXqYa_heroTop{flex-direction:column;align-items:flex-start;gap:12px}.KFXqYa_heroGauge{width:72px;height:72px}.KFXqYa_heroSide{gap:12px}.KFXqYa_heroSideSpacer{display:none}}.KFXqYa_peakCard{z-index:2000;border:1px solid var(--dsw-alias-border-l1);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 82%, transparent);-webkit-backdrop-filter:blur(12px)saturate(1.2);border-radius:12px;flex-direction:column;gap:8px;min-width:280px;max-width:380px;padding:16px;animation:.2s KFXqYa_peakAlertIn;display:flex;position:fixed;box-shadow:0 4px 16px #00000014}.KFXqYa_peakCardCorner{bottom:18px;right:18px}.KFXqYa_peakCardCenter{top:20%;left:50%;transform:translate(-50%)}.KFXqYa_peakCardPeak{color:var(--dsw-static-blue-500)}.KFXqYa_peakCardOff{color:var(--dsw-static-green-500)}.KFXqYa_peakHead{justify-content:space-between;align-items:center;gap:8px;display:flex}.KFXqYa_peakTag{white-space:nowrap;border-radius:6px;align-items:center;gap:6px;height:20px;padding:0 8px;font-size:11px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_peakTagPrimary{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-blue-500)}.KFXqYa_peakTagSuccess{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-green-500)}.KFXqYa_peakDot{border-radius:999px;flex:none;width:6px;height:6px}.KFXqYa_peakDotPrimary{background:var(--dsw-static-blue-500)}.KFXqYa_peakDotSuccess{background:var(--dsw-static-green-500)}.KFXqYa_peakClose{width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;font-size:15px;line-height:1;transition:background-color .14s,color .14s;display:inline-flex}.KFXqYa_peakClose:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2)}.KFXqYa_peakCount{font-variant-numeric:tabular-nums;font-size:28px;font-weight:700;line-height:34px}.KFXqYa_peakCountPrimary{color:var(--dsw-static-blue-500)}.KFXqYa_peakCountSuccess{color:var(--dsw-static-green-500)}.KFXqYa_peakDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:18px}@keyframes KFXqYa_peakAlertIn{0%{opacity:0}to{opacity:1}}.KFXqYa_setCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:12px;padding:16px 18px;display:flex}.KFXqYa_setGrid3,.KFXqYa_setGrid2{gap:10px;display:grid}.KFXqYa_setGrid3{grid-template-columns:repeat(3,minmax(0,1fr))}.KFXqYa_setGrid2{grid-template-columns:repeat(2,minmax(0,1fr))}@media (width<=720px){.KFXqYa_setGrid3,.KFXqYa_setGrid2{grid-template-columns:1fr}}.KFXqYa_setCell{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;flex-direction:column;gap:8px;min-width:0;padding:12px 14px;display:flex}.KFXqYa_setCardHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.KFXqYa_setCardMeta{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_setCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_setCardDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.KFXqYa_ctlCol{flex-direction:column;gap:10px;padding-top:2px;display:flex}.KFXqYa_ctlRow{align-items:center;gap:12px;min-height:28px;display:flex}.KFXqYa_ctlRowStretch{display:flex}.KFXqYa_ctlLabel{color:var(--dsw-alias-label-secondary);flex:0 0 96px;font-size:11px;line-height:16px}.KFXqYa_ctlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.KFXqYa_userPriceRow{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:10px;padding:8px 0;display:flex}.KFXqYa_userPriceCheck{width:14px;height:14px;accent-color:var(--dsw-static-blue-500);flex:none;margin:0}.KFXqYa_userPriceBody{flex-direction:column;flex:1;gap:8px;min-width:0;display:flex}.KFXqYa_userPriceLineMeta{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) auto;align-items:end;gap:8px 10px;display:grid}@media (width<=720px){.KFXqYa_userPriceLineMeta{grid-template-columns:repeat(2,minmax(0,1fr))}}.KFXqYa_userPriceLineMeta .KFXqYa_userPriceInput{box-sizing:border-box;width:100%;min-width:0;max-width:none}.KFXqYa_userPriceBody .KFXqYa_ctlGroup{flex-wrap:nowrap}.KFXqYa_userPriceLineMeta .KFXqYa_userPriceField .KFXqYa_ctlLabel{align-items:flex-end;min-height:30px;display:flex}.KFXqYa_userPricePriceLine{border-left:2px solid var(--dsw-alias-border-l1);flex-wrap:wrap;align-items:center;gap:10px;width:calc(100% - 22px);margin-left:10px;padding:2px 0 6px 12px;display:flex}.KFXqYa_userPricePriceLine>.KFXqYa_ctlLabel{color:var(--dsw-alias-label-secondary);flex:0 0 44px;font-size:11px}.KFXqYa_userPricePriceLine .KFXqYa_userPriceInputNum{box-sizing:border-box;flex:1 1 0;width:auto;min-width:120px;max-width:240px}.KFXqYa_userPriceField{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_userPriceField .KFXqYa_ctlLabel{flex:none;font-size:11px}.KFXqYa_userPriceInput,.KFXqYa_userPriceInputNum{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);min-width:96px;max-width:160px;color:var(--dsw-alias-label-primary);border-radius:6px;padding:4px 8px;font-size:12px;line-height:16px}.KFXqYa_userPriceInputNum{min-width:72px;max-width:88px}.KFXqYa_rdo{color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;align-items:center;gap:6px;font-size:12px;line-height:16px;display:inline-flex}.KFXqYa_rdo input{opacity:0;pointer-events:none;position:absolute}.KFXqYa_rdoDot{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:50%;flex:none;width:14px;height:14px;position:relative}.KFXqYa_rdo input:checked+.KFXqYa_rdoDot{border-color:var(--dsw-static-blue-500)}.KFXqYa_rdo input:checked+.KFXqYa_rdoDot:after{content:"";background:var(--dsw-static-blue-500);border-radius:50%;position:absolute;inset:3px}.KFXqYa_inp{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:6px;align-items:center;gap:4px;padding:2px 6px;display:inline-flex}.KFXqYa_affix{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_prog{background:var(--dsw-alias-bg-module-platform);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.KFXqYa_progFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .2s}.KFXqYa_btn{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:999px;align-items:center;gap:6px;padding:0 12px;font-size:12px;line-height:16px;transition:border-color .16s,color .16s,background-color .16s;display:inline-flex}.KFXqYa_btn:hover{border-color:var(--dsw-static-blue-500);color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-static-blue-500) 12%, var(--dsw-alias-bg-layer-1))}.KFXqYa_modelTable tbody td:not(:first-child) tbody td:not(:first-child){text-align:right;font-family:var(--mono);font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary)}`,document.head.appendChild(e)}var A={setGrid3:`KFXqYa_setGrid3`,plgTag:`KFXqYa_plgTag`,shareSegOff:`KFXqYa_shareSegOff`,deltaDown:`KFXqYa_deltaDown`,modelTable:`KFXqYa_modelTable`,floatSubHead:`KFXqYa_floatSubHead`,tabButton:`KFXqYa_tabButton`,chartBarPlaceholder:`KFXqYa_chartBarPlaceholder`,shareSeg:`KFXqYa_shareSeg`,heroTop:`KFXqYa_heroTop`,ubTagPromo:`KFXqYa_ubTagPromo`,heroMeta:`KFXqYa_heroMeta`,uncataloguedTag:`KFXqYa_uncataloguedTag`,balanceDetailHead:`KFXqYa_balanceDetailHead`,heatmapYearWeekdays:`KFXqYa_heatmapYearWeekdays`,heroGaugeArcOver:`KFXqYa_heroGaugeArcOver`,rowlineDrill:`KFXqYa_rowlineDrill`,ubStatGrid:`KFXqYa_ubStatGrid`,bucketThird:`KFXqYa_bucketThird`,heroSideSpacer:`KFXqYa_heroSideSpacer`,reconcileDismiss:`KFXqYa_reconcileDismiss`,budgetFillWarn:`KFXqYa_budgetFillWarn`,vendorLogo:`KFXqYa_vendorLogo`,tableScroll:`KFXqYa_tableScroll`,siteRow:`KFXqYa_siteRow`,providerGroupHead:`KFXqYa_providerGroupHead`,popDotNeutral:`KFXqYa_popDotNeutral`,subscriptionHead:`KFXqYa_subscriptionHead`,shareTrack:`KFXqYa_shareTrack`,heatmapYearBody:`KFXqYa_heatmapYearBody`,heatmapRangeButton:`KFXqYa_heatmapRangeButton`,heroValue:`KFXqYa_heroValue`,heroBudgetFillOver:`KFXqYa_heroBudgetFillOver`,dashboardBody:`KFXqYa_dashboardBody`,currencyButtonActive:`KFXqYa_currencyButtonActive`,subscriptionWindowLabel:`KFXqYa_subscriptionWindowLabel`,providerGroupTitle:`KFXqYa_providerGroupTitle`,roundsBarLabel:`KFXqYa_roundsBarLabel`,peakClose:`KFXqYa_peakClose`,setCardMeta:`KFXqYa_setCardMeta`,modelRowFocusable:`KFXqYa_modelRowFocusable`,userPriceCheck:`KFXqYa_userPriceCheck`,affix:`KFXqYa_affix`,userPricePriceLine:`KFXqYa_userPricePriceLine`,modelName:`KFXqYa_modelName`,budgetInput:`KFXqYa_budgetInput`,feeBar:`KFXqYa_feeBar`,ctlLabel:`KFXqYa_ctlLabel`,heroBudget:`KFXqYa_heroBudget`,ubStatValue:`KFXqYa_ubStatValue`,peakTagSuccess:`KFXqYa_peakTagSuccess`,rangeButtonActive:`KFXqYa_rangeButtonActive`,setCardHead:`KFXqYa_setCardHead`,triggerYen:`KFXqYa_triggerYen`,exportButton:`KFXqYa_exportButton`,feeChipPrimary:`KFXqYa_feeChipPrimary`,heatmapYearScroll:`KFXqYa_heatmapYearScroll`,plgTitle:`KFXqYa_plgTitle`,ubTagNeutral:`KFXqYa_ubTagNeutral`,heatmapHover:`KFXqYa_heatmapHover`,floatTargetLabel:`KFXqYa_floatTargetLabel`,peakCardOff:`KFXqYa_peakCardOff`,heroGauge:`KFXqYa_heroGauge`,providerGroupName:`KFXqYa_providerGroupName`,ctlRowStretch:`KFXqYa_ctlRowStretch`,userPriceInput:`KFXqYa_userPriceInput`,triggerLabel:`KFXqYa_triggerLabel`,heroBudgetTrack:`KFXqYa_heroBudgetTrack`,budgetOverPulse:`KFXqYa_budgetOverPulse`,perfChips:`KFXqYa_perfChips`,ubAlertNote:`KFXqYa_ubAlertNote`,peakCountPrimary:`KFXqYa_peakCountPrimary`,chartWrap:`KFXqYa_chartWrap`,heroGaugeTrack:`KFXqYa_heroGaugeTrack`,peakCard:`KFXqYa_peakCard`,feeChipAlert:`KFXqYa_feeChipAlert`,chartHoverDot:`KFXqYa_chartHoverDot`,heatmapFooter:`KFXqYa_heatmapFooter`,popModelStatus:`KFXqYa_popModelStatus`,ubNotesItem:`KFXqYa_ubNotesItem`,triggerPop:`KFXqYa_triggerPop`,heroSideItem:`KFXqYa_heroSideItem`,subscriptionCard:`KFXqYa_subscriptionCard`,ubTag:`KFXqYa_ubTag`,bucketCost:`KFXqYa_bucketCost`,ubChipLabel:`KFXqYa_ubChipLabel`,plgItem:`KFXqYa_plgItem`,ubStatDetail:`KFXqYa_ubStatDetail`,tokenModelParts:`KFXqYa_tokenModelParts`,userPriceRow:`KFXqYa_userPriceRow`,unpricedHint:`KFXqYa_unpricedHint`,peakDotPrimary:`KFXqYa_peakDotPrimary`,chartTooltipRow:`KFXqYa_chartTooltipRow`,ubNotes:`KFXqYa_ubNotes`,siteKindTag:`KFXqYa_siteKindTag`,subscriptionAuto:`KFXqYa_subscriptionAuto`,userPriceLineMeta:`KFXqYa_userPriceLineMeta`,userPriceInputNum:`KFXqYa_userPriceInputNum`,userPriceBody:`KFXqYa_userPriceBody`,closeButton:`KFXqYa_closeButton`,dashboardSubtitle:`KFXqYa_dashboardSubtitle`,balanceDaysBadge:`KFXqYa_balanceDaysBadge`,dashboardIn:`KFXqYa_dashboardIn`,setGrid2:`KFXqYa_setGrid2`,ubExtraNote:`KFXqYa_ubExtraNote`,popTitle:`KFXqYa_popTitle`,kpiGrid:`KFXqYa_kpiGrid`,rangeToggle:`KFXqYa_rangeToggle`,metricValuePrimary:`KFXqYa_metricValuePrimary`,switchOn:`KFXqYa_switchOn`,metricValueSuccess:`KFXqYa_metricValueSuccess`,siteKindSite:`KFXqYa_siteKindSite`,feeChipOff:`KFXqYa_feeChipOff`,heroSideValue:`KFXqYa_heroSideValue`,heroGaugePctOver:`KFXqYa_heroGaugePctOver`,dashboard:`KFXqYa_dashboard`,na:`KFXqYa_na`,chartCrosshair:`KFXqYa_chartCrosshair`,balanceDaysBadgeLow:`KFXqYa_balanceDaysBadgeLow`,heatmapCell:`KFXqYa_heatmapCell`,peakHead:`KFXqYa_peakHead`,chartBar:`KFXqYa_chartBar`,subscriptionFillWarn:`KFXqYa_subscriptionFillWarn`,ubRate:`KFXqYa_ubRate`,subscriptionExhausted:`KFXqYa_subscriptionExhausted`,heatmapGrid:`KFXqYa_heatmapGrid`,healthIdle:`KFXqYa_healthIdle`,ubCardTitle:`KFXqYa_ubCardTitle`,triggerIcon:`KFXqYa_triggerIcon`,tabButtonActive:`KFXqYa_tabButtonActive`,roundsBarColOff:`KFXqYa_roundsBarColOff`,subscriptionStatus:`KFXqYa_subscriptionStatus`,popDotSub:`KFXqYa_popDotSub`,heroBudgetFill:`KFXqYa_heroBudgetFill`,roundsBar:`KFXqYa_roundsBar`,balanceDetailGrid:`KFXqYa_balanceDetailGrid`,panelHead:`KFXqYa_panelHead`,siteRowTitle:`KFXqYa_siteRowTitle`,healthBad:`KFXqYa_healthBad`,chartTooltip:`KFXqYa_chartTooltip`,rdo:`KFXqYa_rdo`,progFill:`KFXqYa_progFill`,kpiTile:`KFXqYa_kpiTile`,heroGaugeSvg:`KFXqYa_heroGaugeSvg`,healthBadgeBad:`KFXqYa_healthBadgeBad`,switchKnob:`KFXqYa_switchKnob`,ubModelName:`KFXqYa_ubModelName`,tabNav:`KFXqYa_tabNav`,modelTableScroll:`KFXqYa_modelTableScroll`,ubCardHead:`KFXqYa_ubCardHead`,ubAlertLeft:`KFXqYa_ubAlertLeft`,heroGaugeLabel:`KFXqYa_heroGaugeLabel`,feeItem:`KFXqYa_feeItem`,heatmapRangeSwitch:`KFXqYa_heatmapRangeSwitch`,subscriptionName:`KFXqYa_subscriptionName`,chartEmpty:`KFXqYa_chartEmpty`,modelDot:`KFXqYa_modelDot`,balanceDetailRow:`KFXqYa_balanceDetailRow`,staleNotice:`KFXqYa_staleNotice`,reconcileIcon:`KFXqYa_reconcileIcon`,heroMain:`KFXqYa_heroMain`,siteRowCallsLow:`KFXqYa_siteRowCallsLow`,modalFooter:`KFXqYa_modalFooter`,modelRowActive:`KFXqYa_modelRowActive`,peakDotSuccess:`KFXqYa_peakDotSuccess`,rdoDot:`KFXqYa_rdoDot`,subscriptionFill:`KFXqYa_subscriptionFill`,triggerPopSubscription:`KFXqYa_triggerPopSubscription`,heatmapYearMonth:`KFXqYa_heatmapYearMonth`,siteRowCost:`KFXqYa_siteRowCost`,siteKindDirect:`KFXqYa_siteKindDirect`,plgVal:`KFXqYa_plgVal`,plgIcon:`KFXqYa_plgIcon`,heatmapRangeButtonActive:`KFXqYa_heatmapRangeButtonActive`,heroGaugeCenter:`KFXqYa_heroGaugeCenter`,heroBudgetValue:`KFXqYa_heroBudgetValue`,ubAlert:`KFXqYa_ubAlert`,chartTooltipLabel:`KFXqYa_chartTooltipLabel`,siteKindUnknown:`KFXqYa_siteKindUnknown`,popHead:`KFXqYa_popHead`,reconcileNotice:`KFXqYa_reconcileNotice`,ubChipPeak:`KFXqYa_ubChipPeak`,chartTooltipSwatch:`KFXqYa_chartTooltipSwatch`,ubTagSuccess:`KFXqYa_ubTagSuccess`,trendPanel:`KFXqYa_trendPanel`,heroSideLabel:`KFXqYa_heroSideLabel`,kpiDetail:`KFXqYa_kpiDetail`,heroGaugeArc:`KFXqYa_heroGaugeArc`,triggerMain:`KFXqYa_triggerMain`,popDot:`KFXqYa_popDot`,popTagPrimary:`KFXqYa_popTagPrimary`,subscriptionPct:`KFXqYa_subscriptionPct`,shareSegTool:`KFXqYa_shareSegTool`,triggerPopEmpty:`KFXqYa_triggerPopEmpty`,ubNotesDesc:`KFXqYa_ubNotesDesc`,setCell:`KFXqYa_setCell`,heroReadout:`KFXqYa_heroReadout`,rowlineRight:`KFXqYa_rowlineRight`,chartGrid:`KFXqYa_chartGrid`,estimatedTag:`KFXqYa_estimatedTag`,heroSide:`KFXqYa_heroSide`,siteRowMeta:`KFXqYa_siteRowMeta`,chartLegendItem:`KFXqYa_chartLegendItem`,feeChipError:`KFXqYa_feeChipError`,balanceDetailTitle:`KFXqYa_balanceDetailTitle`,heatmapLegend:`KFXqYa_heatmapLegend`,heatmapYear:`KFXqYa_heatmapYear`,switch:`KFXqYa_switch`,feeCount:`KFXqYa_feeCount`,heatmapYearMonths:`KFXqYa_heatmapYearMonths`,plgLink:`KFXqYa_plgLink`,inp:`KFXqYa_inp`,subscriptionWindow:`KFXqYa_subscriptionWindow`,providerGroupBadge:`KFXqYa_providerGroupBadge`,triggerSpark:`KFXqYa_triggerSpark`,balanceDetailValue:`KFXqYa_balanceDetailValue`,rowlineChev:`KFXqYa_rowlineChev`,subscriptionGrid:`KFXqYa_subscriptionGrid`,heatmapYearWeekday:`KFXqYa_heatmapYearWeekday`,ubCardSub:`KFXqYa_ubCardSub`,panel:`KFXqYa_panel`,popDotDirect:`KFXqYa_popDotDirect`,plgGrid:`KFXqYa_plgGrid`,chartStack:`KFXqYa_chartStack`,roundsAxis:`KFXqYa_roundsAxis`,tokenModelPartOut:`KFXqYa_tokenModelPartOut`,heatmapYearCell:`KFXqYa_heatmapYearCell`,chartTooltipHead:`KFXqYa_chartTooltipHead`,shareSegUser:`KFXqYa_shareSegUser`,providerGroupMeta:`KFXqYa_providerGroupMeta`,providerGroupBalance:`KFXqYa_providerGroupBalance`,popTagSub:`KFXqYa_popTagSub`,healthOk:`KFXqYa_healthOk`,subscriptionPlan:`KFXqYa_subscriptionPlan`,peakDesc:`KFXqYa_peakDesc`,popModelLabel:`KFXqYa_popModelLabel`,triggerSub:`KFXqYa_triggerSub`,floatModeBtn:`KFXqYa_floatModeBtn`,exportLabel:`KFXqYa_exportLabel`,subscriptionTier:`KFXqYa_subscriptionTier`,dashboardRight:`KFXqYa_dashboardRight`,btn:`KFXqYa_btn`,triggerSparkHot:`KFXqYa_triggerSparkHot`,perfChipDot:`KFXqYa_perfChipDot`,ubStatCard:`KFXqYa_ubStatCard`,heroGaugePct:`KFXqYa_heroGaugePct`,plgHead:`KFXqYa_plgHead`,numCol:`KFXqYa_numCol`,peakCardCorner:`KFXqYa_peakCardCorner`,shareSegPeak:`KFXqYa_shareSegPeak`,"billing-trigger":`KFXqYa_billing-trigger`,currencyButton:`KFXqYa_currencyButton`,providerGroupBalanceLabel:`KFXqYa_providerGroupBalanceLabel`,heatmap:`KFXqYa_heatmap`,subscriptionMeta:`KFXqYa_subscriptionMeta`,currencyToggle:`KFXqYa_currencyToggle`,rowlist:`KFXqYa_rowlist`,triggerWrap:`KFXqYa_triggerWrap`,metricLabel:`KFXqYa_metricLabel`,roundsBars:`KFXqYa_roundsBars`,ubTagError:`KFXqYa_ubTagError`,panelHeadControls:`KFXqYa_panelHeadControls`,ubTablewrap:`KFXqYa_ubTablewrap`,floatTarget:`KFXqYa_floatTarget`,plgName:`KFXqYa_plgName`,heroCurrency:`KFXqYa_heroCurrency`,roundsBarColPeak:`KFXqYa_roundsBarColPeak`,roundsBarCol:`KFXqYa_roundsBarCol`,panelTitle:`KFXqYa_panelTitle`,chartSvg:`KFXqYa_chartSvg`,perfChipOff:`KFXqYa_perfChipOff`,tokenModelPartIn:`KFXqYa_tokenModelPartIn`,panelHint:`KFXqYa_panelHint`,shareSegAssistant:`KFXqYa_shareSegAssistant`,chartAxisLabel:`KFXqYa_chartAxisLabel`,healthBadge:`KFXqYa_healthBadge`,setCardDesc:`KFXqYa_setCardDesc`,dashboardHead:`KFXqYa_dashboardHead`,ctlGroup:`KFXqYa_ctlGroup`,shareItem:`KFXqYa_shareItem`,popModel:`KFXqYa_popModel`,ubCardControlGroup:`KFXqYa_ubCardControlGroup`,kpiGreen:`KFXqYa_kpiGreen`,modelCell:`KFXqYa_modelCell`,popModelStatusLow:`KFXqYa_popModelStatusLow`,peakCardPeak:`KFXqYa_peakCardPeak`,setCardTitle:`KFXqYa_setCardTitle`,reconcileText:`KFXqYa_reconcileText`,tokenPanel:`KFXqYa_tokenPanel`,vendorLetter:`KFXqYa_vendorLetter`,tokenModelBar:`KFXqYa_tokenModelBar`,rowlineMuted:`KFXqYa_rowlineMuted`,triggerPopSwitchCount:`KFXqYa_triggerPopSwitchCount`,shareDot:`KFXqYa_shareDot`,chartTooltipModelDetail:`KFXqYa_chartTooltipModelDetail`,chartTooltipDate:`KFXqYa_chartTooltipDate`,feeNum:`KFXqYa_feeNum`,perfBar:`KFXqYa_perfBar`,ubExtraRow:`KFXqYa_ubExtraRow`,roundsBarFlagged:`KFXqYa_roundsBarFlagged`,heatmapCellEmpty:`KFXqYa_heatmapCellEmpty`,floatSubName:`KFXqYa_floatSubName`,rowlineDrillWrap:`KFXqYa_rowlineDrillWrap`,setCard:`KFXqYa_setCard`,feeSuffix:`KFXqYa_feeSuffix`,rangeButton:`KFXqYa_rangeButton`,bucketOfficial:`KFXqYa_bucketOfficial`,hero:`KFXqYa_hero`,siteRowName:`KFXqYa_siteRowName`,metricGrid:`KFXqYa_metricGrid`,roundsFlagMark:`KFXqYa_roundsFlagMark`,siteRowCalls:`KFXqYa_siteRowCalls`,rowline:`KFXqYa_rowline`,triggerPrimary:`KFXqYa_triggerPrimary`,peakDot:`KFXqYa_peakDot`,floatSub:`KFXqYa_floatSub`,ubModel:`KFXqYa_ubModel`,peakCount:`KFXqYa_peakCount`,roundsBarWrap:`KFXqYa_roundsBarWrap`,chartLine:`KFXqYa_chartLine`,subscriptionFillOver:`KFXqYa_subscriptionFillOver`,plgNameRow:`KFXqYa_plgNameRow`,heroLabel:`KFXqYa_heroLabel`,tabPanel:`KFXqYa_tabPanel`,triggerSparkBar:`KFXqYa_triggerSparkBar`,chartLegendBar:`KFXqYa_chartLegendBar`,ubTable:`KFXqYa_ubTable`,trigger:`KFXqYa_trigger`,peakAlertIn:`KFXqYa_peakAlertIn`,peakTagPrimary:`KFXqYa_peakTagPrimary`,tabPanelIn:`KFXqYa_tabPanelIn`,deltaUp:`KFXqYa_deltaUp`,kpiValue:`KFXqYa_kpiValue`,kpiLabel:`KFXqYa_kpiLabel`,emptyRow:`KFXqYa_emptyRow`,perfChip:`KFXqYa_perfChip`,ubCard:`KFXqYa_ubCard`,headTitleRow:`KFXqYa_headTitleRow`,modelProvider:`KFXqYa_modelProvider`,shareValue:`KFXqYa_shareValue`,plgDesc:`KFXqYa_plgDesc`,ubNotesTerm:`KFXqYa_ubNotesTerm`,ctlCol:`KFXqYa_ctlCol`,feeSep:`KFXqYa_feeSep`,heatmapYearGrid:`KFXqYa_heatmapYearGrid`,balanceDetailClose:`KFXqYa_balanceDetailClose`,bucketSep:`KFXqYa_bucketSep`,ubChipOff:`KFXqYa_ubChipOff`,subscriptionReset:`KFXqYa_subscriptionReset`,tokenModelShareRow:`KFXqYa_tokenModelShareRow`,balanceDetailLabel:`KFXqYa_balanceDetailLabel`,popModelName:`KFXqYa_popModelName`,chartLegendLine:`KFXqYa_chartLegendLine`,planTag:`KFXqYa_planTag`,triggerPopSwitcher:`KFXqYa_triggerPopSwitcher`,budgetFillOver:`KFXqYa_budgetFillOver`,rounds:`KFXqYa_rounds`,chartTooltipSplit:`KFXqYa_chartTooltipSplit`,plgLabel:`KFXqYa_plgLabel`,peakTag:`KFXqYa_peakTag`,railButton:`KFXqYa_railButton`,balanceDetailPop:`KFXqYa_balanceDetailPop`,ctlRow:`KFXqYa_ctlRow`,userPriceField:`KFXqYa_userPriceField`,ubStatLabel:`KFXqYa_ubStatLabel`,metricValue:`KFXqYa_metricValue`,dashboardModal:`KFXqYa_dashboardModal`,shareLegend:`KFXqYa_shareLegend`,providerGroupList:`KFXqYa_providerGroupList`,healthDot:`KFXqYa_healthDot`,providerGroup:`KFXqYa_providerGroup`,ubExtraName:`KFXqYa_ubExtraName`,heroBudgetLabel:`KFXqYa_heroBudgetLabel`,subscriptionTrack:`KFXqYa_subscriptionTrack`,healthBadgeOk:`KFXqYa_healthBadgeOk`,balanceCell:`KFXqYa_balanceCell`,roundsEmpty:`KFXqYa_roundsEmpty`,floatSubPlan:`KFXqYa_floatSubPlan`,subscriptionGoldFlow:`KFXqYa_subscriptionGoldFlow`,chartLegend:`KFXqYa_chartLegend`,peakCardCenter:`KFXqYa_peakCardCenter`,floatModeBtnOn:`KFXqYa_floatModeBtnOn`,peakCountSuccess:`KFXqYa_peakCountSuccess`,flatTag:`KFXqYa_flatTag`,dashboardTitle:`KFXqYa_dashboardTitle`,metricCell:`KFXqYa_metricCell`,delta:`KFXqYa_delta`,rowlineName:`KFXqYa_rowlineName`,triggerMetric:`KFXqYa_triggerMetric`,ubTagAlert:`KFXqYa_ubTagAlert`,ubPricepair:`KFXqYa_ubPricepair`,prog:`KFXqYa_prog`,chartLegendItemActive:`KFXqYa_chartLegendItemActive`,exportBar:`KFXqYa_exportBar`,popModelRow:`KFXqYa_popModelRow`};let ie={"opencode-go":{type:`code`,subscription:{amount:10,currency:`USD`,period:`month`},tier:{amount:10,currency:`USD`,periodDays:7,label:`周额度 $30`}},opencode:{type:`code`,subscription:{amount:10,currency:`USD`,period:`month`},tier:{amount:10,currency:`USD`,periodDays:7,label:`周额度 $30`}},"kimi-coding":{type:`code`},"zai-coding-cn":{type:`code`},"zai-coding":{type:`code`},"qwen-token-plan":{type:`code`},"qwen-token-plan-cn":{type:`code`},"xiaomi-token-plan-ams":{type:`code`},"xiaomi-token-plan-cn":{type:`code`},"xiaomi-token-plan-sgp":{type:`code`},"volcengine-token-plan":{type:`code`},"ark-token-plan":{type:`code`},"doubao-token-plan":{type:`code`},minimax:{type:`code`},"minimax-cn":{type:`code`},"minimax-token-plan":{type:`code`},"minimax-token-plan-cn":{type:`code`},"hunyuan-token-plan":{type:`code`},"tencent-token-plan":{type:`code`},"hy-token-plan":{type:`code`},"xinghuo-token-plan":{type:`code`},"xfyun-coding":{type:`code`},"spark-coding":{type:`code`},"huawei-token-plan":{type:`code`},"pangu-token-plan":{type:`code`},"huawei-maas-token-plan":{type:`code`},"volcengine-agent-plan":{type:`code`},"ark-agent-plan":{type:`code`},"baidu-token-plan":{type:`code`},"ernie-token-plan":{type:`code`},"wenxin-token-plan":{type:`code`}},ae={glm:`zai-coding-cn`,bigmodel:`zai-coding-cn`,zhipu:`zai-coding-cn`,zhipuai:`zai-coding-cn`,zai:`zai-coding`,ark:`volcengine-token-plan`,volcengine:`volcengine-token-plan`,doubao:`doubao-token-plan`,moonshot:`kimi-coding`,kimi:`kimi-coding`,xiaomi:`xiaomi-token-plan-cn`,opencode:`opencode-go`};function j(e){return e===``?e:ae[e]??e}function oe(e){let t=ie[j(e)];return t?.type===`code`?t.tier:void 0}let se=[{key:`deepseek-v4-flash`,input:.14,cacheHit:.0028,output:.28},{key:`deepseek-v4-pro`,input:.435,cacheHit:.003625,output:.87},{key:`gpt-5.6-sol`,input:5,cacheHit:.5,output:30},{key:`gpt-5.6-terra`,input:2,cacheHit:.2,output:12},{key:`gpt-5.6-luna`,input:.2,cacheHit:.02,output:1.2},{key:`glm-5.2`,input:1.4,cacheHit:.26,output:4.4},{key:`qwen3.8-max`,input:2,cacheHit:.21,output:6},{key:`kimi-k3`,input:2.82,cacheHit:.28,output:14.08},{key:`grok-4.6`,input:2,cacheHit:.5,output:6},{key:`gemini-2.5-pro`,input:1.25,cacheHit:.125,output:10}],M,N,ce,le,P;function ue(e){let t=/:\/\//.test(e)?e:`https://${e}`;try{return new URL(t).origin}catch{return e.trim().toLowerCase().replace(/\/+$/,``)}}function de(e,t){return ue(e)===ue(t)}function fe(e){P=e.length>0?e:void 0}function pe(){return P}function me(e){return ke(e)}function he(e,t){let n=ge(e,t);if(n!==void 0)return{input:n.input,cacheHit:n.cacheHit,output:n.output,...n.currency===void 0?{}:{currency:n.currency},...n.offPeak===void 0?{}:{offPeak:n.offPeak}}}function ge(e,t){if(P===void 0)return;let n=me(e),r=V(n),i=e=>me(e.key)===n||V(e.key)===r;if(t!==void 0){for(let e of P)if(e.origin!==void 0&&e.origin!==``&&i(e)&&de(e.origin,t))return e}for(let e of P)if((e.origin===void 0||e.origin===``)&&i(e))return e}function _e(e){if(P===void 0)return;let t=me(e),n=V(t);return P.find(e=>e.origin!==void 0&&e.origin!==``&&(me(e.key)===t||V(e.key)===n))}function ve(e){M=typeof e.rate==`number`&&Number.isFinite(e.rate)&&e.rate>0?e.rate:void 0,N=e.prices,ce=e.extraModels}function ye(e){le=e}function be(){return M??6.79}function xe(){return{rate:be(),live:M!==void 0}}let F=.5;function Se(e){return e>=9&&e<12||e>=14&&e<18}function Ce(e){return e==null||!Number.isFinite(e)?`peak`:I(e)?`offPeak`:Se((new Date(e).getUTCHours()+8)%24)?`peak`:`offPeak`}function I(e){let t=new Date(e+288e5).getUTCDay();return t===0||t===6}function L(e){let t=new Date(e+288e5),n=t.getUTCDay(),r=t.getUTCHours()*36e5+t.getUTCMinutes()*6e4+t.getUTCSeconds()*1e3+t.getUTCMilliseconds();return(n===0?1:2)*864e5-r+324e5}let we=[540,720,840,1080];function Te(e){return((e+288e5)%864e5+864e5)%864e5}function R(e){if(I(e))return{tier:`offPeak`,nextSwitchInMs:L(e)};let t=Te(e);for(let n of we){let r=n*6e4;if(t<r)return{tier:Ce(e),nextSwitchInMs:r-t}}let n=we[0]??0;return{tier:Ce(e),nextSwitchInMs:864e5-t+n*6e4}}function z(e,t){let{nextSwitchInMs:n}=R(e);if(n>t)return null;let r=e+n;return{entering:Ce(r),atMs:r}}function B(e){let t=Math.max(1,Math.ceil(e/6e4)),n=Math.floor(t/60),r=t%60;return n>0?`${n}h${String(r).padStart(2,`0`)}m`:`${r}m`}let Ee=[{key:`flash`,name:`DeepSeek V4 Flash`,provider:`DeepSeek`,colorVar:`dsw-static-blue-500`,price:{currency:`CNY`,input:3,cacheHit:.1,output:9,offPeak:{input:1.5,cacheHit:.05,output:4.5}},peakHours:`09:00-12:00 / 14:00-18:00`},{key:`flash-vision-exp`,name:`DeepSeek V4 Flash Vision (Exp)`,provider:`DeepSeek`,colorVar:`dsw-static-blue-500`,price:{currency:`CNY`,input:3,cacheHit:.1,output:9,offPeak:{input:1.5,cacheHit:.05,output:4.5}},peakHours:`09:00-12:00 / 14:00-18:00`},{key:`pro`,name:`DeepSeek V4 Pro`,provider:`DeepSeek`,colorVar:`dsw-static-deepseek-500`,price:{currency:`CNY`,input:9,cacheHit:.3,output:27,offPeak:{input:4.5,cacheHit:.15,output:13.5}},peakHours:`09:00-12:00 / 14:00-18:00`},{key:`glm`,name:`GLM-5.2`,provider:`智谱 AI`,colorVar:`dsw-static-blue-600`,price:{currency:`CNY`,input:8,cacheHit:2,output:28}},{key:`glm-5.3`,name:`GLM-5.3`,provider:`智谱 AI`,colorVar:`dsw-static-blue-500`,price:{currency:`CNY`,input:8,cacheHit:2,output:28}},{key:`glm-5.3-flash`,name:`GLM-5.3-Flash`,provider:`智谱 AI`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:.8,cacheHit:.23,output:2.8},promo:{factor:.5,endsAtMs:Date.UTC(2026,8,8,16,0,0),note:`限时 5 折`}},{key:`glm-4.6`,name:`GLM-4.6`,provider:`智谱 AI`,colorVar:`dsw-static-blue-400`,price:{currency:`CNY`,input:4,cacheHit:.8,output:16}},{key:`glm-4.5-air`,name:`GLM-4.5-Air`,provider:`智谱 AI`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:.8,cacheHit:.16,output:2}},{key:`glm-4.7`,name:`GLM-4.7`,provider:`智谱 AI`,colorVar:`dsw-static-blue-400`,price:{currency:`CNY`,input:4,cacheHit:1,output:16},estimated:!0},{key:`glm-5-turbo`,name:`GLM-5-Turbo`,provider:`智谱 AI`,colorVar:`dsw-static-blue-500`,price:{currency:`CNY`,input:5,cacheHit:1.2,output:22}},{key:`glm-5.1`,name:`GLM-5.1`,provider:`智谱 AI`,colorVar:`dsw-static-blue-600`,price:{currency:`CNY`,input:6,cacheHit:1.2,output:24}},{key:`glm-5v-turbo`,name:`GLM-5V-Turbo`,provider:`智谱 AI`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:5,cacheHit:1.2,output:22}},{key:`qwen-3.8-max`,name:`Qwen3.8 Max`,provider:`阿里通义`,colorVar:`dsw-static-blue-600`,price:{currency:`CNY`,input:12,cacheHit:1.5,output:36},extraRows:[{label:`显式缓存创建`,input:15},{label:`显式缓存命中`,input:1},{label:`Batch File`,input:6,output:18,note:`长期半价`},{label:`Batch Chat`,input:12,output:36,note:`与标准价一致`}]},{key:`qwen-3.8-flash`,name:`Qwen3.8 Flash`,provider:`阿里通义`,colorVar:`dsw-static-blue-400`,price:{currency:`CNY`,input:1,cacheHit:.1,output:3},extraRows:[{label:`显式缓存创建`,input:1.25},{label:`显式缓存命中`,input:.1},{label:`Batch File`,input:.5,output:1.5,note:`长期半价`},{label:`Batch Chat`,input:1,output:3,note:`与标准价一致`}]},{key:`qwen-max`,name:`Qwen3.7-Max`,provider:`阿里通义`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:12,cacheHit:1.2,output:36},promo:{factor:.5,note:`限时 5 折`},extraRows:[{label:`显式缓存创建`,input:15},{label:`显式缓存命中`,input:1.2},{label:`Batch File`,input:6,output:18,note:`长期半价`},{label:`Batch Chat`,input:12,output:36,note:`与标准价一致`}]},{key:`qwen-plus`,name:`Qwen3.5-Plus`,provider:`阿里通义`,colorVar:`dsw-static-blue-500`,price:{currency:`CNY`,input:.8,cacheHit:.08,output:4.8},extraRows:[{label:`显式缓存创建`,input:1},{label:`显式缓存命中`,input:.08},{label:`Batch File`,input:.4,output:2.4,note:`长期半价`},{label:`Batch Chat`,input:.8,output:4.8,note:`与标准价一致`}]},{key:`qwen-flash`,name:`Qwen3.5-Flash`,provider:`阿里通义`,colorVar:`dsw-static-blue-400`,price:{currency:`CNY`,input:.2,cacheHit:.02,output:2},extraRows:[{label:`显式缓存创建`,input:.25},{label:`显式缓存命中`,input:.02}]},{key:`doubao`,name:`Doubao Seed-2.0 Pro`,provider:`字节豆包`,colorVar:`dsw-static-red-500`,price:{currency:`CNY`,input:3.2,cacheHit:.64,output:16}},{key:`doubao-mini`,name:`Doubao Seed-2.0 Mini`,provider:`字节豆包`,colorVar:`dsw-static-red-300`,price:{currency:`CNY`,input:.2,cacheHit:.02,output:2}},{key:`doubao-1.6`,name:`Doubao Seed-1.6`,provider:`字节豆包`,colorVar:`dsw-static-red-400`,price:{currency:`CNY`,input:.8,cacheHit:0,output:8}},{key:`doubao-seed-evolving`,name:`Doubao-Seed-Evolving`,provider:`字节豆包`,colorVar:`dsw-static-red-500`,price:{currency:`CNY`,input:6,cacheHit:1.2,output:30}},{key:`doubao-seed-2.1-pro`,name:`Doubao Seed-2.1 Pro`,provider:`字节豆包`,colorVar:`dsw-static-red-400`,price:{currency:`CNY`,input:6,cacheHit:1.2,output:30}},{key:`doubao-seed-2.1-turbo`,name:`Doubao Seed-2.1 Turbo`,provider:`字节豆包`,colorVar:`dsw-static-red-300`,price:{currency:`CNY`,input:3,cacheHit:.6,output:15}},{key:`kimi`,name:`Kimi K2.7 Code`,provider:`月之暗面`,colorVar:`dsw-static-neutral-bluish-700`,price:{currency:`CNY`,input:6.5,cacheHit:1.3,output:27}},{key:`kimi-k2.7-hs`,name:`Kimi K2.7 Code HighSpeed`,provider:`月之暗面`,colorVar:`dsw-static-neutral-bluish-600`,price:{currency:`CNY`,input:13,cacheHit:2.6,output:54}},{key:`kimi-k2.6`,name:`Kimi K2.6`,provider:`月之暗面`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`CNY`,input:6.5,cacheHit:1.1,output:27}},{key:`kimi-k3`,name:`Kimi K3`,provider:`月之暗面`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`CNY`,input:20,cacheHit:2,output:100}},{key:`mimo-v2.5`,name:`MiMo V2.5`,provider:`小米`,colorVar:`dsw-static-green-400`,price:{currency:`CNY`,input:1,cacheHit:.02,output:2}},{key:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,provider:`小米`,colorVar:`dsw-static-green-400`,price:{currency:`CNY`,input:3,cacheHit:.025,output:6}},{key:`minimax`,name:`MiniMax-M3`,provider:`MiniMax`,colorVar:`dsw-static-amber-500`,price:{currency:`CNY`,input:2.1,cacheHit:.42,output:8.4}},{key:`minimax-m2.7`,name:`MiniMax-M2.7`,provider:`MiniMax`,colorVar:`dsw-static-amber-400`,price:{currency:`CNY`,input:2.1,cacheHit:.42,output:8.4}},{key:`minimax-m2.7-highspeed`,name:`MiniMax-M2.7-highspeed`,provider:`MiniMax`,colorVar:`dsw-static-amber-500`,price:{currency:`CNY`,input:4.2,cacheHit:.42,output:16.8}},{key:`ernie`,name:`ERNIE-5.1`,provider:`百度文心`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:4,cacheHit:.4,output:18}},{key:`hunyuan`,name:`混元 Hy3`,provider:`腾讯混元`,colorVar:`dsw-static-amber-400`,price:{currency:`CNY`,input:1,cacheHit:.25,output:4}},{key:`hunyuan-t1`,name:`混元 T1`,provider:`腾讯混元`,colorVar:`dsw-static-amber-300`,price:{currency:`CNY`,input:1,cacheHit:.1,output:4}},{key:`yi`,name:`Yi-Lightning`,provider:`零一万物`,colorVar:`dsw-static-green-500`,price:{currency:`CNY`,input:.99,cacheHit:.1,output:.99}},{key:`step`,name:`Step 3.7 Flash`,provider:`阶跃星辰`,colorVar:`dsw-static-neutral-bluish-400`,price:{currency:`CNY`,input:1.35,cacheHit:.27,output:8.1}},{key:`spark`,name:`Spark 4.0 Ultra`,provider:`科大讯飞`,colorVar:`dsw-static-green-400`,price:{currency:`CNY`,input:5,cacheHit:.5,output:10},estimated:!0},{key:`sensenova`,name:`SenseNova 6.5`,provider:`商汤`,colorVar:`dsw-static-red-400`,price:{currency:`CNY`,input:4.5,cacheHit:.45,output:9},estimated:!0},{key:`baichuan`,name:`Baichuan M3-Plus`,provider:`百川智能`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`CNY`,input:5,cacheHit:.5,output:9}},{key:`gpt-5.6-sol`,name:`GPT-5.6 Sol`,provider:`OpenAI`,colorVar:`dsw-static-green-500`,price:{currency:`USD`,input:5,cacheHit:.5,output:30}},{key:`gpt-5.6-terra`,name:`GPT-5.6 Terra`,provider:`OpenAI`,colorVar:`dsw-static-green-400`,price:{currency:`USD`,input:2,cacheHit:.2,output:12}},{key:`gpt-5.6-luna`,name:`GPT-5.6 Luna`,provider:`OpenAI`,colorVar:`dsw-static-green-500`,price:{currency:`USD`,input:.2,cacheHit:.02,output:1.2}},{key:`gemini-pro`,name:`Gemini 3.1 Pro`,provider:`Google`,colorVar:`dsw-static-blue-600`,price:{currency:`USD`,input:2,cacheHit:.2,output:12,offPeak:{input:1,cacheHit:.1,output:6}},peakHours:`Standard / Flex`,tierSemantics:`latency`},{key:`gemini-flash`,name:`Gemini 3.6 Flash`,provider:`Google`,colorVar:`dsw-static-blue-400`,price:{currency:`USD`,input:1.5,cacheHit:.15,output:7.5,offPeak:{input:.75,cacheHit:.075,output:3.75}},peakHours:`Standard / Flex`,tierSemantics:`latency`},{key:`grok`,name:`Grok 4.6`,provider:`xAI`,colorVar:`dsw-static-neutral-bluish-700`,price:{currency:`USD`,input:2,cacheHit:.5,output:6}},{key:`grok-4.3`,name:`Grok 4.3`,provider:`xAI`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`USD`,input:1.25,cacheHit:.2,output:2.5}},{key:`llama`,name:`Llama 4 Maverick`,provider:`Meta`,colorVar:`dsw-static-red-500`,price:{currency:`USD`,input:.2,cacheHit:.05,output:.6}},{key:`llama-scout`,name:`Llama 4 Scout`,provider:`Meta`,colorVar:`dsw-static-red-400`,price:{currency:`USD`,input:.1,cacheHit:.025,output:.3}},{key:`claude-opus-4-6`,name:`Claude Opus 4.6`,provider:`Anthropic`,colorVar:`dsw-static-red-500`,price:{currency:`USD`,input:5,cacheHit:.5,output:25}},{key:`claude-sonnet-4-6`,name:`Claude Sonnet 4.6`,provider:`Anthropic`,colorVar:`dsw-static-red-400`,price:{currency:`USD`,input:3,cacheHit:.3,output:15}},{key:`claude-haiku-4-5`,name:`Claude Haiku 4.5`,provider:`Anthropic`,colorVar:`dsw-static-red-300`,price:{currency:`USD`,input:1,cacheHit:.1,output:5}},{key:`claude-opus-5`,name:`Claude Opus 5`,provider:`Anthropic`,colorVar:`dsw-static-red-500`,price:{currency:`USD`,input:5,cacheHit:.5,output:25}},{key:`claude-sonnet-5`,name:`Claude Sonnet 5`,provider:`Anthropic`,colorVar:`dsw-static-red-400`,price:{currency:`USD`,input:2,cacheHit:.2,output:10}},{key:`mistral-large-2512`,name:`Mistral Large 3`,provider:`Mistral AI`,colorVar:`dsw-static-violet-500`,price:{currency:`USD`,input:.5,cacheHit:.05,output:1.5}},{key:`mistral-small-2603`,name:`Mistral Small 4`,provider:`Mistral AI`,colorVar:`dsw-static-violet-400`,price:{currency:`USD`,input:.15,cacheHit:.015,output:.6}},{key:`ministral-8b-latest`,name:`Ministral 8B`,provider:`Mistral AI`,colorVar:`dsw-static-violet-300`,price:{currency:`USD`,input:.1,cacheHit:.01,output:.1}},{key:`command-a-03-2025`,name:`Command A`,provider:`Cohere`,colorVar:`dsw-static-cyan-500`,price:{currency:`USD`,input:2.5,cacheHit:.25,output:10}},{key:`command-r-08-2024`,name:`Command R`,provider:`Cohere`,colorVar:`dsw-static-cyan-400`,price:{currency:`USD`,input:.15,cacheHit:.015,output:.6}},{key:`longcat-2.0`,name:`LongCat 2.0`,provider:`美团`,colorVar:`dsw-static-amber-500`,price:{currency:`CNY`,input:4,cacheHit:.8,output:16},estimated:!0},{key:`minicpm-v-4.5`,name:`MiniCPM-V 4.5`,provider:`面壁智能`,colorVar:`dsw-static-green-500`,price:{currency:`CNY`,input:1,cacheHit:.2,output:4},estimated:!0},{key:`ernie-4.5`,name:`ERNIE-4.5 300B`,provider:`百度文心`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:2,cacheHit:.4,output:8},estimated:!0},{key:`dots-3-note-preview`,name:`Dots3-Note Preview`,provider:`小红书`,colorVar:`dsw-static-red-500`,price:{currency:`CNY`,input:2,cacheHit:.4,output:8},estimated:!0},{key:`qwen3.6-max`,name:`Qwen3.6 Max`,provider:`阿里通义`,colorVar:`dsw-static-orange-500`,price:{currency:`CNY`,input:9,cacheHit:.9,output:54},extraRows:[{label:`显式缓存创建`,input:11.25},{label:`显式缓存命中`,input:.9}]},{key:`qwen3-coder-plus`,name:`Qwen3-Coder Plus`,provider:`阿里通义`,colorVar:`dsw-static-orange-400`,price:{currency:`CNY`,input:4,cacheHit:.8,output:16},extraRows:[{label:`显式缓存创建`,input:5},{label:`显式缓存命中`,input:.4}]},{key:`qwen3-coder`,name:`Qwen3-Coder 480B`,provider:`阿里通义`,colorVar:`dsw-static-orange-300`,price:{currency:`CNY`,input:4,cacheHit:.8,output:16},estimated:!0},{key:`glm-4.5-x`,name:`GLM-4.5-X`,provider:`智谱 AI`,colorVar:`dsw-static-blue-400`,price:{currency:`CNY`,input:4,cacheHit:1,output:16},estimated:!0},{key:`glm-5.2-fast`,name:`GLM-5.2 Fast`,provider:`智谱 AI`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:6,cacheHit:1.2,output:24},estimated:!0},{key:`kimi-k3-fast`,name:`Kimi K3 Fast`,provider:`月之暗面`,colorVar:`dsw-static-cyan-400`,price:{currency:`CNY`,input:20,cacheHit:2,output:100},estimated:!0},{key:`kimi-k2.7-code-fast`,name:`Kimi K2.7 Code Fast`,provider:`月之暗面`,colorVar:`dsw-static-cyan-400`,price:{currency:`CNY`,input:6.5,cacheHit:1.3,output:27},estimated:!0},{key:`kimi-k2.6-fast`,name:`Kimi K2.6 Fast`,provider:`月之暗面`,colorVar:`dsw-static-cyan-300`,price:{currency:`CNY`,input:6.5,cacheHit:1.1,output:27},estimated:!0},{key:`kimi-k2.6-turbo`,name:`Kimi K2.6 Turbo`,provider:`月之暗面`,colorVar:`dsw-static-cyan-300`,price:{currency:`CNY`,input:6.5,cacheHit:1.1,output:27},estimated:!0},{key:`kimi-k2-thinking-turbo`,name:`Kimi K2 Thinking Turbo`,provider:`月之暗面`,colorVar:`dsw-static-cyan-300`,price:{currency:`CNY`,input:8,cacheHit:1,output:58}},{key:`doubao-seed-2.0-code`,name:`Doubao Seed-2.0 Code`,provider:`字节豆包`,colorVar:`dsw-static-red-500`,price:{currency:`CNY`,input:3.2,cacheHit:.64,output:16}},{key:`doubao-seed-2.0-lite`,name:`Doubao Seed-2.0 Lite`,provider:`字节豆包`,colorVar:`dsw-static-red-300`,price:{currency:`CNY`,input:.6,cacheHit:.12,output:3.6}},{key:`other`,name:`其他模型`,provider:`Custom`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`CNY`,input:0,cacheHit:0,cacheMiss:0,output:0}}],De={"deepseek-v4-flash":`flash`,"deepseek-v4-flash-vision-exp":`flash-vision-exp`,"deepseek-v4-pro":`pro`,"glm-5.2":`glm`,"glm-4.5-air":`glm-4.5-air`,"glm-4.5air":`glm-4.5-air`,"glm-4.7":`glm-4.7`,"glm-5-turbo":`glm-5-turbo`,"glm-5.1":`glm-5.1`,"glm-5.3-flash":`glm-5.3-flash`,"glm-5v-turbo":`glm-5v-turbo`,"glm-5v.1":`glm-5v-turbo`,"claude-opus-4-6":`claude-opus-4-6`,"claude-opus-4.6":`claude-opus-4-6`,"claude-sonnet-4-6":`claude-sonnet-4-6`,"claude-sonnet-4.6":`claude-sonnet-4-6`,"claude-haiku-4-5":`claude-haiku-4-5`,"claude-haiku-4.5":`claude-haiku-4-5`,"claude-opus-5":`claude-opus-5`,"claude-sonnet-5":`claude-sonnet-5`,"mistral-large-2512":`mistral-large-2512`,"mistral-large-3":`mistral-large-2512`,"mistral-small-2603":`mistral-small-2603`,"mistral-small-4":`mistral-small-2603`,"ministral-8b-latest":`ministral-8b-latest`,"ministral-8b":`ministral-8b-latest`,"command-a-03-2025":`command-a-03-2025`,"command-a":`command-a-03-2025`,"command-r-08-2024":`command-r-08-2024`,"command-r":`command-r-08-2024`,"longcat-2.0":`longcat-2.0`,"longcat-2":`longcat-2.0`,"minicpm-v-4.5":`minicpm-v-4.5`,"minicpm-v-4.5-thinking":`minicpm-v-4.5`,"ernie-4.5":`ernie-4.5`,"ernie-4.5-300b":`ernie-4.5`,"dots-3-note-preview":`dots-3-note-preview`,"dots-3-note":`dots-3-note-preview`,"dots3-note-preview":`dots-3-note-preview`,"rednote-dots3":`dots-3-note-preview`,"doubao-seed-evolving":`doubao-seed-evolving`,"doubao-seed-evolve":`doubao-seed-evolving`,"doubao-seed-2.1-pro":`doubao-seed-2.1-pro`,"doubao-seed-2.1-pro-290000":`doubao-seed-2.1-pro`,"doubao-seed-2.1-turbo":`doubao-seed-2.1-turbo`,"doubao-seed-2-1-turbo":`doubao-seed-2.1-turbo`,"qwen3.8-max":`qwen-3.8-max`,"qwen3.8-flash":`qwen-3.8-flash`,"qwen3.7-max":`qwen-max`,"qwen3.6-max":`qwen3.6-max`,"qwen3.6-max-preview":`qwen3.6-max`,"qwen3-coder-plus":`qwen3-coder-plus`,"qwen3-coder":`qwen3-coder`,"qwen3-coder-480b":`qwen3-coder`,"glm-4.5-x":`glm-4.5-x`,"glm-4.5x":`glm-4.5-x`,"glm-5.2-fast":`glm-5.2-fast`,"glm-5.2f":`glm-5.2-fast`,"kimi-k3-fast":`kimi-k3-fast`,"kimi-k3f":`kimi-k3-fast`,"kimi-k2.7-code-fast":`kimi-k2.7-code-fast`,"kimi-k2.7-code-f":`kimi-k2.7-code-fast`,"kimi-k2.6-fast":`kimi-k2.6-fast`,"kimi-k2.6-turbo":`kimi-k2.6-turbo`,"kimi-k2-thinking-turbo":`kimi-k2-thinking-turbo`,"doubao-seed-2.0-code":`doubao-seed-2.0-code`,"doubao-seed-2-0-code":`doubao-seed-2.0-code`,"doubao-seed-2.0-lite":`doubao-seed-2.0-lite`,"doubao-seed-2-0-lite":`doubao-seed-2.0-lite`,"qwen-max":`qwen-max`,"hunyuan-t1":`hunyuan-t1`,"step-3.7-flash":`step`,"seed-2.0-mini":`doubao-mini`,k3:`kimi-k3`,"kimi-k3":`kimi-k3`,"minimax-m1":`minimax`,"minimax-m2":`minimax`,"minimax-m3":`minimax`,"minimax-m2.7":`minimax-m2.7`,"minimax-m2.7-highspeed":`minimax-m2.7-highspeed`,"minimax-m2.7-high-speed":`minimax-m2.7-highspeed`,"minimax-m2-7":`minimax-m2.7`,"minimax-m2-7-highspeed":`minimax-m2.7-highspeed`,"minimax-m2-7-high-speed":`minimax-m2.7-highspeed`};function V(e){return String(e).toLowerCase().replace(/\([^)]*\)/g,``).replace(/[^a-z0-9]+/g,``)}let Oe=(()=>{let e=new Map,t=(t,n)=>{let r=V(t);r!==``&&!e.has(r)&&e.set(r,n)};for(let e of Ee)t(e.key,e.key);for(let[e,n]of Object.entries(De))t(e,n);for(let e of se)t(e.key,e.key);return e})();function ke(e){let t=De[e]??e;if(t===e){let t=V(e);if(t!==``){let e=Oe.get(t);if(e!==void 0)return e;let n=(ce??[]).find(e=>V(e.key)===t);if(n!==void 0)return n.key}}return t}function Ae(e){let t=ke(e),n=N?.[t];if(n!==void 0)return n;let r=se.find(e=>e.key.toLowerCase()===t.toLowerCase());if(r!==void 0)return{input:r.input,cacheHit:r.cacheHit,output:r.output}}function je(e){let t=ke(e),n=Ee.find(e=>e.key===t),r=ce?.find(e=>e.key===t),i=n??(r===void 0?(()=>{let e=Ee.at(-1);if(e!==void 0)return e;throw Error(`MODEL_CATALOG must not be empty`)})():Me(r)),a=he(t);if(a!==void 0)return{...i,userPriced:!0,price:{currency:a.currency??`CNY`,input:a.input,cacheHit:a.cacheHit,output:a.output,...a.offPeak===void 0?{}:{offPeak:a.offPeak}}};let o=Ae(t);return o===void 0?i:{...i,price:{currency:`USD`,input:o.input,cacheHit:o.cacheHit,output:o.output}}}function Me(e){return{key:e.key,name:e.name,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:e.price.input,cacheHit:e.price.cacheHit,output:e.price.output}}}function Ne(e,t){let n=e.endsAtMs!==void 0&&t>=e.endsAtMs;return Number.isFinite(t)&&!n&&e.factor>0&&e.factor<1}function Pe(e,t){let{promo:n}=e;if(n===void 0||!Ne(n,t))return e;let r=e=>({input:e.input*n.factor,cacheHit:e.cacheHit*n.factor,...e.cacheMiss===void 0?{}:{cacheMiss:e.cacheMiss*n.factor},output:e.output*n.factor});return{...e,price:{...r(e.price),currency:e.price.currency,...e.price.offPeak===void 0?{}:{offPeak:r(e.price.offPeak)}}}}function Fe(e=Date.now()){let t=[...Ee.map(t=>Pe(t,e))],n=new Set(t.map(e=>e.key.toLowerCase())),r=new Set(t.map(e=>V(e.key)));for(let e of le??[]){let i=e.id.toLowerCase();if((()=>{let t=ke(e.id);return Ee.find(e=>e.key===t)})()!==void 0)continue;let a=V(e.id);if(n.has(i)||a!==``&&r.has(a))continue;let o=(ce??[]).find(e=>V(e.key)===a),s;if(o!==void 0)s=Me(o),e.name!==void 0&&e.name!==``&&(s={...s,name:e.name});else{let t=Ae(i);s=t===void 0?{key:ke(e.id),name:e.name??e.id,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:0,cacheHit:0,output:0},uncatalogued:!0}:{key:i,name:e.name??e.id,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:t.input,cacheHit:t.cacheHit,output:t.output}}}n.add(s.key.toLowerCase()),a!==``&&r.add(a),t.push(s)}return t.map(e=>{let t=he(e.key);return t===void 0?e:{...e,userPriced:!0,price:{currency:t.currency??`CNY`,input:t.input,cacheHit:t.cacheHit,output:t.output}}})}function Ie(e){let t=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return t===``?`#8b95a3`:t}function H(e,t,n){let r=t.cacheMiss>0?t.cacheMiss:Math.max(0,t.input-t.cacheHit),i=Math.min(t.cacheHit,t.input),a=(r*(e.cacheMiss??e.input)+i*e.cacheHit+t.output*e.output)/1e6;return n===`USD`?a*be():a}function Le(e,t,n=F,r=Date.now()){let i=Pe(e,r),a=H(i.price,t,i.price.currency),o=i.price.offPeak===void 0?a:H(i.price.offPeak,t,i.price.currency);return a*n+o*(1-n)}function Re(e){let t=be();return t>0?e/t:e}function U(e,t=`cny`){let n=Number(e);if(!Number.isFinite(n))return t===`cny`?`¥0`:`$0`;let r=t===`cny`?`¥`:`$`;return n<=0?`${r}0`:n>=1e3?`${r}${n.toFixed(0)}`:n>=10?`${r}${n.toFixed(1)}`:n>=.1?`${r}${n.toFixed(2)}`:`${r}${n.toFixed(3)}`}function ze(e,t=`CNY`){return e===0?`免费`:t===`USD`?e>=10?`$${e.toFixed(1)}`:`$${e.toFixed(2)}`:e>=10?`¥${e.toFixed(1)}`:`¥${e.toFixed(2)}`}function Be(e,t,n,r){return r<=0||!Number.isFinite(r)||t===(n===`usd`?`USD`:`CNY`)?e:n===`usd`?e/r:e*r}function W(e){return e>=1e9?`${(e/1e9).toFixed(2)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function Ve(e){let t=Number(e);return Number.isFinite(t)?`${t.toFixed(1)}%`:`0.0%`}let G={top:18,right:40,bottom:26,left:46};function He(e){let[,t,n]=e.split(`-`);return`${Number(t)}/${Number(n)}`}function Ue(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}function K(e,t){let n=[];for(let r=0;r<e;r+=t)n.push(r);return e>0&&n[n.length-1]!==e-1&&n.push(e-1),n}let q={key:`__total__`,name:`总计`,color:``};function We({data:e,models:t=[],currency:n=`cny`,metric:i=`cost`}){let[o,s]=(0,r.useState)(null),c=e=>U(n===`usd`?Re(e):e,n),l=e=>i===`tokens`?Ue(e):c(e),u=e=>i===`tokens`?e.tokens??0:e.cost,d=(0,r.useMemo)(()=>{let n=e.length;if(n===0)return null;let r=680-G.left-G.right,a=220-G.top-G.bottom,o=e=>n===1?G.left+r/2:G.left+r*e/(n-1),s=Math.max(...i===`tokens`?e.map(e=>e.tokens??0):e.map(e=>Math.max(e.cost,Object.values(e.byModel??{}).reduce((e,t)=>e+t,0))),1e-4),c=e=>G.top+a-e/s*a,l=Math.max(...e.map(e=>e.calls),1),d=e=>G.top+a-e/l*a,f=r/n,p=Math.min(18,f*.6);return{n,plotW:r,plotH:a,inner:o,yCost:c,yCalls:d,barW:p,bars:e.flatMap((e,n)=>{let r=o(n)-p/2;if(t.length===0||i===`tokens`)return[{date:e.date,model:q,x:r,base:0,value:u(e),topRounded:!0}];let a=null;for(let n of t)(e.byModel?.[n.key]??0)>0&&(a=n.key);let s=0;return t.map(t=>{let n=e.byModel?.[t.key]??0,i={date:e.date,model:t,x:r,base:s,value:n,topRounded:t.key===a};return s+=n,i})}),costTicks:[0,.25,.5,.75,1].map(e=>s*e).reverse(),callsTicks:[0,.25,.5,.75,1].map(e=>l*e).reverse(),linePath:e.map((e,t)=>{let n=d(e.calls);return`${t===0?`M`:`L`}${o(t)} ${n}`}).join(` `)}},[e,t,i]);if(d===null)return(0,a.jsx)(`div`,{className:A.chartEmpty,children:`暂无趋势数据`});let{n:f,plotW:p,plotH:m,inner:h,yCost:g,yCalls:_,barW:v,bars:y,costTicks:b,callsTicks:x,linePath:S}=d,C=o===null?void 0:e[o],ee=K(f,Math.max(1,Math.ceil(f/8)));return(0,a.jsxs)(`div`,{className:A.chartWrap,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 220`,className:A.chartSvg,role:`img`,"aria-label":`Daily cost by model and total calls`,onMouseLeave:()=>{s(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-G.left)/p,r=Math.round(n*(f-1));s(Math.min(Math.max(r,0),f-1))},children:[b.map((e,t)=>{let n=g(e);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:G.left,x2:680-G.right,y1:n,y2:n,className:A.chartGrid}),(0,a.jsx)(`text`,{x:G.left-8,y:n+3,textAnchor:`end`,className:A.chartAxisLabel,children:l(e)})]},`cost-${t}`)}),y.map(t=>{if(t.value>0)return(0,a.jsx)(`rect`,{x:t.x,y:g(t.base+t.value),width:v,height:g(t.base)-g(t.base+t.value),rx:t.topRounded?2:0,className:t.model.color===``?A.chartBar:A.chartStack,style:t.model.color===``?void 0:{fill:t.model.color}},`${t.date}-${t.model.key}`);let n=e.find(e=>e.date===t.date);return n!==void 0&&n.calls>0&&t.base===0?(0,a.jsx)(`rect`,{x:t.x,y:g(0)-1,width:v,height:1,rx:0,className:A.chartBarPlaceholder},`${t.date}-${t.model.key}-placeholder`):null}),(0,a.jsx)(`path`,{d:S,fill:`none`,className:A.chartLine}),x.map((e,t)=>{let n=_(e);return(0,a.jsx)(`text`,{x:680-G.right+8,y:n+3,textAnchor:`start`,className:A.chartAxisLabel,children:Ue(e)},`calls-${t}`)}),ee.map(t=>{let n=e[t];return n===void 0?null:(0,a.jsx)(`text`,{x:h(t),y:214,textAnchor:`middle`,className:A.chartAxisLabel,children:He(n.date)},n.date)}),o!==null&&(0,a.jsx)(`line`,{x1:h(o),x2:h(o),y1:G.top,y2:G.top+m,className:A.chartCrosshair})]}),C!==void 0&&o!==null&&(0,a.jsxs)(`div`,{className:A.chartTooltip,style:{left:`${h(o)/680*100}%`,top:`${g(C.cost)/220*100}%`},children:[(0,a.jsx)(`div`,{className:A.chartTooltipDate,children:C.date}),i!==`tokens`&&t.filter(e=>(C.byModel?.[e.key]??0)>0).map(e=>(0,a.jsxs)(`div`,{className:A.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:A.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,a.jsx)(`strong`,{children:c(C.byModel?.[e.key]??0)})]},e.key)),(0,a.jsxs)(`div`,{className:A.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:A.chartLegendBar}),`总计 `,(0,a.jsx)(`strong`,{children:i===`tokens`?Ue(C.tokens??0):c(C.cost)})]}),(0,a.jsxs)(`div`,{className:A.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:A.chartLegendLine}),`调用 `,(0,a.jsx)(`strong`,{children:C.calls.toLocaleString()})]})]}),t.length>0&&i!==`tokens`&&(0,a.jsxs)(`div`,{className:A.chartLegend,children:[t.map(e=>(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:A.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key)),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:A.chartLegendLine}),`调用`]})]})]})}let J={top:14,right:42,bottom:22,left:46};function Ge(e){return e.slice(5,13).replace(`T`,` `)}function Ke(e){return String(e>=100?Math.round(e):Number(e.toFixed(1)))}function qe(e,t,n){return t===`ttft`?`${Math.round(e)} ms`:`${e.toFixed(1)} ${n(`perfTpsUnit`)}`}function Je({perf:e,models:t,t:n}){let[i,o]=(0,r.useState)(()=>O()),[s,l]=(0,r.useState)(null),u=e=>{o(e),k(e)},d=e=>t.find(t=>t.key===e)?.color??`#8b95a3`,f=(0,r.useMemo)(()=>e===void 0?[]:Object.entries(e.byModel).map(([e,n])=>({key:e,name:t.find(t=>t.key===e)?.name??e,color:d(e),samples:n.samples,ttftAvg:n.ttftAvg,ttftP50:n.ttftP50,ttftP90:n.ttftP90,...n.ttftMax===void 0?{}:{ttftMax:n.ttftMax},...n.ttftSpikes===void 0?{}:{ttftSpikes:n.ttftSpikes},...n.tpsAvg===void 0?{}:{tpsAvg:n.tpsAvg},latencyAvg:n.latencyAvg,estimatedSamples:n.estimatedSamples})).sort((e,t)=>t.samples-e.samples||t.ttftP90-e.ttftP90),[e,t]),p=(0,r.useMemo)(()=>{if(e===void 0)return[];if(i.models!==void 0){let t=new Set(Object.keys(e.byModel));return i.models.filter(e=>t.has(e))}return f.slice(0,5).map(e=>e.key)},[e,f,i.models]),m=(0,r.useMemo)(()=>{if(e===void 0)return null;let t=Object.keys(e.byHourModel).sort().slice(-48);if(t.length===0)return null;let n=t.length,r=680-J.left-J.right,a=180-J.top-J.bottom,o=e=>n===1?J.left+r/2:J.left+r*e/(n-1),s=new Set(p),c=e=>i.metric===`ttft`?e?.ttftAvg:e?.tpsAvg,l=[],u=0;for(let r of f){if(!s.has(r.key))continue;let i=[];for(let a=0;a<n;a++){let n=t[a];if(n===void 0)continue;let s=c(e.byHourModel[n]?.[r.key]);s===void 0||!Number.isFinite(s)||(i.push({i:a,x:o(a),y:0,v:s}),s>u&&(u=s))}l.push({key:r.key,name:r.name,color:r.color,segments:[],points:i})}let d=l.reduce((e,t)=>e+t.points.length,0);u=Math.max(u,1);let m=e=>J.top+a-e/u*a;for(let e of l){let t=``,n=-2;for(let r of e.points)r.y=m(r.v),t!==``&&r.i!==n+1&&(e.segments.push(t),t=``),t+=`${t===``?`M`:`L`}${r.x} ${r.y} `,n=r.i;t!==``&&e.segments.push(t)}let h=Math.max(1,Math.ceil(n/8)),g=[];for(let e=0;e<n;e+=h)g.push(e);return g[g.length-1]!==n-1&&g.push(n-1),{hourKeys:t,n,plotW:r,plotH:a,inner:o,yOf:m,series:l,ticks:[0,.5,1].map(e=>u*e).reverse(),xTicks:g,totalPoints:d}},[e,f,p,i.metric]);if(e===void 0||f.length===0)return(0,a.jsx)(`div`,{className:A.chartEmpty,"data-testid":`billing-perf-empty`,children:n(`perfEmpty`)});let h=e=>{let t=p.includes(e)?p.filter(t=>t!==e):[...p,e];u({metric:i.metric,models:t})},g=e=>{u({metric:e,...i.models===void 0?{}:{models:i.models}})},_=s===null||m===null?[]:m.series.flatMap(e=>{let t=e.points.find(e=>e.i===s);return t===void 0?[]:[{key:e.key,name:e.name,color:e.color,v:t.v}]});return(0,a.jsxs)(`div`,{"data-testid":`billing-perf-panel`,children:[(0,a.jsx)(`div`,{className:A.tableScroll,"data-testid":`billing-perf-table`,children:(0,a.jsxs)(`table`,{className:A.modelTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:n(`model`)}),(0,a.jsx)(`th`,{className:A.numCol,children:n(`perfSamples`)}),(0,a.jsx)(`th`,{className:A.numCol,children:n(`perfTtft`)}),(0,a.jsx)(`th`,{className:A.numCol,children:n(`perfP50`)}),(0,a.jsx)(`th`,{className:A.numCol,children:n(`perfP90`)}),(0,a.jsx)(`th`,{className:A.numCol,children:n(`perfMax`)}),(0,a.jsx)(`th`,{className:A.numCol,children:n(`perfTps`)}),(0,a.jsx)(`th`,{className:A.numCol,children:n(`perfLatency`)}),(0,a.jsx)(`th`,{className:A.numCol,children:n(`perfEstimated`)})]})}),(0,a.jsx)(`tbody`,{children:f.map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:A.modelCell,children:[(0,a.jsx)(`span`,{className:A.modelDot,style:{background:e.color}}),(0,a.jsx)(`span`,{className:A.modelName,children:e.name})]})}),(0,a.jsx)(`td`,{className:A.numCol,children:e.samples.toLocaleString()}),(0,a.jsxs)(`td`,{className:A.numCol,children:[e.ttftAvg.toFixed(0),` ms`]}),(0,a.jsxs)(`td`,{className:A.numCol,children:[e.ttftP50.toFixed(0),` ms`]}),(0,a.jsxs)(`td`,{className:A.numCol,children:[e.ttftP90.toFixed(0),` ms`]}),(0,a.jsx)(`td`,{className:A.numCol,children:e.ttftMax===void 0?(0,a.jsx)(`span`,{className:A.na,children:`—`}):(0,a.jsxs)(`span`,{children:[e.ttftMax.toFixed(0),` ms`,e.ttftSpikes!==void 0&&e.ttftSpikes>0?` (${e.ttftSpikes}↑)`:``]})}),(0,a.jsx)(`td`,{className:A.numCol,children:e.tpsAvg===void 0?(0,a.jsx)(`span`,{className:A.na,children:`—`}):`${e.tpsAvg.toFixed(1)}`}),(0,a.jsxs)(`td`,{className:A.numCol,children:[e.latencyAvg.toFixed(0),` ms`]}),(0,a.jsx)(`td`,{className:A.numCol,children:e.estimatedSamples>0?e.estimatedSamples:(0,a.jsx)(`span`,{className:A.na,children:`—`})})]},e.key))})]})}),m!==null&&(0,a.jsxs)(`div`,{"data-testid":`billing-perf-hour`,children:[(0,a.jsx)(`div`,{className:A.perfBar,children:(0,a.jsx)(`span`,{className:A.rangeToggle,role:`group`,"aria-label":n(`perfTitle`),children:[`ttft`,`tps`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(A.rangeButton,i.metric===e&&A.rangeButtonActive),"aria-pressed":i.metric===e,"data-testid":`billing-perf-tab-${e}`,onClick:()=>{g(e)},children:e===`ttft`?`${n(`perfTtft`)} (ms)`:`${n(`perfTps`)} (${n(`perfTpsUnit`)})`},e))})}),(0,a.jsxs)(`div`,{className:A.perfChips,role:`group`,"aria-label":n(`model`),children:[(0,a.jsx)(`button`,{type:`button`,className:A.perfChip,"data-testid":`billing-perf-chip-all`,onClick:()=>{u({metric:i.metric,models:f.map(e=>e.key)})},children:n(`perfAll`)}),f.map(e=>{let t=p.includes(e.key);return(0,a.jsxs)(`button`,{type:`button`,className:c(A.perfChip,!t&&A.perfChipOff),style:t?{color:e.color,borderColor:`color-mix(in srgb, ${e.color} 45%, transparent)`}:void 0,"aria-pressed":t,"data-testid":`billing-perf-chip-${e.key}`,onClick:()=>{h(e.key)},children:[(0,a.jsx)(`span`,{className:A.perfChipDot,style:{background:t?e.color:`var(--dsw-alias-label-dimmed)`}}),e.name]},e.key)})]}),m.totalPoints>0?(0,a.jsxs)(`div`,{className:A.chartWrap,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 180`,className:A.chartSvg,role:`img`,"aria-label":`Hourly perf comparison by model`,onMouseLeave:()=>{l(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-J.left)/m.plotW,r=Math.round(n*(m.n-1));l(Math.min(Math.max(r,0),m.n-1))},children:[m.ticks.map((e,t)=>{let n=m.yOf(e);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:J.left,x2:680-J.right,y1:n,y2:n,className:A.chartGrid}),(0,a.jsx)(`text`,{x:J.left-8,y:n+3,textAnchor:`end`,className:A.chartAxisLabel,children:Ke(e)})]},`tick-${t}`)}),m.series.map(e=>e.segments.map((t,n)=>(0,a.jsx)(`path`,{d:t,fill:`none`,className:A.chartLine,style:{stroke:e.color}},`${e.key}-${n}`))),m.xTicks.map(e=>{let t=m.hourKeys[e];return t===void 0?null:(0,a.jsx)(`text`,{x:m.inner(e),y:174,textAnchor:`middle`,className:A.chartAxisLabel,children:Ge(t)},t)}),s!==null&&(0,a.jsx)(`line`,{x1:m.inner(s),x2:m.inner(s),y1:J.top,y2:J.top+m.plotH,className:A.chartCrosshair}),s!==null&&m.series.map(e=>{let t=e.points.find(e=>e.i===s);return t===void 0?null:(0,a.jsx)(`circle`,{cx:t.x,cy:t.y,r:3.5,fill:e.color,className:A.chartHoverDot},`${e.key}-dot`)})]}),s!==null&&_.length>0&&(0,a.jsxs)(`div`,{className:A.chartTooltip,"data-testid":`billing-perf-tooltip`,style:{left:`${m.inner(s)/680*100}%`,top:`${(J.top+m.plotH/2)/180*100}%`},children:[(0,a.jsx)(`div`,{className:A.chartTooltipDate,children:Ge(m.hourKeys[s]??``)}),_.map(e=>(0,a.jsxs)(`div`,{className:A.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:A.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,a.jsx)(`strong`,{children:qe(e.v,i.metric,n)})]},e.key))]})]}):(0,a.jsx)(`div`,{className:A.chartEmpty,"data-testid":`billing-perf-chart-empty`,children:n(`perfChartEmpty`)})]}),m===null&&(0,a.jsx)(`div`,{className:A.chartEmpty,"data-testid":`billing-perf-chart-empty`,children:n(`perfChartEmpty`)})]})}let Ye=`@kenz1117/dsh-ui-usage-billing`,Xe=`kenz1117`;function Ze({t:e,version:t}){return(0,a.jsxs)(`section`,{className:A.setCard,"data-testid":`billing-plugin-info`,children:[(0,a.jsxs)(`div`,{className:A.plgHead,children:[(0,a.jsx)(`span`,{className:A.plgIcon,"aria-hidden":`true`,children:(0,a.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,a.jsx)(`path`,{d:`M10 3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a2 2 0 0 0 4 0V4a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a2 2 0 0 0 4 0 1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0 0 4h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-1a2 2 0 0 0-4 0 1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 0-4H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 4 0z`})})}),(0,a.jsxs)(`div`,{className:A.plgTitle,children:[(0,a.jsxs)(`div`,{className:A.plgNameRow,children:[(0,a.jsx)(`h3`,{className:A.plgName,children:Ye}),(0,a.jsx)(`span`,{className:A.plgTag,children:t===void 0?`—`:`v${t}`})]}),(0,a.jsx)(`p`,{className:A.plgDesc,children:`Usage billing dashboard for DeepSeek Harness`})]})]}),(0,a.jsxs)(`div`,{className:A.plgGrid,children:[(0,a.jsxs)(`div`,{className:A.plgItem,children:[(0,a.jsx)(`span`,{className:A.plgLabel,children:e(`pluginAuthor`)}),(0,a.jsxs)(`a`,{className:A.plgLink,href:`https://github.com/${Xe}`,target:`_blank`,rel:`noreferrer`,children:[`KenZ`,` (`,Xe,`)`]})]}),(0,a.jsxs)(`div`,{className:A.plgItem,children:[(0,a.jsx)(`span`,{className:A.plgLabel,children:e(`pluginRepository`)}),(0,a.jsx)(`a`,{className:A.plgLink,href:`https://github.com/kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:`GitHub`})]}),(0,a.jsxs)(`div`,{className:A.plgItem,children:[(0,a.jsx)(`span`,{className:A.plgLabel,children:e(`pluginNpm`)}),(0,a.jsx)(`a`,{className:A.plgLink,href:`https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:Ye})]}),(0,a.jsxs)(`div`,{className:A.plgItem,children:[(0,a.jsx)(`span`,{className:A.plgLabel,children:e(`pluginLicense`)}),(0,a.jsx)(`span`,{className:A.plgVal,children:`MIT`})]})]})]})}function Qe(e=Date.now()){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function $e(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}let Y={top:14,right:18,bottom:22,left:46},X=`var(--dsw-static-blue-500)`,Z=`#14b8a6`,et=`var(--dsw-static-amber-500)`;function tt(e,t,n,r){return JSON.stringify({days:e,models:t,dayModels:n,total:r},null,2)}function nt(e){let{stats:t,trendDays:n,onTrendDays:i,t:o}=e,s=e.models??[],{byDay:l,byModel:u,total:d}=t,[f,p]=(0,r.useState)(null),[m,h]=(0,r.useState)(`structure`),[g,_]=(0,r.useState)(null),v=t.byDayModels!==void 0,y=e=>{h(e),_(null)},b=(0,r.useMemo)(()=>{let e=[];for(let t=n-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t);let r=Qe(n.getTime()),i=l[r];e.push({date:r,miss:i?.cacheMiss??0,hit:i?.cacheHit??0,output:i?.output??0,reasoning:i?.reasoning??0})}return e},[l,n]),x=(0,r.useMemo)(()=>{let e=[];for(let r=n-1;r>=0;--r){let n=new Date;n.setDate(n.getDate()-r);let i=Qe(n.getTime()),a=t.byDayModels?.[i],o={},s=0;if(a!==void 0)for(let[e,t]of Object.entries(a)){let n=t.cacheHit??0,r=t.cacheMiss??0,i=t.output??0,a=n+r+i;a<=0||(o[e]={hit:n,miss:r,output:i,total:a},s+=a)}e.push({date:i,models:o,total:s})}return e},[t.byDayModels,n]),S=(0,r.useMemo)(()=>{let e=new Map;for(let t of x)for(let[n,r]of Object.entries(t.models))e.set(n,(e.get(n)??0)+r.total);return[...e.entries()].sort((e,t)=>t[1]-e[1]).map(([e])=>({key:e,name:s.find(t=>t.key===e)?.name??je(e).name,color:s.find(t=>t.key===e)?.color??`#8b95a3`}))},[x,s]),C=g!==null&&S.some(e=>e.key===g)?g:null,ee=e=>{if(v){if(m!==`model`){h(`model`),_(e);return}_(t=>t===e?null:e)}},w=(0,r.useMemo)(()=>{let e=0;return Object.entries(u).filter(([,e])=>e.calls>0).map(([t,n])=>{let r=n.input+n.output;e+=r;let i=n.cacheHit+n.cacheMiss;return{key:t,name:je(t).name,input:n.input,output:n.output,reasoning:n.reasoning??0,calls:n.calls,cacheHit:n.cacheHit,cacheMiss:n.cacheMiss,cacheHitRate:i>0?n.cacheHit/i*100:0,total:r,share:0}}).sort((e,t)=>t.total-e.total).map(t=>({...t,share:e>0?t.total/e:0}))},[u]),T=(0,r.useMemo)(()=>{let e=d.cacheHit??0,t=d.cacheMiss??0,n=d.input??0,r=d.output??0,i=d.reasoning??0,a=e+t,o=a>0?e/a*100:0,s=r>0?i/r*100:0,c=r>0?n/r:0,l;for(let e of b){let t=e.miss+e.hit+e.output;(l===void 0||t>l.miss+l.hit+l.output)&&(l=e)}return{cacheHitRate:o,reasoningPct:s,io:c,peak:l,hit:e,miss:t,input:n,output:r,reasoning:i}},[d,b]),te=(0,r.useMemo)(()=>{let e=Object.entries(t.byTool??{}),n=e.slice(0,8),r=e.slice(8).reduce((e,[,t])=>e+t,0),i=e.reduce((e,[,t])=>e+t,0);return{top:n,rest:r>0?[[`…`,r]]:[],totalCalls:i}},[t.byTool]),E=(0,r.useMemo)(()=>{let e=b.length;if(e===0)return null;let t=680-Y.left-Y.right,n=200-Y.top-Y.bottom,r=Math.max(...m===`model`?x.map(e=>e.total):b.map(e=>e.miss+e.hit+e.output),1),i=e=>Y.top+n-e/r*n,a=t/e,o=Math.min(20,a*.6),s=n=>e===1?Y.left+t/2:Y.left+t*n/(e-1),c=Math.max(1,Math.ceil(e/8)),l=[];for(let t=0;t<e;t+=c)l.push(t);return e>0&&l[l.length-1]!==e-1&&l.push(e-1),{n:e,plotW:t,plotH:n,max:r,y:i,barW:o,inner:s,indices:l}},[b,x,m]),D=()=>{let e=new Blob([rt(b)],{type:`text/csv`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`token-daily-${Qe()}.csv`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},ne=()=>{let e=new Blob([tt(b,w,x,d)],{type:`application/json`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`token-${Qe()}.json`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},O=f===null?void 0:b[f],k=f===null?void 0:x[f];return(0,a.jsxs)(`div`,{className:A.tokenPanel,"data-testid":`billing-token-panel`,children:[(0,a.jsxs)(`div`,{className:A.exportBar,role:`group`,"aria-label":o(`tokenExport`),children:[(0,a.jsx)(`span`,{className:A.exportLabel,children:o(`export`)}),(0,a.jsx)(`button`,{type:`button`,className:A.exportButton,"data-testid":`billing-token-export-csv`,onClick:D,children:o(`tokenExportCsv`)}),(0,a.jsx)(`button`,{type:`button`,className:A.exportButton,"data-testid":`billing-token-export-json`,onClick:ne,children:o(`exportJson`)})]}),(0,a.jsxs)(`div`,{className:A.kpiGrid,"data-testid":`billing-token-kpis`,children:[(0,a.jsxs)(`div`,{className:A.kpiTile,children:[(0,a.jsx)(`span`,{className:A.kpiLabel,children:o(`tokenCacheHitRate`)}),(0,a.jsxs)(`span`,{className:A.kpiValue,children:[T.cacheHitRate.toFixed(1),`%`]}),(0,a.jsxs)(`span`,{className:A.kpiDetail,children:[W(T.hit),` / `,W(T.hit+T.miss),(d.cacheWrite??0)>0?` · ${o(`tokenCacheWrite`)} ${W(d.cacheWrite??0)}`:``]})]}),(0,a.jsxs)(`div`,{className:A.kpiTile,children:[(0,a.jsx)(`span`,{className:A.kpiLabel,children:o(`tokenReasoningShare`)}),(0,a.jsxs)(`span`,{className:A.kpiValue,children:[T.reasoningPct.toFixed(1),`%`]}),(0,a.jsx)(`span`,{className:A.kpiDetail,children:W(T.reasoning)})]}),(0,a.jsxs)(`div`,{className:A.kpiTile,children:[(0,a.jsx)(`span`,{className:A.kpiLabel,children:o(`tokenIo`)}),(0,a.jsx)(`span`,{className:A.kpiValue,children:T.io.toFixed(2)}),(0,a.jsxs)(`span`,{className:A.kpiDetail,children:[W(T.input),` / `,W(T.output)]})]}),(0,a.jsxs)(`div`,{className:A.kpiTile,children:[(0,a.jsx)(`span`,{className:A.kpiLabel,children:o(`tokenPeak`)}),(0,a.jsx)(`span`,{className:A.kpiValue,children:T.peak===void 0?`—`:$e(T.peak.miss+T.peak.hit+T.peak.output)}),(0,a.jsx)(`span`,{className:A.kpiDetail,children:T.peak?.date??`—`})]})]}),(0,a.jsxs)(`section`,{className:A.panel,"data-testid":`billing-token-daily`,children:[(0,a.jsxs)(`div`,{className:A.panelHead,children:[(0,a.jsx)(`h3`,{className:A.panelTitle,children:o(`tokenDaily`)}),(0,a.jsxs)(`span`,{className:A.panelHeadControls,children:[v&&(0,a.jsx)(`span`,{className:A.rangeToggle,role:`group`,"aria-label":o(`tokenDaily`),children:[`structure`,`model`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(A.rangeButton,m===e&&A.rangeButtonActive),"aria-pressed":m===e,onClick:()=>{y(e)},"data-testid":`billing-token-view-${e}`,children:o(e===`structure`?`tokenViewStructure`:`tokenViewModel`)},e))}),(0,a.jsx)(`span`,{className:A.rangeToggle,role:`group`,"aria-label":o(`tokenDaily`),children:[7,30].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(A.rangeButton,n===e&&A.rangeButtonActive),"aria-pressed":n===e,onClick:()=>{i(e)},"data-testid":`billing-token-${e}d`,children:o(e===7?`trend7d`:`trend30d`)},e))})]})]}),E===null||m===`model`&&S.length===0?(0,a.jsx)(`div`,{className:A.chartEmpty,children:o(`trendEmpty`)}):(0,a.jsxs)(`div`,{className:A.chartWrap,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 200`,className:A.chartSvg,role:`img`,"aria-label":o(`tokenDaily`),onMouseLeave:()=>{p(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-Y.left)/E.plotW,r=Math.round(n*(E.n-1));p(Math.min(Math.max(r,0),E.n-1))},children:[[0,.5,1].map(e=>{let t=E.max*e,n=E.y(t);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:Y.left,x2:680-Y.right,y1:n,y2:n,className:A.chartGrid}),(0,a.jsx)(`text`,{x:Y.left-8,y:n+3,textAnchor:`end`,className:A.chartAxisLabel,children:$e(t)})]},e)}),m===`structure`?b.map((e,t)=>{let n=E.inner(t)-E.barW/2,r=E.y(0),i=E.y(e.miss),o=E.y(e.miss+e.hit),s=E.y(e.miss+e.hit+e.output);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`rect`,{x:n,y:i,width:E.barW,height:r-i,fill:X}),(0,a.jsx)(`rect`,{x:n,y:o,width:E.barW,height:i-o,fill:Z}),(0,a.jsx)(`rect`,{x:n,y:s,width:E.barW,height:o-s,fill:et})]},e.date)}):x.map((e,t)=>{let n=E.inner(t)-E.barW/2,r=0;return(0,a.jsx)(`g`,{children:S.map(t=>{let i=e.models[t.key];if(i===void 0)return null;let o=E.y(r);r+=i.total;let s=E.y(r),c=C!==null&&t.key!==C;return(0,a.jsx)(`rect`,{x:n,y:s,width:E.barW,height:o-s,fill:t.color,opacity:c?.15:1},t.key)})},e.date)}),E.indices.map(e=>{let t=b[e];return t===void 0?null:(0,a.jsx)(`text`,{x:E.inner(e),y:194,textAnchor:`middle`,className:A.chartAxisLabel,children:t.date.slice(5)},t.date)}),f!==null&&(0,a.jsx)(`line`,{x1:E.inner(f),x2:E.inner(f),y1:Y.top,y2:Y.top+E.plotH,className:A.chartCrosshair})]}),f!==null&&m===`structure`&&O!==void 0&&(0,a.jsxs)(`div`,{className:A.chartTooltip,"data-testid":`billing-token-tooltip`,style:{left:`${E.inner(f)/680*100}%`,top:`${E.y(O.miss+O.hit+O.output)/200*100}%`},children:[(0,a.jsxs)(`div`,{className:A.chartTooltipHead,children:[(0,a.jsx)(`span`,{className:A.chartTooltipDate,children:O.date}),(0,a.jsx)(`strong`,{children:(O.miss+O.hit+O.output).toLocaleString()})]}),(0,a.jsxs)(`div`,{className:c(A.chartTooltipRow,A.chartTooltipSplit),children:[(0,a.jsxs)(`span`,{className:A.chartTooltipLabel,children:[(0,a.jsx)(`span`,{className:A.chartTooltipSwatch,style:{background:Z}}),o(`tokenHit`)]}),(0,a.jsx)(`strong`,{children:O.hit.toLocaleString()})]}),(0,a.jsxs)(`div`,{className:c(A.chartTooltipRow,A.chartTooltipSplit),children:[(0,a.jsxs)(`span`,{className:A.chartTooltipLabel,children:[(0,a.jsx)(`span`,{className:A.chartTooltipSwatch,style:{background:X}}),o(`tokenMiss`)]}),(0,a.jsx)(`strong`,{children:O.miss.toLocaleString()})]}),(0,a.jsxs)(`div`,{className:c(A.chartTooltipRow,A.chartTooltipSplit),children:[(0,a.jsxs)(`span`,{className:A.chartTooltipLabel,children:[(0,a.jsx)(`span`,{className:A.chartTooltipSwatch,style:{background:et}}),o(`tokenOutput`)]}),(0,a.jsx)(`strong`,{children:O.output.toLocaleString()})]})]}),f!==null&&m===`model`&&k!==void 0&&(0,a.jsxs)(`div`,{className:A.chartTooltip,"data-testid":`billing-token-tooltip`,style:{left:`${E.inner(f)/680*100}%`,top:`${E.y(k.total)/200*100}%`},children:[(0,a.jsxs)(`div`,{className:A.chartTooltipHead,children:[(0,a.jsx)(`span`,{className:A.chartTooltipDate,children:k.date}),(0,a.jsx)(`strong`,{children:k.total.toLocaleString()})]}),S.map(e=>{let t=k.models[e.key];return t===void 0?null:(0,a.jsxs)(`div`,{className:A.chartTooltipModel,children:[(0,a.jsxs)(`div`,{className:c(A.chartTooltipRow,A.chartTooltipSplit),children:[(0,a.jsxs)(`span`,{className:A.chartTooltipLabel,children:[(0,a.jsx)(`span`,{className:A.chartTooltipSwatch,style:{background:e.color}}),e.name]}),(0,a.jsx)(`strong`,{children:t.total.toLocaleString()})]}),(0,a.jsxs)(`div`,{className:A.chartTooltipModelDetail,children:[o(`tokenHitShort`),` `,t.hit.toLocaleString(),` · `,o(`tokenMissShort`),` `,t.miss.toLocaleString(),` · `,o(`tokenOutput`),` `,t.output.toLocaleString()]})]},e.key)})]}),(0,a.jsx)(`div`,{className:A.chartLegend,children:m===`structure`?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:A.chartTooltipSwatch,style:{background:X}}),o(`tokenMiss`)]}),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:A.chartTooltipSwatch,style:{background:Z}}),o(`tokenHit`)]}),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:A.chartTooltipSwatch,style:{background:et}}),o(`tokenOutput`)]})]}):S.map(e=>(0,a.jsxs)(`button`,{type:`button`,className:c(A.chartLegendItem,C===e.key&&A.chartLegendItemActive),"aria-pressed":C===e.key,"data-testid":`billing-token-legend-${e.key}`,onClick:()=>{ee(e.key)},children:[(0,a.jsx)(`span`,{className:A.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key))})]})]}),(0,a.jsxs)(`section`,{className:A.panel,"data-testid":`billing-token-models`,children:[(0,a.jsx)(`div`,{className:A.panelHead,children:(0,a.jsx)(`h3`,{className:A.panelTitle,children:o(`tokenByModel`)})}),w.length===0?(0,a.jsx)(`div`,{className:A.emptyRow,children:o(`noData`)}):(0,a.jsx)(`div`,{className:A.tableScroll,children:(0,a.jsxs)(`table`,{className:A.modelTable,"data-testid":`billing-token-model-table`,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:o(`model`)}),(0,a.jsx)(`th`,{className:A.numCol,children:o(`inputTokens`)}),(0,a.jsx)(`th`,{className:A.numCol,children:o(`outputTokens`)}),(0,a.jsx)(`th`,{className:A.numCol,children:o(`tokenReasoningShort`)}),(0,a.jsx)(`th`,{className:A.numCol,children:o(`cacheHitRate`)}),(0,a.jsx)(`th`,{className:A.numCol,children:o(`tokenTotal`)}),(0,a.jsx)(`th`,{className:A.numCol,children:o(`tokenShare`)}),(0,a.jsx)(`th`,{className:A.numCol,children:o(`calls`)})]})}),(0,a.jsx)(`tbody`,{children:w.map(e=>(0,a.jsxs)(`tr`,{"data-testid":`billing-token-model`,className:c(v&&A.modelRowFocusable,C===e.key&&A.modelRowActive),"aria-selected":v?C===e.key:void 0,onClick:v?()=>{ee(e.key)}:void 0,children:[(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:A.modelName,children:e.name})}),(0,a.jsx)(`td`,{className:A.numCol,children:W(e.input)}),(0,a.jsx)(`td`,{className:A.numCol,children:W(e.output)}),(0,a.jsx)(`td`,{className:A.numCol,children:e.reasoning>0?W(e.reasoning):(0,a.jsx)(`span`,{className:A.na,children:`—`})}),(0,a.jsxs)(`td`,{className:A.numCol,children:[e.cacheHitRate.toFixed(1),`%`]}),(0,a.jsx)(`td`,{className:A.numCol,children:W(e.total)}),(0,a.jsx)(`td`,{className:A.numCol,children:(0,a.jsxs)(`span`,{className:A.tokenModelShareRow,children:[(0,a.jsx)(`span`,{className:A.tokenModelBar,children:(0,a.jsxs)(`span`,{className:A.tokenModelParts,style:{width:`${(e.share*100).toFixed(2)}%`},children:[(0,a.jsx)(`span`,{className:A.tokenModelPartIn,style:{width:`${e.total>0?e.input/e.total*100:0}%`}}),(0,a.jsx)(`span`,{className:A.tokenModelPartOut,style:{width:`${e.total>0?e.output/e.total*100:0}%`}})]})}),(e.share*100).toFixed(1),`%`]})}),(0,a.jsx)(`td`,{className:A.numCol,children:e.calls.toLocaleString()})]},e.key))})]})})]}),te.totalCalls>0&&(0,a.jsxs)(`section`,{className:A.panel,"data-testid":`billing-token-tools`,children:[(0,a.jsx)(`div`,{className:A.panelHead,children:(0,a.jsx)(`h3`,{className:A.panelTitle,children:o(`toolRank`)})}),(0,a.jsx)(`div`,{className:A.tableScroll,children:(0,a.jsxs)(`table`,{className:A.modelTable,"data-testid":`billing-tool-table`,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:o(`toolName`)}),(0,a.jsx)(`th`,{className:A.numCol,children:o(`calls`)}),(0,a.jsx)(`th`,{className:A.numCol,children:o(`tokenShare`)})]})}),(0,a.jsx)(`tbody`,{children:[...te.top,...te.rest].map(([e,t])=>(0,a.jsxs)(`tr`,{"data-testid":`billing-tool-row`,children:[(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:A.modelName,children:e})}),(0,a.jsx)(`td`,{className:A.numCol,children:t.toLocaleString()}),(0,a.jsxs)(`td`,{className:A.numCol,children:[(t/te.totalCalls*100).toFixed(1),`%`]})]},e))})]})})]})]})}function rt(e){return[`date,missInput,cacheHit,output,reasoning,total`,...e.map(e=>`${e.date},${e.miss},${e.hit},${e.output},${e.reasoning},${e.miss+e.hit+e.output}`)].join(`
|
|
2
|
-
`)}function it(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}`}function at(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function ot(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m${String(t%60).padStart(2,`0`)}s`}function st({rounds:e,flags:t,currency:n,t:i}){let o=(0,r.useMemo)(()=>e.slice(-40),[e]),s=(0,r.useMemo)(()=>new Set(t.map(e=>`${e.sessionId}:${e.turn}`)),[t]),l=(0,r.useMemo)(()=>Math.max(1e-4,...o.map(e=>e.cost)),[o]);if(o.length===0)return(0,a.jsxs)(`div`,{className:
|
|
1
|
+
window.__ModuleLoader__.load({id:`@kenz1117/dsh-ui-usage-billing`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});let r=e("react"),i=e("@deepseek-ai/dsh-client-ui-primitives"),a=e("react/jsx-runtime"),o=e("@deepseek-ai/dsh-client-store");function s(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=s(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function c(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=s(e))&&(r&&(r+=` `),r+=t);return r}let l={mode:`combined`,targets:[]},u=`dsh.ui-usage-billing.float`;function d(){try{let e=localStorage.getItem(u);if(e===null)return{...l,targets:[...l.targets]};let t=JSON.parse(e);return{mode:t.mode===`subscription`?`subscription`:`combined`,targets:Array.isArray(t.targets)?t.targets.filter(e=>typeof e==`string`):[]}}catch{return{...l,targets:[...l.targets]}}}function f(e){try{localStorage.setItem(u,JSON.stringify(e))}catch{}}let p={metric:`money`},m=`dsh.ui-usage-billing.card`;function h(){try{let e=localStorage.getItem(m);return e===null?{...p}:{metric:JSON.parse(e).metric===`tokens`?`tokens`:`money`}}catch{return{...p}}}function g(e){try{localStorage.setItem(m,JSON.stringify(e))}catch{}}let _={hideUnidentified:!0},v=`dsh.ui-usage-billing.sites`;function y(){try{let e=localStorage.getItem(v);return e===null?{..._}:{hideUnidentified:JSON.parse(e).hideUnidentified!==!1}}catch{return{..._}}}function b(e){try{localStorage.setItem(v,JSON.stringify(e))}catch{}}let x={show:!0,position:`below`},S=`dsh.ui-usage-billing.livecost`,C=`dsh.ui-usage-billing.livecost-pref`;function w(){try{let e=localStorage.getItem(S);if(e===null)return{...x};let t=JSON.parse(e);return{show:t.show!==!1,position:t.position===`above`||t.position===`toolbar`?t.position:`below`}}catch{return{...x}}}function T(e){try{localStorage.setItem(S,JSON.stringify(e))}catch{}}let E=`dsh.ui-usage-billing.prices`;function ee(){try{let e=localStorage.getItem(E);if(e===null)return[];let t=JSON.parse(e);if(t===null)return[];let n=[],r=(e,t)=>{if(typeof t!=`object`||!t)return;let r=t,i=Number(r.input),a=Number(r.cacheHit),o=Number(r.output);if(![i,a,o].every(e=>Number.isFinite(e)&&e>=0))return;let s=r.offPeak,c;if(typeof s==`object`&&s){let e=s,t=Number(e.input),n=Number(e.cacheHit),r=Number(e.output);[t,n,r].every(e=>Number.isFinite(e)&&e>=0)&&(c={input:t,cacheHit:n,output:r})}n.push({key:e,...typeof r.origin==`string`&&r.origin!==``?{origin:r.origin}:{},input:i,cacheHit:a,output:o,...c===void 0?{}:{offPeak:c},...r.currency===`USD`?{currency:`USD`}:{}})};if(Array.isArray(t))for(let e of t){if(typeof e!=`object`||!e)continue;let t=e;typeof t.key==`string`&&t.key!==``&&r(t.key,e)}else if(typeof t==`object`)for(let[e,n]of Object.entries(t))r(e,n);return n}catch{return[]}}function D(e){try{localStorage.setItem(E,JSON.stringify(e))}catch{}}let O={metric:`ttft`},te=`dsh.ui-usage-billing.perf`;function k(){try{let e=localStorage.getItem(te);if(e===null)return{...O};let t=JSON.parse(e);return{metric:t.metric===`tps`?`tps`:`ttft`,...Array.isArray(t.models)?{models:t.models.filter(e=>typeof e==`string`)}:{}}}catch{return{...O}}}function A(e){try{localStorage.setItem(te,JSON.stringify(e))}catch{}}let ne=`@kenz1117/dsh-ui-usage-billing/UsageBilling.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(ne)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=ne,e.textContent=`.KFXqYa_railButton{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);width:36px;height:36px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:8px;flex:none;justify-content:center;align-items:center;padding:0;transition:border-color .16s,color .16s;display:flex}.KFXqYa_railButton:hover,.KFXqYa_railButton:focus-visible{border-color:var(--dsw-static-blue-500);color:var(--dsw-static-blue-500);outline:none}.KFXqYa_railButton svg{stroke-width:2px;width:18px;height:18px}.KFXqYa_trigger{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);width:100%;min-width:0;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;border-radius:14px;align-items:center;gap:10px;padding:9px 12px;transition:border-color .16s,transform .16s,box-shadow .16s;display:flex;position:relative;overflow:hidden;box-shadow:0 1px 2px #0000000a}.KFXqYa_trigger:hover,.KFXqYa_trigger:focus-visible{border-color:var(--dsw-static-blue-500);box-shadow:0 6px 18px -8px color-mix(in srgb, var(--dsw-static-blue-500) 45%, transparent);outline:none;transform:translateY(-1px)}.KFXqYa_triggerIcon{border:1px solid var(--dsw-alias-border-l1);width:32px;height:32px;color:var(--dsw-alias-label-secondary);opacity:.8;border-radius:8px;flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_triggerIcon svg{stroke-width:2px;width:16px;height:16px}.KFXqYa_triggerMain{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.KFXqYa_triggerPrimary{align-items:baseline;gap:5px;min-width:0;display:inline-flex}.KFXqYa_triggerLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:11px;line-height:15px;overflow:hidden}.KFXqYa_triggerYen{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;font-weight:600;line-height:16px}.KFXqYa_triggerMetric{color:var(--dsw-alias-label-primary);letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:20px;font-weight:700;line-height:24px;overflow:hidden}.KFXqYa_triggerSub{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:10px;line-height:14px;overflow:hidden}.KFXqYa_triggerSpark{flex:none;align-items:flex-end;gap:2px;height:20px;display:flex}.KFXqYa_triggerSparkBar,.KFXqYa_triggerSparkHot{background:var(--dsw-static-blue-500);opacity:.6;border-radius:1px 1px 0 0;width:3px}.KFXqYa_triggerSparkHot{opacity:1}.KFXqYa_triggerWrap{flex:180px;min-width:96px;max-width:100%;display:block;position:relative;container:KFXqYa_billing-trigger/inline-size}@container KFXqYa_billing-trigger (width<=200px){.KFXqYa_trigger{gap:6px;padding:8px 10px}.KFXqYa_triggerSpark{display:none}}@container KFXqYa_billing-trigger (width<=170px){.KFXqYa_triggerSub,.KFXqYa_triggerLabel{display:none}}@container KFXqYa_billing-trigger (width<=110px){.KFXqYa_triggerIcon,.KFXqYa_triggerSpark,.KFXqYa_triggerSub,.KFXqYa_triggerLabel{display:none}.KFXqYa_trigger{justify-content:center;padding:8px 6px}}.KFXqYa_triggerPop{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 80%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 72%, transparent);-webkit-backdrop-filter:blur(14px)saturate(1.3);box-shadow:0 12px 32px #00000029, inset 0 1px 0 color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent);opacity:0;pointer-events:none;z-index:10;border-radius:14px;flex-direction:column;gap:5px;padding:10px 12px;transition:opacity .16s,transform .16s;display:flex;position:absolute;bottom:calc(100% + 8px);left:0;right:0;overflow:hidden;transform:translateY(4px)}.KFXqYa_triggerPop:before{content:"";background:linear-gradient(90deg, transparent 0%, var(--dsw-static-amber-500) 30%, var(--dsw-alias-label-primary) 50%, var(--dsw-static-amber-500) 70%, transparent 100%);opacity:.9;pointer-events:none;background-size:200% 100%;height:1.5px;animation:4s ease-in-out infinite KFXqYa_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}.KFXqYa_triggerWrap:hover .KFXqYa_triggerPop,.KFXqYa_triggerWrap:focus-within .KFXqYa_triggerPop{opacity:1;transform:translateY(0)}.KFXqYa_popHead{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.KFXqYa_popTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:700;line-height:18px}.KFXqYa_metricGrid{grid-template-columns:repeat(3,1fr);gap:10px 8px;display:grid}.KFXqYa_metricCell{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_metricLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_metricValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:12px;font-weight:700;line-height:16px}.KFXqYa_metricValuePrimary{color:var(--dsw-static-amber-500)}.KFXqYa_metricValueSuccess{color:var(--dsw-static-green-500)}.KFXqYa_popModel{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:6px;padding-top:10px;display:flex}.KFXqYa_popModelLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_popModelRow{align-items:center;gap:8px;min-width:0;display:flex}.KFXqYa_popDot{border-radius:999px;flex:none;width:6px;height:6px}.KFXqYa_popDotDirect{background:var(--dsw-static-green-500)}.KFXqYa_popDotSub{background:var(--dsw-static-amber-500)}.KFXqYa_popDotNeutral{background:var(--dsw-alias-label-tertiary)}.KFXqYa_popTagPrimary,.KFXqYa_popTagSub{white-space:nowrap;border-radius:5px;flex:none;align-items:center;height:18px;padding:0 6px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_popTagPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.KFXqYa_popTagSub{background:color-mix(in srgb, var(--dsw-static-amber-500) 18%, transparent);color:var(--dsw-static-amber-500)}.KFXqYa_popModelName{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:16px;overflow:hidden}.KFXqYa_popModelStatus{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;white-space:nowrap;margin-left:auto;font-size:11px;font-weight:600;line-height:16px}.KFXqYa_popModelStatusLow{color:var(--dsw-static-red-500)}.KFXqYa_dashboardModal{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:14px;width:min(760px,100vw - 48px);max-height:min(760px,88vh);animation:.18s ease-out KFXqYa_dashboardIn;box-shadow:0 12px 32px -12px #0000002e,0 2px 8px #0000000f}@keyframes KFXqYa_dashboardIn{0%{opacity:0;transform:translateY(8px)scale(.98)}to{opacity:1;transform:none}}div[role=presentation]:has(>.dsh-billing-modal)>div[aria-hidden=true]:first-child{backdrop-filter:blur(8px)saturate(1.25)}.KFXqYa_dashboard{flex-direction:column;width:100%;max-height:min(760px,88vh);display:flex}.KFXqYa_dashboardHead{border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:12px;padding:12px 18px;display:flex}.KFXqYa_dashboardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:600;line-height:20px}.KFXqYa_dashboardSubtitle{color:var(--dsw-alias-label-caption);margin:2px 0 0;font-size:11px;line-height:16px}.KFXqYa_closeButton{border:1px solid var(--dsw-alias-border-l1);width:32px;height:32px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border-radius:8px;flex:none;justify-content:center;align-items:center;transition:background-color .14s,color .14s;display:inline-flex}.KFXqYa_closeButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.KFXqYa_closeButton svg{stroke-width:2px;width:16px;height:16px}.KFXqYa_dashboardBody{flex-direction:column;gap:14px;padding:16px 24px 24px;display:flex;overflow-y:auto}.KFXqYa_modalFooter{border-top:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:16px;padding:8px 18px;font-size:11px;line-height:16px;display:flex}.KFXqYa_tabNav{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;align-items:center;gap:4px;margin:14px 24px 0;padding:4px;display:flex}.KFXqYa_tabButton{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:7px;padding:6px 14px;font-size:13px;font-weight:500;line-height:20px;transition:background-color .16s,color .16s}.KFXqYa_tabButton:hover,.KFXqYa_tabButton:focus-visible{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 62%, transparent);outline:none}.KFXqYa_tabButtonActive,.KFXqYa_tabButtonActive:hover,.KFXqYa_tabButtonActive:focus-visible{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font-weight:600;box-shadow:0 1px 3px #0000001f}.KFXqYa_tabPanel{flex-direction:column;gap:14px;animation:.14s ease-out KFXqYa_tabPanelIn;display:flex}@keyframes KFXqYa_tabPanelIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.KFXqYa_reconcileNotice{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 78%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 62%, transparent);color:var(--dsw-alias-label-secondary);border-radius:10px;align-items:flex-start;gap:10px;padding:10px 12px;font-size:12px;line-height:1.55;display:flex}.KFXqYa_reconcileIcon{color:var(--dsw-alias-label-tertiary);flex:none;margin-top:1px;display:inline-flex}.KFXqYa_reconcileText{flex:1}.KFXqYa_reconcileDismiss{color:var(--dsw-alias-label-tertiary);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:6px;flex:none;padding:2px 8px;font-size:12px;line-height:1.4;transition:color .15s,background-color .15s}.KFXqYa_reconcileDismiss:hover{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent)}.KFXqYa_hero{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;flex-direction:column;gap:12px;padding:14px 16px;display:flex;position:relative;overflow:hidden}.KFXqYa_heroTop{justify-content:space-between;align-items:center;gap:24px;display:flex}.KFXqYa_heroMain{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_heroLabel{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;font-size:10px;font-weight:500;line-height:14px}.KFXqYa_heroReadout{align-items:baseline;gap:4px;display:flex}.KFXqYa_heroCurrency{letter-spacing:-.01em;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:15px;font-weight:600;line-height:20px}.KFXqYa_heroValue{letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:28px;font-weight:650;line-height:34px}.KFXqYa_heroMeta{color:var(--dsw-alias-label-caption);white-space:nowrap;margin-top:2px;font-size:11px;line-height:15px}.KFXqYa_heroGauge{flex:none;width:72px;height:72px;position:relative}.KFXqYa_heroGaugeSvg{width:100%;height:100%;display:block;transform:rotate(-90deg)}.KFXqYa_heroGaugeTrack{fill:none;stroke:var(--dsw-alias-bg-module-platform);stroke-width:7px}.KFXqYa_heroGaugeArc{fill:none;stroke:var(--dsw-static-blue-500);stroke-width:7px;stroke-linecap:round;transition:stroke-dasharray .26s}.KFXqYa_heroGaugeArcOver{stroke:var(--dsw-static-red-500)}.KFXqYa_heroGaugeCenter{flex-direction:column;justify-content:center;align-items:center;gap:1px;display:flex;position:absolute;inset:0}.KFXqYa_heroGaugePct{letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);font-size:14px;font-weight:700;line-height:18px}.KFXqYa_heroGaugePctOver{color:var(--dsw-static-red-500)}.KFXqYa_heroGaugeLabel{color:var(--dsw-alias-label-tertiary);font-size:9px;line-height:12px}.KFXqYa_heroBudget{border-top:1px solid var(--dsw-alias-border-l1);align-items:center;gap:14px;padding-top:14px;display:flex}.KFXqYa_heroBudgetLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px;line-height:16px}.KFXqYa_heroBudgetTrack{background:var(--dsw-alias-border-l1);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.KFXqYa_heroBudgetFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .22s}.KFXqYa_heroBudgetFillOver{background:var(--dsw-static-red-500)}.KFXqYa_heroBudgetValue{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px;line-height:16px}.KFXqYa_heroSide{border-top:1px solid var(--dsw-alias-border-l1);align-items:stretch;padding-top:12px;display:flex}.KFXqYa_heroSideItem{border-left:1px solid var(--dsw-alias-border-l1);flex-direction:column;flex:1;gap:2px;min-width:0;padding-left:14px;display:flex}.KFXqYa_heroSideItem:first-child{border-left:none;padding-left:0}.KFXqYa_heroSideLabel{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;font-size:10px;font-weight:500;line-height:13px}.KFXqYa_heroSideValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;white-space:nowrap;align-items:baseline;gap:6px;font-size:15px;font-weight:600;line-height:20px;display:inline-flex}.KFXqYa_heroSideSpacer{flex:1;display:block}.KFXqYa_delta{font-variant-numeric:tabular-nums;border-radius:999px;align-items:center;gap:2px;margin-left:6px;padding:1px 7px;font-size:10.5px;font-weight:600;line-height:16px;display:inline-flex}.KFXqYa_deltaUp{color:var(--dsw-static-green-500);background:color-mix(in srgb, var(--dsw-static-green-500) 12%, transparent)}.KFXqYa_deltaDown{color:var(--dsw-static-red-500);background:color-mix(in srgb, var(--dsw-static-red-500) 12%, transparent)}.KFXqYa_unpricedHint{border:1px solid color-mix(in srgb, var(--dsw-static-amber-500) 30%, transparent);background:color-mix(in srgb, var(--dsw-static-amber-500) 8%, transparent);color:var(--dsw-static-amber-500);border-radius:8px;align-items:center;padding:8px 12px;font-size:11.5px;font-weight:500;line-height:17px;display:flex}.KFXqYa_kpiGrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;display:grid}.KFXqYa_kpiTile{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;flex-direction:column;gap:2px;padding:10px 12px;transition:border-color .16s;display:flex;position:relative;overflow:hidden}.KFXqYa_kpiTile:hover{border-color:var(--dsw-alias-border-l2)}.KFXqYa_kpiLabel{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.06em;font-size:10px;font-weight:500;line-height:13px}.KFXqYa_kpiValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:16px;font-weight:650;line-height:22px}.KFXqYa_kpiGreen{color:var(--dsw-static-green-500)}.KFXqYa_kpiDetail{color:var(--dsw-alias-label-caption);white-space:nowrap;text-overflow:ellipsis;font-size:10.5px;line-height:14px;overflow:hidden}.KFXqYa_panel{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;flex-direction:column;gap:8px;padding:12px 14px;transition:border-color .16s;display:flex}.KFXqYa_panelHead{justify-content:space-between;align-items:baseline;gap:10px;display:flex}.KFXqYa_panelHeadControls{align-items:center;gap:8px;display:inline-flex}.KFXqYa_panelTitle{letter-spacing:-.005em;color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:600;line-height:20px}.KFXqYa_panelHint{color:var(--dsw-alias-label-caption);white-space:nowrap;font-size:11px;line-height:16px}.KFXqYa_rangeToggle{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:8px;gap:2px;padding:2px;display:inline-flex}.KFXqYa_rangeButton{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:6px;padding:2px 8px;font-size:11px;line-height:16px;transition:background-color .14s,color .14s}.KFXqYa_rangeButtonActive{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);font-weight:600}.KFXqYa_exportBar{justify-content:flex-end;align-items:center;gap:8px;display:flex}.KFXqYa_exportLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:16px}.KFXqYa_exportButton{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:999px;padding:4px 12px;font-size:11.5px;line-height:16px;transition:border-color .16s,color .16s,background-color .16s}.KFXqYa_exportButton:hover,.KFXqYa_exportButton:focus-visible{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);outline:none}.KFXqYa_shareTrack{background:var(--dsw-alias-bg-module-platform);border-radius:999px;height:10px;display:flex;overflow:hidden}.KFXqYa_shareSeg{height:100%;transition:width .2s}.KFXqYa_shareSegPeak{background:var(--dsw-static-blue-500)}.KFXqYa_shareSegOff{background:color-mix(in srgb, var(--dsw-static-blue-500) 25%, var(--dsw-alias-bg-module-platform))}.KFXqYa_shareSegUser{background:var(--dsw-static-blue-500)}.KFXqYa_shareSegAssistant{background:var(--dsw-static-green-500)}.KFXqYa_shareSegTool{background:var(--dsw-static-amber-500)}.KFXqYa_shareLegend{align-items:center;gap:16px;display:flex}.KFXqYa_shareItem{color:var(--dsw-alias-label-secondary);align-items:baseline;gap:6px;font-size:12px;line-height:17px;display:inline-flex}.KFXqYa_bucketCost{align-items:baseline;gap:3px;display:inline-flex}.KFXqYa_bucketOfficial{color:var(--dsw-static-blue-500);font-weight:600}.KFXqYa_bucketSep{color:var(--dsw-alias-label-dimmed)}.KFXqYa_bucketThird{color:var(--dsw-alias-label-secondary)}.KFXqYa_shareDot{border-radius:50%;flex:none;align-self:center;width:8px;height:8px}.KFXqYa_shareValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_budgetInput{width:64px;color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;text-align:right;background:0 0;border:none;padding:0;font-size:12px;line-height:16px}.KFXqYa_budgetInput:focus-visible{outline:none}.KFXqYa_switch{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);cursor:pointer;border-radius:999px;flex:none;width:30px;height:17px;padding:0;transition:background-color .16s,border-color .16s;position:relative}.KFXqYa_switchOn{border-color:var(--dsw-alias-border-l1);background:var(--dsw-alias-label-primary)}.KFXqYa_switchKnob{background:var(--dsw-static-neutral-bluish-00);border-radius:50%;width:11px;height:11px;transition:transform .16s;position:absolute;top:2px;left:2px}.KFXqYa_switchOn .KFXqYa_switchKnob{transform:translate(13px)}.KFXqYa_budgetFillWarn{background:var(--dsw-static-amber-500)}.KFXqYa_budgetFillOver{background:var(--dsw-static-red-500);animation:1.6s ease-in-out infinite KFXqYa_budgetOverPulse}@keyframes KFXqYa_budgetOverPulse{50%{opacity:.55}}.KFXqYa_chartWrap{width:100%;position:relative}.KFXqYa_chartSvg{width:100%;height:auto;display:block}.KFXqYa_chartEmpty{height:140px;color:var(--dsw-alias-label-caption);justify-content:center;align-items:center;font-size:13px;display:flex}.KFXqYa_emptyRow{text-align:center;color:var(--dsw-alias-label-caption);padding:28px 0;font-size:13px}.KFXqYa_chartGrid{stroke:var(--dsw-alias-border-l1);stroke-width:1px}.KFXqYa_chartAxisLabel{fill:var(--dsw-alias-label-tertiary);font-size:10px}.KFXqYa_chartBar{fill:var(--dsw-static-blue-500);opacity:.7}.KFXqYa_chartBar:hover{opacity:1}.KFXqYa_chartStack{stroke:var(--dsw-alias-bg-layer-1);stroke-width:.75px}.KFXqYa_chartStack:hover{opacity:.9}.KFXqYa_chartLine{stroke:var(--dsw-static-blue-500);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.KFXqYa_chartCrosshair{stroke:var(--dsw-alias-label-dimmed);stroke-width:1px;stroke-dasharray:3 3}.KFXqYa_chartTooltip{pointer-events:none;z-index:2;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);box-shadow:none;white-space:nowrap;border-radius:8px;padding:8px 10px;position:absolute;transform:translate(-50%,calc(-100% - 10px))}.KFXqYa_chartTooltipDate{color:var(--dsw-alias-label-primary);margin-bottom:3px;font-size:11px;font-weight:600}.KFXqYa_chartTooltipRow{color:var(--dsw-alias-label-secondary);align-items:center;gap:5px;font-size:11px;line-height:17px;display:flex}.KFXqYa_chartTooltipRow strong{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_chartTooltipHead{justify-content:space-between;align-items:baseline;gap:14px;margin-bottom:3px;display:flex}.KFXqYa_chartTooltipHead .KFXqYa_chartTooltipDate{margin-bottom:0}.KFXqYa_chartTooltipHead strong{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:11px;font-weight:600}.KFXqYa_chartTooltipSplit{justify-content:space-between;gap:14px}.KFXqYa_chartTooltipLabel{align-items:center;gap:5px;display:flex}.KFXqYa_chartTooltipModelDetail{color:var(--dsw-alias-label-caption);font-variant-numeric:tabular-nums;margin:-2px 0 4px 13px;font-size:10.5px;line-height:14px}.KFXqYa_chartBarPlaceholder{fill:color-mix(in srgb, var(--dsw-alias-label-secondary) 30%, transparent)}.KFXqYa_chartLegendLine{background:var(--dsw-static-blue-500);border-radius:2px;width:10px;height:3px;display:inline-block}.KFXqYa_chartLegendBar{background:var(--dsw-static-blue-500);opacity:.5;border-radius:2px;width:7px;height:7px;display:inline-block}.KFXqYa_chartTooltipSwatch{border-radius:3px;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_chartLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-end;gap:14px;margin-top:2px;font-size:11px;display:flex}.KFXqYa_chartLegend span{align-items:center;gap:5px;display:inline-flex}.KFXqYa_chartLegendItem{font:inherit;color:inherit;cursor:pointer;background:0 0;border:none;align-items:center;gap:5px;padding:0;transition:color .12s;display:inline-flex}.KFXqYa_chartLegendItem:hover{color:var(--dsw-alias-label-secondary)}.KFXqYa_chartLegendItemActive{color:var(--dsw-alias-label-primary);font-weight:600}.KFXqYa_perfBar{align-items:center;margin:10px 0 2px;display:flex}.KFXqYa_perfChips{flex-wrap:wrap;gap:6px;margin:6px 0 2px;display:flex}.KFXqYa_perfChip{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:999px;align-items:center;gap:5px;padding:2px 9px;font-size:11px;line-height:16px;transition:border-color .12s,color .12s,opacity .12s;display:inline-flex}.KFXqYa_perfChip:hover{color:var(--dsw-alias-label-primary)}.KFXqYa_perfChipOff{opacity:.45}.KFXqYa_perfChipDot{border-radius:3px;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_chartHoverDot{stroke:var(--dsw-alias-bg-layer-2);stroke-width:1.5px}.KFXqYa_tableScroll{border:1px solid var(--dsw-alias-border-l1);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:12px;overflow:auto}.KFXqYa_ubAlert{border:1px solid color-mix(in srgb, var(--dsw-static-blue-500) 30%, transparent);background:color-mix(in srgb, var(--dsw-static-blue-500) 8%, transparent);border-radius:10px;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;font-size:12px;line-height:17px;display:flex}.KFXqYa_ubAlertLeft{align-items:center;gap:8px;display:inline-flex}.KFXqYa_ubRate{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_ubAlertNote{color:var(--dsw-alias-label-secondary);margin:0}.KFXqYa_ubTag,.KFXqYa_ubTagSuccess,.KFXqYa_ubTagNeutral,.KFXqYa_ubTagAlert,.KFXqYa_ubTagPromo{white-space:nowrap;border-radius:999px;align-items:center;height:18px;padding:0 7px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_ubTagSuccess{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.KFXqYa_ubTagNeutral{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary)}.KFXqYa_ubTagAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.KFXqYa_ubTagPromo{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500);cursor:help}.KFXqYa_ubExtraRow td{opacity:.72;padding-top:2px;padding-bottom:2px;font-size:12px}.KFXqYa_ubExtraName{color:var(--dsw-alias-label-secondary);margin-left:26px}.KFXqYa_ubExtraNote{color:var(--dsw-alias-label-tertiary);margin-left:8px;font-size:10px}.KFXqYa_ubCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:12px;padding:16px 18px;display:flex}.KFXqYa_ubCardHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.KFXqYa_ubCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_ubCardSub{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_ubTablewrap{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;overflow:auto}.KFXqYa_ubTable{border-collapse:collapse;white-space:nowrap;width:100%;font-size:12.5px}.KFXqYa_ubTable th,.KFXqYa_ubTable td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;padding:9px 12px}.KFXqYa_ubTable tbody tr:last-child td{border-bottom:0}.KFXqYa_ubTable thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;font-size:11px;font-weight:600}.KFXqYa_ubModel{align-items:center;gap:8px;display:inline-flex}.KFXqYa_vendorLogo{object-fit:contain;border-radius:4px;flex:none;width:18px;height:18px}.KFXqYa_vendorLetter{color:#fff;border-radius:4px;flex:none;justify-content:center;align-items:center;width:18px;height:18px;font-size:10px;font-weight:600;line-height:1;display:inline-flex}.KFXqYa_ubModelName{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-weight:500;display:inline-flex}.KFXqYa_ubPricepair{flex-wrap:wrap;gap:6px;display:inline-flex}.KFXqYa_ubChipPeak,.KFXqYa_ubChipOff{font-variant-numeric:tabular-nums;border-radius:999px;align-items:center;gap:5px;height:20px;padding:0 8px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_ubChipLabel{font-size:10px;font-weight:600}.KFXqYa_ubChipPeak{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.KFXqYa_ubChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.KFXqYa_ubNotes{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.KFXqYa_ubNotesItem{align-items:baseline;gap:10px;display:flex}.KFXqYa_ubNotesTerm{color:var(--dsw-alias-label-primary);flex:0 0 72px;font-size:12px;font-weight:500}.KFXqYa_ubNotesDesc{min-width:0;color:var(--dsw-alias-label-secondary);flex:1;font-size:12px;line-height:17px}.KFXqYa_ubCardControlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.KFXqYa_ubTagError{white-space:nowrap;background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);height:18px;color:var(--dsw-static-red-500);border-radius:999px;align-items:center;padding:0 7px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_ubStatGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.KFXqYa_ubStatCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:4px;padding:14px 16px;display:flex}.KFXqYa_ubStatLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_ubStatValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:22px;font-weight:700;line-height:28px}.KFXqYa_ubStatDetail{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.KFXqYa_rowlist{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.KFXqYa_rowline{width:100%;min-width:0;color:var(--dsw-alias-label-primary);text-align:left;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:10px;justify-content:space-between;align-items:center;gap:12px;padding:9px 12px;transition:background-color .14s,border-color .14s;display:flex}.KFXqYa_rowline:hover{background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 60%, transparent);border-color:var(--dsw-alias-border-l1)}.KFXqYa_rowlineName{min-width:0;color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:12.5px;font-weight:500;overflow:hidden}.KFXqYa_rowlineRight{font-variant-numeric:tabular-nums;flex:none;align-items:baseline;gap:8px;display:inline-flex}.KFXqYa_rowlineMuted{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_rowlineChev{color:var(--dsw-alias-label-tertiary);font-size:14px}.KFXqYa_rowlineDrillWrap{padding-left:12px}.KFXqYa_rowlineDrill{border-left:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:12px;padding:6px 12px;font-size:12px;display:flex}.KFXqYa_modelTable{border-collapse:collapse;width:100%;font-size:12.5px}.KFXqYa_modelTable th,.KFXqYa_modelTable td th td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;white-space:nowrap;padding:7px 10px}.KFXqYa_modelTable tbody tr:last-child td tbody tr:last-child td{border-bottom:0}.KFXqYa_modelTable thead th thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;background:0 0;font-size:11px;font-weight:600}.KFXqYa_modelTable tbody tr tbody tr{transition:background-color .12s}.KFXqYa_modelTable tbody tr:hover tbody tr:hover{background:0 0}.KFXqYa_modelTable tbody tr.KFXqYa_modelRowFocusable{cursor:pointer}.KFXqYa_modelTable tbody tr.KFXqYa_modelRowActive,.KFXqYa_modelTable tbody tr.KFXqYa_modelRowActive:hover{background:var(--dsw-alias-interactive-bg-hover)}.KFXqYa_numCol{text-align:right;font-variant-numeric:tabular-nums}.KFXqYa_na{color:var(--dsw-alias-label-dimmed)}.KFXqYa_modelCell{align-items:center;gap:8px;display:inline-flex}.KFXqYa_modelDot{border-radius:50%;flex:none;width:9px;height:9px}.KFXqYa_modelName{color:var(--dsw-alias-label-primary);font-weight:500;line-height:16px;display:block}.KFXqYa_modelProvider{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px;display:block}.KFXqYa_siteRow{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:10px;justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;display:flex}.KFXqYa_siteRowName{align-items:center;gap:8px;min-width:0;display:inline-flex}.KFXqYa_siteKindTag{white-space:nowrap;border-radius:999px;flex:none;align-items:center;padding:1px 7px;font-size:10.5px;font-weight:600;line-height:16px;display:inline-flex}.KFXqYa_siteKindSite{color:var(--dsw-static-blue-500);background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent)}.KFXqYa_siteKindDirect{color:var(--dsw-static-green-500);background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent)}.KFXqYa_siteKindUnknown{color:var(--dsw-static-red-500);background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent)}.KFXqYa_siteRowTitle{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:600;line-height:18px;overflow:hidden}.KFXqYa_siteRowMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.KFXqYa_siteRowCost{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:12.5px;font-weight:700;line-height:18px}.KFXqYa_siteRowCalls{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:11.5px;line-height:17px}.KFXqYa_siteRowCallsLow{color:var(--dsw-static-red-500)}.KFXqYa_flatTag{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px}.KFXqYa_healthDot{border-radius:50%;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_healthOk{background:var(--dsw-static-green-500)}.KFXqYa_healthBad{background:var(--dsw-static-red-500)}.KFXqYa_healthIdle{background:var(--dsw-static-neutral-bluish-400)}.KFXqYa_dashboardRight{align-items:center;gap:8px;min-width:0;display:flex}.KFXqYa_healthBadge{white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:3px 9px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_healthBadgeOk{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2)}.KFXqYa_healthBadgeBad{color:var(--dsw-static-red-500);background:var(--dsw-alias-bg-layer-2)}.KFXqYa_planTag{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;align-items:center;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px;display:inline-flex}.KFXqYa_uncataloguedTag{vertical-align:1px;color:var(--dsw-static-amber-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;margin-left:6px;padding:0 6px;font-size:10px;font-weight:600;line-height:16px;display:inline-block}.KFXqYa_estimatedTag{vertical-align:1px;color:var(--dsw-static-blue-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;margin-left:6px;padding:0 6px;font-size:10px;font-weight:600;line-height:16px;display:inline-block}.KFXqYa_feeBar{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;border-radius:999px;flex-wrap:wrap;align-items:center;gap:8px;padding:6px 12px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_feeBarAbove{order:-1;align-self:center;margin-bottom:8px}.KFXqYa_feeInline{font-variant-numeric:tabular-nums;white-space:nowrap;cursor:default;border-radius:999px;align-self:center;align-items:center;gap:5px;height:22px;padding:0 4px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_feeInline .KFXqYa_feeChipPrimary,.KFXqYa_feeInline .KFXqYa_feeChipOff{height:18px;padding:0 7px}.KFXqYa_feeInlineNum{color:var(--dsw-alias-label-primary);padding-right:6px;font-weight:600}.KFXqYa_feeInlineAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 12%, transparent)}.KFXqYa_feeInlineAlert .KFXqYa_feeInlineNum{color:var(--dsw-static-amber-500)}.KFXqYa_feeInlineError{background:color-mix(in srgb, var(--dsw-static-red-500) 12%, transparent)}.KFXqYa_feeInlineError .KFXqYa_feeInlineNum{color:var(--dsw-static-red-500)}.KFXqYa_feeBar .KFXqYa_feeSep{color:var(--dsw-alias-label-dimmed)}.KFXqYa_feeCount{color:var(--dsw-alias-label-primary);font-weight:600}.KFXqYa_feeSuffix{color:var(--dsw-alias-label-tertiary)}.KFXqYa_feeItem{color:var(--dsw-alias-label-secondary);white-space:nowrap}.KFXqYa_feeNum{color:var(--dsw-alias-label-primary);font-weight:600}.KFXqYa_feeSep{color:var(--dsw-alias-label-tertiary)}.KFXqYa_feeChipPrimary,.KFXqYa_feeChipOff,.KFXqYa_feeChipAlert,.KFXqYa_feeChipError{font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:999px;align-items:center;height:20px;padding:0 8px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_feeChipPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.KFXqYa_feeChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.KFXqYa_feeChipAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.KFXqYa_feeChipError{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500)}.KFXqYa_balanceCell{align-items:center;gap:6px;display:inline-flex;position:relative}.KFXqYa_balanceDaysBadge{border:1px solid var(--dsw-alias-label-caption);background:color-mix(in srgb, var(--dsw-alias-label-caption) 10%, transparent);min-width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:12px;justify-content:center;align-items:center;padding:0 6px;font-size:10.5px;font-weight:600;line-height:1;display:inline-flex}.KFXqYa_balanceDaysBadge:hover{border-color:var(--dsw-alias-label-secondary);background:color-mix(in srgb, var(--dsw-alias-label-caption) 18%, transparent)}.KFXqYa_balanceDaysBadgeLow{color:var(--dsw-static-red-500);border-color:var(--dsw-static-red-500);background:color-mix(in srgb, var(--dsw-static-red-500) 10%, transparent)}.KFXqYa_balanceDetailPop{z-index:20;background:var(--dsw-alias-bg-layer-3);border:1px solid var(--dsw-alias-label-caption);white-space:nowrap;border-radius:8px;flex-direction:column;gap:6px;min-width:180px;padding:8px 10px;display:inline-flex;position:absolute;top:calc(100% + 6px);right:0;box-shadow:0 6px 20px #0000002e}.KFXqYa_balanceDetailHead{justify-content:space-between;align-items:center;gap:12px;display:flex}.KFXqYa_balanceDetailTitle{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600}.KFXqYa_balanceDetailClose{cursor:pointer;color:var(--dsw-alias-label-caption);background:0 0;border:none;font-size:14px;line-height:1}.KFXqYa_balanceDetailClose:hover{color:var(--dsw-alias-label-primary)}.KFXqYa_balanceDetailGrid{flex-direction:column;gap:4px;display:inline-flex}.KFXqYa_balanceDetailRow{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;justify-content:space-between;gap:16px;font-size:11px;line-height:15px;display:flex}.KFXqYa_balanceDetailLabel{color:var(--dsw-alias-label-caption)}.KFXqYa_balanceDetailValue{color:var(--dsw-alias-label-primary);font-weight:500}body[data-zine-mode] .KFXqYa_trigger,body[data-zine-mode] .KFXqYa_triggerPop,body[data-zine-mode] .KFXqYa_railButton{display:none}body[data-zine-mode] .KFXqYa_dashboardHead{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .KFXqYa_headTitleRow{align-items:center;gap:8px;margin-top:4px;display:flex}body[data-zine-mode] .KFXqYa_dashboardTitle{color:#e8ff00;letter-spacing:.04em;text-transform:uppercase;text-shadow:0 0 8px #e8ff0066;font-weight:900}body[data-zine-mode] .KFXqYa_dashboardSubtitle{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px}body[data-zine-mode] .KFXqYa_closeButton{color:#0a0a05;background:#ff2d95;border:1.5px solid #ff2d95;border-radius:0;box-shadow:0 0 10px #ff2d9573}body[data-zine-mode] .KFXqYa_hero{background:#000;border:2.5px solid #e8ff00;border-radius:0;position:relative;box-shadow:0 0 0 1px #0009,0 0 24px #e8ff002e}body[data-zine-mode] .KFXqYa_heroLabel{color:#c9d98a;letter-spacing:.12em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .KFXqYa_heroValue{color:#e8ff00;letter-spacing:-.02em;text-shadow:0 0 12px #e8ff0073;-webkit-text-fill-color:#e8ff00;background:0 0;font-size:38px;font-weight:900}body[data-zine-mode] .KFXqYa_heroMeta{color:#c9d98a;letter-spacing:.06em;text-transform:uppercase;font-size:10.5px}body[data-zine-mode] .KFXqYa_heroSideLabel{color:#c9d98a;letter-spacing:.1em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .KFXqYa_heroSideValue{color:#e8ff00;text-shadow:0 0 6px #e8ff0059}body[data-zine-mode] .KFXqYa_delta{font-weight:900}body[data-zine-mode] .KFXqYa_deltaUp{color:#ff2d95}body[data-zine-mode] .KFXqYa_deltaDown{color:#c9d98a}body[data-zine-mode] .KFXqYa_tabNav{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .KFXqYa_tabButton{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;border-radius:0;font-size:10.5px;font-weight:900}body[data-zine-mode] .KFXqYa_tabButton:hover,body[data-zine-mode] .KFXqYa_tabButton:focus-visible{color:#e8ff00;background:#e8ff001f}body[data-zine-mode] .KFXqYa_tabButtonActive,body[data-zine-mode] .KFXqYa_tabButtonActive:hover,body[data-zine-mode] .KFXqYa_tabButtonActive:focus-visible{color:#0a0a05;background:#e8ff00;box-shadow:0 0 10px #e8ff0073}body[data-zine-mode] .KFXqYa_panel{background:#000;border:2px solid #e8ff00;border-radius:0}body[data-zine-mode] .KFXqYa_trendPanel{position:relative}body[data-zine-mode] .KFXqYa_panelTitle{color:#e8ff00;letter-spacing:.06em;text-transform:uppercase;text-shadow:0 0 6px #e8ff0066;font-weight:900}body[data-zine-mode] .KFXqYa_panelHint{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .KFXqYa_modelTableScroll{background:#000;border:1.5px solid #e8ff0080;border-radius:0}.KFXqYa_currencyToggle{background:var(--dsw-alias-bg-layer-3);border:none;border-radius:8px;align-items:center;gap:2px;margin-right:8px;padding:2px;display:inline-flex}.KFXqYa_currencyButton{color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;background:0 0;border:0;border-radius:6px;padding:4px 8px;font-size:11px;font-weight:700;line-height:1}.KFXqYa_currencyButtonActive{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}.KFXqYa_subscriptionGrid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin-top:10px;display:grid}.KFXqYa_subscriptionCard{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 75%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 62%, transparent);-webkit-backdrop-filter:blur(12px)saturate(1.3);border-radius:12px;padding:12px 14px;transition:border-color .2s,box-shadow .2s;position:relative;overflow:hidden;box-shadow:0 8px 24px #0000001a}.KFXqYa_subscriptionCard:before{content:"";background:linear-gradient(90deg, transparent 0%, var(--dsw-static-amber-500) 30%, var(--dsw-alias-label-primary) 50%, var(--dsw-static-amber-500) 70%, transparent 100%);opacity:.9;pointer-events:none;background-size:200% 100%;height:1.5px;animation:3.6s ease-in-out infinite KFXqYa_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}@keyframes KFXqYa_subscriptionGoldFlow{0%{background-position:200% 0}to{background-position:-200% 0}}.KFXqYa_subscriptionCard:hover{border-color:color-mix(in srgb, var(--dsw-static-amber-500) 55%, var(--dsw-alias-border-l1));box-shadow:0 10px 30px #00000029}.KFXqYa_subscriptionHead{flex-wrap:wrap;align-items:baseline;gap:6px;margin-bottom:8px;display:flex}.KFXqYa_subscriptionName{font-size:13px;font-weight:700}.KFXqYa_subscriptionPlan{color:var(--dsw-alias-label-secondary);font-size:11px}.KFXqYa_subscriptionPlan[data-kind=code],.KFXqYa_subscriptionPlan[data-kind=token]{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-3);border-radius:999px;padding:1px 8px;font-weight:500}.KFXqYa_subscriptionTier{color:var(--dsw-alias-label-secondary);margin-left:6px}.KFXqYa_subscriptionAuto{color:var(--dsw-static-blue-500);background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, var(--dsw-alias-bg-layer-2));border-radius:999px;margin-left:6px;padding:1px 6px;font-size:10px}.KFXqYa_subscriptionStatus{color:var(--dsw-alias-label-secondary);margin-bottom:6px;font-size:11px}.KFXqYa_subscriptionWindow{align-items:center;gap:10px;margin-top:8px;font-size:11px;display:flex}.KFXqYa_subscriptionWindowLabel{color:var(--dsw-alias-label-secondary);flex:0 0 44px}.KFXqYa_subscriptionTrack{background:var(--dsw-alias-bg-layer-3);border-radius:3px;flex:1;height:6px;overflow:hidden}.KFXqYa_subscriptionFill{background:var(--dsw-static-blue-500);border-radius:3px;height:100%;transition:width .2s;display:block}.KFXqYa_subscriptionFillWarn{background:var(--dsw-static-amber-500)}.KFXqYa_subscriptionFillOver{background:var(--dsw-static-red-500)}.KFXqYa_subscriptionMeta{flex-direction:column;flex:none;align-items:flex-end;gap:2px;display:flex}.KFXqYa_subscriptionPct{text-align:right;font-variant-numeric:tabular-nums;flex:none;min-width:52px}.KFXqYa_subscriptionExhausted{color:var(--dsw-static-red-500);min-width:52px;font-weight:600}.KFXqYa_subscriptionReset{color:var(--dsw-alias-label-caption);white-space:nowrap;flex:none;font-size:10px}.KFXqYa_providerGroupList{flex-direction:column;gap:10px;display:flex}.KFXqYa_providerGroup{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;padding:12px 14px}.KFXqYa_providerGroupHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.KFXqYa_providerGroupTitle{align-items:center;gap:7px;min-width:0;display:inline-flex}.KFXqYa_providerGroupName{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px}.KFXqYa_providerGroupMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.KFXqYa_providerGroupBadge{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;align-items:center;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px;display:inline-flex}.KFXqYa_providerGroupBalance{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;align-items:baseline;gap:6px;font-size:12px;line-height:17px;display:inline-flex}.KFXqYa_providerGroupBalanceLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:17px}.KFXqYa_rounds{margin-top:10px}.KFXqYa_roundsBars{align-items:flex-end;gap:3px;height:124px;padding:16px 2px 0;display:flex;overflow-x:auto}.KFXqYa_roundsBarCol{border-radius:5px 5px 0 0;flex-direction:column;flex:1 0 28px;justify-content:flex-end;align-items:stretch;height:100%;display:flex;position:relative}.KFXqYa_roundsBarColPeak{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent)}.KFXqYa_roundsBarColOff{background:var(--dsw-alias-bg-module-platform)}.KFXqYa_roundsBarLabel{text-align:center;color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;max-width:100%;font-size:9px;line-height:1.2;position:absolute;bottom:0;left:0;right:0;overflow:hidden;transform:translateY(-100%)}.KFXqYa_roundsBarWrap{flex:1;align-items:flex-end;min-height:0;display:flex}.KFXqYa_roundsBar{background:var(--dsw-static-blue-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.KFXqYa_roundsBarFlagged{background:var(--dsw-static-red-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.KFXqYa_roundsFlagMark{background:var(--dsw-static-red-500);border-radius:50%;width:7px;height:7px;position:absolute;top:-3px;right:-3px}.KFXqYa_roundsAxis{color:var(--dsw-alias-label-secondary);justify-content:space-between;margin-top:6px;font-size:10px;display:flex}.KFXqYa_roundsEmpty{color:var(--dsw-alias-label-secondary);margin-top:10px;font-size:12px}.KFXqYa_heatmap{margin-top:10px}.KFXqYa_heatmapGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;display:grid}.KFXqYa_heatmapCellEmpty{background:var(--dsw-alias-bg-layer-1);height:30px;color:var(--dsw-alias-label-dimmed);font-variant-numeric:tabular-nums;border-radius:8px;justify-content:center;align-items:center;font-size:11px;display:flex}.KFXqYa_heatmapCell{font-variant-numeric:tabular-nums;cursor:pointer;border:0;border-radius:8px;justify-content:center;align-items:center;height:30px;padding:0;font-size:11px;display:flex}.KFXqYa_heatmapCell[data-level="0"],.KFXqYa_heatmapCell[data-level="1"],.KFXqYa_heatmapCell[data-level="2"]{color:var(--dsw-alias-label-primary)}.KFXqYa_heatmapCell[data-level="3"],.KFXqYa_heatmapCell[data-level="4"]{color:var(--dsw-static-neutral-bluish-00)}.KFXqYa_heatmapFooter{color:var(--dsw-alias-label-secondary);align-items:center;gap:8px;margin-top:10px;font-size:10px;display:flex}.KFXqYa_heatmapLegend{gap:3px;display:inline-flex}.KFXqYa_heatmapLegend i{border-radius:4px;width:14px;height:14px;display:block}.KFXqYa_heatmapHover{font-variant-numeric:tabular-nums;margin-left:auto}.KFXqYa_heatmapRangeSwitch{gap:4px;margin-left:auto;display:inline-flex}.KFXqYa_heatmapRangeButton{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-text-secondary);cursor:pointer;background:0 0;border-radius:6px;padding:2px 8px;font-size:11px;line-height:1.4}.KFXqYa_heatmapRangeButtonActive{color:var(--dsw-alias-text-primary);border-color:currentColor;font-weight:600}.KFXqYa_heatmapYear{flex-direction:column;gap:6px;display:flex}.KFXqYa_heatmapYearBody{align-items:flex-start;gap:6px;display:flex}.KFXqYa_heatmapYearWeekdays{color:var(--dsw-alias-text-tertiary);flex:none;grid-template-rows:repeat(7,11px);gap:3px;padding-top:12px;font-size:9px;line-height:11px;display:grid}.KFXqYa_heatmapYearWeekday{white-space:nowrap;text-align:right;height:11px}.KFXqYa_heatmapYearMonths{min-width:max-content;color:var(--dsw-alias-text-tertiary);grid-template-columns:repeat(52,11px);gap:3px;font-size:9px;line-height:12px;display:grid;overflow:visible}.KFXqYa_heatmapYearMonth{white-space:nowrap;overflow:visible}.KFXqYa_heatmapYearScroll{padding-bottom:2px;overflow-x:auto}.KFXqYa_heatmapYearGrid{grid-template-rows:repeat(7,11px);grid-auto-flow:column;gap:3px;min-width:max-content;display:grid}.KFXqYa_heatmapYearCell{cursor:pointer;border:0;border-radius:2px;width:11px;height:11px;padding:0}.KFXqYa_triggerPopSubscription{width:auto;left:0;right:0}.KFXqYa_floatSub{flex-direction:column;gap:6px;min-width:0;display:flex}.KFXqYa_floatSubHead{flex-wrap:wrap;align-items:baseline;gap:6px;min-width:0;display:flex}.KFXqYa_floatSubName{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:700}.KFXqYa_floatSubPlan{color:var(--dsw-alias-label-secondary);font-size:10px}.KFXqYa_floatSub .KFXqYa_subscriptionWindow{flex-wrap:wrap;gap:4px 10px}.KFXqYa_floatSub .KFXqYa_subscriptionWindowLabel{flex:none}.KFXqYa_floatSub .KFXqYa_subscriptionMeta{min-width:0;max-width:100%}.KFXqYa_floatSub .KFXqYa_subscriptionPct{min-width:0}.KFXqYa_floatSub .KFXqYa_subscriptionReset{white-space:normal;overflow-wrap:anywhere}.KFXqYa_triggerPopEmpty{color:var(--dsw-alias-label-tertiary);padding:2px 0;font-size:11px;line-height:1.5}.KFXqYa_triggerPopSwitcher{justify-content:flex-end;align-items:center;gap:8px;margin-top:2px;display:flex}.KFXqYa_triggerPopSwitchCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:10px}.KFXqYa_floatModeBtn{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 75%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 60%, transparent);color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;border-radius:10px;flex:1;padding:7px 10px;font-size:12px}.KFXqYa_floatModeBtnOn{border-color:var(--dsw-static-blue-500);color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-static-blue-500) 16%, transparent)}.KFXqYa_rdoRow{justify-content:space-between;align-items:center;gap:8px;margin-top:10px;display:flex}.KFXqYa_rdoLabel{color:var(--dsw-alias-label-secondary);font-size:12px}.KFXqYa_rdoSelect{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 75%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 60%, transparent);color:var(--dsw-alias-label-primary);white-space:nowrap;cursor:pointer;border-radius:10px;align-items:center;gap:5px;padding:5px 8px 5px 10px;font-size:12px;display:inline-flex}.KFXqYa_rdoSelect:hover{background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 85%, transparent)}.KFXqYa_rdoSelect:focus-visible{border-color:var(--dsw-static-blue-500);outline:none}.KFXqYa_rdoChevron{color:var(--dsw-alias-label-tertiary);transition:transform .15s;display:inline-flex}.KFXqYa_rdoChevronOpen{transform:rotate(180deg)}.KFXqYa_floatTarget{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:5px;font-size:12px;display:inline-flex}.KFXqYa_floatTargetLabel{color:var(--dsw-alias-label-secondary)}.KFXqYa_staleNotice{color:var(--dsw-static-amber-500);background:color-mix(in srgb, var(--dsw-static-amber-500) 12%, transparent);border:1px solid color-mix(in srgb, var(--dsw-static-amber-500) 30%, transparent);border-radius:10px;align-items:center;gap:6px;margin:0 0 10px;padding:8px 10px;font-size:11px;display:flex}.KFXqYa_plgHead{align-items:flex-start;gap:12px;display:flex}.KFXqYa_plgIcon{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);width:40px;height:40px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_plgTitle{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_plgNameRow{align-items:center;gap:8px;display:flex}.KFXqYa_plgName{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_plgTag{height:18px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-3);white-space:nowrap;border-radius:5px;align-items:center;padding:0 6px;font-size:10px;font-weight:600;display:inline-flex}.KFXqYa_plgDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.KFXqYa_plgGrid{border-top:1px solid var(--dsw-alias-border-l1);grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding-top:12px;display:grid}.KFXqYa_plgItem{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_plgLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_plgVal{color:var(--dsw-alias-label-primary);word-break:break-all;font-size:12px;line-height:17px}.KFXqYa_plgLink{color:var(--dsw-static-blue-500);word-break:break-all;font-size:12px;line-height:17px;text-decoration:none}.KFXqYa_plgLink:hover{text-decoration:underline}.KFXqYa_tokenPanel{flex-direction:column;gap:14px;display:flex}.KFXqYa_tokenModelBar{background:var(--dsw-alias-bg-layer-2);border-radius:999px;height:8px;overflow:hidden}.KFXqYa_tokenModelParts{height:100%;display:flex}.KFXqYa_tokenModelPartIn{background:var(--dsw-static-blue-500)}.KFXqYa_tokenModelPartOut{background:var(--dsw-static-amber-500)}.KFXqYa_tokenModelShareRow{align-items:center;gap:6px;display:inline-flex}@media (width<=640px){.KFXqYa_kpiGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.KFXqYa_hero{gap:14px}.KFXqYa_heroTop{flex-direction:column;align-items:flex-start;gap:12px}.KFXqYa_heroGauge{width:72px;height:72px}.KFXqYa_heroSide{gap:12px}.KFXqYa_heroSideSpacer{display:none}}.KFXqYa_peakCard{z-index:2000;border:1px solid var(--dsw-alias-border-l1);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 82%, transparent);-webkit-backdrop-filter:blur(12px)saturate(1.2);border-radius:12px;flex-direction:column;gap:8px;min-width:280px;max-width:380px;padding:16px;animation:.2s KFXqYa_peakAlertIn;display:flex;position:fixed;box-shadow:0 4px 16px #00000014}.KFXqYa_peakCardCorner{bottom:18px;right:18px}.KFXqYa_peakCardCenter{top:20%;left:50%;transform:translate(-50%)}.KFXqYa_peakCardPeak{color:var(--dsw-static-blue-500)}.KFXqYa_peakCardOff{color:var(--dsw-static-green-500)}.KFXqYa_peakHead{justify-content:space-between;align-items:center;gap:8px;display:flex}.KFXqYa_peakTag{white-space:nowrap;border-radius:6px;align-items:center;gap:6px;height:20px;padding:0 8px;font-size:11px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_peakTagPrimary{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-blue-500)}.KFXqYa_peakTagSuccess{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-green-500)}.KFXqYa_peakDot{border-radius:999px;flex:none;width:6px;height:6px}.KFXqYa_peakDotPrimary{background:var(--dsw-static-blue-500)}.KFXqYa_peakDotSuccess{background:var(--dsw-static-green-500)}.KFXqYa_peakClose{width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;font-size:15px;line-height:1;transition:background-color .14s,color .14s;display:inline-flex}.KFXqYa_peakClose:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2)}.KFXqYa_peakCount{font-variant-numeric:tabular-nums;font-size:28px;font-weight:700;line-height:34px}.KFXqYa_peakCountPrimary{color:var(--dsw-static-blue-500)}.KFXqYa_peakCountSuccess{color:var(--dsw-static-green-500)}.KFXqYa_peakDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:18px}@keyframes KFXqYa_peakAlertIn{0%{opacity:0}to{opacity:1}}.KFXqYa_setCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:12px;padding:16px 18px;display:flex}.KFXqYa_setGrid3,.KFXqYa_setGrid2{gap:10px;display:grid}.KFXqYa_setGrid3{grid-template-columns:repeat(3,minmax(0,1fr))}.KFXqYa_setGrid2{grid-template-columns:repeat(2,minmax(0,1fr))}@media (width<=720px){.KFXqYa_setGrid3,.KFXqYa_setGrid2{grid-template-columns:1fr}}.KFXqYa_setCell{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;flex-direction:column;gap:8px;min-width:0;padding:12px 14px;display:flex}.KFXqYa_setCardHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.KFXqYa_setCardMeta{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_setCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_setCardDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.KFXqYa_ctlCol{flex-direction:column;gap:10px;padding-top:2px;display:flex}.KFXqYa_ctlRow{align-items:center;gap:12px;min-height:28px;display:flex}.KFXqYa_ctlRowStretch{display:flex}.KFXqYa_ctlLabel{color:var(--dsw-alias-label-secondary);flex:0 0 96px;font-size:11px;line-height:16px}.KFXqYa_ctlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.KFXqYa_userPriceRow{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:10px;padding:8px 0;display:flex}.KFXqYa_userPriceCheck{width:14px;height:14px;accent-color:var(--dsw-static-blue-500);flex:none;margin:0}.KFXqYa_userPriceBody{flex-direction:column;flex:1;gap:8px;min-width:0;display:flex}.KFXqYa_userPriceLineMeta{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) auto;align-items:end;gap:8px 10px;display:grid}@media (width<=720px){.KFXqYa_userPriceLineMeta{grid-template-columns:repeat(2,minmax(0,1fr))}}.KFXqYa_userPriceLineMeta .KFXqYa_userPriceInput{box-sizing:border-box;width:100%;min-width:0;max-width:none}.KFXqYa_userPriceBody .KFXqYa_ctlGroup{flex-wrap:nowrap}.KFXqYa_userPriceLineMeta .KFXqYa_userPriceField .KFXqYa_ctlLabel{align-items:flex-end;min-height:30px;display:flex}.KFXqYa_userPricePriceLine{border-left:2px solid var(--dsw-alias-border-l1);flex-wrap:wrap;align-items:center;gap:10px;width:calc(100% - 22px);margin-left:10px;padding:2px 0 6px 12px;display:flex}.KFXqYa_userPricePriceLine>.KFXqYa_ctlLabel{color:var(--dsw-alias-label-secondary);flex:0 0 44px;font-size:11px}.KFXqYa_userPricePriceLine .KFXqYa_userPriceInputNum{box-sizing:border-box;flex:1 1 0;width:auto;min-width:120px;max-width:240px}.KFXqYa_userPriceField{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_userPriceField .KFXqYa_ctlLabel{flex:none;font-size:11px}.KFXqYa_userPriceInput,.KFXqYa_userPriceInputNum{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);min-width:96px;max-width:160px;color:var(--dsw-alias-label-primary);border-radius:6px;padding:4px 8px;font-size:12px;line-height:16px}.KFXqYa_userPriceInputNum{min-width:72px;max-width:88px}.KFXqYa_rdo{color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;align-items:center;gap:6px;font-size:12px;line-height:16px;display:inline-flex}.KFXqYa_rdo input{opacity:0;pointer-events:none;position:absolute}.KFXqYa_rdoDot{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:50%;flex:none;width:14px;height:14px;position:relative}.KFXqYa_rdo input:checked+.KFXqYa_rdoDot{border-color:var(--dsw-static-blue-500)}.KFXqYa_rdo input:checked+.KFXqYa_rdoDot:after{content:"";background:var(--dsw-static-blue-500);border-radius:50%;position:absolute;inset:3px}.KFXqYa_inp{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:6px;align-items:center;gap:4px;padding:2px 6px;display:inline-flex}.KFXqYa_affix{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_prog{background:var(--dsw-alias-bg-module-platform);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.KFXqYa_progFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .2s}.KFXqYa_btn{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:999px;align-items:center;gap:6px;padding:0 12px;font-size:12px;line-height:16px;transition:border-color .16s,color .16s,background-color .16s;display:inline-flex}.KFXqYa_btn:hover{border-color:var(--dsw-static-blue-500);color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-static-blue-500) 12%, var(--dsw-alias-bg-layer-1))}.KFXqYa_modelTable tbody td:not(:first-child) tbody td:not(:first-child){text-align:right;font-family:var(--mono);font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary)}`,document.head.appendChild(e)}var j={siteRowMeta:`KFXqYa_siteRowMeta`,floatSubPlan:`KFXqYa_floatSubPlan`,dashboardIn:`KFXqYa_dashboardIn`,plgTag:`KFXqYa_plgTag`,healthBadgeOk:`KFXqYa_healthBadgeOk`,triggerPopSubscription:`KFXqYa_triggerPopSubscription`,tabButton:`KFXqYa_tabButton`,bucketOfficial:`KFXqYa_bucketOfficial`,heroBudgetFillOver:`KFXqYa_heroBudgetFillOver`,tokenModelBar:`KFXqYa_tokenModelBar`,budgetFillOver:`KFXqYa_budgetFillOver`,peakCardOff:`KFXqYa_peakCardOff`,setGrid2:`KFXqYa_setGrid2`,tabNav:`KFXqYa_tabNav`,healthBadgeBad:`KFXqYa_healthBadgeBad`,shareDot:`KFXqYa_shareDot`,shareSegUser:`KFXqYa_shareSegUser`,emptyRow:`KFXqYa_emptyRow`,perfBar:`KFXqYa_perfBar`,rdoDot:`KFXqYa_rdoDot`,shareTrack:`KFXqYa_shareTrack`,chartSvg:`KFXqYa_chartSvg`,perfChipOff:`KFXqYa_perfChipOff`,roundsBarColOff:`KFXqYa_roundsBarColOff`,heroGaugeLabel:`KFXqYa_heroGaugeLabel`,ubModelName:`KFXqYa_ubModelName`,currencyToggle:`KFXqYa_currencyToggle`,subscriptionTrack:`KFXqYa_subscriptionTrack`,peakTagPrimary:`KFXqYa_peakTagPrimary`,balanceDetailPop:`KFXqYa_balanceDetailPop`,btn:`KFXqYa_btn`,chartTooltipSplit:`KFXqYa_chartTooltipSplit`,roundsBarColPeak:`KFXqYa_roundsBarColPeak`,plgItem:`KFXqYa_plgItem`,providerGroupName:`KFXqYa_providerGroupName`,plgLabel:`KFXqYa_plgLabel`,peakDesc:`KFXqYa_peakDesc`,ubNotesTerm:`KFXqYa_ubNotesTerm`,peakClose:`KFXqYa_peakClose`,setCardDesc:`KFXqYa_setCardDesc`,ubNotesDesc:`KFXqYa_ubNotesDesc`,triggerPopSwitcher:`KFXqYa_triggerPopSwitcher`,triggerSub:`KFXqYa_triggerSub`,chartTooltipModelDetail:`KFXqYa_chartTooltipModelDetail`,siteRowTitle:`KFXqYa_siteRowTitle`,feeChipOff:`KFXqYa_feeChipOff`,subscriptionFillWarn:`KFXqYa_subscriptionFillWarn`,reconcileDismiss:`KFXqYa_reconcileDismiss`,kpiGrid:`KFXqYa_kpiGrid`,bucketSep:`KFXqYa_bucketSep`,feeInlineNum:`KFXqYa_feeInlineNum`,closeButton:`KFXqYa_closeButton`,rdoChevron:`KFXqYa_rdoChevron`,siteRowCost:`KFXqYa_siteRowCost`,providerGroupBalance:`KFXqYa_providerGroupBalance`,healthBad:`KFXqYa_healthBad`,plgName:`KFXqYa_plgName`,peakCardCorner:`KFXqYa_peakCardCorner`,peakHead:`KFXqYa_peakHead`,numCol:`KFXqYa_numCol`,rowlineChev:`KFXqYa_rowlineChev`,subscriptionStatus:`KFXqYa_subscriptionStatus`,balanceDetailRow:`KFXqYa_balanceDetailRow`,subscriptionMeta:`KFXqYa_subscriptionMeta`,heatmapRangeButtonActive:`KFXqYa_heatmapRangeButtonActive`,heatmapYearMonths:`KFXqYa_heatmapYearMonths`,delta:`KFXqYa_delta`,chartAxisLabel:`KFXqYa_chartAxisLabel`,roundsBarFlagged:`KFXqYa_roundsBarFlagged`,ctlGroup:`KFXqYa_ctlGroup`,ubCardSub:`KFXqYa_ubCardSub`,setCardHead:`KFXqYa_setCardHead`,userPriceCheck:`KFXqYa_userPriceCheck`,setCardTitle:`KFXqYa_setCardTitle`,providerGroupTitle:`KFXqYa_providerGroupTitle`,floatTargetLabel:`KFXqYa_floatTargetLabel`,ubAlert:`KFXqYa_ubAlert`,triggerSpark:`KFXqYa_triggerSpark`,metricCell:`KFXqYa_metricCell`,popTagPrimary:`KFXqYa_popTagPrimary`,siteKindDirect:`KFXqYa_siteKindDirect`,na:`KFXqYa_na`,providerGroupBalanceLabel:`KFXqYa_providerGroupBalanceLabel`,plgNameRow:`KFXqYa_plgNameRow`,prog:`KFXqYa_prog`,progFill:`KFXqYa_progFill`,heatmapGrid:`KFXqYa_heatmapGrid`,popModelName:`KFXqYa_popModelName`,heatmapYearGrid:`KFXqYa_heatmapYearGrid`,subscriptionHead:`KFXqYa_subscriptionHead`,rowlineMuted:`KFXqYa_rowlineMuted`,uncataloguedTag:`KFXqYa_uncataloguedTag`,ubCardControlGroup:`KFXqYa_ubCardControlGroup`,heroLabel:`KFXqYa_heroLabel`,peakDotPrimary:`KFXqYa_peakDotPrimary`,shareSegPeak:`KFXqYa_shareSegPeak`,reconcileNotice:`KFXqYa_reconcileNotice`,heroReadout:`KFXqYa_heroReadout`,heroCurrency:`KFXqYa_heroCurrency`,ubNotes:`KFXqYa_ubNotes`,dashboardBody:`KFXqYa_dashboardBody`,tabPanel:`KFXqYa_tabPanel`,deltaUp:`KFXqYa_deltaUp`,siteKindTag:`KFXqYa_siteKindTag`,heatmapYearScroll:`KFXqYa_heatmapYearScroll`,metricValue:`KFXqYa_metricValue`,subscriptionReset:`KFXqYa_subscriptionReset`,heatmap:`KFXqYa_heatmap`,trendPanel:`KFXqYa_trendPanel`,plgVal:`KFXqYa_plgVal`,setCardMeta:`KFXqYa_setCardMeta`,floatSub:`KFXqYa_floatSub`,heatmapYearMonth:`KFXqYa_heatmapYearMonth`,popModel:`KFXqYa_popModel`,popDot:`KFXqYa_popDot`,currencyButton:`KFXqYa_currencyButton`,popHead:`KFXqYa_popHead`,heatmapHover:`KFXqYa_heatmapHover`,popModelLabel:`KFXqYa_popModelLabel`,balanceDetailHead:`KFXqYa_balanceDetailHead`,subscriptionExhausted:`KFXqYa_subscriptionExhausted`,peakCountSuccess:`KFXqYa_peakCountSuccess`,exportLabel:`KFXqYa_exportLabel`,chartGrid:`KFXqYa_chartGrid`,budgetOverPulse:`KFXqYa_budgetOverPulse`,chartHoverDot:`KFXqYa_chartHoverDot`,modelRowActive:`KFXqYa_modelRowActive`,peakCount:`KFXqYa_peakCount`,heatmapYear:`KFXqYa_heatmapYear`,heroBudgetLabel:`KFXqYa_heroBudgetLabel`,balanceDetailLabel:`KFXqYa_balanceDetailLabel`,heroGaugePctOver:`KFXqYa_heroGaugePctOver`,kpiDetail:`KFXqYa_kpiDetail`,shareSegAssistant:`KFXqYa_shareSegAssistant`,ubExtraName:`KFXqYa_ubExtraName`,rowlineRight:`KFXqYa_rowlineRight`,shareItem:`KFXqYa_shareItem`,dashboardModal:`KFXqYa_dashboardModal`,chartLegend:`KFXqYa_chartLegend`,switchOn:`KFXqYa_switchOn`,providerGroupMeta:`KFXqYa_providerGroupMeta`,triggerLabel:`KFXqYa_triggerLabel`,ubNotesItem:`KFXqYa_ubNotesItem`,feeNum:`KFXqYa_feeNum`,setCard:`KFXqYa_setCard`,userPriceField:`KFXqYa_userPriceField`,userPricePriceLine:`KFXqYa_userPricePriceLine`,kpiValue:`KFXqYa_kpiValue`,metricGrid:`KFXqYa_metricGrid`,triggerWrap:`KFXqYa_triggerWrap`,popModelStatusLow:`KFXqYa_popModelStatusLow`,heroMain:`KFXqYa_heroMain`,shareSeg:`KFXqYa_shareSeg`,rowlineDrill:`KFXqYa_rowlineDrill`,triggerPrimary:`KFXqYa_triggerPrimary`,rangeButton:`KFXqYa_rangeButton`,roundsBars:`KFXqYa_roundsBars`,peakDot:`KFXqYa_peakDot`,panelTitle:`KFXqYa_panelTitle`,ctlCol:`KFXqYa_ctlCol`,subscriptionPlan:`KFXqYa_subscriptionPlan`,budgetFillWarn:`KFXqYa_budgetFillWarn`,unpricedHint:`KFXqYa_unpricedHint`,inp:`KFXqYa_inp`,subscriptionPct:`KFXqYa_subscriptionPct`,floatSubName:`KFXqYa_floatSubName`,heroSideSpacer:`KFXqYa_heroSideSpacer`,heatmapYearBody:`KFXqYa_heatmapYearBody`,rdoLabel:`KFXqYa_rdoLabel`,chartTooltipLabel:`KFXqYa_chartTooltipLabel`,chartLegendItemActive:`KFXqYa_chartLegendItemActive`,heroGauge:`KFXqYa_heroGauge`,dashboardTitle:`KFXqYa_dashboardTitle`,siteRowName:`KFXqYa_siteRowName`,feeInlineAlert:`KFXqYa_feeInlineAlert`,feeSep:`KFXqYa_feeSep`,peakCard:`KFXqYa_peakCard`,affix:`KFXqYa_affix`,heroSideValue:`KFXqYa_heroSideValue`,ubRate:`KFXqYa_ubRate`,subscriptionWindow:`KFXqYa_subscriptionWindow`,providerGroup:`KFXqYa_providerGroup`,popModelRow:`KFXqYa_popModelRow`,chartStack:`KFXqYa_chartStack`,ubChipPeak:`KFXqYa_ubChipPeak`,tokenModelShareRow:`KFXqYa_tokenModelShareRow`,heatmapCell:`KFXqYa_heatmapCell`,rdo:`KFXqYa_rdo`,triggerPop:`KFXqYa_triggerPop`,ubStatCard:`KFXqYa_ubStatCard`,flatTag:`KFXqYa_flatTag`,vendorLogo:`KFXqYa_vendorLogo`,balanceDaysBadge:`KFXqYa_balanceDaysBadge`,ubTagError:`KFXqYa_ubTagError`,panelHead:`KFXqYa_panelHead`,heroGaugeSvg:`KFXqYa_heroGaugeSvg`,rounds:`KFXqYa_rounds`,feeItem:`KFXqYa_feeItem`,heroGaugeCenter:`KFXqYa_heroGaugeCenter`,kpiTile:`KFXqYa_kpiTile`,plgHead:`KFXqYa_plgHead`,modelRowFocusable:`KFXqYa_modelRowFocusable`,modelName:`KFXqYa_modelName`,chartBar:`KFXqYa_chartBar`,subscriptionAuto:`KFXqYa_subscriptionAuto`,peakTag:`KFXqYa_peakTag`,tabButtonActive:`KFXqYa_tabButtonActive`,peakDotSuccess:`KFXqYa_peakDotSuccess`,ubTagSuccess:`KFXqYa_ubTagSuccess`,heatmapLegend:`KFXqYa_heatmapLegend`,peakCardPeak:`KFXqYa_peakCardPeak`,heroTop:`KFXqYa_heroTop`,modalFooter:`KFXqYa_modalFooter`,healthIdle:`KFXqYa_healthIdle`,balanceDetailValue:`KFXqYa_balanceDetailValue`,ubTablewrap:`KFXqYa_ubTablewrap`,railButton:`KFXqYa_railButton`,chartWrap:`KFXqYa_chartWrap`,roundsAxis:`KFXqYa_roundsAxis`,floatModeBtn:`KFXqYa_floatModeBtn`,chartLegendBar:`KFXqYa_chartLegendBar`,feeBar:`KFXqYa_feeBar`,perfChip:`KFXqYa_perfChip`,balanceDaysBadgeLow:`KFXqYa_balanceDaysBadgeLow`,dashboardRight:`KFXqYa_dashboardRight`,peakCardCenter:`KFXqYa_peakCardCenter`,setCell:`KFXqYa_setCell`,roundsBarLabel:`KFXqYa_roundsBarLabel`,floatSubHead:`KFXqYa_floatSubHead`,siteRow:`KFXqYa_siteRow`,providerGroupBadge:`KFXqYa_providerGroupBadge`,subscriptionGoldFlow:`KFXqYa_subscriptionGoldFlow`,heatmapYearWeekdays:`KFXqYa_heatmapYearWeekdays`,providerGroupHead:`KFXqYa_providerGroupHead`,peakAlertIn:`KFXqYa_peakAlertIn`,ctlLabel:`KFXqYa_ctlLabel`,ubStatGrid:`KFXqYa_ubStatGrid`,bucketThird:`KFXqYa_bucketThird`,plgTitle:`KFXqYa_plgTitle`,triggerSparkBar:`KFXqYa_triggerSparkBar`,heroGaugeArc:`KFXqYa_heroGaugeArc`,exportBar:`KFXqYa_exportBar`,feeChipPrimary:`KFXqYa_feeChipPrimary`,subscriptionCard:`KFXqYa_subscriptionCard`,rowline:`KFXqYa_rowline`,subscriptionName:`KFXqYa_subscriptionName`,ubChipLabel:`KFXqYa_ubChipLabel`,heatmapRangeSwitch:`KFXqYa_heatmapRangeSwitch`,tokenModelParts:`KFXqYa_tokenModelParts`,popDotSub:`KFXqYa_popDotSub`,bucketCost:`KFXqYa_bucketCost`,chartTooltipRow:`KFXqYa_chartTooltipRow`,dashboardSubtitle:`KFXqYa_dashboardSubtitle`,popDotDirect:`KFXqYa_popDotDirect`,roundsEmpty:`KFXqYa_roundsEmpty`,heroBudget:`KFXqYa_heroBudget`,ubCard:`KFXqYa_ubCard`,ubExtraNote:`KFXqYa_ubExtraNote`,modelDot:`KFXqYa_modelDot`,headTitleRow:`KFXqYa_headTitleRow`,shareSegTool:`KFXqYa_shareSegTool`,chartBarPlaceholder:`KFXqYa_chartBarPlaceholder`,heroSide:`KFXqYa_heroSide`,triggerMain:`KFXqYa_triggerMain`,ubCardHead:`KFXqYa_ubCardHead`,panel:`KFXqYa_panel`,metricValuePrimary:`KFXqYa_metricValuePrimary`,rowlineName:`KFXqYa_rowlineName`,reconcileIcon:`KFXqYa_reconcileIcon`,modelTable:`KFXqYa_modelTable`,triggerSparkHot:`KFXqYa_triggerSparkHot`,popTagSub:`KFXqYa_popTagSub`,feeInlineError:`KFXqYa_feeInlineError`,feeChipAlert:`KFXqYa_feeChipAlert`,heroSideItem:`KFXqYa_heroSideItem`,subscriptionFillOver:`KFXqYa_subscriptionFillOver`,balanceDetailTitle:`KFXqYa_balanceDetailTitle`,roundsFlagMark:`KFXqYa_roundsFlagMark`,heatmapYearCell:`KFXqYa_heatmapYearCell`,triggerPopSwitchCount:`KFXqYa_triggerPopSwitchCount`,peakCountPrimary:`KFXqYa_peakCountPrimary`,rowlist:`KFXqYa_rowlist`,chartTooltipDate:`KFXqYa_chartTooltipDate`,balanceDetailGrid:`KFXqYa_balanceDetailGrid`,heatmapYearWeekday:`KFXqYa_heatmapYearWeekday`,estimatedTag:`KFXqYa_estimatedTag`,tokenPanel:`KFXqYa_tokenPanel`,userPriceInput:`KFXqYa_userPriceInput`,budgetInput:`KFXqYa_budgetInput`,balanceDetailClose:`KFXqYa_balanceDetailClose`,heroBudgetTrack:`KFXqYa_heroBudgetTrack`,ubExtraRow:`KFXqYa_ubExtraRow`,ubChipOff:`KFXqYa_ubChipOff`,subscriptionTier:`KFXqYa_subscriptionTier`,peakTagSuccess:`KFXqYa_peakTagSuccess`,healthDot:`KFXqYa_healthDot`,roundsBarWrap:`KFXqYa_roundsBarWrap`,ctlRow:`KFXqYa_ctlRow`,panelHint:`KFXqYa_panelHint`,kpiGreen:`KFXqYa_kpiGreen`,heroSideLabel:`KFXqYa_heroSideLabel`,modelCell:`KFXqYa_modelCell`,perfChips:`KFXqYa_perfChips`,providerGroupList:`KFXqYa_providerGroupList`,heroGaugeTrack:`KFXqYa_heroGaugeTrack`,tabPanelIn:`KFXqYa_tabPanelIn`,popModelStatus:`KFXqYa_popModelStatus`,panelHeadControls:`KFXqYa_panelHeadControls`,ubTagPromo:`KFXqYa_ubTagPromo`,healthOk:`KFXqYa_healthOk`,subscriptionGrid:`KFXqYa_subscriptionGrid`,triggerPopEmpty:`KFXqYa_triggerPopEmpty`,heroBudgetFill:`KFXqYa_heroBudgetFill`,rangeButtonActive:`KFXqYa_rangeButtonActive`,heatmapFooter:`KFXqYa_heatmapFooter`,heroValue:`KFXqYa_heroValue`,switch:`KFXqYa_switch`,ubAlertLeft:`KFXqYa_ubAlertLeft`,ubTagAlert:`KFXqYa_ubTagAlert`,staleNotice:`KFXqYa_staleNotice`,dashboard:`KFXqYa_dashboard`,plgIcon:`KFXqYa_plgIcon`,plgDesc:`KFXqYa_plgDesc`,siteRowCallsLow:`KFXqYa_siteRowCallsLow`,healthBadge:`KFXqYa_healthBadge`,tokenModelPartOut:`KFXqYa_tokenModelPartOut`,rowlineDrillWrap:`KFXqYa_rowlineDrillWrap`,ubStatDetail:`KFXqYa_ubStatDetail`,exportButton:`KFXqYa_exportButton`,balanceCell:`KFXqYa_balanceCell`,userPriceRow:`KFXqYa_userPriceRow`,popDotNeutral:`KFXqYa_popDotNeutral`,heroGaugeArcOver:`KFXqYa_heroGaugeArcOver`,chartTooltipSwatch:`KFXqYa_chartTooltipSwatch`,ubPricepair:`KFXqYa_ubPricepair`,rdoSelect:`KFXqYa_rdoSelect`,userPriceLineMeta:`KFXqYa_userPriceLineMeta`,kpiLabel:`KFXqYa_kpiLabel`,rdoChevronOpen:`KFXqYa_rdoChevronOpen`,heroGaugePct:`KFXqYa_heroGaugePct`,siteKindSite:`KFXqYa_siteKindSite`,feeChipError:`KFXqYa_feeChipError`,shareLegend:`KFXqYa_shareLegend`,chartTooltipHead:`KFXqYa_chartTooltipHead`,feeSuffix:`KFXqYa_feeSuffix`,floatModeBtnOn:`KFXqYa_floatModeBtnOn`,subscriptionWindowLabel:`KFXqYa_subscriptionWindowLabel`,shareValue:`KFXqYa_shareValue`,roundsBar:`KFXqYa_roundsBar`,tableScroll:`KFXqYa_tableScroll`,heatmapRangeButton:`KFXqYa_heatmapRangeButton`,chartLegendItem:`KFXqYa_chartLegendItem`,planTag:`KFXqYa_planTag`,shareSegOff:`KFXqYa_shareSegOff`,modelTableScroll:`KFXqYa_modelTableScroll`,chartLegendLine:`KFXqYa_chartLegendLine`,roundsBarCol:`KFXqYa_roundsBarCol`,rangeToggle:`KFXqYa_rangeToggle`,triggerYen:`KFXqYa_triggerYen`,modelProvider:`KFXqYa_modelProvider`,hero:`KFXqYa_hero`,userPriceInputNum:`KFXqYa_userPriceInputNum`,metricLabel:`KFXqYa_metricLabel`,vendorLetter:`KFXqYa_vendorLetter`,siteRowCalls:`KFXqYa_siteRowCalls`,trigger:`KFXqYa_trigger`,triggerMetric:`KFXqYa_triggerMetric`,ubStatLabel:`KFXqYa_ubStatLabel`,triggerIcon:`KFXqYa_triggerIcon`,ctlRowStretch:`KFXqYa_ctlRowStretch`,heroBudgetValue:`KFXqYa_heroBudgetValue`,feeBarAbove:`KFXqYa_feeBarAbove`,tokenModelPartIn:`KFXqYa_tokenModelPartIn`,ubModel:`KFXqYa_ubModel`,ubStatValue:`KFXqYa_ubStatValue`,feeCount:`KFXqYa_feeCount`,popTitle:`KFXqYa_popTitle`,ubTable:`KFXqYa_ubTable`,heatmapCellEmpty:`KFXqYa_heatmapCellEmpty`,feeInline:`KFXqYa_feeInline`,deltaDown:`KFXqYa_deltaDown`,switchKnob:`KFXqYa_switchKnob`,ubAlertNote:`KFXqYa_ubAlertNote`,chartEmpty:`KFXqYa_chartEmpty`,currencyButtonActive:`KFXqYa_currencyButtonActive`,setGrid3:`KFXqYa_setGrid3`,dashboardHead:`KFXqYa_dashboardHead`,subscriptionFill:`KFXqYa_subscriptionFill`,"billing-trigger":`KFXqYa_billing-trigger`,ubCardTitle:`KFXqYa_ubCardTitle`,plgLink:`KFXqYa_plgLink`,chartLine:`KFXqYa_chartLine`,floatTarget:`KFXqYa_floatTarget`,perfChipDot:`KFXqYa_perfChipDot`,plgGrid:`KFXqYa_plgGrid`,siteKindUnknown:`KFXqYa_siteKindUnknown`,reconcileText:`KFXqYa_reconcileText`,metricValueSuccess:`KFXqYa_metricValueSuccess`,chartTooltip:`KFXqYa_chartTooltip`,ubTag:`KFXqYa_ubTag`,heroMeta:`KFXqYa_heroMeta`,ubTagNeutral:`KFXqYa_ubTagNeutral`,rdoRow:`KFXqYa_rdoRow`,userPriceBody:`KFXqYa_userPriceBody`,chartCrosshair:`KFXqYa_chartCrosshair`};let re={"opencode-go":{type:`code`,subscription:{amount:10,currency:`USD`,period:`month`},tier:{amount:10,currency:`USD`,periodDays:7,label:`周额度 $30`}},opencode:{type:`code`,subscription:{amount:10,currency:`USD`,period:`month`},tier:{amount:10,currency:`USD`,periodDays:7,label:`周额度 $30`}},"kimi-coding":{type:`code`},"zai-coding-cn":{type:`code`},"zai-coding":{type:`code`},"qwen-token-plan":{type:`code`},"qwen-token-plan-cn":{type:`code`},"xiaomi-token-plan-ams":{type:`code`},"xiaomi-token-plan-cn":{type:`code`},"xiaomi-token-plan-sgp":{type:`code`},"volcengine-token-plan":{type:`code`},"ark-token-plan":{type:`code`},"doubao-token-plan":{type:`code`},minimax:{type:`code`},"minimax-cn":{type:`code`},"minimax-token-plan":{type:`code`},"minimax-token-plan-cn":{type:`code`},"hunyuan-token-plan":{type:`code`},"tencent-token-plan":{type:`code`},"hy-token-plan":{type:`code`},"xinghuo-token-plan":{type:`code`},"xfyun-coding":{type:`code`},"spark-coding":{type:`code`},"huawei-token-plan":{type:`code`},"pangu-token-plan":{type:`code`},"huawei-maas-token-plan":{type:`code`},"volcengine-agent-plan":{type:`code`},"ark-agent-plan":{type:`code`},"baidu-token-plan":{type:`code`},"ernie-token-plan":{type:`code`},"wenxin-token-plan":{type:`code`}},ie={glm:`zai-coding-cn`,bigmodel:`zai-coding-cn`,zhipu:`zai-coding-cn`,zhipuai:`zai-coding-cn`,zai:`zai-coding`,ark:`volcengine-token-plan`,volcengine:`volcengine-token-plan`,doubao:`doubao-token-plan`,moonshot:`kimi-coding`,kimi:`kimi-coding`,xiaomi:`xiaomi-token-plan-cn`,opencode:`opencode-go`};function M(e){return e===``?e:ie[e]??e}function ae(e){let t=re[M(e)];return t?.type===`code`?t.tier:void 0}let oe=[{key:`deepseek-v4-flash`,input:.14,cacheHit:.0028,output:.28},{key:`deepseek-v4-pro`,input:.435,cacheHit:.003625,output:.87},{key:`gpt-5.6-sol`,input:5,cacheHit:.5,output:30},{key:`gpt-5.6-terra`,input:2,cacheHit:.2,output:12},{key:`gpt-5.6-luna`,input:.2,cacheHit:.02,output:1.2},{key:`glm-5.2`,input:1.4,cacheHit:.26,output:4.4},{key:`qwen3.8-max`,input:2,cacheHit:.21,output:6},{key:`kimi-k3`,input:2.82,cacheHit:.28,output:14.08},{key:`grok-4.6`,input:2,cacheHit:.5,output:6},{key:`gemini-2.5-pro`,input:1.25,cacheHit:.125,output:10}],N,P,se,ce,F;function le(e){let t=/:\/\//.test(e)?e:`https://${e}`;try{return new URL(t).origin}catch{return e.trim().toLowerCase().replace(/\/+$/,``)}}function ue(e,t){return le(e)===le(t)}function de(e){F=e.length>0?e:void 0}function fe(){return F}function pe(e){return ke(e)}function me(e,t){let n=he(e,t);if(n!==void 0)return{input:n.input,cacheHit:n.cacheHit,output:n.output,...n.currency===void 0?{}:{currency:n.currency},...n.offPeak===void 0?{}:{offPeak:n.offPeak}}}function he(e,t){if(F===void 0)return;let n=pe(e),r=V(n),i=e=>pe(e.key)===n||V(e.key)===r;if(t!==void 0){for(let e of F)if(e.origin!==void 0&&e.origin!==``&&i(e)&&ue(e.origin,t))return e}for(let e of F)if((e.origin===void 0||e.origin===``)&&i(e))return e}function ge(e){if(F===void 0)return;let t=pe(e),n=V(t);return F.find(e=>e.origin!==void 0&&e.origin!==``&&(pe(e.key)===t||V(e.key)===n))}function _e(e){N=typeof e.rate==`number`&&Number.isFinite(e.rate)&&e.rate>0?e.rate:void 0,P=e.prices,se=e.extraModels}function ve(e){ce=e}function ye(){return N??6.79}function be(){return{rate:ye(),live:N!==void 0}}let I=.5;function xe(e){return e>=9&&e<12||e>=14&&e<18}function Se(e){return e==null||!Number.isFinite(e)?`peak`:Ce(e)?`offPeak`:xe((new Date(e).getUTCHours()+8)%24)?`peak`:`offPeak`}function Ce(e){let t=new Date(e+288e5).getUTCDay();return t===0||t===6}function L(e){let t=new Date(e+288e5),n=t.getUTCDay(),r=t.getUTCHours()*36e5+t.getUTCMinutes()*6e4+t.getUTCSeconds()*1e3+t.getUTCMilliseconds();return(n===0?1:2)*864e5-r+324e5}let we=[540,720,840,1080];function Te(e){return((e+288e5)%864e5+864e5)%864e5}function R(e){if(Ce(e))return{tier:`offPeak`,nextSwitchInMs:L(e)};let t=Te(e);for(let n of we){let r=n*6e4;if(t<r)return{tier:Se(e),nextSwitchInMs:r-t}}let n=we[0]??0;return{tier:Se(e),nextSwitchInMs:864e5-t+n*6e4}}function z(e,t){let{nextSwitchInMs:n}=R(e);if(n>t)return null;let r=e+n;return{entering:Se(r),atMs:r}}function B(e){let t=Math.max(1,Math.ceil(e/6e4)),n=Math.floor(t/60),r=t%60;return n>0?`${n}h${String(r).padStart(2,`0`)}m`:`${r}m`}let Ee=[{key:`flash`,name:`DeepSeek V4 Flash`,provider:`DeepSeek`,colorVar:`dsw-static-blue-500`,price:{currency:`CNY`,input:3,cacheHit:.1,output:9,offPeak:{input:1.5,cacheHit:.05,output:4.5}},peakHours:`09:00-12:00 / 14:00-18:00`},{key:`flash-vision-exp`,name:`DeepSeek V4 Flash Vision (Exp)`,provider:`DeepSeek`,colorVar:`dsw-static-blue-500`,price:{currency:`CNY`,input:3,cacheHit:.1,output:9,offPeak:{input:1.5,cacheHit:.05,output:4.5}},peakHours:`09:00-12:00 / 14:00-18:00`},{key:`pro`,name:`DeepSeek V4 Pro`,provider:`DeepSeek`,colorVar:`dsw-static-deepseek-500`,price:{currency:`CNY`,input:9,cacheHit:.3,output:27,offPeak:{input:4.5,cacheHit:.15,output:13.5}},peakHours:`09:00-12:00 / 14:00-18:00`},{key:`glm`,name:`GLM-5.2`,provider:`智谱 AI`,colorVar:`dsw-static-blue-600`,price:{currency:`CNY`,input:8,cacheHit:2,output:28}},{key:`glm-5.3`,name:`GLM-5.3`,provider:`智谱 AI`,colorVar:`dsw-static-blue-500`,price:{currency:`CNY`,input:8,cacheHit:2,output:28}},{key:`glm-5.3-flash`,name:`GLM-5.3-Flash`,provider:`智谱 AI`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:.8,cacheHit:.23,output:2.8},promo:{factor:.5,endsAtMs:Date.UTC(2026,8,8,16,0,0),note:`限时 5 折`}},{key:`glm-4.6`,name:`GLM-4.6`,provider:`智谱 AI`,colorVar:`dsw-static-blue-400`,price:{currency:`CNY`,input:4,cacheHit:.8,output:16}},{key:`glm-4.5-air`,name:`GLM-4.5-Air`,provider:`智谱 AI`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:.8,cacheHit:.16,output:2}},{key:`glm-4.7`,name:`GLM-4.7`,provider:`智谱 AI`,colorVar:`dsw-static-blue-400`,price:{currency:`CNY`,input:4,cacheHit:1,output:16},estimated:!0},{key:`glm-5-turbo`,name:`GLM-5-Turbo`,provider:`智谱 AI`,colorVar:`dsw-static-blue-500`,price:{currency:`CNY`,input:5,cacheHit:1.2,output:22}},{key:`glm-5.1`,name:`GLM-5.1`,provider:`智谱 AI`,colorVar:`dsw-static-blue-600`,price:{currency:`CNY`,input:6,cacheHit:1.2,output:24}},{key:`glm-5v-turbo`,name:`GLM-5V-Turbo`,provider:`智谱 AI`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:5,cacheHit:1.2,output:22}},{key:`qwen-3.8-max`,name:`Qwen3.8 Max`,provider:`阿里通义`,colorVar:`dsw-static-blue-600`,price:{currency:`CNY`,input:12,cacheHit:1.5,output:36},extraRows:[{label:`显式缓存创建`,input:15},{label:`显式缓存命中`,input:1},{label:`Batch File`,input:6,output:18,note:`长期半价`},{label:`Batch Chat`,input:12,output:36,note:`与标准价一致`}]},{key:`qwen-3.8-flash`,name:`Qwen3.8 Flash`,provider:`阿里通义`,colorVar:`dsw-static-blue-400`,price:{currency:`CNY`,input:1,cacheHit:.1,output:3},extraRows:[{label:`显式缓存创建`,input:1.25},{label:`显式缓存命中`,input:.1},{label:`Batch File`,input:.5,output:1.5,note:`长期半价`},{label:`Batch Chat`,input:1,output:3,note:`与标准价一致`}]},{key:`qwen-max`,name:`Qwen3.7-Max`,provider:`阿里通义`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:12,cacheHit:1.2,output:36},promo:{factor:.5,note:`限时 5 折`},extraRows:[{label:`显式缓存创建`,input:15},{label:`显式缓存命中`,input:1.2},{label:`Batch File`,input:6,output:18,note:`长期半价`},{label:`Batch Chat`,input:12,output:36,note:`与标准价一致`}]},{key:`qwen-plus`,name:`Qwen3.5-Plus`,provider:`阿里通义`,colorVar:`dsw-static-blue-500`,price:{currency:`CNY`,input:.8,cacheHit:.08,output:4.8},extraRows:[{label:`显式缓存创建`,input:1},{label:`显式缓存命中`,input:.08},{label:`Batch File`,input:.4,output:2.4,note:`长期半价`},{label:`Batch Chat`,input:.8,output:4.8,note:`与标准价一致`}]},{key:`qwen-flash`,name:`Qwen3.5-Flash`,provider:`阿里通义`,colorVar:`dsw-static-blue-400`,price:{currency:`CNY`,input:.2,cacheHit:.02,output:2},extraRows:[{label:`显式缓存创建`,input:.25},{label:`显式缓存命中`,input:.02}]},{key:`doubao`,name:`Doubao Seed-2.0 Pro`,provider:`字节豆包`,colorVar:`dsw-static-red-500`,price:{currency:`CNY`,input:3.2,cacheHit:.64,output:16}},{key:`doubao-mini`,name:`Doubao Seed-2.0 Mini`,provider:`字节豆包`,colorVar:`dsw-static-red-300`,price:{currency:`CNY`,input:.2,cacheHit:.02,output:2}},{key:`doubao-1.6`,name:`Doubao Seed-1.6`,provider:`字节豆包`,colorVar:`dsw-static-red-400`,price:{currency:`CNY`,input:.8,cacheHit:0,output:8}},{key:`doubao-seed-evolving`,name:`Doubao-Seed-Evolving`,provider:`字节豆包`,colorVar:`dsw-static-red-500`,price:{currency:`CNY`,input:6,cacheHit:1.2,output:30}},{key:`doubao-seed-2.1-pro`,name:`Doubao Seed-2.1 Pro`,provider:`字节豆包`,colorVar:`dsw-static-red-400`,price:{currency:`CNY`,input:6,cacheHit:1.2,output:30}},{key:`doubao-seed-2.1-turbo`,name:`Doubao Seed-2.1 Turbo`,provider:`字节豆包`,colorVar:`dsw-static-red-300`,price:{currency:`CNY`,input:3,cacheHit:.6,output:15}},{key:`kimi`,name:`Kimi K2.7 Code`,provider:`月之暗面`,colorVar:`dsw-static-neutral-bluish-700`,price:{currency:`CNY`,input:6.5,cacheHit:1.3,output:27}},{key:`kimi-k2.7-hs`,name:`Kimi K2.7 Code HighSpeed`,provider:`月之暗面`,colorVar:`dsw-static-neutral-bluish-600`,price:{currency:`CNY`,input:13,cacheHit:2.6,output:54}},{key:`kimi-k2.6`,name:`Kimi K2.6`,provider:`月之暗面`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`CNY`,input:6.5,cacheHit:1.1,output:27}},{key:`kimi-k3`,name:`Kimi K3`,provider:`月之暗面`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`CNY`,input:20,cacheHit:2,output:100}},{key:`mimo-v2.5`,name:`MiMo V2.5`,provider:`小米`,colorVar:`dsw-static-green-400`,price:{currency:`CNY`,input:1,cacheHit:.02,output:2}},{key:`mimo-v2.5-pro`,name:`MiMo V2.5 Pro`,provider:`小米`,colorVar:`dsw-static-green-400`,price:{currency:`CNY`,input:3,cacheHit:.025,output:6}},{key:`minimax`,name:`MiniMax-M3`,provider:`MiniMax`,colorVar:`dsw-static-amber-500`,price:{currency:`CNY`,input:2.1,cacheHit:.42,output:8.4}},{key:`minimax-m2.7`,name:`MiniMax-M2.7`,provider:`MiniMax`,colorVar:`dsw-static-amber-400`,price:{currency:`CNY`,input:2.1,cacheHit:.42,output:8.4}},{key:`minimax-m2.7-highspeed`,name:`MiniMax-M2.7-highspeed`,provider:`MiniMax`,colorVar:`dsw-static-amber-500`,price:{currency:`CNY`,input:4.2,cacheHit:.42,output:16.8}},{key:`ernie`,name:`ERNIE-5.1`,provider:`百度文心`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:4,cacheHit:.4,output:18}},{key:`hunyuan`,name:`混元 Hy3`,provider:`腾讯混元`,colorVar:`dsw-static-amber-400`,price:{currency:`CNY`,input:1,cacheHit:.25,output:4}},{key:`hunyuan-t1`,name:`混元 T1`,provider:`腾讯混元`,colorVar:`dsw-static-amber-300`,price:{currency:`CNY`,input:1,cacheHit:.1,output:4}},{key:`yi`,name:`Yi-Lightning`,provider:`零一万物`,colorVar:`dsw-static-green-500`,price:{currency:`CNY`,input:.99,cacheHit:.1,output:.99}},{key:`step`,name:`Step 3.7 Flash`,provider:`阶跃星辰`,colorVar:`dsw-static-neutral-bluish-400`,price:{currency:`CNY`,input:1.35,cacheHit:.27,output:8.1}},{key:`spark`,name:`Spark 4.0 Ultra`,provider:`科大讯飞`,colorVar:`dsw-static-green-400`,price:{currency:`CNY`,input:5,cacheHit:.5,output:10},estimated:!0},{key:`sensenova`,name:`SenseNova 6.5`,provider:`商汤`,colorVar:`dsw-static-red-400`,price:{currency:`CNY`,input:4.5,cacheHit:.45,output:9},estimated:!0},{key:`baichuan`,name:`Baichuan M3-Plus`,provider:`百川智能`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`CNY`,input:5,cacheHit:.5,output:9}},{key:`gpt-5.6-sol`,name:`GPT-5.6 Sol`,provider:`OpenAI`,colorVar:`dsw-static-green-500`,price:{currency:`USD`,input:5,cacheHit:.5,output:30}},{key:`gpt-5.6-terra`,name:`GPT-5.6 Terra`,provider:`OpenAI`,colorVar:`dsw-static-green-400`,price:{currency:`USD`,input:2,cacheHit:.2,output:12}},{key:`gpt-5.6-luna`,name:`GPT-5.6 Luna`,provider:`OpenAI`,colorVar:`dsw-static-green-500`,price:{currency:`USD`,input:.2,cacheHit:.02,output:1.2}},{key:`gemini-pro`,name:`Gemini 3.1 Pro`,provider:`Google`,colorVar:`dsw-static-blue-600`,price:{currency:`USD`,input:2,cacheHit:.2,output:12,offPeak:{input:1,cacheHit:.1,output:6}},peakHours:`Standard / Flex`,tierSemantics:`latency`},{key:`gemini-flash`,name:`Gemini 3.6 Flash`,provider:`Google`,colorVar:`dsw-static-blue-400`,price:{currency:`USD`,input:1.5,cacheHit:.15,output:7.5,offPeak:{input:.75,cacheHit:.075,output:3.75}},peakHours:`Standard / Flex`,tierSemantics:`latency`},{key:`grok`,name:`Grok 4.6`,provider:`xAI`,colorVar:`dsw-static-neutral-bluish-700`,price:{currency:`USD`,input:2,cacheHit:.5,output:6}},{key:`grok-4.3`,name:`Grok 4.3`,provider:`xAI`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`USD`,input:1.25,cacheHit:.2,output:2.5}},{key:`llama`,name:`Llama 4 Maverick`,provider:`Meta`,colorVar:`dsw-static-red-500`,price:{currency:`USD`,input:.2,cacheHit:.05,output:.6}},{key:`llama-scout`,name:`Llama 4 Scout`,provider:`Meta`,colorVar:`dsw-static-red-400`,price:{currency:`USD`,input:.1,cacheHit:.025,output:.3}},{key:`claude-opus-4-6`,name:`Claude Opus 4.6`,provider:`Anthropic`,colorVar:`dsw-static-red-500`,price:{currency:`USD`,input:5,cacheHit:.5,output:25}},{key:`claude-sonnet-4-6`,name:`Claude Sonnet 4.6`,provider:`Anthropic`,colorVar:`dsw-static-red-400`,price:{currency:`USD`,input:3,cacheHit:.3,output:15}},{key:`claude-haiku-4-5`,name:`Claude Haiku 4.5`,provider:`Anthropic`,colorVar:`dsw-static-red-300`,price:{currency:`USD`,input:1,cacheHit:.1,output:5}},{key:`claude-opus-5`,name:`Claude Opus 5`,provider:`Anthropic`,colorVar:`dsw-static-red-500`,price:{currency:`USD`,input:5,cacheHit:.5,output:25}},{key:`claude-sonnet-5`,name:`Claude Sonnet 5`,provider:`Anthropic`,colorVar:`dsw-static-red-400`,price:{currency:`USD`,input:2,cacheHit:.2,output:10}},{key:`mistral-large-2512`,name:`Mistral Large 3`,provider:`Mistral AI`,colorVar:`dsw-static-violet-500`,price:{currency:`USD`,input:.5,cacheHit:.05,output:1.5}},{key:`mistral-small-2603`,name:`Mistral Small 4`,provider:`Mistral AI`,colorVar:`dsw-static-violet-400`,price:{currency:`USD`,input:.15,cacheHit:.015,output:.6}},{key:`ministral-8b-latest`,name:`Ministral 8B`,provider:`Mistral AI`,colorVar:`dsw-static-violet-300`,price:{currency:`USD`,input:.1,cacheHit:.01,output:.1}},{key:`command-a-03-2025`,name:`Command A`,provider:`Cohere`,colorVar:`dsw-static-cyan-500`,price:{currency:`USD`,input:2.5,cacheHit:.25,output:10}},{key:`command-r-08-2024`,name:`Command R`,provider:`Cohere`,colorVar:`dsw-static-cyan-400`,price:{currency:`USD`,input:.15,cacheHit:.015,output:.6}},{key:`longcat-2.0`,name:`LongCat 2.0`,provider:`美团`,colorVar:`dsw-static-amber-500`,price:{currency:`CNY`,input:4,cacheHit:.8,output:16},estimated:!0},{key:`minicpm-v-4.5`,name:`MiniCPM-V 4.5`,provider:`面壁智能`,colorVar:`dsw-static-green-500`,price:{currency:`CNY`,input:1,cacheHit:.2,output:4},estimated:!0},{key:`ernie-4.5`,name:`ERNIE-4.5 300B`,provider:`百度文心`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:2,cacheHit:.4,output:8},estimated:!0},{key:`dots-3-note-preview`,name:`Dots3-Note Preview`,provider:`小红书`,colorVar:`dsw-static-red-500`,price:{currency:`CNY`,input:2,cacheHit:.4,output:8},estimated:!0},{key:`qwen3.6-max`,name:`Qwen3.6 Max`,provider:`阿里通义`,colorVar:`dsw-static-orange-500`,price:{currency:`CNY`,input:9,cacheHit:.9,output:54},extraRows:[{label:`显式缓存创建`,input:11.25},{label:`显式缓存命中`,input:.9}]},{key:`qwen3-coder-plus`,name:`Qwen3-Coder Plus`,provider:`阿里通义`,colorVar:`dsw-static-orange-400`,price:{currency:`CNY`,input:4,cacheHit:.8,output:16},extraRows:[{label:`显式缓存创建`,input:5},{label:`显式缓存命中`,input:.4}]},{key:`qwen3-coder`,name:`Qwen3-Coder 480B`,provider:`阿里通义`,colorVar:`dsw-static-orange-300`,price:{currency:`CNY`,input:4,cacheHit:.8,output:16},estimated:!0},{key:`glm-4.5-x`,name:`GLM-4.5-X`,provider:`智谱 AI`,colorVar:`dsw-static-blue-400`,price:{currency:`CNY`,input:4,cacheHit:1,output:16},estimated:!0},{key:`glm-5.2-fast`,name:`GLM-5.2 Fast`,provider:`智谱 AI`,colorVar:`dsw-static-blue-300`,price:{currency:`CNY`,input:6,cacheHit:1.2,output:24},estimated:!0},{key:`kimi-k3-fast`,name:`Kimi K3 Fast`,provider:`月之暗面`,colorVar:`dsw-static-cyan-400`,price:{currency:`CNY`,input:20,cacheHit:2,output:100},estimated:!0},{key:`kimi-k2.7-code-fast`,name:`Kimi K2.7 Code Fast`,provider:`月之暗面`,colorVar:`dsw-static-cyan-400`,price:{currency:`CNY`,input:6.5,cacheHit:1.3,output:27},estimated:!0},{key:`kimi-k2.6-fast`,name:`Kimi K2.6 Fast`,provider:`月之暗面`,colorVar:`dsw-static-cyan-300`,price:{currency:`CNY`,input:6.5,cacheHit:1.1,output:27},estimated:!0},{key:`kimi-k2.6-turbo`,name:`Kimi K2.6 Turbo`,provider:`月之暗面`,colorVar:`dsw-static-cyan-300`,price:{currency:`CNY`,input:6.5,cacheHit:1.1,output:27},estimated:!0},{key:`kimi-k2-thinking-turbo`,name:`Kimi K2 Thinking Turbo`,provider:`月之暗面`,colorVar:`dsw-static-cyan-300`,price:{currency:`CNY`,input:8,cacheHit:1,output:58}},{key:`doubao-seed-2.0-code`,name:`Doubao Seed-2.0 Code`,provider:`字节豆包`,colorVar:`dsw-static-red-500`,price:{currency:`CNY`,input:3.2,cacheHit:.64,output:16}},{key:`doubao-seed-2.0-lite`,name:`Doubao Seed-2.0 Lite`,provider:`字节豆包`,colorVar:`dsw-static-red-300`,price:{currency:`CNY`,input:.6,cacheHit:.12,output:3.6}},{key:`other`,name:`其他模型`,provider:`Custom`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`CNY`,input:0,cacheHit:0,cacheMiss:0,output:0}}],De={"deepseek-v4-flash":`flash`,"deepseek-v4-flash-vision-exp":`flash-vision-exp`,"deepseek-v4-pro":`pro`,"glm-5.2":`glm`,"glm-4.5-air":`glm-4.5-air`,"glm-4.5air":`glm-4.5-air`,"glm-4.7":`glm-4.7`,"glm-5-turbo":`glm-5-turbo`,"glm-5.1":`glm-5.1`,"glm-5.3-flash":`glm-5.3-flash`,"glm-5v-turbo":`glm-5v-turbo`,"glm-5v.1":`glm-5v-turbo`,"claude-opus-4-6":`claude-opus-4-6`,"claude-opus-4.6":`claude-opus-4-6`,"claude-sonnet-4-6":`claude-sonnet-4-6`,"claude-sonnet-4.6":`claude-sonnet-4-6`,"claude-haiku-4-5":`claude-haiku-4-5`,"claude-haiku-4.5":`claude-haiku-4-5`,"claude-opus-5":`claude-opus-5`,"claude-sonnet-5":`claude-sonnet-5`,"mistral-large-2512":`mistral-large-2512`,"mistral-large-3":`mistral-large-2512`,"mistral-small-2603":`mistral-small-2603`,"mistral-small-4":`mistral-small-2603`,"ministral-8b-latest":`ministral-8b-latest`,"ministral-8b":`ministral-8b-latest`,"command-a-03-2025":`command-a-03-2025`,"command-a":`command-a-03-2025`,"command-r-08-2024":`command-r-08-2024`,"command-r":`command-r-08-2024`,"longcat-2.0":`longcat-2.0`,"longcat-2":`longcat-2.0`,"minicpm-v-4.5":`minicpm-v-4.5`,"minicpm-v-4.5-thinking":`minicpm-v-4.5`,"ernie-4.5":`ernie-4.5`,"ernie-4.5-300b":`ernie-4.5`,"dots-3-note-preview":`dots-3-note-preview`,"dots-3-note":`dots-3-note-preview`,"dots3-note-preview":`dots-3-note-preview`,"rednote-dots3":`dots-3-note-preview`,"doubao-seed-evolving":`doubao-seed-evolving`,"doubao-seed-evolve":`doubao-seed-evolving`,"doubao-seed-2.1-pro":`doubao-seed-2.1-pro`,"doubao-seed-2.1-pro-290000":`doubao-seed-2.1-pro`,"doubao-seed-2.1-turbo":`doubao-seed-2.1-turbo`,"doubao-seed-2-1-turbo":`doubao-seed-2.1-turbo`,"qwen3.8-max":`qwen-3.8-max`,"qwen3.8-flash":`qwen-3.8-flash`,"qwen3.7-max":`qwen-max`,"qwen3.6-max":`qwen3.6-max`,"qwen3.6-max-preview":`qwen3.6-max`,"qwen3-coder-plus":`qwen3-coder-plus`,"qwen3-coder":`qwen3-coder`,"qwen3-coder-480b":`qwen3-coder`,"glm-4.5-x":`glm-4.5-x`,"glm-4.5x":`glm-4.5-x`,"glm-5.2-fast":`glm-5.2-fast`,"glm-5.2f":`glm-5.2-fast`,"kimi-k3-fast":`kimi-k3-fast`,"kimi-k3f":`kimi-k3-fast`,"kimi-k2.7-code-fast":`kimi-k2.7-code-fast`,"kimi-k2.7-code-f":`kimi-k2.7-code-fast`,"kimi-k2.6-fast":`kimi-k2.6-fast`,"kimi-k2.6-turbo":`kimi-k2.6-turbo`,"kimi-k2-thinking-turbo":`kimi-k2-thinking-turbo`,"doubao-seed-2.0-code":`doubao-seed-2.0-code`,"doubao-seed-2-0-code":`doubao-seed-2.0-code`,"doubao-seed-2.0-lite":`doubao-seed-2.0-lite`,"doubao-seed-2-0-lite":`doubao-seed-2.0-lite`,"qwen-max":`qwen-max`,"hunyuan-t1":`hunyuan-t1`,"step-3.7-flash":`step`,"seed-2.0-mini":`doubao-mini`,k3:`kimi-k3`,"kimi-k3":`kimi-k3`,"minimax-m1":`minimax`,"minimax-m2":`minimax`,"minimax-m3":`minimax`,"minimax-m2.7":`minimax-m2.7`,"minimax-m2.7-highspeed":`minimax-m2.7-highspeed`,"minimax-m2.7-high-speed":`minimax-m2.7-highspeed`,"minimax-m2-7":`minimax-m2.7`,"minimax-m2-7-highspeed":`minimax-m2.7-highspeed`,"minimax-m2-7-high-speed":`minimax-m2.7-highspeed`};function V(e){return String(e).toLowerCase().replace(/\([^)]*\)/g,``).replace(/[^a-z0-9]+/g,``)}let Oe=(()=>{let e=new Map,t=(t,n)=>{let r=V(t);r!==``&&!e.has(r)&&e.set(r,n)};for(let e of Ee)t(e.key,e.key);for(let[e,n]of Object.entries(De))t(e,n);for(let e of oe)t(e.key,e.key);return e})();function ke(e){let t=De[e]??e;if(t===e){let t=V(e);if(t!==``){let e=Oe.get(t);if(e!==void 0)return e;let n=(se??[]).find(e=>V(e.key)===t);if(n!==void 0)return n.key}}return t}function Ae(e){let t=ke(e),n=P?.[t];if(n!==void 0)return n;let r=oe.find(e=>e.key.toLowerCase()===t.toLowerCase());if(r!==void 0)return{input:r.input,cacheHit:r.cacheHit,output:r.output}}function je(e){let t=ke(e),n=Ee.find(e=>e.key===t),r=se?.find(e=>e.key===t),i=n??(r===void 0?(()=>{let e=Ee.at(-1);if(e!==void 0)return e;throw Error(`MODEL_CATALOG must not be empty`)})():Me(r)),a=me(t);if(a!==void 0)return{...i,userPriced:!0,price:{currency:a.currency??`CNY`,input:a.input,cacheHit:a.cacheHit,output:a.output,...a.offPeak===void 0?{}:{offPeak:a.offPeak}}};let o=Ae(t);return o===void 0?i:{...i,price:{currency:`USD`,input:o.input,cacheHit:o.cacheHit,output:o.output}}}function Me(e){return{key:e.key,name:e.name,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:e.price.input,cacheHit:e.price.cacheHit,output:e.price.output}}}function Ne(e,t){let n=e.endsAtMs!==void 0&&t>=e.endsAtMs;return Number.isFinite(t)&&!n&&e.factor>0&&e.factor<1}function Pe(e,t){let{promo:n}=e;if(n===void 0||!Ne(n,t))return e;let r=e=>({input:e.input*n.factor,cacheHit:e.cacheHit*n.factor,...e.cacheMiss===void 0?{}:{cacheMiss:e.cacheMiss*n.factor},output:e.output*n.factor});return{...e,price:{...r(e.price),currency:e.price.currency,...e.price.offPeak===void 0?{}:{offPeak:r(e.price.offPeak)}}}}function Fe(e=Date.now()){let t=[...Ee.map(t=>Pe(t,e))],n=new Set(t.map(e=>e.key.toLowerCase())),r=new Set(t.map(e=>V(e.key)));for(let e of ce??[]){let i=e.id.toLowerCase();if((()=>{let t=ke(e.id);return Ee.find(e=>e.key===t)})()!==void 0)continue;let a=V(e.id);if(n.has(i)||a!==``&&r.has(a))continue;let o=(se??[]).find(e=>V(e.key)===a),s;if(o!==void 0)s=Me(o),e.name!==void 0&&e.name!==``&&(s={...s,name:e.name});else{let t=Ae(i);s=t===void 0?{key:ke(e.id),name:e.name??e.id,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:0,cacheHit:0,output:0},uncatalogued:!0}:{key:i,name:e.name??e.id,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:t.input,cacheHit:t.cacheHit,output:t.output}}}n.add(s.key.toLowerCase()),a!==``&&r.add(a),t.push(s)}return t.map(e=>{let t=me(e.key);return t===void 0?e:{...e,userPriced:!0,price:{currency:t.currency??`CNY`,input:t.input,cacheHit:t.cacheHit,output:t.output}}})}function Ie(e){let t=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return t===``?`#8b95a3`:t}function H(e,t,n){let r=t.cacheMiss>0?t.cacheMiss:Math.max(0,t.input-t.cacheHit),i=Math.min(t.cacheHit,t.input),a=(r*(e.cacheMiss??e.input)+i*e.cacheHit+t.output*e.output)/1e6;return n===`USD`?a*ye():a}function Le(e,t,n=I,r=Date.now()){let i=Pe(e,r),a=H(i.price,t,i.price.currency),o=i.price.offPeak===void 0?a:H(i.price.offPeak,t,i.price.currency);return a*n+o*(1-n)}function Re(e){let t=ye();return t>0?e/t:e}function U(e,t=`cny`){let n=Number(e);if(!Number.isFinite(n))return t===`cny`?`¥0`:`$0`;let r=t===`cny`?`¥`:`$`;return n<=0?`${r}0`:n>=1e3?`${r}${n.toFixed(0)}`:n>=10?`${r}${n.toFixed(1)}`:n>=.1?`${r}${n.toFixed(2)}`:`${r}${n.toFixed(3)}`}function ze(e,t=`CNY`){return e===0?`免费`:t===`USD`?e>=10?`$${e.toFixed(1)}`:`$${e.toFixed(2)}`:e>=10?`¥${e.toFixed(1)}`:`¥${e.toFixed(2)}`}function Be(e,t,n,r){return r<=0||!Number.isFinite(r)||t===(n===`usd`?`USD`:`CNY`)?e:n===`usd`?e/r:e*r}function W(e){return e>=1e9?`${(e/1e9).toFixed(2)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function Ve(e){let t=Number(e);return Number.isFinite(t)?`${t.toFixed(1)}%`:`0.0%`}let G={top:18,right:40,bottom:26,left:46};function He(e){let[,t,n]=e.split(`-`);return`${Number(t)}/${Number(n)}`}function Ue(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}function K(e,t){let n=[];for(let r=0;r<e;r+=t)n.push(r);return e>0&&n[n.length-1]!==e-1&&n.push(e-1),n}let q={key:`__total__`,name:`总计`,color:``};function We({data:e,models:t=[],currency:n=`cny`,metric:i=`cost`}){let[o,s]=(0,r.useState)(null),c=e=>U(n===`usd`?Re(e):e,n),l=e=>i===`tokens`?Ue(e):c(e),u=e=>i===`tokens`?e.tokens??0:e.cost,d=(0,r.useMemo)(()=>{let n=e.length;if(n===0)return null;let r=680-G.left-G.right,a=220-G.top-G.bottom,o=e=>n===1?G.left+r/2:G.left+r*e/(n-1),s=Math.max(...i===`tokens`?e.map(e=>e.tokens??0):e.map(e=>Math.max(e.cost,Object.values(e.byModel??{}).reduce((e,t)=>e+t,0))),1e-4),c=e=>G.top+a-e/s*a,l=Math.max(...e.map(e=>e.calls),1),d=e=>G.top+a-e/l*a,f=r/n,p=Math.min(18,f*.6);return{n,plotW:r,plotH:a,inner:o,yCost:c,yCalls:d,barW:p,bars:e.flatMap((e,n)=>{let r=o(n)-p/2;if(t.length===0||i===`tokens`)return[{date:e.date,model:q,x:r,base:0,value:u(e),topRounded:!0}];let a=null;for(let n of t)(e.byModel?.[n.key]??0)>0&&(a=n.key);let s=0;return t.map(t=>{let n=e.byModel?.[t.key]??0,i={date:e.date,model:t,x:r,base:s,value:n,topRounded:t.key===a};return s+=n,i})}),costTicks:[0,.25,.5,.75,1].map(e=>s*e).reverse(),callsTicks:[0,.25,.5,.75,1].map(e=>l*e).reverse(),linePath:e.map((e,t)=>{let n=d(e.calls);return`${t===0?`M`:`L`}${o(t)} ${n}`}).join(` `)}},[e,t,i]);if(d===null)return(0,a.jsx)(`div`,{className:j.chartEmpty,children:`暂无趋势数据`});let{n:f,plotW:p,plotH:m,inner:h,yCost:g,yCalls:_,barW:v,bars:y,costTicks:b,callsTicks:x,linePath:S}=d,C=o===null?void 0:e[o],w=K(f,Math.max(1,Math.ceil(f/8)));return(0,a.jsxs)(`div`,{className:j.chartWrap,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 220`,className:j.chartSvg,role:`img`,"aria-label":`Daily cost by model and total calls`,onMouseLeave:()=>{s(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-G.left)/p,r=Math.round(n*(f-1));s(Math.min(Math.max(r,0),f-1))},children:[b.map((e,t)=>{let n=g(e);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:G.left,x2:680-G.right,y1:n,y2:n,className:j.chartGrid}),(0,a.jsx)(`text`,{x:G.left-8,y:n+3,textAnchor:`end`,className:j.chartAxisLabel,children:l(e)})]},`cost-${t}`)}),y.map(t=>{if(t.value>0)return(0,a.jsx)(`rect`,{x:t.x,y:g(t.base+t.value),width:v,height:g(t.base)-g(t.base+t.value),rx:t.topRounded?2:0,className:t.model.color===``?j.chartBar:j.chartStack,style:t.model.color===``?void 0:{fill:t.model.color}},`${t.date}-${t.model.key}`);let n=e.find(e=>e.date===t.date);return n!==void 0&&n.calls>0&&t.base===0?(0,a.jsx)(`rect`,{x:t.x,y:g(0)-1,width:v,height:1,rx:0,className:j.chartBarPlaceholder},`${t.date}-${t.model.key}-placeholder`):null}),(0,a.jsx)(`path`,{d:S,fill:`none`,className:j.chartLine}),x.map((e,t)=>{let n=_(e);return(0,a.jsx)(`text`,{x:680-G.right+8,y:n+3,textAnchor:`start`,className:j.chartAxisLabel,children:Ue(e)},`calls-${t}`)}),w.map(t=>{let n=e[t];return n===void 0?null:(0,a.jsx)(`text`,{x:h(t),y:214,textAnchor:`middle`,className:j.chartAxisLabel,children:He(n.date)},n.date)}),o!==null&&(0,a.jsx)(`line`,{x1:h(o),x2:h(o),y1:G.top,y2:G.top+m,className:j.chartCrosshair})]}),C!==void 0&&o!==null&&(0,a.jsxs)(`div`,{className:j.chartTooltip,style:{left:`${h(o)/680*100}%`,top:`${g(C.cost)/220*100}%`},children:[(0,a.jsx)(`div`,{className:j.chartTooltipDate,children:C.date}),i!==`tokens`&&t.filter(e=>(C.byModel?.[e.key]??0)>0).map(e=>(0,a.jsxs)(`div`,{className:j.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:j.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,a.jsx)(`strong`,{children:c(C.byModel?.[e.key]??0)})]},e.key)),(0,a.jsxs)(`div`,{className:j.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:j.chartLegendBar}),`总计 `,(0,a.jsx)(`strong`,{children:i===`tokens`?Ue(C.tokens??0):c(C.cost)})]}),(0,a.jsxs)(`div`,{className:j.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:j.chartLegendLine}),`调用 `,(0,a.jsx)(`strong`,{children:C.calls.toLocaleString()})]})]}),t.length>0&&i!==`tokens`&&(0,a.jsxs)(`div`,{className:j.chartLegend,children:[t.map(e=>(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:j.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key)),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:j.chartLegendLine}),`调用`]})]})]})}let J={top:14,right:42,bottom:22,left:46};function Ge(e){return e.slice(5,13).replace(`T`,` `)}function Ke(e){return String(e>=100?Math.round(e):Number(e.toFixed(1)))}function qe(e,t,n){return t===`ttft`?`${Math.round(e)} ms`:`${e.toFixed(1)} ${n(`perfTpsUnit`)}`}function Je({perf:e,models:t,t:n}){let[i,o]=(0,r.useState)(()=>k()),[s,l]=(0,r.useState)(null),u=e=>{o(e),A(e)},d=e=>t.find(t=>t.key===e)?.color??`#8b95a3`,f=(0,r.useMemo)(()=>e===void 0?[]:Object.entries(e.byModel).map(([e,n])=>({key:e,name:t.find(t=>t.key===e)?.name??e,color:d(e),samples:n.samples,ttftAvg:n.ttftAvg,ttftP50:n.ttftP50,ttftP90:n.ttftP90,...n.ttftMax===void 0?{}:{ttftMax:n.ttftMax},...n.ttftSpikes===void 0?{}:{ttftSpikes:n.ttftSpikes},...n.tpsAvg===void 0?{}:{tpsAvg:n.tpsAvg},latencyAvg:n.latencyAvg,estimatedSamples:n.estimatedSamples})).sort((e,t)=>t.samples-e.samples||t.ttftP90-e.ttftP90),[e,t]),p=(0,r.useMemo)(()=>{if(e===void 0)return[];if(i.models!==void 0){let t=new Set(Object.keys(e.byModel));return i.models.filter(e=>t.has(e))}return f.slice(0,5).map(e=>e.key)},[e,f,i.models]),m=(0,r.useMemo)(()=>{if(e===void 0)return null;let t=Object.keys(e.byHourModel).sort().slice(-48);if(t.length===0)return null;let n=t.length,r=680-J.left-J.right,a=180-J.top-J.bottom,o=e=>n===1?J.left+r/2:J.left+r*e/(n-1),s=new Set(p),c=e=>i.metric===`ttft`?e?.ttftAvg:e?.tpsAvg,l=[],u=0;for(let r of f){if(!s.has(r.key))continue;let i=[];for(let a=0;a<n;a++){let n=t[a];if(n===void 0)continue;let s=c(e.byHourModel[n]?.[r.key]);s===void 0||!Number.isFinite(s)||(i.push({i:a,x:o(a),y:0,v:s}),s>u&&(u=s))}l.push({key:r.key,name:r.name,color:r.color,segments:[],points:i})}let d=l.reduce((e,t)=>e+t.points.length,0);u=Math.max(u,1);let m=e=>J.top+a-e/u*a;for(let e of l){let t=``,n=-2;for(let r of e.points)r.y=m(r.v),t!==``&&r.i!==n+1&&(e.segments.push(t),t=``),t+=`${t===``?`M`:`L`}${r.x} ${r.y} `,n=r.i;t!==``&&e.segments.push(t)}let h=Math.max(1,Math.ceil(n/8)),g=[];for(let e=0;e<n;e+=h)g.push(e);return g[g.length-1]!==n-1&&g.push(n-1),{hourKeys:t,n,plotW:r,plotH:a,inner:o,yOf:m,series:l,ticks:[0,.5,1].map(e=>u*e).reverse(),xTicks:g,totalPoints:d}},[e,f,p,i.metric]);if(e===void 0||f.length===0)return(0,a.jsx)(`div`,{className:j.chartEmpty,"data-testid":`billing-perf-empty`,children:n(`perfEmpty`)});let h=e=>{let t=p.includes(e)?p.filter(t=>t!==e):[...p,e];u({metric:i.metric,models:t})},g=e=>{u({metric:e,...i.models===void 0?{}:{models:i.models}})},_=s===null||m===null?[]:m.series.flatMap(e=>{let t=e.points.find(e=>e.i===s);return t===void 0?[]:[{key:e.key,name:e.name,color:e.color,v:t.v}]});return(0,a.jsxs)(`div`,{"data-testid":`billing-perf-panel`,children:[(0,a.jsx)(`div`,{className:j.tableScroll,"data-testid":`billing-perf-table`,children:(0,a.jsxs)(`table`,{className:j.modelTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:n(`model`)}),(0,a.jsx)(`th`,{className:j.numCol,children:n(`perfSamples`)}),(0,a.jsx)(`th`,{className:j.numCol,children:n(`perfTtft`)}),(0,a.jsx)(`th`,{className:j.numCol,children:n(`perfP50`)}),(0,a.jsx)(`th`,{className:j.numCol,children:n(`perfP90`)}),(0,a.jsx)(`th`,{className:j.numCol,children:n(`perfMax`)}),(0,a.jsx)(`th`,{className:j.numCol,children:n(`perfTps`)}),(0,a.jsx)(`th`,{className:j.numCol,children:n(`perfLatency`)}),(0,a.jsx)(`th`,{className:j.numCol,children:n(`perfEstimated`)})]})}),(0,a.jsx)(`tbody`,{children:f.map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:j.modelCell,children:[(0,a.jsx)(`span`,{className:j.modelDot,style:{background:e.color}}),(0,a.jsx)(`span`,{className:j.modelName,children:e.name})]})}),(0,a.jsx)(`td`,{className:j.numCol,children:e.samples.toLocaleString()}),(0,a.jsxs)(`td`,{className:j.numCol,children:[e.ttftAvg.toFixed(0),` ms`]}),(0,a.jsxs)(`td`,{className:j.numCol,children:[e.ttftP50.toFixed(0),` ms`]}),(0,a.jsxs)(`td`,{className:j.numCol,children:[e.ttftP90.toFixed(0),` ms`]}),(0,a.jsx)(`td`,{className:j.numCol,children:e.ttftMax===void 0?(0,a.jsx)(`span`,{className:j.na,children:`—`}):(0,a.jsxs)(`span`,{children:[e.ttftMax.toFixed(0),` ms`,e.ttftSpikes!==void 0&&e.ttftSpikes>0?` (${e.ttftSpikes}↑)`:``]})}),(0,a.jsx)(`td`,{className:j.numCol,children:e.tpsAvg===void 0?(0,a.jsx)(`span`,{className:j.na,children:`—`}):`${e.tpsAvg.toFixed(1)}`}),(0,a.jsxs)(`td`,{className:j.numCol,children:[e.latencyAvg.toFixed(0),` ms`]}),(0,a.jsx)(`td`,{className:j.numCol,children:e.estimatedSamples>0?e.estimatedSamples:(0,a.jsx)(`span`,{className:j.na,children:`—`})})]},e.key))})]})}),m!==null&&(0,a.jsxs)(`div`,{"data-testid":`billing-perf-hour`,children:[(0,a.jsx)(`div`,{className:j.perfBar,children:(0,a.jsx)(`span`,{className:j.rangeToggle,role:`group`,"aria-label":n(`perfTitle`),children:[`ttft`,`tps`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(j.rangeButton,i.metric===e&&j.rangeButtonActive),"aria-pressed":i.metric===e,"data-testid":`billing-perf-tab-${e}`,onClick:()=>{g(e)},children:e===`ttft`?`${n(`perfTtft`)} (ms)`:`${n(`perfTps`)} (${n(`perfTpsUnit`)})`},e))})}),(0,a.jsxs)(`div`,{className:j.perfChips,role:`group`,"aria-label":n(`model`),children:[(0,a.jsx)(`button`,{type:`button`,className:j.perfChip,"data-testid":`billing-perf-chip-all`,onClick:()=>{u({metric:i.metric,models:f.map(e=>e.key)})},children:n(`perfAll`)}),f.map(e=>{let t=p.includes(e.key);return(0,a.jsxs)(`button`,{type:`button`,className:c(j.perfChip,!t&&j.perfChipOff),style:t?{color:e.color,borderColor:`color-mix(in srgb, ${e.color} 45%, transparent)`}:void 0,"aria-pressed":t,"data-testid":`billing-perf-chip-${e.key}`,onClick:()=>{h(e.key)},children:[(0,a.jsx)(`span`,{className:j.perfChipDot,style:{background:t?e.color:`var(--dsw-alias-label-dimmed)`}}),e.name]},e.key)})]}),m.totalPoints>0?(0,a.jsxs)(`div`,{className:j.chartWrap,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 180`,className:j.chartSvg,role:`img`,"aria-label":`Hourly perf comparison by model`,onMouseLeave:()=>{l(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-J.left)/m.plotW,r=Math.round(n*(m.n-1));l(Math.min(Math.max(r,0),m.n-1))},children:[m.ticks.map((e,t)=>{let n=m.yOf(e);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:J.left,x2:680-J.right,y1:n,y2:n,className:j.chartGrid}),(0,a.jsx)(`text`,{x:J.left-8,y:n+3,textAnchor:`end`,className:j.chartAxisLabel,children:Ke(e)})]},`tick-${t}`)}),m.series.map(e=>e.segments.map((t,n)=>(0,a.jsx)(`path`,{d:t,fill:`none`,className:j.chartLine,style:{stroke:e.color}},`${e.key}-${n}`))),m.xTicks.map(e=>{let t=m.hourKeys[e];return t===void 0?null:(0,a.jsx)(`text`,{x:m.inner(e),y:174,textAnchor:`middle`,className:j.chartAxisLabel,children:Ge(t)},t)}),s!==null&&(0,a.jsx)(`line`,{x1:m.inner(s),x2:m.inner(s),y1:J.top,y2:J.top+m.plotH,className:j.chartCrosshair}),s!==null&&m.series.map(e=>{let t=e.points.find(e=>e.i===s);return t===void 0?null:(0,a.jsx)(`circle`,{cx:t.x,cy:t.y,r:3.5,fill:e.color,className:j.chartHoverDot},`${e.key}-dot`)})]}),s!==null&&_.length>0&&(0,a.jsxs)(`div`,{className:j.chartTooltip,"data-testid":`billing-perf-tooltip`,style:{left:`${m.inner(s)/680*100}%`,top:`${(J.top+m.plotH/2)/180*100}%`},children:[(0,a.jsx)(`div`,{className:j.chartTooltipDate,children:Ge(m.hourKeys[s]??``)}),_.map(e=>(0,a.jsxs)(`div`,{className:j.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:j.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,a.jsx)(`strong`,{children:qe(e.v,i.metric,n)})]},e.key))]})]}):(0,a.jsx)(`div`,{className:j.chartEmpty,"data-testid":`billing-perf-chart-empty`,children:n(`perfChartEmpty`)})]}),m===null&&(0,a.jsx)(`div`,{className:j.chartEmpty,"data-testid":`billing-perf-chart-empty`,children:n(`perfChartEmpty`)})]})}let Ye=`@kenz1117/dsh-ui-usage-billing`,Xe=`kenz1117`;function Ze({t:e,version:t}){return(0,a.jsxs)(`section`,{className:j.setCard,"data-testid":`billing-plugin-info`,children:[(0,a.jsxs)(`div`,{className:j.plgHead,children:[(0,a.jsx)(`span`,{className:j.plgIcon,"aria-hidden":`true`,children:(0,a.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,a.jsx)(`path`,{d:`M10 3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a2 2 0 0 0 4 0V4a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a2 2 0 0 0 4 0 1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0 0 4h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-1a2 2 0 0 0-4 0 1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 0-4H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 4 0z`})})}),(0,a.jsxs)(`div`,{className:j.plgTitle,children:[(0,a.jsxs)(`div`,{className:j.plgNameRow,children:[(0,a.jsx)(`h3`,{className:j.plgName,children:Ye}),(0,a.jsx)(`span`,{className:j.plgTag,children:t===void 0?`—`:`v${t}`})]}),(0,a.jsx)(`p`,{className:j.plgDesc,children:`Usage billing dashboard for DeepSeek Harness`})]})]}),(0,a.jsxs)(`div`,{className:j.plgGrid,children:[(0,a.jsxs)(`div`,{className:j.plgItem,children:[(0,a.jsx)(`span`,{className:j.plgLabel,children:e(`pluginAuthor`)}),(0,a.jsxs)(`a`,{className:j.plgLink,href:`https://github.com/${Xe}`,target:`_blank`,rel:`noreferrer`,children:[`KenZ`,` (`,Xe,`)`]})]}),(0,a.jsxs)(`div`,{className:j.plgItem,children:[(0,a.jsx)(`span`,{className:j.plgLabel,children:e(`pluginRepository`)}),(0,a.jsx)(`a`,{className:j.plgLink,href:`https://github.com/kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:`GitHub`})]}),(0,a.jsxs)(`div`,{className:j.plgItem,children:[(0,a.jsx)(`span`,{className:j.plgLabel,children:e(`pluginNpm`)}),(0,a.jsx)(`a`,{className:j.plgLink,href:`https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:Ye})]}),(0,a.jsxs)(`div`,{className:j.plgItem,children:[(0,a.jsx)(`span`,{className:j.plgLabel,children:e(`pluginLicense`)}),(0,a.jsx)(`span`,{className:j.plgVal,children:`MIT`})]})]})]})}function Qe(e=Date.now()){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function $e(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}let Y={top:14,right:18,bottom:22,left:46},X=`var(--dsw-static-blue-500)`,Z=`#14b8a6`,et=`var(--dsw-static-amber-500)`;function tt(e,t,n,r){return JSON.stringify({days:e,models:t,dayModels:n,total:r},null,2)}function nt(e){let{stats:t,trendDays:n,onTrendDays:i,t:o}=e,s=e.models??[],{byDay:l,byModel:u,total:d}=t,[f,p]=(0,r.useState)(null),[m,h]=(0,r.useState)(`structure`),[g,_]=(0,r.useState)(null),v=t.byDayModels!==void 0,y=e=>{h(e),_(null)},b=(0,r.useMemo)(()=>{let e=[];for(let t=n-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t);let r=Qe(n.getTime()),i=l[r];e.push({date:r,miss:i?.cacheMiss??0,hit:i?.cacheHit??0,output:i?.output??0,reasoning:i?.reasoning??0})}return e},[l,n]),x=(0,r.useMemo)(()=>{let e=[];for(let r=n-1;r>=0;--r){let n=new Date;n.setDate(n.getDate()-r);let i=Qe(n.getTime()),a=t.byDayModels?.[i],o={},s=0;if(a!==void 0)for(let[e,t]of Object.entries(a)){let n=t.cacheHit??0,r=t.cacheMiss??0,i=t.output??0,a=n+r+i;a<=0||(o[e]={hit:n,miss:r,output:i,total:a},s+=a)}e.push({date:i,models:o,total:s})}return e},[t.byDayModels,n]),S=(0,r.useMemo)(()=>{let e=new Map;for(let t of x)for(let[n,r]of Object.entries(t.models))e.set(n,(e.get(n)??0)+r.total);return[...e.entries()].sort((e,t)=>t[1]-e[1]).map(([e])=>({key:e,name:s.find(t=>t.key===e)?.name??je(e).name,color:s.find(t=>t.key===e)?.color??`#8b95a3`}))},[x,s]),C=g!==null&&S.some(e=>e.key===g)?g:null,w=e=>{if(v){if(m!==`model`){h(`model`),_(e);return}_(t=>t===e?null:e)}},T=(0,r.useMemo)(()=>{let e=0;return Object.entries(u).filter(([,e])=>e.calls>0).map(([t,n])=>{let r=n.input+n.output;e+=r;let i=n.cacheHit+n.cacheMiss;return{key:t,name:je(t).name,input:n.input,output:n.output,reasoning:n.reasoning??0,calls:n.calls,cacheHit:n.cacheHit,cacheMiss:n.cacheMiss,cacheHitRate:i>0?n.cacheHit/i*100:0,total:r,share:0}}).sort((e,t)=>t.total-e.total).map(t=>({...t,share:e>0?t.total/e:0}))},[u]),E=(0,r.useMemo)(()=>{let e=d.cacheHit??0,t=d.cacheMiss??0,n=d.input??0,r=d.output??0,i=d.reasoning??0,a=e+t,o=a>0?e/a*100:0,s=r>0?i/r*100:0,c=r>0?n/r:0,l;for(let e of b){let t=e.miss+e.hit+e.output;(l===void 0||t>l.miss+l.hit+l.output)&&(l=e)}return{cacheHitRate:o,reasoningPct:s,io:c,peak:l,hit:e,miss:t,input:n,output:r,reasoning:i}},[d,b]),ee=(0,r.useMemo)(()=>{let e=Object.entries(t.byTool??{}),n=e.slice(0,8),r=e.slice(8).reduce((e,[,t])=>e+t,0),i=e.reduce((e,[,t])=>e+t,0);return{top:n,rest:r>0?[[`…`,r]]:[],totalCalls:i}},[t.byTool]),D=(0,r.useMemo)(()=>{let e=b.length;if(e===0)return null;let t=680-Y.left-Y.right,n=200-Y.top-Y.bottom,r=Math.max(...m===`model`?x.map(e=>e.total):b.map(e=>e.miss+e.hit+e.output),1),i=e=>Y.top+n-e/r*n,a=t/e,o=Math.min(20,a*.6),s=n=>e===1?Y.left+t/2:Y.left+t*n/(e-1),c=Math.max(1,Math.ceil(e/8)),l=[];for(let t=0;t<e;t+=c)l.push(t);return e>0&&l[l.length-1]!==e-1&&l.push(e-1),{n:e,plotW:t,plotH:n,max:r,y:i,barW:o,inner:s,indices:l}},[b,x,m]),O=()=>{let e=new Blob([rt(b)],{type:`text/csv`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`token-daily-${Qe()}.csv`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},te=()=>{let e=new Blob([tt(b,T,x,d)],{type:`application/json`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`token-${Qe()}.json`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},k=f===null?void 0:b[f],A=f===null?void 0:x[f];return(0,a.jsxs)(`div`,{className:j.tokenPanel,"data-testid":`billing-token-panel`,children:[(0,a.jsxs)(`div`,{className:j.exportBar,role:`group`,"aria-label":o(`tokenExport`),children:[(0,a.jsx)(`span`,{className:j.exportLabel,children:o(`export`)}),(0,a.jsx)(`button`,{type:`button`,className:j.exportButton,"data-testid":`billing-token-export-csv`,onClick:O,children:o(`tokenExportCsv`)}),(0,a.jsx)(`button`,{type:`button`,className:j.exportButton,"data-testid":`billing-token-export-json`,onClick:te,children:o(`exportJson`)})]}),(0,a.jsxs)(`div`,{className:j.kpiGrid,"data-testid":`billing-token-kpis`,children:[(0,a.jsxs)(`div`,{className:j.kpiTile,children:[(0,a.jsx)(`span`,{className:j.kpiLabel,children:o(`tokenCacheHitRate`)}),(0,a.jsxs)(`span`,{className:j.kpiValue,children:[E.cacheHitRate.toFixed(1),`%`]}),(0,a.jsxs)(`span`,{className:j.kpiDetail,children:[W(E.hit),` / `,W(E.hit+E.miss),(d.cacheWrite??0)>0?` · ${o(`tokenCacheWrite`)} ${W(d.cacheWrite??0)}`:``]})]}),(0,a.jsxs)(`div`,{className:j.kpiTile,children:[(0,a.jsx)(`span`,{className:j.kpiLabel,children:o(`tokenReasoningShare`)}),(0,a.jsxs)(`span`,{className:j.kpiValue,children:[E.reasoningPct.toFixed(1),`%`]}),(0,a.jsx)(`span`,{className:j.kpiDetail,children:W(E.reasoning)})]}),(0,a.jsxs)(`div`,{className:j.kpiTile,children:[(0,a.jsx)(`span`,{className:j.kpiLabel,children:o(`tokenIo`)}),(0,a.jsx)(`span`,{className:j.kpiValue,children:E.io.toFixed(2)}),(0,a.jsxs)(`span`,{className:j.kpiDetail,children:[W(E.input),` / `,W(E.output)]})]}),(0,a.jsxs)(`div`,{className:j.kpiTile,children:[(0,a.jsx)(`span`,{className:j.kpiLabel,children:o(`tokenPeak`)}),(0,a.jsx)(`span`,{className:j.kpiValue,children:E.peak===void 0?`—`:$e(E.peak.miss+E.peak.hit+E.peak.output)}),(0,a.jsx)(`span`,{className:j.kpiDetail,children:E.peak?.date??`—`})]})]}),(0,a.jsxs)(`section`,{className:j.panel,"data-testid":`billing-token-daily`,children:[(0,a.jsxs)(`div`,{className:j.panelHead,children:[(0,a.jsx)(`h3`,{className:j.panelTitle,children:o(`tokenDaily`)}),(0,a.jsxs)(`span`,{className:j.panelHeadControls,children:[v&&(0,a.jsx)(`span`,{className:j.rangeToggle,role:`group`,"aria-label":o(`tokenDaily`),children:[`structure`,`model`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(j.rangeButton,m===e&&j.rangeButtonActive),"aria-pressed":m===e,onClick:()=>{y(e)},"data-testid":`billing-token-view-${e}`,children:o(e===`structure`?`tokenViewStructure`:`tokenViewModel`)},e))}),(0,a.jsx)(`span`,{className:j.rangeToggle,role:`group`,"aria-label":o(`tokenDaily`),children:[7,30].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(j.rangeButton,n===e&&j.rangeButtonActive),"aria-pressed":n===e,onClick:()=>{i(e)},"data-testid":`billing-token-${e}d`,children:o(e===7?`trend7d`:`trend30d`)},e))})]})]}),D===null||m===`model`&&S.length===0?(0,a.jsx)(`div`,{className:j.chartEmpty,children:o(`trendEmpty`)}):(0,a.jsxs)(`div`,{className:j.chartWrap,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 200`,className:j.chartSvg,role:`img`,"aria-label":o(`tokenDaily`),onMouseLeave:()=>{p(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-Y.left)/D.plotW,r=Math.round(n*(D.n-1));p(Math.min(Math.max(r,0),D.n-1))},children:[[0,.5,1].map(e=>{let t=D.max*e,n=D.y(t);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:Y.left,x2:680-Y.right,y1:n,y2:n,className:j.chartGrid}),(0,a.jsx)(`text`,{x:Y.left-8,y:n+3,textAnchor:`end`,className:j.chartAxisLabel,children:$e(t)})]},e)}),m===`structure`?b.map((e,t)=>{let n=D.inner(t)-D.barW/2,r=D.y(0),i=D.y(e.miss),o=D.y(e.miss+e.hit),s=D.y(e.miss+e.hit+e.output);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`rect`,{x:n,y:i,width:D.barW,height:r-i,fill:X}),(0,a.jsx)(`rect`,{x:n,y:o,width:D.barW,height:i-o,fill:Z}),(0,a.jsx)(`rect`,{x:n,y:s,width:D.barW,height:o-s,fill:et})]},e.date)}):x.map((e,t)=>{let n=D.inner(t)-D.barW/2,r=0;return(0,a.jsx)(`g`,{children:S.map(t=>{let i=e.models[t.key];if(i===void 0)return null;let o=D.y(r);r+=i.total;let s=D.y(r),c=C!==null&&t.key!==C;return(0,a.jsx)(`rect`,{x:n,y:s,width:D.barW,height:o-s,fill:t.color,opacity:c?.15:1},t.key)})},e.date)}),D.indices.map(e=>{let t=b[e];return t===void 0?null:(0,a.jsx)(`text`,{x:D.inner(e),y:194,textAnchor:`middle`,className:j.chartAxisLabel,children:t.date.slice(5)},t.date)}),f!==null&&(0,a.jsx)(`line`,{x1:D.inner(f),x2:D.inner(f),y1:Y.top,y2:Y.top+D.plotH,className:j.chartCrosshair})]}),f!==null&&m===`structure`&&k!==void 0&&(0,a.jsxs)(`div`,{className:j.chartTooltip,"data-testid":`billing-token-tooltip`,style:{left:`${D.inner(f)/680*100}%`,top:`${D.y(k.miss+k.hit+k.output)/200*100}%`},children:[(0,a.jsxs)(`div`,{className:j.chartTooltipHead,children:[(0,a.jsx)(`span`,{className:j.chartTooltipDate,children:k.date}),(0,a.jsx)(`strong`,{children:(k.miss+k.hit+k.output).toLocaleString()})]}),(0,a.jsxs)(`div`,{className:c(j.chartTooltipRow,j.chartTooltipSplit),children:[(0,a.jsxs)(`span`,{className:j.chartTooltipLabel,children:[(0,a.jsx)(`span`,{className:j.chartTooltipSwatch,style:{background:Z}}),o(`tokenHit`)]}),(0,a.jsx)(`strong`,{children:k.hit.toLocaleString()})]}),(0,a.jsxs)(`div`,{className:c(j.chartTooltipRow,j.chartTooltipSplit),children:[(0,a.jsxs)(`span`,{className:j.chartTooltipLabel,children:[(0,a.jsx)(`span`,{className:j.chartTooltipSwatch,style:{background:X}}),o(`tokenMiss`)]}),(0,a.jsx)(`strong`,{children:k.miss.toLocaleString()})]}),(0,a.jsxs)(`div`,{className:c(j.chartTooltipRow,j.chartTooltipSplit),children:[(0,a.jsxs)(`span`,{className:j.chartTooltipLabel,children:[(0,a.jsx)(`span`,{className:j.chartTooltipSwatch,style:{background:et}}),o(`tokenOutput`)]}),(0,a.jsx)(`strong`,{children:k.output.toLocaleString()})]})]}),f!==null&&m===`model`&&A!==void 0&&(0,a.jsxs)(`div`,{className:j.chartTooltip,"data-testid":`billing-token-tooltip`,style:{left:`${D.inner(f)/680*100}%`,top:`${D.y(A.total)/200*100}%`},children:[(0,a.jsxs)(`div`,{className:j.chartTooltipHead,children:[(0,a.jsx)(`span`,{className:j.chartTooltipDate,children:A.date}),(0,a.jsx)(`strong`,{children:A.total.toLocaleString()})]}),S.map(e=>{let t=A.models[e.key];return t===void 0?null:(0,a.jsxs)(`div`,{className:j.chartTooltipModel,children:[(0,a.jsxs)(`div`,{className:c(j.chartTooltipRow,j.chartTooltipSplit),children:[(0,a.jsxs)(`span`,{className:j.chartTooltipLabel,children:[(0,a.jsx)(`span`,{className:j.chartTooltipSwatch,style:{background:e.color}}),e.name]}),(0,a.jsx)(`strong`,{children:t.total.toLocaleString()})]}),(0,a.jsxs)(`div`,{className:j.chartTooltipModelDetail,children:[o(`tokenHitShort`),` `,t.hit.toLocaleString(),` · `,o(`tokenMissShort`),` `,t.miss.toLocaleString(),` · `,o(`tokenOutput`),` `,t.output.toLocaleString()]})]},e.key)})]}),(0,a.jsx)(`div`,{className:j.chartLegend,children:m===`structure`?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:j.chartTooltipSwatch,style:{background:X}}),o(`tokenMiss`)]}),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:j.chartTooltipSwatch,style:{background:Z}}),o(`tokenHit`)]}),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:j.chartTooltipSwatch,style:{background:et}}),o(`tokenOutput`)]})]}):S.map(e=>(0,a.jsxs)(`button`,{type:`button`,className:c(j.chartLegendItem,C===e.key&&j.chartLegendItemActive),"aria-pressed":C===e.key,"data-testid":`billing-token-legend-${e.key}`,onClick:()=>{w(e.key)},children:[(0,a.jsx)(`span`,{className:j.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key))})]})]}),(0,a.jsxs)(`section`,{className:j.panel,"data-testid":`billing-token-models`,children:[(0,a.jsx)(`div`,{className:j.panelHead,children:(0,a.jsx)(`h3`,{className:j.panelTitle,children:o(`tokenByModel`)})}),T.length===0?(0,a.jsx)(`div`,{className:j.emptyRow,children:o(`noData`)}):(0,a.jsx)(`div`,{className:j.tableScroll,children:(0,a.jsxs)(`table`,{className:j.modelTable,"data-testid":`billing-token-model-table`,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:o(`model`)}),(0,a.jsx)(`th`,{className:j.numCol,children:o(`inputTokens`)}),(0,a.jsx)(`th`,{className:j.numCol,children:o(`outputTokens`)}),(0,a.jsx)(`th`,{className:j.numCol,children:o(`tokenReasoningShort`)}),(0,a.jsx)(`th`,{className:j.numCol,children:o(`cacheHitRate`)}),(0,a.jsx)(`th`,{className:j.numCol,children:o(`tokenTotal`)}),(0,a.jsx)(`th`,{className:j.numCol,children:o(`tokenShare`)}),(0,a.jsx)(`th`,{className:j.numCol,children:o(`calls`)})]})}),(0,a.jsx)(`tbody`,{children:T.map(e=>(0,a.jsxs)(`tr`,{"data-testid":`billing-token-model`,className:c(v&&j.modelRowFocusable,C===e.key&&j.modelRowActive),"aria-selected":v?C===e.key:void 0,onClick:v?()=>{w(e.key)}:void 0,children:[(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:j.modelName,children:e.name})}),(0,a.jsx)(`td`,{className:j.numCol,children:W(e.input)}),(0,a.jsx)(`td`,{className:j.numCol,children:W(e.output)}),(0,a.jsx)(`td`,{className:j.numCol,children:e.reasoning>0?W(e.reasoning):(0,a.jsx)(`span`,{className:j.na,children:`—`})}),(0,a.jsxs)(`td`,{className:j.numCol,children:[e.cacheHitRate.toFixed(1),`%`]}),(0,a.jsx)(`td`,{className:j.numCol,children:W(e.total)}),(0,a.jsx)(`td`,{className:j.numCol,children:(0,a.jsxs)(`span`,{className:j.tokenModelShareRow,children:[(0,a.jsx)(`span`,{className:j.tokenModelBar,children:(0,a.jsxs)(`span`,{className:j.tokenModelParts,style:{width:`${(e.share*100).toFixed(2)}%`},children:[(0,a.jsx)(`span`,{className:j.tokenModelPartIn,style:{width:`${e.total>0?e.input/e.total*100:0}%`}}),(0,a.jsx)(`span`,{className:j.tokenModelPartOut,style:{width:`${e.total>0?e.output/e.total*100:0}%`}})]})}),(e.share*100).toFixed(1),`%`]})}),(0,a.jsx)(`td`,{className:j.numCol,children:e.calls.toLocaleString()})]},e.key))})]})})]}),ee.totalCalls>0&&(0,a.jsxs)(`section`,{className:j.panel,"data-testid":`billing-token-tools`,children:[(0,a.jsx)(`div`,{className:j.panelHead,children:(0,a.jsx)(`h3`,{className:j.panelTitle,children:o(`toolRank`)})}),(0,a.jsx)(`div`,{className:j.tableScroll,children:(0,a.jsxs)(`table`,{className:j.modelTable,"data-testid":`billing-tool-table`,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:o(`toolName`)}),(0,a.jsx)(`th`,{className:j.numCol,children:o(`calls`)}),(0,a.jsx)(`th`,{className:j.numCol,children:o(`tokenShare`)})]})}),(0,a.jsx)(`tbody`,{children:[...ee.top,...ee.rest].map(([e,t])=>(0,a.jsxs)(`tr`,{"data-testid":`billing-tool-row`,children:[(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:j.modelName,children:e})}),(0,a.jsx)(`td`,{className:j.numCol,children:t.toLocaleString()}),(0,a.jsxs)(`td`,{className:j.numCol,children:[(t/ee.totalCalls*100).toFixed(1),`%`]})]},e))})]})})]})]})}function rt(e){return[`date,missInput,cacheHit,output,reasoning,total`,...e.map(e=>`${e.date},${e.miss},${e.hit},${e.output},${e.reasoning},${e.miss+e.hit+e.output}`)].join(`
|
|
2
|
+
`)}function it(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}`}function at(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function ot(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m${String(t%60).padStart(2,`0`)}s`}function st({rounds:e,flags:t,currency:n,t:i}){let o=(0,r.useMemo)(()=>e.slice(-40),[e]),s=(0,r.useMemo)(()=>new Set(t.map(e=>`${e.sessionId}:${e.turn}`)),[t]),l=(0,r.useMemo)(()=>Math.max(1e-4,...o.map(e=>e.cost)),[o]);if(o.length===0)return(0,a.jsxs)(`div`,{className:j.roundsEmpty,children:[i(`model`),` —`]});let u=e=>U(n===`usd`?Re(e):e,n);return(0,a.jsxs)(`div`,{className:j.rounds,children:[(0,a.jsx)(`div`,{className:j.roundsBars,role:`img`,"aria-label":`cost per turn`,children:o.map(e=>{let t=s.has(`${e.sessionId}:${e.turn}`),n=Math.max(1,e.cost/l*100),r=Se(e.startedAt)===`peak`;return(0,a.jsxs)(`div`,{className:c(j.roundsBarCol,r?j.roundsBarColPeak:j.roundsBarColOff),children:[(0,a.jsx)(`span`,{className:j.roundsBarLabel,style:{bottom:`${n}%`},children:u(e.cost)}),(0,a.jsx)(`div`,{className:j.roundsBarWrap,children:(0,a.jsx)(`div`,{className:t?j.roundsBarFlagged:j.roundsBar,style:{height:`${n}%`},"data-testid":`round-bar`,title:`${i(`model`)} ${e.model} · ${u(e.cost)} · ${at(e.startedAt)}${e.endedAt===void 0?``:` → ${it(e.endedAt)} (${ot(e.endedAt-e.startedAt)})`}`,children:t&&(0,a.jsx)(`span`,{className:j.roundsFlagMark,"aria-hidden":`true`})})})]},`${e.sessionId}:${e.turn}`)})}),(0,a.jsxs)(`div`,{className:j.roundsAxis,children:[(0,a.jsxs)(`span`,{children:[i(`costAbbr`),` `,u(l)]}),(0,a.jsxs)(`span`,{children:[o.length,` 轮`]})]})]})}let ct=[`var(--dsw-alias-bg-layer-2)`,`color-mix(in srgb, var(--dsw-static-green-500) 22%, var(--dsw-alias-bg-layer-2))`,`color-mix(in srgb, var(--dsw-static-green-500) 45%, var(--dsw-alias-bg-layer-2))`,`color-mix(in srgb, var(--dsw-static-green-500) 70%, var(--dsw-alias-bg-layer-2))`,`var(--dsw-static-green-500)`],lt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function ut(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function dt(e,t){let n=new Map;for(let t of e)n.set(t.date,t.value);let r=0;for(let e of n.values())e>r&&(r=e);let i=t.getFullYear(),a=t.getMonth(),o=t.getDate(),s=new Date(i,a+1,0).getDate(),c=new Date(i,a,1).getDay(),l=c+s,u=Math.ceil(l/7),d=[];for(let e=0;e<u;e+=1){let t=[];for(let l=0;l<7;l+=1){let u=e*7+l-c+1;if(u<1){let e=new Date(i,a,u);t.push({date:ut(e),dayNum:e.getDate(),value:0,level:0,placeholder:!0});continue}if(u>s){let e=new Date(i,a+1,u-s);t.push({date:ut(e),dayNum:e.getDate(),value:0,level:0,placeholder:!0});continue}let d=ut(new Date(i,a,u)),f=n.get(d)??0,p=0;if(f>0&&r>0){let e=Math.ceil(f/r*4);p=Math.min(4,Math.max(1,e))}let m=u>o;t.push({date:d,dayNum:u,value:m?0:f,level:m?0:p,placeholder:m})}d.push(t)}return d}function ft(e,t){let n=new Map;for(let t of e)n.set(t.date,t.value);let r=0;for(let e of n.values())e>r&&(r=e);let i=ut(t),a=new Date(t);a.setHours(0,0,0,0),a.setDate(a.getDate()-a.getDay());let o=new Date(a);o.setDate(a.getDate()-357);let s=[];for(let e=0;e<52;e+=1){let t=[];for(let a=0;a<7;a+=1){let s=new Date(o);s.setDate(o.getDate()+e*7+a);let c=ut(s),l=c>i,u=l?0:n.get(c)??0,d=0;if(!l&&u>0&&r>0){let e=Math.ceil(u/r*4);d=Math.min(4,Math.max(1,e))}t.push({date:c,dayNum:s.getDate(),value:u,level:d,placeholder:l})}s.push(t)}return s}function pt({days:e,currency:t,now:n,t:i,range:o=`month`}){let[s,c]=(0,r.useState)(null),l=e=>U(t===`usd`?Re(e):e,t),u=(0,r.useMemo)(()=>dt(e,n??new Date),[e,n]);if(o===`year`){let t=ft(e,n??new Date),r=[],o=-1;return t.forEach((e,t)=>{let n=Number(e[0]?.date.slice(5,7)??0);n!==o&&(r.push({index:t,label:lt[n-1]??``}),o=n)}),(0,a.jsxs)(`div`,{className:j.heatmapYear,"data-testid":`heatmap-year`,children:[(0,a.jsxs)(`div`,{className:j.heatmapYearBody,children:[(0,a.jsx)(`div`,{className:j.heatmapYearWeekdays,"aria-hidden":`true`,children:[{label:`Mon`,row:1},{label:`Wed`,row:3},{label:`Fri`,row:5}].map(e=>(0,a.jsx)(`span`,{className:j.heatmapYearWeekday,style:{gridRow:e.row},children:e.label},e.label))}),(0,a.jsxs)(`div`,{className:j.heatmapYearScroll,children:[(0,a.jsx)(`div`,{className:j.heatmapYearMonths,"aria-hidden":`true`,"data-testid":`heatmap-year-months`,children:r.map(e=>(0,a.jsx)(`span`,{className:j.heatmapYearMonth,style:{gridColumn:e.index+1},children:e.label},e.index))}),(0,a.jsx)(`div`,{className:j.heatmapYearGrid,role:`img`,"aria-label":`yearly cost heatmap`,"data-testid":`heatmap-year-grid`,children:t.flat().map(e=>(0,a.jsx)(`button`,{type:`button`,className:j.heatmapYearCell,"data-testid":`heatmap-year-cell`,"data-level":e.level,style:{background:ct[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`},e.date))})]})]}),(0,a.jsxs)(`div`,{className:j.heatmapFooter,children:[(0,a.jsx)(`span`,{className:j.heatmapLegendText,children:i(`heatmapLess`)}),(0,a.jsx)(`span`,{className:j.heatmapLegend,children:ct.map((e,t)=>(0,a.jsx)(`i`,{style:{background:e}},t))}),(0,a.jsx)(`span`,{className:j.heatmapLegendText,children:i(`heatmapMore`)})]})]})}return(0,a.jsxs)(`div`,{className:j.heatmap,children:[(0,a.jsx)(`div`,{className:j.heatmapGrid,role:`img`,"aria-label":`daily cost heatmap`,children:u.map(e=>e.map(e=>e.placeholder?(0,a.jsx)(`div`,{className:j.heatmapCellEmpty,children:e.dayNum},e.date):(0,a.jsx)(`button`,{type:`button`,className:j.heatmapCell,"data-testid":`heatmap-cell`,"data-level":e.level,style:{background:ct[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`,onMouseEnter:()=>{c(e)},onMouseLeave:()=>{c(null)},onFocus:()=>{c(e)},onBlur:()=>{c(null)},children:e.dayNum},e.date)))}),(0,a.jsxs)(`div`,{className:j.heatmapFooter,children:[(0,a.jsx)(`span`,{className:j.heatmapLegendText,children:i(`heatmapLess`)}),(0,a.jsx)(`span`,{className:j.heatmapLegend,children:ct.map((e,t)=>(0,a.jsx)(`i`,{style:{background:e}},t))}),(0,a.jsx)(`span`,{className:j.heatmapLegendText,children:i(`heatmapMore`)}),s!==null&&(0,a.jsxs)(`span`,{className:j.heatmapHover,"data-testid":`heatmap-hover`,children:[s.date,` · `,l(s.value)]})]})]})}let mt={window:6,threshold:2,reasonFactor:1.8,reasonHitDropPp:15};function ht(e){if(e.length===0)return null;let t=0;for(let n of e)t+=n;return t/e.length}function gt(e){let t=e.cacheHit+e.cacheMiss;return t<=0?null:e.cacheHit/t*100}function _t(e,t){let n=t?.window??mt.window,r=t?.threshold??mt.threshold,i=t?.reasonFactor??mt.reasonFactor,a=t?.reasonHitDropPp??mt.reasonHitDropPp,o=[];if(n<=0||r<=0)return o;let s=[],c=[],l=[],u=[];for(let t of e){if(t.cost<=0)continue;let e=t.output,d=t.input,f=gt(t),p=ht(s),m=[];if(p!==null&&p>0&&t.cost>p*r){let n=ht(c),r=ht(l),s=ht(u);n!==null&&n>0&&e>n*i&&m.push(`output-growth`),r!==null&&r>0&&d>r*i&&m.push(`context-bloat`),s!==null&&f!==null&&f<s-a&&m.push(`cache-hit-drop`),o.push({sessionId:t.sessionId,turn:t.turn,cost:t.cost,reasons:m})}for(s.push(t.cost),c.push(e),l.push(d),f!==null&&u.push(f);s.length>n;)s.shift();for(;c.length>n;)c.shift();for(;l.length>n;)l.shift();for(;u.length>n;)u.shift()}return o}function vt(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function yt(e){return/^[=+\-@\t\r]/.test(e)?`'${e}`:e}function bt(e){return e.toFixed(2)}function xt(e){return[`date,calls,input,output,cache_hit,cache_miss,cost_cny`,...Object.keys(e).sort().map(t=>{let n=e[t];return n===void 0?``:[t,n.calls,n.input,n.output,n.cacheHit,n.cacheMiss,bt(n.cost)].join(`,`)})].join(`
|
|
3
3
|
`)}function St(e){return[`site,kind,calls,cost_cny`,...Object.entries(e).map(([e,t])=>{let n=e.startsWith(`site:`)?e.slice(5):e.startsWith(`direct:`)?e.slice(7):`unknown`,r=e.startsWith(`site:`)?`site`:e.startsWith(`direct:`)?`direct`:`unknown`;return[vt(yt(n)),r,t.calls,bt(t.cost)].join(`,`)})].join(`
|
|
4
4
|
`)}function Ct(e){return e===void 0?``:e.split(/[\\/]/).filter(Boolean).pop()??e}function wt(e){return[`session_id,title,project,calls,cost_cny,last_active`,...e.map(e=>[vt(yt(e.id)),vt(yt(e.title??``)),vt(yt(Ct(e.cwd))),e.calls,bt(e.cost),e.lastActive>0?new Date(e.lastActive).toISOString():``].join(`,`))].join(`
|
|
5
|
-
`)}function Tt(e,t,n){let r=[...n].sort(),i=r[0],a=r.at(-1);return`${e}${i!==void 0&&a!==void 0?`-${i}_${a}`:``}.${t}`}function Et(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),setTimeout(()=>URL.revokeObjectURL(r),0)}let Dt=`usageBilling`,Ot={title:`使用统计`,cost:`费用`,todayCost:`今日费用`,monthCost:`本月费用`,yearCost:`本年费用`,monthProjected:`本月预计`,liveTurn:`本轮`,liveSession:`会话`,calls:`调用`,cacheHitRate:`缓存命中率`,tokens:`Token`,inputTokens:`输入`,outputTokens:`输出`,avgCost:`平均成本`,trend:`每日费用与调用趋势`,trend7d:`7 天`,trend30d:`30 天`,trendMetric:`趋势指标`,trendMetricCost:`费用`,trendMetricTokens:`Token`,trendEmpty:`暂无趋势数据`,budget:`本月预算`,budgetAmount:`预算金额`,budgetSummary:`本月已用 {used} / {total};达到 80% 时提醒,达到 100% 时红色脉冲警示`,sessions:`会话明细`,sessionTitle:`标题`,project:`项目`,lastActive:`最后活跃`,sessionOverflow:`仅显示花费前 {limit} 个,共 {total} 个会话`,budgetTierBody:`本月花费 {cost} 已达预算 {budget} 的 {pct}%`,models:`模型计费明细`,providerBilling:`厂商计费与订阅`,actual:`实际`,pricing:`模型单价表`,input:`输入`,output:`输出`,cacheHit:`缓存命中`,peak:`高峰`,offPeak:`低谷`,flat:`全天统一`,band:`时段`,close:`关闭`,footer:`每 30s 自动轮询 · 仅统计本机 dsh 会话`,footerCredit:`dsh-ui-usage-billing {version} · MIT`,lastUpdated:`数据更新于`,noData:`暂无计费数据`,todayRate:`今日汇率`,rateLive:`实时`,rateBuiltin:`内置`,promoBadge:`限时折扣`,promoUntil:`促销价至 {date},之后自动恢复刊例价`,promoOpenEnded:`厂商未公布截止时间,当前按折扣计价;公告截止后自动恢复刊例价`,pricingTip:`DeepSeek 模型自北京时间 2026-08-23(周日)00:00 起:工作日高峰 9-12 / 14-18(×2),周末(周六 / 周日)全天低谷价;双价单元格按峰 / 谷展示,费用按调用时刻计。`,pricingUnit:`单位:人民币 / 每百万 Token`,pricingNotes:`计价说明`,ubPeak:`峰`,ubOff:`谷`,ubStd:`标准`,peakBand:`峰谷分带`,pricingSource:`数据来源`,noteCache:`命中部分按缓存价计费,显著降低成本。`,noteBand:`高峰与空闲时段单价不同,空闲约半价。`,noteSource:`价格来自实时汇率 + 模型定价目录,未收录模型按 0 计并提示。`,balance:`余额`,balanceUnconfigured:`未配置`,balanceUnauthorized:`密钥无效`,balanceUnreachable:`查询失败`,uncatalogued:`未收录`,estimatedPricing:`估算价`,balanceDays:`约可撑 {days} 天`,balanceLowBody:`{name} 余额 {balance},约可撑 {days} 天,请及时充值`,reconcileDrift:`系统监控到{provider}官方余额变动 {spent},本面板记录 {today},差额通常由其它工具或 API 的消耗所致`,reconcileDismiss:`知道了`,subscriptionNotConfigured:`未配置密钥`,subscriptionUnauthorized:`密钥无效`,subscriptionUnavailable:`查询失败`,subscriptionInvalid:`响应异常`,subscriptionRateLimited:`触发限流`,subscriptionSession:`本次`,subscriptionWeekly:`本周`,subscriptionMonthly:`本月`,subscriptionBilling:`计费周期`,subscriptionRemaining:`剩余 {pct}%`,subscriptionExhausted:`已用尽`,subscriptionReset:`{date} 重置`,subscriptionNoApi:`该厂商暂未提供用量查询接口`,floatWindow:`模型用量悬浮窗`,floatModeCombined:`综合`,floatModeSubscription:`订阅卡`,floatMode:`展示模式`,floatTargets:`订阅目标`,floatWindowHint:`悬浮在左下角计费卡上的用量速览;综合=当前样式,订阅卡=每次展示一张订阅额度卡(可切换)。`,cardDisplay:`计费卡显示`,cardDisplayHint:`切换左下角计费卡的主指标:花费金额或 Token 消耗(副行与迷你柱同步切换,悬浮窗不受影响)。`,cardMetric:`主指标`,cardMetricMoney:`花费金额`,cardMetricTokens:`Token 消耗`,floatNoTargets:`未指定订阅通道,请在设置中勾选要展示的订阅。`,floatNoTargetsHint:`暂无可选的订阅通道。`,subscriptionsStale:`订阅额度刷新失败,以下为缓存数据`,staleLedgerNotice:`{count} 个会话出自旧版算法存档(日志已删,无法重算),模型归属可能有误差`,tokenCacheWrite:`写入`,toolRank:`工具排行`,toolName:`工具`,userPrices:`自定义单价`,userPricesHint:`为未收录或变价模型填入实付单价,总览与日趋势按此重估;模型可用下拉候选(目录键或模型 id);来源留空=该模型默认价,填入中转站域名=仅该来源的同名模型用此价(协议可省);低谷价三栏填后按峰/谷混合估算,留空=平档`,userPriceSave:`保存`,userPriceModel:`模型`,userPriceSource:`来源(中转站域名)`,userPriceSourceHint:`留空=默认价,或 https://api.中转站.com`,userPriceOffPeak:`低谷价`,userPriceNormal:`标准价`,userPriceCurrency:`币种`,userPriceAdd:`新增`,userPriceRemoveSelected:`删除所选`,userPriceSelect:`选择此行`,sessionStaleBadge:`旧版统计`,heatmapLess:`少`,heatmapMore:`多`,currency:`币种`,currencyCny:`人民币`,currencyUsd:`美元`,heatmap:`用量热力图`,rounds:`每轮费用`,roundsHint:`最近 {count} 轮 · 柱顶为金额 · 底色为峰谷时段`,anomaly:`成本突增`,workspaces:`工作区统计`,workspacesHint:`点击行下钻项目成本前 5 会话`,model:`模型`,thModel:`模型名称`,thInputMiss:`输入缓存未命中`,thInputHit:`输入缓存命中`,costAbbr:`费用`,tabOverview:`概览`,tabTrends:`趋势`,tabProviders:`账单`,tabPricing:`费率`,tabSettings:`设置`,budgetHint:`设置月度上限,用于本月预计与超支分段提醒`,peakAlertHint:`在切档前弹窗提醒,可选同步系统通知`,peakAlertDescPeak:`即将进入高峰时段,价格将上调,请提前安排长任务`,peakAlertDescOff:`即将进入平价时段,价格减半,适合运行大批量任务`,export:`导出`,exportCsvDay:`按日 CSV`,exportCsvSession:`按会话 CSV`,exportJson:`全量 JSON`,peakShare:`峰谷时段占比`,peakSharePerCall:`按调用时刻精确判档`,offPeakSavings:`挪谷可省约 {amount}`,perfMax:`最大 TTFT`,weekCost:`本周`,roleCost:`费用构成`,roleUser:`用户输入`,roleAssistant:`助手输出`,roleTool:`工具结果`,roleHint:`估算:输出按实测计价,输入按消息长度摊分`,tierPeak:`峰时`,tierOff:`平价`,tierToPeak:`后转峰时`,tierToOff:`后转平价`,tierAlertEnterPeak:`{minutes} 分钟后进入峰时(DeepSeek 高峰价 ×2),不急的调用可稍等`,tierAlertEnterOff:`{minutes} 分钟后进入平价(价格减半)`,peakAlertTitlePeak:`即将进入高峰价`,peakAlertTitleOff:`即将进入平价`,peakAlert:`峰谷切换提醒`,peakAlertLeadMin:`提前量(分钟)`,peakAlertPos:`位置`,peakAlertMode:`提醒模式`,peakAlertPosCorner:`右下角`,peakAlertPosCenter:`屏幕居中`,peakAlertModePeak:`仅进入峰时`,peakAlertModeOff:`仅进入平价`,peakAlertModeBoth:`峰与谷都提醒`,peakAlertWebNotify:`同时发系统通知`,peakAlertPreview:`预览提醒`,planTypeCode:`订阅制`,planTypeToken:`按量`,subscriptionFeePerMonth:`{amount}/月`,triggerToday:`今日`,triggerMonth:`当月`,triggerMonthTokens:`当月 Token`,subscriptionIncluded:`订阅包含`,free:`免费`,official:`官方`,thirdParty:`三方`,perfSamples:`样本`,perfTtft:`首字延时`,perfP50:`P50`,perfP90:`P90`,perfTps:`生成速度`,perfLatency:`总延迟`,perfEstimated:`估算样本`,perfEmpty:`暂无性能数据`,perfTpsUnit:`tok/s`,perfTitle:`性能`,perfHint:`按模型与按小时聚合;估算样本为工具续写步骤`,perfAll:`全选`,perfChartEmpty:`未选择模型或该指标暂无数据`,heatmapYear:`年`,heatmapMonth:`月`,activeDays:`活跃天数`,streakDays:`连续使用`,subscriptionAutoDetect:`自动识别`,pluginVersion:`版本`,pluginAuthor:`作者`,pluginRepository:`仓库`,pluginNpm:`npm`,pluginLicense:`许可证`,tabToken:`用量`,tokenExport:`导出 Token`,tokenExportCsv:`按日 Token CSV`,tokenCacheHitRate:`缓存命中率`,tokenReasoningShare:`思考占比`,tokenReasoningShort:`思考`,tokenIo:`输入/输出比`,tokenPeak:`峰值日`,tokenDaily:`每日 Token`,tokenByModel:`模型 Token`,tokenMiss:`输入(缓存未命中)`,tokenHit:`输入(缓存命中)`,tokenOutput:`输出`,tokenViewStructure:`按结构`,tokenViewModel:`按模型`,tokenHitShort:`命中`,tokenMissShort:`未命中`,tokenTotal:`总 Token`,tokenShare:`占比`,usageStatsTool:`注入用量查询工具`,usageStatsToolHint:`让模型可在对话中查询用量/费用;会占用模型每次请求的上下文,coding 场景建议关闭(改后需重载应用生效)`,balanceGranted:`赠金余额`,balanceTopped:`充值余额`,balanceDaily:`日均消耗`,balanceDaysLong:`约可撑`,balanceDaysUnit:`天`,popTodayModel:`主力消耗模型余额`,popTitle:`用量速览`,popNoConsumption:`暂无消耗`,popDirectLead:`直联`,popSubLead:`订阅`,unpricedHint:`{count} 个模型未收录计价,费用已按 0 计`,searchEstimateHint:`含 {count} 次联网搜索请求的估算费用(每次约 {each};日志无用量事件,按次估算,可在配置 searchCallEstimateCny 调整或关闭)`,siteListDisplay:`中转站列表`,siteListDisplayHint:`隐藏「未识别」占位条目,净化中转站额度列表`,liveCostBar:`平价消耗胶囊`,liveCostBarHint:`输入框下方的即时代费条(峰谷档位、本轮/会话费用与额度预警);关闭后整条隐藏,统计与提醒不受影响`,exportCsvSite:`按站点 CSV`,panelRelayQuota:`中转站额度`,relayBalance:`余额`,relayNoQuota:`未读出额度`,relayWindowUsed:`已用`,relayKindNewApi:`New API`,relayKindSub2Api:`Sub2API`,relayKindUnknown:`未识别`},kt={title:`Usage`,cost:`Cost`,todayCost:`Today`,monthCost:`This month`,yearCost:`This year`,monthProjected:`Projected`,liveTurn:`Turn`,liveSession:`Session`,calls:`Calls`,cacheHitRate:`Cache Hit`,tokens:`Tokens`,inputTokens:`Input`,outputTokens:`Output`,avgCost:`Avg cost`,trend:`Daily cost & calls`,trend7d:`7D`,trend30d:`30D`,trendMetric:`Trend metric`,trendMetricCost:`Cost`,trendMetricTokens:`Tokens`,trendEmpty:`No trend data yet`,budget:`Monthly budget`,budgetAmount:`Budget amount`,budgetSummary:`Used {used} / {total} this month; warn at 80%, pulse red at 100%`,sessions:`Sessions`,sessionTitle:`Title`,project:`Project`,lastActive:`Last active`,sessionOverflow:`Top {limit} of {total} sessions by cost`,budgetTierBody:`This month {cost} reached {pct}% of the budget {budget}`,models:`Model billing`,providerBilling:`Provider billing & subscriptions`,actual:`Actual`,pricing:`Model pricing`,input:`Input`,output:`Output`,cacheHit:`Cache hit`,peak:`Peak`,offPeak:`Off-peak`,flat:`Flat`,band:`Band`,close:`Close`,footer:`Polls every 30s · local dsh sessions only`,footerCredit:`dsh-ui-usage-billing {version} · MIT`,lastUpdated:`Updated`,noData:`No billing data yet`,todayRate:`Today rate`,rateLive:`Live`,rateBuiltin:`Built-in`,promoBadge:`Promo`,promoUntil:`Promo price until {date}, then list price resumes automatically`,promoOpenEnded:`End date not announced; billed at the discounted rate until further notice, then list price resumes`,pricingTip:`DeepSeek models: from 2026-08-23 (Sun) 00:00 Beijing, weekdays peak 9-12 / 14-18 (×2), weekends (Sat/Sun) all-day off-peak; cells show peak/off-peak price, billed at call time.`,pricingUnit:`Unit: CNY / per 1M tokens`,pricingNotes:`Pricing notes`,ubPeak:`Peak`,ubOff:`Off`,ubStd:`Std`,peakBand:`Peak/off-peak band`,pricingSource:`Data source`,noteCache:`Cache hits are billed at the cache rate, cutting cost.`,noteBand:`Peak and off-peak prices differ; off-peak is roughly half price.`,noteSource:`Prices come from the live rate + model catalog; unlisted models count as 0 and are flagged.`,balance:`Balance`,balanceUnconfigured:`Not set`,balanceUnauthorized:`Bad key`,balanceUnreachable:`Unavailable`,uncatalogued:`Not catalogued`,estimatedPricing:`Estimated`,balanceDays:`~{days} days left`,balanceLowBody:`{name} balance {balance}, ~{days} days left, please top up`,reconcileDrift:`Detected {provider} official balance moved {spent}, this panel recorded {today}; the gap usually comes from other tools or APIs consuming too`,reconcileDismiss:`Got it`,subscriptionNotConfigured:`Key not set`,subscriptionUnauthorized:`Bad key`,subscriptionUnavailable:`Unavailable`,subscriptionInvalid:`Bad response`,subscriptionRateLimited:`Rate limited`,subscriptionSession:`Current`,subscriptionWeekly:`Weekly`,subscriptionMonthly:`Monthly`,subscriptionBilling:`Billing`,subscriptionRemaining:`{pct}% left`,subscriptionExhausted:`Exhausted`,subscriptionReset:`Resets {date}`,subscriptionNoApi:`Provider does not offer a usage API`,floatWindow:`Model usage popover`,floatModeCombined:`Combined`,floatModeSubscription:`Subscription card`,floatMode:`Display mode`,floatTargets:`Targets`,floatWindowHint:`Usage summary floating on the footer card; Combined=current style, Subscription cards=one quota card at a time (switchable).`,cardDisplay:`Billing card display`,cardDisplayHint:`Switch the main metric on the bottom-left billing card between cost and token usage (sub row and sparkline follow; the popover is unaffected).`,cardMetric:`Main metric`,cardMetricMoney:`Cost`,cardMetricTokens:`Token usage`,floatNoTargets:`No subscription selected — pick some in Settings.`,floatNoTargetsHint:`No subscription channel available.`,subscriptionsStale:`Subscription refresh failed — showing cached data`,staleLedgerNotice:`{count} sessions use legacy-algorithm archives (logs deleted); attribution may be off`,tokenCacheWrite:`written`,toolRank:`Tool calls`,toolName:`Tool`,userPrices:`Custom prices`,userPricesHint:`Enter actual per-1M-token prices; main views are re-costed. Pick a model key from the dropdown candidates. Leave source empty for the model default, or enter a relay origin (protocol optional) to price only that source. Fill all three off-peak fields for peak/off-peak estimation; leave them empty for flat pricing.`,userPriceSave:`Save`,userPriceModel:`Model`,userPriceSource:`Source (relay origin)`,userPriceSourceHint:`Empty = default; e.g. https://api.relay.com`,userPriceOffPeak:`Off-peak price`,userPriceNormal:`Standard price`,userPriceCurrency:`Currency`,userPriceAdd:`Add`,userPriceRemoveSelected:`Remove selected`,userPriceSelect:`Select this row`,sessionStaleBadge:`legacy`,heatmapLess:`Less`,heatmapMore:`More`,currency:`Currency`,currencyCny:`CNY`,currencyUsd:`USD`,heatmap:`Usage heatmap`,rounds:`Cost per turn`,roundsHint:`Last {count} rounds · bar tops show amount · fill = peak/off-peak`,anomaly:`Cost spike`,workspaces:`Workspaces`,workspacesHint:`Click a row to drill into its top-5 sessions`,model:`Model`,thModel:`Model name`,thInputMiss:`Input (cache miss)`,thInputHit:`Input (cache hit)`,costAbbr:`cost`,tabOverview:`Overview`,tabTrends:`Trends`,tabProviders:`Bills`,tabPricing:`Rates`,tabSettings:`Settings`,budgetHint:`Set a monthly cap for projections and tier alerts`,peakAlertHint:`Alert before a tier switch, optionally via system notification`,peakAlertDescPeak:`About to enter peak hours — prices rise, plan long tasks ahead`,peakAlertDescOff:`About to enter off-peak hours — price halves, ideal for large batches`,export:`Export`,exportCsvDay:`Daily CSV`,exportCsvSession:`Sessions CSV`,exportJson:`Full JSON`,peakShare:`Peak vs off-peak`,peakSharePerCall:`per-call attribution, full history`,offPeakSavings:`Shift peak to off-peak: save ~{amount}`,perfMax:`Max TTFT`,weekCost:`This week`,roleCost:`Cost breakdown`,roleUser:`User input`,roleAssistant:`Assistant output`,roleTool:`Tool results`,roleHint:`Estimated: output priced exactly, input split by message size`,tierPeak:`Peak`,tierOff:`Off-peak`,tierToPeak:`until peak`,tierToOff:`until off-peak`,tierAlertEnterPeak:`Peak pricing (2x) starts in {minutes} min — non-urgent calls can wait`,tierAlertEnterOff:`Off-peak pricing (50% off) starts in {minutes} min`,peakAlertTitlePeak:`Peak pricing incoming`,peakAlertTitleOff:`Off-peak incoming`,peakAlert:`Peak/off-peak alert`,peakAlertLeadMin:`Lead time (min)`,peakAlertPos:`Position`,peakAlertMode:`Remind mode`,peakAlertPosCorner:`Bottom-right`,peakAlertPosCenter:`Center`,peakAlertModePeak:`Entering peak only`,peakAlertModeOff:`Entering off-peak only`,peakAlertModeBoth:`Both`,peakAlertWebNotify:`Also send system notification`,peakAlertPreview:`Preview alert`,planTypeCode:`Subscription`,planTypeToken:`Usage`,subscriptionFeePerMonth:`{amount}/mo`,triggerToday:`Today`,triggerMonth:`This month`,triggerMonthTokens:`Monthly tokens`,subscriptionIncluded:`Included`,free:`Free`,official:`Official`,thirdParty:`Third-party`,perfSamples:`Samples`,perfTtft:`TTFT`,perfP50:`P50`,perfP90:`P90`,perfTps:`Speed`,perfLatency:`Total latency`,perfEstimated:`Estimated`,perfEmpty:`No performance data yet`,perfTpsUnit:`tok/s`,perfTitle:`Performance`,perfHint:`Per model & per hour; estimated samples are tool-continuation steps`,perfAll:`All`,perfChartEmpty:`No model selected or no data for this metric`,heatmapYear:`Year`,heatmapMonth:`Month`,activeDays:`Active days`,streakDays:`Streak`,subscriptionAutoDetect:`Auto`,pluginVersion:`Version`,pluginAuthor:`Author`,pluginRepository:`Repository`,pluginNpm:`npm`,pluginLicense:`License`,tabToken:`Usage`,tokenExport:`Export tokens`,tokenExportCsv:`Daily token CSV`,tokenCacheHitRate:`Cache hit rate`,tokenReasoningShare:`Reasoning share`,tokenReasoningShort:`reasoning`,tokenIo:`In/out ratio`,tokenPeak:`Peak day`,tokenDaily:`Daily tokens`,tokenByModel:`Tokens by model`,tokenMiss:`Input (cache miss)`,tokenHit:`Input (cache hit)`,tokenOutput:`Output`,tokenViewStructure:`Structure`,tokenViewModel:`By model`,tokenHitShort:`Hit`,tokenMissShort:`Miss`,tokenTotal:`Total tokens`,tokenShare:`Share`,usageStatsTool:`Inject usage-stats tool`,usageStatsToolHint:`Lets the model query usage/cost inside a conversation; it consumes context per request, so keep it off for coding (takes effect after a reload)`,balanceGranted:`Granted`,balanceTopped:`Topped up`,balanceDaily:`Daily burn`,balanceDaysLong:`~days left`,balanceDaysUnit:`days`,popTodayModel:`Main model balance`,popTitle:`Usage overview`,popNoConsumption:`No usage yet`,popDirectLead:`Direct`,popSubLead:`Subscription`,unpricedHint:`{count} models not priced; their cost counts as 0`,searchEstimateHint:`Includes estimated cost of {count} web-search requests (~{each} each; no usage events logged, per-call estimate; tune via searchCallEstimateCny)`,siteListDisplay:`Relay lists`,siteListDisplayHint:`Hide "unidentified" placeholder rows in the relay quota list`,liveCostBar:`Live cost capsule`,liveCostBarHint:`The live cost bar under the composer (pricing tier, per-turn/session spend, quota alerts); hiding it never affects stats or alerts`,exportCsvSite:`By site CSV`,panelRelayQuota:`Relay quotas`,relayBalance:`Balance`,relayNoQuota:`No quota`,relayWindowUsed:`used`,relayKindNewApi:`New API`,relayKindSub2Api:`Sub2API`,relayKindUnknown:`Unknown`},At={"智谱 AI":`Zhipu AI`,阿里通义:`Alibaba Qwen`,字节豆包:`ByteDance Doubao`,月之暗面:`Moonshot AI`,小米:`Xiaomi`,百度文心:`Baidu ERNIE`,腾讯混元:`Tencent Hunyuan`,零一万物:`01.AI`,阶跃星辰:`StepFun`,科大讯飞:`iFlytek Spark`,商汤:`SenseNova`,百川智能:`Baichuan`,"小米 Token Plan(海外)":`Xiaomi Token Plan (Global)`,"小米 Token Plan(国内)":`Xiaomi Token Plan (CN)`,"小米 Token Plan(新加坡)":`Xiaomi Token Plan (SG)`,"火山引擎 Token Plan":`Volcengine Token Plan`,"火山方舟 Token Plan":`Volcengine Ark Token Plan`,"豆包 Token Plan":`Doubao Token Plan`,"百度文心 Plan":`Baidu ERNIE Plan`,"MiniMax Token Plan(国内)":`MiniMax Token Plan (CN)`};function jt(e,t){return t===`en`?At[e]??e:e}let Mt={DeepSeek:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M35.7 9.9C35.3 9.8 35.2 10.1 35 10.2C34.9 10.3 34.9 10.4 34.8 10.4C34.3 10.9 33.7 11.3 33 11.2C31.9 11.2 30.9 11.5 30.1 12.4C29.9 11.3 29.3 10.7 28.4 10.3C28 10.1 27.5 9.9 27.1 9.4C26.9 9.1 26.9 8.8 26.7 8.4C26.7 8.2 26.6 8 26.4 7.9C26.1 7.9 26 8.1 25.9 8.3C25.5 9.1 25.3 9.9 25.3 10.8C25.3 12.7 26.2 14.2 27.8 15.3C27.9 15.4 28 15.5 27.9 15.7C27.8 16.1 27.7 16.5 27.6 16.8C27.5 17.1 27.4 17.1 27.1 17C26.3 16.7 25.5 16.1 24.8 15.4C23.7 14.3 22.7 13.1 21.4 12.2C21.1 12 20.8 11.7 20.4 11.5C19.1 10.3 20.6 9.2 21 9.1C21.3 9 21.1 8.5 19.9 8.5C18.8 8.5 17.7 8.9 16.3 9.4C16.1 9.5 15.9 9.6 15.7 9.6C14.5 9.4 13.2 9.3 11.9 9.5C9.4 9.8 7.4 11 5.9 13C4.1 15.4 3.7 18.2 4.2 21.1C4.7 24.1 6.3 26.6 8.7 28.6C11.2 30.7 14 31.7 17.3 31.5C19.2 31.4 21.4 31.1 23.9 29C24.6 29.3 25.2 29.4 26.3 29.5C27.1 29.6 27.9 29.5 28.6 29.3C29.6 29.1 29.5 28.2 29.1 28.1C26.3 26.7 26.9 27.3 26.3 26.8C27.8 25.1 30 23.3 30.8 17.5C30.9 17 30.8 16.7 30.8 16.4C30.8 16.1 30.9 16.1 31.1 16C31.9 15.9 32.6 15.7 33.2 15.4C35.1 14.4 35.8 12.7 36 10.7C36 10.4 36 10.1 35.7 9.9ZM19.4 27.9C16.7 25.8 15.3 25 14.7 25.1C14.2 25.1 14.3 25.7 14.4 26.1C14.6 26.5 14.7 26.7 14.9 27.1C15.1 27.3 15.2 27.6 14.8 27.9C13.9 28.4 12.3 27.7 12.2 27.6C10.4 26.6 8.9 25.2 7.8 23.2C6.8 21.4 6.2 19.4 6.1 17.3C6.1 16.7 6.2 16.6 6.8 16.5C7.4 16.3 8.1 16.3 8.8 16.4C11.6 16.8 14.1 18.1 16.1 20.1C17.2 21.3 18.1 22.6 19 24C20 25.4 21 26.8 22.3 27.9C22.8 28.2 23.2 28.5 23.5 28.8C22.4 28.9 20.7 28.9 19.4 27.9ZM20.8 19.4C20.8 19.3 20.8 19.2 20.8 19.2C20.9 19.1 20.9 19.1 21 19C21 19 21.1 19 21.1 19C21.2 18.9 21.3 19 21.3 19C21.4 19 21.5 19.1 21.5 19.1C21.6 19.2 21.6 19.3 21.6 19.4C21.6 19.4 21.6 19.5 21.6 19.5C21.5 19.6 21.5 19.6 21.5 19.6C21.4 19.7 21.4 19.7 21.3 19.7C21.3 19.8 21.2 19.8 21.2 19.8C21.1 19.8 21.1 19.8 21 19.7C21 19.7 20.9 19.7 20.9 19.6C20.9 19.6 20.8 19.6 20.8 19.5C20.8 19.5 20.8 19.4 20.8 19.4ZM24.9 21.5C24.7 21.6 24.4 21.7 24.1 21.7C23.8 21.7 23.4 21.6 23.1 21.4C22.7 21.1 22.4 20.9 22.3 20.3C22.3 20.1 22.3 19.8 22.4 19.6C22.4 19.1 22.3 18.8 22 18.6C21.8 18.4 21.5 18.3 21.1 18.3C21 18.3 20.9 18.3 20.8 18.2C20.6 18.2 20.5 18 20.6 17.7C20.7 17.7 20.8 17.5 20.9 17.5C21.4 17.2 21.9 17.3 22.4 17.5C22.9 17.7 23.2 18 23.7 18.5C24.3 19.1 24.4 19.3 24.7 19.8C24.9 20.1 25.1 20.5 25.3 20.9C25.3 21.1 25.2 21.4 24.9 21.5Z' fill='currentColor'/%3E%3C/svg%3E`,OpenAI:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M32.8 17.3C33.2 16.3 33.3 15.2 33.2 14.2C33.1 13.2 32.7 12.1 32.3 11.2C31.4 9.8 30.2 8.7 28.8 8C27.3 7.3 25.7 7.2 24.1 7.5C23.4 6.8 22.5 6.1 21.6 5.7C20.7 5.2 19.5 5 18.5 5C16.9 5 15.3 5.5 14 6.4C12.7 7.3 11.7 8.7 11.3 10.2C10.2 10.4 9.2 10.9 8.3 11.5C7.4 12.1 6.8 13 6.2 13.8C5.4 15.2 5.1 16.8 5.3 18.4C5.5 20 6.1 21.5 7.2 22.7C6.8 23.7 6.7 24.8 6.8 25.8C6.9 26.8 7.2 27.9 7.7 28.8C8.6 30.2 9.8 31.3 11.2 32C12.7 32.7 14.3 32.8 15.9 32.5C16.6 33.2 17.5 33.9 18.4 34.3C19.3 34.8 20.5 35 21.5 35C23.1 35 24.7 34.5 26 33.6C27.3 32.7 28.2 31.3 28.7 29.8C29.8 29.6 30.8 29.2 31.6 28.5C32.5 27.9 33.2 27.1 33.7 26.2C34.5 24.8 34.8 23.2 34.6 21.6C34.4 20 33.9 18.5 32.8 17.3ZM21.6 33C20.1 33 19 32.6 17.9 31.7C17.9 31.7 18 31.6 18.1 31.6L24.1 28.2C24.3 28.1 24.4 27.9 24.5 27.8C24.6 27.6 24.6 27.5 24.6 27.3V18.9L27.1 20.4V27.3C27.1 28.1 27 28.8 26.8 29.5C26.5 30.2 26.1 30.8 25.6 31.3C25.1 31.9 24.4 32.3 23.7 32.6C23.1 32.9 22.3 33 21.6 33ZM9.5 27.9C8.8 26.7 8.6 25.4 8.8 24.1C8.8 24.1 8.9 24.2 9 24.2L15 27.7C15.2 27.8 15.3 27.8 15.5 27.8C15.7 27.8 15.9 27.8 16 27.7L23.3 23.5V26.4L17.2 29.9C16.6 30.3 15.9 30.5 15.1 30.6C14.4 30.7 13.7 30.7 13 30.5C11.5 30.1 10.2 29.2 9.5 27.9ZM7.9 14.8C8.6 13.7 9.6 12.9 10.8 12.4V19.5C10.8 19.7 10.8 19.9 10.9 20C11 20.2 11.1 20.3 11.3 20.4L18.6 24.6L16.1 26.1L10.1 22.6C9.4 22.3 8.9 21.8 8.4 21.2C8 20.6 7.6 20 7.4 19.3C7.1 17.8 7.2 16.2 7.9 14.8ZM28.6 19.6L21.3 15.4L23.8 13.9L29.8 17.4C30.8 17.9 31.5 18.7 32 19.6C32.5 20.6 32.7 21.6 32.7 22.7C32.6 23.8 32.2 24.8 31.5 25.6C30.9 26.5 30 27.1 29 27.5V20.4C29 20.2 29 20 28.9 19.9C28.9 19.9 28.8 19.7 28.6 19.6ZM31.2 15.9C31.2 15.9 31.1 15.8 31 15.8L25 12.3C24.8 12.2 24.7 12.2 24.5 12.2C24.3 12.2 24.1 12.2 24 12.3L16.7 16.5V13.6L22.8 10.1C23.7 9.5 24.8 9.3 25.9 9.3C26.9 9.3 28 9.7 28.9 10.3C29.7 11 30.5 11.8 30.9 12.8C31.2 13.7 31.3 14.8 31.2 15.9ZM15.4 21.1L12.9 19.6V12.6C12.9 11.6 13.2 10.4 13.7 9.6C14.3 8.7 15.1 8 16.1 7.5C17 7.1 18.1 6.9 19.2 7.1C20.2 7.2 21.2 7.6 22.1 8.3C22.1 8.3 22 8.4 21.9 8.4L15.9 11.8C15.7 11.9 15.6 12.1 15.5 12.2C15.4 12.4 15.4 12.5 15.4 12.7V21.1ZM16.7 18.1L20 16.3L23.3 18.1V21.9L20 23.8L16.7 21.9V18.1Z' fill='currentColor'/%3E%3C/svg%3E`,Google:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M37 20C27.9 20.6 20.6 27.9 20 37H20C19.4 27.9 12.1 20.6 3 20V20C12.1 19.4 19.4 12.1 20 3H20C20.6 12.1 27.9 19.4 37 20V20Z' fill='currentColor'/%3E%3C/svg%3E`,"智谱 AI":`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.1 7.5L17.4 11.2H5.8L8.5 7.5H20.1H20.1ZM34.1 28.8L31.3 32.5H19.8L22.5 28.8H34.1ZM35 7.5L16.6 32.5H5L23.4 7.5H35Z' fill='currentColor'/%3E%3C/svg%3E`,腾讯混元:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18.1 25.2C19.6 26.8 21.1 28.1 22.7 29.2L21.5 30.8C19.9 29.7 18.3 28.3 16.7 26.6C17.1 26.1 17.6 25.7 18.1 25.2ZM10 2.7C11.8 1.7 13.8 2.2 15.6 3.3C17.5 4.4 19.5 6.2 21.3 8.3L19.7 9.6C18 7.6 16.2 6 14.6 5.1C13 4.1 11.8 4 11 4.5C10 5 9.4 6.5 9.8 9.2C9.9 9.8 10 10.4 10.2 11.1C11.6 10.9 13.1 10.9 14.6 10.9C17.7 10.9 20.5 11.2 22.8 11.7L22.8 11.7C23.2 11.8 23.6 11.9 24 12C24 12 24 12 24 12C24.7 12.2 25.3 12.4 25.9 12.6C28.6 13.7 30.6 15.5 30.6 17.9C30.6 19.9 29.1 21.4 27.3 22.5C25.4 23.6 22.9 24.3 20.1 24.8L19.8 22.9C22.4 22.4 24.7 21.7 26.3 20.8C27.9 19.8 28.6 18.8 28.6 17.9C28.6 16.8 27.7 15.5 25.1 14.5C24.6 14.3 23.9 14 23.2 13.8C22.7 15.1 22 16.4 21.3 17.7C18.9 21.7 16.4 24.8 14.1 26.6C11.8 28.4 9.2 29.3 7.2 28.1C5.4 27 4.8 25 4.8 22.9C4.9 20.7 5.5 18.1 6.4 15.5L8.3 16.2C7.4 18.7 6.9 21 6.8 22.9C6.8 24.8 7.4 25.8 8.2 26.3C9.1 26.9 10.7 26.7 12.8 25C13.3 24.7 13.8 24.2 14.3 23.7C13.4 22.6 12.6 21.4 11.9 20.1C9.6 16.1 8.2 12.4 7.8 9.4C7.4 6.5 7.9 3.9 10 2.7ZM14.6 12.9C13.3 12.9 12 12.9 10.8 13.1C11.4 14.9 12.4 16.9 13.6 19.1C14.3 20.2 15 21.3 15.7 22.3C17 20.8 18.3 18.9 19.5 16.7C20.2 15.6 20.7 14.5 21.2 13.4C19.3 13.1 17.1 12.9 14.6 12.9ZM6.2 11.8C6.4 12.5 6.6 13.1 6.8 13.8C4.9 14.2 3.1 14.8 1.5 15.5L0.7 13.7C2.3 13 4.2 12.3 6.2 11.8ZM24.9 3.6L25.9 3.7C25.7 5.7 25.3 7.8 24.6 10.1C24.2 9.9 23.7 9.8 23.2 9.7C23 9.7 22.8 9.7 22.7 9.6C23.3 7.5 23.7 5.4 23.9 3.5L24.9 3.6Z' fill='currentColor'/%3E%3C/svg%3E`,MiniMax:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.9 9.2C17.9 8.6 17.4 8.1 16.8 8.1C16.2 8.1 15.7 8.6 15.7 9.2V27.6C15.7 29.1 14.5 30.2 13.1 30.2C11.7 30.2 10.5 29.1 10.5 27.6V15.8C10.5 15.2 10 14.7 9.4 14.7C8.8 14.7 8.3 15.2 8.3 15.8V20.8C8.3 22.3 7.1 23.4 5.7 23.4C4.3 23.4 3.1 22.3 3.1 20.8V19C3.1 18.6 3.4 18.3 3.8 18.3C4.3 18.3 4.6 18.6 4.6 19V20.8C4.6 21.4 5.1 21.9 5.7 21.9C6.3 21.9 6.8 21.4 6.8 20.8V15.8C6.8 14.4 8 13.2 9.4 13.2C10.8 13.2 12 14.4 12 15.8V27.6C12 28.3 12.5 28.8 13.1 28.8C13.7 28.8 14.2 28.3 14.2 27.6V20.4V9.2C14.2 7.8 15.3 6.6 16.8 6.6C18.2 6.6 19.3 7.8 19.3 9.2V24.5C19.3 24.9 19 25.2 18.6 25.2C18.2 25.2 17.9 24.9 17.9 24.5V9.2ZM31.5 13.2C30.1 13.2 28.9 14.4 28.9 15.8V25.7C28.9 26.3 28.5 26.8 27.8 26.8C27.2 26.8 26.7 26.3 26.7 25.7V9.2C26.7 7.8 25.6 6.6 24.1 6.6C22.7 6.6 21.6 7.8 21.6 9.2V30.1C21.6 30.8 21.1 31.3 20.5 31.3C19.8 31.3 19.3 30.8 19.3 30.1V27.5C19.3 27.1 19 26.8 18.6 26.8C18.2 26.8 17.9 27.1 17.9 27.5V30.1C17.9 31.6 19 32.7 20.5 32.7C21.9 32.7 23 31.6 23 30.1V9.2C23 8.6 23.5 8.1 24.1 8.1C24.8 8.1 25.3 8.6 25.3 9.2V25.7C25.3 27.1 26.4 28.3 27.8 28.3C29.3 28.3 30.4 27.1 30.4 25.7V15.8C30.4 15.2 30.9 14.7 31.5 14.7C32.1 14.7 32.6 15.2 32.6 15.8V24.5C32.6 24.9 33 25.2 33.4 25.2C33.8 25.2 34.1 24.9 34.1 24.5V15.8C34.1 14.4 33 13.2 31.5 13.2Z' fill='currentColor'/%3E%3C/svg%3E`,阿里通义:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M38 23C33.8 25.3 29.6 27.4 24.9 28.3C23.8 28.5 22.6 28.5 21.6 28.4C20.6 28.2 20.1 27.3 20.4 26.4C20.8 25.5 21.2 24.6 21.8 23.9C23.1 22.3 24.5 20.8 25.8 19.3C26.6 18.3 27.3 17.3 28 16.2C28.4 15.4 28.2 14.5 27.4 14.1C26.1 13.5 24.6 13 23.2 12.5C23 12.4 22.8 12.6 22.5 12.7C22.9 13.1 23.2 13.4 23.6 13.7C19.3 14.4 15.3 15.5 11.4 16.9C11.4 17 11.4 17 11.4 17C12 17.9 11.7 18.6 10.9 19.1C10.6 19.4 10.3 19.6 10 19.9C12.6 20.7 14.9 20.2 17.1 18.8C16.9 18.6 16.8 18.5 16.7 18.3C17.5 18.4 18 18.9 18 19.6C18.1 19.7 18 19.9 17.9 20C17.8 19.9 17.6 19.8 17.5 19.6C17.5 19.5 17.5 19.4 17.4 19.3C14.8 21 12 21.4 9 20.5C9 21.1 8.9 21.6 9 22.1C9 22.6 8.8 22.8 8.4 23C7.6 23.5 6.6 24.1 5.9 24.8C5 25.7 5.3 26.8 6.5 27.2C7.9 27.7 9.3 27.7 10.8 27.6C12.4 27.3 14.1 27.1 15.9 26.8C13.8 27.8 11.7 28.5 9.4 28.8C7.9 29 6.3 29.1 4.8 28.7C2.6 28.1 1.6 26.4 2.2 24.3C2.7 22.2 4 20.6 5.4 19.1C10.1 14.1 16.1 11.5 23 11C24.6 10.9 26.2 11.1 27.7 11.8C29.8 12.8 30.7 14.8 29.7 16.8C29 18.2 28.1 19.4 27.1 20.7C26.2 21.9 25.2 23 24.2 24.2C23.9 24.5 23.7 24.9 23.5 25.3C23.1 26 23.3 26.5 24.2 26.4C26 26.3 27.9 26.1 29.6 25.7C32.2 25 34.7 24.1 37.3 23.3C37.5 23.2 37.8 23.1 38 23V23Z' fill='currentColor'/%3E%3C/svg%3E`,小米:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.4 5C13.6 5.2 11.4 5.8 9.5 7.1C8.1 8 7.1 9.1 6.4 10.7C5.6 12.4 5.2 14.3 5.1 17.7C4.9 21.6 5.2 25.5 5.8 27.5C6.3 29.4 7.1 30.8 8.4 32C10 33.5 11.7 34.3 14.5 34.7C17 35 22.8 35.1 25.3 34.7C28.4 34.3 30.4 33.4 32 31.7C32.8 30.9 33.2 30.4 33.7 29.3C34.5 27.6 34.8 25.8 35 22.2C35.1 19.7 35 16.1 34.7 14.4C34.1 10.5 32.5 7.9 29.5 6.4C28 5.6 25.7 5.2 22.5 5C20.1 4.9 19.8 4.9 17.4 5ZM21.1 14.4C22.4 14.7 23 15.1 23.4 16C23.9 17 24 17.7 24 21.9V25.8L22.5 25.8L21.1 25.7L21 21.9C21 17.8 21 17.6 20.4 17.2C19.9 16.8 19.4 16.7 16.6 16.7H13.9L13.8 21.2L13.8 25.7H11L10.9 20C10.9 15.5 10.9 14.3 11 14.2C11.1 14.2 13.2 14.2 15.8 14.2C19.5 14.2 20.5 14.3 21.1 14.4ZM28.9 14.3C29 14.5 29 25.4 29 25.7C29 25.8 28.3 25.8 27.5 25.8L26.1 25.7L26.1 20.1C26.1 16 26.1 14.4 26.2 14.3C26.3 14.2 26.6 14.2 27.6 14.2C28.7 14.2 28.9 14.2 28.9 14.3ZM18.9 22.2V25.8L17.5 25.8L16 25.7L15.9 22.3C15.9 20.5 15.9 18.9 16 18.8C16 18.7 16.4 18.7 17.5 18.7H18.9V22.2Z' fill='currentColor'/%3E%3C/svg%3E`,字节豆包:`data:image/svg+xml,%3Csvg fill='currentColor' fill-rule='evenodd' height='1em' style='flex:none;line-height:1' viewBox='0 0 24 24' width='1em' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.3 5.4L3.1 21.7a.215.2 0 0.2.261h8.3a.214.2 0 0.2-.261L7.7 5.4a.214.2 0 00-.41 0z' fill-opacity='.5'%3E%3C/path%3E%3Cpath clip-rule='evenodd' d='M4.6 16.2l-1.4 5.6a.214.2 0 0.2.261h2.4-4.6a.214.2 0 01-.214-.26l2.3-9a.214.2 0 1.4 0l.864 3.4z'%3E%3C/path%3E%3Cpath d='M14.4.15a.214.2 0 00-.41 0L8.4 21.7a.214.2 0 0.2.261H19.9a.214.2 0 0.2-.261L14.4.151z' fill-opacity='.5'%3E%3C/path%3E%3Cpath clip-rule='evenodd' d='M16.7 22h3.2a.215.2 0 0.2-.262l-1.8-7 1.2-4.6a.214.2 0 1.4 0l3 11.6a.214.2 0 01-.214.3h-5.9z'%3E%3C/path%3E%3Cpath d='M10.3 7.7L6.7 21.7a.214.2 0 0.2.264h7.2a.216.2 0 0.2-.166.2.216 0 000-.098L10.7 7.7a.214.2 0 00-.409 0z'%3E%3C/path%3E%3C/svg%3E`,月之暗面:`data:image/svg+xml,%3Csvg viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M26 4a16 16 0 1 0 10 28A18 18 0 0 1 26 4z' fill='currentColor'/%3E%3C/svg%3E`};function Nt(e){return Mt[e]}let Pt=`dsh-billing-peak-alert-v1`,Ft={enabled:!1,leadMin:2,position:`bottom-right`,webNotify:!0,mode:`both`};function It(){try{let e=localStorage.getItem(Pt);if(e===null)return{...Ft};let t=JSON.parse(e),n=t.mode===`peak`||t.mode===`offPeak`?t.mode:Ft.mode,r=t.position===`center`?`center`:`bottom-right`;return{enabled:t.enabled===!0,leadMin:typeof t.leadMin==`number`&&Number.isFinite(t.leadMin)?Math.min(30,Math.max(1,Math.round(t.leadMin))):Ft.leadMin,position:r,webNotify:t.webNotify!==!1,mode:n}}catch{return{...Ft}}}function Lt(e){try{localStorage.setItem(Pt,JSON.stringify(e))}catch{}}function Rt(e,t,n){if(!t.enabled)return null;let r=z(e,t.leadMin*6e4);return r===null||t.mode===`peak`&&r.entering!==`peak`||t.mode===`offPeak`&&r.entering!==`offPeak`||r.atMs===n?null:r}function zt({hit:e,config:t,t:n,onDismiss:i}){let[o,s]=(0,r.useState)(()=>Date.now());if((0,r.useEffect)(()=>{let e=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,r.useEffect)(()=>{o>=e.atMs&&i()},[o,e.atMs,i]),o>=e.atMs)return null;let l=Math.max(1,Math.round((e.atMs-o)/6e4)),u=e.entering,d=n(u===`peak`?`tierPeak`:`tierOff`),f=n(u===`peak`?`peakAlertDescPeak`:`peakAlertDescOff`),p=u===`peak`;return(0,a.jsxs)(`div`,{className:c(A.peakCard,p?A.peakCardPeak:A.peakCardOff,t.position===`center`?A.peakCardCenter:A.peakCardCorner),"data-testid":`billing-peak-alert`,role:`alert`,children:[(0,a.jsxs)(`div`,{className:A.peakHead,children:[(0,a.jsxs)(`span`,{className:c(A.peakTag,p?A.peakTagPrimary:A.peakTagSuccess),children:[(0,a.jsx)(`span`,{className:c(A.peakDot,p?A.peakDotPrimary:A.peakDotSuccess),"aria-hidden":`true`}),d]}),(0,a.jsx)(`button`,{type:`button`,className:A.peakClose,onClick:i,"aria-label":n(`close`),children:`×`})]}),(0,a.jsxs)(`div`,{className:c(A.peakCount,p?A.peakCountPrimary:A.peakCountSuccess),children:[l,`min`]}),(0,a.jsx)(`p`,{className:A.peakDesc,children:f})]})}let Bt=[{id:`overview`,labelKey:`tabOverview`},{id:`providers`,labelKey:`tabProviders`},{id:`token`,labelKey:`tabToken`},{id:`trends`,labelKey:`tabTrends`},{id:`pricing`,labelKey:`tabPricing`},{id:`settings`,labelKey:`tabSettings`}];function Vt(e){if(e!==void 0)return e.split(/[\\/]/).filter(Boolean).pop()??e}let Ht=[50,80,100],Ut={checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]},Wt={DeepSeek:[`deepseek`],"智谱 AI":[`zhipu`,`glm`,`z.ai`],阿里通义:[`qwen`,`tongyi`,`dashscope`,`aliyun`],字节豆包:[`doubao`,`volcengine`,`ark`],月之暗面:[`moonshot`,`kimi`],小米:[`xiaomi`,`mi`,`mimo`],MiniMax:[`minimax`],百度文心:[`ernie`,`wenxin`,`qianfan`,`baidu`],腾讯混元:[`hunyuan`,`tencent`],零一万物:[`01.ai`,`lingyi`,`yi`],阶跃星辰:[`step`,`stepfun`,`step-3.7`],科大讯飞:[`spark`,`xfyun`,`iflytek`],商汤:[`sensenova`,`sensetime`],百川智能:[`baichuan`],OpenAI:[`openai`],Google:[`google`,`gemini`],xAI:[`xai`,`grok`],Meta:[`meta`,`llama`],Anthropic:[`claude`,`anthropic`],"Mistral AI":[`mistral`,`ministral`,`devstral`],Cohere:[`cohere`,`command`],美团:[`longcat`,`meituan`],面壁智能:[`minicpm`,`modelbest`],小红书:[`dots`,`rednote`,`xiaohongshu`]};function Q(e){return e.trim().toLowerCase().replace(/[\s_/-]+/g,``)}function Gt(e,t){if(e.length===0||t.length===0)return!1;if(e===t)return!0;let[n,r]=e.length<=t.length?[e,t]:[t,e];return n.length>=3&&r.includes(n)}function Kt(e,t){let n=Q(e),r=Q(t);if(Gt(n,r))return!0;let i=Wt[e];return i!==void 0&&i.some(e=>Gt(Q(e),r))}function qt(e){let t=e.trim().toLowerCase(),n=t.replace(/[\s_/-]+/g,``);if(n.length!==0){for(let[e,n]of Object.entries(Wt))for(let r of n){let n=Q(r);if(n.length!==0&&(t===n||t.startsWith(`${n}-`)||t.startsWith(`${n}/`)||t.startsWith(`${n}_`)||t.includes(`${n}-`)||t.includes(`${n}/`)||t.includes(`${n}_`)))return e}for(let[e,t]of Object.entries(Wt))for(let r of t){let t=Q(r);if(!(t.length<4)&&n.includes(t))return e}}}let Jt={"kimi-coding":`月之暗面`,"zai-coding-cn":`智谱 AI`,"zai-coding":`智谱 AI`,"qwen-token-plan":`阿里通义`,"qwen-token-plan-cn":`阿里通义`,"xiaomi-token-plan-ams":`小米`,"xiaomi-token-plan-cn":`小米`,"xiaomi-token-plan-sgp":`小米`,"volcengine-token-plan":`字节豆包`,"ark-token-plan":`字节豆包`,"doubao-token-plan":`字节豆包`,ernie:`百度文心`,baidu:`百度文心`,wenxin:`百度文心`,minimax:`MiniMax`,"minimax-cn":`MiniMax`,"minimax-token-plan":`MiniMax`,"minimax-token-plan-cn":`MiniMax`,"hunyuan-token-plan":`腾讯混元`,"tencent-token-plan":`腾讯混元`,"hy-token-plan":`腾讯混元`,"xinghuo-token-plan":`讯飞星火`,"xfyun-coding":`讯飞星火`,"spark-coding":`讯飞星火`,"huawei-token-plan":`华为云`,"pangu-token-plan":`华为云`,"huawei-maas-token-plan":`华为云`,"volcengine-agent-plan":`字节豆包`,"ark-agent-plan":`字节豆包`,"baidu-token-plan":`百度文心`,"ernie-token-plan":`百度文心`,"wenxin-token-plan":`百度文心`,opencode:`OpenCode`,"opencode-go":`OpenCode`};function Yt(e){let t=Jt[e];return t===void 0?qt(e)??e:t}function Xt(e,t){let n=Object.keys(e).filter(e=>e<=t).sort().slice(-7);return n.length===0?0:n.reduce((t,n)=>t+(e[n]?.cost??0),0)/n.length}function Zt(e,t,n){let r=Object.keys(e).filter(e=>e.startsWith(t)),[i,a]=t.split(`-`).map(Number),o=new Date(i,a,0).getDate(),s=r.length>0?r.reduce((t,n)=>t+(e[n]?.cost??0),0)/r.length:Xt(e,n);return s<=0?0:s*o}function Qt(e){let t=pe();if(t===void 0||e.byDayModels===void 0)return e;let n=xe().rate,r=e.byDayModelsSite!==void 0,i={},a={},o=new Map,s=0,c=e=>t.some(t=>t.origin!==void 0&&t.origin!==``&&(t.key===e||V(t.key)===V(e))),l=(e,t,r)=>{if(e===void 0)return r;let i=Math.min(t.cacheHit,t.cacheMiss+t.cacheHit),a=r=>{let a=(t.cacheMiss*r.input+i*r.cacheHit+t.output*r.output)/1e6;return e.currency===`USD`?a*n:a};return e.offPeak===void 0?a(e):a(e)*F+a(e.offPeak)*.5};for(let[t,n]of Object.entries(e.byDayModels)){let u=0,d={};for(let[i,a]of Object.entries(n)){let n=he(i)??_e(i),s=r&&c(i),f;if((n!==void 0||s)&&s&&e.byDayModelsSite?.[t]?.[i]!==void 0){let r=0;for(let[a,o]of Object.entries(e.byDayModelsSite[t][i])){let e=a.startsWith(`site:`)?a.slice(5):void 0,t=e===void 0?void 0:he(i,e);r+=l(t??n,o,o.cost)}f=r}else f=l(n,a,a.cost);u+=f,d[i]={...a,cost:f},o.set(i,(o.get(i)??0)+f)}let f=e.byDay[t];f!==void 0&&(i[t]={...f,cost:u}),a[t]=d,s+=u}return{...e,total:{...e.total,cost:s},byDay:i,byDayModels:a,byModel:Object.fromEntries(Object.entries(e.byModel).map(([e,t])=>{let n=o.get(e);return[e,n===void 0?t:{...t,cost:n}]}))}}function $t(e){return Object.keys(e).length}function en(e,t=Date.now()){let n=0,r=new Date(t);for(;$(r.getTime())in e;)n+=1,r.setDate(r.getDate()-1);return n}function tn(e){let t=[];for(let n=6;n>=0;--n){let r=new Date;r.setDate(r.getDate()-n);let i=$(r.getTime());t.push({date:i,cost:e[i]?.cost??0})}return t}function nn(e,t){return e.checked?e.okProviders.some(e=>Kt(t,e))?A.healthOk:e.badProviders.some(e=>Kt(t,e))?A.healthBad:A.healthIdle:A.healthIdle}function rn(e,t){switch(e){case`ok`:return``;case`not-configured`:return t(`subscriptionNotConfigured`);case`unauthorized`:return t(`subscriptionUnauthorized`);case`rate-limited`:return t(`subscriptionRateLimited`);case`invalid-response`:return t(`subscriptionInvalid`);default:return t(`subscriptionUnavailable`)}}function an(e,t){switch(e){case`session`:return t(`subscriptionSession`);case`weekly`:return t(`subscriptionWeekly`);case`monthly`:return t(`subscriptionMonthly`);case`billing`:return t(`subscriptionBilling`)}}function on(e,t){switch(e){case`new-api`:return t(`relayKindNewApi`);case`sub2api`:return t(`relayKindSub2Api`);default:return t(`relayKindUnknown`)}}let sn={"new-api":A.siteKindSite,sub2api:A.siteKindDirect,unknown:A.siteKindUnknown},cn=3e4;function $(e=Date.now()){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function ln(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}let un=[`#3b82f6`,`#06b6d4`,`#8b5cf6`,`#f59e0b`,`#10b981`,`#ef4444`,`#ec4899`,`#6366f1`,`#f97316`,`#14b8a6`],dn={total:{calls:0,input:0,output:0,cacheHit:0,cacheMiss:0,cost:0,reasoning:0},byModel:{},byDay:{},byDayModels:{}};async function fn(){try{let e=await fetch(`/api/billing/usage-stats`);if(!e.ok)return null;let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n||!(`total`in n))return null;let r=n,i=e=>typeof e==`object`&&!!e;return{total:r.total??dn.total,byModel:r.byModel??{},byDay:r.byDay??{},...r.byDayModels===void 0?{}:{byDayModels:r.byDayModels},...i(r.byDayModelsSite)?{byDayModelsSite:r.byDayModelsSite}:{},...r.updatedAt===void 0?{}:{updatedAt:r.updatedAt},...typeof r.budget==`number`?{budget:r.budget}:{},...typeof r.lowBalanceThreshold==`number`?{lowBalanceThreshold:r.lowBalanceThreshold}:{},...Array.isArray(r.bySession)?{bySession:r.bySession}:{},...Array.isArray(r.byTurn)?{byTurn:r.byTurn}:{},...Array.isArray(r.byWorkspace)?{byWorkspace:r.byWorkspace}:{},...i(r.bySite)?{bySite:r.bySite}:{},...i(r.byTier)?{byTier:r.byTier}:{},...i(r.byTool)?{byTool:r.byTool}:{},...Array.isArray(r.unpricedModels)?{unpricedModels:r.unpricedModels}:{},...typeof r.staleLedgerSessions==`number`?{staleLedgerSessions:r.staleLedgerSessions}:{},...typeof r.searchCallEstimateCny==`number`?{searchCallEstimateCny:r.searchCallEstimateCny}:{},...r.byRole!==null&&typeof r.byRole==`object`?{byRole:r.byRole}:{},...r.perf!==null&&typeof r.perf==`object`&&r.perf.byModel!==null&&typeof r.perf.byModel==`object`&&r.perf.byHourModel!==null&&typeof r.perf.byHourModel==`object`?{perf:r.perf}:{},...typeof r.pluginVersion==`string`?{pluginVersion:r.pluginVersion}:{}}}catch{return null}}let pn=!1;async function mn(e=0){try{let t=await fetch(`/api/billing/pricing`);if(!t.ok){pn=!1;return}let n=await t.text(),r=JSON.parse(n);if(typeof r!=`object`||!r||!(`source`in r)){pn=!1;return}let i=r;if(i.source===`builtin`&&e<3){if(e===0){if(pn)return;pn=!0}setTimeout(()=>{mn(e+1)},2e3);return}pn=!1,ve(i)}catch{pn=!1}}async function hn(){try{let e=await fetch(`/api/billing/balance`);if(!e.ok)return{balances:[]};let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n)return{balances:[]};let r=n;return{balances:Array.isArray(r.balances)?r.balances:[],...r.reconcile===void 0?{}:{reconcile:r.reconcile}}}catch{return{balances:[]}}}async function gn(){let e=await fetch(`/api/billing/subscriptions`);if(!e.ok)throw Error(`subscriptions HTTP ${String(e.status)}`);let t=await e.text(),n=JSON.parse(t);if(typeof n==`object`&&n&&`quotas`in n)return n.quotas;throw Error(`subscriptions: invalid response`)}async function _n(){let e=await fetch(`/api/billing/relay-quotas`);if(!e.ok)throw Error(`relay-quotas HTTP ${String(e.status)}`);let t=await e.text(),n=JSON.parse(t);if(typeof n==`object`&&n&&`quotas`in n)return n.quotas;throw Error(`relay-quotas: invalid response`)}async function vn(){try{let e=await fetch(`/api/billing/usage-tool`);if(!e.ok)return;let t=JSON.parse(await e.text());return typeof t.enabled==`boolean`?t.enabled:void 0}catch{return}}async function yn(e){try{let t=await fetch(`/api/billing/usage-tool`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:e})});return t.ok?JSON.parse(await t.text()).ok===!0:!1}catch{return!1}}function bn(e){let{wide:t,t:n,onOpen:i,monthCost:o,todayCost:s,weekCost:l,days:u,vendorStatus:d,dash:f,floatPrefs:p,subscriptions:m,cardPrefs:h,monthTokens:g,todayTokens:_,weekTokens:v}=e,y=(0,r.useMemo)(()=>p.targets.map(e=>m.find(t=>t.provider===e)).filter(e=>e!==void 0),[p.targets,m]),[b,x]=(0,r.useState)(0),S=y.length===0?0:Math.min(b,y.length-1),C=y[S];(0,r.useEffect)(()=>{if(p.mode!==`subscription`||y.length<2)return;let e=setInterval(()=>x(e=>(e+1)%y.length),1500);return()=>clearInterval(e)},[p.mode,y.length]);let ee=(0,a.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,a.jsx)(`path`,{d:`M4 7h16v11H4z`}),(0,a.jsx)(`path`,{d:`M4 10h16`}),(0,a.jsx)(`path`,{d:`M8 14h3`})]});if(!t)return(0,a.jsx)(`button`,{type:`button`,className:A.railButton,"data-testid":`billing-rail-button`,onClick:i,title:`${n(`title`)} · ${U(o)}`,children:ee});let w=h.metric===`tokens`,T=u.map(e=>w?e.tokens:e.cost),te=Math.max(...T,0),E=T.map(e=>te>0?4+e/te*12:4);return(0,a.jsxs)(`span`,{className:A.triggerWrap,children:[(0,a.jsxs)(`button`,{type:`button`,className:A.trigger,"data-testid":`billing-trigger`,onClick:i,title:`${n(`title`)} · ${U(o)}`,children:[(0,a.jsx)(`span`,{className:A.triggerIcon,"data-testid":`billing-trigger-icon`,children:ee}),(0,a.jsxs)(`span`,{className:A.triggerMain,children:[(0,a.jsxs)(`span`,{className:A.triggerPrimary,children:[(0,a.jsx)(`span`,{className:A.triggerLabel,children:n(w?`triggerMonthTokens`:`triggerMonth`)}),w?(0,a.jsx)(`span`,{className:A.triggerMetric,"data-testid":`billing-trigger-month-tokens`,children:W(g)}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:A.triggerYen,"aria-hidden":`true`,children:U(o).charAt(0)}),(0,a.jsx)(`span`,{className:A.triggerMetric,children:U(o).slice(1)})]})]}),(0,a.jsx)(`span`,{className:A.triggerSub,"data-testid":`billing-trigger-today`,children:w?`${n(`triggerToday`)} ${W(_)} · ${n(`weekCost`)} ${W(v)}`:`${n(`triggerToday`)} ${U(s)} · ${n(`weekCost`)} ${U(l)}`})]}),(0,a.jsx)(`span`,{className:A.triggerSpark,"data-testid":`billing-trigger-spark`,"aria-hidden":`true`,children:E.map((e,t)=>(0,a.jsx)(`span`,{className:t===E.length-1?A.triggerSparkHot:A.triggerSparkBar,style:{height:`${e}px`}},u[t]?.date??String(t)))})]}),(0,a.jsx)(`span`,{className:c(A.triggerPop,p.mode===`subscription`&&A.triggerPopSubscription),"data-testid":`billing-trigger-pop`,"aria-hidden":`true`,children:p.mode===`subscription`?(0,a.jsx)(a.Fragment,{children:y.length===0?(0,a.jsx)(`span`,{className:A.triggerPopEmpty,children:n(`floatNoTargets`)}):(0,a.jsxs)(a.Fragment,{children:[C!==void 0&&(0,a.jsxs)(`div`,{className:A.floatSub,"data-testid":`billing-float-subscription`,children:[(0,a.jsxs)(`div`,{className:A.floatSubHead,children:[(0,a.jsx)(`span`,{className:A.floatSubName,children:C.displayName}),C.plan!==void 0&&(0,a.jsx)(`span`,{className:A.floatSubPlan,children:C.plan})]}),C.windows.map(e=>(()=>{let t=Math.min(100,Math.max(0,e.usedPercent)),r=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,a.jsxs)(`div`,{className:A.subscriptionWindow,children:[(0,a.jsx)(`span`,{className:A.subscriptionWindowLabel,children:an(e.kind,n)}),(0,a.jsx)(`span`,{className:A.subscriptionTrack,"aria-hidden":`true`,children:(0,a.jsx)(`span`,{className:c(A.subscriptionFill,t>=100&&A.subscriptionFillOver,t>=80&&t<100&&A.subscriptionFillWarn),style:{width:`${t}%`}})}),(0,a.jsxs)(`span`,{className:A.subscriptionMeta,children:[(0,a.jsx)(`span`,{className:c(A.subscriptionPct,r&&A.subscriptionExhausted),children:r?n(`subscriptionExhausted`):n(`subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,a.jsx)(`span`,{className:A.subscriptionReset,children:n(`subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${ln(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]}),y.length>1&&(0,a.jsx)(`span`,{className:A.triggerPopSwitcher,"data-testid":`billing-float-switcher`,children:(0,a.jsxs)(`span`,{className:A.triggerPopSwitchCount,children:[S+1,`/`,y.length]})})]})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:A.popHead,children:(0,a.jsx)(`span`,{className:A.popTitle,children:n(`popTitle`)})}),(0,a.jsxs)(`span`,{className:A.metricGrid,children:[(0,a.jsxs)(`span`,{className:A.metricCell,children:[(0,a.jsx)(`span`,{className:A.metricLabel,children:n(`monthCost`)}),(0,a.jsx)(`span`,{className:c(A.metricValue,A.metricValuePrimary),children:U(o)})]}),(0,a.jsxs)(`span`,{className:A.metricCell,children:[(0,a.jsx)(`span`,{className:A.metricLabel,children:n(`tokenTotal`)}),(0,a.jsx)(`span`,{className:A.metricValue,children:W(f.totalToken)})]}),(0,a.jsxs)(`span`,{className:A.metricCell,children:[(0,a.jsx)(`span`,{className:A.metricLabel,children:n(`input`)}),(0,a.jsx)(`span`,{className:A.metricValue,children:W(f.input)})]}),(0,a.jsxs)(`span`,{className:A.metricCell,children:[(0,a.jsx)(`span`,{className:A.metricLabel,children:n(`output`)}),(0,a.jsx)(`span`,{className:A.metricValue,children:W(f.output)})]}),(0,a.jsxs)(`span`,{className:A.metricCell,children:[(0,a.jsx)(`span`,{className:A.metricLabel,children:n(`cacheHit`)}),(0,a.jsx)(`span`,{className:c(A.metricValue,A.metricValueSuccess),children:W(f.cacheRead)})]}),(0,a.jsxs)(`span`,{className:A.metricCell,children:[(0,a.jsx)(`span`,{className:A.metricLabel,children:n(`calls`)}),(0,a.jsx)(`span`,{className:A.metricValue,children:f.calls.toLocaleString()})]})]}),(0,a.jsxs)(`span`,{className:A.popModel,children:[(0,a.jsx)(`span`,{className:A.popModelLabel,children:n(`popTodayModel`)}),d.direct!==void 0||d.sub!==void 0?(0,a.jsxs)(a.Fragment,{children:[d.direct!==void 0&&(0,a.jsxs)(`span`,{className:A.popModelRow,children:[(0,a.jsx)(`span`,{className:c(A.popDot,A.popDotDirect),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:A.popTagPrimary,children:n(`popDirectLead`)}),(0,a.jsx)(`span`,{className:A.popModelName,children:d.direct.name}),(0,a.jsx)(`span`,{className:c(A.popModelStatus,d.direct.low&&A.popModelStatusLow),children:d.direct.text})]}),d.sub!==void 0&&(0,a.jsxs)(`span`,{className:A.popModelRow,children:[(0,a.jsx)(`span`,{className:c(A.popDot,A.popDotSub),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:A.popTagSub,children:n(`popSubLead`)}),(0,a.jsx)(`span`,{className:A.popModelName,children:d.sub.name}),(0,a.jsx)(`span`,{className:c(A.popModelStatus,d.sub.low&&A.popModelStatusLow),children:d.sub.text})]})]}):(0,a.jsxs)(`span`,{className:A.popModelRow,children:[(0,a.jsx)(`span`,{className:c(A.popDot,A.popDotNeutral),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:A.popModelStatus,children:n(`popNoConsumption`)})]})]})]})})]})}function xn({balance:e,days:t,dailyBurn:n,money:r,t:i,onClose:o}){let s=t=>t===void 0?void 0:e.currency===`USD`?`$${t.toFixed(2)}`:r(t),c=s(e.totalBalance),l=s(e.grantedBalance),u=s(e.toppedUpBalance);return(0,a.jsxs)(`span`,{className:A.balanceDetailPop,"data-testid":`billing-balance-detail-pop`,children:[(0,a.jsxs)(`span`,{className:A.balanceDetailHead,children:[(0,a.jsx)(`span`,{className:A.balanceDetailTitle,children:e.displayName}),(0,a.jsx)(`button`,{type:`button`,className:A.balanceDetailClose,"aria-label":i(`close`),onClick:o,children:`×`})]}),(0,a.jsxs)(`span`,{className:A.balanceDetailGrid,children:[c!==void 0&&(0,a.jsx)(Sn,{label:i(`balance`),value:c}),l!==void 0&&(0,a.jsx)(Sn,{label:i(`balanceGranted`),value:l}),u!==void 0&&(0,a.jsx)(Sn,{label:i(`balanceTopped`),value:u}),(0,a.jsx)(Sn,{label:i(`balanceDaily`),value:r(n)}),(0,a.jsx)(Sn,{label:i(`balanceDaysLong`),value:`${t} ${i(`balanceDaysUnit`)}`})]})]})}function Sn({label:e,value:t}){return(0,a.jsxs)(`span`,{className:A.balanceDetailRow,children:[(0,a.jsx)(`span`,{className:A.balanceDetailLabel,children:e}),(0,a.jsx)(`span`,{className:A.balanceDetailValue,children:t})]})}function Cn({userPrices:e,onUserPrices:t,t:n}){let[i,o]=(0,r.useState)(()=>[...e]),[s,l]=(0,r.useState)(new Set),u=e=>l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),d=()=>{o(e=>e.filter((e,t)=>!s.has(t))),l(new Set)},f=(e,t)=>o(n=>n.map((n,r)=>r===e?{...n,...t}:n)),p=()=>o(e=>[...e,{key:``,input:0,cacheHit:0,output:0}]),m=e=>{let t=i[e]?.offPeak;return{input:t===void 0?``:String(t.input),cacheHit:t===void 0?``:String(t.cacheHit),output:t===void 0?``:String(t.output)}},h=(e,t,n)=>o(r=>r.map((r,i)=>{if(i!==e)return r;let a={...m(e),[t]:n},o=[a.input,a.cacheHit,a.output].some(e=>e.trim()!==``),s=[a.input,a.cacheHit,a.output].map(e=>Number(e)),c=o&&s.every(e=>Number.isFinite(e)&&e>=0)&&s.some(e=>e>0),{offPeak:l,...u}=r;return c?{...u,offPeak:{input:s[0]??0,cacheHit:s[1]??0,output:s[2]??0}}:u})),g=()=>t(i.filter(e=>e.key.trim()!==``).map(e=>({...e,key:e.key.trim(),...e.origin===void 0||e.origin.trim()===``?{}:{origin:ue(e.origin.trim())}}))),_=Fe().map(e=>e.key),v=(e,t)=>o(n=>n.map((n,r)=>{if(r!==e)return n;let{currency:i,...a}=n;return t===`USD`?{...a,currency:`USD`}:a})),y=e=>Number.isFinite(e)&&e!==0?String(e):``,b=(e,t,n)=>{let r=Number(n);f(e,{[t]:Number.isFinite(r)&&r>=0?r:0})};return(0,a.jsxs)(`section`,{className:A.setCard,"data-testid":`billing-user-prices`,children:[(0,a.jsx)(`div`,{className:A.setCardHead,children:(0,a.jsxs)(`div`,{className:A.setCardMeta,children:[(0,a.jsx)(`h3`,{className:A.setCardTitle,children:n(`userPrices`)}),(0,a.jsx)(`p`,{className:A.setCardDesc,children:n(`userPricesHint`)})]})}),(0,a.jsxs)(`div`,{className:A.ctlCol,children:[(0,a.jsx)(`datalist`,{id:`billing-price-model-keys`,children:_.map(e=>(0,a.jsx)(`option`,{value:e},e))}),i.map((e,t)=>(0,a.jsxs)(`div`,{className:A.userPriceRow,"data-testid":`billing-user-price-row`,children:[(0,a.jsx)(`input`,{type:`checkbox`,className:A.userPriceCheck,"data-testid":`billing-user-price-select`,checked:s.has(t),"aria-label":n(`userPriceSelect`),onChange:()=>u(t)}),(0,a.jsxs)(`div`,{className:A.userPriceBody,children:[(0,a.jsxs)(`div`,{className:A.userPriceLineMeta,children:[(0,a.jsxs)(`div`,{className:A.userPriceField,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:n(`userPriceModel`)}),(0,a.jsx)(`input`,{className:A.userPriceInput,"data-testid":`billing-user-price-model`,type:`text`,list:`billing-price-model-keys`,value:e.key,placeholder:`flash`,"aria-label":n(`userPriceModel`),onChange:e=>f(t,{key:e.target.value})})]}),(0,a.jsxs)(`div`,{className:A.userPriceField,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:n(`userPriceSource`)}),(0,a.jsx)(`input`,{className:A.userPriceInput,"data-testid":`billing-user-price-origin`,type:`text`,value:e.origin??``,placeholder:n(`userPriceSourceHint`),"aria-label":n(`userPriceSource`),onChange:e=>f(t,{origin:e.target.value.trim()})})]}),(0,a.jsxs)(`div`,{className:A.userPriceField,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:n(`userPriceCurrency`)}),(0,a.jsxs)(`div`,{className:A.ctlGroup,children:[(0,a.jsx)(`button`,{type:`button`,className:c(A.floatModeBtn,e.currency!==`USD`&&A.floatModeBtnOn),onClick:()=>v(t,`CNY`),children:`CNY`}),(0,a.jsx)(`button`,{type:`button`,className:c(A.floatModeBtn,e.currency===`USD`&&A.floatModeBtnOn),onClick:()=>v(t,`USD`),children:`USD`})]})]})]}),(0,a.jsxs)(`div`,{className:A.userPricePriceLine,"data-testid":`billing-user-price-normal`,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:n(`userPriceNormal`)}),[`input`,`cacheHit`,`output`].map(r=>(0,a.jsx)(`input`,{className:A.userPriceInputNum,type:`number`,min:0,step:.01,placeholder:n(r===`input`?`tokenMiss`:r===`cacheHit`?`tokenHit`:`tokenOutput`),"aria-label":`${n(`userPriceNormal`)} ${n(r===`input`?`tokenMiss`:r===`cacheHit`?`tokenHit`:`tokenOutput`)}`,value:y(e[r]),onChange:e=>b(t,r,e.target.value)},r))]}),(()=>{let e=m(t);return(0,a.jsxs)(`div`,{className:A.userPricePriceLine,"data-testid":`billing-user-price-offpeak`,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:n(`userPriceOffPeak`)}),[`input`,`cacheHit`,`output`].map(r=>(0,a.jsx)(`input`,{className:A.userPriceInputNum,type:`number`,min:0,step:.01,placeholder:n(r===`input`?`tokenMiss`:r===`cacheHit`?`tokenHit`:`tokenOutput`),"aria-label":`${n(`userPriceOffPeak`)} ${n(r===`input`?`tokenMiss`:r===`cacheHit`?`tokenHit`:`tokenOutput`)}`,value:e[r],onChange:e=>h(t,r,e.target.value)},r))]})})()]})]},t)),(0,a.jsxs)(`div`,{className:A.ctlRow,children:[(0,a.jsx)(`button`,{type:`button`,className:A.exportButton,"data-testid":`billing-user-price-add`,onClick:p,children:n(`userPriceAdd`)}),(0,a.jsxs)(`button`,{type:`button`,className:A.exportButton,"data-testid":`billing-user-price-remove-selected`,disabled:s.size===0,onClick:d,children:[n(`userPriceRemoveSelected`),s.size>0?` (${s.size})`:``]}),(0,a.jsx)(`button`,{type:`button`,className:A.exportButton,"data-testid":`billing-user-price-save`,onClick:g,children:n(`userPriceSave`)})]})]})]})}function wn({stats:e,t,onClose:n,userPrices:o,onUserPrices:s,health:l,balances:u,reconcile:d,quotas:f,relayQuotas:p,currency:m,onCurrency:h,turns:g,renderSlot:_,budgetEnabled:v,budgetAmount:y,onToggleBudget:b,onBudgetAmount:x,peakConfig:S,onPeakConfig:C,onPreviewPeak:ee,floatPrefs:w,onFloatPrefs:T,cardPrefs:te,onCardPrefs:E,sitePrefs:D,onSitePrefs:ne,liveCostPrefs:O,onLiveCostPrefs:k,quotasStale:re}){let[ie,ae]=(0,r.useState)(`cost`),{total:j,byModel:se,byDay:M}=e,[N,ce]=(0,r.useState)(`overview`),[le,P]=(0,r.useState)(7),[ue,de]=(0,r.useState)(()=>{try{return window.localStorage.getItem(`dsh-billing:reconcile-dismissed`)??``}catch{return``}}),fe=()=>{let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`},pe=(0,r.useCallback)(()=>{let e=fe();de(e);try{window.localStorage.setItem(`dsh-billing:reconcile-dismissed`,e)}catch{}},[]),[me,he]=(0,r.useState)(`month`),ge=(0,r.useMemo)(()=>f.filter(e=>e.status===`ok`&&e.windows.length>0).map(e=>({id:e.provider,label:e.displayName})),[f]),[_e,ve]=(0,r.useState)(),[ye,be]=(0,r.useState)(),[F,Se]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=!0;return vn().then(t=>{e&&t!==void 0&&Se(t)}),()=>{e=!1}},[]);let Ce=(0,r.useCallback)(()=>{let e=!F;Se(e),yn(e).then(t=>{t||Se(!e)})},[F]),I=xe(),L=e=>U(m===`usd`?Re(e):e,m),we=m===`usd`?`en`:`zh`,Te=e=>jt(e,we),R=(e,n)=>e===0?t(`free`):ze(Be(e,n,m,I.rate),m===`usd`?`USD`:`CNY`),z=(0,r.useMemo)(()=>_t([...g].reverse()),[g]),B={peak:e.byTier?.peak.cost??0,offPeak:e.byTier?.offPeak.cost??0},Ee=B.peak/2,De=(0,r.useMemo)(()=>{let n=e.byRole;if(n===void 0)return[];let r=n.user+n.assistant+n.tool;return r<=0?[]:[{label:t(`roleUser`),value:n.user,seg:A.shareSegUser},{label:t(`roleAssistant`),value:n.assistant,seg:A.shareSegAssistant},{label:t(`roleTool`),value:n.tool,seg:A.shareSegTool}].map(e=>({...e,pct:e.value/r*100}))},[e.byRole,t]),V=Xt(M,$()),Oe=e=>u.find(t=>Q(t.provider)===Q(e)),ke=e=>e.balance?.error===`unconfigured`&&e.models.length>0&&e.models.every(e=>e.plan),Ae=e=>{if(e===void 0)return(0,a.jsx)(`span`,{className:A.na,children:`—`});if(e.error===`unconfigured`)return t(`balanceUnconfigured`);if(e.error===`unauthorized`)return t(`balanceUnauthorized`);if(e.error===`unreachable`)return t(`balanceUnreachable`);if(e.totalBalance===void 0)return(0,a.jsx)(`span`,{className:A.na,children:`—`});let n=e.currency===`USD`?`$${e.totalBalance.toFixed(2)}`:L(e.totalBalance),r=e.currency===`USD`?e.totalBalance*I.rate:e.totalBalance,i=V>0?Math.floor(r/V):void 0;return(0,a.jsxs)(`span`,{className:A.balanceCell,children:[(0,a.jsx)(`span`,{children:n}),i!==void 0&&i>=0&&(0,a.jsx)(`button`,{type:`button`,className:c(A.balanceDaysBadge,i<=3&&A.balanceDaysBadgeLow),"data-testid":`billing-balance-days-badge`,title:t(`balanceDays`).replace(`{days}`,String(i)),"aria-label":`${e.displayName} ${t(`balanceDays`).replace(`{days}`,String(i))}`,onClick:()=>{ve(_e===e.provider?void 0:e.provider)},children:`?`}),_e===e.provider&&(0,a.jsx)(xn,{balance:e,days:i??0,dailyBurn:V,money:L,t,onClose:()=>{ve(void 0)}})]})},Me=j.cacheHit+j.cacheMiss>0?j.cacheHit/(j.cacheHit+j.cacheMiss)*100:0,Pe=Object.keys(M).sort(),H=$(),G=M[H]?.cost??0,He=H.slice(0,7),Ue=H.slice(0,4),K=Pe.reduce((e,t)=>e+(t.startsWith(He)?M[t]?.cost??0:0),0),q=Pe.reduce((e,t)=>e+(t.startsWith(Ue)?M[t]?.cost??0:0),0),J=(0,r.useMemo)(()=>Zt(M,He,H)+f.reduce((e,t)=>e+(t.planType===`code`?t.subscriptionAmount??0:0),0),[M,He,H,f]),Ge=(0,r.useMemo)(()=>{let e=v&&y>0?K/y*100:NaN;return{pct:Number.isFinite(e)?Math.max(0,Math.min(100,e)):q>0?Math.max(0,Math.min(100,K/q*100)):0,over:Number.isFinite(e)&&e>=100,label:t(Number.isFinite(e)?`budget`:`monthCost`)}},[v,y,K,q,t]),Ke=v&&y>0?K/y*100:0,qe=(0,r.useMemo)(()=>{let e=[];for(let t=le-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t),e.push($(n.getTime()))}return e},[le]),Ye=qe.at(-1)??H,Xe=(0,r.useMemo)(()=>Object.entries(M).map(([e,t])=>({date:e,value:t.cost})),[M]),Qe=$t(M),$e=en(M),Y=(0,r.useMemo)(()=>qe.map(t=>{let n={},r=e.byDayModels?.[t];if(r!==void 0)for(let[e,t]of Object.entries(r))t.cost>0&&(n[e]=t.cost);let i=M[t];return{date:t,cost:i?.cost??0,calls:i?.calls??0,byModel:n,tokens:i===void 0?0:i.input+i.output+i.cacheHit+i.cacheMiss}}),[qe,M,e.byDayModels]),X=(0,r.useMemo)(()=>Object.entries(se).filter(([,e])=>e.calls>0).map(([e,t])=>{let n=je(e),r=n.key===`other`,i=r?qt(e):void 0,a={input:t.input,cacheHit:t.cacheHit,cacheMiss:t.cacheMiss,output:t.output};return{key:e,name:r?e:n.name,provider:i??n.provider,calls:t.calls,input:t.input,output:t.output,cacheHitRate:t.cacheHit+t.cacheMiss>0?t.cacheHit/(t.cacheHit+t.cacheMiss)*100:0,estimated:Le(n,a),plan:t.plan===!0,...t.cost>0?{actual:t.cost}:{},uncatalogued:r,estimatedPricing:n.estimated===!0,officialCalls:t.officialCalls??0,officialCost:t.officialCost??0}}).sort((e,t)=>(t.actual??t.estimated)-(e.actual??e.estimated)).map((e,t)=>({...e,color:un[t%un.length]??`#8b95a3`})),[se]),Z=(0,r.useMemo)(()=>{let e=0,t=0,n=0;for(let r of X){let i=r.officialCost;i>0&&(e+=i),t+=r.officialCalls,n+=Math.max(0,r.calls-r.officialCalls)}let r=Math.max(0,X.reduce((e,t)=>e+(t.actual??0),0)-e);if(!(e<=0&&r<=0&&t<=0&&n<=0))return{officialCost:e,officialCalls:t,thirdCost:r,thirdCalls:n}},[X]),et=(0,r.useMemo)(()=>D.hideUnidentified?p.filter(e=>e.kind!==`unknown`):p,[p,D.hideUnidentified]),tt=(0,r.useMemo)(()=>{let e=new Map;for(let t of f){if(t.status===`not-configured`)continue;let n=Yt(t.provider),r=e.get(n);r===void 0?e.set(n,[t]):r.push(t)}let t=new Map,n=new Map;for(let t of e.keys())n.set(Q(t),t);for(let e of X){let r=e.provider;if(e.plan===!0){let t=qt(e.key);t!==void 0&&(r=t)}let i=n.get(Q(r))??r,a=t.get(i);a===void 0?t.set(i,[e]):a.push(e)}let r=[...new Set([...t.keys(),...e.keys()])].map(n=>({name:n,models:t.get(n)??[],subscriptions:e.get(n)??[],balance:Oe(n),dot:nn(l,n)})),i=new Set(r.map(e=>Q(e.name)));for(let e of u)i.has(Q(e.provider))||(e.error===void 0||e.provider.startsWith(`custom:`))&&r.push({name:e.displayName,models:[],subscriptions:[],balance:e,dot:nn(l,e.displayName)});return r.sort((e,t)=>{let n=e=>e.models.reduce((e,t)=>e+(t.actual??t.estimated),0),r=n(t)-n(e);return r===0?e.models.length===0&&t.models.length===0?0:t.models.length===0?-1:e.models.length===0?1:e.name.localeCompare(t.name,`zh`):r})},[X,f,u,l]),rt=X.reduce((e,t)=>e+t.estimated,0),it=j.cost>0?j.cost:rt,at=j.calls>0?it/j.calls:0,ot=(0,r.useMemo)(()=>X.map(e=>({key:e.key,name:e.name,color:e.color})),[X]),ct=Y.length>=2?Y.at(-2)?.cost??0:0,lt=ct>0?(G-ct)/ct*100:0;return(0,a.jsx)(i.Modal,{open:!0,onClose:n,title:t(`title`),headless:!0,className:c(A.dashboardModal,`dsh-billing-modal`),children:(0,a.jsxs)(`div`,{className:A.dashboard,"data-testid":`billing-dashboard`,children:[(0,a.jsxs)(`div`,{className:A.dashboardHead,"data-testid":`billing-dashboard-head`,children:[(0,a.jsxs)(`div`,{children:[_(`billing.dashboard.decor`,{position:`head`}),(0,a.jsxs)(`div`,{className:A.headTitleRow,children:[(0,a.jsx)(`h2`,{className:A.dashboardTitle,children:t(`title`)}),_(`billing.dashboard.decor`,{position:`headTitle`})]}),(0,a.jsxs)(`p`,{className:A.dashboardSubtitle,children:[t(`lastUpdated`),` `,Ye,e.timezone===void 0?null:` · ${e.timezone.name} (${e.timezone.offset})`]})]}),(0,a.jsxs)(`div`,{className:A.dashboardRight,children:[(0,a.jsx)(`span`,{className:A.currencyToggle,role:`group`,"aria-label":t(`currency`),children:[`cny`,`usd`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(A.currencyButton,m===e&&A.currencyButtonActive),"aria-pressed":m===e,"data-testid":`billing-currency-${e}`,title:t(e===`cny`?`currencyCny`:`currencyUsd`),onClick:()=>{h(e)},children:e===`cny`?`¥ CNY`:`$ USD`},e))}),l.checked&&(0,a.jsxs)(`span`,{className:c(A.healthBadge,l.available?A.healthBadgeOk:A.healthBadgeBad),children:[(0,a.jsx)(`span`,{className:c(A.healthDot,l.available?A.healthOk:A.healthBad),"aria-hidden":`true`}),l.available?`${l.models} 模型可用${l.failures>0?` · ${l.failures} 厂商失效`:``}`:`${l.failures} 厂商不可用`]}),(0,a.jsx)(`button`,{type:`button`,className:A.closeButton,"aria-label":t(`close`),"data-testid":`billing-close`,onClick:n,children:(0,a.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,a.jsx)(`path`,{d:`M18 6 6 18`}),(0,a.jsx)(`path`,{d:`m6 6 12 12`})]})})]})]}),(0,a.jsx)(`nav`,{className:A.tabNav,"data-testid":`billing-tab-nav`,role:`tablist`,"aria-label":t(`title`),children:Bt.map(e=>(0,a.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":N===e.id,className:c(A.tabButton,N===e.id&&A.tabButtonActive),"data-testid":`billing-tab-${e.id}`,onClick:()=>{ce(e.id)},children:t(e.labelKey)},e.id))}),(0,a.jsxs)(`div`,{className:A.dashboardBody,children:[N===`overview`&&(0,a.jsxs)(`div`,{className:A.tabPanel,"data-testid":`billing-tab-panel-overview`,children:[d?.kind===`drift`&&d.spent!==void 0&&ue!==fe()&&(0,a.jsxs)(`div`,{className:A.reconcileNotice,"data-testid":`billing-reconcile-notice`,role:`note`,children:[(0,a.jsx)(`span`,{className:A.reconcileIcon,"aria-hidden":`true`,children:(0,a.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,a.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,a.jsx)(`line`,{x1:`12`,y1:`10`,x2:`12`,y2:`16`}),(0,a.jsx)(`line`,{x1:`12`,y1:`7.5`,x2:`12.01`,y2:`7.5`})]})}),(0,a.jsx)(`span`,{className:A.reconcileText,children:t(`reconcileDrift`).replace(`{provider}`,d.provider??``).replace(`{spent}`,L(d.spent)).replace(`{today}`,L(d.todayOfficialCost??0))}),(0,a.jsx)(`button`,{type:`button`,className:A.reconcileDismiss,"data-testid":`billing-reconcile-dismiss`,onClick:pe,children:t(`reconcileDismiss`)})]}),(0,a.jsxs)(`section`,{className:A.hero,"data-testid":`billing-hero`,children:[_(`billing.dashboard.decor`,{position:`hero`}),(0,a.jsxs)(`div`,{className:A.heroTop,children:[(0,a.jsxs)(`div`,{className:A.heroMain,children:[(0,a.jsx)(`span`,{className:A.heroLabel,children:t(`monthCost`)}),(0,a.jsxs)(`div`,{className:A.heroReadout,children:[(0,a.jsx)(`span`,{className:A.heroCurrency,"aria-hidden":`true`,children:m===`usd`?`$`:`¥`}),(0,a.jsx)(`span`,{className:A.heroValue,children:L(K).slice(1)})]}),(0,a.jsxs)(`span`,{className:A.heroMeta,children:[j.calls.toLocaleString(),` `,t(`calls`)]})]}),(0,a.jsxs)(`div`,{className:A.heroGauge,"data-testid":`billing-hero-gauge`,children:[(0,a.jsxs)(`svg`,{className:A.heroGaugeSvg,viewBox:`0 0 120 120`,"aria-hidden":`true`,children:[(0,a.jsx)(`circle`,{className:A.heroGaugeTrack,cx:`60`,cy:`60`,r:`52`}),(0,a.jsx)(`circle`,{className:c(A.heroGaugeArc,Ge.over&&A.heroGaugeArcOver),cx:`60`,cy:`60`,r:`52`,style:{strokeDasharray:`${Ge.pct/100*326.7} 326.7`}})]}),(0,a.jsxs)(`span`,{className:A.heroGaugeCenter,children:[(0,a.jsxs)(`span`,{className:c(A.heroGaugePct,Ge.over&&A.heroGaugePctOver),children:[Ge.pct.toFixed(0),`%`]}),(0,a.jsx)(`span`,{className:A.heroGaugeLabel,children:Ge.label})]})]})]}),v&&y>0&&(0,a.jsxs)(`div`,{className:A.heroBudget,"data-testid":`billing-hero-budget`,children:[(0,a.jsx)(`span`,{className:A.heroBudgetLabel,children:t(`budget`)}),(0,a.jsx)(`div`,{className:A.heroBudgetTrack,role:`progressbar`,"aria-valuenow":Math.min(Ke,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`budget`),children:(0,a.jsx)(`div`,{className:c(A.heroBudgetFill,Ke>=100&&A.heroBudgetFillOver),style:{width:`${Math.min(Ke,100)}%`}})}),(0,a.jsxs)(`span`,{className:A.heroBudgetValue,children:[L(K),` / `,L(y),` · `,Ke.toFixed(1),`%`]})]}),(0,a.jsxs)(`div`,{className:A.heroSide,children:[(0,a.jsxs)(`div`,{className:A.heroSideItem,children:[(0,a.jsx)(`span`,{className:A.heroSideLabel,children:t(`yearCost`)}),(0,a.jsx)(`span`,{className:A.heroSideValue,children:L(q)})]}),(0,a.jsxs)(`div`,{className:A.heroSideItem,children:[(0,a.jsx)(`span`,{className:A.heroSideLabel,children:t(`todayCost`)}),(0,a.jsxs)(`span`,{className:A.heroSideValue,children:[L(G),(0,a.jsxs)(`span`,{className:c(A.delta,lt>=0?A.deltaUp:A.deltaDown),children:[lt>=0?`▲`:`▼`,` `,Math.abs(lt).toFixed(1),`%`]})]})]}),J>0&&(0,a.jsxs)(`div`,{className:A.heroSideItem,children:[(0,a.jsx)(`span`,{className:A.heroSideLabel,children:t(`monthProjected`)}),(0,a.jsx)(`span`,{className:A.heroSideValue,children:L(J)})]}),J<=0&&(0,a.jsx)(`span`,{className:A.heroSideSpacer,"aria-hidden":`true`})]})]}),(e.unpricedModels?.length??0)>0&&(0,a.jsx)(`div`,{className:A.unpricedHint,"data-testid":`billing-unpriced-hint`,children:t(`unpricedHint`).replace(`{count}`,String(e.unpricedModels?.length??0))}),(e.total.searchCalls??0)>0&&(0,a.jsx)(`div`,{className:A.unpricedHint,"data-testid":`billing-search-estimate-hint`,children:t(`searchEstimateHint`).replace(`{count}`,String(e.total.searchCalls??0)).replace(`{each}`,L(e.searchCallEstimateCny??0))}),(0,a.jsxs)(`section`,{className:A.kpiGrid,"data-testid":`billing-kpi-grid`,children:[(0,a.jsxs)(`div`,{className:A.kpiTile,"data-testid":`billing-kpi-tile`,children:[(0,a.jsx)(`span`,{className:A.kpiLabel,children:t(`cacheHitRate`)}),(0,a.jsx)(`span`,{className:c(A.kpiValue,A.kpiGreen),children:Ve(Me)}),(0,a.jsxs)(`span`,{className:A.kpiDetail,children:[W(j.cacheHit),` / `,W(j.cacheHit+j.cacheMiss)]})]}),(0,a.jsxs)(`div`,{className:A.kpiTile,children:[(0,a.jsx)(`span`,{className:A.kpiLabel,children:t(`tokens`)}),(0,a.jsx)(`span`,{className:A.kpiValue,children:W(j.input+j.output)}),(0,a.jsxs)(`span`,{className:A.kpiDetail,children:[t(`inputTokens`),` `,W(j.input),` · `,t(`outputTokens`),` `,W(j.output)]})]}),(0,a.jsxs)(`div`,{className:A.kpiTile,children:[(0,a.jsx)(`span`,{className:A.kpiLabel,children:t(`avgCost`)}),(0,a.jsx)(`span`,{className:A.kpiValue,children:L(at)}),(0,a.jsxs)(`span`,{className:A.kpiDetail,children:[t(`calls`),` `,j.calls.toLocaleString()]})]}),(0,a.jsxs)(`div`,{className:A.kpiTile,children:[(0,a.jsx)(`span`,{className:A.kpiLabel,children:t(`calls`)}),(0,a.jsx)(`span`,{className:A.kpiValue,children:j.calls.toLocaleString()}),(0,a.jsxs)(`span`,{className:A.kpiDetail,children:[X.length,` `,t(`models`)]})]})]}),(0,a.jsxs)(`section`,{className:A.panel,"data-testid":`billing-panel-heatmap`,children:[(0,a.jsxs)(`div`,{className:A.panelHead,children:[(0,a.jsx)(`h3`,{className:A.panelTitle,children:t(`heatmap`)}),(0,a.jsx)(`div`,{className:A.heatmapRangeSwitch,"data-testid":`billing-heatmap-range`,role:`group`,"aria-label":t(`heatmap`),children:[`month`,`year`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(A.heatmapRangeButton,me===e&&A.heatmapRangeButtonActive),"data-testid":`billing-heatmap-range-${e}`,"aria-pressed":me===e,onClick:()=>{he(e)},children:t(e===`month`?`heatmapMonth`:`heatmapYear`)},e))}),(0,a.jsxs)(`span`,{className:A.panelHint,"data-testid":`billing-heatmap-summary`,children:[t(`activeDays`),` `,Qe,` · `,t(`streakDays`),` `,$e]})]}),(0,a.jsx)(pt,{days:Xe,currency:m,t,range:me})]})]}),N===`settings`&&(0,a.jsxs)(`div`,{className:A.tabPanel,"data-testid":`billing-tab-panel-settings`,children:[(0,a.jsxs)(`section`,{className:A.setCard,"data-testid":`billing-budget`,children:[(0,a.jsxs)(`div`,{className:A.setCardHead,children:[(0,a.jsxs)(`div`,{className:A.setCardMeta,children:[(0,a.jsx)(`h3`,{className:A.setCardTitle,children:t(`budget`)}),(0,a.jsx)(`p`,{className:A.setCardDesc,children:t(`budgetHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":v,"aria-label":t(`budget`),"data-testid":`billing-budget-toggle`,className:c(A.switch,v&&A.switchOn),onClick:b,children:(0,a.jsx)(`span`,{className:A.switchKnob})})]}),v&&(0,a.jsxs)(`div`,{className:A.ctlCol,children:[(0,a.jsxs)(`div`,{className:A.ctlRow,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:t(`budgetAmount`)}),(0,a.jsxs)(`span`,{className:A.inp,"data-testid":`billing-budget-input-wrap`,children:[(0,a.jsx)(`span`,{className:A.affix,"aria-hidden":`true`,children:`¥`}),(0,a.jsx)(`input`,{className:A.budgetInput,"data-testid":`billing-budget-input`,type:`number`,min:0,step:1,value:y===0?``:y,placeholder:e.budget===void 0?`0`:String(e.budget),"aria-label":`${t(`budget`)}(${m===`usd`?`USD`:`CNY`})`,title:`${t(`budget`)}(${m===`usd`?`USD`:`CNY`})`,onChange:e=>{x(e.target.valueAsNumber)}})]})]}),y>0&&(()=>{let e=K/y*100;return(0,a.jsx)(`div`,{className:A.ctlRowStretch,children:(0,a.jsx)(`div`,{className:A.prog,role:`progressbar`,"aria-valuenow":Math.min(e,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`budget`),"data-testid":`billing-budget-track`,children:(0,a.jsx)(`div`,{className:c(A.progFill,e>=100&&A.budgetFillOver,e>=80&&e<100&&A.budgetFillWarn),style:{width:`${Math.min(e,100)}%`}})})})})(),y>0&&(0,a.jsx)(`p`,{className:A.setCardDesc,"data-testid":`billing-budget-value`,children:t(`budgetSummary`).replace(`{used}`,L(K)).replace(`{total}`,L(y))})]})]}),(0,a.jsxs)(`section`,{className:A.setCard,"data-testid":`billing-peak-alert-settings`,children:[(0,a.jsxs)(`div`,{className:A.setCardHead,children:[(0,a.jsxs)(`div`,{className:A.setCardMeta,children:[(0,a.jsx)(`h3`,{className:A.setCardTitle,children:t(`peakAlert`)}),(0,a.jsx)(`p`,{className:A.setCardDesc,children:t(`peakAlertHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":S.enabled,"aria-label":t(`peakAlert`),"data-testid":`billing-peak-alert-toggle`,className:c(A.switch,S.enabled&&A.switchOn),onClick:()=>{C({...S,enabled:!S.enabled})},children:(0,a.jsx)(`span`,{className:A.switchKnob})})]}),S.enabled&&(0,a.jsxs)(`div`,{className:A.ctlCol,children:[(0,a.jsxs)(`label`,{className:A.ctlRow,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:t(`peakAlertLeadMin`)}),(0,a.jsx)(`span`,{className:A.inp,children:(0,a.jsx)(`input`,{type:`number`,min:1,max:30,step:1,value:S.leadMin,className:A.budgetInput,"aria-label":t(`peakAlertLeadMin`),onChange:e=>{let t=Number(e.target.valueAsNumber);C({...S,leadMin:Number.isFinite(t)?Math.min(30,Math.max(1,Math.round(t))):S.leadMin})}})})]}),(0,a.jsxs)(`div`,{className:A.ctlRow,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:t(`peakAlertPos`)}),(0,a.jsx)(`div`,{className:A.ctlGroup,role:`radiogroup`,"aria-label":t(`peakAlertPos`),children:[`bottom-right`,`center`].map(e=>(0,a.jsxs)(`label`,{className:A.rdo,children:[(0,a.jsx)(`input`,{type:`radio`,name:`peak-pos`,checked:S.position===e,onChange:()=>C({...S,position:e})}),(0,a.jsx)(`span`,{className:A.rdoDot,"aria-hidden":`true`}),t(e===`bottom-right`?`peakAlertPosCorner`:`peakAlertPosCenter`)]},e))})]}),(0,a.jsxs)(`div`,{className:A.ctlRow,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:t(`peakAlertMode`)}),(0,a.jsx)(`div`,{className:A.ctlGroup,role:`radiogroup`,"aria-label":t(`peakAlertMode`),children:[`both`,`peak`,`offPeak`].map(e=>(0,a.jsxs)(`label`,{className:A.rdo,children:[(0,a.jsx)(`input`,{type:`radio`,name:`peak-mode`,checked:S.mode===e,onChange:()=>C({...S,mode:e})}),(0,a.jsx)(`span`,{className:A.rdoDot,"aria-hidden":`true`}),t(e===`both`?`peakAlertModeBoth`:e===`peak`?`peakAlertModePeak`:`peakAlertModeOff`)]},e))})]}),(0,a.jsxs)(`label`,{className:A.ctlRow,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:t(`peakAlertWebNotify`)}),(0,a.jsx)(`input`,{type:`checkbox`,checked:S.webNotify,"aria-label":t(`peakAlertWebNotify`),onChange:e=>{C({...S,webNotify:e.target.checked})}})]}),(0,a.jsx)(`div`,{className:A.ctlRow,children:(0,a.jsx)(`button`,{type:`button`,className:A.btn,onClick:ee,children:t(`peakAlertPreview`)})})]})]}),(0,a.jsx)(`section`,{className:A.setCard,"data-testid":`billing-toggle-setting`,children:(0,a.jsxs)(`div`,{className:A.setGrid3,children:[(0,a.jsx)(`div`,{className:A.setCell,"data-testid":`billing-usage-stats-tool-setting`,children:(0,a.jsxs)(`div`,{className:A.setCardHead,children:[(0,a.jsxs)(`div`,{className:A.setCardMeta,children:[(0,a.jsx)(`h3`,{className:A.setCardTitle,children:t(`usageStatsTool`)}),(0,a.jsx)(`p`,{className:A.setCardDesc,children:t(`usageStatsToolHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":F,"aria-label":t(`usageStatsTool`),"data-testid":`billing-usage-stats-tool-toggle`,className:c(A.switch,F&&A.switchOn),onClick:Ce,children:(0,a.jsx)(`span`,{className:A.switchKnob})})]})}),(0,a.jsx)(`div`,{className:A.setCell,"data-testid":`billing-livecost-setting`,children:(0,a.jsxs)(`div`,{className:A.setCardHead,children:[(0,a.jsxs)(`div`,{className:A.setCardMeta,children:[(0,a.jsx)(`h3`,{className:A.setCardTitle,children:t(`liveCostBar`)}),(0,a.jsx)(`p`,{className:A.setCardDesc,children:t(`liveCostBarHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":O.show,"aria-label":t(`liveCostBar`),"data-testid":`billing-livecost-toggle`,className:c(A.switch,O.show&&A.switchOn),onClick:()=>k({show:!O.show}),children:(0,a.jsx)(`span`,{className:A.switchKnob})})]})}),(0,a.jsx)(`div`,{className:A.setCell,"data-testid":`billing-site-list-setting`,children:(0,a.jsxs)(`div`,{className:A.setCardHead,children:[(0,a.jsxs)(`div`,{className:A.setCardMeta,children:[(0,a.jsx)(`h3`,{className:A.setCardTitle,children:t(`siteListDisplay`)}),(0,a.jsx)(`p`,{className:A.setCardDesc,children:t(`siteListDisplayHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":D.hideUnidentified,"aria-label":t(`siteListDisplay`),"data-testid":`billing-site-hide-unidentified`,className:c(A.switch,D.hideUnidentified&&A.switchOn),onClick:()=>ne({hideUnidentified:!D.hideUnidentified}),children:(0,a.jsx)(`span`,{className:A.switchKnob})})]})})]})}),(0,a.jsx)(`section`,{className:A.setCard,"data-testid":`billing-display-setting`,children:(0,a.jsxs)(`div`,{className:A.setGrid2,children:[(0,a.jsxs)(`div`,{className:A.setCell,"data-testid":`billing-float-setting`,children:[(0,a.jsx)(`div`,{className:A.setCardHead,children:(0,a.jsxs)(`div`,{className:A.setCardMeta,children:[(0,a.jsx)(`h3`,{className:A.setCardTitle,children:t(`floatWindow`)}),(0,a.jsx)(`p`,{className:A.setCardDesc,children:t(`floatWindowHint`)})]})}),(0,a.jsxs)(`div`,{className:A.ctlCol,children:[(0,a.jsxs)(`div`,{className:A.ctlRow,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:t(`floatMode`)}),(0,a.jsxs)(`div`,{className:A.ctlGroup,"data-testid":`billing-float-mode`,children:[(0,a.jsx)(`button`,{type:`button`,className:c(A.floatModeBtn,w.mode===`combined`&&A.floatModeBtnOn),"data-testid":`billing-float-mode-combined`,onClick:()=>T({mode:`combined`,targets:w.targets}),children:t(`floatModeCombined`)}),(0,a.jsx)(`button`,{type:`button`,className:c(A.floatModeBtn,w.mode===`subscription`&&A.floatModeBtnOn),"data-testid":`billing-float-mode-subscription`,onClick:()=>T({mode:`subscription`,targets:w.targets}),children:t(`floatModeSubscription`)})]})]}),w.mode===`subscription`&&(0,a.jsxs)(`div`,{className:A.ctlRow,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:t(`floatTargets`)}),(0,a.jsxs)(`span`,{className:A.ctlGroup,"data-testid":`billing-float-targets`,children:[ge.map(e=>{let t=w.targets.includes(e.id);return(0,a.jsxs)(`label`,{className:A.floatTarget,children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:t,"data-testid":`billing-float-target-${e.id}`,onChange:()=>T({mode:`subscription`,targets:t?w.targets.filter(t=>t!==e.id):[...w.targets,e.id]})}),(0,a.jsx)(`span`,{className:A.floatTargetLabel,children:e.label})]},e.id)}),ge.length===0&&(0,a.jsx)(`span`,{className:A.setCardDesc,children:t(`floatNoTargetsHint`)})]})]})]})]}),(0,a.jsxs)(`div`,{className:A.setCell,"data-testid":`billing-card-setting`,children:[(0,a.jsx)(`div`,{className:A.setCardHead,children:(0,a.jsxs)(`div`,{className:A.setCardMeta,children:[(0,a.jsx)(`h3`,{className:A.setCardTitle,children:t(`cardDisplay`)}),(0,a.jsx)(`p`,{className:A.setCardDesc,children:t(`cardDisplayHint`)})]})}),(0,a.jsx)(`div`,{className:A.ctlCol,children:(0,a.jsxs)(`div`,{className:A.ctlRow,children:[(0,a.jsx)(`span`,{className:A.ctlLabel,children:t(`cardMetric`)}),(0,a.jsxs)(`div`,{className:A.ctlGroup,"data-testid":`billing-card-metric`,children:[(0,a.jsx)(`button`,{type:`button`,className:c(A.floatModeBtn,te.metric===`money`&&A.floatModeBtnOn),"data-testid":`billing-card-money`,onClick:()=>E({metric:`money`}),children:t(`cardMetricMoney`)}),(0,a.jsx)(`button`,{type:`button`,className:c(A.floatModeBtn,te.metric===`tokens`&&A.floatModeBtnOn),"data-testid":`billing-card-tokens`,onClick:()=>E({metric:`tokens`}),children:t(`cardMetricTokens`)})]})]})})]})]})}),(0,a.jsx)(Cn,{userPrices:o,onUserPrices:s,t}),(0,a.jsx)(Ze,{t,version:e.pluginVersion})]}),N===`trends`&&(0,a.jsxs)(`div`,{className:A.tabPanel,"data-testid":`billing-tab-panel-trends`,children:[(0,a.jsxs)(`section`,{className:c(A.ubCard,A.trendPanel),"data-testid":`billing-panel-trend`,children:[(0,a.jsxs)(`div`,{className:A.ubCardHead,children:[(0,a.jsx)(`h3`,{className:A.ubCardTitle,children:t(`trend`)}),_(`billing.dashboard.decor`,{position:`trend`}),(0,a.jsxs)(`span`,{className:A.ubCardControlGroup,children:[(0,a.jsx)(`span`,{className:A.rangeToggle,role:`group`,"aria-label":t(`trend`),children:[7,30].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(A.rangeButton,le===e&&A.rangeButtonActive),"aria-pressed":le===e,"data-testid":`billing-trend-${e}d`,onClick:()=>{P(e)},children:t(e===7?`trend7d`:`trend30d`)},e))}),(0,a.jsx)(`span`,{className:A.rangeToggle,role:`group`,"aria-label":t(`trendMetric`),children:[`cost`,`tokens`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(A.rangeButton,ie===e&&A.rangeButtonActive),"aria-pressed":ie===e,"data-testid":`billing-trend-metric-${e}`,onClick:()=>{ae(e)},children:t(e===`cost`?`trendMetricCost`:`trendMetricTokens`)},e))})]}),(0,a.jsx)(`span`,{className:A.ubCardSub,children:Ye})]}),(0,a.jsx)(We,{data:Y,models:ot,currency:m,metric:ie})]}),g.length>0&&(0,a.jsxs)(`section`,{className:A.ubCard,"data-testid":`billing-panel-rounds`,children:[(0,a.jsxs)(`div`,{className:A.ubCardHead,children:[(0,a.jsx)(`h3`,{className:A.ubCardTitle,children:t(`rounds`)}),z.length>0&&(0,a.jsxs)(`span`,{className:A.ubTagError,"data-testid":`billing-rounds-flag-count`,children:[z.length,` `,t(`anomaly`)]})]}),(0,a.jsx)(`p`,{className:A.ubCardSub,children:t(`roundsHint`).replace(`{count}`,String(g.length))}),(0,a.jsx)(st,{rounds:g,flags:z,currency:m,t})]}),e.byTier!==void 0&&(()=>{let e=B.peak+B.offPeak;if(e<=0)return null;let n=B.peak/e*100;return(0,a.jsxs)(`section`,{className:A.ubCard,"data-testid":`billing-panel-share`,children:[(0,a.jsxs)(`div`,{className:A.ubCardHead,children:[(0,a.jsx)(`h3`,{className:A.ubCardTitle,children:t(`peakShare`)}),(0,a.jsx)(`span`,{className:A.ubCardSub,children:t(`peakSharePerCall`)})]}),(0,a.jsxs)(`div`,{className:A.shareTrack,"data-testid":`billing-share-track`,children:[(0,a.jsx)(`div`,{className:c(A.shareSeg,A.shareSegPeak),style:{width:`${n}%`}}),(0,a.jsx)(`div`,{className:c(A.shareSeg,A.shareSegOff),style:{width:`${100-n}%`}})]}),(0,a.jsxs)(`div`,{className:A.shareLegend,children:[(0,a.jsxs)(`span`,{className:A.shareItem,children:[(0,a.jsx)(`span`,{className:A.shareDot,style:{background:`var(--dsw-static-blue-500)`}}),t(`peak`),(0,a.jsxs)(`span`,{className:A.shareValue,"data-testid":`billing-share-peak`,children:[L(B.peak),` · `,n.toFixed(1),`%`]})]}),(0,a.jsxs)(`span`,{className:A.shareItem,children:[(0,a.jsx)(`span`,{className:A.shareDot,style:{background:`color-mix(in srgb, var(--dsw-static-blue-500) 30%, var(--dsw-alias-bg-module-platform))`}}),t(`offPeak`),(0,a.jsxs)(`span`,{className:A.shareValue,"data-testid":`billing-share-offpeak`,children:[L(B.offPeak),` · `,(100-n).toFixed(1),`%`]})]})]}),Ee>0&&(0,a.jsx)(`div`,{className:A.staleNotice,"data-testid":`billing-share-savings`,children:t(`offPeakSavings`).replace(`{amount}`,L(Ee))})]})})()]}),N===`providers`&&(0,a.jsxs)(`div`,{className:A.tabPanel,"data-testid":`billing-tab-panel-providers`,children:[et.length>0&&(0,a.jsxs)(`section`,{className:A.panel,"data-testid":`billing-panel-relay-quota`,children:[(0,a.jsx)(`div`,{className:A.panelHead,children:(0,a.jsx)(`h3`,{className:A.panelTitle,children:t(`panelRelayQuota`)})}),(0,a.jsx)(`div`,{className:A.providerGroupList,"data-testid":`billing-relay-quotas`,children:et.map(e=>(0,a.jsxs)(`div`,{className:A.siteRow,"data-testid":`billing-relay-quota`,children:[(0,a.jsxs)(`span`,{className:A.siteRowName,children:[(0,a.jsx)(`span`,{className:c(A.siteKindTag,sn[e.kind]),children:on(e.kind,t)}),(0,a.jsx)(`span`,{className:A.siteRowTitle,children:e.origin})]}),(0,a.jsxs)(`span`,{className:A.siteRowMeta,children:[e.balance!==void 0&&(0,a.jsxs)(`span`,{className:A.siteRowCost,children:[t(`relayBalance`),` `,e.balance.toFixed(2)]}),(e.windows?.length??0)>0?e.windows?.map(e=>{let n=e.remainingPercent<20;return(0,a.jsxs)(`span`,{className:c(A.siteRowCalls,n&&A.siteRowCallsLow),children:[t(`relayWindowUsed`),` `,e.usedPercent,`%`]},e.kind)}):(0,a.jsx)(`span`,{className:A.siteRowCalls,children:t(`relayNoQuota`)})]})]},e.route))})]}),(0,a.jsxs)(`section`,{className:A.panel,"data-testid":`billing-panel-providers`,children:[(0,a.jsxs)(`div`,{className:A.panelHead,children:[(0,a.jsx)(`h3`,{className:A.panelTitle,children:t(`providerBilling`)}),_(`billing.dashboard.decor`,{position:`models`}),(0,a.jsx)(`span`,{className:A.panelHint,children:e.updatedAt===void 0?``:`${t(`lastUpdated`)} ${ln(e.updatedAt)}`})]}),re&&(0,a.jsx)(`div`,{className:A.staleNotice,"data-testid":`billing-subscriptions-stale`,children:t(`subscriptionsStale`)}),tt.length===0?(0,a.jsx)(`div`,{className:A.emptyRow,"data-testid":`billing-provider-empty`,children:t(`noData`)}):(0,a.jsx)(`div`,{className:A.providerGroupList,"data-testid":`billing-provider-groups`,children:tt.map(e=>(0,a.jsxs)(`div`,{className:A.providerGroup,"data-testid":`billing-provider-group`,children:[(0,a.jsxs)(`div`,{className:A.providerGroupHead,children:[(0,a.jsxs)(`span`,{className:A.providerGroupTitle,children:[(0,a.jsx)(`span`,{className:c(A.healthDot,e.dot),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:A.providerGroupName,children:Te(e.name)})]}),(0,a.jsxs)(`span`,{className:A.providerGroupMeta,children:[e.subscriptions.length>0&&(0,a.jsxs)(`span`,{className:A.providerGroupBadge,"data-testid":`billing-provider-sub-count`,children:[e.subscriptions.length,` 套餐`]}),!ke(e)&&e.balance!==void 0&&(0,a.jsxs)(`span`,{className:A.providerGroupBalance,"data-testid":`billing-provider-balance`,children:[(0,a.jsx)(`span`,{className:A.providerGroupBalanceLabel,children:t(`balance`)}),Ae(e.balance)]})]})]}),e.models.length>0&&(0,a.jsx)(`div`,{className:c(A.tableScroll,A.modelTableScroll),"data-testid":`billing-table-scroll`,children:(0,a.jsxs)(`table`,{className:A.modelTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`model`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`calls`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`inputTokens`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`outputTokens`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`cacheHitRate`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`actual`)})]})}),(0,a.jsx)(`tbody`,{children:e.models.map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:A.modelCell,children:[(0,a.jsx)(Tn,{provider:e.provider,colorVar:e.color}),(0,a.jsxs)(`span`,{children:[(0,a.jsxs)(`span`,{className:A.modelName,children:[e.name,e.uncatalogued&&(0,a.jsx)(`span`,{className:A.uncataloguedTag,"data-testid":`billing-uncatalogued-tag`,children:t(`uncatalogued`)}),e.estimatedPricing&&(0,a.jsx)(`span`,{className:A.estimatedTag,"data-testid":`billing-estimated-tag`,children:t(`estimatedPricing`)})]}),(0,a.jsx)(`span`,{className:A.modelProvider,children:Te(e.provider)})]})]})}),(0,a.jsx)(`td`,{className:A.numCol,children:e.calls.toLocaleString()}),(0,a.jsx)(`td`,{className:A.numCol,children:W(e.input)}),(0,a.jsx)(`td`,{className:A.numCol,children:W(e.output)}),(0,a.jsx)(`td`,{className:A.numCol,children:Ve(e.cacheHitRate)}),(0,a.jsx)(`td`,{className:A.numCol,children:e.plan?(0,a.jsx)(`span`,{className:A.planTag,children:t(`subscriptionIncluded`)}):e.actual===void 0?(0,a.jsx)(`span`,{className:A.na,children:`—`}):(()=>{let t=e.officialCost,n=e.actual-t;return t>0&&n>0?(0,a.jsxs)(`span`,{className:A.bucketCost,children:[(0,a.jsx)(`span`,{className:A.bucketOfficial,children:L(t)}),(0,a.jsx)(`span`,{className:A.bucketSep,children:`/`}),(0,a.jsx)(`span`,{className:A.bucketThird,children:L(n)})]}):L(e.actual)})()})]},e.key))})]})}),e.subscriptions.length>0&&(0,a.jsx)(`div`,{className:A.subscriptionGrid,"data-testid":`billing-subscriptions-grid`,children:e.subscriptions.map(e=>{let n=rn(e.status,t);return(0,a.jsxs)(`div`,{className:A.subscriptionCard,"data-testid":`billing-subscription-card`,children:[(0,a.jsxs)(`div`,{className:A.subscriptionHead,children:[(0,a.jsx)(`span`,{className:A.subscriptionName,children:Te(e.displayName)}),e.planType===`code`&&(()=>{let n=oe(e.provider),r=n===void 0?void 0:t(`subscriptionFeePerMonth`).replace(`{amount}`,n.currency===`USD`?`$${n.amount}`:`¥${n.amount}`);return(0,a.jsxs)(`span`,{className:A.subscriptionPlan,"data-kind":`code`,children:[r??(e.subscriptionAmount!==void 0&&e.subscriptionAmount>0?t(`subscriptionFeePerMonth`).replace(`{amount}`,L(e.subscriptionAmount)):t(`planTypeCode`)),n?.label!==void 0&&(0,a.jsx)(`span`,{className:A.subscriptionTier,"data-testid":`billing-tier-${e.provider}`,children:n.label}),n!==void 0&&(0,a.jsx)(`span`,{className:A.subscriptionAuto,"data-testid":`billing-auto-${e.provider}`,children:t(`subscriptionAutoDetect`)})]})})(),e.planType===`token`&&(0,a.jsx)(`span`,{className:A.subscriptionPlan,"data-kind":`token`,children:t(`planTypeToken`)}),e.plan!==void 0&&(0,a.jsx)(`span`,{className:A.subscriptionPlan,children:e.plan})]}),n!==``&&(0,a.jsx)(`div`,{className:A.subscriptionStatus,children:n}),e.windows.length===0&&n===``&&(0,a.jsx)(`div`,{className:A.subscriptionStatus,children:t(`subscriptionNoApi`)}),e.windows.map(e=>(()=>{let n=Math.min(100,Math.max(0,e.usedPercent)),r=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,a.jsxs)(`div`,{className:A.subscriptionWindow,children:[(0,a.jsx)(`span`,{className:A.subscriptionWindowLabel,children:an(e.kind,t)}),(0,a.jsx)(`span`,{className:A.subscriptionTrack,"aria-hidden":`true`,children:(0,a.jsx)(`span`,{className:c(A.subscriptionFill,n>=100&&A.subscriptionFillOver,n>=80&&n<100&&A.subscriptionFillWarn),style:{width:`${n}%`}})}),(0,a.jsxs)(`span`,{className:A.subscriptionMeta,children:[(0,a.jsx)(`span`,{className:c(A.subscriptionPct,r&&A.subscriptionExhausted),children:r?t(`subscriptionExhausted`):t(`subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,a.jsx)(`span`,{className:A.subscriptionReset,children:t(`subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${ln(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]},e.provider)})})]},e.name))})]}),(0,a.jsxs)(`div`,{className:A.exportBar,"data-testid":`billing-export-bar`,role:`group`,"aria-label":t(`export`),children:[(0,a.jsx)(`span`,{className:A.exportLabel,children:t(`export`)}),(0,a.jsx)(`button`,{type:`button`,className:A.exportButton,"data-testid":`billing-export-day`,onClick:()=>{Et(Tt(`usage-daily`,`csv`,Object.keys(M)),xt(M),`text/csv`)},children:t(`exportCsvDay`)}),e.bySession!==void 0&&(0,a.jsx)(`button`,{type:`button`,className:A.exportButton,"data-testid":`billing-export-sessions`,onClick:()=>{Et(Tt(`usage-sessions`,`csv`,Object.keys(M)),wt(e.bySession??[]),`text/csv`)},children:t(`exportCsvSession`)}),e.bySite!==void 0&&(0,a.jsx)(`button`,{type:`button`,className:A.exportButton,"data-testid":`billing-export-sites`,onClick:()=>{Et(Tt(`usage-sites`,`csv`,Object.keys(M)),St(e.bySite??{}),`text/csv`)},children:t(`exportCsvSite`)}),(0,a.jsx)(`button`,{type:`button`,className:A.exportButton,"data-testid":`billing-export-json`,onClick:()=>{Et(Tt(`usage-stats`,`json`,Object.keys(M)),JSON.stringify(e,null,2),`application/json`)},children:t(`exportJson`)})]}),De.length>0&&(0,a.jsxs)(`section`,{className:A.panel,"data-testid":`billing-panel-roles`,children:[(0,a.jsxs)(`div`,{className:A.panelHead,children:[(0,a.jsx)(`h3`,{className:A.panelTitle,children:t(`roleCost`)}),(0,a.jsx)(`span`,{className:A.panelHint,children:t(`roleHint`)})]}),(0,a.jsx)(`div`,{className:A.shareTrack,"data-testid":`billing-role-track`,children:De.map(e=>(0,a.jsx)(`div`,{className:c(A.shareSeg,e.seg),style:{width:`${e.pct}%`}},e.label))}),(0,a.jsx)(`div`,{className:A.shareLegend,children:De.map(e=>(0,a.jsxs)(`span`,{className:A.shareItem,children:[(0,a.jsx)(`span`,{className:c(A.shareDot,e.seg)}),e.label,(0,a.jsxs)(`span`,{className:A.shareValue,children:[L(e.value),` · `,e.pct.toFixed(1),`%`]})]},e.label))})]}),Z!==void 0&&(()=>{let e=Z.officialCost+Z.thirdCost,n=e>0?Z.officialCost/e*100:0;return(0,a.jsxs)(`div`,{className:A.ubStatGrid,"data-testid":`billing-panel-buckets`,children:[(0,a.jsxs)(`div`,{className:A.ubStatCard,children:[(0,a.jsxs)(`span`,{className:A.ubStatLabel,children:[t(`official`),`(=DeepSeek 直连)`]}),(0,a.jsx)(`span`,{className:A.ubStatValue,children:L(Z.officialCost)}),(0,a.jsxs)(`span`,{className:A.ubStatDetail,children:[Z.officialCalls,` `,t(`calls`),` · `,n.toFixed(1),`%`]})]}),(0,a.jsxs)(`div`,{className:A.ubStatCard,children:[(0,a.jsxs)(`span`,{className:A.ubStatLabel,children:[t(`thirdParty`),`(中转)`]}),(0,a.jsx)(`span`,{className:A.ubStatValue,children:L(Z.thirdCost)}),(0,a.jsxs)(`span`,{className:A.ubStatDetail,children:[Z.thirdCalls,` `,t(`calls`),` · `,(100-n).toFixed(1),`%`]})]})]})})(),e.byWorkspace!==void 0&&e.byWorkspace.length>0&&(0,a.jsxs)(`section`,{className:A.ubCard,"data-testid":`billing-panel-workspaces`,children:[(0,a.jsxs)(`div`,{className:A.ubCardHead,children:[(0,a.jsx)(`h3`,{className:A.ubCardTitle,children:t(`workspaces`)}),(0,a.jsx)(`span`,{className:A.ubCardSub,children:t(`workspacesHint`)})]}),(0,a.jsx)(`ul`,{className:A.rowlist,children:e.byWorkspace.map(n=>(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(`li`,{children:(0,a.jsxs)(`button`,{type:`button`,className:A.rowline,"data-testid":`billing-workspace-${n.name}`,onClick:()=>{be(ye===n.name?void 0:n.name)},children:[(0,a.jsx)(`span`,{className:A.rowlineName,children:n.name}),(0,a.jsxs)(`span`,{className:A.rowlineRight,children:[(0,a.jsx)(`span`,{className:A.num,children:L(n.cost)}),(0,a.jsxs)(`span`,{className:A.rowlineMuted,children:[n.calls,` `,t(`calls`)]}),(0,a.jsx)(`span`,{className:A.rowlineChev,"aria-hidden":`true`,children:`›`})]})]})}),ye===n.name&&(0,a.jsx)(`li`,{className:A.rowlineDrillWrap,children:e.bySession?.filter(e=>Vt(e.cwd)===n.name).slice(0,5).map(e=>(0,a.jsxs)(`div`,{className:A.rowlineDrill,children:[(0,a.jsx)(`span`,{className:A.rowlineName,children:e.title??e.id.slice(0,8)}),(0,a.jsxs)(`span`,{className:A.rowlineRight,children:[(0,a.jsx)(`span`,{className:A.num,children:L(e.cost)}),(0,a.jsxs)(`span`,{className:A.rowlineMuted,children:[e.calls,` `,t(`calls`)]})]})]},e.id))})]},n.name))})]}),e.bySession!==void 0&&(0,a.jsxs)(`section`,{className:A.ubCard,"data-testid":`billing-panel-sessions`,children:[(0,a.jsxs)(`div`,{className:A.ubCardHead,children:[(0,a.jsx)(`h3`,{className:A.ubCardTitle,children:t(`sessions`)}),(0,a.jsx)(`span`,{className:A.ubCardSub,children:e.bySession.length>20?t(`sessionOverflow`).replace(`{limit}`,`20`).replace(`{total}`,String(e.bySession.length)):`${e.bySession.length}`})]}),(e.staleLedgerSessions??0)>0&&(0,a.jsx)(`div`,{className:A.staleNotice,"data-testid":`billing-sessions-stale`,children:t(`staleLedgerNotice`).replace(`{count}`,String(e.staleLedgerSessions))}),(0,a.jsx)(`div`,{className:A.ubTablewrap,"data-testid":`billing-sessions-table`,children:(0,a.jsxs)(`table`,{className:A.ubTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`sessionTitle`)}),(0,a.jsx)(`th`,{children:t(`project`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`calls`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`actual`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`lastActive`)})]})}),(0,a.jsxs)(`tbody`,{children:[e.bySession.length===0&&(0,a.jsx)(`tr`,{children:(0,a.jsx)(`td`,{colSpan:5,className:A.emptyRow,children:t(`noData`)})}),e.bySession.slice(0,20).map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsxs)(`td`,{children:[(0,a.jsx)(`span`,{className:A.modelName,children:e.title??e.id.slice(0,8)}),e.stale===!0&&(0,a.jsx)(`span`,{className:c(A.ubTag,A.ubTagNeutral),"data-testid":`billing-session-stale`,children:t(`sessionStaleBadge`)})]}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:A.modelProvider,children:Vt(e.cwd)??`—`})}),(0,a.jsx)(`td`,{className:A.numCol,children:e.calls.toLocaleString()}),(0,a.jsx)(`td`,{className:A.numCol,children:L(e.cost)}),(0,a.jsx)(`td`,{className:A.numCol,children:e.lastActive>0?`${$(e.lastActive)} ${ln(e.lastActive)}`:`—`})]},e.id))]})]})})]})]}),N===`token`&&(0,a.jsxs)(`div`,{className:A.tabPanel,"data-testid":`billing-tab-panel-token`,children:[(0,a.jsx)(nt,{stats:e,trendDays:le,onTrendDays:P,models:ot,t}),e.perf!==void 0&&(0,a.jsxs)(`section`,{className:A.panel,"data-testid":`billing-panel-perf`,children:[(0,a.jsxs)(`div`,{className:A.panelHead,children:[(0,a.jsx)(`h3`,{className:A.panelTitle,children:t(`perfTitle`)}),(0,a.jsx)(`span`,{className:A.panelHint,children:t(`perfHint`)})]}),(0,a.jsx)(Je,{perf:e.perf,models:ot,t})]})]}),N===`pricing`&&(0,a.jsxs)(`div`,{className:A.tabPanel,"data-testid":`billing-tab-panel-pricing`,children:[(0,a.jsxs)(`div`,{className:A.ubAlert,role:`note`,children:[(0,a.jsxs)(`div`,{className:A.ubAlertLeft,children:[(0,a.jsxs)(`span`,{className:A.ubRate,"data-testid":`billing-rate`,children:[t(`todayRate`),` 1 USD = `,U(I.rate)]}),(0,a.jsx)(`span`,{className:c(A.ubTag,I.live?A.ubTagSuccess:A.ubTagNeutral),children:I.live?t(`rateLive`):t(`rateBuiltin`)})]}),(0,a.jsx)(`p`,{className:A.ubAlertNote,children:t(`pricingTip`)})]}),(0,a.jsxs)(`section`,{className:A.ubCard,"data-testid":`billing-panel-pricing`,children:[(0,a.jsxs)(`div`,{className:A.ubCardHead,children:[(0,a.jsx)(`h3`,{className:A.ubCardTitle,children:t(`pricing`)}),(0,a.jsx)(`span`,{className:A.ubCardSub,children:t(`pricingUnit`)})]}),(0,a.jsx)(`div`,{className:A.ubTablewrap,children:(0,a.jsxs)(`table`,{className:A.ubTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`thModel`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`thInputMiss`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`thInputHit`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`output`)}),(0,a.jsx)(`th`,{className:A.numCol,children:t(`band`)})]})}),(0,a.jsx)(`tbody`,{children:Fe().map(e=>{let n=e.price.input>0||e.price.output>0;return(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:A.ubModel,children:[(0,a.jsx)(Tn,{provider:e.provider,colorVar:Ie(e.colorVar)}),(0,a.jsxs)(`span`,{className:A.ubModelName,children:[e.name,e.uncatalogued&&(0,a.jsx)(`span`,{className:A.ubTagAlert,"data-testid":`billing-price-uncatalogued`,children:t(`uncatalogued`)}),e.promo!==void 0&&Ne(e.promo,Date.now())&&(0,a.jsx)(`span`,{className:A.ubTagPromo,"data-testid":`billing-price-promo`,title:e.promo.endsAtMs===void 0?t(`promoOpenEnded`):t(`promoUntil`,{date:new Date(e.promo.endsAtMs).toLocaleDateString()}),children:e.promo.note??t(`promoBadge`)})]})]})}),(0,a.jsx)(`td`,{className:A.numCol,children:n?R(e.price.input,e.price.currency):(0,a.jsx)(`span`,{className:A.na,children:`—`})}),(0,a.jsx)(`td`,{className:A.numCol,children:n?R(e.price.cacheHit,e.price.currency):(0,a.jsx)(`span`,{className:A.na,children:`—`})}),(0,a.jsx)(`td`,{className:A.numCol,children:n?R(e.price.output,e.price.currency):(0,a.jsx)(`span`,{className:A.na,children:`—`})}),(0,a.jsx)(`td`,{className:A.numCol,children:n&&e.price.offPeak!==void 0&&e.peakHours!==void 0?(0,a.jsxs)(`span`,{className:A.ubPricepair,children:[(0,a.jsxs)(`span`,{className:A.ubChipPeak,children:[(0,a.jsx)(`span`,{className:A.ubChipLabel,children:e.tierSemantics===`latency`?t(`ubStd`):t(`ubPeak`)}),(0,a.jsxs)(`span`,{className:A.num,children:[R(e.price.input,e.price.currency),` / `,R(e.price.output,e.price.currency)]})]}),(0,a.jsxs)(`span`,{className:A.ubChipOff,children:[(0,a.jsx)(`span`,{className:A.ubChipLabel,children:e.tierSemantics===`latency`?`Flex`:t(`ubOff`)}),(0,a.jsxs)(`span`,{className:A.num,children:[R(e.price.offPeak.input,e.price.currency),` / `,R(e.price.offPeak.output,e.price.currency)]})]})]}):n?(0,a.jsx)(`span`,{className:A.flatTag,children:t(`flat`)}):(0,a.jsx)(`span`,{className:A.na,children:`—`})})]}),(e.extraRows??[]).map(t=>(0,a.jsxs)(`tr`,{className:A.ubExtraRow,children:[(0,a.jsxs)(`td`,{children:[(0,a.jsx)(`span`,{className:A.ubExtraName,children:t.label}),t.note!==void 0&&(0,a.jsx)(`span`,{className:A.ubExtraNote,children:t.note})]}),(0,a.jsx)(`td`,{className:A.numCol,children:t.input===void 0?(0,a.jsx)(`span`,{className:A.na,children:`—`}):R(t.input,e.price.currency)}),(0,a.jsx)(`td`,{className:A.numCol,children:(0,a.jsx)(`span`,{className:A.na,children:`—`})}),(0,a.jsx)(`td`,{className:A.numCol,children:t.output===void 0?(0,a.jsx)(`span`,{className:A.na,children:`—`}):R(t.output,e.price.currency)}),(0,a.jsx)(`td`,{className:A.numCol,children:(0,a.jsx)(`span`,{className:A.na,children:`—`})})]},`${e.key}:${t.label}`))]},e.key)})})]})})]}),(0,a.jsxs)(`section`,{className:A.ubCard,children:[(0,a.jsx)(`div`,{className:A.ubCardHead,children:(0,a.jsx)(`h3`,{className:A.ubCardTitle,children:t(`pricingNotes`)})}),(0,a.jsxs)(`ul`,{className:A.ubNotes,children:[(0,a.jsxs)(`li`,{className:A.ubNotesItem,children:[(0,a.jsx)(`span`,{className:A.ubNotesTerm,children:t(`cacheHit`)}),(0,a.jsx)(`span`,{className:A.ubNotesDesc,children:t(`noteCache`)})]}),(0,a.jsxs)(`li`,{className:A.ubNotesItem,children:[(0,a.jsx)(`span`,{className:A.ubNotesTerm,children:t(`peakBand`)}),(0,a.jsx)(`span`,{className:A.ubNotesDesc,children:t(`noteBand`)})]}),(0,a.jsxs)(`li`,{className:A.ubNotesItem,children:[(0,a.jsx)(`span`,{className:A.ubNotesTerm,children:t(`pricingSource`)}),(0,a.jsx)(`span`,{className:A.ubNotesDesc,children:t(`noteSource`)})]})]})]})]}),_(`billing.dashboard.decor`,{position:`footer`})]}),(0,a.jsxs)(`footer`,{className:A.modalFooter,"data-testid":`billing-footer`,children:[(0,a.jsx)(`span`,{children:t(`footer`)}),(0,a.jsx)(`span`,{children:t(`footerCredit`).replace(`{version}`,e.pluginVersion===void 0?`—`:`v${e.pluginVersion}`)})]})]})})}function Tn({provider:e,colorVar:t}){let n=Nt(e);return n===void 0?(0,a.jsx)(`span`,{className:A.vendorLetter,style:t===void 0?void 0:{background:t},"aria-hidden":`true`,children:e.trim().charAt(0).toUpperCase()}):(0,a.jsx)(`img`,{className:A.vendorLogo,src:n,alt:``,"aria-hidden":`true`})}function En(e){let{t,checkModels:n,publishCosts:i,registerOpen:o,renderSlot:s,useStore:c,actions:l}=e,[u,p]=(0,r.useState)(dn),[m,_]=(0,r.useState)(Ut),[v,x]=(0,r.useState)([]),[S,T]=(0,r.useState)(void 0),[D,ne]=(0,r.useState)([]),[O,k]=(0,r.useState)(!1),[re,A]=(0,r.useState)([]),[ie,ae]=(0,r.useState)(`cny`),[j,oe]=(0,r.useState)(()=>d()),se=(0,r.useCallback)(e=>{oe(e),f(e)},[]),[M,N]=(0,r.useState)(()=>y()),ce=(0,r.useCallback)(e=>{N(e),b(e)},[]),[le,P]=(0,r.useState)(()=>ee()),ue=(0,r.useCallback)(e=>{P(e),w(e),window.dispatchEvent(new CustomEvent(C))},[]),[de,pe]=(0,r.useState)(()=>h()),me=(0,r.useCallback)(e=>{pe(e),g(e)},[]),[he,ge]=(0,r.useState)(()=>{let e=te();return fe(e),e}),_e=(0,r.useCallback)(e=>{ge(e),fe(e),E(e)},[]),ve=(0,r.useMemo)(()=>Qt(u),[u,he]),be=ie===`usd`?`en`:`zh`,F=(0,r.useCallback)((e,n)=>{let r=(be===`en`?kt:Ot)[e]??t(e);if(n===void 0)return r;let i=r;for(let[e,t]of Object.entries(n))i=i.replaceAll(`{${e}}`,String(t));return i},[be,t]),[Se,I]=(0,r.useState)(!1),L=(0,r.useCallback)(()=>{I(!1)},[]),we=(0,r.useCallback)(()=>{fn().then(e=>{e!==null&&p(Qt(e))}),hn().then(({balances:e,reconcile:t})=>{e.length>0&&x(e),T(t)}),gn().then(e=>{e.length>0&&ne(e),k(!1)}).catch(()=>{k(!0)}),_n().then(e=>{A(e)}).catch(()=>{})},[]),Te=(0,r.useCallback)(()=>{we(),mn(),I(!0)},[we]);(0,r.useEffect)(()=>{we(),mn()},[we]),(0,r.useEffect)(()=>{let e=setInterval(()=>{we(),mn()},cn);return()=>{clearInterval(e)}},[we]),(0,r.useEffect)(()=>{let e=!0;return n().then(t=>{e&&(_(t),ye(t.catalog??[]))}),()=>{e=!1}},[n]);let R=$(),z=Object.entries(u.byDay).filter(([e])=>e.startsWith(R.slice(0,7))).reduce((e,[,t])=>e+t.cost,0),B=u.byDay[R]?.cost??0,Ee=tn(u.byDay).reduce((e,t)=>e+t.cost,0),De=(0,r.useMemo)(()=>tn(u.byDay).map(e=>{let t=u.byDay[e.date];return{date:e.date,cost:e.cost,tokens:t===void 0?0:t.input+t.output}}),[u.byDay]),V=Object.entries(u.byDay).filter(([e])=>e.startsWith(R.slice(0,7))).reduce((e,[,t])=>e+t.input+t.output,0),Oe=(()=>{let e=u.byDay[R];return e===void 0?0:e.input+e.output})(),ke=De.reduce((e,t)=>e+t.tokens,0),Ae=c(e=>e.enabled),Me=c(e=>e.amount),Ne=c(e=>e.tierAlertDays),Pe=c(e=>e.lastTierSwitchAt),[Fe,Ie]=(0,r.useState)(()=>It()),[H,Le]=(0,r.useState)(null),[Re,ze]=(0,r.useState)(null),[Be,W]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{let e=setInterval(()=>W(Date.now()),cn);return()=>{clearInterval(e)}},[]);let Ve=(0,r.useCallback)(e=>{Ie(e),Lt(e)},[]),G=(0,r.useCallback)(()=>{ze({entering:Ce(Date.now())===`peak`?`offPeak`:`peak`,atMs:Date.now()+18e4})},[]),He=Me>0?Me:u.budget??0,Ue=(0,r.useCallback)(()=>{let e=!Ae;l.setEnabled(e),e&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission()},[l,Ae]);(0,r.useEffect)(()=>{if(!Ae||He<=0)return;let e=z/He*100,t=$(),n=Ht.filter(n=>e>=n&&Ne?.[String(n)]!==t);if(n.length===0)return;let r=n[n.length-1]??100;if(l.markTierAlerted(n,t),typeof Notification>`u`||Notification.permission!==`granted`)return;let i=F(`budgetTierBody`).replace(`{cost}`,U(z)).replace(`{budget}`,U(He)).replace(`{pct}`,String(r));try{new Notification(F(`budget`),{body:i})}catch{}},[Ae,He,z,Ne,l,F]),(0,r.useEffect)(()=>{let e=Rt(Be,Fe,Pe);if(e===null||(l.markTierSwitchAlerted(e.atMs),Le(e),!Fe.webNotify)||typeof Notification>`u`||Notification.permission!==`granted`)return;let t=Math.max(1,Math.round((e.atMs-Be)/6e4)),n=e.entering===`peak`?F(`peakAlertTitlePeak`):F(`peakAlertTitleOff`),r=e.entering===`peak`?F(`tierAlertEnterPeak`).replace(`{minutes}`,String(t)):F(`tierAlertEnterOff`).replace(`{minutes}`,String(t));try{new Notification(n,{body:r})}catch{}},[Be,Pe,Fe,l,F]);let K=c(e=>e.lastBalanceAlertDay),q=(0,r.useMemo)(()=>{if(v.length===0)return;let e=u.lowBalanceThreshold??50,t=Xt(u.byDay,R),n=xe().rate;for(let r of v){if(r.totalBalance===void 0||r.error!==void 0)continue;let i=r.currency===`USD`?r.totalBalance*n:r.totalBalance;if(i>=e)continue;let a=t>0?Math.floor(i/t):void 0;return{name:r.displayName,cny:i,days:a}}},[v,u.lowBalanceThreshold,u.byDay,R]);(0,r.useEffect)(()=>{if(q===void 0)return;let e=$();if(K===e||(l.markBalanceAlerted(e),typeof Notification>`u`||Notification.permission!==`granted`))return;let t=F(`balanceLowBody`).replace(`{name}`,q.name).replace(`{balance}`,U(q.cny)).replace(`{days}`,q.days===void 0?`—`:String(q.days));try{new Notification(F(`balance`),{body:t})}catch{}},[q,K,l,F]);let We=(0,r.useMemo)(()=>{let e=R.slice(0,7),t=new Map;for(let[n,r]of Object.entries(u.byDayModels??{}))if(n.startsWith(e))for(let[e,n]of Object.entries(r)){if(n.cost<=0)continue;let r=je(e).provider??`其他`,i=u.byModel?.[e]?.plan===!0,a=t.get(r)??{cost:0,plan:i};a.cost+=n.cost,i||(a.plan=!1),t.set(r,a)}let n=[...t.entries()].filter(([,e])=>!e.plan).sort((e,t)=>t[1].cost-e[1].cost)[0],r=[...t.entries()].filter(([,e])=>e.plan).sort((e,t)=>t[1].cost-e[1].cost)[0],i=e=>{let t=v.find(t=>Q(t.provider)===Q(e));if(t===void 0||t.totalBalance===void 0)return{text:t?.error===`unauthorized`?F(`balanceUnauthorized`):t?.error===`unreachable`||t?.error===`invalid`?F(`balanceUnreachable`):F(`balanceUnconfigured`),low:!1};let n=t.currency===`USD`?`$${t.totalBalance.toFixed(2)}`:U(t.totalBalance),r=xe().rate;return{text:n,low:(t.currency===`USD`?t.totalBalance*r:t.totalBalance)<(u.lowBalanceThreshold??50)}},a=e=>{let t=D.find(t=>t.displayName===e||Yt(t.provider)===e);if(t===void 0||t.windows.length===0)return{text:F(`subscriptionNoApi`),low:!1};let n=t.windows.reduce((e,t)=>Math.min(e,t.remainingPercent),100);return{text:n<=0?F(`subscriptionExhausted`):F(`subscriptionRemaining`).replace(`{pct}`,String(n)),low:n<20}};return{direct:n===void 0?void 0:{name:n[0],...i(n[0])},sub:r===void 0?void 0:{name:r[0],...a(r[0])}}},[u.byDayModels,u.byModel,u.lowBalanceThreshold,v,D,R]),J=(0,r.useMemo)(()=>{let e=u.total;return{totalToken:e.input+e.output,input:e.input,output:e.output,cacheRead:e.cacheHit,calls:e.calls}},[u]);(0,r.useEffect)(()=>{i({todayCost:B,monthCost:z})},[B,z,i]),(0,r.useEffect)(()=>o(Te),[o,Te]);let Ge=(0,r.useMemo)(()=>u.byTurn??[],[u.byTurn]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(bn,{...e,t:F,onOpen:Te,monthCost:z,todayCost:B,weekCost:Ee,days:De,vendorStatus:We,dash:J,cardPrefs:de,monthTokens:V,todayTokens:Oe,weekTokens:ke,floatPrefs:j,subscriptions:D}),Se&&(0,a.jsx)(wn,{stats:ve,t:F,onClose:L,userPrices:he,onUserPrices:_e,health:m,balances:v,...S===void 0?{}:{reconcile:S},quotas:D,relayQuotas:re,currency:ie,onCurrency:ae,turns:Ge,renderSlot:s,budgetEnabled:Ae,budgetAmount:He,onToggleBudget:Ue,onBudgetAmount:l.setAmount,peakConfig:Fe,onPeakConfig:Ve,onPreviewPeak:G,floatPrefs:j,onFloatPrefs:se,cardPrefs:de,onCardPrefs:me,sitePrefs:M,onSitePrefs:ce,liveCostPrefs:le,onLiveCostPrefs:ue,quotasStale:O}),(H!==null||Re!==null)&&(0,a.jsx)(zt,{hit:H??Re,config:Fe,t:F,onDismiss:()=>{Le(null),ze(null)}})]})}function Dn(e,t){return t===void 0||e?.bySession===void 0?0:e.bySession.find(e=>e.id===t)?.cost??0}function On(e,t){if(t===void 0||e?.byTurn===void 0)return 0;let n=0,r=-1;for(let i of e.byTurn)i.sessionId===t&&(r===-1||i.turn>r)&&(r=i.turn,n=i.cost);return n}function kn(e,t=20){let n=[];for(let r of e)if(r.status===`ok`)for(let e of r.windows)e.remainingPercent>t||n.push({name:r.displayName,kind:e.kind,pct:e.remainingPercent});return n.sort((e,t)=>e.pct-t.pct).slice(0,3)}async function An(){try{let e=await fetch(`/api/billing/usage-stats`);if(!e.ok)return null;let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return{...Array.isArray(r.bySession)?{bySession:r.bySession}:{},...Array.isArray(r.byTurn)?{byTurn:r.byTurn}:{}}}catch{return null}}async function jn(){try{let e=await fetch(`/api/billing/subscriptions`);if(!e.ok)return[];let t=JSON.parse(await e.text());if(typeof t!=`object`||!t||!(`quotas`in t))return[];let n=t.quotas;return Array.isArray(n)?n:[]}catch{return[]}}function Mn(e){switch(e){case`session`:return`subscriptionSession`;case`weekly`:return`subscriptionWeekly`;case`monthly`:return`subscriptionMonthly`;default:return`subscriptionBilling`}}function Nn({sessionId:e,t}){let[n,i]=(0,r.useState)(()=>ee().show);(0,r.useEffect)(()=>{let e=()=>{i(ee().show)};return window.addEventListener(C,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(C,e),window.removeEventListener(`storage`,e)}},[]);let[o,s]=(0,r.useState)(null),[c,l]=(0,r.useState)([]),[u,d]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{let e=!1,t=()=>{An().then(t=>{!e&&t!==null&&s(t)}),jn().then(t=>{e||l(t)}),e||d(Date.now())};t();let n=setInterval(t,3e4);return()=>{e=!0,clearInterval(n)}},[e]);let f=(0,r.useMemo)(()=>Dn(o,e),[o,e]),p=(0,r.useMemo)(()=>On(o,e),[o,e]),m=R(u),h=(0,r.useMemo)(()=>kn(c),[c]),g=e=>U(e,`cny`),_=f>0||p>0,v=m.tier===`peak`;return n?(0,a.jsxs)(`span`,{className:A.feeBar,"data-testid":`billing-live-cost-bar`,children:[(0,a.jsx)(`span`,{className:v?A.feeChipPrimary:A.feeChipOff,"data-testid":`billing-live-tier`,children:t(v?`tierPeak`:`tierOff`)}),(0,a.jsx)(`span`,{className:A.feeCount,children:B(m.nextSwitchInMs)}),(0,a.jsx)(`span`,{className:A.feeSuffix,children:t(v?`tierToOff`:`tierToPeak`)}),_&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:A.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:A.feeItem,"data-testid":`billing-live-turn`,children:[t(`liveTurn`),` `,(0,a.jsx)(`span`,{className:A.feeNum,children:g(p)})]}),(0,a.jsx)(`span`,{className:A.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:A.feeItem,"data-testid":`billing-live-session`,children:[t(`liveSession`),` `,(0,a.jsx)(`span`,{className:A.feeNum,children:g(f)})]})]}),h.map(e=>(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:A.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:e.pct<=10?A.feeChipError:A.feeChipAlert,"data-testid":`billing-live-quota`,children:[e.name,` `,t(Mn(e.kind)),` `,e.pct,`%`]})]},`${e.name}:${e.kind}`))]}):null}function Pn(){let e,t,n=new Set;return{readCosts:()=>e,subscribeCosts:t=>(t(e),n.add(t),()=>{n.delete(t)}),openDashboard:()=>{t?.()},publishCosts:t=>{e=t;for(let e of n)try{e(t)}catch{}},registerOpen:e=>(t=e,()=>{t===e&&(t=void 0)})}}function Fn(){return(0,o.defineStore)({init:()=>({enabled:!1,amount:0,tierAlertDays:{},lastBalanceAlertDay:``,lastTierSwitchAt:0}),persist:`dsh.ui-usage-billing.budget`,actions:{setEnabled:(e,t)=>{e.enabled=t},setAmount:(e,t)=>{e.amount=Number.isFinite(t)&&t>0?t:0},markTierAlerted:(e,t,n)=>{e.tierAlertDays??={};for(let r of t)e.tierAlertDays[String(r)]=n},markBalanceAlerted:(e,t)=>{e.lastBalanceAlertDay=t},markTierSwitchAlerted:(e,t)=>{e.lastTierSwitchAt=t}}})}let In={enabled:!1,timeout:0};function Ln(){try{let e=localStorage.getItem(`dsh-billing-completion-notify-v1`);if(e===null)return{...In};let t=JSON.parse(e);return{enabled:t.enabled===!0,timeout:typeof t.timeout==`number`?t.timeout:0}}catch{return{...In}}}function Rn(e){return e.completed===!0||e.running===!1}function zn(e,t){let n=new Set,r=new Set,i,a=e.getSnapshot();for(let e of a.ids){let t=a.byId[e];t!==void 0&&(r.add(String(e)),Rn(t)&&n.add(String(e)))}let o=e=>{let{enabled:n,timeout:r}=t();if(n&&!(typeof Notification>`u`)&&Notification.permission===`granted`)try{let t=new Notification(e,{body:e,tag:`dsh-billing-completion`,requireInteraction:r===0});r>0&&(i!==void 0&&clearTimeout(i),i=setTimeout(()=>t.close(),r*1e3))}catch{}},s=e.subscribe(()=>{let t=e.getSnapshot(),i=[];for(let e of t.ids){let a=t.byId[e];if(a===void 0)continue;let o=String(e),s=Rn(a),c=!r.has(o);c&&r.add(o),s&&!c&&!n.has(o)&&i.push(a.title??a.id??o),s?n.add(o):n.delete(o)}if(i.length>0){let e=i.length===1?i[0]:`${i.length} 个会话已完成`;e!==void 0&&o(e)}});return()=>{s(),i!==void 0&&clearTimeout(i)}}let Bn=[`slots`,`locale`,`remote`,`sessions`];function Vn(e){let t=Pn();e.provide(`billingMetrics`,t);let n=Fn();e.effect(()=>e.locale.register(Dt,{zh:Ot,en:kt}),`ui-usage-billing: dictionaries`),e.slots.inject(`sidebar.footer.action`,()=>e.slots.register({name:`sidebar.footer.action`,id:`usage-billing`,order:-10,locale:Dt,children:{"billing.dashboard.decor":{kind:`list`,scope:`root`}},store:n,inject:()=>({checkModels:async()=>{try{let[t,n]=await Promise.all([e.remote.llm.listProviders(),e.remote.llm.listConfigurableProviders()]);if(!t.ok||!n.ok)return{checked:!0,available:!1,models:0,failures:0,okProviders:[],badProviders:[]};let r=new Map(n.value.map(e=>[e.provider,e])),i=await Promise.all(t.value.map(async t=>{let n=r.get(t.id);if(n===void 0)return{provider:t,models:[]};let i=await e.remote.llm.discoverModels(n.settingsNs,{provider:t.id});return i.ok?{provider:t,models:i.value}:{provider:t,failed:!0}})),a=[],o=[],s=[],c=0;for(let e of i){if(`failed`in e){s.push(e.provider.name);continue}o.push(e.provider.name),c+=e.models.length;for(let t of e.models)a.push({id:t.id,...typeof t.name==`string`&&t.name!==``?{name:t.name}:{},provider:e.provider.name})}return{checked:!0,available:o.length>0,models:c,failures:s.length,okProviders:o,badProviders:s,catalog:a}}catch{return{checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]}}},publishCosts:e=>{t.publishCosts(e)},registerOpen:e=>t.registerOpen(e)})},En)),e.slots.inject(`conversation.composer.dock`,()=>e.slots.register({name:`conversation.composer.dock`,id:`usage-billing-cost`,order:0,locale:Dt},Nn)),e.effect(()=>zn(e.sessions.list,Ln),`ui-usage-billing: completion notifier`)}return n.UsageBilling=En,n.apply=Vn,n.inject=Bn,t.exports}});
|
|
5
|
+
`)}function Tt(e,t,n){let r=[...n].sort(),i=r[0],a=r.at(-1);return`${e}${i!==void 0&&a!==void 0?`-${i}_${a}`:``}.${t}`}function Et(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),setTimeout(()=>URL.revokeObjectURL(r),0)}let Dt=`usageBilling`,Ot={title:`使用统计`,cost:`费用`,todayCost:`今日费用`,monthCost:`本月费用`,yearCost:`本年费用`,monthProjected:`本月预计`,liveTurn:`本轮`,liveSession:`会话`,calls:`调用`,cacheHitRate:`缓存命中率`,tokens:`Token`,inputTokens:`输入`,outputTokens:`输出`,avgCost:`平均成本`,trend:`每日费用与调用趋势`,trend7d:`7 天`,trend30d:`30 天`,trendMetric:`趋势指标`,trendMetricCost:`费用`,trendMetricTokens:`Token`,trendEmpty:`暂无趋势数据`,budget:`本月预算`,budgetAmount:`预算金额`,budgetSummary:`本月已用 {used} / {total};达到 80% 时提醒,达到 100% 时红色脉冲警示`,sessions:`会话明细`,sessionTitle:`标题`,project:`项目`,lastActive:`最后活跃`,sessionOverflow:`仅显示花费前 {limit} 个,共 {total} 个会话`,budgetTierBody:`本月花费 {cost} 已达预算 {budget} 的 {pct}%`,models:`模型计费明细`,providerBilling:`厂商计费与订阅`,actual:`实际`,pricing:`模型单价表`,input:`输入`,output:`输出`,cacheHit:`缓存命中`,peak:`高峰`,offPeak:`低谷`,flat:`全天统一`,band:`时段`,close:`关闭`,footer:`每 30s 自动轮询 · 仅统计本机 dsh 会话`,footerCredit:`dsh-ui-usage-billing {version} · MIT`,lastUpdated:`数据更新于`,noData:`暂无计费数据`,todayRate:`今日汇率`,rateLive:`实时`,rateBuiltin:`内置`,promoBadge:`限时折扣`,promoUntil:`促销价至 {date},之后自动恢复刊例价`,promoOpenEnded:`厂商未公布截止时间,当前按折扣计价;公告截止后自动恢复刊例价`,pricingTip:`DeepSeek 模型自北京时间 2026-08-23(周日)00:00 起:工作日高峰 9-12 / 14-18(×2),周末(周六 / 周日)全天低谷价;双价单元格按峰 / 谷展示,费用按调用时刻计。`,pricingUnit:`单位:人民币 / 每百万 Token`,pricingNotes:`计价说明`,ubPeak:`峰`,ubOff:`谷`,ubStd:`标准`,peakBand:`峰谷分带`,pricingSource:`数据来源`,noteCache:`命中部分按缓存价计费,显著降低成本。`,noteBand:`高峰与空闲时段单价不同,空闲约半价。`,noteSource:`价格来自实时汇率 + 模型定价目录,未收录模型按 0 计并提示。`,balance:`余额`,balanceUnconfigured:`未配置`,balanceUnauthorized:`密钥无效`,balanceUnreachable:`查询失败`,uncatalogued:`未收录`,estimatedPricing:`估算价`,balanceDays:`约可撑 {days} 天`,balanceLowBody:`{name} 余额 {balance},约可撑 {days} 天,请及时充值`,reconcileDrift:`系统监控到{provider}官方余额变动 {spent},本面板记录 {today},差额通常由其它工具或 API 的消耗所致`,reconcileDismiss:`知道了`,subscriptionNotConfigured:`未配置密钥`,subscriptionUnauthorized:`密钥无效`,subscriptionUnavailable:`查询失败`,subscriptionInvalid:`响应异常`,subscriptionRateLimited:`触发限流`,subscriptionSession:`本次`,subscriptionWeekly:`本周`,subscriptionMonthly:`本月`,subscriptionBilling:`计费周期`,subscriptionRemaining:`剩余 {pct}%`,subscriptionExhausted:`已用尽`,subscriptionReset:`{date} 重置`,subscriptionNoApi:`该厂商暂未提供用量查询接口`,floatWindow:`模型用量悬浮窗`,floatModeCombined:`综合`,floatModeSubscription:`订阅卡`,floatMode:`展示模式`,floatTargets:`订阅目标`,floatWindowHint:`悬浮在左下角计费卡上的用量速览;综合=当前样式,订阅卡=每次展示一张订阅额度卡(可切换)。`,cardDisplay:`计费卡显示`,cardDisplayHint:`切换左下角计费卡的主指标:花费金额或 Token 消耗(副行与迷你柱同步切换,悬浮窗不受影响)。`,cardMetric:`主指标`,cardMetricMoney:`花费金额`,cardMetricTokens:`Token 消耗`,floatNoTargets:`未指定订阅通道,请在设置中勾选要展示的订阅。`,floatNoTargetsHint:`暂无可选的订阅通道。`,subscriptionsStale:`订阅额度刷新失败,以下为缓存数据`,staleLedgerNotice:`{count} 个会话出自旧版算法存档(日志已删,无法重算),模型归属可能有误差`,tokenCacheWrite:`写入`,toolRank:`工具排行`,toolName:`工具`,userPrices:`自定义单价`,userPricesHint:`为未收录或变价模型填入实付单价,总览与日趋势按此重估;模型可用下拉候选(目录键或模型 id);来源留空=该模型默认价,填入中转站域名=仅该来源的同名模型用此价(协议可省);低谷价三栏填后按峰/谷混合估算,留空=平档`,userPriceSave:`保存`,userPriceModel:`模型`,userPriceSource:`来源(中转站域名)`,userPriceSourceHint:`留空=默认价,或 https://api.中转站.com`,userPriceOffPeak:`低谷价`,userPriceNormal:`标准价`,userPriceCurrency:`币种`,userPriceAdd:`新增`,userPriceRemoveSelected:`删除所选`,userPriceSelect:`选择此行`,sessionStaleBadge:`旧版统计`,heatmapLess:`少`,heatmapMore:`多`,currency:`币种`,currencyCny:`人民币`,currencyUsd:`美元`,heatmap:`用量热力图`,rounds:`每轮费用`,roundsHint:`最近 {count} 轮 · 柱顶为金额 · 底色为峰谷时段`,anomaly:`成本突增`,workspaces:`工作区统计`,workspacesHint:`点击行下钻项目成本前 5 会话`,model:`模型`,thModel:`模型名称`,thInputMiss:`输入缓存未命中`,thInputHit:`输入缓存命中`,costAbbr:`费用`,tabOverview:`概览`,tabTrends:`趋势`,tabProviders:`账单`,tabPricing:`费率`,tabSettings:`设置`,budgetHint:`设置月度上限,用于本月预计与超支分段提醒`,peakAlertHint:`在切档前弹窗提醒,可选同步系统通知`,peakAlertDescPeak:`即将进入高峰时段,价格将上调,请提前安排长任务`,peakAlertDescOff:`即将进入平价时段,价格减半,适合运行大批量任务`,export:`导出`,exportCsvDay:`按日 CSV`,exportCsvSession:`按会话 CSV`,exportJson:`全量 JSON`,peakShare:`峰谷时段占比`,peakSharePerCall:`按调用时刻精确判档`,offPeakSavings:`挪谷可省约 {amount}`,perfMax:`最大 TTFT`,weekCost:`本周`,roleCost:`费用构成`,roleUser:`用户输入`,roleAssistant:`助手输出`,roleTool:`工具结果`,roleHint:`估算:输出按实测计价,输入按消息长度摊分`,tierPeak:`峰时`,tierOff:`平价`,tierToPeak:`后转峰时`,tierToOff:`后转平价`,tierAlertEnterPeak:`{minutes} 分钟后进入峰时(DeepSeek 高峰价 ×2),不急的调用可稍等`,tierAlertEnterOff:`{minutes} 分钟后进入平价(价格减半)`,peakAlertTitlePeak:`即将进入高峰价`,peakAlertTitleOff:`即将进入平价`,peakAlert:`峰谷切换提醒`,peakAlertLeadMin:`提前量(分钟)`,peakAlertPos:`位置`,peakAlertMode:`提醒模式`,peakAlertPosCorner:`右下角`,peakAlertPosCenter:`屏幕居中`,peakAlertModePeak:`仅进入峰时`,peakAlertModeOff:`仅进入平价`,peakAlertModeBoth:`峰与谷都提醒`,peakAlertWebNotify:`同时发系统通知`,peakAlertPreview:`预览提醒`,planTypeCode:`订阅制`,planTypeToken:`按量`,subscriptionFeePerMonth:`{amount}/月`,triggerToday:`今日`,triggerMonth:`当月`,triggerMonthTokens:`当月 Token`,subscriptionIncluded:`订阅包含`,free:`免费`,official:`官方`,thirdParty:`三方`,perfSamples:`样本`,perfTtft:`首字延时`,perfP50:`P50`,perfP90:`P90`,perfTps:`生成速度`,perfLatency:`总延迟`,perfEstimated:`估算样本`,perfEmpty:`暂无性能数据`,perfTpsUnit:`tok/s`,perfTitle:`性能`,perfHint:`按模型与按小时聚合;估算样本为工具续写步骤`,perfAll:`全选`,perfChartEmpty:`未选择模型或该指标暂无数据`,heatmapYear:`年`,heatmapMonth:`月`,activeDays:`活跃天数`,streakDays:`连续使用`,subscriptionAutoDetect:`自动识别`,pluginVersion:`版本`,pluginAuthor:`作者`,pluginRepository:`仓库`,pluginNpm:`npm`,pluginLicense:`许可证`,tabToken:`用量`,tokenExport:`导出 Token`,tokenExportCsv:`按日 Token CSV`,tokenCacheHitRate:`缓存命中率`,tokenReasoningShare:`思考占比`,tokenReasoningShort:`思考`,tokenIo:`输入/输出比`,tokenPeak:`峰值日`,tokenDaily:`每日 Token`,tokenByModel:`模型 Token`,tokenMiss:`输入(缓存未命中)`,tokenHit:`输入(缓存命中)`,tokenOutput:`输出`,tokenViewStructure:`按结构`,tokenViewModel:`按模型`,tokenHitShort:`命中`,tokenMissShort:`未命中`,tokenTotal:`总 Token`,tokenShare:`占比`,usageStatsTool:`注入用量查询工具`,usageStatsToolHint:`让模型可在对话中查询用量/费用;会占用模型每次请求的上下文,coding 场景建议关闭(改后需重载应用生效)`,balanceGranted:`赠金余额`,balanceTopped:`充值余额`,balanceDaily:`日均消耗`,balanceDaysLong:`约可撑`,balanceDaysUnit:`天`,popTodayModel:`主力消耗模型余额`,popTitle:`用量速览`,popNoConsumption:`暂无消耗`,popDirectLead:`直联`,popSubLead:`订阅`,unpricedHint:`{count} 个模型未收录计价,费用已按 0 计`,searchEstimateHint:`含 {count} 次联网搜索请求的估算费用(每次约 {each};日志无用量事件,按次估算,可在配置 searchCallEstimateCny 调整或关闭)`,siteListDisplay:`中转站列表`,siteListDisplayHint:`隐藏「未识别」占位条目,净化中转站额度列表`,liveCostBar:`平价消耗胶囊`,liveCostBarHint:`输入框旁的即时代费条,悬浮可看详情`,liveCostBarPosition:`位置`,liveCostBarPosBelow:`输入框下方`,liveCostBarPosAbove:`输入框上方`,liveCostBarPosToolbar:`输入框内部`,exportCsvSite:`按站点 CSV`,panelRelayQuota:`中转站额度`,relayBalance:`余额`,relayNoQuota:`未读出额度`,relayWindowUsed:`已用`,relayKindNewApi:`New API`,relayKindSub2Api:`Sub2API`,relayKindUnknown:`未识别`},kt={title:`Usage`,cost:`Cost`,todayCost:`Today`,monthCost:`This month`,yearCost:`This year`,monthProjected:`Projected`,liveTurn:`Turn`,liveSession:`Session`,calls:`Calls`,cacheHitRate:`Cache Hit`,tokens:`Tokens`,inputTokens:`Input`,outputTokens:`Output`,avgCost:`Avg cost`,trend:`Daily cost & calls`,trend7d:`7D`,trend30d:`30D`,trendMetric:`Trend metric`,trendMetricCost:`Cost`,trendMetricTokens:`Tokens`,trendEmpty:`No trend data yet`,budget:`Monthly budget`,budgetAmount:`Budget amount`,budgetSummary:`Used {used} / {total} this month; warn at 80%, pulse red at 100%`,sessions:`Sessions`,sessionTitle:`Title`,project:`Project`,lastActive:`Last active`,sessionOverflow:`Top {limit} of {total} sessions by cost`,budgetTierBody:`This month {cost} reached {pct}% of the budget {budget}`,models:`Model billing`,providerBilling:`Provider billing & subscriptions`,actual:`Actual`,pricing:`Model pricing`,input:`Input`,output:`Output`,cacheHit:`Cache hit`,peak:`Peak`,offPeak:`Off-peak`,flat:`Flat`,band:`Band`,close:`Close`,footer:`Polls every 30s · local dsh sessions only`,footerCredit:`dsh-ui-usage-billing {version} · MIT`,lastUpdated:`Updated`,noData:`No billing data yet`,todayRate:`Today rate`,rateLive:`Live`,rateBuiltin:`Built-in`,promoBadge:`Promo`,promoUntil:`Promo price until {date}, then list price resumes automatically`,promoOpenEnded:`End date not announced; billed at the discounted rate until further notice, then list price resumes`,pricingTip:`DeepSeek models: from 2026-08-23 (Sun) 00:00 Beijing, weekdays peak 9-12 / 14-18 (×2), weekends (Sat/Sun) all-day off-peak; cells show peak/off-peak price, billed at call time.`,pricingUnit:`Unit: CNY / per 1M tokens`,pricingNotes:`Pricing notes`,ubPeak:`Peak`,ubOff:`Off`,ubStd:`Std`,peakBand:`Peak/off-peak band`,pricingSource:`Data source`,noteCache:`Cache hits are billed at the cache rate, cutting cost.`,noteBand:`Peak and off-peak prices differ; off-peak is roughly half price.`,noteSource:`Prices come from the live rate + model catalog; unlisted models count as 0 and are flagged.`,balance:`Balance`,balanceUnconfigured:`Not set`,balanceUnauthorized:`Bad key`,balanceUnreachable:`Unavailable`,uncatalogued:`Not catalogued`,estimatedPricing:`Estimated`,balanceDays:`~{days} days left`,balanceLowBody:`{name} balance {balance}, ~{days} days left, please top up`,reconcileDrift:`Detected {provider} official balance moved {spent}, this panel recorded {today}; the gap usually comes from other tools or APIs consuming too`,reconcileDismiss:`Got it`,subscriptionNotConfigured:`Key not set`,subscriptionUnauthorized:`Bad key`,subscriptionUnavailable:`Unavailable`,subscriptionInvalid:`Bad response`,subscriptionRateLimited:`Rate limited`,subscriptionSession:`Current`,subscriptionWeekly:`Weekly`,subscriptionMonthly:`Monthly`,subscriptionBilling:`Billing`,subscriptionRemaining:`{pct}% left`,subscriptionExhausted:`Exhausted`,subscriptionReset:`Resets {date}`,subscriptionNoApi:`Provider does not offer a usage API`,floatWindow:`Model usage popover`,floatModeCombined:`Combined`,floatModeSubscription:`Subscription card`,floatMode:`Display mode`,floatTargets:`Targets`,floatWindowHint:`Usage summary floating on the footer card; Combined=current style, Subscription cards=one quota card at a time (switchable).`,cardDisplay:`Billing card display`,cardDisplayHint:`Switch the main metric on the bottom-left billing card between cost and token usage (sub row and sparkline follow; the popover is unaffected).`,cardMetric:`Main metric`,cardMetricMoney:`Cost`,cardMetricTokens:`Token usage`,floatNoTargets:`No subscription selected — pick some in Settings.`,floatNoTargetsHint:`No subscription channel available.`,subscriptionsStale:`Subscription refresh failed — showing cached data`,staleLedgerNotice:`{count} sessions use legacy-algorithm archives (logs deleted); attribution may be off`,tokenCacheWrite:`written`,toolRank:`Tool calls`,toolName:`Tool`,userPrices:`Custom prices`,userPricesHint:`Enter actual per-1M-token prices; main views are re-costed. Pick a model key from the dropdown candidates. Leave source empty for the model default, or enter a relay origin (protocol optional) to price only that source. Fill all three off-peak fields for peak/off-peak estimation; leave them empty for flat pricing.`,userPriceSave:`Save`,userPriceModel:`Model`,userPriceSource:`Source (relay origin)`,userPriceSourceHint:`Empty = default; e.g. https://api.relay.com`,userPriceOffPeak:`Off-peak price`,userPriceNormal:`Standard price`,userPriceCurrency:`Currency`,userPriceAdd:`Add`,userPriceRemoveSelected:`Remove selected`,userPriceSelect:`Select this row`,sessionStaleBadge:`legacy`,heatmapLess:`Less`,heatmapMore:`More`,currency:`Currency`,currencyCny:`CNY`,currencyUsd:`USD`,heatmap:`Usage heatmap`,rounds:`Cost per turn`,roundsHint:`Last {count} rounds · bar tops show amount · fill = peak/off-peak`,anomaly:`Cost spike`,workspaces:`Workspaces`,workspacesHint:`Click a row to drill into its top-5 sessions`,model:`Model`,thModel:`Model name`,thInputMiss:`Input (cache miss)`,thInputHit:`Input (cache hit)`,costAbbr:`cost`,tabOverview:`Overview`,tabTrends:`Trends`,tabProviders:`Bills`,tabPricing:`Rates`,tabSettings:`Settings`,budgetHint:`Set a monthly cap for projections and tier alerts`,peakAlertHint:`Alert before a tier switch, optionally via system notification`,peakAlertDescPeak:`About to enter peak hours — prices rise, plan long tasks ahead`,peakAlertDescOff:`About to enter off-peak hours — price halves, ideal for large batches`,export:`Export`,exportCsvDay:`Daily CSV`,exportCsvSession:`Sessions CSV`,exportJson:`Full JSON`,peakShare:`Peak vs off-peak`,peakSharePerCall:`per-call attribution, full history`,offPeakSavings:`Shift peak to off-peak: save ~{amount}`,perfMax:`Max TTFT`,weekCost:`This week`,roleCost:`Cost breakdown`,roleUser:`User input`,roleAssistant:`Assistant output`,roleTool:`Tool results`,roleHint:`Estimated: output priced exactly, input split by message size`,tierPeak:`Peak`,tierOff:`Off-peak`,tierToPeak:`until peak`,tierToOff:`until off-peak`,tierAlertEnterPeak:`Peak pricing (2x) starts in {minutes} min — non-urgent calls can wait`,tierAlertEnterOff:`Off-peak pricing (50% off) starts in {minutes} min`,peakAlertTitlePeak:`Peak pricing incoming`,peakAlertTitleOff:`Off-peak incoming`,peakAlert:`Peak/off-peak alert`,peakAlertLeadMin:`Lead time (min)`,peakAlertPos:`Position`,peakAlertMode:`Remind mode`,peakAlertPosCorner:`Bottom-right`,peakAlertPosCenter:`Center`,peakAlertModePeak:`Entering peak only`,peakAlertModeOff:`Entering off-peak only`,peakAlertModeBoth:`Both`,peakAlertWebNotify:`Also send system notification`,peakAlertPreview:`Preview alert`,planTypeCode:`Subscription`,planTypeToken:`Usage`,subscriptionFeePerMonth:`{amount}/mo`,triggerToday:`Today`,triggerMonth:`This month`,triggerMonthTokens:`Monthly tokens`,subscriptionIncluded:`Included`,free:`Free`,official:`Official`,thirdParty:`Third-party`,perfSamples:`Samples`,perfTtft:`TTFT`,perfP50:`P50`,perfP90:`P90`,perfTps:`Speed`,perfLatency:`Total latency`,perfEstimated:`Estimated`,perfEmpty:`No performance data yet`,perfTpsUnit:`tok/s`,perfTitle:`Performance`,perfHint:`Per model & per hour; estimated samples are tool-continuation steps`,perfAll:`All`,perfChartEmpty:`No model selected or no data for this metric`,heatmapYear:`Year`,heatmapMonth:`Month`,activeDays:`Active days`,streakDays:`Streak`,subscriptionAutoDetect:`Auto`,pluginVersion:`Version`,pluginAuthor:`Author`,pluginRepository:`Repository`,pluginNpm:`npm`,pluginLicense:`License`,tabToken:`Usage`,tokenExport:`Export tokens`,tokenExportCsv:`Daily token CSV`,tokenCacheHitRate:`Cache hit rate`,tokenReasoningShare:`Reasoning share`,tokenReasoningShort:`reasoning`,tokenIo:`In/out ratio`,tokenPeak:`Peak day`,tokenDaily:`Daily tokens`,tokenByModel:`Tokens by model`,tokenMiss:`Input (cache miss)`,tokenHit:`Input (cache hit)`,tokenOutput:`Output`,tokenViewStructure:`Structure`,tokenViewModel:`By model`,tokenHitShort:`Hit`,tokenMissShort:`Miss`,tokenTotal:`Total tokens`,tokenShare:`Share`,usageStatsTool:`Inject usage-stats tool`,usageStatsToolHint:`Lets the model query usage/cost inside a conversation; it consumes context per request, so keep it off for coding (takes effect after a reload)`,balanceGranted:`Granted`,balanceTopped:`Topped up`,balanceDaily:`Daily burn`,balanceDaysLong:`~days left`,balanceDaysUnit:`days`,popTodayModel:`Main model balance`,popTitle:`Usage overview`,popNoConsumption:`No usage yet`,popDirectLead:`Direct`,popSubLead:`Subscription`,unpricedHint:`{count} models not priced; their cost counts as 0`,searchEstimateHint:`Includes estimated cost of {count} web-search requests (~{each} each; no usage events logged, per-call estimate; tune via searchCallEstimateCny)`,siteListDisplay:`Relay lists`,siteListDisplayHint:`Hide "unidentified" placeholder rows in the relay quota list`,liveCostBar:`Live cost capsule`,liveCostBarHint:`Live cost bar beside the composer; hover for details`,liveCostBarPosition:`Position`,liveCostBarPosBelow:`Below composer`,liveCostBarPosAbove:`Above composer`,liveCostBarPosToolbar:`Inside composer`,exportCsvSite:`By site CSV`,panelRelayQuota:`Relay quotas`,relayBalance:`Balance`,relayNoQuota:`No quota`,relayWindowUsed:`used`,relayKindNewApi:`New API`,relayKindSub2Api:`Sub2API`,relayKindUnknown:`Unknown`},At={"智谱 AI":`Zhipu AI`,阿里通义:`Alibaba Qwen`,字节豆包:`ByteDance Doubao`,月之暗面:`Moonshot AI`,小米:`Xiaomi`,百度文心:`Baidu ERNIE`,腾讯混元:`Tencent Hunyuan`,零一万物:`01.AI`,阶跃星辰:`StepFun`,科大讯飞:`iFlytek Spark`,商汤:`SenseNova`,百川智能:`Baichuan`,"小米 Token Plan(海外)":`Xiaomi Token Plan (Global)`,"小米 Token Plan(国内)":`Xiaomi Token Plan (CN)`,"小米 Token Plan(新加坡)":`Xiaomi Token Plan (SG)`,"火山引擎 Token Plan":`Volcengine Token Plan`,"火山方舟 Token Plan":`Volcengine Ark Token Plan`,"豆包 Token Plan":`Doubao Token Plan`,"百度文心 Plan":`Baidu ERNIE Plan`,"MiniMax Token Plan(国内)":`MiniMax Token Plan (CN)`};function jt(e,t){return t===`en`?At[e]??e:e}let Mt={DeepSeek:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M35.7 9.9C35.3 9.8 35.2 10.1 35 10.2C34.9 10.3 34.9 10.4 34.8 10.4C34.3 10.9 33.7 11.3 33 11.2C31.9 11.2 30.9 11.5 30.1 12.4C29.9 11.3 29.3 10.7 28.4 10.3C28 10.1 27.5 9.9 27.1 9.4C26.9 9.1 26.9 8.8 26.7 8.4C26.7 8.2 26.6 8 26.4 7.9C26.1 7.9 26 8.1 25.9 8.3C25.5 9.1 25.3 9.9 25.3 10.8C25.3 12.7 26.2 14.2 27.8 15.3C27.9 15.4 28 15.5 27.9 15.7C27.8 16.1 27.7 16.5 27.6 16.8C27.5 17.1 27.4 17.1 27.1 17C26.3 16.7 25.5 16.1 24.8 15.4C23.7 14.3 22.7 13.1 21.4 12.2C21.1 12 20.8 11.7 20.4 11.5C19.1 10.3 20.6 9.2 21 9.1C21.3 9 21.1 8.5 19.9 8.5C18.8 8.5 17.7 8.9 16.3 9.4C16.1 9.5 15.9 9.6 15.7 9.6C14.5 9.4 13.2 9.3 11.9 9.5C9.4 9.8 7.4 11 5.9 13C4.1 15.4 3.7 18.2 4.2 21.1C4.7 24.1 6.3 26.6 8.7 28.6C11.2 30.7 14 31.7 17.3 31.5C19.2 31.4 21.4 31.1 23.9 29C24.6 29.3 25.2 29.4 26.3 29.5C27.1 29.6 27.9 29.5 28.6 29.3C29.6 29.1 29.5 28.2 29.1 28.1C26.3 26.7 26.9 27.3 26.3 26.8C27.8 25.1 30 23.3 30.8 17.5C30.9 17 30.8 16.7 30.8 16.4C30.8 16.1 30.9 16.1 31.1 16C31.9 15.9 32.6 15.7 33.2 15.4C35.1 14.4 35.8 12.7 36 10.7C36 10.4 36 10.1 35.7 9.9ZM19.4 27.9C16.7 25.8 15.3 25 14.7 25.1C14.2 25.1 14.3 25.7 14.4 26.1C14.6 26.5 14.7 26.7 14.9 27.1C15.1 27.3 15.2 27.6 14.8 27.9C13.9 28.4 12.3 27.7 12.2 27.6C10.4 26.6 8.9 25.2 7.8 23.2C6.8 21.4 6.2 19.4 6.1 17.3C6.1 16.7 6.2 16.6 6.8 16.5C7.4 16.3 8.1 16.3 8.8 16.4C11.6 16.8 14.1 18.1 16.1 20.1C17.2 21.3 18.1 22.6 19 24C20 25.4 21 26.8 22.3 27.9C22.8 28.2 23.2 28.5 23.5 28.8C22.4 28.9 20.7 28.9 19.4 27.9ZM20.8 19.4C20.8 19.3 20.8 19.2 20.8 19.2C20.9 19.1 20.9 19.1 21 19C21 19 21.1 19 21.1 19C21.2 18.9 21.3 19 21.3 19C21.4 19 21.5 19.1 21.5 19.1C21.6 19.2 21.6 19.3 21.6 19.4C21.6 19.4 21.6 19.5 21.6 19.5C21.5 19.6 21.5 19.6 21.5 19.6C21.4 19.7 21.4 19.7 21.3 19.7C21.3 19.8 21.2 19.8 21.2 19.8C21.1 19.8 21.1 19.8 21 19.7C21 19.7 20.9 19.7 20.9 19.6C20.9 19.6 20.8 19.6 20.8 19.5C20.8 19.5 20.8 19.4 20.8 19.4ZM24.9 21.5C24.7 21.6 24.4 21.7 24.1 21.7C23.8 21.7 23.4 21.6 23.1 21.4C22.7 21.1 22.4 20.9 22.3 20.3C22.3 20.1 22.3 19.8 22.4 19.6C22.4 19.1 22.3 18.8 22 18.6C21.8 18.4 21.5 18.3 21.1 18.3C21 18.3 20.9 18.3 20.8 18.2C20.6 18.2 20.5 18 20.6 17.7C20.7 17.7 20.8 17.5 20.9 17.5C21.4 17.2 21.9 17.3 22.4 17.5C22.9 17.7 23.2 18 23.7 18.5C24.3 19.1 24.4 19.3 24.7 19.8C24.9 20.1 25.1 20.5 25.3 20.9C25.3 21.1 25.2 21.4 24.9 21.5Z' fill='currentColor'/%3E%3C/svg%3E`,OpenAI:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M32.8 17.3C33.2 16.3 33.3 15.2 33.2 14.2C33.1 13.2 32.7 12.1 32.3 11.2C31.4 9.8 30.2 8.7 28.8 8C27.3 7.3 25.7 7.2 24.1 7.5C23.4 6.8 22.5 6.1 21.6 5.7C20.7 5.2 19.5 5 18.5 5C16.9 5 15.3 5.5 14 6.4C12.7 7.3 11.7 8.7 11.3 10.2C10.2 10.4 9.2 10.9 8.3 11.5C7.4 12.1 6.8 13 6.2 13.8C5.4 15.2 5.1 16.8 5.3 18.4C5.5 20 6.1 21.5 7.2 22.7C6.8 23.7 6.7 24.8 6.8 25.8C6.9 26.8 7.2 27.9 7.7 28.8C8.6 30.2 9.8 31.3 11.2 32C12.7 32.7 14.3 32.8 15.9 32.5C16.6 33.2 17.5 33.9 18.4 34.3C19.3 34.8 20.5 35 21.5 35C23.1 35 24.7 34.5 26 33.6C27.3 32.7 28.2 31.3 28.7 29.8C29.8 29.6 30.8 29.2 31.6 28.5C32.5 27.9 33.2 27.1 33.7 26.2C34.5 24.8 34.8 23.2 34.6 21.6C34.4 20 33.9 18.5 32.8 17.3ZM21.6 33C20.1 33 19 32.6 17.9 31.7C17.9 31.7 18 31.6 18.1 31.6L24.1 28.2C24.3 28.1 24.4 27.9 24.5 27.8C24.6 27.6 24.6 27.5 24.6 27.3V18.9L27.1 20.4V27.3C27.1 28.1 27 28.8 26.8 29.5C26.5 30.2 26.1 30.8 25.6 31.3C25.1 31.9 24.4 32.3 23.7 32.6C23.1 32.9 22.3 33 21.6 33ZM9.5 27.9C8.8 26.7 8.6 25.4 8.8 24.1C8.8 24.1 8.9 24.2 9 24.2L15 27.7C15.2 27.8 15.3 27.8 15.5 27.8C15.7 27.8 15.9 27.8 16 27.7L23.3 23.5V26.4L17.2 29.9C16.6 30.3 15.9 30.5 15.1 30.6C14.4 30.7 13.7 30.7 13 30.5C11.5 30.1 10.2 29.2 9.5 27.9ZM7.9 14.8C8.6 13.7 9.6 12.9 10.8 12.4V19.5C10.8 19.7 10.8 19.9 10.9 20C11 20.2 11.1 20.3 11.3 20.4L18.6 24.6L16.1 26.1L10.1 22.6C9.4 22.3 8.9 21.8 8.4 21.2C8 20.6 7.6 20 7.4 19.3C7.1 17.8 7.2 16.2 7.9 14.8ZM28.6 19.6L21.3 15.4L23.8 13.9L29.8 17.4C30.8 17.9 31.5 18.7 32 19.6C32.5 20.6 32.7 21.6 32.7 22.7C32.6 23.8 32.2 24.8 31.5 25.6C30.9 26.5 30 27.1 29 27.5V20.4C29 20.2 29 20 28.9 19.9C28.9 19.9 28.8 19.7 28.6 19.6ZM31.2 15.9C31.2 15.9 31.1 15.8 31 15.8L25 12.3C24.8 12.2 24.7 12.2 24.5 12.2C24.3 12.2 24.1 12.2 24 12.3L16.7 16.5V13.6L22.8 10.1C23.7 9.5 24.8 9.3 25.9 9.3C26.9 9.3 28 9.7 28.9 10.3C29.7 11 30.5 11.8 30.9 12.8C31.2 13.7 31.3 14.8 31.2 15.9ZM15.4 21.1L12.9 19.6V12.6C12.9 11.6 13.2 10.4 13.7 9.6C14.3 8.7 15.1 8 16.1 7.5C17 7.1 18.1 6.9 19.2 7.1C20.2 7.2 21.2 7.6 22.1 8.3C22.1 8.3 22 8.4 21.9 8.4L15.9 11.8C15.7 11.9 15.6 12.1 15.5 12.2C15.4 12.4 15.4 12.5 15.4 12.7V21.1ZM16.7 18.1L20 16.3L23.3 18.1V21.9L20 23.8L16.7 21.9V18.1Z' fill='currentColor'/%3E%3C/svg%3E`,Google:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M37 20C27.9 20.6 20.6 27.9 20 37H20C19.4 27.9 12.1 20.6 3 20V20C12.1 19.4 19.4 12.1 20 3H20C20.6 12.1 27.9 19.4 37 20V20Z' fill='currentColor'/%3E%3C/svg%3E`,"智谱 AI":`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.1 7.5L17.4 11.2H5.8L8.5 7.5H20.1H20.1ZM34.1 28.8L31.3 32.5H19.8L22.5 28.8H34.1ZM35 7.5L16.6 32.5H5L23.4 7.5H35Z' fill='currentColor'/%3E%3C/svg%3E`,腾讯混元:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18.1 25.2C19.6 26.8 21.1 28.1 22.7 29.2L21.5 30.8C19.9 29.7 18.3 28.3 16.7 26.6C17.1 26.1 17.6 25.7 18.1 25.2ZM10 2.7C11.8 1.7 13.8 2.2 15.6 3.3C17.5 4.4 19.5 6.2 21.3 8.3L19.7 9.6C18 7.6 16.2 6 14.6 5.1C13 4.1 11.8 4 11 4.5C10 5 9.4 6.5 9.8 9.2C9.9 9.8 10 10.4 10.2 11.1C11.6 10.9 13.1 10.9 14.6 10.9C17.7 10.9 20.5 11.2 22.8 11.7L22.8 11.7C23.2 11.8 23.6 11.9 24 12C24 12 24 12 24 12C24.7 12.2 25.3 12.4 25.9 12.6C28.6 13.7 30.6 15.5 30.6 17.9C30.6 19.9 29.1 21.4 27.3 22.5C25.4 23.6 22.9 24.3 20.1 24.8L19.8 22.9C22.4 22.4 24.7 21.7 26.3 20.8C27.9 19.8 28.6 18.8 28.6 17.9C28.6 16.8 27.7 15.5 25.1 14.5C24.6 14.3 23.9 14 23.2 13.8C22.7 15.1 22 16.4 21.3 17.7C18.9 21.7 16.4 24.8 14.1 26.6C11.8 28.4 9.2 29.3 7.2 28.1C5.4 27 4.8 25 4.8 22.9C4.9 20.7 5.5 18.1 6.4 15.5L8.3 16.2C7.4 18.7 6.9 21 6.8 22.9C6.8 24.8 7.4 25.8 8.2 26.3C9.1 26.9 10.7 26.7 12.8 25C13.3 24.7 13.8 24.2 14.3 23.7C13.4 22.6 12.6 21.4 11.9 20.1C9.6 16.1 8.2 12.4 7.8 9.4C7.4 6.5 7.9 3.9 10 2.7ZM14.6 12.9C13.3 12.9 12 12.9 10.8 13.1C11.4 14.9 12.4 16.9 13.6 19.1C14.3 20.2 15 21.3 15.7 22.3C17 20.8 18.3 18.9 19.5 16.7C20.2 15.6 20.7 14.5 21.2 13.4C19.3 13.1 17.1 12.9 14.6 12.9ZM6.2 11.8C6.4 12.5 6.6 13.1 6.8 13.8C4.9 14.2 3.1 14.8 1.5 15.5L0.7 13.7C2.3 13 4.2 12.3 6.2 11.8ZM24.9 3.6L25.9 3.7C25.7 5.7 25.3 7.8 24.6 10.1C24.2 9.9 23.7 9.8 23.2 9.7C23 9.7 22.8 9.7 22.7 9.6C23.3 7.5 23.7 5.4 23.9 3.5L24.9 3.6Z' fill='currentColor'/%3E%3C/svg%3E`,MiniMax:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.9 9.2C17.9 8.6 17.4 8.1 16.8 8.1C16.2 8.1 15.7 8.6 15.7 9.2V27.6C15.7 29.1 14.5 30.2 13.1 30.2C11.7 30.2 10.5 29.1 10.5 27.6V15.8C10.5 15.2 10 14.7 9.4 14.7C8.8 14.7 8.3 15.2 8.3 15.8V20.8C8.3 22.3 7.1 23.4 5.7 23.4C4.3 23.4 3.1 22.3 3.1 20.8V19C3.1 18.6 3.4 18.3 3.8 18.3C4.3 18.3 4.6 18.6 4.6 19V20.8C4.6 21.4 5.1 21.9 5.7 21.9C6.3 21.9 6.8 21.4 6.8 20.8V15.8C6.8 14.4 8 13.2 9.4 13.2C10.8 13.2 12 14.4 12 15.8V27.6C12 28.3 12.5 28.8 13.1 28.8C13.7 28.8 14.2 28.3 14.2 27.6V20.4V9.2C14.2 7.8 15.3 6.6 16.8 6.6C18.2 6.6 19.3 7.8 19.3 9.2V24.5C19.3 24.9 19 25.2 18.6 25.2C18.2 25.2 17.9 24.9 17.9 24.5V9.2ZM31.5 13.2C30.1 13.2 28.9 14.4 28.9 15.8V25.7C28.9 26.3 28.5 26.8 27.8 26.8C27.2 26.8 26.7 26.3 26.7 25.7V9.2C26.7 7.8 25.6 6.6 24.1 6.6C22.7 6.6 21.6 7.8 21.6 9.2V30.1C21.6 30.8 21.1 31.3 20.5 31.3C19.8 31.3 19.3 30.8 19.3 30.1V27.5C19.3 27.1 19 26.8 18.6 26.8C18.2 26.8 17.9 27.1 17.9 27.5V30.1C17.9 31.6 19 32.7 20.5 32.7C21.9 32.7 23 31.6 23 30.1V9.2C23 8.6 23.5 8.1 24.1 8.1C24.8 8.1 25.3 8.6 25.3 9.2V25.7C25.3 27.1 26.4 28.3 27.8 28.3C29.3 28.3 30.4 27.1 30.4 25.7V15.8C30.4 15.2 30.9 14.7 31.5 14.7C32.1 14.7 32.6 15.2 32.6 15.8V24.5C32.6 24.9 33 25.2 33.4 25.2C33.8 25.2 34.1 24.9 34.1 24.5V15.8C34.1 14.4 33 13.2 31.5 13.2Z' fill='currentColor'/%3E%3C/svg%3E`,阿里通义:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M38 23C33.8 25.3 29.6 27.4 24.9 28.3C23.8 28.5 22.6 28.5 21.6 28.4C20.6 28.2 20.1 27.3 20.4 26.4C20.8 25.5 21.2 24.6 21.8 23.9C23.1 22.3 24.5 20.8 25.8 19.3C26.6 18.3 27.3 17.3 28 16.2C28.4 15.4 28.2 14.5 27.4 14.1C26.1 13.5 24.6 13 23.2 12.5C23 12.4 22.8 12.6 22.5 12.7C22.9 13.1 23.2 13.4 23.6 13.7C19.3 14.4 15.3 15.5 11.4 16.9C11.4 17 11.4 17 11.4 17C12 17.9 11.7 18.6 10.9 19.1C10.6 19.4 10.3 19.6 10 19.9C12.6 20.7 14.9 20.2 17.1 18.8C16.9 18.6 16.8 18.5 16.7 18.3C17.5 18.4 18 18.9 18 19.6C18.1 19.7 18 19.9 17.9 20C17.8 19.9 17.6 19.8 17.5 19.6C17.5 19.5 17.5 19.4 17.4 19.3C14.8 21 12 21.4 9 20.5C9 21.1 8.9 21.6 9 22.1C9 22.6 8.8 22.8 8.4 23C7.6 23.5 6.6 24.1 5.9 24.8C5 25.7 5.3 26.8 6.5 27.2C7.9 27.7 9.3 27.7 10.8 27.6C12.4 27.3 14.1 27.1 15.9 26.8C13.8 27.8 11.7 28.5 9.4 28.8C7.9 29 6.3 29.1 4.8 28.7C2.6 28.1 1.6 26.4 2.2 24.3C2.7 22.2 4 20.6 5.4 19.1C10.1 14.1 16.1 11.5 23 11C24.6 10.9 26.2 11.1 27.7 11.8C29.8 12.8 30.7 14.8 29.7 16.8C29 18.2 28.1 19.4 27.1 20.7C26.2 21.9 25.2 23 24.2 24.2C23.9 24.5 23.7 24.9 23.5 25.3C23.1 26 23.3 26.5 24.2 26.4C26 26.3 27.9 26.1 29.6 25.7C32.2 25 34.7 24.1 37.3 23.3C37.5 23.2 37.8 23.1 38 23V23Z' fill='currentColor'/%3E%3C/svg%3E`,小米:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.4 5C13.6 5.2 11.4 5.8 9.5 7.1C8.1 8 7.1 9.1 6.4 10.7C5.6 12.4 5.2 14.3 5.1 17.7C4.9 21.6 5.2 25.5 5.8 27.5C6.3 29.4 7.1 30.8 8.4 32C10 33.5 11.7 34.3 14.5 34.7C17 35 22.8 35.1 25.3 34.7C28.4 34.3 30.4 33.4 32 31.7C32.8 30.9 33.2 30.4 33.7 29.3C34.5 27.6 34.8 25.8 35 22.2C35.1 19.7 35 16.1 34.7 14.4C34.1 10.5 32.5 7.9 29.5 6.4C28 5.6 25.7 5.2 22.5 5C20.1 4.9 19.8 4.9 17.4 5ZM21.1 14.4C22.4 14.7 23 15.1 23.4 16C23.9 17 24 17.7 24 21.9V25.8L22.5 25.8L21.1 25.7L21 21.9C21 17.8 21 17.6 20.4 17.2C19.9 16.8 19.4 16.7 16.6 16.7H13.9L13.8 21.2L13.8 25.7H11L10.9 20C10.9 15.5 10.9 14.3 11 14.2C11.1 14.2 13.2 14.2 15.8 14.2C19.5 14.2 20.5 14.3 21.1 14.4ZM28.9 14.3C29 14.5 29 25.4 29 25.7C29 25.8 28.3 25.8 27.5 25.8L26.1 25.7L26.1 20.1C26.1 16 26.1 14.4 26.2 14.3C26.3 14.2 26.6 14.2 27.6 14.2C28.7 14.2 28.9 14.2 28.9 14.3ZM18.9 22.2V25.8L17.5 25.8L16 25.7L15.9 22.3C15.9 20.5 15.9 18.9 16 18.8C16 18.7 16.4 18.7 17.5 18.7H18.9V22.2Z' fill='currentColor'/%3E%3C/svg%3E`,字节豆包:`data:image/svg+xml,%3Csvg fill='currentColor' fill-rule='evenodd' height='1em' style='flex:none;line-height:1' viewBox='0 0 24 24' width='1em' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.3 5.4L3.1 21.7a.215.2 0 0.2.261h8.3a.214.2 0 0.2-.261L7.7 5.4a.214.2 0 00-.41 0z' fill-opacity='.5'%3E%3C/path%3E%3Cpath clip-rule='evenodd' d='M4.6 16.2l-1.4 5.6a.214.2 0 0.2.261h2.4-4.6a.214.2 0 01-.214-.26l2.3-9a.214.2 0 1.4 0l.864 3.4z'%3E%3C/path%3E%3Cpath d='M14.4.15a.214.2 0 00-.41 0L8.4 21.7a.214.2 0 0.2.261H19.9a.214.2 0 0.2-.261L14.4.151z' fill-opacity='.5'%3E%3C/path%3E%3Cpath clip-rule='evenodd' d='M16.7 22h3.2a.215.2 0 0.2-.262l-1.8-7 1.2-4.6a.214.2 0 1.4 0l3 11.6a.214.2 0 01-.214.3h-5.9z'%3E%3C/path%3E%3Cpath d='M10.3 7.7L6.7 21.7a.214.2 0 0.2.264h7.2a.216.2 0 0.2-.166.2.216 0 000-.098L10.7 7.7a.214.2 0 00-.409 0z'%3E%3C/path%3E%3C/svg%3E`,月之暗面:`data:image/svg+xml,%3Csvg viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M26 4a16 16 0 1 0 10 28A18 18 0 0 1 26 4z' fill='currentColor'/%3E%3C/svg%3E`};function Nt(e){return Mt[e]}let Pt=`dsh-billing-peak-alert-v1`,Ft={enabled:!1,leadMin:2,position:`bottom-right`,webNotify:!0,mode:`both`};function It(){try{let e=localStorage.getItem(Pt);if(e===null)return{...Ft};let t=JSON.parse(e),n=t.mode===`peak`||t.mode===`offPeak`?t.mode:Ft.mode,r=t.position===`center`?`center`:`bottom-right`;return{enabled:t.enabled===!0,leadMin:typeof t.leadMin==`number`&&Number.isFinite(t.leadMin)?Math.min(30,Math.max(1,Math.round(t.leadMin))):Ft.leadMin,position:r,webNotify:t.webNotify!==!1,mode:n}}catch{return{...Ft}}}function Lt(e){try{localStorage.setItem(Pt,JSON.stringify(e))}catch{}}function Rt(e,t,n){if(!t.enabled)return null;let r=z(e,t.leadMin*6e4);return r===null||t.mode===`peak`&&r.entering!==`peak`||t.mode===`offPeak`&&r.entering!==`offPeak`||r.atMs===n?null:r}function zt({hit:e,config:t,t:n,onDismiss:i}){let[o,s]=(0,r.useState)(()=>Date.now());if((0,r.useEffect)(()=>{let e=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,r.useEffect)(()=>{o>=e.atMs&&i()},[o,e.atMs,i]),o>=e.atMs)return null;let l=Math.max(1,Math.round((e.atMs-o)/6e4)),u=e.entering,d=n(u===`peak`?`tierPeak`:`tierOff`),f=n(u===`peak`?`peakAlertDescPeak`:`peakAlertDescOff`),p=u===`peak`;return(0,a.jsxs)(`div`,{className:c(j.peakCard,p?j.peakCardPeak:j.peakCardOff,t.position===`center`?j.peakCardCenter:j.peakCardCorner),"data-testid":`billing-peak-alert`,role:`alert`,children:[(0,a.jsxs)(`div`,{className:j.peakHead,children:[(0,a.jsxs)(`span`,{className:c(j.peakTag,p?j.peakTagPrimary:j.peakTagSuccess),children:[(0,a.jsx)(`span`,{className:c(j.peakDot,p?j.peakDotPrimary:j.peakDotSuccess),"aria-hidden":`true`}),d]}),(0,a.jsx)(`button`,{type:`button`,className:j.peakClose,onClick:i,"aria-label":n(`close`),children:`×`})]}),(0,a.jsxs)(`div`,{className:c(j.peakCount,p?j.peakCountPrimary:j.peakCountSuccess),children:[l,`min`]}),(0,a.jsx)(`p`,{className:j.peakDesc,children:f})]})}let Bt=[{id:`overview`,labelKey:`tabOverview`},{id:`providers`,labelKey:`tabProviders`},{id:`token`,labelKey:`tabToken`},{id:`trends`,labelKey:`tabTrends`},{id:`pricing`,labelKey:`tabPricing`},{id:`settings`,labelKey:`tabSettings`}];function Vt(e){if(e!==void 0)return e.split(/[\\/]/).filter(Boolean).pop()??e}let Ht=[50,80,100],Ut={checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]},Wt={DeepSeek:[`deepseek`],"智谱 AI":[`zhipu`,`glm`,`z.ai`],阿里通义:[`qwen`,`tongyi`,`dashscope`,`aliyun`],字节豆包:[`doubao`,`volcengine`,`ark`],月之暗面:[`moonshot`,`kimi`],小米:[`xiaomi`,`mi`,`mimo`],MiniMax:[`minimax`],百度文心:[`ernie`,`wenxin`,`qianfan`,`baidu`],腾讯混元:[`hunyuan`,`tencent`],零一万物:[`01.ai`,`lingyi`,`yi`],阶跃星辰:[`step`,`stepfun`,`step-3.7`],科大讯飞:[`spark`,`xfyun`,`iflytek`],商汤:[`sensenova`,`sensetime`],百川智能:[`baichuan`],OpenAI:[`openai`],Google:[`google`,`gemini`],xAI:[`xai`,`grok`],Meta:[`meta`,`llama`],Anthropic:[`claude`,`anthropic`],"Mistral AI":[`mistral`,`ministral`,`devstral`],Cohere:[`cohere`,`command`],美团:[`longcat`,`meituan`],面壁智能:[`minicpm`,`modelbest`],小红书:[`dots`,`rednote`,`xiaohongshu`]};function Q(e){return e.trim().toLowerCase().replace(/[\s_/-]+/g,``)}function Gt(e,t){if(e.length===0||t.length===0)return!1;if(e===t)return!0;let[n,r]=e.length<=t.length?[e,t]:[t,e];return n.length>=3&&r.includes(n)}function Kt(e,t){let n=Q(e),r=Q(t);if(Gt(n,r))return!0;let i=Wt[e];return i!==void 0&&i.some(e=>Gt(Q(e),r))}function qt(e){let t=e.trim().toLowerCase(),n=t.replace(/[\s_/-]+/g,``);if(n.length!==0){for(let[e,n]of Object.entries(Wt))for(let r of n){let n=Q(r);if(n.length!==0&&(t===n||t.startsWith(`${n}-`)||t.startsWith(`${n}/`)||t.startsWith(`${n}_`)||t.includes(`${n}-`)||t.includes(`${n}/`)||t.includes(`${n}_`)))return e}for(let[e,t]of Object.entries(Wt))for(let r of t){let t=Q(r);if(!(t.length<4)&&n.includes(t))return e}}}let Jt={"kimi-coding":`月之暗面`,"zai-coding-cn":`智谱 AI`,"zai-coding":`智谱 AI`,"qwen-token-plan":`阿里通义`,"qwen-token-plan-cn":`阿里通义`,"xiaomi-token-plan-ams":`小米`,"xiaomi-token-plan-cn":`小米`,"xiaomi-token-plan-sgp":`小米`,"volcengine-token-plan":`字节豆包`,"ark-token-plan":`字节豆包`,"doubao-token-plan":`字节豆包`,ernie:`百度文心`,baidu:`百度文心`,wenxin:`百度文心`,minimax:`MiniMax`,"minimax-cn":`MiniMax`,"minimax-token-plan":`MiniMax`,"minimax-token-plan-cn":`MiniMax`,"hunyuan-token-plan":`腾讯混元`,"tencent-token-plan":`腾讯混元`,"hy-token-plan":`腾讯混元`,"xinghuo-token-plan":`讯飞星火`,"xfyun-coding":`讯飞星火`,"spark-coding":`讯飞星火`,"huawei-token-plan":`华为云`,"pangu-token-plan":`华为云`,"huawei-maas-token-plan":`华为云`,"volcengine-agent-plan":`字节豆包`,"ark-agent-plan":`字节豆包`,"baidu-token-plan":`百度文心`,"ernie-token-plan":`百度文心`,"wenxin-token-plan":`百度文心`,opencode:`OpenCode`,"opencode-go":`OpenCode`};function Yt(e){let t=Jt[e];return t===void 0?qt(e)??e:t}function Xt(e,t){let n=Object.keys(e).filter(e=>e<=t).sort().slice(-7);return n.length===0?0:n.reduce((t,n)=>t+(e[n]?.cost??0),0)/n.length}function Zt(e,t,n){let r=Object.keys(e).filter(e=>e.startsWith(t)),[i,a]=t.split(`-`).map(Number),o=new Date(i,a,0).getDate(),s=r.length>0?r.reduce((t,n)=>t+(e[n]?.cost??0),0)/r.length:Xt(e,n);return s<=0?0:s*o}function Qt(e){let t=fe();if(t===void 0||e.byDayModels===void 0)return e;let n=be().rate,r=e.byDayModelsSite!==void 0,i={},a={},o=new Map,s=0,c=e=>t.some(t=>t.origin!==void 0&&t.origin!==``&&(t.key===e||V(t.key)===V(e))),l=(e,t,r)=>{if(e===void 0)return r;let i=Math.min(t.cacheHit,t.cacheMiss+t.cacheHit),a=r=>{let a=(t.cacheMiss*r.input+i*r.cacheHit+t.output*r.output)/1e6;return e.currency===`USD`?a*n:a};return e.offPeak===void 0?a(e):a(e)*I+a(e.offPeak)*.5};for(let[t,n]of Object.entries(e.byDayModels)){let u=0,d={};for(let[i,a]of Object.entries(n)){let n=me(i)??ge(i),s=r&&c(i),f;if((n!==void 0||s)&&s&&e.byDayModelsSite?.[t]?.[i]!==void 0){let r=0;for(let[a,o]of Object.entries(e.byDayModelsSite[t][i])){let e=a.startsWith(`site:`)?a.slice(5):void 0,t=e===void 0?void 0:me(i,e);r+=l(t??n,o,o.cost)}f=r}else f=l(n,a,a.cost);u+=f,d[i]={...a,cost:f},o.set(i,(o.get(i)??0)+f)}let f=e.byDay[t];f!==void 0&&(i[t]={...f,cost:u}),a[t]=d,s+=u}return{...e,total:{...e.total,cost:s},byDay:i,byDayModels:a,byModel:Object.fromEntries(Object.entries(e.byModel).map(([e,t])=>{let n=o.get(e);return[e,n===void 0?t:{...t,cost:n}]}))}}function $t(e){return Object.keys(e).length}function en(e,t=Date.now()){let n=0,r=new Date(t);for(;$(r.getTime())in e;)n+=1,r.setDate(r.getDate()-1);return n}function tn(e){let t=[];for(let n=6;n>=0;--n){let r=new Date;r.setDate(r.getDate()-n);let i=$(r.getTime());t.push({date:i,cost:e[i]?.cost??0})}return t}function nn(e,t){return e.checked?e.okProviders.some(e=>Kt(t,e))?j.healthOk:e.badProviders.some(e=>Kt(t,e))?j.healthBad:j.healthIdle:j.healthIdle}function rn(e,t){switch(e){case`ok`:return``;case`not-configured`:return t(`subscriptionNotConfigured`);case`unauthorized`:return t(`subscriptionUnauthorized`);case`rate-limited`:return t(`subscriptionRateLimited`);case`invalid-response`:return t(`subscriptionInvalid`);default:return t(`subscriptionUnavailable`)}}function an(e,t){switch(e){case`session`:return t(`subscriptionSession`);case`weekly`:return t(`subscriptionWeekly`);case`monthly`:return t(`subscriptionMonthly`);case`billing`:return t(`subscriptionBilling`)}}function on(e,t){switch(e){case`new-api`:return t(`relayKindNewApi`);case`sub2api`:return t(`relayKindSub2Api`);default:return t(`relayKindUnknown`)}}let sn={"new-api":j.siteKindSite,sub2api:j.siteKindDirect,unknown:j.siteKindUnknown},cn=3e4;function $(e=Date.now()){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function ln(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}let un=[`#3b82f6`,`#06b6d4`,`#8b5cf6`,`#f59e0b`,`#10b981`,`#ef4444`,`#ec4899`,`#6366f1`,`#f97316`,`#14b8a6`],dn={total:{calls:0,input:0,output:0,cacheHit:0,cacheMiss:0,cost:0,reasoning:0},byModel:{},byDay:{},byDayModels:{}};async function fn(){try{let e=await fetch(`/api/billing/usage-stats`);if(!e.ok)return null;let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n||!(`total`in n))return null;let r=n,i=e=>typeof e==`object`&&!!e;return{total:r.total??dn.total,byModel:r.byModel??{},byDay:r.byDay??{},...r.byDayModels===void 0?{}:{byDayModels:r.byDayModels},...i(r.byDayModelsSite)?{byDayModelsSite:r.byDayModelsSite}:{},...r.updatedAt===void 0?{}:{updatedAt:r.updatedAt},...typeof r.budget==`number`?{budget:r.budget}:{},...typeof r.lowBalanceThreshold==`number`?{lowBalanceThreshold:r.lowBalanceThreshold}:{},...Array.isArray(r.bySession)?{bySession:r.bySession}:{},...Array.isArray(r.byTurn)?{byTurn:r.byTurn}:{},...Array.isArray(r.byWorkspace)?{byWorkspace:r.byWorkspace}:{},...i(r.bySite)?{bySite:r.bySite}:{},...i(r.byTier)?{byTier:r.byTier}:{},...i(r.byTool)?{byTool:r.byTool}:{},...Array.isArray(r.unpricedModels)?{unpricedModels:r.unpricedModels}:{},...typeof r.staleLedgerSessions==`number`?{staleLedgerSessions:r.staleLedgerSessions}:{},...typeof r.searchCallEstimateCny==`number`?{searchCallEstimateCny:r.searchCallEstimateCny}:{},...r.byRole!==null&&typeof r.byRole==`object`?{byRole:r.byRole}:{},...r.perf!==null&&typeof r.perf==`object`&&r.perf.byModel!==null&&typeof r.perf.byModel==`object`&&r.perf.byHourModel!==null&&typeof r.perf.byHourModel==`object`?{perf:r.perf}:{},...typeof r.pluginVersion==`string`?{pluginVersion:r.pluginVersion}:{}}}catch{return null}}let pn=!1;async function mn(e=0){try{let t=await fetch(`/api/billing/pricing`);if(!t.ok){pn=!1;return}let n=await t.text(),r=JSON.parse(n);if(typeof r!=`object`||!r||!(`source`in r)){pn=!1;return}let i=r;if(i.source===`builtin`&&e<3){if(e===0){if(pn)return;pn=!0}setTimeout(()=>{mn(e+1)},2e3);return}pn=!1,_e(i)}catch{pn=!1}}async function hn(){try{let e=await fetch(`/api/billing/balance`);if(!e.ok)return{balances:[]};let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n)return{balances:[]};let r=n;return{balances:Array.isArray(r.balances)?r.balances:[],...r.reconcile===void 0?{}:{reconcile:r.reconcile}}}catch{return{balances:[]}}}async function gn(){let e=await fetch(`/api/billing/subscriptions`);if(!e.ok)throw Error(`subscriptions HTTP ${String(e.status)}`);let t=await e.text(),n=JSON.parse(t);if(typeof n==`object`&&n&&`quotas`in n)return n.quotas;throw Error(`subscriptions: invalid response`)}async function _n(){let e=await fetch(`/api/billing/relay-quotas`);if(!e.ok)throw Error(`relay-quotas HTTP ${String(e.status)}`);let t=await e.text(),n=JSON.parse(t);if(typeof n==`object`&&n&&`quotas`in n)return n.quotas;throw Error(`relay-quotas: invalid response`)}async function vn(){try{let e=await fetch(`/api/billing/usage-tool`);if(!e.ok)return;let t=JSON.parse(await e.text());return typeof t.enabled==`boolean`?t.enabled:void 0}catch{return}}async function yn(e){try{let t=await fetch(`/api/billing/usage-tool`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:e})});return t.ok?JSON.parse(await t.text()).ok===!0:!1}catch{return!1}}function bn(e){let{wide:t,t:n,onOpen:i,monthCost:o,todayCost:s,weekCost:l,days:u,vendorStatus:d,dash:f,floatPrefs:p,subscriptions:m,cardPrefs:h,monthTokens:g,todayTokens:_,weekTokens:v}=e,y=(0,r.useMemo)(()=>p.targets.map(e=>m.find(t=>t.provider===e)).filter(e=>e!==void 0),[p.targets,m]),[b,x]=(0,r.useState)(0),S=y.length===0?0:Math.min(b,y.length-1),C=y[S];(0,r.useEffect)(()=>{if(p.mode!==`subscription`||y.length<2)return;let e=setInterval(()=>x(e=>(e+1)%y.length),1500);return()=>clearInterval(e)},[p.mode,y.length]);let w=(0,a.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,a.jsx)(`path`,{d:`M4 7h16v11H4z`}),(0,a.jsx)(`path`,{d:`M4 10h16`}),(0,a.jsx)(`path`,{d:`M8 14h3`})]});if(!t)return(0,a.jsx)(`button`,{type:`button`,className:j.railButton,"data-testid":`billing-rail-button`,onClick:i,title:`${n(`title`)} · ${U(o)}`,children:w});let T=h.metric===`tokens`,E=u.map(e=>T?e.tokens:e.cost),ee=Math.max(...E,0),D=E.map(e=>ee>0?4+e/ee*12:4);return(0,a.jsxs)(`span`,{className:j.triggerWrap,children:[(0,a.jsxs)(`button`,{type:`button`,className:j.trigger,"data-testid":`billing-trigger`,onClick:i,title:`${n(`title`)} · ${U(o)}`,children:[(0,a.jsx)(`span`,{className:j.triggerIcon,"data-testid":`billing-trigger-icon`,children:w}),(0,a.jsxs)(`span`,{className:j.triggerMain,children:[(0,a.jsxs)(`span`,{className:j.triggerPrimary,children:[(0,a.jsx)(`span`,{className:j.triggerLabel,children:n(T?`triggerMonthTokens`:`triggerMonth`)}),T?(0,a.jsx)(`span`,{className:j.triggerMetric,"data-testid":`billing-trigger-month-tokens`,children:W(g)}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:j.triggerYen,"aria-hidden":`true`,children:U(o).charAt(0)}),(0,a.jsx)(`span`,{className:j.triggerMetric,children:U(o).slice(1)})]})]}),(0,a.jsx)(`span`,{className:j.triggerSub,"data-testid":`billing-trigger-today`,children:T?`${n(`triggerToday`)} ${W(_)} · ${n(`weekCost`)} ${W(v)}`:`${n(`triggerToday`)} ${U(s)} · ${n(`weekCost`)} ${U(l)}`})]}),(0,a.jsx)(`span`,{className:j.triggerSpark,"data-testid":`billing-trigger-spark`,"aria-hidden":`true`,children:D.map((e,t)=>(0,a.jsx)(`span`,{className:t===D.length-1?j.triggerSparkHot:j.triggerSparkBar,style:{height:`${e}px`}},u[t]?.date??String(t)))})]}),(0,a.jsx)(`span`,{className:c(j.triggerPop,p.mode===`subscription`&&j.triggerPopSubscription),"data-testid":`billing-trigger-pop`,"aria-hidden":`true`,children:p.mode===`subscription`?(0,a.jsx)(a.Fragment,{children:y.length===0?(0,a.jsx)(`span`,{className:j.triggerPopEmpty,children:n(`floatNoTargets`)}):(0,a.jsxs)(a.Fragment,{children:[C!==void 0&&(0,a.jsxs)(`div`,{className:j.floatSub,"data-testid":`billing-float-subscription`,children:[(0,a.jsxs)(`div`,{className:j.floatSubHead,children:[(0,a.jsx)(`span`,{className:j.floatSubName,children:C.displayName}),C.plan!==void 0&&(0,a.jsx)(`span`,{className:j.floatSubPlan,children:C.plan})]}),C.windows.map(e=>(()=>{let t=Math.min(100,Math.max(0,e.usedPercent)),r=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,a.jsxs)(`div`,{className:j.subscriptionWindow,children:[(0,a.jsx)(`span`,{className:j.subscriptionWindowLabel,children:an(e.kind,n)}),(0,a.jsx)(`span`,{className:j.subscriptionTrack,"aria-hidden":`true`,children:(0,a.jsx)(`span`,{className:c(j.subscriptionFill,t>=100&&j.subscriptionFillOver,t>=80&&t<100&&j.subscriptionFillWarn),style:{width:`${t}%`}})}),(0,a.jsxs)(`span`,{className:j.subscriptionMeta,children:[(0,a.jsx)(`span`,{className:c(j.subscriptionPct,r&&j.subscriptionExhausted),children:r?n(`subscriptionExhausted`):n(`subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,a.jsx)(`span`,{className:j.subscriptionReset,children:n(`subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${ln(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]}),y.length>1&&(0,a.jsx)(`span`,{className:j.triggerPopSwitcher,"data-testid":`billing-float-switcher`,children:(0,a.jsxs)(`span`,{className:j.triggerPopSwitchCount,children:[S+1,`/`,y.length]})})]})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:j.popHead,children:(0,a.jsx)(`span`,{className:j.popTitle,children:n(`popTitle`)})}),(0,a.jsxs)(`span`,{className:j.metricGrid,children:[(0,a.jsxs)(`span`,{className:j.metricCell,children:[(0,a.jsx)(`span`,{className:j.metricLabel,children:n(`monthCost`)}),(0,a.jsx)(`span`,{className:c(j.metricValue,j.metricValuePrimary),children:U(o)})]}),(0,a.jsxs)(`span`,{className:j.metricCell,children:[(0,a.jsx)(`span`,{className:j.metricLabel,children:n(`tokenTotal`)}),(0,a.jsx)(`span`,{className:j.metricValue,children:W(f.totalToken)})]}),(0,a.jsxs)(`span`,{className:j.metricCell,children:[(0,a.jsx)(`span`,{className:j.metricLabel,children:n(`input`)}),(0,a.jsx)(`span`,{className:j.metricValue,children:W(f.input)})]}),(0,a.jsxs)(`span`,{className:j.metricCell,children:[(0,a.jsx)(`span`,{className:j.metricLabel,children:n(`output`)}),(0,a.jsx)(`span`,{className:j.metricValue,children:W(f.output)})]}),(0,a.jsxs)(`span`,{className:j.metricCell,children:[(0,a.jsx)(`span`,{className:j.metricLabel,children:n(`cacheHit`)}),(0,a.jsx)(`span`,{className:c(j.metricValue,j.metricValueSuccess),children:W(f.cacheRead)})]}),(0,a.jsxs)(`span`,{className:j.metricCell,children:[(0,a.jsx)(`span`,{className:j.metricLabel,children:n(`calls`)}),(0,a.jsx)(`span`,{className:j.metricValue,children:f.calls.toLocaleString()})]})]}),(0,a.jsxs)(`span`,{className:j.popModel,children:[(0,a.jsx)(`span`,{className:j.popModelLabel,children:n(`popTodayModel`)}),d.direct!==void 0||d.sub!==void 0?(0,a.jsxs)(a.Fragment,{children:[d.direct!==void 0&&(0,a.jsxs)(`span`,{className:j.popModelRow,children:[(0,a.jsx)(`span`,{className:c(j.popDot,j.popDotDirect),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:j.popTagPrimary,children:n(`popDirectLead`)}),(0,a.jsx)(`span`,{className:j.popModelName,children:d.direct.name}),(0,a.jsx)(`span`,{className:c(j.popModelStatus,d.direct.low&&j.popModelStatusLow),children:d.direct.text})]}),d.sub!==void 0&&(0,a.jsxs)(`span`,{className:j.popModelRow,children:[(0,a.jsx)(`span`,{className:c(j.popDot,j.popDotSub),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:j.popTagSub,children:n(`popSubLead`)}),(0,a.jsx)(`span`,{className:j.popModelName,children:d.sub.name}),(0,a.jsx)(`span`,{className:c(j.popModelStatus,d.sub.low&&j.popModelStatusLow),children:d.sub.text})]})]}):(0,a.jsxs)(`span`,{className:j.popModelRow,children:[(0,a.jsx)(`span`,{className:c(j.popDot,j.popDotNeutral),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:j.popModelStatus,children:n(`popNoConsumption`)})]})]})]})})]})}function xn({balance:e,days:t,dailyBurn:n,money:r,t:i,onClose:o}){let s=t=>t===void 0?void 0:e.currency===`USD`?`$${t.toFixed(2)}`:r(t),c=s(e.totalBalance),l=s(e.grantedBalance),u=s(e.toppedUpBalance);return(0,a.jsxs)(`span`,{className:j.balanceDetailPop,"data-testid":`billing-balance-detail-pop`,children:[(0,a.jsxs)(`span`,{className:j.balanceDetailHead,children:[(0,a.jsx)(`span`,{className:j.balanceDetailTitle,children:e.displayName}),(0,a.jsx)(`button`,{type:`button`,className:j.balanceDetailClose,"aria-label":i(`close`),onClick:o,children:`×`})]}),(0,a.jsxs)(`span`,{className:j.balanceDetailGrid,children:[c!==void 0&&(0,a.jsx)(Sn,{label:i(`balance`),value:c}),l!==void 0&&(0,a.jsx)(Sn,{label:i(`balanceGranted`),value:l}),u!==void 0&&(0,a.jsx)(Sn,{label:i(`balanceTopped`),value:u}),(0,a.jsx)(Sn,{label:i(`balanceDaily`),value:r(n)}),(0,a.jsx)(Sn,{label:i(`balanceDaysLong`),value:`${t} ${i(`balanceDaysUnit`)}`})]})]})}function Sn({label:e,value:t}){return(0,a.jsxs)(`span`,{className:j.balanceDetailRow,children:[(0,a.jsx)(`span`,{className:j.balanceDetailLabel,children:e}),(0,a.jsx)(`span`,{className:j.balanceDetailValue,children:t})]})}function Cn({userPrices:e,onUserPrices:t,t:n}){let[i,o]=(0,r.useState)(()=>[...e]),[s,l]=(0,r.useState)(new Set),u=e=>l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),d=()=>{o(e=>e.filter((e,t)=>!s.has(t))),l(new Set)},f=(e,t)=>o(n=>n.map((n,r)=>r===e?{...n,...t}:n)),p=()=>o(e=>[...e,{key:``,input:0,cacheHit:0,output:0}]),m=e=>{let t=i[e]?.offPeak;return{input:t===void 0?``:String(t.input),cacheHit:t===void 0?``:String(t.cacheHit),output:t===void 0?``:String(t.output)}},h=(e,t,n)=>o(r=>r.map((r,i)=>{if(i!==e)return r;let a={...m(e),[t]:n},o=[a.input,a.cacheHit,a.output].some(e=>e.trim()!==``),s=[a.input,a.cacheHit,a.output].map(e=>Number(e)),c=o&&s.every(e=>Number.isFinite(e)&&e>=0)&&s.some(e=>e>0),{offPeak:l,...u}=r;return c?{...u,offPeak:{input:s[0]??0,cacheHit:s[1]??0,output:s[2]??0}}:u})),g=()=>t(i.filter(e=>e.key.trim()!==``).map(e=>({...e,key:e.key.trim(),...e.origin===void 0||e.origin.trim()===``?{}:{origin:le(e.origin.trim())}}))),_=Fe().map(e=>e.key),v=(e,t)=>o(n=>n.map((n,r)=>{if(r!==e)return n;let{currency:i,...a}=n;return t===`USD`?{...a,currency:`USD`}:a})),y=e=>Number.isFinite(e)&&e!==0?String(e):``,b=(e,t,n)=>{let r=Number(n);f(e,{[t]:Number.isFinite(r)&&r>=0?r:0})};return(0,a.jsxs)(`section`,{className:j.setCard,"data-testid":`billing-user-prices`,children:[(0,a.jsx)(`div`,{className:j.setCardHead,children:(0,a.jsxs)(`div`,{className:j.setCardMeta,children:[(0,a.jsx)(`h3`,{className:j.setCardTitle,children:n(`userPrices`)}),(0,a.jsx)(`p`,{className:j.setCardDesc,children:n(`userPricesHint`)})]})}),(0,a.jsxs)(`div`,{className:j.ctlCol,children:[(0,a.jsx)(`datalist`,{id:`billing-price-model-keys`,children:_.map(e=>(0,a.jsx)(`option`,{value:e},e))}),i.map((e,t)=>(0,a.jsxs)(`div`,{className:j.userPriceRow,"data-testid":`billing-user-price-row`,children:[(0,a.jsx)(`input`,{type:`checkbox`,className:j.userPriceCheck,"data-testid":`billing-user-price-select`,checked:s.has(t),"aria-label":n(`userPriceSelect`),onChange:()=>u(t)}),(0,a.jsxs)(`div`,{className:j.userPriceBody,children:[(0,a.jsxs)(`div`,{className:j.userPriceLineMeta,children:[(0,a.jsxs)(`div`,{className:j.userPriceField,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:n(`userPriceModel`)}),(0,a.jsx)(`input`,{className:j.userPriceInput,"data-testid":`billing-user-price-model`,type:`text`,list:`billing-price-model-keys`,value:e.key,placeholder:`flash`,"aria-label":n(`userPriceModel`),onChange:e=>f(t,{key:e.target.value})})]}),(0,a.jsxs)(`div`,{className:j.userPriceField,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:n(`userPriceSource`)}),(0,a.jsx)(`input`,{className:j.userPriceInput,"data-testid":`billing-user-price-origin`,type:`text`,value:e.origin??``,placeholder:n(`userPriceSourceHint`),"aria-label":n(`userPriceSource`),onChange:e=>f(t,{origin:e.target.value.trim()})})]}),(0,a.jsxs)(`div`,{className:j.userPriceField,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:n(`userPriceCurrency`)}),(0,a.jsxs)(`div`,{className:j.ctlGroup,children:[(0,a.jsx)(`button`,{type:`button`,className:c(j.floatModeBtn,e.currency!==`USD`&&j.floatModeBtnOn),onClick:()=>v(t,`CNY`),children:`CNY`}),(0,a.jsx)(`button`,{type:`button`,className:c(j.floatModeBtn,e.currency===`USD`&&j.floatModeBtnOn),onClick:()=>v(t,`USD`),children:`USD`})]})]})]}),(0,a.jsxs)(`div`,{className:j.userPricePriceLine,"data-testid":`billing-user-price-normal`,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:n(`userPriceNormal`)}),[`input`,`cacheHit`,`output`].map(r=>(0,a.jsx)(`input`,{className:j.userPriceInputNum,type:`number`,min:0,step:.01,placeholder:n(r===`input`?`tokenMiss`:r===`cacheHit`?`tokenHit`:`tokenOutput`),"aria-label":`${n(`userPriceNormal`)} ${n(r===`input`?`tokenMiss`:r===`cacheHit`?`tokenHit`:`tokenOutput`)}`,value:y(e[r]),onChange:e=>b(t,r,e.target.value)},r))]}),(()=>{let e=m(t);return(0,a.jsxs)(`div`,{className:j.userPricePriceLine,"data-testid":`billing-user-price-offpeak`,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:n(`userPriceOffPeak`)}),[`input`,`cacheHit`,`output`].map(r=>(0,a.jsx)(`input`,{className:j.userPriceInputNum,type:`number`,min:0,step:.01,placeholder:n(r===`input`?`tokenMiss`:r===`cacheHit`?`tokenHit`:`tokenOutput`),"aria-label":`${n(`userPriceOffPeak`)} ${n(r===`input`?`tokenMiss`:r===`cacheHit`?`tokenHit`:`tokenOutput`)}`,value:e[r],onChange:e=>h(t,r,e.target.value)},r))]})})()]})]},t)),(0,a.jsxs)(`div`,{className:j.ctlRow,children:[(0,a.jsx)(`button`,{type:`button`,className:j.exportButton,"data-testid":`billing-user-price-add`,onClick:p,children:n(`userPriceAdd`)}),(0,a.jsxs)(`button`,{type:`button`,className:j.exportButton,"data-testid":`billing-user-price-remove-selected`,disabled:s.size===0,onClick:d,children:[n(`userPriceRemoveSelected`),s.size>0?` (${s.size})`:``]}),(0,a.jsx)(`button`,{type:`button`,className:j.exportButton,"data-testid":`billing-user-price-save`,onClick:g,children:n(`userPriceSave`)})]})]})]})}function wn({stats:e,t,onClose:n,userPrices:o,onUserPrices:s,health:l,balances:u,reconcile:d,quotas:f,relayQuotas:p,currency:m,onCurrency:h,turns:g,renderSlot:_,budgetEnabled:v,budgetAmount:y,onToggleBudget:b,onBudgetAmount:x,peakConfig:S,onPeakConfig:C,onPreviewPeak:w,floatPrefs:T,onFloatPrefs:E,cardPrefs:ee,onCardPrefs:D,sitePrefs:O,onSitePrefs:te,liveCostPrefs:k,onLiveCostPrefs:A,quotasStale:ne}){let[re,ie]=(0,r.useState)(`cost`),{total:M,byModel:oe,byDay:N}=e,[P,se]=(0,r.useState)(`overview`),[ce,F]=(0,r.useState)(7),[le,ue]=(0,r.useState)(()=>{try{return window.localStorage.getItem(`dsh-billing:reconcile-dismissed`)??``}catch{return``}}),de=()=>{let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`},fe=(0,r.useCallback)(()=>{let e=de();ue(e);try{window.localStorage.setItem(`dsh-billing:reconcile-dismissed`,e)}catch{}},[]),[pe,me]=(0,r.useState)(`month`),he=(0,r.useMemo)(()=>f.filter(e=>e.status===`ok`&&e.windows.length>0).map(e=>({id:e.provider,label:e.displayName})),[f]),[ge,_e]=(0,r.useState)(),[ve,ye]=(0,r.useState)(),[I,xe]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=!0;return vn().then(t=>{e&&t!==void 0&&xe(t)}),()=>{e=!1}},[]);let Se=(0,r.useCallback)(()=>{let e=!I;xe(e),yn(e).then(t=>{t||xe(!e)})},[I]),Ce=be(),L=e=>U(m===`usd`?Re(e):e,m),we=m===`usd`?`en`:`zh`,Te=e=>jt(e,we),R=(e,n)=>e===0?t(`free`):ze(Be(e,n,m,Ce.rate),m===`usd`?`USD`:`CNY`),z=(0,r.useMemo)(()=>_t([...g].reverse()),[g]),B={peak:e.byTier?.peak.cost??0,offPeak:e.byTier?.offPeak.cost??0},Ee=B.peak/2,De=(0,r.useMemo)(()=>{let n=e.byRole;if(n===void 0)return[];let r=n.user+n.assistant+n.tool;return r<=0?[]:[{label:t(`roleUser`),value:n.user,seg:j.shareSegUser},{label:t(`roleAssistant`),value:n.assistant,seg:j.shareSegAssistant},{label:t(`roleTool`),value:n.tool,seg:j.shareSegTool}].map(e=>({...e,pct:e.value/r*100}))},[e.byRole,t]),V=Xt(N,$()),Oe=e=>u.find(t=>Q(t.provider)===Q(e)),ke=e=>e.balance?.error===`unconfigured`&&e.models.length>0&&e.models.every(e=>e.plan),Ae=e=>{if(e===void 0)return(0,a.jsx)(`span`,{className:j.na,children:`—`});if(e.error===`unconfigured`)return t(`balanceUnconfigured`);if(e.error===`unauthorized`)return t(`balanceUnauthorized`);if(e.error===`unreachable`)return t(`balanceUnreachable`);if(e.totalBalance===void 0)return(0,a.jsx)(`span`,{className:j.na,children:`—`});let n=e.currency===`USD`?`$${e.totalBalance.toFixed(2)}`:L(e.totalBalance),r=e.currency===`USD`?e.totalBalance*Ce.rate:e.totalBalance,i=V>0?Math.floor(r/V):void 0;return(0,a.jsxs)(`span`,{className:j.balanceCell,children:[(0,a.jsx)(`span`,{children:n}),i!==void 0&&i>=0&&(0,a.jsx)(`button`,{type:`button`,className:c(j.balanceDaysBadge,i<=3&&j.balanceDaysBadgeLow),"data-testid":`billing-balance-days-badge`,title:t(`balanceDays`).replace(`{days}`,String(i)),"aria-label":`${e.displayName} ${t(`balanceDays`).replace(`{days}`,String(i))}`,onClick:()=>{_e(ge===e.provider?void 0:e.provider)},children:`?`}),ge===e.provider&&(0,a.jsx)(xn,{balance:e,days:i??0,dailyBurn:V,money:L,t,onClose:()=>{_e(void 0)}})]})},Me=M.cacheHit+M.cacheMiss>0?M.cacheHit/(M.cacheHit+M.cacheMiss)*100:0,Pe=Object.keys(N).sort(),H=$(),G=N[H]?.cost??0,He=H.slice(0,7),Ue=H.slice(0,4),K=Pe.reduce((e,t)=>e+(t.startsWith(He)?N[t]?.cost??0:0),0),q=Pe.reduce((e,t)=>e+(t.startsWith(Ue)?N[t]?.cost??0:0),0),J=(0,r.useMemo)(()=>Zt(N,He,H)+f.reduce((e,t)=>e+(t.planType===`code`?t.subscriptionAmount??0:0),0),[N,He,H,f]),Ge=(0,r.useMemo)(()=>{let e=v&&y>0?K/y*100:NaN;return{pct:Number.isFinite(e)?Math.max(0,Math.min(100,e)):q>0?Math.max(0,Math.min(100,K/q*100)):0,over:Number.isFinite(e)&&e>=100,label:t(Number.isFinite(e)?`budget`:`monthCost`)}},[v,y,K,q,t]),Ke=v&&y>0?K/y*100:0,qe=(0,r.useMemo)(()=>{let e=[];for(let t=ce-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t),e.push($(n.getTime()))}return e},[ce]),Ye=qe.at(-1)??H,Xe=(0,r.useMemo)(()=>Object.entries(N).map(([e,t])=>({date:e,value:t.cost})),[N]),Qe=$t(N),$e=en(N),Y=(0,r.useMemo)(()=>qe.map(t=>{let n={},r=e.byDayModels?.[t];if(r!==void 0)for(let[e,t]of Object.entries(r))t.cost>0&&(n[e]=t.cost);let i=N[t];return{date:t,cost:i?.cost??0,calls:i?.calls??0,byModel:n,tokens:i===void 0?0:i.input+i.output+i.cacheHit+i.cacheMiss}}),[qe,N,e.byDayModels]),X=(0,r.useMemo)(()=>Object.entries(oe).filter(([,e])=>e.calls>0).map(([e,t])=>{let n=je(e),r=n.key===`other`,i=r?qt(e):void 0,a={input:t.input,cacheHit:t.cacheHit,cacheMiss:t.cacheMiss,output:t.output};return{key:e,name:r?e:n.name,provider:i??n.provider,calls:t.calls,input:t.input,output:t.output,cacheHitRate:t.cacheHit+t.cacheMiss>0?t.cacheHit/(t.cacheHit+t.cacheMiss)*100:0,estimated:Le(n,a),plan:t.plan===!0,...t.cost>0?{actual:t.cost}:{},uncatalogued:r,estimatedPricing:n.estimated===!0,officialCalls:t.officialCalls??0,officialCost:t.officialCost??0}}).sort((e,t)=>(t.actual??t.estimated)-(e.actual??e.estimated)).map((e,t)=>({...e,color:un[t%un.length]??`#8b95a3`})),[oe]),Z=(0,r.useMemo)(()=>{let e=0,t=0,n=0;for(let r of X){let i=r.officialCost;i>0&&(e+=i),t+=r.officialCalls,n+=Math.max(0,r.calls-r.officialCalls)}let r=Math.max(0,X.reduce((e,t)=>e+(t.actual??0),0)-e);if(!(e<=0&&r<=0&&t<=0&&n<=0))return{officialCost:e,officialCalls:t,thirdCost:r,thirdCalls:n}},[X]),et=(0,r.useMemo)(()=>O.hideUnidentified?p.filter(e=>e.kind!==`unknown`):p,[p,O.hideUnidentified]),tt=(0,r.useMemo)(()=>{let e=new Map;for(let t of f){if(t.status===`not-configured`)continue;let n=Yt(t.provider),r=e.get(n);r===void 0?e.set(n,[t]):r.push(t)}let t=new Map,n=new Map;for(let t of e.keys())n.set(Q(t),t);for(let e of X){let r=e.provider;if(e.plan===!0){let t=qt(e.key);t!==void 0&&(r=t)}let i=n.get(Q(r))??r,a=t.get(i);a===void 0?t.set(i,[e]):a.push(e)}let r=[...new Set([...t.keys(),...e.keys()])].map(n=>({name:n,models:t.get(n)??[],subscriptions:e.get(n)??[],balance:Oe(n),dot:nn(l,n)})),i=new Set(r.map(e=>Q(e.name)));for(let e of u)i.has(Q(e.provider))||(e.error===void 0||e.provider.startsWith(`custom:`))&&r.push({name:e.displayName,models:[],subscriptions:[],balance:e,dot:nn(l,e.displayName)});return r.sort((e,t)=>{let n=e=>e.models.reduce((e,t)=>e+(t.actual??t.estimated),0),r=n(t)-n(e);return r===0?e.models.length===0&&t.models.length===0?0:t.models.length===0?-1:e.models.length===0?1:e.name.localeCompare(t.name,`zh`):r})},[X,f,u,l]),rt=X.reduce((e,t)=>e+t.estimated,0),it=M.cost>0?M.cost:rt,at=M.calls>0?it/M.calls:0,ot=(0,r.useMemo)(()=>X.map(e=>({key:e.key,name:e.name,color:e.color})),[X]),ct=Y.length>=2?Y.at(-2)?.cost??0:0,lt=ct>0?(G-ct)/ct*100:0;return(0,a.jsx)(i.Modal,{open:!0,onClose:n,title:t(`title`),headless:!0,className:c(j.dashboardModal,`dsh-billing-modal`),children:(0,a.jsxs)(`div`,{className:j.dashboard,"data-testid":`billing-dashboard`,children:[(0,a.jsxs)(`div`,{className:j.dashboardHead,"data-testid":`billing-dashboard-head`,children:[(0,a.jsxs)(`div`,{children:[_(`billing.dashboard.decor`,{position:`head`}),(0,a.jsxs)(`div`,{className:j.headTitleRow,children:[(0,a.jsx)(`h2`,{className:j.dashboardTitle,children:t(`title`)}),_(`billing.dashboard.decor`,{position:`headTitle`})]}),(0,a.jsxs)(`p`,{className:j.dashboardSubtitle,children:[t(`lastUpdated`),` `,Ye,e.timezone===void 0?null:` · ${e.timezone.name} (${e.timezone.offset})`]})]}),(0,a.jsxs)(`div`,{className:j.dashboardRight,children:[(0,a.jsx)(`span`,{className:j.currencyToggle,role:`group`,"aria-label":t(`currency`),children:[`cny`,`usd`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(j.currencyButton,m===e&&j.currencyButtonActive),"aria-pressed":m===e,"data-testid":`billing-currency-${e}`,title:t(e===`cny`?`currencyCny`:`currencyUsd`),onClick:()=>{h(e)},children:e===`cny`?`¥ CNY`:`$ USD`},e))}),l.checked&&(0,a.jsxs)(`span`,{className:c(j.healthBadge,l.available?j.healthBadgeOk:j.healthBadgeBad),children:[(0,a.jsx)(`span`,{className:c(j.healthDot,l.available?j.healthOk:j.healthBad),"aria-hidden":`true`}),l.available?`${l.models} 模型可用${l.failures>0?` · ${l.failures} 厂商失效`:``}`:`${l.failures} 厂商不可用`]}),(0,a.jsx)(`button`,{type:`button`,className:j.closeButton,"aria-label":t(`close`),"data-testid":`billing-close`,onClick:n,children:(0,a.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,a.jsx)(`path`,{d:`M18 6 6 18`}),(0,a.jsx)(`path`,{d:`m6 6 12 12`})]})})]})]}),(0,a.jsx)(`nav`,{className:j.tabNav,"data-testid":`billing-tab-nav`,role:`tablist`,"aria-label":t(`title`),children:Bt.map(e=>(0,a.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":P===e.id,className:c(j.tabButton,P===e.id&&j.tabButtonActive),"data-testid":`billing-tab-${e.id}`,onClick:()=>{se(e.id)},children:t(e.labelKey)},e.id))}),(0,a.jsxs)(`div`,{className:j.dashboardBody,children:[P===`overview`&&(0,a.jsxs)(`div`,{className:j.tabPanel,"data-testid":`billing-tab-panel-overview`,children:[d?.kind===`drift`&&d.spent!==void 0&&le!==de()&&(0,a.jsxs)(`div`,{className:j.reconcileNotice,"data-testid":`billing-reconcile-notice`,role:`note`,children:[(0,a.jsx)(`span`,{className:j.reconcileIcon,"aria-hidden":`true`,children:(0,a.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,a.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,a.jsx)(`line`,{x1:`12`,y1:`10`,x2:`12`,y2:`16`}),(0,a.jsx)(`line`,{x1:`12`,y1:`7.5`,x2:`12.01`,y2:`7.5`})]})}),(0,a.jsx)(`span`,{className:j.reconcileText,children:t(`reconcileDrift`).replace(`{provider}`,d.provider??``).replace(`{spent}`,L(d.spent)).replace(`{today}`,L(d.todayOfficialCost??0))}),(0,a.jsx)(`button`,{type:`button`,className:j.reconcileDismiss,"data-testid":`billing-reconcile-dismiss`,onClick:fe,children:t(`reconcileDismiss`)})]}),(0,a.jsxs)(`section`,{className:j.hero,"data-testid":`billing-hero`,children:[_(`billing.dashboard.decor`,{position:`hero`}),(0,a.jsxs)(`div`,{className:j.heroTop,children:[(0,a.jsxs)(`div`,{className:j.heroMain,children:[(0,a.jsx)(`span`,{className:j.heroLabel,children:t(`monthCost`)}),(0,a.jsxs)(`div`,{className:j.heroReadout,children:[(0,a.jsx)(`span`,{className:j.heroCurrency,"aria-hidden":`true`,children:m===`usd`?`$`:`¥`}),(0,a.jsx)(`span`,{className:j.heroValue,children:L(K).slice(1)})]}),(0,a.jsxs)(`span`,{className:j.heroMeta,children:[M.calls.toLocaleString(),` `,t(`calls`)]})]}),(0,a.jsxs)(`div`,{className:j.heroGauge,"data-testid":`billing-hero-gauge`,children:[(0,a.jsxs)(`svg`,{className:j.heroGaugeSvg,viewBox:`0 0 120 120`,"aria-hidden":`true`,children:[(0,a.jsx)(`circle`,{className:j.heroGaugeTrack,cx:`60`,cy:`60`,r:`52`}),(0,a.jsx)(`circle`,{className:c(j.heroGaugeArc,Ge.over&&j.heroGaugeArcOver),cx:`60`,cy:`60`,r:`52`,style:{strokeDasharray:`${Ge.pct/100*326.7} 326.7`}})]}),(0,a.jsxs)(`span`,{className:j.heroGaugeCenter,children:[(0,a.jsxs)(`span`,{className:c(j.heroGaugePct,Ge.over&&j.heroGaugePctOver),children:[Ge.pct.toFixed(0),`%`]}),(0,a.jsx)(`span`,{className:j.heroGaugeLabel,children:Ge.label})]})]})]}),v&&y>0&&(0,a.jsxs)(`div`,{className:j.heroBudget,"data-testid":`billing-hero-budget`,children:[(0,a.jsx)(`span`,{className:j.heroBudgetLabel,children:t(`budget`)}),(0,a.jsx)(`div`,{className:j.heroBudgetTrack,role:`progressbar`,"aria-valuenow":Math.min(Ke,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`budget`),children:(0,a.jsx)(`div`,{className:c(j.heroBudgetFill,Ke>=100&&j.heroBudgetFillOver),style:{width:`${Math.min(Ke,100)}%`}})}),(0,a.jsxs)(`span`,{className:j.heroBudgetValue,children:[L(K),` / `,L(y),` · `,Ke.toFixed(1),`%`]})]}),(0,a.jsxs)(`div`,{className:j.heroSide,children:[(0,a.jsxs)(`div`,{className:j.heroSideItem,children:[(0,a.jsx)(`span`,{className:j.heroSideLabel,children:t(`yearCost`)}),(0,a.jsx)(`span`,{className:j.heroSideValue,children:L(q)})]}),(0,a.jsxs)(`div`,{className:j.heroSideItem,children:[(0,a.jsx)(`span`,{className:j.heroSideLabel,children:t(`todayCost`)}),(0,a.jsxs)(`span`,{className:j.heroSideValue,children:[L(G),(0,a.jsxs)(`span`,{className:c(j.delta,lt>=0?j.deltaUp:j.deltaDown),children:[lt>=0?`▲`:`▼`,` `,Math.abs(lt).toFixed(1),`%`]})]})]}),J>0&&(0,a.jsxs)(`div`,{className:j.heroSideItem,children:[(0,a.jsx)(`span`,{className:j.heroSideLabel,children:t(`monthProjected`)}),(0,a.jsx)(`span`,{className:j.heroSideValue,children:L(J)})]}),J<=0&&(0,a.jsx)(`span`,{className:j.heroSideSpacer,"aria-hidden":`true`})]})]}),(e.unpricedModels?.length??0)>0&&(0,a.jsx)(`div`,{className:j.unpricedHint,"data-testid":`billing-unpriced-hint`,children:t(`unpricedHint`).replace(`{count}`,String(e.unpricedModels?.length??0))}),(e.total.searchCalls??0)>0&&(0,a.jsx)(`div`,{className:j.unpricedHint,"data-testid":`billing-search-estimate-hint`,children:t(`searchEstimateHint`).replace(`{count}`,String(e.total.searchCalls??0)).replace(`{each}`,L(e.searchCallEstimateCny??0))}),(0,a.jsxs)(`section`,{className:j.kpiGrid,"data-testid":`billing-kpi-grid`,children:[(0,a.jsxs)(`div`,{className:j.kpiTile,"data-testid":`billing-kpi-tile`,children:[(0,a.jsx)(`span`,{className:j.kpiLabel,children:t(`cacheHitRate`)}),(0,a.jsx)(`span`,{className:c(j.kpiValue,j.kpiGreen),children:Ve(Me)}),(0,a.jsxs)(`span`,{className:j.kpiDetail,children:[W(M.cacheHit),` / `,W(M.cacheHit+M.cacheMiss)]})]}),(0,a.jsxs)(`div`,{className:j.kpiTile,children:[(0,a.jsx)(`span`,{className:j.kpiLabel,children:t(`tokens`)}),(0,a.jsx)(`span`,{className:j.kpiValue,children:W(M.input+M.output)}),(0,a.jsxs)(`span`,{className:j.kpiDetail,children:[t(`inputTokens`),` `,W(M.input),` · `,t(`outputTokens`),` `,W(M.output)]})]}),(0,a.jsxs)(`div`,{className:j.kpiTile,children:[(0,a.jsx)(`span`,{className:j.kpiLabel,children:t(`avgCost`)}),(0,a.jsx)(`span`,{className:j.kpiValue,children:L(at)}),(0,a.jsxs)(`span`,{className:j.kpiDetail,children:[t(`calls`),` `,M.calls.toLocaleString()]})]}),(0,a.jsxs)(`div`,{className:j.kpiTile,children:[(0,a.jsx)(`span`,{className:j.kpiLabel,children:t(`calls`)}),(0,a.jsx)(`span`,{className:j.kpiValue,children:M.calls.toLocaleString()}),(0,a.jsxs)(`span`,{className:j.kpiDetail,children:[X.length,` `,t(`models`)]})]})]}),(0,a.jsxs)(`section`,{className:j.panel,"data-testid":`billing-panel-heatmap`,children:[(0,a.jsxs)(`div`,{className:j.panelHead,children:[(0,a.jsx)(`h3`,{className:j.panelTitle,children:t(`heatmap`)}),(0,a.jsx)(`div`,{className:j.heatmapRangeSwitch,"data-testid":`billing-heatmap-range`,role:`group`,"aria-label":t(`heatmap`),children:[`month`,`year`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(j.heatmapRangeButton,pe===e&&j.heatmapRangeButtonActive),"data-testid":`billing-heatmap-range-${e}`,"aria-pressed":pe===e,onClick:()=>{me(e)},children:t(e===`month`?`heatmapMonth`:`heatmapYear`)},e))}),(0,a.jsxs)(`span`,{className:j.panelHint,"data-testid":`billing-heatmap-summary`,children:[t(`activeDays`),` `,Qe,` · `,t(`streakDays`),` `,$e]})]}),(0,a.jsx)(pt,{days:Xe,currency:m,t,range:pe})]})]}),P===`settings`&&(0,a.jsxs)(`div`,{className:j.tabPanel,"data-testid":`billing-tab-panel-settings`,children:[(0,a.jsxs)(`section`,{className:j.setCard,"data-testid":`billing-budget`,children:[(0,a.jsxs)(`div`,{className:j.setCardHead,children:[(0,a.jsxs)(`div`,{className:j.setCardMeta,children:[(0,a.jsx)(`h3`,{className:j.setCardTitle,children:t(`budget`)}),(0,a.jsx)(`p`,{className:j.setCardDesc,children:t(`budgetHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":v,"aria-label":t(`budget`),"data-testid":`billing-budget-toggle`,className:c(j.switch,v&&j.switchOn),onClick:b,children:(0,a.jsx)(`span`,{className:j.switchKnob})})]}),v&&(0,a.jsxs)(`div`,{className:j.ctlCol,children:[(0,a.jsxs)(`div`,{className:j.ctlRow,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:t(`budgetAmount`)}),(0,a.jsxs)(`span`,{className:j.inp,"data-testid":`billing-budget-input-wrap`,children:[(0,a.jsx)(`span`,{className:j.affix,"aria-hidden":`true`,children:`¥`}),(0,a.jsx)(`input`,{className:j.budgetInput,"data-testid":`billing-budget-input`,type:`number`,min:0,step:1,value:y===0?``:y,placeholder:e.budget===void 0?`0`:String(e.budget),"aria-label":`${t(`budget`)}(${m===`usd`?`USD`:`CNY`})`,title:`${t(`budget`)}(${m===`usd`?`USD`:`CNY`})`,onChange:e=>{x(e.target.valueAsNumber)}})]})]}),y>0&&(()=>{let e=K/y*100;return(0,a.jsx)(`div`,{className:j.ctlRowStretch,children:(0,a.jsx)(`div`,{className:j.prog,role:`progressbar`,"aria-valuenow":Math.min(e,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`budget`),"data-testid":`billing-budget-track`,children:(0,a.jsx)(`div`,{className:c(j.progFill,e>=100&&j.budgetFillOver,e>=80&&e<100&&j.budgetFillWarn),style:{width:`${Math.min(e,100)}%`}})})})})(),y>0&&(0,a.jsx)(`p`,{className:j.setCardDesc,"data-testid":`billing-budget-value`,children:t(`budgetSummary`).replace(`{used}`,L(K)).replace(`{total}`,L(y))})]})]}),(0,a.jsxs)(`section`,{className:j.setCard,"data-testid":`billing-peak-alert-settings`,children:[(0,a.jsxs)(`div`,{className:j.setCardHead,children:[(0,a.jsxs)(`div`,{className:j.setCardMeta,children:[(0,a.jsx)(`h3`,{className:j.setCardTitle,children:t(`peakAlert`)}),(0,a.jsx)(`p`,{className:j.setCardDesc,children:t(`peakAlertHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":S.enabled,"aria-label":t(`peakAlert`),"data-testid":`billing-peak-alert-toggle`,className:c(j.switch,S.enabled&&j.switchOn),onClick:()=>{C({...S,enabled:!S.enabled})},children:(0,a.jsx)(`span`,{className:j.switchKnob})})]}),S.enabled&&(0,a.jsxs)(`div`,{className:j.ctlCol,children:[(0,a.jsxs)(`label`,{className:j.ctlRow,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:t(`peakAlertLeadMin`)}),(0,a.jsx)(`span`,{className:j.inp,children:(0,a.jsx)(`input`,{type:`number`,min:1,max:30,step:1,value:S.leadMin,className:j.budgetInput,"aria-label":t(`peakAlertLeadMin`),onChange:e=>{let t=Number(e.target.valueAsNumber);C({...S,leadMin:Number.isFinite(t)?Math.min(30,Math.max(1,Math.round(t))):S.leadMin})}})})]}),(0,a.jsxs)(`div`,{className:j.ctlRow,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:t(`peakAlertPos`)}),(0,a.jsx)(`div`,{className:j.ctlGroup,role:`radiogroup`,"aria-label":t(`peakAlertPos`),children:[`bottom-right`,`center`].map(e=>(0,a.jsxs)(`label`,{className:j.rdo,children:[(0,a.jsx)(`input`,{type:`radio`,name:`peak-pos`,checked:S.position===e,onChange:()=>C({...S,position:e})}),(0,a.jsx)(`span`,{className:j.rdoDot,"aria-hidden":`true`}),t(e===`bottom-right`?`peakAlertPosCorner`:`peakAlertPosCenter`)]},e))})]}),(0,a.jsxs)(`div`,{className:j.ctlRow,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:t(`peakAlertMode`)}),(0,a.jsx)(`div`,{className:j.ctlGroup,role:`radiogroup`,"aria-label":t(`peakAlertMode`),children:[`both`,`peak`,`offPeak`].map(e=>(0,a.jsxs)(`label`,{className:j.rdo,children:[(0,a.jsx)(`input`,{type:`radio`,name:`peak-mode`,checked:S.mode===e,onChange:()=>C({...S,mode:e})}),(0,a.jsx)(`span`,{className:j.rdoDot,"aria-hidden":`true`}),t(e===`both`?`peakAlertModeBoth`:e===`peak`?`peakAlertModePeak`:`peakAlertModeOff`)]},e))})]}),(0,a.jsxs)(`label`,{className:j.ctlRow,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:t(`peakAlertWebNotify`)}),(0,a.jsx)(`input`,{type:`checkbox`,checked:S.webNotify,"aria-label":t(`peakAlertWebNotify`),onChange:e=>{C({...S,webNotify:e.target.checked})}})]}),(0,a.jsx)(`div`,{className:j.ctlRow,children:(0,a.jsx)(`button`,{type:`button`,className:j.btn,onClick:w,children:t(`peakAlertPreview`)})})]})]}),(0,a.jsx)(`section`,{className:j.setCard,"data-testid":`billing-toggle-setting`,children:(0,a.jsxs)(`div`,{className:j.setGrid3,children:[(0,a.jsx)(`div`,{className:j.setCell,"data-testid":`billing-usage-stats-tool-setting`,children:(0,a.jsxs)(`div`,{className:j.setCardHead,children:[(0,a.jsxs)(`div`,{className:j.setCardMeta,children:[(0,a.jsx)(`h3`,{className:j.setCardTitle,children:t(`usageStatsTool`)}),(0,a.jsx)(`p`,{className:j.setCardDesc,children:t(`usageStatsToolHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":I,"aria-label":t(`usageStatsTool`),"data-testid":`billing-usage-stats-tool-toggle`,className:c(j.switch,I&&j.switchOn),onClick:Se,children:(0,a.jsx)(`span`,{className:j.switchKnob})})]})}),(0,a.jsxs)(`div`,{className:j.setCell,"data-testid":`billing-livecost-setting`,children:[(0,a.jsxs)(`div`,{className:j.setCardHead,children:[(0,a.jsxs)(`div`,{className:j.setCardMeta,children:[(0,a.jsx)(`h3`,{className:j.setCardTitle,children:t(`liveCostBar`)}),(0,a.jsx)(`p`,{className:j.setCardDesc,children:t(`liveCostBarHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":k.show,"aria-label":t(`liveCostBar`),"data-testid":`billing-livecost-toggle`,className:c(j.switch,k.show&&j.switchOn),onClick:()=>A({...k,show:!k.show}),children:(0,a.jsx)(`span`,{className:j.switchKnob})})]}),k.show&&(0,a.jsxs)(`div`,{className:j.rdoRow,"data-testid":`billing-livecost-position`,children:[(0,a.jsx)(`span`,{className:j.rdoLabel,children:t(`liveCostBarPosition`)}),(0,a.jsx)(Dn,{liveCostPrefs:k,onLiveCostPrefs:A,t})]})]}),(0,a.jsx)(`div`,{className:j.setCell,"data-testid":`billing-site-list-setting`,children:(0,a.jsxs)(`div`,{className:j.setCardHead,children:[(0,a.jsxs)(`div`,{className:j.setCardMeta,children:[(0,a.jsx)(`h3`,{className:j.setCardTitle,children:t(`siteListDisplay`)}),(0,a.jsx)(`p`,{className:j.setCardDesc,children:t(`siteListDisplayHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":O.hideUnidentified,"aria-label":t(`siteListDisplay`),"data-testid":`billing-site-hide-unidentified`,className:c(j.switch,O.hideUnidentified&&j.switchOn),onClick:()=>te({hideUnidentified:!O.hideUnidentified}),children:(0,a.jsx)(`span`,{className:j.switchKnob})})]})})]})}),(0,a.jsx)(`section`,{className:j.setCard,"data-testid":`billing-display-setting`,children:(0,a.jsxs)(`div`,{className:j.setGrid2,children:[(0,a.jsxs)(`div`,{className:j.setCell,"data-testid":`billing-float-setting`,children:[(0,a.jsx)(`div`,{className:j.setCardHead,children:(0,a.jsxs)(`div`,{className:j.setCardMeta,children:[(0,a.jsx)(`h3`,{className:j.setCardTitle,children:t(`floatWindow`)}),(0,a.jsx)(`p`,{className:j.setCardDesc,children:t(`floatWindowHint`)})]})}),(0,a.jsxs)(`div`,{className:j.ctlCol,children:[(0,a.jsxs)(`div`,{className:j.ctlRow,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:t(`floatMode`)}),(0,a.jsxs)(`div`,{className:j.ctlGroup,"data-testid":`billing-float-mode`,children:[(0,a.jsx)(`button`,{type:`button`,className:c(j.floatModeBtn,T.mode===`combined`&&j.floatModeBtnOn),"data-testid":`billing-float-mode-combined`,onClick:()=>E({mode:`combined`,targets:T.targets}),children:t(`floatModeCombined`)}),(0,a.jsx)(`button`,{type:`button`,className:c(j.floatModeBtn,T.mode===`subscription`&&j.floatModeBtnOn),"data-testid":`billing-float-mode-subscription`,onClick:()=>E({mode:`subscription`,targets:T.targets}),children:t(`floatModeSubscription`)})]})]}),T.mode===`subscription`&&(0,a.jsxs)(`div`,{className:j.ctlRow,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:t(`floatTargets`)}),(0,a.jsxs)(`span`,{className:j.ctlGroup,"data-testid":`billing-float-targets`,children:[he.map(e=>{let t=T.targets.includes(e.id);return(0,a.jsxs)(`label`,{className:j.floatTarget,children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:t,"data-testid":`billing-float-target-${e.id}`,onChange:()=>E({mode:`subscription`,targets:t?T.targets.filter(t=>t!==e.id):[...T.targets,e.id]})}),(0,a.jsx)(`span`,{className:j.floatTargetLabel,children:e.label})]},e.id)}),he.length===0&&(0,a.jsx)(`span`,{className:j.setCardDesc,children:t(`floatNoTargetsHint`)})]})]})]})]}),(0,a.jsxs)(`div`,{className:j.setCell,"data-testid":`billing-card-setting`,children:[(0,a.jsx)(`div`,{className:j.setCardHead,children:(0,a.jsxs)(`div`,{className:j.setCardMeta,children:[(0,a.jsx)(`h3`,{className:j.setCardTitle,children:t(`cardDisplay`)}),(0,a.jsx)(`p`,{className:j.setCardDesc,children:t(`cardDisplayHint`)})]})}),(0,a.jsx)(`div`,{className:j.ctlCol,children:(0,a.jsxs)(`div`,{className:j.ctlRow,children:[(0,a.jsx)(`span`,{className:j.ctlLabel,children:t(`cardMetric`)}),(0,a.jsxs)(`div`,{className:j.ctlGroup,"data-testid":`billing-card-metric`,children:[(0,a.jsx)(`button`,{type:`button`,className:c(j.floatModeBtn,ee.metric===`money`&&j.floatModeBtnOn),"data-testid":`billing-card-money`,onClick:()=>D({metric:`money`}),children:t(`cardMetricMoney`)}),(0,a.jsx)(`button`,{type:`button`,className:c(j.floatModeBtn,ee.metric===`tokens`&&j.floatModeBtnOn),"data-testid":`billing-card-tokens`,onClick:()=>D({metric:`tokens`}),children:t(`cardMetricTokens`)})]})]})})]})]})}),(0,a.jsx)(Cn,{userPrices:o,onUserPrices:s,t}),(0,a.jsx)(Ze,{t,version:e.pluginVersion})]}),P===`trends`&&(0,a.jsxs)(`div`,{className:j.tabPanel,"data-testid":`billing-tab-panel-trends`,children:[(0,a.jsxs)(`section`,{className:c(j.ubCard,j.trendPanel),"data-testid":`billing-panel-trend`,children:[(0,a.jsxs)(`div`,{className:j.ubCardHead,children:[(0,a.jsx)(`h3`,{className:j.ubCardTitle,children:t(`trend`)}),_(`billing.dashboard.decor`,{position:`trend`}),(0,a.jsxs)(`span`,{className:j.ubCardControlGroup,children:[(0,a.jsx)(`span`,{className:j.rangeToggle,role:`group`,"aria-label":t(`trend`),children:[7,30].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(j.rangeButton,ce===e&&j.rangeButtonActive),"aria-pressed":ce===e,"data-testid":`billing-trend-${e}d`,onClick:()=>{F(e)},children:t(e===7?`trend7d`:`trend30d`)},e))}),(0,a.jsx)(`span`,{className:j.rangeToggle,role:`group`,"aria-label":t(`trendMetric`),children:[`cost`,`tokens`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(j.rangeButton,re===e&&j.rangeButtonActive),"aria-pressed":re===e,"data-testid":`billing-trend-metric-${e}`,onClick:()=>{ie(e)},children:t(e===`cost`?`trendMetricCost`:`trendMetricTokens`)},e))})]}),(0,a.jsx)(`span`,{className:j.ubCardSub,children:Ye})]}),(0,a.jsx)(We,{data:Y,models:ot,currency:m,metric:re})]}),g.length>0&&(0,a.jsxs)(`section`,{className:j.ubCard,"data-testid":`billing-panel-rounds`,children:[(0,a.jsxs)(`div`,{className:j.ubCardHead,children:[(0,a.jsx)(`h3`,{className:j.ubCardTitle,children:t(`rounds`)}),z.length>0&&(0,a.jsxs)(`span`,{className:j.ubTagError,"data-testid":`billing-rounds-flag-count`,children:[z.length,` `,t(`anomaly`)]})]}),(0,a.jsx)(`p`,{className:j.ubCardSub,children:t(`roundsHint`).replace(`{count}`,String(g.length))}),(0,a.jsx)(st,{rounds:g,flags:z,currency:m,t})]}),e.byTier!==void 0&&(()=>{let e=B.peak+B.offPeak;if(e<=0)return null;let n=B.peak/e*100;return(0,a.jsxs)(`section`,{className:j.ubCard,"data-testid":`billing-panel-share`,children:[(0,a.jsxs)(`div`,{className:j.ubCardHead,children:[(0,a.jsx)(`h3`,{className:j.ubCardTitle,children:t(`peakShare`)}),(0,a.jsx)(`span`,{className:j.ubCardSub,children:t(`peakSharePerCall`)})]}),(0,a.jsxs)(`div`,{className:j.shareTrack,"data-testid":`billing-share-track`,children:[(0,a.jsx)(`div`,{className:c(j.shareSeg,j.shareSegPeak),style:{width:`${n}%`}}),(0,a.jsx)(`div`,{className:c(j.shareSeg,j.shareSegOff),style:{width:`${100-n}%`}})]}),(0,a.jsxs)(`div`,{className:j.shareLegend,children:[(0,a.jsxs)(`span`,{className:j.shareItem,children:[(0,a.jsx)(`span`,{className:j.shareDot,style:{background:`var(--dsw-static-blue-500)`}}),t(`peak`),(0,a.jsxs)(`span`,{className:j.shareValue,"data-testid":`billing-share-peak`,children:[L(B.peak),` · `,n.toFixed(1),`%`]})]}),(0,a.jsxs)(`span`,{className:j.shareItem,children:[(0,a.jsx)(`span`,{className:j.shareDot,style:{background:`color-mix(in srgb, var(--dsw-static-blue-500) 30%, var(--dsw-alias-bg-module-platform))`}}),t(`offPeak`),(0,a.jsxs)(`span`,{className:j.shareValue,"data-testid":`billing-share-offpeak`,children:[L(B.offPeak),` · `,(100-n).toFixed(1),`%`]})]})]}),Ee>0&&(0,a.jsx)(`div`,{className:j.staleNotice,"data-testid":`billing-share-savings`,children:t(`offPeakSavings`).replace(`{amount}`,L(Ee))})]})})()]}),P===`providers`&&(0,a.jsxs)(`div`,{className:j.tabPanel,"data-testid":`billing-tab-panel-providers`,children:[et.length>0&&(0,a.jsxs)(`section`,{className:j.panel,"data-testid":`billing-panel-relay-quota`,children:[(0,a.jsx)(`div`,{className:j.panelHead,children:(0,a.jsx)(`h3`,{className:j.panelTitle,children:t(`panelRelayQuota`)})}),(0,a.jsx)(`div`,{className:j.providerGroupList,"data-testid":`billing-relay-quotas`,children:et.map(e=>(0,a.jsxs)(`div`,{className:j.siteRow,"data-testid":`billing-relay-quota`,children:[(0,a.jsxs)(`span`,{className:j.siteRowName,children:[(0,a.jsx)(`span`,{className:c(j.siteKindTag,sn[e.kind]),children:on(e.kind,t)}),(0,a.jsx)(`span`,{className:j.siteRowTitle,children:e.origin})]}),(0,a.jsxs)(`span`,{className:j.siteRowMeta,children:[e.balance!==void 0&&(0,a.jsxs)(`span`,{className:j.siteRowCost,children:[t(`relayBalance`),` `,e.balance.toFixed(2)]}),(e.windows?.length??0)>0?e.windows?.map(e=>{let n=e.remainingPercent<20;return(0,a.jsxs)(`span`,{className:c(j.siteRowCalls,n&&j.siteRowCallsLow),children:[t(`relayWindowUsed`),` `,e.usedPercent,`%`]},e.kind)}):(0,a.jsx)(`span`,{className:j.siteRowCalls,children:t(`relayNoQuota`)})]})]},e.route))})]}),(0,a.jsxs)(`section`,{className:j.panel,"data-testid":`billing-panel-providers`,children:[(0,a.jsxs)(`div`,{className:j.panelHead,children:[(0,a.jsx)(`h3`,{className:j.panelTitle,children:t(`providerBilling`)}),_(`billing.dashboard.decor`,{position:`models`}),(0,a.jsx)(`span`,{className:j.panelHint,children:e.updatedAt===void 0?``:`${t(`lastUpdated`)} ${ln(e.updatedAt)}`})]}),ne&&(0,a.jsx)(`div`,{className:j.staleNotice,"data-testid":`billing-subscriptions-stale`,children:t(`subscriptionsStale`)}),tt.length===0?(0,a.jsx)(`div`,{className:j.emptyRow,"data-testid":`billing-provider-empty`,children:t(`noData`)}):(0,a.jsx)(`div`,{className:j.providerGroupList,"data-testid":`billing-provider-groups`,children:tt.map(e=>(0,a.jsxs)(`div`,{className:j.providerGroup,"data-testid":`billing-provider-group`,children:[(0,a.jsxs)(`div`,{className:j.providerGroupHead,children:[(0,a.jsxs)(`span`,{className:j.providerGroupTitle,children:[(0,a.jsx)(`span`,{className:c(j.healthDot,e.dot),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:j.providerGroupName,children:Te(e.name)})]}),(0,a.jsxs)(`span`,{className:j.providerGroupMeta,children:[e.subscriptions.length>0&&(0,a.jsxs)(`span`,{className:j.providerGroupBadge,"data-testid":`billing-provider-sub-count`,children:[e.subscriptions.length,` 套餐`]}),!ke(e)&&e.balance!==void 0&&(0,a.jsxs)(`span`,{className:j.providerGroupBalance,"data-testid":`billing-provider-balance`,children:[(0,a.jsx)(`span`,{className:j.providerGroupBalanceLabel,children:t(`balance`)}),Ae(e.balance)]})]})]}),e.models.length>0&&(0,a.jsx)(`div`,{className:c(j.tableScroll,j.modelTableScroll),"data-testid":`billing-table-scroll`,children:(0,a.jsxs)(`table`,{className:j.modelTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`model`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`calls`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`inputTokens`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`outputTokens`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`cacheHitRate`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`actual`)})]})}),(0,a.jsx)(`tbody`,{children:e.models.map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:j.modelCell,children:[(0,a.jsx)(Tn,{provider:e.provider,colorVar:e.color}),(0,a.jsxs)(`span`,{children:[(0,a.jsxs)(`span`,{className:j.modelName,children:[e.name,e.uncatalogued&&(0,a.jsx)(`span`,{className:j.uncataloguedTag,"data-testid":`billing-uncatalogued-tag`,children:t(`uncatalogued`)}),e.estimatedPricing&&(0,a.jsx)(`span`,{className:j.estimatedTag,"data-testid":`billing-estimated-tag`,children:t(`estimatedPricing`)})]}),(0,a.jsx)(`span`,{className:j.modelProvider,children:Te(e.provider)})]})]})}),(0,a.jsx)(`td`,{className:j.numCol,children:e.calls.toLocaleString()}),(0,a.jsx)(`td`,{className:j.numCol,children:W(e.input)}),(0,a.jsx)(`td`,{className:j.numCol,children:W(e.output)}),(0,a.jsx)(`td`,{className:j.numCol,children:Ve(e.cacheHitRate)}),(0,a.jsx)(`td`,{className:j.numCol,children:e.plan?(0,a.jsx)(`span`,{className:j.planTag,children:t(`subscriptionIncluded`)}):e.actual===void 0?(0,a.jsx)(`span`,{className:j.na,children:`—`}):(()=>{let t=e.officialCost,n=e.actual-t;return t>0&&n>0?(0,a.jsxs)(`span`,{className:j.bucketCost,children:[(0,a.jsx)(`span`,{className:j.bucketOfficial,children:L(t)}),(0,a.jsx)(`span`,{className:j.bucketSep,children:`/`}),(0,a.jsx)(`span`,{className:j.bucketThird,children:L(n)})]}):L(e.actual)})()})]},e.key))})]})}),e.subscriptions.length>0&&(0,a.jsx)(`div`,{className:j.subscriptionGrid,"data-testid":`billing-subscriptions-grid`,children:e.subscriptions.map(e=>{let n=rn(e.status,t);return(0,a.jsxs)(`div`,{className:j.subscriptionCard,"data-testid":`billing-subscription-card`,children:[(0,a.jsxs)(`div`,{className:j.subscriptionHead,children:[(0,a.jsx)(`span`,{className:j.subscriptionName,children:Te(e.displayName)}),e.planType===`code`&&(()=>{let n=ae(e.provider),r=n===void 0?void 0:t(`subscriptionFeePerMonth`).replace(`{amount}`,n.currency===`USD`?`$${n.amount}`:`¥${n.amount}`);return(0,a.jsxs)(`span`,{className:j.subscriptionPlan,"data-kind":`code`,children:[r??(e.subscriptionAmount!==void 0&&e.subscriptionAmount>0?t(`subscriptionFeePerMonth`).replace(`{amount}`,L(e.subscriptionAmount)):t(`planTypeCode`)),n?.label!==void 0&&(0,a.jsx)(`span`,{className:j.subscriptionTier,"data-testid":`billing-tier-${e.provider}`,children:n.label}),n!==void 0&&(0,a.jsx)(`span`,{className:j.subscriptionAuto,"data-testid":`billing-auto-${e.provider}`,children:t(`subscriptionAutoDetect`)})]})})(),e.planType===`token`&&(0,a.jsx)(`span`,{className:j.subscriptionPlan,"data-kind":`token`,children:t(`planTypeToken`)}),e.plan!==void 0&&(0,a.jsx)(`span`,{className:j.subscriptionPlan,children:e.plan})]}),n!==``&&(0,a.jsx)(`div`,{className:j.subscriptionStatus,children:n}),e.windows.length===0&&n===``&&(0,a.jsx)(`div`,{className:j.subscriptionStatus,children:t(`subscriptionNoApi`)}),e.windows.map(e=>(()=>{let n=Math.min(100,Math.max(0,e.usedPercent)),r=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,a.jsxs)(`div`,{className:j.subscriptionWindow,children:[(0,a.jsx)(`span`,{className:j.subscriptionWindowLabel,children:an(e.kind,t)}),(0,a.jsx)(`span`,{className:j.subscriptionTrack,"aria-hidden":`true`,children:(0,a.jsx)(`span`,{className:c(j.subscriptionFill,n>=100&&j.subscriptionFillOver,n>=80&&n<100&&j.subscriptionFillWarn),style:{width:`${n}%`}})}),(0,a.jsxs)(`span`,{className:j.subscriptionMeta,children:[(0,a.jsx)(`span`,{className:c(j.subscriptionPct,r&&j.subscriptionExhausted),children:r?t(`subscriptionExhausted`):t(`subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,a.jsx)(`span`,{className:j.subscriptionReset,children:t(`subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${ln(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]},e.provider)})})]},e.name))})]}),(0,a.jsxs)(`div`,{className:j.exportBar,"data-testid":`billing-export-bar`,role:`group`,"aria-label":t(`export`),children:[(0,a.jsx)(`span`,{className:j.exportLabel,children:t(`export`)}),(0,a.jsx)(`button`,{type:`button`,className:j.exportButton,"data-testid":`billing-export-day`,onClick:()=>{Et(Tt(`usage-daily`,`csv`,Object.keys(N)),xt(N),`text/csv`)},children:t(`exportCsvDay`)}),e.bySession!==void 0&&(0,a.jsx)(`button`,{type:`button`,className:j.exportButton,"data-testid":`billing-export-sessions`,onClick:()=>{Et(Tt(`usage-sessions`,`csv`,Object.keys(N)),wt(e.bySession??[]),`text/csv`)},children:t(`exportCsvSession`)}),e.bySite!==void 0&&(0,a.jsx)(`button`,{type:`button`,className:j.exportButton,"data-testid":`billing-export-sites`,onClick:()=>{Et(Tt(`usage-sites`,`csv`,Object.keys(N)),St(e.bySite??{}),`text/csv`)},children:t(`exportCsvSite`)}),(0,a.jsx)(`button`,{type:`button`,className:j.exportButton,"data-testid":`billing-export-json`,onClick:()=>{Et(Tt(`usage-stats`,`json`,Object.keys(N)),JSON.stringify(e,null,2),`application/json`)},children:t(`exportJson`)})]}),De.length>0&&(0,a.jsxs)(`section`,{className:j.panel,"data-testid":`billing-panel-roles`,children:[(0,a.jsxs)(`div`,{className:j.panelHead,children:[(0,a.jsx)(`h3`,{className:j.panelTitle,children:t(`roleCost`)}),(0,a.jsx)(`span`,{className:j.panelHint,children:t(`roleHint`)})]}),(0,a.jsx)(`div`,{className:j.shareTrack,"data-testid":`billing-role-track`,children:De.map(e=>(0,a.jsx)(`div`,{className:c(j.shareSeg,e.seg),style:{width:`${e.pct}%`}},e.label))}),(0,a.jsx)(`div`,{className:j.shareLegend,children:De.map(e=>(0,a.jsxs)(`span`,{className:j.shareItem,children:[(0,a.jsx)(`span`,{className:c(j.shareDot,e.seg)}),e.label,(0,a.jsxs)(`span`,{className:j.shareValue,children:[L(e.value),` · `,e.pct.toFixed(1),`%`]})]},e.label))})]}),Z!==void 0&&(()=>{let e=Z.officialCost+Z.thirdCost,n=e>0?Z.officialCost/e*100:0;return(0,a.jsxs)(`div`,{className:j.ubStatGrid,"data-testid":`billing-panel-buckets`,children:[(0,a.jsxs)(`div`,{className:j.ubStatCard,children:[(0,a.jsxs)(`span`,{className:j.ubStatLabel,children:[t(`official`),`(=DeepSeek 直连)`]}),(0,a.jsx)(`span`,{className:j.ubStatValue,children:L(Z.officialCost)}),(0,a.jsxs)(`span`,{className:j.ubStatDetail,children:[Z.officialCalls,` `,t(`calls`),` · `,n.toFixed(1),`%`]})]}),(0,a.jsxs)(`div`,{className:j.ubStatCard,children:[(0,a.jsxs)(`span`,{className:j.ubStatLabel,children:[t(`thirdParty`),`(中转)`]}),(0,a.jsx)(`span`,{className:j.ubStatValue,children:L(Z.thirdCost)}),(0,a.jsxs)(`span`,{className:j.ubStatDetail,children:[Z.thirdCalls,` `,t(`calls`),` · `,(100-n).toFixed(1),`%`]})]})]})})(),e.byWorkspace!==void 0&&e.byWorkspace.length>0&&(0,a.jsxs)(`section`,{className:j.ubCard,"data-testid":`billing-panel-workspaces`,children:[(0,a.jsxs)(`div`,{className:j.ubCardHead,children:[(0,a.jsx)(`h3`,{className:j.ubCardTitle,children:t(`workspaces`)}),(0,a.jsx)(`span`,{className:j.ubCardSub,children:t(`workspacesHint`)})]}),(0,a.jsx)(`ul`,{className:j.rowlist,children:e.byWorkspace.map(n=>(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(`li`,{children:(0,a.jsxs)(`button`,{type:`button`,className:j.rowline,"data-testid":`billing-workspace-${n.name}`,onClick:()=>{ye(ve===n.name?void 0:n.name)},children:[(0,a.jsx)(`span`,{className:j.rowlineName,children:n.name}),(0,a.jsxs)(`span`,{className:j.rowlineRight,children:[(0,a.jsx)(`span`,{className:j.num,children:L(n.cost)}),(0,a.jsxs)(`span`,{className:j.rowlineMuted,children:[n.calls,` `,t(`calls`)]}),(0,a.jsx)(`span`,{className:j.rowlineChev,"aria-hidden":`true`,children:`›`})]})]})}),ve===n.name&&(0,a.jsx)(`li`,{className:j.rowlineDrillWrap,children:e.bySession?.filter(e=>Vt(e.cwd)===n.name).slice(0,5).map(e=>(0,a.jsxs)(`div`,{className:j.rowlineDrill,children:[(0,a.jsx)(`span`,{className:j.rowlineName,children:e.title??e.id.slice(0,8)}),(0,a.jsxs)(`span`,{className:j.rowlineRight,children:[(0,a.jsx)(`span`,{className:j.num,children:L(e.cost)}),(0,a.jsxs)(`span`,{className:j.rowlineMuted,children:[e.calls,` `,t(`calls`)]})]})]},e.id))})]},n.name))})]}),e.bySession!==void 0&&(0,a.jsxs)(`section`,{className:j.ubCard,"data-testid":`billing-panel-sessions`,children:[(0,a.jsxs)(`div`,{className:j.ubCardHead,children:[(0,a.jsx)(`h3`,{className:j.ubCardTitle,children:t(`sessions`)}),(0,a.jsx)(`span`,{className:j.ubCardSub,children:e.bySession.length>20?t(`sessionOverflow`).replace(`{limit}`,`20`).replace(`{total}`,String(e.bySession.length)):`${e.bySession.length}`})]}),(e.staleLedgerSessions??0)>0&&(0,a.jsx)(`div`,{className:j.staleNotice,"data-testid":`billing-sessions-stale`,children:t(`staleLedgerNotice`).replace(`{count}`,String(e.staleLedgerSessions))}),(0,a.jsx)(`div`,{className:j.ubTablewrap,"data-testid":`billing-sessions-table`,children:(0,a.jsxs)(`table`,{className:j.ubTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`sessionTitle`)}),(0,a.jsx)(`th`,{children:t(`project`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`calls`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`actual`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`lastActive`)})]})}),(0,a.jsxs)(`tbody`,{children:[e.bySession.length===0&&(0,a.jsx)(`tr`,{children:(0,a.jsx)(`td`,{colSpan:5,className:j.emptyRow,children:t(`noData`)})}),e.bySession.slice(0,20).map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsxs)(`td`,{children:[(0,a.jsx)(`span`,{className:j.modelName,children:e.title??e.id.slice(0,8)}),e.stale===!0&&(0,a.jsx)(`span`,{className:c(j.ubTag,j.ubTagNeutral),"data-testid":`billing-session-stale`,children:t(`sessionStaleBadge`)})]}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:j.modelProvider,children:Vt(e.cwd)??`—`})}),(0,a.jsx)(`td`,{className:j.numCol,children:e.calls.toLocaleString()}),(0,a.jsx)(`td`,{className:j.numCol,children:L(e.cost)}),(0,a.jsx)(`td`,{className:j.numCol,children:e.lastActive>0?`${$(e.lastActive)} ${ln(e.lastActive)}`:`—`})]},e.id))]})]})})]})]}),P===`token`&&(0,a.jsxs)(`div`,{className:j.tabPanel,"data-testid":`billing-tab-panel-token`,children:[(0,a.jsx)(nt,{stats:e,trendDays:ce,onTrendDays:F,models:ot,t}),e.perf!==void 0&&(0,a.jsxs)(`section`,{className:j.panel,"data-testid":`billing-panel-perf`,children:[(0,a.jsxs)(`div`,{className:j.panelHead,children:[(0,a.jsx)(`h3`,{className:j.panelTitle,children:t(`perfTitle`)}),(0,a.jsx)(`span`,{className:j.panelHint,children:t(`perfHint`)})]}),(0,a.jsx)(Je,{perf:e.perf,models:ot,t})]})]}),P===`pricing`&&(0,a.jsxs)(`div`,{className:j.tabPanel,"data-testid":`billing-tab-panel-pricing`,children:[(0,a.jsxs)(`div`,{className:j.ubAlert,role:`note`,children:[(0,a.jsxs)(`div`,{className:j.ubAlertLeft,children:[(0,a.jsxs)(`span`,{className:j.ubRate,"data-testid":`billing-rate`,children:[t(`todayRate`),` 1 USD = `,U(Ce.rate)]}),(0,a.jsx)(`span`,{className:c(j.ubTag,Ce.live?j.ubTagSuccess:j.ubTagNeutral),children:Ce.live?t(`rateLive`):t(`rateBuiltin`)})]}),(0,a.jsx)(`p`,{className:j.ubAlertNote,children:t(`pricingTip`)})]}),(0,a.jsxs)(`section`,{className:j.ubCard,"data-testid":`billing-panel-pricing`,children:[(0,a.jsxs)(`div`,{className:j.ubCardHead,children:[(0,a.jsx)(`h3`,{className:j.ubCardTitle,children:t(`pricing`)}),(0,a.jsx)(`span`,{className:j.ubCardSub,children:t(`pricingUnit`)})]}),(0,a.jsx)(`div`,{className:j.ubTablewrap,children:(0,a.jsxs)(`table`,{className:j.ubTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`thModel`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`thInputMiss`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`thInputHit`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`output`)}),(0,a.jsx)(`th`,{className:j.numCol,children:t(`band`)})]})}),(0,a.jsx)(`tbody`,{children:Fe().map(e=>{let n=e.price.input>0||e.price.output>0;return(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:j.ubModel,children:[(0,a.jsx)(Tn,{provider:e.provider,colorVar:Ie(e.colorVar)}),(0,a.jsxs)(`span`,{className:j.ubModelName,children:[e.name,e.uncatalogued&&(0,a.jsx)(`span`,{className:j.ubTagAlert,"data-testid":`billing-price-uncatalogued`,children:t(`uncatalogued`)}),e.promo!==void 0&&Ne(e.promo,Date.now())&&(0,a.jsx)(`span`,{className:j.ubTagPromo,"data-testid":`billing-price-promo`,title:e.promo.endsAtMs===void 0?t(`promoOpenEnded`):t(`promoUntil`,{date:new Date(e.promo.endsAtMs).toLocaleDateString()}),children:e.promo.note??t(`promoBadge`)})]})]})}),(0,a.jsx)(`td`,{className:j.numCol,children:n?R(e.price.input,e.price.currency):(0,a.jsx)(`span`,{className:j.na,children:`—`})}),(0,a.jsx)(`td`,{className:j.numCol,children:n?R(e.price.cacheHit,e.price.currency):(0,a.jsx)(`span`,{className:j.na,children:`—`})}),(0,a.jsx)(`td`,{className:j.numCol,children:n?R(e.price.output,e.price.currency):(0,a.jsx)(`span`,{className:j.na,children:`—`})}),(0,a.jsx)(`td`,{className:j.numCol,children:n&&e.price.offPeak!==void 0&&e.peakHours!==void 0?(0,a.jsxs)(`span`,{className:j.ubPricepair,children:[(0,a.jsxs)(`span`,{className:j.ubChipPeak,children:[(0,a.jsx)(`span`,{className:j.ubChipLabel,children:e.tierSemantics===`latency`?t(`ubStd`):t(`ubPeak`)}),(0,a.jsxs)(`span`,{className:j.num,children:[R(e.price.input,e.price.currency),` / `,R(e.price.output,e.price.currency)]})]}),(0,a.jsxs)(`span`,{className:j.ubChipOff,children:[(0,a.jsx)(`span`,{className:j.ubChipLabel,children:e.tierSemantics===`latency`?`Flex`:t(`ubOff`)}),(0,a.jsxs)(`span`,{className:j.num,children:[R(e.price.offPeak.input,e.price.currency),` / `,R(e.price.offPeak.output,e.price.currency)]})]})]}):n?(0,a.jsx)(`span`,{className:j.flatTag,children:t(`flat`)}):(0,a.jsx)(`span`,{className:j.na,children:`—`})})]}),(e.extraRows??[]).map(t=>(0,a.jsxs)(`tr`,{className:j.ubExtraRow,children:[(0,a.jsxs)(`td`,{children:[(0,a.jsx)(`span`,{className:j.ubExtraName,children:t.label}),t.note!==void 0&&(0,a.jsx)(`span`,{className:j.ubExtraNote,children:t.note})]}),(0,a.jsx)(`td`,{className:j.numCol,children:t.input===void 0?(0,a.jsx)(`span`,{className:j.na,children:`—`}):R(t.input,e.price.currency)}),(0,a.jsx)(`td`,{className:j.numCol,children:(0,a.jsx)(`span`,{className:j.na,children:`—`})}),(0,a.jsx)(`td`,{className:j.numCol,children:t.output===void 0?(0,a.jsx)(`span`,{className:j.na,children:`—`}):R(t.output,e.price.currency)}),(0,a.jsx)(`td`,{className:j.numCol,children:(0,a.jsx)(`span`,{className:j.na,children:`—`})})]},`${e.key}:${t.label}`))]},e.key)})})]})})]}),(0,a.jsxs)(`section`,{className:j.ubCard,children:[(0,a.jsx)(`div`,{className:j.ubCardHead,children:(0,a.jsx)(`h3`,{className:j.ubCardTitle,children:t(`pricingNotes`)})}),(0,a.jsxs)(`ul`,{className:j.ubNotes,children:[(0,a.jsxs)(`li`,{className:j.ubNotesItem,children:[(0,a.jsx)(`span`,{className:j.ubNotesTerm,children:t(`cacheHit`)}),(0,a.jsx)(`span`,{className:j.ubNotesDesc,children:t(`noteCache`)})]}),(0,a.jsxs)(`li`,{className:j.ubNotesItem,children:[(0,a.jsx)(`span`,{className:j.ubNotesTerm,children:t(`peakBand`)}),(0,a.jsx)(`span`,{className:j.ubNotesDesc,children:t(`noteBand`)})]}),(0,a.jsxs)(`li`,{className:j.ubNotesItem,children:[(0,a.jsx)(`span`,{className:j.ubNotesTerm,children:t(`pricingSource`)}),(0,a.jsx)(`span`,{className:j.ubNotesDesc,children:t(`noteSource`)})]})]})]})]}),_(`billing.dashboard.decor`,{position:`footer`})]}),(0,a.jsxs)(`footer`,{className:j.modalFooter,"data-testid":`billing-footer`,children:[(0,a.jsx)(`span`,{children:t(`footer`)}),(0,a.jsx)(`span`,{children:t(`footerCredit`).replace(`{version}`,e.pluginVersion===void 0?`—`:`v${e.pluginVersion}`)})]})]})})}function Tn({provider:e,colorVar:t}){let n=Nt(e);return n===void 0?(0,a.jsx)(`span`,{className:j.vendorLetter,style:t===void 0?void 0:{background:t},"aria-hidden":`true`,children:e.trim().charAt(0).toUpperCase()}):(0,a.jsx)(`img`,{className:j.vendorLogo,src:n,alt:``,"aria-hidden":`true`})}let En=[`below`,`above`,`toolbar`];function Dn({liveCostPrefs:e,onLiveCostPrefs:t,t:n}){let[o,s]=(0,r.useState)(!1),l={below:n(`liveCostBarPosBelow`),above:n(`liveCostBarPosAbove`),toolbar:n(`liveCostBarPosToolbar`)},u=En.map(e=>({id:e,label:l[e]}));return(0,a.jsx)(i.Menu,{open:o,align:`end`,portal:!0,compact:!0,items:u,selectedId:e.position,onSelect:n=>{s(!1);let r=En.find(e=>e===n);r!==void 0&&t({...e,position:r})},onClose:()=>{s(!1)},anchor:(0,a.jsxs)(`button`,{type:`button`,className:j.rdoSelect,"data-testid":`billing-livecost-position-select`,"aria-haspopup":`menu`,"aria-expanded":o,onClick:()=>{s(!o)},children:[(0,a.jsx)(`span`,{children:l[e.position]}),(0,a.jsx)(`span`,{className:c(j.rdoChevron,o&&j.rdoChevronOpen),"aria-hidden":!0,children:(0,a.jsx)(i.IconChevronDownOutline14,{})})]})})}function On(e){let{t,checkModels:n,publishCosts:i,registerOpen:o,renderSlot:s,useStore:c,actions:l}=e,[u,p]=(0,r.useState)(dn),[m,_]=(0,r.useState)(Ut),[v,x]=(0,r.useState)([]),[S,E]=(0,r.useState)(void 0),[O,te]=(0,r.useState)([]),[k,A]=(0,r.useState)(!1),[ne,j]=(0,r.useState)([]),[re,ie]=(0,r.useState)(`cny`),[M,ae]=(0,r.useState)(()=>d()),oe=(0,r.useCallback)(e=>{ae(e),f(e)},[]),[N,P]=(0,r.useState)(()=>y()),se=(0,r.useCallback)(e=>{P(e),b(e)},[]),[ce,F]=(0,r.useState)(()=>w()),le=(0,r.useCallback)(e=>{F(e),T(e),window.dispatchEvent(new CustomEvent(C))},[]),[ue,fe]=(0,r.useState)(()=>h()),pe=(0,r.useCallback)(e=>{fe(e),g(e)},[]),[me,he]=(0,r.useState)(()=>{let e=ee();return de(e),e}),ge=(0,r.useCallback)(e=>{he(e),de(e),D(e)},[]),_e=(0,r.useMemo)(()=>Qt(u),[u,me]),ye=re===`usd`?`en`:`zh`,I=(0,r.useCallback)((e,n)=>{let r=(ye===`en`?kt:Ot)[e]??t(e);if(n===void 0)return r;let i=r;for(let[e,t]of Object.entries(n))i=i.replaceAll(`{${e}}`,String(t));return i},[ye,t]),[xe,Ce]=(0,r.useState)(!1),L=(0,r.useCallback)(()=>{Ce(!1)},[]),we=(0,r.useCallback)(()=>{fn().then(e=>{e!==null&&p(Qt(e))}),hn().then(({balances:e,reconcile:t})=>{e.length>0&&x(e),E(t)}),gn().then(e=>{e.length>0&&te(e),A(!1)}).catch(()=>{A(!0)}),_n().then(e=>{j(e)}).catch(()=>{})},[]),Te=(0,r.useCallback)(()=>{we(),mn(),Ce(!0)},[we]);(0,r.useEffect)(()=>{we(),mn()},[we]),(0,r.useEffect)(()=>{let e=setInterval(()=>{we(),mn()},cn);return()=>{clearInterval(e)}},[we]),(0,r.useEffect)(()=>{let e=!0;return n().then(t=>{e&&(_(t),ve(t.catalog??[]))}),()=>{e=!1}},[n]);let R=$(),z=Object.entries(u.byDay).filter(([e])=>e.startsWith(R.slice(0,7))).reduce((e,[,t])=>e+t.cost,0),B=u.byDay[R]?.cost??0,Ee=tn(u.byDay).reduce((e,t)=>e+t.cost,0),De=(0,r.useMemo)(()=>tn(u.byDay).map(e=>{let t=u.byDay[e.date];return{date:e.date,cost:e.cost,tokens:t===void 0?0:t.input+t.output}}),[u.byDay]),V=Object.entries(u.byDay).filter(([e])=>e.startsWith(R.slice(0,7))).reduce((e,[,t])=>e+t.input+t.output,0),Oe=(()=>{let e=u.byDay[R];return e===void 0?0:e.input+e.output})(),ke=De.reduce((e,t)=>e+t.tokens,0),Ae=c(e=>e.enabled),Me=c(e=>e.amount),Ne=c(e=>e.tierAlertDays),Pe=c(e=>e.lastTierSwitchAt),[Fe,Ie]=(0,r.useState)(()=>It()),[H,Le]=(0,r.useState)(null),[Re,ze]=(0,r.useState)(null),[Be,W]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{let e=setInterval(()=>W(Date.now()),cn);return()=>{clearInterval(e)}},[]);let Ve=(0,r.useCallback)(e=>{Ie(e),Lt(e)},[]),G=(0,r.useCallback)(()=>{ze({entering:Se(Date.now())===`peak`?`offPeak`:`peak`,atMs:Date.now()+18e4})},[]),He=Me>0?Me:u.budget??0,Ue=(0,r.useCallback)(()=>{let e=!Ae;l.setEnabled(e),e&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission()},[l,Ae]);(0,r.useEffect)(()=>{if(!Ae||He<=0)return;let e=z/He*100,t=$(),n=Ht.filter(n=>e>=n&&Ne?.[String(n)]!==t);if(n.length===0)return;let r=n[n.length-1]??100;if(l.markTierAlerted(n,t),typeof Notification>`u`||Notification.permission!==`granted`)return;let i=I(`budgetTierBody`).replace(`{cost}`,U(z)).replace(`{budget}`,U(He)).replace(`{pct}`,String(r));try{new Notification(I(`budget`),{body:i})}catch{}},[Ae,He,z,Ne,l,I]),(0,r.useEffect)(()=>{let e=Rt(Be,Fe,Pe);if(e===null||(l.markTierSwitchAlerted(e.atMs),Le(e),!Fe.webNotify)||typeof Notification>`u`||Notification.permission!==`granted`)return;let t=Math.max(1,Math.round((e.atMs-Be)/6e4)),n=e.entering===`peak`?I(`peakAlertTitlePeak`):I(`peakAlertTitleOff`),r=e.entering===`peak`?I(`tierAlertEnterPeak`).replace(`{minutes}`,String(t)):I(`tierAlertEnterOff`).replace(`{minutes}`,String(t));try{new Notification(n,{body:r})}catch{}},[Be,Pe,Fe,l,I]);let K=c(e=>e.lastBalanceAlertDay),q=(0,r.useMemo)(()=>{if(v.length===0)return;let e=u.lowBalanceThreshold??50,t=Xt(u.byDay,R),n=be().rate;for(let r of v){if(r.totalBalance===void 0||r.error!==void 0)continue;let i=r.currency===`USD`?r.totalBalance*n:r.totalBalance;if(i>=e)continue;let a=t>0?Math.floor(i/t):void 0;return{name:r.displayName,cny:i,days:a}}},[v,u.lowBalanceThreshold,u.byDay,R]);(0,r.useEffect)(()=>{if(q===void 0)return;let e=$();if(K===e||(l.markBalanceAlerted(e),typeof Notification>`u`||Notification.permission!==`granted`))return;let t=I(`balanceLowBody`).replace(`{name}`,q.name).replace(`{balance}`,U(q.cny)).replace(`{days}`,q.days===void 0?`—`:String(q.days));try{new Notification(I(`balance`),{body:t})}catch{}},[q,K,l,I]);let We=(0,r.useMemo)(()=>{let e=R.slice(0,7),t=new Map;for(let[n,r]of Object.entries(u.byDayModels??{}))if(n.startsWith(e))for(let[e,n]of Object.entries(r)){if(n.cost<=0)continue;let r=je(e).provider??`其他`,i=u.byModel?.[e]?.plan===!0,a=t.get(r)??{cost:0,plan:i};a.cost+=n.cost,i||(a.plan=!1),t.set(r,a)}let n=[...t.entries()].filter(([,e])=>!e.plan).sort((e,t)=>t[1].cost-e[1].cost)[0],r=[...t.entries()].filter(([,e])=>e.plan).sort((e,t)=>t[1].cost-e[1].cost)[0],i=e=>{let t=v.find(t=>Q(t.provider)===Q(e));if(t===void 0||t.totalBalance===void 0)return{text:t?.error===`unauthorized`?I(`balanceUnauthorized`):t?.error===`unreachable`||t?.error===`invalid`?I(`balanceUnreachable`):I(`balanceUnconfigured`),low:!1};let n=t.currency===`USD`?`$${t.totalBalance.toFixed(2)}`:U(t.totalBalance),r=be().rate;return{text:n,low:(t.currency===`USD`?t.totalBalance*r:t.totalBalance)<(u.lowBalanceThreshold??50)}},a=e=>{let t=O.find(t=>t.displayName===e||Yt(t.provider)===e);if(t===void 0||t.windows.length===0)return{text:I(`subscriptionNoApi`),low:!1};let n=t.windows.reduce((e,t)=>Math.min(e,t.remainingPercent),100);return{text:n<=0?I(`subscriptionExhausted`):I(`subscriptionRemaining`).replace(`{pct}`,String(n)),low:n<20}};return{direct:n===void 0?void 0:{name:n[0],...i(n[0])},sub:r===void 0?void 0:{name:r[0],...a(r[0])}}},[u.byDayModels,u.byModel,u.lowBalanceThreshold,v,O,R]),J=(0,r.useMemo)(()=>{let e=u.total;return{totalToken:e.input+e.output,input:e.input,output:e.output,cacheRead:e.cacheHit,calls:e.calls}},[u]);(0,r.useEffect)(()=>{i({todayCost:B,monthCost:z})},[B,z,i]),(0,r.useEffect)(()=>o(Te),[o,Te]);let Ge=(0,r.useMemo)(()=>u.byTurn??[],[u.byTurn]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(bn,{...e,t:I,onOpen:Te,monthCost:z,todayCost:B,weekCost:Ee,days:De,vendorStatus:We,dash:J,cardPrefs:ue,monthTokens:V,todayTokens:Oe,weekTokens:ke,floatPrefs:M,subscriptions:O}),xe&&(0,a.jsx)(wn,{stats:_e,t:I,onClose:L,userPrices:me,onUserPrices:ge,health:m,balances:v,...S===void 0?{}:{reconcile:S},quotas:O,relayQuotas:ne,currency:re,onCurrency:ie,turns:Ge,renderSlot:s,budgetEnabled:Ae,budgetAmount:He,onToggleBudget:Ue,onBudgetAmount:l.setAmount,peakConfig:Fe,onPeakConfig:Ve,onPreviewPeak:G,floatPrefs:M,onFloatPrefs:oe,cardPrefs:ue,onCardPrefs:pe,sitePrefs:N,onSitePrefs:se,liveCostPrefs:ce,onLiveCostPrefs:le,quotasStale:k}),(H!==null||Re!==null)&&(0,a.jsx)(zt,{hit:H??Re,config:Fe,t:I,onDismiss:()=>{Le(null),ze(null)}})]})}function kn(e,t){return t===void 0||e?.bySession===void 0?0:e.bySession.find(e=>e.id===t)?.cost??0}function An(e,t){if(t===void 0||e?.byTurn===void 0)return 0;let n=0,r=-1;for(let i of e.byTurn)i.sessionId===t&&(r===-1||i.turn>r)&&(r=i.turn,n=i.cost);return n}function jn(e,t=20){let n=[];for(let r of e)if(r.status===`ok`)for(let e of r.windows)e.remainingPercent>t||n.push({name:r.displayName,kind:e.kind,pct:e.remainingPercent});return n.sort((e,t)=>e.pct-t.pct).slice(0,3)}async function Mn(){try{let e=await fetch(`/api/billing/usage-stats`);if(!e.ok)return null;let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return{...Array.isArray(r.bySession)?{bySession:r.bySession}:{},...Array.isArray(r.byTurn)?{byTurn:r.byTurn}:{}}}catch{return null}}async function Nn(){try{let e=await fetch(`/api/billing/subscriptions`);if(!e.ok)return[];let t=JSON.parse(await e.text());if(typeof t!=`object`||!t||!(`quotas`in t))return[];let n=t.quotas;return Array.isArray(n)?n:[]}catch{return[]}}function Pn(e){switch(e){case`session`:return`subscriptionSession`;case`weekly`:return`subscriptionWeekly`;case`monthly`:return`subscriptionMonthly`;default:return`subscriptionBilling`}}function Fn(){let[e,t]=(0,r.useState)(()=>w().show),[n,i]=(0,r.useState)(()=>w().position);return(0,r.useEffect)(()=>{let e=()=>{t(w().show),i(w().position)};return window.addEventListener(C,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(C,e),window.removeEventListener(`storage`,e)}},[]),{visible:e,position:n}}function In(e){let[t,n]=(0,r.useState)(null),[i,a]=(0,r.useState)([]),[o,s]=(0,r.useState)(()=>Date.now());return(0,r.useEffect)(()=>{let e=!1,t=()=>{Mn().then(t=>{!e&&t!==null&&n(t)}),Nn().then(t=>{e||a(t)}),e||s(Date.now())};t();let r=setInterval(t,3e4);return()=>{e=!0,clearInterval(r)}},[e]),{sessionCost:(0,r.useMemo)(()=>kn(t,e),[t,e]),turnCost:(0,r.useMemo)(()=>An(t,e),[t,e]),tier:R(o),chips:(0,r.useMemo)(()=>jn(i),[i])}}function Ln({sessionId:e,t}){let{visible:n,position:r}=Fn(),{sessionCost:i,turnCost:o,tier:s,chips:l}=In(e),u=e=>U(e,`cny`),d=i>0||o>0,f=s.tier===`peak`;return!n||r===`toolbar`?null:(0,a.jsxs)(`span`,{className:r===`above`?c(j.feeBar,j.feeBarAbove):j.feeBar,"data-testid":`billing-live-cost-bar`,children:[(0,a.jsx)(`span`,{className:f?j.feeChipPrimary:j.feeChipOff,"data-testid":`billing-live-tier`,children:t(f?`tierPeak`:`tierOff`)}),(0,a.jsx)(`span`,{className:j.feeCount,children:B(s.nextSwitchInMs)}),(0,a.jsx)(`span`,{className:j.feeSuffix,children:t(f?`tierToOff`:`tierToPeak`)}),d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:j.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:j.feeItem,"data-testid":`billing-live-turn`,children:[t(`liveTurn`),` `,(0,a.jsx)(`span`,{className:j.feeNum,children:u(o)})]}),(0,a.jsx)(`span`,{className:j.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:j.feeItem,"data-testid":`billing-live-session`,children:[t(`liveSession`),` `,(0,a.jsx)(`span`,{className:j.feeNum,children:u(i)})]})]}),l.map(e=>(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:j.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:e.pct<=10?j.feeChipError:j.feeChipAlert,"data-testid":`billing-live-quota`,children:[e.name,` `,t(Pn(e.kind)),` `,e.pct,`%`]})]},`${e.name}:${e.kind}`))]})}function Rn({sessionId:e,t}){let{visible:n,position:r}=Fn(),{sessionCost:o,turnCost:s,tier:c,chips:l}=In(e);if(!n||r!==`toolbar`)return null;let u=c.tier===`peak`,d=l.reduce((e,t)=>Math.min(e,t.pct),100),f=d<=10?j.feeInlineError:d<=20?j.feeInlineAlert:j.feeInline,p=[`${B(c.nextSwitchInMs)} ${t(u?`tierToOff`:`tierToPeak`)}`,`${t(`liveTurn`)} ${U(s,`cny`)}`,`${t(`liveSession`)} ${U(o,`cny`)}`,...l.map(e=>`${e.name} ${t(Pn(e.kind))} ${e.pct}%`)].join(` · `);return(0,a.jsx)(i.Tooltip,{label:p,side:`top`,delayMs:500,children:(0,a.jsxs)(`span`,{className:f,"data-testid":`billing-live-cost-chip`,role:`note`,"aria-label":p,children:[(0,a.jsx)(`span`,{className:u?j.feeChipPrimary:j.feeChipOff,"data-testid":`billing-live-tier`,children:t(u?`tierPeak`:`tierOff`)}),o>0&&(0,a.jsx)(`span`,{className:j.feeInlineNum,children:U(o,`cny`)})]})})}function zn(){let e,t,n=new Set;return{readCosts:()=>e,subscribeCosts:t=>(t(e),n.add(t),()=>{n.delete(t)}),openDashboard:()=>{t?.()},publishCosts:t=>{e=t;for(let e of n)try{e(t)}catch{}},registerOpen:e=>(t=e,()=>{t===e&&(t=void 0)})}}function Bn(){return(0,o.defineStore)({init:()=>({enabled:!1,amount:0,tierAlertDays:{},lastBalanceAlertDay:``,lastTierSwitchAt:0}),persist:`dsh.ui-usage-billing.budget`,actions:{setEnabled:(e,t)=>{e.enabled=t},setAmount:(e,t)=>{e.amount=Number.isFinite(t)&&t>0?t:0},markTierAlerted:(e,t,n)=>{e.tierAlertDays??={};for(let r of t)e.tierAlertDays[String(r)]=n},markBalanceAlerted:(e,t)=>{e.lastBalanceAlertDay=t},markTierSwitchAlerted:(e,t)=>{e.lastTierSwitchAt=t}}})}let Vn={enabled:!1,timeout:0};function Hn(){try{let e=localStorage.getItem(`dsh-billing-completion-notify-v1`);if(e===null)return{...Vn};let t=JSON.parse(e);return{enabled:t.enabled===!0,timeout:typeof t.timeout==`number`?t.timeout:0}}catch{return{...Vn}}}function Un(e){return e.completed===!0||e.running===!1}function Wn(e,t){let n=new Set,r=new Set,i,a=e.getSnapshot();for(let e of a.ids){let t=a.byId[e];t!==void 0&&(r.add(String(e)),Un(t)&&n.add(String(e)))}let o=e=>{let{enabled:n,timeout:r}=t();if(n&&!(typeof Notification>`u`)&&Notification.permission===`granted`)try{let t=new Notification(e,{body:e,tag:`dsh-billing-completion`,requireInteraction:r===0});r>0&&(i!==void 0&&clearTimeout(i),i=setTimeout(()=>t.close(),r*1e3))}catch{}},s=e.subscribe(()=>{let t=e.getSnapshot(),i=[];for(let e of t.ids){let a=t.byId[e];if(a===void 0)continue;let o=String(e),s=Un(a),c=!r.has(o);c&&r.add(o),s&&!c&&!n.has(o)&&i.push(a.title??a.id??o),s?n.add(o):n.delete(o)}if(i.length>0){let e=i.length===1?i[0]:`${i.length} 个会话已完成`;e!==void 0&&o(e)}});return()=>{s(),i!==void 0&&clearTimeout(i)}}let Gn=[`slots`,`locale`,`remote`,`sessions`];function Kn(e){let t=zn();e.provide(`billingMetrics`,t);let n=Bn();e.effect(()=>e.locale.register(Dt,{zh:Ot,en:kt}),`ui-usage-billing: dictionaries`),e.slots.inject(`sidebar.footer.action`,()=>e.slots.register({name:`sidebar.footer.action`,id:`usage-billing`,order:-10,locale:Dt,children:{"billing.dashboard.decor":{kind:`list`,scope:`root`}},store:n,inject:()=>({checkModels:async()=>{try{let[t,n]=await Promise.all([e.remote.llm.listProviders(),e.remote.llm.listConfigurableProviders()]);if(!t.ok||!n.ok)return{checked:!0,available:!1,models:0,failures:0,okProviders:[],badProviders:[]};let r=new Map(n.value.map(e=>[e.provider,e])),i=await Promise.all(t.value.map(async t=>{let n=r.get(t.id);if(n===void 0)return{provider:t,models:[]};let i=await e.remote.llm.discoverModels(n.settingsNs,{provider:t.id});return i.ok?{provider:t,models:i.value}:{provider:t,failed:!0}})),a=[],o=[],s=[],c=0;for(let e of i){if(`failed`in e){s.push(e.provider.name);continue}o.push(e.provider.name),c+=e.models.length;for(let t of e.models)a.push({id:t.id,...typeof t.name==`string`&&t.name!==``?{name:t.name}:{},provider:e.provider.name})}return{checked:!0,available:o.length>0,models:c,failures:s.length,okProviders:o,badProviders:s,catalog:a}}catch{return{checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]}}},publishCosts:e=>{t.publishCosts(e)},registerOpen:e=>t.registerOpen(e)})},On)),e.slots.inject(`conversation.composer.dock`,()=>e.slots.register({name:`conversation.composer.dock`,id:`usage-billing-cost`,order:0,locale:Dt},Ln)),e.slots.inject(`conversation.input.right`,()=>e.slots.register({name:`conversation.input.right`,id:`usage-billing-cost-chip`,order:0,locale:Dt},Rn)),e.effect(()=>Wn(e.sessions.list,Hn),`ui-usage-billing: completion notifier`)}return n.UsageBilling=On,n.apply=Kn,n.inject=Gn,t.exports}});
|
|
6
6
|
//# sourceMappingURL=client.js.map
|