@kenz1117/dsh-ui-usage-billing 1.0.12 → 1.0.13

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 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/jsx-runtime"),i=e("react"),a=e("@deepseek-ai/dsh-client-ui-primitives"),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 ee(e){try{localStorage.setItem(v,JSON.stringify(e))}catch{}}let te=`dsh.ui-usage-billing.prices`;function b(){try{let e=localStorage.getItem(te);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);[i,a,o].every(e=>Number.isFinite(e)&&e>=0)&&n.push({key:e,...typeof r.origin==`string`&&r.origin!==``?{origin:r.origin}:{},input:i,cacheHit:a,output:o,...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 x(e){try{localStorage.setItem(te,JSON.stringify(e))}catch{}}let S=`@kenz1117/dsh-ui-usage-billing/UsageBilling.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(S)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=S,e.textContent=`.uejhGG_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}.uejhGG_railButton:hover,.uejhGG_railButton:focus-visible{border-color:var(--dsw-static-blue-500);color:var(--dsw-static-blue-500);outline:none}.uejhGG_railButton svg{stroke-width:2px;width:18px;height:18px}.uejhGG_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}.uejhGG_trigger:hover,.uejhGG_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)}.uejhGG_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}.uejhGG_triggerIcon svg{stroke-width:2px;width:16px;height:16px}.uejhGG_triggerMain{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.uejhGG_triggerPrimary{align-items:baseline;gap:5px;min-width:0;display:inline-flex}.uejhGG_triggerLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:11px;line-height:15px;overflow:hidden}.uejhGG_triggerYen{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;font-weight:600;line-height:16px}.uejhGG_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}.uejhGG_triggerSub{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:10px;line-height:14px;overflow:hidden}.uejhGG_triggerSpark{flex:none;align-items:flex-end;gap:2px;height:20px;display:flex}.uejhGG_triggerSparkBar,.uejhGG_triggerSparkHot{background:var(--dsw-static-blue-500);opacity:.6;border-radius:1px 1px 0 0;width:3px}.uejhGG_triggerSparkHot{opacity:1}.uejhGG_triggerWrap{flex:auto;width:100%;min-width:0;display:block;position:relative;container:uejhGG_billing-trigger/inline-size}@container uejhGG_billing-trigger (width<=200px){.uejhGG_trigger{gap:6px;padding:8px 10px}.uejhGG_triggerSpark{display:none}}@container uejhGG_billing-trigger (width<=170px){.uejhGG_triggerSub,.uejhGG_triggerLabel{display:none}}@container uejhGG_billing-trigger (width<=110px){.uejhGG_triggerIcon,.uejhGG_triggerSpark,.uejhGG_triggerSub,.uejhGG_triggerLabel{display:none}.uejhGG_trigger{justify-content:center;padding:8px 6px}}.uejhGG_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-2) 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)}.uejhGG_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 uejhGG_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}.uejhGG_triggerWrap:hover .uejhGG_triggerPop,.uejhGG_triggerWrap:focus-within .uejhGG_triggerPop{opacity:1;transform:translateY(0)}.uejhGG_popHead{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.uejhGG_popTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:700;line-height:18px}.uejhGG_metricGrid{grid-template-columns:repeat(3,1fr);gap:10px 8px;display:grid}.uejhGG_metricCell{flex-direction:column;gap:2px;min-width:0;display:flex}.uejhGG_metricLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.uejhGG_metricValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:12px;font-weight:700;line-height:16px}.uejhGG_metricValuePrimary{color:var(--dsw-static-amber-500)}.uejhGG_metricValueSuccess{color:var(--dsw-static-green-500)}.uejhGG_popModel{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:6px;padding-top:10px;display:flex}.uejhGG_popModelLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.uejhGG_popModelRow{align-items:center;gap:8px;min-width:0;display:flex}.uejhGG_popDot{border-radius:999px;flex:none;width:6px;height:6px}.uejhGG_popDotDirect{background:var(--dsw-static-green-500)}.uejhGG_popDotSub{background:var(--dsw-static-amber-500)}.uejhGG_popDotNeutral{background:var(--dsw-alias-label-tertiary)}.uejhGG_popTagPrimary,.uejhGG_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}.uejhGG_popTagPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.uejhGG_popTagSub{background:color-mix(in srgb, var(--dsw-static-amber-500) 18%, transparent);color:var(--dsw-static-amber-500)}.uejhGG_popModelName{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:16px;overflow:hidden}.uejhGG_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}.uejhGG_popModelStatusLow{color:var(--dsw-static-red-500)}.uejhGG_dashboardModal{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:16px;width:min(760px,100vw - 48px);max-height:min(760px,88vh);animation:.18s ease-out uejhGG_dashboardIn;box-shadow:0 12px 32px -12px #0000002e,0 2px 8px #0000000f}@keyframes uejhGG_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)}.uejhGG_dashboard{flex-direction:column;width:100%;max-height:min(760px,88vh);display:flex}.uejhGG_dashboardHead{border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:12px;padding:20px 24px;display:flex}.uejhGG_dashboardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:600;line-height:24px}.uejhGG_dashboardSubtitle{color:var(--dsw-alias-label-caption);margin:2px 0 0;font-size:11px;line-height:16px}.uejhGG_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}.uejhGG_closeButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.uejhGG_closeButton svg{stroke-width:2px;width:16px;height:16px}.uejhGG_dashboardBody{flex-direction:column;gap:14px;padding:16px 24px 24px;display:flex;overflow-y:auto}.uejhGG_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:12px 24px;font-size:11px;line-height:16px;display:flex}.uejhGG_tabNav{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:4px;padding:0 24px;display:flex}.uejhGG_tabButton{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:8px;margin:8px 0;padding:6px 12px;font-size:13px;font-weight:500;line-height:20px;transition:background-color .16s,color .16s}.uejhGG_tabButton:hover,.uejhGG_tabButton:focus-visible{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 62%, transparent);outline:none}.uejhGG_tabButtonActive,.uejhGG_tabButtonActive:hover,.uejhGG_tabButtonActive:focus-visible{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);font-weight:600}.uejhGG_tabPanel{flex-direction:column;gap:14px;animation:.14s ease-out uejhGG_tabPanelIn;display:flex}@keyframes uejhGG_tabPanelIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.uejhGG_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}.uejhGG_reconcileIcon{color:var(--dsw-alias-label-tertiary);flex:none;margin-top:1px;display:inline-flex}.uejhGG_reconcileText{flex:1}.uejhGG_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}.uejhGG_reconcileDismiss:hover{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent)}.uejhGG_hero{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:18px;padding:24px;display:flex;position:relative;overflow:hidden}.uejhGG_heroTop{justify-content:space-between;align-items:center;gap:24px;display:flex}.uejhGG_heroMain{flex-direction:column;gap:2px;min-width:0;display:flex}.uejhGG_heroLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:16px}.uejhGG_heroReadout{align-items:baseline;gap:4px;display:flex}.uejhGG_heroCurrency{letter-spacing:-.01em;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:22px;font-weight:600;line-height:28px}.uejhGG_heroValue{letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:40px;font-weight:700;line-height:48px}.uejhGG_heroMeta{color:var(--dsw-alias-label-caption);white-space:nowrap;margin-top:4px;font-size:12px;line-height:17px}.uejhGG_heroGauge{flex:none;width:96px;height:96px;position:relative}.uejhGG_heroGaugeSvg{width:100%;height:100%;display:block;transform:rotate(-90deg)}.uejhGG_heroGaugeTrack{fill:none;stroke:var(--dsw-alias-bg-module-platform);stroke-width:9px}.uejhGG_heroGaugeArc{fill:none;stroke:var(--dsw-static-blue-500);stroke-width:9px;stroke-linecap:round;transition:stroke-dasharray .26s}.uejhGG_heroGaugeArcOver{stroke:var(--dsw-static-red-500)}.uejhGG_heroGaugeCenter{flex-direction:column;justify-content:center;align-items:center;gap:1px;display:flex;position:absolute;inset:0}.uejhGG_heroGaugePct{letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);font-size:18px;font-weight:700;line-height:22px}.uejhGG_heroGaugePctOver{color:var(--dsw-static-red-500)}.uejhGG_heroGaugeLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.uejhGG_heroBudget{border-top:1px solid var(--dsw-alias-border-l1);align-items:center;gap:14px;padding-top:14px;display:flex}.uejhGG_heroBudgetLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px;line-height:16px}.uejhGG_heroBudgetTrack{background:var(--dsw-alias-border-l1);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.uejhGG_heroBudgetFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .22s}.uejhGG_heroBudgetFillOver{background:var(--dsw-static-red-500)}.uejhGG_heroBudgetValue{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px;line-height:16px}.uejhGG_heroSide{border-top:1px solid var(--dsw-alias-border-l1);align-items:stretch;padding-top:14px;display:flex}.uejhGG_heroSideItem{border-left:1px solid var(--dsw-alias-border-l1);flex-direction:column;flex:1;gap:3px;min-width:0;padding-left:16px;display:flex}.uejhGG_heroSideItem:first-child{border-left:none;padding-left:0}.uejhGG_heroSideLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:15px}.uejhGG_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:18px;font-weight:600;line-height:24px;display:inline-flex}.uejhGG_heroSideSpacer{flex:1;display:block}.uejhGG_delta{align-items:center;gap:2px;margin-left:4px;font-size:11px;font-weight:600;line-height:17px;display:inline-flex}.uejhGG_deltaUp{color:var(--dsw-static-green-500)}.uejhGG_deltaDown{color:var(--dsw-static-red-500)}.uejhGG_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}.uejhGG_kpiGrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;display:grid}.uejhGG_kpiTile{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:3px;padding:16px;transition:border-color .16s;display:flex;position:relative;overflow:hidden}.uejhGG_kpiTile:hover{border-color:var(--dsw-alias-border-l2)}.uejhGG_kpiLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:15px}.uejhGG_kpiValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:24px;font-weight:600;line-height:32px}.uejhGG_kpiGreen{color:var(--dsw-static-green-500)}.uejhGG_kpiDetail{color:var(--dsw-alias-label-caption);white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:15px;overflow:hidden}.uejhGG_panel{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:10px;padding:16px 18px;transition:border-color .16s;display:flex}.uejhGG_panelHead{justify-content:space-between;align-items:baseline;gap:10px;display:flex}.uejhGG_panelTitle{letter-spacing:-.005em;color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:600;line-height:20px}.uejhGG_panelHint{color:var(--dsw-alias-label-caption);white-space:nowrap;font-size:11px;line-height:16px}.uejhGG_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}.uejhGG_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}.uejhGG_rangeButtonActive{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);font-weight:600}.uejhGG_exportBar{justify-content:flex-end;align-items:center;gap:8px;display:flex}.uejhGG_exportLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:16px}.uejhGG_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}.uejhGG_exportButton:hover,.uejhGG_exportButton:focus-visible{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);outline:none}.uejhGG_shareTrack{background:var(--dsw-alias-bg-module-platform);border-radius:999px;height:10px;display:flex;overflow:hidden}.uejhGG_shareSeg{height:100%;transition:width .2s}.uejhGG_shareSegPeak{background:var(--dsw-static-blue-500)}.uejhGG_shareSegOff{background:color-mix(in srgb, var(--dsw-static-blue-500) 25%, var(--dsw-alias-bg-module-platform))}.uejhGG_shareSegUser{background:var(--dsw-static-blue-500)}.uejhGG_shareSegAssistant{background:var(--dsw-static-green-500)}.uejhGG_shareSegTool{background:var(--dsw-static-amber-500)}.uejhGG_shareLegend{align-items:center;gap:16px;display:flex}.uejhGG_shareItem{color:var(--dsw-alias-label-secondary);align-items:baseline;gap:6px;font-size:12px;line-height:17px;display:inline-flex}.uejhGG_bucketCost{align-items:baseline;gap:3px;display:inline-flex}.uejhGG_bucketOfficial{color:var(--dsw-static-blue-500);font-weight:600}.uejhGG_bucketSep{color:var(--dsw-alias-label-dimmed)}.uejhGG_bucketThird{color:var(--dsw-alias-label-secondary)}.uejhGG_shareDot{border-radius:50%;flex:none;align-self:center;width:8px;height:8px}.uejhGG_shareValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.uejhGG_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}.uejhGG_budgetInput:focus-visible{outline:none}.uejhGG_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}.uejhGG_switchOn{border-color:var(--dsw-alias-border-l1);background:var(--dsw-alias-label-primary)}.uejhGG_switchKnob{background:var(--dsw-static-neutral-bluish-00);border-radius:50%;width:11px;height:11px;transition:transform .16s;position:absolute;top:2px;left:2px}.uejhGG_switchOn .uejhGG_switchKnob{transform:translate(13px)}.uejhGG_budgetFillWarn{background:var(--dsw-static-amber-500)}.uejhGG_budgetFillOver{background:var(--dsw-static-red-500);animation:1.6s ease-in-out infinite uejhGG_budgetOverPulse}@keyframes uejhGG_budgetOverPulse{50%{opacity:.55}}.uejhGG_chartWrap{width:100%;position:relative}.uejhGG_chartSvg{width:100%;height:auto;display:block}.uejhGG_chartEmpty{height:140px;color:var(--dsw-alias-label-caption);justify-content:center;align-items:center;font-size:13px;display:flex}.uejhGG_emptyRow{text-align:center;color:var(--dsw-alias-label-caption);padding:28px 0;font-size:13px}.uejhGG_chartGrid{stroke:var(--dsw-alias-border-l1);stroke-width:1px}.uejhGG_chartAxisLabel{fill:var(--dsw-alias-label-tertiary);font-size:10px}.uejhGG_chartBar{fill:var(--dsw-static-blue-500);opacity:.7}.uejhGG_chartBar:hover{opacity:1}.uejhGG_chartStack{stroke:var(--dsw-alias-bg-layer-1);stroke-width:.75px}.uejhGG_chartStack:hover{opacity:.9}.uejhGG_chartLine{stroke:var(--dsw-static-blue-500);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.uejhGG_chartCrosshair{stroke:var(--dsw-alias-label-dimmed);stroke-width:1px;stroke-dasharray:3 3}.uejhGG_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))}.uejhGG_chartTooltipDate{color:var(--dsw-alias-label-primary);margin-bottom:3px;font-size:11px;font-weight:600}.uejhGG_chartTooltipRow{color:var(--dsw-alias-label-secondary);align-items:center;gap:5px;font-size:11px;line-height:17px;display:flex}.uejhGG_chartTooltipRow strong{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.uejhGG_chartBarPlaceholder{fill:color-mix(in srgb, var(--dsw-alias-label-secondary) 30%, transparent)}.uejhGG_chartLegendLine{background:var(--dsw-static-blue-500);border-radius:2px;width:10px;height:3px;display:inline-block}.uejhGG_chartLegendBar{background:var(--dsw-static-blue-500);opacity:.5;border-radius:2px;width:7px;height:7px;display:inline-block}.uejhGG_chartTooltipSwatch{border-radius:3px;flex:none;width:8px;height:8px;display:inline-block}.uejhGG_chartLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-end;gap:14px;margin-top:2px;font-size:11px;display:flex}.uejhGG_chartLegend span{align-items:center;gap:5px;display:inline-flex}.uejhGG_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}.uejhGG_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}.uejhGG_ubAlertLeft{align-items:center;gap:8px;display:inline-flex}.uejhGG_ubRate{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.uejhGG_ubAlertNote{color:var(--dsw-alias-label-secondary);margin:0}.uejhGG_ubTag,.uejhGG_ubTagSuccess,.uejhGG_ubTagNeutral,.uejhGG_ubTagAlert,.uejhGG_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}.uejhGG_ubTagSuccess{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.uejhGG_ubTagNeutral{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary)}.uejhGG_ubTagAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.uejhGG_ubTagPromo{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500);cursor:help}.uejhGG_ubExtraRow td{opacity:.72;padding-top:2px;padding-bottom:2px;font-size:12px}.uejhGG_ubExtraName{color:var(--dsw-alias-label-secondary);margin-left:26px}.uejhGG_ubExtraNote{color:var(--dsw-alias-label-tertiary);margin-left:8px;font-size:10px}.uejhGG_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}.uejhGG_ubCardHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.uejhGG_ubCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.uejhGG_ubCardSub{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.uejhGG_ubTablewrap{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;overflow:auto}.uejhGG_ubTable{border-collapse:collapse;white-space:nowrap;width:100%;font-size:12.5px}.uejhGG_ubTable th,.uejhGG_ubTable td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;padding:9px 12px}.uejhGG_ubTable tbody tr:last-child td{border-bottom:0}.uejhGG_ubTable thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;font-size:11px;font-weight:600}.uejhGG_ubModel{align-items:center;gap:8px;display:inline-flex}.uejhGG_vendorLogo{object-fit:contain;border-radius:4px;flex:none;width:18px;height:18px}.uejhGG_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}.uejhGG_ubModelName{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-weight:500;display:inline-flex}.uejhGG_ubPricepair{flex-wrap:wrap;gap:6px;display:inline-flex}.uejhGG_ubChipPeak,.uejhGG_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}.uejhGG_ubChipLabel{font-size:10px;font-weight:600}.uejhGG_ubChipPeak{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.uejhGG_ubChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.uejhGG_ubNotes{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.uejhGG_ubNotesItem{align-items:baseline;gap:10px;display:flex}.uejhGG_ubNotesTerm{color:var(--dsw-alias-label-primary);flex:0 0 72px;font-size:12px;font-weight:500}.uejhGG_ubNotesDesc{min-width:0;color:var(--dsw-alias-label-secondary);flex:1;font-size:12px;line-height:17px}.uejhGG_ubCardControlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.uejhGG_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}.uejhGG_ubStatGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.uejhGG_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}.uejhGG_ubStatLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.uejhGG_ubStatValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:22px;font-weight:700;line-height:28px}.uejhGG_ubStatDetail{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.uejhGG_rowlist{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.uejhGG_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}.uejhGG_rowline:hover{background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 60%, transparent);border-color:var(--dsw-alias-border-l1)}.uejhGG_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}.uejhGG_rowlineRight{font-variant-numeric:tabular-nums;flex:none;align-items:baseline;gap:8px;display:inline-flex}.uejhGG_rowlineMuted{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.uejhGG_rowlineChev{color:var(--dsw-alias-label-tertiary);font-size:14px}.uejhGG_rowlineDrillWrap{padding-left:12px}.uejhGG_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}.uejhGG_modelTable,.uejhGG_pricingTable{border-collapse:collapse;width:100%;font-size:12.5px}.uejhGG_modelTable th,.uejhGG_modelTable td,.uejhGG_pricingTable th,.uejhGG_pricingTable td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;white-space:nowrap;padding:9px 12px}.uejhGG_modelTable tbody tr:last-child td,.uejhGG_pricingTable tbody tr:last-child td{border-bottom:0}.uejhGG_modelTable thead th,.uejhGG_pricingTable thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;background:0 0;font-size:11px;font-weight:600}.uejhGG_modelTable tbody tr,.uejhGG_pricingTable tbody tr{transition:background-color .12s}.uejhGG_modelTable tbody tr:hover,.uejhGG_pricingTable tbody tr:hover{background:0 0}.uejhGG_numCol{text-align:right;font-variant-numeric:tabular-nums}.uejhGG_na{color:var(--dsw-alias-label-dimmed)}.uejhGG_modelCell{align-items:center;gap:8px;display:inline-flex}.uejhGG_modelDot{border-radius:50%;flex:none;width:9px;height:9px}.uejhGG_modelName{color:var(--dsw-alias-label-primary);font-weight:500;line-height:16px;display:block}.uejhGG_modelProvider{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px;display:block}.uejhGG_pricingToggle:hover .uejhGG_panelTitle,.uejhGG_pricingToggle:focus-visible .uejhGG_panelTitle{color:var(--dsw-alias-label-primary)}.uejhGG_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}.uejhGG_siteRowName{align-items:center;gap:8px;min-width:0;display:inline-flex}.uejhGG_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}.uejhGG_siteKindSite{color:var(--dsw-static-blue-500);background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent)}.uejhGG_siteKindDirect{color:var(--dsw-static-green-500);background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent)}.uejhGG_siteKindUnknown{color:var(--dsw-static-red-500);background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent)}.uejhGG_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}.uejhGG_siteRowMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.uejhGG_siteRowCost{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:12.5px;font-weight:700;line-height:18px}.uejhGG_siteRowCalls{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:11.5px;line-height:17px}.uejhGG_siteRowCallsLow{color:var(--dsw-static-red-500)}.uejhGG_flatTag{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px}.uejhGG_healthDot{border-radius:50%;flex:none;width:8px;height:8px;display:inline-block}.uejhGG_healthOk{background:var(--dsw-static-green-500)}.uejhGG_healthBad{background:var(--dsw-static-red-500)}.uejhGG_healthIdle{background:var(--dsw-static-neutral-bluish-400)}.uejhGG_dashboardRight{align-items:center;gap:8px;min-width:0;display:flex}.uejhGG_healthBadge{white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:3px 9px;font-size:11px;line-height:16px;display:inline-flex}.uejhGG_healthBadgeOk{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2)}.uejhGG_healthBadgeBad{color:var(--dsw-static-red-500);background:var(--dsw-alias-bg-layer-2)}.uejhGG_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}.uejhGG_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}.uejhGG_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}.uejhGG_feeBar{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);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}.uejhGG_feeCount{color:var(--dsw-alias-label-primary);font-weight:600}.uejhGG_feeSuffix{color:var(--dsw-alias-label-tertiary)}.uejhGG_feeItem{color:var(--dsw-alias-label-secondary);white-space:nowrap}.uejhGG_feeNum{color:var(--dsw-alias-label-primary)}.uejhGG_feeSep{color:var(--dsw-alias-label-tertiary)}.uejhGG_feeChipPrimary,.uejhGG_feeChipOff,.uejhGG_feeChipAlert,.uejhGG_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}.uejhGG_feeChipPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.uejhGG_feeChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.uejhGG_feeChipAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.uejhGG_feeChipError{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500)}.uejhGG_balanceCell{align-items:center;gap:6px;display:inline-flex;position:relative}.uejhGG_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}.uejhGG_balanceDaysBadge:hover{border-color:var(--dsw-alias-label-secondary);background:color-mix(in srgb, var(--dsw-alias-label-caption) 18%, transparent)}.uejhGG_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)}.uejhGG_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}.uejhGG_balanceDetailHead{justify-content:space-between;align-items:center;gap:12px;display:flex}.uejhGG_balanceDetailTitle{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600}.uejhGG_balanceDetailClose{cursor:pointer;color:var(--dsw-alias-label-caption);background:0 0;border:none;font-size:14px;line-height:1}.uejhGG_balanceDetailClose:hover{color:var(--dsw-alias-label-primary)}.uejhGG_balanceDetailGrid{flex-direction:column;gap:4px;display:inline-flex}.uejhGG_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}.uejhGG_balanceDetailLabel{color:var(--dsw-alias-label-caption)}.uejhGG_balanceDetailValue{color:var(--dsw-alias-label-primary);font-weight:500}body[data-zine-mode] .uejhGG_trigger,body[data-zine-mode] .uejhGG_triggerPop,body[data-zine-mode] .uejhGG_railButton{display:none}body[data-zine-mode] .uejhGG_dashboardHead{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .uejhGG_headTitleRow{align-items:center;gap:8px;margin-top:4px;display:flex}body[data-zine-mode] .uejhGG_dashboardTitle{color:#e8ff00;letter-spacing:.04em;text-transform:uppercase;text-shadow:0 0 8px #e8ff0066;font-weight:900}body[data-zine-mode] .uejhGG_dashboardSubtitle{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px}body[data-zine-mode] .uejhGG_closeButton{color:#0a0a05;background:#ff2d95;border:1.5px solid #ff2d95;border-radius:0;box-shadow:0 0 10px #ff2d9573}body[data-zine-mode] .uejhGG_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] .uejhGG_heroLabel{color:#c9d98a;letter-spacing:.12em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .uejhGG_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] .uejhGG_heroMeta{color:#c9d98a;letter-spacing:.06em;text-transform:uppercase;font-size:10.5px}body[data-zine-mode] .uejhGG_heroSideLabel{color:#c9d98a;letter-spacing:.1em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .uejhGG_heroSideValue{color:#e8ff00;text-shadow:0 0 6px #e8ff0059}body[data-zine-mode] .uejhGG_delta{font-weight:900}body[data-zine-mode] .uejhGG_deltaUp{color:#ff2d95}body[data-zine-mode] .uejhGG_deltaDown{color:#c9d98a}body[data-zine-mode] .uejhGG_tabNav{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .uejhGG_tabButton{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;border-radius:0;font-size:10.5px;font-weight:900}body[data-zine-mode] .uejhGG_tabButton:hover,body[data-zine-mode] .uejhGG_tabButton:focus-visible{color:#e8ff00;background:#e8ff001f}body[data-zine-mode] .uejhGG_tabButtonActive,body[data-zine-mode] .uejhGG_tabButtonActive:hover,body[data-zine-mode] .uejhGG_tabButtonActive:focus-visible{color:#0a0a05;background:#e8ff00;box-shadow:0 0 10px #e8ff0073}body[data-zine-mode] .uejhGG_panel{background:#000;border:2px solid #e8ff00;border-radius:0}body[data-zine-mode] .uejhGG_trendPanel{position:relative}body[data-zine-mode] .uejhGG_panelTitle{color:#e8ff00;letter-spacing:.06em;text-transform:uppercase;text-shadow:0 0 6px #e8ff0066;font-weight:900}body[data-zine-mode] .uejhGG_panelHint{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .uejhGG_modelTableScroll{background:#000;border:1.5px solid #e8ff0080;border-radius:0}.uejhGG_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}.uejhGG_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}.uejhGG_currencyButtonActive{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}.uejhGG_subscriptionGrid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin-top:10px;display:grid}.uejhGG_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}.uejhGG_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 uejhGG_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}@keyframes uejhGG_subscriptionGoldFlow{0%{background-position:200% 0}to{background-position:-200% 0}}.uejhGG_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}.uejhGG_subscriptionHead{flex-wrap:wrap;align-items:baseline;gap:6px;margin-bottom:8px;display:flex}.uejhGG_subscriptionName{font-size:13px;font-weight:700}.uejhGG_subscriptionPlan{color:var(--dsw-alias-label-secondary);font-size:11px}.uejhGG_subscriptionPlan[data-kind=code],.uejhGG_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}.uejhGG_subscriptionTier{color:var(--dsw-alias-label-secondary);margin-left:6px}.uejhGG_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}.uejhGG_subscriptionStatus{color:var(--dsw-alias-label-secondary);margin-bottom:6px;font-size:11px}.uejhGG_subscriptionWindow{align-items:center;gap:10px;margin-top:8px;font-size:11px;display:flex}.uejhGG_subscriptionWindowLabel{color:var(--dsw-alias-label-secondary);flex:0 0 44px}.uejhGG_subscriptionTrack{background:var(--dsw-alias-bg-layer-3);border-radius:3px;flex:1;height:6px;overflow:hidden}.uejhGG_subscriptionFill{background:var(--dsw-static-blue-500);border-radius:3px;height:100%;transition:width .2s;display:block}.uejhGG_subscriptionFillWarn{background:var(--dsw-static-amber-500)}.uejhGG_subscriptionFillOver{background:var(--dsw-static-red-500)}.uejhGG_subscriptionMeta{flex-direction:column;flex:none;align-items:flex-end;gap:2px;display:flex}.uejhGG_subscriptionPct{text-align:right;font-variant-numeric:tabular-nums;flex:none;min-width:52px}.uejhGG_subscriptionExhausted{color:var(--dsw-static-red-500);min-width:52px;font-weight:600}.uejhGG_subscriptionReset{color:var(--dsw-alias-label-caption);white-space:nowrap;flex:none;font-size:10px}.uejhGG_providerGroupList{flex-direction:column;gap:10px;display:flex}.uejhGG_providerGroup{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;padding:12px 14px}.uejhGG_providerGroupHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.uejhGG_providerGroupTitle{align-items:center;gap:7px;min-width:0;display:inline-flex}.uejhGG_providerGroupName{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px}.uejhGG_providerGroupMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.uejhGG_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}.uejhGG_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}.uejhGG_providerGroupBalanceLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:17px}.uejhGG_rounds{margin-top:10px}.uejhGG_roundsBars{align-items:flex-end;gap:3px;height:124px;padding:16px 2px 0;display:flex;overflow-x:auto}.uejhGG_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}.uejhGG_roundsBarColPeak{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent)}.uejhGG_roundsBarColOff{background:var(--dsw-alias-bg-module-platform)}.uejhGG_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%)}.uejhGG_roundsBarWrap{flex:1;align-items:flex-end;min-height:0;display:flex}.uejhGG_roundsBar{background:var(--dsw-static-blue-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.uejhGG_roundsBarFlagged{background:var(--dsw-static-red-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.uejhGG_roundsFlagMark{background:var(--dsw-static-red-500);border-radius:50%;width:7px;height:7px;position:absolute;top:-3px;right:-3px}.uejhGG_roundsAxis{color:var(--dsw-alias-label-secondary);justify-content:space-between;margin-top:6px;font-size:10px;display:flex}.uejhGG_roundsEmpty{color:var(--dsw-alias-label-secondary);margin-top:10px;font-size:12px}.uejhGG_heatmap{margin-top:10px}.uejhGG_heatmapGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;display:grid}.uejhGG_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}.uejhGG_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}.uejhGG_heatmapCell[data-level="0"],.uejhGG_heatmapCell[data-level="1"],.uejhGG_heatmapCell[data-level="2"]{color:var(--dsw-alias-label-primary)}.uejhGG_heatmapCell[data-level="3"],.uejhGG_heatmapCell[data-level="4"]{color:var(--dsw-static-neutral-bluish-00)}.uejhGG_heatmapFooter{color:var(--dsw-alias-label-secondary);align-items:center;gap:8px;margin-top:10px;font-size:10px;display:flex}.uejhGG_heatmapLegend{gap:3px;display:inline-flex}.uejhGG_heatmapLegend i{border-radius:4px;width:14px;height:14px;display:block}.uejhGG_heatmapHover{font-variant-numeric:tabular-nums;margin-left:auto}.uejhGG_heatmapRangeSwitch{gap:4px;margin-left:auto;display:inline-flex}.uejhGG_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}.uejhGG_heatmapRangeButtonActive{color:var(--dsw-alias-text-primary);border-color:currentColor;font-weight:600}.uejhGG_heatmapYear{flex-direction:column;gap:6px;display:flex}.uejhGG_heatmapYearBody{align-items:flex-start;gap:6px;display:flex}.uejhGG_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}.uejhGG_heatmapYearWeekday{white-space:nowrap;text-align:right;height:11px}.uejhGG_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}.uejhGG_heatmapYearMonth{white-space:nowrap;overflow:visible}.uejhGG_heatmapYearScroll{padding-bottom:2px;overflow-x:auto}.uejhGG_heatmapYearGrid{grid-template-rows:repeat(7,11px);grid-auto-flow:column;gap:3px;min-width:max-content;display:grid}.uejhGG_heatmapYearCell{cursor:pointer;border:0;border-radius:2px;width:11px;height:11px;padding:0}.uejhGG_triggerPopSubscription{width:auto;left:0;right:0}.uejhGG_floatSub{flex-direction:column;gap:6px;min-width:0;display:flex}.uejhGG_floatSubHead{flex-wrap:wrap;align-items:baseline;gap:6px;min-width:0;display:flex}.uejhGG_floatSubName{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:700}.uejhGG_floatSubPlan{color:var(--dsw-alias-label-secondary);font-size:10px}.uejhGG_floatSub .uejhGG_subscriptionWindow{flex-wrap:wrap;gap:4px 10px}.uejhGG_floatSub .uejhGG_subscriptionWindowLabel{flex:none}.uejhGG_floatSub .uejhGG_subscriptionMeta{min-width:0;max-width:100%}.uejhGG_floatSub .uejhGG_subscriptionPct{min-width:0}.uejhGG_floatSub .uejhGG_subscriptionReset{white-space:normal;overflow-wrap:anywhere}.uejhGG_triggerPopEmpty{color:var(--dsw-alias-label-tertiary);padding:2px 0;font-size:11px;line-height:1.5}.uejhGG_triggerPopSwitcher{justify-content:flex-end;align-items:center;gap:8px;margin-top:2px;display:flex}.uejhGG_triggerPopSwitchCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:10px}.uejhGG_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}.uejhGG_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)}.uejhGG_floatTarget{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:5px;font-size:12px;display:inline-flex}.uejhGG_floatTargetLabel{color:var(--dsw-alias-label-secondary)}.uejhGG_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}.uejhGG_plgHead{align-items:flex-start;gap:12px;display:flex}.uejhGG_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}.uejhGG_plgTitle{flex-direction:column;gap:4px;min-width:0;display:flex}.uejhGG_plgNameRow{align-items:center;gap:8px;display:flex}.uejhGG_plgName{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.uejhGG_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}.uejhGG_plgDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.uejhGG_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}.uejhGG_plgItem{flex-direction:column;gap:2px;min-width:0;display:flex}.uejhGG_plgLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.uejhGG_plgVal{color:var(--dsw-alias-label-primary);word-break:break-all;font-size:12px;line-height:17px}.uejhGG_plgLink{color:var(--dsw-static-blue-500);word-break:break-all;font-size:12px;line-height:17px;text-decoration:none}.uejhGG_plgLink:hover{text-decoration:underline}.uejhGG_tokenPanel{flex-direction:column;gap:14px;display:flex}.uejhGG_tokenModelBar{background:var(--dsw-alias-bg-layer-2);border-radius:999px;height:8px;overflow:hidden}.uejhGG_tokenModelParts{height:100%;display:flex}.uejhGG_tokenModelPartIn{background:var(--dsw-static-blue-500)}.uejhGG_tokenModelPartOut{background:var(--dsw-static-amber-500)}.uejhGG_tokenModelShareRow{align-items:center;gap:6px;display:inline-flex}@media (width<=640px){.uejhGG_kpiGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.uejhGG_hero{gap:14px}.uejhGG_heroTop{flex-direction:column;align-items:flex-start;gap:12px}.uejhGG_heroGauge{width:72px;height:72px}.uejhGG_heroSide{gap:12px}.uejhGG_heroSideSpacer{display:none}}.uejhGG_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 uejhGG_peakAlertIn;display:flex;position:fixed;box-shadow:0 4px 16px #00000014}.uejhGG_peakCardCorner{bottom:18px;right:18px}.uejhGG_peakCardCenter{top:20%;left:50%;transform:translate(-50%)}.uejhGG_peakCardPeak{color:var(--dsw-static-blue-500)}.uejhGG_peakCardOff{color:var(--dsw-static-green-500)}.uejhGG_peakHead{justify-content:space-between;align-items:center;gap:8px;display:flex}.uejhGG_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}.uejhGG_peakTagPrimary{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-blue-500)}.uejhGG_peakTagSuccess{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-green-500)}.uejhGG_peakDot{border-radius:999px;flex:none;width:6px;height:6px}.uejhGG_peakDotPrimary{background:var(--dsw-static-blue-500)}.uejhGG_peakDotSuccess{background:var(--dsw-static-green-500)}.uejhGG_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}.uejhGG_peakClose:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2)}.uejhGG_peakCount{font-variant-numeric:tabular-nums;font-size:28px;font-weight:700;line-height:34px}.uejhGG_peakCountPrimary{color:var(--dsw-static-blue-500)}.uejhGG_peakCountSuccess{color:var(--dsw-static-green-500)}.uejhGG_peakDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:18px}@keyframes uejhGG_peakAlertIn{0%{opacity:0}to{opacity:1}}.uejhGG_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}.uejhGG_setCardHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.uejhGG_setCardMeta{flex-direction:column;gap:4px;min-width:0;display:flex}.uejhGG_setCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.uejhGG_setCardDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.uejhGG_ctlCol{flex-direction:column;gap:10px;padding-top:2px;display:flex}.uejhGG_ctlRow{align-items:center;gap:12px;min-height:28px;display:flex}.uejhGG_ctlRowStretch{display:flex}.uejhGG_ctlLabel{color:var(--dsw-alias-label-secondary);flex:0 0 96px;font-size:11px;line-height:16px}.uejhGG_ctlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.uejhGG_userPriceRow{border-bottom:1px solid var(--dsw-alias-border-l1);flex-wrap:wrap;align-items:flex-end;gap:10px;padding:8px 0;display:flex}.uejhGG_userPriceField{flex-direction:column;gap:4px;min-width:0;display:flex}.uejhGG_userPriceField .uejhGG_ctlLabel{flex:none;font-size:11px}.uejhGG_userPriceInput,.uejhGG_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}.uejhGG_userPriceInputNum{min-width:72px;max-width:88px}.uejhGG_userPriceRemove{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-static-red-400);cursor:pointer;background:0 0;border-radius:6px;align-self:center;padding:4px 8px;font-size:11px;line-height:16px}.uejhGG_userPriceRemove:hover{border-color:var(--dsw-static-red-400)}.uejhGG_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}.uejhGG_rdo input{opacity:0;pointer-events:none;position:absolute}.uejhGG_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}.uejhGG_rdo input:checked+.uejhGG_rdoDot{border-color:var(--dsw-static-blue-500)}.uejhGG_rdo input:checked+.uejhGG_rdoDot:after{content:"";background:var(--dsw-static-blue-500);border-radius:50%;position:absolute;inset:3px}.uejhGG_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}.uejhGG_affix{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.uejhGG_prog{background:var(--dsw-alias-bg-module-platform);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.uejhGG_progFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .2s}.uejhGG_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}.uejhGG_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))}`,document.head.appendChild(e)}var C={chartCrosshair:`uejhGG_chartCrosshair`,subscriptionCard:`uejhGG_subscriptionCard`,rounds:`uejhGG_rounds`,tabButton:`uejhGG_tabButton`,heroGauge:`uejhGG_heroGauge`,chartBar:`uejhGG_chartBar`,chartStack:`uejhGG_chartStack`,ubAlertLeft:`uejhGG_ubAlertLeft`,rowlineDrillWrap:`uejhGG_rowlineDrillWrap`,siteRowMeta:`uejhGG_siteRowMeta`,subscriptionStatus:`uejhGG_subscriptionStatus`,subscriptionMeta:`uejhGG_subscriptionMeta`,floatModeBtn:`uejhGG_floatModeBtn`,plgTitle:`uejhGG_plgTitle`,tokenModelPartIn:`uejhGG_tokenModelPartIn`,peakDesc:`uejhGG_peakDesc`,peakCountSuccess:`uejhGG_peakCountSuccess`,ubExtraName:`uejhGG_ubExtraName`,prog:`uejhGG_prog`,triggerSub:`uejhGG_triggerSub`,roundsFlagMark:`uejhGG_roundsFlagMark`,heatmapYearBody:`uejhGG_heatmapYearBody`,peakCard:`uejhGG_peakCard`,popModelStatus:`uejhGG_popModelStatus`,ubTagSuccess:`uejhGG_ubTagSuccess`,subscriptionWindowLabel:`uejhGG_subscriptionWindowLabel`,flatTag:`uejhGG_flatTag`,siteRowTitle:`uejhGG_siteRowTitle`,triggerPopSubscription:`uejhGG_triggerPopSubscription`,peakCountPrimary:`uejhGG_peakCountPrimary`,ctlLabel:`uejhGG_ctlLabel`,inp:`uejhGG_inp`,triggerSparkHot:`uejhGG_triggerSparkHot`,shareSegAssistant:`uejhGG_shareSegAssistant`,shareValue:`uejhGG_shareValue`,dashboardIn:`uejhGG_dashboardIn`,subscriptionExhausted:`uejhGG_subscriptionExhausted`,peakClose:`uejhGG_peakClose`,ctlGroup:`uejhGG_ctlGroup`,healthBadgeOk:`uejhGG_healthBadgeOk`,heroLabel:`uejhGG_heroLabel`,ubNotes:`uejhGG_ubNotes`,uncataloguedTag:`uejhGG_uncataloguedTag`,setCardHead:`uejhGG_setCardHead`,popDotSub:`uejhGG_popDotSub`,feeChipOff:`uejhGG_feeChipOff`,subscriptionHead:`uejhGG_subscriptionHead`,ctlRow:`uejhGG_ctlRow`,ctlRowStretch:`uejhGG_ctlRowStretch`,numCol:`uejhGG_numCol`,triggerPop:`uejhGG_triggerPop`,shareLegend:`uejhGG_shareLegend`,vendorLetter:`uejhGG_vendorLetter`,popTagSub:`uejhGG_popTagSub`,heatmapYearCell:`uejhGG_heatmapYearCell`,heatmapLegend:`uejhGG_heatmapLegend`,heroMain:`uejhGG_heroMain`,triggerSpark:`uejhGG_triggerSpark`,ubModelName:`uejhGG_ubModelName`,rowlineMuted:`uejhGG_rowlineMuted`,closeButton:`uejhGG_closeButton`,heroSideSpacer:`uejhGG_heroSideSpacer`,siteKindSite:`uejhGG_siteKindSite`,heroValue:`uejhGG_heroValue`,healthBadge:`uejhGG_healthBadge`,balanceDetailRow:`uejhGG_balanceDetailRow`,reconcileNotice:`uejhGG_reconcileNotice`,providerGroupTitle:`uejhGG_providerGroupTitle`,roundsBarColPeak:`uejhGG_roundsBarColPeak`,metricValue:`uejhGG_metricValue`,ubAlertNote:`uejhGG_ubAlertNote`,plgGrid:`uejhGG_plgGrid`,heroSideValue:`uejhGG_heroSideValue`,peakAlertIn:`uejhGG_peakAlertIn`,dashboardSubtitle:`uejhGG_dashboardSubtitle`,subscriptionGrid:`uejhGG_subscriptionGrid`,plgHead:`uejhGG_plgHead`,ubStatValue:`uejhGG_ubStatValue`,triggerPrimary:`uejhGG_triggerPrimary`,budgetFillOver:`uejhGG_budgetFillOver`,siteRow:`uejhGG_siteRow`,feeChipAlert:`uejhGG_feeChipAlert`,triggerIcon:`uejhGG_triggerIcon`,rowlineDrill:`uejhGG_rowlineDrill`,popTagPrimary:`uejhGG_popTagPrimary`,heroGaugeSvg:`uejhGG_heroGaugeSvg`,bucketOfficial:`uejhGG_bucketOfficial`,metricValueSuccess:`uejhGG_metricValueSuccess`,heroGaugeLabel:`uejhGG_heroGaugeLabel`,feeBar:`uejhGG_feeBar`,balanceDetailValue:`uejhGG_balanceDetailValue`,siteRowCallsLow:`uejhGG_siteRowCallsLow`,ubTablewrap:`uejhGG_ubTablewrap`,triggerMetric:`uejhGG_triggerMetric`,triggerSparkBar:`uejhGG_triggerSparkBar`,rowlineChev:`uejhGG_rowlineChev`,providerGroupBadge:`uejhGG_providerGroupBadge`,tokenPanel:`uejhGG_tokenPanel`,peakTagPrimary:`uejhGG_peakTagPrimary`,subscriptionName:`uejhGG_subscriptionName`,hero:`uejhGG_hero`,providerGroupName:`uejhGG_providerGroupName`,plgLink:`uejhGG_plgLink`,healthDot:`uejhGG_healthDot`,rangeButtonActive:`uejhGG_rangeButtonActive`,metricLabel:`uejhGG_metricLabel`,popHead:`uejhGG_popHead`,heroBudgetLabel:`uejhGG_heroBudgetLabel`,ubCardTitle:`uejhGG_ubCardTitle`,rowline:`uejhGG_rowline`,siteKindTag:`uejhGG_siteKindTag`,kpiGrid:`uejhGG_kpiGrid`,siteKindDirect:`uejhGG_siteKindDirect`,dashboardBody:`uejhGG_dashboardBody`,panelTitle:`uejhGG_panelTitle`,healthIdle:`uejhGG_healthIdle`,peakTag:`uejhGG_peakTag`,currencyButton:`uejhGG_currencyButton`,floatSub:`uejhGG_floatSub`,heroMeta:`uejhGG_heroMeta`,feeSuffix:`uejhGG_feeSuffix`,btn:`uejhGG_btn`,heroGaugeTrack:`uejhGG_heroGaugeTrack`,peakCardCorner:`uejhGG_peakCardCorner`,feeChipPrimary:`uejhGG_feeChipPrimary`,heroTop:`uejhGG_heroTop`,triggerPopSwitcher:`uejhGG_triggerPopSwitcher`,siteKindUnknown:`uejhGG_siteKindUnknown`,kpiValue:`uejhGG_kpiValue`,floatSubPlan:`uejhGG_floatSubPlan`,ubCardControlGroup:`uejhGG_ubCardControlGroup`,chartLegendLine:`uejhGG_chartLegendLine`,panelHint:`uejhGG_panelHint`,rangeButton:`uejhGG_rangeButton`,chartTooltipSwatch:`uejhGG_chartTooltipSwatch`,currencyToggle:`uejhGG_currencyToggle`,popTitle:`uejhGG_popTitle`,rangeToggle:`uejhGG_rangeToggle`,na:`uejhGG_na`,balanceDetailLabel:`uejhGG_balanceDetailLabel`,peakTagSuccess:`uejhGG_peakTagSuccess`,heatmapYearMonths:`uejhGG_heatmapYearMonths`,kpiDetail:`uejhGG_kpiDetail`,subscriptionTrack:`uejhGG_subscriptionTrack`,heatmapYearWeekdays:`uejhGG_heatmapYearWeekdays`,peakCardOff:`uejhGG_peakCardOff`,chartWrap:`uejhGG_chartWrap`,feeChipError:`uejhGG_feeChipError`,plgTag:`uejhGG_plgTag`,subscriptionFillWarn:`uejhGG_subscriptionFillWarn`,plgItem:`uejhGG_plgItem`,chartAxisLabel:`uejhGG_chartAxisLabel`,tokenModelShareRow:`uejhGG_tokenModelShareRow`,chartLine:`uejhGG_chartLine`,trigger:`uejhGG_trigger`,ubStatGrid:`uejhGG_ubStatGrid`,roundsBarWrap:`uejhGG_roundsBarWrap`,heatmapGrid:`uejhGG_heatmapGrid`,dashboard:`uejhGG_dashboard`,planTag:`uejhGG_planTag`,ubAlert:`uejhGG_ubAlert`,exportButton:`uejhGG_exportButton`,triggerYen:`uejhGG_triggerYen`,tabPanelIn:`uejhGG_tabPanelIn`,shareSegPeak:`uejhGG_shareSegPeak`,rowlist:`uejhGG_rowlist`,dashboardRight:`uejhGG_dashboardRight`,tabNav:`uejhGG_tabNav`,modalFooter:`uejhGG_modalFooter`,heroBudget:`uejhGG_heroBudget`,kpiTile:`uejhGG_kpiTile`,ubTagAlert:`uejhGG_ubTagAlert`,rowlineRight:`uejhGG_rowlineRight`,currencyButtonActive:`uejhGG_currencyButtonActive`,triggerPopEmpty:`uejhGG_triggerPopEmpty`,heroBudgetTrack:`uejhGG_heroBudgetTrack`,modelTable:`uejhGG_modelTable`,healthOk:`uejhGG_healthOk`,chartTooltipRow:`uejhGG_chartTooltipRow`,providerGroupList:`uejhGG_providerGroupList`,floatTarget:`uejhGG_floatTarget`,heroCurrency:`uejhGG_heroCurrency`,subscriptionPlan:`uejhGG_subscriptionPlan`,providerGroupHead:`uejhGG_providerGroupHead`,heatmapYearMonth:`uejhGG_heatmapYearMonth`,heroGaugePctOver:`uejhGG_heroGaugePctOver`,ubPricepair:`uejhGG_ubPricepair`,setCard:`uejhGG_setCard`,setCardDesc:`uejhGG_setCardDesc`,progFill:`uejhGG_progFill`,shareSeg:`uejhGG_shareSeg`,bucketSep:`uejhGG_bucketSep`,rowlineName:`uejhGG_rowlineName`,rdo:`uejhGG_rdo`,reconcileText:`uejhGG_reconcileText`,peakCardPeak:`uejhGG_peakCardPeak`,tokenModelBar:`uejhGG_tokenModelBar`,subscriptionFillOver:`uejhGG_subscriptionFillOver`,plgName:`uejhGG_plgName`,kpiGreen:`uejhGG_kpiGreen`,triggerLabel:`uejhGG_triggerLabel`,balanceDetailHead:`uejhGG_balanceDetailHead`,triggerPopSwitchCount:`uejhGG_triggerPopSwitchCount`,providerGroupBalance:`uejhGG_providerGroupBalance`,ubNotesTerm:`uejhGG_ubNotesTerm`,heatmapYearScroll:`uejhGG_heatmapYearScroll`,floatModeBtnOn:`uejhGG_floatModeBtnOn`,balanceDaysBadgeLow:`uejhGG_balanceDaysBadgeLow`,userPriceRemove:`uejhGG_userPriceRemove`,switchOn:`uejhGG_switchOn`,ubStatDetail:`uejhGG_ubStatDetail`,feeSep:`uejhGG_feeSep`,budgetOverPulse:`uejhGG_budgetOverPulse`,pricingTable:`uejhGG_pricingTable`,plgVal:`uejhGG_plgVal`,roundsBarColOff:`uejhGG_roundsBarColOff`,exportLabel:`uejhGG_exportLabel`,roundsBarCol:`uejhGG_roundsBarCol`,affix:`uejhGG_affix`,chartBarPlaceholder:`uejhGG_chartBarPlaceholder`,chartLegendBar:`uejhGG_chartLegendBar`,unpricedHint:`uejhGG_unpricedHint`,ubModel:`uejhGG_ubModel`,switch:`uejhGG_switch`,providerGroupBalanceLabel:`uejhGG_providerGroupBalanceLabel`,heatmapYearGrid:`uejhGG_heatmapYearGrid`,subscriptionFill:`uejhGG_subscriptionFill`,plgIcon:`uejhGG_plgIcon`,roundsBarFlagged:`uejhGG_roundsBarFlagged`,heroBudgetFillOver:`uejhGG_heroBudgetFillOver`,bucketCost:`uejhGG_bucketCost`,heroGaugeArcOver:`uejhGG_heroGaugeArcOver`,ctlCol:`uejhGG_ctlCol`,heroBudgetFill:`uejhGG_heroBudgetFill`,shareTrack:`uejhGG_shareTrack`,tabButtonActive:`uejhGG_tabButtonActive`,pricingToggle:`uejhGG_pricingToggle`,deltaDown:`uejhGG_deltaDown`,plgNameRow:`uejhGG_plgNameRow`,exportBar:`uejhGG_exportBar`,chartSvg:`uejhGG_chartSvg`,ubChipOff:`uejhGG_ubChipOff`,ubStatCard:`uejhGG_ubStatCard`,shareSegUser:`uejhGG_shareSegUser`,roundsBarLabel:`uejhGG_roundsBarLabel`,heatmapHover:`uejhGG_heatmapHover`,ubTable:`uejhGG_ubTable`,healthBad:`uejhGG_healthBad`,subscriptionGoldFlow:`uejhGG_subscriptionGoldFlow`,shareItem:`uejhGG_shareItem`,reconcileDismiss:`uejhGG_reconcileDismiss`,dashboardTitle:`uejhGG_dashboardTitle`,heroGaugeArc:`uejhGG_heroGaugeArc`,popModelLabel:`uejhGG_popModelLabel`,siteRowCalls:`uejhGG_siteRowCalls`,roundsBars:`uejhGG_roundsBars`,popModelStatusLow:`uejhGG_popModelStatusLow`,balanceDaysBadge:`uejhGG_balanceDaysBadge`,subscriptionReset:`uejhGG_subscriptionReset`,heatmapFooter:`uejhGG_heatmapFooter`,heroGaugePct:`uejhGG_heroGaugePct`,floatSubName:`uejhGG_floatSubName`,floatTargetLabel:`uejhGG_floatTargetLabel`,tokenModelPartOut:`uejhGG_tokenModelPartOut`,peakCardCenter:`uejhGG_peakCardCenter`,peakDot:`uejhGG_peakDot`,heatmap:`uejhGG_heatmap`,userPriceInput:`uejhGG_userPriceInput`,kpiLabel:`uejhGG_kpiLabel`,chartGrid:`uejhGG_chartGrid`,balanceCell:`uejhGG_balanceCell`,"billing-trigger":`uejhGG_billing-trigger`,staleNotice:`uejhGG_staleNotice`,shareSegTool:`uejhGG_shareSegTool`,delta:`uejhGG_delta`,subscriptionPct:`uejhGG_subscriptionPct`,triggerWrap:`uejhGG_triggerWrap`,triggerMain:`uejhGG_triggerMain`,ubCardSub:`uejhGG_ubCardSub`,modelDot:`uejhGG_modelDot`,metricGrid:`uejhGG_metricGrid`,subscriptionTier:`uejhGG_subscriptionTier`,emptyRow:`uejhGG_emptyRow`,switchKnob:`uejhGG_switchKnob`,ubCardHead:`uejhGG_ubCardHead`,balanceDetailPop:`uejhGG_balanceDetailPop`,heatmapCellEmpty:`uejhGG_heatmapCellEmpty`,ubRate:`uejhGG_ubRate`,panel:`uejhGG_panel`,peakHead:`uejhGG_peakHead`,popDotNeutral:`uejhGG_popDotNeutral`,roundsAxis:`uejhGG_roundsAxis`,tabPanel:`uejhGG_tabPanel`,budgetFillWarn:`uejhGG_budgetFillWarn`,heroSideItem:`uejhGG_heroSideItem`,tokenModelParts:`uejhGG_tokenModelParts`,providerGroup:`uejhGG_providerGroup`,subscriptionWindow:`uejhGG_subscriptionWindow`,healthBadgeBad:`uejhGG_healthBadgeBad`,peakDotPrimary:`uejhGG_peakDotPrimary`,modelTableScroll:`uejhGG_modelTableScroll`,popDotDirect:`uejhGG_popDotDirect`,peakCount:`uejhGG_peakCount`,setCardMeta:`uejhGG_setCardMeta`,peakDotSuccess:`uejhGG_peakDotSuccess`,userPriceField:`uejhGG_userPriceField`,balanceDetailGrid:`uejhGG_balanceDetailGrid`,balanceDetailClose:`uejhGG_balanceDetailClose`,ubTagNeutral:`uejhGG_ubTagNeutral`,siteRowCost:`uejhGG_siteRowCost`,headTitleRow:`uejhGG_headTitleRow`,popModel:`uejhGG_popModel`,roundsBar:`uejhGG_roundsBar`,heatmapRangeSwitch:`uejhGG_heatmapRangeSwitch`,reconcileIcon:`uejhGG_reconcileIcon`,userPriceRow:`uejhGG_userPriceRow`,modelCell:`uejhGG_modelCell`,ubExtraRow:`uejhGG_ubExtraRow`,feeCount:`uejhGG_feeCount`,floatSubHead:`uejhGG_floatSubHead`,heroSideLabel:`uejhGG_heroSideLabel`,metricValuePrimary:`uejhGG_metricValuePrimary`,deltaUp:`uejhGG_deltaUp`,chartTooltipDate:`uejhGG_chartTooltipDate`,dashboardHead:`uejhGG_dashboardHead`,feeNum:`uejhGG_feeNum`,heroReadout:`uejhGG_heroReadout`,panelHead:`uejhGG_panelHead`,popModelRow:`uejhGG_popModelRow`,siteRowName:`uejhGG_siteRowName`,tableScroll:`uejhGG_tableScroll`,ubChipLabel:`uejhGG_ubChipLabel`,dashboardModal:`uejhGG_dashboardModal`,heroBudgetValue:`uejhGG_heroBudgetValue`,chartEmpty:`uejhGG_chartEmpty`,ubTagPromo:`uejhGG_ubTagPromo`,vendorLogo:`uejhGG_vendorLogo`,ubStatLabel:`uejhGG_ubStatLabel`,modelName:`uejhGG_modelName`,feeItem:`uejhGG_feeItem`,railButton:`uejhGG_railButton`,ubTagError:`uejhGG_ubTagError`,providerGroupMeta:`uejhGG_providerGroupMeta`,heatmapCell:`uejhGG_heatmapCell`,setCardTitle:`uejhGG_setCardTitle`,heatmapRangeButtonActive:`uejhGG_heatmapRangeButtonActive`,plgLabel:`uejhGG_plgLabel`,heroGaugeCenter:`uejhGG_heroGaugeCenter`,rdoDot:`uejhGG_rdoDot`,trendPanel:`uejhGG_trendPanel`,subscriptionAuto:`uejhGG_subscriptionAuto`,heatmapRangeButton:`uejhGG_heatmapRangeButton`,userPriceInputNum:`uejhGG_userPriceInputNum`,heroSide:`uejhGG_heroSide`,balanceDetailTitle:`uejhGG_balanceDetailTitle`,popDot:`uejhGG_popDot`,estimatedTag:`uejhGG_estimatedTag`,roundsEmpty:`uejhGG_roundsEmpty`,bucketThird:`uejhGG_bucketThird`,heatmapYearWeekday:`uejhGG_heatmapYearWeekday`,budgetInput:`uejhGG_budgetInput`,ubChipPeak:`uejhGG_ubChipPeak`,shareDot:`uejhGG_shareDot`,ubNotesItem:`uejhGG_ubNotesItem`,chartLegend:`uejhGG_chartLegend`,ubTag:`uejhGG_ubTag`,ubCard:`uejhGG_ubCard`,heatmapYear:`uejhGG_heatmapYear`,metricCell:`uejhGG_metricCell`,ubExtraNote:`uejhGG_ubExtraNote`,chartTooltip:`uejhGG_chartTooltip`,plgDesc:`uejhGG_plgDesc`,shareSegOff:`uejhGG_shareSegOff`,modelProvider:`uejhGG_modelProvider`,ubNotesDesc:`uejhGG_ubNotesDesc`,popModelName:`uejhGG_popModelName`};let w={"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`}},T={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 ne(e){return e===``?e:T[e]??e}function re(e){let t=w[ne(e)];return t?.type===`code`?t.tier:void 0}let ie=[{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}],E,ae,oe,se,D;function O(e){D=e.length>0?e:void 0}function ce(){return D}function k(e){return F(e)}function A(e,t){if(D===void 0)return;let n=k(e),r=N(n);if(t!==void 0){for(let e of D)if(!(e.origin===void 0||e.origin===``)&&(k(e.key)===n||N(e.key)===r)&&e.origin===t)return{input:e.input,cacheHit:e.cacheHit,output:e.output,...e.currency===void 0?{}:{currency:e.currency}}}for(let e of D)if(!(e.origin!==void 0&&e.origin!==``)&&(k(e.key)===n||N(e.key)===r))return{input:e.input,cacheHit:e.cacheHit,output:e.output,...e.currency===void 0?{}:{currency:e.currency}}}function le(e){E=typeof e.rate==`number`&&Number.isFinite(e.rate)&&e.rate>0?e.rate:void 0,ae=e.prices,oe=e.extraModels}function ue(e){se=e}function de(){return E??6.79}function fe(){return{rate:de(),live:E!==void 0}}function pe(e){return e>=9&&e<12||e>=14&&e<18}function me(e){return e==null||!Number.isFinite(e)?`peak`:he(e)?`offPeak`:pe((new Date(e).getUTCHours()+8)%24)?`peak`:`offPeak`}function he(e){let t=new Date(e+8*36e5).getUTCDay();return t===0||t===6}function ge(e){let t=new Date(e+8*36e5),n=t.getUTCDay(),r=t.getUTCHours()*36e5+t.getUTCMinutes()*6e4+t.getUTCSeconds()*1e3+t.getUTCMilliseconds();return(n===0?1:2)*864e5-r+9*36e5}let _e=[540,720,840,1080];function ve(e){return((e+8*36e5)%864e5+864e5)%864e5}function ye(e){if(he(e))return{tier:`offPeak`,nextSwitchInMs:ge(e)};let t=ve(e);for(let n of _e){let r=n*6e4;if(t<r)return{tier:me(e),nextSwitchInMs:r-t}}let n=_e[0]??0;return{tier:me(e),nextSwitchInMs:864e5-t+n*6e4}}function be(e,t){let{nextSwitchInMs:n}=ye(e);if(n>t)return null;let r=e+n;return{entering:me(r),atMs:r}}function j(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 M=[{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}}],xe={"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 N(e){return String(e).toLowerCase().replace(/\([^)]*\)/g,``).replace(/[^a-z0-9]+/g,``)}let P=(()=>{let e=new Map,t=(t,n)=>{let r=N(t);r!==``&&!e.has(r)&&e.set(r,n)};for(let e of M)t(e.key,e.key);for(let[e,n]of Object.entries(xe))t(e,n);for(let e of ie)t(e.key,e.key);return e})();function F(e){let t=xe[e]??e;if(t===e){let t=N(e);if(t!==``){let e=P.get(t);if(e!==void 0)return e;let n=(oe??[]).find(e=>N(e.key)===t);if(n!==void 0)return n.key}}return t}function I(e){let t=F(e),n=ae?.[t];if(n!==void 0)return n;let r=ie.find(e=>e.key.toLowerCase()===t.toLowerCase());if(r!==void 0)return{input:r.input,cacheHit:r.cacheHit,output:r.output}}function Se(e){let t=F(e),n=M.find(e=>e.key===t),r=oe?.find(e=>e.key===t),i=n??(r===void 0?(()=>{let e=M.at(-1);if(e!==void 0)return e;throw Error(`MODEL_CATALOG must not be empty`)})():L(r)),a=A(t);if(a!==void 0)return{...i,userPriced:!0,price:{currency:a.currency??`CNY`,input:a.input,cacheHit:a.cacheHit,output:a.output}};let o=I(t);return o===void 0?i:{...i,price:{currency:`USD`,input:o.input,cacheHit:o.cacheHit,output:o.output}}}function L(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 Ce(e,t){let n=e.endsAtMs!==void 0&&t>=e.endsAtMs;return Number.isFinite(t)&&!n&&e.factor>0&&e.factor<1}function we(e,t){let{promo:n}=e;if(n===void 0||!Ce(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 Te(e=Date.now()){let t=[...M.map(t=>we(t,e))],n=new Set(t.map(e=>e.key.toLowerCase())),r=new Set(t.map(e=>N(e.key)));for(let e of se??[]){let i=e.id.toLowerCase();if((()=>{let t=F(e.id);return M.find(e=>e.key===t)})()!==void 0)continue;let a=N(e.id);if(n.has(i)||a!==``&&r.has(a))continue;let o=(oe??[]).find(e=>N(e.key)===a),s;if(o!==void 0)s=L(o),e.name!==void 0&&e.name!==``&&(s={...s,name:e.name});else{let t=I(i);s=t===void 0?{key:F(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=A(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 Ee(e){let t=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return t===``?`#8b95a3`:t}function De(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*de():a}function Oe(e,t,n=.5,r=Date.now()){let i=we(e,r),a=De(i.price,t,i.price.currency),o=i.price.offPeak===void 0?a:De(i.price.offPeak,t,i.price.currency);return a*n+o*(1-n)}function R(e){let t=de();return t>0?e/t:e}function z(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 ke(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 Ae(e,t,n,r){return r<=0||!Number.isFinite(r)||t===(n===`usd`?`USD`:`CNY`)?e:n===`usd`?e/r:e*r}function B(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 je(e){let t=Number(e);return Number.isFinite(t)?`${t.toFixed(1)}%`:`0.0%`}let V={top:18,right:40,bottom:26,left:46};function Me(e){let[,t,n]=e.split(`-`);return`${Number(t)}/${Number(n)}`}function H(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}function Ne(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 Pe={key:`__total__`,name:`总计`,color:``};function Fe({data:e,models:t=[],currency:n=`cny`,metric:a=`cost`}){let[o,s]=(0,i.useState)(null),c=e=>z(n===`usd`?R(e):e,n),l=e=>a===`tokens`?H(e):c(e),u=e=>a===`tokens`?e.tokens??0:e.cost,d=(0,i.useMemo)(()=>{let n=e.length;if(n===0)return null;let r=680-V.left-V.right,i=220-V.top-V.bottom,o=e=>n===1?V.left+r/2:V.left+r*e/(n-1),s=Math.max(...a===`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=>V.top+i-e/s*i,l=Math.max(...e.map(e=>e.calls),1),d=e=>V.top+i-e/l*i,f=r/n,p=Math.min(18,f*.6);return{n,plotW:r,plotH:i,inner:o,yCost:c,yCalls:d,barW:p,bars:e.flatMap((e,n)=>{let r=o(n)-p/2;if(t.length===0||a===`tokens`)return[{date:e.date,model:Pe,x:r,base:0,value:u(e),topRounded:!0}];let i=null;for(let n of t)(e.byModel?.[n.key]??0)>0&&(i=n.key);let s=0;return t.map(t=>{let n=e.byModel?.[t.key]??0,a={date:e.date,model:t,x:r,base:s,value:n,topRounded:t.key===i};return s+=n,a})}),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,a]);if(d===null)return(0,r.jsx)(`div`,{className:C.chartEmpty,children:`暂无趋势数据`});let{n:f,plotW:p,plotH:m,inner:h,yCost:g,yCalls:_,barW:v,bars:y,costTicks:ee,callsTicks:te,linePath:b}=d,x=o===null?void 0:e[o],S=Ne(f,Math.max(1,Math.ceil(f/8)));return(0,r.jsxs)(`div`,{className:C.chartWrap,children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 680 220`,className:C.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-V.left)/p,r=Math.round(n*(f-1));s(Math.min(Math.max(r,0),f-1))},children:[ee.map((e,t)=>{let n=g(e);return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`line`,{x1:V.left,x2:680-V.right,y1:n,y2:n,className:C.chartGrid}),(0,r.jsx)(`text`,{x:V.left-8,y:n+3,textAnchor:`end`,className:C.chartAxisLabel,children:l(e)})]},`cost-${t}`)}),y.map(t=>{if(t.value>0)return(0,r.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===``?C.chartBar:C.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,r.jsx)(`rect`,{x:t.x,y:g(0)-1,width:v,height:1,rx:0,className:C.chartBarPlaceholder},`${t.date}-${t.model.key}-placeholder`):null}),(0,r.jsx)(`path`,{d:b,fill:`none`,className:C.chartLine}),te.map((e,t)=>{let n=_(e);return(0,r.jsx)(`text`,{x:680-V.right+8,y:n+3,textAnchor:`start`,className:C.chartAxisLabel,children:H(e)},`calls-${t}`)}),S.map(t=>{let n=e[t];return n===void 0?null:(0,r.jsx)(`text`,{x:h(t),y:214,textAnchor:`middle`,className:C.chartAxisLabel,children:Me(n.date)},n.date)}),o!==null&&(0,r.jsx)(`line`,{x1:h(o),x2:h(o),y1:V.top,y2:V.top+m,className:C.chartCrosshair})]}),x!==void 0&&o!==null&&(0,r.jsxs)(`div`,{className:C.chartTooltip,style:{left:`${h(o)/680*100}%`,top:`${g(x.cost)/220*100}%`},children:[(0,r.jsx)(`div`,{className:C.chartTooltipDate,children:x.date}),a!==`tokens`&&t.filter(e=>(x.byModel?.[e.key]??0)>0).map(e=>(0,r.jsxs)(`div`,{className:C.chartTooltipRow,children:[(0,r.jsx)(`span`,{className:C.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,r.jsx)(`strong`,{children:c(x.byModel?.[e.key]??0)})]},e.key)),(0,r.jsxs)(`div`,{className:C.chartTooltipRow,children:[(0,r.jsx)(`span`,{className:C.chartLegendBar}),`总计 `,(0,r.jsx)(`strong`,{children:a===`tokens`?H(x.tokens??0):c(x.cost)})]}),(0,r.jsxs)(`div`,{className:C.chartTooltipRow,children:[(0,r.jsx)(`span`,{className:C.chartLegendLine}),`调用 `,(0,r.jsx)(`strong`,{children:x.calls.toLocaleString()})]})]}),t.length>0&&a!==`tokens`&&(0,r.jsxs)(`div`,{className:C.chartLegend,children:[t.map(e=>(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key)),(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartLegendLine}),`调用`]})]})]})}let U={top:14,right:42,bottom:22,left:46};function Ie(e){let t=Object.keys(e).sort(),n=[];for(let r of t.slice(-48)){let t=e[r];t!==void 0&&n.push({key:r,ttftMs:t.ttftAvg,...t.tpsAvg===void 0?{}:{tps:t.tpsAvg}})}return n}function Le(e){return e.slice(5,13).replace(`T`,` `)}function Re({perf:e,models:t,t:n}){let a=e=>t.find(t=>t.key===e)?.color??`#8b95a3`,o=(0,i.useMemo)(()=>e===void 0?[]:Object.entries(e.byModel).map(([e,n])=>({key:e,name:t.find(t=>t.key===e)?.name??e,color:a(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]),s=(0,i.useMemo)(()=>{let t=e===void 0?[]:Ie(e.byHour);if(t.length===0)return null;let n=t.length,r=680-U.left-U.right,i=180-U.top-U.bottom,a=e=>n===1?U.left+r/2:U.left+r*e/(n-1),o=Math.max(...t.map(e=>e.ttftMs),1),s=Math.max(...t.map(e=>e.tps??0),1),c=e=>U.top+i-e/o*i,l=e=>U.top+i-e/s*i,u=t.map((e,t)=>`${t===0?`M`:`L`}${a(t)} ${c(e.ttftMs)}`).join(` `),d=t.some(e=>e.tps!==void 0)?t.map((e,t)=>`${t===0?`M`:`L`}${a(t)} ${l(e.tps??0)}`).join(` `):``,f=Math.max(1,Math.ceil(n/8)),p=[];for(let e=0;e<n;e+=f)p.push(e);return n>0&&p[p.length-1]!==n-1&&p.push(n-1),{points:t,n,inner:a,yTtft:c,ttftPath:u,tpsPath:d,indices:p,ttftTicks:[0,.5,1].map(e=>o*e).reverse(),maxTps:s}},[e]);return e===void 0||o.length===0?(0,r.jsx)(`div`,{className:C.chartEmpty,"data-testid":`billing-perf-empty`,children:n(`billing.perfEmpty`)}):(0,r.jsxs)(`div`,{"data-testid":`billing-perf-panel`,children:[(0,r.jsx)(`div`,{className:C.tableScroll,"data-testid":`billing-perf-table`,children:(0,r.jsxs)(`table`,{className:C.modelTable,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:n(`billing.model`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfSamples`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfTtft`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfP50`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfP90`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfMax`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfTps`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfLatency`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfEstimated`)})]})}),(0,r.jsx)(`tbody`,{children:o.map(e=>(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`td`,{children:(0,r.jsxs)(`span`,{className:C.modelCell,children:[(0,r.jsx)(`span`,{className:C.modelDot,style:{background:e.color}}),(0,r.jsx)(`span`,{className:C.modelName,children:e.name})]})}),(0,r.jsx)(`td`,{className:C.numCol,children:e.samples.toLocaleString()}),(0,r.jsxs)(`td`,{className:C.numCol,children:[e.ttftAvg.toFixed(0),` ms`]}),(0,r.jsxs)(`td`,{className:C.numCol,children:[e.ttftP50.toFixed(0),` ms`]}),(0,r.jsxs)(`td`,{className:C.numCol,children:[e.ttftP90.toFixed(0),` ms`]}),(0,r.jsx)(`td`,{className:C.numCol,children:e.ttftMax===void 0?(0,r.jsx)(`span`,{className:C.na,children:`—`}):(0,r.jsxs)(`span`,{children:[e.ttftMax.toFixed(0),` ms`,e.ttftSpikes!==void 0&&e.ttftSpikes>0?` (${e.ttftSpikes}↑)`:``]})}),(0,r.jsx)(`td`,{className:C.numCol,children:e.tpsAvg===void 0?(0,r.jsx)(`span`,{className:C.na,children:`—`}):`${e.tpsAvg.toFixed(1)}`}),(0,r.jsxs)(`td`,{className:C.numCol,children:[e.latencyAvg.toFixed(0),` ms`]}),(0,r.jsx)(`td`,{className:C.numCol,children:e.estimatedSamples>0?e.estimatedSamples:(0,r.jsx)(`span`,{className:C.na,children:`—`})})]},e.key))})]})}),s!==null&&(0,r.jsxs)(`div`,{className:C.chartWrap,"data-testid":`billing-perf-hour`,children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 680 180`,className:C.chartSvg,role:`img`,"aria-label":`Hourly TTFT and generation speed by model`,children:[s.ttftTicks.map((e,t)=>{let n=s.yTtft(e);return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`line`,{x1:U.left,x2:680-U.right,y1:n,y2:n,className:C.chartGrid}),(0,r.jsx)(`text`,{x:U.left-8,y:n+3,textAnchor:`end`,className:C.chartAxisLabel,children:e.toFixed(0)})]},`ttft-${t}`)}),(0,r.jsx)(`path`,{d:s.ttftPath,fill:`none`,className:C.chartLine}),s.tpsPath!==``&&(0,r.jsx)(`path`,{d:s.tpsPath,fill:`none`,className:C.chartLine,style:{stroke:`var(--dsw-static-amber-500)`,strokeDasharray:`4 4`}}),s.indices.map(e=>{let t=s.points[e];return t===void 0?null:(0,r.jsx)(`text`,{x:s.inner(e),y:174,textAnchor:`middle`,className:C.chartAxisLabel,children:Le(t.key)},t.key)}),(0,r.jsxs)(`text`,{x:680-U.right+8,y:U.top+4,textAnchor:`start`,className:C.chartAxisLabel,children:[n(`billing.perfTpsUnit`),` `,s.maxTps.toFixed(0)]})]}),(0,r.jsxs)(`div`,{className:C.chartLegend,children:[(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartLegendLine}),n(`billing.perfTtft`),` (ms)`]}),(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartLegendLine,style:{background:`var(--dsw-static-amber-500)`}}),n(`billing.perfTps`),` (`,n(`billing.perfTpsUnit`),`)`]})]})]})]})}let ze=`@kenz1117/dsh-ui-usage-billing`,Be=`kenz1117`;function W({t:e,version:t}){return(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-plugin-info`,children:[(0,r.jsxs)(`div`,{className:C.plgHead,children:[(0,r.jsx)(`span`,{className:C.plgIcon,"aria-hidden":`true`,children:(0,r.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,r.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,r.jsxs)(`div`,{className:C.plgTitle,children:[(0,r.jsxs)(`div`,{className:C.plgNameRow,children:[(0,r.jsx)(`h3`,{className:C.plgName,children:ze}),(0,r.jsx)(`span`,{className:C.plgTag,children:t===void 0?`—`:`v${t}`})]}),(0,r.jsx)(`p`,{className:C.plgDesc,children:`Usage billing dashboard for DeepSeek Harness`})]})]}),(0,r.jsxs)(`div`,{className:C.plgGrid,children:[(0,r.jsxs)(`div`,{className:C.plgItem,children:[(0,r.jsx)(`span`,{className:C.plgLabel,children:e(`billing.pluginAuthor`)}),(0,r.jsxs)(`a`,{className:C.plgLink,href:`https://github.com/${Be}`,target:`_blank`,rel:`noreferrer`,children:[`KenZ`,` (`,Be,`)`]})]}),(0,r.jsxs)(`div`,{className:C.plgItem,children:[(0,r.jsx)(`span`,{className:C.plgLabel,children:e(`billing.pluginRepository`)}),(0,r.jsx)(`a`,{className:C.plgLink,href:`https://github.com/kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:`GitHub`})]}),(0,r.jsxs)(`div`,{className:C.plgItem,children:[(0,r.jsx)(`span`,{className:C.plgLabel,children:e(`billing.pluginNpm`)}),(0,r.jsx)(`a`,{className:C.plgLink,href:`https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:ze})]}),(0,r.jsxs)(`div`,{className:C.plgItem,children:[(0,r.jsx)(`span`,{className:C.plgLabel,children:e(`billing.pluginLicense`)}),(0,r.jsx)(`span`,{className:C.plgVal,children:`MIT`})]})]})]})}function Ve(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 G(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}let K={top:14,right:18,bottom:22,left:46},He=`var(--dsw-static-blue-500)`,Ue=`#14b8a6`,q=`var(--dsw-static-amber-500)`;function We(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 Ge(e){let{stats:t,trendDays:n,onTrendDays:a,t:o}=e,{byDay:s,byModel:l,total:u}=t,d=(0,i.useMemo)(()=>{let e=[];for(let t=n-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t);let r=Ve(n.getTime()),i=s[r];e.push({date:r,miss:i?.cacheMiss??0,hit:i?.cacheHit??0,output:i?.output??0,reasoning:i?.reasoning??0})}return e},[s,n]),f=(0,i.useMemo)(()=>{let e=0;return Object.entries(l).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:Se(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}))},[l]),p=(0,i.useMemo)(()=>{let e=u.cacheHit??0,t=u.cacheMiss??0,n=u.input??0,r=u.output??0,i=u.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 d){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}},[u,d]),m=(0,i.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]),h=(0,i.useMemo)(()=>{let e=d.length;if(e===0)return null;let t=680-K.left-K.right,n=200-K.top-K.bottom,r=Math.max(...d.map(e=>e.miss+e.hit+e.output),1),i=e=>K.top+n-e/r*n,a=t/e,o=Math.min(20,a*.6),s=n=>e===1?K.left+t/2:K.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}},[d]);return(0,r.jsxs)(`div`,{className:C.tokenPanel,"data-testid":`billing-token-panel`,children:[(0,r.jsxs)(`div`,{className:C.exportBar,role:`group`,"aria-label":o(`billing.tokenExport`),children:[(0,r.jsx)(`span`,{className:C.exportLabel,children:o(`billing.export`)}),(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-token-export-csv`,onClick:()=>{let e=new Blob([We(d)],{type:`text/csv`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`token-daily-${Ve()}.csv`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},children:o(`billing.tokenExportCsv`)}),(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-token-export-json`,onClick:()=>{let e=new Blob([JSON.stringify({days:d,models:f,total:u},null,2)],{type:`application/json`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`token-${Ve()}.json`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},children:o(`billing.exportJson`)})]}),(0,r.jsxs)(`div`,{className:C.kpiGrid,"data-testid":`billing-token-kpis`,children:[(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:o(`billing.tokenCacheHitRate`)}),(0,r.jsxs)(`span`,{className:C.kpiValue,children:[p.cacheHitRate.toFixed(1),`%`]}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[B(p.hit),` / `,B(p.hit+p.miss),(u.cacheWrite??0)>0?` · ${o(`billing.tokenCacheWrite`)} ${B(u.cacheWrite??0)}`:``]})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:o(`billing.tokenReasoningShare`)}),(0,r.jsxs)(`span`,{className:C.kpiValue,children:[p.reasoningPct.toFixed(1),`%`]}),(0,r.jsx)(`span`,{className:C.kpiDetail,children:B(p.reasoning)})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:o(`billing.tokenIo`)}),(0,r.jsx)(`span`,{className:C.kpiValue,children:p.io.toFixed(2)}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[B(p.input),` / `,B(p.output)]})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:o(`billing.tokenPeak`)}),(0,r.jsx)(`span`,{className:C.kpiValue,children:p.peak===void 0?`—`:G(p.peak.miss+p.peak.hit+p.peak.output)}),(0,r.jsx)(`span`,{className:C.kpiDetail,children:p.peak?.date??`—`})]})]}),(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-token-daily`,children:[(0,r.jsxs)(`div`,{className:C.panelHead,children:[(0,r.jsx)(`h3`,{className:C.panelTitle,children:o(`billing.tokenDaily`)}),(0,r.jsx)(`span`,{className:C.rangeToggle,role:`group`,"aria-label":o(`billing.tokenDaily`),children:[7,30].map(e=>(0,r.jsx)(`button`,{type:`button`,className:c(C.rangeButton,n===e&&C.rangeButtonActive),"aria-pressed":n===e,onClick:()=>{a(e)},"data-testid":`billing-token-${e}d`,children:o(e===7?`billing.trend7d`:`billing.trend30d`)},e))})]}),h===null?(0,r.jsx)(`div`,{className:C.chartEmpty,children:o(`billing.trendEmpty`)}):(0,r.jsxs)(`div`,{className:C.chartWrap,children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 680 200`,className:C.chartSvg,role:`img`,"aria-label":o(`billing.tokenDaily`),children:[[0,.5,1].map(e=>{let t=h.max*e,n=h.y(t);return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`line`,{x1:K.left,x2:680-K.right,y1:n,y2:n,className:C.chartGrid}),(0,r.jsx)(`text`,{x:K.left-8,y:n+3,textAnchor:`end`,className:C.chartAxisLabel,children:G(t)})]},e)}),d.map((e,t)=>{let n=h.inner(t)-h.barW/2,i=h.y(0),a=h.y(e.miss),o=h.y(e.miss+e.hit),s=h.y(e.miss+e.hit+e.output);return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`rect`,{x:n,y:a,width:h.barW,height:i-a,fill:He}),(0,r.jsx)(`rect`,{x:n,y:o,width:h.barW,height:a-o,fill:Ue}),(0,r.jsx)(`rect`,{x:n,y:s,width:h.barW,height:o-s,fill:q})]},e.date)}),h.indices.map(e=>{let t=d[e];return t===void 0?null:(0,r.jsx)(`text`,{x:h.inner(e),y:194,textAnchor:`middle`,className:C.chartAxisLabel,children:t.date.slice(5)},t.date)})]}),(0,r.jsxs)(`div`,{className:C.chartLegend,children:[(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartTooltipSwatch,style:{background:He}}),o(`billing.tokenMiss`)]}),(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartTooltipSwatch,style:{background:Ue}}),o(`billing.tokenHit`)]}),(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartTooltipSwatch,style:{background:q}}),o(`billing.tokenOutput`)]})]})]})]}),(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-token-models`,children:[(0,r.jsx)(`div`,{className:C.panelHead,children:(0,r.jsx)(`h3`,{className:C.panelTitle,children:o(`billing.tokenByModel`)})}),f.length===0?(0,r.jsx)(`div`,{className:C.emptyRow,children:o(`billing.noData`)}):(0,r.jsx)(`div`,{className:C.tableScroll,children:(0,r.jsxs)(`table`,{className:C.modelTable,"data-testid":`billing-token-model-table`,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:o(`billing.model`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.inputTokens`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.outputTokens`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.tokenReasoningShort`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.cacheHitRate`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.tokenTotal`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.tokenShare`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.calls`)})]})}),(0,r.jsx)(`tbody`,{children:f.map(e=>(0,r.jsxs)(`tr`,{"data-testid":`billing-token-model`,children:[(0,r.jsx)(`td`,{children:(0,r.jsx)(`span`,{className:C.modelName,children:e.name})}),(0,r.jsx)(`td`,{className:C.numCol,children:B(e.input)}),(0,r.jsx)(`td`,{className:C.numCol,children:B(e.output)}),(0,r.jsx)(`td`,{className:C.numCol,children:e.reasoning>0?B(e.reasoning):(0,r.jsx)(`span`,{className:C.na,children:`—`})}),(0,r.jsxs)(`td`,{className:C.numCol,children:[e.cacheHitRate.toFixed(1),`%`]}),(0,r.jsx)(`td`,{className:C.numCol,children:B(e.total)}),(0,r.jsx)(`td`,{className:C.numCol,children:(0,r.jsxs)(`span`,{className:C.tokenModelShareRow,children:[(0,r.jsx)(`span`,{className:C.tokenModelBar,children:(0,r.jsxs)(`span`,{className:C.tokenModelParts,style:{width:`${(e.share*100).toFixed(2)}%`},children:[(0,r.jsx)(`span`,{className:C.tokenModelPartIn,style:{width:`${e.total>0?e.input/e.total*100:0}%`}}),(0,r.jsx)(`span`,{className:C.tokenModelPartOut,style:{width:`${e.total>0?e.output/e.total*100:0}%`}})]})}),(e.share*100).toFixed(1),`%`]})}),(0,r.jsx)(`td`,{className:C.numCol,children:e.calls.toLocaleString()})]},e.key))})]})})]}),m.totalCalls>0&&(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-token-tools`,children:[(0,r.jsx)(`div`,{className:C.panelHead,children:(0,r.jsx)(`h3`,{className:C.panelTitle,children:o(`billing.toolRank`)})}),(0,r.jsx)(`div`,{className:C.tableScroll,children:(0,r.jsxs)(`table`,{className:C.modelTable,"data-testid":`billing-tool-table`,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:o(`billing.toolName`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.calls`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.tokenShare`)})]})}),(0,r.jsx)(`tbody`,{children:[...m.top,...m.rest].map(([e,t])=>(0,r.jsxs)(`tr`,{"data-testid":`billing-tool-row`,children:[(0,r.jsx)(`td`,{children:(0,r.jsx)(`span`,{className:C.modelName,children:e})}),(0,r.jsx)(`td`,{className:C.numCol,children:t.toLocaleString()}),(0,r.jsxs)(`td`,{className:C.numCol,children:[(t/m.totalCalls*100).toFixed(1),`%`]})]},e))})]})})]})]})}function Ke(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}`}function qe(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 Je(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 Ye({rounds:e,flags:t,currency:n,t:a}){let o=(0,i.useMemo)(()=>e.slice(-40),[e]),s=(0,i.useMemo)(()=>new Set(t.map(e=>`${e.sessionId}:${e.turn}`)),[t]),l=(0,i.useMemo)(()=>Math.max(1e-4,...o.map(e=>e.cost)),[o]);if(o.length===0)return(0,r.jsxs)(`div`,{className:C.roundsEmpty,children:[a(`billing.model`),` —`]});let u=e=>z(n===`usd`?R(e):e,n);return(0,r.jsxs)(`div`,{className:C.rounds,children:[(0,r.jsx)(`div`,{className:C.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),i=me(e.startedAt)===`peak`;return(0,r.jsxs)(`div`,{className:c(C.roundsBarCol,i?C.roundsBarColPeak:C.roundsBarColOff),children:[(0,r.jsx)(`span`,{className:C.roundsBarLabel,style:{bottom:`${n}%`},children:u(e.cost)}),(0,r.jsx)(`div`,{className:C.roundsBarWrap,children:(0,r.jsx)(`div`,{className:t?C.roundsBarFlagged:C.roundsBar,style:{height:`${n}%`},"data-testid":`round-bar`,title:`${a(`billing.model`)} ${e.model} · ${u(e.cost)} · ${qe(e.startedAt)}${e.endedAt===void 0?``:` → ${Ke(e.endedAt)} (${Je(e.endedAt-e.startedAt)})`}`,children:t&&(0,r.jsx)(`span`,{className:C.roundsFlagMark,"aria-hidden":`true`})})})]},`${e.sessionId}:${e.turn}`)})}),(0,r.jsxs)(`div`,{className:C.roundsAxis,children:[(0,r.jsxs)(`span`,{children:[a(`billing.costAbbr`),` `,u(l)]}),(0,r.jsxs)(`span`,{children:[o.length,` 轮`]})]})]})}let J=[`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)`],Xe=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Ze(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function Qe(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:Ze(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:Ze(e),dayNum:e.getDate(),value:0,level:0,placeholder:!0});continue}let d=Ze(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 $e(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=Ze(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=Ze(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 et({days:e,currency:t,now:n,t:a,range:o=`month`}){let[s,c]=(0,i.useState)(null),l=e=>z(t===`usd`?R(e):e,t),u=(0,i.useMemo)(()=>Qe(e,n??new Date),[e,n]);if(o===`year`){let t=$e(e,n??new Date),i=[],o=-1;return t.forEach((e,t)=>{let n=Number(e[0]?.date.slice(5,7)??0);n!==o&&(i.push({index:t,label:Xe[n-1]??``}),o=n)}),(0,r.jsxs)(`div`,{className:C.heatmapYear,"data-testid":`heatmap-year`,children:[(0,r.jsxs)(`div`,{className:C.heatmapYearBody,children:[(0,r.jsx)(`div`,{className:C.heatmapYearWeekdays,"aria-hidden":`true`,children:[{label:`Mon`,row:1},{label:`Wed`,row:3},{label:`Fri`,row:5}].map(e=>(0,r.jsx)(`span`,{className:C.heatmapYearWeekday,style:{gridRow:e.row},children:e.label},e.label))}),(0,r.jsxs)(`div`,{className:C.heatmapYearScroll,children:[(0,r.jsx)(`div`,{className:C.heatmapYearMonths,"aria-hidden":`true`,"data-testid":`heatmap-year-months`,children:i.map(e=>(0,r.jsx)(`span`,{className:C.heatmapYearMonth,style:{gridColumn:e.index+1},children:e.label},e.index))}),(0,r.jsx)(`div`,{className:C.heatmapYearGrid,role:`img`,"aria-label":`yearly cost heatmap`,"data-testid":`heatmap-year-grid`,children:t.flat().map(e=>(0,r.jsx)(`button`,{type:`button`,className:C.heatmapYearCell,"data-testid":`heatmap-year-cell`,"data-level":e.level,style:{background:J[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`},e.date))})]})]}),(0,r.jsxs)(`div`,{className:C.heatmapFooter,children:[(0,r.jsx)(`span`,{className:C.heatmapLegendText,children:a(`billing.heatmapLess`)}),(0,r.jsx)(`span`,{className:C.heatmapLegend,children:J.map((e,t)=>(0,r.jsx)(`i`,{style:{background:e}},t))}),(0,r.jsx)(`span`,{className:C.heatmapLegendText,children:a(`billing.heatmapMore`)})]})]})}return(0,r.jsxs)(`div`,{className:C.heatmap,children:[(0,r.jsx)(`div`,{className:C.heatmapGrid,role:`img`,"aria-label":`daily cost heatmap`,children:u.map(e=>e.map(e=>e.placeholder?(0,r.jsx)(`div`,{className:C.heatmapCellEmpty,children:e.dayNum},e.date):(0,r.jsx)(`button`,{type:`button`,className:C.heatmapCell,"data-testid":`heatmap-cell`,"data-level":e.level,style:{background:J[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,r.jsxs)(`div`,{className:C.heatmapFooter,children:[(0,r.jsx)(`span`,{className:C.heatmapLegendText,children:a(`billing.heatmapLess`)}),(0,r.jsx)(`span`,{className:C.heatmapLegend,children:J.map((e,t)=>(0,r.jsx)(`i`,{style:{background:e}},t))}),(0,r.jsx)(`span`,{className:C.heatmapLegendText,children:a(`billing.heatmapMore`)}),s!==null&&(0,r.jsxs)(`span`,{className:C.heatmapHover,"data-testid":`heatmap-hover`,children:[s.date,` · `,l(s.value)]})]})]})}let Y={window:6,threshold:2,reasonFactor:1.8,reasonHitDropPp:15};function X(e){if(e.length===0)return null;let t=0;for(let n of e)t+=n;return t/e.length}function Z(e){let t=e.cacheHit+e.cacheMiss;return t<=0?null:e.cacheHit/t*100}function tt(e,t){let n=t?.window??Y.window,r=t?.threshold??Y.threshold,i=t?.reasonFactor??Y.reasonFactor,a=t?.reasonHitDropPp??Y.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=Z(t),p=X(s),m=[];if(p!==null&&p>0&&t.cost>p*r){let n=X(c),r=X(l),s=X(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 nt(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function rt(e){return/^[=+\-@\t\r]/.test(e)?`'${e}`:e}function it(e){return e.toFixed(2)}function at(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,it(n.cost)].join(`,`)})].join(`
3
- `)}function ot(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[nt(rt(n)),r,t.calls,it(t.cost)].join(`,`)})].join(`
4
- `)}function st(e){return e===void 0?``:e.split(/[\\/]/).filter(Boolean).pop()??e}function ct(e){return[`session_id,title,project,calls,cost_cny,last_active`,...e.map(e=>[nt(rt(e.id)),nt(rt(e.title??``)),nt(rt(st(e.cwd))),e.calls,it(e.cost),e.lastActive>0?new Date(e.lastActive).toISOString():``].join(`,`))].join(`
5
- `)}function lt(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 ut(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`,ft={"billing.title":`使用统计`,"billing.subtitle":`计费仪表盘`,"billing.cost":`费用`,"billing.todayCost":`今日费用`,"billing.monthCost":`本月费用`,"billing.yearCost":`本年费用`,"billing.monthProjected":`本月预计`,"billing.liveTurn":`本轮`,"billing.liveSession":`会话`,"billing.totalCost":`总费用`,"billing.calls":`调用`,"billing.cacheHitRate":`缓存命中率`,"billing.tokens":`Token`,"billing.inputTokens":`输入`,"billing.outputTokens":`输出`,"billing.avgCost":`平均成本`,"billing.trend":`每日费用与调用趋势`,"billing.trend7d":`7 天`,"billing.trend30d":`30 天`,"billing.trendMetric":`趋势指标`,"billing.trendMetricCost":`费用`,"billing.trendMetricTokens":`Token`,"billing.trendEmpty":`暂无趋势数据`,"billing.budget":`本月预算`,"billing.budgetAmount":`预算金额`,"billing.budgetSummary":`本月已用 {used} / {total};达到 80% 时提醒,达到 100% 时红色脉冲警示`,"billing.sessions":`会话明细`,"billing.sessionTitle":`标题`,"billing.project":`项目`,"billing.lastActive":`最后活跃`,"billing.sessionOverflow":`仅显示花费前 {limit} 个,共 {total} 个会话`,"billing.budgetTierBody":`本月花费 {cost} 已达预算 {budget} 的 {pct}%`,"billing.models":`模型计费明细`,"billing.providerBilling":`厂商计费与订阅`,"billing.estimated":`估算`,"billing.actual":`实际`,"billing.pricing":`模型单价表`,"billing.showPricing":`查看模型单价`,"billing.hidePricing":`收起单价表`,"billing.pricePerM":`¥ / 1M tokens`,"billing.input":`输入`,"billing.output":`输出`,"billing.cacheHit":`缓存命中`,"billing.peak":`高峰`,"billing.offPeak":`低谷`,"billing.flat":`全天统一`,"billing.peakHours":`高峰时段`,"billing.band":`时段`,"billing.openDashboard":`打开计费仪表盘`,"billing.close":`关闭`,"billing.footer":`每 30s 自动轮询 · 仅统计本机 dsh 会话`,"billing.footerCredit":`dsh-ui-usage-billing {version} · MIT`,"billing.lastUpdated":`数据更新于`,"billing.noData":`暂无计费数据`,"billing.todayRate":`今日汇率`,"billing.rateLive":`实时`,"billing.rateBuiltin":`内置`,"billing.promoBadge":`限时折扣`,"billing.promoUntil":`促销价至 {date},之后自动恢复刊例价`,"billing.promoOpenEnded":`厂商未公布截止时间,当前按折扣计价;公告截止后自动恢复刊例价`,"billing.pricingTip":`DeepSeek 模型自北京时间 2026-08-23(周日)00:00 起:工作日高峰 9-12 / 14-18(×2),周末(周六 / 周日)全天低谷价;双价单元格按峰 / 谷展示,费用按调用时刻计。`,"billing.pricingUnit":`单位:人民币 / 每百万 Token`,"billing.pricingNotes":`计价说明`,"billing.ubPeak":`峰`,"billing.ubOff":`谷`,"billing.ubStd":`标准`,"billing.peakBand":`峰谷分带`,"billing.pricingSource":`数据来源`,"billing.noteCache":`命中部分按缓存价计费,显著降低成本。`,"billing.noteBand":`高峰与空闲时段单价不同,空闲约半价。`,"billing.noteSource":`价格来自实时汇率 + 模型定价目录,未收录模型按 0 计并提示。`,"billing.balance":`余额`,"billing.balanceUnconfigured":`未配置`,"billing.balanceUnauthorized":`密钥无效`,"billing.balanceUnreachable":`查询失败`,"billing.uncatalogued":`未收录`,"billing.estimatedPricing":`估算价`,"billing.balanceDays":`约可撑 {days} 天`,"billing.balanceLowBody":`{name} 余额 {balance},约可撑 {days} 天,请及时充值`,"billing.reconcileDrift":`系统监控到{provider}官方余额变动 {spent},本面板记录 {today},差额通常由其它工具或 API 的消耗所致`,"billing.reconcileDismiss":`知道了`,"billing.subscriptions":`订阅套餐`,"billing.subscriptionNotConfigured":`未配置密钥`,"billing.subscriptionUnauthorized":`密钥无效`,"billing.subscriptionUnavailable":`查询失败`,"billing.subscriptionInvalid":`响应异常`,"billing.subscriptionRateLimited":`触发限流`,"billing.subscriptionSession":`本次`,"billing.subscriptionWeekly":`本周`,"billing.subscriptionMonthly":`本月`,"billing.subscriptionBilling":`计费周期`,"billing.subscriptionRemaining":`剩余 {pct}%`,"billing.subscriptionExhausted":`已用尽`,"billing.subscriptionReset":`{date} 重置`,"billing.subscriptionNoApi":`该厂商暂未提供用量查询接口`,"billing.floatWindow":`模型用量悬浮窗`,"billing.floatModeCombined":`综合`,"billing.floatModeSubscription":`订阅卡`,"billing.floatMode":`展示模式`,"billing.floatTargets":`订阅目标`,"billing.floatWindowHint":`悬浮在左下角计费卡上的用量速览;综合=当前样式,订阅卡=每次展示一张订阅额度卡(可切换)。`,"billing.cardDisplay":`计费卡显示`,"billing.cardDisplayHint":`切换左下角计费卡的主指标:花费金额或 Token 消耗(副行与迷你柱同步切换,悬浮窗不受影响)。`,"billing.cardMetric":`主指标`,"billing.cardMetricMoney":`花费金额`,"billing.cardMetricTokens":`Token 消耗`,"billing.floatNoTargets":`未指定订阅通道,请在设置中勾选要展示的订阅。`,"billing.floatNoTargetsHint":`暂无可选的订阅通道。`,"billing.floatPrev":`上一张订阅`,"billing.floatNext":`下一张订阅`,"billing.subscriptionsStale":`订阅额度刷新失败,以下为缓存数据`,"billing.staleLedgerNotice":`{count} 个会话出自旧版算法存档(日志已删,无法重算),模型归属可能有误差`,"billing.tokenCacheWrite":`写入`,"billing.toolRank":`工具排行`,"billing.toolName":`工具`,"billing.userPrices":`自定义单价`,"billing.userPricesHint":`为未收录或变价模型填入实付单价,总览与日趋势按此重估;来源留空=该模型默认价,填入中转站域名=仅该来源的同名模型用此价`,"billing.userPriceSave":`保存`,"billing.userPriceModel":`模型`,"billing.userPriceSource":`来源(中转站域名)`,"billing.userPriceSourceHint":`留空=默认价,或 https://api.中转站.com`,"billing.userPriceCurrency":`币种`,"billing.userPriceAdd":`新增`,"billing.userPriceRemove":`删除`,"billing.sessionStaleBadge":`旧版统计`,"billing.heatmapLess":`少`,"billing.heatmapMore":`多`,"billing.currency":`币种`,"billing.currencyCny":`人民币`,"billing.currencyUsd":`美元`,"billing.heatmap":`用量热力图`,"billing.rounds":`每轮费用`,"billing.roundsHint":`最近 {count} 轮 · 柱顶为金额 · 底色为峰谷时段`,"billing.anomaly":`成本突增`,"billing.workspaces":`工作区统计`,"billing.workspacesHint":`点击行下钻项目成本前 5 会话`,"billing.plan":`套餐`,"billing.remaining":`剩余`,"billing.unknownModel":`未定价`,"billing.model":`模型`,"billing.thModel":`模型名称`,"billing.thInputMiss":`输入缓存未命中`,"billing.thInputHit":`输入缓存命中`,"billing.currentRound":`当前`,"billing.costAbbr":`费用`,"billing.tabOverview":`概览`,"billing.tabTrends":`趋势`,"billing.tabProviders":`账单`,"billing.tabDetails":`统计`,"billing.tabPricing":`费率`,"billing.tabSettings":`设置`,"billing.settingsHead":`偏好设置`,"billing.settingsHint":`管理与计费相关的偏好`,"billing.budgetHint":`设置月度上限,用于本月预计与超支分段提醒`,"billing.peakAlertHint":`在切档前弹窗提醒,可选同步系统通知`,"billing.peakAlertDescPeak":`即将进入高峰时段,价格将上调,请提前安排长任务`,"billing.peakAlertDescOff":`即将进入平价时段,价格减半,适合运行大批量任务`,"billing.export":`导出`,"billing.exportCsvDay":`按日 CSV`,"billing.exportCsvSession":`按会话 CSV`,"billing.exportJson":`全量 JSON`,"billing.peakShare":`峰谷时段占比`,"billing.peakSharePerCall":`按调用时刻精确判档`,"billing.offPeakSavings":`挪谷可省约 {amount}`,"billing.perfMax":`最大 TTFT`,"billing.weekCost":`本周`,"billing.roleCost":`费用构成`,"billing.roleUser":`用户输入`,"billing.roleAssistant":`助手输出`,"billing.roleTool":`工具结果`,"billing.roleHint":`估算:输出按实测计价,输入按消息长度摊分`,"billing.tierPeak":`峰时`,"billing.tierOff":`平价`,"billing.tierToPeak":`后转峰时`,"billing.tierToOff":`后转平价`,"billing.tierAlertEnterPeak":`{minutes} 分钟后进入峰时(DeepSeek 高峰价 ×2),不急的调用可稍等`,"billing.tierAlertEnterOff":`{minutes} 分钟后进入平价(价格减半)`,"billing.peakAlertTitlePeak":`即将进入高峰价`,"billing.peakAlertTitleOff":`即将进入平价`,"billing.peakAlert":`峰谷切换提醒`,"billing.peakAlertLeadMin":`提前量(分钟)`,"billing.peakAlertPos":`位置`,"billing.peakAlertMode":`提醒模式`,"billing.peakAlertPosCorner":`右下角`,"billing.peakAlertPosCenter":`屏幕居中`,"billing.peakAlertModePeak":`仅进入峰时`,"billing.peakAlertModeOff":`仅进入平价`,"billing.peakAlertModeBoth":`峰与谷都提醒`,"billing.peakAlertWebNotify":`同时发系统通知`,"billing.peakAlertPreview":`预览提醒`,"billing.planTypeCode":`订阅制`,"billing.planTypeToken":`按量`,"billing.subscriptionFeePerMonth":`{amount}/月`,"billing.triggerToday":`今日`,"billing.triggerMonth":`当月`,"billing.triggerMonthTokens":`当月 Token`,"billing.subscriptionIncluded":`订阅包含`,"billing.free":`免费`,"billing.official":`官方`,"billing.thirdParty":`三方`,"billing.officialCost":`官方费用`,"billing.thirdPartyCost":`三方费用`,"billing.perfSamples":`样本`,"billing.perfTtft":`首字延时`,"billing.perfP50":`P50`,"billing.perfP90":`P90`,"billing.perfTps":`生成速度`,"billing.perfLatency":`总延迟`,"billing.perfEstimated":`估算样本`,"billing.perfEmpty":`暂无性能数据`,"billing.perfTpsUnit":`tok/s`,"billing.perfTitle":`性能`,"billing.perfHint":`按模型与按小时聚合;估算样本为工具续写步骤`,"billing.heatmapYear":`年`,"billing.heatmapMonth":`月`,"billing.activeDays":`活跃天数`,"billing.streakDays":`连续使用`,"billing.subscriptionAutoDetect":`自动识别`,"billing.pluginInfo":`插件信息`,"billing.pluginName":`插件名`,"billing.pluginDescription":`描述`,"billing.pluginVersion":`版本`,"billing.pluginAuthor":`作者`,"billing.pluginRepository":`仓库`,"billing.pluginNpm":`npm`,"billing.pluginLicense":`许可证`,"billing.tabToken":`用量`,"billing.tokenExport":`导出 Token`,"billing.tokenExportCsv":`按日 Token CSV`,"billing.tokenCacheHitRate":`缓存命中率`,"billing.tokenReasoningShare":`思考占比`,"billing.tokenReasoningShort":`思考`,"billing.tokenIo":`输入/输出比`,"billing.tokenPeak":`峰值日`,"billing.tokenDaily":`每日 Token`,"billing.tokenByModel":`模型 Token`,"billing.tokenMiss":`输入(缓存未命中)`,"billing.tokenHit":`输入(缓存命中)`,"billing.tokenOutput":`输出`,"billing.tokenTotal":`总 Token`,"billing.tokenShare":`占比`,"billing.usageStatsTool":`注入用量查询工具`,"billing.usageStatsToolHint":`让模型可在对话中查询用量/费用;会占用模型每次请求的上下文,coding 场景建议关闭(改后需重载应用生效)`,"billing.balanceGranted":`赠金余额`,"billing.balanceTopped":`充值余额`,"billing.balanceDaily":`日均消耗`,"billing.balanceDaysLong":`约可撑`,"billing.balanceDaysUnit":`天`,"billing.popTodayModel":`主力消耗模型余额`,"billing.popTitle":`用量速览`,"billing.popNoConsumption":`暂无消耗`,"billing.popQuotaAlert":`额度提醒`,"billing.popRiskNone":`余额与配额正常`,"billing.popDirectLead":`直联`,"billing.popSubLead":`订阅`,"billing.popBalanceNormal":`余额正常`,"billing.popBalanceLow":`余额不足`,"billing.popQuotaNormal":`配额正常`,"billing.popQuotaLow":`配额将尽`,"billing.alertBalanceLow":`{name} 余额不足`,"billing.alertQuotaLow":`{name} 配额将尽`,"billing.unpricedHint":`{count} 个模型未收录计价,费用已按 0 计`,"billing.searchEstimateHint":`含 {count} 次联网搜索请求的估算费用(每次约 {each};日志无用量事件,按次估算,可在配置 searchCallEstimateCny 调整或关闭)`,"billing.siteListDisplay":`中转站列表`,"billing.siteListDisplayHint":`隐藏「未知路由 / 未识别」占位条目,净化中转站分布与额度列表`,"billing.exportCsvSite":`按站点 CSV`,"billing.panelRelay":`中转站分布`,"billing.relaySite":`中转站`,"billing.relayDirect":`直连`,"billing.relayUnknown":`未知路由`,"billing.panelRelayQuota":`中转站额度`,"billing.relayBalance":`余额`,"billing.relayNoQuota":`未读出额度`,"billing.relayWindowUsed":`已用`,"billing.relayKindNewApi":`New API`,"billing.relayKindSub2Api":`Sub2API`,"billing.relayKindUnknown":`未识别`,"billing.relayCalls":`调用`},pt={"billing.title":`Usage`,"billing.subtitle":`Billing dashboard`,"billing.cost":`Cost`,"billing.todayCost":`Today`,"billing.monthCost":`This month`,"billing.yearCost":`This year`,"billing.monthProjected":`Projected`,"billing.liveTurn":`Turn`,"billing.liveSession":`Session`,"billing.totalCost":`Total`,"billing.calls":`Calls`,"billing.cacheHitRate":`Cache Hit`,"billing.tokens":`Tokens`,"billing.inputTokens":`Input`,"billing.outputTokens":`Output`,"billing.avgCost":`Avg cost`,"billing.trend":`Daily cost & calls`,"billing.trend7d":`7D`,"billing.trend30d":`30D`,"billing.trendMetric":`Trend metric`,"billing.trendMetricCost":`Cost`,"billing.trendMetricTokens":`Tokens`,"billing.trendEmpty":`No trend data yet`,"billing.budget":`Monthly budget`,"billing.budgetAmount":`Budget amount`,"billing.budgetSummary":`Used {used} / {total} this month; warn at 80%, pulse red at 100%`,"billing.sessions":`Sessions`,"billing.sessionTitle":`Title`,"billing.project":`Project`,"billing.lastActive":`Last active`,"billing.sessionOverflow":`Top {limit} of {total} sessions by cost`,"billing.budgetTierBody":`This month {cost} reached {pct}% of the budget {budget}`,"billing.models":`Model billing`,"billing.providerBilling":`Provider billing & subscriptions`,"billing.estimated":`Est.`,"billing.actual":`Actual`,"billing.pricing":`Model pricing`,"billing.showPricing":`View pricing`,"billing.hidePricing":`Hide pricing`,"billing.pricePerM":`¥ / 1M tokens`,"billing.input":`Input`,"billing.output":`Output`,"billing.cacheHit":`Cache hit`,"billing.peak":`Peak`,"billing.offPeak":`Off-peak`,"billing.flat":`Flat`,"billing.peakHours":`Peak hours`,"billing.band":`Band`,"billing.openDashboard":`Open billing dashboard`,"billing.close":`Close`,"billing.footer":`Polls every 30s · local dsh sessions only`,"billing.footerCredit":`dsh-ui-usage-billing {version} · MIT`,"billing.lastUpdated":`Updated`,"billing.noData":`No billing data yet`,"billing.todayRate":`Today rate`,"billing.rateLive":`Live`,"billing.rateBuiltin":`Built-in`,"billing.promoBadge":`Promo`,"billing.promoUntil":`Promo price until {date}, then list price resumes automatically`,"billing.promoOpenEnded":`End date not announced; billed at the discounted rate until further notice, then list price resumes`,"billing.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.`,"billing.pricingUnit":`Unit: CNY / per 1M tokens`,"billing.pricingNotes":`Pricing notes`,"billing.ubPeak":`Peak`,"billing.ubOff":`Off`,"billing.ubStd":`Std`,"billing.peakBand":`Peak/off-peak band`,"billing.pricingSource":`Data source`,"billing.noteCache":`Cache hits are billed at the cache rate, cutting cost.`,"billing.noteBand":`Peak and off-peak prices differ; off-peak is roughly half price.`,"billing.noteSource":`Prices come from the live rate + model catalog; unlisted models count as 0 and are flagged.`,"billing.balance":`Balance`,"billing.balanceUnconfigured":`Not set`,"billing.balanceUnauthorized":`Bad key`,"billing.balanceUnreachable":`Unavailable`,"billing.uncatalogued":`Not catalogued`,"billing.estimatedPricing":`Estimated`,"billing.balanceDays":`~{days} days left`,"billing.balanceLowBody":`{name} balance {balance}, ~{days} days left, please top up`,"billing.reconcileDrift":`Detected {provider} official balance moved {spent}, this panel recorded {today}; the gap usually comes from other tools or APIs consuming too`,"billing.reconcileDismiss":`Got it`,"billing.subscriptions":`Subscriptions`,"billing.subscriptionNotConfigured":`Key not set`,"billing.subscriptionUnauthorized":`Bad key`,"billing.subscriptionUnavailable":`Unavailable`,"billing.subscriptionInvalid":`Bad response`,"billing.subscriptionRateLimited":`Rate limited`,"billing.subscriptionSession":`Current`,"billing.subscriptionWeekly":`Weekly`,"billing.subscriptionMonthly":`Monthly`,"billing.subscriptionBilling":`Billing`,"billing.subscriptionRemaining":`{pct}% left`,"billing.subscriptionExhausted":`Exhausted`,"billing.subscriptionReset":`Resets {date}`,"billing.subscriptionNoApi":`Provider does not offer a usage API`,"billing.floatWindow":`Model usage popover`,"billing.floatModeCombined":`Combined`,"billing.floatModeSubscription":`Subscription card`,"billing.floatMode":`Display mode`,"billing.floatTargets":`Targets`,"billing.floatWindowHint":`Usage summary floating on the footer card; Combined=current style, Subscription cards=one quota card at a time (switchable).`,"billing.cardDisplay":`Billing card display`,"billing.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).`,"billing.cardMetric":`Main metric`,"billing.cardMetricMoney":`Cost`,"billing.cardMetricTokens":`Token usage`,"billing.floatNoTargets":`No subscription selected — pick some in Settings.`,"billing.floatNoTargetsHint":`No subscription channel available.`,"billing.floatPrev":`Previous subscription`,"billing.floatNext":`Next subscription`,"billing.subscriptionsStale":`Subscription refresh failed — showing cached data`,"billing.staleLedgerNotice":`{count} sessions use legacy-algorithm archives (logs deleted); attribution may be off`,"billing.tokenCacheWrite":`written`,"billing.toolRank":`Tool calls`,"billing.toolName":`Tool`,"billing.userPrices":`Custom prices`,"billing.userPricesHint":`Enter actual per-1M-token prices; main views are re-costed. Leave source empty for the model default, or enter a relay origin to price only that source.`,"billing.userPriceSave":`Save`,"billing.userPriceModel":`Model`,"billing.userPriceSource":`Source (relay origin)`,"billing.userPriceSourceHint":`Empty = default; e.g. https://api.relay.com`,"billing.userPriceCurrency":`Currency`,"billing.userPriceAdd":`Add`,"billing.userPriceRemove":`Remove`,"billing.sessionStaleBadge":`legacy`,"billing.heatmapLess":`Less`,"billing.heatmapMore":`More`,"billing.currency":`Currency`,"billing.currencyCny":`CNY`,"billing.currencyUsd":`USD`,"billing.heatmap":`Usage heatmap`,"billing.rounds":`Cost per turn`,"billing.roundsHint":`Last {count} rounds · bar tops show amount · fill = peak/off-peak`,"billing.anomaly":`Cost spike`,"billing.workspaces":`Workspaces`,"billing.workspacesHint":`Click a row to drill into its top-5 sessions`,"billing.plan":`Plan`,"billing.remaining":`Left`,"billing.unknownModel":`Unpriced`,"billing.model":`Model`,"billing.thModel":`Model name`,"billing.thInputMiss":`Input (cache miss)`,"billing.thInputHit":`Input (cache hit)`,"billing.currentRound":`current`,"billing.costAbbr":`cost`,"billing.tabOverview":`Overview`,"billing.tabTrends":`Trends`,"billing.tabProviders":`Bills`,"billing.tabDetails":`Stats`,"billing.tabPricing":`Rates`,"billing.tabSettings":`Settings`,"billing.settingsHead":`Preferences`,"billing.settingsHint":`Manage billing-related preferences`,"billing.budgetHint":`Set a monthly cap for projections and tier alerts`,"billing.peakAlertHint":`Alert before a tier switch, optionally via system notification`,"billing.peakAlertDescPeak":`About to enter peak hours — prices rise, plan long tasks ahead`,"billing.peakAlertDescOff":`About to enter off-peak hours — price halves, ideal for large batches`,"billing.export":`Export`,"billing.exportCsvDay":`Daily CSV`,"billing.exportCsvSession":`Sessions CSV`,"billing.exportJson":`Full JSON`,"billing.peakShare":`Peak vs off-peak`,"billing.peakSharePerCall":`per-call attribution, full history`,"billing.offPeakSavings":`Shift peak to off-peak: save ~{amount}`,"billing.perfMax":`Max TTFT`,"billing.weekCost":`This week`,"billing.roleCost":`Cost breakdown`,"billing.roleUser":`User input`,"billing.roleAssistant":`Assistant output`,"billing.roleTool":`Tool results`,"billing.roleHint":`Estimated: output priced exactly, input split by message size`,"billing.tierPeak":`Peak`,"billing.tierOff":`Off-peak`,"billing.tierToPeak":`until peak`,"billing.tierToOff":`until off-peak`,"billing.tierAlertEnterPeak":`Peak pricing (2x) starts in {minutes} min — non-urgent calls can wait`,"billing.tierAlertEnterOff":`Off-peak pricing (50% off) starts in {minutes} min`,"billing.peakAlertTitlePeak":`Peak pricing incoming`,"billing.peakAlertTitleOff":`Off-peak incoming`,"billing.peakAlert":`Peak/off-peak alert`,"billing.peakAlertLeadMin":`Lead time (min)`,"billing.peakAlertPos":`Position`,"billing.peakAlertMode":`Remind mode`,"billing.peakAlertPosCorner":`Bottom-right`,"billing.peakAlertPosCenter":`Center`,"billing.peakAlertModePeak":`Entering peak only`,"billing.peakAlertModeOff":`Entering off-peak only`,"billing.peakAlertModeBoth":`Both`,"billing.peakAlertWebNotify":`Also send system notification`,"billing.peakAlertPreview":`Preview alert`,"billing.planTypeCode":`Subscription`,"billing.planTypeToken":`Usage`,"billing.subscriptionFeePerMonth":`{amount}/mo`,"billing.triggerToday":`Today`,"billing.triggerMonth":`This month`,"billing.triggerMonthTokens":`Monthly tokens`,"billing.subscriptionIncluded":`Included`,"billing.free":`Free`,"billing.official":`Official`,"billing.thirdParty":`Third-party`,"billing.officialCost":`Official cost`,"billing.thirdPartyCost":`Third-party cost`,"billing.perfSamples":`Samples`,"billing.perfTtft":`TTFT`,"billing.perfP50":`P50`,"billing.perfP90":`P90`,"billing.perfTps":`Speed`,"billing.perfLatency":`Total latency`,"billing.perfEstimated":`Estimated`,"billing.perfEmpty":`No performance data yet`,"billing.perfTpsUnit":`tok/s`,"billing.perfTitle":`Performance`,"billing.perfHint":`Per model & per hour; estimated samples are tool-continuation steps`,"billing.heatmapYear":`Year`,"billing.heatmapMonth":`Month`,"billing.activeDays":`Active days`,"billing.streakDays":`Streak`,"billing.subscriptionAutoDetect":`Auto`,"billing.pluginInfo":`Plugin info`,"billing.pluginName":`Name`,"billing.pluginDescription":`Description`,"billing.pluginVersion":`Version`,"billing.pluginAuthor":`Author`,"billing.pluginRepository":`Repository`,"billing.pluginNpm":`npm`,"billing.pluginLicense":`License`,"billing.tabToken":`Usage`,"billing.tokenExport":`Export tokens`,"billing.tokenExportCsv":`Daily token CSV`,"billing.tokenCacheHitRate":`Cache hit rate`,"billing.tokenReasoningShare":`Reasoning share`,"billing.tokenReasoningShort":`reasoning`,"billing.tokenIo":`In/out ratio`,"billing.tokenPeak":`Peak day`,"billing.tokenDaily":`Daily tokens`,"billing.tokenByModel":`Tokens by model`,"billing.tokenMiss":`Input (cache miss)`,"billing.tokenHit":`Input (cache hit)`,"billing.tokenOutput":`Output`,"billing.tokenTotal":`Total tokens`,"billing.tokenShare":`Share`,"billing.usageStatsTool":`Inject usage-stats tool`,"billing.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)`,"billing.balanceGranted":`Granted`,"billing.balanceTopped":`Topped up`,"billing.balanceDaily":`Daily burn`,"billing.balanceDaysLong":`~days left`,"billing.balanceDaysUnit":`days`,"billing.popTodayModel":`Main model balance`,"billing.popTitle":`Usage overview`,"billing.popNoConsumption":`No usage yet`,"billing.popQuotaAlert":`Quota alerts`,"billing.popRiskNone":`Balances & quotas OK`,"billing.popDirectLead":`Direct`,"billing.popSubLead":`Subscription`,"billing.popBalanceNormal":`balance ok`,"billing.popBalanceLow":`balance low`,"billing.popQuotaNormal":`quota ok`,"billing.popQuotaLow":`quota low`,"billing.alertBalanceLow":`{name} balance low`,"billing.alertQuotaLow":`{name} quota low`,"billing.unpricedHint":`{count} models not priced; their cost counts as 0`,"billing.searchEstimateHint":`Includes estimated cost of {count} web-search requests (~{each} each; no usage events logged, per-call estimate; tune via searchCallEstimateCny)`,"billing.siteListDisplay":`Relay lists`,"billing.siteListDisplayHint":`Hide "unknown route / unidentified" placeholder rows in relay distribution and quota lists`,"billing.exportCsvSite":`By site CSV`,"billing.panelRelay":`Relay sites`,"billing.relaySite":`Relay`,"billing.relayDirect":`Direct`,"billing.relayUnknown":`Unknown route`,"billing.panelRelayQuota":`Relay quota`,"billing.relayBalance":`Balance`,"billing.relayNoQuota":`No quota`,"billing.relayWindowUsed":`used`,"billing.relayKindNewApi":`New API`,"billing.relayKindSub2Api":`Sub2API`,"billing.relayKindUnknown":`Unknown`,"billing.relayCalls":`calls`},mt={"智谱 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 ht(e,t){return t===`en`?mt[e]??e:e}let gt={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.6638 9.91965C35.3251 9.75432 35.1785 10.0703 34.9811 10.2316C34.9131 10.2836 34.8558 10.3516 34.7985 10.413C34.3025 10.9423 33.7238 11.289 32.9678 11.2476C31.8625 11.1863 30.9186 11.533 30.0839 12.3783C29.9066 11.3356 29.3173 10.7143 28.4213 10.3143C27.9519 10.1063 27.4773 9.89965 27.148 9.44766C26.9186 9.12633 26.856 8.76767 26.7413 8.41568C26.668 8.20235 26.5946 7.98502 26.3506 7.94902C26.084 7.90769 25.98 8.13035 25.876 8.31702C25.4587 9.07967 25.2973 9.91965 25.3133 10.7703C25.3493 12.6849 26.1573 14.2102 27.764 15.2942C27.9466 15.4182 27.9933 15.5435 27.9359 15.7249C27.8266 16.0982 27.696 16.4609 27.5813 16.8355C27.508 17.0742 27.3986 17.1248 27.1426 17.0222C26.2777 16.6504 25.4919 16.1164 24.828 15.4489C23.6854 14.3449 22.6534 13.1263 21.3654 12.1716C21.067 11.9511 20.7606 11.7416 20.4468 11.5436C19.1335 10.2676 20.6201 9.21967 20.9641 9.09567C21.3241 8.965 21.0881 8.51968 19.9254 8.52501C18.7628 8.53035 17.6988 8.91834 16.3428 9.43699C16.1413 9.51421 15.934 9.57529 15.7229 9.61966C14.4557 9.38091 13.1598 9.33506 11.8789 9.48366C9.36565 9.76365 7.35902 10.953 5.88305 12.9809C4.10975 15.4182 3.69243 18.1888 4.20308 21.0768C4.74041 24.122 6.29504 26.6433 8.683 28.6139C11.1603 30.6579 14.0122 31.6592 17.2668 31.4672C19.2428 31.3539 21.4441 31.0886 23.9254 28.9873C24.552 29.2993 25.208 29.4233 26.2986 29.5166C27.1386 29.5953 27.9466 29.4766 28.5719 29.3459C29.5519 29.1379 29.4839 28.23 29.1306 28.0646C26.2573 26.726 26.888 27.2713 26.3133 26.83C27.7746 25.102 29.9746 23.3074 30.8359 17.4928C30.9026 17.0302 30.8452 16.7395 30.8359 16.3662C30.8306 16.1395 30.8826 16.0502 31.1426 16.0249C31.8639 15.95 32.5637 15.7349 33.2025 15.3915C35.0638 14.3742 35.8158 12.7049 35.9931 10.7023C36.0198 10.3956 35.9878 10.081 35.6638 9.91965ZM19.4414 27.9433C16.6562 25.754 15.3055 25.0327 14.7482 25.0634C14.2256 25.0954 14.3202 25.6913 14.4349 26.0807C14.5549 26.4647 14.7109 26.7286 14.9295 27.066C15.0815 27.2886 15.1855 27.6206 14.7789 27.87C13.8816 28.4246 12.3229 27.6833 12.2496 27.6473C10.435 26.578 8.91632 25.1673 7.84834 23.2381C6.81637 21.3808 6.21638 19.3888 6.11771 17.2622C6.09105 16.7475 6.24171 16.5662 6.7537 16.4729C7.42583 16.3442 8.11451 16.3267 8.79233 16.4209C11.6349 16.8368 14.0536 18.1075 16.0828 20.1194C17.2402 21.2661 18.1161 22.6354 19.0188 23.974C19.9788 25.3953 21.0108 26.75 22.3254 27.8593C22.7894 28.2486 23.1587 28.5446 23.5134 28.7619C22.4441 28.8819 20.6601 28.9086 19.4414 27.9433ZM20.7748 19.3568C20.7745 19.2906 20.7904 19.2253 20.8211 19.1666C20.8517 19.1078 20.8962 19.0575 20.9507 19.0198C21.0052 18.9821 21.068 18.9583 21.1337 18.9503C21.1995 18.9424 21.2662 18.9505 21.3281 18.9741C21.407 19.0024 21.475 19.0546 21.5228 19.1235C21.5706 19.1923 21.5958 19.2743 21.5947 19.3581C21.5949 19.4123 21.5843 19.4659 21.5636 19.5159C21.5428 19.5659 21.5123 19.6113 21.4738 19.6494C21.4354 19.6875 21.3897 19.7176 21.3395 19.7378C21.2893 19.7581 21.2356 19.7682 21.1814 19.7675C21.1277 19.7676 21.0745 19.7571 21.0248 19.7365C20.9752 19.7158 20.9302 19.6855 20.8925 19.6473C20.8548 19.609 20.825 19.5636 20.805 19.5138C20.785 19.4639 20.7739 19.4105 20.7748 19.3568ZM24.9213 21.4848C24.6547 21.5928 24.3893 21.6861 24.1347 21.6981C23.7516 21.7114 23.3756 21.5918 23.0707 21.3594C22.7054 21.0528 22.4441 20.8821 22.3347 20.3488C22.297 20.0881 22.3042 19.823 22.3561 19.5648C22.4494 19.1288 22.3454 18.8488 22.0374 18.5955C21.7881 18.3875 21.4694 18.3302 21.1201 18.3302C21.0005 18.3232 20.8843 18.2875 20.7814 18.2262C20.6348 18.1542 20.5148 17.9728 20.6294 17.7488C20.6668 17.6768 20.8428 17.5008 20.8854 17.4688C21.3601 17.1995 21.9081 17.2875 22.4134 17.4902C22.8827 17.6822 23.2374 18.0342 23.748 18.5328C24.2694 19.1341 24.364 19.3008 24.6613 19.7515C24.896 20.1048 25.1093 20.4674 25.2547 20.8821C25.344 21.1421 25.2293 21.3541 24.9213 21.4848Z' 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.8377 17.282C33.2127 16.25 33.3072 15.218 33.2127 14.1875C33.1197 13.1571 32.7447 12.1251 32.2752 11.1876C31.4322 9.78209 30.2127 8.6571 28.8072 8.0001C27.3072 7.34461 25.7127 7.15711 24.1197 7.53211C23.3698 6.78212 22.5253 6.12512 21.5878 5.65713C20.6503 5.18913 19.5253 5.00013 18.4948 5.00013C16.8851 4.99074 15.3125 5.48246 13.9948 6.40712C12.6824 7.34311 11.7449 8.6571 11.2754 10.1571C10.1504 10.4376 9.21289 10.9071 8.27539 11.4696C7.4324 12.1251 6.77541 12.9696 6.21291 13.8126C5.36992 15.2195 5.08792 16.8125 5.27542 18.407C5.46399 19.9968 6.11605 21.496 7.1504 22.718C6.79608 23.7086 6.66795 24.7659 6.77541 25.8124C6.86991 26.8444 7.2449 27.8749 7.7129 28.8124C8.55739 30.2194 9.77538 31.3444 11.1824 31.9999C12.6824 32.6569 14.2753 32.8444 15.8698 32.4694C16.6198 33.2194 17.4628 33.8749 18.4003 34.3444C19.3378 34.8139 20.4628 34.9999 21.4948 34.9999C23.1043 35.0097 24.6769 34.5185 25.9947 33.5944C27.3072 32.6569 28.2447 31.3444 28.7127 29.8444C29.7719 29.6432 30.7682 29.1934 31.6197 28.5319C32.4627 27.8749 33.2127 27.1249 33.6822 26.1874C34.5251 24.7819 34.8071 23.1875 34.6196 21.5945C34.4322 20 33.8697 18.5015 32.8377 17.282ZM21.5878 33.0304C20.0878 33.0304 18.9628 32.5609 17.9323 31.7179C17.9323 31.7179 18.0253 31.6234 18.1198 31.6234L24.1197 28.1554C24.2862 28.0803 24.4196 27.9469 24.4947 27.7804C24.5698 27.636 24.6021 27.4731 24.5877 27.3109V18.875L27.1197 20.375V27.3124C27.1455 28.0547 27.0215 28.7945 26.755 29.4878C26.4885 30.181 26.085 30.8134 25.5687 31.3473C25.0523 31.8811 24.4337 32.3054 23.7497 32.5949C23.0658 32.8843 22.3305 33.0314 21.5878 33.0304ZM9.49488 27.8749C8.83789 26.7499 8.55739 25.4374 8.83789 24.125C8.83789 24.125 8.93239 24.2195 9.02539 24.2195L15.0253 27.6874C15.1693 27.7638 15.3325 27.7966 15.4948 27.7819C15.6823 27.7819 15.8698 27.7819 15.9628 27.6874L23.2753 23.4695V26.3749L17.1823 29.9374C16.5506 30.3042 15.8527 30.5427 15.1287 30.6393C14.4046 30.7358 13.6686 30.6884 12.9629 30.4999C11.4629 30.1249 10.2449 29.1874 9.49488 27.8749ZM7.9004 14.8445C8.56239 13.7234 9.58826 12.8627 10.8074 12.4056V19.532C10.8074 19.718 10.8074 19.907 10.9004 20C10.9755 20.1665 11.1089 20.2998 11.2754 20.375L18.5878 24.5944L16.0573 26.0944L10.0574 22.625C9.41842 22.2639 8.85742 21.7797 8.40684 21.2004C7.95627 20.6211 7.62506 19.9582 7.4324 19.25C7.05741 17.8445 7.1504 16.157 7.9004 14.8445ZM28.6197 19.625L21.3073 15.407L23.8377 13.9071L29.8377 17.375C30.7752 17.9375 31.5252 18.6875 31.9947 19.625C32.4642 20.5625 32.7447 21.5945 32.6502 22.7195C32.5603 23.7755 32.1699 24.7837 31.5252 25.6249C30.8697 26.4694 30.0252 27.1249 28.9947 27.4999V20.375C28.9947 20.1875 28.9947 20 28.9002 19.907C28.9002 19.907 28.8072 19.718 28.6197 19.625ZM31.1502 15.875C31.1502 15.875 31.0572 15.782 30.9627 15.782L24.9627 12.3126C24.7752 12.2196 24.6822 12.2196 24.4947 12.2196C24.3072 12.2196 24.1197 12.2196 24.0252 12.3126L16.7128 16.532V13.6251L22.8073 10.0626C23.7448 9.50009 24.7752 9.31259 25.9002 9.31259C26.9322 9.31259 27.9627 9.68759 28.9002 10.3446C29.7447 11.0001 30.4947 11.8446 30.8697 12.7821C31.2447 13.7196 31.3377 14.8445 31.1502 15.875ZM15.4003 21.125L12.8699 19.625V12.5946C12.8699 11.5626 13.1503 10.4376 13.7128 9.59459C14.2753 8.6571 15.1198 8.0001 16.0573 7.53211C17.0127 7.05249 18.0956 6.88812 19.1503 7.06261C20.1823 7.15711 21.2128 7.62511 22.0573 8.2821C22.0573 8.2821 21.9628 8.3751 21.8698 8.3751L15.8698 11.8446C15.7033 11.9197 15.57 12.0531 15.4948 12.2196C15.4003 12.4071 15.4003 12.5001 15.4003 12.6876V21.125ZM16.7128 18.125L19.9948 16.25L23.2753 18.125V21.875L19.9948 23.75L16.7128 21.875V18.125Z' 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 20.034C27.8809 20.5837 20.5808 27.8809 20.0326 37H19.966C19.4163 27.8809 12.1177 20.5837 3 20.034V19.9674C12.1191 19.4163 19.4163 12.1191 19.966 3H20.0326C20.5822 12.1191 27.8809 19.4163 37 19.9674V20.034Z' 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.1312 7.50002L17.4088 11.1913H5.81625L8.5375 7.50002H20.1325H20.1312ZM34.0675 28.81L31.3475 32.5H19.795L22.5125 28.81H34.0675ZM35 7.50002L16.58 32.5H5L23.42 7.50002H35Z' 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.0835 25.1541C19.5821 26.7684 21.1466 28.1292 22.6694 29.2117L21.5103 30.8416C19.8992 29.6963 18.2543 28.2675 16.6802 26.5808C17.1455 26.1486 17.6143 25.6722 18.0835 25.1541ZM9.99365 2.74979C11.7639 1.73255 13.8054 2.24897 15.6479 3.32304C17.52 4.41448 19.4573 6.22477 21.2603 8.33866L19.7378 9.63651C18.0045 7.60434 16.238 5.98161 14.6411 5.05058C13.0147 4.10247 11.8203 4.00682 10.9897 4.48417C10.0366 5.03255 9.41678 6.47496 9.78271 9.17167C9.86549 9.78127 9.99965 10.4345 10.1812 11.1277C11.6144 10.9497 13.0985 10.8513 14.6167 10.8543C17.7104 10.8604 20.4741 11.1506 22.7944 11.6805L22.7964 11.6814C23.2 11.7609 23.5914 11.858 23.9702 11.9656C23.9685 11.9703 23.9661 11.9746 23.9644 11.9793C24.661 12.1766 25.3101 12.3961 25.9067 12.6404C28.6066 13.7462 30.6077 15.4947 30.603 17.8855C30.599 19.9274 29.1314 21.4372 27.2798 22.4959C25.3986 23.5714 22.8625 24.344 20.1304 24.8484L19.7671 22.8807C22.3935 22.3957 24.6819 21.677 26.2866 20.7596C27.9209 19.8251 28.6011 18.8396 28.603 17.8816C28.6051 16.7818 27.6669 15.5237 25.1479 14.492C24.5672 14.2542 23.9208 14.0387 23.2134 13.8465C22.6517 15.1437 22.0035 16.4444 21.2612 17.7244C18.9392 21.7281 16.437 24.776 14.0688 26.6082C11.7614 28.3932 9.24631 29.2529 7.17822 28.0535C5.41209 27.0291 4.83828 25.0026 4.84717 22.8699C4.85632 20.7032 5.45524 18.1208 6.38428 15.5027L8.27002 16.1717C7.37685 18.6887 6.85497 21.0304 6.84717 22.8787C6.83939 24.7607 7.35367 25.8424 8.18213 26.323C9.13349 26.8747 10.6925 26.6915 12.8452 25.0262C13.3191 24.6595 13.8045 24.2295 14.3003 23.742C13.4493 22.6129 12.6395 21.4021 11.897 20.1101C9.59084 16.0976 8.20303 12.4071 7.80029 9.44022C7.40803 6.54936 7.92116 3.94134 9.99365 2.74979ZM14.6128 12.8543C13.3044 12.8518 12.0235 12.9291 10.7827 13.0701C11.4353 14.9013 12.3808 16.9381 13.6313 19.1141C14.2698 20.2249 14.9606 21.2715 15.6841 22.2537C16.9553 20.7654 18.2592 18.9138 19.5308 16.7215C20.1679 15.623 20.7315 14.5102 21.2271 13.4012C19.3246 13.0558 17.1033 12.8592 14.6128 12.8543ZM6.23193 11.8416C6.39799 12.459 6.59817 13.0982 6.83154 13.7566C4.8717 14.2207 3.07218 14.836 1.49854 15.5398L0.682129 13.7137C2.33167 12.9759 4.20224 12.3309 6.23193 11.8416ZM24.8901 3.62675L25.8853 3.70976C25.7206 5.68459 25.2981 7.84221 24.6128 10.0701C24.1572 9.9381 23.6801 9.8164 23.1831 9.71854C23.0101 9.6845 22.8337 9.6559 22.6567 9.62577C23.3278 7.47916 23.7373 5.41176 23.8931 3.54276L24.8901 3.62675Z' 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.8758 9.20865C17.8758 8.59461 17.3777 8.09634 16.7663 8.09634C16.155 8.09634 15.6567 8.59575 15.6567 9.20865V27.6446C15.6567 29.0714 14.4985 30.2324 13.0755 30.2324C11.6523 30.2324 10.4941 29.0714 10.4941 27.6446V15.8167C10.4941 15.2027 9.99591 14.7044 9.38453 14.7044C8.77316 14.7044 8.275 15.2038 8.275 15.8167V20.8301C8.275 22.2567 7.11678 23.4179 5.69364 23.4179C4.2705 23.4179 3.1123 22.2567 3.1123 20.8301V19.0129C3.1123 18.6054 3.44177 18.2752 3.84822 18.2752C4.25467 18.2752 4.58413 18.6054 4.58413 19.0129V20.8301C4.58413 21.4441 5.08227 21.9424 5.69364 21.9424C6.30502 21.9424 6.80317 21.443 6.80317 20.8301V15.8167C6.80317 14.39 7.96139 13.2289 9.38453 13.2289C10.8077 13.2289 11.9659 14.39 11.9659 15.8167V27.6446C11.9659 28.2587 12.4641 28.7569 13.0755 28.7569C13.6868 28.7569 14.1849 28.2575 14.1849 27.6446V20.4123V9.20865C14.1849 7.78194 15.3431 6.62082 16.7663 6.62082C18.1894 6.62082 19.3476 7.78194 19.3476 9.20865V24.4746C19.3476 24.8821 19.0182 25.2123 18.6117 25.2123C18.2053 25.2123 17.8758 24.8821 17.8758 24.4746V9.20865ZM31.531 13.2289C30.1079 13.2289 28.9496 14.39 28.9496 15.8167V25.6969C28.9496 26.311 28.4515 26.8093 27.8401 26.8093C27.2287 26.8093 26.7306 26.3099 26.7306 25.6969V9.20865C26.7306 7.78194 25.5723 6.62082 24.1492 6.62082C22.7261 6.62082 21.5679 7.78194 21.5679 9.20865V30.1383C21.5679 30.7523 21.0697 31.2506 20.4583 31.2506C19.8469 31.2506 19.3488 30.7511 19.3488 30.1383V27.5471C19.3488 27.1396 19.0194 26.8093 18.6129 26.8093C18.2065 26.8093 17.877 27.1396 17.877 27.5471V30.1383C17.877 31.565 19.0352 32.7261 20.4583 32.7261C21.8815 32.7261 23.0397 31.565 23.0397 30.1383V9.20865C23.0397 8.59461 23.5378 8.09634 24.1492 8.09634C24.7605 8.09634 25.2587 8.59575 25.2587 9.20865V25.6969C25.2587 27.1237 26.417 28.2848 27.8401 28.2848C29.2632 28.2848 30.4215 27.1237 30.4215 25.6969V15.8167C30.4215 15.2027 30.9196 14.7044 31.531 14.7044C32.1424 14.7044 32.6405 15.2038 32.6405 15.8167V24.4746C32.6405 24.8821 32.97 25.2123 33.3764 25.2123C33.7829 25.2123 34.1123 24.8821 34.1123 24.4746V15.8167C34.1123 14.39 32.9541 13.2289 31.531 13.2289Z' 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='M37.9998 23.021C33.7998 25.2889 29.5698 27.3649 24.8614 28.3069C23.8114 28.5154 22.6474 28.5154 21.5809 28.3714C20.5639 28.2439 20.0554 27.3484 20.4169 26.4064C20.7619 25.5289 21.2209 24.635 21.8119 23.9C23.0899 22.3025 24.5329 20.849 25.8289 19.268C26.6203 18.2991 27.3335 17.2689 27.9618 16.187C28.4208 15.4205 28.2078 14.4935 27.4038 14.111C26.0584 13.4556 24.6154 12.9936 23.1889 12.4986C23.0239 12.4341 22.7779 12.6096 22.4509 12.7221C22.8604 13.0881 23.1559 13.3596 23.5654 13.727C19.3339 14.447 15.3305 15.467 11.4455 16.874C11.4275 16.9535 11.396 17.0165 11.411 17.0495C11.9855 17.927 11.723 18.5975 10.886 19.1405C10.5611 19.3531 10.2732 19.6176 10.034 19.9235C12.593 20.6735 14.873 20.243 17.0539 18.821C16.9234 18.6305 16.7914 18.455 16.6609 18.263C17.4799 18.407 17.9719 18.854 18.0379 19.556C18.0544 19.7165 17.9569 19.8755 17.9074 20.036C17.7919 19.907 17.6449 19.781 17.5474 19.6355C17.4799 19.5395 17.4634 19.4285 17.4154 19.268C14.8235 20.993 12.035 21.425 8.96751 20.531C8.96751 21.137 8.93451 21.6485 8.98401 22.1435C9.01701 22.574 8.83701 22.766 8.44401 22.9895C7.55752 23.5325 6.63803 24.092 5.90003 24.8105C5.01504 25.6879 5.34354 26.7589 6.54053 27.2059C7.90102 27.7159 9.329 27.7309 10.7555 27.5569C12.4445 27.3484 14.1005 27.0769 15.9394 26.8219C13.79 27.8269 11.6735 28.5319 9.4445 28.8169C7.88452 29.0269 6.32753 29.1379 4.78554 28.6909C2.57156 28.0684 1.58607 26.4394 2.16057 24.251C2.70206 22.2065 4.01455 20.5775 5.42454 19.076C10.133 14.078 16.0864 11.5401 22.9744 11.0286C24.5824 10.9176 26.2069 11.1246 27.7143 11.7951C29.8308 12.7536 30.7173 14.78 29.6838 16.826C29.0118 18.1835 28.0758 19.4285 27.1413 20.6585C26.2234 21.872 25.1899 22.9895 24.2224 24.155C23.9434 24.506 23.6809 24.875 23.4679 25.2724C23.0569 26.0224 23.3359 26.5174 24.2059 26.4394C26.0254 26.2624 27.8808 26.1199 29.6358 25.6729C32.2098 25.0174 34.7193 24.092 37.2618 23.2775C37.5243 23.213 37.7703 23.117 37.9998 23.0225V23.021Z' 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.3598 5.03522C13.6378 5.20577 11.3905 5.78765 9.47432 7.07179C8.10992 7.97471 7.10668 9.14849 6.38435 10.6935C5.59179 12.389 5.24066 14.255 5.09017 17.7262C4.90959 21.6087 5.17043 25.4812 5.75231 27.5378C6.27399 29.4039 7.10668 30.8285 8.38079 32.0223C9.95588 33.487 11.7216 34.2595 14.4604 34.6709C16.9685 35.0421 22.7773 35.0621 25.3154 34.711C28.4054 34.2896 30.3718 33.4168 31.987 31.7414C32.7896 30.9187 33.1608 30.377 33.6824 29.2835C34.4951 27.5679 34.8261 25.7922 34.9867 22.2407C35.107 19.7026 34.9867 16.0909 34.7358 14.4055C34.1439 10.4527 32.4585 7.88441 29.519 6.39962C27.964 5.62713 25.6766 5.17567 22.4963 5.02519C20.0986 4.91483 19.7776 4.91483 17.3598 5.03522ZM21.0617 14.3854C22.386 14.6964 23.0281 15.1378 23.4494 16.0407C23.8808 16.9637 23.951 17.7262 23.951 21.8896V25.8022L22.5264 25.7721L21.0918 25.742L21.0417 21.9297C20.9915 17.7663 20.9714 17.6359 20.3895 17.1844C19.8679 16.7731 19.4264 16.7229 16.5772 16.7129H13.8685L13.8183 21.2275L13.7682 25.742H10.9591L10.929 20.0336C10.909 15.5291 10.939 14.2951 11.0293 14.2349C11.0996 14.1847 13.2365 14.1647 15.7747 14.1847C19.4967 14.2249 20.52 14.265 21.0617 14.3854ZM28.9472 14.3252C29.0174 14.4657 29.0475 25.3708 28.9773 25.722C28.9773 25.7621 28.3252 25.7822 27.5426 25.7721L26.108 25.742L26.0779 20.0838C26.0679 15.9906 26.0879 14.3854 26.1682 14.2951C26.2585 14.1847 26.6096 14.1546 27.5727 14.1546C28.6964 14.1546 28.8669 14.1747 28.9472 14.3252ZM18.9349 22.2307V25.8022L17.4601 25.7721L15.9753 25.742L15.9452 22.331C15.9352 20.455 15.9452 18.8598 15.9753 18.7996C16.0054 18.6993 16.3967 18.6692 17.4802 18.6692H18.9349V22.2307Z' 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.29 5.36L3.148 21.737a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.359a.214.214 0 00-.41 0z' fill-opacity='.5'%3E%3C/path%3E%3Cpath clip-rule='evenodd' d='M4.553 16.18l-1.406 5.558a.214.214 0 00.203.261h2.42-4.551a.214.214 0 01-.214-.26l2.275-8.961a.214.214 0 01.409 0l.864 3.402z'%3E%3C/path%3E%3Cpath d='M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.214.214 0 00.215-.261L14.44.151z' fill-opacity='.5'%3E%3C/path%3E%3Cpath clip-rule='evenodd' d='M16.694 22h3.207a.215.215 0 00.214-.262l-1.839-6.993 1.164-4.592a.214.214 0 01.411 0l2.951 11.586a.214.214 0 01-.214.261h-5.894z'%3E%3C/path%3E%3Cpath d='M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.216.216 0 00.214-.166.216.216 0 000-.098L10.687 7.742a.214.214 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 _t(e){return gt[e]}let vt=`dsh-billing-peak-alert-v1`,yt={enabled:!1,leadMin:2,position:`bottom-right`,webNotify:!0,mode:`both`};function bt(){try{let e=localStorage.getItem(vt);if(e===null)return{...yt};let t=JSON.parse(e),n=t.mode===`peak`||t.mode===`offPeak`?t.mode:yt.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))):yt.leadMin,position:r,webNotify:t.webNotify!==!1,mode:n}}catch{return{...yt}}}function xt(e){try{localStorage.setItem(vt,JSON.stringify(e))}catch{}}function St(e,t,n){if(!t.enabled)return null;let r=be(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 Ct({hit:e,config:t,t:n,onDismiss:a}){let[o,s]=(0,i.useState)(()=>Date.now());if((0,i.useEffect)(()=>{let e=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,i.useEffect)(()=>{o>=e.atMs&&a()},[o,e.atMs,a]),o>=e.atMs)return null;let l=Math.max(1,Math.round((e.atMs-o)/6e4)),u=e.entering,d=n(u===`peak`?`billing.tierPeak`:`billing.tierOff`),f=n(u===`peak`?`billing.peakAlertDescPeak`:`billing.peakAlertDescOff`),p=u===`peak`;return(0,r.jsxs)(`div`,{className:c(C.peakCard,p?C.peakCardPeak:C.peakCardOff,t.position===`center`?C.peakCardCenter:C.peakCardCorner),"data-testid":`billing-peak-alert`,role:`alert`,children:[(0,r.jsxs)(`div`,{className:C.peakHead,children:[(0,r.jsxs)(`span`,{className:c(C.peakTag,p?C.peakTagPrimary:C.peakTagSuccess),children:[(0,r.jsx)(`span`,{className:c(C.peakDot,p?C.peakDotPrimary:C.peakDotSuccess),"aria-hidden":`true`}),d]}),(0,r.jsx)(`button`,{type:`button`,className:C.peakClose,onClick:a,"aria-label":n(`billing.close`),children:`×`})]}),(0,r.jsxs)(`div`,{className:c(C.peakCount,p?C.peakCountPrimary:C.peakCountSuccess),children:[l,`min`]}),(0,r.jsx)(`p`,{className:C.peakDesc,children:f})]})}let wt=[{id:`overview`,labelKey:`billing.tabOverview`},{id:`providers`,labelKey:`billing.tabProviders`},{id:`token`,labelKey:`billing.tabToken`},{id:`trends`,labelKey:`billing.tabTrends`},{id:`pricing`,labelKey:`billing.tabPricing`},{id:`settings`,labelKey:`billing.tabSettings`}];function Tt(e){if(e!==void 0)return e.split(/[\\/]/).filter(Boolean).pop()??e}let Et=[50,80,100],Dt={checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]},Ot={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 kt(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 At(e,t){let n=Q(e),r=Q(t);if(kt(n,r))return!0;let i=Ot[e];return i!==void 0&&i.some(e=>kt(Q(e),r))}function jt(e){let t=e.trim().toLowerCase(),n=t.replace(/[\s_/-]+/g,``);if(n.length!==0){for(let[e,n]of Object.entries(Ot))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(Ot))for(let r of t){let t=Q(r);if(!(t.length<4)&&n.includes(t))return e}}}let Mt={"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 Nt(e){let t=Mt[e];return t===void 0?jt(e)??e:t}function Pt(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 Ft(e,t,n){let r=Object.keys(e).filter(e=>e.startsWith(t)),i=new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate(),a=r.length>0?r.reduce((t,n)=>t+(e[n]?.cost??0),0)/r.length:Pt(e,n);return a<=0?0:a*i}function It(e){let t=ce();if(t===void 0||e.byDayModels===void 0)return e;let n=fe().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||N(t.key)===N(e))),l=(e,t,r)=>{if(e===void 0)return r;let i=Math.min(t.cacheHit,t.cacheMiss+t.cacheHit),a=(t.cacheMiss*e.input+i*e.cacheHit+t.output*e.output)/1e6;return e.currency===`USD`?a*n:a};for(let[t,n]of Object.entries(e.byDayModels)){let u=0,d={};for(let[i,a]of Object.entries(n)){let n=A(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:A(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 Lt(e){return Object.keys(e).length}function Rt(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 zt(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 Bt(e,t){return e.checked?e.okProviders.some(e=>At(t,e))?C.healthOk:e.badProviders.some(e=>At(t,e))?C.healthBad:C.healthIdle:C.healthIdle}function Vt(e,t){switch(e){case`ok`:return``;case`not-configured`:return t(`billing.subscriptionNotConfigured`);case`unauthorized`:return t(`billing.subscriptionUnauthorized`);case`rate-limited`:return t(`billing.subscriptionRateLimited`);case`invalid-response`:return t(`billing.subscriptionInvalid`);default:return t(`billing.subscriptionUnavailable`)}}function Ht(e,t){switch(e){case`session`:return t(`billing.subscriptionSession`);case`weekly`:return t(`billing.subscriptionWeekly`);case`monthly`:return t(`billing.subscriptionMonthly`);case`billing`:return t(`billing.subscriptionBilling`)}}function Ut(e,t){return e.startsWith(`site:`)?{name:e.slice(5),kind:`site`}:e.startsWith(`direct:`)?{name:e.slice(7),kind:`direct`}:{name:t(`billing.relayUnknown`),kind:`unknown`}}function Wt(e,t){switch(e){case`site`:return t(`billing.relaySite`);case`direct`:return t(`billing.relayDirect`);default:return t(`billing.relayUnknown`)}}function Gt(e,t){switch(e){case`new-api`:return t(`billing.relayKindNewApi`);case`sub2api`:return t(`billing.relayKindSub2Api`);default:return t(`billing.relayKindUnknown`)}}let Kt={site:C.siteKindSite,direct:C.siteKindDirect,unknown:C.siteKindUnknown},qt={"new-api":C.siteKindSite,sub2api:C.siteKindDirect,unknown:C.siteKindUnknown},Jt=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 Yt(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}let Xt=[`#3b82f6`,`#06b6d4`,`#8b5cf6`,`#f59e0b`,`#10b981`,`#ef4444`,`#ec4899`,`#6366f1`,`#f97316`,`#14b8a6`],Zt={total:{calls:0,input:0,output:0,cacheHit:0,cacheMiss:0,cost:0,reasoning:0},byModel:{},byDay:{},byDayModels:{}};async function Qt(){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??Zt.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.byHour!==null&&typeof r.perf.byHour==`object`?{perf:r.perf}:{},...typeof r.pluginVersion==`string`?{pluginVersion:r.pluginVersion}:{}}}catch{return null}}let $t=!1;async function en(e=0){try{let t=await fetch(`/api/billing/pricing`);if(!t.ok){$t=!1;return}let n=await t.text(),r=JSON.parse(n);if(typeof r!=`object`||!r||!(`source`in r)){$t=!1;return}let i=r;if(i.source===`builtin`&&e<3){if(e===0){if($t)return;$t=!0}setTimeout(()=>{en(e+1)},2e3);return}$t=!1,le(i)}catch{$t=!1}}async function tn(){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 nn(){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 rn(){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 an(){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 on(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 sn(e){let{wide:t,t:n,onOpen:a,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,i.useMemo)(()=>p.targets.map(e=>m.find(t=>t.provider===e)).filter(e=>e!==void 0),[p.targets,m]),[ee,te]=(0,i.useState)(0),b=y.length===0?0:Math.min(ee,y.length-1),x=y[b];(0,i.useEffect)(()=>{if(p.mode!==`subscription`||y.length<2)return;let e=setInterval(()=>te(e=>(e+1)%y.length),1500);return()=>clearInterval(e)},[p.mode,y.length]);let S=(0,r.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,r.jsx)(`path`,{d:`M4 7h16v11H4z`}),(0,r.jsx)(`path`,{d:`M4 10h16`}),(0,r.jsx)(`path`,{d:`M8 14h3`})]});if(!t)return(0,r.jsx)(`button`,{type:`button`,className:C.railButton,"data-testid":`billing-rail-button`,onClick:a,title:`${n(`billing.title`)} · ${z(o)}`,children:S});let w=h.metric===`tokens`,T=u.map(e=>w?e.tokens:e.cost),ne=Math.max(...T,0),re=T.map(e=>ne>0?4+e/ne*12:4);return(0,r.jsxs)(`span`,{className:C.triggerWrap,children:[(0,r.jsxs)(`button`,{type:`button`,className:C.trigger,"data-testid":`billing-trigger`,onClick:a,title:`${n(`billing.title`)} · ${z(o)}`,children:[(0,r.jsx)(`span`,{className:C.triggerIcon,"data-testid":`billing-trigger-icon`,children:S}),(0,r.jsxs)(`span`,{className:C.triggerMain,children:[(0,r.jsxs)(`span`,{className:C.triggerPrimary,children:[(0,r.jsx)(`span`,{className:C.triggerLabel,children:n(w?`billing.triggerMonthTokens`:`billing.triggerMonth`)}),w?(0,r.jsx)(`span`,{className:C.triggerMetric,"data-testid":`billing-trigger-month-tokens`,children:B(g)}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{className:C.triggerYen,"aria-hidden":`true`,children:z(o).charAt(0)}),(0,r.jsx)(`span`,{className:C.triggerMetric,children:z(o).slice(1)})]})]}),(0,r.jsx)(`span`,{className:C.triggerSub,"data-testid":`billing-trigger-today`,children:w?`${n(`billing.triggerToday`)} ${B(_)} · ${n(`billing.weekCost`)} ${B(v)}`:`${n(`billing.triggerToday`)} ${z(s)} · ${n(`billing.weekCost`)} ${z(l)}`})]}),(0,r.jsx)(`span`,{className:C.triggerSpark,"data-testid":`billing-trigger-spark`,"aria-hidden":`true`,children:re.map((e,t)=>(0,r.jsx)(`span`,{className:t===re.length-1?C.triggerSparkHot:C.triggerSparkBar,style:{height:`${e}px`}},u[t]?.date??String(t)))})]}),(0,r.jsx)(`span`,{className:c(C.triggerPop,p.mode===`subscription`&&C.triggerPopSubscription),"data-testid":`billing-trigger-pop`,"aria-hidden":`true`,children:p.mode===`subscription`?(0,r.jsx)(r.Fragment,{children:y.length===0?(0,r.jsx)(`span`,{className:C.triggerPopEmpty,children:n(`billing.floatNoTargets`)}):(0,r.jsxs)(r.Fragment,{children:[x!==void 0&&(0,r.jsxs)(`div`,{className:C.floatSub,"data-testid":`billing-float-subscription`,children:[(0,r.jsxs)(`div`,{className:C.floatSubHead,children:[(0,r.jsx)(`span`,{className:C.floatSubName,children:x.displayName}),x.plan!==void 0&&(0,r.jsx)(`span`,{className:C.floatSubPlan,children:x.plan})]}),x.windows.map(e=>(()=>{let t=Math.min(100,Math.max(0,e.usedPercent)),i=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,r.jsxs)(`div`,{className:C.subscriptionWindow,children:[(0,r.jsx)(`span`,{className:C.subscriptionWindowLabel,children:Ht(e.kind,n)}),(0,r.jsx)(`span`,{className:C.subscriptionTrack,"aria-hidden":`true`,children:(0,r.jsx)(`span`,{className:c(C.subscriptionFill,t>=100&&C.subscriptionFillOver,t>=80&&t<100&&C.subscriptionFillWarn),style:{width:`${t}%`}})}),(0,r.jsxs)(`span`,{className:C.subscriptionMeta,children:[(0,r.jsx)(`span`,{className:c(C.subscriptionPct,i&&C.subscriptionExhausted),children:i?n(`billing.subscriptionExhausted`):n(`billing.subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,r.jsx)(`span`,{className:C.subscriptionReset,children:n(`billing.subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${Yt(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]}),y.length>1&&(0,r.jsx)(`span`,{className:C.triggerPopSwitcher,"data-testid":`billing-float-switcher`,children:(0,r.jsxs)(`span`,{className:C.triggerPopSwitchCount,children:[b+1,`/`,y.length]})})]})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{className:C.popHead,children:(0,r.jsx)(`span`,{className:C.popTitle,children:n(`billing.popTitle`)})}),(0,r.jsxs)(`span`,{className:C.metricGrid,children:[(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.monthCost`)}),(0,r.jsx)(`span`,{className:c(C.metricValue,C.metricValuePrimary),children:z(o)})]}),(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.tokenTotal`)}),(0,r.jsx)(`span`,{className:C.metricValue,children:B(f.totalToken)})]}),(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.input`)}),(0,r.jsx)(`span`,{className:C.metricValue,children:B(f.input)})]}),(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.output`)}),(0,r.jsx)(`span`,{className:C.metricValue,children:B(f.output)})]}),(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.cacheHit`)}),(0,r.jsx)(`span`,{className:c(C.metricValue,C.metricValueSuccess),children:B(f.cacheRead)})]}),(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.calls`)}),(0,r.jsx)(`span`,{className:C.metricValue,children:f.calls.toLocaleString()})]})]}),(0,r.jsxs)(`span`,{className:C.popModel,children:[(0,r.jsx)(`span`,{className:C.popModelLabel,children:n(`billing.popTodayModel`)}),d.direct!==void 0||d.sub!==void 0?(0,r.jsxs)(r.Fragment,{children:[d.direct!==void 0&&(0,r.jsxs)(`span`,{className:C.popModelRow,children:[(0,r.jsx)(`span`,{className:c(C.popDot,C.popDotDirect),"aria-hidden":`true`}),(0,r.jsx)(`span`,{className:C.popTagPrimary,children:n(`billing.popDirectLead`)}),(0,r.jsx)(`span`,{className:C.popModelName,children:d.direct.name}),(0,r.jsx)(`span`,{className:c(C.popModelStatus,d.direct.low&&C.popModelStatusLow),children:d.direct.text})]}),d.sub!==void 0&&(0,r.jsxs)(`span`,{className:C.popModelRow,children:[(0,r.jsx)(`span`,{className:c(C.popDot,C.popDotSub),"aria-hidden":`true`}),(0,r.jsx)(`span`,{className:C.popTagSub,children:n(`billing.popSubLead`)}),(0,r.jsx)(`span`,{className:C.popModelName,children:d.sub.name}),(0,r.jsx)(`span`,{className:c(C.popModelStatus,d.sub.low&&C.popModelStatusLow),children:d.sub.text})]})]}):(0,r.jsxs)(`span`,{className:C.popModelRow,children:[(0,r.jsx)(`span`,{className:c(C.popDot,C.popDotNeutral),"aria-hidden":`true`}),(0,r.jsx)(`span`,{className:C.popModelStatus,children:n(`billing.popNoConsumption`)})]})]})]})})]})}function cn({balance:e,days:t,dailyBurn:n,money:i,t:a,onClose:o}){let s=t=>t===void 0?void 0:e.currency===`USD`?`$${t.toFixed(2)}`:i(t),c=s(e.totalBalance),l=s(e.grantedBalance),u=s(e.toppedUpBalance);return(0,r.jsxs)(`span`,{className:C.balanceDetailPop,"data-testid":`billing-balance-detail-pop`,children:[(0,r.jsxs)(`span`,{className:C.balanceDetailHead,children:[(0,r.jsx)(`span`,{className:C.balanceDetailTitle,children:e.displayName}),(0,r.jsx)(`button`,{type:`button`,className:C.balanceDetailClose,"aria-label":a(`billing.close`),onClick:o,children:`×`})]}),(0,r.jsxs)(`span`,{className:C.balanceDetailGrid,children:[c!==void 0&&(0,r.jsx)(ln,{label:a(`billing.balance`),value:c}),l!==void 0&&(0,r.jsx)(ln,{label:a(`billing.balanceGranted`),value:l}),u!==void 0&&(0,r.jsx)(ln,{label:a(`billing.balanceTopped`),value:u}),(0,r.jsx)(ln,{label:a(`billing.balanceDaily`),value:i(n)}),(0,r.jsx)(ln,{label:a(`billing.balanceDaysLong`),value:`${t} ${a(`billing.balanceDaysUnit`)}`})]})]})}function ln({label:e,value:t}){return(0,r.jsxs)(`span`,{className:C.balanceDetailRow,children:[(0,r.jsx)(`span`,{className:C.balanceDetailLabel,children:e}),(0,r.jsx)(`span`,{className:C.balanceDetailValue,children:t})]})}function un({userPrices:e,onUserPrices:t,t:n}){let[a,o]=(0,i.useState)(()=>[...e]),s=(e,t)=>o(n=>n.map((n,r)=>r===e?{...n,...t}:n)),l=e=>o(t=>t.filter((t,n)=>n!==e)),u=()=>o(e=>[...e,{key:``,input:0,cacheHit:0,output:0}]),d=()=>t(a.filter(e=>e.key.trim()!==``)),f=(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})),p=e=>Number.isFinite(e)&&e!==0?String(e):``,m=(e,t,n)=>{let r=Number(n);s(e,{[t]:Number.isFinite(r)&&r>=0?r:0})};return(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-user-prices`,children:[(0,r.jsx)(`div`,{className:C.setCardHead,children:(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:n(`billing.userPrices`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:n(`billing.userPricesHint`)})]})}),(0,r.jsxs)(`div`,{className:C.ctlCol,children:[a.map((e,t)=>(0,r.jsxs)(`div`,{className:C.userPriceRow,"data-testid":`billing-user-price-row`,children:[(0,r.jsxs)(`div`,{className:C.userPriceField,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:n(`billing.userPriceModel`)}),(0,r.jsx)(`input`,{className:C.userPriceInput,"data-testid":`billing-user-price-model`,type:`text`,value:e.key,placeholder:`flash`,"aria-label":n(`billing.userPriceModel`),onChange:e=>s(t,{key:e.target.value})})]}),(0,r.jsxs)(`div`,{className:C.userPriceField,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:n(`billing.userPriceSource`)}),(0,r.jsx)(`input`,{className:C.userPriceInput,"data-testid":`billing-user-price-origin`,type:`text`,value:e.origin??``,placeholder:n(`billing.userPriceSourceHint`),"aria-label":n(`billing.userPriceSource`),onChange:e=>s(t,{origin:e.target.value.trim()})})]}),[`input`,`cacheHit`,`output`].map(i=>(0,r.jsxs)(`div`,{className:C.userPriceField,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:n(i===`input`?`billing.tokenMiss`:i===`cacheHit`?`billing.tokenHit`:`billing.tokenOutput`)}),(0,r.jsx)(`input`,{className:C.userPriceInputNum,type:`number`,min:0,step:.01,value:p(e[i]),onChange:e=>m(t,i,e.target.value)})]},i)),(0,r.jsxs)(`div`,{className:C.userPriceField,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:n(`billing.userPriceCurrency`)}),(0,r.jsxs)(`div`,{className:C.ctlGroup,children:[(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,e.currency!==`USD`&&C.floatModeBtnOn),onClick:()=>f(t,`CNY`),children:`CNY`}),(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,e.currency===`USD`&&C.floatModeBtnOn),onClick:()=>f(t,`USD`),children:`USD`})]})]}),(0,r.jsx)(`button`,{type:`button`,className:C.userPriceRemove,"aria-label":n(`billing.userPriceRemove`),onClick:()=>l(t),children:n(`billing.userPriceRemove`)})]},t)),(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-user-price-add`,onClick:u,children:n(`billing.userPriceAdd`)}),(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-user-price-save`,onClick:d,children:n(`billing.userPriceSave`)})]})]})]})}function dn({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:ee,onBudgetAmount:te,peakConfig:b,onPeakConfig:x,onPreviewPeak:S,floatPrefs:w,onFloatPrefs:T,cardPrefs:ne,onCardPrefs:ie,sitePrefs:E,onSitePrefs:ae,quotasStale:oe}){let[se,D]=(0,i.useState)(`cost`),{total:O,byModel:ce,byDay:k}=e,[A,le]=(0,i.useState)(`overview`),[ue,de]=(0,i.useState)(7),[pe,me]=(0,i.useState)(()=>{try{return window.localStorage.getItem(`dsh-billing:reconcile-dismissed`)??``}catch{return``}}),he=()=>{let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`},ge=(0,i.useCallback)(()=>{let e=he();me(e);try{window.localStorage.setItem(`dsh-billing:reconcile-dismissed`,e)}catch{}},[]),[_e,ve]=(0,i.useState)(`month`),ye=(0,i.useMemo)(()=>f.filter(e=>e.status===`ok`&&e.windows.length>0).map(e=>({id:e.provider,label:e.displayName})),[f]),[be,j]=(0,i.useState)(),[M,xe]=(0,i.useState)(),[N,P]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=!0;return an().then(t=>{e&&t!==void 0&&P(t)}),()=>{e=!1}},[]);let F=(0,i.useCallback)(()=>{let e=!N;P(e),on(e).then(t=>{t||P(!e)})},[N]),I=fe(),L=e=>z(m===`usd`?R(e):e,m),we=m===`usd`?`en`:`zh`,De=e=>ht(e,we),V=(e,n)=>e===0?t(`billing.free`):ke(Ae(e,n,m,I.rate),m===`usd`?`USD`:`CNY`),Me=(0,i.useMemo)(()=>tt([...g].reverse()),[g]),H={peak:e.byTier?.peak.cost??0,offPeak:e.byTier?.offPeak.cost??0},Ne=H.peak/2,Pe=(0,i.useMemo)(()=>{let n=e.byRole;if(n===void 0)return[];let r=n.user+n.assistant+n.tool;return r<=0?[]:[{label:t(`billing.roleUser`),value:n.user,seg:C.shareSegUser},{label:t(`billing.roleAssistant`),value:n.assistant,seg:C.shareSegAssistant},{label:t(`billing.roleTool`),value:n.tool,seg:C.shareSegTool}].map(e=>({...e,pct:e.value/r*100}))},[e.byRole,t]),U=Pt(k,$()),Ie=e=>u.find(t=>Q(t.provider)===Q(e)),Le=e=>e.balance?.error===`unconfigured`&&e.models.length>0&&e.models.every(e=>e.plan),ze=e=>{if(e===void 0)return(0,r.jsx)(`span`,{className:C.na,children:`—`});if(e.error===`unconfigured`)return t(`billing.balanceUnconfigured`);if(e.error===`unauthorized`)return t(`billing.balanceUnauthorized`);if(e.error===`unreachable`)return t(`billing.balanceUnreachable`);if(e.totalBalance===void 0)return(0,r.jsx)(`span`,{className:C.na,children:`—`});let n=e.currency===`USD`?`$${e.totalBalance.toFixed(2)}`:L(e.totalBalance),i=e.currency===`USD`?e.totalBalance*I.rate:e.totalBalance,a=U>0?Math.floor(i/U):void 0;return(0,r.jsxs)(`span`,{className:C.balanceCell,children:[(0,r.jsx)(`span`,{children:n}),a!==void 0&&a>=0&&(0,r.jsx)(`button`,{type:`button`,className:c(C.balanceDaysBadge,a<=3&&C.balanceDaysBadgeLow),"data-testid":`billing-balance-days-badge`,title:t(`billing.balanceDays`).replace(`{days}`,String(a)),"aria-label":`${e.displayName} ${t(`billing.balanceDays`).replace(`{days}`,String(a))}`,onClick:()=>{j(be===e.provider?void 0:e.provider)},children:`?`}),be===e.provider&&(0,r.jsx)(cn,{balance:e,days:a??0,dailyBurn:U,money:L,t,onClose:()=>{j(void 0)}})]})},Be=O.cacheHit+O.cacheMiss>0?O.cacheHit/(O.cacheHit+O.cacheMiss)*100:0,Ve=Object.keys(k).sort(),G=$(),K=k[G]?.cost??0,He=G.slice(0,7),Ue=G.slice(0,4),q=Ve.reduce((e,t)=>e+(t.startsWith(He)?k[t]?.cost??0:0),0),We=Ve.reduce((e,t)=>e+(t.startsWith(Ue)?k[t]?.cost??0:0),0),Ke=(0,i.useMemo)(()=>Ft(k,He,G)+f.reduce((e,t)=>e+(t.planType===`code`?t.subscriptionAmount??0:0),0),[k,He,G,f]),qe=(0,i.useMemo)(()=>{let e=v&&y>0?q/y*100:NaN;return{pct:Number.isFinite(e)?Math.max(0,Math.min(100,e)):We>0?Math.max(0,Math.min(100,q/We*100)):0,over:Number.isFinite(e)&&e>=100,label:t(Number.isFinite(e)?`billing.budget`:`billing.monthCost`)}},[v,y,q,We,t]),Je=v&&y>0?q/y*100:0,J=(0,i.useMemo)(()=>{let e=[];for(let t=ue-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t),e.push($(n.getTime()))}return e},[ue]),Xe=J.at(-1)??G,Ze=(0,i.useMemo)(()=>Object.entries(k).map(([e,t])=>({date:e,value:t.cost})),[k]),Qe=Lt(k),$e=Rt(k),Y=(0,i.useMemo)(()=>J.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=k[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}}),[J,k,e.byDayModels]),X=(0,i.useMemo)(()=>Object.entries(ce).filter(([,e])=>e.calls>0).map(([e,t])=>{let n=Se(e),r=n.key===`other`,i=r?jt(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:Oe(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:Xt[t%Xt.length]??`#8b95a3`})),[ce]),Z=(0,i.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]),nt=(0,i.useMemo)(()=>Object.entries(e.bySite??{}).filter(([e])=>!(E.hideUnidentified&&e===`unknown`)).sort((e,t)=>(t[1].cost??0)-(e[1].cost??0)),[e.bySite,E.hideUnidentified]),rt=(0,i.useMemo)(()=>E.hideUnidentified?p.filter(e=>e.kind!==`unknown`):p,[p,E.hideUnidentified]),it=(0,i.useMemo)(()=>{let e=new Map;for(let t of f){if(t.status===`not-configured`)continue;let n=Nt(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=jt(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:Ie(n),dot:Bt(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:Bt(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]),st=X.reduce((e,t)=>e+t.estimated,0),dt=O.cost>0?O.cost:st,ft=O.calls>0?dt/O.calls:0,pt=(0,i.useMemo)(()=>X.map(e=>({key:e.key,name:e.name,color:e.color})),[X]),mt=Y.length>=2?Y.at(-2)?.cost??0:0,gt=mt>0?(K-mt)/mt*100:0;return(0,r.jsx)(a.Modal,{open:!0,onClose:n,title:t(`billing.title`),headless:!0,className:c(C.dashboardModal,`dsh-billing-modal`),children:(0,r.jsxs)(`div`,{className:C.dashboard,"data-testid":`billing-dashboard`,children:[(0,r.jsxs)(`div`,{className:C.dashboardHead,"data-testid":`billing-dashboard-head`,children:[(0,r.jsxs)(`div`,{children:[_(`billing.dashboard.decor`,{position:`head`}),(0,r.jsxs)(`div`,{className:C.headTitleRow,children:[(0,r.jsx)(`h2`,{className:C.dashboardTitle,children:t(`billing.title`)}),_(`billing.dashboard.decor`,{position:`headTitle`})]}),(0,r.jsxs)(`p`,{className:C.dashboardSubtitle,children:[t(`billing.lastUpdated`),` `,Xe,e.timezone===void 0?null:` · ${e.timezone.name} (${e.timezone.offset})`]})]}),(0,r.jsxs)(`div`,{className:C.dashboardRight,children:[(0,r.jsx)(`span`,{className:C.currencyToggle,role:`group`,"aria-label":t(`billing.currency`),children:[`cny`,`usd`].map(e=>(0,r.jsx)(`button`,{type:`button`,className:c(C.currencyButton,m===e&&C.currencyButtonActive),"aria-pressed":m===e,"data-testid":`billing-currency-${e}`,title:t(e===`cny`?`billing.currencyCny`:`billing.currencyUsd`),onClick:()=>{h(e)},children:e===`cny`?`¥ CNY`:`$ USD`},e))}),l.checked&&(0,r.jsxs)(`span`,{className:c(C.healthBadge,l.available?C.healthBadgeOk:C.healthBadgeBad),children:[(0,r.jsx)(`span`,{className:c(C.healthDot,l.available?C.healthOk:C.healthBad),"aria-hidden":`true`}),l.available?`${l.models} 模型可用${l.failures>0?` · ${l.failures} 厂商失效`:``}`:`${l.failures} 厂商不可用`]}),(0,r.jsx)(`button`,{type:`button`,className:C.closeButton,"aria-label":t(`billing.close`),"data-testid":`billing-close`,onClick:n,children:(0,r.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,r.jsx)(`path`,{d:`M18 6 6 18`}),(0,r.jsx)(`path`,{d:`m6 6 12 12`})]})})]})]}),(0,r.jsx)(`nav`,{className:C.tabNav,"data-testid":`billing-tab-nav`,role:`tablist`,"aria-label":t(`billing.title`),children:wt.map(e=>(0,r.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":A===e.id,className:c(C.tabButton,A===e.id&&C.tabButtonActive),"data-testid":`billing-tab-${e.id}`,onClick:()=>{le(e.id)},children:t(e.labelKey)},e.id))}),(0,r.jsxs)(`div`,{className:C.dashboardBody,children:[A===`overview`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-overview`,children:[d?.kind===`drift`&&d.spent!==void 0&&pe!==he()&&(0,r.jsxs)(`div`,{className:C.reconcileNotice,"data-testid":`billing-reconcile-notice`,role:`note`,children:[(0,r.jsx)(`span`,{className:C.reconcileIcon,"aria-hidden":`true`,children:(0,r.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,r.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,r.jsx)(`line`,{x1:`12`,y1:`10`,x2:`12`,y2:`16`}),(0,r.jsx)(`line`,{x1:`12`,y1:`7.5`,x2:`12.01`,y2:`7.5`})]})}),(0,r.jsx)(`span`,{className:C.reconcileText,children:t(`billing.reconcileDrift`).replace(`{provider}`,d.provider??``).replace(`{spent}`,L(d.spent)).replace(`{today}`,L(d.todayOfficialCost??0))}),(0,r.jsx)(`button`,{type:`button`,className:C.reconcileDismiss,"data-testid":`billing-reconcile-dismiss`,onClick:ge,children:t(`billing.reconcileDismiss`)})]}),(0,r.jsxs)(`section`,{className:C.hero,"data-testid":`billing-hero`,children:[_(`billing.dashboard.decor`,{position:`hero`}),(0,r.jsxs)(`div`,{className:C.heroTop,children:[(0,r.jsxs)(`div`,{className:C.heroMain,children:[(0,r.jsx)(`span`,{className:C.heroLabel,children:t(`billing.monthCost`)}),(0,r.jsxs)(`div`,{className:C.heroReadout,children:[(0,r.jsx)(`span`,{className:C.heroCurrency,"aria-hidden":`true`,children:m===`usd`?`$`:`¥`}),(0,r.jsx)(`span`,{className:C.heroValue,children:L(q).slice(1)})]}),(0,r.jsxs)(`span`,{className:C.heroMeta,children:[O.calls.toLocaleString(),` `,t(`billing.calls`)]})]}),(0,r.jsxs)(`div`,{className:C.heroGauge,"data-testid":`billing-hero-gauge`,children:[(0,r.jsxs)(`svg`,{className:C.heroGaugeSvg,viewBox:`0 0 120 120`,"aria-hidden":`true`,children:[(0,r.jsx)(`circle`,{className:C.heroGaugeTrack,cx:`60`,cy:`60`,r:`52`}),(0,r.jsx)(`circle`,{className:c(C.heroGaugeArc,qe.over&&C.heroGaugeArcOver),cx:`60`,cy:`60`,r:`52`,style:{strokeDasharray:`${qe.pct/100*326.7} 326.7`}})]}),(0,r.jsxs)(`span`,{className:C.heroGaugeCenter,children:[(0,r.jsxs)(`span`,{className:c(C.heroGaugePct,qe.over&&C.heroGaugePctOver),children:[qe.pct.toFixed(0),`%`]}),(0,r.jsx)(`span`,{className:C.heroGaugeLabel,children:qe.label})]})]})]}),v&&y>0&&(0,r.jsxs)(`div`,{className:C.heroBudget,"data-testid":`billing-hero-budget`,children:[(0,r.jsx)(`span`,{className:C.heroBudgetLabel,children:t(`billing.budget`)}),(0,r.jsx)(`div`,{className:C.heroBudgetTrack,role:`progressbar`,"aria-valuenow":Math.min(Je,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`billing.budget`),children:(0,r.jsx)(`div`,{className:c(C.heroBudgetFill,Je>=100&&C.heroBudgetFillOver),style:{width:`${Math.min(Je,100)}%`}})}),(0,r.jsxs)(`span`,{className:C.heroBudgetValue,children:[L(q),` / `,L(y),` · `,Je.toFixed(1),`%`]})]}),(0,r.jsxs)(`div`,{className:C.heroSide,children:[(0,r.jsxs)(`div`,{className:C.heroSideItem,children:[(0,r.jsx)(`span`,{className:C.heroSideLabel,children:t(`billing.yearCost`)}),(0,r.jsx)(`span`,{className:C.heroSideValue,children:L(We)})]}),(0,r.jsxs)(`div`,{className:C.heroSideItem,children:[(0,r.jsx)(`span`,{className:C.heroSideLabel,children:t(`billing.todayCost`)}),(0,r.jsxs)(`span`,{className:C.heroSideValue,children:[L(K),(0,r.jsxs)(`span`,{className:c(C.delta,gt>=0?C.deltaUp:C.deltaDown),children:[gt>=0?`▲`:`▼`,` `,Math.abs(gt).toFixed(1),`%`]})]})]}),Ke>0&&(0,r.jsxs)(`div`,{className:C.heroSideItem,children:[(0,r.jsx)(`span`,{className:C.heroSideLabel,children:t(`billing.monthProjected`)}),(0,r.jsx)(`span`,{className:C.heroSideValue,children:L(Ke)})]}),Ke<=0&&(0,r.jsx)(`span`,{className:C.heroSideSpacer,"aria-hidden":`true`})]})]}),(e.unpricedModels?.length??0)>0&&(0,r.jsx)(`div`,{className:C.unpricedHint,"data-testid":`billing-unpriced-hint`,children:t(`billing.unpricedHint`).replace(`{count}`,String(e.unpricedModels?.length??0))}),(e.total.searchCalls??0)>0&&(0,r.jsx)(`div`,{className:C.unpricedHint,"data-testid":`billing-search-estimate-hint`,children:t(`billing.searchEstimateHint`).replace(`{count}`,String(e.total.searchCalls??0)).replace(`{each}`,L(e.searchCallEstimateCny??0))}),(0,r.jsxs)(`section`,{className:C.kpiGrid,"data-testid":`billing-kpi-grid`,children:[(0,r.jsxs)(`div`,{className:C.kpiTile,"data-testid":`billing-kpi-tile`,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:t(`billing.cacheHitRate`)}),(0,r.jsx)(`span`,{className:c(C.kpiValue,C.kpiGreen),children:je(Be)}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[B(O.cacheHit),` / `,B(O.cacheHit+O.cacheMiss)]})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:t(`billing.tokens`)}),(0,r.jsx)(`span`,{className:C.kpiValue,children:B(O.input+O.output)}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[t(`billing.inputTokens`),` `,B(O.input),` · `,t(`billing.outputTokens`),` `,B(O.output)]})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:t(`billing.avgCost`)}),(0,r.jsx)(`span`,{className:C.kpiValue,children:L(ft)}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[t(`billing.calls`),` `,O.calls.toLocaleString()]})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:t(`billing.calls`)}),(0,r.jsx)(`span`,{className:C.kpiValue,children:O.calls.toLocaleString()}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[X.length,` `,t(`billing.models`)]})]})]}),(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-heatmap`,children:[(0,r.jsxs)(`div`,{className:C.panelHead,children:[(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.heatmap`)}),(0,r.jsx)(`div`,{className:C.heatmapRangeSwitch,"data-testid":`billing-heatmap-range`,role:`group`,"aria-label":t(`billing.heatmap`),children:[`month`,`year`].map(e=>(0,r.jsx)(`button`,{type:`button`,className:c(C.heatmapRangeButton,_e===e&&C.heatmapRangeButtonActive),"data-testid":`billing-heatmap-range-${e}`,"aria-pressed":_e===e,onClick:()=>{ve(e)},children:t(e===`month`?`billing.heatmapMonth`:`billing.heatmapYear`)},e))}),(0,r.jsxs)(`span`,{className:C.panelHint,"data-testid":`billing-heatmap-summary`,children:[t(`billing.activeDays`),` `,Qe,` · `,t(`billing.streakDays`),` `,$e]})]}),(0,r.jsx)(et,{days:Ze,currency:m,t,range:_e})]})]}),A===`settings`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-settings`,children:[(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-budget`,children:[(0,r.jsxs)(`div`,{className:C.setCardHead,children:[(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.budget`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.budgetHint`)})]}),(0,r.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":v,"aria-label":t(`billing.budget`),"data-testid":`billing-budget-toggle`,className:c(C.switch,v&&C.switchOn),onClick:ee,children:(0,r.jsx)(`span`,{className:C.switchKnob})})]}),v&&(0,r.jsxs)(`div`,{className:C.ctlCol,children:[(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.budgetAmount`)}),(0,r.jsxs)(`span`,{className:C.inp,"data-testid":`billing-budget-input-wrap`,children:[(0,r.jsx)(`span`,{className:C.affix,"aria-hidden":`true`,children:`¥`}),(0,r.jsx)(`input`,{className:C.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(`billing.budget`)}(${m===`usd`?`USD`:`CNY`})`,title:`${t(`billing.budget`)}(${m===`usd`?`USD`:`CNY`})`,onChange:e=>{te(e.target.valueAsNumber)}})]})]}),y>0&&(()=>{let e=q/y*100;return(0,r.jsx)(`div`,{className:C.ctlRowStretch,children:(0,r.jsx)(`div`,{className:C.prog,role:`progressbar`,"aria-valuenow":Math.min(e,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`billing.budget`),"data-testid":`billing-budget-track`,children:(0,r.jsx)(`div`,{className:c(C.progFill,e>=100&&C.budgetFillOver,e>=80&&e<100&&C.budgetFillWarn),style:{width:`${Math.min(e,100)}%`}})})})})(),y>0&&(0,r.jsx)(`p`,{className:C.setCardDesc,"data-testid":`billing-budget-value`,children:t(`billing.budgetSummary`).replace(`{used}`,L(q)).replace(`{total}`,L(y))})]})]}),(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-peak-alert-settings`,children:[(0,r.jsxs)(`div`,{className:C.setCardHead,children:[(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.peakAlert`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.peakAlertHint`)})]}),(0,r.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":b.enabled,"aria-label":t(`billing.peakAlert`),"data-testid":`billing-peak-alert-toggle`,className:c(C.switch,b.enabled&&C.switchOn),onClick:()=>{x({...b,enabled:!b.enabled})},children:(0,r.jsx)(`span`,{className:C.switchKnob})})]}),b.enabled&&(0,r.jsxs)(`div`,{className:C.ctlCol,children:[(0,r.jsxs)(`label`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.peakAlertLeadMin`)}),(0,r.jsx)(`span`,{className:C.inp,children:(0,r.jsx)(`input`,{type:`number`,min:1,max:30,step:1,value:b.leadMin,className:C.budgetInput,"aria-label":t(`billing.peakAlertLeadMin`),onChange:e=>{let t=Number(e.target.valueAsNumber);x({...b,leadMin:Number.isFinite(t)?Math.min(30,Math.max(1,Math.round(t))):b.leadMin})}})})]}),(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.peakAlertPos`)}),(0,r.jsx)(`div`,{className:C.ctlGroup,role:`radiogroup`,"aria-label":t(`billing.peakAlertPos`),children:[`bottom-right`,`center`].map(e=>(0,r.jsxs)(`label`,{className:C.rdo,children:[(0,r.jsx)(`input`,{type:`radio`,name:`peak-pos`,checked:b.position===e,onChange:()=>x({...b,position:e})}),(0,r.jsx)(`span`,{className:C.rdoDot,"aria-hidden":`true`}),t(e===`bottom-right`?`billing.peakAlertPosCorner`:`billing.peakAlertPosCenter`)]},e))})]}),(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.peakAlertMode`)}),(0,r.jsx)(`div`,{className:C.ctlGroup,role:`radiogroup`,"aria-label":t(`billing.peakAlertMode`),children:[`both`,`peak`,`offPeak`].map(e=>(0,r.jsxs)(`label`,{className:C.rdo,children:[(0,r.jsx)(`input`,{type:`radio`,name:`peak-mode`,checked:b.mode===e,onChange:()=>x({...b,mode:e})}),(0,r.jsx)(`span`,{className:C.rdoDot,"aria-hidden":`true`}),t(e===`both`?`billing.peakAlertModeBoth`:e===`peak`?`billing.peakAlertModePeak`:`billing.peakAlertModeOff`)]},e))})]}),(0,r.jsxs)(`label`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.peakAlertWebNotify`)}),(0,r.jsx)(`input`,{type:`checkbox`,checked:b.webNotify,"aria-label":t(`billing.peakAlertWebNotify`),onChange:e=>{x({...b,webNotify:e.target.checked})}})]}),(0,r.jsx)(`div`,{className:C.ctlRow,children:(0,r.jsx)(`button`,{type:`button`,className:C.btn,onClick:S,children:t(`billing.peakAlertPreview`)})})]})]}),(0,r.jsx)(`section`,{className:C.setCard,"data-testid":`billing-usage-stats-tool-setting`,children:(0,r.jsxs)(`div`,{className:C.setCardHead,children:[(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.usageStatsTool`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.usageStatsToolHint`)})]}),(0,r.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":N,"aria-label":t(`billing.usageStatsTool`),"data-testid":`billing-usage-stats-tool-toggle`,className:c(C.switch,N&&C.switchOn),onClick:F,children:(0,r.jsx)(`span`,{className:C.switchKnob})})]})}),(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-float-setting`,children:[(0,r.jsx)(`div`,{className:C.setCardHead,children:(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.floatWindow`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.floatWindowHint`)})]})}),(0,r.jsxs)(`div`,{className:C.ctlCol,children:[(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.floatMode`)}),(0,r.jsxs)(`div`,{className:C.ctlGroup,"data-testid":`billing-float-mode`,children:[(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,w.mode===`combined`&&C.floatModeBtnOn),"data-testid":`billing-float-mode-combined`,onClick:()=>T({mode:`combined`,targets:w.targets}),children:t(`billing.floatModeCombined`)}),(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,w.mode===`subscription`&&C.floatModeBtnOn),"data-testid":`billing-float-mode-subscription`,onClick:()=>T({mode:`subscription`,targets:w.targets}),children:t(`billing.floatModeSubscription`)})]})]}),w.mode===`subscription`&&(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.floatTargets`)}),(0,r.jsxs)(`span`,{className:C.ctlGroup,"data-testid":`billing-float-targets`,children:[ye.map(e=>{let t=w.targets.includes(e.id);return(0,r.jsxs)(`label`,{className:C.floatTarget,children:[(0,r.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,r.jsx)(`span`,{className:C.floatTargetLabel,children:e.label})]},e.id)}),ye.length===0&&(0,r.jsx)(`span`,{className:C.setCardDesc,children:t(`billing.floatNoTargetsHint`)})]})]})]})]}),(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-card-setting`,children:[(0,r.jsx)(`div`,{className:C.setCardHead,children:(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.cardDisplay`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.cardDisplayHint`)})]})}),(0,r.jsx)(`div`,{className:C.ctlCol,children:(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.cardMetric`)}),(0,r.jsxs)(`div`,{className:C.ctlGroup,"data-testid":`billing-card-metric`,children:[(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,ne.metric===`money`&&C.floatModeBtnOn),"data-testid":`billing-card-money`,onClick:()=>ie({metric:`money`}),children:t(`billing.cardMetricMoney`)}),(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,ne.metric===`tokens`&&C.floatModeBtnOn),"data-testid":`billing-card-tokens`,onClick:()=>ie({metric:`tokens`}),children:t(`billing.cardMetricTokens`)})]})]})})]}),(0,r.jsx)(`section`,{className:C.setCard,"data-testid":`billing-site-list-setting`,children:(0,r.jsxs)(`div`,{className:C.setCardHead,children:[(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.siteListDisplay`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.siteListDisplayHint`)})]}),(0,r.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":E.hideUnidentified,"aria-label":t(`billing.siteListDisplay`),"data-testid":`billing-site-hide-unidentified`,className:c(C.switch,E.hideUnidentified&&C.switchOn),onClick:()=>ae({hideUnidentified:!E.hideUnidentified}),children:(0,r.jsx)(`span`,{className:C.switchKnob})})]})}),(0,r.jsx)(un,{userPrices:o,onUserPrices:s,t}),(0,r.jsx)(W,{t,version:e.pluginVersion})]}),A===`trends`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-trends`,children:[(0,r.jsxs)(`section`,{className:c(C.ubCard,C.trendPanel),"data-testid":`billing-panel-trend`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.trend`)}),_(`billing.dashboard.decor`,{position:`trend`}),(0,r.jsxs)(`span`,{className:C.ubCardControlGroup,children:[(0,r.jsx)(`span`,{className:C.rangeToggle,role:`group`,"aria-label":t(`billing.trend`),children:[7,30].map(e=>(0,r.jsx)(`button`,{type:`button`,className:c(C.rangeButton,ue===e&&C.rangeButtonActive),"aria-pressed":ue===e,"data-testid":`billing-trend-${e}d`,onClick:()=>{de(e)},children:t(e===7?`billing.trend7d`:`billing.trend30d`)},e))}),(0,r.jsx)(`span`,{className:C.rangeToggle,role:`group`,"aria-label":t(`billing.trendMetric`),children:[`cost`,`tokens`].map(e=>(0,r.jsx)(`button`,{type:`button`,className:c(C.rangeButton,se===e&&C.rangeButtonActive),"aria-pressed":se===e,"data-testid":`billing-trend-metric-${e}`,onClick:()=>{D(e)},children:t(e===`cost`?`billing.trendMetricCost`:`billing.trendMetricTokens`)},e))})]}),(0,r.jsx)(`span`,{className:C.ubCardSub,children:Xe})]}),(0,r.jsx)(Fe,{data:Y,models:pt,currency:m,metric:se})]}),g.length>0&&(0,r.jsxs)(`section`,{className:C.ubCard,"data-testid":`billing-panel-rounds`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.rounds`)}),Me.length>0&&(0,r.jsxs)(`span`,{className:C.ubTagError,"data-testid":`billing-rounds-flag-count`,children:[Me.length,` `,t(`billing.anomaly`)]})]}),(0,r.jsx)(`p`,{className:C.ubCardSub,children:t(`billing.roundsHint`).replace(`{count}`,String(g.length))}),(0,r.jsx)(Ye,{rounds:g,flags:Me,currency:m,t})]}),e.byTier!==void 0&&(()=>{let e=H.peak+H.offPeak;if(e<=0)return null;let n=H.peak/e*100;return(0,r.jsxs)(`section`,{className:C.ubCard,"data-testid":`billing-panel-share`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.peakShare`)}),(0,r.jsx)(`span`,{className:C.ubCardSub,children:t(`billing.peakSharePerCall`)})]}),(0,r.jsxs)(`div`,{className:C.shareTrack,"data-testid":`billing-share-track`,children:[(0,r.jsx)(`div`,{className:c(C.shareSeg,C.shareSegPeak),style:{width:`${n}%`}}),(0,r.jsx)(`div`,{className:c(C.shareSeg,C.shareSegOff),style:{width:`${100-n}%`}})]}),(0,r.jsxs)(`div`,{className:C.shareLegend,children:[(0,r.jsxs)(`span`,{className:C.shareItem,children:[(0,r.jsx)(`span`,{className:C.shareDot,style:{background:`var(--dsw-static-blue-500)`}}),t(`billing.peak`),(0,r.jsxs)(`span`,{className:C.shareValue,"data-testid":`billing-share-peak`,children:[L(H.peak),` · `,n.toFixed(1),`%`]})]}),(0,r.jsxs)(`span`,{className:C.shareItem,children:[(0,r.jsx)(`span`,{className:C.shareDot,style:{background:`color-mix(in srgb, var(--dsw-static-blue-500) 30%, var(--dsw-alias-bg-module-platform))`}}),t(`billing.offPeak`),(0,r.jsxs)(`span`,{className:C.shareValue,"data-testid":`billing-share-offpeak`,children:[L(H.offPeak),` · `,(100-n).toFixed(1),`%`]})]})]}),Ne>0&&(0,r.jsx)(`div`,{className:C.staleNotice,"data-testid":`billing-share-savings`,children:t(`billing.offPeakSavings`).replace(`{amount}`,L(Ne))})]})})()]}),A===`providers`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-providers`,children:[nt.length>0&&(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-relay-sites`,children:[(0,r.jsx)(`div`,{className:C.panelHead,children:(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.panelRelay`)})}),(0,r.jsx)(`div`,{className:C.providerGroupList,"data-testid":`billing-relay-sites`,children:nt.map(([e,n])=>{let i=Ut(e,t);return(0,r.jsxs)(`div`,{className:C.siteRow,"data-testid":`billing-relay-site`,children:[(0,r.jsxs)(`span`,{className:C.siteRowName,children:[(0,r.jsx)(`span`,{className:c(C.siteKindTag,Kt[i.kind]),children:Wt(i.kind,t)}),(0,r.jsx)(`span`,{className:C.siteRowTitle,children:i.name})]}),(0,r.jsxs)(`span`,{className:C.siteRowMeta,children:[(0,r.jsx)(`span`,{className:C.siteRowCost,children:L(n.cost)}),(0,r.jsxs)(`span`,{className:C.siteRowCalls,children:[n.calls,` `,t(`billing.relayCalls`)]})]})]},e)})})]}),rt.length>0&&(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-relay-quota`,children:[(0,r.jsx)(`div`,{className:C.panelHead,children:(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.panelRelayQuota`)})}),(0,r.jsx)(`div`,{className:C.providerGroupList,"data-testid":`billing-relay-quotas`,children:rt.map(e=>(0,r.jsxs)(`div`,{className:C.siteRow,"data-testid":`billing-relay-quota`,children:[(0,r.jsxs)(`span`,{className:C.siteRowName,children:[(0,r.jsx)(`span`,{className:c(C.siteKindTag,qt[e.kind]),children:Gt(e.kind,t)}),(0,r.jsx)(`span`,{className:C.siteRowTitle,children:e.origin})]}),(0,r.jsxs)(`span`,{className:C.siteRowMeta,children:[e.balance!==void 0&&(0,r.jsxs)(`span`,{className:C.siteRowCost,children:[t(`billing.relayBalance`),` `,e.balance.toFixed(2)]}),(e.windows?.length??0)>0?e.windows?.map(e=>{let n=e.remainingPercent<20;return(0,r.jsxs)(`span`,{className:c(C.siteRowCalls,n&&C.siteRowCallsLow),children:[t(`billing.relayWindowUsed`),` `,e.usedPercent,`%`]},e.kind)}):(0,r.jsx)(`span`,{className:C.siteRowCalls,children:t(`billing.relayNoQuota`)})]})]},e.route))})]}),(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-providers`,children:[(0,r.jsxs)(`div`,{className:C.panelHead,children:[(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.providerBilling`)}),_(`billing.dashboard.decor`,{position:`models`}),(0,r.jsx)(`span`,{className:C.panelHint,children:e.updatedAt===void 0?``:`${t(`billing.lastUpdated`)} ${Yt(e.updatedAt)}`})]}),oe&&(0,r.jsx)(`div`,{className:C.staleNotice,"data-testid":`billing-subscriptions-stale`,children:t(`billing.subscriptionsStale`)}),it.length===0?(0,r.jsx)(`div`,{className:C.emptyRow,"data-testid":`billing-provider-empty`,children:t(`billing.noData`)}):(0,r.jsx)(`div`,{className:C.providerGroupList,"data-testid":`billing-provider-groups`,children:it.map(e=>(0,r.jsxs)(`div`,{className:C.providerGroup,"data-testid":`billing-provider-group`,children:[(0,r.jsxs)(`div`,{className:C.providerGroupHead,children:[(0,r.jsxs)(`span`,{className:C.providerGroupTitle,children:[(0,r.jsx)(`span`,{className:c(C.healthDot,e.dot),"aria-hidden":`true`}),(0,r.jsx)(`span`,{className:C.providerGroupName,children:De(e.name)})]}),(0,r.jsxs)(`span`,{className:C.providerGroupMeta,children:[e.subscriptions.length>0&&(0,r.jsxs)(`span`,{className:C.providerGroupBadge,"data-testid":`billing-provider-sub-count`,children:[e.subscriptions.length,` 套餐`]}),!Le(e)&&e.balance!==void 0&&(0,r.jsxs)(`span`,{className:C.providerGroupBalance,"data-testid":`billing-provider-balance`,children:[(0,r.jsx)(`span`,{className:C.providerGroupBalanceLabel,children:t(`billing.balance`)}),ze(e.balance)]})]})]}),e.models.length>0&&(0,r.jsx)(`div`,{className:c(C.tableScroll,C.modelTableScroll),"data-testid":`billing-table-scroll`,children:(0,r.jsxs)(`table`,{className:C.modelTable,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:t(`billing.model`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.calls`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.inputTokens`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.outputTokens`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.cacheHitRate`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.actual`)})]})}),(0,r.jsx)(`tbody`,{children:e.models.map(e=>(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`td`,{children:(0,r.jsxs)(`span`,{className:C.modelCell,children:[(0,r.jsx)(fn,{provider:e.provider,colorVar:e.color}),(0,r.jsxs)(`span`,{children:[(0,r.jsxs)(`span`,{className:C.modelName,children:[e.name,e.uncatalogued&&(0,r.jsx)(`span`,{className:C.uncataloguedTag,"data-testid":`billing-uncatalogued-tag`,children:t(`billing.uncatalogued`)}),e.estimatedPricing&&(0,r.jsx)(`span`,{className:C.estimatedTag,"data-testid":`billing-estimated-tag`,children:t(`billing.estimatedPricing`)})]}),(0,r.jsx)(`span`,{className:C.modelProvider,children:De(e.provider)})]})]})}),(0,r.jsx)(`td`,{className:C.numCol,children:e.calls.toLocaleString()}),(0,r.jsx)(`td`,{className:C.numCol,children:B(e.input)}),(0,r.jsx)(`td`,{className:C.numCol,children:B(e.output)}),(0,r.jsx)(`td`,{className:C.numCol,children:je(e.cacheHitRate)}),(0,r.jsx)(`td`,{className:C.numCol,children:e.plan?(0,r.jsx)(`span`,{className:C.planTag,children:t(`billing.subscriptionIncluded`)}):e.actual===void 0?(0,r.jsx)(`span`,{className:C.na,children:`—`}):(()=>{let t=e.officialCost,n=e.actual-t;return t>0&&n>0?(0,r.jsxs)(`span`,{className:C.bucketCost,children:[(0,r.jsx)(`span`,{className:C.bucketOfficial,children:L(t)}),(0,r.jsx)(`span`,{className:C.bucketSep,children:`/`}),(0,r.jsx)(`span`,{className:C.bucketThird,children:L(n)})]}):L(e.actual)})()})]},e.key))})]})}),e.subscriptions.length>0&&(0,r.jsx)(`div`,{className:C.subscriptionGrid,"data-testid":`billing-subscriptions-grid`,children:e.subscriptions.map(e=>{let n=Vt(e.status,t);return(0,r.jsxs)(`div`,{className:C.subscriptionCard,"data-testid":`billing-subscription-card`,children:[(0,r.jsxs)(`div`,{className:C.subscriptionHead,children:[(0,r.jsx)(`span`,{className:C.subscriptionName,children:De(e.displayName)}),e.planType===`code`&&(()=>{let n=re(e.provider),i=n===void 0?void 0:t(`billing.subscriptionFeePerMonth`).replace(`{amount}`,n.currency===`USD`?`$${n.amount}`:`¥${n.amount}`);return(0,r.jsxs)(`span`,{className:C.subscriptionPlan,"data-kind":`code`,children:[i??(e.subscriptionAmount!==void 0&&e.subscriptionAmount>0?t(`billing.subscriptionFeePerMonth`).replace(`{amount}`,L(e.subscriptionAmount)):t(`billing.planTypeCode`)),n?.label!==void 0&&(0,r.jsx)(`span`,{className:C.subscriptionTier,"data-testid":`billing-tier-${e.provider}`,children:n.label}),n!==void 0&&(0,r.jsx)(`span`,{className:C.subscriptionAuto,"data-testid":`billing-auto-${e.provider}`,children:t(`billing.subscriptionAutoDetect`)})]})})(),e.planType===`token`&&(0,r.jsx)(`span`,{className:C.subscriptionPlan,"data-kind":`token`,children:t(`billing.planTypeToken`)}),e.plan!==void 0&&(0,r.jsx)(`span`,{className:C.subscriptionPlan,children:e.plan})]}),n!==``&&(0,r.jsx)(`div`,{className:C.subscriptionStatus,children:n}),e.windows.length===0&&n===``&&(0,r.jsx)(`div`,{className:C.subscriptionStatus,children:t(`billing.subscriptionNoApi`)}),e.windows.map(e=>(()=>{let n=Math.min(100,Math.max(0,e.usedPercent)),i=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,r.jsxs)(`div`,{className:C.subscriptionWindow,children:[(0,r.jsx)(`span`,{className:C.subscriptionWindowLabel,children:Ht(e.kind,t)}),(0,r.jsx)(`span`,{className:C.subscriptionTrack,"aria-hidden":`true`,children:(0,r.jsx)(`span`,{className:c(C.subscriptionFill,n>=100&&C.subscriptionFillOver,n>=80&&n<100&&C.subscriptionFillWarn),style:{width:`${n}%`}})}),(0,r.jsxs)(`span`,{className:C.subscriptionMeta,children:[(0,r.jsx)(`span`,{className:c(C.subscriptionPct,i&&C.subscriptionExhausted),children:i?t(`billing.subscriptionExhausted`):t(`billing.subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,r.jsx)(`span`,{className:C.subscriptionReset,children:t(`billing.subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${Yt(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]},e.provider)})})]},e.name))})]}),(0,r.jsxs)(`div`,{className:C.exportBar,"data-testid":`billing-export-bar`,role:`group`,"aria-label":t(`billing.export`),children:[(0,r.jsx)(`span`,{className:C.exportLabel,children:t(`billing.export`)}),(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-export-day`,onClick:()=>{ut(lt(`usage-daily`,`csv`,Object.keys(k)),at(k),`text/csv`)},children:t(`billing.exportCsvDay`)}),e.bySession!==void 0&&(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-export-sessions`,onClick:()=>{ut(lt(`usage-sessions`,`csv`,Object.keys(k)),ct(e.bySession??[]),`text/csv`)},children:t(`billing.exportCsvSession`)}),e.bySite!==void 0&&(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-export-sites`,onClick:()=>{ut(lt(`usage-sites`,`csv`,Object.keys(k)),ot(e.bySite??{}),`text/csv`)},children:t(`billing.exportCsvSite`)}),(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-export-json`,onClick:()=>{ut(lt(`usage-stats`,`json`,Object.keys(k)),JSON.stringify(e,null,2),`application/json`)},children:t(`billing.exportJson`)})]}),Pe.length>0&&(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-roles`,children:[(0,r.jsxs)(`div`,{className:C.panelHead,children:[(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.roleCost`)}),(0,r.jsx)(`span`,{className:C.panelHint,children:t(`billing.roleHint`)})]}),(0,r.jsx)(`div`,{className:C.shareTrack,"data-testid":`billing-role-track`,children:Pe.map(e=>(0,r.jsx)(`div`,{className:c(C.shareSeg,e.seg),style:{width:`${e.pct}%`}},e.label))}),(0,r.jsx)(`div`,{className:C.shareLegend,children:Pe.map(e=>(0,r.jsxs)(`span`,{className:C.shareItem,children:[(0,r.jsx)(`span`,{className:c(C.shareDot,e.seg)}),e.label,(0,r.jsxs)(`span`,{className:C.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,r.jsxs)(`div`,{className:C.ubStatGrid,"data-testid":`billing-panel-buckets`,children:[(0,r.jsxs)(`div`,{className:C.ubStatCard,children:[(0,r.jsxs)(`span`,{className:C.ubStatLabel,children:[t(`billing.official`),`(=DeepSeek 直连)`]}),(0,r.jsx)(`span`,{className:C.ubStatValue,children:L(Z.officialCost)}),(0,r.jsxs)(`span`,{className:C.ubStatDetail,children:[Z.officialCalls,` `,t(`billing.calls`),` · `,n.toFixed(1),`%`]})]}),(0,r.jsxs)(`div`,{className:C.ubStatCard,children:[(0,r.jsxs)(`span`,{className:C.ubStatLabel,children:[t(`billing.thirdParty`),`(中转)`]}),(0,r.jsx)(`span`,{className:C.ubStatValue,children:L(Z.thirdCost)}),(0,r.jsxs)(`span`,{className:C.ubStatDetail,children:[Z.thirdCalls,` `,t(`billing.calls`),` · `,(100-n).toFixed(1),`%`]})]})]})})(),e.byWorkspace!==void 0&&e.byWorkspace.length>0&&(0,r.jsxs)(`section`,{className:C.ubCard,"data-testid":`billing-panel-workspaces`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.workspaces`)}),(0,r.jsx)(`span`,{className:C.ubCardSub,children:t(`billing.workspacesHint`)})]}),(0,r.jsx)(`ul`,{className:C.rowlist,children:e.byWorkspace.map(n=>(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(`li`,{children:(0,r.jsxs)(`button`,{type:`button`,className:C.rowline,"data-testid":`billing-workspace-${n.name}`,onClick:()=>{xe(M===n.name?void 0:n.name)},children:[(0,r.jsx)(`span`,{className:C.rowlineName,children:n.name}),(0,r.jsxs)(`span`,{className:C.rowlineRight,children:[(0,r.jsx)(`span`,{className:C.num,children:L(n.cost)}),(0,r.jsxs)(`span`,{className:C.rowlineMuted,children:[n.calls,` `,t(`billing.calls`)]}),(0,r.jsx)(`span`,{className:C.rowlineChev,"aria-hidden":`true`,children:`›`})]})]})}),M===n.name&&(0,r.jsx)(`li`,{className:C.rowlineDrillWrap,children:e.bySession?.filter(e=>Tt(e.cwd)===n.name).slice(0,5).map(e=>(0,r.jsxs)(`div`,{className:C.rowlineDrill,children:[(0,r.jsx)(`span`,{className:C.rowlineName,children:e.title??e.id.slice(0,8)}),(0,r.jsxs)(`span`,{className:C.rowlineRight,children:[(0,r.jsx)(`span`,{className:C.num,children:L(e.cost)}),(0,r.jsxs)(`span`,{className:C.rowlineMuted,children:[e.calls,` `,t(`billing.calls`)]})]})]},e.id))})]},n.name))})]}),e.bySession!==void 0&&(0,r.jsxs)(`section`,{className:C.ubCard,"data-testid":`billing-panel-sessions`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.sessions`)}),(0,r.jsx)(`span`,{className:C.ubCardSub,children:e.bySession.length>20?t(`billing.sessionOverflow`).replace(`{limit}`,`20`).replace(`{total}`,String(e.bySession.length)):`${e.bySession.length}`})]}),(e.staleLedgerSessions??0)>0&&(0,r.jsx)(`div`,{className:C.staleNotice,"data-testid":`billing-sessions-stale`,children:t(`billing.staleLedgerNotice`).replace(`{count}`,String(e.staleLedgerSessions))}),(0,r.jsx)(`div`,{className:C.ubTablewrap,"data-testid":`billing-sessions-table`,children:(0,r.jsxs)(`table`,{className:C.ubTable,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:t(`billing.sessionTitle`)}),(0,r.jsx)(`th`,{children:t(`billing.project`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.calls`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.actual`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.lastActive`)})]})}),(0,r.jsxs)(`tbody`,{children:[e.bySession.length===0&&(0,r.jsx)(`tr`,{children:(0,r.jsx)(`td`,{colSpan:5,className:C.emptyRow,children:t(`billing.noData`)})}),e.bySession.slice(0,20).map(e=>(0,r.jsxs)(`tr`,{children:[(0,r.jsxs)(`td`,{children:[(0,r.jsx)(`span`,{className:C.modelName,children:e.title??e.id.slice(0,8)}),e.stale===!0&&(0,r.jsx)(`span`,{className:c(C.ubTag,C.ubTagNeutral),"data-testid":`billing-session-stale`,children:t(`billing.sessionStaleBadge`)})]}),(0,r.jsx)(`td`,{children:(0,r.jsx)(`span`,{className:C.modelProvider,children:Tt(e.cwd)??`—`})}),(0,r.jsx)(`td`,{className:C.numCol,children:e.calls.toLocaleString()}),(0,r.jsx)(`td`,{className:C.numCol,children:L(e.cost)}),(0,r.jsx)(`td`,{className:C.numCol,children:e.lastActive>0?`${$(e.lastActive)} ${Yt(e.lastActive)}`:`—`})]},e.id))]})]})})]})]}),A===`token`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-token`,children:[(0,r.jsx)(Ge,{stats:e,trendDays:ue,onTrendDays:de,t}),e.perf!==void 0&&(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-perf`,children:[(0,r.jsxs)(`div`,{className:C.panelHead,children:[(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.perfTitle`)}),(0,r.jsx)(`span`,{className:C.panelHint,children:t(`billing.perfHint`)})]}),(0,r.jsx)(Re,{perf:e.perf,models:pt,t})]})]}),A===`pricing`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-pricing`,children:[(0,r.jsxs)(`div`,{className:C.ubAlert,role:`note`,children:[(0,r.jsxs)(`div`,{className:C.ubAlertLeft,children:[(0,r.jsxs)(`span`,{className:C.ubRate,"data-testid":`billing-rate`,children:[t(`billing.todayRate`),` 1 USD = `,z(I.rate)]}),(0,r.jsx)(`span`,{className:c(C.ubTag,I.live?C.ubTagSuccess:C.ubTagNeutral),children:I.live?t(`billing.rateLive`):t(`billing.rateBuiltin`)})]}),(0,r.jsx)(`p`,{className:C.ubAlertNote,children:t(`billing.pricingTip`)})]}),(0,r.jsxs)(`section`,{className:C.ubCard,"data-testid":`billing-panel-pricing`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.pricing`)}),(0,r.jsx)(`span`,{className:C.ubCardSub,children:t(`billing.pricingUnit`)})]}),(0,r.jsx)(`div`,{className:C.ubTablewrap,children:(0,r.jsxs)(`table`,{className:C.ubTable,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:t(`billing.thModel`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.thInputMiss`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.thInputHit`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.output`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.band`)})]})}),(0,r.jsx)(`tbody`,{children:Te().map(e=>{let n=e.price.input>0||e.price.output>0;return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`td`,{children:(0,r.jsxs)(`span`,{className:C.ubModel,children:[(0,r.jsx)(fn,{provider:e.provider,colorVar:Ee(e.colorVar)}),(0,r.jsxs)(`span`,{className:C.ubModelName,children:[e.name,e.uncatalogued&&(0,r.jsx)(`span`,{className:C.ubTagAlert,"data-testid":`billing-price-uncatalogued`,children:t(`billing.uncatalogued`)}),e.promo!==void 0&&Ce(e.promo,Date.now())&&(0,r.jsx)(`span`,{className:C.ubTagPromo,"data-testid":`billing-price-promo`,title:e.promo.endsAtMs===void 0?t(`billing.promoOpenEnded`):t(`billing.promoUntil`,{date:new Date(e.promo.endsAtMs).toLocaleDateString()}),children:e.promo.note??t(`billing.promoBadge`)})]})]})}),(0,r.jsx)(`td`,{className:C.numCol,children:n?V(e.price.input,e.price.currency):(0,r.jsx)(`span`,{className:C.na,children:`—`})}),(0,r.jsx)(`td`,{className:C.numCol,children:n?V(e.price.cacheHit,e.price.currency):(0,r.jsx)(`span`,{className:C.na,children:`—`})}),(0,r.jsx)(`td`,{className:C.numCol,children:n?V(e.price.output,e.price.currency):(0,r.jsx)(`span`,{className:C.na,children:`—`})}),(0,r.jsx)(`td`,{className:C.numCol,children:n&&e.price.offPeak!==void 0&&e.peakHours!==void 0?(0,r.jsxs)(`span`,{className:C.ubPricepair,children:[(0,r.jsxs)(`span`,{className:C.ubChipPeak,children:[(0,r.jsx)(`span`,{className:C.ubChipLabel,children:e.tierSemantics===`latency`?t(`billing.ubStd`):t(`billing.ubPeak`)}),(0,r.jsxs)(`span`,{className:C.num,children:[V(e.price.input,e.price.currency),` / `,V(e.price.output,e.price.currency)]})]}),(0,r.jsxs)(`span`,{className:C.ubChipOff,children:[(0,r.jsx)(`span`,{className:C.ubChipLabel,children:e.tierSemantics===`latency`?`Flex`:t(`billing.ubOff`)}),(0,r.jsxs)(`span`,{className:C.num,children:[V(e.price.offPeak.input,e.price.currency),` / `,V(e.price.offPeak.output,e.price.currency)]})]})]}):n?(0,r.jsx)(`span`,{className:C.flatTag,children:t(`billing.flat`)}):(0,r.jsx)(`span`,{className:C.na,children:`—`})})]}),(e.extraRows??[]).map(t=>(0,r.jsxs)(`tr`,{className:C.ubExtraRow,children:[(0,r.jsxs)(`td`,{children:[(0,r.jsx)(`span`,{className:C.ubExtraName,children:t.label}),t.note!==void 0&&(0,r.jsx)(`span`,{className:C.ubExtraNote,children:t.note})]}),(0,r.jsx)(`td`,{className:C.numCol,children:t.input===void 0?(0,r.jsx)(`span`,{className:C.na,children:`—`}):V(t.input,e.price.currency)}),(0,r.jsx)(`td`,{className:C.numCol,children:(0,r.jsx)(`span`,{className:C.na,children:`—`})}),(0,r.jsx)(`td`,{className:C.numCol,children:t.output===void 0?(0,r.jsx)(`span`,{className:C.na,children:`—`}):V(t.output,e.price.currency)}),(0,r.jsx)(`td`,{className:C.numCol,children:(0,r.jsx)(`span`,{className:C.na,children:`—`})})]},`${e.key}:${t.label}`))]},e.key)})})]})})]}),(0,r.jsxs)(`section`,{className:C.ubCard,children:[(0,r.jsx)(`div`,{className:C.ubCardHead,children:(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.pricingNotes`)})}),(0,r.jsxs)(`ul`,{className:C.ubNotes,children:[(0,r.jsxs)(`li`,{className:C.ubNotesItem,children:[(0,r.jsx)(`span`,{className:C.ubNotesTerm,children:t(`billing.cacheHit`)}),(0,r.jsx)(`span`,{className:C.ubNotesDesc,children:t(`billing.noteCache`)})]}),(0,r.jsxs)(`li`,{className:C.ubNotesItem,children:[(0,r.jsx)(`span`,{className:C.ubNotesTerm,children:t(`billing.peakBand`)}),(0,r.jsx)(`span`,{className:C.ubNotesDesc,children:t(`billing.noteBand`)})]}),(0,r.jsxs)(`li`,{className:C.ubNotesItem,children:[(0,r.jsx)(`span`,{className:C.ubNotesTerm,children:t(`billing.pricingSource`)}),(0,r.jsx)(`span`,{className:C.ubNotesDesc,children:t(`billing.noteSource`)})]})]})]})]}),_(`billing.dashboard.decor`,{position:`footer`})]}),(0,r.jsxs)(`footer`,{className:C.modalFooter,"data-testid":`billing-footer`,children:[(0,r.jsx)(`span`,{children:t(`billing.footer`)}),(0,r.jsx)(`span`,{children:t(`billing.footerCredit`).replace(`{version}`,e.pluginVersion===void 0?`—`:`v${e.pluginVersion}`)})]})]})})}function fn({provider:e,colorVar:t}){let n=_t(e);return n===void 0?(0,r.jsx)(`span`,{className:C.vendorLetter,style:t===void 0?void 0:{background:t},"aria-hidden":`true`,children:e.trim().charAt(0).toUpperCase()}):(0,r.jsx)(`img`,{className:C.vendorLogo,src:n,alt:``,"aria-hidden":`true`})}function pn(e){let{t,checkModels:n,publishCosts:a,registerOpen:o,renderSlot:s,useStore:c,actions:l}=e,[u,p]=(0,i.useState)(Zt),[m,_]=(0,i.useState)(Dt),[v,te]=(0,i.useState)([]),[S,C]=(0,i.useState)(void 0),[w,T]=(0,i.useState)([]),[ne,re]=(0,i.useState)(!1),[ie,E]=(0,i.useState)([]),[ae,oe]=(0,i.useState)(`cny`),[se,D]=(0,i.useState)(()=>d()),ce=(0,i.useCallback)(e=>{D(e),f(e)},[]),[k,A]=(0,i.useState)(()=>y()),le=(0,i.useCallback)(e=>{A(e),ee(e)},[]),[de,pe]=(0,i.useState)(()=>h()),he=(0,i.useCallback)(e=>{pe(e),g(e)},[]),[ge,_e]=(0,i.useState)(()=>{let e=b();return O(e),e}),ve=(0,i.useCallback)(e=>{_e(e),O(e),x(e)},[]),ye=(0,i.useMemo)(()=>It(u),[u,ge]),be=ae===`usd`?`en`:`zh`,j=(0,i.useCallback)((e,n)=>{let r=(be===`en`?pt:ft)[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]),[M,xe]=(0,i.useState)(!1),N=(0,i.useCallback)(()=>{xe(!1)},[]),P=(0,i.useCallback)(()=>{Qt().then(e=>{e!==null&&p(It(e))}),tn().then(({balances:e,reconcile:t})=>{e.length>0&&te(e),C(t)}),nn().then(e=>{e.length>0&&T(e),re(!1)}).catch(()=>{re(!0)}),rn().then(e=>{E(e)}).catch(()=>{})},[]),F=(0,i.useCallback)(()=>{P(),en(),xe(!0)},[P]);(0,i.useEffect)(()=>{P(),en()},[P]),(0,i.useEffect)(()=>{let e=setInterval(()=>{P(),en()},Jt);return()=>{clearInterval(e)}},[P]),(0,i.useEffect)(()=>{let e=!0;return n().then(t=>{e&&(_(t),ue(t.catalog??[]))}),()=>{e=!1}},[n]);let I=$(),L=Object.entries(u.byDay).filter(([e])=>e.startsWith(I.slice(0,7))).reduce((e,[,t])=>e+t.cost,0),Ce=u.byDay[I]?.cost??0,we=zt(u.byDay).reduce((e,t)=>e+t.cost,0),Te=(0,i.useMemo)(()=>zt(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]),Ee=Object.entries(u.byDay).filter(([e])=>e.startsWith(I.slice(0,7))).reduce((e,[,t])=>e+t.input+t.output,0),De=(()=>{let e=u.byDay[I];return e===void 0?0:e.input+e.output})(),Oe=Te.reduce((e,t)=>e+t.tokens,0),R=c(e=>e.enabled),ke=c(e=>e.amount),Ae=c(e=>e.tierAlertDays),B=c(e=>e.lastTierSwitchAt),[je,V]=(0,i.useState)(()=>bt()),[Me,H]=(0,i.useState)(null),[Ne,Pe]=(0,i.useState)(null),[Fe,U]=(0,i.useState)(()=>Date.now());(0,i.useEffect)(()=>{let e=setInterval(()=>U(Date.now()),Jt);return()=>{clearInterval(e)}},[]);let Ie=(0,i.useCallback)(e=>{V(e),xt(e)},[]),Le=(0,i.useCallback)(()=>{Pe({entering:me(Date.now())===`peak`?`offPeak`:`peak`,atMs:Date.now()+3*6e4})},[]),Re=ke>0?ke:u.budget??0,ze=(0,i.useCallback)(()=>{let e=!R;l.setEnabled(e),e&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission()},[l,R]);(0,i.useEffect)(()=>{if(!R||Re<=0)return;let e=L/Re*100,t=$(),n=Et.filter(n=>e>=n&&Ae?.[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=j(`billing.budgetTierBody`).replace(`{cost}`,z(L)).replace(`{budget}`,z(Re)).replace(`{pct}`,String(r));try{new Notification(j(`billing.budget`),{body:i})}catch{}},[R,Re,L,Ae,l,j]),(0,i.useEffect)(()=>{let e=St(Fe,je,B);if(e===null||(l.markTierSwitchAlerted(e.atMs),H(e),!je.webNotify)||typeof Notification>`u`||Notification.permission!==`granted`)return;let t=Math.max(1,Math.round((e.atMs-Fe)/6e4)),n=e.entering===`peak`?j(`billing.peakAlertTitlePeak`):j(`billing.peakAlertTitleOff`),r=e.entering===`peak`?j(`billing.tierAlertEnterPeak`).replace(`{minutes}`,String(t)):j(`billing.tierAlertEnterOff`).replace(`{minutes}`,String(t));try{new Notification(n,{body:r})}catch{}},[Fe,B,je,l,j]);let Be=c(e=>e.lastBalanceAlertDay),W=(0,i.useMemo)(()=>{if(v.length===0)return;let e=u.lowBalanceThreshold??50,t=Pt(u.byDay,I),n=fe().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,I]);(0,i.useEffect)(()=>{if(W===void 0)return;let e=$();if(Be===e||(l.markBalanceAlerted(e),typeof Notification>`u`||Notification.permission!==`granted`))return;let t=j(`billing.balanceLowBody`).replace(`{name}`,W.name).replace(`{balance}`,z(W.cny)).replace(`{days}`,W.days===void 0?`—`:String(W.days));try{new Notification(j(`billing.balance`),{body:t})}catch{}},[W,Be,l,j]);let Ve=(0,i.useMemo)(()=>{let e=I.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=Se(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`?j(`billing.balanceUnauthorized`):t?.error===`unreachable`||t?.error===`invalid`?j(`billing.balanceUnreachable`):j(`billing.balanceUnconfigured`),low:!1};let n=t.currency===`USD`?`$${t.totalBalance.toFixed(2)}`:z(t.totalBalance),r=fe().rate;return{text:n,low:(t.currency===`USD`?t.totalBalance*r:t.totalBalance)<(u.lowBalanceThreshold??50)}},a=e=>{let t=w.find(t=>t.displayName===e||Nt(t.provider)===e);if(t===void 0||t.windows.length===0)return{text:j(`billing.subscriptionNoApi`),low:!1};let n=t.windows.reduce((e,t)=>Math.min(e,t.remainingPercent),100);return{text:n<=0?j(`billing.subscriptionExhausted`):j(`billing.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,w,I]),G=(0,i.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,i.useEffect)(()=>{a({todayCost:Ce,monthCost:L})},[Ce,L,a]),(0,i.useEffect)(()=>o(F),[o,F]);let K=(0,i.useMemo)(()=>u.byTurn??[],[u.byTurn]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(sn,{...e,t:j,onOpen:F,monthCost:L,todayCost:Ce,weekCost:we,days:Te,vendorStatus:Ve,dash:G,cardPrefs:de,monthTokens:Ee,todayTokens:De,weekTokens:Oe,floatPrefs:se,subscriptions:w}),M&&(0,r.jsx)(dn,{stats:ye,t:j,onClose:N,userPrices:ge,onUserPrices:ve,health:m,balances:v,...S===void 0?{}:{reconcile:S},quotas:w,relayQuotas:ie,currency:ae,onCurrency:oe,turns:K,renderSlot:s,budgetEnabled:R,budgetAmount:Re,onToggleBudget:ze,onBudgetAmount:l.setAmount,peakConfig:je,onPeakConfig:Ie,onPreviewPeak:Le,floatPrefs:se,onFloatPrefs:ce,cardPrefs:de,onCardPrefs:he,sitePrefs:k,onSitePrefs:le,quotasStale:ne}),(Me!==null||Ne!==null)&&(0,r.jsx)(Ct,{hit:Me??Ne,config:je,t:j,onDismiss:()=>{H(null),Pe(null)}})]})}function mn(e,t){return t===void 0||e?.bySession===void 0?0:e.bySession.find(e=>e.id===t)?.cost??0}function hn(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 gn(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 _n(){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 vn(){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 yn(e){switch(e){case`session`:return`billing.subscriptionSession`;case`weekly`:return`billing.subscriptionWeekly`;case`monthly`:return`billing.subscriptionMonthly`;default:return`billing.subscriptionBilling`}}function bn({sessionId:e,t}){let[n,a]=(0,i.useState)(null),[o,s]=(0,i.useState)([]),[c,l]=(0,i.useState)(()=>Date.now());(0,i.useEffect)(()=>{let e=!1,t=()=>{_n().then(t=>{!e&&t!==null&&a(t)}),vn().then(t=>{e||s(t)}),e||l(Date.now())};t();let n=setInterval(t,3e4);return()=>{e=!0,clearInterval(n)}},[e]);let u=(0,i.useMemo)(()=>mn(n,e),[n,e]),d=(0,i.useMemo)(()=>hn(n,e),[n,e]),f=ye(c),p=(0,i.useMemo)(()=>gn(o),[o]),m=e=>z(e,`cny`),h=u>0||d>0,g=f.tier===`peak`;return(0,r.jsxs)(`span`,{className:C.feeBar,"data-testid":`billing-live-cost-bar`,children:[(0,r.jsx)(`span`,{className:g?C.feeChipPrimary:C.feeChipOff,"data-testid":`billing-live-tier`,children:t(g?`billing.tierPeak`:`billing.tierOff`)}),(0,r.jsx)(`span`,{className:C.feeCount,children:j(f.nextSwitchInMs)}),(0,r.jsx)(`span`,{className:C.feeSuffix,children:t(g?`billing.tierToOff`:`billing.tierToPeak`)}),h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{className:C.feeSep,"aria-hidden":`true`,children:`·`}),(0,r.jsxs)(`span`,{className:C.feeItem,"data-testid":`billing-live-turn`,children:[t(`billing.liveTurn`),` `,(0,r.jsx)(`span`,{className:C.feeNum,children:m(d)})]}),(0,r.jsx)(`span`,{className:C.feeSep,"aria-hidden":`true`,children:`·`}),(0,r.jsxs)(`span`,{className:C.feeItem,"data-testid":`billing-live-session`,children:[t(`billing.liveSession`),` `,(0,r.jsx)(`span`,{className:C.feeNum,children:m(u)})]})]}),p.map(e=>(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.feeSep,"aria-hidden":`true`,children:`·`}),(0,r.jsxs)(`span`,{className:e.pct<=10?C.feeChipError:C.feeChipAlert,"data-testid":`billing-live-quota`,children:[e.name,` `,t(yn(e.kind)),` `,e.pct,`%`]})]},`${e.name}:${e.kind}`))]})}function xn(){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 Sn(){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 Cn={enabled:!1,timeout:0};function wn(){try{let e=localStorage.getItem(`dsh-billing-completion-notify-v1`);if(e===null)return{...Cn};let t=JSON.parse(e);return{enabled:t.enabled===!0,timeout:typeof t.timeout==`number`?t.timeout:0}}catch{return{...Cn}}}function Tn(e){return e.completed===!0?!0:e.running===!1}function En(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)),Tn(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=Tn(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 Dn=[`slots`,`locale`,`remote`,`remote.llm`,`sessions`];function On(e){let t=xn();e.provide(`billingMetrics`,t);let n=Sn();e.effect(()=>e.locale.register(dt,{zh:ft,en:pt}),`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:!0,available:!1,models:0,failures:0,okProviders:[],badProviders:[]}}},publishCosts:e=>{t.publishCosts(e)},registerOpen:e=>t.registerOpen(e)})},pn)),e.slots.inject(`conversation.composer.dock`,()=>e.slots.register({name:`conversation.composer.dock`,id:`usage-billing-cost`,order:0,locale:dt},bn)),e.effect(()=>En(e.sessions.list,wn),`ui-usage-billing: completion notifier`)}return n.UsageBilling=pn,n.apply=On,n.inject=Dn,t.exports}});
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/jsx-runtime"),i=e("react"),a=e("@deepseek-ai/dsh-client-ui-primitives"),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 ee(e){try{localStorage.setItem(v,JSON.stringify(e))}catch{}}let te=`dsh.ui-usage-billing.prices`;function b(){try{let e=localStorage.getItem(te);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 x(e){try{localStorage.setItem(te,JSON.stringify(e))}catch{}}let S=`@kenz1117/dsh-ui-usage-billing/UsageBilling.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(S)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=S,e.textContent=`.uejhGG_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}.uejhGG_railButton:hover,.uejhGG_railButton:focus-visible{border-color:var(--dsw-static-blue-500);color:var(--dsw-static-blue-500);outline:none}.uejhGG_railButton svg{stroke-width:2px;width:18px;height:18px}.uejhGG_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}.uejhGG_trigger:hover,.uejhGG_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)}.uejhGG_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}.uejhGG_triggerIcon svg{stroke-width:2px;width:16px;height:16px}.uejhGG_triggerMain{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.uejhGG_triggerPrimary{align-items:baseline;gap:5px;min-width:0;display:inline-flex}.uejhGG_triggerLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:11px;line-height:15px;overflow:hidden}.uejhGG_triggerYen{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;font-weight:600;line-height:16px}.uejhGG_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}.uejhGG_triggerSub{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:10px;line-height:14px;overflow:hidden}.uejhGG_triggerSpark{flex:none;align-items:flex-end;gap:2px;height:20px;display:flex}.uejhGG_triggerSparkBar,.uejhGG_triggerSparkHot{background:var(--dsw-static-blue-500);opacity:.6;border-radius:1px 1px 0 0;width:3px}.uejhGG_triggerSparkHot{opacity:1}.uejhGG_triggerWrap{flex:auto;width:100%;min-width:0;display:block;position:relative;container:uejhGG_billing-trigger/inline-size}@container uejhGG_billing-trigger (width<=200px){.uejhGG_trigger{gap:6px;padding:8px 10px}.uejhGG_triggerSpark{display:none}}@container uejhGG_billing-trigger (width<=170px){.uejhGG_triggerSub,.uejhGG_triggerLabel{display:none}}@container uejhGG_billing-trigger (width<=110px){.uejhGG_triggerIcon,.uejhGG_triggerSpark,.uejhGG_triggerSub,.uejhGG_triggerLabel{display:none}.uejhGG_trigger{justify-content:center;padding:8px 6px}}.uejhGG_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-2) 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)}.uejhGG_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 uejhGG_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}.uejhGG_triggerWrap:hover .uejhGG_triggerPop,.uejhGG_triggerWrap:focus-within .uejhGG_triggerPop{opacity:1;transform:translateY(0)}.uejhGG_popHead{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.uejhGG_popTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:700;line-height:18px}.uejhGG_metricGrid{grid-template-columns:repeat(3,1fr);gap:10px 8px;display:grid}.uejhGG_metricCell{flex-direction:column;gap:2px;min-width:0;display:flex}.uejhGG_metricLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.uejhGG_metricValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:12px;font-weight:700;line-height:16px}.uejhGG_metricValuePrimary{color:var(--dsw-static-amber-500)}.uejhGG_metricValueSuccess{color:var(--dsw-static-green-500)}.uejhGG_popModel{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:6px;padding-top:10px;display:flex}.uejhGG_popModelLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.uejhGG_popModelRow{align-items:center;gap:8px;min-width:0;display:flex}.uejhGG_popDot{border-radius:999px;flex:none;width:6px;height:6px}.uejhGG_popDotDirect{background:var(--dsw-static-green-500)}.uejhGG_popDotSub{background:var(--dsw-static-amber-500)}.uejhGG_popDotNeutral{background:var(--dsw-alias-label-tertiary)}.uejhGG_popTagPrimary,.uejhGG_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}.uejhGG_popTagPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.uejhGG_popTagSub{background:color-mix(in srgb, var(--dsw-static-amber-500) 18%, transparent);color:var(--dsw-static-amber-500)}.uejhGG_popModelName{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:16px;overflow:hidden}.uejhGG_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}.uejhGG_popModelStatusLow{color:var(--dsw-static-red-500)}.uejhGG_dashboardModal{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:16px;width:min(760px,100vw - 48px);max-height:min(760px,88vh);animation:.18s ease-out uejhGG_dashboardIn;box-shadow:0 12px 32px -12px #0000002e,0 2px 8px #0000000f}@keyframes uejhGG_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)}.uejhGG_dashboard{flex-direction:column;width:100%;max-height:min(760px,88vh);display:flex}.uejhGG_dashboardHead{border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:12px;padding:20px 24px;display:flex}.uejhGG_dashboardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:600;line-height:24px}.uejhGG_dashboardSubtitle{color:var(--dsw-alias-label-caption);margin:2px 0 0;font-size:11px;line-height:16px}.uejhGG_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}.uejhGG_closeButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.uejhGG_closeButton svg{stroke-width:2px;width:16px;height:16px}.uejhGG_dashboardBody{flex-direction:column;gap:14px;padding:16px 24px 24px;display:flex;overflow-y:auto}.uejhGG_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:12px 24px;font-size:11px;line-height:16px;display:flex}.uejhGG_tabNav{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:4px;padding:0 24px;display:flex}.uejhGG_tabButton{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:8px;margin:8px 0;padding:6px 12px;font-size:13px;font-weight:500;line-height:20px;transition:background-color .16s,color .16s}.uejhGG_tabButton:hover,.uejhGG_tabButton:focus-visible{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 62%, transparent);outline:none}.uejhGG_tabButtonActive,.uejhGG_tabButtonActive:hover,.uejhGG_tabButtonActive:focus-visible{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);font-weight:600}.uejhGG_tabPanel{flex-direction:column;gap:14px;animation:.14s ease-out uejhGG_tabPanelIn;display:flex}@keyframes uejhGG_tabPanelIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.uejhGG_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}.uejhGG_reconcileIcon{color:var(--dsw-alias-label-tertiary);flex:none;margin-top:1px;display:inline-flex}.uejhGG_reconcileText{flex:1}.uejhGG_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}.uejhGG_reconcileDismiss:hover{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent)}.uejhGG_hero{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:18px;padding:24px;display:flex;position:relative;overflow:hidden}.uejhGG_heroTop{justify-content:space-between;align-items:center;gap:24px;display:flex}.uejhGG_heroMain{flex-direction:column;gap:2px;min-width:0;display:flex}.uejhGG_heroLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:16px}.uejhGG_heroReadout{align-items:baseline;gap:4px;display:flex}.uejhGG_heroCurrency{letter-spacing:-.01em;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:22px;font-weight:600;line-height:28px}.uejhGG_heroValue{letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:40px;font-weight:700;line-height:48px}.uejhGG_heroMeta{color:var(--dsw-alias-label-caption);white-space:nowrap;margin-top:4px;font-size:12px;line-height:17px}.uejhGG_heroGauge{flex:none;width:96px;height:96px;position:relative}.uejhGG_heroGaugeSvg{width:100%;height:100%;display:block;transform:rotate(-90deg)}.uejhGG_heroGaugeTrack{fill:none;stroke:var(--dsw-alias-bg-module-platform);stroke-width:9px}.uejhGG_heroGaugeArc{fill:none;stroke:var(--dsw-static-blue-500);stroke-width:9px;stroke-linecap:round;transition:stroke-dasharray .26s}.uejhGG_heroGaugeArcOver{stroke:var(--dsw-static-red-500)}.uejhGG_heroGaugeCenter{flex-direction:column;justify-content:center;align-items:center;gap:1px;display:flex;position:absolute;inset:0}.uejhGG_heroGaugePct{letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);font-size:18px;font-weight:700;line-height:22px}.uejhGG_heroGaugePctOver{color:var(--dsw-static-red-500)}.uejhGG_heroGaugeLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.uejhGG_heroBudget{border-top:1px solid var(--dsw-alias-border-l1);align-items:center;gap:14px;padding-top:14px;display:flex}.uejhGG_heroBudgetLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px;line-height:16px}.uejhGG_heroBudgetTrack{background:var(--dsw-alias-border-l1);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.uejhGG_heroBudgetFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .22s}.uejhGG_heroBudgetFillOver{background:var(--dsw-static-red-500)}.uejhGG_heroBudgetValue{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px;line-height:16px}.uejhGG_heroSide{border-top:1px solid var(--dsw-alias-border-l1);align-items:stretch;padding-top:14px;display:flex}.uejhGG_heroSideItem{border-left:1px solid var(--dsw-alias-border-l1);flex-direction:column;flex:1;gap:3px;min-width:0;padding-left:16px;display:flex}.uejhGG_heroSideItem:first-child{border-left:none;padding-left:0}.uejhGG_heroSideLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:15px}.uejhGG_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:18px;font-weight:600;line-height:24px;display:inline-flex}.uejhGG_heroSideSpacer{flex:1;display:block}.uejhGG_delta{align-items:center;gap:2px;margin-left:4px;font-size:11px;font-weight:600;line-height:17px;display:inline-flex}.uejhGG_deltaUp{color:var(--dsw-static-green-500)}.uejhGG_deltaDown{color:var(--dsw-static-red-500)}.uejhGG_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}.uejhGG_kpiGrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;display:grid}.uejhGG_kpiTile{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:3px;padding:16px;transition:border-color .16s;display:flex;position:relative;overflow:hidden}.uejhGG_kpiTile:hover{border-color:var(--dsw-alias-border-l2)}.uejhGG_kpiLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:15px}.uejhGG_kpiValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:24px;font-weight:600;line-height:32px}.uejhGG_kpiGreen{color:var(--dsw-static-green-500)}.uejhGG_kpiDetail{color:var(--dsw-alias-label-caption);white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:15px;overflow:hidden}.uejhGG_panel{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:10px;padding:16px 18px;transition:border-color .16s;display:flex}.uejhGG_panelHead{justify-content:space-between;align-items:baseline;gap:10px;display:flex}.uejhGG_panelTitle{letter-spacing:-.005em;color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:600;line-height:20px}.uejhGG_panelHint{color:var(--dsw-alias-label-caption);white-space:nowrap;font-size:11px;line-height:16px}.uejhGG_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}.uejhGG_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}.uejhGG_rangeButtonActive{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);font-weight:600}.uejhGG_exportBar{justify-content:flex-end;align-items:center;gap:8px;display:flex}.uejhGG_exportLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:16px}.uejhGG_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}.uejhGG_exportButton:hover,.uejhGG_exportButton:focus-visible{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);outline:none}.uejhGG_shareTrack{background:var(--dsw-alias-bg-module-platform);border-radius:999px;height:10px;display:flex;overflow:hidden}.uejhGG_shareSeg{height:100%;transition:width .2s}.uejhGG_shareSegPeak{background:var(--dsw-static-blue-500)}.uejhGG_shareSegOff{background:color-mix(in srgb, var(--dsw-static-blue-500) 25%, var(--dsw-alias-bg-module-platform))}.uejhGG_shareSegUser{background:var(--dsw-static-blue-500)}.uejhGG_shareSegAssistant{background:var(--dsw-static-green-500)}.uejhGG_shareSegTool{background:var(--dsw-static-amber-500)}.uejhGG_shareLegend{align-items:center;gap:16px;display:flex}.uejhGG_shareItem{color:var(--dsw-alias-label-secondary);align-items:baseline;gap:6px;font-size:12px;line-height:17px;display:inline-flex}.uejhGG_bucketCost{align-items:baseline;gap:3px;display:inline-flex}.uejhGG_bucketOfficial{color:var(--dsw-static-blue-500);font-weight:600}.uejhGG_bucketSep{color:var(--dsw-alias-label-dimmed)}.uejhGG_bucketThird{color:var(--dsw-alias-label-secondary)}.uejhGG_shareDot{border-radius:50%;flex:none;align-self:center;width:8px;height:8px}.uejhGG_shareValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.uejhGG_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}.uejhGG_budgetInput:focus-visible{outline:none}.uejhGG_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}.uejhGG_switchOn{border-color:var(--dsw-alias-border-l1);background:var(--dsw-alias-label-primary)}.uejhGG_switchKnob{background:var(--dsw-static-neutral-bluish-00);border-radius:50%;width:11px;height:11px;transition:transform .16s;position:absolute;top:2px;left:2px}.uejhGG_switchOn .uejhGG_switchKnob{transform:translate(13px)}.uejhGG_budgetFillWarn{background:var(--dsw-static-amber-500)}.uejhGG_budgetFillOver{background:var(--dsw-static-red-500);animation:1.6s ease-in-out infinite uejhGG_budgetOverPulse}@keyframes uejhGG_budgetOverPulse{50%{opacity:.55}}.uejhGG_chartWrap{width:100%;position:relative}.uejhGG_chartSvg{width:100%;height:auto;display:block}.uejhGG_chartEmpty{height:140px;color:var(--dsw-alias-label-caption);justify-content:center;align-items:center;font-size:13px;display:flex}.uejhGG_emptyRow{text-align:center;color:var(--dsw-alias-label-caption);padding:28px 0;font-size:13px}.uejhGG_chartGrid{stroke:var(--dsw-alias-border-l1);stroke-width:1px}.uejhGG_chartAxisLabel{fill:var(--dsw-alias-label-tertiary);font-size:10px}.uejhGG_chartBar{fill:var(--dsw-static-blue-500);opacity:.7}.uejhGG_chartBar:hover{opacity:1}.uejhGG_chartStack{stroke:var(--dsw-alias-bg-layer-1);stroke-width:.75px}.uejhGG_chartStack:hover{opacity:.9}.uejhGG_chartLine{stroke:var(--dsw-static-blue-500);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.uejhGG_chartCrosshair{stroke:var(--dsw-alias-label-dimmed);stroke-width:1px;stroke-dasharray:3 3}.uejhGG_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))}.uejhGG_chartTooltipDate{color:var(--dsw-alias-label-primary);margin-bottom:3px;font-size:11px;font-weight:600}.uejhGG_chartTooltipRow{color:var(--dsw-alias-label-secondary);align-items:center;gap:5px;font-size:11px;line-height:17px;display:flex}.uejhGG_chartTooltipRow strong{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.uejhGG_chartBarPlaceholder{fill:color-mix(in srgb, var(--dsw-alias-label-secondary) 30%, transparent)}.uejhGG_chartLegendLine{background:var(--dsw-static-blue-500);border-radius:2px;width:10px;height:3px;display:inline-block}.uejhGG_chartLegendBar{background:var(--dsw-static-blue-500);opacity:.5;border-radius:2px;width:7px;height:7px;display:inline-block}.uejhGG_chartTooltipSwatch{border-radius:3px;flex:none;width:8px;height:8px;display:inline-block}.uejhGG_chartLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-end;gap:14px;margin-top:2px;font-size:11px;display:flex}.uejhGG_chartLegend span{align-items:center;gap:5px;display:inline-flex}.uejhGG_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}.uejhGG_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}.uejhGG_ubAlertLeft{align-items:center;gap:8px;display:inline-flex}.uejhGG_ubRate{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.uejhGG_ubAlertNote{color:var(--dsw-alias-label-secondary);margin:0}.uejhGG_ubTag,.uejhGG_ubTagSuccess,.uejhGG_ubTagNeutral,.uejhGG_ubTagAlert,.uejhGG_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}.uejhGG_ubTagSuccess{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.uejhGG_ubTagNeutral{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary)}.uejhGG_ubTagAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.uejhGG_ubTagPromo{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500);cursor:help}.uejhGG_ubExtraRow td{opacity:.72;padding-top:2px;padding-bottom:2px;font-size:12px}.uejhGG_ubExtraName{color:var(--dsw-alias-label-secondary);margin-left:26px}.uejhGG_ubExtraNote{color:var(--dsw-alias-label-tertiary);margin-left:8px;font-size:10px}.uejhGG_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}.uejhGG_ubCardHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.uejhGG_ubCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.uejhGG_ubCardSub{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.uejhGG_ubTablewrap{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;overflow:auto}.uejhGG_ubTable{border-collapse:collapse;white-space:nowrap;width:100%;font-size:12.5px}.uejhGG_ubTable th,.uejhGG_ubTable td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;padding:9px 12px}.uejhGG_ubTable tbody tr:last-child td{border-bottom:0}.uejhGG_ubTable thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;font-size:11px;font-weight:600}.uejhGG_ubModel{align-items:center;gap:8px;display:inline-flex}.uejhGG_vendorLogo{object-fit:contain;border-radius:4px;flex:none;width:18px;height:18px}.uejhGG_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}.uejhGG_ubModelName{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-weight:500;display:inline-flex}.uejhGG_ubPricepair{flex-wrap:wrap;gap:6px;display:inline-flex}.uejhGG_ubChipPeak,.uejhGG_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}.uejhGG_ubChipLabel{font-size:10px;font-weight:600}.uejhGG_ubChipPeak{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.uejhGG_ubChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.uejhGG_ubNotes{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.uejhGG_ubNotesItem{align-items:baseline;gap:10px;display:flex}.uejhGG_ubNotesTerm{color:var(--dsw-alias-label-primary);flex:0 0 72px;font-size:12px;font-weight:500}.uejhGG_ubNotesDesc{min-width:0;color:var(--dsw-alias-label-secondary);flex:1;font-size:12px;line-height:17px}.uejhGG_ubCardControlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.uejhGG_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}.uejhGG_ubStatGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.uejhGG_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}.uejhGG_ubStatLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.uejhGG_ubStatValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:22px;font-weight:700;line-height:28px}.uejhGG_ubStatDetail{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.uejhGG_rowlist{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.uejhGG_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}.uejhGG_rowline:hover{background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 60%, transparent);border-color:var(--dsw-alias-border-l1)}.uejhGG_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}.uejhGG_rowlineRight{font-variant-numeric:tabular-nums;flex:none;align-items:baseline;gap:8px;display:inline-flex}.uejhGG_rowlineMuted{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.uejhGG_rowlineChev{color:var(--dsw-alias-label-tertiary);font-size:14px}.uejhGG_rowlineDrillWrap{padding-left:12px}.uejhGG_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}.uejhGG_modelTable,.uejhGG_pricingTable{border-collapse:collapse;width:100%;font-size:12.5px}.uejhGG_modelTable th,.uejhGG_modelTable td,.uejhGG_pricingTable th,.uejhGG_pricingTable td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;white-space:nowrap;padding:9px 12px}.uejhGG_modelTable tbody tr:last-child td,.uejhGG_pricingTable tbody tr:last-child td{border-bottom:0}.uejhGG_modelTable thead th,.uejhGG_pricingTable thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;background:0 0;font-size:11px;font-weight:600}.uejhGG_modelTable tbody tr,.uejhGG_pricingTable tbody tr{transition:background-color .12s}.uejhGG_modelTable tbody tr:hover,.uejhGG_pricingTable tbody tr:hover{background:0 0}.uejhGG_numCol{text-align:right;font-variant-numeric:tabular-nums}.uejhGG_na{color:var(--dsw-alias-label-dimmed)}.uejhGG_modelCell{align-items:center;gap:8px;display:inline-flex}.uejhGG_modelDot{border-radius:50%;flex:none;width:9px;height:9px}.uejhGG_modelName{color:var(--dsw-alias-label-primary);font-weight:500;line-height:16px;display:block}.uejhGG_modelProvider{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px;display:block}.uejhGG_pricingToggle:hover .uejhGG_panelTitle,.uejhGG_pricingToggle:focus-visible .uejhGG_panelTitle{color:var(--dsw-alias-label-primary)}.uejhGG_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}.uejhGG_siteRowName{align-items:center;gap:8px;min-width:0;display:inline-flex}.uejhGG_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}.uejhGG_siteKindSite{color:var(--dsw-static-blue-500);background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent)}.uejhGG_siteKindDirect{color:var(--dsw-static-green-500);background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent)}.uejhGG_siteKindUnknown{color:var(--dsw-static-red-500);background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent)}.uejhGG_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}.uejhGG_siteRowMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.uejhGG_siteRowCost{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:12.5px;font-weight:700;line-height:18px}.uejhGG_siteRowCalls{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:11.5px;line-height:17px}.uejhGG_siteRowCallsLow{color:var(--dsw-static-red-500)}.uejhGG_flatTag{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px}.uejhGG_healthDot{border-radius:50%;flex:none;width:8px;height:8px;display:inline-block}.uejhGG_healthOk{background:var(--dsw-static-green-500)}.uejhGG_healthBad{background:var(--dsw-static-red-500)}.uejhGG_healthIdle{background:var(--dsw-static-neutral-bluish-400)}.uejhGG_dashboardRight{align-items:center;gap:8px;min-width:0;display:flex}.uejhGG_healthBadge{white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:3px 9px;font-size:11px;line-height:16px;display:inline-flex}.uejhGG_healthBadgeOk{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2)}.uejhGG_healthBadgeBad{color:var(--dsw-static-red-500);background:var(--dsw-alias-bg-layer-2)}.uejhGG_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}.uejhGG_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}.uejhGG_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}.uejhGG_feeBar{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);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}.uejhGG_feeCount{color:var(--dsw-alias-label-primary);font-weight:600}.uejhGG_feeSuffix{color:var(--dsw-alias-label-tertiary)}.uejhGG_feeItem{color:var(--dsw-alias-label-secondary);white-space:nowrap}.uejhGG_feeNum{color:var(--dsw-alias-label-primary)}.uejhGG_feeSep{color:var(--dsw-alias-label-tertiary)}.uejhGG_feeChipPrimary,.uejhGG_feeChipOff,.uejhGG_feeChipAlert,.uejhGG_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}.uejhGG_feeChipPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.uejhGG_feeChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.uejhGG_feeChipAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.uejhGG_feeChipError{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500)}.uejhGG_balanceCell{align-items:center;gap:6px;display:inline-flex;position:relative}.uejhGG_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}.uejhGG_balanceDaysBadge:hover{border-color:var(--dsw-alias-label-secondary);background:color-mix(in srgb, var(--dsw-alias-label-caption) 18%, transparent)}.uejhGG_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)}.uejhGG_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}.uejhGG_balanceDetailHead{justify-content:space-between;align-items:center;gap:12px;display:flex}.uejhGG_balanceDetailTitle{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600}.uejhGG_balanceDetailClose{cursor:pointer;color:var(--dsw-alias-label-caption);background:0 0;border:none;font-size:14px;line-height:1}.uejhGG_balanceDetailClose:hover{color:var(--dsw-alias-label-primary)}.uejhGG_balanceDetailGrid{flex-direction:column;gap:4px;display:inline-flex}.uejhGG_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}.uejhGG_balanceDetailLabel{color:var(--dsw-alias-label-caption)}.uejhGG_balanceDetailValue{color:var(--dsw-alias-label-primary);font-weight:500}body[data-zine-mode] .uejhGG_trigger,body[data-zine-mode] .uejhGG_triggerPop,body[data-zine-mode] .uejhGG_railButton{display:none}body[data-zine-mode] .uejhGG_dashboardHead{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .uejhGG_headTitleRow{align-items:center;gap:8px;margin-top:4px;display:flex}body[data-zine-mode] .uejhGG_dashboardTitle{color:#e8ff00;letter-spacing:.04em;text-transform:uppercase;text-shadow:0 0 8px #e8ff0066;font-weight:900}body[data-zine-mode] .uejhGG_dashboardSubtitle{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px}body[data-zine-mode] .uejhGG_closeButton{color:#0a0a05;background:#ff2d95;border:1.5px solid #ff2d95;border-radius:0;box-shadow:0 0 10px #ff2d9573}body[data-zine-mode] .uejhGG_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] .uejhGG_heroLabel{color:#c9d98a;letter-spacing:.12em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .uejhGG_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] .uejhGG_heroMeta{color:#c9d98a;letter-spacing:.06em;text-transform:uppercase;font-size:10.5px}body[data-zine-mode] .uejhGG_heroSideLabel{color:#c9d98a;letter-spacing:.1em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .uejhGG_heroSideValue{color:#e8ff00;text-shadow:0 0 6px #e8ff0059}body[data-zine-mode] .uejhGG_delta{font-weight:900}body[data-zine-mode] .uejhGG_deltaUp{color:#ff2d95}body[data-zine-mode] .uejhGG_deltaDown{color:#c9d98a}body[data-zine-mode] .uejhGG_tabNav{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .uejhGG_tabButton{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;border-radius:0;font-size:10.5px;font-weight:900}body[data-zine-mode] .uejhGG_tabButton:hover,body[data-zine-mode] .uejhGG_tabButton:focus-visible{color:#e8ff00;background:#e8ff001f}body[data-zine-mode] .uejhGG_tabButtonActive,body[data-zine-mode] .uejhGG_tabButtonActive:hover,body[data-zine-mode] .uejhGG_tabButtonActive:focus-visible{color:#0a0a05;background:#e8ff00;box-shadow:0 0 10px #e8ff0073}body[data-zine-mode] .uejhGG_panel{background:#000;border:2px solid #e8ff00;border-radius:0}body[data-zine-mode] .uejhGG_trendPanel{position:relative}body[data-zine-mode] .uejhGG_panelTitle{color:#e8ff00;letter-spacing:.06em;text-transform:uppercase;text-shadow:0 0 6px #e8ff0066;font-weight:900}body[data-zine-mode] .uejhGG_panelHint{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .uejhGG_modelTableScroll{background:#000;border:1.5px solid #e8ff0080;border-radius:0}.uejhGG_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}.uejhGG_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}.uejhGG_currencyButtonActive{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}.uejhGG_subscriptionGrid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin-top:10px;display:grid}.uejhGG_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}.uejhGG_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 uejhGG_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}@keyframes uejhGG_subscriptionGoldFlow{0%{background-position:200% 0}to{background-position:-200% 0}}.uejhGG_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}.uejhGG_subscriptionHead{flex-wrap:wrap;align-items:baseline;gap:6px;margin-bottom:8px;display:flex}.uejhGG_subscriptionName{font-size:13px;font-weight:700}.uejhGG_subscriptionPlan{color:var(--dsw-alias-label-secondary);font-size:11px}.uejhGG_subscriptionPlan[data-kind=code],.uejhGG_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}.uejhGG_subscriptionTier{color:var(--dsw-alias-label-secondary);margin-left:6px}.uejhGG_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}.uejhGG_subscriptionStatus{color:var(--dsw-alias-label-secondary);margin-bottom:6px;font-size:11px}.uejhGG_subscriptionWindow{align-items:center;gap:10px;margin-top:8px;font-size:11px;display:flex}.uejhGG_subscriptionWindowLabel{color:var(--dsw-alias-label-secondary);flex:0 0 44px}.uejhGG_subscriptionTrack{background:var(--dsw-alias-bg-layer-3);border-radius:3px;flex:1;height:6px;overflow:hidden}.uejhGG_subscriptionFill{background:var(--dsw-static-blue-500);border-radius:3px;height:100%;transition:width .2s;display:block}.uejhGG_subscriptionFillWarn{background:var(--dsw-static-amber-500)}.uejhGG_subscriptionFillOver{background:var(--dsw-static-red-500)}.uejhGG_subscriptionMeta{flex-direction:column;flex:none;align-items:flex-end;gap:2px;display:flex}.uejhGG_subscriptionPct{text-align:right;font-variant-numeric:tabular-nums;flex:none;min-width:52px}.uejhGG_subscriptionExhausted{color:var(--dsw-static-red-500);min-width:52px;font-weight:600}.uejhGG_subscriptionReset{color:var(--dsw-alias-label-caption);white-space:nowrap;flex:none;font-size:10px}.uejhGG_providerGroupList{flex-direction:column;gap:10px;display:flex}.uejhGG_providerGroup{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;padding:12px 14px}.uejhGG_providerGroupHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.uejhGG_providerGroupTitle{align-items:center;gap:7px;min-width:0;display:inline-flex}.uejhGG_providerGroupName{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px}.uejhGG_providerGroupMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.uejhGG_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}.uejhGG_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}.uejhGG_providerGroupBalanceLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:17px}.uejhGG_rounds{margin-top:10px}.uejhGG_roundsBars{align-items:flex-end;gap:3px;height:124px;padding:16px 2px 0;display:flex;overflow-x:auto}.uejhGG_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}.uejhGG_roundsBarColPeak{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent)}.uejhGG_roundsBarColOff{background:var(--dsw-alias-bg-module-platform)}.uejhGG_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%)}.uejhGG_roundsBarWrap{flex:1;align-items:flex-end;min-height:0;display:flex}.uejhGG_roundsBar{background:var(--dsw-static-blue-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.uejhGG_roundsBarFlagged{background:var(--dsw-static-red-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.uejhGG_roundsFlagMark{background:var(--dsw-static-red-500);border-radius:50%;width:7px;height:7px;position:absolute;top:-3px;right:-3px}.uejhGG_roundsAxis{color:var(--dsw-alias-label-secondary);justify-content:space-between;margin-top:6px;font-size:10px;display:flex}.uejhGG_roundsEmpty{color:var(--dsw-alias-label-secondary);margin-top:10px;font-size:12px}.uejhGG_heatmap{margin-top:10px}.uejhGG_heatmapGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;display:grid}.uejhGG_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}.uejhGG_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}.uejhGG_heatmapCell[data-level="0"],.uejhGG_heatmapCell[data-level="1"],.uejhGG_heatmapCell[data-level="2"]{color:var(--dsw-alias-label-primary)}.uejhGG_heatmapCell[data-level="3"],.uejhGG_heatmapCell[data-level="4"]{color:var(--dsw-static-neutral-bluish-00)}.uejhGG_heatmapFooter{color:var(--dsw-alias-label-secondary);align-items:center;gap:8px;margin-top:10px;font-size:10px;display:flex}.uejhGG_heatmapLegend{gap:3px;display:inline-flex}.uejhGG_heatmapLegend i{border-radius:4px;width:14px;height:14px;display:block}.uejhGG_heatmapHover{font-variant-numeric:tabular-nums;margin-left:auto}.uejhGG_heatmapRangeSwitch{gap:4px;margin-left:auto;display:inline-flex}.uejhGG_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}.uejhGG_heatmapRangeButtonActive{color:var(--dsw-alias-text-primary);border-color:currentColor;font-weight:600}.uejhGG_heatmapYear{flex-direction:column;gap:6px;display:flex}.uejhGG_heatmapYearBody{align-items:flex-start;gap:6px;display:flex}.uejhGG_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}.uejhGG_heatmapYearWeekday{white-space:nowrap;text-align:right;height:11px}.uejhGG_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}.uejhGG_heatmapYearMonth{white-space:nowrap;overflow:visible}.uejhGG_heatmapYearScroll{padding-bottom:2px;overflow-x:auto}.uejhGG_heatmapYearGrid{grid-template-rows:repeat(7,11px);grid-auto-flow:column;gap:3px;min-width:max-content;display:grid}.uejhGG_heatmapYearCell{cursor:pointer;border:0;border-radius:2px;width:11px;height:11px;padding:0}.uejhGG_triggerPopSubscription{width:auto;left:0;right:0}.uejhGG_floatSub{flex-direction:column;gap:6px;min-width:0;display:flex}.uejhGG_floatSubHead{flex-wrap:wrap;align-items:baseline;gap:6px;min-width:0;display:flex}.uejhGG_floatSubName{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:700}.uejhGG_floatSubPlan{color:var(--dsw-alias-label-secondary);font-size:10px}.uejhGG_floatSub .uejhGG_subscriptionWindow{flex-wrap:wrap;gap:4px 10px}.uejhGG_floatSub .uejhGG_subscriptionWindowLabel{flex:none}.uejhGG_floatSub .uejhGG_subscriptionMeta{min-width:0;max-width:100%}.uejhGG_floatSub .uejhGG_subscriptionPct{min-width:0}.uejhGG_floatSub .uejhGG_subscriptionReset{white-space:normal;overflow-wrap:anywhere}.uejhGG_triggerPopEmpty{color:var(--dsw-alias-label-tertiary);padding:2px 0;font-size:11px;line-height:1.5}.uejhGG_triggerPopSwitcher{justify-content:flex-end;align-items:center;gap:8px;margin-top:2px;display:flex}.uejhGG_triggerPopSwitchCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:10px}.uejhGG_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}.uejhGG_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)}.uejhGG_floatTarget{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:5px;font-size:12px;display:inline-flex}.uejhGG_floatTargetLabel{color:var(--dsw-alias-label-secondary)}.uejhGG_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}.uejhGG_plgHead{align-items:flex-start;gap:12px;display:flex}.uejhGG_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}.uejhGG_plgTitle{flex-direction:column;gap:4px;min-width:0;display:flex}.uejhGG_plgNameRow{align-items:center;gap:8px;display:flex}.uejhGG_plgName{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.uejhGG_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}.uejhGG_plgDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.uejhGG_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}.uejhGG_plgItem{flex-direction:column;gap:2px;min-width:0;display:flex}.uejhGG_plgLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.uejhGG_plgVal{color:var(--dsw-alias-label-primary);word-break:break-all;font-size:12px;line-height:17px}.uejhGG_plgLink{color:var(--dsw-static-blue-500);word-break:break-all;font-size:12px;line-height:17px;text-decoration:none}.uejhGG_plgLink:hover{text-decoration:underline}.uejhGG_tokenPanel{flex-direction:column;gap:14px;display:flex}.uejhGG_tokenModelBar{background:var(--dsw-alias-bg-layer-2);border-radius:999px;height:8px;overflow:hidden}.uejhGG_tokenModelParts{height:100%;display:flex}.uejhGG_tokenModelPartIn{background:var(--dsw-static-blue-500)}.uejhGG_tokenModelPartOut{background:var(--dsw-static-amber-500)}.uejhGG_tokenModelShareRow{align-items:center;gap:6px;display:inline-flex}@media (width<=640px){.uejhGG_kpiGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.uejhGG_hero{gap:14px}.uejhGG_heroTop{flex-direction:column;align-items:flex-start;gap:12px}.uejhGG_heroGauge{width:72px;height:72px}.uejhGG_heroSide{gap:12px}.uejhGG_heroSideSpacer{display:none}}.uejhGG_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 uejhGG_peakAlertIn;display:flex;position:fixed;box-shadow:0 4px 16px #00000014}.uejhGG_peakCardCorner{bottom:18px;right:18px}.uejhGG_peakCardCenter{top:20%;left:50%;transform:translate(-50%)}.uejhGG_peakCardPeak{color:var(--dsw-static-blue-500)}.uejhGG_peakCardOff{color:var(--dsw-static-green-500)}.uejhGG_peakHead{justify-content:space-between;align-items:center;gap:8px;display:flex}.uejhGG_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}.uejhGG_peakTagPrimary{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-blue-500)}.uejhGG_peakTagSuccess{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-green-500)}.uejhGG_peakDot{border-radius:999px;flex:none;width:6px;height:6px}.uejhGG_peakDotPrimary{background:var(--dsw-static-blue-500)}.uejhGG_peakDotSuccess{background:var(--dsw-static-green-500)}.uejhGG_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}.uejhGG_peakClose:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2)}.uejhGG_peakCount{font-variant-numeric:tabular-nums;font-size:28px;font-weight:700;line-height:34px}.uejhGG_peakCountPrimary{color:var(--dsw-static-blue-500)}.uejhGG_peakCountSuccess{color:var(--dsw-static-green-500)}.uejhGG_peakDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:18px}@keyframes uejhGG_peakAlertIn{0%{opacity:0}to{opacity:1}}.uejhGG_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}.uejhGG_setCardHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.uejhGG_setCardMeta{flex-direction:column;gap:4px;min-width:0;display:flex}.uejhGG_setCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.uejhGG_setCardDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.uejhGG_ctlCol{flex-direction:column;gap:10px;padding-top:2px;display:flex}.uejhGG_ctlRow{align-items:center;gap:12px;min-height:28px;display:flex}.uejhGG_ctlRowStretch{display:flex}.uejhGG_ctlLabel{color:var(--dsw-alias-label-secondary);flex:0 0 96px;font-size:11px;line-height:16px}.uejhGG_ctlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.uejhGG_userPriceRow{border-bottom:1px solid var(--dsw-alias-border-l1);flex-wrap:wrap;align-items:flex-end;gap:10px;padding:8px 0;display:flex}.uejhGG_userPriceOffPeak{flex-wrap:wrap;align-items:center;gap:10px;width:100%;padding:2px 0 6px;display:flex}.uejhGG_userPriceField{flex-direction:column;gap:4px;min-width:0;display:flex}.uejhGG_userPriceField .uejhGG_ctlLabel{flex:none;font-size:11px}.uejhGG_userPriceInput,.uejhGG_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}.uejhGG_userPriceInputNum{min-width:72px;max-width:88px}.uejhGG_userPriceRemove{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-static-red-400);cursor:pointer;background:0 0;border-radius:6px;align-self:center;padding:4px 8px;font-size:11px;line-height:16px}.uejhGG_userPriceRemove:hover{border-color:var(--dsw-static-red-400)}.uejhGG_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}.uejhGG_rdo input{opacity:0;pointer-events:none;position:absolute}.uejhGG_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}.uejhGG_rdo input:checked+.uejhGG_rdoDot{border-color:var(--dsw-static-blue-500)}.uejhGG_rdo input:checked+.uejhGG_rdoDot:after{content:"";background:var(--dsw-static-blue-500);border-radius:50%;position:absolute;inset:3px}.uejhGG_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}.uejhGG_affix{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.uejhGG_prog{background:var(--dsw-alias-bg-module-platform);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.uejhGG_progFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .2s}.uejhGG_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}.uejhGG_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))}`,document.head.appendChild(e)}var C={subscriptionName:`uejhGG_subscriptionName`,bucketSep:`uejhGG_bucketSep`,heroGaugeLabel:`uejhGG_heroGaugeLabel`,panelHint:`uejhGG_panelHint`,vendorLogo:`uejhGG_vendorLogo`,heatmapYearWeekdays:`uejhGG_heatmapYearWeekdays`,feeCount:`uejhGG_feeCount`,bucketOfficial:`uejhGG_bucketOfficial`,exportButton:`uejhGG_exportButton`,heroBudgetValue:`uejhGG_heroBudgetValue`,tabButtonActive:`uejhGG_tabButtonActive`,feeChipOff:`uejhGG_feeChipOff`,feeChipError:`uejhGG_feeChipError`,kpiLabel:`uejhGG_kpiLabel`,popModelRow:`uejhGG_popModelRow`,reconcileNotice:`uejhGG_reconcileNotice`,triggerSpark:`uejhGG_triggerSpark`,ubStatDetail:`uejhGG_ubStatDetail`,dashboardIn:`uejhGG_dashboardIn`,kpiDetail:`uejhGG_kpiDetail`,ubTagError:`uejhGG_ubTagError`,plgIcon:`uejhGG_plgIcon`,balanceDetailTitle:`uejhGG_balanceDetailTitle`,metricValue:`uejhGG_metricValue`,peakCardOff:`uejhGG_peakCardOff`,userPriceRemove:`uejhGG_userPriceRemove`,ubStatLabel:`uejhGG_ubStatLabel`,rowlineChev:`uejhGG_rowlineChev`,numCol:`uejhGG_numCol`,peakDesc:`uejhGG_peakDesc`,providerGroupBadge:`uejhGG_providerGroupBadge`,prog:`uejhGG_prog`,modelTable:`uejhGG_modelTable`,modelCell:`uejhGG_modelCell`,heroBudgetFillOver:`uejhGG_heroBudgetFillOver`,heroValue:`uejhGG_heroValue`,budgetFillWarn:`uejhGG_budgetFillWarn`,ubRate:`uejhGG_ubRate`,peakCardCorner:`uejhGG_peakCardCorner`,ubCardHead:`uejhGG_ubCardHead`,userPriceInputNum:`uejhGG_userPriceInputNum`,peakHead:`uejhGG_peakHead`,feeNum:`uejhGG_feeNum`,rowlineDrillWrap:`uejhGG_rowlineDrillWrap`,peakCountPrimary:`uejhGG_peakCountPrimary`,popDot:`uejhGG_popDot`,popModelLabel:`uejhGG_popModelLabel`,triggerPopSwitchCount:`uejhGG_triggerPopSwitchCount`,floatModeBtnOn:`uejhGG_floatModeBtnOn`,setCardHead:`uejhGG_setCardHead`,heatmapCellEmpty:`uejhGG_heatmapCellEmpty`,shareSegUser:`uejhGG_shareSegUser`,userPriceOffPeak:`uejhGG_userPriceOffPeak`,delta:`uejhGG_delta`,hero:`uejhGG_hero`,siteKindTag:`uejhGG_siteKindTag`,peakDotPrimary:`uejhGG_peakDotPrimary`,ubCardTitle:`uejhGG_ubCardTitle`,heroMain:`uejhGG_heroMain`,balanceDetailClose:`uejhGG_balanceDetailClose`,setCardDesc:`uejhGG_setCardDesc`,emptyRow:`uejhGG_emptyRow`,roundsAxis:`uejhGG_roundsAxis`,heatmapYear:`uejhGG_heatmapYear`,plgTitle:`uejhGG_plgTitle`,railButton:`uejhGG_railButton`,dashboardTitle:`uejhGG_dashboardTitle`,tabButton:`uejhGG_tabButton`,heroGaugeCenter:`uejhGG_heroGaugeCenter`,heroSideValue:`uejhGG_heroSideValue`,chartSvg:`uejhGG_chartSvg`,shareSegAssistant:`uejhGG_shareSegAssistant`,ubCardSub:`uejhGG_ubCardSub`,heroGaugePctOver:`uejhGG_heroGaugePctOver`,budgetInput:`uejhGG_budgetInput`,ubTablewrap:`uejhGG_ubTablewrap`,balanceDetailPop:`uejhGG_balanceDetailPop`,heroSideSpacer:`uejhGG_heroSideSpacer`,roundsBarLabel:`uejhGG_roundsBarLabel`,ubNotesDesc:`uejhGG_ubNotesDesc`,heatmapRangeButtonActive:`uejhGG_heatmapRangeButtonActive`,ctlRowStretch:`uejhGG_ctlRowStretch`,uncataloguedTag:`uejhGG_uncataloguedTag`,heatmapGrid:`uejhGG_heatmapGrid`,balanceDetailRow:`uejhGG_balanceDetailRow`,heatmapRangeButton:`uejhGG_heatmapRangeButton`,heatmapYearMonths:`uejhGG_heatmapYearMonths`,plgVal:`uejhGG_plgVal`,progFill:`uejhGG_progFill`,planTag:`uejhGG_planTag`,heroGauge:`uejhGG_heroGauge`,ubAlert:`uejhGG_ubAlert`,subscriptionFillWarn:`uejhGG_subscriptionFillWarn`,setCard:`uejhGG_setCard`,triggerMetric:`uejhGG_triggerMetric`,triggerPrimary:`uejhGG_triggerPrimary`,chartTooltip:`uejhGG_chartTooltip`,currencyToggle:`uejhGG_currencyToggle`,providerGroup:`uejhGG_providerGroup`,userPriceRow:`uejhGG_userPriceRow`,siteRowCallsLow:`uejhGG_siteRowCallsLow`,rdo:`uejhGG_rdo`,heroLabel:`uejhGG_heroLabel`,chartWrap:`uejhGG_chartWrap`,rowlist:`uejhGG_rowlist`,subscriptionCard:`uejhGG_subscriptionCard`,balanceCell:`uejhGG_balanceCell`,ubNotesItem:`uejhGG_ubNotesItem`,metricValueSuccess:`uejhGG_metricValueSuccess`,subscriptionAuto:`uejhGG_subscriptionAuto`,providerGroupHead:`uejhGG_providerGroupHead`,healthBadgeBad:`uejhGG_healthBadgeBad`,heatmapFooter:`uejhGG_heatmapFooter`,peakDotSuccess:`uejhGG_peakDotSuccess`,ctlGroup:`uejhGG_ctlGroup`,feeChipPrimary:`uejhGG_feeChipPrimary`,rangeButtonActive:`uejhGG_rangeButtonActive`,dashboardSubtitle:`uejhGG_dashboardSubtitle`,subscriptionPct:`uejhGG_subscriptionPct`,chartAxisLabel:`uejhGG_chartAxisLabel`,heroGaugeSvg:`uejhGG_heroGaugeSvg`,ubCard:`uejhGG_ubCard`,floatTargetLabel:`uejhGG_floatTargetLabel`,peakTagPrimary:`uejhGG_peakTagPrimary`,feeItem:`uejhGG_feeItem`,heroGaugeTrack:`uejhGG_heroGaugeTrack`,providerGroupBalance:`uejhGG_providerGroupBalance`,exportBar:`uejhGG_exportBar`,chartLine:`uejhGG_chartLine`,chartTooltipSwatch:`uejhGG_chartTooltipSwatch`,peakClose:`uejhGG_peakClose`,userPriceInput:`uejhGG_userPriceInput`,btn:`uejhGG_btn`,rangeToggle:`uejhGG_rangeToggle`,pricingToggle:`uejhGG_pricingToggle`,heatmapRangeSwitch:`uejhGG_heatmapRangeSwitch`,kpiGreen:`uejhGG_kpiGreen`,pricingTable:`uejhGG_pricingTable`,shareTrack:`uejhGG_shareTrack`,heatmapHover:`uejhGG_heatmapHover`,siteRowCost:`uejhGG_siteRowCost`,peakDot:`uejhGG_peakDot`,subscriptionExhausted:`uejhGG_subscriptionExhausted`,rangeButton:`uejhGG_rangeButton`,chartLegendBar:`uejhGG_chartLegendBar`,popTagPrimary:`uejhGG_popTagPrimary`,switchKnob:`uejhGG_switchKnob`,ubStatGrid:`uejhGG_ubStatGrid`,feeSuffix:`uejhGG_feeSuffix`,chartGrid:`uejhGG_chartGrid`,floatSub:`uejhGG_floatSub`,floatSubHead:`uejhGG_floatSubHead`,triggerPopEmpty:`uejhGG_triggerPopEmpty`,"billing-trigger":`uejhGG_billing-trigger`,shareSeg:`uejhGG_shareSeg`,chartTooltipRow:`uejhGG_chartTooltipRow`,ubTagNeutral:`uejhGG_ubTagNeutral`,triggerYen:`uejhGG_triggerYen`,heroGaugePct:`uejhGG_heroGaugePct`,tokenModelBar:`uejhGG_tokenModelBar`,ctlLabel:`uejhGG_ctlLabel`,na:`uejhGG_na`,modalFooter:`uejhGG_modalFooter`,switch:`uejhGG_switch`,triggerSparkBar:`uejhGG_triggerSparkBar`,plgTag:`uejhGG_plgTag`,ubModel:`uejhGG_ubModel`,rowlineDrill:`uejhGG_rowlineDrill`,tabPanel:`uejhGG_tabPanel`,chartLegend:`uejhGG_chartLegend`,heroGaugeArc:`uejhGG_heroGaugeArc`,triggerIcon:`uejhGG_triggerIcon`,heatmapYearMonth:`uejhGG_heatmapYearMonth`,providerGroupBalanceLabel:`uejhGG_providerGroupBalanceLabel`,kpiValue:`uejhGG_kpiValue`,ubExtraRow:`uejhGG_ubExtraRow`,chartLegendLine:`uejhGG_chartLegendLine`,providerGroupMeta:`uejhGG_providerGroupMeta`,heatmapCell:`uejhGG_heatmapCell`,heroSideLabel:`uejhGG_heroSideLabel`,shareLegend:`uejhGG_shareLegend`,rowlineName:`uejhGG_rowlineName`,trigger:`uejhGG_trigger`,triggerSub:`uejhGG_triggerSub`,dashboardHead:`uejhGG_dashboardHead`,vendorLetter:`uejhGG_vendorLetter`,heroTop:`uejhGG_heroTop`,ubExtraNote:`uejhGG_ubExtraNote`,plgLabel:`uejhGG_plgLabel`,setCardTitle:`uejhGG_setCardTitle`,inp:`uejhGG_inp`,panelHead:`uejhGG_panelHead`,balanceDetailValue:`uejhGG_balanceDetailValue`,reconcileText:`uejhGG_reconcileText`,kpiGrid:`uejhGG_kpiGrid`,feeBar:`uejhGG_feeBar`,popModel:`uejhGG_popModel`,ubNotes:`uejhGG_ubNotes`,roundsFlagMark:`uejhGG_roundsFlagMark`,heatmapYearBody:`uejhGG_heatmapYearBody`,plgNameRow:`uejhGG_plgNameRow`,triggerLabel:`uejhGG_triggerLabel`,heroSide:`uejhGG_heroSide`,flatTag:`uejhGG_flatTag`,heatmapYearGrid:`uejhGG_heatmapYearGrid`,userPriceField:`uejhGG_userPriceField`,chartStack:`uejhGG_chartStack`,chartTooltipDate:`uejhGG_chartTooltipDate`,rowlineRight:`uejhGG_rowlineRight`,affix:`uejhGG_affix`,budgetFillOver:`uejhGG_budgetFillOver`,rowline:`uejhGG_rowline`,exportLabel:`uejhGG_exportLabel`,ubChipOff:`uejhGG_ubChipOff`,subscriptionFill:`uejhGG_subscriptionFill`,plgGrid:`uejhGG_plgGrid`,heroMeta:`uejhGG_heroMeta`,shareDot:`uejhGG_shareDot`,peakCardCenter:`uejhGG_peakCardCenter`,heroBudgetFill:`uejhGG_heroBudgetFill`,metricGrid:`uejhGG_metricGrid`,modelDot:`uejhGG_modelDot`,siteRow:`uejhGG_siteRow`,chartCrosshair:`uejhGG_chartCrosshair`,dashboardModal:`uejhGG_dashboardModal`,providerGroupName:`uejhGG_providerGroupName`,subscriptionMeta:`uejhGG_subscriptionMeta`,roundsBar:`uejhGG_roundsBar`,siteRowCalls:`uejhGG_siteRowCalls`,roundsEmpty:`uejhGG_roundsEmpty`,plgHead:`uejhGG_plgHead`,tokenModelParts:`uejhGG_tokenModelParts`,tokenModelShareRow:`uejhGG_tokenModelShareRow`,budgetOverPulse:`uejhGG_budgetOverPulse`,roundsBarColPeak:`uejhGG_roundsBarColPeak`,peakCount:`uejhGG_peakCount`,ctlCol:`uejhGG_ctlCol`,chartBarPlaceholder:`uejhGG_chartBarPlaceholder`,popModelStatus:`uejhGG_popModelStatus`,healthBadge:`uejhGG_healthBadge`,peakTagSuccess:`uejhGG_peakTagSuccess`,metricCell:`uejhGG_metricCell`,triggerSparkHot:`uejhGG_triggerSparkHot`,trendPanel:`uejhGG_trendPanel`,currencyButton:`uejhGG_currencyButton`,staleNotice:`uejhGG_staleNotice`,ubTagAlert:`uejhGG_ubTagAlert`,bucketCost:`uejhGG_bucketCost`,providerGroupList:`uejhGG_providerGroupList`,ubTagPromo:`uejhGG_ubTagPromo`,tabPanelIn:`uejhGG_tabPanelIn`,floatSubName:`uejhGG_floatSubName`,modelProvider:`uejhGG_modelProvider`,ctlRow:`uejhGG_ctlRow`,popHead:`uejhGG_popHead`,rounds:`uejhGG_rounds`,deltaDown:`uejhGG_deltaDown`,ubTagSuccess:`uejhGG_ubTagSuccess`,subscriptionWindowLabel:`uejhGG_subscriptionWindowLabel`,siteKindUnknown:`uejhGG_siteKindUnknown`,healthBad:`uejhGG_healthBad`,rdoDot:`uejhGG_rdoDot`,estimatedTag:`uejhGG_estimatedTag`,heroBudgetTrack:`uejhGG_heroBudgetTrack`,heatmapYearCell:`uejhGG_heatmapYearCell`,chartEmpty:`uejhGG_chartEmpty`,tokenPanel:`uejhGG_tokenPanel`,rowlineMuted:`uejhGG_rowlineMuted`,dashboard:`uejhGG_dashboard`,ubChipPeak:`uejhGG_ubChipPeak`,reconcileDismiss:`uejhGG_reconcileDismiss`,plgLink:`uejhGG_plgLink`,tokenModelPartOut:`uejhGG_tokenModelPartOut`,subscriptionTrack:`uejhGG_subscriptionTrack`,subscriptionHead:`uejhGG_subscriptionHead`,plgDesc:`uejhGG_plgDesc`,ubTag:`uejhGG_ubTag`,healthOk:`uejhGG_healthOk`,subscriptionPlan:`uejhGG_subscriptionPlan`,triggerPopSwitcher:`uejhGG_triggerPopSwitcher`,modelTableScroll:`uejhGG_modelTableScroll`,peakAlertIn:`uejhGG_peakAlertIn`,ubAlertLeft:`uejhGG_ubAlertLeft`,siteRowName:`uejhGG_siteRowName`,siteKindSite:`uejhGG_siteKindSite`,peakTag:`uejhGG_peakTag`,reconcileIcon:`uejhGG_reconcileIcon`,heroSideItem:`uejhGG_heroSideItem`,shareSegTool:`uejhGG_shareSegTool`,dashboardRight:`uejhGG_dashboardRight`,balanceDetailLabel:`uejhGG_balanceDetailLabel`,headTitleRow:`uejhGG_headTitleRow`,metricValuePrimary:`uejhGG_metricValuePrimary`,subscriptionFillOver:`uejhGG_subscriptionFillOver`,balanceDaysBadgeLow:`uejhGG_balanceDaysBadgeLow`,triggerPopSubscription:`uejhGG_triggerPopSubscription`,roundsBarFlagged:`uejhGG_roundsBarFlagged`,heroReadout:`uejhGG_heroReadout`,plgItem:`uejhGG_plgItem`,peakCardPeak:`uejhGG_peakCardPeak`,floatTarget:`uejhGG_floatTarget`,deltaUp:`uejhGG_deltaUp`,triggerPop:`uejhGG_triggerPop`,peakCard:`uejhGG_peakCard`,switchOn:`uejhGG_switchOn`,healthIdle:`uejhGG_healthIdle`,feeSep:`uejhGG_feeSep`,roundsBars:`uejhGG_roundsBars`,triggerWrap:`uejhGG_triggerWrap`,siteRowTitle:`uejhGG_siteRowTitle`,heroBudget:`uejhGG_heroBudget`,plgName:`uejhGG_plgName`,popTagSub:`uejhGG_popTagSub`,balanceDetailHead:`uejhGG_balanceDetailHead`,setCardMeta:`uejhGG_setCardMeta`,popDotNeutral:`uejhGG_popDotNeutral`,chartBar:`uejhGG_chartBar`,peakCountSuccess:`uejhGG_peakCountSuccess`,heatmapYearScroll:`uejhGG_heatmapYearScroll`,floatModeBtn:`uejhGG_floatModeBtn`,subscriptionStatus:`uejhGG_subscriptionStatus`,roundsBarWrap:`uejhGG_roundsBarWrap`,panelTitle:`uejhGG_panelTitle`,triggerMain:`uejhGG_triggerMain`,healthDot:`uejhGG_healthDot`,subscriptionGrid:`uejhGG_subscriptionGrid`,tokenModelPartIn:`uejhGG_tokenModelPartIn`,popModelName:`uejhGG_popModelName`,siteRowMeta:`uejhGG_siteRowMeta`,subscriptionGoldFlow:`uejhGG_subscriptionGoldFlow`,ubNotesTerm:`uejhGG_ubNotesTerm`,ubPricepair:`uejhGG_ubPricepair`,popTitle:`uejhGG_popTitle`,shareSegOff:`uejhGG_shareSegOff`,unpricedHint:`uejhGG_unpricedHint`,panel:`uejhGG_panel`,shareItem:`uejhGG_shareItem`,heroCurrency:`uejhGG_heroCurrency`,ubStatValue:`uejhGG_ubStatValue`,subscriptionWindow:`uejhGG_subscriptionWindow`,tabNav:`uejhGG_tabNav`,bucketThird:`uejhGG_bucketThird`,ubStatCard:`uejhGG_ubStatCard`,subscriptionTier:`uejhGG_subscriptionTier`,metricLabel:`uejhGG_metricLabel`,heroGaugeArcOver:`uejhGG_heroGaugeArcOver`,shareValue:`uejhGG_shareValue`,ubCardControlGroup:`uejhGG_ubCardControlGroup`,subscriptionReset:`uejhGG_subscriptionReset`,ubModelName:`uejhGG_ubModelName`,roundsBarColOff:`uejhGG_roundsBarColOff`,shareSegPeak:`uejhGG_shareSegPeak`,heatmapLegend:`uejhGG_heatmapLegend`,heatmap:`uejhGG_heatmap`,heatmapYearWeekday:`uejhGG_heatmapYearWeekday`,balanceDaysBadge:`uejhGG_balanceDaysBadge`,feeChipAlert:`uejhGG_feeChipAlert`,ubAlertNote:`uejhGG_ubAlertNote`,popDotDirect:`uejhGG_popDotDirect`,floatSubPlan:`uejhGG_floatSubPlan`,modelName:`uejhGG_modelName`,popModelStatusLow:`uejhGG_popModelStatusLow`,currencyButtonActive:`uejhGG_currencyButtonActive`,tableScroll:`uejhGG_tableScroll`,closeButton:`uejhGG_closeButton`,siteKindDirect:`uejhGG_siteKindDirect`,ubChipLabel:`uejhGG_ubChipLabel`,roundsBarCol:`uejhGG_roundsBarCol`,ubExtraName:`uejhGG_ubExtraName`,heroBudgetLabel:`uejhGG_heroBudgetLabel`,kpiTile:`uejhGG_kpiTile`,providerGroupTitle:`uejhGG_providerGroupTitle`,healthBadgeOk:`uejhGG_healthBadgeOk`,balanceDetailGrid:`uejhGG_balanceDetailGrid`,ubTable:`uejhGG_ubTable`,popDotSub:`uejhGG_popDotSub`,dashboardBody:`uejhGG_dashboardBody`};let w={"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`}},ne={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 re(e){return e===``?e:ne[e]??e}function ie(e){let t=w[re(e)];return t?.type===`code`?t.tier:void 0}let ae=[{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}],T,oe,se,ce,E;function D(e){let t=/:\/\//.test(e)?e:`https://${e}`;try{return new URL(t).origin}catch{return e.trim().toLowerCase().replace(/\/+$/,``)}}function le(e,t){return D(e)===D(t)}function O(e){E=e.length>0?e:void 0}function k(){return E}function ue(e){return R(e)}function A(e,t){let n=de(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 de(e,t){if(E===void 0)return;let n=ue(e),r=L(n),i=e=>ue(e.key)===n||L(e.key)===r;if(t!==void 0){for(let e of E)if(!(e.origin===void 0||e.origin===``)&&i(e)&&le(e.origin,t))return e}for(let e of E)if(!(e.origin!==void 0&&e.origin!==``)&&i(e))return e}function fe(e){if(E===void 0)return;let t=ue(e),n=L(t);return E.find(e=>e.origin!==void 0&&e.origin!==``&&(ue(e.key)===t||L(e.key)===n))}function pe(e){T=typeof e.rate==`number`&&Number.isFinite(e.rate)&&e.rate>0?e.rate:void 0,oe=e.prices,se=e.extraModels}function me(e){ce=e}function he(){return T??6.79}function ge(){return{rate:he(),live:T!==void 0}}let j=.5;function _e(e){return e>=9&&e<12||e>=14&&e<18}function M(e){return e==null||!Number.isFinite(e)?`peak`:ve(e)?`offPeak`:_e((new Date(e).getUTCHours()+8)%24)?`peak`:`offPeak`}function ve(e){let t=new Date(e+8*36e5).getUTCDay();return t===0||t===6}function N(e){let t=new Date(e+8*36e5),n=t.getUTCDay(),r=t.getUTCHours()*36e5+t.getUTCMinutes()*6e4+t.getUTCSeconds()*1e3+t.getUTCMilliseconds();return(n===0?1:2)*864e5-r+9*36e5}let ye=[540,720,840,1080];function be(e){return((e+8*36e5)%864e5+864e5)%864e5}function xe(e){if(ve(e))return{tier:`offPeak`,nextSwitchInMs:N(e)};let t=be(e);for(let n of ye){let r=n*6e4;if(t<r)return{tier:M(e),nextSwitchInMs:r-t}}let n=ye[0]??0;return{tier:M(e),nextSwitchInMs:864e5-t+n*6e4}}function P(e,t){let{nextSwitchInMs:n}=xe(e);if(n>t)return null;let r=e+n;return{entering:M(r),atMs:r}}function Se(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 F=[{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}}],I={"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 L(e){return String(e).toLowerCase().replace(/\([^)]*\)/g,``).replace(/[^a-z0-9]+/g,``)}let Ce=(()=>{let e=new Map,t=(t,n)=>{let r=L(t);r!==``&&!e.has(r)&&e.set(r,n)};for(let e of F)t(e.key,e.key);for(let[e,n]of Object.entries(I))t(e,n);for(let e of ae)t(e.key,e.key);return e})();function R(e){let t=I[e]??e;if(t===e){let t=L(e);if(t!==``){let e=Ce.get(t);if(e!==void 0)return e;let n=(se??[]).find(e=>L(e.key)===t);if(n!==void 0)return n.key}}return t}function we(e){let t=R(e),n=oe?.[t];if(n!==void 0)return n;let r=ae.find(e=>e.key.toLowerCase()===t.toLowerCase());if(r!==void 0)return{input:r.input,cacheHit:r.cacheHit,output:r.output}}function Te(e){let t=R(e),n=F.find(e=>e.key===t),r=se?.find(e=>e.key===t),i=n??(r===void 0?(()=>{let e=F.at(-1);if(e!==void 0)return e;throw Error(`MODEL_CATALOG must not be empty`)})():z(r)),a=A(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=we(t);return o===void 0?i:{...i,price:{currency:`USD`,input:o.input,cacheHit:o.cacheHit,output:o.output}}}function z(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 Ee(e,t){let n=e.endsAtMs!==void 0&&t>=e.endsAtMs;return Number.isFinite(t)&&!n&&e.factor>0&&e.factor<1}function B(e,t){let{promo:n}=e;if(n===void 0||!Ee(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 De(e=Date.now()){let t=[...F.map(t=>B(t,e))],n=new Set(t.map(e=>e.key.toLowerCase())),r=new Set(t.map(e=>L(e.key)));for(let e of ce??[]){let i=e.id.toLowerCase();if((()=>{let t=R(e.id);return F.find(e=>e.key===t)})()!==void 0)continue;let a=L(e.id);if(n.has(i)||a!==``&&r.has(a))continue;let o=(se??[]).find(e=>L(e.key)===a),s;if(o!==void 0)s=z(o),e.name!==void 0&&e.name!==``&&(s={...s,name:e.name});else{let t=we(i);s=t===void 0?{key:R(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=A(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 Oe(e){let t=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return t===``?`#8b95a3`:t}function V(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*he():a}function ke(e,t,n=j,r=Date.now()){let i=B(e,r),a=V(i.price,t,i.price.currency),o=i.price.offPeak===void 0?a:V(i.price.offPeak,t,i.price.currency);return a*n+o*(1-n)}function Ae(e){let t=he();return t>0?e/t:e}function H(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 je(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 Me(e,t,n,r){return r<=0||!Number.isFinite(r)||t===(n===`usd`?`USD`:`CNY`)?e:n===`usd`?e/r:e*r}function U(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 Ne(e){let t=Number(e);return Number.isFinite(t)?`${t.toFixed(1)}%`:`0.0%`}let W={top:18,right:40,bottom:26,left:46};function Pe(e){let[,t,n]=e.split(`-`);return`${Number(t)}/${Number(n)}`}function Fe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}function Ie(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 G={key:`__total__`,name:`总计`,color:``};function Le({data:e,models:t=[],currency:n=`cny`,metric:a=`cost`}){let[o,s]=(0,i.useState)(null),c=e=>H(n===`usd`?Ae(e):e,n),l=e=>a===`tokens`?Fe(e):c(e),u=e=>a===`tokens`?e.tokens??0:e.cost,d=(0,i.useMemo)(()=>{let n=e.length;if(n===0)return null;let r=680-W.left-W.right,i=220-W.top-W.bottom,o=e=>n===1?W.left+r/2:W.left+r*e/(n-1),s=Math.max(...a===`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=>W.top+i-e/s*i,l=Math.max(...e.map(e=>e.calls),1),d=e=>W.top+i-e/l*i,f=r/n,p=Math.min(18,f*.6);return{n,plotW:r,plotH:i,inner:o,yCost:c,yCalls:d,barW:p,bars:e.flatMap((e,n)=>{let r=o(n)-p/2;if(t.length===0||a===`tokens`)return[{date:e.date,model:G,x:r,base:0,value:u(e),topRounded:!0}];let i=null;for(let n of t)(e.byModel?.[n.key]??0)>0&&(i=n.key);let s=0;return t.map(t=>{let n=e.byModel?.[t.key]??0,a={date:e.date,model:t,x:r,base:s,value:n,topRounded:t.key===i};return s+=n,a})}),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,a]);if(d===null)return(0,r.jsx)(`div`,{className:C.chartEmpty,children:`暂无趋势数据`});let{n:f,plotW:p,plotH:m,inner:h,yCost:g,yCalls:_,barW:v,bars:y,costTicks:ee,callsTicks:te,linePath:b}=d,x=o===null?void 0:e[o],S=Ie(f,Math.max(1,Math.ceil(f/8)));return(0,r.jsxs)(`div`,{className:C.chartWrap,children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 680 220`,className:C.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-W.left)/p,r=Math.round(n*(f-1));s(Math.min(Math.max(r,0),f-1))},children:[ee.map((e,t)=>{let n=g(e);return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`line`,{x1:W.left,x2:680-W.right,y1:n,y2:n,className:C.chartGrid}),(0,r.jsx)(`text`,{x:W.left-8,y:n+3,textAnchor:`end`,className:C.chartAxisLabel,children:l(e)})]},`cost-${t}`)}),y.map(t=>{if(t.value>0)return(0,r.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===``?C.chartBar:C.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,r.jsx)(`rect`,{x:t.x,y:g(0)-1,width:v,height:1,rx:0,className:C.chartBarPlaceholder},`${t.date}-${t.model.key}-placeholder`):null}),(0,r.jsx)(`path`,{d:b,fill:`none`,className:C.chartLine}),te.map((e,t)=>{let n=_(e);return(0,r.jsx)(`text`,{x:680-W.right+8,y:n+3,textAnchor:`start`,className:C.chartAxisLabel,children:Fe(e)},`calls-${t}`)}),S.map(t=>{let n=e[t];return n===void 0?null:(0,r.jsx)(`text`,{x:h(t),y:214,textAnchor:`middle`,className:C.chartAxisLabel,children:Pe(n.date)},n.date)}),o!==null&&(0,r.jsx)(`line`,{x1:h(o),x2:h(o),y1:W.top,y2:W.top+m,className:C.chartCrosshair})]}),x!==void 0&&o!==null&&(0,r.jsxs)(`div`,{className:C.chartTooltip,style:{left:`${h(o)/680*100}%`,top:`${g(x.cost)/220*100}%`},children:[(0,r.jsx)(`div`,{className:C.chartTooltipDate,children:x.date}),a!==`tokens`&&t.filter(e=>(x.byModel?.[e.key]??0)>0).map(e=>(0,r.jsxs)(`div`,{className:C.chartTooltipRow,children:[(0,r.jsx)(`span`,{className:C.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,r.jsx)(`strong`,{children:c(x.byModel?.[e.key]??0)})]},e.key)),(0,r.jsxs)(`div`,{className:C.chartTooltipRow,children:[(0,r.jsx)(`span`,{className:C.chartLegendBar}),`总计 `,(0,r.jsx)(`strong`,{children:a===`tokens`?Fe(x.tokens??0):c(x.cost)})]}),(0,r.jsxs)(`div`,{className:C.chartTooltipRow,children:[(0,r.jsx)(`span`,{className:C.chartLegendLine}),`调用 `,(0,r.jsx)(`strong`,{children:x.calls.toLocaleString()})]})]}),t.length>0&&a!==`tokens`&&(0,r.jsxs)(`div`,{className:C.chartLegend,children:[t.map(e=>(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key)),(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartLegendLine}),`调用`]})]})]})}let K={top:14,right:42,bottom:22,left:46};function q(e){let t=Object.keys(e).sort(),n=[];for(let r of t.slice(-48)){let t=e[r];t!==void 0&&n.push({key:r,ttftMs:t.ttftAvg,...t.tpsAvg===void 0?{}:{tps:t.tpsAvg}})}return n}function Re(e){return e.slice(5,13).replace(`T`,` `)}function ze({perf:e,models:t,t:n}){let a=e=>t.find(t=>t.key===e)?.color??`#8b95a3`,o=(0,i.useMemo)(()=>e===void 0?[]:Object.entries(e.byModel).map(([e,n])=>({key:e,name:t.find(t=>t.key===e)?.name??e,color:a(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]),s=(0,i.useMemo)(()=>{let t=e===void 0?[]:q(e.byHour);if(t.length===0)return null;let n=t.length,r=680-K.left-K.right,i=180-K.top-K.bottom,a=e=>n===1?K.left+r/2:K.left+r*e/(n-1),o=Math.max(...t.map(e=>e.ttftMs),1),s=Math.max(...t.map(e=>e.tps??0),1),c=e=>K.top+i-e/o*i,l=e=>K.top+i-e/s*i,u=t.map((e,t)=>`${t===0?`M`:`L`}${a(t)} ${c(e.ttftMs)}`).join(` `),d=t.some(e=>e.tps!==void 0)?t.map((e,t)=>`${t===0?`M`:`L`}${a(t)} ${l(e.tps??0)}`).join(` `):``,f=Math.max(1,Math.ceil(n/8)),p=[];for(let e=0;e<n;e+=f)p.push(e);return n>0&&p[p.length-1]!==n-1&&p.push(n-1),{points:t,n,inner:a,yTtft:c,ttftPath:u,tpsPath:d,indices:p,ttftTicks:[0,.5,1].map(e=>o*e).reverse(),maxTps:s}},[e]);return e===void 0||o.length===0?(0,r.jsx)(`div`,{className:C.chartEmpty,"data-testid":`billing-perf-empty`,children:n(`billing.perfEmpty`)}):(0,r.jsxs)(`div`,{"data-testid":`billing-perf-panel`,children:[(0,r.jsx)(`div`,{className:C.tableScroll,"data-testid":`billing-perf-table`,children:(0,r.jsxs)(`table`,{className:C.modelTable,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:n(`billing.model`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfSamples`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfTtft`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfP50`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfP90`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfMax`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfTps`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfLatency`)}),(0,r.jsx)(`th`,{className:C.numCol,children:n(`billing.perfEstimated`)})]})}),(0,r.jsx)(`tbody`,{children:o.map(e=>(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`td`,{children:(0,r.jsxs)(`span`,{className:C.modelCell,children:[(0,r.jsx)(`span`,{className:C.modelDot,style:{background:e.color}}),(0,r.jsx)(`span`,{className:C.modelName,children:e.name})]})}),(0,r.jsx)(`td`,{className:C.numCol,children:e.samples.toLocaleString()}),(0,r.jsxs)(`td`,{className:C.numCol,children:[e.ttftAvg.toFixed(0),` ms`]}),(0,r.jsxs)(`td`,{className:C.numCol,children:[e.ttftP50.toFixed(0),` ms`]}),(0,r.jsxs)(`td`,{className:C.numCol,children:[e.ttftP90.toFixed(0),` ms`]}),(0,r.jsx)(`td`,{className:C.numCol,children:e.ttftMax===void 0?(0,r.jsx)(`span`,{className:C.na,children:`—`}):(0,r.jsxs)(`span`,{children:[e.ttftMax.toFixed(0),` ms`,e.ttftSpikes!==void 0&&e.ttftSpikes>0?` (${e.ttftSpikes}↑)`:``]})}),(0,r.jsx)(`td`,{className:C.numCol,children:e.tpsAvg===void 0?(0,r.jsx)(`span`,{className:C.na,children:`—`}):`${e.tpsAvg.toFixed(1)}`}),(0,r.jsxs)(`td`,{className:C.numCol,children:[e.latencyAvg.toFixed(0),` ms`]}),(0,r.jsx)(`td`,{className:C.numCol,children:e.estimatedSamples>0?e.estimatedSamples:(0,r.jsx)(`span`,{className:C.na,children:`—`})})]},e.key))})]})}),s!==null&&(0,r.jsxs)(`div`,{className:C.chartWrap,"data-testid":`billing-perf-hour`,children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 680 180`,className:C.chartSvg,role:`img`,"aria-label":`Hourly TTFT and generation speed by model`,children:[s.ttftTicks.map((e,t)=>{let n=s.yTtft(e);return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`line`,{x1:K.left,x2:680-K.right,y1:n,y2:n,className:C.chartGrid}),(0,r.jsx)(`text`,{x:K.left-8,y:n+3,textAnchor:`end`,className:C.chartAxisLabel,children:e.toFixed(0)})]},`ttft-${t}`)}),(0,r.jsx)(`path`,{d:s.ttftPath,fill:`none`,className:C.chartLine}),s.tpsPath!==``&&(0,r.jsx)(`path`,{d:s.tpsPath,fill:`none`,className:C.chartLine,style:{stroke:`var(--dsw-static-amber-500)`,strokeDasharray:`4 4`}}),s.indices.map(e=>{let t=s.points[e];return t===void 0?null:(0,r.jsx)(`text`,{x:s.inner(e),y:174,textAnchor:`middle`,className:C.chartAxisLabel,children:Re(t.key)},t.key)}),(0,r.jsxs)(`text`,{x:680-K.right+8,y:K.top+4,textAnchor:`start`,className:C.chartAxisLabel,children:[n(`billing.perfTpsUnit`),` `,s.maxTps.toFixed(0)]})]}),(0,r.jsxs)(`div`,{className:C.chartLegend,children:[(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartLegendLine}),n(`billing.perfTtft`),` (ms)`]}),(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartLegendLine,style:{background:`var(--dsw-static-amber-500)`}}),n(`billing.perfTps`),` (`,n(`billing.perfTpsUnit`),`)`]})]})]})]})}let Be=`@kenz1117/dsh-ui-usage-billing`,Ve=`kenz1117`;function He({t:e,version:t}){return(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-plugin-info`,children:[(0,r.jsxs)(`div`,{className:C.plgHead,children:[(0,r.jsx)(`span`,{className:C.plgIcon,"aria-hidden":`true`,children:(0,r.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,r.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,r.jsxs)(`div`,{className:C.plgTitle,children:[(0,r.jsxs)(`div`,{className:C.plgNameRow,children:[(0,r.jsx)(`h3`,{className:C.plgName,children:Be}),(0,r.jsx)(`span`,{className:C.plgTag,children:t===void 0?`—`:`v${t}`})]}),(0,r.jsx)(`p`,{className:C.plgDesc,children:`Usage billing dashboard for DeepSeek Harness`})]})]}),(0,r.jsxs)(`div`,{className:C.plgGrid,children:[(0,r.jsxs)(`div`,{className:C.plgItem,children:[(0,r.jsx)(`span`,{className:C.plgLabel,children:e(`billing.pluginAuthor`)}),(0,r.jsxs)(`a`,{className:C.plgLink,href:`https://github.com/${Ve}`,target:`_blank`,rel:`noreferrer`,children:[`KenZ`,` (`,Ve,`)`]})]}),(0,r.jsxs)(`div`,{className:C.plgItem,children:[(0,r.jsx)(`span`,{className:C.plgLabel,children:e(`billing.pluginRepository`)}),(0,r.jsx)(`a`,{className:C.plgLink,href:`https://github.com/kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:`GitHub`})]}),(0,r.jsxs)(`div`,{className:C.plgItem,children:[(0,r.jsx)(`span`,{className:C.plgLabel,children:e(`billing.pluginNpm`)}),(0,r.jsx)(`a`,{className:C.plgLink,href:`https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:Be})]}),(0,r.jsxs)(`div`,{className:C.plgItem,children:[(0,r.jsx)(`span`,{className:C.plgLabel,children:e(`billing.pluginLicense`)}),(0,r.jsx)(`span`,{className:C.plgVal,children:`MIT`})]})]})]})}function J(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 Ue(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},We=`var(--dsw-static-blue-500)`,Ge=`#14b8a6`,Ke=`var(--dsw-static-amber-500)`;function qe(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 Je(e){let{stats:t,trendDays:n,onTrendDays:a,t:o}=e,{byDay:s,byModel:l,total:u}=t,d=(0,i.useMemo)(()=>{let e=[];for(let t=n-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t);let r=J(n.getTime()),i=s[r];e.push({date:r,miss:i?.cacheMiss??0,hit:i?.cacheHit??0,output:i?.output??0,reasoning:i?.reasoning??0})}return e},[s,n]),f=(0,i.useMemo)(()=>{let e=0;return Object.entries(l).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:Te(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}))},[l]),p=(0,i.useMemo)(()=>{let e=u.cacheHit??0,t=u.cacheMiss??0,n=u.input??0,r=u.output??0,i=u.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 d){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}},[u,d]),m=(0,i.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]),h=(0,i.useMemo)(()=>{let e=d.length;if(e===0)return null;let t=680-Y.left-Y.right,n=200-Y.top-Y.bottom,r=Math.max(...d.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}},[d]);return(0,r.jsxs)(`div`,{className:C.tokenPanel,"data-testid":`billing-token-panel`,children:[(0,r.jsxs)(`div`,{className:C.exportBar,role:`group`,"aria-label":o(`billing.tokenExport`),children:[(0,r.jsx)(`span`,{className:C.exportLabel,children:o(`billing.export`)}),(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-token-export-csv`,onClick:()=>{let e=new Blob([qe(d)],{type:`text/csv`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`token-daily-${J()}.csv`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},children:o(`billing.tokenExportCsv`)}),(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-token-export-json`,onClick:()=>{let e=new Blob([JSON.stringify({days:d,models:f,total:u},null,2)],{type:`application/json`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`token-${J()}.json`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},children:o(`billing.exportJson`)})]}),(0,r.jsxs)(`div`,{className:C.kpiGrid,"data-testid":`billing-token-kpis`,children:[(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:o(`billing.tokenCacheHitRate`)}),(0,r.jsxs)(`span`,{className:C.kpiValue,children:[p.cacheHitRate.toFixed(1),`%`]}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[U(p.hit),` / `,U(p.hit+p.miss),(u.cacheWrite??0)>0?` · ${o(`billing.tokenCacheWrite`)} ${U(u.cacheWrite??0)}`:``]})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:o(`billing.tokenReasoningShare`)}),(0,r.jsxs)(`span`,{className:C.kpiValue,children:[p.reasoningPct.toFixed(1),`%`]}),(0,r.jsx)(`span`,{className:C.kpiDetail,children:U(p.reasoning)})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:o(`billing.tokenIo`)}),(0,r.jsx)(`span`,{className:C.kpiValue,children:p.io.toFixed(2)}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[U(p.input),` / `,U(p.output)]})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:o(`billing.tokenPeak`)}),(0,r.jsx)(`span`,{className:C.kpiValue,children:p.peak===void 0?`—`:Ue(p.peak.miss+p.peak.hit+p.peak.output)}),(0,r.jsx)(`span`,{className:C.kpiDetail,children:p.peak?.date??`—`})]})]}),(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-token-daily`,children:[(0,r.jsxs)(`div`,{className:C.panelHead,children:[(0,r.jsx)(`h3`,{className:C.panelTitle,children:o(`billing.tokenDaily`)}),(0,r.jsx)(`span`,{className:C.rangeToggle,role:`group`,"aria-label":o(`billing.tokenDaily`),children:[7,30].map(e=>(0,r.jsx)(`button`,{type:`button`,className:c(C.rangeButton,n===e&&C.rangeButtonActive),"aria-pressed":n===e,onClick:()=>{a(e)},"data-testid":`billing-token-${e}d`,children:o(e===7?`billing.trend7d`:`billing.trend30d`)},e))})]}),h===null?(0,r.jsx)(`div`,{className:C.chartEmpty,children:o(`billing.trendEmpty`)}):(0,r.jsxs)(`div`,{className:C.chartWrap,children:[(0,r.jsxs)(`svg`,{viewBox:`0 0 680 200`,className:C.chartSvg,role:`img`,"aria-label":o(`billing.tokenDaily`),children:[[0,.5,1].map(e=>{let t=h.max*e,n=h.y(t);return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`line`,{x1:Y.left,x2:680-Y.right,y1:n,y2:n,className:C.chartGrid}),(0,r.jsx)(`text`,{x:Y.left-8,y:n+3,textAnchor:`end`,className:C.chartAxisLabel,children:Ue(t)})]},e)}),d.map((e,t)=>{let n=h.inner(t)-h.barW/2,i=h.y(0),a=h.y(e.miss),o=h.y(e.miss+e.hit),s=h.y(e.miss+e.hit+e.output);return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`rect`,{x:n,y:a,width:h.barW,height:i-a,fill:We}),(0,r.jsx)(`rect`,{x:n,y:o,width:h.barW,height:a-o,fill:Ge}),(0,r.jsx)(`rect`,{x:n,y:s,width:h.barW,height:o-s,fill:Ke})]},e.date)}),h.indices.map(e=>{let t=d[e];return t===void 0?null:(0,r.jsx)(`text`,{x:h.inner(e),y:194,textAnchor:`middle`,className:C.chartAxisLabel,children:t.date.slice(5)},t.date)})]}),(0,r.jsxs)(`div`,{className:C.chartLegend,children:[(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartTooltipSwatch,style:{background:We}}),o(`billing.tokenMiss`)]}),(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartTooltipSwatch,style:{background:Ge}}),o(`billing.tokenHit`)]}),(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.chartTooltipSwatch,style:{background:Ke}}),o(`billing.tokenOutput`)]})]})]})]}),(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-token-models`,children:[(0,r.jsx)(`div`,{className:C.panelHead,children:(0,r.jsx)(`h3`,{className:C.panelTitle,children:o(`billing.tokenByModel`)})}),f.length===0?(0,r.jsx)(`div`,{className:C.emptyRow,children:o(`billing.noData`)}):(0,r.jsx)(`div`,{className:C.tableScroll,children:(0,r.jsxs)(`table`,{className:C.modelTable,"data-testid":`billing-token-model-table`,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:o(`billing.model`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.inputTokens`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.outputTokens`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.tokenReasoningShort`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.cacheHitRate`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.tokenTotal`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.tokenShare`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.calls`)})]})}),(0,r.jsx)(`tbody`,{children:f.map(e=>(0,r.jsxs)(`tr`,{"data-testid":`billing-token-model`,children:[(0,r.jsx)(`td`,{children:(0,r.jsx)(`span`,{className:C.modelName,children:e.name})}),(0,r.jsx)(`td`,{className:C.numCol,children:U(e.input)}),(0,r.jsx)(`td`,{className:C.numCol,children:U(e.output)}),(0,r.jsx)(`td`,{className:C.numCol,children:e.reasoning>0?U(e.reasoning):(0,r.jsx)(`span`,{className:C.na,children:`—`})}),(0,r.jsxs)(`td`,{className:C.numCol,children:[e.cacheHitRate.toFixed(1),`%`]}),(0,r.jsx)(`td`,{className:C.numCol,children:U(e.total)}),(0,r.jsx)(`td`,{className:C.numCol,children:(0,r.jsxs)(`span`,{className:C.tokenModelShareRow,children:[(0,r.jsx)(`span`,{className:C.tokenModelBar,children:(0,r.jsxs)(`span`,{className:C.tokenModelParts,style:{width:`${(e.share*100).toFixed(2)}%`},children:[(0,r.jsx)(`span`,{className:C.tokenModelPartIn,style:{width:`${e.total>0?e.input/e.total*100:0}%`}}),(0,r.jsx)(`span`,{className:C.tokenModelPartOut,style:{width:`${e.total>0?e.output/e.total*100:0}%`}})]})}),(e.share*100).toFixed(1),`%`]})}),(0,r.jsx)(`td`,{className:C.numCol,children:e.calls.toLocaleString()})]},e.key))})]})})]}),m.totalCalls>0&&(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-token-tools`,children:[(0,r.jsx)(`div`,{className:C.panelHead,children:(0,r.jsx)(`h3`,{className:C.panelTitle,children:o(`billing.toolRank`)})}),(0,r.jsx)(`div`,{className:C.tableScroll,children:(0,r.jsxs)(`table`,{className:C.modelTable,"data-testid":`billing-tool-table`,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:o(`billing.toolName`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.calls`)}),(0,r.jsx)(`th`,{className:C.numCol,children:o(`billing.tokenShare`)})]})}),(0,r.jsx)(`tbody`,{children:[...m.top,...m.rest].map(([e,t])=>(0,r.jsxs)(`tr`,{"data-testid":`billing-tool-row`,children:[(0,r.jsx)(`td`,{children:(0,r.jsx)(`span`,{className:C.modelName,children:e})}),(0,r.jsx)(`td`,{className:C.numCol,children:t.toLocaleString()}),(0,r.jsxs)(`td`,{className:C.numCol,children:[(t/m.totalCalls*100).toFixed(1),`%`]})]},e))})]})})]})]})}function Ye(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}`}function Xe(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 Ze(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 Qe({rounds:e,flags:t,currency:n,t:a}){let o=(0,i.useMemo)(()=>e.slice(-40),[e]),s=(0,i.useMemo)(()=>new Set(t.map(e=>`${e.sessionId}:${e.turn}`)),[t]),l=(0,i.useMemo)(()=>Math.max(1e-4,...o.map(e=>e.cost)),[o]);if(o.length===0)return(0,r.jsxs)(`div`,{className:C.roundsEmpty,children:[a(`billing.model`),` —`]});let u=e=>H(n===`usd`?Ae(e):e,n);return(0,r.jsxs)(`div`,{className:C.rounds,children:[(0,r.jsx)(`div`,{className:C.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),i=M(e.startedAt)===`peak`;return(0,r.jsxs)(`div`,{className:c(C.roundsBarCol,i?C.roundsBarColPeak:C.roundsBarColOff),children:[(0,r.jsx)(`span`,{className:C.roundsBarLabel,style:{bottom:`${n}%`},children:u(e.cost)}),(0,r.jsx)(`div`,{className:C.roundsBarWrap,children:(0,r.jsx)(`div`,{className:t?C.roundsBarFlagged:C.roundsBar,style:{height:`${n}%`},"data-testid":`round-bar`,title:`${a(`billing.model`)} ${e.model} · ${u(e.cost)} · ${Xe(e.startedAt)}${e.endedAt===void 0?``:` → ${Ye(e.endedAt)} (${Ze(e.endedAt-e.startedAt)})`}`,children:t&&(0,r.jsx)(`span`,{className:C.roundsFlagMark,"aria-hidden":`true`})})})]},`${e.sessionId}:${e.turn}`)})}),(0,r.jsxs)(`div`,{className:C.roundsAxis,children:[(0,r.jsxs)(`span`,{children:[a(`billing.costAbbr`),` `,u(l)]}),(0,r.jsxs)(`span`,{children:[o.length,` 轮`]})]})]})}let $e=[`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)`],X=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Z(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function et(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:Z(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:Z(e),dayNum:e.getDate(),value:0,level:0,placeholder:!0});continue}let d=Z(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 tt(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=Z(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=Z(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 nt({days:e,currency:t,now:n,t:a,range:o=`month`}){let[s,c]=(0,i.useState)(null),l=e=>H(t===`usd`?Ae(e):e,t),u=(0,i.useMemo)(()=>et(e,n??new Date),[e,n]);if(o===`year`){let t=tt(e,n??new Date),i=[],o=-1;return t.forEach((e,t)=>{let n=Number(e[0]?.date.slice(5,7)??0);n!==o&&(i.push({index:t,label:X[n-1]??``}),o=n)}),(0,r.jsxs)(`div`,{className:C.heatmapYear,"data-testid":`heatmap-year`,children:[(0,r.jsxs)(`div`,{className:C.heatmapYearBody,children:[(0,r.jsx)(`div`,{className:C.heatmapYearWeekdays,"aria-hidden":`true`,children:[{label:`Mon`,row:1},{label:`Wed`,row:3},{label:`Fri`,row:5}].map(e=>(0,r.jsx)(`span`,{className:C.heatmapYearWeekday,style:{gridRow:e.row},children:e.label},e.label))}),(0,r.jsxs)(`div`,{className:C.heatmapYearScroll,children:[(0,r.jsx)(`div`,{className:C.heatmapYearMonths,"aria-hidden":`true`,"data-testid":`heatmap-year-months`,children:i.map(e=>(0,r.jsx)(`span`,{className:C.heatmapYearMonth,style:{gridColumn:e.index+1},children:e.label},e.index))}),(0,r.jsx)(`div`,{className:C.heatmapYearGrid,role:`img`,"aria-label":`yearly cost heatmap`,"data-testid":`heatmap-year-grid`,children:t.flat().map(e=>(0,r.jsx)(`button`,{type:`button`,className:C.heatmapYearCell,"data-testid":`heatmap-year-cell`,"data-level":e.level,style:{background:$e[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`},e.date))})]})]}),(0,r.jsxs)(`div`,{className:C.heatmapFooter,children:[(0,r.jsx)(`span`,{className:C.heatmapLegendText,children:a(`billing.heatmapLess`)}),(0,r.jsx)(`span`,{className:C.heatmapLegend,children:$e.map((e,t)=>(0,r.jsx)(`i`,{style:{background:e}},t))}),(0,r.jsx)(`span`,{className:C.heatmapLegendText,children:a(`billing.heatmapMore`)})]})]})}return(0,r.jsxs)(`div`,{className:C.heatmap,children:[(0,r.jsx)(`div`,{className:C.heatmapGrid,role:`img`,"aria-label":`daily cost heatmap`,children:u.map(e=>e.map(e=>e.placeholder?(0,r.jsx)(`div`,{className:C.heatmapCellEmpty,children:e.dayNum},e.date):(0,r.jsx)(`button`,{type:`button`,className:C.heatmapCell,"data-testid":`heatmap-cell`,"data-level":e.level,style:{background:$e[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,r.jsxs)(`div`,{className:C.heatmapFooter,children:[(0,r.jsx)(`span`,{className:C.heatmapLegendText,children:a(`billing.heatmapLess`)}),(0,r.jsx)(`span`,{className:C.heatmapLegend,children:$e.map((e,t)=>(0,r.jsx)(`i`,{style:{background:e}},t))}),(0,r.jsx)(`span`,{className:C.heatmapLegendText,children:a(`billing.heatmapMore`)}),s!==null&&(0,r.jsxs)(`span`,{className:C.heatmapHover,"data-testid":`heatmap-hover`,children:[s.date,` · `,l(s.value)]})]})]})}let rt={window:6,threshold:2,reasonFactor:1.8,reasonHitDropPp:15};function it(e){if(e.length===0)return null;let t=0;for(let n of e)t+=n;return t/e.length}function at(e){let t=e.cacheHit+e.cacheMiss;return t<=0?null:e.cacheHit/t*100}function ot(e,t){let n=t?.window??rt.window,r=t?.threshold??rt.threshold,i=t?.reasonFactor??rt.reasonFactor,a=t?.reasonHitDropPp??rt.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=at(t),p=it(s),m=[];if(p!==null&&p>0&&t.cost>p*r){let n=it(c),r=it(l),s=it(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 st(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function ct(e){return/^[=+\-@\t\r]/.test(e)?`'${e}`:e}function lt(e){return e.toFixed(2)}function ut(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,lt(n.cost)].join(`,`)})].join(`
3
+ `)}function dt(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[st(ct(n)),r,t.calls,lt(t.cost)].join(`,`)})].join(`
4
+ `)}function ft(e){return e===void 0?``:e.split(/[\\/]/).filter(Boolean).pop()??e}function pt(e){return[`session_id,title,project,calls,cost_cny,last_active`,...e.map(e=>[st(ct(e.id)),st(ct(e.title??``)),st(ct(ft(e.cwd))),e.calls,lt(e.cost),e.lastActive>0?new Date(e.lastActive).toISOString():``].join(`,`))].join(`
5
+ `)}function mt(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 ht(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 gt=`usageBilling`,_t={"billing.title":`使用统计`,"billing.subtitle":`计费仪表盘`,"billing.cost":`费用`,"billing.todayCost":`今日费用`,"billing.monthCost":`本月费用`,"billing.yearCost":`本年费用`,"billing.monthProjected":`本月预计`,"billing.liveTurn":`本轮`,"billing.liveSession":`会话`,"billing.totalCost":`总费用`,"billing.calls":`调用`,"billing.cacheHitRate":`缓存命中率`,"billing.tokens":`Token`,"billing.inputTokens":`输入`,"billing.outputTokens":`输出`,"billing.avgCost":`平均成本`,"billing.trend":`每日费用与调用趋势`,"billing.trend7d":`7 天`,"billing.trend30d":`30 天`,"billing.trendMetric":`趋势指标`,"billing.trendMetricCost":`费用`,"billing.trendMetricTokens":`Token`,"billing.trendEmpty":`暂无趋势数据`,"billing.budget":`本月预算`,"billing.budgetAmount":`预算金额`,"billing.budgetSummary":`本月已用 {used} / {total};达到 80% 时提醒,达到 100% 时红色脉冲警示`,"billing.sessions":`会话明细`,"billing.sessionTitle":`标题`,"billing.project":`项目`,"billing.lastActive":`最后活跃`,"billing.sessionOverflow":`仅显示花费前 {limit} 个,共 {total} 个会话`,"billing.budgetTierBody":`本月花费 {cost} 已达预算 {budget} 的 {pct}%`,"billing.models":`模型计费明细`,"billing.providerBilling":`厂商计费与订阅`,"billing.estimated":`估算`,"billing.actual":`实际`,"billing.pricing":`模型单价表`,"billing.showPricing":`查看模型单价`,"billing.hidePricing":`收起单价表`,"billing.pricePerM":`¥ / 1M tokens`,"billing.input":`输入`,"billing.output":`输出`,"billing.cacheHit":`缓存命中`,"billing.peak":`高峰`,"billing.offPeak":`低谷`,"billing.flat":`全天统一`,"billing.peakHours":`高峰时段`,"billing.band":`时段`,"billing.openDashboard":`打开计费仪表盘`,"billing.close":`关闭`,"billing.footer":`每 30s 自动轮询 · 仅统计本机 dsh 会话`,"billing.footerCredit":`dsh-ui-usage-billing {version} · MIT`,"billing.lastUpdated":`数据更新于`,"billing.noData":`暂无计费数据`,"billing.todayRate":`今日汇率`,"billing.rateLive":`实时`,"billing.rateBuiltin":`内置`,"billing.promoBadge":`限时折扣`,"billing.promoUntil":`促销价至 {date},之后自动恢复刊例价`,"billing.promoOpenEnded":`厂商未公布截止时间,当前按折扣计价;公告截止后自动恢复刊例价`,"billing.pricingTip":`DeepSeek 模型自北京时间 2026-08-23(周日)00:00 起:工作日高峰 9-12 / 14-18(×2),周末(周六 / 周日)全天低谷价;双价单元格按峰 / 谷展示,费用按调用时刻计。`,"billing.pricingUnit":`单位:人民币 / 每百万 Token`,"billing.pricingNotes":`计价说明`,"billing.ubPeak":`峰`,"billing.ubOff":`谷`,"billing.ubStd":`标准`,"billing.peakBand":`峰谷分带`,"billing.pricingSource":`数据来源`,"billing.noteCache":`命中部分按缓存价计费,显著降低成本。`,"billing.noteBand":`高峰与空闲时段单价不同,空闲约半价。`,"billing.noteSource":`价格来自实时汇率 + 模型定价目录,未收录模型按 0 计并提示。`,"billing.balance":`余额`,"billing.balanceUnconfigured":`未配置`,"billing.balanceUnauthorized":`密钥无效`,"billing.balanceUnreachable":`查询失败`,"billing.uncatalogued":`未收录`,"billing.estimatedPricing":`估算价`,"billing.balanceDays":`约可撑 {days} 天`,"billing.balanceLowBody":`{name} 余额 {balance},约可撑 {days} 天,请及时充值`,"billing.reconcileDrift":`系统监控到{provider}官方余额变动 {spent},本面板记录 {today},差额通常由其它工具或 API 的消耗所致`,"billing.reconcileDismiss":`知道了`,"billing.subscriptions":`订阅套餐`,"billing.subscriptionNotConfigured":`未配置密钥`,"billing.subscriptionUnauthorized":`密钥无效`,"billing.subscriptionUnavailable":`查询失败`,"billing.subscriptionInvalid":`响应异常`,"billing.subscriptionRateLimited":`触发限流`,"billing.subscriptionSession":`本次`,"billing.subscriptionWeekly":`本周`,"billing.subscriptionMonthly":`本月`,"billing.subscriptionBilling":`计费周期`,"billing.subscriptionRemaining":`剩余 {pct}%`,"billing.subscriptionExhausted":`已用尽`,"billing.subscriptionReset":`{date} 重置`,"billing.subscriptionNoApi":`该厂商暂未提供用量查询接口`,"billing.floatWindow":`模型用量悬浮窗`,"billing.floatModeCombined":`综合`,"billing.floatModeSubscription":`订阅卡`,"billing.floatMode":`展示模式`,"billing.floatTargets":`订阅目标`,"billing.floatWindowHint":`悬浮在左下角计费卡上的用量速览;综合=当前样式,订阅卡=每次展示一张订阅额度卡(可切换)。`,"billing.cardDisplay":`计费卡显示`,"billing.cardDisplayHint":`切换左下角计费卡的主指标:花费金额或 Token 消耗(副行与迷你柱同步切换,悬浮窗不受影响)。`,"billing.cardMetric":`主指标`,"billing.cardMetricMoney":`花费金额`,"billing.cardMetricTokens":`Token 消耗`,"billing.floatNoTargets":`未指定订阅通道,请在设置中勾选要展示的订阅。`,"billing.floatNoTargetsHint":`暂无可选的订阅通道。`,"billing.floatPrev":`上一张订阅`,"billing.floatNext":`下一张订阅`,"billing.subscriptionsStale":`订阅额度刷新失败,以下为缓存数据`,"billing.staleLedgerNotice":`{count} 个会话出自旧版算法存档(日志已删,无法重算),模型归属可能有误差`,"billing.tokenCacheWrite":`写入`,"billing.toolRank":`工具排行`,"billing.toolName":`工具`,"billing.userPrices":`自定义单价`,"billing.userPricesHint":`为未收录或变价模型填入实付单价,总览与日趋势按此重估;模型可用下拉候选(目录键或模型 id);来源留空=该模型默认价,填入中转站域名=仅该来源的同名模型用此价(协议可省);低谷价三栏填后按峰/谷混合估算,留空=平档`,"billing.userPriceSave":`保存`,"billing.userPriceModel":`模型`,"billing.userPriceSource":`来源(中转站域名)`,"billing.userPriceSourceHint":`留空=默认价,或 https://api.中转站.com`,"billing.userPriceOffPeak":`低谷价`,"billing.userPriceCurrency":`币种`,"billing.userPriceAdd":`新增`,"billing.userPriceRemove":`删除`,"billing.sessionStaleBadge":`旧版统计`,"billing.heatmapLess":`少`,"billing.heatmapMore":`多`,"billing.currency":`币种`,"billing.currencyCny":`人民币`,"billing.currencyUsd":`美元`,"billing.heatmap":`用量热力图`,"billing.rounds":`每轮费用`,"billing.roundsHint":`最近 {count} 轮 · 柱顶为金额 · 底色为峰谷时段`,"billing.anomaly":`成本突增`,"billing.workspaces":`工作区统计`,"billing.workspacesHint":`点击行下钻项目成本前 5 会话`,"billing.plan":`套餐`,"billing.remaining":`剩余`,"billing.unknownModel":`未定价`,"billing.model":`模型`,"billing.thModel":`模型名称`,"billing.thInputMiss":`输入缓存未命中`,"billing.thInputHit":`输入缓存命中`,"billing.currentRound":`当前`,"billing.costAbbr":`费用`,"billing.tabOverview":`概览`,"billing.tabTrends":`趋势`,"billing.tabProviders":`账单`,"billing.tabDetails":`统计`,"billing.tabPricing":`费率`,"billing.tabSettings":`设置`,"billing.settingsHead":`偏好设置`,"billing.settingsHint":`管理与计费相关的偏好`,"billing.budgetHint":`设置月度上限,用于本月预计与超支分段提醒`,"billing.peakAlertHint":`在切档前弹窗提醒,可选同步系统通知`,"billing.peakAlertDescPeak":`即将进入高峰时段,价格将上调,请提前安排长任务`,"billing.peakAlertDescOff":`即将进入平价时段,价格减半,适合运行大批量任务`,"billing.export":`导出`,"billing.exportCsvDay":`按日 CSV`,"billing.exportCsvSession":`按会话 CSV`,"billing.exportJson":`全量 JSON`,"billing.peakShare":`峰谷时段占比`,"billing.peakSharePerCall":`按调用时刻精确判档`,"billing.offPeakSavings":`挪谷可省约 {amount}`,"billing.perfMax":`最大 TTFT`,"billing.weekCost":`本周`,"billing.roleCost":`费用构成`,"billing.roleUser":`用户输入`,"billing.roleAssistant":`助手输出`,"billing.roleTool":`工具结果`,"billing.roleHint":`估算:输出按实测计价,输入按消息长度摊分`,"billing.tierPeak":`峰时`,"billing.tierOff":`平价`,"billing.tierToPeak":`后转峰时`,"billing.tierToOff":`后转平价`,"billing.tierAlertEnterPeak":`{minutes} 分钟后进入峰时(DeepSeek 高峰价 ×2),不急的调用可稍等`,"billing.tierAlertEnterOff":`{minutes} 分钟后进入平价(价格减半)`,"billing.peakAlertTitlePeak":`即将进入高峰价`,"billing.peakAlertTitleOff":`即将进入平价`,"billing.peakAlert":`峰谷切换提醒`,"billing.peakAlertLeadMin":`提前量(分钟)`,"billing.peakAlertPos":`位置`,"billing.peakAlertMode":`提醒模式`,"billing.peakAlertPosCorner":`右下角`,"billing.peakAlertPosCenter":`屏幕居中`,"billing.peakAlertModePeak":`仅进入峰时`,"billing.peakAlertModeOff":`仅进入平价`,"billing.peakAlertModeBoth":`峰与谷都提醒`,"billing.peakAlertWebNotify":`同时发系统通知`,"billing.peakAlertPreview":`预览提醒`,"billing.planTypeCode":`订阅制`,"billing.planTypeToken":`按量`,"billing.subscriptionFeePerMonth":`{amount}/月`,"billing.triggerToday":`今日`,"billing.triggerMonth":`当月`,"billing.triggerMonthTokens":`当月 Token`,"billing.subscriptionIncluded":`订阅包含`,"billing.free":`免费`,"billing.official":`官方`,"billing.thirdParty":`三方`,"billing.officialCost":`官方费用`,"billing.thirdPartyCost":`三方费用`,"billing.perfSamples":`样本`,"billing.perfTtft":`首字延时`,"billing.perfP50":`P50`,"billing.perfP90":`P90`,"billing.perfTps":`生成速度`,"billing.perfLatency":`总延迟`,"billing.perfEstimated":`估算样本`,"billing.perfEmpty":`暂无性能数据`,"billing.perfTpsUnit":`tok/s`,"billing.perfTitle":`性能`,"billing.perfHint":`按模型与按小时聚合;估算样本为工具续写步骤`,"billing.heatmapYear":`年`,"billing.heatmapMonth":`月`,"billing.activeDays":`活跃天数`,"billing.streakDays":`连续使用`,"billing.subscriptionAutoDetect":`自动识别`,"billing.pluginInfo":`插件信息`,"billing.pluginName":`插件名`,"billing.pluginDescription":`描述`,"billing.pluginVersion":`版本`,"billing.pluginAuthor":`作者`,"billing.pluginRepository":`仓库`,"billing.pluginNpm":`npm`,"billing.pluginLicense":`许可证`,"billing.tabToken":`用量`,"billing.tokenExport":`导出 Token`,"billing.tokenExportCsv":`按日 Token CSV`,"billing.tokenCacheHitRate":`缓存命中率`,"billing.tokenReasoningShare":`思考占比`,"billing.tokenReasoningShort":`思考`,"billing.tokenIo":`输入/输出比`,"billing.tokenPeak":`峰值日`,"billing.tokenDaily":`每日 Token`,"billing.tokenByModel":`模型 Token`,"billing.tokenMiss":`输入(缓存未命中)`,"billing.tokenHit":`输入(缓存命中)`,"billing.tokenOutput":`输出`,"billing.tokenTotal":`总 Token`,"billing.tokenShare":`占比`,"billing.usageStatsTool":`注入用量查询工具`,"billing.usageStatsToolHint":`让模型可在对话中查询用量/费用;会占用模型每次请求的上下文,coding 场景建议关闭(改后需重载应用生效)`,"billing.balanceGranted":`赠金余额`,"billing.balanceTopped":`充值余额`,"billing.balanceDaily":`日均消耗`,"billing.balanceDaysLong":`约可撑`,"billing.balanceDaysUnit":`天`,"billing.popTodayModel":`主力消耗模型余额`,"billing.popTitle":`用量速览`,"billing.popNoConsumption":`暂无消耗`,"billing.popQuotaAlert":`额度提醒`,"billing.popRiskNone":`余额与配额正常`,"billing.popDirectLead":`直联`,"billing.popSubLead":`订阅`,"billing.popBalanceNormal":`余额正常`,"billing.popBalanceLow":`余额不足`,"billing.popQuotaNormal":`配额正常`,"billing.popQuotaLow":`配额将尽`,"billing.alertBalanceLow":`{name} 余额不足`,"billing.alertQuotaLow":`{name} 配额将尽`,"billing.unpricedHint":`{count} 个模型未收录计价,费用已按 0 计`,"billing.searchEstimateHint":`含 {count} 次联网搜索请求的估算费用(每次约 {each};日志无用量事件,按次估算,可在配置 searchCallEstimateCny 调整或关闭)`,"billing.siteListDisplay":`中转站列表`,"billing.siteListDisplayHint":`隐藏「未知路由 / 未识别」占位条目,净化中转站分布与额度列表`,"billing.exportCsvSite":`按站点 CSV`,"billing.panelRelay":`中转站分布`,"billing.relaySite":`中转站`,"billing.relayDirect":`直连`,"billing.relayUnknown":`未知路由`,"billing.panelRelayQuota":`中转站额度`,"billing.relayBalance":`余额`,"billing.relayNoQuota":`未读出额度`,"billing.relayWindowUsed":`已用`,"billing.relayKindNewApi":`New API`,"billing.relayKindSub2Api":`Sub2API`,"billing.relayKindUnknown":`未识别`,"billing.relayCalls":`调用`},vt={"billing.title":`Usage`,"billing.subtitle":`Billing dashboard`,"billing.cost":`Cost`,"billing.todayCost":`Today`,"billing.monthCost":`This month`,"billing.yearCost":`This year`,"billing.monthProjected":`Projected`,"billing.liveTurn":`Turn`,"billing.liveSession":`Session`,"billing.totalCost":`Total`,"billing.calls":`Calls`,"billing.cacheHitRate":`Cache Hit`,"billing.tokens":`Tokens`,"billing.inputTokens":`Input`,"billing.outputTokens":`Output`,"billing.avgCost":`Avg cost`,"billing.trend":`Daily cost & calls`,"billing.trend7d":`7D`,"billing.trend30d":`30D`,"billing.trendMetric":`Trend metric`,"billing.trendMetricCost":`Cost`,"billing.trendMetricTokens":`Tokens`,"billing.trendEmpty":`No trend data yet`,"billing.budget":`Monthly budget`,"billing.budgetAmount":`Budget amount`,"billing.budgetSummary":`Used {used} / {total} this month; warn at 80%, pulse red at 100%`,"billing.sessions":`Sessions`,"billing.sessionTitle":`Title`,"billing.project":`Project`,"billing.lastActive":`Last active`,"billing.sessionOverflow":`Top {limit} of {total} sessions by cost`,"billing.budgetTierBody":`This month {cost} reached {pct}% of the budget {budget}`,"billing.models":`Model billing`,"billing.providerBilling":`Provider billing & subscriptions`,"billing.estimated":`Est.`,"billing.actual":`Actual`,"billing.pricing":`Model pricing`,"billing.showPricing":`View pricing`,"billing.hidePricing":`Hide pricing`,"billing.pricePerM":`¥ / 1M tokens`,"billing.input":`Input`,"billing.output":`Output`,"billing.cacheHit":`Cache hit`,"billing.peak":`Peak`,"billing.offPeak":`Off-peak`,"billing.flat":`Flat`,"billing.peakHours":`Peak hours`,"billing.band":`Band`,"billing.openDashboard":`Open billing dashboard`,"billing.close":`Close`,"billing.footer":`Polls every 30s · local dsh sessions only`,"billing.footerCredit":`dsh-ui-usage-billing {version} · MIT`,"billing.lastUpdated":`Updated`,"billing.noData":`No billing data yet`,"billing.todayRate":`Today rate`,"billing.rateLive":`Live`,"billing.rateBuiltin":`Built-in`,"billing.promoBadge":`Promo`,"billing.promoUntil":`Promo price until {date}, then list price resumes automatically`,"billing.promoOpenEnded":`End date not announced; billed at the discounted rate until further notice, then list price resumes`,"billing.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.`,"billing.pricingUnit":`Unit: CNY / per 1M tokens`,"billing.pricingNotes":`Pricing notes`,"billing.ubPeak":`Peak`,"billing.ubOff":`Off`,"billing.ubStd":`Std`,"billing.peakBand":`Peak/off-peak band`,"billing.pricingSource":`Data source`,"billing.noteCache":`Cache hits are billed at the cache rate, cutting cost.`,"billing.noteBand":`Peak and off-peak prices differ; off-peak is roughly half price.`,"billing.noteSource":`Prices come from the live rate + model catalog; unlisted models count as 0 and are flagged.`,"billing.balance":`Balance`,"billing.balanceUnconfigured":`Not set`,"billing.balanceUnauthorized":`Bad key`,"billing.balanceUnreachable":`Unavailable`,"billing.uncatalogued":`Not catalogued`,"billing.estimatedPricing":`Estimated`,"billing.balanceDays":`~{days} days left`,"billing.balanceLowBody":`{name} balance {balance}, ~{days} days left, please top up`,"billing.reconcileDrift":`Detected {provider} official balance moved {spent}, this panel recorded {today}; the gap usually comes from other tools or APIs consuming too`,"billing.reconcileDismiss":`Got it`,"billing.subscriptions":`Subscriptions`,"billing.subscriptionNotConfigured":`Key not set`,"billing.subscriptionUnauthorized":`Bad key`,"billing.subscriptionUnavailable":`Unavailable`,"billing.subscriptionInvalid":`Bad response`,"billing.subscriptionRateLimited":`Rate limited`,"billing.subscriptionSession":`Current`,"billing.subscriptionWeekly":`Weekly`,"billing.subscriptionMonthly":`Monthly`,"billing.subscriptionBilling":`Billing`,"billing.subscriptionRemaining":`{pct}% left`,"billing.subscriptionExhausted":`Exhausted`,"billing.subscriptionReset":`Resets {date}`,"billing.subscriptionNoApi":`Provider does not offer a usage API`,"billing.floatWindow":`Model usage popover`,"billing.floatModeCombined":`Combined`,"billing.floatModeSubscription":`Subscription card`,"billing.floatMode":`Display mode`,"billing.floatTargets":`Targets`,"billing.floatWindowHint":`Usage summary floating on the footer card; Combined=current style, Subscription cards=one quota card at a time (switchable).`,"billing.cardDisplay":`Billing card display`,"billing.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).`,"billing.cardMetric":`Main metric`,"billing.cardMetricMoney":`Cost`,"billing.cardMetricTokens":`Token usage`,"billing.floatNoTargets":`No subscription selected — pick some in Settings.`,"billing.floatNoTargetsHint":`No subscription channel available.`,"billing.floatPrev":`Previous subscription`,"billing.floatNext":`Next subscription`,"billing.subscriptionsStale":`Subscription refresh failed — showing cached data`,"billing.staleLedgerNotice":`{count} sessions use legacy-algorithm archives (logs deleted); attribution may be off`,"billing.tokenCacheWrite":`written`,"billing.toolRank":`Tool calls`,"billing.toolName":`Tool`,"billing.userPrices":`Custom prices`,"billing.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.`,"billing.userPriceSave":`Save`,"billing.userPriceModel":`Model`,"billing.userPriceSource":`Source (relay origin)`,"billing.userPriceSourceHint":`Empty = default; e.g. https://api.relay.com`,"billing.userPriceOffPeak":`Off-peak price`,"billing.userPriceCurrency":`Currency`,"billing.userPriceAdd":`Add`,"billing.userPriceRemove":`Remove`,"billing.sessionStaleBadge":`legacy`,"billing.heatmapLess":`Less`,"billing.heatmapMore":`More`,"billing.currency":`Currency`,"billing.currencyCny":`CNY`,"billing.currencyUsd":`USD`,"billing.heatmap":`Usage heatmap`,"billing.rounds":`Cost per turn`,"billing.roundsHint":`Last {count} rounds · bar tops show amount · fill = peak/off-peak`,"billing.anomaly":`Cost spike`,"billing.workspaces":`Workspaces`,"billing.workspacesHint":`Click a row to drill into its top-5 sessions`,"billing.plan":`Plan`,"billing.remaining":`Left`,"billing.unknownModel":`Unpriced`,"billing.model":`Model`,"billing.thModel":`Model name`,"billing.thInputMiss":`Input (cache miss)`,"billing.thInputHit":`Input (cache hit)`,"billing.currentRound":`current`,"billing.costAbbr":`cost`,"billing.tabOverview":`Overview`,"billing.tabTrends":`Trends`,"billing.tabProviders":`Bills`,"billing.tabDetails":`Stats`,"billing.tabPricing":`Rates`,"billing.tabSettings":`Settings`,"billing.settingsHead":`Preferences`,"billing.settingsHint":`Manage billing-related preferences`,"billing.budgetHint":`Set a monthly cap for projections and tier alerts`,"billing.peakAlertHint":`Alert before a tier switch, optionally via system notification`,"billing.peakAlertDescPeak":`About to enter peak hours — prices rise, plan long tasks ahead`,"billing.peakAlertDescOff":`About to enter off-peak hours — price halves, ideal for large batches`,"billing.export":`Export`,"billing.exportCsvDay":`Daily CSV`,"billing.exportCsvSession":`Sessions CSV`,"billing.exportJson":`Full JSON`,"billing.peakShare":`Peak vs off-peak`,"billing.peakSharePerCall":`per-call attribution, full history`,"billing.offPeakSavings":`Shift peak to off-peak: save ~{amount}`,"billing.perfMax":`Max TTFT`,"billing.weekCost":`This week`,"billing.roleCost":`Cost breakdown`,"billing.roleUser":`User input`,"billing.roleAssistant":`Assistant output`,"billing.roleTool":`Tool results`,"billing.roleHint":`Estimated: output priced exactly, input split by message size`,"billing.tierPeak":`Peak`,"billing.tierOff":`Off-peak`,"billing.tierToPeak":`until peak`,"billing.tierToOff":`until off-peak`,"billing.tierAlertEnterPeak":`Peak pricing (2x) starts in {minutes} min — non-urgent calls can wait`,"billing.tierAlertEnterOff":`Off-peak pricing (50% off) starts in {minutes} min`,"billing.peakAlertTitlePeak":`Peak pricing incoming`,"billing.peakAlertTitleOff":`Off-peak incoming`,"billing.peakAlert":`Peak/off-peak alert`,"billing.peakAlertLeadMin":`Lead time (min)`,"billing.peakAlertPos":`Position`,"billing.peakAlertMode":`Remind mode`,"billing.peakAlertPosCorner":`Bottom-right`,"billing.peakAlertPosCenter":`Center`,"billing.peakAlertModePeak":`Entering peak only`,"billing.peakAlertModeOff":`Entering off-peak only`,"billing.peakAlertModeBoth":`Both`,"billing.peakAlertWebNotify":`Also send system notification`,"billing.peakAlertPreview":`Preview alert`,"billing.planTypeCode":`Subscription`,"billing.planTypeToken":`Usage`,"billing.subscriptionFeePerMonth":`{amount}/mo`,"billing.triggerToday":`Today`,"billing.triggerMonth":`This month`,"billing.triggerMonthTokens":`Monthly tokens`,"billing.subscriptionIncluded":`Included`,"billing.free":`Free`,"billing.official":`Official`,"billing.thirdParty":`Third-party`,"billing.officialCost":`Official cost`,"billing.thirdPartyCost":`Third-party cost`,"billing.perfSamples":`Samples`,"billing.perfTtft":`TTFT`,"billing.perfP50":`P50`,"billing.perfP90":`P90`,"billing.perfTps":`Speed`,"billing.perfLatency":`Total latency`,"billing.perfEstimated":`Estimated`,"billing.perfEmpty":`No performance data yet`,"billing.perfTpsUnit":`tok/s`,"billing.perfTitle":`Performance`,"billing.perfHint":`Per model & per hour; estimated samples are tool-continuation steps`,"billing.heatmapYear":`Year`,"billing.heatmapMonth":`Month`,"billing.activeDays":`Active days`,"billing.streakDays":`Streak`,"billing.subscriptionAutoDetect":`Auto`,"billing.pluginInfo":`Plugin info`,"billing.pluginName":`Name`,"billing.pluginDescription":`Description`,"billing.pluginVersion":`Version`,"billing.pluginAuthor":`Author`,"billing.pluginRepository":`Repository`,"billing.pluginNpm":`npm`,"billing.pluginLicense":`License`,"billing.tabToken":`Usage`,"billing.tokenExport":`Export tokens`,"billing.tokenExportCsv":`Daily token CSV`,"billing.tokenCacheHitRate":`Cache hit rate`,"billing.tokenReasoningShare":`Reasoning share`,"billing.tokenReasoningShort":`reasoning`,"billing.tokenIo":`In/out ratio`,"billing.tokenPeak":`Peak day`,"billing.tokenDaily":`Daily tokens`,"billing.tokenByModel":`Tokens by model`,"billing.tokenMiss":`Input (cache miss)`,"billing.tokenHit":`Input (cache hit)`,"billing.tokenOutput":`Output`,"billing.tokenTotal":`Total tokens`,"billing.tokenShare":`Share`,"billing.usageStatsTool":`Inject usage-stats tool`,"billing.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)`,"billing.balanceGranted":`Granted`,"billing.balanceTopped":`Topped up`,"billing.balanceDaily":`Daily burn`,"billing.balanceDaysLong":`~days left`,"billing.balanceDaysUnit":`days`,"billing.popTodayModel":`Main model balance`,"billing.popTitle":`Usage overview`,"billing.popNoConsumption":`No usage yet`,"billing.popQuotaAlert":`Quota alerts`,"billing.popRiskNone":`Balances & quotas OK`,"billing.popDirectLead":`Direct`,"billing.popSubLead":`Subscription`,"billing.popBalanceNormal":`balance ok`,"billing.popBalanceLow":`balance low`,"billing.popQuotaNormal":`quota ok`,"billing.popQuotaLow":`quota low`,"billing.alertBalanceLow":`{name} balance low`,"billing.alertQuotaLow":`{name} quota low`,"billing.unpricedHint":`{count} models not priced; their cost counts as 0`,"billing.searchEstimateHint":`Includes estimated cost of {count} web-search requests (~{each} each; no usage events logged, per-call estimate; tune via searchCallEstimateCny)`,"billing.siteListDisplay":`Relay lists`,"billing.siteListDisplayHint":`Hide "unknown route / unidentified" placeholder rows in relay distribution and quota lists`,"billing.exportCsvSite":`By site CSV`,"billing.panelRelay":`Relay sites`,"billing.relaySite":`Relay`,"billing.relayDirect":`Direct`,"billing.relayUnknown":`Unknown route`,"billing.panelRelayQuota":`Relay quota`,"billing.relayBalance":`Balance`,"billing.relayNoQuota":`No quota`,"billing.relayWindowUsed":`used`,"billing.relayKindNewApi":`New API`,"billing.relayKindSub2Api":`Sub2API`,"billing.relayKindUnknown":`Unknown`,"billing.relayCalls":`calls`},yt={"智谱 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 bt(e,t){return t===`en`?yt[e]??e:e}let xt={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.6638 9.91965C35.3251 9.75432 35.1785 10.0703 34.9811 10.2316C34.9131 10.2836 34.8558 10.3516 34.7985 10.413C34.3025 10.9423 33.7238 11.289 32.9678 11.2476C31.8625 11.1863 30.9186 11.533 30.0839 12.3783C29.9066 11.3356 29.3173 10.7143 28.4213 10.3143C27.9519 10.1063 27.4773 9.89965 27.148 9.44766C26.9186 9.12633 26.856 8.76767 26.7413 8.41568C26.668 8.20235 26.5946 7.98502 26.3506 7.94902C26.084 7.90769 25.98 8.13035 25.876 8.31702C25.4587 9.07967 25.2973 9.91965 25.3133 10.7703C25.3493 12.6849 26.1573 14.2102 27.764 15.2942C27.9466 15.4182 27.9933 15.5435 27.9359 15.7249C27.8266 16.0982 27.696 16.4609 27.5813 16.8355C27.508 17.0742 27.3986 17.1248 27.1426 17.0222C26.2777 16.6504 25.4919 16.1164 24.828 15.4489C23.6854 14.3449 22.6534 13.1263 21.3654 12.1716C21.067 11.9511 20.7606 11.7416 20.4468 11.5436C19.1335 10.2676 20.6201 9.21967 20.9641 9.09567C21.3241 8.965 21.0881 8.51968 19.9254 8.52501C18.7628 8.53035 17.6988 8.91834 16.3428 9.43699C16.1413 9.51421 15.934 9.57529 15.7229 9.61966C14.4557 9.38091 13.1598 9.33506 11.8789 9.48366C9.36565 9.76365 7.35902 10.953 5.88305 12.9809C4.10975 15.4182 3.69243 18.1888 4.20308 21.0768C4.74041 24.122 6.29504 26.6433 8.683 28.6139C11.1603 30.6579 14.0122 31.6592 17.2668 31.4672C19.2428 31.3539 21.4441 31.0886 23.9254 28.9873C24.552 29.2993 25.208 29.4233 26.2986 29.5166C27.1386 29.5953 27.9466 29.4766 28.5719 29.3459C29.5519 29.1379 29.4839 28.23 29.1306 28.0646C26.2573 26.726 26.888 27.2713 26.3133 26.83C27.7746 25.102 29.9746 23.3074 30.8359 17.4928C30.9026 17.0302 30.8452 16.7395 30.8359 16.3662C30.8306 16.1395 30.8826 16.0502 31.1426 16.0249C31.8639 15.95 32.5637 15.7349 33.2025 15.3915C35.0638 14.3742 35.8158 12.7049 35.9931 10.7023C36.0198 10.3956 35.9878 10.081 35.6638 9.91965ZM19.4414 27.9433C16.6562 25.754 15.3055 25.0327 14.7482 25.0634C14.2256 25.0954 14.3202 25.6913 14.4349 26.0807C14.5549 26.4647 14.7109 26.7286 14.9295 27.066C15.0815 27.2886 15.1855 27.6206 14.7789 27.87C13.8816 28.4246 12.3229 27.6833 12.2496 27.6473C10.435 26.578 8.91632 25.1673 7.84834 23.2381C6.81637 21.3808 6.21638 19.3888 6.11771 17.2622C6.09105 16.7475 6.24171 16.5662 6.7537 16.4729C7.42583 16.3442 8.11451 16.3267 8.79233 16.4209C11.6349 16.8368 14.0536 18.1075 16.0828 20.1194C17.2402 21.2661 18.1161 22.6354 19.0188 23.974C19.9788 25.3953 21.0108 26.75 22.3254 27.8593C22.7894 28.2486 23.1587 28.5446 23.5134 28.7619C22.4441 28.8819 20.6601 28.9086 19.4414 27.9433ZM20.7748 19.3568C20.7745 19.2906 20.7904 19.2253 20.8211 19.1666C20.8517 19.1078 20.8962 19.0575 20.9507 19.0198C21.0052 18.9821 21.068 18.9583 21.1337 18.9503C21.1995 18.9424 21.2662 18.9505 21.3281 18.9741C21.407 19.0024 21.475 19.0546 21.5228 19.1235C21.5706 19.1923 21.5958 19.2743 21.5947 19.3581C21.5949 19.4123 21.5843 19.4659 21.5636 19.5159C21.5428 19.5659 21.5123 19.6113 21.4738 19.6494C21.4354 19.6875 21.3897 19.7176 21.3395 19.7378C21.2893 19.7581 21.2356 19.7682 21.1814 19.7675C21.1277 19.7676 21.0745 19.7571 21.0248 19.7365C20.9752 19.7158 20.9302 19.6855 20.8925 19.6473C20.8548 19.609 20.825 19.5636 20.805 19.5138C20.785 19.4639 20.7739 19.4105 20.7748 19.3568ZM24.9213 21.4848C24.6547 21.5928 24.3893 21.6861 24.1347 21.6981C23.7516 21.7114 23.3756 21.5918 23.0707 21.3594C22.7054 21.0528 22.4441 20.8821 22.3347 20.3488C22.297 20.0881 22.3042 19.823 22.3561 19.5648C22.4494 19.1288 22.3454 18.8488 22.0374 18.5955C21.7881 18.3875 21.4694 18.3302 21.1201 18.3302C21.0005 18.3232 20.8843 18.2875 20.7814 18.2262C20.6348 18.1542 20.5148 17.9728 20.6294 17.7488C20.6668 17.6768 20.8428 17.5008 20.8854 17.4688C21.3601 17.1995 21.9081 17.2875 22.4134 17.4902C22.8827 17.6822 23.2374 18.0342 23.748 18.5328C24.2694 19.1341 24.364 19.3008 24.6613 19.7515C24.896 20.1048 25.1093 20.4674 25.2547 20.8821C25.344 21.1421 25.2293 21.3541 24.9213 21.4848Z' 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.8377 17.282C33.2127 16.25 33.3072 15.218 33.2127 14.1875C33.1197 13.1571 32.7447 12.1251 32.2752 11.1876C31.4322 9.78209 30.2127 8.6571 28.8072 8.0001C27.3072 7.34461 25.7127 7.15711 24.1197 7.53211C23.3698 6.78212 22.5253 6.12512 21.5878 5.65713C20.6503 5.18913 19.5253 5.00013 18.4948 5.00013C16.8851 4.99074 15.3125 5.48246 13.9948 6.40712C12.6824 7.34311 11.7449 8.6571 11.2754 10.1571C10.1504 10.4376 9.21289 10.9071 8.27539 11.4696C7.4324 12.1251 6.77541 12.9696 6.21291 13.8126C5.36992 15.2195 5.08792 16.8125 5.27542 18.407C5.46399 19.9968 6.11605 21.496 7.1504 22.718C6.79608 23.7086 6.66795 24.7659 6.77541 25.8124C6.86991 26.8444 7.2449 27.8749 7.7129 28.8124C8.55739 30.2194 9.77538 31.3444 11.1824 31.9999C12.6824 32.6569 14.2753 32.8444 15.8698 32.4694C16.6198 33.2194 17.4628 33.8749 18.4003 34.3444C19.3378 34.8139 20.4628 34.9999 21.4948 34.9999C23.1043 35.0097 24.6769 34.5185 25.9947 33.5944C27.3072 32.6569 28.2447 31.3444 28.7127 29.8444C29.7719 29.6432 30.7682 29.1934 31.6197 28.5319C32.4627 27.8749 33.2127 27.1249 33.6822 26.1874C34.5251 24.7819 34.8071 23.1875 34.6196 21.5945C34.4322 20 33.8697 18.5015 32.8377 17.282ZM21.5878 33.0304C20.0878 33.0304 18.9628 32.5609 17.9323 31.7179C17.9323 31.7179 18.0253 31.6234 18.1198 31.6234L24.1197 28.1554C24.2862 28.0803 24.4196 27.9469 24.4947 27.7804C24.5698 27.636 24.6021 27.4731 24.5877 27.3109V18.875L27.1197 20.375V27.3124C27.1455 28.0547 27.0215 28.7945 26.755 29.4878C26.4885 30.181 26.085 30.8134 25.5687 31.3473C25.0523 31.8811 24.4337 32.3054 23.7497 32.5949C23.0658 32.8843 22.3305 33.0314 21.5878 33.0304ZM9.49488 27.8749C8.83789 26.7499 8.55739 25.4374 8.83789 24.125C8.83789 24.125 8.93239 24.2195 9.02539 24.2195L15.0253 27.6874C15.1693 27.7638 15.3325 27.7966 15.4948 27.7819C15.6823 27.7819 15.8698 27.7819 15.9628 27.6874L23.2753 23.4695V26.3749L17.1823 29.9374C16.5506 30.3042 15.8527 30.5427 15.1287 30.6393C14.4046 30.7358 13.6686 30.6884 12.9629 30.4999C11.4629 30.1249 10.2449 29.1874 9.49488 27.8749ZM7.9004 14.8445C8.56239 13.7234 9.58826 12.8627 10.8074 12.4056V19.532C10.8074 19.718 10.8074 19.907 10.9004 20C10.9755 20.1665 11.1089 20.2998 11.2754 20.375L18.5878 24.5944L16.0573 26.0944L10.0574 22.625C9.41842 22.2639 8.85742 21.7797 8.40684 21.2004C7.95627 20.6211 7.62506 19.9582 7.4324 19.25C7.05741 17.8445 7.1504 16.157 7.9004 14.8445ZM28.6197 19.625L21.3073 15.407L23.8377 13.9071L29.8377 17.375C30.7752 17.9375 31.5252 18.6875 31.9947 19.625C32.4642 20.5625 32.7447 21.5945 32.6502 22.7195C32.5603 23.7755 32.1699 24.7837 31.5252 25.6249C30.8697 26.4694 30.0252 27.1249 28.9947 27.4999V20.375C28.9947 20.1875 28.9947 20 28.9002 19.907C28.9002 19.907 28.8072 19.718 28.6197 19.625ZM31.1502 15.875C31.1502 15.875 31.0572 15.782 30.9627 15.782L24.9627 12.3126C24.7752 12.2196 24.6822 12.2196 24.4947 12.2196C24.3072 12.2196 24.1197 12.2196 24.0252 12.3126L16.7128 16.532V13.6251L22.8073 10.0626C23.7448 9.50009 24.7752 9.31259 25.9002 9.31259C26.9322 9.31259 27.9627 9.68759 28.9002 10.3446C29.7447 11.0001 30.4947 11.8446 30.8697 12.7821C31.2447 13.7196 31.3377 14.8445 31.1502 15.875ZM15.4003 21.125L12.8699 19.625V12.5946C12.8699 11.5626 13.1503 10.4376 13.7128 9.59459C14.2753 8.6571 15.1198 8.0001 16.0573 7.53211C17.0127 7.05249 18.0956 6.88812 19.1503 7.06261C20.1823 7.15711 21.2128 7.62511 22.0573 8.2821C22.0573 8.2821 21.9628 8.3751 21.8698 8.3751L15.8698 11.8446C15.7033 11.9197 15.57 12.0531 15.4948 12.2196C15.4003 12.4071 15.4003 12.5001 15.4003 12.6876V21.125ZM16.7128 18.125L19.9948 16.25L23.2753 18.125V21.875L19.9948 23.75L16.7128 21.875V18.125Z' 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 20.034C27.8809 20.5837 20.5808 27.8809 20.0326 37H19.966C19.4163 27.8809 12.1177 20.5837 3 20.034V19.9674C12.1191 19.4163 19.4163 12.1191 19.966 3H20.0326C20.5822 12.1191 27.8809 19.4163 37 19.9674V20.034Z' 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.1312 7.50002L17.4088 11.1913H5.81625L8.5375 7.50002H20.1325H20.1312ZM34.0675 28.81L31.3475 32.5H19.795L22.5125 28.81H34.0675ZM35 7.50002L16.58 32.5H5L23.42 7.50002H35Z' 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.0835 25.1541C19.5821 26.7684 21.1466 28.1292 22.6694 29.2117L21.5103 30.8416C19.8992 29.6963 18.2543 28.2675 16.6802 26.5808C17.1455 26.1486 17.6143 25.6722 18.0835 25.1541ZM9.99365 2.74979C11.7639 1.73255 13.8054 2.24897 15.6479 3.32304C17.52 4.41448 19.4573 6.22477 21.2603 8.33866L19.7378 9.63651C18.0045 7.60434 16.238 5.98161 14.6411 5.05058C13.0147 4.10247 11.8203 4.00682 10.9897 4.48417C10.0366 5.03255 9.41678 6.47496 9.78271 9.17167C9.86549 9.78127 9.99965 10.4345 10.1812 11.1277C11.6144 10.9497 13.0985 10.8513 14.6167 10.8543C17.7104 10.8604 20.4741 11.1506 22.7944 11.6805L22.7964 11.6814C23.2 11.7609 23.5914 11.858 23.9702 11.9656C23.9685 11.9703 23.9661 11.9746 23.9644 11.9793C24.661 12.1766 25.3101 12.3961 25.9067 12.6404C28.6066 13.7462 30.6077 15.4947 30.603 17.8855C30.599 19.9274 29.1314 21.4372 27.2798 22.4959C25.3986 23.5714 22.8625 24.344 20.1304 24.8484L19.7671 22.8807C22.3935 22.3957 24.6819 21.677 26.2866 20.7596C27.9209 19.8251 28.6011 18.8396 28.603 17.8816C28.6051 16.7818 27.6669 15.5237 25.1479 14.492C24.5672 14.2542 23.9208 14.0387 23.2134 13.8465C22.6517 15.1437 22.0035 16.4444 21.2612 17.7244C18.9392 21.7281 16.437 24.776 14.0688 26.6082C11.7614 28.3932 9.24631 29.2529 7.17822 28.0535C5.41209 27.0291 4.83828 25.0026 4.84717 22.8699C4.85632 20.7032 5.45524 18.1208 6.38428 15.5027L8.27002 16.1717C7.37685 18.6887 6.85497 21.0304 6.84717 22.8787C6.83939 24.7607 7.35367 25.8424 8.18213 26.323C9.13349 26.8747 10.6925 26.6915 12.8452 25.0262C13.3191 24.6595 13.8045 24.2295 14.3003 23.742C13.4493 22.6129 12.6395 21.4021 11.897 20.1101C9.59084 16.0976 8.20303 12.4071 7.80029 9.44022C7.40803 6.54936 7.92116 3.94134 9.99365 2.74979ZM14.6128 12.8543C13.3044 12.8518 12.0235 12.9291 10.7827 13.0701C11.4353 14.9013 12.3808 16.9381 13.6313 19.1141C14.2698 20.2249 14.9606 21.2715 15.6841 22.2537C16.9553 20.7654 18.2592 18.9138 19.5308 16.7215C20.1679 15.623 20.7315 14.5102 21.2271 13.4012C19.3246 13.0558 17.1033 12.8592 14.6128 12.8543ZM6.23193 11.8416C6.39799 12.459 6.59817 13.0982 6.83154 13.7566C4.8717 14.2207 3.07218 14.836 1.49854 15.5398L0.682129 13.7137C2.33167 12.9759 4.20224 12.3309 6.23193 11.8416ZM24.8901 3.62675L25.8853 3.70976C25.7206 5.68459 25.2981 7.84221 24.6128 10.0701C24.1572 9.9381 23.6801 9.8164 23.1831 9.71854C23.0101 9.6845 22.8337 9.6559 22.6567 9.62577C23.3278 7.47916 23.7373 5.41176 23.8931 3.54276L24.8901 3.62675Z' 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.8758 9.20865C17.8758 8.59461 17.3777 8.09634 16.7663 8.09634C16.155 8.09634 15.6567 8.59575 15.6567 9.20865V27.6446C15.6567 29.0714 14.4985 30.2324 13.0755 30.2324C11.6523 30.2324 10.4941 29.0714 10.4941 27.6446V15.8167C10.4941 15.2027 9.99591 14.7044 9.38453 14.7044C8.77316 14.7044 8.275 15.2038 8.275 15.8167V20.8301C8.275 22.2567 7.11678 23.4179 5.69364 23.4179C4.2705 23.4179 3.1123 22.2567 3.1123 20.8301V19.0129C3.1123 18.6054 3.44177 18.2752 3.84822 18.2752C4.25467 18.2752 4.58413 18.6054 4.58413 19.0129V20.8301C4.58413 21.4441 5.08227 21.9424 5.69364 21.9424C6.30502 21.9424 6.80317 21.443 6.80317 20.8301V15.8167C6.80317 14.39 7.96139 13.2289 9.38453 13.2289C10.8077 13.2289 11.9659 14.39 11.9659 15.8167V27.6446C11.9659 28.2587 12.4641 28.7569 13.0755 28.7569C13.6868 28.7569 14.1849 28.2575 14.1849 27.6446V20.4123V9.20865C14.1849 7.78194 15.3431 6.62082 16.7663 6.62082C18.1894 6.62082 19.3476 7.78194 19.3476 9.20865V24.4746C19.3476 24.8821 19.0182 25.2123 18.6117 25.2123C18.2053 25.2123 17.8758 24.8821 17.8758 24.4746V9.20865ZM31.531 13.2289C30.1079 13.2289 28.9496 14.39 28.9496 15.8167V25.6969C28.9496 26.311 28.4515 26.8093 27.8401 26.8093C27.2287 26.8093 26.7306 26.3099 26.7306 25.6969V9.20865C26.7306 7.78194 25.5723 6.62082 24.1492 6.62082C22.7261 6.62082 21.5679 7.78194 21.5679 9.20865V30.1383C21.5679 30.7523 21.0697 31.2506 20.4583 31.2506C19.8469 31.2506 19.3488 30.7511 19.3488 30.1383V27.5471C19.3488 27.1396 19.0194 26.8093 18.6129 26.8093C18.2065 26.8093 17.877 27.1396 17.877 27.5471V30.1383C17.877 31.565 19.0352 32.7261 20.4583 32.7261C21.8815 32.7261 23.0397 31.565 23.0397 30.1383V9.20865C23.0397 8.59461 23.5378 8.09634 24.1492 8.09634C24.7605 8.09634 25.2587 8.59575 25.2587 9.20865V25.6969C25.2587 27.1237 26.417 28.2848 27.8401 28.2848C29.2632 28.2848 30.4215 27.1237 30.4215 25.6969V15.8167C30.4215 15.2027 30.9196 14.7044 31.531 14.7044C32.1424 14.7044 32.6405 15.2038 32.6405 15.8167V24.4746C32.6405 24.8821 32.97 25.2123 33.3764 25.2123C33.7829 25.2123 34.1123 24.8821 34.1123 24.4746V15.8167C34.1123 14.39 32.9541 13.2289 31.531 13.2289Z' 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='M37.9998 23.021C33.7998 25.2889 29.5698 27.3649 24.8614 28.3069C23.8114 28.5154 22.6474 28.5154 21.5809 28.3714C20.5639 28.2439 20.0554 27.3484 20.4169 26.4064C20.7619 25.5289 21.2209 24.635 21.8119 23.9C23.0899 22.3025 24.5329 20.849 25.8289 19.268C26.6203 18.2991 27.3335 17.2689 27.9618 16.187C28.4208 15.4205 28.2078 14.4935 27.4038 14.111C26.0584 13.4556 24.6154 12.9936 23.1889 12.4986C23.0239 12.4341 22.7779 12.6096 22.4509 12.7221C22.8604 13.0881 23.1559 13.3596 23.5654 13.727C19.3339 14.447 15.3305 15.467 11.4455 16.874C11.4275 16.9535 11.396 17.0165 11.411 17.0495C11.9855 17.927 11.723 18.5975 10.886 19.1405C10.5611 19.3531 10.2732 19.6176 10.034 19.9235C12.593 20.6735 14.873 20.243 17.0539 18.821C16.9234 18.6305 16.7914 18.455 16.6609 18.263C17.4799 18.407 17.9719 18.854 18.0379 19.556C18.0544 19.7165 17.9569 19.8755 17.9074 20.036C17.7919 19.907 17.6449 19.781 17.5474 19.6355C17.4799 19.5395 17.4634 19.4285 17.4154 19.268C14.8235 20.993 12.035 21.425 8.96751 20.531C8.96751 21.137 8.93451 21.6485 8.98401 22.1435C9.01701 22.574 8.83701 22.766 8.44401 22.9895C7.55752 23.5325 6.63803 24.092 5.90003 24.8105C5.01504 25.6879 5.34354 26.7589 6.54053 27.2059C7.90102 27.7159 9.329 27.7309 10.7555 27.5569C12.4445 27.3484 14.1005 27.0769 15.9394 26.8219C13.79 27.8269 11.6735 28.5319 9.4445 28.8169C7.88452 29.0269 6.32753 29.1379 4.78554 28.6909C2.57156 28.0684 1.58607 26.4394 2.16057 24.251C2.70206 22.2065 4.01455 20.5775 5.42454 19.076C10.133 14.078 16.0864 11.5401 22.9744 11.0286C24.5824 10.9176 26.2069 11.1246 27.7143 11.7951C29.8308 12.7536 30.7173 14.78 29.6838 16.826C29.0118 18.1835 28.0758 19.4285 27.1413 20.6585C26.2234 21.872 25.1899 22.9895 24.2224 24.155C23.9434 24.506 23.6809 24.875 23.4679 25.2724C23.0569 26.0224 23.3359 26.5174 24.2059 26.4394C26.0254 26.2624 27.8808 26.1199 29.6358 25.6729C32.2098 25.0174 34.7193 24.092 37.2618 23.2775C37.5243 23.213 37.7703 23.117 37.9998 23.0225V23.021Z' 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.3598 5.03522C13.6378 5.20577 11.3905 5.78765 9.47432 7.07179C8.10992 7.97471 7.10668 9.14849 6.38435 10.6935C5.59179 12.389 5.24066 14.255 5.09017 17.7262C4.90959 21.6087 5.17043 25.4812 5.75231 27.5378C6.27399 29.4039 7.10668 30.8285 8.38079 32.0223C9.95588 33.487 11.7216 34.2595 14.4604 34.6709C16.9685 35.0421 22.7773 35.0621 25.3154 34.711C28.4054 34.2896 30.3718 33.4168 31.987 31.7414C32.7896 30.9187 33.1608 30.377 33.6824 29.2835C34.4951 27.5679 34.8261 25.7922 34.9867 22.2407C35.107 19.7026 34.9867 16.0909 34.7358 14.4055C34.1439 10.4527 32.4585 7.88441 29.519 6.39962C27.964 5.62713 25.6766 5.17567 22.4963 5.02519C20.0986 4.91483 19.7776 4.91483 17.3598 5.03522ZM21.0617 14.3854C22.386 14.6964 23.0281 15.1378 23.4494 16.0407C23.8808 16.9637 23.951 17.7262 23.951 21.8896V25.8022L22.5264 25.7721L21.0918 25.742L21.0417 21.9297C20.9915 17.7663 20.9714 17.6359 20.3895 17.1844C19.8679 16.7731 19.4264 16.7229 16.5772 16.7129H13.8685L13.8183 21.2275L13.7682 25.742H10.9591L10.929 20.0336C10.909 15.5291 10.939 14.2951 11.0293 14.2349C11.0996 14.1847 13.2365 14.1647 15.7747 14.1847C19.4967 14.2249 20.52 14.265 21.0617 14.3854ZM28.9472 14.3252C29.0174 14.4657 29.0475 25.3708 28.9773 25.722C28.9773 25.7621 28.3252 25.7822 27.5426 25.7721L26.108 25.742L26.0779 20.0838C26.0679 15.9906 26.0879 14.3854 26.1682 14.2951C26.2585 14.1847 26.6096 14.1546 27.5727 14.1546C28.6964 14.1546 28.8669 14.1747 28.9472 14.3252ZM18.9349 22.2307V25.8022L17.4601 25.7721L15.9753 25.742L15.9452 22.331C15.9352 20.455 15.9452 18.8598 15.9753 18.7996C16.0054 18.6993 16.3967 18.6692 17.4802 18.6692H18.9349V22.2307Z' 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.29 5.36L3.148 21.737a.215.215 0 00.203.261h8.29a.214.214 0 00.215-.261L7.7 5.359a.214.214 0 00-.41 0z' fill-opacity='.5'%3E%3C/path%3E%3Cpath clip-rule='evenodd' d='M4.553 16.18l-1.406 5.558a.214.214 0 00.203.261h2.42-4.551a.214.214 0 01-.214-.26l2.275-8.961a.214.214 0 01.409 0l.864 3.402z'%3E%3C/path%3E%3Cpath d='M14.44.15a.214.214 0 00-.41 0L8.366 21.739a.214.214 0 00.214.261H19.9a.214.214 0 00.215-.261L14.44.151z' fill-opacity='.5'%3E%3C/path%3E%3Cpath clip-rule='evenodd' d='M16.694 22h3.207a.215.215 0 00.214-.262l-1.839-6.993 1.164-4.592a.214.214 0 01.411 0l2.951 11.586a.214.214 0 01-.214.261h-5.894z'%3E%3C/path%3E%3Cpath d='M10.278 7.741L6.685 21.736a.214.214 0 00.214.264h7.17a.216.216 0 00.214-.166.216.216 0 000-.098L10.687 7.742a.214.214 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 St(e){return xt[e]}let Ct=`dsh-billing-peak-alert-v1`,wt={enabled:!1,leadMin:2,position:`bottom-right`,webNotify:!0,mode:`both`};function Tt(){try{let e=localStorage.getItem(Ct);if(e===null)return{...wt};let t=JSON.parse(e),n=t.mode===`peak`||t.mode===`offPeak`?t.mode:wt.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))):wt.leadMin,position:r,webNotify:t.webNotify!==!1,mode:n}}catch{return{...wt}}}function Et(e){try{localStorage.setItem(Ct,JSON.stringify(e))}catch{}}function Dt(e,t,n){if(!t.enabled)return null;let r=P(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 Ot({hit:e,config:t,t:n,onDismiss:a}){let[o,s]=(0,i.useState)(()=>Date.now());if((0,i.useEffect)(()=>{let e=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,i.useEffect)(()=>{o>=e.atMs&&a()},[o,e.atMs,a]),o>=e.atMs)return null;let l=Math.max(1,Math.round((e.atMs-o)/6e4)),u=e.entering,d=n(u===`peak`?`billing.tierPeak`:`billing.tierOff`),f=n(u===`peak`?`billing.peakAlertDescPeak`:`billing.peakAlertDescOff`),p=u===`peak`;return(0,r.jsxs)(`div`,{className:c(C.peakCard,p?C.peakCardPeak:C.peakCardOff,t.position===`center`?C.peakCardCenter:C.peakCardCorner),"data-testid":`billing-peak-alert`,role:`alert`,children:[(0,r.jsxs)(`div`,{className:C.peakHead,children:[(0,r.jsxs)(`span`,{className:c(C.peakTag,p?C.peakTagPrimary:C.peakTagSuccess),children:[(0,r.jsx)(`span`,{className:c(C.peakDot,p?C.peakDotPrimary:C.peakDotSuccess),"aria-hidden":`true`}),d]}),(0,r.jsx)(`button`,{type:`button`,className:C.peakClose,onClick:a,"aria-label":n(`billing.close`),children:`×`})]}),(0,r.jsxs)(`div`,{className:c(C.peakCount,p?C.peakCountPrimary:C.peakCountSuccess),children:[l,`min`]}),(0,r.jsx)(`p`,{className:C.peakDesc,children:f})]})}let kt=[{id:`overview`,labelKey:`billing.tabOverview`},{id:`providers`,labelKey:`billing.tabProviders`},{id:`token`,labelKey:`billing.tabToken`},{id:`trends`,labelKey:`billing.tabTrends`},{id:`pricing`,labelKey:`billing.tabPricing`},{id:`settings`,labelKey:`billing.tabSettings`}];function At(e){if(e!==void 0)return e.split(/[\\/]/).filter(Boolean).pop()??e}let jt=[50,80,100],Mt={checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]},Nt={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 Pt(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 Ft(e,t){let n=Q(e),r=Q(t);if(Pt(n,r))return!0;let i=Nt[e];return i!==void 0&&i.some(e=>Pt(Q(e),r))}function It(e){let t=e.trim().toLowerCase(),n=t.replace(/[\s_/-]+/g,``);if(n.length!==0){for(let[e,n]of Object.entries(Nt))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(Nt))for(let r of t){let t=Q(r);if(!(t.length<4)&&n.includes(t))return e}}}let Lt={"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 Rt(e){let t=Lt[e];return t===void 0?It(e)??e:t}function zt(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 Bt(e,t,n){let r=Object.keys(e).filter(e=>e.startsWith(t)),i=new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate(),a=r.length>0?r.reduce((t,n)=>t+(e[n]?.cost??0),0)/r.length:zt(e,n);return a<=0?0:a*i}function Vt(e){let t=k();if(t===void 0||e.byDayModels===void 0)return e;let n=ge().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||L(t.key)===L(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)*j+a(e.offPeak)*(1-j)};for(let[t,n]of Object.entries(e.byDayModels)){let u=0,d={};for(let[i,a]of Object.entries(n)){let n=A(i)??fe(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:A(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 Ht(e){return Object.keys(e).length}function Ut(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 Wt(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 Gt(e,t){return e.checked?e.okProviders.some(e=>Ft(t,e))?C.healthOk:e.badProviders.some(e=>Ft(t,e))?C.healthBad:C.healthIdle:C.healthIdle}function Kt(e,t){switch(e){case`ok`:return``;case`not-configured`:return t(`billing.subscriptionNotConfigured`);case`unauthorized`:return t(`billing.subscriptionUnauthorized`);case`rate-limited`:return t(`billing.subscriptionRateLimited`);case`invalid-response`:return t(`billing.subscriptionInvalid`);default:return t(`billing.subscriptionUnavailable`)}}function qt(e,t){switch(e){case`session`:return t(`billing.subscriptionSession`);case`weekly`:return t(`billing.subscriptionWeekly`);case`monthly`:return t(`billing.subscriptionMonthly`);case`billing`:return t(`billing.subscriptionBilling`)}}function Jt(e,t){return e.startsWith(`site:`)?{name:e.slice(5),kind:`site`}:e.startsWith(`direct:`)?{name:e.slice(7),kind:`direct`}:{name:t(`billing.relayUnknown`),kind:`unknown`}}function Yt(e,t){switch(e){case`site`:return t(`billing.relaySite`);case`direct`:return t(`billing.relayDirect`);default:return t(`billing.relayUnknown`)}}function Xt(e,t){switch(e){case`new-api`:return t(`billing.relayKindNewApi`);case`sub2api`:return t(`billing.relayKindSub2Api`);default:return t(`billing.relayKindUnknown`)}}let Zt={site:C.siteKindSite,direct:C.siteKindDirect,unknown:C.siteKindUnknown},Qt={"new-api":C.siteKindSite,sub2api:C.siteKindDirect,unknown:C.siteKindUnknown},$t=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 en(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}let tn=[`#3b82f6`,`#06b6d4`,`#8b5cf6`,`#f59e0b`,`#10b981`,`#ef4444`,`#ec4899`,`#6366f1`,`#f97316`,`#14b8a6`],nn={total:{calls:0,input:0,output:0,cacheHit:0,cacheMiss:0,cost:0,reasoning:0},byModel:{},byDay:{},byDayModels:{}};async function rn(){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??nn.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.byHour!==null&&typeof r.perf.byHour==`object`?{perf:r.perf}:{},...typeof r.pluginVersion==`string`?{pluginVersion:r.pluginVersion}:{}}}catch{return null}}let an=!1;async function on(e=0){try{let t=await fetch(`/api/billing/pricing`);if(!t.ok){an=!1;return}let n=await t.text(),r=JSON.parse(n);if(typeof r!=`object`||!r||!(`source`in r)){an=!1;return}let i=r;if(i.source===`builtin`&&e<3){if(e===0){if(an)return;an=!0}setTimeout(()=>{on(e+1)},2e3);return}an=!1,pe(i)}catch{an=!1}}async function sn(){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 cn(){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 ln(){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 un(){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 dn(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 fn(e){let{wide:t,t:n,onOpen:a,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,i.useMemo)(()=>p.targets.map(e=>m.find(t=>t.provider===e)).filter(e=>e!==void 0),[p.targets,m]),[ee,te]=(0,i.useState)(0),b=y.length===0?0:Math.min(ee,y.length-1),x=y[b];(0,i.useEffect)(()=>{if(p.mode!==`subscription`||y.length<2)return;let e=setInterval(()=>te(e=>(e+1)%y.length),1500);return()=>clearInterval(e)},[p.mode,y.length]);let S=(0,r.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,r.jsx)(`path`,{d:`M4 7h16v11H4z`}),(0,r.jsx)(`path`,{d:`M4 10h16`}),(0,r.jsx)(`path`,{d:`M8 14h3`})]});if(!t)return(0,r.jsx)(`button`,{type:`button`,className:C.railButton,"data-testid":`billing-rail-button`,onClick:a,title:`${n(`billing.title`)} · ${H(o)}`,children:S});let w=h.metric===`tokens`,ne=u.map(e=>w?e.tokens:e.cost),re=Math.max(...ne,0),ie=ne.map(e=>re>0?4+e/re*12:4);return(0,r.jsxs)(`span`,{className:C.triggerWrap,children:[(0,r.jsxs)(`button`,{type:`button`,className:C.trigger,"data-testid":`billing-trigger`,onClick:a,title:`${n(`billing.title`)} · ${H(o)}`,children:[(0,r.jsx)(`span`,{className:C.triggerIcon,"data-testid":`billing-trigger-icon`,children:S}),(0,r.jsxs)(`span`,{className:C.triggerMain,children:[(0,r.jsxs)(`span`,{className:C.triggerPrimary,children:[(0,r.jsx)(`span`,{className:C.triggerLabel,children:n(w?`billing.triggerMonthTokens`:`billing.triggerMonth`)}),w?(0,r.jsx)(`span`,{className:C.triggerMetric,"data-testid":`billing-trigger-month-tokens`,children:U(g)}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{className:C.triggerYen,"aria-hidden":`true`,children:H(o).charAt(0)}),(0,r.jsx)(`span`,{className:C.triggerMetric,children:H(o).slice(1)})]})]}),(0,r.jsx)(`span`,{className:C.triggerSub,"data-testid":`billing-trigger-today`,children:w?`${n(`billing.triggerToday`)} ${U(_)} · ${n(`billing.weekCost`)} ${U(v)}`:`${n(`billing.triggerToday`)} ${H(s)} · ${n(`billing.weekCost`)} ${H(l)}`})]}),(0,r.jsx)(`span`,{className:C.triggerSpark,"data-testid":`billing-trigger-spark`,"aria-hidden":`true`,children:ie.map((e,t)=>(0,r.jsx)(`span`,{className:t===ie.length-1?C.triggerSparkHot:C.triggerSparkBar,style:{height:`${e}px`}},u[t]?.date??String(t)))})]}),(0,r.jsx)(`span`,{className:c(C.triggerPop,p.mode===`subscription`&&C.triggerPopSubscription),"data-testid":`billing-trigger-pop`,"aria-hidden":`true`,children:p.mode===`subscription`?(0,r.jsx)(r.Fragment,{children:y.length===0?(0,r.jsx)(`span`,{className:C.triggerPopEmpty,children:n(`billing.floatNoTargets`)}):(0,r.jsxs)(r.Fragment,{children:[x!==void 0&&(0,r.jsxs)(`div`,{className:C.floatSub,"data-testid":`billing-float-subscription`,children:[(0,r.jsxs)(`div`,{className:C.floatSubHead,children:[(0,r.jsx)(`span`,{className:C.floatSubName,children:x.displayName}),x.plan!==void 0&&(0,r.jsx)(`span`,{className:C.floatSubPlan,children:x.plan})]}),x.windows.map(e=>(()=>{let t=Math.min(100,Math.max(0,e.usedPercent)),i=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,r.jsxs)(`div`,{className:C.subscriptionWindow,children:[(0,r.jsx)(`span`,{className:C.subscriptionWindowLabel,children:qt(e.kind,n)}),(0,r.jsx)(`span`,{className:C.subscriptionTrack,"aria-hidden":`true`,children:(0,r.jsx)(`span`,{className:c(C.subscriptionFill,t>=100&&C.subscriptionFillOver,t>=80&&t<100&&C.subscriptionFillWarn),style:{width:`${t}%`}})}),(0,r.jsxs)(`span`,{className:C.subscriptionMeta,children:[(0,r.jsx)(`span`,{className:c(C.subscriptionPct,i&&C.subscriptionExhausted),children:i?n(`billing.subscriptionExhausted`):n(`billing.subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,r.jsx)(`span`,{className:C.subscriptionReset,children:n(`billing.subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${en(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]}),y.length>1&&(0,r.jsx)(`span`,{className:C.triggerPopSwitcher,"data-testid":`billing-float-switcher`,children:(0,r.jsxs)(`span`,{className:C.triggerPopSwitchCount,children:[b+1,`/`,y.length]})})]})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{className:C.popHead,children:(0,r.jsx)(`span`,{className:C.popTitle,children:n(`billing.popTitle`)})}),(0,r.jsxs)(`span`,{className:C.metricGrid,children:[(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.monthCost`)}),(0,r.jsx)(`span`,{className:c(C.metricValue,C.metricValuePrimary),children:H(o)})]}),(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.tokenTotal`)}),(0,r.jsx)(`span`,{className:C.metricValue,children:U(f.totalToken)})]}),(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.input`)}),(0,r.jsx)(`span`,{className:C.metricValue,children:U(f.input)})]}),(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.output`)}),(0,r.jsx)(`span`,{className:C.metricValue,children:U(f.output)})]}),(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.cacheHit`)}),(0,r.jsx)(`span`,{className:c(C.metricValue,C.metricValueSuccess),children:U(f.cacheRead)})]}),(0,r.jsxs)(`span`,{className:C.metricCell,children:[(0,r.jsx)(`span`,{className:C.metricLabel,children:n(`billing.calls`)}),(0,r.jsx)(`span`,{className:C.metricValue,children:f.calls.toLocaleString()})]})]}),(0,r.jsxs)(`span`,{className:C.popModel,children:[(0,r.jsx)(`span`,{className:C.popModelLabel,children:n(`billing.popTodayModel`)}),d.direct!==void 0||d.sub!==void 0?(0,r.jsxs)(r.Fragment,{children:[d.direct!==void 0&&(0,r.jsxs)(`span`,{className:C.popModelRow,children:[(0,r.jsx)(`span`,{className:c(C.popDot,C.popDotDirect),"aria-hidden":`true`}),(0,r.jsx)(`span`,{className:C.popTagPrimary,children:n(`billing.popDirectLead`)}),(0,r.jsx)(`span`,{className:C.popModelName,children:d.direct.name}),(0,r.jsx)(`span`,{className:c(C.popModelStatus,d.direct.low&&C.popModelStatusLow),children:d.direct.text})]}),d.sub!==void 0&&(0,r.jsxs)(`span`,{className:C.popModelRow,children:[(0,r.jsx)(`span`,{className:c(C.popDot,C.popDotSub),"aria-hidden":`true`}),(0,r.jsx)(`span`,{className:C.popTagSub,children:n(`billing.popSubLead`)}),(0,r.jsx)(`span`,{className:C.popModelName,children:d.sub.name}),(0,r.jsx)(`span`,{className:c(C.popModelStatus,d.sub.low&&C.popModelStatusLow),children:d.sub.text})]})]}):(0,r.jsxs)(`span`,{className:C.popModelRow,children:[(0,r.jsx)(`span`,{className:c(C.popDot,C.popDotNeutral),"aria-hidden":`true`}),(0,r.jsx)(`span`,{className:C.popModelStatus,children:n(`billing.popNoConsumption`)})]})]})]})})]})}function pn({balance:e,days:t,dailyBurn:n,money:i,t:a,onClose:o}){let s=t=>t===void 0?void 0:e.currency===`USD`?`$${t.toFixed(2)}`:i(t),c=s(e.totalBalance),l=s(e.grantedBalance),u=s(e.toppedUpBalance);return(0,r.jsxs)(`span`,{className:C.balanceDetailPop,"data-testid":`billing-balance-detail-pop`,children:[(0,r.jsxs)(`span`,{className:C.balanceDetailHead,children:[(0,r.jsx)(`span`,{className:C.balanceDetailTitle,children:e.displayName}),(0,r.jsx)(`button`,{type:`button`,className:C.balanceDetailClose,"aria-label":a(`billing.close`),onClick:o,children:`×`})]}),(0,r.jsxs)(`span`,{className:C.balanceDetailGrid,children:[c!==void 0&&(0,r.jsx)(mn,{label:a(`billing.balance`),value:c}),l!==void 0&&(0,r.jsx)(mn,{label:a(`billing.balanceGranted`),value:l}),u!==void 0&&(0,r.jsx)(mn,{label:a(`billing.balanceTopped`),value:u}),(0,r.jsx)(mn,{label:a(`billing.balanceDaily`),value:i(n)}),(0,r.jsx)(mn,{label:a(`billing.balanceDaysLong`),value:`${t} ${a(`billing.balanceDaysUnit`)}`})]})]})}function mn({label:e,value:t}){return(0,r.jsxs)(`span`,{className:C.balanceDetailRow,children:[(0,r.jsx)(`span`,{className:C.balanceDetailLabel,children:e}),(0,r.jsx)(`span`,{className:C.balanceDetailValue,children:t})]})}function hn({userPrices:e,onUserPrices:t,t:n}){let[a,o]=(0,i.useState)(()=>[...e]),s=(e,t)=>o(n=>n.map((n,r)=>r===e?{...n,...t}:n)),l=e=>o(t=>t.filter((t,n)=>n!==e)),u=()=>o(e=>[...e,{key:``,input:0,cacheHit:0,output:0}]),d=e=>{let t=a[e]?.offPeak;return{input:t===void 0?``:String(t.input),cacheHit:t===void 0?``:String(t.cacheHit),output:t===void 0?``:String(t.output)}},f=(e,t,n)=>o(r=>r.map((r,i)=>{if(i!==e)return r;let a={...d(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})),p=()=>t(a.filter(e=>e.key.trim()!==``).map(e=>({...e,key:e.key.trim(),...e.origin===void 0||e.origin.trim()===``?{}:{origin:D(e.origin.trim())}}))),m=De().map(e=>e.key),h=(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})),g=e=>Number.isFinite(e)&&e!==0?String(e):``,_=(e,t,n)=>{let r=Number(n);s(e,{[t]:Number.isFinite(r)&&r>=0?r:0})};return(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-user-prices`,children:[(0,r.jsx)(`div`,{className:C.setCardHead,children:(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:n(`billing.userPrices`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:n(`billing.userPricesHint`)})]})}),(0,r.jsxs)(`div`,{className:C.ctlCol,children:[(0,r.jsx)(`datalist`,{id:`billing-price-model-keys`,children:m.map(e=>(0,r.jsx)(`option`,{value:e},e))}),a.map((e,t)=>(0,r.jsxs)(`div`,{className:C.userPriceRow,"data-testid":`billing-user-price-row`,children:[(0,r.jsxs)(`div`,{className:C.userPriceField,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:n(`billing.userPriceModel`)}),(0,r.jsx)(`input`,{className:C.userPriceInput,"data-testid":`billing-user-price-model`,type:`text`,list:`billing-price-model-keys`,value:e.key,placeholder:`flash`,"aria-label":n(`billing.userPriceModel`),onChange:e=>s(t,{key:e.target.value})})]}),(0,r.jsxs)(`div`,{className:C.userPriceField,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:n(`billing.userPriceSource`)}),(0,r.jsx)(`input`,{className:C.userPriceInput,"data-testid":`billing-user-price-origin`,type:`text`,value:e.origin??``,placeholder:n(`billing.userPriceSourceHint`),"aria-label":n(`billing.userPriceSource`),onChange:e=>s(t,{origin:e.target.value.trim()})})]}),[`input`,`cacheHit`,`output`].map(i=>(0,r.jsxs)(`div`,{className:C.userPriceField,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:n(i===`input`?`billing.tokenMiss`:i===`cacheHit`?`billing.tokenHit`:`billing.tokenOutput`)}),(0,r.jsx)(`input`,{className:C.userPriceInputNum,type:`number`,min:0,step:.01,value:g(e[i]),onChange:e=>_(t,i,e.target.value)})]},i)),(0,r.jsxs)(`div`,{className:C.userPriceField,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:n(`billing.userPriceCurrency`)}),(0,r.jsxs)(`div`,{className:C.ctlGroup,children:[(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,e.currency!==`USD`&&C.floatModeBtnOn),onClick:()=>h(t,`CNY`),children:`CNY`}),(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,e.currency===`USD`&&C.floatModeBtnOn),onClick:()=>h(t,`USD`),children:`USD`})]})]}),(0,r.jsx)(`button`,{type:`button`,className:C.userPriceRemove,"aria-label":n(`billing.userPriceRemove`),onClick:()=>l(t),children:n(`billing.userPriceRemove`)}),(()=>{let e=d(t);return(0,r.jsxs)(`div`,{className:C.userPriceOffPeak,"data-testid":`billing-user-price-offpeak`,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:n(`billing.userPriceOffPeak`)}),[`input`,`cacheHit`,`output`].map(i=>(0,r.jsx)(`input`,{className:C.userPriceInputNum,type:`number`,min:0,step:.01,placeholder:n(i===`input`?`billing.tokenMiss`:i===`cacheHit`?`billing.tokenHit`:`billing.tokenOutput`),"aria-label":`${n(`billing.userPriceOffPeak`)} ${n(i===`input`?`billing.tokenMiss`:i===`cacheHit`?`billing.tokenHit`:`billing.tokenOutput`)}`,value:e[i],onChange:e=>f(t,i,e.target.value)},i))]})})()]},t)),(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-user-price-add`,onClick:u,children:n(`billing.userPriceAdd`)}),(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-user-price-save`,onClick:p,children:n(`billing.userPriceSave`)})]})]})]})}function gn({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:ee,onBudgetAmount:te,peakConfig:b,onPeakConfig:x,onPreviewPeak:S,floatPrefs:w,onFloatPrefs:ne,cardPrefs:re,onCardPrefs:ae,sitePrefs:T,onSitePrefs:oe,quotasStale:se}){let[ce,E]=(0,i.useState)(`cost`),{total:D,byModel:le,byDay:O}=e,[k,ue]=(0,i.useState)(`overview`),[A,de]=(0,i.useState)(7),[fe,pe]=(0,i.useState)(()=>{try{return window.localStorage.getItem(`dsh-billing:reconcile-dismissed`)??``}catch{return``}}),me=()=>{let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`},he=(0,i.useCallback)(()=>{let e=me();pe(e);try{window.localStorage.setItem(`dsh-billing:reconcile-dismissed`,e)}catch{}},[]),[j,_e]=(0,i.useState)(`month`),M=(0,i.useMemo)(()=>f.filter(e=>e.status===`ok`&&e.windows.length>0).map(e=>({id:e.provider,label:e.displayName})),[f]),[ve,N]=(0,i.useState)(),[ye,be]=(0,i.useState)(),[xe,P]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=!0;return un().then(t=>{e&&t!==void 0&&P(t)}),()=>{e=!1}},[]);let Se=(0,i.useCallback)(()=>{let e=!xe;P(e),dn(e).then(t=>{t||P(!e)})},[xe]),F=ge(),I=e=>H(m===`usd`?Ae(e):e,m),L=m===`usd`?`en`:`zh`,Ce=e=>bt(e,L),R=(e,n)=>e===0?t(`billing.free`):je(Me(e,n,m,F.rate),m===`usd`?`USD`:`CNY`),we=(0,i.useMemo)(()=>ot([...g].reverse()),[g]),z={peak:e.byTier?.peak.cost??0,offPeak:e.byTier?.offPeak.cost??0},B=z.peak/2,V=(0,i.useMemo)(()=>{let n=e.byRole;if(n===void 0)return[];let r=n.user+n.assistant+n.tool;return r<=0?[]:[{label:t(`billing.roleUser`),value:n.user,seg:C.shareSegUser},{label:t(`billing.roleAssistant`),value:n.assistant,seg:C.shareSegAssistant},{label:t(`billing.roleTool`),value:n.tool,seg:C.shareSegTool}].map(e=>({...e,pct:e.value/r*100}))},[e.byRole,t]),W=zt(O,$()),Pe=e=>u.find(t=>Q(t.provider)===Q(e)),Fe=e=>e.balance?.error===`unconfigured`&&e.models.length>0&&e.models.every(e=>e.plan),Ie=e=>{if(e===void 0)return(0,r.jsx)(`span`,{className:C.na,children:`—`});if(e.error===`unconfigured`)return t(`billing.balanceUnconfigured`);if(e.error===`unauthorized`)return t(`billing.balanceUnauthorized`);if(e.error===`unreachable`)return t(`billing.balanceUnreachable`);if(e.totalBalance===void 0)return(0,r.jsx)(`span`,{className:C.na,children:`—`});let n=e.currency===`USD`?`$${e.totalBalance.toFixed(2)}`:I(e.totalBalance),i=e.currency===`USD`?e.totalBalance*F.rate:e.totalBalance,a=W>0?Math.floor(i/W):void 0;return(0,r.jsxs)(`span`,{className:C.balanceCell,children:[(0,r.jsx)(`span`,{children:n}),a!==void 0&&a>=0&&(0,r.jsx)(`button`,{type:`button`,className:c(C.balanceDaysBadge,a<=3&&C.balanceDaysBadgeLow),"data-testid":`billing-balance-days-badge`,title:t(`billing.balanceDays`).replace(`{days}`,String(a)),"aria-label":`${e.displayName} ${t(`billing.balanceDays`).replace(`{days}`,String(a))}`,onClick:()=>{N(ve===e.provider?void 0:e.provider)},children:`?`}),ve===e.provider&&(0,r.jsx)(pn,{balance:e,days:a??0,dailyBurn:W,money:I,t,onClose:()=>{N(void 0)}})]})},G=D.cacheHit+D.cacheMiss>0?D.cacheHit/(D.cacheHit+D.cacheMiss)*100:0,K=Object.keys(O).sort(),q=$(),Re=O[q]?.cost??0,Be=q.slice(0,7),Ve=q.slice(0,4),J=K.reduce((e,t)=>e+(t.startsWith(Be)?O[t]?.cost??0:0),0),Ue=K.reduce((e,t)=>e+(t.startsWith(Ve)?O[t]?.cost??0:0),0),Y=(0,i.useMemo)(()=>Bt(O,Be,q)+f.reduce((e,t)=>e+(t.planType===`code`?t.subscriptionAmount??0:0),0),[O,Be,q,f]),We=(0,i.useMemo)(()=>{let e=v&&y>0?J/y*100:NaN;return{pct:Number.isFinite(e)?Math.max(0,Math.min(100,e)):Ue>0?Math.max(0,Math.min(100,J/Ue*100)):0,over:Number.isFinite(e)&&e>=100,label:t(Number.isFinite(e)?`billing.budget`:`billing.monthCost`)}},[v,y,J,Ue,t]),Ge=v&&y>0?J/y*100:0,Ke=(0,i.useMemo)(()=>{let e=[];for(let t=A-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t),e.push($(n.getTime()))}return e},[A]),qe=Ke.at(-1)??q,Ye=(0,i.useMemo)(()=>Object.entries(O).map(([e,t])=>({date:e,value:t.cost})),[O]),Xe=Ht(O),Ze=Ut(O),$e=(0,i.useMemo)(()=>Ke.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=O[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}}),[Ke,O,e.byDayModels]),X=(0,i.useMemo)(()=>Object.entries(le).filter(([,e])=>e.calls>0).map(([e,t])=>{let n=Te(e),r=n.key===`other`,i=r?It(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:ke(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:tn[t%tn.length]??`#8b95a3`})),[le]),Z=(0,i.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,i.useMemo)(()=>Object.entries(e.bySite??{}).filter(([e])=>!(T.hideUnidentified&&e===`unknown`)).sort((e,t)=>(t[1].cost??0)-(e[1].cost??0)),[e.bySite,T.hideUnidentified]),tt=(0,i.useMemo)(()=>T.hideUnidentified?p.filter(e=>e.kind!==`unknown`):p,[p,T.hideUnidentified]),rt=(0,i.useMemo)(()=>{let e=new Map;for(let t of f){if(t.status===`not-configured`)continue;let n=Rt(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=It(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:Pe(n),dot:Gt(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:Gt(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]),it=X.reduce((e,t)=>e+t.estimated,0),at=D.cost>0?D.cost:it,st=D.calls>0?at/D.calls:0,ct=(0,i.useMemo)(()=>X.map(e=>({key:e.key,name:e.name,color:e.color})),[X]),lt=$e.length>=2?$e.at(-2)?.cost??0:0,ft=lt>0?(Re-lt)/lt*100:0;return(0,r.jsx)(a.Modal,{open:!0,onClose:n,title:t(`billing.title`),headless:!0,className:c(C.dashboardModal,`dsh-billing-modal`),children:(0,r.jsxs)(`div`,{className:C.dashboard,"data-testid":`billing-dashboard`,children:[(0,r.jsxs)(`div`,{className:C.dashboardHead,"data-testid":`billing-dashboard-head`,children:[(0,r.jsxs)(`div`,{children:[_(`billing.dashboard.decor`,{position:`head`}),(0,r.jsxs)(`div`,{className:C.headTitleRow,children:[(0,r.jsx)(`h2`,{className:C.dashboardTitle,children:t(`billing.title`)}),_(`billing.dashboard.decor`,{position:`headTitle`})]}),(0,r.jsxs)(`p`,{className:C.dashboardSubtitle,children:[t(`billing.lastUpdated`),` `,qe,e.timezone===void 0?null:` · ${e.timezone.name} (${e.timezone.offset})`]})]}),(0,r.jsxs)(`div`,{className:C.dashboardRight,children:[(0,r.jsx)(`span`,{className:C.currencyToggle,role:`group`,"aria-label":t(`billing.currency`),children:[`cny`,`usd`].map(e=>(0,r.jsx)(`button`,{type:`button`,className:c(C.currencyButton,m===e&&C.currencyButtonActive),"aria-pressed":m===e,"data-testid":`billing-currency-${e}`,title:t(e===`cny`?`billing.currencyCny`:`billing.currencyUsd`),onClick:()=>{h(e)},children:e===`cny`?`¥ CNY`:`$ USD`},e))}),l.checked&&(0,r.jsxs)(`span`,{className:c(C.healthBadge,l.available?C.healthBadgeOk:C.healthBadgeBad),children:[(0,r.jsx)(`span`,{className:c(C.healthDot,l.available?C.healthOk:C.healthBad),"aria-hidden":`true`}),l.available?`${l.models} 模型可用${l.failures>0?` · ${l.failures} 厂商失效`:``}`:`${l.failures} 厂商不可用`]}),(0,r.jsx)(`button`,{type:`button`,className:C.closeButton,"aria-label":t(`billing.close`),"data-testid":`billing-close`,onClick:n,children:(0,r.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,r.jsx)(`path`,{d:`M18 6 6 18`}),(0,r.jsx)(`path`,{d:`m6 6 12 12`})]})})]})]}),(0,r.jsx)(`nav`,{className:C.tabNav,"data-testid":`billing-tab-nav`,role:`tablist`,"aria-label":t(`billing.title`),children:kt.map(e=>(0,r.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":k===e.id,className:c(C.tabButton,k===e.id&&C.tabButtonActive),"data-testid":`billing-tab-${e.id}`,onClick:()=>{ue(e.id)},children:t(e.labelKey)},e.id))}),(0,r.jsxs)(`div`,{className:C.dashboardBody,children:[k===`overview`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-overview`,children:[d?.kind===`drift`&&d.spent!==void 0&&fe!==me()&&(0,r.jsxs)(`div`,{className:C.reconcileNotice,"data-testid":`billing-reconcile-notice`,role:`note`,children:[(0,r.jsx)(`span`,{className:C.reconcileIcon,"aria-hidden":`true`,children:(0,r.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,r.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,r.jsx)(`line`,{x1:`12`,y1:`10`,x2:`12`,y2:`16`}),(0,r.jsx)(`line`,{x1:`12`,y1:`7.5`,x2:`12.01`,y2:`7.5`})]})}),(0,r.jsx)(`span`,{className:C.reconcileText,children:t(`billing.reconcileDrift`).replace(`{provider}`,d.provider??``).replace(`{spent}`,I(d.spent)).replace(`{today}`,I(d.todayOfficialCost??0))}),(0,r.jsx)(`button`,{type:`button`,className:C.reconcileDismiss,"data-testid":`billing-reconcile-dismiss`,onClick:he,children:t(`billing.reconcileDismiss`)})]}),(0,r.jsxs)(`section`,{className:C.hero,"data-testid":`billing-hero`,children:[_(`billing.dashboard.decor`,{position:`hero`}),(0,r.jsxs)(`div`,{className:C.heroTop,children:[(0,r.jsxs)(`div`,{className:C.heroMain,children:[(0,r.jsx)(`span`,{className:C.heroLabel,children:t(`billing.monthCost`)}),(0,r.jsxs)(`div`,{className:C.heroReadout,children:[(0,r.jsx)(`span`,{className:C.heroCurrency,"aria-hidden":`true`,children:m===`usd`?`$`:`¥`}),(0,r.jsx)(`span`,{className:C.heroValue,children:I(J).slice(1)})]}),(0,r.jsxs)(`span`,{className:C.heroMeta,children:[D.calls.toLocaleString(),` `,t(`billing.calls`)]})]}),(0,r.jsxs)(`div`,{className:C.heroGauge,"data-testid":`billing-hero-gauge`,children:[(0,r.jsxs)(`svg`,{className:C.heroGaugeSvg,viewBox:`0 0 120 120`,"aria-hidden":`true`,children:[(0,r.jsx)(`circle`,{className:C.heroGaugeTrack,cx:`60`,cy:`60`,r:`52`}),(0,r.jsx)(`circle`,{className:c(C.heroGaugeArc,We.over&&C.heroGaugeArcOver),cx:`60`,cy:`60`,r:`52`,style:{strokeDasharray:`${We.pct/100*326.7} 326.7`}})]}),(0,r.jsxs)(`span`,{className:C.heroGaugeCenter,children:[(0,r.jsxs)(`span`,{className:c(C.heroGaugePct,We.over&&C.heroGaugePctOver),children:[We.pct.toFixed(0),`%`]}),(0,r.jsx)(`span`,{className:C.heroGaugeLabel,children:We.label})]})]})]}),v&&y>0&&(0,r.jsxs)(`div`,{className:C.heroBudget,"data-testid":`billing-hero-budget`,children:[(0,r.jsx)(`span`,{className:C.heroBudgetLabel,children:t(`billing.budget`)}),(0,r.jsx)(`div`,{className:C.heroBudgetTrack,role:`progressbar`,"aria-valuenow":Math.min(Ge,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`billing.budget`),children:(0,r.jsx)(`div`,{className:c(C.heroBudgetFill,Ge>=100&&C.heroBudgetFillOver),style:{width:`${Math.min(Ge,100)}%`}})}),(0,r.jsxs)(`span`,{className:C.heroBudgetValue,children:[I(J),` / `,I(y),` · `,Ge.toFixed(1),`%`]})]}),(0,r.jsxs)(`div`,{className:C.heroSide,children:[(0,r.jsxs)(`div`,{className:C.heroSideItem,children:[(0,r.jsx)(`span`,{className:C.heroSideLabel,children:t(`billing.yearCost`)}),(0,r.jsx)(`span`,{className:C.heroSideValue,children:I(Ue)})]}),(0,r.jsxs)(`div`,{className:C.heroSideItem,children:[(0,r.jsx)(`span`,{className:C.heroSideLabel,children:t(`billing.todayCost`)}),(0,r.jsxs)(`span`,{className:C.heroSideValue,children:[I(Re),(0,r.jsxs)(`span`,{className:c(C.delta,ft>=0?C.deltaUp:C.deltaDown),children:[ft>=0?`▲`:`▼`,` `,Math.abs(ft).toFixed(1),`%`]})]})]}),Y>0&&(0,r.jsxs)(`div`,{className:C.heroSideItem,children:[(0,r.jsx)(`span`,{className:C.heroSideLabel,children:t(`billing.monthProjected`)}),(0,r.jsx)(`span`,{className:C.heroSideValue,children:I(Y)})]}),Y<=0&&(0,r.jsx)(`span`,{className:C.heroSideSpacer,"aria-hidden":`true`})]})]}),(e.unpricedModels?.length??0)>0&&(0,r.jsx)(`div`,{className:C.unpricedHint,"data-testid":`billing-unpriced-hint`,children:t(`billing.unpricedHint`).replace(`{count}`,String(e.unpricedModels?.length??0))}),(e.total.searchCalls??0)>0&&(0,r.jsx)(`div`,{className:C.unpricedHint,"data-testid":`billing-search-estimate-hint`,children:t(`billing.searchEstimateHint`).replace(`{count}`,String(e.total.searchCalls??0)).replace(`{each}`,I(e.searchCallEstimateCny??0))}),(0,r.jsxs)(`section`,{className:C.kpiGrid,"data-testid":`billing-kpi-grid`,children:[(0,r.jsxs)(`div`,{className:C.kpiTile,"data-testid":`billing-kpi-tile`,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:t(`billing.cacheHitRate`)}),(0,r.jsx)(`span`,{className:c(C.kpiValue,C.kpiGreen),children:Ne(G)}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[U(D.cacheHit),` / `,U(D.cacheHit+D.cacheMiss)]})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:t(`billing.tokens`)}),(0,r.jsx)(`span`,{className:C.kpiValue,children:U(D.input+D.output)}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[t(`billing.inputTokens`),` `,U(D.input),` · `,t(`billing.outputTokens`),` `,U(D.output)]})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:t(`billing.avgCost`)}),(0,r.jsx)(`span`,{className:C.kpiValue,children:I(st)}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[t(`billing.calls`),` `,D.calls.toLocaleString()]})]}),(0,r.jsxs)(`div`,{className:C.kpiTile,children:[(0,r.jsx)(`span`,{className:C.kpiLabel,children:t(`billing.calls`)}),(0,r.jsx)(`span`,{className:C.kpiValue,children:D.calls.toLocaleString()}),(0,r.jsxs)(`span`,{className:C.kpiDetail,children:[X.length,` `,t(`billing.models`)]})]})]}),(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-heatmap`,children:[(0,r.jsxs)(`div`,{className:C.panelHead,children:[(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.heatmap`)}),(0,r.jsx)(`div`,{className:C.heatmapRangeSwitch,"data-testid":`billing-heatmap-range`,role:`group`,"aria-label":t(`billing.heatmap`),children:[`month`,`year`].map(e=>(0,r.jsx)(`button`,{type:`button`,className:c(C.heatmapRangeButton,j===e&&C.heatmapRangeButtonActive),"data-testid":`billing-heatmap-range-${e}`,"aria-pressed":j===e,onClick:()=>{_e(e)},children:t(e===`month`?`billing.heatmapMonth`:`billing.heatmapYear`)},e))}),(0,r.jsxs)(`span`,{className:C.panelHint,"data-testid":`billing-heatmap-summary`,children:[t(`billing.activeDays`),` `,Xe,` · `,t(`billing.streakDays`),` `,Ze]})]}),(0,r.jsx)(nt,{days:Ye,currency:m,t,range:j})]})]}),k===`settings`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-settings`,children:[(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-budget`,children:[(0,r.jsxs)(`div`,{className:C.setCardHead,children:[(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.budget`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.budgetHint`)})]}),(0,r.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":v,"aria-label":t(`billing.budget`),"data-testid":`billing-budget-toggle`,className:c(C.switch,v&&C.switchOn),onClick:ee,children:(0,r.jsx)(`span`,{className:C.switchKnob})})]}),v&&(0,r.jsxs)(`div`,{className:C.ctlCol,children:[(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.budgetAmount`)}),(0,r.jsxs)(`span`,{className:C.inp,"data-testid":`billing-budget-input-wrap`,children:[(0,r.jsx)(`span`,{className:C.affix,"aria-hidden":`true`,children:`¥`}),(0,r.jsx)(`input`,{className:C.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(`billing.budget`)}(${m===`usd`?`USD`:`CNY`})`,title:`${t(`billing.budget`)}(${m===`usd`?`USD`:`CNY`})`,onChange:e=>{te(e.target.valueAsNumber)}})]})]}),y>0&&(()=>{let e=J/y*100;return(0,r.jsx)(`div`,{className:C.ctlRowStretch,children:(0,r.jsx)(`div`,{className:C.prog,role:`progressbar`,"aria-valuenow":Math.min(e,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`billing.budget`),"data-testid":`billing-budget-track`,children:(0,r.jsx)(`div`,{className:c(C.progFill,e>=100&&C.budgetFillOver,e>=80&&e<100&&C.budgetFillWarn),style:{width:`${Math.min(e,100)}%`}})})})})(),y>0&&(0,r.jsx)(`p`,{className:C.setCardDesc,"data-testid":`billing-budget-value`,children:t(`billing.budgetSummary`).replace(`{used}`,I(J)).replace(`{total}`,I(y))})]})]}),(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-peak-alert-settings`,children:[(0,r.jsxs)(`div`,{className:C.setCardHead,children:[(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.peakAlert`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.peakAlertHint`)})]}),(0,r.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":b.enabled,"aria-label":t(`billing.peakAlert`),"data-testid":`billing-peak-alert-toggle`,className:c(C.switch,b.enabled&&C.switchOn),onClick:()=>{x({...b,enabled:!b.enabled})},children:(0,r.jsx)(`span`,{className:C.switchKnob})})]}),b.enabled&&(0,r.jsxs)(`div`,{className:C.ctlCol,children:[(0,r.jsxs)(`label`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.peakAlertLeadMin`)}),(0,r.jsx)(`span`,{className:C.inp,children:(0,r.jsx)(`input`,{type:`number`,min:1,max:30,step:1,value:b.leadMin,className:C.budgetInput,"aria-label":t(`billing.peakAlertLeadMin`),onChange:e=>{let t=Number(e.target.valueAsNumber);x({...b,leadMin:Number.isFinite(t)?Math.min(30,Math.max(1,Math.round(t))):b.leadMin})}})})]}),(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.peakAlertPos`)}),(0,r.jsx)(`div`,{className:C.ctlGroup,role:`radiogroup`,"aria-label":t(`billing.peakAlertPos`),children:[`bottom-right`,`center`].map(e=>(0,r.jsxs)(`label`,{className:C.rdo,children:[(0,r.jsx)(`input`,{type:`radio`,name:`peak-pos`,checked:b.position===e,onChange:()=>x({...b,position:e})}),(0,r.jsx)(`span`,{className:C.rdoDot,"aria-hidden":`true`}),t(e===`bottom-right`?`billing.peakAlertPosCorner`:`billing.peakAlertPosCenter`)]},e))})]}),(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.peakAlertMode`)}),(0,r.jsx)(`div`,{className:C.ctlGroup,role:`radiogroup`,"aria-label":t(`billing.peakAlertMode`),children:[`both`,`peak`,`offPeak`].map(e=>(0,r.jsxs)(`label`,{className:C.rdo,children:[(0,r.jsx)(`input`,{type:`radio`,name:`peak-mode`,checked:b.mode===e,onChange:()=>x({...b,mode:e})}),(0,r.jsx)(`span`,{className:C.rdoDot,"aria-hidden":`true`}),t(e===`both`?`billing.peakAlertModeBoth`:e===`peak`?`billing.peakAlertModePeak`:`billing.peakAlertModeOff`)]},e))})]}),(0,r.jsxs)(`label`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.peakAlertWebNotify`)}),(0,r.jsx)(`input`,{type:`checkbox`,checked:b.webNotify,"aria-label":t(`billing.peakAlertWebNotify`),onChange:e=>{x({...b,webNotify:e.target.checked})}})]}),(0,r.jsx)(`div`,{className:C.ctlRow,children:(0,r.jsx)(`button`,{type:`button`,className:C.btn,onClick:S,children:t(`billing.peakAlertPreview`)})})]})]}),(0,r.jsx)(`section`,{className:C.setCard,"data-testid":`billing-usage-stats-tool-setting`,children:(0,r.jsxs)(`div`,{className:C.setCardHead,children:[(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.usageStatsTool`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.usageStatsToolHint`)})]}),(0,r.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":xe,"aria-label":t(`billing.usageStatsTool`),"data-testid":`billing-usage-stats-tool-toggle`,className:c(C.switch,xe&&C.switchOn),onClick:Se,children:(0,r.jsx)(`span`,{className:C.switchKnob})})]})}),(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-float-setting`,children:[(0,r.jsx)(`div`,{className:C.setCardHead,children:(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.floatWindow`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.floatWindowHint`)})]})}),(0,r.jsxs)(`div`,{className:C.ctlCol,children:[(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.floatMode`)}),(0,r.jsxs)(`div`,{className:C.ctlGroup,"data-testid":`billing-float-mode`,children:[(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,w.mode===`combined`&&C.floatModeBtnOn),"data-testid":`billing-float-mode-combined`,onClick:()=>ne({mode:`combined`,targets:w.targets}),children:t(`billing.floatModeCombined`)}),(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,w.mode===`subscription`&&C.floatModeBtnOn),"data-testid":`billing-float-mode-subscription`,onClick:()=>ne({mode:`subscription`,targets:w.targets}),children:t(`billing.floatModeSubscription`)})]})]}),w.mode===`subscription`&&(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.floatTargets`)}),(0,r.jsxs)(`span`,{className:C.ctlGroup,"data-testid":`billing-float-targets`,children:[M.map(e=>{let t=w.targets.includes(e.id);return(0,r.jsxs)(`label`,{className:C.floatTarget,children:[(0,r.jsx)(`input`,{type:`checkbox`,checked:t,"data-testid":`billing-float-target-${e.id}`,onChange:()=>ne({mode:`subscription`,targets:t?w.targets.filter(t=>t!==e.id):[...w.targets,e.id]})}),(0,r.jsx)(`span`,{className:C.floatTargetLabel,children:e.label})]},e.id)}),M.length===0&&(0,r.jsx)(`span`,{className:C.setCardDesc,children:t(`billing.floatNoTargetsHint`)})]})]})]})]}),(0,r.jsxs)(`section`,{className:C.setCard,"data-testid":`billing-card-setting`,children:[(0,r.jsx)(`div`,{className:C.setCardHead,children:(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.cardDisplay`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.cardDisplayHint`)})]})}),(0,r.jsx)(`div`,{className:C.ctlCol,children:(0,r.jsxs)(`div`,{className:C.ctlRow,children:[(0,r.jsx)(`span`,{className:C.ctlLabel,children:t(`billing.cardMetric`)}),(0,r.jsxs)(`div`,{className:C.ctlGroup,"data-testid":`billing-card-metric`,children:[(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,re.metric===`money`&&C.floatModeBtnOn),"data-testid":`billing-card-money`,onClick:()=>ae({metric:`money`}),children:t(`billing.cardMetricMoney`)}),(0,r.jsx)(`button`,{type:`button`,className:c(C.floatModeBtn,re.metric===`tokens`&&C.floatModeBtnOn),"data-testid":`billing-card-tokens`,onClick:()=>ae({metric:`tokens`}),children:t(`billing.cardMetricTokens`)})]})]})})]}),(0,r.jsx)(`section`,{className:C.setCard,"data-testid":`billing-site-list-setting`,children:(0,r.jsxs)(`div`,{className:C.setCardHead,children:[(0,r.jsxs)(`div`,{className:C.setCardMeta,children:[(0,r.jsx)(`h3`,{className:C.setCardTitle,children:t(`billing.siteListDisplay`)}),(0,r.jsx)(`p`,{className:C.setCardDesc,children:t(`billing.siteListDisplayHint`)})]}),(0,r.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":T.hideUnidentified,"aria-label":t(`billing.siteListDisplay`),"data-testid":`billing-site-hide-unidentified`,className:c(C.switch,T.hideUnidentified&&C.switchOn),onClick:()=>oe({hideUnidentified:!T.hideUnidentified}),children:(0,r.jsx)(`span`,{className:C.switchKnob})})]})}),(0,r.jsx)(hn,{userPrices:o,onUserPrices:s,t}),(0,r.jsx)(He,{t,version:e.pluginVersion})]}),k===`trends`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-trends`,children:[(0,r.jsxs)(`section`,{className:c(C.ubCard,C.trendPanel),"data-testid":`billing-panel-trend`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.trend`)}),_(`billing.dashboard.decor`,{position:`trend`}),(0,r.jsxs)(`span`,{className:C.ubCardControlGroup,children:[(0,r.jsx)(`span`,{className:C.rangeToggle,role:`group`,"aria-label":t(`billing.trend`),children:[7,30].map(e=>(0,r.jsx)(`button`,{type:`button`,className:c(C.rangeButton,A===e&&C.rangeButtonActive),"aria-pressed":A===e,"data-testid":`billing-trend-${e}d`,onClick:()=>{de(e)},children:t(e===7?`billing.trend7d`:`billing.trend30d`)},e))}),(0,r.jsx)(`span`,{className:C.rangeToggle,role:`group`,"aria-label":t(`billing.trendMetric`),children:[`cost`,`tokens`].map(e=>(0,r.jsx)(`button`,{type:`button`,className:c(C.rangeButton,ce===e&&C.rangeButtonActive),"aria-pressed":ce===e,"data-testid":`billing-trend-metric-${e}`,onClick:()=>{E(e)},children:t(e===`cost`?`billing.trendMetricCost`:`billing.trendMetricTokens`)},e))})]}),(0,r.jsx)(`span`,{className:C.ubCardSub,children:qe})]}),(0,r.jsx)(Le,{data:$e,models:ct,currency:m,metric:ce})]}),g.length>0&&(0,r.jsxs)(`section`,{className:C.ubCard,"data-testid":`billing-panel-rounds`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.rounds`)}),we.length>0&&(0,r.jsxs)(`span`,{className:C.ubTagError,"data-testid":`billing-rounds-flag-count`,children:[we.length,` `,t(`billing.anomaly`)]})]}),(0,r.jsx)(`p`,{className:C.ubCardSub,children:t(`billing.roundsHint`).replace(`{count}`,String(g.length))}),(0,r.jsx)(Qe,{rounds:g,flags:we,currency:m,t})]}),e.byTier!==void 0&&(()=>{let e=z.peak+z.offPeak;if(e<=0)return null;let n=z.peak/e*100;return(0,r.jsxs)(`section`,{className:C.ubCard,"data-testid":`billing-panel-share`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.peakShare`)}),(0,r.jsx)(`span`,{className:C.ubCardSub,children:t(`billing.peakSharePerCall`)})]}),(0,r.jsxs)(`div`,{className:C.shareTrack,"data-testid":`billing-share-track`,children:[(0,r.jsx)(`div`,{className:c(C.shareSeg,C.shareSegPeak),style:{width:`${n}%`}}),(0,r.jsx)(`div`,{className:c(C.shareSeg,C.shareSegOff),style:{width:`${100-n}%`}})]}),(0,r.jsxs)(`div`,{className:C.shareLegend,children:[(0,r.jsxs)(`span`,{className:C.shareItem,children:[(0,r.jsx)(`span`,{className:C.shareDot,style:{background:`var(--dsw-static-blue-500)`}}),t(`billing.peak`),(0,r.jsxs)(`span`,{className:C.shareValue,"data-testid":`billing-share-peak`,children:[I(z.peak),` · `,n.toFixed(1),`%`]})]}),(0,r.jsxs)(`span`,{className:C.shareItem,children:[(0,r.jsx)(`span`,{className:C.shareDot,style:{background:`color-mix(in srgb, var(--dsw-static-blue-500) 30%, var(--dsw-alias-bg-module-platform))`}}),t(`billing.offPeak`),(0,r.jsxs)(`span`,{className:C.shareValue,"data-testid":`billing-share-offpeak`,children:[I(z.offPeak),` · `,(100-n).toFixed(1),`%`]})]})]}),B>0&&(0,r.jsx)(`div`,{className:C.staleNotice,"data-testid":`billing-share-savings`,children:t(`billing.offPeakSavings`).replace(`{amount}`,I(B))})]})})()]}),k===`providers`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-providers`,children:[et.length>0&&(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-relay-sites`,children:[(0,r.jsx)(`div`,{className:C.panelHead,children:(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.panelRelay`)})}),(0,r.jsx)(`div`,{className:C.providerGroupList,"data-testid":`billing-relay-sites`,children:et.map(([e,n])=>{let i=Jt(e,t);return(0,r.jsxs)(`div`,{className:C.siteRow,"data-testid":`billing-relay-site`,children:[(0,r.jsxs)(`span`,{className:C.siteRowName,children:[(0,r.jsx)(`span`,{className:c(C.siteKindTag,Zt[i.kind]),children:Yt(i.kind,t)}),(0,r.jsx)(`span`,{className:C.siteRowTitle,children:i.name})]}),(0,r.jsxs)(`span`,{className:C.siteRowMeta,children:[(0,r.jsx)(`span`,{className:C.siteRowCost,children:I(n.cost)}),(0,r.jsxs)(`span`,{className:C.siteRowCalls,children:[n.calls,` `,t(`billing.relayCalls`)]})]})]},e)})})]}),tt.length>0&&(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-relay-quota`,children:[(0,r.jsx)(`div`,{className:C.panelHead,children:(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.panelRelayQuota`)})}),(0,r.jsx)(`div`,{className:C.providerGroupList,"data-testid":`billing-relay-quotas`,children:tt.map(e=>(0,r.jsxs)(`div`,{className:C.siteRow,"data-testid":`billing-relay-quota`,children:[(0,r.jsxs)(`span`,{className:C.siteRowName,children:[(0,r.jsx)(`span`,{className:c(C.siteKindTag,Qt[e.kind]),children:Xt(e.kind,t)}),(0,r.jsx)(`span`,{className:C.siteRowTitle,children:e.origin})]}),(0,r.jsxs)(`span`,{className:C.siteRowMeta,children:[e.balance!==void 0&&(0,r.jsxs)(`span`,{className:C.siteRowCost,children:[t(`billing.relayBalance`),` `,e.balance.toFixed(2)]}),(e.windows?.length??0)>0?e.windows?.map(e=>{let n=e.remainingPercent<20;return(0,r.jsxs)(`span`,{className:c(C.siteRowCalls,n&&C.siteRowCallsLow),children:[t(`billing.relayWindowUsed`),` `,e.usedPercent,`%`]},e.kind)}):(0,r.jsx)(`span`,{className:C.siteRowCalls,children:t(`billing.relayNoQuota`)})]})]},e.route))})]}),(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-providers`,children:[(0,r.jsxs)(`div`,{className:C.panelHead,children:[(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.providerBilling`)}),_(`billing.dashboard.decor`,{position:`models`}),(0,r.jsx)(`span`,{className:C.panelHint,children:e.updatedAt===void 0?``:`${t(`billing.lastUpdated`)} ${en(e.updatedAt)}`})]}),se&&(0,r.jsx)(`div`,{className:C.staleNotice,"data-testid":`billing-subscriptions-stale`,children:t(`billing.subscriptionsStale`)}),rt.length===0?(0,r.jsx)(`div`,{className:C.emptyRow,"data-testid":`billing-provider-empty`,children:t(`billing.noData`)}):(0,r.jsx)(`div`,{className:C.providerGroupList,"data-testid":`billing-provider-groups`,children:rt.map(e=>(0,r.jsxs)(`div`,{className:C.providerGroup,"data-testid":`billing-provider-group`,children:[(0,r.jsxs)(`div`,{className:C.providerGroupHead,children:[(0,r.jsxs)(`span`,{className:C.providerGroupTitle,children:[(0,r.jsx)(`span`,{className:c(C.healthDot,e.dot),"aria-hidden":`true`}),(0,r.jsx)(`span`,{className:C.providerGroupName,children:Ce(e.name)})]}),(0,r.jsxs)(`span`,{className:C.providerGroupMeta,children:[e.subscriptions.length>0&&(0,r.jsxs)(`span`,{className:C.providerGroupBadge,"data-testid":`billing-provider-sub-count`,children:[e.subscriptions.length,` 套餐`]}),!Fe(e)&&e.balance!==void 0&&(0,r.jsxs)(`span`,{className:C.providerGroupBalance,"data-testid":`billing-provider-balance`,children:[(0,r.jsx)(`span`,{className:C.providerGroupBalanceLabel,children:t(`billing.balance`)}),Ie(e.balance)]})]})]}),e.models.length>0&&(0,r.jsx)(`div`,{className:c(C.tableScroll,C.modelTableScroll),"data-testid":`billing-table-scroll`,children:(0,r.jsxs)(`table`,{className:C.modelTable,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:t(`billing.model`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.calls`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.inputTokens`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.outputTokens`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.cacheHitRate`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.actual`)})]})}),(0,r.jsx)(`tbody`,{children:e.models.map(e=>(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`td`,{children:(0,r.jsxs)(`span`,{className:C.modelCell,children:[(0,r.jsx)(_n,{provider:e.provider,colorVar:e.color}),(0,r.jsxs)(`span`,{children:[(0,r.jsxs)(`span`,{className:C.modelName,children:[e.name,e.uncatalogued&&(0,r.jsx)(`span`,{className:C.uncataloguedTag,"data-testid":`billing-uncatalogued-tag`,children:t(`billing.uncatalogued`)}),e.estimatedPricing&&(0,r.jsx)(`span`,{className:C.estimatedTag,"data-testid":`billing-estimated-tag`,children:t(`billing.estimatedPricing`)})]}),(0,r.jsx)(`span`,{className:C.modelProvider,children:Ce(e.provider)})]})]})}),(0,r.jsx)(`td`,{className:C.numCol,children:e.calls.toLocaleString()}),(0,r.jsx)(`td`,{className:C.numCol,children:U(e.input)}),(0,r.jsx)(`td`,{className:C.numCol,children:U(e.output)}),(0,r.jsx)(`td`,{className:C.numCol,children:Ne(e.cacheHitRate)}),(0,r.jsx)(`td`,{className:C.numCol,children:e.plan?(0,r.jsx)(`span`,{className:C.planTag,children:t(`billing.subscriptionIncluded`)}):e.actual===void 0?(0,r.jsx)(`span`,{className:C.na,children:`—`}):(()=>{let t=e.officialCost,n=e.actual-t;return t>0&&n>0?(0,r.jsxs)(`span`,{className:C.bucketCost,children:[(0,r.jsx)(`span`,{className:C.bucketOfficial,children:I(t)}),(0,r.jsx)(`span`,{className:C.bucketSep,children:`/`}),(0,r.jsx)(`span`,{className:C.bucketThird,children:I(n)})]}):I(e.actual)})()})]},e.key))})]})}),e.subscriptions.length>0&&(0,r.jsx)(`div`,{className:C.subscriptionGrid,"data-testid":`billing-subscriptions-grid`,children:e.subscriptions.map(e=>{let n=Kt(e.status,t);return(0,r.jsxs)(`div`,{className:C.subscriptionCard,"data-testid":`billing-subscription-card`,children:[(0,r.jsxs)(`div`,{className:C.subscriptionHead,children:[(0,r.jsx)(`span`,{className:C.subscriptionName,children:Ce(e.displayName)}),e.planType===`code`&&(()=>{let n=ie(e.provider),i=n===void 0?void 0:t(`billing.subscriptionFeePerMonth`).replace(`{amount}`,n.currency===`USD`?`$${n.amount}`:`¥${n.amount}`);return(0,r.jsxs)(`span`,{className:C.subscriptionPlan,"data-kind":`code`,children:[i??(e.subscriptionAmount!==void 0&&e.subscriptionAmount>0?t(`billing.subscriptionFeePerMonth`).replace(`{amount}`,I(e.subscriptionAmount)):t(`billing.planTypeCode`)),n?.label!==void 0&&(0,r.jsx)(`span`,{className:C.subscriptionTier,"data-testid":`billing-tier-${e.provider}`,children:n.label}),n!==void 0&&(0,r.jsx)(`span`,{className:C.subscriptionAuto,"data-testid":`billing-auto-${e.provider}`,children:t(`billing.subscriptionAutoDetect`)})]})})(),e.planType===`token`&&(0,r.jsx)(`span`,{className:C.subscriptionPlan,"data-kind":`token`,children:t(`billing.planTypeToken`)}),e.plan!==void 0&&(0,r.jsx)(`span`,{className:C.subscriptionPlan,children:e.plan})]}),n!==``&&(0,r.jsx)(`div`,{className:C.subscriptionStatus,children:n}),e.windows.length===0&&n===``&&(0,r.jsx)(`div`,{className:C.subscriptionStatus,children:t(`billing.subscriptionNoApi`)}),e.windows.map(e=>(()=>{let n=Math.min(100,Math.max(0,e.usedPercent)),i=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,r.jsxs)(`div`,{className:C.subscriptionWindow,children:[(0,r.jsx)(`span`,{className:C.subscriptionWindowLabel,children:qt(e.kind,t)}),(0,r.jsx)(`span`,{className:C.subscriptionTrack,"aria-hidden":`true`,children:(0,r.jsx)(`span`,{className:c(C.subscriptionFill,n>=100&&C.subscriptionFillOver,n>=80&&n<100&&C.subscriptionFillWarn),style:{width:`${n}%`}})}),(0,r.jsxs)(`span`,{className:C.subscriptionMeta,children:[(0,r.jsx)(`span`,{className:c(C.subscriptionPct,i&&C.subscriptionExhausted),children:i?t(`billing.subscriptionExhausted`):t(`billing.subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,r.jsx)(`span`,{className:C.subscriptionReset,children:t(`billing.subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${en(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]},e.provider)})})]},e.name))})]}),(0,r.jsxs)(`div`,{className:C.exportBar,"data-testid":`billing-export-bar`,role:`group`,"aria-label":t(`billing.export`),children:[(0,r.jsx)(`span`,{className:C.exportLabel,children:t(`billing.export`)}),(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-export-day`,onClick:()=>{ht(mt(`usage-daily`,`csv`,Object.keys(O)),ut(O),`text/csv`)},children:t(`billing.exportCsvDay`)}),e.bySession!==void 0&&(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-export-sessions`,onClick:()=>{ht(mt(`usage-sessions`,`csv`,Object.keys(O)),pt(e.bySession??[]),`text/csv`)},children:t(`billing.exportCsvSession`)}),e.bySite!==void 0&&(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-export-sites`,onClick:()=>{ht(mt(`usage-sites`,`csv`,Object.keys(O)),dt(e.bySite??{}),`text/csv`)},children:t(`billing.exportCsvSite`)}),(0,r.jsx)(`button`,{type:`button`,className:C.exportButton,"data-testid":`billing-export-json`,onClick:()=>{ht(mt(`usage-stats`,`json`,Object.keys(O)),JSON.stringify(e,null,2),`application/json`)},children:t(`billing.exportJson`)})]}),V.length>0&&(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-roles`,children:[(0,r.jsxs)(`div`,{className:C.panelHead,children:[(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.roleCost`)}),(0,r.jsx)(`span`,{className:C.panelHint,children:t(`billing.roleHint`)})]}),(0,r.jsx)(`div`,{className:C.shareTrack,"data-testid":`billing-role-track`,children:V.map(e=>(0,r.jsx)(`div`,{className:c(C.shareSeg,e.seg),style:{width:`${e.pct}%`}},e.label))}),(0,r.jsx)(`div`,{className:C.shareLegend,children:V.map(e=>(0,r.jsxs)(`span`,{className:C.shareItem,children:[(0,r.jsx)(`span`,{className:c(C.shareDot,e.seg)}),e.label,(0,r.jsxs)(`span`,{className:C.shareValue,children:[I(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,r.jsxs)(`div`,{className:C.ubStatGrid,"data-testid":`billing-panel-buckets`,children:[(0,r.jsxs)(`div`,{className:C.ubStatCard,children:[(0,r.jsxs)(`span`,{className:C.ubStatLabel,children:[t(`billing.official`),`(=DeepSeek 直连)`]}),(0,r.jsx)(`span`,{className:C.ubStatValue,children:I(Z.officialCost)}),(0,r.jsxs)(`span`,{className:C.ubStatDetail,children:[Z.officialCalls,` `,t(`billing.calls`),` · `,n.toFixed(1),`%`]})]}),(0,r.jsxs)(`div`,{className:C.ubStatCard,children:[(0,r.jsxs)(`span`,{className:C.ubStatLabel,children:[t(`billing.thirdParty`),`(中转)`]}),(0,r.jsx)(`span`,{className:C.ubStatValue,children:I(Z.thirdCost)}),(0,r.jsxs)(`span`,{className:C.ubStatDetail,children:[Z.thirdCalls,` `,t(`billing.calls`),` · `,(100-n).toFixed(1),`%`]})]})]})})(),e.byWorkspace!==void 0&&e.byWorkspace.length>0&&(0,r.jsxs)(`section`,{className:C.ubCard,"data-testid":`billing-panel-workspaces`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.workspaces`)}),(0,r.jsx)(`span`,{className:C.ubCardSub,children:t(`billing.workspacesHint`)})]}),(0,r.jsx)(`ul`,{className:C.rowlist,children:e.byWorkspace.map(n=>(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(`li`,{children:(0,r.jsxs)(`button`,{type:`button`,className:C.rowline,"data-testid":`billing-workspace-${n.name}`,onClick:()=>{be(ye===n.name?void 0:n.name)},children:[(0,r.jsx)(`span`,{className:C.rowlineName,children:n.name}),(0,r.jsxs)(`span`,{className:C.rowlineRight,children:[(0,r.jsx)(`span`,{className:C.num,children:I(n.cost)}),(0,r.jsxs)(`span`,{className:C.rowlineMuted,children:[n.calls,` `,t(`billing.calls`)]}),(0,r.jsx)(`span`,{className:C.rowlineChev,"aria-hidden":`true`,children:`›`})]})]})}),ye===n.name&&(0,r.jsx)(`li`,{className:C.rowlineDrillWrap,children:e.bySession?.filter(e=>At(e.cwd)===n.name).slice(0,5).map(e=>(0,r.jsxs)(`div`,{className:C.rowlineDrill,children:[(0,r.jsx)(`span`,{className:C.rowlineName,children:e.title??e.id.slice(0,8)}),(0,r.jsxs)(`span`,{className:C.rowlineRight,children:[(0,r.jsx)(`span`,{className:C.num,children:I(e.cost)}),(0,r.jsxs)(`span`,{className:C.rowlineMuted,children:[e.calls,` `,t(`billing.calls`)]})]})]},e.id))})]},n.name))})]}),e.bySession!==void 0&&(0,r.jsxs)(`section`,{className:C.ubCard,"data-testid":`billing-panel-sessions`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.sessions`)}),(0,r.jsx)(`span`,{className:C.ubCardSub,children:e.bySession.length>20?t(`billing.sessionOverflow`).replace(`{limit}`,`20`).replace(`{total}`,String(e.bySession.length)):`${e.bySession.length}`})]}),(e.staleLedgerSessions??0)>0&&(0,r.jsx)(`div`,{className:C.staleNotice,"data-testid":`billing-sessions-stale`,children:t(`billing.staleLedgerNotice`).replace(`{count}`,String(e.staleLedgerSessions))}),(0,r.jsx)(`div`,{className:C.ubTablewrap,"data-testid":`billing-sessions-table`,children:(0,r.jsxs)(`table`,{className:C.ubTable,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:t(`billing.sessionTitle`)}),(0,r.jsx)(`th`,{children:t(`billing.project`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.calls`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.actual`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.lastActive`)})]})}),(0,r.jsxs)(`tbody`,{children:[e.bySession.length===0&&(0,r.jsx)(`tr`,{children:(0,r.jsx)(`td`,{colSpan:5,className:C.emptyRow,children:t(`billing.noData`)})}),e.bySession.slice(0,20).map(e=>(0,r.jsxs)(`tr`,{children:[(0,r.jsxs)(`td`,{children:[(0,r.jsx)(`span`,{className:C.modelName,children:e.title??e.id.slice(0,8)}),e.stale===!0&&(0,r.jsx)(`span`,{className:c(C.ubTag,C.ubTagNeutral),"data-testid":`billing-session-stale`,children:t(`billing.sessionStaleBadge`)})]}),(0,r.jsx)(`td`,{children:(0,r.jsx)(`span`,{className:C.modelProvider,children:At(e.cwd)??`—`})}),(0,r.jsx)(`td`,{className:C.numCol,children:e.calls.toLocaleString()}),(0,r.jsx)(`td`,{className:C.numCol,children:I(e.cost)}),(0,r.jsx)(`td`,{className:C.numCol,children:e.lastActive>0?`${$(e.lastActive)} ${en(e.lastActive)}`:`—`})]},e.id))]})]})})]})]}),k===`token`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-token`,children:[(0,r.jsx)(Je,{stats:e,trendDays:A,onTrendDays:de,t}),e.perf!==void 0&&(0,r.jsxs)(`section`,{className:C.panel,"data-testid":`billing-panel-perf`,children:[(0,r.jsxs)(`div`,{className:C.panelHead,children:[(0,r.jsx)(`h3`,{className:C.panelTitle,children:t(`billing.perfTitle`)}),(0,r.jsx)(`span`,{className:C.panelHint,children:t(`billing.perfHint`)})]}),(0,r.jsx)(ze,{perf:e.perf,models:ct,t})]})]}),k===`pricing`&&(0,r.jsxs)(`div`,{className:C.tabPanel,"data-testid":`billing-tab-panel-pricing`,children:[(0,r.jsxs)(`div`,{className:C.ubAlert,role:`note`,children:[(0,r.jsxs)(`div`,{className:C.ubAlertLeft,children:[(0,r.jsxs)(`span`,{className:C.ubRate,"data-testid":`billing-rate`,children:[t(`billing.todayRate`),` 1 USD = `,H(F.rate)]}),(0,r.jsx)(`span`,{className:c(C.ubTag,F.live?C.ubTagSuccess:C.ubTagNeutral),children:F.live?t(`billing.rateLive`):t(`billing.rateBuiltin`)})]}),(0,r.jsx)(`p`,{className:C.ubAlertNote,children:t(`billing.pricingTip`)})]}),(0,r.jsxs)(`section`,{className:C.ubCard,"data-testid":`billing-panel-pricing`,children:[(0,r.jsxs)(`div`,{className:C.ubCardHead,children:[(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.pricing`)}),(0,r.jsx)(`span`,{className:C.ubCardSub,children:t(`billing.pricingUnit`)})]}),(0,r.jsx)(`div`,{className:C.ubTablewrap,children:(0,r.jsxs)(`table`,{className:C.ubTable,children:[(0,r.jsx)(`thead`,{children:(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`th`,{children:t(`billing.thModel`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.thInputMiss`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.thInputHit`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.output`)}),(0,r.jsx)(`th`,{className:C.numCol,children:t(`billing.band`)})]})}),(0,r.jsx)(`tbody`,{children:De().map(e=>{let n=e.price.input>0||e.price.output>0;return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(`tr`,{children:[(0,r.jsx)(`td`,{children:(0,r.jsxs)(`span`,{className:C.ubModel,children:[(0,r.jsx)(_n,{provider:e.provider,colorVar:Oe(e.colorVar)}),(0,r.jsxs)(`span`,{className:C.ubModelName,children:[e.name,e.uncatalogued&&(0,r.jsx)(`span`,{className:C.ubTagAlert,"data-testid":`billing-price-uncatalogued`,children:t(`billing.uncatalogued`)}),e.promo!==void 0&&Ee(e.promo,Date.now())&&(0,r.jsx)(`span`,{className:C.ubTagPromo,"data-testid":`billing-price-promo`,title:e.promo.endsAtMs===void 0?t(`billing.promoOpenEnded`):t(`billing.promoUntil`,{date:new Date(e.promo.endsAtMs).toLocaleDateString()}),children:e.promo.note??t(`billing.promoBadge`)})]})]})}),(0,r.jsx)(`td`,{className:C.numCol,children:n?R(e.price.input,e.price.currency):(0,r.jsx)(`span`,{className:C.na,children:`—`})}),(0,r.jsx)(`td`,{className:C.numCol,children:n?R(e.price.cacheHit,e.price.currency):(0,r.jsx)(`span`,{className:C.na,children:`—`})}),(0,r.jsx)(`td`,{className:C.numCol,children:n?R(e.price.output,e.price.currency):(0,r.jsx)(`span`,{className:C.na,children:`—`})}),(0,r.jsx)(`td`,{className:C.numCol,children:n&&e.price.offPeak!==void 0&&e.peakHours!==void 0?(0,r.jsxs)(`span`,{className:C.ubPricepair,children:[(0,r.jsxs)(`span`,{className:C.ubChipPeak,children:[(0,r.jsx)(`span`,{className:C.ubChipLabel,children:e.tierSemantics===`latency`?t(`billing.ubStd`):t(`billing.ubPeak`)}),(0,r.jsxs)(`span`,{className:C.num,children:[R(e.price.input,e.price.currency),` / `,R(e.price.output,e.price.currency)]})]}),(0,r.jsxs)(`span`,{className:C.ubChipOff,children:[(0,r.jsx)(`span`,{className:C.ubChipLabel,children:e.tierSemantics===`latency`?`Flex`:t(`billing.ubOff`)}),(0,r.jsxs)(`span`,{className:C.num,children:[R(e.price.offPeak.input,e.price.currency),` / `,R(e.price.offPeak.output,e.price.currency)]})]})]}):n?(0,r.jsx)(`span`,{className:C.flatTag,children:t(`billing.flat`)}):(0,r.jsx)(`span`,{className:C.na,children:`—`})})]}),(e.extraRows??[]).map(t=>(0,r.jsxs)(`tr`,{className:C.ubExtraRow,children:[(0,r.jsxs)(`td`,{children:[(0,r.jsx)(`span`,{className:C.ubExtraName,children:t.label}),t.note!==void 0&&(0,r.jsx)(`span`,{className:C.ubExtraNote,children:t.note})]}),(0,r.jsx)(`td`,{className:C.numCol,children:t.input===void 0?(0,r.jsx)(`span`,{className:C.na,children:`—`}):R(t.input,e.price.currency)}),(0,r.jsx)(`td`,{className:C.numCol,children:(0,r.jsx)(`span`,{className:C.na,children:`—`})}),(0,r.jsx)(`td`,{className:C.numCol,children:t.output===void 0?(0,r.jsx)(`span`,{className:C.na,children:`—`}):R(t.output,e.price.currency)}),(0,r.jsx)(`td`,{className:C.numCol,children:(0,r.jsx)(`span`,{className:C.na,children:`—`})})]},`${e.key}:${t.label}`))]},e.key)})})]})})]}),(0,r.jsxs)(`section`,{className:C.ubCard,children:[(0,r.jsx)(`div`,{className:C.ubCardHead,children:(0,r.jsx)(`h3`,{className:C.ubCardTitle,children:t(`billing.pricingNotes`)})}),(0,r.jsxs)(`ul`,{className:C.ubNotes,children:[(0,r.jsxs)(`li`,{className:C.ubNotesItem,children:[(0,r.jsx)(`span`,{className:C.ubNotesTerm,children:t(`billing.cacheHit`)}),(0,r.jsx)(`span`,{className:C.ubNotesDesc,children:t(`billing.noteCache`)})]}),(0,r.jsxs)(`li`,{className:C.ubNotesItem,children:[(0,r.jsx)(`span`,{className:C.ubNotesTerm,children:t(`billing.peakBand`)}),(0,r.jsx)(`span`,{className:C.ubNotesDesc,children:t(`billing.noteBand`)})]}),(0,r.jsxs)(`li`,{className:C.ubNotesItem,children:[(0,r.jsx)(`span`,{className:C.ubNotesTerm,children:t(`billing.pricingSource`)}),(0,r.jsx)(`span`,{className:C.ubNotesDesc,children:t(`billing.noteSource`)})]})]})]})]}),_(`billing.dashboard.decor`,{position:`footer`})]}),(0,r.jsxs)(`footer`,{className:C.modalFooter,"data-testid":`billing-footer`,children:[(0,r.jsx)(`span`,{children:t(`billing.footer`)}),(0,r.jsx)(`span`,{children:t(`billing.footerCredit`).replace(`{version}`,e.pluginVersion===void 0?`—`:`v${e.pluginVersion}`)})]})]})})}function _n({provider:e,colorVar:t}){let n=St(e);return n===void 0?(0,r.jsx)(`span`,{className:C.vendorLetter,style:t===void 0?void 0:{background:t},"aria-hidden":`true`,children:e.trim().charAt(0).toUpperCase()}):(0,r.jsx)(`img`,{className:C.vendorLogo,src:n,alt:``,"aria-hidden":`true`})}function vn(e){let{t,checkModels:n,publishCosts:a,registerOpen:o,renderSlot:s,useStore:c,actions:l}=e,[u,p]=(0,i.useState)(nn),[m,_]=(0,i.useState)(Mt),[v,te]=(0,i.useState)([]),[S,C]=(0,i.useState)(void 0),[w,ne]=(0,i.useState)([]),[re,ie]=(0,i.useState)(!1),[ae,T]=(0,i.useState)([]),[oe,se]=(0,i.useState)(`cny`),[ce,E]=(0,i.useState)(()=>d()),D=(0,i.useCallback)(e=>{E(e),f(e)},[]),[le,k]=(0,i.useState)(()=>y()),ue=(0,i.useCallback)(e=>{k(e),ee(e)},[]),[A,de]=(0,i.useState)(()=>h()),fe=(0,i.useCallback)(e=>{de(e),g(e)},[]),[pe,he]=(0,i.useState)(()=>{let e=b();return O(e),e}),j=(0,i.useCallback)(e=>{he(e),O(e),x(e)},[]),_e=(0,i.useMemo)(()=>Vt(u),[u,pe]),ve=oe===`usd`?`en`:`zh`,N=(0,i.useCallback)((e,n)=>{let r=(ve===`en`?vt:_t)[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},[ve,t]),[ye,be]=(0,i.useState)(!1),xe=(0,i.useCallback)(()=>{be(!1)},[]),P=(0,i.useCallback)(()=>{rn().then(e=>{e!==null&&p(Vt(e))}),sn().then(({balances:e,reconcile:t})=>{e.length>0&&te(e),C(t)}),cn().then(e=>{e.length>0&&ne(e),ie(!1)}).catch(()=>{ie(!0)}),ln().then(e=>{T(e)}).catch(()=>{})},[]),Se=(0,i.useCallback)(()=>{P(),on(),be(!0)},[P]);(0,i.useEffect)(()=>{P(),on()},[P]),(0,i.useEffect)(()=>{let e=setInterval(()=>{P(),on()},$t);return()=>{clearInterval(e)}},[P]),(0,i.useEffect)(()=>{let e=!0;return n().then(t=>{e&&(_(t),me(t.catalog??[]))}),()=>{e=!1}},[n]);let F=$(),I=Object.entries(u.byDay).filter(([e])=>e.startsWith(F.slice(0,7))).reduce((e,[,t])=>e+t.cost,0),L=u.byDay[F]?.cost??0,Ce=Wt(u.byDay).reduce((e,t)=>e+t.cost,0),R=(0,i.useMemo)(()=>Wt(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]),we=Object.entries(u.byDay).filter(([e])=>e.startsWith(F.slice(0,7))).reduce((e,[,t])=>e+t.input+t.output,0),z=(()=>{let e=u.byDay[F];return e===void 0?0:e.input+e.output})(),Ee=R.reduce((e,t)=>e+t.tokens,0),B=c(e=>e.enabled),De=c(e=>e.amount),Oe=c(e=>e.tierAlertDays),V=c(e=>e.lastTierSwitchAt),[ke,Ae]=(0,i.useState)(()=>Tt()),[je,Me]=(0,i.useState)(null),[U,Ne]=(0,i.useState)(null),[W,Pe]=(0,i.useState)(()=>Date.now());(0,i.useEffect)(()=>{let e=setInterval(()=>Pe(Date.now()),$t);return()=>{clearInterval(e)}},[]);let Fe=(0,i.useCallback)(e=>{Ae(e),Et(e)},[]),Ie=(0,i.useCallback)(()=>{Ne({entering:M(Date.now())===`peak`?`offPeak`:`peak`,atMs:Date.now()+3*6e4})},[]),G=De>0?De:u.budget??0,Le=(0,i.useCallback)(()=>{let e=!B;l.setEnabled(e),e&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission()},[l,B]);(0,i.useEffect)(()=>{if(!B||G<=0)return;let e=I/G*100,t=$(),n=jt.filter(n=>e>=n&&Oe?.[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=N(`billing.budgetTierBody`).replace(`{cost}`,H(I)).replace(`{budget}`,H(G)).replace(`{pct}`,String(r));try{new Notification(N(`billing.budget`),{body:i})}catch{}},[B,G,I,Oe,l,N]),(0,i.useEffect)(()=>{let e=Dt(W,ke,V);if(e===null||(l.markTierSwitchAlerted(e.atMs),Me(e),!ke.webNotify)||typeof Notification>`u`||Notification.permission!==`granted`)return;let t=Math.max(1,Math.round((e.atMs-W)/6e4)),n=e.entering===`peak`?N(`billing.peakAlertTitlePeak`):N(`billing.peakAlertTitleOff`),r=e.entering===`peak`?N(`billing.tierAlertEnterPeak`).replace(`{minutes}`,String(t)):N(`billing.tierAlertEnterOff`).replace(`{minutes}`,String(t));try{new Notification(n,{body:r})}catch{}},[W,V,ke,l,N]);let K=c(e=>e.lastBalanceAlertDay),q=(0,i.useMemo)(()=>{if(v.length===0)return;let e=u.lowBalanceThreshold??50,t=zt(u.byDay,F),n=ge().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,F]);(0,i.useEffect)(()=>{if(q===void 0)return;let e=$();if(K===e||(l.markBalanceAlerted(e),typeof Notification>`u`||Notification.permission!==`granted`))return;let t=N(`billing.balanceLowBody`).replace(`{name}`,q.name).replace(`{balance}`,H(q.cny)).replace(`{days}`,q.days===void 0?`—`:String(q.days));try{new Notification(N(`billing.balance`),{body:t})}catch{}},[q,K,l,N]);let Re=(0,i.useMemo)(()=>{let e=F.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=Te(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`?N(`billing.balanceUnauthorized`):t?.error===`unreachable`||t?.error===`invalid`?N(`billing.balanceUnreachable`):N(`billing.balanceUnconfigured`),low:!1};let n=t.currency===`USD`?`$${t.totalBalance.toFixed(2)}`:H(t.totalBalance),r=ge().rate;return{text:n,low:(t.currency===`USD`?t.totalBalance*r:t.totalBalance)<(u.lowBalanceThreshold??50)}},a=e=>{let t=w.find(t=>t.displayName===e||Rt(t.provider)===e);if(t===void 0||t.windows.length===0)return{text:N(`billing.subscriptionNoApi`),low:!1};let n=t.windows.reduce((e,t)=>Math.min(e,t.remainingPercent),100);return{text:n<=0?N(`billing.subscriptionExhausted`):N(`billing.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,w,F]),ze=(0,i.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,i.useEffect)(()=>{a({todayCost:L,monthCost:I})},[L,I,a]),(0,i.useEffect)(()=>o(Se),[o,Se]);let Be=(0,i.useMemo)(()=>u.byTurn??[],[u.byTurn]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(fn,{...e,t:N,onOpen:Se,monthCost:I,todayCost:L,weekCost:Ce,days:R,vendorStatus:Re,dash:ze,cardPrefs:A,monthTokens:we,todayTokens:z,weekTokens:Ee,floatPrefs:ce,subscriptions:w}),ye&&(0,r.jsx)(gn,{stats:_e,t:N,onClose:xe,userPrices:pe,onUserPrices:j,health:m,balances:v,...S===void 0?{}:{reconcile:S},quotas:w,relayQuotas:ae,currency:oe,onCurrency:se,turns:Be,renderSlot:s,budgetEnabled:B,budgetAmount:G,onToggleBudget:Le,onBudgetAmount:l.setAmount,peakConfig:ke,onPeakConfig:Fe,onPreviewPeak:Ie,floatPrefs:ce,onFloatPrefs:D,cardPrefs:A,onCardPrefs:fe,sitePrefs:le,onSitePrefs:ue,quotasStale:re}),(je!==null||U!==null)&&(0,r.jsx)(Ot,{hit:je??U,config:ke,t:N,onDismiss:()=>{Me(null),Ne(null)}})]})}function yn(e,t){return t===void 0||e?.bySession===void 0?0:e.bySession.find(e=>e.id===t)?.cost??0}function bn(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 xn(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 Sn(){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 Cn(){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 wn(e){switch(e){case`session`:return`billing.subscriptionSession`;case`weekly`:return`billing.subscriptionWeekly`;case`monthly`:return`billing.subscriptionMonthly`;default:return`billing.subscriptionBilling`}}function Tn({sessionId:e,t}){let[n,a]=(0,i.useState)(null),[o,s]=(0,i.useState)([]),[c,l]=(0,i.useState)(()=>Date.now());(0,i.useEffect)(()=>{let e=!1,t=()=>{Sn().then(t=>{!e&&t!==null&&a(t)}),Cn().then(t=>{e||s(t)}),e||l(Date.now())};t();let n=setInterval(t,3e4);return()=>{e=!0,clearInterval(n)}},[e]);let u=(0,i.useMemo)(()=>yn(n,e),[n,e]),d=(0,i.useMemo)(()=>bn(n,e),[n,e]),f=xe(c),p=(0,i.useMemo)(()=>xn(o),[o]),m=e=>H(e,`cny`),h=u>0||d>0,g=f.tier===`peak`;return(0,r.jsxs)(`span`,{className:C.feeBar,"data-testid":`billing-live-cost-bar`,children:[(0,r.jsx)(`span`,{className:g?C.feeChipPrimary:C.feeChipOff,"data-testid":`billing-live-tier`,children:t(g?`billing.tierPeak`:`billing.tierOff`)}),(0,r.jsx)(`span`,{className:C.feeCount,children:Se(f.nextSwitchInMs)}),(0,r.jsx)(`span`,{className:C.feeSuffix,children:t(g?`billing.tierToOff`:`billing.tierToPeak`)}),h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{className:C.feeSep,"aria-hidden":`true`,children:`·`}),(0,r.jsxs)(`span`,{className:C.feeItem,"data-testid":`billing-live-turn`,children:[t(`billing.liveTurn`),` `,(0,r.jsx)(`span`,{className:C.feeNum,children:m(d)})]}),(0,r.jsx)(`span`,{className:C.feeSep,"aria-hidden":`true`,children:`·`}),(0,r.jsxs)(`span`,{className:C.feeItem,"data-testid":`billing-live-session`,children:[t(`billing.liveSession`),` `,(0,r.jsx)(`span`,{className:C.feeNum,children:m(u)})]})]}),p.map(e=>(0,r.jsxs)(`span`,{children:[(0,r.jsx)(`span`,{className:C.feeSep,"aria-hidden":`true`,children:`·`}),(0,r.jsxs)(`span`,{className:e.pct<=10?C.feeChipError:C.feeChipAlert,"data-testid":`billing-live-quota`,children:[e.name,` `,t(wn(e.kind)),` `,e.pct,`%`]})]},`${e.name}:${e.kind}`))]})}function En(){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 Dn(){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 On={enabled:!1,timeout:0};function kn(){try{let e=localStorage.getItem(`dsh-billing-completion-notify-v1`);if(e===null)return{...On};let t=JSON.parse(e);return{enabled:t.enabled===!0,timeout:typeof t.timeout==`number`?t.timeout:0}}catch{return{...On}}}function An(e){return e.completed===!0?!0:e.running===!1}function jn(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)),An(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=An(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 Mn=[`slots`,`locale`,`remote`,`remote.llm`,`sessions`];function Nn(e){let t=En();e.provide(`billingMetrics`,t);let n=Dn();e.effect(()=>e.locale.register(gt,{zh:_t,en:vt}),`ui-usage-billing: dictionaries`),e.slots.inject(`sidebar.footer.action`,()=>e.slots.register({name:`sidebar.footer.action`,id:`usage-billing`,order:-10,locale:gt,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:!0,available:!1,models:0,failures:0,okProviders:[],badProviders:[]}}},publishCosts:e=>{t.publishCosts(e)},registerOpen:e=>t.registerOpen(e)})},vn)),e.slots.inject(`conversation.composer.dock`,()=>e.slots.register({name:`conversation.composer.dock`,id:`usage-billing-cost`,order:0,locale:gt},Tn)),e.effect(()=>jn(e.sessions.list,kn),`ui-usage-billing: completion notifier`)}return n.UsageBilling=vn,n.apply=Nn,n.inject=Mn,t.exports}});
6
6
  //# sourceMappingURL=client.js.map