@kenz1117/dsh-ui-usage-billing 1.0.6 → 1.0.8
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 +5 -5
- package/lib/index.js +78 -12
- package/lib/types/aggregate.d.ts +51 -5
- package/lib/types/client/PerfPanel.d.ts +4 -0
- package/lib/types/client/TokenPanel.d.ts +3 -2
- package/lib/types/client/UsageBilling.d.ts +30 -11
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/pricing.d.ts +37 -0
- package/lib/types/client/usage-billing-settings.d.ts +19 -0
- package/package.json +4 -2
package/lib/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({id:`@kenz1117/dsh-ui-usage-billing`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});let r=e("react"),i=e("@deepseek-ai/dsh-client-ui-primitives"),a=e("react/jsx-runtime"),o=e("@deepseek-ai/dsh-client-runtime/client");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 _=`@kenz1117/dsh-ui-usage-billing/UsageBilling.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(_)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=_,e.textContent=`.VWh0dG_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}.VWh0dG_railButton:hover,.VWh0dG_railButton:focus-visible{border-color:var(--dsw-static-blue-500);color:var(--dsw-static-blue-500);outline:none}.VWh0dG_railButton svg{stroke-width:2px;width:18px;height:18px}.VWh0dG_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}.VWh0dG_trigger:hover,.VWh0dG_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)}.VWh0dG_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}.VWh0dG_triggerIcon svg{stroke-width:2px;width:16px;height:16px}.VWh0dG_triggerMain{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.VWh0dG_triggerPrimary{align-items:baseline;gap:5px;min-width:0;display:inline-flex}.VWh0dG_triggerLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:11px;line-height:15px;overflow:hidden}.VWh0dG_triggerYen{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;font-weight:600;line-height:16px}.VWh0dG_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}.VWh0dG_triggerSub{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:10px;line-height:14px;overflow:hidden}.VWh0dG_triggerSpark{flex:none;align-items:flex-end;gap:2px;height:20px;display:flex}.VWh0dG_triggerSparkBar,.VWh0dG_triggerSparkHot{background:var(--dsw-static-blue-500);opacity:.6;border-radius:1px 1px 0 0;width:3px}.VWh0dG_triggerSparkHot{opacity:1}.VWh0dG_triggerWrap{flex:auto;width:100%;min-width:0;display:block;position:relative;container:VWh0dG_billing-trigger/inline-size}@container VWh0dG_billing-trigger (width<=200px){.VWh0dG_trigger{gap:6px;padding:8px 10px}.VWh0dG_triggerSpark{display:none}}@container VWh0dG_billing-trigger (width<=170px){.VWh0dG_triggerSub,.VWh0dG_triggerLabel{display:none}}@container VWh0dG_billing-trigger (width<=110px){.VWh0dG_triggerIcon,.VWh0dG_triggerSpark,.VWh0dG_triggerSub,.VWh0dG_triggerLabel{display:none}.VWh0dG_trigger{justify-content:center;padding:8px 6px}}.VWh0dG_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)}.VWh0dG_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 VWh0dG_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}.VWh0dG_triggerWrap:hover .VWh0dG_triggerPop,.VWh0dG_triggerWrap:focus-within .VWh0dG_triggerPop{opacity:1;transform:translateY(0)}.VWh0dG_popHead{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.VWh0dG_popTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:700;line-height:18px}.VWh0dG_metricGrid{grid-template-columns:repeat(3,1fr);gap:10px 8px;display:grid}.VWh0dG_metricCell{flex-direction:column;gap:2px;min-width:0;display:flex}.VWh0dG_metricLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.VWh0dG_metricValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:12px;font-weight:700;line-height:16px}.VWh0dG_metricValuePrimary{color:var(--dsw-static-amber-500)}.VWh0dG_metricValueSuccess{color:var(--dsw-static-green-500)}.VWh0dG_popModel{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:6px;padding-top:10px;display:flex}.VWh0dG_popModelLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.VWh0dG_popModelRow{align-items:center;gap:8px;min-width:0;display:flex}.VWh0dG_popDot{border-radius:999px;flex:none;width:6px;height:6px}.VWh0dG_popDotDirect{background:var(--dsw-static-green-500)}.VWh0dG_popDotSub{background:var(--dsw-static-amber-500)}.VWh0dG_popDotNeutral{background:var(--dsw-alias-label-tertiary)}.VWh0dG_popTagPrimary,.VWh0dG_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}.VWh0dG_popTagPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.VWh0dG_popTagSub{background:color-mix(in srgb, var(--dsw-static-amber-500) 18%, transparent);color:var(--dsw-static-amber-500)}.VWh0dG_popModelName{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:16px;overflow:hidden}.VWh0dG_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}.VWh0dG_popModelStatusLow{color:var(--dsw-static-red-500)}.VWh0dG_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 VWh0dG_dashboardIn;box-shadow:0 12px 32px -12px #0000002e,0 2px 8px #0000000f}@keyframes VWh0dG_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)}.VWh0dG_dashboard{flex-direction:column;width:100%;max-height:min(760px,88vh);display:flex}.VWh0dG_dashboardHead{border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:12px;padding:20px 24px;display:flex}.VWh0dG_dashboardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:600;line-height:24px}.VWh0dG_dashboardSubtitle{color:var(--dsw-alias-label-caption);margin:2px 0 0;font-size:11px;line-height:16px}.VWh0dG_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}.VWh0dG_closeButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.VWh0dG_closeButton svg{stroke-width:2px;width:16px;height:16px}.VWh0dG_dashboardBody{flex-direction:column;gap:14px;padding:16px 24px 24px;display:flex;overflow-y:auto}.VWh0dG_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}.VWh0dG_tabNav{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:4px;padding:0 24px;display:flex}.VWh0dG_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}.VWh0dG_tabButton:hover,.VWh0dG_tabButton:focus-visible{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 62%, transparent);outline:none}.VWh0dG_tabButtonActive,.VWh0dG_tabButtonActive:hover,.VWh0dG_tabButtonActive:focus-visible{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);font-weight:600}.VWh0dG_tabPanel{flex-direction:column;gap:14px;animation:.14s ease-out VWh0dG_tabPanelIn;display:flex}@keyframes VWh0dG_tabPanelIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.VWh0dG_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}.VWh0dG_reconcileIcon{color:var(--dsw-alias-label-tertiary);flex:none;margin-top:1px;display:inline-flex}.VWh0dG_reconcileText{flex:1}.VWh0dG_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}.VWh0dG_reconcileDismiss:hover{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent)}.VWh0dG_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}.VWh0dG_heroTop{justify-content:space-between;align-items:center;gap:24px;display:flex}.VWh0dG_heroMain{flex-direction:column;gap:2px;min-width:0;display:flex}.VWh0dG_heroLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:16px}.VWh0dG_heroReadout{align-items:baseline;gap:4px;display:flex}.VWh0dG_heroCurrency{letter-spacing:-.01em;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:22px;font-weight:600;line-height:28px}.VWh0dG_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}.VWh0dG_heroMeta{color:var(--dsw-alias-label-caption);white-space:nowrap;margin-top:4px;font-size:12px;line-height:17px}.VWh0dG_heroGauge{flex:none;width:96px;height:96px;position:relative}.VWh0dG_heroGaugeSvg{width:100%;height:100%;display:block;transform:rotate(-90deg)}.VWh0dG_heroGaugeTrack{fill:none;stroke:var(--dsw-alias-bg-module-platform);stroke-width:9px}.VWh0dG_heroGaugeArc{fill:none;stroke:var(--dsw-static-blue-500);stroke-width:9px;stroke-linecap:round;transition:stroke-dasharray .26s}.VWh0dG_heroGaugeArcOver{stroke:var(--dsw-static-red-500)}.VWh0dG_heroGaugeCenter{flex-direction:column;justify-content:center;align-items:center;gap:1px;display:flex;position:absolute;inset:0}.VWh0dG_heroGaugePct{letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);font-size:18px;font-weight:700;line-height:22px}.VWh0dG_heroGaugePctOver{color:var(--dsw-static-red-500)}.VWh0dG_heroGaugeLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.VWh0dG_heroBudget{border-top:1px solid var(--dsw-alias-border-l1);align-items:center;gap:14px;padding-top:14px;display:flex}.VWh0dG_heroBudgetLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px;line-height:16px}.VWh0dG_heroBudgetTrack{background:var(--dsw-alias-border-l1);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.VWh0dG_heroBudgetFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .22s}.VWh0dG_heroBudgetFillOver{background:var(--dsw-static-red-500)}.VWh0dG_heroBudgetValue{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px;line-height:16px}.VWh0dG_heroSide{border-top:1px solid var(--dsw-alias-border-l1);align-items:stretch;padding-top:14px;display:flex}.VWh0dG_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}.VWh0dG_heroSideItem:first-child{border-left:none;padding-left:0}.VWh0dG_heroSideLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:15px}.VWh0dG_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}.VWh0dG_heroSideSpacer{flex:1;display:block}.VWh0dG_delta{align-items:center;gap:2px;margin-left:4px;font-size:11px;font-weight:600;line-height:17px;display:inline-flex}.VWh0dG_deltaUp{color:var(--dsw-static-green-500)}.VWh0dG_deltaDown{color:var(--dsw-static-red-500)}.VWh0dG_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}.VWh0dG_kpiGrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;display:grid}.VWh0dG_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}.VWh0dG_kpiTile:hover{border-color:var(--dsw-alias-border-l2)}.VWh0dG_kpiLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:15px}.VWh0dG_kpiValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:24px;font-weight:600;line-height:32px}.VWh0dG_kpiGreen{color:var(--dsw-static-green-500)}.VWh0dG_kpiDetail{color:var(--dsw-alias-label-caption);white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:15px;overflow:hidden}.VWh0dG_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}.VWh0dG_panelHead{justify-content:space-between;align-items:baseline;gap:10px;display:flex}.VWh0dG_panelTitle{letter-spacing:-.005em;color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:600;line-height:20px}.VWh0dG_panelHint{color:var(--dsw-alias-label-caption);white-space:nowrap;font-size:11px;line-height:16px}.VWh0dG_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}.VWh0dG_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}.VWh0dG_rangeButtonActive{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);font-weight:600}.VWh0dG_exportBar{justify-content:flex-end;align-items:center;gap:8px;display:flex}.VWh0dG_exportLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:16px}.VWh0dG_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}.VWh0dG_exportButton:hover,.VWh0dG_exportButton:focus-visible{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);outline:none}.VWh0dG_shareTrack{background:var(--dsw-alias-bg-module-platform);border-radius:999px;height:10px;display:flex;overflow:hidden}.VWh0dG_shareSeg{height:100%;transition:width .2s}.VWh0dG_shareSegPeak{background:var(--dsw-static-blue-500)}.VWh0dG_shareSegOff{background:color-mix(in srgb, var(--dsw-static-blue-500) 25%, var(--dsw-alias-bg-module-platform))}.VWh0dG_shareSegUser{background:var(--dsw-static-blue-500)}.VWh0dG_shareSegAssistant{background:var(--dsw-static-green-500)}.VWh0dG_shareSegTool{background:var(--dsw-static-amber-500)}.VWh0dG_shareLegend{align-items:center;gap:16px;display:flex}.VWh0dG_shareItem{color:var(--dsw-alias-label-secondary);align-items:baseline;gap:6px;font-size:12px;line-height:17px;display:inline-flex}.VWh0dG_bucketCost{align-items:baseline;gap:3px;display:inline-flex}.VWh0dG_bucketOfficial{color:var(--dsw-static-blue-500);font-weight:600}.VWh0dG_bucketSep{color:var(--dsw-alias-label-dimmed)}.VWh0dG_bucketThird{color:var(--dsw-alias-label-secondary)}.VWh0dG_shareDot{border-radius:50%;flex:none;align-self:center;width:8px;height:8px}.VWh0dG_shareValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.VWh0dG_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}.VWh0dG_budgetInput:focus-visible{outline:none}.VWh0dG_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}.VWh0dG_switchOn{border-color:var(--dsw-alias-border-l1);background:var(--dsw-alias-label-primary)}.VWh0dG_switchKnob{background:var(--dsw-static-neutral-bluish-00);border-radius:50%;width:11px;height:11px;transition:transform .16s;position:absolute;top:2px;left:2px}.VWh0dG_switchOn .VWh0dG_switchKnob{transform:translate(13px)}.VWh0dG_budgetFillWarn{background:var(--dsw-static-amber-500)}.VWh0dG_budgetFillOver{background:var(--dsw-static-red-500);animation:1.6s ease-in-out infinite VWh0dG_budgetOverPulse}@keyframes VWh0dG_budgetOverPulse{50%{opacity:.55}}.VWh0dG_chartWrap{width:100%;position:relative}.VWh0dG_chartSvg{width:100%;height:auto;display:block}.VWh0dG_chartEmpty{height:140px;color:var(--dsw-alias-label-caption);justify-content:center;align-items:center;font-size:13px;display:flex}.VWh0dG_emptyRow{text-align:center;color:var(--dsw-alias-label-caption);padding:28px 0;font-size:13px}.VWh0dG_chartGrid{stroke:var(--dsw-alias-border-l1);stroke-width:1px}.VWh0dG_chartAxisLabel{fill:var(--dsw-alias-label-tertiary);font-size:10px}.VWh0dG_chartBar{fill:var(--dsw-static-blue-500);opacity:.7}.VWh0dG_chartBar:hover{opacity:1}.VWh0dG_chartStack{stroke:var(--dsw-alias-bg-layer-1);stroke-width:.75px}.VWh0dG_chartStack:hover{opacity:.9}.VWh0dG_chartLine{stroke:var(--dsw-static-blue-500);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.VWh0dG_chartCrosshair{stroke:var(--dsw-alias-label-dimmed);stroke-width:1px;stroke-dasharray:3 3}.VWh0dG_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))}.VWh0dG_chartTooltipDate{color:var(--dsw-alias-label-primary);margin-bottom:3px;font-size:11px;font-weight:600}.VWh0dG_chartTooltipRow{color:var(--dsw-alias-label-secondary);align-items:center;gap:5px;font-size:11px;line-height:17px;display:flex}.VWh0dG_chartTooltipRow strong{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.VWh0dG_chartBarPlaceholder{fill:color-mix(in srgb, var(--dsw-alias-label-secondary) 30%, transparent)}.VWh0dG_chartLegendLine{background:var(--dsw-static-blue-500);border-radius:2px;width:10px;height:3px;display:inline-block}.VWh0dG_chartLegendBar{background:var(--dsw-static-blue-500);opacity:.5;border-radius:2px;width:7px;height:7px;display:inline-block}.VWh0dG_chartTooltipSwatch{border-radius:3px;flex:none;width:8px;height:8px;display:inline-block}.VWh0dG_chartLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-end;gap:14px;margin-top:2px;font-size:11px;display:flex}.VWh0dG_chartLegend span{align-items:center;gap:5px;display:inline-flex}.VWh0dG_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}.VWh0dG_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}.VWh0dG_ubAlertLeft{align-items:center;gap:8px;display:inline-flex}.VWh0dG_ubRate{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.VWh0dG_ubAlertNote{color:var(--dsw-alias-label-secondary);margin:0}.VWh0dG_ubTag,.VWh0dG_ubTagSuccess,.VWh0dG_ubTagNeutral,.VWh0dG_ubTagAlert,.VWh0dG_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}.VWh0dG_ubTagSuccess{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.VWh0dG_ubTagNeutral{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary)}.VWh0dG_ubTagAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.VWh0dG_ubTagPromo{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500);cursor:help}.VWh0dG_ubExtraRow td{opacity:.72;padding-top:2px;padding-bottom:2px;font-size:12px}.VWh0dG_ubExtraName{color:var(--dsw-alias-label-secondary);margin-left:26px}.VWh0dG_ubExtraNote{color:var(--dsw-alias-label-tertiary);margin-left:8px;font-size:10px}.VWh0dG_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}.VWh0dG_ubCardHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.VWh0dG_ubCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.VWh0dG_ubCardSub{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.VWh0dG_ubTablewrap{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;overflow:auto}.VWh0dG_ubTable{border-collapse:collapse;white-space:nowrap;width:100%;font-size:12.5px}.VWh0dG_ubTable th,.VWh0dG_ubTable td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;padding:9px 12px}.VWh0dG_ubTable tbody tr:last-child td{border-bottom:0}.VWh0dG_ubTable thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;font-size:11px;font-weight:600}.VWh0dG_ubModel{align-items:center;gap:8px;display:inline-flex}.VWh0dG_vendorLogo{object-fit:contain;border-radius:4px;flex:none;width:18px;height:18px}.VWh0dG_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}.VWh0dG_ubModelName{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-weight:500;display:inline-flex}.VWh0dG_ubPricepair{flex-wrap:wrap;gap:6px;display:inline-flex}.VWh0dG_ubChipPeak,.VWh0dG_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}.VWh0dG_ubChipLabel{font-size:10px;font-weight:600}.VWh0dG_ubChipPeak{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.VWh0dG_ubChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.VWh0dG_ubNotes{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.VWh0dG_ubNotesItem{align-items:baseline;gap:10px;display:flex}.VWh0dG_ubNotesTerm{color:var(--dsw-alias-label-primary);flex:0 0 72px;font-size:12px;font-weight:500}.VWh0dG_ubNotesDesc{min-width:0;color:var(--dsw-alias-label-secondary);flex:1;font-size:12px;line-height:17px}.VWh0dG_ubCardControlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.VWh0dG_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}.VWh0dG_ubStatGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.VWh0dG_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}.VWh0dG_ubStatLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.VWh0dG_ubStatValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:22px;font-weight:700;line-height:28px}.VWh0dG_ubStatDetail{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.VWh0dG_rowlist{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.VWh0dG_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}.VWh0dG_rowline:hover{background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 60%, transparent);border-color:var(--dsw-alias-border-l1)}.VWh0dG_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}.VWh0dG_rowlineRight{font-variant-numeric:tabular-nums;flex:none;align-items:baseline;gap:8px;display:inline-flex}.VWh0dG_rowlineMuted{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.VWh0dG_rowlineChev{color:var(--dsw-alias-label-tertiary);font-size:14px}.VWh0dG_rowlineDrillWrap{padding-left:12px}.VWh0dG_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}.VWh0dG_modelTable,.VWh0dG_pricingTable{border-collapse:collapse;width:100%;font-size:12.5px}.VWh0dG_modelTable th,.VWh0dG_modelTable td,.VWh0dG_pricingTable th,.VWh0dG_pricingTable td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;white-space:nowrap;padding:9px 12px}.VWh0dG_modelTable tbody tr:last-child td,.VWh0dG_pricingTable tbody tr:last-child td{border-bottom:0}.VWh0dG_modelTable thead th,.VWh0dG_pricingTable thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;background:0 0;font-size:11px;font-weight:600}.VWh0dG_modelTable tbody tr,.VWh0dG_pricingTable tbody tr{transition:background-color .12s}.VWh0dG_modelTable tbody tr:hover,.VWh0dG_pricingTable tbody tr:hover{background:0 0}.VWh0dG_numCol{text-align:right;font-variant-numeric:tabular-nums}.VWh0dG_na{color:var(--dsw-alias-label-dimmed)}.VWh0dG_modelCell{align-items:center;gap:8px;display:inline-flex}.VWh0dG_modelDot{border-radius:50%;flex:none;width:9px;height:9px}.VWh0dG_modelName{color:var(--dsw-alias-label-primary);font-weight:500;line-height:16px;display:block}.VWh0dG_modelProvider{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px;display:block}.VWh0dG_pricingToggle:hover .VWh0dG_panelTitle,.VWh0dG_pricingToggle:focus-visible .VWh0dG_panelTitle{color:var(--dsw-alias-label-primary)}.VWh0dG_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}.VWh0dG_siteRowName{align-items:center;gap:8px;min-width:0;display:inline-flex}.VWh0dG_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}.VWh0dG_siteKindSite{color:var(--dsw-static-blue-500);background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent)}.VWh0dG_siteKindDirect{color:var(--dsw-static-green-500);background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent)}.VWh0dG_siteKindUnknown{color:var(--dsw-static-red-500);background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent)}.VWh0dG_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}.VWh0dG_siteRowMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.VWh0dG_siteRowCost{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:12.5px;font-weight:700;line-height:18px}.VWh0dG_siteRowCalls{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:11.5px;line-height:17px}.VWh0dG_siteRowCallsLow{color:var(--dsw-static-red-500)}.VWh0dG_flatTag{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px}.VWh0dG_healthDot{border-radius:50%;flex:none;width:8px;height:8px;display:inline-block}.VWh0dG_healthOk{background:var(--dsw-static-green-500)}.VWh0dG_healthBad{background:var(--dsw-static-red-500)}.VWh0dG_healthIdle{background:var(--dsw-static-neutral-bluish-400)}.VWh0dG_dashboardRight{align-items:center;gap:8px;min-width:0;display:flex}.VWh0dG_healthBadge{white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:3px 9px;font-size:11px;line-height:16px;display:inline-flex}.VWh0dG_healthBadgeOk{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2)}.VWh0dG_healthBadgeBad{color:var(--dsw-static-red-500);background:var(--dsw-alias-bg-layer-2)}.VWh0dG_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}.VWh0dG_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}.VWh0dG_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}.VWh0dG_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}.VWh0dG_feeCount{color:var(--dsw-alias-label-primary);font-weight:600}.VWh0dG_feeSuffix{color:var(--dsw-alias-label-tertiary)}.VWh0dG_feeItem{color:var(--dsw-alias-label-secondary);white-space:nowrap}.VWh0dG_feeNum{color:var(--dsw-alias-label-primary)}.VWh0dG_feeSep{color:var(--dsw-alias-label-tertiary)}.VWh0dG_feeChipPrimary,.VWh0dG_feeChipOff,.VWh0dG_feeChipAlert,.VWh0dG_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}.VWh0dG_feeChipPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.VWh0dG_feeChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.VWh0dG_feeChipAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.VWh0dG_feeChipError{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500)}.VWh0dG_balanceCell{align-items:center;gap:6px;display:inline-flex;position:relative}.VWh0dG_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}.VWh0dG_balanceDaysBadge:hover{border-color:var(--dsw-alias-label-secondary);background:color-mix(in srgb, var(--dsw-alias-label-caption) 18%, transparent)}.VWh0dG_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)}.VWh0dG_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}.VWh0dG_balanceDetailHead{justify-content:space-between;align-items:center;gap:12px;display:flex}.VWh0dG_balanceDetailTitle{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600}.VWh0dG_balanceDetailClose{cursor:pointer;color:var(--dsw-alias-label-caption);background:0 0;border:none;font-size:14px;line-height:1}.VWh0dG_balanceDetailClose:hover{color:var(--dsw-alias-label-primary)}.VWh0dG_balanceDetailGrid{flex-direction:column;gap:4px;display:inline-flex}.VWh0dG_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}.VWh0dG_balanceDetailLabel{color:var(--dsw-alias-label-caption)}.VWh0dG_balanceDetailValue{color:var(--dsw-alias-label-primary);font-weight:500}body[data-zine-mode] .VWh0dG_trigger,body[data-zine-mode] .VWh0dG_triggerPop,body[data-zine-mode] .VWh0dG_railButton{display:none}body[data-zine-mode] .VWh0dG_dashboardHead{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .VWh0dG_headTitleRow{align-items:center;gap:8px;margin-top:4px;display:flex}body[data-zine-mode] .VWh0dG_dashboardTitle{color:#e8ff00;letter-spacing:.04em;text-transform:uppercase;text-shadow:0 0 8px #e8ff0066;font-weight:900}body[data-zine-mode] .VWh0dG_dashboardSubtitle{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px}body[data-zine-mode] .VWh0dG_closeButton{color:#0a0a05;background:#ff2d95;border:1.5px solid #ff2d95;border-radius:0;box-shadow:0 0 10px #ff2d9573}body[data-zine-mode] .VWh0dG_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] .VWh0dG_heroLabel{color:#c9d98a;letter-spacing:.12em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .VWh0dG_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] .VWh0dG_heroMeta{color:#c9d98a;letter-spacing:.06em;text-transform:uppercase;font-size:10.5px}body[data-zine-mode] .VWh0dG_heroSideLabel{color:#c9d98a;letter-spacing:.1em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .VWh0dG_heroSideValue{color:#e8ff00;text-shadow:0 0 6px #e8ff0059}body[data-zine-mode] .VWh0dG_delta{font-weight:900}body[data-zine-mode] .VWh0dG_deltaUp{color:#ff2d95}body[data-zine-mode] .VWh0dG_deltaDown{color:#c9d98a}body[data-zine-mode] .VWh0dG_tabNav{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .VWh0dG_tabButton{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;border-radius:0;font-size:10.5px;font-weight:900}body[data-zine-mode] .VWh0dG_tabButton:hover,body[data-zine-mode] .VWh0dG_tabButton:focus-visible{color:#e8ff00;background:#e8ff001f}body[data-zine-mode] .VWh0dG_tabButtonActive,body[data-zine-mode] .VWh0dG_tabButtonActive:hover,body[data-zine-mode] .VWh0dG_tabButtonActive:focus-visible{color:#0a0a05;background:#e8ff00;box-shadow:0 0 10px #e8ff0073}body[data-zine-mode] .VWh0dG_panel{background:#000;border:2px solid #e8ff00;border-radius:0}body[data-zine-mode] .VWh0dG_trendPanel{position:relative}body[data-zine-mode] .VWh0dG_panelTitle{color:#e8ff00;letter-spacing:.06em;text-transform:uppercase;text-shadow:0 0 6px #e8ff0066;font-weight:900}body[data-zine-mode] .VWh0dG_panelHint{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .VWh0dG_modelTableScroll{background:#000;border:1.5px solid #e8ff0080;border-radius:0}.VWh0dG_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}.VWh0dG_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}.VWh0dG_currencyButtonActive{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}.VWh0dG_subscriptionGrid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin-top:10px;display:grid}.VWh0dG_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}.VWh0dG_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 VWh0dG_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}@keyframes VWh0dG_subscriptionGoldFlow{0%{background-position:200% 0}to{background-position:-200% 0}}.VWh0dG_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}.VWh0dG_subscriptionHead{flex-wrap:wrap;align-items:baseline;gap:6px;margin-bottom:8px;display:flex}.VWh0dG_subscriptionName{font-size:13px;font-weight:700}.VWh0dG_subscriptionPlan{color:var(--dsw-alias-label-secondary);font-size:11px}.VWh0dG_subscriptionPlan[data-kind=code],.VWh0dG_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}.VWh0dG_subscriptionTier{color:var(--dsw-alias-label-secondary);margin-left:6px}.VWh0dG_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}.VWh0dG_subscriptionStatus{color:var(--dsw-alias-label-secondary);margin-bottom:6px;font-size:11px}.VWh0dG_subscriptionWindow{align-items:center;gap:10px;margin-top:8px;font-size:11px;display:flex}.VWh0dG_subscriptionWindowLabel{color:var(--dsw-alias-label-secondary);flex:0 0 44px}.VWh0dG_subscriptionTrack{background:var(--dsw-alias-bg-layer-3);border-radius:3px;flex:1;height:6px;overflow:hidden}.VWh0dG_subscriptionFill{background:var(--dsw-static-blue-500);border-radius:3px;height:100%;transition:width .2s;display:block}.VWh0dG_subscriptionFillWarn{background:var(--dsw-static-amber-500)}.VWh0dG_subscriptionFillOver{background:var(--dsw-static-red-500)}.VWh0dG_subscriptionMeta{flex-direction:column;flex:none;align-items:flex-end;gap:2px;display:flex}.VWh0dG_subscriptionPct{text-align:right;font-variant-numeric:tabular-nums;flex:none;min-width:52px}.VWh0dG_subscriptionExhausted{color:var(--dsw-static-red-500);min-width:52px;font-weight:600}.VWh0dG_subscriptionReset{color:var(--dsw-alias-label-caption);white-space:nowrap;flex:none;font-size:10px}.VWh0dG_providerGroupList{flex-direction:column;gap:10px;display:flex}.VWh0dG_providerGroup{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;padding:12px 14px}.VWh0dG_providerGroupHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.VWh0dG_providerGroupTitle{align-items:center;gap:7px;min-width:0;display:inline-flex}.VWh0dG_providerGroupName{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px}.VWh0dG_providerGroupMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.VWh0dG_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}.VWh0dG_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}.VWh0dG_providerGroupBalanceLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:17px}.VWh0dG_rounds{margin-top:10px}.VWh0dG_roundsBars{align-items:flex-end;gap:3px;height:124px;padding:16px 2px 0;display:flex;overflow-x:auto}.VWh0dG_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}.VWh0dG_roundsBarColPeak{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent)}.VWh0dG_roundsBarColOff{background:var(--dsw-alias-bg-module-platform)}.VWh0dG_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%)}.VWh0dG_roundsBarWrap{flex:1;align-items:flex-end;min-height:0;display:flex}.VWh0dG_roundsBar{background:var(--dsw-static-blue-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.VWh0dG_roundsBarFlagged{background:var(--dsw-static-red-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.VWh0dG_roundsFlagMark{background:var(--dsw-static-red-500);border-radius:50%;width:7px;height:7px;position:absolute;top:-3px;right:-3px}.VWh0dG_roundsAxis{color:var(--dsw-alias-label-secondary);justify-content:space-between;margin-top:6px;font-size:10px;display:flex}.VWh0dG_roundsEmpty{color:var(--dsw-alias-label-secondary);margin-top:10px;font-size:12px}.VWh0dG_heatmap{margin-top:10px}.VWh0dG_heatmapGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;display:grid}.VWh0dG_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}.VWh0dG_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}.VWh0dG_heatmapCell[data-level="0"],.VWh0dG_heatmapCell[data-level="1"],.VWh0dG_heatmapCell[data-level="2"]{color:var(--dsw-alias-label-primary)}.VWh0dG_heatmapCell[data-level="3"],.VWh0dG_heatmapCell[data-level="4"]{color:var(--dsw-static-neutral-bluish-00)}.VWh0dG_heatmapFooter{color:var(--dsw-alias-label-secondary);align-items:center;gap:8px;margin-top:10px;font-size:10px;display:flex}.VWh0dG_heatmapLegend{gap:3px;display:inline-flex}.VWh0dG_heatmapLegend i{border-radius:4px;width:14px;height:14px;display:block}.VWh0dG_heatmapHover{font-variant-numeric:tabular-nums;margin-left:auto}.VWh0dG_heatmapRangeSwitch{gap:4px;margin-left:auto;display:inline-flex}.VWh0dG_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}.VWh0dG_heatmapRangeButtonActive{color:var(--dsw-alias-text-primary);border-color:currentColor;font-weight:600}.VWh0dG_heatmapYear{flex-direction:column;gap:6px;display:flex}.VWh0dG_heatmapYearBody{align-items:flex-start;gap:6px;display:flex}.VWh0dG_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}.VWh0dG_heatmapYearWeekday{white-space:nowrap;text-align:right;height:11px}.VWh0dG_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}.VWh0dG_heatmapYearMonth{white-space:nowrap;overflow:visible}.VWh0dG_heatmapYearScroll{padding-bottom:2px;overflow-x:auto}.VWh0dG_heatmapYearGrid{grid-template-rows:repeat(7,11px);grid-auto-flow:column;gap:3px;min-width:max-content;display:grid}.VWh0dG_heatmapYearCell{cursor:pointer;border:0;border-radius:2px;width:11px;height:11px;padding:0}.VWh0dG_triggerPopSubscription{width:auto;left:0;right:0}.VWh0dG_floatSub{flex-direction:column;gap:6px;min-width:0;display:flex}.VWh0dG_floatSubHead{flex-wrap:wrap;align-items:baseline;gap:6px;min-width:0;display:flex}.VWh0dG_floatSubName{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:700}.VWh0dG_floatSubPlan{color:var(--dsw-alias-label-secondary);font-size:10px}.VWh0dG_floatSub .VWh0dG_subscriptionWindow{flex-wrap:wrap;gap:4px 10px}.VWh0dG_floatSub .VWh0dG_subscriptionWindowLabel{flex:none}.VWh0dG_floatSub .VWh0dG_subscriptionMeta{min-width:0;max-width:100%}.VWh0dG_floatSub .VWh0dG_subscriptionPct{min-width:0}.VWh0dG_floatSub .VWh0dG_subscriptionReset{white-space:normal;overflow-wrap:anywhere}.VWh0dG_triggerPopEmpty{color:var(--dsw-alias-label-tertiary);padding:2px 0;font-size:11px;line-height:1.5}.VWh0dG_triggerPopSwitcher{justify-content:flex-end;align-items:center;gap:8px;margin-top:2px;display:flex}.VWh0dG_triggerPopSwitchCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:10px}.VWh0dG_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}.VWh0dG_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)}.VWh0dG_floatTarget{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:5px;font-size:12px;display:inline-flex}.VWh0dG_floatTargetLabel{color:var(--dsw-alias-label-secondary)}.VWh0dG_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}.VWh0dG_plgHead{align-items:flex-start;gap:12px;display:flex}.VWh0dG_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}.VWh0dG_plgTitle{flex-direction:column;gap:4px;min-width:0;display:flex}.VWh0dG_plgNameRow{align-items:center;gap:8px;display:flex}.VWh0dG_plgName{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.VWh0dG_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}.VWh0dG_plgDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.VWh0dG_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}.VWh0dG_plgItem{flex-direction:column;gap:2px;min-width:0;display:flex}.VWh0dG_plgLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.VWh0dG_plgVal{color:var(--dsw-alias-label-primary);word-break:break-all;font-size:12px;line-height:17px}.VWh0dG_plgLink{color:var(--dsw-static-blue-500);word-break:break-all;font-size:12px;line-height:17px;text-decoration:none}.VWh0dG_plgLink:hover{text-decoration:underline}.VWh0dG_tokenPanel{flex-direction:column;gap:14px;display:flex}.VWh0dG_tokenModelBar{background:var(--dsw-alias-bg-layer-2);border-radius:999px;height:8px;overflow:hidden}.VWh0dG_tokenModelParts{height:100%;display:flex}.VWh0dG_tokenModelPartIn{background:var(--dsw-static-blue-500)}.VWh0dG_tokenModelPartOut{background:var(--dsw-static-amber-500)}.VWh0dG_tokenModelShareRow{align-items:center;gap:6px;display:inline-flex}@media (width<=640px){.VWh0dG_kpiGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.VWh0dG_hero{gap:14px}.VWh0dG_heroTop{flex-direction:column;align-items:flex-start;gap:12px}.VWh0dG_heroGauge{width:72px;height:72px}.VWh0dG_heroSide{gap:12px}.VWh0dG_heroSideSpacer{display:none}}.VWh0dG_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 VWh0dG_peakAlertIn;display:flex;position:fixed;box-shadow:0 4px 16px #00000014}.VWh0dG_peakCardCorner{bottom:18px;right:18px}.VWh0dG_peakCardCenter{top:20%;left:50%;transform:translate(-50%)}.VWh0dG_peakCardPeak{color:var(--dsw-static-blue-500)}.VWh0dG_peakCardOff{color:var(--dsw-static-green-500)}.VWh0dG_peakHead{justify-content:space-between;align-items:center;gap:8px;display:flex}.VWh0dG_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}.VWh0dG_peakTagPrimary{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-blue-500)}.VWh0dG_peakTagSuccess{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-green-500)}.VWh0dG_peakDot{border-radius:999px;flex:none;width:6px;height:6px}.VWh0dG_peakDotPrimary{background:var(--dsw-static-blue-500)}.VWh0dG_peakDotSuccess{background:var(--dsw-static-green-500)}.VWh0dG_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}.VWh0dG_peakClose:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2)}.VWh0dG_peakCount{font-variant-numeric:tabular-nums;font-size:28px;font-weight:700;line-height:34px}.VWh0dG_peakCountPrimary{color:var(--dsw-static-blue-500)}.VWh0dG_peakCountSuccess{color:var(--dsw-static-green-500)}.VWh0dG_peakDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:18px}@keyframes VWh0dG_peakAlertIn{0%{opacity:0}to{opacity:1}}.VWh0dG_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}.VWh0dG_setCardHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.VWh0dG_setCardMeta{flex-direction:column;gap:4px;min-width:0;display:flex}.VWh0dG_setCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.VWh0dG_setCardDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.VWh0dG_ctlCol{flex-direction:column;gap:10px;padding-top:2px;display:flex}.VWh0dG_ctlRow{align-items:center;gap:12px;min-height:28px;display:flex}.VWh0dG_ctlRowStretch{display:flex}.VWh0dG_ctlLabel{color:var(--dsw-alias-label-secondary);flex:0 0 96px;font-size:11px;line-height:16px}.VWh0dG_ctlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.VWh0dG_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}.VWh0dG_rdo input{opacity:0;pointer-events:none;position:absolute}.VWh0dG_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}.VWh0dG_rdo input:checked+.VWh0dG_rdoDot{border-color:var(--dsw-static-blue-500)}.VWh0dG_rdo input:checked+.VWh0dG_rdoDot:after{content:"";background:var(--dsw-static-blue-500);border-radius:50%;position:absolute;inset:3px}.VWh0dG_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}.VWh0dG_affix{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.VWh0dG_prog{background:var(--dsw-alias-bg-module-platform);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.VWh0dG_progFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .2s}.VWh0dG_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}.VWh0dG_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 v={popDotSub:`VWh0dG_popDotSub`,numCol:`VWh0dG_numCol`,feeChipOff:`VWh0dG_feeChipOff`,balanceDetailPop:`VWh0dG_balanceDetailPop`,triggerMetric:`VWh0dG_triggerMetric`,triggerPop:`VWh0dG_triggerPop`,chartLine:`VWh0dG_chartLine`,ubTagSuccess:`VWh0dG_ubTagSuccess`,dashboard:`VWh0dG_dashboard`,deltaDown:`VWh0dG_deltaDown`,ubCardTitle:`VWh0dG_ubCardTitle`,tokenModelParts:`VWh0dG_tokenModelParts`,peakTagPrimary:`VWh0dG_peakTagPrimary`,floatSubHead:`VWh0dG_floatSubHead`,subscriptionExhausted:`VWh0dG_subscriptionExhausted`,triggerPopSubscription:`VWh0dG_triggerPopSubscription`,bucketThird:`VWh0dG_bucketThird`,subscriptionGoldFlow:`VWh0dG_subscriptionGoldFlow`,popModelStatusLow:`VWh0dG_popModelStatusLow`,heroSideSpacer:`VWh0dG_heroSideSpacer`,plgIcon:`VWh0dG_plgIcon`,feeChipPrimary:`VWh0dG_feeChipPrimary`,panelHint:`VWh0dG_panelHint`,peakCountSuccess:`VWh0dG_peakCountSuccess`,ubCardSub:`VWh0dG_ubCardSub`,rowlineDrillWrap:`VWh0dG_rowlineDrillWrap`,balanceDetailLabel:`VWh0dG_balanceDetailLabel`,tabPanelIn:`VWh0dG_tabPanelIn`,roundsEmpty:`VWh0dG_roundsEmpty`,switchKnob:`VWh0dG_switchKnob`,ctlRowStretch:`VWh0dG_ctlRowStretch`,peakCardCenter:`VWh0dG_peakCardCenter`,roundsBarCol:`VWh0dG_roundsBarCol`,setCardHead:`VWh0dG_setCardHead`,chartBarPlaceholder:`VWh0dG_chartBarPlaceholder`,setCard:`VWh0dG_setCard`,heatmapYear:`VWh0dG_heatmapYear`,heroMeta:`VWh0dG_heroMeta`,triggerSpark:`VWh0dG_triggerSpark`,metricValuePrimary:`VWh0dG_metricValuePrimary`,bucketCost:`VWh0dG_bucketCost`,feeSep:`VWh0dG_feeSep`,floatModeBtn:`VWh0dG_floatModeBtn`,inp:`VWh0dG_inp`,heroValue:`VWh0dG_heroValue`,subscriptionMeta:`VWh0dG_subscriptionMeta`,balanceDetailClose:`VWh0dG_balanceDetailClose`,subscriptionTier:`VWh0dG_subscriptionTier`,triggerWrap:`VWh0dG_triggerWrap`,siteRowCalls:`VWh0dG_siteRowCalls`,shareSegOff:`VWh0dG_shareSegOff`,siteKindSite:`VWh0dG_siteKindSite`,heatmapCellEmpty:`VWh0dG_heatmapCellEmpty`,popDotDirect:`VWh0dG_popDotDirect`,ubTagPromo:`VWh0dG_ubTagPromo`,heroBudgetFillOver:`VWh0dG_heroBudgetFillOver`,kpiLabel:`VWh0dG_kpiLabel`,shareValue:`VWh0dG_shareValue`,heatmapRangeButton:`VWh0dG_heatmapRangeButton`,subscriptionCard:`VWh0dG_subscriptionCard`,feeChipAlert:`VWh0dG_feeChipAlert`,floatSubPlan:`VWh0dG_floatSubPlan`,balanceDaysBadge:`VWh0dG_balanceDaysBadge`,popModelStatus:`VWh0dG_popModelStatus`,tokenModelShareRow:`VWh0dG_tokenModelShareRow`,roundsBarWrap:`VWh0dG_roundsBarWrap`,heroGaugeCenter:`VWh0dG_heroGaugeCenter`,plgName:`VWh0dG_plgName`,healthBadge:`VWh0dG_healthBadge`,chartEmpty:`VWh0dG_chartEmpty`,peakAlertIn:`VWh0dG_peakAlertIn`,metricValue:`VWh0dG_metricValue`,feeChipError:`VWh0dG_feeChipError`,setCardDesc:`VWh0dG_setCardDesc`,subscriptionGrid:`VWh0dG_subscriptionGrid`,balanceDetailValue:`VWh0dG_balanceDetailValue`,roundsBarColPeak:`VWh0dG_roundsBarColPeak`,kpiValue:`VWh0dG_kpiValue`,peakClose:`VWh0dG_peakClose`,healthOk:`VWh0dG_healthOk`,ubTagAlert:`VWh0dG_ubTagAlert`,na:`VWh0dG_na`,staleNotice:`VWh0dG_staleNotice`,heroSideValue:`VWh0dG_heroSideValue`,plgLink:`VWh0dG_plgLink`,plgGrid:`VWh0dG_plgGrid`,floatModeBtnOn:`VWh0dG_floatModeBtnOn`,triggerPrimary:`VWh0dG_triggerPrimary`,feeCount:`VWh0dG_feeCount`,currencyButtonActive:`VWh0dG_currencyButtonActive`,ubTablewrap:`VWh0dG_ubTablewrap`,providerGroupBalanceLabel:`VWh0dG_providerGroupBalanceLabel`,heatmapYearGrid:`VWh0dG_heatmapYearGrid`,providerGroupName:`VWh0dG_providerGroupName`,heroBudgetLabel:`VWh0dG_heroBudgetLabel`,modalFooter:`VWh0dG_modalFooter`,popTagSub:`VWh0dG_popTagSub`,flatTag:`VWh0dG_flatTag`,popModel:`VWh0dG_popModel`,triggerLabel:`VWh0dG_triggerLabel`,ubStatCard:`VWh0dG_ubStatCard`,currencyToggle:`VWh0dG_currencyToggle`,subscriptionFill:`VWh0dG_subscriptionFill`,floatTargetLabel:`VWh0dG_floatTargetLabel`,kpiGreen:`VWh0dG_kpiGreen`,ubExtraName:`VWh0dG_ubExtraName`,rowlineChev:`VWh0dG_rowlineChev`,chartLegendLine:`VWh0dG_chartLegendLine`,heatmapFooter:`VWh0dG_heatmapFooter`,plgDesc:`VWh0dG_plgDesc`,tokenPanel:`VWh0dG_tokenPanel`,peakCardPeak:`VWh0dG_peakCardPeak`,"billing-trigger":`VWh0dG_billing-trigger`,shareSeg:`VWh0dG_shareSeg`,chartCrosshair:`VWh0dG_chartCrosshair`,vendorLetter:`VWh0dG_vendorLetter`,chartTooltipSwatch:`VWh0dG_chartTooltipSwatch`,healthDot:`VWh0dG_healthDot`,healthIdle:`VWh0dG_healthIdle`,ubCardHead:`VWh0dG_ubCardHead`,modelTableScroll:`VWh0dG_modelTableScroll`,ubChipOff:`VWh0dG_ubChipOff`,subscriptionHead:`VWh0dG_subscriptionHead`,bucketSep:`VWh0dG_bucketSep`,peakDesc:`VWh0dG_peakDesc`,heroGaugeArcOver:`VWh0dG_heroGaugeArcOver`,budgetInput:`VWh0dG_budgetInput`,modelProvider:`VWh0dG_modelProvider`,emptyRow:`VWh0dG_emptyRow`,panelTitle:`VWh0dG_panelTitle`,ubTagError:`VWh0dG_ubTagError`,triggerPopEmpty:`VWh0dG_triggerPopEmpty`,metricLabel:`VWh0dG_metricLabel`,plgVal:`VWh0dG_plgVal`,rowlineRight:`VWh0dG_rowlineRight`,shareSegTool:`VWh0dG_shareSegTool`,ctlRow:`VWh0dG_ctlRow`,ctlGroup:`VWh0dG_ctlGroup`,dashboardBody:`VWh0dG_dashboardBody`,delta:`VWh0dG_delta`,heatmapYearMonths:`VWh0dG_heatmapYearMonths`,reconcileNotice:`VWh0dG_reconcileNotice`,subscriptionTrack:`VWh0dG_subscriptionTrack`,peakHead:`VWh0dG_peakHead`,ctlLabel:`VWh0dG_ctlLabel`,bucketOfficial:`VWh0dG_bucketOfficial`,shareDot:`VWh0dG_shareDot`,dashboardSubtitle:`VWh0dG_dashboardSubtitle`,reconcileIcon:`VWh0dG_reconcileIcon`,popDot:`VWh0dG_popDot`,shareSegPeak:`VWh0dG_shareSegPeak`,tableScroll:`VWh0dG_tableScroll`,tokenModelPartOut:`VWh0dG_tokenModelPartOut`,ubPricepair:`VWh0dG_ubPricepair`,popTitle:`VWh0dG_popTitle`,peakTagSuccess:`VWh0dG_peakTagSuccess`,plgNameRow:`VWh0dG_plgNameRow`,heroSideItem:`VWh0dG_heroSideItem`,subscriptionStatus:`VWh0dG_subscriptionStatus`,heroGaugeLabel:`VWh0dG_heroGaugeLabel`,switchOn:`VWh0dG_switchOn`,chartLegendBar:`VWh0dG_chartLegendBar`,dashboardTitle:`VWh0dG_dashboardTitle`,heroGauge:`VWh0dG_heroGauge`,rowlineMuted:`VWh0dG_rowlineMuted`,ubNotesTerm:`VWh0dG_ubNotesTerm`,roundsBar:`VWh0dG_roundsBar`,heroSideLabel:`VWh0dG_heroSideLabel`,chartTooltipRow:`VWh0dG_chartTooltipRow`,heatmapRangeSwitch:`VWh0dG_heatmapRangeSwitch`,heroLabel:`VWh0dG_heroLabel`,healthBadgeBad:`VWh0dG_healthBadgeBad`,kpiGrid:`VWh0dG_kpiGrid`,shareSegUser:`VWh0dG_shareSegUser`,ubCard:`VWh0dG_ubCard`,chartTooltip:`VWh0dG_chartTooltip`,peakCard:`VWh0dG_peakCard`,kpiTile:`VWh0dG_kpiTile`,triggerSparkHot:`VWh0dG_triggerSparkHot`,pricingTable:`VWh0dG_pricingTable`,ubStatGrid:`VWh0dG_ubStatGrid`,feeSuffix:`VWh0dG_feeSuffix`,providerGroupBalance:`VWh0dG_providerGroupBalance`,healthBad:`VWh0dG_healthBad`,heroBudget:`VWh0dG_heroBudget`,closeButton:`VWh0dG_closeButton`,heroBudgetFill:`VWh0dG_heroBudgetFill`,balanceDetailRow:`VWh0dG_balanceDetailRow`,heatmapRangeButtonActive:`VWh0dG_heatmapRangeButtonActive`,peakCardCorner:`VWh0dG_peakCardCorner`,btn:`VWh0dG_btn`,ubChipLabel:`VWh0dG_ubChipLabel`,subscriptionAuto:`VWh0dG_subscriptionAuto`,providerGroupHead:`VWh0dG_providerGroupHead`,chartBar:`VWh0dG_chartBar`,peakCardOff:`VWh0dG_peakCardOff`,modelCell:`VWh0dG_modelCell`,subscriptionReset:`VWh0dG_subscriptionReset`,trendPanel:`VWh0dG_trendPanel`,triggerSub:`VWh0dG_triggerSub`,dashboardModal:`VWh0dG_dashboardModal`,triggerPopSwitcher:`VWh0dG_triggerPopSwitcher`,metricValueSuccess:`VWh0dG_metricValueSuccess`,heroGaugeSvg:`VWh0dG_heroGaugeSvg`,ubChipPeak:`VWh0dG_ubChipPeak`,exportBar:`VWh0dG_exportBar`,chartGrid:`VWh0dG_chartGrid`,ubStatValue:`VWh0dG_ubStatValue`,modelName:`VWh0dG_modelName`,popModelRow:`VWh0dG_popModelRow`,dashboardRight:`VWh0dG_dashboardRight`,heatmapYearMonth:`VWh0dG_heatmapYearMonth`,triggerIcon:`VWh0dG_triggerIcon`,floatSub:`VWh0dG_floatSub`,peakDotPrimary:`VWh0dG_peakDotPrimary`,siteRowMeta:`VWh0dG_siteRowMeta`,ctlCol:`VWh0dG_ctlCol`,balanceCell:`VWh0dG_balanceCell`,heatmapYearScroll:`VWh0dG_heatmapYearScroll`,plgTag:`VWh0dG_plgTag`,prog:`VWh0dG_prog`,triggerMain:`VWh0dG_triggerMain`,modelTable:`VWh0dG_modelTable`,unpricedHint:`VWh0dG_unpricedHint`,heroGaugePct:`VWh0dG_heroGaugePct`,ubStatDetail:`VWh0dG_ubStatDetail`,rowline:`VWh0dG_rowline`,balanceDaysBadgeLow:`VWh0dG_balanceDaysBadgeLow`,ubTag:`VWh0dG_ubTag`,shareLegend:`VWh0dG_shareLegend`,heroGaugePctOver:`VWh0dG_heroGaugePctOver`,modelDot:`VWh0dG_modelDot`,roundsBarColOff:`VWh0dG_roundsBarColOff`,heatmapGrid:`VWh0dG_heatmapGrid`,popHead:`VWh0dG_popHead`,subscriptionFillWarn:`VWh0dG_subscriptionFillWarn`,peakCount:`VWh0dG_peakCount`,ubTagNeutral:`VWh0dG_ubTagNeutral`,triggerPopSwitchCount:`VWh0dG_triggerPopSwitchCount`,chartSvg:`VWh0dG_chartSvg`,floatTarget:`VWh0dG_floatTarget`,providerGroupList:`VWh0dG_providerGroupList`,headTitleRow:`VWh0dG_headTitleRow`,ubExtraNote:`VWh0dG_ubExtraNote`,heroMain:`VWh0dG_heroMain`,subscriptionWindowLabel:`VWh0dG_subscriptionWindowLabel`,tokenModelPartIn:`VWh0dG_tokenModelPartIn`,peakCountPrimary:`VWh0dG_peakCountPrimary`,tabButton:`VWh0dG_tabButton`,progFill:`VWh0dG_progFill`,shareSegAssistant:`VWh0dG_shareSegAssistant`,heatmapYearBody:`VWh0dG_heatmapYearBody`,switch:`VWh0dG_switch`,balanceDetailTitle:`VWh0dG_balanceDetailTitle`,siteRowName:`VWh0dG_siteRowName`,providerGroup:`VWh0dG_providerGroup`,metricGrid:`VWh0dG_metricGrid`,heatmap:`VWh0dG_heatmap`,rangeButton:`VWh0dG_rangeButton`,peakDotSuccess:`VWh0dG_peakDotSuccess`,siteRowTitle:`VWh0dG_siteRowTitle`,siteRowCallsLow:`VWh0dG_siteRowCallsLow`,heatmapLegend:`VWh0dG_heatmapLegend`,ubNotes:`VWh0dG_ubNotes`,plgTitle:`VWh0dG_plgTitle`,roundsFlagMark:`VWh0dG_roundsFlagMark`,affix:`VWh0dG_affix`,feeNum:`VWh0dG_feeNum`,ubAlertNote:`VWh0dG_ubAlertNote`,rangeButtonActive:`VWh0dG_rangeButtonActive`,chartAxisLabel:`VWh0dG_chartAxisLabel`,rangeToggle:`VWh0dG_rangeToggle`,heroSide:`VWh0dG_heroSide`,reconcileDismiss:`VWh0dG_reconcileDismiss`,heroTop:`VWh0dG_heroTop`,shareItem:`VWh0dG_shareItem`,deltaUp:`VWh0dG_deltaUp`,ubExtraRow:`VWh0dG_ubExtraRow`,ubTable:`VWh0dG_ubTable`,ubNotesDesc:`VWh0dG_ubNotesDesc`,siteKindDirect:`VWh0dG_siteKindDirect`,subscriptionPlan:`VWh0dG_subscriptionPlan`,subscriptionFillOver:`VWh0dG_subscriptionFillOver`,heroCurrency:`VWh0dG_heroCurrency`,subscriptionPct:`VWh0dG_subscriptionPct`,siteKindUnknown:`VWh0dG_siteKindUnknown`,ubModel:`VWh0dG_ubModel`,providerGroupMeta:`VWh0dG_providerGroupMeta`,budgetFillOver:`VWh0dG_budgetFillOver`,roundsBarLabel:`VWh0dG_roundsBarLabel`,roundsBarFlagged:`VWh0dG_roundsBarFlagged`,triggerYen:`VWh0dG_triggerYen`,ubCardControlGroup:`VWh0dG_ubCardControlGroup`,heroBudgetTrack:`VWh0dG_heroBudgetTrack`,plgLabel:`VWh0dG_plgLabel`,rowlist:`VWh0dG_rowlist`,peakTag:`VWh0dG_peakTag`,ubNotesItem:`VWh0dG_ubNotesItem`,tabNav:`VWh0dG_tabNav`,trigger:`VWh0dG_trigger`,metricCell:`VWh0dG_metricCell`,popModelName:`VWh0dG_popModelName`,feeBar:`VWh0dG_feeBar`,tabPanel:`VWh0dG_tabPanel`,heroGaugeArc:`VWh0dG_heroGaugeArc`,shareTrack:`VWh0dG_shareTrack`,chartWrap:`VWh0dG_chartWrap`,chartStack:`VWh0dG_chartStack`,chartLegend:`VWh0dG_chartLegend`,rowlineDrill:`VWh0dG_rowlineDrill`,estimatedTag:`VWh0dG_estimatedTag`,triggerSparkBar:`VWh0dG_triggerSparkBar`,exportButton:`VWh0dG_exportButton`,balanceDetailHead:`VWh0dG_balanceDetailHead`,vendorLogo:`VWh0dG_vendorLogo`,reconcileText:`VWh0dG_reconcileText`,exportLabel:`VWh0dG_exportLabel`,currencyButton:`VWh0dG_currencyButton`,heatmapYearWeekday:`VWh0dG_heatmapYearWeekday`,heroBudgetValue:`VWh0dG_heroBudgetValue`,popTagPrimary:`VWh0dG_popTagPrimary`,budgetFillWarn:`VWh0dG_budgetFillWarn`,hero:`VWh0dG_hero`,setCardMeta:`VWh0dG_setCardMeta`,kpiDetail:`VWh0dG_kpiDetail`,chartTooltipDate:`VWh0dG_chartTooltipDate`,siteKindTag:`VWh0dG_siteKindTag`,heroReadout:`VWh0dG_heroReadout`,pricingToggle:`VWh0dG_pricingToggle`,feeItem:`VWh0dG_feeItem`,subscriptionName:`VWh0dG_subscriptionName`,providerGroupBadge:`VWh0dG_providerGroupBadge`,tokenModelBar:`VWh0dG_tokenModelBar`,rdo:`VWh0dG_rdo`,peakDot:`VWh0dG_peakDot`,dashboardIn:`VWh0dG_dashboardIn`,tabButtonActive:`VWh0dG_tabButtonActive`,siteRow:`VWh0dG_siteRow`,heroGaugeTrack:`VWh0dG_heroGaugeTrack`,ubModelName:`VWh0dG_ubModelName`,balanceDetailGrid:`VWh0dG_balanceDetailGrid`,heatmapYearCell:`VWh0dG_heatmapYearCell`,heatmapHover:`VWh0dG_heatmapHover`,healthBadgeOk:`VWh0dG_healthBadgeOk`,budgetOverPulse:`VWh0dG_budgetOverPulse`,rdoDot:`VWh0dG_rdoDot`,roundsAxis:`VWh0dG_roundsAxis`,plgHead:`VWh0dG_plgHead`,rounds:`VWh0dG_rounds`,roundsBars:`VWh0dG_roundsBars`,heatmapCell:`VWh0dG_heatmapCell`,heatmapYearWeekdays:`VWh0dG_heatmapYearWeekdays`,panel:`VWh0dG_panel`,ubRate:`VWh0dG_ubRate`,dashboardHead:`VWh0dG_dashboardHead`,popDotNeutral:`VWh0dG_popDotNeutral`,ubStatLabel:`VWh0dG_ubStatLabel`,planTag:`VWh0dG_planTag`,uncataloguedTag:`VWh0dG_uncataloguedTag`,railButton:`VWh0dG_railButton`,panelHead:`VWh0dG_panelHead`,floatSubName:`VWh0dG_floatSubName`,providerGroupTitle:`VWh0dG_providerGroupTitle`,subscriptionWindow:`VWh0dG_subscriptionWindow`,ubAlert:`VWh0dG_ubAlert`,ubAlertLeft:`VWh0dG_ubAlertLeft`,rowlineName:`VWh0dG_rowlineName`,plgItem:`VWh0dG_plgItem`,popModelLabel:`VWh0dG_popModelLabel`,siteRowCost:`VWh0dG_siteRowCost`,setCardTitle:`VWh0dG_setCardTitle`};let ee={"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`}},y={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 b(e){return e===``?e:y[e]??e}function te(e){let t=ee[b(e)];return t?.type===`code`?t.tier:void 0}let x=[{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}],S,C,w,ne;function T(e){S=typeof e.rate==`number`&&Number.isFinite(e.rate)&&e.rate>0?e.rate:void 0,C=e.prices,w=e.extraModels}function re(e){ne=e}function E(){return S??6.79}function ie(){return{rate:E(),live:S!==void 0}}function ae(e){return e>=9&&e<12||e>=14&&e<18}function D(e){return e==null||!Number.isFinite(e)?`peak`:oe(e)?`offPeak`:ae((new Date(e).getUTCHours()+8)%24)?`peak`:`offPeak`}function oe(e){let t=new Date(e+8*36e5).getUTCDay();return t===0||t===6}function O(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 k=[540,720,840,1080];function se(e){return((e+8*36e5)%864e5+864e5)%864e5}function A(e){if(oe(e))return{tier:`offPeak`,nextSwitchInMs:O(e)};let t=se(e);for(let n of k){let r=n*6e4;if(t<r)return{tier:D(e),nextSwitchInMs:r-t}}let n=k[0]??0;return{tier:D(e),nextSwitchInMs:864e5-t+n*6e4}}function ce(e,t){let{nextSwitchInMs:n}=A(e);if(n>t)return null;let r=e+n;return{entering:D(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 le=[{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`},{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`},{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}}],ue={"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 M(e){return String(e).toLowerCase().replace(/\([^)]*\)/g,``).replace(/[^a-z0-9]+/g,``)}let N=(()=>{let e=new Map,t=(t,n)=>{let r=M(t);r!==``&&!e.has(r)&&e.set(r,n)};for(let e of le)t(e.key,e.key);for(let[e,n]of Object.entries(ue))t(e,n);for(let e of x)t(e.key,e.key);return e})();function P(e){let t=ue[e]??e;if(t===e){let t=M(e);if(t!==``){let e=N.get(t);if(e!==void 0)return e;let n=(w??[]).find(e=>M(e.key)===t);if(n!==void 0)return n.key}}return t}function F(e){let t=P(e),n=C?.[t];if(n!==void 0)return n;let r=x.find(e=>e.key.toLowerCase()===t.toLowerCase());if(r!==void 0)return{input:r.input,cacheHit:r.cacheHit,output:r.output}}function de(e){let t=P(e),n=le.find(e=>e.key===t),r=w?.find(e=>e.key===t),i=n??(r===void 0?(()=>{let e=le.at(-1);if(e!==void 0)return e;throw Error(`MODEL_CATALOG must not be empty`)})():I(r)),a=F(t);return a===void 0?i:{...i,price:{currency:`USD`,input:a.input,cacheHit:a.cacheHit,output:a.output}}}function I(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 fe(e,t){let n=e.endsAtMs!==void 0&&t>=e.endsAtMs;return Number.isFinite(t)&&!n&&e.factor>0&&e.factor<1}function pe(e,t){let{promo:n}=e;if(n===void 0||!fe(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 me(e=Date.now()){let t=[...le.map(t=>pe(t,e))],n=new Set(t.map(e=>e.key.toLowerCase())),r=new Set(t.map(e=>M(e.key)));for(let e of ne??[]){let i=e.id.toLowerCase();if((()=>{let t=P(e.id);return le.find(e=>e.key===t)})()!==void 0)continue;let a=M(e.id);if(n.has(i)||a!==``&&r.has(a))continue;let o=(w??[]).find(e=>M(e.key)===a),s;if(o!==void 0)s=I(o),e.name!==void 0&&e.name!==``&&(s={...s,name:e.name});else{let t=F(i);s=t===void 0?{key:P(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}function he(e){let t=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return t===``?`#8b95a3`:t}function ge(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*E():a}function _e(e,t,n=.5,r=Date.now()){let i=pe(e,r),a=ge(i.price,t,i.price.currency),o=i.price.offPeak===void 0?a:ge(i.price.offPeak,t,i.price.currency);return a*n+o*(1-n)}function L(e){let t=E();return t>0?e/t:e}function R(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 ve(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 ye(e,t,n,r){return r<=0||!Number.isFinite(r)||t===(n===`usd`?`USD`:`CNY`)?e:n===`usd`?e/r:e*r}function z(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 B(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 be(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 xe(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 U={key:`__total__`,name:`总计`,color:``};function Se({data:e,models:t=[],currency:n=`cny`,metric:i=`cost`}){let[o,s]=(0,r.useState)(null),c=e=>R(n===`usd`?L(e):e,n),l=e=>i===`tokens`?H(e):c(e),u=e=>i===`tokens`?e.tokens??0:e.cost,d=(0,r.useMemo)(()=>{let n=e.length;if(n===0)return null;let r=680-V.left-V.right,a=220-V.top-V.bottom,o=e=>n===1?V.left+r/2:V.left+r*e/(n-1),s=Math.max(...i===`tokens`?e.map(e=>e.tokens??0):e.map(e=>Math.max(e.cost,Object.values(e.byModel??{}).reduce((e,t)=>e+t,0))),1e-4),c=e=>V.top+a-e/s*a,l=Math.max(...e.map(e=>e.calls),1),d=e=>V.top+a-e/l*a,f=r/n,p=Math.min(18,f*.6);return{n,plotW:r,plotH:a,inner:o,yCost:c,yCalls:d,barW:p,bars:e.flatMap((e,n)=>{let r=o(n)-p/2;if(t.length===0||i===`tokens`)return[{date:e.date,model:U,x:r,base:0,value:u(e),topRounded:!0}];let a=null;for(let n of t)(e.byModel?.[n.key]??0)>0&&(a=n.key);let s=0;return t.map(t=>{let n=e.byModel?.[t.key]??0,i={date:e.date,model:t,x:r,base:s,value:n,topRounded:t.key===a};return s+=n,i})}),costTicks:[0,.25,.5,.75,1].map(e=>s*e).reverse(),callsTicks:[0,.25,.5,.75,1].map(e=>l*e).reverse(),linePath:e.map((e,t)=>{let n=d(e.calls);return`${t===0?`M`:`L`}${o(t)} ${n}`}).join(` `)}},[e,t,i]);if(d===null)return(0,a.jsx)(`div`,{className:v.chartEmpty,children:`暂无趋势数据`});let{n:f,plotW:p,plotH:m,inner:h,yCost:g,yCalls:_,barW:ee,bars:y,costTicks:b,callsTicks:te,linePath:x}=d,S=o===null?void 0:e[o],C=xe(f,Math.max(1,Math.ceil(f/8)));return(0,a.jsxs)(`div`,{className:v.chartWrap,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 220`,className:v.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:[b.map((e,t)=>{let n=g(e);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:V.left,x2:680-V.right,y1:n,y2:n,className:v.chartGrid}),(0,a.jsx)(`text`,{x:V.left-8,y:n+3,textAnchor:`end`,className:v.chartAxisLabel,children:l(e)})]},`cost-${t}`)}),y.map(t=>{if(t.value>0)return(0,a.jsx)(`rect`,{x:t.x,y:g(t.base+t.value),width:ee,height:g(t.base)-g(t.base+t.value),rx:t.topRounded?2:0,className:t.model.color===``?v.chartBar:v.chartStack,style:t.model.color===``?void 0:{fill:t.model.color}},`${t.date}-${t.model.key}`);let n=e.find(e=>e.date===t.date);return n!==void 0&&n.calls>0&&t.base===0?(0,a.jsx)(`rect`,{x:t.x,y:g(0)-1,width:ee,height:1,rx:0,className:v.chartBarPlaceholder},`${t.date}-${t.model.key}-placeholder`):null}),(0,a.jsx)(`path`,{d:x,fill:`none`,className:v.chartLine}),te.map((e,t)=>{let n=_(e);return(0,a.jsx)(`text`,{x:680-V.right+8,y:n+3,textAnchor:`start`,className:v.chartAxisLabel,children:H(e)},`calls-${t}`)}),C.map(t=>{let n=e[t];return n===void 0?null:(0,a.jsx)(`text`,{x:h(t),y:214,textAnchor:`middle`,className:v.chartAxisLabel,children:be(n.date)},n.date)}),o!==null&&(0,a.jsx)(`line`,{x1:h(o),x2:h(o),y1:V.top,y2:V.top+m,className:v.chartCrosshair})]}),S!==void 0&&o!==null&&(0,a.jsxs)(`div`,{className:v.chartTooltip,style:{left:`${h(o)/680*100}%`,top:`${g(S.cost)/220*100}%`},children:[(0,a.jsx)(`div`,{className:v.chartTooltipDate,children:S.date}),i!==`tokens`&&t.filter(e=>(S.byModel?.[e.key]??0)>0).map(e=>(0,a.jsxs)(`div`,{className:v.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:v.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,a.jsx)(`strong`,{children:c(S.byModel?.[e.key]??0)})]},e.key)),(0,a.jsxs)(`div`,{className:v.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:v.chartLegendBar}),`总计 `,(0,a.jsx)(`strong`,{children:i===`tokens`?H(S.tokens??0):c(S.cost)})]}),(0,a.jsxs)(`div`,{className:v.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:v.chartLegendLine}),`调用 `,(0,a.jsx)(`strong`,{children:S.calls.toLocaleString()})]})]}),t.length>0&&i!==`tokens`&&(0,a.jsxs)(`div`,{className:v.chartLegend,children:[t.map(e=>(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:v.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key)),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:v.chartLegendLine}),`调用`]})]})]})}let W={top:14,right:42,bottom:22,left:46};function Ce(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 we(e){return e.slice(5,13).replace(`T`,` `)}function Te({perf:e,models:t,t:n}){let i=e=>t.find(t=>t.key===e)?.color??`#8b95a3`,o=(0,r.useMemo)(()=>e===void 0?[]:Object.entries(e.byModel).map(([e,n])=>({key:e,name:t.find(t=>t.key===e)?.name??e,color:i(e),samples:n.samples,ttftAvg:n.ttftAvg,ttftP50:n.ttftP50,ttftP90:n.ttftP90,...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,r.useMemo)(()=>{let t=e===void 0?[]:Ce(e.byHour);if(t.length===0)return null;let n=t.length,r=680-W.left-W.right,i=180-W.top-W.bottom,a=e=>n===1?W.left+r/2:W.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=>W.top+i-e/o*i,l=e=>W.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,a.jsx)(`div`,{className:v.chartEmpty,"data-testid":`billing-perf-empty`,children:n(`billing.perfEmpty`)}):(0,a.jsxs)(`div`,{"data-testid":`billing-perf-panel`,children:[(0,a.jsx)(`div`,{className:v.tableScroll,"data-testid":`billing-perf-table`,children:(0,a.jsxs)(`table`,{className:v.modelTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:n(`billing.model`)}),(0,a.jsx)(`th`,{className:v.numCol,children:n(`billing.perfSamples`)}),(0,a.jsx)(`th`,{className:v.numCol,children:n(`billing.perfTtft`)}),(0,a.jsx)(`th`,{className:v.numCol,children:n(`billing.perfP50`)}),(0,a.jsx)(`th`,{className:v.numCol,children:n(`billing.perfP90`)}),(0,a.jsx)(`th`,{className:v.numCol,children:n(`billing.perfTps`)}),(0,a.jsx)(`th`,{className:v.numCol,children:n(`billing.perfLatency`)}),(0,a.jsx)(`th`,{className:v.numCol,children:n(`billing.perfEstimated`)})]})}),(0,a.jsx)(`tbody`,{children:o.map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:v.modelCell,children:[(0,a.jsx)(`span`,{className:v.modelDot,style:{background:e.color}}),(0,a.jsx)(`span`,{className:v.modelName,children:e.name})]})}),(0,a.jsx)(`td`,{className:v.numCol,children:e.samples.toLocaleString()}),(0,a.jsxs)(`td`,{className:v.numCol,children:[e.ttftAvg.toFixed(0),` ms`]}),(0,a.jsxs)(`td`,{className:v.numCol,children:[e.ttftP50.toFixed(0),` ms`]}),(0,a.jsxs)(`td`,{className:v.numCol,children:[e.ttftP90.toFixed(0),` ms`]}),(0,a.jsx)(`td`,{className:v.numCol,children:e.tpsAvg===void 0?(0,a.jsx)(`span`,{className:v.na,children:`—`}):`${e.tpsAvg.toFixed(1)}`}),(0,a.jsxs)(`td`,{className:v.numCol,children:[e.latencyAvg.toFixed(0),` ms`]}),(0,a.jsx)(`td`,{className:v.numCol,children:e.estimatedSamples>0?e.estimatedSamples:(0,a.jsx)(`span`,{className:v.na,children:`—`})})]},e.key))})]})}),s!==null&&(0,a.jsxs)(`div`,{className:v.chartWrap,"data-testid":`billing-perf-hour`,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 180`,className:v.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,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:W.left,x2:680-W.right,y1:n,y2:n,className:v.chartGrid}),(0,a.jsx)(`text`,{x:W.left-8,y:n+3,textAnchor:`end`,className:v.chartAxisLabel,children:e.toFixed(0)})]},`ttft-${t}`)}),(0,a.jsx)(`path`,{d:s.ttftPath,fill:`none`,className:v.chartLine}),s.tpsPath!==``&&(0,a.jsx)(`path`,{d:s.tpsPath,fill:`none`,className:v.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,a.jsx)(`text`,{x:s.inner(e),y:174,textAnchor:`middle`,className:v.chartAxisLabel,children:we(t.key)},t.key)}),(0,a.jsxs)(`text`,{x:680-W.right+8,y:W.top+4,textAnchor:`start`,className:v.chartAxisLabel,children:[n(`billing.perfTpsUnit`),` `,s.maxTps.toFixed(0)]})]}),(0,a.jsxs)(`div`,{className:v.chartLegend,children:[(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:v.chartLegendLine}),n(`billing.perfTtft`),` (ms)`]}),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:v.chartLegendLine,style:{background:`var(--dsw-static-amber-500)`}}),n(`billing.perfTps`),` (`,n(`billing.perfTpsUnit`),`)`]})]})]})]})}let G=`@kenz1117/dsh-ui-usage-billing`,Ee=`kenz1117`;function De({t:e,version:t}){return(0,a.jsxs)(`section`,{className:v.setCard,"data-testid":`billing-plugin-info`,children:[(0,a.jsxs)(`div`,{className:v.plgHead,children:[(0,a.jsx)(`span`,{className:v.plgIcon,"aria-hidden":`true`,children:(0,a.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,a.jsx)(`path`,{d:`M10 3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a2 2 0 0 0 4 0V4a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a2 2 0 0 0 4 0 1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0 0 4h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-1a2 2 0 0 0-4 0 1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 0-4H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 4 0z`})})}),(0,a.jsxs)(`div`,{className:v.plgTitle,children:[(0,a.jsxs)(`div`,{className:v.plgNameRow,children:[(0,a.jsx)(`h3`,{className:v.plgName,children:G}),(0,a.jsx)(`span`,{className:v.plgTag,children:t===void 0?`—`:`v${t}`})]}),(0,a.jsx)(`p`,{className:v.plgDesc,children:`Usage billing dashboard for DeepSeek Harness`})]})]}),(0,a.jsxs)(`div`,{className:v.plgGrid,children:[(0,a.jsxs)(`div`,{className:v.plgItem,children:[(0,a.jsx)(`span`,{className:v.plgLabel,children:e(`billing.pluginAuthor`)}),(0,a.jsxs)(`a`,{className:v.plgLink,href:`https://github.com/${Ee}`,target:`_blank`,rel:`noreferrer`,children:[`KenZ`,` (`,Ee,`)`]})]}),(0,a.jsxs)(`div`,{className:v.plgItem,children:[(0,a.jsx)(`span`,{className:v.plgLabel,children:e(`billing.pluginRepository`)}),(0,a.jsx)(`a`,{className:v.plgLink,href:`https://github.com/kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:`GitHub`})]}),(0,a.jsxs)(`div`,{className:v.plgItem,children:[(0,a.jsx)(`span`,{className:v.plgLabel,children:e(`billing.pluginNpm`)}),(0,a.jsx)(`a`,{className:v.plgLink,href:`https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:G})]}),(0,a.jsxs)(`div`,{className:v.plgItem,children:[(0,a.jsx)(`span`,{className:v.plgLabel,children:e(`billing.pluginLicense`)}),(0,a.jsx)(`span`,{className:v.plgVal,children:`MIT`})]})]})]})}function K(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 Oe(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}let q={top:14,right:18,bottom:22,left:46},ke=`var(--dsw-static-blue-500)`,Ae=`#14b8a6`,je=`var(--dsw-static-amber-500)`;function Me(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 Ne(e){let{stats:t,trendDays:n,onTrendDays:i,t:o}=e,{byDay:s,byModel:l,total:u}=t,d=(0,r.useMemo)(()=>{let e=[];for(let t=n-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t);let r=K(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,r.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:de(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,r.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,r.useMemo)(()=>{let e=d.length;if(e===0)return null;let t=680-q.left-q.right,n=200-q.top-q.bottom,r=Math.max(...d.map(e=>e.miss+e.hit+e.output),1),i=e=>q.top+n-e/r*n,a=t/e,o=Math.min(20,a*.6),s=n=>e===1?q.left+t/2:q.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,a.jsxs)(`div`,{className:v.tokenPanel,"data-testid":`billing-token-panel`,children:[(0,a.jsxs)(`div`,{className:v.exportBar,role:`group`,"aria-label":o(`billing.tokenExport`),children:[(0,a.jsx)(`span`,{className:v.exportLabel,children:o(`billing.export`)}),(0,a.jsx)(`button`,{type:`button`,className:v.exportButton,"data-testid":`billing-token-export-csv`,onClick:()=>{let e=new Blob([Me(d)],{type:`text/csv`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`token-daily-${K()}.csv`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},children:o(`billing.tokenExportCsv`)}),(0,a.jsx)(`button`,{type:`button`,className:v.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-${K()}.json`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},children:o(`billing.exportJson`)})]}),(0,a.jsxs)(`div`,{className:v.kpiGrid,"data-testid":`billing-token-kpis`,children:[(0,a.jsxs)(`div`,{className:v.kpiTile,children:[(0,a.jsx)(`span`,{className:v.kpiLabel,children:o(`billing.tokenCacheHitRate`)}),(0,a.jsxs)(`span`,{className:v.kpiValue,children:[p.cacheHitRate.toFixed(1),`%`]}),(0,a.jsxs)(`span`,{className:v.kpiDetail,children:[z(p.hit),` / `,z(p.hit+p.miss)]})]}),(0,a.jsxs)(`div`,{className:v.kpiTile,children:[(0,a.jsx)(`span`,{className:v.kpiLabel,children:o(`billing.tokenReasoningShare`)}),(0,a.jsxs)(`span`,{className:v.kpiValue,children:[p.reasoningPct.toFixed(1),`%`]}),(0,a.jsx)(`span`,{className:v.kpiDetail,children:z(p.reasoning)})]}),(0,a.jsxs)(`div`,{className:v.kpiTile,children:[(0,a.jsx)(`span`,{className:v.kpiLabel,children:o(`billing.tokenIo`)}),(0,a.jsx)(`span`,{className:v.kpiValue,children:p.io.toFixed(2)}),(0,a.jsxs)(`span`,{className:v.kpiDetail,children:[z(p.input),` / `,z(p.output)]})]}),(0,a.jsxs)(`div`,{className:v.kpiTile,children:[(0,a.jsx)(`span`,{className:v.kpiLabel,children:o(`billing.tokenPeak`)}),(0,a.jsx)(`span`,{className:v.kpiValue,children:p.peak===void 0?`—`:Oe(p.peak.miss+p.peak.hit+p.peak.output)}),(0,a.jsx)(`span`,{className:v.kpiDetail,children:p.peak?.date??`—`})]})]}),(0,a.jsxs)(`section`,{className:v.panel,"data-testid":`billing-token-daily`,children:[(0,a.jsxs)(`div`,{className:v.panelHead,children:[(0,a.jsx)(`h3`,{className:v.panelTitle,children:o(`billing.tokenDaily`)}),(0,a.jsx)(`span`,{className:v.rangeToggle,role:`group`,"aria-label":o(`billing.tokenDaily`),children:[7,30].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(v.rangeButton,n===e&&v.rangeButtonActive),"aria-pressed":n===e,onClick:()=>{i(e)},"data-testid":`billing-token-${e}d`,children:o(e===7?`billing.trend7d`:`billing.trend30d`)},e))})]}),m===null?(0,a.jsx)(`div`,{className:v.chartEmpty,children:o(`billing.trendEmpty`)}):(0,a.jsxs)(`div`,{className:v.chartWrap,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 200`,className:v.chartSvg,role:`img`,"aria-label":o(`billing.tokenDaily`),children:[[0,.5,1].map(e=>{let t=m.max*e,n=m.y(t);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:q.left,x2:680-q.right,y1:n,y2:n,className:v.chartGrid}),(0,a.jsx)(`text`,{x:q.left-8,y:n+3,textAnchor:`end`,className:v.chartAxisLabel,children:Oe(t)})]},e)}),d.map((e,t)=>{let n=m.inner(t)-m.barW/2,r=m.y(0),i=m.y(e.miss),o=m.y(e.miss+e.hit),s=m.y(e.miss+e.hit+e.output);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`rect`,{x:n,y:i,width:m.barW,height:r-i,fill:ke}),(0,a.jsx)(`rect`,{x:n,y:o,width:m.barW,height:i-o,fill:Ae}),(0,a.jsx)(`rect`,{x:n,y:s,width:m.barW,height:o-s,fill:je})]},e.date)}),m.indices.map(e=>{let t=d[e];return t===void 0?null:(0,a.jsx)(`text`,{x:m.inner(e),y:194,textAnchor:`middle`,className:v.chartAxisLabel,children:t.date.slice(5)},t.date)})]}),(0,a.jsxs)(`div`,{className:v.chartLegend,children:[(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:v.chartTooltipSwatch,style:{background:ke}}),o(`billing.tokenMiss`)]}),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:v.chartTooltipSwatch,style:{background:Ae}}),o(`billing.tokenHit`)]}),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:v.chartTooltipSwatch,style:{background:je}}),o(`billing.tokenOutput`)]})]})]})]}),(0,a.jsxs)(`section`,{className:v.panel,"data-testid":`billing-token-models`,children:[(0,a.jsx)(`div`,{className:v.panelHead,children:(0,a.jsx)(`h3`,{className:v.panelTitle,children:o(`billing.tokenByModel`)})}),f.length===0?(0,a.jsx)(`div`,{className:v.emptyRow,children:o(`billing.noData`)}):(0,a.jsx)(`div`,{className:v.tableScroll,children:(0,a.jsxs)(`table`,{className:v.modelTable,"data-testid":`billing-token-model-table`,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:o(`billing.model`)}),(0,a.jsx)(`th`,{className:v.numCol,children:o(`billing.inputTokens`)}),(0,a.jsx)(`th`,{className:v.numCol,children:o(`billing.outputTokens`)}),(0,a.jsx)(`th`,{className:v.numCol,children:o(`billing.tokenReasoningShort`)}),(0,a.jsx)(`th`,{className:v.numCol,children:o(`billing.cacheHitRate`)}),(0,a.jsx)(`th`,{className:v.numCol,children:o(`billing.tokenTotal`)}),(0,a.jsx)(`th`,{className:v.numCol,children:o(`billing.tokenShare`)}),(0,a.jsx)(`th`,{className:v.numCol,children:o(`billing.calls`)})]})}),(0,a.jsx)(`tbody`,{children:f.map(e=>(0,a.jsxs)(`tr`,{"data-testid":`billing-token-model`,children:[(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:v.modelName,children:e.name})}),(0,a.jsx)(`td`,{className:v.numCol,children:z(e.input)}),(0,a.jsx)(`td`,{className:v.numCol,children:z(e.output)}),(0,a.jsx)(`td`,{className:v.numCol,children:e.reasoning>0?z(e.reasoning):(0,a.jsx)(`span`,{className:v.na,children:`—`})}),(0,a.jsxs)(`td`,{className:v.numCol,children:[e.cacheHitRate.toFixed(1),`%`]}),(0,a.jsx)(`td`,{className:v.numCol,children:z(e.total)}),(0,a.jsx)(`td`,{className:v.numCol,children:(0,a.jsxs)(`span`,{className:v.tokenModelShareRow,children:[(0,a.jsx)(`span`,{className:v.tokenModelBar,children:(0,a.jsxs)(`span`,{className:v.tokenModelParts,style:{width:`${(e.share*100).toFixed(2)}%`},children:[(0,a.jsx)(`span`,{className:v.tokenModelPartIn,style:{width:`${e.total>0?e.input/e.total*100:0}%`}}),(0,a.jsx)(`span`,{className:v.tokenModelPartOut,style:{width:`${e.total>0?e.output/e.total*100:0}%`}})]})}),(e.share*100).toFixed(1),`%`]})}),(0,a.jsx)(`td`,{className:v.numCol,children:e.calls.toLocaleString()})]},e.key))})]})})]})]})}function Pe(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}`}function Fe(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 Ie({rounds:e,flags:t,currency:n,t:i}){let o=(0,r.useMemo)(()=>e.slice(-40),[e]),s=(0,r.useMemo)(()=>new Set(t.map(e=>`${e.sessionId}:${e.turn}`)),[t]),l=(0,r.useMemo)(()=>Math.max(1e-4,...o.map(e=>e.cost)),[o]);if(o.length===0)return(0,a.jsxs)(`div`,{className:v.roundsEmpty,children:[i(`billing.model`),` —`]});let u=e=>R(n===`usd`?L(e):e,n);return(0,a.jsxs)(`div`,{className:v.rounds,children:[(0,a.jsx)(`div`,{className:v.roundsBars,role:`img`,"aria-label":`cost per turn`,children:o.map(e=>{let t=s.has(`${e.sessionId}:${e.turn}`),n=Math.max(1,e.cost/l*100),r=D(e.startedAt)===`peak`;return(0,a.jsxs)(`div`,{className:c(v.roundsBarCol,r?v.roundsBarColPeak:v.roundsBarColOff),children:[(0,a.jsx)(`span`,{className:v.roundsBarLabel,style:{bottom:`${n}%`},children:u(e.cost)}),(0,a.jsx)(`div`,{className:v.roundsBarWrap,children:(0,a.jsx)(`div`,{className:t?v.roundsBarFlagged:v.roundsBar,style:{height:`${n}%`},"data-testid":`round-bar`,title:`${i(`billing.model`)} ${e.model} · ${u(e.cost)} · ${Fe(e.startedAt)}${e.endedAt===void 0?``:` → ${Pe(e.endedAt)}`}`,children:t&&(0,a.jsx)(`span`,{className:v.roundsFlagMark,"aria-hidden":`true`})})})]},`${e.sessionId}:${e.turn}`)})}),(0,a.jsxs)(`div`,{className:v.roundsAxis,children:[(0,a.jsxs)(`span`,{children:[i(`billing.costAbbr`),` `,u(l)]}),(0,a.jsxs)(`span`,{children:[o.length,` 轮`]})]})]})}let Le=[`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)`],Re=[`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 J(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 Be(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 Ve({days:e,currency:t,now:n,t:i,range:o=`month`}){let[s,c]=(0,r.useState)(null),l=e=>R(t===`usd`?L(e):e,t),u=(0,r.useMemo)(()=>J(e,n??new Date),[e,n]);if(o===`year`){let t=Be(e,n??new Date),r=[],o=-1;return t.forEach((e,t)=>{let n=Number(e[0]?.date.slice(5,7)??0);n!==o&&(r.push({index:t,label:Re[n-1]??``}),o=n)}),(0,a.jsxs)(`div`,{className:v.heatmapYear,"data-testid":`heatmap-year`,children:[(0,a.jsxs)(`div`,{className:v.heatmapYearBody,children:[(0,a.jsx)(`div`,{className:v.heatmapYearWeekdays,"aria-hidden":`true`,children:[{label:`Mon`,row:1},{label:`Wed`,row:3},{label:`Fri`,row:5}].map(e=>(0,a.jsx)(`span`,{className:v.heatmapYearWeekday,style:{gridRow:e.row},children:e.label},e.label))}),(0,a.jsxs)(`div`,{className:v.heatmapYearScroll,children:[(0,a.jsx)(`div`,{className:v.heatmapYearMonths,"aria-hidden":`true`,"data-testid":`heatmap-year-months`,children:r.map(e=>(0,a.jsx)(`span`,{className:v.heatmapYearMonth,style:{gridColumn:e.index+1},children:e.label},e.index))}),(0,a.jsx)(`div`,{className:v.heatmapYearGrid,role:`img`,"aria-label":`yearly cost heatmap`,"data-testid":`heatmap-year-grid`,children:t.flat().map(e=>(0,a.jsx)(`button`,{type:`button`,className:v.heatmapYearCell,"data-testid":`heatmap-year-cell`,"data-level":e.level,style:{background:Le[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`},e.date))})]})]}),(0,a.jsxs)(`div`,{className:v.heatmapFooter,children:[(0,a.jsx)(`span`,{className:v.heatmapLegendText,children:i(`billing.heatmapLess`)}),(0,a.jsx)(`span`,{className:v.heatmapLegend,children:Le.map((e,t)=>(0,a.jsx)(`i`,{style:{background:e}},t))}),(0,a.jsx)(`span`,{className:v.heatmapLegendText,children:i(`billing.heatmapMore`)})]})]})}return(0,a.jsxs)(`div`,{className:v.heatmap,children:[(0,a.jsx)(`div`,{className:v.heatmapGrid,role:`img`,"aria-label":`daily cost heatmap`,children:u.map(e=>e.map(e=>e.placeholder?(0,a.jsx)(`div`,{className:v.heatmapCellEmpty,children:e.dayNum},e.date):(0,a.jsx)(`button`,{type:`button`,className:v.heatmapCell,"data-testid":`heatmap-cell`,"data-level":e.level,style:{background:Le[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`,onMouseEnter:()=>{c(e)},onMouseLeave:()=>{c(null)},onFocus:()=>{c(e)},onBlur:()=>{c(null)},children:e.dayNum},e.date)))}),(0,a.jsxs)(`div`,{className:v.heatmapFooter,children:[(0,a.jsx)(`span`,{className:v.heatmapLegendText,children:i(`billing.heatmapLess`)}),(0,a.jsx)(`span`,{className:v.heatmapLegend,children:Le.map((e,t)=>(0,a.jsx)(`i`,{style:{background:e}},t))}),(0,a.jsx)(`span`,{className:v.heatmapLegendText,children:i(`billing.heatmapMore`)}),s!==null&&(0,a.jsxs)(`span`,{className:v.heatmapHover,"data-testid":`heatmap-hover`,children:[s.date,` · `,l(s.value)]})]})]})}let He={window:6,threshold:2,reasonFactor:1.8,reasonHitDropPp:15};function Y(e){if(e.length===0)return null;let t=0;for(let n of e)t+=n;return t/e.length}function Ue(e){let t=e.cacheHit+e.cacheMiss;return t<=0?null:e.cacheHit/t*100}function We(e,t){let n=t?.window??He.window,r=t?.threshold??He.threshold,i=t?.reasonFactor??He.reasonFactor,a=t?.reasonHitDropPp??He.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=Ue(t),p=Y(s),m=[];if(p!==null&&p>0&&t.cost>p*r){let n=Y(c),r=Y(l),s=Y(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 Ge(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function Ke(e){return/^[=+\-@\t\r]/.test(e)?`'${e}`:e}function qe(e){return e.toFixed(2)}function Je(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,qe(n.cost)].join(`,`)})].join(`
|
|
3
|
-
`)}function
|
|
4
|
-
`)}function
|
|
5
|
-
`)}function Qe(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 $e(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 et=`usageBilling`,tt={"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.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.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.peakShareHint":`近 {count} 轮`,"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.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":`调用`},X={"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.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.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.peakShareHint":`last {count} turns`,"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.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`},Z={"智谱 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 nt(e,t){return t===`en`?Z[e]??e:e}let rt={Anthropic:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M26.9568 9.88184H22.1265L30.7753 31.7848H35.4917L26.9568 9.88184ZM13.028 9.88184L4.4917 31.7848H9.32203L11.2305 27.1793H20.2166L22.0126 31.6724H26.8444L18.0832 9.88184H13.028ZM12.5783 23.1361L15.4987 15.3853L18.5315 23.1361H12.5783Z' fill='currentColor'/%3E%3C/svg%3E`,Cohere:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.14882 13.5552C9.58082 13.5552 10.4448 13.5336 11.6544 13.0368C13.0584 12.4536 15.8232 11.4168 17.832 10.3368C19.236 9.5808 19.8408 8.5872 19.8408 7.248C19.8408 5.412 18.3504 3.9 16.4928 3.9H8.71682C6.06002 3.9 3.90002 6.06 3.90002 8.7168C3.90002 11.3736 5.93042 13.5552 9.14882 13.5552Z' fill='currentColor'/%3E%3Cpath d='M10.4664 16.86C10.4664 15.564 11.244 14.376 12.4536 13.8792L14.8944 12.864C17.3784 11.8488 20.1 13.6632 20.1 16.3416C20.1 18.4152 18.4152 20.1 16.3416 20.1H13.6848C11.9136 20.1 10.4664 18.6528 10.4664 16.86Z' fill='currentColor'/%3E%3Cpath d='M6.68642 14.1816C5.15282 14.1816 3.90002 15.4344 3.90002 16.968V17.3352C3.90002 18.8472 5.15282 20.1 6.68642 20.1C8.22003 20.1 9.47283 18.8472 9.47283 17.3136V16.9464C9.45123 15.4344 8.22003 14.1816 6.68642 14.1816Z' fill='currentColor'/%3E%3C/svg%3E`,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`,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`,Meta:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M27.1942 9.03509C24.4881 9.03509 22.3726 11.0731 20.4574 13.6623C17.8258 10.3114 15.6255 9.03509 12.9925 9.03509C7.62404 9.03509 3.51001 16.0234 3.51001 23.4181C3.51001 28.0453 5.74831 30.9649 9.49831 30.9649C12.1971 30.9649 14.1387 29.693 17.5904 23.6594C17.5904 23.6594 19.029 21.1199 20.0173 19.3699C20.3643 19.9293 20.7298 20.5327 21.1138 21.1798L22.7322 23.902C25.8843 29.1769 27.6416 30.9649 30.8229 30.9649C34.4778 30.9649 36.51 28.0058 36.51 23.2822C36.51 15.538 32.3039 9.03509 27.1942 9.03509ZM14.9574 22.0263C12.1606 26.4123 11.1928 27.3962 9.63574 27.3962C8.03194 27.3962 7.07872 25.9883 7.07872 23.4781C7.07872 18.1096 9.75562 12.6199 12.9471 12.6199C14.6752 12.6199 16.1197 13.617 18.3316 16.7836C16.2308 20.0058 14.9574 22.0263 14.9574 22.0263ZM25.5202 21.4751L23.5831 18.2456C23.0969 17.4514 22.5938 16.6676 22.0743 15.8947C23.8185 13.2032 25.2556 11.8611 26.9676 11.8611C30.5202 11.8611 33.3638 17.095 33.3638 23.5219C33.3638 25.9722 32.5612 27.3947 30.8989 27.3947C29.3053 27.3947 28.5451 26.3421 25.5188 21.4737' 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`,"Mistral 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='M8.92783 8.88101H13.357V13.3088H17.7861V17.738H17.7835H22.2152V13.3088H26.6418V8.88101H31.0722V26.5949H35.5V31.0241H22.2139V26.5962H17.7861V22.1671H13.3557V26.5949L17.7861 26.5962V31.0241H4.5V26.5949H8.92783V8.88101ZM22.2139 26.5962H26.6418V22.1671H22.2152V26.5962H22.2139Z' 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`,xAI:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.4579 15.6036L26.1529 35H20.0656L6.37059 15.6036H12.4579ZM12.4524 26.3764L15.4974 30.6909L12.4551 35H6.36377L12.4524 26.3764ZM33.6365 7.15727V35H28.647V14.2236L33.6365 7.15727ZM33.6365 5L20.0656 24.2205L17.0206 19.9073L27.5451 5H33.6365Z' 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 xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28' %3E %3Cg clipPath='url(%23clip0_9396_9240)'%3E %3Cpath d='M14 0C6.272 0 0 6.272 0 14C0 21.728 6.272 28 14 28C21.728 28 28 21.728 28 14C28 6.272 21.728 0 14 0ZM10.22 22.876H5.11V17.766H10.22V22.876ZM16.548 22.876H11.438V17.766H16.548V22.876ZM16.548 16.562H11.438V11.438H16.548V16.562ZM16.548 10.234H11.438V5.124H16.548V10.234ZM22.876 10.234H17.766V5.11H22.876V10.234Z' fill='currentColor' /%3E %3C/g%3E %3Cdefs%3E %3CclipPath id='clip0_9396_9240'%3E %3Crect width='28' height='28' /%3E %3C/clipPath%3E %3C/defs%3E %3C/svg%3E`,美团:`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' fill='currentColor'%3E %3Cg transform='translate(0 0.48)'%3E %3Cpath fill-rule='evenodd' d='M1.6654430203094481,29.51981024475098C1.1898620203094483,29.51981024475098,0.8449320203094483,29.066910244750975,0.9713445203094483,28.608410244750978L7.043789020309449,6.584860244750977C7.303349020309448,5.6433932447509765,8.404949020309449,5.227902244750976,9.221609020309447,5.763425244750977L17.21172902030945,11.002880244750976C17.690529020309448,11.316830244750976,18.309829020309447,11.317340244750977,18.78912902030945,11.004100244750976L26.81322902030945,5.760550244750976C27.63062902030945,5.226395244750977,28.73132902030945,5.643421244750977,28.989629020309447,6.5851002447509766L35.030329020309445,28.609310244750976C35.15602902030945,29.067610244750977,34.81112902030945,29.51981024475098,34.33592902030945,29.51981024475098L26.623629020309448,29.51981024475098C28.027629020309448,27.894210244750976,28.80002902030945,25.817910244750976,28.80002902030945,23.670010244750976L28.80002902030945,23.419310244750978C28.80002902030945,21.318310244750975,28.03582902030945,19.289110244750976,26.649829020309447,17.710010244750976L25.660029020309448,12.741890244750977C25.60192902030945,12.450000244750978,25.34572902030945,12.239800244750977,25.04812902030945,12.239800244750977C24.913029020309448,12.239800244750977,24.78162902030945,12.283570244750976,24.67362902030945,12.364580244750977L20.94192902030945,15.163390244750977C20.67612902030945,15.362690244750977,20.332429020309448,15.426190244750977,20.01302902030945,15.334900244750976C18.69732902030945,14.959020244750976,17.30272902030945,14.959020244750976,15.987129020309448,15.334900244750976C15.667629020309448,15.426190244750977,15.323929020309448,15.362690244750977,15.058229020309449,15.163390244750977L11.324829020309448,12.363350244750976C11.217929020309448,12.283140244750976,11.087829020309448,12.239800244750977,10.954129020309448,12.239800244750977C10.656209020309449,12.239800244750977,10.400719020309449,12.452340244750976,10.346539020309448,12.745240244750978L9.386279020309448,17.936610244750977C7.985189020309448,19.361310244750975,7.200069020309448,21.279610244750977,7.200069020309448,23.277810244750977L7.200069020309448,23.752710244750975C7.200069020309448,25.848010244750977,7.949629020309448,27.874310244750976,9.313239020309448,29.465210244750978L9.360069020309448,29.51981024475098L1.6654430203094481,29.51981024475098Z'/%3E %3Cpath d='M14.040008306503296,25.19998077392578L16.200008306503296,25.19998077392578L16.200008306503296,20.15998077392578L14.367281306503296,20.15998077392578L14.040008306503296,25.19998077392578ZM21.960008306503298,25.19998077392578L19.800008306503294,25.19998077392578L19.800008306503294,20.15998077392578L21.632728306503296,20.15998077392578L21.960008306503298,25.19998077392578Z'/%3E %3C/g%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`,小米:`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 width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.85893 26.3499L18.1801 29.6463C18.1635 30.5223 18.1894 31.3987 18.2576 32.2722L25.9507 34.3298C23.669 35.2716 21.1952 35.6547 18.7355 35.4471L18.503 35.4265L18.4462 35.4213L18.3377 35.4097L18.2163 35.3968C18.1486 35.3886 18.081 35.38 18.0135 35.3709L17.8753 35.3528L17.7332 35.3322C17.5951 35.3121 17.4573 35.2901 17.3198 35.2663L17.2656 35.256L17.1687 35.2392L17.0305 35.2133L16.9401 35.194L16.82 35.1694L16.7231 35.1488L16.6004 35.1229L16.4751 35.0932L16.3537 35.0648L16.2659 35.0428L16.1522 35.0144L16.0359 34.9834L15.9132 34.9511L15.8073 34.9214L15.6665 34.8827L15.5864 34.8568L15.4779 34.8245L15.3578 34.7884L15.2222 34.7445L15.1473 34.7199L15.0439 34.6863L14.9277 34.6463L14.8424 34.6153C14.8235 34.6089 14.8045 34.6025 14.7856 34.5959L14.6978 34.5636L14.5673 34.5158L14.4937 34.4874L14.3904 34.4487L14.278 34.4035L14.1643 34.3583L14.0623 34.3169L13.9396 34.2653L13.8582 34.2291L13.7768 34.1942C13.7591 34.1865 13.7415 34.1788 13.7239 34.171L13.6386 34.1322L13.5056 34.0715L13.4384 34.0405L13.3144 33.9811L13.2343 33.9423L13.1258 33.8907L13.0147 33.8338L12.8946 33.7731L12.8274 33.7383L12.6944 33.6672L12.6208 33.6285L12.5459 33.5871C12.526 33.576 12.5062 33.5648 12.4864 33.5536L12.365 33.4851L12.2875 33.4412L12.2217 33.4024L12.1287 33.3495L12.0227 33.2849L11.9026 33.2126L11.8354 33.1712L11.7269 33.1028L11.6482 33.0524L11.5461 32.9878L11.4557 32.9271L11.3872 32.8819C11.3639 32.8665 11.3407 32.851 11.3175 32.8354L11.2607 32.7966L11.2038 32.7579C11.1866 32.7459 11.1693 32.7338 11.1522 32.7217L11.0785 32.6701L10.9804 32.6003L10.8912 32.5357L10.7957 32.466L10.7233 32.4117L10.6252 32.3381L10.527 32.2619L10.4159 32.1753L10.3578 32.1301L10.2751 32.063L10.1795 31.9855L10.0646 31.8912L10.0052 31.8408L9.94575 31.7904C9.92717 31.7746 9.90866 31.7586 9.8902 31.7426L9.83208 31.691L9.75329 31.6225L9.66287 31.5424L9.57504 31.4649L9.49496 31.39L9.40841 31.3099L9.33996 31.2453L9.22629 31.1368C9.18345 31.0953 9.14082 31.0535 9.09842 31.0116L9.06096 30.9754L9.008 30.9211L8.91887 30.8307L8.85429 30.7648L8.78971 30.6964C8.71592 30.6207 8.64357 30.5436 8.57271 30.4652L8.46938 30.3515L8.38929 30.2611L8.29758 30.1578L8.24333 30.0945L8.17488 30.0144L8.09996 29.9266L8.04054 29.8542C8.02888 29.8401 8.01725 29.8258 8.00567 29.8116L7.94754 29.7406L7.86229 29.6346L7.80934 29.5675L7.74475 29.4848L7.71892 29.4525C6.97985 28.4945 6.3556 27.4532 5.85893 26.3499ZM4.54143 18.8661L19.2057 22.7888C18.9602 23.6439 18.758 24.5109 18.5999 25.3864L32.5718 29.1244C31.8777 30.0748 31.0782 30.9436 30.1887 31.7142L5.34872 25.0673L5.32805 25.0079L5.28284 24.8736C5.26087 24.8078 5.23934 24.742 5.21826 24.676L5.20922 24.6462C5.1098 24.3302 5.02063 24.011 4.94184 23.6891L4.90309 23.5264L4.87984 23.423L4.85272 23.2978L4.82947 23.1931L4.80622 23.0769L4.78426 22.9684L4.76101 22.847C4.72743 22.6648 4.69643 22.4814 4.6693 22.2967L4.64735 22.1443L4.63314 22.0371L4.61635 21.9053C4.6077 21.8361 4.59952 21.7668 4.5918 21.6974L4.58535 21.6367C4.48884 20.7162 4.47414 19.7891 4.54143 18.8661ZM6.59905 12.214L22.0318 16.3421C21.5565 17.1236 21.1212 17.9322 20.7273 18.764L35.3166 22.6674C35.1332 23.7266 34.8413 24.7496 34.4538 25.7222L19.5351 21.731L4.66026 17.7526L4.67964 17.6235L4.68997 17.5602L4.70289 17.4736L4.72226 17.3613L4.74551 17.2347C4.7791 17.0435 4.81785 16.8536 4.85918 16.6638L4.89534 16.5036L4.92118 16.3938L4.95218 16.2685C4.98059 16.1523 5.0103 16.036 5.04259 15.9224L5.07876 15.7906L5.10847 15.6834L5.14722 15.5542L5.17951 15.4483L5.21826 15.3243L5.25184 15.2184L5.29189 15.0957C5.62637 14.0924 6.06355 13.1262 6.59646 12.2127L6.59905 12.214ZM12.3366 6.53068L26.913 10.4289C26.1438 11.1271 25.4158 11.8693 24.7327 12.6519L34.8374 15.3553C35.1823 16.4558 35.4083 17.608 35.5 18.7976L7.22034 11.2336L7.27846 11.1497L7.31334 11.098L7.365 11.027L7.42442 10.943L7.49546 10.8448L7.56521 10.7518L7.64788 10.6407L7.71246 10.5568L7.78609 10.4625L7.85713 10.3721L7.93463 10.2765L8.00567 10.1874L8.08963 10.0879L8.15938 10.0027L8.24463 9.90321L8.31308 9.82571L8.40608 9.71979L8.47454 9.64229L8.56108 9.54671L8.63083 9.47179L8.72512 9.37104L8.80004 9.29354L8.88142 9.207L9.09842 8.98742L9.22758 8.86084L9.30379 8.7885L9.40196 8.69679C10.2922 7.86254 11.2771 7.13554 12.3366 6.53068ZM20.022 4.50018H20.1473L20.2532 4.50147L20.3423 4.50277L20.4121 4.50535L20.4999 4.50793L20.5593 4.50922L20.6575 4.5131L20.7182 4.51568L20.7957 4.51956L20.8655 4.52214L20.9778 4.5286L21.1135 4.53764L21.2995 4.55185L21.4131 4.56089L21.47 4.56606L21.5694 4.57639L21.6753 4.58672L21.736 4.59318L21.8678 4.60868L21.9324 4.61643L22.0719 4.63452L22.1765 4.64743L22.2308 4.65518L22.3147 4.6681L22.5821 4.70943L22.6725 4.72493L22.7565 4.73914L22.9373 4.77272L23.0561 4.79597L23.1982 4.82439L23.2576 4.83731L23.3545 4.85797L23.4075 4.87089L23.4875 4.88768L23.5418 4.9006L23.6257 4.91997L23.689 4.93547L23.7807 4.95743L23.9047 4.98843L24.0494 5.02718L24.1954 5.06593L24.3413 5.10726L24.4059 5.12664L24.4963 5.15247L24.5971 5.18347L24.6914 5.21318L24.756 5.23385L24.8205 5.25451L24.9187 5.28681L25.0466 5.32943L25.1783 5.37593L25.2403 5.39789L25.323 5.4276L25.4431 5.47151L25.5852 5.52447L25.735 5.5826L25.8642 5.63426L25.9249 5.6601L26.0024 5.6911L26.0554 5.71435L26.1367 5.74793L26.1884 5.77118L26.262 5.80347L26.4041 5.86547L26.5333 5.92489L26.6289 5.97009L26.7257 6.01659L26.8032 6.05276L26.9221 6.11218L27.0396 6.1703L27.1714 6.23747L27.2398 6.27364L27.3031 6.30722L27.3625 6.33822L27.44 6.38084L27.493 6.40926L27.5602 6.44672L27.6738 6.5113L27.8107 6.5888L27.9231 6.65468L27.9967 6.69859L28.0652 6.73993L28.1892 6.81613L28.3029 6.88718L28.4294 6.96726L28.4759 6.99826L28.5586 7.05122L28.6671 7.12355L28.7188 7.15842L28.7989 7.21267L28.8789 7.26822L28.9086 7.29017C28.9784 7.33797 29.0481 7.38705 29.1166 7.43742L29.2238 7.51492L29.3078 7.57692L29.3801 7.63246L29.4912 7.71642L29.5971 7.79909L29.6488 7.83784L29.7134 7.8908L29.8244 7.97992L29.9265 8.06388L30.0363 8.15559C30.9559 8.93059 31.7839 9.81279 32.5021 10.779L13.8285 5.7841L13.9086 5.74922L13.9925 5.71305L14.0971 5.66914L14.2082 5.62393C14.3542 5.5658 14.5014 5.50768 14.6487 5.45472L14.7727 5.40951L14.8928 5.36689L15.0013 5.32814L15.1253 5.2881C15.2377 5.24935 15.3526 5.21318 15.4663 5.17831L15.5839 5.14343L15.6949 5.11114L15.8267 5.07239L15.9365 5.04268L16.0656 5.0091L16.1767 4.9781L16.293 4.94839L16.4105 4.91997L16.5332 4.89156L16.6495 4.86572L16.7761 4.8386L16.8936 4.81276L17.0163 4.78951L17.1351 4.76627L17.2643 4.74302L17.3818 4.72235L17.5084 4.70039L17.6273 4.68231L17.7526 4.66293L17.8714 4.64614L18.0031 4.62935L18.1207 4.61385L18.2563 4.59835L18.3726 4.58543L18.5082 4.57252C18.6283 4.5596 18.7484 4.54927 18.8698 4.54152L19.0068 4.53118L19.123 4.52472L19.2651 4.51697L19.3852 4.51181L19.5144 4.50664L19.6397 4.50406L19.7675 4.50147L20.022 4.49889V4.50018Z' 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 role='img' fill='currentColor' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.154 0C7.71 0 6.54 1.658 6.54 3.707c0 2.051 1.171 3.71 2.615 3.71 1.446 0 2.614-1.659 2.614-3.71C11.768 1.658 10.6 0 9.154 0zm7.025.594C14.86.58 13.347 2.589 13.2 3.927c-.187 1.745.25 3.487 2.179 3.735 1.933.25 3.175-1.806 3.422-3.364.252-1.555-.995-3.364-2.362-3.674a1.218 1.218 0 0 0-.261-.03zM3.582 5.535a2.811 2.811 0 0 0-.156.008c-2.118.19-2.428 3.24-2.428 3.24-.287 1.41.686 4.425 3.297 3.864 2.617-.561 2.262-3.68 2.183-4.362-.125-1.018-1.292-2.773-2.896-2.75zm16.534 1.753c-2.308 0-2.617 2.119-2.617 3.616 0 1.43.121 3.425 2.988 3.362 2.867-.063 2.553-3.238 2.553-3.988 0-.745-.62-2.99-2.924-2.99zm-8.264 2.478c-1.424.014-2.708.925-3.323 1.947-1.118 1.868-2.863 3.05-3.112 3.363-.25.309-3.61 2.116-2.864 5.42.746 3.301 3.365 3.237 3.365 3.237s1.93.19 4.171-.31c2.24-.495 4.17.123 4.17.123s5.233 1.748 6.665-1.616c1.43-3.364-.808-5.109-.808-5.109s-2.99-2.306-4.736-4.798c-1.072-1.665-2.348-2.268-3.528-2.257zm-2.234 3.84l1.542.024v8.197H7.758c-1.47-.291-2.055-1.292-2.13-1.462-.072-.173-.488-.976-.268-2.343.635-2.049 2.447-2.196 2.447-2.196h1.81zm3.964 2.39v3.881c.096.413.612.488.612.488h1.614v-4.343h1.689v5.782h-3.915c-1.517-.39-1.59-1.465-1.59-1.465v-4.317zm-5.458 1.147c-.66.197-.978.708-1.05.928-.076.22-.247.78-.1 1.269.294 1.095 1.248 1.144 1.248 1.144h1.37v-3.34z'/%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`};function it(e){return rt[e]}let at=`dsh-billing-peak-alert-v1`,ot={enabled:!1,leadMin:2,position:`bottom-right`,webNotify:!0,mode:`both`};function st(){try{let e=localStorage.getItem(at);if(e===null)return{...ot};let t=JSON.parse(e),n=t.mode===`peak`||t.mode===`offPeak`?t.mode:ot.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))):ot.leadMin,position:r,webNotify:t.webNotify!==!1,mode:n}}catch{return{...ot}}}function ct(e){try{localStorage.setItem(at,JSON.stringify(e))}catch{}}function lt(e,t,n){if(!t.enabled)return null;let r=ce(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 ut({hit:e,config:t,t:n,onDismiss:i}){let[o,s]=(0,r.useState)(()=>Date.now());if((0,r.useEffect)(()=>{let e=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,r.useEffect)(()=>{o>=e.atMs&&i()},[o,e.atMs,i]),o>=e.atMs)return null;let l=Math.max(1,Math.round((e.atMs-o)/6e4)),u=e.entering,d=n(u===`peak`?`billing.tierPeak`:`billing.tierOff`),f=n(u===`peak`?`billing.peakAlertDescPeak`:`billing.peakAlertDescOff`),p=u===`peak`;return(0,a.jsxs)(`div`,{className:c(v.peakCard,p?v.peakCardPeak:v.peakCardOff,t.position===`center`?v.peakCardCenter:v.peakCardCorner),"data-testid":`billing-peak-alert`,role:`alert`,children:[(0,a.jsxs)(`div`,{className:v.peakHead,children:[(0,a.jsxs)(`span`,{className:c(v.peakTag,p?v.peakTagPrimary:v.peakTagSuccess),children:[(0,a.jsx)(`span`,{className:c(v.peakDot,p?v.peakDotPrimary:v.peakDotSuccess),"aria-hidden":`true`}),d]}),(0,a.jsx)(`button`,{type:`button`,className:v.peakClose,onClick:i,"aria-label":n(`billing.close`),children:`×`})]}),(0,a.jsxs)(`div`,{className:c(v.peakCount,p?v.peakCountPrimary:v.peakCountSuccess),children:[l,`min`]}),(0,a.jsx)(`p`,{className:v.peakDesc,children:f})]})}let dt=[{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 ft(e){if(e!==void 0)return e.split(/[\\/]/).filter(Boolean).pop()??e}let pt=[50,80,100],mt={checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]},ht={DeepSeek:[`deepseek`],"智谱 AI":[`zhipu`,`glm`,`z.ai`],阿里通义:[`qwen`,`tongyi`,`dashscope`,`aliyun`],字节豆包:[`doubao`,`volcengine`,`ark`],月之暗面:[`moonshot`,`kimi`],小米:[`xiaomi`,`mi`,`mimo`],MiniMax:[`minimax`],百度文心:[`ernie`,`wenxin`,`qianfan`,`baidu`],腾讯混元:[`hunyuan`,`tencent`],零一万物:[`01.ai`,`lingyi`,`yi`],阶跃星辰:[`step`,`stepfun`,`step-3.7`],科大讯飞:[`spark`,`xfyun`,`iflytek`],商汤:[`sensenova`,`sensetime`],百川智能:[`baichuan`],OpenAI:[`openai`],Google:[`google`,`gemini`],xAI:[`xai`,`grok`],Meta:[`meta`,`llama`],Anthropic:[`claude`,`anthropic`],"Mistral AI":[`mistral`,`ministral`,`devstral`],Cohere:[`cohere`,`command`],美团:[`longcat`,`meituan`],面壁智能:[`minicpm`,`modelbest`],小红书:[`dots`,`rednote`,`xiaohongshu`]};function Q(e){return e.trim().toLowerCase().replace(/[\s_/-]+/g,``)}function gt(e,t){if(e.length===0||t.length===0)return!1;if(e===t)return!0;let[n,r]=e.length<=t.length?[e,t]:[t,e];return n.length>=3&&r.includes(n)}function _t(e,t){let n=Q(e),r=Q(t);if(gt(n,r))return!0;let i=ht[e];return i!==void 0&&i.some(e=>gt(Q(e),r))}function vt(e){let t=e.trim().toLowerCase(),n=t.replace(/[\s_/-]+/g,``);if(n.length!==0){for(let[e,n]of Object.entries(ht))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(ht))for(let r of t){let t=Q(r);if(!(t.length<4)&&n.includes(t))return e}}}let yt={"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 bt(e){let t=yt[e];return t===void 0?vt(e)??e:t}function xt(e,t){let n=Object.keys(e).filter(e=>e<=t).sort().slice(-7);return n.length===0?0:n.reduce((t,n)=>t+(e[n]?.cost??0),0)/n.length}function St(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:xt(e,n);return a<=0?0:a*i}function Ct(e){let t=0,n=0;for(let r of e)D(r.startedAt)===`peak`?t+=r.cost:n+=r.cost;return{peak:t,offPeak:n}}function wt(e){return Object.keys(e).length}function Tt(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 Et(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 Dt(e,t){return e.checked?e.okProviders.some(e=>_t(t,e))?v.healthOk:e.badProviders.some(e=>_t(t,e))?v.healthBad:v.healthIdle:v.healthIdle}function Ot(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 kt(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 At(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 jt(e,t){switch(e){case`site`:return t(`billing.relaySite`);case`direct`:return t(`billing.relayDirect`);default:return t(`billing.relayUnknown`)}}function Mt(e,t){switch(e){case`new-api`:return t(`billing.relayKindNewApi`);case`sub2api`:return t(`billing.relayKindSub2Api`);default:return t(`billing.relayKindUnknown`)}}let Nt={site:v.siteKindSite,direct:v.siteKindDirect,unknown:v.siteKindUnknown},Pt={"new-api":v.siteKindSite,sub2api:v.siteKindDirect,unknown:v.siteKindUnknown},Ft=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 It(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}let Lt=[`#3b82f6`,`#06b6d4`,`#8b5cf6`,`#f59e0b`,`#10b981`,`#ef4444`,`#ec4899`,`#6366f1`,`#f97316`,`#14b8a6`],Rt={total:{calls:0,input:0,output:0,cacheHit:0,cacheMiss:0,cost:0,reasoning:0},byModel:{},byDay:{},byDayModels:{}};async function zt(){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;return{total:r.total??Rt.total,byModel:r.byModel??{},byDay:r.byDay??{},...r.byDayModels===void 0?{}:{byDayModels:r.byDayModels},...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}:{},...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 Bt=!1;async function Vt(e=0){try{let t=await fetch(`/api/billing/pricing`);if(!t.ok){Bt=!1;return}let n=await t.text(),r=JSON.parse(n);if(typeof r!=`object`||!r||!(`source`in r)){Bt=!1;return}let i=r;if(i.source===`builtin`&&e<3){if(e===0){if(Bt)return;Bt=!0}setTimeout(()=>{Vt(e+1)},2e3);return}Bt=!1,T(i)}catch{Bt=!1}}async function Ht(){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 Ut(){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 Wt(){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 Gt(){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 Kt(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 qt(e){let{wide:t,t:n,onOpen:i,monthCost:o,todayCost:s,weekCost:l,days:u,vendorStatus:d,dash:f,floatPrefs:p,subscriptions:m,cardPrefs:h,monthTokens:g,todayTokens:_,weekTokens:ee}=e,y=(0,r.useMemo)(()=>p.targets.map(e=>m.find(t=>t.provider===e)).filter(e=>e!==void 0),[p.targets,m]),[b,te]=(0,r.useState)(0),x=y.length===0?0:Math.min(b,y.length-1),S=y[x];(0,r.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 C=(0,a.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,a.jsx)(`path`,{d:`M4 7h16v11H4z`}),(0,a.jsx)(`path`,{d:`M4 10h16`}),(0,a.jsx)(`path`,{d:`M8 14h3`})]});if(!t)return(0,a.jsx)(`button`,{type:`button`,className:v.railButton,"data-testid":`billing-rail-button`,onClick:i,title:`${n(`billing.title`)} · ${R(o)}`,children:C});let w=h.metric===`tokens`,ne=u.map(e=>w?e.tokens:e.cost),T=Math.max(...ne,0),re=ne.map(e=>T>0?4+e/T*12:4);return(0,a.jsxs)(`span`,{className:v.triggerWrap,children:[(0,a.jsxs)(`button`,{type:`button`,className:v.trigger,"data-testid":`billing-trigger`,onClick:i,title:`${n(`billing.title`)} · ${R(o)}`,children:[(0,a.jsx)(`span`,{className:v.triggerIcon,"data-testid":`billing-trigger-icon`,children:C}),(0,a.jsxs)(`span`,{className:v.triggerMain,children:[(0,a.jsxs)(`span`,{className:v.triggerPrimary,children:[(0,a.jsx)(`span`,{className:v.triggerLabel,children:n(w?`billing.triggerMonthTokens`:`billing.triggerMonth`)}),w?(0,a.jsx)(`span`,{className:v.triggerMetric,"data-testid":`billing-trigger-month-tokens`,children:z(g)}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:v.triggerYen,"aria-hidden":`true`,children:R(o).charAt(0)}),(0,a.jsx)(`span`,{className:v.triggerMetric,children:R(o).slice(1)})]})]}),(0,a.jsx)(`span`,{className:v.triggerSub,"data-testid":`billing-trigger-today`,children:w?`${n(`billing.triggerToday`)} ${z(_)} · ${n(`billing.weekCost`)} ${z(ee)}`:`${n(`billing.triggerToday`)} ${R(s)} · ${n(`billing.weekCost`)} ${R(l)}`})]}),(0,a.jsx)(`span`,{className:v.triggerSpark,"data-testid":`billing-trigger-spark`,"aria-hidden":`true`,children:re.map((e,t)=>(0,a.jsx)(`span`,{className:t===re.length-1?v.triggerSparkHot:v.triggerSparkBar,style:{height:`${e}px`}},u[t]?.date??String(t)))})]}),(0,a.jsx)(`span`,{className:c(v.triggerPop,p.mode===`subscription`&&v.triggerPopSubscription),"data-testid":`billing-trigger-pop`,"aria-hidden":`true`,children:p.mode===`subscription`?(0,a.jsx)(a.Fragment,{children:y.length===0?(0,a.jsx)(`span`,{className:v.triggerPopEmpty,children:n(`billing.floatNoTargets`)}):(0,a.jsxs)(a.Fragment,{children:[S!==void 0&&(0,a.jsxs)(`div`,{className:v.floatSub,"data-testid":`billing-float-subscription`,children:[(0,a.jsxs)(`div`,{className:v.floatSubHead,children:[(0,a.jsx)(`span`,{className:v.floatSubName,children:S.displayName}),S.plan!==void 0&&(0,a.jsx)(`span`,{className:v.floatSubPlan,children:S.plan})]}),S.windows.map(e=>(()=>{let t=Math.min(100,Math.max(0,e.usedPercent)),r=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,a.jsxs)(`div`,{className:v.subscriptionWindow,children:[(0,a.jsx)(`span`,{className:v.subscriptionWindowLabel,children:kt(e.kind,n)}),(0,a.jsx)(`span`,{className:v.subscriptionTrack,"aria-hidden":`true`,children:(0,a.jsx)(`span`,{className:c(v.subscriptionFill,t>=100&&v.subscriptionFillOver,t>=80&&t<100&&v.subscriptionFillWarn),style:{width:`${t}%`}})}),(0,a.jsxs)(`span`,{className:v.subscriptionMeta,children:[(0,a.jsx)(`span`,{className:c(v.subscriptionPct,r&&v.subscriptionExhausted),children:r?n(`billing.subscriptionExhausted`):n(`billing.subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,a.jsx)(`span`,{className:v.subscriptionReset,children:n(`billing.subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${It(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]}),y.length>1&&(0,a.jsx)(`span`,{className:v.triggerPopSwitcher,"data-testid":`billing-float-switcher`,children:(0,a.jsxs)(`span`,{className:v.triggerPopSwitchCount,children:[x+1,`/`,y.length]})})]})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:v.popHead,children:(0,a.jsx)(`span`,{className:v.popTitle,children:n(`billing.popTitle`)})}),(0,a.jsxs)(`span`,{className:v.metricGrid,children:[(0,a.jsxs)(`span`,{className:v.metricCell,children:[(0,a.jsx)(`span`,{className:v.metricLabel,children:n(`billing.monthCost`)}),(0,a.jsx)(`span`,{className:c(v.metricValue,v.metricValuePrimary),children:R(o)})]}),(0,a.jsxs)(`span`,{className:v.metricCell,children:[(0,a.jsx)(`span`,{className:v.metricLabel,children:n(`billing.tokenTotal`)}),(0,a.jsx)(`span`,{className:v.metricValue,children:z(f.totalToken)})]}),(0,a.jsxs)(`span`,{className:v.metricCell,children:[(0,a.jsx)(`span`,{className:v.metricLabel,children:n(`billing.input`)}),(0,a.jsx)(`span`,{className:v.metricValue,children:z(f.input)})]}),(0,a.jsxs)(`span`,{className:v.metricCell,children:[(0,a.jsx)(`span`,{className:v.metricLabel,children:n(`billing.output`)}),(0,a.jsx)(`span`,{className:v.metricValue,children:z(f.output)})]}),(0,a.jsxs)(`span`,{className:v.metricCell,children:[(0,a.jsx)(`span`,{className:v.metricLabel,children:n(`billing.cacheHit`)}),(0,a.jsx)(`span`,{className:c(v.metricValue,v.metricValueSuccess),children:z(f.cacheRead)})]}),(0,a.jsxs)(`span`,{className:v.metricCell,children:[(0,a.jsx)(`span`,{className:v.metricLabel,children:n(`billing.calls`)}),(0,a.jsx)(`span`,{className:v.metricValue,children:f.calls.toLocaleString()})]})]}),(0,a.jsxs)(`span`,{className:v.popModel,children:[(0,a.jsx)(`span`,{className:v.popModelLabel,children:n(`billing.popTodayModel`)}),d.direct!==void 0||d.sub!==void 0?(0,a.jsxs)(a.Fragment,{children:[d.direct!==void 0&&(0,a.jsxs)(`span`,{className:v.popModelRow,children:[(0,a.jsx)(`span`,{className:c(v.popDot,v.popDotDirect),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:v.popTagPrimary,children:n(`billing.popDirectLead`)}),(0,a.jsx)(`span`,{className:v.popModelName,children:d.direct.name}),(0,a.jsx)(`span`,{className:c(v.popModelStatus,d.direct.low&&v.popModelStatusLow),children:d.direct.text})]}),d.sub!==void 0&&(0,a.jsxs)(`span`,{className:v.popModelRow,children:[(0,a.jsx)(`span`,{className:c(v.popDot,v.popDotSub),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:v.popTagSub,children:n(`billing.popSubLead`)}),(0,a.jsx)(`span`,{className:v.popModelName,children:d.sub.name}),(0,a.jsx)(`span`,{className:c(v.popModelStatus,d.sub.low&&v.popModelStatusLow),children:d.sub.text})]})]}):(0,a.jsxs)(`span`,{className:v.popModelRow,children:[(0,a.jsx)(`span`,{className:c(v.popDot,v.popDotNeutral),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:v.popModelStatus,children:n(`billing.popNoConsumption`)})]})]})]})})]})}function Jt({balance:e,days:t,dailyBurn:n,money:r,t:i,onClose:o}){let s=t=>t===void 0?void 0:e.currency===`USD`?`$${t.toFixed(2)}`:r(t),c=s(e.totalBalance),l=s(e.grantedBalance),u=s(e.toppedUpBalance);return(0,a.jsxs)(`span`,{className:v.balanceDetailPop,"data-testid":`billing-balance-detail-pop`,children:[(0,a.jsxs)(`span`,{className:v.balanceDetailHead,children:[(0,a.jsx)(`span`,{className:v.balanceDetailTitle,children:e.displayName}),(0,a.jsx)(`button`,{type:`button`,className:v.balanceDetailClose,"aria-label":i(`billing.close`),onClick:o,children:`×`})]}),(0,a.jsxs)(`span`,{className:v.balanceDetailGrid,children:[c!==void 0&&(0,a.jsx)(Yt,{label:i(`billing.balance`),value:c}),l!==void 0&&(0,a.jsx)(Yt,{label:i(`billing.balanceGranted`),value:l}),u!==void 0&&(0,a.jsx)(Yt,{label:i(`billing.balanceTopped`),value:u}),(0,a.jsx)(Yt,{label:i(`billing.balanceDaily`),value:r(n)}),(0,a.jsx)(Yt,{label:i(`billing.balanceDaysLong`),value:`${t} ${i(`billing.balanceDaysUnit`)}`})]})]})}function Yt({label:e,value:t}){return(0,a.jsxs)(`span`,{className:v.balanceDetailRow,children:[(0,a.jsx)(`span`,{className:v.balanceDetailLabel,children:e}),(0,a.jsx)(`span`,{className:v.balanceDetailValue,children:t})]})}function Xt({stats:e,t,onClose:n,health:o,balances:s,reconcile:l,quotas:u,relayQuotas:d,currency:f,onCurrency:p,turns:m,renderSlot:h,budgetEnabled:g,budgetAmount:_,onToggleBudget:ee,onBudgetAmount:y,peakConfig:b,onPeakConfig:x,onPreviewPeak:S,floatPrefs:C,onFloatPrefs:w,cardPrefs:ne,onCardPrefs:T,quotasStale:re}){let[E,ae]=(0,r.useState)(`cost`),{total:D,byModel:oe,byDay:O}=e,[k,se]=(0,r.useState)(`overview`),[A,ce]=(0,r.useState)(7),[j,le]=(0,r.useState)(()=>{try{return window.localStorage.getItem(`dsh-billing:reconcile-dismissed`)??``}catch{return``}}),ue=()=>{let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`},M=(0,r.useCallback)(()=>{let e=ue();le(e);try{window.localStorage.setItem(`dsh-billing:reconcile-dismissed`,e)}catch{}},[]),[N,P]=(0,r.useState)(`month`),F=(0,r.useMemo)(()=>u.filter(e=>e.status===`ok`&&e.windows.length>0).map(e=>({id:e.provider,label:e.displayName})),[u]),[I,pe]=(0,r.useState)(),[ge,V]=(0,r.useState)(),[be,H]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=!0;return Gt().then(t=>{e&&t!==void 0&&H(t)}),()=>{e=!1}},[]);let xe=(0,r.useCallback)(()=>{let e=!be;H(e),Kt(e).then(t=>{t||H(!e)})},[be]),U=ie(),W=e=>R(f===`usd`?L(e):e,f),Ce=f===`usd`?`en`:`zh`,we=e=>nt(e,Ce),G=(e,n)=>e===0?t(`billing.free`):ve(ye(e,n,f,U.rate),f===`usd`?`USD`:`CNY`),Ee=(0,r.useMemo)(()=>We([...m].reverse()),[m]),K=(0,r.useMemo)(()=>Ct(m),[m]),Oe=(0,r.useMemo)(()=>{let n=e.byRole;if(n===void 0)return[];let r=n.user+n.assistant+n.tool;return r<=0?[]:[{label:t(`billing.roleUser`),value:n.user,seg:v.shareSegUser},{label:t(`billing.roleAssistant`),value:n.assistant,seg:v.shareSegAssistant},{label:t(`billing.roleTool`),value:n.tool,seg:v.shareSegTool}].map(e=>({...e,pct:e.value/r*100}))},[e.byRole,t]),q=xt(O,$()),ke=e=>s.find(t=>Q(t.provider)===Q(e)),Ae=e=>e.balance?.error===`unconfigured`&&e.models.length>0&&e.models.every(e=>e.plan),je=e=>{if(e===void 0)return(0,a.jsx)(`span`,{className:v.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,a.jsx)(`span`,{className:v.na,children:`—`});let n=e.currency===`USD`?`$${e.totalBalance.toFixed(2)}`:W(e.totalBalance),r=e.currency===`USD`?e.totalBalance*U.rate:e.totalBalance,i=q>0?Math.floor(r/q):void 0;return(0,a.jsxs)(`span`,{className:v.balanceCell,children:[(0,a.jsx)(`span`,{children:n}),i!==void 0&&i>=0&&(0,a.jsx)(`button`,{type:`button`,className:c(v.balanceDaysBadge,i<=3&&v.balanceDaysBadgeLow),"data-testid":`billing-balance-days-badge`,title:t(`billing.balanceDays`).replace(`{days}`,String(i)),"aria-label":`${e.displayName} ${t(`billing.balanceDays`).replace(`{days}`,String(i))}`,onClick:()=>{pe(I===e.provider?void 0:e.provider)},children:`?`}),I===e.provider&&(0,a.jsx)(Jt,{balance:e,days:i??0,dailyBurn:q,money:W,t,onClose:()=>{pe(void 0)}})]})},Me=D.cacheHit+D.cacheMiss>0?D.cacheHit/(D.cacheHit+D.cacheMiss)*100:0,Pe=Object.keys(O).sort(),Fe=$(),Le=O[Fe]?.cost??0,Re=Fe.slice(0,7),ze=Fe.slice(0,4),J=Pe.reduce((e,t)=>e+(t.startsWith(Re)?O[t]?.cost??0:0),0),Be=Pe.reduce((e,t)=>e+(t.startsWith(ze)?O[t]?.cost??0:0),0),He=(0,r.useMemo)(()=>St(O,Re,Fe)+u.reduce((e,t)=>e+(t.planType===`code`?t.subscriptionAmount??0:0),0),[O,Re,Fe,u]),Y=(0,r.useMemo)(()=>{let e=g&&_>0?J/_*100:NaN;return{pct:Number.isFinite(e)?Math.max(0,Math.min(100,e)):Be>0?Math.max(0,Math.min(100,J/Be*100)):0,over:Number.isFinite(e)&&e>=100,label:t(Number.isFinite(e)?`billing.budget`:`billing.monthCost`)}},[g,_,J,Be,t]),Ue=g&&_>0?J/_*100:0,Ge=(0,r.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]),Ke=Ge.at(-1)??Fe,qe=(0,r.useMemo)(()=>Object.entries(O).map(([e,t])=>({date:e,value:t.cost})),[O]),Xe=wt(O),et=Tt(O),tt=(0,r.useMemo)(()=>Ge.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}}),[Ge,O,e.byDayModels]),X=(0,r.useMemo)(()=>Object.entries(oe).filter(([,e])=>e.calls>0).map(([e,t])=>{let n=de(e),r=n.key===`other`,i=r?vt(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:_e(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:Lt[t%Lt.length]??`#8b95a3`})),[oe]),Z=(0,r.useMemo)(()=>{let e=0,t=0,n=0;for(let r of X){let i=r.officialCost;i>0&&(e+=i),t+=r.officialCalls,n+=Math.max(0,r.calls-r.officialCalls)}let r=Math.max(0,X.reduce((e,t)=>e+(t.actual??0),0)-e);if(!(e<=0&&r<=0&&t<=0&&n<=0))return{officialCost:e,officialCalls:t,thirdCost:r,thirdCalls:n}},[X]),rt=(0,r.useMemo)(()=>{let e=new Map;for(let t of u){if(t.status===`not-configured`)continue;let n=bt(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=vt(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:ke(n),dot:Dt(o,n)})),i=new Set(r.map(e=>Q(e.name)));for(let e of s)i.has(Q(e.provider))||(e.error===void 0||e.provider.startsWith(`custom:`))&&r.push({name:e.displayName,models:[],subscriptions:[],balance:e,dot:Dt(o,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,u,s,o]),it=X.reduce((e,t)=>e+t.estimated,0),at=D.cost>0?D.cost:it,ot=D.calls>0?at/D.calls:0,st=(0,r.useMemo)(()=>X.map(e=>({key:e.key,name:e.name,color:e.color})),[X]),ct=tt.length>=2?tt.at(-2)?.cost??0:0,lt=ct>0?(Le-ct)/ct*100:0;return(0,a.jsx)(i.Modal,{open:!0,onClose:n,title:t(`billing.title`),headless:!0,className:c(v.dashboardModal,`dsh-billing-modal`),children:(0,a.jsxs)(`div`,{className:v.dashboard,"data-testid":`billing-dashboard`,children:[(0,a.jsxs)(`div`,{className:v.dashboardHead,"data-testid":`billing-dashboard-head`,children:[(0,a.jsxs)(`div`,{children:[h(`billing.dashboard.decor`,{position:`head`}),(0,a.jsxs)(`div`,{className:v.headTitleRow,children:[(0,a.jsx)(`h2`,{className:v.dashboardTitle,children:t(`billing.title`)}),h(`billing.dashboard.decor`,{position:`headTitle`})]}),(0,a.jsxs)(`p`,{className:v.dashboardSubtitle,children:[t(`billing.lastUpdated`),` `,Ke,e.timezone===void 0?null:` · ${e.timezone.name} (${e.timezone.offset})`]})]}),(0,a.jsxs)(`div`,{className:v.dashboardRight,children:[(0,a.jsx)(`span`,{className:v.currencyToggle,role:`group`,"aria-label":t(`billing.currency`),children:[`cny`,`usd`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(v.currencyButton,f===e&&v.currencyButtonActive),"aria-pressed":f===e,"data-testid":`billing-currency-${e}`,title:t(e===`cny`?`billing.currencyCny`:`billing.currencyUsd`),onClick:()=>{p(e)},children:e===`cny`?`¥ CNY`:`$ USD`},e))}),o.checked&&(0,a.jsxs)(`span`,{className:c(v.healthBadge,o.available?v.healthBadgeOk:v.healthBadgeBad),children:[(0,a.jsx)(`span`,{className:c(v.healthDot,o.available?v.healthOk:v.healthBad),"aria-hidden":`true`}),o.available?`${o.models} 模型可用${o.failures>0?` · ${o.failures} 厂商失效`:``}`:`${o.failures} 厂商不可用`]}),(0,a.jsx)(`button`,{type:`button`,className:v.closeButton,"aria-label":t(`billing.close`),"data-testid":`billing-close`,onClick:n,children:(0,a.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,a.jsx)(`path`,{d:`M18 6 6 18`}),(0,a.jsx)(`path`,{d:`m6 6 12 12`})]})})]})]}),(0,a.jsx)(`nav`,{className:v.tabNav,"data-testid":`billing-tab-nav`,role:`tablist`,"aria-label":t(`billing.title`),children:dt.map(e=>(0,a.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":k===e.id,className:c(v.tabButton,k===e.id&&v.tabButtonActive),"data-testid":`billing-tab-${e.id}`,onClick:()=>{se(e.id)},children:t(e.labelKey)},e.id))}),(0,a.jsxs)(`div`,{className:v.dashboardBody,children:[k===`overview`&&(0,a.jsxs)(`div`,{className:v.tabPanel,"data-testid":`billing-tab-panel-overview`,children:[l?.kind===`drift`&&l.spent!==void 0&&j!==ue()&&(0,a.jsxs)(`div`,{className:v.reconcileNotice,"data-testid":`billing-reconcile-notice`,role:`note`,children:[(0,a.jsx)(`span`,{className:v.reconcileIcon,"aria-hidden":`true`,children:(0,a.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,a.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,a.jsx)(`line`,{x1:`12`,y1:`10`,x2:`12`,y2:`16`}),(0,a.jsx)(`line`,{x1:`12`,y1:`7.5`,x2:`12.01`,y2:`7.5`})]})}),(0,a.jsx)(`span`,{className:v.reconcileText,children:t(`billing.reconcileDrift`).replace(`{provider}`,l.provider??``).replace(`{spent}`,W(l.spent)).replace(`{today}`,W(l.todayOfficialCost??0))}),(0,a.jsx)(`button`,{type:`button`,className:v.reconcileDismiss,"data-testid":`billing-reconcile-dismiss`,onClick:M,children:t(`billing.reconcileDismiss`)})]}),(0,a.jsxs)(`section`,{className:v.hero,"data-testid":`billing-hero`,children:[h(`billing.dashboard.decor`,{position:`hero`}),(0,a.jsxs)(`div`,{className:v.heroTop,children:[(0,a.jsxs)(`div`,{className:v.heroMain,children:[(0,a.jsx)(`span`,{className:v.heroLabel,children:t(`billing.monthCost`)}),(0,a.jsxs)(`div`,{className:v.heroReadout,children:[(0,a.jsx)(`span`,{className:v.heroCurrency,"aria-hidden":`true`,children:f===`usd`?`$`:`¥`}),(0,a.jsx)(`span`,{className:v.heroValue,children:W(J).slice(1)})]}),(0,a.jsxs)(`span`,{className:v.heroMeta,children:[D.calls.toLocaleString(),` `,t(`billing.calls`)]})]}),(0,a.jsxs)(`div`,{className:v.heroGauge,"data-testid":`billing-hero-gauge`,children:[(0,a.jsxs)(`svg`,{className:v.heroGaugeSvg,viewBox:`0 0 120 120`,"aria-hidden":`true`,children:[(0,a.jsx)(`circle`,{className:v.heroGaugeTrack,cx:`60`,cy:`60`,r:`52`}),(0,a.jsx)(`circle`,{className:c(v.heroGaugeArc,Y.over&&v.heroGaugeArcOver),cx:`60`,cy:`60`,r:`52`,style:{strokeDasharray:`${Y.pct/100*326.7} 326.7`}})]}),(0,a.jsxs)(`span`,{className:v.heroGaugeCenter,children:[(0,a.jsxs)(`span`,{className:c(v.heroGaugePct,Y.over&&v.heroGaugePctOver),children:[Y.pct.toFixed(0),`%`]}),(0,a.jsx)(`span`,{className:v.heroGaugeLabel,children:Y.label})]})]})]}),g&&_>0&&(0,a.jsxs)(`div`,{className:v.heroBudget,"data-testid":`billing-hero-budget`,children:[(0,a.jsx)(`span`,{className:v.heroBudgetLabel,children:t(`billing.budget`)}),(0,a.jsx)(`div`,{className:v.heroBudgetTrack,role:`progressbar`,"aria-valuenow":Math.min(Ue,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`billing.budget`),children:(0,a.jsx)(`div`,{className:c(v.heroBudgetFill,Ue>=100&&v.heroBudgetFillOver),style:{width:`${Math.min(Ue,100)}%`}})}),(0,a.jsxs)(`span`,{className:v.heroBudgetValue,children:[W(J),` / `,W(_),` · `,Ue.toFixed(1),`%`]})]}),(0,a.jsxs)(`div`,{className:v.heroSide,children:[(0,a.jsxs)(`div`,{className:v.heroSideItem,children:[(0,a.jsx)(`span`,{className:v.heroSideLabel,children:t(`billing.yearCost`)}),(0,a.jsx)(`span`,{className:v.heroSideValue,children:W(Be)})]}),(0,a.jsxs)(`div`,{className:v.heroSideItem,children:[(0,a.jsx)(`span`,{className:v.heroSideLabel,children:t(`billing.todayCost`)}),(0,a.jsxs)(`span`,{className:v.heroSideValue,children:[W(Le),(0,a.jsxs)(`span`,{className:c(v.delta,lt>=0?v.deltaUp:v.deltaDown),children:[lt>=0?`▲`:`▼`,` `,Math.abs(lt).toFixed(1),`%`]})]})]}),He>0&&(0,a.jsxs)(`div`,{className:v.heroSideItem,children:[(0,a.jsx)(`span`,{className:v.heroSideLabel,children:t(`billing.monthProjected`)}),(0,a.jsx)(`span`,{className:v.heroSideValue,children:W(He)})]}),He<=0&&(0,a.jsx)(`span`,{className:v.heroSideSpacer,"aria-hidden":`true`})]})]}),(e.unpricedModels?.length??0)>0&&(0,a.jsx)(`div`,{className:v.unpricedHint,"data-testid":`billing-unpriced-hint`,children:t(`billing.unpricedHint`).replace(`{count}`,String(e.unpricedModels?.length??0))}),(0,a.jsxs)(`section`,{className:v.kpiGrid,"data-testid":`billing-kpi-grid`,children:[(0,a.jsxs)(`div`,{className:v.kpiTile,"data-testid":`billing-kpi-tile`,children:[(0,a.jsx)(`span`,{className:v.kpiLabel,children:t(`billing.cacheHitRate`)}),(0,a.jsx)(`span`,{className:c(v.kpiValue,v.kpiGreen),children:B(Me)}),(0,a.jsxs)(`span`,{className:v.kpiDetail,children:[z(D.cacheHit),` / `,z(D.cacheHit+D.cacheMiss)]})]}),(0,a.jsxs)(`div`,{className:v.kpiTile,children:[(0,a.jsx)(`span`,{className:v.kpiLabel,children:t(`billing.tokens`)}),(0,a.jsx)(`span`,{className:v.kpiValue,children:z(D.input+D.output)}),(0,a.jsxs)(`span`,{className:v.kpiDetail,children:[t(`billing.inputTokens`),` `,z(D.input),` · `,t(`billing.outputTokens`),` `,z(D.output)]})]}),(0,a.jsxs)(`div`,{className:v.kpiTile,children:[(0,a.jsx)(`span`,{className:v.kpiLabel,children:t(`billing.avgCost`)}),(0,a.jsx)(`span`,{className:v.kpiValue,children:W(ot)}),(0,a.jsxs)(`span`,{className:v.kpiDetail,children:[t(`billing.calls`),` `,D.calls.toLocaleString()]})]}),(0,a.jsxs)(`div`,{className:v.kpiTile,children:[(0,a.jsx)(`span`,{className:v.kpiLabel,children:t(`billing.calls`)}),(0,a.jsx)(`span`,{className:v.kpiValue,children:D.calls.toLocaleString()}),(0,a.jsxs)(`span`,{className:v.kpiDetail,children:[X.length,` `,t(`billing.models`)]})]})]}),(0,a.jsxs)(`section`,{className:v.panel,"data-testid":`billing-panel-heatmap`,children:[(0,a.jsxs)(`div`,{className:v.panelHead,children:[(0,a.jsx)(`h3`,{className:v.panelTitle,children:t(`billing.heatmap`)}),(0,a.jsx)(`div`,{className:v.heatmapRangeSwitch,"data-testid":`billing-heatmap-range`,role:`group`,"aria-label":t(`billing.heatmap`),children:[`month`,`year`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(v.heatmapRangeButton,N===e&&v.heatmapRangeButtonActive),"data-testid":`billing-heatmap-range-${e}`,"aria-pressed":N===e,onClick:()=>{P(e)},children:t(e===`month`?`billing.heatmapMonth`:`billing.heatmapYear`)},e))}),(0,a.jsxs)(`span`,{className:v.panelHint,"data-testid":`billing-heatmap-summary`,children:[t(`billing.activeDays`),` `,Xe,` · `,t(`billing.streakDays`),` `,et]})]}),(0,a.jsx)(Ve,{days:qe,currency:f,t,range:N})]})]}),k===`settings`&&(0,a.jsxs)(`div`,{className:v.tabPanel,"data-testid":`billing-tab-panel-settings`,children:[(0,a.jsxs)(`section`,{className:v.setCard,"data-testid":`billing-budget`,children:[(0,a.jsxs)(`div`,{className:v.setCardHead,children:[(0,a.jsxs)(`div`,{className:v.setCardMeta,children:[(0,a.jsx)(`h3`,{className:v.setCardTitle,children:t(`billing.budget`)}),(0,a.jsx)(`p`,{className:v.setCardDesc,children:t(`billing.budgetHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":g,"aria-label":t(`billing.budget`),"data-testid":`billing-budget-toggle`,className:c(v.switch,g&&v.switchOn),onClick:ee,children:(0,a.jsx)(`span`,{className:v.switchKnob})})]}),g&&(0,a.jsxs)(`div`,{className:v.ctlCol,children:[(0,a.jsxs)(`div`,{className:v.ctlRow,children:[(0,a.jsx)(`span`,{className:v.ctlLabel,children:t(`billing.budgetAmount`)}),(0,a.jsxs)(`span`,{className:v.inp,"data-testid":`billing-budget-input-wrap`,children:[(0,a.jsx)(`span`,{className:v.affix,"aria-hidden":`true`,children:`¥`}),(0,a.jsx)(`input`,{className:v.budgetInput,"data-testid":`billing-budget-input`,type:`number`,min:0,step:1,value:_===0?``:_,placeholder:e.budget===void 0?`0`:String(e.budget),"aria-label":`${t(`billing.budget`)}(${f===`usd`?`USD`:`CNY`})`,title:`${t(`billing.budget`)}(${f===`usd`?`USD`:`CNY`})`,onChange:e=>{y(e.target.valueAsNumber)}})]})]}),_>0&&(()=>{let e=J/_*100;return(0,a.jsx)(`div`,{className:v.ctlRowStretch,children:(0,a.jsx)(`div`,{className:v.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,a.jsx)(`div`,{className:c(v.progFill,e>=100&&v.budgetFillOver,e>=80&&e<100&&v.budgetFillWarn),style:{width:`${Math.min(e,100)}%`}})})})})(),_>0&&(0,a.jsx)(`p`,{className:v.setCardDesc,"data-testid":`billing-budget-value`,children:t(`billing.budgetSummary`).replace(`{used}`,W(J)).replace(`{total}`,W(_))})]})]}),(0,a.jsxs)(`section`,{className:v.setCard,"data-testid":`billing-peak-alert-settings`,children:[(0,a.jsxs)(`div`,{className:v.setCardHead,children:[(0,a.jsxs)(`div`,{className:v.setCardMeta,children:[(0,a.jsx)(`h3`,{className:v.setCardTitle,children:t(`billing.peakAlert`)}),(0,a.jsx)(`p`,{className:v.setCardDesc,children:t(`billing.peakAlertHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":b.enabled,"aria-label":t(`billing.peakAlert`),"data-testid":`billing-peak-alert-toggle`,className:c(v.switch,b.enabled&&v.switchOn),onClick:()=>{x({...b,enabled:!b.enabled})},children:(0,a.jsx)(`span`,{className:v.switchKnob})})]}),b.enabled&&(0,a.jsxs)(`div`,{className:v.ctlCol,children:[(0,a.jsxs)(`label`,{className:v.ctlRow,children:[(0,a.jsx)(`span`,{className:v.ctlLabel,children:t(`billing.peakAlertLeadMin`)}),(0,a.jsx)(`span`,{className:v.inp,children:(0,a.jsx)(`input`,{type:`number`,min:1,max:30,step:1,value:b.leadMin,className:v.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,a.jsxs)(`div`,{className:v.ctlRow,children:[(0,a.jsx)(`span`,{className:v.ctlLabel,children:t(`billing.peakAlertPos`)}),(0,a.jsx)(`div`,{className:v.ctlGroup,role:`radiogroup`,"aria-label":t(`billing.peakAlertPos`),children:[`bottom-right`,`center`].map(e=>(0,a.jsxs)(`label`,{className:v.rdo,children:[(0,a.jsx)(`input`,{type:`radio`,name:`peak-pos`,checked:b.position===e,onChange:()=>x({...b,position:e})}),(0,a.jsx)(`span`,{className:v.rdoDot,"aria-hidden":`true`}),t(e===`bottom-right`?`billing.peakAlertPosCorner`:`billing.peakAlertPosCenter`)]},e))})]}),(0,a.jsxs)(`div`,{className:v.ctlRow,children:[(0,a.jsx)(`span`,{className:v.ctlLabel,children:t(`billing.peakAlertMode`)}),(0,a.jsx)(`div`,{className:v.ctlGroup,role:`radiogroup`,"aria-label":t(`billing.peakAlertMode`),children:[`both`,`peak`,`offPeak`].map(e=>(0,a.jsxs)(`label`,{className:v.rdo,children:[(0,a.jsx)(`input`,{type:`radio`,name:`peak-mode`,checked:b.mode===e,onChange:()=>x({...b,mode:e})}),(0,a.jsx)(`span`,{className:v.rdoDot,"aria-hidden":`true`}),t(e===`both`?`billing.peakAlertModeBoth`:e===`peak`?`billing.peakAlertModePeak`:`billing.peakAlertModeOff`)]},e))})]}),(0,a.jsxs)(`label`,{className:v.ctlRow,children:[(0,a.jsx)(`span`,{className:v.ctlLabel,children:t(`billing.peakAlertWebNotify`)}),(0,a.jsx)(`input`,{type:`checkbox`,checked:b.webNotify,"aria-label":t(`billing.peakAlertWebNotify`),onChange:e=>{x({...b,webNotify:e.target.checked})}})]}),(0,a.jsx)(`div`,{className:v.ctlRow,children:(0,a.jsx)(`button`,{type:`button`,className:v.btn,onClick:S,children:t(`billing.peakAlertPreview`)})})]})]}),(0,a.jsx)(`section`,{className:v.setCard,"data-testid":`billing-usage-stats-tool-setting`,children:(0,a.jsxs)(`div`,{className:v.setCardHead,children:[(0,a.jsxs)(`div`,{className:v.setCardMeta,children:[(0,a.jsx)(`h3`,{className:v.setCardTitle,children:t(`billing.usageStatsTool`)}),(0,a.jsx)(`p`,{className:v.setCardDesc,children:t(`billing.usageStatsToolHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":be,"aria-label":t(`billing.usageStatsTool`),"data-testid":`billing-usage-stats-tool-toggle`,className:c(v.switch,be&&v.switchOn),onClick:xe,children:(0,a.jsx)(`span`,{className:v.switchKnob})})]})}),(0,a.jsxs)(`section`,{className:v.setCard,"data-testid":`billing-float-setting`,children:[(0,a.jsx)(`div`,{className:v.setCardHead,children:(0,a.jsxs)(`div`,{className:v.setCardMeta,children:[(0,a.jsx)(`h3`,{className:v.setCardTitle,children:t(`billing.floatWindow`)}),(0,a.jsx)(`p`,{className:v.setCardDesc,children:t(`billing.floatWindowHint`)})]})}),(0,a.jsxs)(`div`,{className:v.ctlCol,children:[(0,a.jsxs)(`div`,{className:v.ctlRow,children:[(0,a.jsx)(`span`,{className:v.ctlLabel,children:t(`billing.floatMode`)}),(0,a.jsxs)(`div`,{className:v.ctlGroup,"data-testid":`billing-float-mode`,children:[(0,a.jsx)(`button`,{type:`button`,className:c(v.floatModeBtn,C.mode===`combined`&&v.floatModeBtnOn),"data-testid":`billing-float-mode-combined`,onClick:()=>w({mode:`combined`,targets:C.targets}),children:t(`billing.floatModeCombined`)}),(0,a.jsx)(`button`,{type:`button`,className:c(v.floatModeBtn,C.mode===`subscription`&&v.floatModeBtnOn),"data-testid":`billing-float-mode-subscription`,onClick:()=>w({mode:`subscription`,targets:C.targets}),children:t(`billing.floatModeSubscription`)})]})]}),C.mode===`subscription`&&(0,a.jsxs)(`div`,{className:v.ctlRow,children:[(0,a.jsx)(`span`,{className:v.ctlLabel,children:t(`billing.floatTargets`)}),(0,a.jsxs)(`span`,{className:v.ctlGroup,"data-testid":`billing-float-targets`,children:[F.map(e=>{let t=C.targets.includes(e.id);return(0,a.jsxs)(`label`,{className:v.floatTarget,children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:t,"data-testid":`billing-float-target-${e.id}`,onChange:()=>w({mode:`subscription`,targets:t?C.targets.filter(t=>t!==e.id):[...C.targets,e.id]})}),(0,a.jsx)(`span`,{className:v.floatTargetLabel,children:e.label})]},e.id)}),F.length===0&&(0,a.jsx)(`span`,{className:v.setCardDesc,children:t(`billing.floatNoTargetsHint`)})]})]})]})]}),(0,a.jsxs)(`section`,{className:v.setCard,"data-testid":`billing-card-setting`,children:[(0,a.jsx)(`div`,{className:v.setCardHead,children:(0,a.jsxs)(`div`,{className:v.setCardMeta,children:[(0,a.jsx)(`h3`,{className:v.setCardTitle,children:t(`billing.cardDisplay`)}),(0,a.jsx)(`p`,{className:v.setCardDesc,children:t(`billing.cardDisplayHint`)})]})}),(0,a.jsx)(`div`,{className:v.ctlCol,children:(0,a.jsxs)(`div`,{className:v.ctlRow,children:[(0,a.jsx)(`span`,{className:v.ctlLabel,children:t(`billing.cardMetric`)}),(0,a.jsxs)(`div`,{className:v.ctlGroup,"data-testid":`billing-card-metric`,children:[(0,a.jsx)(`button`,{type:`button`,className:c(v.floatModeBtn,ne.metric===`money`&&v.floatModeBtnOn),"data-testid":`billing-card-money`,onClick:()=>T({metric:`money`}),children:t(`billing.cardMetricMoney`)}),(0,a.jsx)(`button`,{type:`button`,className:c(v.floatModeBtn,ne.metric===`tokens`&&v.floatModeBtnOn),"data-testid":`billing-card-tokens`,onClick:()=>T({metric:`tokens`}),children:t(`billing.cardMetricTokens`)})]})]})})]}),(0,a.jsx)(De,{t,version:e.pluginVersion})]}),k===`trends`&&(0,a.jsxs)(`div`,{className:v.tabPanel,"data-testid":`billing-tab-panel-trends`,children:[(0,a.jsxs)(`section`,{className:c(v.ubCard,v.trendPanel),"data-testid":`billing-panel-trend`,children:[(0,a.jsxs)(`div`,{className:v.ubCardHead,children:[(0,a.jsx)(`h3`,{className:v.ubCardTitle,children:t(`billing.trend`)}),h(`billing.dashboard.decor`,{position:`trend`}),(0,a.jsxs)(`span`,{className:v.ubCardControlGroup,children:[(0,a.jsx)(`span`,{className:v.rangeToggle,role:`group`,"aria-label":t(`billing.trend`),children:[7,30].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(v.rangeButton,A===e&&v.rangeButtonActive),"aria-pressed":A===e,"data-testid":`billing-trend-${e}d`,onClick:()=>{ce(e)},children:t(e===7?`billing.trend7d`:`billing.trend30d`)},e))}),(0,a.jsx)(`span`,{className:v.rangeToggle,role:`group`,"aria-label":t(`billing.trendMetric`),children:[`cost`,`tokens`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(v.rangeButton,E===e&&v.rangeButtonActive),"aria-pressed":E===e,"data-testid":`billing-trend-metric-${e}`,onClick:()=>{ae(e)},children:t(e===`cost`?`billing.trendMetricCost`:`billing.trendMetricTokens`)},e))})]}),(0,a.jsx)(`span`,{className:v.ubCardSub,children:Ke})]}),(0,a.jsx)(Se,{data:tt,models:st,currency:f,metric:E})]}),m.length>0&&(0,a.jsxs)(`section`,{className:v.ubCard,"data-testid":`billing-panel-rounds`,children:[(0,a.jsxs)(`div`,{className:v.ubCardHead,children:[(0,a.jsx)(`h3`,{className:v.ubCardTitle,children:t(`billing.rounds`)}),Ee.length>0&&(0,a.jsxs)(`span`,{className:v.ubTagError,"data-testid":`billing-rounds-flag-count`,children:[Ee.length,` `,t(`billing.anomaly`)]})]}),(0,a.jsx)(`p`,{className:v.ubCardSub,children:t(`billing.roundsHint`).replace(`{count}`,String(m.length))}),(0,a.jsx)(Ie,{rounds:m,flags:Ee,currency:f,t})]}),m.length>0&&(()=>{let e=K.peak+K.offPeak;if(e<=0)return null;let n=K.peak/e*100;return(0,a.jsxs)(`section`,{className:v.ubCard,"data-testid":`billing-panel-share`,children:[(0,a.jsxs)(`div`,{className:v.ubCardHead,children:[(0,a.jsx)(`h3`,{className:v.ubCardTitle,children:t(`billing.peakShare`)}),(0,a.jsx)(`span`,{className:v.ubCardSub,children:t(`billing.peakShareHint`).replace(`{count}`,String(m.length))})]}),(0,a.jsxs)(`div`,{className:v.shareTrack,"data-testid":`billing-share-track`,children:[(0,a.jsx)(`div`,{className:c(v.shareSeg,v.shareSegPeak),style:{width:`${n}%`}}),(0,a.jsx)(`div`,{className:c(v.shareSeg,v.shareSegOff),style:{width:`${100-n}%`}})]}),(0,a.jsxs)(`div`,{className:v.shareLegend,children:[(0,a.jsxs)(`span`,{className:v.shareItem,children:[(0,a.jsx)(`span`,{className:v.shareDot,style:{background:`var(--dsw-static-blue-500)`}}),t(`billing.peak`),(0,a.jsxs)(`span`,{className:v.shareValue,"data-testid":`billing-share-peak`,children:[W(K.peak),` · `,n.toFixed(1),`%`]})]}),(0,a.jsxs)(`span`,{className:v.shareItem,children:[(0,a.jsx)(`span`,{className:v.shareDot,style:{background:`color-mix(in srgb, var(--dsw-static-blue-500) 30%, var(--dsw-alias-bg-module-platform))`}}),t(`billing.offPeak`),(0,a.jsxs)(`span`,{className:v.shareValue,"data-testid":`billing-share-offpeak`,children:[W(K.offPeak),` · `,(100-n).toFixed(1),`%`]})]})]})]})})()]}),k===`providers`&&(0,a.jsxs)(`div`,{className:v.tabPanel,"data-testid":`billing-tab-panel-providers`,children:[e.bySite!==void 0&&Object.keys(e.bySite).length>0&&(0,a.jsxs)(`section`,{className:v.panel,"data-testid":`billing-panel-relay-sites`,children:[(0,a.jsx)(`div`,{className:v.panelHead,children:(0,a.jsx)(`h3`,{className:v.panelTitle,children:t(`billing.panelRelay`)})}),(0,a.jsx)(`div`,{className:v.providerGroupList,"data-testid":`billing-relay-sites`,children:Object.entries(e.bySite).sort((e,t)=>(t[1].cost??0)-(e[1].cost??0)).map(([e,n])=>{let r=At(e,t);return(0,a.jsxs)(`div`,{className:v.siteRow,"data-testid":`billing-relay-site`,children:[(0,a.jsxs)(`span`,{className:v.siteRowName,children:[(0,a.jsx)(`span`,{className:c(v.siteKindTag,Nt[r.kind]),children:jt(r.kind,t)}),(0,a.jsx)(`span`,{className:v.siteRowTitle,children:r.name})]}),(0,a.jsxs)(`span`,{className:v.siteRowMeta,children:[(0,a.jsx)(`span`,{className:v.siteRowCost,children:W(n.cost)}),(0,a.jsxs)(`span`,{className:v.siteRowCalls,children:[n.calls,` `,t(`billing.relayCalls`)]})]})]},e)})})]}),d.length>0&&(0,a.jsxs)(`section`,{className:v.panel,"data-testid":`billing-panel-relay-quota`,children:[(0,a.jsx)(`div`,{className:v.panelHead,children:(0,a.jsx)(`h3`,{className:v.panelTitle,children:t(`billing.panelRelayQuota`)})}),(0,a.jsx)(`div`,{className:v.providerGroupList,"data-testid":`billing-relay-quotas`,children:d.map(e=>(0,a.jsxs)(`div`,{className:v.siteRow,"data-testid":`billing-relay-quota`,children:[(0,a.jsxs)(`span`,{className:v.siteRowName,children:[(0,a.jsx)(`span`,{className:c(v.siteKindTag,Pt[e.kind]),children:Mt(e.kind,t)}),(0,a.jsx)(`span`,{className:v.siteRowTitle,children:e.origin})]}),(0,a.jsxs)(`span`,{className:v.siteRowMeta,children:[e.balance!==void 0&&(0,a.jsxs)(`span`,{className:v.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,a.jsxs)(`span`,{className:c(v.siteRowCalls,n&&v.siteRowCallsLow),children:[t(`billing.relayWindowUsed`),` `,e.usedPercent,`%`]},e.kind)}):(0,a.jsx)(`span`,{className:v.siteRowCalls,children:t(`billing.relayNoQuota`)})]})]},e.route))})]}),(0,a.jsxs)(`section`,{className:v.panel,"data-testid":`billing-panel-providers`,children:[(0,a.jsxs)(`div`,{className:v.panelHead,children:[(0,a.jsx)(`h3`,{className:v.panelTitle,children:t(`billing.providerBilling`)}),h(`billing.dashboard.decor`,{position:`models`}),(0,a.jsx)(`span`,{className:v.panelHint,children:e.updatedAt===void 0?``:`${t(`billing.lastUpdated`)} ${It(e.updatedAt)}`})]}),re&&(0,a.jsx)(`div`,{className:v.staleNotice,"data-testid":`billing-subscriptions-stale`,children:t(`billing.subscriptionsStale`)}),rt.length===0?(0,a.jsx)(`div`,{className:v.emptyRow,"data-testid":`billing-provider-empty`,children:t(`billing.noData`)}):(0,a.jsx)(`div`,{className:v.providerGroupList,"data-testid":`billing-provider-groups`,children:rt.map(e=>(0,a.jsxs)(`div`,{className:v.providerGroup,"data-testid":`billing-provider-group`,children:[(0,a.jsxs)(`div`,{className:v.providerGroupHead,children:[(0,a.jsxs)(`span`,{className:v.providerGroupTitle,children:[(0,a.jsx)(`span`,{className:c(v.healthDot,e.dot),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:v.providerGroupName,children:we(e.name)})]}),(0,a.jsxs)(`span`,{className:v.providerGroupMeta,children:[e.subscriptions.length>0&&(0,a.jsxs)(`span`,{className:v.providerGroupBadge,"data-testid":`billing-provider-sub-count`,children:[e.subscriptions.length,` 套餐`]}),!Ae(e)&&e.balance!==void 0&&(0,a.jsxs)(`span`,{className:v.providerGroupBalance,"data-testid":`billing-provider-balance`,children:[(0,a.jsx)(`span`,{className:v.providerGroupBalanceLabel,children:t(`billing.balance`)}),je(e.balance)]})]})]}),e.models.length>0&&(0,a.jsx)(`div`,{className:c(v.tableScroll,v.modelTableScroll),"data-testid":`billing-table-scroll`,children:(0,a.jsxs)(`table`,{className:v.modelTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`billing.model`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.calls`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.inputTokens`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.outputTokens`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.cacheHitRate`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.actual`)})]})}),(0,a.jsx)(`tbody`,{children:e.models.map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:v.modelCell,children:[(0,a.jsx)(Zt,{provider:e.provider,colorVar:e.color}),(0,a.jsxs)(`span`,{children:[(0,a.jsxs)(`span`,{className:v.modelName,children:[e.name,e.uncatalogued&&(0,a.jsx)(`span`,{className:v.uncataloguedTag,"data-testid":`billing-uncatalogued-tag`,children:t(`billing.uncatalogued`)}),e.estimatedPricing&&(0,a.jsx)(`span`,{className:v.estimatedTag,"data-testid":`billing-estimated-tag`,children:t(`billing.estimatedPricing`)})]}),(0,a.jsx)(`span`,{className:v.modelProvider,children:we(e.provider)})]})]})}),(0,a.jsx)(`td`,{className:v.numCol,children:e.calls.toLocaleString()}),(0,a.jsx)(`td`,{className:v.numCol,children:z(e.input)}),(0,a.jsx)(`td`,{className:v.numCol,children:z(e.output)}),(0,a.jsx)(`td`,{className:v.numCol,children:B(e.cacheHitRate)}),(0,a.jsx)(`td`,{className:v.numCol,children:e.plan?(0,a.jsx)(`span`,{className:v.planTag,children:t(`billing.subscriptionIncluded`)}):e.actual===void 0?(0,a.jsx)(`span`,{className:v.na,children:`—`}):(()=>{let t=e.officialCost,n=e.actual-t;return t>0&&n>0?(0,a.jsxs)(`span`,{className:v.bucketCost,children:[(0,a.jsx)(`span`,{className:v.bucketOfficial,children:W(t)}),(0,a.jsx)(`span`,{className:v.bucketSep,children:`/`}),(0,a.jsx)(`span`,{className:v.bucketThird,children:W(n)})]}):W(e.actual)})()})]},e.key))})]})}),e.subscriptions.length>0&&(0,a.jsx)(`div`,{className:v.subscriptionGrid,"data-testid":`billing-subscriptions-grid`,children:e.subscriptions.map(e=>{let n=Ot(e.status,t);return(0,a.jsxs)(`div`,{className:v.subscriptionCard,"data-testid":`billing-subscription-card`,children:[(0,a.jsxs)(`div`,{className:v.subscriptionHead,children:[(0,a.jsx)(`span`,{className:v.subscriptionName,children:we(e.displayName)}),e.planType===`code`&&(()=>{let n=te(e.provider),r=n===void 0?void 0:t(`billing.subscriptionFeePerMonth`).replace(`{amount}`,n.currency===`USD`?`$${n.amount}`:`¥${n.amount}`);return(0,a.jsxs)(`span`,{className:v.subscriptionPlan,"data-kind":`code`,children:[r??(e.subscriptionAmount!==void 0&&e.subscriptionAmount>0?t(`billing.subscriptionFeePerMonth`).replace(`{amount}`,W(e.subscriptionAmount)):t(`billing.planTypeCode`)),n?.label!==void 0&&(0,a.jsx)(`span`,{className:v.subscriptionTier,"data-testid":`billing-tier-${e.provider}`,children:n.label}),n!==void 0&&(0,a.jsx)(`span`,{className:v.subscriptionAuto,"data-testid":`billing-auto-${e.provider}`,children:t(`billing.subscriptionAutoDetect`)})]})})(),e.planType===`token`&&(0,a.jsx)(`span`,{className:v.subscriptionPlan,"data-kind":`token`,children:t(`billing.planTypeToken`)}),e.plan!==void 0&&(0,a.jsx)(`span`,{className:v.subscriptionPlan,children:e.plan})]}),n!==``&&(0,a.jsx)(`div`,{className:v.subscriptionStatus,children:n}),e.windows.length===0&&n===``&&(0,a.jsx)(`div`,{className:v.subscriptionStatus,children:t(`billing.subscriptionNoApi`)}),e.windows.map(e=>(()=>{let n=Math.min(100,Math.max(0,e.usedPercent)),r=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,a.jsxs)(`div`,{className:v.subscriptionWindow,children:[(0,a.jsx)(`span`,{className:v.subscriptionWindowLabel,children:kt(e.kind,t)}),(0,a.jsx)(`span`,{className:v.subscriptionTrack,"aria-hidden":`true`,children:(0,a.jsx)(`span`,{className:c(v.subscriptionFill,n>=100&&v.subscriptionFillOver,n>=80&&n<100&&v.subscriptionFillWarn),style:{width:`${n}%`}})}),(0,a.jsxs)(`span`,{className:v.subscriptionMeta,children:[(0,a.jsx)(`span`,{className:c(v.subscriptionPct,r&&v.subscriptionExhausted),children:r?t(`billing.subscriptionExhausted`):t(`billing.subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,a.jsx)(`span`,{className:v.subscriptionReset,children:t(`billing.subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${It(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]},e.provider)})})]},e.name))})]}),(0,a.jsxs)(`div`,{className:v.exportBar,"data-testid":`billing-export-bar`,role:`group`,"aria-label":t(`billing.export`),children:[(0,a.jsx)(`span`,{className:v.exportLabel,children:t(`billing.export`)}),(0,a.jsx)(`button`,{type:`button`,className:v.exportButton,"data-testid":`billing-export-day`,onClick:()=>{$e(Qe(`usage-daily`,`csv`,Object.keys(O)),Je(O),`text/csv`)},children:t(`billing.exportCsvDay`)}),e.bySession!==void 0&&(0,a.jsx)(`button`,{type:`button`,className:v.exportButton,"data-testid":`billing-export-sessions`,onClick:()=>{$e(Qe(`usage-sessions`,`csv`,Object.keys(O)),Ze(e.bySession??[]),`text/csv`)},children:t(`billing.exportCsvSession`)}),e.bySite!==void 0&&(0,a.jsx)(`button`,{type:`button`,className:v.exportButton,"data-testid":`billing-export-sites`,onClick:()=>{$e(Qe(`usage-sites`,`csv`,Object.keys(O)),Ye(e.bySite??{}),`text/csv`)},children:t(`billing.exportCsvSite`)}),(0,a.jsx)(`button`,{type:`button`,className:v.exportButton,"data-testid":`billing-export-json`,onClick:()=>{$e(Qe(`usage-stats`,`json`,Object.keys(O)),JSON.stringify(e,null,2),`application/json`)},children:t(`billing.exportJson`)})]}),Oe.length>0&&(0,a.jsxs)(`section`,{className:v.panel,"data-testid":`billing-panel-roles`,children:[(0,a.jsxs)(`div`,{className:v.panelHead,children:[(0,a.jsx)(`h3`,{className:v.panelTitle,children:t(`billing.roleCost`)}),(0,a.jsx)(`span`,{className:v.panelHint,children:t(`billing.roleHint`)})]}),(0,a.jsx)(`div`,{className:v.shareTrack,"data-testid":`billing-role-track`,children:Oe.map(e=>(0,a.jsx)(`div`,{className:c(v.shareSeg,e.seg),style:{width:`${e.pct}%`}},e.label))}),(0,a.jsx)(`div`,{className:v.shareLegend,children:Oe.map(e=>(0,a.jsxs)(`span`,{className:v.shareItem,children:[(0,a.jsx)(`span`,{className:c(v.shareDot,e.seg)}),e.label,(0,a.jsxs)(`span`,{className:v.shareValue,children:[W(e.value),` · `,e.pct.toFixed(1),`%`]})]},e.label))})]}),Z!==void 0&&(()=>{let e=Z.officialCost+Z.thirdCost,n=e>0?Z.officialCost/e*100:0;return(0,a.jsxs)(`div`,{className:v.ubStatGrid,"data-testid":`billing-panel-buckets`,children:[(0,a.jsxs)(`div`,{className:v.ubStatCard,children:[(0,a.jsxs)(`span`,{className:v.ubStatLabel,children:[t(`billing.official`),`(=DeepSeek 直连)`]}),(0,a.jsx)(`span`,{className:v.ubStatValue,children:W(Z.officialCost)}),(0,a.jsxs)(`span`,{className:v.ubStatDetail,children:[Z.officialCalls,` `,t(`billing.calls`),` · `,n.toFixed(1),`%`]})]}),(0,a.jsxs)(`div`,{className:v.ubStatCard,children:[(0,a.jsxs)(`span`,{className:v.ubStatLabel,children:[t(`billing.thirdParty`),`(中转)`]}),(0,a.jsx)(`span`,{className:v.ubStatValue,children:W(Z.thirdCost)}),(0,a.jsxs)(`span`,{className:v.ubStatDetail,children:[Z.thirdCalls,` `,t(`billing.calls`),` · `,(100-n).toFixed(1),`%`]})]})]})})(),e.byWorkspace!==void 0&&e.byWorkspace.length>0&&(0,a.jsxs)(`section`,{className:v.ubCard,"data-testid":`billing-panel-workspaces`,children:[(0,a.jsxs)(`div`,{className:v.ubCardHead,children:[(0,a.jsx)(`h3`,{className:v.ubCardTitle,children:t(`billing.workspaces`)}),(0,a.jsx)(`span`,{className:v.ubCardSub,children:t(`billing.workspacesHint`)})]}),(0,a.jsx)(`ul`,{className:v.rowlist,children:e.byWorkspace.map(n=>(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(`li`,{children:(0,a.jsxs)(`button`,{type:`button`,className:v.rowline,"data-testid":`billing-workspace-${n.name}`,onClick:()=>{V(ge===n.name?void 0:n.name)},children:[(0,a.jsx)(`span`,{className:v.rowlineName,children:n.name}),(0,a.jsxs)(`span`,{className:v.rowlineRight,children:[(0,a.jsx)(`span`,{className:v.num,children:W(n.cost)}),(0,a.jsxs)(`span`,{className:v.rowlineMuted,children:[n.calls,` `,t(`billing.calls`)]}),(0,a.jsx)(`span`,{className:v.rowlineChev,"aria-hidden":`true`,children:`›`})]})]})}),ge===n.name&&(0,a.jsx)(`li`,{className:v.rowlineDrillWrap,children:e.bySession?.filter(e=>ft(e.cwd)===n.name).slice(0,5).map(e=>(0,a.jsxs)(`div`,{className:v.rowlineDrill,children:[(0,a.jsx)(`span`,{className:v.rowlineName,children:e.title??e.id.slice(0,8)}),(0,a.jsxs)(`span`,{className:v.rowlineRight,children:[(0,a.jsx)(`span`,{className:v.num,children:W(e.cost)}),(0,a.jsxs)(`span`,{className:v.rowlineMuted,children:[e.calls,` `,t(`billing.calls`)]})]})]},e.id))})]},n.name))})]}),e.bySession!==void 0&&(0,a.jsxs)(`section`,{className:v.ubCard,"data-testid":`billing-panel-sessions`,children:[(0,a.jsxs)(`div`,{className:v.ubCardHead,children:[(0,a.jsx)(`h3`,{className:v.ubCardTitle,children:t(`billing.sessions`)}),(0,a.jsx)(`span`,{className:v.ubCardSub,children:e.bySession.length>20?t(`billing.sessionOverflow`).replace(`{limit}`,`20`).replace(`{total}`,String(e.bySession.length)):`${e.bySession.length}`})]}),(0,a.jsx)(`div`,{className:v.ubTablewrap,"data-testid":`billing-sessions-table`,children:(0,a.jsxs)(`table`,{className:v.ubTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`billing.sessionTitle`)}),(0,a.jsx)(`th`,{children:t(`billing.project`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.calls`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.actual`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.lastActive`)})]})}),(0,a.jsxs)(`tbody`,{children:[e.bySession.length===0&&(0,a.jsx)(`tr`,{children:(0,a.jsx)(`td`,{colSpan:5,className:v.emptyRow,children:t(`billing.noData`)})}),e.bySession.slice(0,20).map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:v.modelName,children:e.title??e.id.slice(0,8)})}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:v.modelProvider,children:ft(e.cwd)??`—`})}),(0,a.jsx)(`td`,{className:v.numCol,children:e.calls.toLocaleString()}),(0,a.jsx)(`td`,{className:v.numCol,children:W(e.cost)}),(0,a.jsx)(`td`,{className:v.numCol,children:e.lastActive>0?`${$(e.lastActive)} ${It(e.lastActive)}`:`—`})]},e.id))]})]})})]})]}),k===`token`&&(0,a.jsxs)(`div`,{className:v.tabPanel,"data-testid":`billing-tab-panel-token`,children:[(0,a.jsx)(Ne,{stats:e,trendDays:A,onTrendDays:ce,t}),e.perf!==void 0&&(0,a.jsxs)(`section`,{className:v.panel,"data-testid":`billing-panel-perf`,children:[(0,a.jsxs)(`div`,{className:v.panelHead,children:[(0,a.jsx)(`h3`,{className:v.panelTitle,children:t(`billing.perfTitle`)}),(0,a.jsx)(`span`,{className:v.panelHint,children:t(`billing.perfHint`)})]}),(0,a.jsx)(Te,{perf:e.perf,models:st,t})]})]}),k===`pricing`&&(0,a.jsxs)(`div`,{className:v.tabPanel,"data-testid":`billing-tab-panel-pricing`,children:[(0,a.jsxs)(`div`,{className:v.ubAlert,role:`note`,children:[(0,a.jsxs)(`div`,{className:v.ubAlertLeft,children:[(0,a.jsxs)(`span`,{className:v.ubRate,"data-testid":`billing-rate`,children:[t(`billing.todayRate`),` 1 USD = `,R(U.rate)]}),(0,a.jsx)(`span`,{className:c(v.ubTag,U.live?v.ubTagSuccess:v.ubTagNeutral),children:U.live?t(`billing.rateLive`):t(`billing.rateBuiltin`)})]}),(0,a.jsx)(`p`,{className:v.ubAlertNote,children:t(`billing.pricingTip`)})]}),(0,a.jsxs)(`section`,{className:v.ubCard,"data-testid":`billing-panel-pricing`,children:[(0,a.jsxs)(`div`,{className:v.ubCardHead,children:[(0,a.jsx)(`h3`,{className:v.ubCardTitle,children:t(`billing.pricing`)}),(0,a.jsx)(`span`,{className:v.ubCardSub,children:t(`billing.pricingUnit`)})]}),(0,a.jsx)(`div`,{className:v.ubTablewrap,children:(0,a.jsxs)(`table`,{className:v.ubTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`billing.thModel`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.thInputMiss`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.thInputHit`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.output`)}),(0,a.jsx)(`th`,{className:v.numCol,children:t(`billing.band`)})]})}),(0,a.jsx)(`tbody`,{children:me().map(e=>{let n=e.price.input>0||e.price.output>0;return(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:v.ubModel,children:[(0,a.jsx)(Zt,{provider:e.provider,colorVar:he(e.colorVar)}),(0,a.jsxs)(`span`,{className:v.ubModelName,children:[e.name,e.uncatalogued&&(0,a.jsx)(`span`,{className:v.ubTagAlert,"data-testid":`billing-price-uncatalogued`,children:t(`billing.uncatalogued`)}),e.promo!==void 0&&fe(e.promo,Date.now())&&(0,a.jsx)(`span`,{className:v.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,a.jsx)(`td`,{className:v.numCol,children:n?G(e.price.input,e.price.currency):(0,a.jsx)(`span`,{className:v.na,children:`—`})}),(0,a.jsx)(`td`,{className:v.numCol,children:n?G(e.price.cacheHit,e.price.currency):(0,a.jsx)(`span`,{className:v.na,children:`—`})}),(0,a.jsx)(`td`,{className:v.numCol,children:n?G(e.price.output,e.price.currency):(0,a.jsx)(`span`,{className:v.na,children:`—`})}),(0,a.jsx)(`td`,{className:v.numCol,children:n&&e.price.offPeak!==void 0&&e.peakHours!==void 0?(0,a.jsxs)(`span`,{className:v.ubPricepair,children:[(0,a.jsxs)(`span`,{className:v.ubChipPeak,children:[(0,a.jsx)(`span`,{className:v.ubChipLabel,children:t(`billing.ubPeak`)}),(0,a.jsxs)(`span`,{className:v.num,children:[G(e.price.input,e.price.currency),` / `,G(e.price.output,e.price.currency)]})]}),(0,a.jsxs)(`span`,{className:v.ubChipOff,children:[(0,a.jsx)(`span`,{className:v.ubChipLabel,children:t(`billing.ubOff`)}),(0,a.jsxs)(`span`,{className:v.num,children:[G(e.price.offPeak.input,e.price.currency),` / `,G(e.price.offPeak.output,e.price.currency)]})]})]}):n?(0,a.jsx)(`span`,{className:v.flatTag,children:t(`billing.flat`)}):(0,a.jsx)(`span`,{className:v.na,children:`—`})})]}),(e.extraRows??[]).map(t=>(0,a.jsxs)(`tr`,{className:v.ubExtraRow,children:[(0,a.jsxs)(`td`,{children:[(0,a.jsx)(`span`,{className:v.ubExtraName,children:t.label}),t.note!==void 0&&(0,a.jsx)(`span`,{className:v.ubExtraNote,children:t.note})]}),(0,a.jsx)(`td`,{className:v.numCol,children:t.input===void 0?(0,a.jsx)(`span`,{className:v.na,children:`—`}):G(t.input,e.price.currency)}),(0,a.jsx)(`td`,{className:v.numCol,children:(0,a.jsx)(`span`,{className:v.na,children:`—`})}),(0,a.jsx)(`td`,{className:v.numCol,children:t.output===void 0?(0,a.jsx)(`span`,{className:v.na,children:`—`}):G(t.output,e.price.currency)}),(0,a.jsx)(`td`,{className:v.numCol,children:(0,a.jsx)(`span`,{className:v.na,children:`—`})})]},`${e.key}:${t.label}`))]},e.key)})})]})})]}),(0,a.jsxs)(`section`,{className:v.ubCard,children:[(0,a.jsx)(`div`,{className:v.ubCardHead,children:(0,a.jsx)(`h3`,{className:v.ubCardTitle,children:t(`billing.pricingNotes`)})}),(0,a.jsxs)(`ul`,{className:v.ubNotes,children:[(0,a.jsxs)(`li`,{className:v.ubNotesItem,children:[(0,a.jsx)(`span`,{className:v.ubNotesTerm,children:t(`billing.cacheHit`)}),(0,a.jsx)(`span`,{className:v.ubNotesDesc,children:t(`billing.noteCache`)})]}),(0,a.jsxs)(`li`,{className:v.ubNotesItem,children:[(0,a.jsx)(`span`,{className:v.ubNotesTerm,children:t(`billing.peakBand`)}),(0,a.jsx)(`span`,{className:v.ubNotesDesc,children:t(`billing.noteBand`)})]}),(0,a.jsxs)(`li`,{className:v.ubNotesItem,children:[(0,a.jsx)(`span`,{className:v.ubNotesTerm,children:t(`billing.pricingSource`)}),(0,a.jsx)(`span`,{className:v.ubNotesDesc,children:t(`billing.noteSource`)})]})]})]})]}),h(`billing.dashboard.decor`,{position:`footer`})]}),(0,a.jsxs)(`footer`,{className:v.modalFooter,"data-testid":`billing-footer`,children:[(0,a.jsx)(`span`,{children:t(`billing.footer`)}),(0,a.jsx)(`span`,{children:t(`billing.footerCredit`).replace(`{version}`,e.pluginVersion===void 0?`—`:`v${e.pluginVersion}`)})]})]})})}function Zt({provider:e,colorVar:t}){let n=it(e);return n===void 0?(0,a.jsx)(`span`,{className:v.vendorLetter,style:t===void 0?void 0:{background:t},"aria-hidden":`true`,children:e.trim().charAt(0).toUpperCase()}):(0,a.jsx)(`img`,{className:v.vendorLogo,src:n,alt:``,"aria-hidden":`true`})}function Qt(e){let{t,checkModels:n,publishCosts:i,registerOpen:o,renderSlot:s,useStore:c,actions:l}=e,[u,p]=(0,r.useState)(Rt),[m,_]=(0,r.useState)(mt),[v,ee]=(0,r.useState)([]),[y,b]=(0,r.useState)(void 0),[te,x]=(0,r.useState)([]),[S,C]=(0,r.useState)(!1),[w,ne]=(0,r.useState)([]),[T,E]=(0,r.useState)(`cny`),[ae,oe]=(0,r.useState)(()=>d()),O=(0,r.useCallback)(e=>{oe(e),f(e)},[]),[k,se]=(0,r.useState)(()=>h()),A=(0,r.useCallback)(e=>{se(e),g(e)},[]),ce=T===`usd`?`en`:`zh`,j=(0,r.useCallback)((e,n)=>{let r=(ce===`en`?X:tt)[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},[ce,t]),[le,ue]=(0,r.useState)(!1),M=(0,r.useCallback)(()=>{ue(!1)},[]),N=(0,r.useCallback)(()=>{zt().then(e=>{e!==null&&p(e)}),Ht().then(({balances:e,reconcile:t})=>{e.length>0&&ee(e),b(t)}),Ut().then(e=>{e.length>0&&x(e),C(!1)}).catch(()=>{C(!0)}),Wt().then(e=>{ne(e)}).catch(()=>{})},[]),P=(0,r.useCallback)(()=>{N(),Vt(),ue(!0)},[N]);(0,r.useEffect)(()=>{N(),Vt()},[N]),(0,r.useEffect)(()=>{let e=setInterval(()=>{N(),Vt()},Ft);return()=>{clearInterval(e)}},[N]),(0,r.useEffect)(()=>{let e=!0;return n().then(t=>{e&&(_(t),re(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),fe=u.byDay[F]?.cost??0,pe=Et(u.byDay).reduce((e,t)=>e+t.cost,0),me=(0,r.useMemo)(()=>Et(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]),he=Object.entries(u.byDay).filter(([e])=>e.startsWith(F.slice(0,7))).reduce((e,[,t])=>e+t.input+t.output,0),ge=(()=>{let e=u.byDay[F];return e===void 0?0:e.input+e.output})(),_e=me.reduce((e,t)=>e+t.tokens,0),L=c(e=>e.enabled),ve=c(e=>e.amount),ye=c(e=>e.tierAlertDays),z=c(e=>e.lastTierSwitchAt),[B,V]=(0,r.useState)(()=>st()),[be,H]=(0,r.useState)(null),[xe,U]=(0,r.useState)(null),[Se,W]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{let e=setInterval(()=>W(Date.now()),Ft);return()=>{clearInterval(e)}},[]);let Ce=(0,r.useCallback)(e=>{V(e),ct(e)},[]),we=(0,r.useCallback)(()=>{U({entering:D(Date.now())===`peak`?`offPeak`:`peak`,atMs:Date.now()+3*6e4})},[]),Te=ve>0?ve:u.budget??0,G=(0,r.useCallback)(()=>{let e=!L;l.setEnabled(e),e&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission()},[l,L]);(0,r.useEffect)(()=>{if(!L||Te<=0)return;let e=I/Te*100,t=$(),n=pt.filter(n=>e>=n&&ye?.[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}`,R(I)).replace(`{budget}`,R(Te)).replace(`{pct}`,String(r));try{new Notification(j(`billing.budget`),{body:i})}catch{}},[L,Te,I,ye,l,j]),(0,r.useEffect)(()=>{let e=lt(Se,B,z);if(e===null||(l.markTierSwitchAlerted(e.atMs),H(e),!B.webNotify)||typeof Notification>`u`||Notification.permission!==`granted`)return;let t=Math.max(1,Math.round((e.atMs-Se)/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{}},[Se,z,B,l,j]);let Ee=c(e=>e.lastBalanceAlertDay),De=(0,r.useMemo)(()=>{if(v.length===0)return;let e=u.lowBalanceThreshold??50,t=xt(u.byDay,F),n=ie().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,r.useEffect)(()=>{if(De===void 0)return;let e=$();if(Ee===e||(l.markBalanceAlerted(e),typeof Notification>`u`||Notification.permission!==`granted`))return;let t=j(`billing.balanceLowBody`).replace(`{name}`,De.name).replace(`{balance}`,R(De.cny)).replace(`{days}`,De.days===void 0?`—`:String(De.days));try{new Notification(j(`billing.balance`),{body:t})}catch{}},[De,Ee,l,j]);let K=(0,r.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=de(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)}`:R(t.totalBalance),r=ie().rate;return{text:n,low:(t.currency===`USD`?t.totalBalance*r:t.totalBalance)<(u.lowBalanceThreshold??50)}},a=e=>{let t=te.find(t=>t.displayName===e||bt(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,te,F]),Oe=(0,r.useMemo)(()=>{let e=u.total;return{totalToken:e.input+e.output,input:e.input,output:e.output,cacheRead:e.cacheHit,calls:e.calls}},[u]);(0,r.useEffect)(()=>{i({todayCost:fe,monthCost:I})},[fe,I,i]),(0,r.useEffect)(()=>o(P),[o,P]);let q=(0,r.useMemo)(()=>u.byTurn??[],[u.byTurn]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(qt,{...e,t:j,onOpen:P,monthCost:I,todayCost:fe,weekCost:pe,days:me,vendorStatus:K,dash:Oe,cardPrefs:k,monthTokens:he,todayTokens:ge,weekTokens:_e,floatPrefs:ae,subscriptions:te}),le&&(0,a.jsx)(Xt,{stats:u,t:j,onClose:M,health:m,balances:v,...y===void 0?{}:{reconcile:y},quotas:te,relayQuotas:w,currency:T,onCurrency:E,turns:q,renderSlot:s,budgetEnabled:L,budgetAmount:Te,onToggleBudget:G,onBudgetAmount:l.setAmount,peakConfig:B,onPeakConfig:Ce,onPreviewPeak:we,floatPrefs:ae,onFloatPrefs:O,cardPrefs:k,onCardPrefs:A,quotasStale:S}),(be!==null||xe!==null)&&(0,a.jsx)(ut,{hit:be??xe,config:B,t:j,onDismiss:()=>{H(null),U(null)}})]})}function $t(e,t){return t===void 0||e?.bySession===void 0?0:e.bySession.find(e=>e.id===t)?.cost??0}function en(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 tn(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 nn(){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 rn(){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 an(e){switch(e){case`session`:return`billing.subscriptionSession`;case`weekly`:return`billing.subscriptionWeekly`;case`monthly`:return`billing.subscriptionMonthly`;default:return`billing.subscriptionBilling`}}function on({useSession:e,t}){let n=e(e=>e.sessionId),[i,o]=(0,r.useState)(null),[s,c]=(0,r.useState)([]),[l,u]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{let e=!1,t=()=>{nn().then(t=>{!e&&t!==null&&o(t)}),rn().then(t=>{e||c(t)}),e||u(Date.now())};t();let n=setInterval(t,3e4);return()=>{e=!0,clearInterval(n)}},[n]);let d=(0,r.useMemo)(()=>$t(i,n),[i,n]),f=(0,r.useMemo)(()=>en(i,n),[i,n]),p=A(l),m=(0,r.useMemo)(()=>tn(s),[s]),h=e=>R(e,`cny`);if(n===void 0)return null;let g=d>0||f>0,_=p.tier===`peak`;return(0,a.jsxs)(`span`,{className:v.feeBar,"data-testid":`billing-live-cost-bar`,children:[(0,a.jsx)(`span`,{className:_?v.feeChipPrimary:v.feeChipOff,"data-testid":`billing-live-tier`,children:t(_?`billing.tierPeak`:`billing.tierOff`)}),(0,a.jsx)(`span`,{className:v.feeCount,children:j(p.nextSwitchInMs)}),(0,a.jsx)(`span`,{className:v.feeSuffix,children:t(_?`billing.tierToOff`:`billing.tierToPeak`)}),g&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:v.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:v.feeItem,"data-testid":`billing-live-turn`,children:[t(`billing.liveTurn`),` `,(0,a.jsx)(`span`,{className:v.feeNum,children:h(f)})]}),(0,a.jsx)(`span`,{className:v.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:v.feeItem,"data-testid":`billing-live-session`,children:[t(`billing.liveSession`),` `,(0,a.jsx)(`span`,{className:v.feeNum,children:h(d)})]})]}),m.map(e=>(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:v.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:e.pct<=10?v.feeChipError:v.feeChipAlert,"data-testid":`billing-live-quota`,children:[e.name,` `,t(an(e.kind)),` `,e.pct,`%`]})]},`${e.name}:${e.kind}`))]})}function sn(){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 cn(){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 ln={enabled:!1,timeout:0};function un(){try{let e=localStorage.getItem(`dsh-billing-completion-notify-v1`);if(e===null)return{...ln};let t=JSON.parse(e);return{enabled:t.enabled===!0,timeout:typeof t.timeout==`number`?t.timeout:0}}catch{return{...ln}}}function dn(e){return e.completed===!0?!0:e.running===!1}function fn(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)),dn(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=dn(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 pn=[`slots`,`locale`,`connection`,`sessions`];function mn(e){let t=sn();e.provide(`billingMetrics`,t);let n=cn(),r=e.get(`connection`);e.effect(()=>e.locale.register(et,{zh:tt,en:X}),`ui-usage-billing: dictionaries`),e.slots.inject(`sidebar.footer.action`,()=>e.slots.register({name:`sidebar.footer.action`,id:`usage-billing`,order:-10,locale:et,children:{"billing.dashboard.decor":{kind:`list`,scope:`root`}},store:n,inject:()=>({checkModels:async()=>{try{let{result:e}=await r.api.llm.models({});if(!e.ok)return{checked:!0,available:!1,models:0,failures:0,okProviders:[],badProviders:[]};let t=[];for(let n of e.value.groups)for(let e of n.models)t.push({id:e.id,...typeof e.name==`string`&&e.name!==``?{name:e.name}:{},provider:n.name});return{checked:!0,available:e.value.groups.length>0,models:e.value.groups.reduce((e,t)=>e+t.models.length,0),failures:e.value.failures.length,okProviders:e.value.groups.map(e=>e.name),badProviders:e.value.failures.map(e=>e.name),catalog:t}}catch{return{checked:!0,available:!1,models:0,failures:0,okProviders:[],badProviders:[]}}},publishCosts:e=>{t.publishCosts(e)},registerOpen:e=>t.registerOpen(e)})},Qt)),e.slots.inject(`conversation.composer.dock`,()=>e.slots.register({name:`conversation.composer.dock`,id:`usage-billing-cost`,order:0,locale:et},on)),e.effect(()=>fn(e.sessions.list,un),`ui-usage-billing: completion notifier`)}return n.UsageBilling=Qt,n.apply=mn,n.inject=pn,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"),i=e("@deepseek-ai/dsh-client-ui-primitives"),a=e("react/jsx-runtime"),o=e("@deepseek-ai/dsh-client-runtime/client");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 _=`dsh.ui-usage-billing.prices`;function v(){try{let e=localStorage.getItem(_);if(e===null)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t)){if(typeof r!=`object`||!r)continue;let t=r;[t.input,t.cacheHit,t.output].every(e=>typeof e==`number`&&e>=0)&&(n[e]={input:t.input,cacheHit:t.cacheHit,output:t.output,...t.currency===`USD`?{currency:`USD`}:{}})}return n}catch{return{}}}function y(e){try{localStorage.setItem(_,JSON.stringify(e))}catch{}}let b=`@kenz1117/dsh-ui-usage-billing/UsageBilling.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(b)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=b,e.textContent=`.KFXqYa_railButton{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);width:36px;height:36px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:8px;flex:none;justify-content:center;align-items:center;padding:0;transition:border-color .16s,color .16s;display:flex}.KFXqYa_railButton:hover,.KFXqYa_railButton:focus-visible{border-color:var(--dsw-static-blue-500);color:var(--dsw-static-blue-500);outline:none}.KFXqYa_railButton svg{stroke-width:2px;width:18px;height:18px}.KFXqYa_trigger{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);width:100%;min-width:0;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;border-radius:14px;align-items:center;gap:10px;padding:9px 12px;transition:border-color .16s,transform .16s,box-shadow .16s;display:flex;position:relative;overflow:hidden;box-shadow:0 1px 2px #0000000a}.KFXqYa_trigger:hover,.KFXqYa_trigger:focus-visible{border-color:var(--dsw-static-blue-500);box-shadow:0 6px 18px -8px color-mix(in srgb, var(--dsw-static-blue-500) 45%, transparent);outline:none;transform:translateY(-1px)}.KFXqYa_triggerIcon{border:1px solid var(--dsw-alias-border-l1);width:32px;height:32px;color:var(--dsw-alias-label-secondary);opacity:.8;border-radius:8px;flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_triggerIcon svg{stroke-width:2px;width:16px;height:16px}.KFXqYa_triggerMain{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.KFXqYa_triggerPrimary{align-items:baseline;gap:5px;min-width:0;display:inline-flex}.KFXqYa_triggerLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:11px;line-height:15px;overflow:hidden}.KFXqYa_triggerYen{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;font-weight:600;line-height:16px}.KFXqYa_triggerMetric{color:var(--dsw-alias-label-primary);letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:20px;font-weight:700;line-height:24px;overflow:hidden}.KFXqYa_triggerSub{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:10px;line-height:14px;overflow:hidden}.KFXqYa_triggerSpark{flex:none;align-items:flex-end;gap:2px;height:20px;display:flex}.KFXqYa_triggerSparkBar,.KFXqYa_triggerSparkHot{background:var(--dsw-static-blue-500);opacity:.6;border-radius:1px 1px 0 0;width:3px}.KFXqYa_triggerSparkHot{opacity:1}.KFXqYa_triggerWrap{flex:auto;width:100%;min-width:0;display:block;position:relative;container:KFXqYa_billing-trigger/inline-size}@container KFXqYa_billing-trigger (width<=200px){.KFXqYa_trigger{gap:6px;padding:8px 10px}.KFXqYa_triggerSpark{display:none}}@container KFXqYa_billing-trigger (width<=170px){.KFXqYa_triggerSub,.KFXqYa_triggerLabel{display:none}}@container KFXqYa_billing-trigger (width<=110px){.KFXqYa_triggerIcon,.KFXqYa_triggerSpark,.KFXqYa_triggerSub,.KFXqYa_triggerLabel{display:none}.KFXqYa_trigger{justify-content:center;padding:8px 6px}}.KFXqYa_triggerPop{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 80%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-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)}.KFXqYa_triggerPop:before{content:"";background:linear-gradient(90deg, transparent 0%, var(--dsw-static-amber-500) 30%, var(--dsw-alias-label-primary) 50%, var(--dsw-static-amber-500) 70%, transparent 100%);opacity:.9;pointer-events:none;background-size:200% 100%;height:1.5px;animation:4s ease-in-out infinite KFXqYa_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}.KFXqYa_triggerWrap:hover .KFXqYa_triggerPop,.KFXqYa_triggerWrap:focus-within .KFXqYa_triggerPop{opacity:1;transform:translateY(0)}.KFXqYa_popHead{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.KFXqYa_popTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:700;line-height:18px}.KFXqYa_metricGrid{grid-template-columns:repeat(3,1fr);gap:10px 8px;display:grid}.KFXqYa_metricCell{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_metricLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_metricValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:12px;font-weight:700;line-height:16px}.KFXqYa_metricValuePrimary{color:var(--dsw-static-amber-500)}.KFXqYa_metricValueSuccess{color:var(--dsw-static-green-500)}.KFXqYa_popModel{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:6px;padding-top:10px;display:flex}.KFXqYa_popModelLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_popModelRow{align-items:center;gap:8px;min-width:0;display:flex}.KFXqYa_popDot{border-radius:999px;flex:none;width:6px;height:6px}.KFXqYa_popDotDirect{background:var(--dsw-static-green-500)}.KFXqYa_popDotSub{background:var(--dsw-static-amber-500)}.KFXqYa_popDotNeutral{background:var(--dsw-alias-label-tertiary)}.KFXqYa_popTagPrimary,.KFXqYa_popTagSub{white-space:nowrap;border-radius:5px;flex:none;align-items:center;height:18px;padding:0 6px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_popTagPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.KFXqYa_popTagSub{background:color-mix(in srgb, var(--dsw-static-amber-500) 18%, transparent);color:var(--dsw-static-amber-500)}.KFXqYa_popModelName{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:16px;overflow:hidden}.KFXqYa_popModelStatus{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;white-space:nowrap;margin-left:auto;font-size:11px;font-weight:600;line-height:16px}.KFXqYa_popModelStatusLow{color:var(--dsw-static-red-500)}.KFXqYa_dashboardModal{border:1px solid var(--dsw-alias-border-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 KFXqYa_dashboardIn;box-shadow:0 12px 32px -12px #0000002e,0 2px 8px #0000000f}@keyframes KFXqYa_dashboardIn{0%{opacity:0;transform:translateY(8px)scale(.98)}to{opacity:1;transform:none}}div[role=presentation]:has(>.dsh-billing-modal)>div[aria-hidden=true]:first-child{backdrop-filter:blur(8px)saturate(1.25)}.KFXqYa_dashboard{flex-direction:column;width:100%;max-height:min(760px,88vh);display:flex}.KFXqYa_dashboardHead{border-bottom:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:12px;padding:20px 24px;display:flex}.KFXqYa_dashboardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:600;line-height:24px}.KFXqYa_dashboardSubtitle{color:var(--dsw-alias-label-caption);margin:2px 0 0;font-size:11px;line-height:16px}.KFXqYa_closeButton{border:1px solid var(--dsw-alias-border-l1);width:32px;height:32px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border-radius:8px;flex:none;justify-content:center;align-items:center;transition:background-color .14s,color .14s;display:inline-flex}.KFXqYa_closeButton:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.KFXqYa_closeButton svg{stroke-width:2px;width:16px;height:16px}.KFXqYa_dashboardBody{flex-direction:column;gap:14px;padding:16px 24px 24px;display:flex;overflow-y:auto}.KFXqYa_modalFooter{border-top:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:16px;padding:12px 24px;font-size:11px;line-height:16px;display:flex}.KFXqYa_tabNav{border-bottom:1px solid var(--dsw-alias-border-l1);align-items:center;gap:4px;padding:0 24px;display:flex}.KFXqYa_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}.KFXqYa_tabButton:hover,.KFXqYa_tabButton:focus-visible{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 62%, transparent);outline:none}.KFXqYa_tabButtonActive,.KFXqYa_tabButtonActive:hover,.KFXqYa_tabButtonActive:focus-visible{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);font-weight:600}.KFXqYa_tabPanel{flex-direction:column;gap:14px;animation:.14s ease-out KFXqYa_tabPanelIn;display:flex}@keyframes KFXqYa_tabPanelIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.KFXqYa_reconcileNotice{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 78%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 62%, transparent);color:var(--dsw-alias-label-secondary);border-radius:10px;align-items:flex-start;gap:10px;padding:10px 12px;font-size:12px;line-height:1.55;display:flex}.KFXqYa_reconcileIcon{color:var(--dsw-alias-label-tertiary);flex:none;margin-top:1px;display:inline-flex}.KFXqYa_reconcileText{flex:1}.KFXqYa_reconcileDismiss{color:var(--dsw-alias-label-tertiary);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:6px;flex:none;padding:2px 8px;font-size:12px;line-height:1.4;transition:color .15s,background-color .15s}.KFXqYa_reconcileDismiss:hover{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent)}.KFXqYa_hero{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:18px;padding:24px;display:flex;position:relative;overflow:hidden}.KFXqYa_heroTop{justify-content:space-between;align-items:center;gap:24px;display:flex}.KFXqYa_heroMain{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_heroLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:16px}.KFXqYa_heroReadout{align-items:baseline;gap:4px;display:flex}.KFXqYa_heroCurrency{letter-spacing:-.01em;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:22px;font-weight:600;line-height:28px}.KFXqYa_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}.KFXqYa_heroMeta{color:var(--dsw-alias-label-caption);white-space:nowrap;margin-top:4px;font-size:12px;line-height:17px}.KFXqYa_heroGauge{flex:none;width:96px;height:96px;position:relative}.KFXqYa_heroGaugeSvg{width:100%;height:100%;display:block;transform:rotate(-90deg)}.KFXqYa_heroGaugeTrack{fill:none;stroke:var(--dsw-alias-bg-module-platform);stroke-width:9px}.KFXqYa_heroGaugeArc{fill:none;stroke:var(--dsw-static-blue-500);stroke-width:9px;stroke-linecap:round;transition:stroke-dasharray .26s}.KFXqYa_heroGaugeArcOver{stroke:var(--dsw-static-red-500)}.KFXqYa_heroGaugeCenter{flex-direction:column;justify-content:center;align-items:center;gap:1px;display:flex;position:absolute;inset:0}.KFXqYa_heroGaugePct{letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);font-size:18px;font-weight:700;line-height:22px}.KFXqYa_heroGaugePctOver{color:var(--dsw-static-red-500)}.KFXqYa_heroGaugeLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_heroBudget{border-top:1px solid var(--dsw-alias-border-l1);align-items:center;gap:14px;padding-top:14px;display:flex}.KFXqYa_heroBudgetLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;font-size:11px;line-height:16px}.KFXqYa_heroBudgetTrack{background:var(--dsw-alias-border-l1);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.KFXqYa_heroBudgetFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .22s}.KFXqYa_heroBudgetFillOver{background:var(--dsw-static-red-500)}.KFXqYa_heroBudgetValue{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px;line-height:16px}.KFXqYa_heroSide{border-top:1px solid var(--dsw-alias-border-l1);align-items:stretch;padding-top:14px;display:flex}.KFXqYa_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}.KFXqYa_heroSideItem:first-child{border-left:none;padding-left:0}.KFXqYa_heroSideLabel{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:15px}.KFXqYa_heroSideValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;white-space:nowrap;align-items:baseline;gap:6px;font-size:18px;font-weight:600;line-height:24px;display:inline-flex}.KFXqYa_heroSideSpacer{flex:1;display:block}.KFXqYa_delta{align-items:center;gap:2px;margin-left:4px;font-size:11px;font-weight:600;line-height:17px;display:inline-flex}.KFXqYa_deltaUp{color:var(--dsw-static-green-500)}.KFXqYa_deltaDown{color:var(--dsw-static-red-500)}.KFXqYa_unpricedHint{border:1px solid color-mix(in srgb, var(--dsw-static-amber-500) 30%, transparent);background:color-mix(in srgb, var(--dsw-static-amber-500) 8%, transparent);color:var(--dsw-static-amber-500);border-radius:8px;align-items:center;padding:8px 12px;font-size:11.5px;font-weight:500;line-height:17px;display:flex}.KFXqYa_kpiGrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;display:grid}.KFXqYa_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}.KFXqYa_kpiTile:hover{border-color:var(--dsw-alias-border-l2)}.KFXqYa_kpiLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:15px}.KFXqYa_kpiValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:24px;font-weight:600;line-height:32px}.KFXqYa_kpiGreen{color:var(--dsw-static-green-500)}.KFXqYa_kpiDetail{color:var(--dsw-alias-label-caption);white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:15px;overflow:hidden}.KFXqYa_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}.KFXqYa_panelHead{justify-content:space-between;align-items:baseline;gap:10px;display:flex}.KFXqYa_panelTitle{letter-spacing:-.005em;color:var(--dsw-alias-label-primary);margin:0;font-size:14px;font-weight:600;line-height:20px}.KFXqYa_panelHint{color:var(--dsw-alias-label-caption);white-space:nowrap;font-size:11px;line-height:16px}.KFXqYa_rangeToggle{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:8px;gap:2px;padding:2px;display:inline-flex}.KFXqYa_rangeButton{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:6px;padding:2px 8px;font-size:11px;line-height:16px;transition:background-color .14s,color .14s}.KFXqYa_rangeButtonActive{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);font-weight:600}.KFXqYa_exportBar{justify-content:flex-end;align-items:center;gap:8px;display:flex}.KFXqYa_exportLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:16px}.KFXqYa_exportButton{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:999px;padding:4px 12px;font-size:11.5px;line-height:16px;transition:border-color .16s,color .16s,background-color .16s}.KFXqYa_exportButton:hover,.KFXqYa_exportButton:focus-visible{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);outline:none}.KFXqYa_shareTrack{background:var(--dsw-alias-bg-module-platform);border-radius:999px;height:10px;display:flex;overflow:hidden}.KFXqYa_shareSeg{height:100%;transition:width .2s}.KFXqYa_shareSegPeak{background:var(--dsw-static-blue-500)}.KFXqYa_shareSegOff{background:color-mix(in srgb, var(--dsw-static-blue-500) 25%, var(--dsw-alias-bg-module-platform))}.KFXqYa_shareSegUser{background:var(--dsw-static-blue-500)}.KFXqYa_shareSegAssistant{background:var(--dsw-static-green-500)}.KFXqYa_shareSegTool{background:var(--dsw-static-amber-500)}.KFXqYa_shareLegend{align-items:center;gap:16px;display:flex}.KFXqYa_shareItem{color:var(--dsw-alias-label-secondary);align-items:baseline;gap:6px;font-size:12px;line-height:17px;display:inline-flex}.KFXqYa_bucketCost{align-items:baseline;gap:3px;display:inline-flex}.KFXqYa_bucketOfficial{color:var(--dsw-static-blue-500);font-weight:600}.KFXqYa_bucketSep{color:var(--dsw-alias-label-dimmed)}.KFXqYa_bucketThird{color:var(--dsw-alias-label-secondary)}.KFXqYa_shareDot{border-radius:50%;flex:none;align-self:center;width:8px;height:8px}.KFXqYa_shareValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_budgetInput{width:64px;color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;text-align:right;background:0 0;border:none;padding:0;font-size:12px;line-height:16px}.KFXqYa_budgetInput:focus-visible{outline:none}.KFXqYa_switch{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);cursor:pointer;border-radius:999px;flex:none;width:30px;height:17px;padding:0;transition:background-color .16s,border-color .16s;position:relative}.KFXqYa_switchOn{border-color:var(--dsw-alias-border-l1);background:var(--dsw-alias-label-primary)}.KFXqYa_switchKnob{background:var(--dsw-static-neutral-bluish-00);border-radius:50%;width:11px;height:11px;transition:transform .16s;position:absolute;top:2px;left:2px}.KFXqYa_switchOn .KFXqYa_switchKnob{transform:translate(13px)}.KFXqYa_budgetFillWarn{background:var(--dsw-static-amber-500)}.KFXqYa_budgetFillOver{background:var(--dsw-static-red-500);animation:1.6s ease-in-out infinite KFXqYa_budgetOverPulse}@keyframes KFXqYa_budgetOverPulse{50%{opacity:.55}}.KFXqYa_chartWrap{width:100%;position:relative}.KFXqYa_chartSvg{width:100%;height:auto;display:block}.KFXqYa_chartEmpty{height:140px;color:var(--dsw-alias-label-caption);justify-content:center;align-items:center;font-size:13px;display:flex}.KFXqYa_emptyRow{text-align:center;color:var(--dsw-alias-label-caption);padding:28px 0;font-size:13px}.KFXqYa_chartGrid{stroke:var(--dsw-alias-border-l1);stroke-width:1px}.KFXqYa_chartAxisLabel{fill:var(--dsw-alias-label-tertiary);font-size:10px}.KFXqYa_chartBar{fill:var(--dsw-static-blue-500);opacity:.7}.KFXqYa_chartBar:hover{opacity:1}.KFXqYa_chartStack{stroke:var(--dsw-alias-bg-layer-1);stroke-width:.75px}.KFXqYa_chartStack:hover{opacity:.9}.KFXqYa_chartLine{stroke:var(--dsw-static-blue-500);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.KFXqYa_chartCrosshair{stroke:var(--dsw-alias-label-dimmed);stroke-width:1px;stroke-dasharray:3 3}.KFXqYa_chartTooltip{pointer-events:none;z-index:2;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);box-shadow:none;white-space:nowrap;border-radius:8px;padding:8px 10px;position:absolute;transform:translate(-50%,calc(-100% - 10px))}.KFXqYa_chartTooltipDate{color:var(--dsw-alias-label-primary);margin-bottom:3px;font-size:11px;font-weight:600}.KFXqYa_chartTooltipRow{color:var(--dsw-alias-label-secondary);align-items:center;gap:5px;font-size:11px;line-height:17px;display:flex}.KFXqYa_chartTooltipRow strong{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_chartBarPlaceholder{fill:color-mix(in srgb, var(--dsw-alias-label-secondary) 30%, transparent)}.KFXqYa_chartLegendLine{background:var(--dsw-static-blue-500);border-radius:2px;width:10px;height:3px;display:inline-block}.KFXqYa_chartLegendBar{background:var(--dsw-static-blue-500);opacity:.5;border-radius:2px;width:7px;height:7px;display:inline-block}.KFXqYa_chartTooltipSwatch{border-radius:3px;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_chartLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-end;gap:14px;margin-top:2px;font-size:11px;display:flex}.KFXqYa_chartLegend span{align-items:center;gap:5px;display:inline-flex}.KFXqYa_tableScroll{border:1px solid var(--dsw-alias-border-l1);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:12px;overflow:auto}.KFXqYa_ubAlert{border:1px solid color-mix(in srgb, var(--dsw-static-blue-500) 30%, transparent);background:color-mix(in srgb, var(--dsw-static-blue-500) 8%, transparent);border-radius:10px;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;font-size:12px;line-height:17px;display:flex}.KFXqYa_ubAlertLeft{align-items:center;gap:8px;display:inline-flex}.KFXqYa_ubRate{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_ubAlertNote{color:var(--dsw-alias-label-secondary);margin:0}.KFXqYa_ubTag,.KFXqYa_ubTagSuccess,.KFXqYa_ubTagNeutral,.KFXqYa_ubTagAlert,.KFXqYa_ubTagPromo{white-space:nowrap;border-radius:999px;align-items:center;height:18px;padding:0 7px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_ubTagSuccess{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.KFXqYa_ubTagNeutral{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary)}.KFXqYa_ubTagAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.KFXqYa_ubTagPromo{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500);cursor:help}.KFXqYa_ubExtraRow td{opacity:.72;padding-top:2px;padding-bottom:2px;font-size:12px}.KFXqYa_ubExtraName{color:var(--dsw-alias-label-secondary);margin-left:26px}.KFXqYa_ubExtraNote{color:var(--dsw-alias-label-tertiary);margin-left:8px;font-size:10px}.KFXqYa_ubCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:12px;padding:16px 18px;display:flex}.KFXqYa_ubCardHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.KFXqYa_ubCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_ubCardSub{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_ubTablewrap{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;overflow:auto}.KFXqYa_ubTable{border-collapse:collapse;white-space:nowrap;width:100%;font-size:12.5px}.KFXqYa_ubTable th,.KFXqYa_ubTable td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;padding:9px 12px}.KFXqYa_ubTable tbody tr:last-child td{border-bottom:0}.KFXqYa_ubTable thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;font-size:11px;font-weight:600}.KFXqYa_ubModel{align-items:center;gap:8px;display:inline-flex}.KFXqYa_vendorLogo{object-fit:contain;border-radius:4px;flex:none;width:18px;height:18px}.KFXqYa_vendorLetter{color:#fff;border-radius:4px;flex:none;justify-content:center;align-items:center;width:18px;height:18px;font-size:10px;font-weight:600;line-height:1;display:inline-flex}.KFXqYa_ubModelName{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-weight:500;display:inline-flex}.KFXqYa_ubPricepair{flex-wrap:wrap;gap:6px;display:inline-flex}.KFXqYa_ubChipPeak,.KFXqYa_ubChipOff{font-variant-numeric:tabular-nums;border-radius:999px;align-items:center;gap:5px;height:20px;padding:0 8px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_ubChipLabel{font-size:10px;font-weight:600}.KFXqYa_ubChipPeak{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.KFXqYa_ubChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.KFXqYa_ubNotes{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.KFXqYa_ubNotesItem{align-items:baseline;gap:10px;display:flex}.KFXqYa_ubNotesTerm{color:var(--dsw-alias-label-primary);flex:0 0 72px;font-size:12px;font-weight:500}.KFXqYa_ubNotesDesc{min-width:0;color:var(--dsw-alias-label-secondary);flex:1;font-size:12px;line-height:17px}.KFXqYa_ubCardControlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.KFXqYa_ubTagError{white-space:nowrap;background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);height:18px;color:var(--dsw-static-red-500);border-radius:999px;align-items:center;padding:0 7px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_ubStatGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.KFXqYa_ubStatCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:4px;padding:14px 16px;display:flex}.KFXqYa_ubStatLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_ubStatValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;letter-spacing:-.01em;font-size:22px;font-weight:700;line-height:28px}.KFXqYa_ubStatDetail{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.KFXqYa_rowlist{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.KFXqYa_rowline{width:100%;min-width:0;color:var(--dsw-alias-label-primary);text-align:left;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:10px;justify-content:space-between;align-items:center;gap:12px;padding:9px 12px;transition:background-color .14s,border-color .14s;display:flex}.KFXqYa_rowline:hover{background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 60%, transparent);border-color:var(--dsw-alias-border-l1)}.KFXqYa_rowlineName{min-width:0;color:var(--dsw-alias-label-primary);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:12.5px;font-weight:500;overflow:hidden}.KFXqYa_rowlineRight{font-variant-numeric:tabular-nums;flex:none;align-items:baseline;gap:8px;display:inline-flex}.KFXqYa_rowlineMuted{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_rowlineChev{color:var(--dsw-alias-label-tertiary);font-size:14px}.KFXqYa_rowlineDrillWrap{padding-left:12px}.KFXqYa_rowlineDrill{border-left:1px solid var(--dsw-alias-border-l1);justify-content:space-between;align-items:center;gap:12px;padding:6px 12px;font-size:12px;display:flex}.KFXqYa_modelTable,.KFXqYa_pricingTable{border-collapse:collapse;width:100%;font-size:12.5px}.KFXqYa_modelTable th,.KFXqYa_modelTable td,.KFXqYa_pricingTable th,.KFXqYa_pricingTable td{border-bottom:1px solid var(--dsw-alias-border-l1);text-align:left;white-space:nowrap;padding:9px 12px}.KFXqYa_modelTable tbody tr:last-child td,.KFXqYa_pricingTable tbody tr:last-child td{border-bottom:0}.KFXqYa_modelTable thead th,.KFXqYa_pricingTable thead th{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;letter-spacing:.05em;background:0 0;font-size:11px;font-weight:600}.KFXqYa_modelTable tbody tr,.KFXqYa_pricingTable tbody tr{transition:background-color .12s}.KFXqYa_modelTable tbody tr:hover,.KFXqYa_pricingTable tbody tr:hover{background:0 0}.KFXqYa_numCol{text-align:right;font-variant-numeric:tabular-nums}.KFXqYa_na{color:var(--dsw-alias-label-dimmed)}.KFXqYa_modelCell{align-items:center;gap:8px;display:inline-flex}.KFXqYa_modelDot{border-radius:50%;flex:none;width:9px;height:9px}.KFXqYa_modelName{color:var(--dsw-alias-label-primary);font-weight:500;line-height:16px;display:block}.KFXqYa_modelProvider{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px;display:block}.KFXqYa_pricingToggle:hover .KFXqYa_panelTitle,.KFXqYa_pricingToggle:focus-visible .KFXqYa_panelTitle{color:var(--dsw-alias-label-primary)}.KFXqYa_siteRow{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:10px;justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;display:flex}.KFXqYa_siteRowName{align-items:center;gap:8px;min-width:0;display:inline-flex}.KFXqYa_siteKindTag{white-space:nowrap;border-radius:999px;flex:none;align-items:center;padding:1px 7px;font-size:10.5px;font-weight:600;line-height:16px;display:inline-flex}.KFXqYa_siteKindSite{color:var(--dsw-static-blue-500);background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent)}.KFXqYa_siteKindDirect{color:var(--dsw-static-green-500);background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent)}.KFXqYa_siteKindUnknown{color:var(--dsw-static-red-500);background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent)}.KFXqYa_siteRowTitle{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:600;line-height:18px;overflow:hidden}.KFXqYa_siteRowMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.KFXqYa_siteRowCost{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:12.5px;font-weight:700;line-height:18px}.KFXqYa_siteRowCalls{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;font-size:11.5px;line-height:17px}.KFXqYa_siteRowCallsLow{color:var(--dsw-static-red-500)}.KFXqYa_flatTag{color:var(--dsw-alias-label-caption);font-size:10.5px;line-height:14px}.KFXqYa_healthDot{border-radius:50%;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_healthOk{background:var(--dsw-static-green-500)}.KFXqYa_healthBad{background:var(--dsw-static-red-500)}.KFXqYa_healthIdle{background:var(--dsw-static-neutral-bluish-400)}.KFXqYa_dashboardRight{align-items:center;gap:8px;min-width:0;display:flex}.KFXqYa_healthBadge{white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:3px 9px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_healthBadgeOk{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2)}.KFXqYa_healthBadgeBad{color:var(--dsw-static-red-500);background:var(--dsw-alias-bg-layer-2)}.KFXqYa_planTag{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;align-items:center;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px;display:inline-flex}.KFXqYa_uncataloguedTag{vertical-align:1px;color:var(--dsw-static-amber-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;margin-left:6px;padding:0 6px;font-size:10px;font-weight:600;line-height:16px;display:inline-block}.KFXqYa_estimatedTag{vertical-align:1px;color:var(--dsw-static-blue-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;margin-left:6px;padding:0 6px;font-size:10px;font-weight:600;line-height:16px;display:inline-block}.KFXqYa_feeBar{border:1px solid var(--dsw-alias-border-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}.KFXqYa_feeCount{color:var(--dsw-alias-label-primary);font-weight:600}.KFXqYa_feeSuffix{color:var(--dsw-alias-label-tertiary)}.KFXqYa_feeItem{color:var(--dsw-alias-label-secondary);white-space:nowrap}.KFXqYa_feeNum{color:var(--dsw-alias-label-primary)}.KFXqYa_feeSep{color:var(--dsw-alias-label-tertiary)}.KFXqYa_feeChipPrimary,.KFXqYa_feeChipOff,.KFXqYa_feeChipAlert,.KFXqYa_feeChipError{font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:999px;align-items:center;height:20px;padding:0 8px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_feeChipPrimary{background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, transparent);color:var(--dsw-static-blue-500)}.KFXqYa_feeChipOff{background:color-mix(in srgb, var(--dsw-static-green-500) 14%, transparent);color:var(--dsw-static-green-500)}.KFXqYa_feeChipAlert{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent);color:var(--dsw-static-amber-500)}.KFXqYa_feeChipError{background:color-mix(in srgb, var(--dsw-static-red-500) 14%, transparent);color:var(--dsw-static-red-500)}.KFXqYa_balanceCell{align-items:center;gap:6px;display:inline-flex;position:relative}.KFXqYa_balanceDaysBadge{border:1px solid var(--dsw-alias-label-caption);background:color-mix(in srgb, var(--dsw-alias-label-caption) 10%, transparent);min-width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:12px;justify-content:center;align-items:center;padding:0 6px;font-size:10.5px;font-weight:600;line-height:1;display:inline-flex}.KFXqYa_balanceDaysBadge:hover{border-color:var(--dsw-alias-label-secondary);background:color-mix(in srgb, var(--dsw-alias-label-caption) 18%, transparent)}.KFXqYa_balanceDaysBadgeLow{color:var(--dsw-static-red-500);border-color:var(--dsw-static-red-500);background:color-mix(in srgb, var(--dsw-static-red-500) 10%, transparent)}.KFXqYa_balanceDetailPop{z-index:20;background:var(--dsw-alias-bg-layer-3);border:1px solid var(--dsw-alias-label-caption);white-space:nowrap;border-radius:8px;flex-direction:column;gap:6px;min-width:180px;padding:8px 10px;display:inline-flex;position:absolute;top:calc(100% + 6px);right:0;box-shadow:0 6px 20px #0000002e}.KFXqYa_balanceDetailHead{justify-content:space-between;align-items:center;gap:12px;display:flex}.KFXqYa_balanceDetailTitle{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600}.KFXqYa_balanceDetailClose{cursor:pointer;color:var(--dsw-alias-label-caption);background:0 0;border:none;font-size:14px;line-height:1}.KFXqYa_balanceDetailClose:hover{color:var(--dsw-alias-label-primary)}.KFXqYa_balanceDetailGrid{flex-direction:column;gap:4px;display:inline-flex}.KFXqYa_balanceDetailRow{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;justify-content:space-between;gap:16px;font-size:11px;line-height:15px;display:flex}.KFXqYa_balanceDetailLabel{color:var(--dsw-alias-label-caption)}.KFXqYa_balanceDetailValue{color:var(--dsw-alias-label-primary);font-weight:500}body[data-zine-mode] .KFXqYa_trigger,body[data-zine-mode] .KFXqYa_triggerPop,body[data-zine-mode] .KFXqYa_railButton{display:none}body[data-zine-mode] .KFXqYa_dashboardHead{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .KFXqYa_headTitleRow{align-items:center;gap:8px;margin-top:4px;display:flex}body[data-zine-mode] .KFXqYa_dashboardTitle{color:#e8ff00;letter-spacing:.04em;text-transform:uppercase;text-shadow:0 0 8px #e8ff0066;font-weight:900}body[data-zine-mode] .KFXqYa_dashboardSubtitle{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px}body[data-zine-mode] .KFXqYa_closeButton{color:#0a0a05;background:#ff2d95;border:1.5px solid #ff2d95;border-radius:0;box-shadow:0 0 10px #ff2d9573}body[data-zine-mode] .KFXqYa_hero{background:#000;border:2.5px solid #e8ff00;border-radius:0;position:relative;box-shadow:0 0 0 1px #0009,0 0 24px #e8ff002e}body[data-zine-mode] .KFXqYa_heroLabel{color:#c9d98a;letter-spacing:.12em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .KFXqYa_heroValue{color:#e8ff00;letter-spacing:-.02em;text-shadow:0 0 12px #e8ff0073;-webkit-text-fill-color:#e8ff00;background:0 0;font-size:38px;font-weight:900}body[data-zine-mode] .KFXqYa_heroMeta{color:#c9d98a;letter-spacing:.06em;text-transform:uppercase;font-size:10.5px}body[data-zine-mode] .KFXqYa_heroSideLabel{color:#c9d98a;letter-spacing:.1em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .KFXqYa_heroSideValue{color:#e8ff00;text-shadow:0 0 6px #e8ff0059}body[data-zine-mode] .KFXqYa_delta{font-weight:900}body[data-zine-mode] .KFXqYa_deltaUp{color:#ff2d95}body[data-zine-mode] .KFXqYa_deltaDown{color:#c9d98a}body[data-zine-mode] .KFXqYa_tabNav{background:#000;border-bottom:2px solid #e8ff00}body[data-zine-mode] .KFXqYa_tabButton{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;border-radius:0;font-size:10.5px;font-weight:900}body[data-zine-mode] .KFXqYa_tabButton:hover,body[data-zine-mode] .KFXqYa_tabButton:focus-visible{color:#e8ff00;background:#e8ff001f}body[data-zine-mode] .KFXqYa_tabButtonActive,body[data-zine-mode] .KFXqYa_tabButtonActive:hover,body[data-zine-mode] .KFXqYa_tabButtonActive:focus-visible{color:#0a0a05;background:#e8ff00;box-shadow:0 0 10px #e8ff0073}body[data-zine-mode] .KFXqYa_panel{background:#000;border:2px solid #e8ff00;border-radius:0}body[data-zine-mode] .KFXqYa_trendPanel{position:relative}body[data-zine-mode] .KFXqYa_panelTitle{color:#e8ff00;letter-spacing:.06em;text-transform:uppercase;text-shadow:0 0 6px #e8ff0066;font-weight:900}body[data-zine-mode] .KFXqYa_panelHint{color:#c9d98a;letter-spacing:.08em;text-transform:uppercase;font-size:10px;font-weight:900}body[data-zine-mode] .KFXqYa_modelTableScroll{background:#000;border:1.5px solid #e8ff0080;border-radius:0}.KFXqYa_currencyToggle{background:var(--dsw-alias-bg-layer-3);border:none;border-radius:8px;align-items:center;gap:2px;margin-right:8px;padding:2px;display:inline-flex}.KFXqYa_currencyButton{color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;background:0 0;border:0;border-radius:6px;padding:4px 8px;font-size:11px;font-weight:700;line-height:1}.KFXqYa_currencyButtonActive{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}.KFXqYa_subscriptionGrid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin-top:10px;display:grid}.KFXqYa_subscriptionCard{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 75%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 62%, transparent);-webkit-backdrop-filter:blur(12px)saturate(1.3);border-radius:12px;padding:12px 14px;transition:border-color .2s,box-shadow .2s;position:relative;overflow:hidden;box-shadow:0 8px 24px #0000001a}.KFXqYa_subscriptionCard:before{content:"";background:linear-gradient(90deg, transparent 0%, var(--dsw-static-amber-500) 30%, var(--dsw-alias-label-primary) 50%, var(--dsw-static-amber-500) 70%, transparent 100%);opacity:.9;pointer-events:none;background-size:200% 100%;height:1.5px;animation:3.6s ease-in-out infinite KFXqYa_subscriptionGoldFlow;position:absolute;top:0;left:0;right:0}@keyframes KFXqYa_subscriptionGoldFlow{0%{background-position:200% 0}to{background-position:-200% 0}}.KFXqYa_subscriptionCard:hover{border-color:color-mix(in srgb, var(--dsw-static-amber-500) 55%, var(--dsw-alias-border-l1));box-shadow:0 10px 30px #00000029}.KFXqYa_subscriptionHead{flex-wrap:wrap;align-items:baseline;gap:6px;margin-bottom:8px;display:flex}.KFXqYa_subscriptionName{font-size:13px;font-weight:700}.KFXqYa_subscriptionPlan{color:var(--dsw-alias-label-secondary);font-size:11px}.KFXqYa_subscriptionPlan[data-kind=code],.KFXqYa_subscriptionPlan[data-kind=token]{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-3);border-radius:999px;padding:1px 8px;font-weight:500}.KFXqYa_subscriptionTier{color:var(--dsw-alias-label-secondary);margin-left:6px}.KFXqYa_subscriptionAuto{color:var(--dsw-static-blue-500);background:color-mix(in srgb, var(--dsw-static-blue-500) 14%, var(--dsw-alias-bg-layer-2));border-radius:999px;margin-left:6px;padding:1px 6px;font-size:10px}.KFXqYa_subscriptionStatus{color:var(--dsw-alias-label-secondary);margin-bottom:6px;font-size:11px}.KFXqYa_subscriptionWindow{align-items:center;gap:10px;margin-top:8px;font-size:11px;display:flex}.KFXqYa_subscriptionWindowLabel{color:var(--dsw-alias-label-secondary);flex:0 0 44px}.KFXqYa_subscriptionTrack{background:var(--dsw-alias-bg-layer-3);border-radius:3px;flex:1;height:6px;overflow:hidden}.KFXqYa_subscriptionFill{background:var(--dsw-static-blue-500);border-radius:3px;height:100%;transition:width .2s;display:block}.KFXqYa_subscriptionFillWarn{background:var(--dsw-static-amber-500)}.KFXqYa_subscriptionFillOver{background:var(--dsw-static-red-500)}.KFXqYa_subscriptionMeta{flex-direction:column;flex:none;align-items:flex-end;gap:2px;display:flex}.KFXqYa_subscriptionPct{text-align:right;font-variant-numeric:tabular-nums;flex:none;min-width:52px}.KFXqYa_subscriptionExhausted{color:var(--dsw-static-red-500);min-width:52px;font-weight:600}.KFXqYa_subscriptionReset{color:var(--dsw-alias-label-caption);white-space:nowrap;flex:none;font-size:10px}.KFXqYa_providerGroupList{flex-direction:column;gap:10px;display:flex}.KFXqYa_providerGroup{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;padding:12px 14px}.KFXqYa_providerGroupHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.KFXqYa_providerGroupTitle{align-items:center;gap:7px;min-width:0;display:inline-flex}.KFXqYa_providerGroupName{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px}.KFXqYa_providerGroupMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.KFXqYa_providerGroupBadge{color:var(--dsw-static-green-500);background:var(--dsw-alias-bg-layer-2);border-radius:999px;align-items:center;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px;display:inline-flex}.KFXqYa_providerGroupBalance{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;align-items:baseline;gap:6px;font-size:12px;line-height:17px;display:inline-flex}.KFXqYa_providerGroupBalanceLabel{color:var(--dsw-alias-label-caption);font-size:11px;line-height:17px}.KFXqYa_rounds{margin-top:10px}.KFXqYa_roundsBars{align-items:flex-end;gap:3px;height:124px;padding:16px 2px 0;display:flex;overflow-x:auto}.KFXqYa_roundsBarCol{border-radius:5px 5px 0 0;flex-direction:column;flex:1 0 28px;justify-content:flex-end;align-items:stretch;height:100%;display:flex;position:relative}.KFXqYa_roundsBarColPeak{background:color-mix(in srgb, var(--dsw-static-amber-500) 16%, transparent)}.KFXqYa_roundsBarColOff{background:var(--dsw-alias-bg-module-platform)}.KFXqYa_roundsBarLabel{text-align:center;color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;max-width:100%;font-size:9px;line-height:1.2;position:absolute;bottom:0;left:0;right:0;overflow:hidden;transform:translateY(-100%)}.KFXqYa_roundsBarWrap{flex:1;align-items:flex-end;min-height:0;display:flex}.KFXqYa_roundsBar{background:var(--dsw-static-blue-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.KFXqYa_roundsBarFlagged{background:var(--dsw-static-red-500);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.KFXqYa_roundsFlagMark{background:var(--dsw-static-red-500);border-radius:50%;width:7px;height:7px;position:absolute;top:-3px;right:-3px}.KFXqYa_roundsAxis{color:var(--dsw-alias-label-secondary);justify-content:space-between;margin-top:6px;font-size:10px;display:flex}.KFXqYa_roundsEmpty{color:var(--dsw-alias-label-secondary);margin-top:10px;font-size:12px}.KFXqYa_heatmap{margin-top:10px}.KFXqYa_heatmapGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;display:grid}.KFXqYa_heatmapCellEmpty{background:var(--dsw-alias-bg-layer-1);height:30px;color:var(--dsw-alias-label-dimmed);font-variant-numeric:tabular-nums;border-radius:8px;justify-content:center;align-items:center;font-size:11px;display:flex}.KFXqYa_heatmapCell{font-variant-numeric:tabular-nums;cursor:pointer;border:0;border-radius:8px;justify-content:center;align-items:center;height:30px;padding:0;font-size:11px;display:flex}.KFXqYa_heatmapCell[data-level="0"],.KFXqYa_heatmapCell[data-level="1"],.KFXqYa_heatmapCell[data-level="2"]{color:var(--dsw-alias-label-primary)}.KFXqYa_heatmapCell[data-level="3"],.KFXqYa_heatmapCell[data-level="4"]{color:var(--dsw-static-neutral-bluish-00)}.KFXqYa_heatmapFooter{color:var(--dsw-alias-label-secondary);align-items:center;gap:8px;margin-top:10px;font-size:10px;display:flex}.KFXqYa_heatmapLegend{gap:3px;display:inline-flex}.KFXqYa_heatmapLegend i{border-radius:4px;width:14px;height:14px;display:block}.KFXqYa_heatmapHover{font-variant-numeric:tabular-nums;margin-left:auto}.KFXqYa_heatmapRangeSwitch{gap:4px;margin-left:auto;display:inline-flex}.KFXqYa_heatmapRangeButton{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-text-secondary);cursor:pointer;background:0 0;border-radius:6px;padding:2px 8px;font-size:11px;line-height:1.4}.KFXqYa_heatmapRangeButtonActive{color:var(--dsw-alias-text-primary);border-color:currentColor;font-weight:600}.KFXqYa_heatmapYear{flex-direction:column;gap:6px;display:flex}.KFXqYa_heatmapYearBody{align-items:flex-start;gap:6px;display:flex}.KFXqYa_heatmapYearWeekdays{color:var(--dsw-alias-text-tertiary);flex:none;grid-template-rows:repeat(7,11px);gap:3px;padding-top:12px;font-size:9px;line-height:11px;display:grid}.KFXqYa_heatmapYearWeekday{white-space:nowrap;text-align:right;height:11px}.KFXqYa_heatmapYearMonths{min-width:max-content;color:var(--dsw-alias-text-tertiary);grid-template-columns:repeat(52,11px);gap:3px;font-size:9px;line-height:12px;display:grid;overflow:visible}.KFXqYa_heatmapYearMonth{white-space:nowrap;overflow:visible}.KFXqYa_heatmapYearScroll{padding-bottom:2px;overflow-x:auto}.KFXqYa_heatmapYearGrid{grid-template-rows:repeat(7,11px);grid-auto-flow:column;gap:3px;min-width:max-content;display:grid}.KFXqYa_heatmapYearCell{cursor:pointer;border:0;border-radius:2px;width:11px;height:11px;padding:0}.KFXqYa_triggerPopSubscription{width:auto;left:0;right:0}.KFXqYa_floatSub{flex-direction:column;gap:6px;min-width:0;display:flex}.KFXqYa_floatSubHead{flex-wrap:wrap;align-items:baseline;gap:6px;min-width:0;display:flex}.KFXqYa_floatSubName{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:700}.KFXqYa_floatSubPlan{color:var(--dsw-alias-label-secondary);font-size:10px}.KFXqYa_floatSub .KFXqYa_subscriptionWindow{flex-wrap:wrap;gap:4px 10px}.KFXqYa_floatSub .KFXqYa_subscriptionWindowLabel{flex:none}.KFXqYa_floatSub .KFXqYa_subscriptionMeta{min-width:0;max-width:100%}.KFXqYa_floatSub .KFXqYa_subscriptionPct{min-width:0}.KFXqYa_floatSub .KFXqYa_subscriptionReset{white-space:normal;overflow-wrap:anywhere}.KFXqYa_triggerPopEmpty{color:var(--dsw-alias-label-tertiary);padding:2px 0;font-size:11px;line-height:1.5}.KFXqYa_triggerPopSwitcher{justify-content:flex-end;align-items:center;gap:8px;margin-top:2px;display:flex}.KFXqYa_triggerPopSwitchCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:10px}.KFXqYa_floatModeBtn{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 75%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 60%, transparent);color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;border-radius:10px;flex:1;padding:7px 10px;font-size:12px}.KFXqYa_floatModeBtnOn{border-color:var(--dsw-static-blue-500);color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-static-blue-500) 16%, transparent)}.KFXqYa_floatTarget{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:5px;font-size:12px;display:inline-flex}.KFXqYa_floatTargetLabel{color:var(--dsw-alias-label-secondary)}.KFXqYa_staleNotice{color:var(--dsw-static-amber-500);background:color-mix(in srgb, var(--dsw-static-amber-500) 12%, transparent);border:1px solid color-mix(in srgb, var(--dsw-static-amber-500) 30%, transparent);border-radius:10px;align-items:center;gap:6px;margin:0 0 10px;padding:8px 10px;font-size:11px;display:flex}.KFXqYa_plgHead{align-items:flex-start;gap:12px;display:flex}.KFXqYa_plgIcon{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);width:40px;height:40px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_plgTitle{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_plgNameRow{align-items:center;gap:8px;display:flex}.KFXqYa_plgName{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_plgTag{height:18px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-3);white-space:nowrap;border-radius:5px;align-items:center;padding:0 6px;font-size:10px;font-weight:600;display:inline-flex}.KFXqYa_plgDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.KFXqYa_plgGrid{border-top:1px solid var(--dsw-alias-border-l1);grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding-top:12px;display:grid}.KFXqYa_plgItem{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_plgLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_plgVal{color:var(--dsw-alias-label-primary);word-break:break-all;font-size:12px;line-height:17px}.KFXqYa_plgLink{color:var(--dsw-static-blue-500);word-break:break-all;font-size:12px;line-height:17px;text-decoration:none}.KFXqYa_plgLink:hover{text-decoration:underline}.KFXqYa_tokenPanel{flex-direction:column;gap:14px;display:flex}.KFXqYa_tokenModelBar{background:var(--dsw-alias-bg-layer-2);border-radius:999px;height:8px;overflow:hidden}.KFXqYa_tokenModelParts{height:100%;display:flex}.KFXqYa_tokenModelPartIn{background:var(--dsw-static-blue-500)}.KFXqYa_tokenModelPartOut{background:var(--dsw-static-amber-500)}.KFXqYa_tokenModelShareRow{align-items:center;gap:6px;display:inline-flex}@media (width<=640px){.KFXqYa_kpiGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.KFXqYa_hero{gap:14px}.KFXqYa_heroTop{flex-direction:column;align-items:flex-start;gap:12px}.KFXqYa_heroGauge{width:72px;height:72px}.KFXqYa_heroSide{gap:12px}.KFXqYa_heroSideSpacer{display:none}}.KFXqYa_peakCard{z-index:2000;border:1px solid var(--dsw-alias-border-l1);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 82%, transparent);-webkit-backdrop-filter:blur(12px)saturate(1.2);border-radius:12px;flex-direction:column;gap:8px;min-width:280px;max-width:380px;padding:16px;animation:.2s KFXqYa_peakAlertIn;display:flex;position:fixed;box-shadow:0 4px 16px #00000014}.KFXqYa_peakCardCorner{bottom:18px;right:18px}.KFXqYa_peakCardCenter{top:20%;left:50%;transform:translate(-50%)}.KFXqYa_peakCardPeak{color:var(--dsw-static-blue-500)}.KFXqYa_peakCardOff{color:var(--dsw-static-green-500)}.KFXqYa_peakHead{justify-content:space-between;align-items:center;gap:8px;display:flex}.KFXqYa_peakTag{white-space:nowrap;border-radius:6px;align-items:center;gap:6px;height:20px;padding:0 8px;font-size:11px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_peakTagPrimary{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-blue-500)}.KFXqYa_peakTagSuccess{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-static-green-500)}.KFXqYa_peakDot{border-radius:999px;flex:none;width:6px;height:6px}.KFXqYa_peakDotPrimary{background:var(--dsw-static-blue-500)}.KFXqYa_peakDotSuccess{background:var(--dsw-static-green-500)}.KFXqYa_peakClose{width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;font-size:15px;line-height:1;transition:background-color .14s,color .14s;display:inline-flex}.KFXqYa_peakClose:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2)}.KFXqYa_peakCount{font-variant-numeric:tabular-nums;font-size:28px;font-weight:700;line-height:34px}.KFXqYa_peakCountPrimary{color:var(--dsw-static-blue-500)}.KFXqYa_peakCountSuccess{color:var(--dsw-static-green-500)}.KFXqYa_peakDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:18px}@keyframes KFXqYa_peakAlertIn{0%{opacity:0}to{opacity:1}}.KFXqYa_setCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:12px;flex-direction:column;gap:12px;padding:16px 18px;display:flex}.KFXqYa_setCardHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.KFXqYa_setCardMeta{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_setCardTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_setCardDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.KFXqYa_ctlCol{flex-direction:column;gap:10px;padding-top:2px;display:flex}.KFXqYa_ctlRow{align-items:center;gap:12px;min-height:28px;display:flex}.KFXqYa_ctlRowStretch{display:flex}.KFXqYa_ctlLabel{color:var(--dsw-alias-label-secondary);flex:0 0 96px;font-size:11px;line-height:16px}.KFXqYa_ctlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.KFXqYa_rdo{color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;align-items:center;gap:6px;font-size:12px;line-height:16px;display:inline-flex}.KFXqYa_rdo input{opacity:0;pointer-events:none;position:absolute}.KFXqYa_rdoDot{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:50%;flex:none;width:14px;height:14px;position:relative}.KFXqYa_rdo input:checked+.KFXqYa_rdoDot{border-color:var(--dsw-static-blue-500)}.KFXqYa_rdo input:checked+.KFXqYa_rdoDot:after{content:"";background:var(--dsw-static-blue-500);border-radius:50%;position:absolute;inset:3px}.KFXqYa_inp{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:6px;align-items:center;gap:4px;padding:2px 6px;display:inline-flex}.KFXqYa_affix{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.KFXqYa_prog{background:var(--dsw-alias-bg-module-platform);border-radius:999px;flex:1;min-width:0;height:6px;overflow:hidden}.KFXqYa_progFill{background:var(--dsw-static-blue-500);border-radius:999px;height:100%;transition:width .2s}.KFXqYa_btn{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;border-radius:999px;align-items:center;gap:6px;padding:0 12px;font-size:12px;line-height:16px;transition:border-color .16s,color .16s,background-color .16s;display:inline-flex}.KFXqYa_btn:hover{border-color:var(--dsw-static-blue-500);color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-static-blue-500) 12%, var(--dsw-alias-bg-layer-1))}`,document.head.appendChild(e)}var x={chartLegendLine:`KFXqYa_chartLegendLine`,providerGroupList:`KFXqYa_providerGroupList`,heatmapYearMonths:`KFXqYa_heatmapYearMonths`,heatmapYearMonth:`KFXqYa_heatmapYearMonth`,tabButtonActive:`KFXqYa_tabButtonActive`,triggerSparkHot:`KFXqYa_triggerSparkHot`,vendorLetter:`KFXqYa_vendorLetter`,ubTagError:`KFXqYa_ubTagError`,shareValue:`KFXqYa_shareValue`,heroMain:`KFXqYa_heroMain`,subscriptionHead:`KFXqYa_subscriptionHead`,providerGroupBalance:`KFXqYa_providerGroupBalance`,heatmapYearWeekdays:`KFXqYa_heatmapYearWeekdays`,ubStatValue:`KFXqYa_ubStatValue`,heroBudget:`KFXqYa_heroBudget`,popModelStatusLow:`KFXqYa_popModelStatusLow`,siteRowCost:`KFXqYa_siteRowCost`,railButton:`KFXqYa_railButton`,heatmapLegend:`KFXqYa_heatmapLegend`,popDot:`KFXqYa_popDot`,siteRowCallsLow:`KFXqYa_siteRowCallsLow`,ctlGroup:`KFXqYa_ctlGroup`,exportBar:`KFXqYa_exportBar`,peakCard:`KFXqYa_peakCard`,peakCardOff:`KFXqYa_peakCardOff`,heroReadout:`KFXqYa_heroReadout`,heroMeta:`KFXqYa_heroMeta`,ubModelName:`KFXqYa_ubModelName`,roundsFlagMark:`KFXqYa_roundsFlagMark`,chartTooltipSwatch:`KFXqYa_chartTooltipSwatch`,peakCardCenter:`KFXqYa_peakCardCenter`,tabPanelIn:`KFXqYa_tabPanelIn`,peakCountSuccess:`KFXqYa_peakCountSuccess`,budgetInput:`KFXqYa_budgetInput`,floatTarget:`KFXqYa_floatTarget`,providerGroupBadge:`KFXqYa_providerGroupBadge`,peakDot:`KFXqYa_peakDot`,heroSideLabel:`KFXqYa_heroSideLabel`,bucketOfficial:`KFXqYa_bucketOfficial`,rowline:`KFXqYa_rowline`,feeBar:`KFXqYa_feeBar`,heroBudgetValue:`KFXqYa_heroBudgetValue`,subscriptionGoldFlow:`KFXqYa_subscriptionGoldFlow`,feeCount:`KFXqYa_feeCount`,balanceDetailGrid:`KFXqYa_balanceDetailGrid`,providerGroupMeta:`KFXqYa_providerGroupMeta`,flatTag:`KFXqYa_flatTag`,peakTag:`KFXqYa_peakTag`,ubStatGrid:`KFXqYa_ubStatGrid`,providerGroup:`KFXqYa_providerGroup`,ctlLabel:`KFXqYa_ctlLabel`,shareSegPeak:`KFXqYa_shareSegPeak`,ubCardTitle:`KFXqYa_ubCardTitle`,subscriptionFillOver:`KFXqYa_subscriptionFillOver`,tokenModelPartIn:`KFXqYa_tokenModelPartIn`,triggerLabel:`KFXqYa_triggerLabel`,dashboardTitle:`KFXqYa_dashboardTitle`,shareSeg:`KFXqYa_shareSeg`,healthBadgeOk:`KFXqYa_healthBadgeOk`,uncataloguedTag:`KFXqYa_uncataloguedTag`,triggerMain:`KFXqYa_triggerMain`,feeSuffix:`KFXqYa_feeSuffix`,balanceCell:`KFXqYa_balanceCell`,balanceDetailValue:`KFXqYa_balanceDetailValue`,currencyButton:`KFXqYa_currencyButton`,popDotDirect:`KFXqYa_popDotDirect`,roundsBarColPeak:`KFXqYa_roundsBarColPeak`,subscriptionName:`KFXqYa_subscriptionName`,floatSubPlan:`KFXqYa_floatSubPlan`,triggerSub:`KFXqYa_triggerSub`,chartAxisLabel:`KFXqYa_chartAxisLabel`,plgItem:`KFXqYa_plgItem`,peakAlertIn:`KFXqYa_peakAlertIn`,setCardMeta:`KFXqYa_setCardMeta`,setCardTitle:`KFXqYa_setCardTitle`,balanceDetailHead:`KFXqYa_balanceDetailHead`,ubNotes:`KFXqYa_ubNotes`,heatmapYear:`KFXqYa_heatmapYear`,ubChipLabel:`KFXqYa_ubChipLabel`,heatmapYearScroll:`KFXqYa_heatmapYearScroll`,popHead:`KFXqYa_popHead`,chartTooltipRow:`KFXqYa_chartTooltipRow`,popDotNeutral:`KFXqYa_popDotNeutral`,heroGaugeArc:`KFXqYa_heroGaugeArc`,na:`KFXqYa_na`,heroGaugeSvg:`KFXqYa_heroGaugeSvg`,metricValuePrimary:`KFXqYa_metricValuePrimary`,ubTagSuccess:`KFXqYa_ubTagSuccess`,ubAlertLeft:`KFXqYa_ubAlertLeft`,popModelName:`KFXqYa_popModelName`,deltaDown:`KFXqYa_deltaDown`,plgTitle:`KFXqYa_plgTitle`,subscriptionTrack:`KFXqYa_subscriptionTrack`,kpiGreen:`KFXqYa_kpiGreen`,ubChipOff:`KFXqYa_ubChipOff`,chartLegendBar:`KFXqYa_chartLegendBar`,dashboardRight:`KFXqYa_dashboardRight`,chartStack:`KFXqYa_chartStack`,shareTrack:`KFXqYa_shareTrack`,feeSep:`KFXqYa_feeSep`,healthDot:`KFXqYa_healthDot`,ubChipPeak:`KFXqYa_ubChipPeak`,providerGroupBalanceLabel:`KFXqYa_providerGroupBalanceLabel`,rowlineMuted:`KFXqYa_rowlineMuted`,modelCell:`KFXqYa_modelCell`,feeChipOff:`KFXqYa_feeChipOff`,floatModeBtnOn:`KFXqYa_floatModeBtnOn`,ubNotesTerm:`KFXqYa_ubNotesTerm`,healthOk:`KFXqYa_healthOk`,chartCrosshair:`KFXqYa_chartCrosshair`,siteRowTitle:`KFXqYa_siteRowTitle`,metricCell:`KFXqYa_metricCell`,trendPanel:`KFXqYa_trendPanel`,subscriptionCard:`KFXqYa_subscriptionCard`,modelDot:`KFXqYa_modelDot`,heroSideValue:`KFXqYa_heroSideValue`,roundsBarLabel:`KFXqYa_roundsBarLabel`,balanceDetailPop:`KFXqYa_balanceDetailPop`,subscriptionFillWarn:`KFXqYa_subscriptionFillWarn`,budgetFillOver:`KFXqYa_budgetFillOver`,reconcileText:`KFXqYa_reconcileText`,kpiGrid:`KFXqYa_kpiGrid`,dashboardModal:`KFXqYa_dashboardModal`,deltaUp:`KFXqYa_deltaUp`,ubCardControlGroup:`KFXqYa_ubCardControlGroup`,feeChipAlert:`KFXqYa_feeChipAlert`,heroGaugeArcOver:`KFXqYa_heroGaugeArcOver`,metricValue:`KFXqYa_metricValue`,shareLegend:`KFXqYa_shareLegend`,metricGrid:`KFXqYa_metricGrid`,panel:`KFXqYa_panel`,rowlineRight:`KFXqYa_rowlineRight`,roundsBarWrap:`KFXqYa_roundsBarWrap`,unpricedHint:`KFXqYa_unpricedHint`,subscriptionPct:`KFXqYa_subscriptionPct`,heroGaugePctOver:`KFXqYa_heroGaugePctOver`,ubCard:`KFXqYa_ubCard`,roundsEmpty:`KFXqYa_roundsEmpty`,bucketSep:`KFXqYa_bucketSep`,currencyToggle:`KFXqYa_currencyToggle`,ubExtraName:`KFXqYa_ubExtraName`,heroBudgetTrack:`KFXqYa_heroBudgetTrack`,"billing-trigger":`KFXqYa_billing-trigger`,ctlRow:`KFXqYa_ctlRow`,peakTagPrimary:`KFXqYa_peakTagPrimary`,heatmapCellEmpty:`KFXqYa_heatmapCellEmpty`,heatmapCell:`KFXqYa_heatmapCell`,popTitle:`KFXqYa_popTitle`,dashboardBody:`KFXqYa_dashboardBody`,heroGaugePct:`KFXqYa_heroGaugePct`,bucketThird:`KFXqYa_bucketThird`,floatSubName:`KFXqYa_floatSubName`,switchOn:`KFXqYa_switchOn`,ctlRowStretch:`KFXqYa_ctlRowStretch`,delta:`KFXqYa_delta`,popTagPrimary:`KFXqYa_popTagPrimary`,tabNav:`KFXqYa_tabNav`,reconcileDismiss:`KFXqYa_reconcileDismiss`,heroBudgetLabel:`KFXqYa_heroBudgetLabel`,ubRate:`KFXqYa_ubRate`,ubNotesItem:`KFXqYa_ubNotesItem`,ubStatLabel:`KFXqYa_ubStatLabel`,balanceDetailClose:`KFXqYa_balanceDetailClose`,heatmap:`KFXqYa_heatmap`,heatmapGrid:`KFXqYa_heatmapGrid`,heatmapYearCell:`KFXqYa_heatmapYearCell`,floatTargetLabel:`KFXqYa_floatTargetLabel`,shareItem:`KFXqYa_shareItem`,plgGrid:`KFXqYa_plgGrid`,peakHead:`KFXqYa_peakHead`,shareSegTool:`KFXqYa_shareSegTool`,metricValueSuccess:`KFXqYa_metricValueSuccess`,dashboardIn:`KFXqYa_dashboardIn`,heatmapYearGrid:`KFXqYa_heatmapYearGrid`,plgIcon:`KFXqYa_plgIcon`,triggerPopEmpty:`KFXqYa_triggerPopEmpty`,estimatedTag:`KFXqYa_estimatedTag`,kpiLabel:`KFXqYa_kpiLabel`,ubTagNeutral:`KFXqYa_ubTagNeutral`,siteKindSite:`KFXqYa_siteKindSite`,heatmapRangeSwitch:`KFXqYa_heatmapRangeSwitch`,rangeToggle:`KFXqYa_rangeToggle`,modelProvider:`KFXqYa_modelProvider`,heatmapRangeButton:`KFXqYa_heatmapRangeButton`,subscriptionWindow:`KFXqYa_subscriptionWindow`,chartTooltip:`KFXqYa_chartTooltip`,floatSub:`KFXqYa_floatSub`,ubCardHead:`KFXqYa_ubCardHead`,roundsBarColOff:`KFXqYa_roundsBarColOff`,floatSubHead:`KFXqYa_floatSubHead`,popTagSub:`KFXqYa_popTagSub`,closeButton:`KFXqYa_closeButton`,roundsAxis:`KFXqYa_roundsAxis`,ubNotesDesc:`KFXqYa_ubNotesDesc`,plgTag:`KFXqYa_plgTag`,ubTag:`KFXqYa_ubTag`,siteRowName:`KFXqYa_siteRowName`,feeItem:`KFXqYa_feeItem`,tabPanel:`KFXqYa_tabPanel`,peakCountPrimary:`KFXqYa_peakCountPrimary`,ctlCol:`KFXqYa_ctlCol`,affix:`KFXqYa_affix`,ubModel:`KFXqYa_ubModel`,ubPricepair:`KFXqYa_ubPricepair`,exportButton:`KFXqYa_exportButton`,modelTable:`KFXqYa_modelTable`,chartWrap:`KFXqYa_chartWrap`,siteRowMeta:`KFXqYa_siteRowMeta`,emptyRow:`KFXqYa_emptyRow`,subscriptionMeta:`KFXqYa_subscriptionMeta`,triggerSparkBar:`KFXqYa_triggerSparkBar`,heatmapFooter:`KFXqYa_heatmapFooter`,chartBar:`KFXqYa_chartBar`,headTitleRow:`KFXqYa_headTitleRow`,bucketCost:`KFXqYa_bucketCost`,reconcileNotice:`KFXqYa_reconcileNotice`,heroBudgetFill:`KFXqYa_heroBudgetFill`,shareSegOff:`KFXqYa_shareSegOff`,subscriptionExhausted:`KFXqYa_subscriptionExhausted`,popModel:`KFXqYa_popModel`,tokenModelPartOut:`KFXqYa_tokenModelPartOut`,subscriptionFill:`KFXqYa_subscriptionFill`,rdoDot:`KFXqYa_rdoDot`,subscriptionWindowLabel:`KFXqYa_subscriptionWindowLabel`,currencyButtonActive:`KFXqYa_currencyButtonActive`,tokenPanel:`KFXqYa_tokenPanel`,peakCardPeak:`KFXqYa_peakCardPeak`,pricingTable:`KFXqYa_pricingTable`,balanceDetailLabel:`KFXqYa_balanceDetailLabel`,triggerMetric:`KFXqYa_triggerMetric`,rowlineDrillWrap:`KFXqYa_rowlineDrillWrap`,panelTitle:`KFXqYa_panelTitle`,trigger:`KFXqYa_trigger`,heroLabel:`KFXqYa_heroLabel`,kpiValue:`KFXqYa_kpiValue`,triggerPopSwitcher:`KFXqYa_triggerPopSwitcher`,plgName:`KFXqYa_plgName`,feeChipPrimary:`KFXqYa_feeChipPrimary`,ubExtraNote:`KFXqYa_ubExtraNote`,popModelRow:`KFXqYa_popModelRow`,siteRowCalls:`KFXqYa_siteRowCalls`,roundsBar:`KFXqYa_roundsBar`,peakTagSuccess:`KFXqYa_peakTagSuccess`,switchKnob:`KFXqYa_switchKnob`,rowlineDrill:`KFXqYa_rowlineDrill`,exportLabel:`KFXqYa_exportLabel`,heroGauge:`KFXqYa_heroGauge`,plgLabel:`KFXqYa_plgLabel`,providerGroupName:`KFXqYa_providerGroupName`,rowlineChev:`KFXqYa_rowlineChev`,triggerPopSubscription:`KFXqYa_triggerPopSubscription`,peakDotPrimary:`KFXqYa_peakDotPrimary`,heroSideSpacer:`KFXqYa_heroSideSpacer`,budgetFillWarn:`KFXqYa_budgetFillWarn`,balanceDaysBadgeLow:`KFXqYa_balanceDaysBadgeLow`,panelHint:`KFXqYa_panelHint`,setCardDesc:`KFXqYa_setCardDesc`,planTag:`KFXqYa_planTag`,subscriptionStatus:`KFXqYa_subscriptionStatus`,progFill:`KFXqYa_progFill`,chartGrid:`KFXqYa_chartGrid`,ubTablewrap:`KFXqYa_ubTablewrap`,siteKindDirect:`KFXqYa_siteKindDirect`,floatModeBtn:`KFXqYa_floatModeBtn`,switch:`KFXqYa_switch`,rangeButton:`KFXqYa_rangeButton`,providerGroupTitle:`KFXqYa_providerGroupTitle`,peakCardCorner:`KFXqYa_peakCardCorner`,balanceDaysBadge:`KFXqYa_balanceDaysBadge`,heroSide:`KFXqYa_heroSide`,heroSideItem:`KFXqYa_heroSideItem`,siteKindUnknown:`KFXqYa_siteKindUnknown`,panelHead:`KFXqYa_panelHead`,chartLine:`KFXqYa_chartLine`,plgLink:`KFXqYa_plgLink`,kpiDetail:`KFXqYa_kpiDetail`,triggerPop:`KFXqYa_triggerPop`,peakDotSuccess:`KFXqYa_peakDotSuccess`,siteKindTag:`KFXqYa_siteKindTag`,modalFooter:`KFXqYa_modalFooter`,popModelLabel:`KFXqYa_popModelLabel`,chartLegend:`KFXqYa_chartLegend`,heroGaugeTrack:`KFXqYa_heroGaugeTrack`,subscriptionTier:`KFXqYa_subscriptionTier`,modelTableScroll:`KFXqYa_modelTableScroll`,healthBadgeBad:`KFXqYa_healthBadgeBad`,chartSvg:`KFXqYa_chartSvg`,setCard:`KFXqYa_setCard`,chartBarPlaceholder:`KFXqYa_chartBarPlaceholder`,heroTop:`KFXqYa_heroTop`,tokenModelParts:`KFXqYa_tokenModelParts`,popModelStatus:`KFXqYa_popModelStatus`,chartTooltipDate:`KFXqYa_chartTooltipDate`,rowlist:`KFXqYa_rowlist`,peakClose:`KFXqYa_peakClose`,peakDesc:`KFXqYa_peakDesc`,shareDot:`KFXqYa_shareDot`,tokenModelShareRow:`KFXqYa_tokenModelShareRow`,prog:`KFXqYa_prog`,heroCurrency:`KFXqYa_heroCurrency`,roundsBarFlagged:`KFXqYa_roundsBarFlagged`,plgHead:`KFXqYa_plgHead`,btn:`KFXqYa_btn`,healthIdle:`KFXqYa_healthIdle`,ubStatDetail:`KFXqYa_ubStatDetail`,triggerYen:`KFXqYa_triggerYen`,subscriptionAuto:`KFXqYa_subscriptionAuto`,plgVal:`KFXqYa_plgVal`,subscriptionGrid:`KFXqYa_subscriptionGrid`,subscriptionReset:`KFXqYa_subscriptionReset`,providerGroupHead:`KFXqYa_providerGroupHead`,setCardHead:`KFXqYa_setCardHead`,ubTagPromo:`KFXqYa_ubTagPromo`,roundsBars:`KFXqYa_roundsBars`,plgDesc:`KFXqYa_plgDesc`,heatmapHover:`KFXqYa_heatmapHover`,modelName:`KFXqYa_modelName`,subscriptionPlan:`KFXqYa_subscriptionPlan`,dashboard:`KFXqYa_dashboard`,dashboardSubtitle:`KFXqYa_dashboardSubtitle`,shareSegAssistant:`KFXqYa_shareSegAssistant`,healthBad:`KFXqYa_healthBad`,dashboardHead:`KFXqYa_dashboardHead`,balanceDetailRow:`KFXqYa_balanceDetailRow`,heroGaugeCenter:`KFXqYa_heroGaugeCenter`,plgNameRow:`KFXqYa_plgNameRow`,peakCount:`KFXqYa_peakCount`,triggerSpark:`KFXqYa_triggerSpark`,triggerWrap:`KFXqYa_triggerWrap`,heatmapRangeButtonActive:`KFXqYa_heatmapRangeButtonActive`,heatmapYearWeekday:`KFXqYa_heatmapYearWeekday`,ubAlertNote:`KFXqYa_ubAlertNote`,siteRow:`KFXqYa_siteRow`,rdo:`KFXqYa_rdo`,heroBudgetFillOver:`KFXqYa_heroBudgetFillOver`,tableScroll:`KFXqYa_tableScroll`,chartEmpty:`KFXqYa_chartEmpty`,ubAlert:`KFXqYa_ubAlert`,triggerPrimary:`KFXqYa_triggerPrimary`,pricingToggle:`KFXqYa_pricingToggle`,tokenModelBar:`KFXqYa_tokenModelBar`,rowlineName:`KFXqYa_rowlineName`,popDotSub:`KFXqYa_popDotSub`,shareSegUser:`KFXqYa_shareSegUser`,triggerIcon:`KFXqYa_triggerIcon`,feeNum:`KFXqYa_feeNum`,hero:`KFXqYa_hero`,roundsBarCol:`KFXqYa_roundsBarCol`,heroGaugeLabel:`KFXqYa_heroGaugeLabel`,vendorLogo:`KFXqYa_vendorLogo`,feeChipError:`KFXqYa_feeChipError`,heroValue:`KFXqYa_heroValue`,healthBadge:`KFXqYa_healthBadge`,budgetOverPulse:`KFXqYa_budgetOverPulse`,metricLabel:`KFXqYa_metricLabel`,ubTagAlert:`KFXqYa_ubTagAlert`,tabButton:`KFXqYa_tabButton`,ubCardSub:`KFXqYa_ubCardSub`,balanceDetailTitle:`KFXqYa_balanceDetailTitle`,rounds:`KFXqYa_rounds`,triggerPopSwitchCount:`KFXqYa_triggerPopSwitchCount`,reconcileIcon:`KFXqYa_reconcileIcon`,rangeButtonActive:`KFXqYa_rangeButtonActive`,heatmapYearBody:`KFXqYa_heatmapYearBody`,inp:`KFXqYa_inp`,staleNotice:`KFXqYa_staleNotice`,ubExtraRow:`KFXqYa_ubExtraRow`,numCol:`KFXqYa_numCol`,ubTable:`KFXqYa_ubTable`,ubStatCard:`KFXqYa_ubStatCard`,kpiTile:`KFXqYa_kpiTile`};let ee={"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`}},S={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 C(e){return e===``?e:S[e]??e}function te(e){let t=ee[C(e)];return t?.type===`code`?t.tier:void 0}let w=[{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,ne,E,re,ie;function ae(e){ie=Object.keys(e).length>0?e:void 0}function oe(){return ie}function D(e){if(ie===void 0)return;let t=F(e),n=ie[t];if(n!==void 0)return n;let r=N(t);return r===``?void 0:ie[r]}function se(e){T=typeof e.rate==`number`&&Number.isFinite(e.rate)&&e.rate>0?e.rate:void 0,ne=e.prices,E=e.extraModels}function O(e){re=e}function k(){return T??6.79}function ce(){return{rate:k(),live:T!==void 0}}function le(e){return e>=9&&e<12||e>=14&&e<18}function A(e){return e==null||!Number.isFinite(e)?`peak`:ue(e)?`offPeak`:le((new Date(e).getUTCHours()+8)%24)?`peak`:`offPeak`}function ue(e){let t=new Date(e+8*36e5).getUTCDay();return t===0||t===6}function de(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 fe=[540,720,840,1080];function pe(e){return((e+8*36e5)%864e5+864e5)%864e5}function me(e){if(ue(e))return{tier:`offPeak`,nextSwitchInMs:de(e)};let t=pe(e);for(let n of fe){let r=n*6e4;if(t<r)return{tier:A(e),nextSwitchInMs:r-t}}let n=fe[0]??0;return{tier:A(e),nextSwitchInMs:864e5-t+n*6e4}}function he(e,t){let{nextSwitchInMs:n}=me(e);if(n>t)return null;let r=e+n;return{entering:A(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}}],ge={"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(ge))t(e,n);for(let e of w)t(e.key,e.key);return e})();function F(e){let t=ge[e]??e;if(t===e){let t=N(e);if(t!==``){let e=P.get(t);if(e!==void 0)return e;let n=(E??[]).find(e=>N(e.key)===t);if(n!==void 0)return n.key}}return t}function I(e){let t=F(e),n=ne?.[t];if(n!==void 0)return n;let r=w.find(e=>e.key.toLowerCase()===t.toLowerCase());if(r!==void 0)return{input:r.input,cacheHit:r.cacheHit,output:r.output}}function _e(e){let t=F(e),n=M.find(e=>e.key===t),r=E?.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=D(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 ve(e,t){let n=e.endsAtMs!==void 0&&t>=e.endsAtMs;return Number.isFinite(t)&&!n&&e.factor>0&&e.factor<1}function ye(e,t){let{promo:n}=e;if(n===void 0||!ve(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 be(e=Date.now()){let t=[...M.map(t=>ye(t,e))],n=new Set(t.map(e=>e.key.toLowerCase())),r=new Set(t.map(e=>N(e.key)));for(let e of re??[]){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=(E??[]).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=D(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 xe(e){let t=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return t===``?`#8b95a3`:t}function R(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*k():a}function Se(e,t,n=.5,r=Date.now()){let i=ye(e,r),a=R(i.price,t,i.price.currency),o=i.price.offPeak===void 0?a:R(i.price.offPeak,t,i.price.currency);return a*n+o*(1-n)}function z(e){let t=k();return t>0?e/t:e}function B(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 Ce(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 we(e,t,n,r){return r<=0||!Number.isFinite(r)||t===(n===`usd`?`USD`:`CNY`)?e:n===`usd`?e/r:e*r}function V(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 Te(e){let t=Number(e);return Number.isFinite(t)?`${t.toFixed(1)}%`:`0.0%`}let H={top:18,right:40,bottom:26,left:46};function Ee(e){let[,t,n]=e.split(`-`);return`${Number(t)}/${Number(n)}`}function U(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}function W(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 De={key:`__total__`,name:`总计`,color:``};function Oe({data:e,models:t=[],currency:n=`cny`,metric:i=`cost`}){let[o,s]=(0,r.useState)(null),c=e=>B(n===`usd`?z(e):e,n),l=e=>i===`tokens`?U(e):c(e),u=e=>i===`tokens`?e.tokens??0:e.cost,d=(0,r.useMemo)(()=>{let n=e.length;if(n===0)return null;let r=680-H.left-H.right,a=220-H.top-H.bottom,o=e=>n===1?H.left+r/2:H.left+r*e/(n-1),s=Math.max(...i===`tokens`?e.map(e=>e.tokens??0):e.map(e=>Math.max(e.cost,Object.values(e.byModel??{}).reduce((e,t)=>e+t,0))),1e-4),c=e=>H.top+a-e/s*a,l=Math.max(...e.map(e=>e.calls),1),d=e=>H.top+a-e/l*a,f=r/n,p=Math.min(18,f*.6);return{n,plotW:r,plotH:a,inner:o,yCost:c,yCalls:d,barW:p,bars:e.flatMap((e,n)=>{let r=o(n)-p/2;if(t.length===0||i===`tokens`)return[{date:e.date,model:De,x:r,base:0,value:u(e),topRounded:!0}];let a=null;for(let n of t)(e.byModel?.[n.key]??0)>0&&(a=n.key);let s=0;return t.map(t=>{let n=e.byModel?.[t.key]??0,i={date:e.date,model:t,x:r,base:s,value:n,topRounded:t.key===a};return s+=n,i})}),costTicks:[0,.25,.5,.75,1].map(e=>s*e).reverse(),callsTicks:[0,.25,.5,.75,1].map(e=>l*e).reverse(),linePath:e.map((e,t)=>{let n=d(e.calls);return`${t===0?`M`:`L`}${o(t)} ${n}`}).join(` `)}},[e,t,i]);if(d===null)return(0,a.jsx)(`div`,{className:x.chartEmpty,children:`暂无趋势数据`});let{n:f,plotW:p,plotH:m,inner:h,yCost:g,yCalls:_,barW:v,bars:y,costTicks:b,callsTicks:ee,linePath:S}=d,C=o===null?void 0:e[o],te=W(f,Math.max(1,Math.ceil(f/8)));return(0,a.jsxs)(`div`,{className:x.chartWrap,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 220`,className:x.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-H.left)/p,r=Math.round(n*(f-1));s(Math.min(Math.max(r,0),f-1))},children:[b.map((e,t)=>{let n=g(e);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:H.left,x2:680-H.right,y1:n,y2:n,className:x.chartGrid}),(0,a.jsx)(`text`,{x:H.left-8,y:n+3,textAnchor:`end`,className:x.chartAxisLabel,children:l(e)})]},`cost-${t}`)}),y.map(t=>{if(t.value>0)return(0,a.jsx)(`rect`,{x:t.x,y:g(t.base+t.value),width:v,height:g(t.base)-g(t.base+t.value),rx:t.topRounded?2:0,className:t.model.color===``?x.chartBar:x.chartStack,style:t.model.color===``?void 0:{fill:t.model.color}},`${t.date}-${t.model.key}`);let n=e.find(e=>e.date===t.date);return n!==void 0&&n.calls>0&&t.base===0?(0,a.jsx)(`rect`,{x:t.x,y:g(0)-1,width:v,height:1,rx:0,className:x.chartBarPlaceholder},`${t.date}-${t.model.key}-placeholder`):null}),(0,a.jsx)(`path`,{d:S,fill:`none`,className:x.chartLine}),ee.map((e,t)=>{let n=_(e);return(0,a.jsx)(`text`,{x:680-H.right+8,y:n+3,textAnchor:`start`,className:x.chartAxisLabel,children:U(e)},`calls-${t}`)}),te.map(t=>{let n=e[t];return n===void 0?null:(0,a.jsx)(`text`,{x:h(t),y:214,textAnchor:`middle`,className:x.chartAxisLabel,children:Ee(n.date)},n.date)}),o!==null&&(0,a.jsx)(`line`,{x1:h(o),x2:h(o),y1:H.top,y2:H.top+m,className:x.chartCrosshair})]}),C!==void 0&&o!==null&&(0,a.jsxs)(`div`,{className:x.chartTooltip,style:{left:`${h(o)/680*100}%`,top:`${g(C.cost)/220*100}%`},children:[(0,a.jsx)(`div`,{className:x.chartTooltipDate,children:C.date}),i!==`tokens`&&t.filter(e=>(C.byModel?.[e.key]??0)>0).map(e=>(0,a.jsxs)(`div`,{className:x.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:x.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,a.jsx)(`strong`,{children:c(C.byModel?.[e.key]??0)})]},e.key)),(0,a.jsxs)(`div`,{className:x.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:x.chartLegendBar}),`总计 `,(0,a.jsx)(`strong`,{children:i===`tokens`?U(C.tokens??0):c(C.cost)})]}),(0,a.jsxs)(`div`,{className:x.chartTooltipRow,children:[(0,a.jsx)(`span`,{className:x.chartLegendLine}),`调用 `,(0,a.jsx)(`strong`,{children:C.calls.toLocaleString()})]})]}),t.length>0&&i!==`tokens`&&(0,a.jsxs)(`div`,{className:x.chartLegend,children:[t.map(e=>(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:x.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key)),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:x.chartLegendLine}),`调用`]})]})]})}let G={top:14,right:42,bottom:22,left:46};function ke(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 Ae(e){return e.slice(5,13).replace(`T`,` `)}function je({perf:e,models:t,t:n}){let i=e=>t.find(t=>t.key===e)?.color??`#8b95a3`,o=(0,r.useMemo)(()=>e===void 0?[]:Object.entries(e.byModel).map(([e,n])=>({key:e,name:t.find(t=>t.key===e)?.name??e,color:i(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,r.useMemo)(()=>{let t=e===void 0?[]:ke(e.byHour);if(t.length===0)return null;let n=t.length,r=680-G.left-G.right,i=180-G.top-G.bottom,a=e=>n===1?G.left+r/2:G.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=>G.top+i-e/o*i,l=e=>G.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,a.jsx)(`div`,{className:x.chartEmpty,"data-testid":`billing-perf-empty`,children:n(`billing.perfEmpty`)}):(0,a.jsxs)(`div`,{"data-testid":`billing-perf-panel`,children:[(0,a.jsx)(`div`,{className:x.tableScroll,"data-testid":`billing-perf-table`,children:(0,a.jsxs)(`table`,{className:x.modelTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:n(`billing.model`)}),(0,a.jsx)(`th`,{className:x.numCol,children:n(`billing.perfSamples`)}),(0,a.jsx)(`th`,{className:x.numCol,children:n(`billing.perfTtft`)}),(0,a.jsx)(`th`,{className:x.numCol,children:n(`billing.perfP50`)}),(0,a.jsx)(`th`,{className:x.numCol,children:n(`billing.perfP90`)}),(0,a.jsx)(`th`,{className:x.numCol,children:n(`billing.perfMax`)}),(0,a.jsx)(`th`,{className:x.numCol,children:n(`billing.perfTps`)}),(0,a.jsx)(`th`,{className:x.numCol,children:n(`billing.perfLatency`)}),(0,a.jsx)(`th`,{className:x.numCol,children:n(`billing.perfEstimated`)})]})}),(0,a.jsx)(`tbody`,{children:o.map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:x.modelCell,children:[(0,a.jsx)(`span`,{className:x.modelDot,style:{background:e.color}}),(0,a.jsx)(`span`,{className:x.modelName,children:e.name})]})}),(0,a.jsx)(`td`,{className:x.numCol,children:e.samples.toLocaleString()}),(0,a.jsxs)(`td`,{className:x.numCol,children:[e.ttftAvg.toFixed(0),` ms`]}),(0,a.jsxs)(`td`,{className:x.numCol,children:[e.ttftP50.toFixed(0),` ms`]}),(0,a.jsxs)(`td`,{className:x.numCol,children:[e.ttftP90.toFixed(0),` ms`]}),(0,a.jsx)(`td`,{className:x.numCol,children:e.ttftMax===void 0?(0,a.jsx)(`span`,{className:x.na,children:`—`}):(0,a.jsxs)(`span`,{children:[e.ttftMax.toFixed(0),` ms`,e.ttftSpikes!==void 0&&e.ttftSpikes>0?` (${e.ttftSpikes}↑)`:``]})}),(0,a.jsx)(`td`,{className:x.numCol,children:e.tpsAvg===void 0?(0,a.jsx)(`span`,{className:x.na,children:`—`}):`${e.tpsAvg.toFixed(1)}`}),(0,a.jsxs)(`td`,{className:x.numCol,children:[e.latencyAvg.toFixed(0),` ms`]}),(0,a.jsx)(`td`,{className:x.numCol,children:e.estimatedSamples>0?e.estimatedSamples:(0,a.jsx)(`span`,{className:x.na,children:`—`})})]},e.key))})]})}),s!==null&&(0,a.jsxs)(`div`,{className:x.chartWrap,"data-testid":`billing-perf-hour`,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 180`,className:x.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,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:G.left,x2:680-G.right,y1:n,y2:n,className:x.chartGrid}),(0,a.jsx)(`text`,{x:G.left-8,y:n+3,textAnchor:`end`,className:x.chartAxisLabel,children:e.toFixed(0)})]},`ttft-${t}`)}),(0,a.jsx)(`path`,{d:s.ttftPath,fill:`none`,className:x.chartLine}),s.tpsPath!==``&&(0,a.jsx)(`path`,{d:s.tpsPath,fill:`none`,className:x.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,a.jsx)(`text`,{x:s.inner(e),y:174,textAnchor:`middle`,className:x.chartAxisLabel,children:Ae(t.key)},t.key)}),(0,a.jsxs)(`text`,{x:680-G.right+8,y:G.top+4,textAnchor:`start`,className:x.chartAxisLabel,children:[n(`billing.perfTpsUnit`),` `,s.maxTps.toFixed(0)]})]}),(0,a.jsxs)(`div`,{className:x.chartLegend,children:[(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:x.chartLegendLine}),n(`billing.perfTtft`),` (ms)`]}),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:x.chartLegendLine,style:{background:`var(--dsw-static-amber-500)`}}),n(`billing.perfTps`),` (`,n(`billing.perfTpsUnit`),`)`]})]})]})]})}let Me=`@kenz1117/dsh-ui-usage-billing`,Ne=`kenz1117`;function Pe({t:e,version:t}){return(0,a.jsxs)(`section`,{className:x.setCard,"data-testid":`billing-plugin-info`,children:[(0,a.jsxs)(`div`,{className:x.plgHead,children:[(0,a.jsx)(`span`,{className:x.plgIcon,"aria-hidden":`true`,children:(0,a.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,a.jsx)(`path`,{d:`M10 3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a2 2 0 0 0 4 0V4a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a2 2 0 0 0 4 0 1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0 0 4h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-1a2 2 0 0 0-4 0 1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 0-4H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 4 0z`})})}),(0,a.jsxs)(`div`,{className:x.plgTitle,children:[(0,a.jsxs)(`div`,{className:x.plgNameRow,children:[(0,a.jsx)(`h3`,{className:x.plgName,children:Me}),(0,a.jsx)(`span`,{className:x.plgTag,children:t===void 0?`—`:`v${t}`})]}),(0,a.jsx)(`p`,{className:x.plgDesc,children:`Usage billing dashboard for DeepSeek Harness`})]})]}),(0,a.jsxs)(`div`,{className:x.plgGrid,children:[(0,a.jsxs)(`div`,{className:x.plgItem,children:[(0,a.jsx)(`span`,{className:x.plgLabel,children:e(`billing.pluginAuthor`)}),(0,a.jsxs)(`a`,{className:x.plgLink,href:`https://github.com/${Ne}`,target:`_blank`,rel:`noreferrer`,children:[`KenZ`,` (`,Ne,`)`]})]}),(0,a.jsxs)(`div`,{className:x.plgItem,children:[(0,a.jsx)(`span`,{className:x.plgLabel,children:e(`billing.pluginRepository`)}),(0,a.jsx)(`a`,{className:x.plgLink,href:`https://github.com/kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:`GitHub`})]}),(0,a.jsxs)(`div`,{className:x.plgItem,children:[(0,a.jsx)(`span`,{className:x.plgLabel,children:e(`billing.pluginNpm`)}),(0,a.jsx)(`a`,{className:x.plgLink,href:`https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:Me})]}),(0,a.jsxs)(`div`,{className:x.plgItem,children:[(0,a.jsx)(`span`,{className:x.plgLabel,children:e(`billing.pluginLicense`)}),(0,a.jsx)(`span`,{className:x.plgVal,children:`MIT`})]})]})]})}function Fe(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 Ie(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},Le=`var(--dsw-static-blue-500)`,q=`#14b8a6`,Re=`var(--dsw-static-amber-500)`;function ze(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 Be(e){let{stats:t,trendDays:n,onTrendDays:i,t:o}=e,{byDay:s,byModel:l,total:u}=t,d=(0,r.useMemo)(()=>{let e=[];for(let t=n-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t);let r=Fe(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,r.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:_e(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,r.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,r.useMemo)(()=>{let e=Object.entries(t.byTool??{}),n=e.slice(0,8),r=e.slice(8).reduce((e,[,t])=>e+t,0),i=e.reduce((e,[,t])=>e+t,0);return{top:n,rest:r>0?[[`…`,r]]:[],totalCalls:i}},[t.byTool]),h=(0,r.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,a.jsxs)(`div`,{className:x.tokenPanel,"data-testid":`billing-token-panel`,children:[(0,a.jsxs)(`div`,{className:x.exportBar,role:`group`,"aria-label":o(`billing.tokenExport`),children:[(0,a.jsx)(`span`,{className:x.exportLabel,children:o(`billing.export`)}),(0,a.jsx)(`button`,{type:`button`,className:x.exportButton,"data-testid":`billing-token-export-csv`,onClick:()=>{let e=new Blob([ze(d)],{type:`text/csv`}),t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`token-daily-${Fe()}.csv`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},children:o(`billing.tokenExportCsv`)}),(0,a.jsx)(`button`,{type:`button`,className:x.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-${Fe()}.json`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),0)},children:o(`billing.exportJson`)})]}),(0,a.jsxs)(`div`,{className:x.kpiGrid,"data-testid":`billing-token-kpis`,children:[(0,a.jsxs)(`div`,{className:x.kpiTile,children:[(0,a.jsx)(`span`,{className:x.kpiLabel,children:o(`billing.tokenCacheHitRate`)}),(0,a.jsxs)(`span`,{className:x.kpiValue,children:[p.cacheHitRate.toFixed(1),`%`]}),(0,a.jsxs)(`span`,{className:x.kpiDetail,children:[V(p.hit),` / `,V(p.hit+p.miss),(u.cacheWrite??0)>0?` · ${o(`billing.tokenCacheWrite`)} ${V(u.cacheWrite??0)}`:``]})]}),(0,a.jsxs)(`div`,{className:x.kpiTile,children:[(0,a.jsx)(`span`,{className:x.kpiLabel,children:o(`billing.tokenReasoningShare`)}),(0,a.jsxs)(`span`,{className:x.kpiValue,children:[p.reasoningPct.toFixed(1),`%`]}),(0,a.jsx)(`span`,{className:x.kpiDetail,children:V(p.reasoning)})]}),(0,a.jsxs)(`div`,{className:x.kpiTile,children:[(0,a.jsx)(`span`,{className:x.kpiLabel,children:o(`billing.tokenIo`)}),(0,a.jsx)(`span`,{className:x.kpiValue,children:p.io.toFixed(2)}),(0,a.jsxs)(`span`,{className:x.kpiDetail,children:[V(p.input),` / `,V(p.output)]})]}),(0,a.jsxs)(`div`,{className:x.kpiTile,children:[(0,a.jsx)(`span`,{className:x.kpiLabel,children:o(`billing.tokenPeak`)}),(0,a.jsx)(`span`,{className:x.kpiValue,children:p.peak===void 0?`—`:Ie(p.peak.miss+p.peak.hit+p.peak.output)}),(0,a.jsx)(`span`,{className:x.kpiDetail,children:p.peak?.date??`—`})]})]}),(0,a.jsxs)(`section`,{className:x.panel,"data-testid":`billing-token-daily`,children:[(0,a.jsxs)(`div`,{className:x.panelHead,children:[(0,a.jsx)(`h3`,{className:x.panelTitle,children:o(`billing.tokenDaily`)}),(0,a.jsx)(`span`,{className:x.rangeToggle,role:`group`,"aria-label":o(`billing.tokenDaily`),children:[7,30].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(x.rangeButton,n===e&&x.rangeButtonActive),"aria-pressed":n===e,onClick:()=>{i(e)},"data-testid":`billing-token-${e}d`,children:o(e===7?`billing.trend7d`:`billing.trend30d`)},e))})]}),h===null?(0,a.jsx)(`div`,{className:x.chartEmpty,children:o(`billing.trendEmpty`)}):(0,a.jsxs)(`div`,{className:x.chartWrap,children:[(0,a.jsxs)(`svg`,{viewBox:`0 0 680 200`,className:x.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,a.jsxs)(`g`,{children:[(0,a.jsx)(`line`,{x1:K.left,x2:680-K.right,y1:n,y2:n,className:x.chartGrid}),(0,a.jsx)(`text`,{x:K.left-8,y:n+3,textAnchor:`end`,className:x.chartAxisLabel,children:Ie(t)})]},e)}),d.map((e,t)=>{let n=h.inner(t)-h.barW/2,r=h.y(0),i=h.y(e.miss),o=h.y(e.miss+e.hit),s=h.y(e.miss+e.hit+e.output);return(0,a.jsxs)(`g`,{children:[(0,a.jsx)(`rect`,{x:n,y:i,width:h.barW,height:r-i,fill:Le}),(0,a.jsx)(`rect`,{x:n,y:o,width:h.barW,height:i-o,fill:q}),(0,a.jsx)(`rect`,{x:n,y:s,width:h.barW,height:o-s,fill:Re})]},e.date)}),h.indices.map(e=>{let t=d[e];return t===void 0?null:(0,a.jsx)(`text`,{x:h.inner(e),y:194,textAnchor:`middle`,className:x.chartAxisLabel,children:t.date.slice(5)},t.date)})]}),(0,a.jsxs)(`div`,{className:x.chartLegend,children:[(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:x.chartTooltipSwatch,style:{background:Le}}),o(`billing.tokenMiss`)]}),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:x.chartTooltipSwatch,style:{background:q}}),o(`billing.tokenHit`)]}),(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:x.chartTooltipSwatch,style:{background:Re}}),o(`billing.tokenOutput`)]})]})]})]}),(0,a.jsxs)(`section`,{className:x.panel,"data-testid":`billing-token-models`,children:[(0,a.jsx)(`div`,{className:x.panelHead,children:(0,a.jsx)(`h3`,{className:x.panelTitle,children:o(`billing.tokenByModel`)})}),f.length===0?(0,a.jsx)(`div`,{className:x.emptyRow,children:o(`billing.noData`)}):(0,a.jsx)(`div`,{className:x.tableScroll,children:(0,a.jsxs)(`table`,{className:x.modelTable,"data-testid":`billing-token-model-table`,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:o(`billing.model`)}),(0,a.jsx)(`th`,{className:x.numCol,children:o(`billing.inputTokens`)}),(0,a.jsx)(`th`,{className:x.numCol,children:o(`billing.outputTokens`)}),(0,a.jsx)(`th`,{className:x.numCol,children:o(`billing.tokenReasoningShort`)}),(0,a.jsx)(`th`,{className:x.numCol,children:o(`billing.cacheHitRate`)}),(0,a.jsx)(`th`,{className:x.numCol,children:o(`billing.tokenTotal`)}),(0,a.jsx)(`th`,{className:x.numCol,children:o(`billing.tokenShare`)}),(0,a.jsx)(`th`,{className:x.numCol,children:o(`billing.calls`)})]})}),(0,a.jsx)(`tbody`,{children:f.map(e=>(0,a.jsxs)(`tr`,{"data-testid":`billing-token-model`,children:[(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:x.modelName,children:e.name})}),(0,a.jsx)(`td`,{className:x.numCol,children:V(e.input)}),(0,a.jsx)(`td`,{className:x.numCol,children:V(e.output)}),(0,a.jsx)(`td`,{className:x.numCol,children:e.reasoning>0?V(e.reasoning):(0,a.jsx)(`span`,{className:x.na,children:`—`})}),(0,a.jsxs)(`td`,{className:x.numCol,children:[e.cacheHitRate.toFixed(1),`%`]}),(0,a.jsx)(`td`,{className:x.numCol,children:V(e.total)}),(0,a.jsx)(`td`,{className:x.numCol,children:(0,a.jsxs)(`span`,{className:x.tokenModelShareRow,children:[(0,a.jsx)(`span`,{className:x.tokenModelBar,children:(0,a.jsxs)(`span`,{className:x.tokenModelParts,style:{width:`${(e.share*100).toFixed(2)}%`},children:[(0,a.jsx)(`span`,{className:x.tokenModelPartIn,style:{width:`${e.total>0?e.input/e.total*100:0}%`}}),(0,a.jsx)(`span`,{className:x.tokenModelPartOut,style:{width:`${e.total>0?e.output/e.total*100:0}%`}})]})}),(e.share*100).toFixed(1),`%`]})}),(0,a.jsx)(`td`,{className:x.numCol,children:e.calls.toLocaleString()})]},e.key))})]})})]}),m.totalCalls>0&&(0,a.jsxs)(`section`,{className:x.panel,"data-testid":`billing-token-tools`,children:[(0,a.jsx)(`div`,{className:x.panelHead,children:(0,a.jsx)(`h3`,{className:x.panelTitle,children:o(`billing.toolRank`)})}),(0,a.jsx)(`div`,{className:x.tableScroll,children:(0,a.jsxs)(`table`,{className:x.modelTable,"data-testid":`billing-tool-table`,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:o(`billing.toolName`)}),(0,a.jsx)(`th`,{className:x.numCol,children:o(`billing.calls`)}),(0,a.jsx)(`th`,{className:x.numCol,children:o(`billing.tokenShare`)})]})}),(0,a.jsx)(`tbody`,{children:[...m.top,...m.rest].map(([e,t])=>(0,a.jsxs)(`tr`,{"data-testid":`billing-tool-row`,children:[(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:x.modelName,children:e})}),(0,a.jsx)(`td`,{className:x.numCol,children:t.toLocaleString()}),(0,a.jsxs)(`td`,{className:x.numCol,children:[(t/m.totalCalls*100).toFixed(1),`%`]})]},e))})]})})]})]})}function Ve(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}`}function J(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 He(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 Ue({rounds:e,flags:t,currency:n,t:i}){let o=(0,r.useMemo)(()=>e.slice(-40),[e]),s=(0,r.useMemo)(()=>new Set(t.map(e=>`${e.sessionId}:${e.turn}`)),[t]),l=(0,r.useMemo)(()=>Math.max(1e-4,...o.map(e=>e.cost)),[o]);if(o.length===0)return(0,a.jsxs)(`div`,{className:x.roundsEmpty,children:[i(`billing.model`),` —`]});let u=e=>B(n===`usd`?z(e):e,n);return(0,a.jsxs)(`div`,{className:x.rounds,children:[(0,a.jsx)(`div`,{className:x.roundsBars,role:`img`,"aria-label":`cost per turn`,children:o.map(e=>{let t=s.has(`${e.sessionId}:${e.turn}`),n=Math.max(1,e.cost/l*100),r=A(e.startedAt)===`peak`;return(0,a.jsxs)(`div`,{className:c(x.roundsBarCol,r?x.roundsBarColPeak:x.roundsBarColOff),children:[(0,a.jsx)(`span`,{className:x.roundsBarLabel,style:{bottom:`${n}%`},children:u(e.cost)}),(0,a.jsx)(`div`,{className:x.roundsBarWrap,children:(0,a.jsx)(`div`,{className:t?x.roundsBarFlagged:x.roundsBar,style:{height:`${n}%`},"data-testid":`round-bar`,title:`${i(`billing.model`)} ${e.model} · ${u(e.cost)} · ${J(e.startedAt)}${e.endedAt===void 0?``:` → ${Ve(e.endedAt)} (${He(e.endedAt-e.startedAt)})`}`,children:t&&(0,a.jsx)(`span`,{className:x.roundsFlagMark,"aria-hidden":`true`})})})]},`${e.sessionId}:${e.turn}`)})}),(0,a.jsxs)(`div`,{className:x.roundsAxis,children:[(0,a.jsxs)(`span`,{children:[i(`billing.costAbbr`),` `,u(l)]}),(0,a.jsxs)(`span`,{children:[o.length,` 轮`]})]})]})}let We=[`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)`],Ge=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Y(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function Ke(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:Y(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:Y(e),dayNum:e.getDate(),value:0,level:0,placeholder:!0});continue}let d=Y(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 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=Y(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=Y(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 Je({days:e,currency:t,now:n,t:i,range:o=`month`}){let[s,c]=(0,r.useState)(null),l=e=>B(t===`usd`?z(e):e,t),u=(0,r.useMemo)(()=>Ke(e,n??new Date),[e,n]);if(o===`year`){let t=qe(e,n??new Date),r=[],o=-1;return t.forEach((e,t)=>{let n=Number(e[0]?.date.slice(5,7)??0);n!==o&&(r.push({index:t,label:Ge[n-1]??``}),o=n)}),(0,a.jsxs)(`div`,{className:x.heatmapYear,"data-testid":`heatmap-year`,children:[(0,a.jsxs)(`div`,{className:x.heatmapYearBody,children:[(0,a.jsx)(`div`,{className:x.heatmapYearWeekdays,"aria-hidden":`true`,children:[{label:`Mon`,row:1},{label:`Wed`,row:3},{label:`Fri`,row:5}].map(e=>(0,a.jsx)(`span`,{className:x.heatmapYearWeekday,style:{gridRow:e.row},children:e.label},e.label))}),(0,a.jsxs)(`div`,{className:x.heatmapYearScroll,children:[(0,a.jsx)(`div`,{className:x.heatmapYearMonths,"aria-hidden":`true`,"data-testid":`heatmap-year-months`,children:r.map(e=>(0,a.jsx)(`span`,{className:x.heatmapYearMonth,style:{gridColumn:e.index+1},children:e.label},e.index))}),(0,a.jsx)(`div`,{className:x.heatmapYearGrid,role:`img`,"aria-label":`yearly cost heatmap`,"data-testid":`heatmap-year-grid`,children:t.flat().map(e=>(0,a.jsx)(`button`,{type:`button`,className:x.heatmapYearCell,"data-testid":`heatmap-year-cell`,"data-level":e.level,style:{background:We[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`},e.date))})]})]}),(0,a.jsxs)(`div`,{className:x.heatmapFooter,children:[(0,a.jsx)(`span`,{className:x.heatmapLegendText,children:i(`billing.heatmapLess`)}),(0,a.jsx)(`span`,{className:x.heatmapLegend,children:We.map((e,t)=>(0,a.jsx)(`i`,{style:{background:e}},t))}),(0,a.jsx)(`span`,{className:x.heatmapLegendText,children:i(`billing.heatmapMore`)})]})]})}return(0,a.jsxs)(`div`,{className:x.heatmap,children:[(0,a.jsx)(`div`,{className:x.heatmapGrid,role:`img`,"aria-label":`daily cost heatmap`,children:u.map(e=>e.map(e=>e.placeholder?(0,a.jsx)(`div`,{className:x.heatmapCellEmpty,children:e.dayNum},e.date):(0,a.jsx)(`button`,{type:`button`,className:x.heatmapCell,"data-testid":`heatmap-cell`,"data-level":e.level,style:{background:We[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`,onMouseEnter:()=>{c(e)},onMouseLeave:()=>{c(null)},onFocus:()=>{c(e)},onBlur:()=>{c(null)},children:e.dayNum},e.date)))}),(0,a.jsxs)(`div`,{className:x.heatmapFooter,children:[(0,a.jsx)(`span`,{className:x.heatmapLegendText,children:i(`billing.heatmapLess`)}),(0,a.jsx)(`span`,{className:x.heatmapLegend,children:We.map((e,t)=>(0,a.jsx)(`i`,{style:{background:e}},t))}),(0,a.jsx)(`span`,{className:x.heatmapLegendText,children:i(`billing.heatmapMore`)}),s!==null&&(0,a.jsxs)(`span`,{className:x.heatmapHover,"data-testid":`heatmap-hover`,children:[s.date,` · `,l(s.value)]})]})]})}let Ye={window:6,threshold:2,reasonFactor:1.8,reasonHitDropPp:15};function Xe(e){if(e.length===0)return null;let t=0;for(let n of e)t+=n;return t/e.length}function Ze(e){let t=e.cacheHit+e.cacheMiss;return t<=0?null:e.cacheHit/t*100}function Qe(e,t){let n=t?.window??Ye.window,r=t?.threshold??Ye.threshold,i=t?.reasonFactor??Ye.reasonFactor,a=t?.reasonHitDropPp??Ye.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=Ze(t),p=Xe(s),m=[];if(p!==null&&p>0&&t.cost>p*r){let n=Xe(c),r=Xe(l),s=Xe(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 $e(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function X(e){return/^[=+\-@\t\r]/.test(e)?`'${e}`:e}function Z(e){return e.toFixed(2)}function et(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,Z(n.cost)].join(`,`)})].join(`
|
|
3
|
+
`)}function tt(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[$e(X(n)),r,t.calls,Z(t.cost)].join(`,`)})].join(`
|
|
4
|
+
`)}function nt(e){return e===void 0?``:e.split(/[\\/]/).filter(Boolean).pop()??e}function rt(e){return[`session_id,title,project,calls,cost_cny,last_active`,...e.map(e=>[$e(X(e.id)),$e(X(e.title??``)),$e(X(nt(e.cwd))),e.calls,Z(e.cost),e.lastActive>0?new Date(e.lastActive).toISOString():``].join(`,`))].join(`
|
|
5
|
+
`)}function it(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 at(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 ot=`usageBilling`,st={"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.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.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":`调用`},ct={"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, some detail rows keep catalog pricing.`,"billing.userPriceSave":`Save`,"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.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`},lt={"智谱 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 ut(e,t){return t===`en`?lt[e]??e:e}let dt={Anthropic:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M26.9568 9.88184H22.1265L30.7753 31.7848H35.4917L26.9568 9.88184ZM13.028 9.88184L4.4917 31.7848H9.32203L11.2305 27.1793H20.2166L22.0126 31.6724H26.8444L18.0832 9.88184H13.028ZM12.5783 23.1361L15.4987 15.3853L18.5315 23.1361H12.5783Z' fill='currentColor'/%3E%3C/svg%3E`,Cohere:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.14882 13.5552C9.58082 13.5552 10.4448 13.5336 11.6544 13.0368C13.0584 12.4536 15.8232 11.4168 17.832 10.3368C19.236 9.5808 19.8408 8.5872 19.8408 7.248C19.8408 5.412 18.3504 3.9 16.4928 3.9H8.71682C6.06002 3.9 3.90002 6.06 3.90002 8.7168C3.90002 11.3736 5.93042 13.5552 9.14882 13.5552Z' fill='currentColor'/%3E%3Cpath d='M10.4664 16.86C10.4664 15.564 11.244 14.376 12.4536 13.8792L14.8944 12.864C17.3784 11.8488 20.1 13.6632 20.1 16.3416C20.1 18.4152 18.4152 20.1 16.3416 20.1H13.6848C11.9136 20.1 10.4664 18.6528 10.4664 16.86Z' fill='currentColor'/%3E%3Cpath d='M6.68642 14.1816C5.15282 14.1816 3.90002 15.4344 3.90002 16.968V17.3352C3.90002 18.8472 5.15282 20.1 6.68642 20.1C8.22003 20.1 9.47283 18.8472 9.47283 17.3136V16.9464C9.45123 15.4344 8.22003 14.1816 6.68642 14.1816Z' fill='currentColor'/%3E%3C/svg%3E`,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`,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`,Meta:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M27.1942 9.03509C24.4881 9.03509 22.3726 11.0731 20.4574 13.6623C17.8258 10.3114 15.6255 9.03509 12.9925 9.03509C7.62404 9.03509 3.51001 16.0234 3.51001 23.4181C3.51001 28.0453 5.74831 30.9649 9.49831 30.9649C12.1971 30.9649 14.1387 29.693 17.5904 23.6594C17.5904 23.6594 19.029 21.1199 20.0173 19.3699C20.3643 19.9293 20.7298 20.5327 21.1138 21.1798L22.7322 23.902C25.8843 29.1769 27.6416 30.9649 30.8229 30.9649C34.4778 30.9649 36.51 28.0058 36.51 23.2822C36.51 15.538 32.3039 9.03509 27.1942 9.03509ZM14.9574 22.0263C12.1606 26.4123 11.1928 27.3962 9.63574 27.3962C8.03194 27.3962 7.07872 25.9883 7.07872 23.4781C7.07872 18.1096 9.75562 12.6199 12.9471 12.6199C14.6752 12.6199 16.1197 13.617 18.3316 16.7836C16.2308 20.0058 14.9574 22.0263 14.9574 22.0263ZM25.5202 21.4751L23.5831 18.2456C23.0969 17.4514 22.5938 16.6676 22.0743 15.8947C23.8185 13.2032 25.2556 11.8611 26.9676 11.8611C30.5202 11.8611 33.3638 17.095 33.3638 23.5219C33.3638 25.9722 32.5612 27.3947 30.8989 27.3947C29.3053 27.3947 28.5451 26.3421 25.5188 21.4737' 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`,"Mistral 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='M8.92783 8.88101H13.357V13.3088H17.7861V17.738H17.7835H22.2152V13.3088H26.6418V8.88101H31.0722V26.5949H35.5V31.0241H22.2139V26.5962H17.7861V22.1671H13.3557V26.5949L17.7861 26.5962V31.0241H4.5V26.5949H8.92783V8.88101ZM22.2139 26.5962H26.6418V22.1671H22.2152V26.5962H22.2139Z' 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`,xAI:`data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.4579 15.6036L26.1529 35H20.0656L6.37059 15.6036H12.4579ZM12.4524 26.3764L15.4974 30.6909L12.4551 35H6.36377L12.4524 26.3764ZM33.6365 7.15727V35H28.647V14.2236L33.6365 7.15727ZM33.6365 5L20.0656 24.2205L17.0206 19.9073L27.5451 5H33.6365Z' 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 xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28' %3E %3Cg clipPath='url(%23clip0_9396_9240)'%3E %3Cpath d='M14 0C6.272 0 0 6.272 0 14C0 21.728 6.272 28 14 28C21.728 28 28 21.728 28 14C28 6.272 21.728 0 14 0ZM10.22 22.876H5.11V17.766H10.22V22.876ZM16.548 22.876H11.438V17.766H16.548V22.876ZM16.548 16.562H11.438V11.438H16.548V16.562ZM16.548 10.234H11.438V5.124H16.548V10.234ZM22.876 10.234H17.766V5.11H22.876V10.234Z' fill='currentColor' /%3E %3C/g%3E %3Cdefs%3E %3CclipPath id='clip0_9396_9240'%3E %3Crect width='28' height='28' /%3E %3C/clipPath%3E %3C/defs%3E %3C/svg%3E`,美团:`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' fill='currentColor'%3E %3Cg transform='translate(0 0.48)'%3E %3Cpath fill-rule='evenodd' d='M1.6654430203094481,29.51981024475098C1.1898620203094483,29.51981024475098,0.8449320203094483,29.066910244750975,0.9713445203094483,28.608410244750978L7.043789020309449,6.584860244750977C7.303349020309448,5.6433932447509765,8.404949020309449,5.227902244750976,9.221609020309447,5.763425244750977L17.21172902030945,11.002880244750976C17.690529020309448,11.316830244750976,18.309829020309447,11.317340244750977,18.78912902030945,11.004100244750976L26.81322902030945,5.760550244750976C27.63062902030945,5.226395244750977,28.73132902030945,5.643421244750977,28.989629020309447,6.5851002447509766L35.030329020309445,28.609310244750976C35.15602902030945,29.067610244750977,34.81112902030945,29.51981024475098,34.33592902030945,29.51981024475098L26.623629020309448,29.51981024475098C28.027629020309448,27.894210244750976,28.80002902030945,25.817910244750976,28.80002902030945,23.670010244750976L28.80002902030945,23.419310244750978C28.80002902030945,21.318310244750975,28.03582902030945,19.289110244750976,26.649829020309447,17.710010244750976L25.660029020309448,12.741890244750977C25.60192902030945,12.450000244750978,25.34572902030945,12.239800244750977,25.04812902030945,12.239800244750977C24.913029020309448,12.239800244750977,24.78162902030945,12.283570244750976,24.67362902030945,12.364580244750977L20.94192902030945,15.163390244750977C20.67612902030945,15.362690244750977,20.332429020309448,15.426190244750977,20.01302902030945,15.334900244750976C18.69732902030945,14.959020244750976,17.30272902030945,14.959020244750976,15.987129020309448,15.334900244750976C15.667629020309448,15.426190244750977,15.323929020309448,15.362690244750977,15.058229020309449,15.163390244750977L11.324829020309448,12.363350244750976C11.217929020309448,12.283140244750976,11.087829020309448,12.239800244750977,10.954129020309448,12.239800244750977C10.656209020309449,12.239800244750977,10.400719020309449,12.452340244750976,10.346539020309448,12.745240244750978L9.386279020309448,17.936610244750977C7.985189020309448,19.361310244750975,7.200069020309448,21.279610244750977,7.200069020309448,23.277810244750977L7.200069020309448,23.752710244750975C7.200069020309448,25.848010244750977,7.949629020309448,27.874310244750976,9.313239020309448,29.465210244750978L9.360069020309448,29.51981024475098L1.6654430203094481,29.51981024475098Z'/%3E %3Cpath d='M14.040008306503296,25.19998077392578L16.200008306503296,25.19998077392578L16.200008306503296,20.15998077392578L14.367281306503296,20.15998077392578L14.040008306503296,25.19998077392578ZM21.960008306503298,25.19998077392578L19.800008306503294,25.19998077392578L19.800008306503294,20.15998077392578L21.632728306503296,20.15998077392578L21.960008306503298,25.19998077392578Z'/%3E %3C/g%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`,小米:`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 width='24' height='24' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.85893 26.3499L18.1801 29.6463C18.1635 30.5223 18.1894 31.3987 18.2576 32.2722L25.9507 34.3298C23.669 35.2716 21.1952 35.6547 18.7355 35.4471L18.503 35.4265L18.4462 35.4213L18.3377 35.4097L18.2163 35.3968C18.1486 35.3886 18.081 35.38 18.0135 35.3709L17.8753 35.3528L17.7332 35.3322C17.5951 35.3121 17.4573 35.2901 17.3198 35.2663L17.2656 35.256L17.1687 35.2392L17.0305 35.2133L16.9401 35.194L16.82 35.1694L16.7231 35.1488L16.6004 35.1229L16.4751 35.0932L16.3537 35.0648L16.2659 35.0428L16.1522 35.0144L16.0359 34.9834L15.9132 34.9511L15.8073 34.9214L15.6665 34.8827L15.5864 34.8568L15.4779 34.8245L15.3578 34.7884L15.2222 34.7445L15.1473 34.7199L15.0439 34.6863L14.9277 34.6463L14.8424 34.6153C14.8235 34.6089 14.8045 34.6025 14.7856 34.5959L14.6978 34.5636L14.5673 34.5158L14.4937 34.4874L14.3904 34.4487L14.278 34.4035L14.1643 34.3583L14.0623 34.3169L13.9396 34.2653L13.8582 34.2291L13.7768 34.1942C13.7591 34.1865 13.7415 34.1788 13.7239 34.171L13.6386 34.1322L13.5056 34.0715L13.4384 34.0405L13.3144 33.9811L13.2343 33.9423L13.1258 33.8907L13.0147 33.8338L12.8946 33.7731L12.8274 33.7383L12.6944 33.6672L12.6208 33.6285L12.5459 33.5871C12.526 33.576 12.5062 33.5648 12.4864 33.5536L12.365 33.4851L12.2875 33.4412L12.2217 33.4024L12.1287 33.3495L12.0227 33.2849L11.9026 33.2126L11.8354 33.1712L11.7269 33.1028L11.6482 33.0524L11.5461 32.9878L11.4557 32.9271L11.3872 32.8819C11.3639 32.8665 11.3407 32.851 11.3175 32.8354L11.2607 32.7966L11.2038 32.7579C11.1866 32.7459 11.1693 32.7338 11.1522 32.7217L11.0785 32.6701L10.9804 32.6003L10.8912 32.5357L10.7957 32.466L10.7233 32.4117L10.6252 32.3381L10.527 32.2619L10.4159 32.1753L10.3578 32.1301L10.2751 32.063L10.1795 31.9855L10.0646 31.8912L10.0052 31.8408L9.94575 31.7904C9.92717 31.7746 9.90866 31.7586 9.8902 31.7426L9.83208 31.691L9.75329 31.6225L9.66287 31.5424L9.57504 31.4649L9.49496 31.39L9.40841 31.3099L9.33996 31.2453L9.22629 31.1368C9.18345 31.0953 9.14082 31.0535 9.09842 31.0116L9.06096 30.9754L9.008 30.9211L8.91887 30.8307L8.85429 30.7648L8.78971 30.6964C8.71592 30.6207 8.64357 30.5436 8.57271 30.4652L8.46938 30.3515L8.38929 30.2611L8.29758 30.1578L8.24333 30.0945L8.17488 30.0144L8.09996 29.9266L8.04054 29.8542C8.02888 29.8401 8.01725 29.8258 8.00567 29.8116L7.94754 29.7406L7.86229 29.6346L7.80934 29.5675L7.74475 29.4848L7.71892 29.4525C6.97985 28.4945 6.3556 27.4532 5.85893 26.3499ZM4.54143 18.8661L19.2057 22.7888C18.9602 23.6439 18.758 24.5109 18.5999 25.3864L32.5718 29.1244C31.8777 30.0748 31.0782 30.9436 30.1887 31.7142L5.34872 25.0673L5.32805 25.0079L5.28284 24.8736C5.26087 24.8078 5.23934 24.742 5.21826 24.676L5.20922 24.6462C5.1098 24.3302 5.02063 24.011 4.94184 23.6891L4.90309 23.5264L4.87984 23.423L4.85272 23.2978L4.82947 23.1931L4.80622 23.0769L4.78426 22.9684L4.76101 22.847C4.72743 22.6648 4.69643 22.4814 4.6693 22.2967L4.64735 22.1443L4.63314 22.0371L4.61635 21.9053C4.6077 21.8361 4.59952 21.7668 4.5918 21.6974L4.58535 21.6367C4.48884 20.7162 4.47414 19.7891 4.54143 18.8661ZM6.59905 12.214L22.0318 16.3421C21.5565 17.1236 21.1212 17.9322 20.7273 18.764L35.3166 22.6674C35.1332 23.7266 34.8413 24.7496 34.4538 25.7222L19.5351 21.731L4.66026 17.7526L4.67964 17.6235L4.68997 17.5602L4.70289 17.4736L4.72226 17.3613L4.74551 17.2347C4.7791 17.0435 4.81785 16.8536 4.85918 16.6638L4.89534 16.5036L4.92118 16.3938L4.95218 16.2685C4.98059 16.1523 5.0103 16.036 5.04259 15.9224L5.07876 15.7906L5.10847 15.6834L5.14722 15.5542L5.17951 15.4483L5.21826 15.3243L5.25184 15.2184L5.29189 15.0957C5.62637 14.0924 6.06355 13.1262 6.59646 12.2127L6.59905 12.214ZM12.3366 6.53068L26.913 10.4289C26.1438 11.1271 25.4158 11.8693 24.7327 12.6519L34.8374 15.3553C35.1823 16.4558 35.4083 17.608 35.5 18.7976L7.22034 11.2336L7.27846 11.1497L7.31334 11.098L7.365 11.027L7.42442 10.943L7.49546 10.8448L7.56521 10.7518L7.64788 10.6407L7.71246 10.5568L7.78609 10.4625L7.85713 10.3721L7.93463 10.2765L8.00567 10.1874L8.08963 10.0879L8.15938 10.0027L8.24463 9.90321L8.31308 9.82571L8.40608 9.71979L8.47454 9.64229L8.56108 9.54671L8.63083 9.47179L8.72512 9.37104L8.80004 9.29354L8.88142 9.207L9.09842 8.98742L9.22758 8.86084L9.30379 8.7885L9.40196 8.69679C10.2922 7.86254 11.2771 7.13554 12.3366 6.53068ZM20.022 4.50018H20.1473L20.2532 4.50147L20.3423 4.50277L20.4121 4.50535L20.4999 4.50793L20.5593 4.50922L20.6575 4.5131L20.7182 4.51568L20.7957 4.51956L20.8655 4.52214L20.9778 4.5286L21.1135 4.53764L21.2995 4.55185L21.4131 4.56089L21.47 4.56606L21.5694 4.57639L21.6753 4.58672L21.736 4.59318L21.8678 4.60868L21.9324 4.61643L22.0719 4.63452L22.1765 4.64743L22.2308 4.65518L22.3147 4.6681L22.5821 4.70943L22.6725 4.72493L22.7565 4.73914L22.9373 4.77272L23.0561 4.79597L23.1982 4.82439L23.2576 4.83731L23.3545 4.85797L23.4075 4.87089L23.4875 4.88768L23.5418 4.9006L23.6257 4.91997L23.689 4.93547L23.7807 4.95743L23.9047 4.98843L24.0494 5.02718L24.1954 5.06593L24.3413 5.10726L24.4059 5.12664L24.4963 5.15247L24.5971 5.18347L24.6914 5.21318L24.756 5.23385L24.8205 5.25451L24.9187 5.28681L25.0466 5.32943L25.1783 5.37593L25.2403 5.39789L25.323 5.4276L25.4431 5.47151L25.5852 5.52447L25.735 5.5826L25.8642 5.63426L25.9249 5.6601L26.0024 5.6911L26.0554 5.71435L26.1367 5.74793L26.1884 5.77118L26.262 5.80347L26.4041 5.86547L26.5333 5.92489L26.6289 5.97009L26.7257 6.01659L26.8032 6.05276L26.9221 6.11218L27.0396 6.1703L27.1714 6.23747L27.2398 6.27364L27.3031 6.30722L27.3625 6.33822L27.44 6.38084L27.493 6.40926L27.5602 6.44672L27.6738 6.5113L27.8107 6.5888L27.9231 6.65468L27.9967 6.69859L28.0652 6.73993L28.1892 6.81613L28.3029 6.88718L28.4294 6.96726L28.4759 6.99826L28.5586 7.05122L28.6671 7.12355L28.7188 7.15842L28.7989 7.21267L28.8789 7.26822L28.9086 7.29017C28.9784 7.33797 29.0481 7.38705 29.1166 7.43742L29.2238 7.51492L29.3078 7.57692L29.3801 7.63246L29.4912 7.71642L29.5971 7.79909L29.6488 7.83784L29.7134 7.8908L29.8244 7.97992L29.9265 8.06388L30.0363 8.15559C30.9559 8.93059 31.7839 9.81279 32.5021 10.779L13.8285 5.7841L13.9086 5.74922L13.9925 5.71305L14.0971 5.66914L14.2082 5.62393C14.3542 5.5658 14.5014 5.50768 14.6487 5.45472L14.7727 5.40951L14.8928 5.36689L15.0013 5.32814L15.1253 5.2881C15.2377 5.24935 15.3526 5.21318 15.4663 5.17831L15.5839 5.14343L15.6949 5.11114L15.8267 5.07239L15.9365 5.04268L16.0656 5.0091L16.1767 4.9781L16.293 4.94839L16.4105 4.91997L16.5332 4.89156L16.6495 4.86572L16.7761 4.8386L16.8936 4.81276L17.0163 4.78951L17.1351 4.76627L17.2643 4.74302L17.3818 4.72235L17.5084 4.70039L17.6273 4.68231L17.7526 4.66293L17.8714 4.64614L18.0031 4.62935L18.1207 4.61385L18.2563 4.59835L18.3726 4.58543L18.5082 4.57252C18.6283 4.5596 18.7484 4.54927 18.8698 4.54152L19.0068 4.53118L19.123 4.52472L19.2651 4.51697L19.3852 4.51181L19.5144 4.50664L19.6397 4.50406L19.7675 4.50147L20.022 4.49889V4.50018Z' 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 role='img' fill='currentColor' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.154 0C7.71 0 6.54 1.658 6.54 3.707c0 2.051 1.171 3.71 2.615 3.71 1.446 0 2.614-1.659 2.614-3.71C11.768 1.658 10.6 0 9.154 0zm7.025.594C14.86.58 13.347 2.589 13.2 3.927c-.187 1.745.25 3.487 2.179 3.735 1.933.25 3.175-1.806 3.422-3.364.252-1.555-.995-3.364-2.362-3.674a1.218 1.218 0 0 0-.261-.03zM3.582 5.535a2.811 2.811 0 0 0-.156.008c-2.118.19-2.428 3.24-2.428 3.24-.287 1.41.686 4.425 3.297 3.864 2.617-.561 2.262-3.68 2.183-4.362-.125-1.018-1.292-2.773-2.896-2.75zm16.534 1.753c-2.308 0-2.617 2.119-2.617 3.616 0 1.43.121 3.425 2.988 3.362 2.867-.063 2.553-3.238 2.553-3.988 0-.745-.62-2.99-2.924-2.99zm-8.264 2.478c-1.424.014-2.708.925-3.323 1.947-1.118 1.868-2.863 3.05-3.112 3.363-.25.309-3.61 2.116-2.864 5.42.746 3.301 3.365 3.237 3.365 3.237s1.93.19 4.171-.31c2.24-.495 4.17.123 4.17.123s5.233 1.748 6.665-1.616c1.43-3.364-.808-5.109-.808-5.109s-2.99-2.306-4.736-4.798c-1.072-1.665-2.348-2.268-3.528-2.257zm-2.234 3.84l1.542.024v8.197H7.758c-1.47-.291-2.055-1.292-2.13-1.462-.072-.173-.488-.976-.268-2.343.635-2.049 2.447-2.196 2.447-2.196h1.81zm3.964 2.39v3.881c.096.413.612.488.612.488h1.614v-4.343h1.689v5.782h-3.915c-1.517-.39-1.59-1.465-1.59-1.465v-4.317zm-5.458 1.147c-.66.197-.978.708-1.05.928-.076.22-.247.78-.1 1.269.294 1.095 1.248 1.144 1.248 1.144h1.37v-3.34z'/%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`};function ft(e){return dt[e]}let pt=`dsh-billing-peak-alert-v1`,mt={enabled:!1,leadMin:2,position:`bottom-right`,webNotify:!0,mode:`both`};function ht(){try{let e=localStorage.getItem(pt);if(e===null)return{...mt};let t=JSON.parse(e),n=t.mode===`peak`||t.mode===`offPeak`?t.mode:mt.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))):mt.leadMin,position:r,webNotify:t.webNotify!==!1,mode:n}}catch{return{...mt}}}function gt(e){try{localStorage.setItem(pt,JSON.stringify(e))}catch{}}function _t(e,t,n){if(!t.enabled)return null;let r=he(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 vt({hit:e,config:t,t:n,onDismiss:i}){let[o,s]=(0,r.useState)(()=>Date.now());if((0,r.useEffect)(()=>{let e=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,r.useEffect)(()=>{o>=e.atMs&&i()},[o,e.atMs,i]),o>=e.atMs)return null;let l=Math.max(1,Math.round((e.atMs-o)/6e4)),u=e.entering,d=n(u===`peak`?`billing.tierPeak`:`billing.tierOff`),f=n(u===`peak`?`billing.peakAlertDescPeak`:`billing.peakAlertDescOff`),p=u===`peak`;return(0,a.jsxs)(`div`,{className:c(x.peakCard,p?x.peakCardPeak:x.peakCardOff,t.position===`center`?x.peakCardCenter:x.peakCardCorner),"data-testid":`billing-peak-alert`,role:`alert`,children:[(0,a.jsxs)(`div`,{className:x.peakHead,children:[(0,a.jsxs)(`span`,{className:c(x.peakTag,p?x.peakTagPrimary:x.peakTagSuccess),children:[(0,a.jsx)(`span`,{className:c(x.peakDot,p?x.peakDotPrimary:x.peakDotSuccess),"aria-hidden":`true`}),d]}),(0,a.jsx)(`button`,{type:`button`,className:x.peakClose,onClick:i,"aria-label":n(`billing.close`),children:`×`})]}),(0,a.jsxs)(`div`,{className:c(x.peakCount,p?x.peakCountPrimary:x.peakCountSuccess),children:[l,`min`]}),(0,a.jsx)(`p`,{className:x.peakDesc,children:f})]})}let yt=[{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 bt(e){if(e!==void 0)return e.split(/[\\/]/).filter(Boolean).pop()??e}let xt=[50,80,100],St={checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]},Ct={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 wt(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 Tt(e,t){let n=Q(e),r=Q(t);if(wt(n,r))return!0;let i=Ct[e];return i!==void 0&&i.some(e=>wt(Q(e),r))}function Et(e){let t=e.trim().toLowerCase(),n=t.replace(/[\s_/-]+/g,``);if(n.length!==0){for(let[e,n]of Object.entries(Ct))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(Ct))for(let r of t){let t=Q(r);if(!(t.length<4)&&n.includes(t))return e}}}let Dt={"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 Ot(e){let t=Dt[e];return t===void 0?Et(e)??e:t}function kt(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 At(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:kt(e,n);return a<=0?0:a*i}function jt(e){if(oe()===void 0||e.byDayModels===void 0)return e;let t=ce().rate,n={},r={},i=new Map,a=0;for(let[o,s]of Object.entries(e.byDayModels)){let c=0,l={};for(let[e,n]of Object.entries(s)){let r=n.cost,a=D(e);if(a!==void 0){let e=n.cacheMiss,i=Math.min(n.cacheHit,n.cacheMiss+n.cacheHit),o=(e*a.input+i*a.cacheHit+n.output*a.output)/1e6;r=a.currency===`USD`?o*t:o}c+=r,l[e]={...n,cost:r},i.set(e,(i.get(e)??0)+r)}let u=e.byDay[o];u!==void 0&&(n[o]={...u,cost:c}),r[o]=l,a+=c}return{...e,total:{...e.total,cost:a},byDay:n,byDayModels:r,byModel:Object.fromEntries(Object.entries(e.byModel).map(([e,t])=>{let n=i.get(e);return[e,n===void 0?t:{...t,cost:n}]}))}}function Mt(e){return Object.keys(e).length}function Nt(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 Pt(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 Ft(e,t){return e.checked?e.okProviders.some(e=>Tt(t,e))?x.healthOk:e.badProviders.some(e=>Tt(t,e))?x.healthBad:x.healthIdle:x.healthIdle}function It(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 Lt(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 Rt(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 zt(e,t){switch(e){case`site`:return t(`billing.relaySite`);case`direct`:return t(`billing.relayDirect`);default:return t(`billing.relayUnknown`)}}function Bt(e,t){switch(e){case`new-api`:return t(`billing.relayKindNewApi`);case`sub2api`:return t(`billing.relayKindSub2Api`);default:return t(`billing.relayKindUnknown`)}}let Vt={site:x.siteKindSite,direct:x.siteKindDirect,unknown:x.siteKindUnknown},Ht={"new-api":x.siteKindSite,sub2api:x.siteKindDirect,unknown:x.siteKindUnknown},Ut=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 Wt(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}let Gt=[`#3b82f6`,`#06b6d4`,`#8b5cf6`,`#f59e0b`,`#10b981`,`#ef4444`,`#ec4899`,`#6366f1`,`#f97316`,`#14b8a6`],Kt={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??Kt.total,byModel:r.byModel??{},byDay:r.byDay??{},...r.byDayModels===void 0?{}:{byDayModels:r.byDayModels},...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}:{},...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 Jt=!1;async function Yt(e=0){try{let t=await fetch(`/api/billing/pricing`);if(!t.ok){Jt=!1;return}let n=await t.text(),r=JSON.parse(n);if(typeof r!=`object`||!r||!(`source`in r)){Jt=!1;return}let i=r;if(i.source===`builtin`&&e<3){if(e===0){if(Jt)return;Jt=!0}setTimeout(()=>{Yt(e+1)},2e3);return}Jt=!1,se(i)}catch{Jt=!1}}async function Xt(){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 Zt(){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 Qt(){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 $t(){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 en(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 tn(e){let{wide:t,t:n,onOpen:i,monthCost:o,todayCost:s,weekCost:l,days:u,vendorStatus:d,dash:f,floatPrefs:p,subscriptions:m,cardPrefs:h,monthTokens:g,todayTokens:_,weekTokens:v}=e,y=(0,r.useMemo)(()=>p.targets.map(e=>m.find(t=>t.provider===e)).filter(e=>e!==void 0),[p.targets,m]),[b,ee]=(0,r.useState)(0),S=y.length===0?0:Math.min(b,y.length-1),C=y[S];(0,r.useEffect)(()=>{if(p.mode!==`subscription`||y.length<2)return;let e=setInterval(()=>ee(e=>(e+1)%y.length),1500);return()=>clearInterval(e)},[p.mode,y.length]);let te=(0,a.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,a.jsx)(`path`,{d:`M4 7h16v11H4z`}),(0,a.jsx)(`path`,{d:`M4 10h16`}),(0,a.jsx)(`path`,{d:`M8 14h3`})]});if(!t)return(0,a.jsx)(`button`,{type:`button`,className:x.railButton,"data-testid":`billing-rail-button`,onClick:i,title:`${n(`billing.title`)} · ${B(o)}`,children:te});let w=h.metric===`tokens`,T=u.map(e=>w?e.tokens:e.cost),ne=Math.max(...T,0),E=T.map(e=>ne>0?4+e/ne*12:4);return(0,a.jsxs)(`span`,{className:x.triggerWrap,children:[(0,a.jsxs)(`button`,{type:`button`,className:x.trigger,"data-testid":`billing-trigger`,onClick:i,title:`${n(`billing.title`)} · ${B(o)}`,children:[(0,a.jsx)(`span`,{className:x.triggerIcon,"data-testid":`billing-trigger-icon`,children:te}),(0,a.jsxs)(`span`,{className:x.triggerMain,children:[(0,a.jsxs)(`span`,{className:x.triggerPrimary,children:[(0,a.jsx)(`span`,{className:x.triggerLabel,children:n(w?`billing.triggerMonthTokens`:`billing.triggerMonth`)}),w?(0,a.jsx)(`span`,{className:x.triggerMetric,"data-testid":`billing-trigger-month-tokens`,children:V(g)}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:x.triggerYen,"aria-hidden":`true`,children:B(o).charAt(0)}),(0,a.jsx)(`span`,{className:x.triggerMetric,children:B(o).slice(1)})]})]}),(0,a.jsx)(`span`,{className:x.triggerSub,"data-testid":`billing-trigger-today`,children:w?`${n(`billing.triggerToday`)} ${V(_)} · ${n(`billing.weekCost`)} ${V(v)}`:`${n(`billing.triggerToday`)} ${B(s)} · ${n(`billing.weekCost`)} ${B(l)}`})]}),(0,a.jsx)(`span`,{className:x.triggerSpark,"data-testid":`billing-trigger-spark`,"aria-hidden":`true`,children:E.map((e,t)=>(0,a.jsx)(`span`,{className:t===E.length-1?x.triggerSparkHot:x.triggerSparkBar,style:{height:`${e}px`}},u[t]?.date??String(t)))})]}),(0,a.jsx)(`span`,{className:c(x.triggerPop,p.mode===`subscription`&&x.triggerPopSubscription),"data-testid":`billing-trigger-pop`,"aria-hidden":`true`,children:p.mode===`subscription`?(0,a.jsx)(a.Fragment,{children:y.length===0?(0,a.jsx)(`span`,{className:x.triggerPopEmpty,children:n(`billing.floatNoTargets`)}):(0,a.jsxs)(a.Fragment,{children:[C!==void 0&&(0,a.jsxs)(`div`,{className:x.floatSub,"data-testid":`billing-float-subscription`,children:[(0,a.jsxs)(`div`,{className:x.floatSubHead,children:[(0,a.jsx)(`span`,{className:x.floatSubName,children:C.displayName}),C.plan!==void 0&&(0,a.jsx)(`span`,{className:x.floatSubPlan,children:C.plan})]}),C.windows.map(e=>(()=>{let t=Math.min(100,Math.max(0,e.usedPercent)),r=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,a.jsxs)(`div`,{className:x.subscriptionWindow,children:[(0,a.jsx)(`span`,{className:x.subscriptionWindowLabel,children:Lt(e.kind,n)}),(0,a.jsx)(`span`,{className:x.subscriptionTrack,"aria-hidden":`true`,children:(0,a.jsx)(`span`,{className:c(x.subscriptionFill,t>=100&&x.subscriptionFillOver,t>=80&&t<100&&x.subscriptionFillWarn),style:{width:`${t}%`}})}),(0,a.jsxs)(`span`,{className:x.subscriptionMeta,children:[(0,a.jsx)(`span`,{className:c(x.subscriptionPct,r&&x.subscriptionExhausted),children:r?n(`billing.subscriptionExhausted`):n(`billing.subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,a.jsx)(`span`,{className:x.subscriptionReset,children:n(`billing.subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${Wt(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]}),y.length>1&&(0,a.jsx)(`span`,{className:x.triggerPopSwitcher,"data-testid":`billing-float-switcher`,children:(0,a.jsxs)(`span`,{className:x.triggerPopSwitchCount,children:[S+1,`/`,y.length]})})]})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:x.popHead,children:(0,a.jsx)(`span`,{className:x.popTitle,children:n(`billing.popTitle`)})}),(0,a.jsxs)(`span`,{className:x.metricGrid,children:[(0,a.jsxs)(`span`,{className:x.metricCell,children:[(0,a.jsx)(`span`,{className:x.metricLabel,children:n(`billing.monthCost`)}),(0,a.jsx)(`span`,{className:c(x.metricValue,x.metricValuePrimary),children:B(o)})]}),(0,a.jsxs)(`span`,{className:x.metricCell,children:[(0,a.jsx)(`span`,{className:x.metricLabel,children:n(`billing.tokenTotal`)}),(0,a.jsx)(`span`,{className:x.metricValue,children:V(f.totalToken)})]}),(0,a.jsxs)(`span`,{className:x.metricCell,children:[(0,a.jsx)(`span`,{className:x.metricLabel,children:n(`billing.input`)}),(0,a.jsx)(`span`,{className:x.metricValue,children:V(f.input)})]}),(0,a.jsxs)(`span`,{className:x.metricCell,children:[(0,a.jsx)(`span`,{className:x.metricLabel,children:n(`billing.output`)}),(0,a.jsx)(`span`,{className:x.metricValue,children:V(f.output)})]}),(0,a.jsxs)(`span`,{className:x.metricCell,children:[(0,a.jsx)(`span`,{className:x.metricLabel,children:n(`billing.cacheHit`)}),(0,a.jsx)(`span`,{className:c(x.metricValue,x.metricValueSuccess),children:V(f.cacheRead)})]}),(0,a.jsxs)(`span`,{className:x.metricCell,children:[(0,a.jsx)(`span`,{className:x.metricLabel,children:n(`billing.calls`)}),(0,a.jsx)(`span`,{className:x.metricValue,children:f.calls.toLocaleString()})]})]}),(0,a.jsxs)(`span`,{className:x.popModel,children:[(0,a.jsx)(`span`,{className:x.popModelLabel,children:n(`billing.popTodayModel`)}),d.direct!==void 0||d.sub!==void 0?(0,a.jsxs)(a.Fragment,{children:[d.direct!==void 0&&(0,a.jsxs)(`span`,{className:x.popModelRow,children:[(0,a.jsx)(`span`,{className:c(x.popDot,x.popDotDirect),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:x.popTagPrimary,children:n(`billing.popDirectLead`)}),(0,a.jsx)(`span`,{className:x.popModelName,children:d.direct.name}),(0,a.jsx)(`span`,{className:c(x.popModelStatus,d.direct.low&&x.popModelStatusLow),children:d.direct.text})]}),d.sub!==void 0&&(0,a.jsxs)(`span`,{className:x.popModelRow,children:[(0,a.jsx)(`span`,{className:c(x.popDot,x.popDotSub),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:x.popTagSub,children:n(`billing.popSubLead`)}),(0,a.jsx)(`span`,{className:x.popModelName,children:d.sub.name}),(0,a.jsx)(`span`,{className:c(x.popModelStatus,d.sub.low&&x.popModelStatusLow),children:d.sub.text})]})]}):(0,a.jsxs)(`span`,{className:x.popModelRow,children:[(0,a.jsx)(`span`,{className:c(x.popDot,x.popDotNeutral),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:x.popModelStatus,children:n(`billing.popNoConsumption`)})]})]})]})})]})}function nn({balance:e,days:t,dailyBurn:n,money:r,t:i,onClose:o}){let s=t=>t===void 0?void 0:e.currency===`USD`?`$${t.toFixed(2)}`:r(t),c=s(e.totalBalance),l=s(e.grantedBalance),u=s(e.toppedUpBalance);return(0,a.jsxs)(`span`,{className:x.balanceDetailPop,"data-testid":`billing-balance-detail-pop`,children:[(0,a.jsxs)(`span`,{className:x.balanceDetailHead,children:[(0,a.jsx)(`span`,{className:x.balanceDetailTitle,children:e.displayName}),(0,a.jsx)(`button`,{type:`button`,className:x.balanceDetailClose,"aria-label":i(`billing.close`),onClick:o,children:`×`})]}),(0,a.jsxs)(`span`,{className:x.balanceDetailGrid,children:[c!==void 0&&(0,a.jsx)(rn,{label:i(`billing.balance`),value:c}),l!==void 0&&(0,a.jsx)(rn,{label:i(`billing.balanceGranted`),value:l}),u!==void 0&&(0,a.jsx)(rn,{label:i(`billing.balanceTopped`),value:u}),(0,a.jsx)(rn,{label:i(`billing.balanceDaily`),value:r(n)}),(0,a.jsx)(rn,{label:i(`billing.balanceDaysLong`),value:`${t} ${i(`billing.balanceDaysUnit`)}`})]})]})}function rn({label:e,value:t}){return(0,a.jsxs)(`span`,{className:x.balanceDetailRow,children:[(0,a.jsx)(`span`,{className:x.balanceDetailLabel,children:e}),(0,a.jsx)(`span`,{className:x.balanceDetailValue,children:t})]})}function an({userPrices:e,onUserPrices:t,t:n}){let[i,o]=(0,r.useState)(()=>({draft:JSON.stringify(e),invalid:!1}));return(0,a.jsxs)(`section`,{className:x.setCard,"data-testid":`billing-user-prices`,children:[(0,a.jsx)(`div`,{className:x.setCardHead,children:(0,a.jsxs)(`div`,{className:x.setCardMeta,children:[(0,a.jsx)(`h3`,{className:x.setCardTitle,children:n(`billing.userPrices`)}),(0,a.jsx)(`p`,{className:x.setCardDesc,children:n(`billing.userPricesHint`)})]})}),(0,a.jsxs)(`div`,{className:x.ctlCol,children:[(0,a.jsx)(`textarea`,{className:x.budgetInput,"data-testid":`billing-user-price-editor`,rows:8,style:i.invalid?{borderColor:`red`}:void 0,value:i.draft,"aria-label":n(`billing.userPrices`),onChange:e=>{o({draft:e.target.value,invalid:!1})}}),(0,a.jsx)(`div`,{className:x.ctlRow,children:(0,a.jsx)(`button`,{type:`button`,className:x.exportButton,"data-testid":`billing-user-price-save`,onClick:()=>{try{let e=JSON.parse(i.draft);if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`shape`);let n={};for(let[t,r]of Object.entries(e)){if(typeof r!=`object`||!r)continue;let e=r,i=Number(e.input),a=Number(e.cacheHit),o=Number(e.output);[i,a,o].every(e=>Number.isFinite(e)&&e>=0)&&(n[t]={input:i,cacheHit:a,output:o,...e.currency===`USD`?{currency:`USD`}:{}})}o({draft:i.draft,invalid:!1}),t(n)}catch{o({draft:i.draft,invalid:!0})}},children:n(`billing.userPriceSave`)})})]})]})}function on({stats:e,t,onClose:n,userPrices:o,onUserPrices:s,health:l,balances:u,reconcile:d,quotas:f,relayQuotas:p,currency:m,onCurrency:h,turns:g,renderSlot:_,budgetEnabled:v,budgetAmount:y,onToggleBudget:b,onBudgetAmount:ee,peakConfig:S,onPeakConfig:C,onPreviewPeak:w,floatPrefs:T,onFloatPrefs:ne,cardPrefs:E,onCardPrefs:re,quotasStale:ie}){let[ae,oe]=(0,r.useState)(`cost`),{total:D,byModel:se,byDay:O}=e,[k,le]=(0,r.useState)(`overview`),[A,ue]=(0,r.useState)(7),[de,fe]=(0,r.useState)(()=>{try{return window.localStorage.getItem(`dsh-billing:reconcile-dismissed`)??``}catch{return``}}),pe=()=>{let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`},me=(0,r.useCallback)(()=>{let e=pe();fe(e);try{window.localStorage.setItem(`dsh-billing:reconcile-dismissed`,e)}catch{}},[]),[he,j]=(0,r.useState)(`month`),M=(0,r.useMemo)(()=>f.filter(e=>e.status===`ok`&&e.windows.length>0).map(e=>({id:e.provider,label:e.displayName})),[f]),[ge,N]=(0,r.useState)(),[P,F]=(0,r.useState)(),[I,L]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=!0;return $t().then(t=>{e&&t!==void 0&&L(t)}),()=>{e=!1}},[]);let ye=(0,r.useCallback)(()=>{let e=!I;L(e),en(e).then(t=>{t||L(!e)})},[I]),R=ce(),H=e=>B(m===`usd`?z(e):e,m),Ee=m===`usd`?`en`:`zh`,U=e=>ut(e,Ee),W=(e,n)=>e===0?t(`billing.free`):Ce(we(e,n,m,R.rate),m===`usd`?`USD`:`CNY`),De=(0,r.useMemo)(()=>Qe([...g].reverse()),[g]),G={peak:e.byTier?.peak.cost??0,offPeak:e.byTier?.offPeak.cost??0},ke=G.peak/2,Ae=(0,r.useMemo)(()=>{let n=e.byRole;if(n===void 0)return[];let r=n.user+n.assistant+n.tool;return r<=0?[]:[{label:t(`billing.roleUser`),value:n.user,seg:x.shareSegUser},{label:t(`billing.roleAssistant`),value:n.assistant,seg:x.shareSegAssistant},{label:t(`billing.roleTool`),value:n.tool,seg:x.shareSegTool}].map(e=>({...e,pct:e.value/r*100}))},[e.byRole,t]),Me=kt(O,$()),Ne=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,a.jsx)(`span`,{className:x.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,a.jsx)(`span`,{className:x.na,children:`—`});let n=e.currency===`USD`?`$${e.totalBalance.toFixed(2)}`:H(e.totalBalance),r=e.currency===`USD`?e.totalBalance*R.rate:e.totalBalance,i=Me>0?Math.floor(r/Me):void 0;return(0,a.jsxs)(`span`,{className:x.balanceCell,children:[(0,a.jsx)(`span`,{children:n}),i!==void 0&&i>=0&&(0,a.jsx)(`button`,{type:`button`,className:c(x.balanceDaysBadge,i<=3&&x.balanceDaysBadgeLow),"data-testid":`billing-balance-days-badge`,title:t(`billing.balanceDays`).replace(`{days}`,String(i)),"aria-label":`${e.displayName} ${t(`billing.balanceDays`).replace(`{days}`,String(i))}`,onClick:()=>{N(ge===e.provider?void 0:e.provider)},children:`?`}),ge===e.provider&&(0,a.jsx)(nn,{balance:e,days:i??0,dailyBurn:Me,money:H,t,onClose:()=>{N(void 0)}})]})},K=D.cacheHit+D.cacheMiss>0?D.cacheHit/(D.cacheHit+D.cacheMiss)*100:0,Le=Object.keys(O).sort(),q=$(),Re=O[q]?.cost??0,ze=q.slice(0,7),Ve=q.slice(0,4),J=Le.reduce((e,t)=>e+(t.startsWith(ze)?O[t]?.cost??0:0),0),He=Le.reduce((e,t)=>e+(t.startsWith(Ve)?O[t]?.cost??0:0),0),We=(0,r.useMemo)(()=>At(O,ze,q)+f.reduce((e,t)=>e+(t.planType===`code`?t.subscriptionAmount??0:0),0),[O,ze,q,f]),Ge=(0,r.useMemo)(()=>{let e=v&&y>0?J/y*100:NaN;return{pct:Number.isFinite(e)?Math.max(0,Math.min(100,e)):He>0?Math.max(0,Math.min(100,J/He*100)):0,over:Number.isFinite(e)&&e>=100,label:t(Number.isFinite(e)?`billing.budget`:`billing.monthCost`)}},[v,y,J,He,t]),Y=v&&y>0?J/y*100:0,Ke=(0,r.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,r.useMemo)(()=>Object.entries(O).map(([e,t])=>({date:e,value:t.cost})),[O]),Xe=Mt(O),Ze=Nt(O),$e=(0,r.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,r.useMemo)(()=>Object.entries(se).filter(([,e])=>e.calls>0).map(([e,t])=>{let n=_e(e),r=n.key===`other`,i=r?Et(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:Se(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:Gt[t%Gt.length]??`#8b95a3`})),[se]),Z=(0,r.useMemo)(()=>{let e=0,t=0,n=0;for(let r of X){let i=r.officialCost;i>0&&(e+=i),t+=r.officialCalls,n+=Math.max(0,r.calls-r.officialCalls)}let r=Math.max(0,X.reduce((e,t)=>e+(t.actual??0),0)-e);if(!(e<=0&&r<=0&&t<=0&&n<=0))return{officialCost:e,officialCalls:t,thirdCost:r,thirdCalls:n}},[X]),nt=(0,r.useMemo)(()=>{let e=new Map;for(let t of f){if(t.status===`not-configured`)continue;let n=Ot(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=Et(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:Ne(n),dot:Ft(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:Ft(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]),ot=X.reduce((e,t)=>e+t.estimated,0),st=D.cost>0?D.cost:ot,ct=D.calls>0?st/D.calls:0,lt=(0,r.useMemo)(()=>X.map(e=>({key:e.key,name:e.name,color:e.color})),[X]),dt=$e.length>=2?$e.at(-2)?.cost??0:0,ft=dt>0?(Re-dt)/dt*100:0;return(0,a.jsx)(i.Modal,{open:!0,onClose:n,title:t(`billing.title`),headless:!0,className:c(x.dashboardModal,`dsh-billing-modal`),children:(0,a.jsxs)(`div`,{className:x.dashboard,"data-testid":`billing-dashboard`,children:[(0,a.jsxs)(`div`,{className:x.dashboardHead,"data-testid":`billing-dashboard-head`,children:[(0,a.jsxs)(`div`,{children:[_(`billing.dashboard.decor`,{position:`head`}),(0,a.jsxs)(`div`,{className:x.headTitleRow,children:[(0,a.jsx)(`h2`,{className:x.dashboardTitle,children:t(`billing.title`)}),_(`billing.dashboard.decor`,{position:`headTitle`})]}),(0,a.jsxs)(`p`,{className:x.dashboardSubtitle,children:[t(`billing.lastUpdated`),` `,qe,e.timezone===void 0?null:` · ${e.timezone.name} (${e.timezone.offset})`]})]}),(0,a.jsxs)(`div`,{className:x.dashboardRight,children:[(0,a.jsx)(`span`,{className:x.currencyToggle,role:`group`,"aria-label":t(`billing.currency`),children:[`cny`,`usd`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(x.currencyButton,m===e&&x.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,a.jsxs)(`span`,{className:c(x.healthBadge,l.available?x.healthBadgeOk:x.healthBadgeBad),children:[(0,a.jsx)(`span`,{className:c(x.healthDot,l.available?x.healthOk:x.healthBad),"aria-hidden":`true`}),l.available?`${l.models} 模型可用${l.failures>0?` · ${l.failures} 厂商失效`:``}`:`${l.failures} 厂商不可用`]}),(0,a.jsx)(`button`,{type:`button`,className:x.closeButton,"aria-label":t(`billing.close`),"data-testid":`billing-close`,onClick:n,children:(0,a.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,a.jsx)(`path`,{d:`M18 6 6 18`}),(0,a.jsx)(`path`,{d:`m6 6 12 12`})]})})]})]}),(0,a.jsx)(`nav`,{className:x.tabNav,"data-testid":`billing-tab-nav`,role:`tablist`,"aria-label":t(`billing.title`),children:yt.map(e=>(0,a.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":k===e.id,className:c(x.tabButton,k===e.id&&x.tabButtonActive),"data-testid":`billing-tab-${e.id}`,onClick:()=>{le(e.id)},children:t(e.labelKey)},e.id))}),(0,a.jsxs)(`div`,{className:x.dashboardBody,children:[k===`overview`&&(0,a.jsxs)(`div`,{className:x.tabPanel,"data-testid":`billing-tab-panel-overview`,children:[d?.kind===`drift`&&d.spent!==void 0&&de!==pe()&&(0,a.jsxs)(`div`,{className:x.reconcileNotice,"data-testid":`billing-reconcile-notice`,role:`note`,children:[(0,a.jsx)(`span`,{className:x.reconcileIcon,"aria-hidden":`true`,children:(0,a.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,a.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,a.jsx)(`line`,{x1:`12`,y1:`10`,x2:`12`,y2:`16`}),(0,a.jsx)(`line`,{x1:`12`,y1:`7.5`,x2:`12.01`,y2:`7.5`})]})}),(0,a.jsx)(`span`,{className:x.reconcileText,children:t(`billing.reconcileDrift`).replace(`{provider}`,d.provider??``).replace(`{spent}`,H(d.spent)).replace(`{today}`,H(d.todayOfficialCost??0))}),(0,a.jsx)(`button`,{type:`button`,className:x.reconcileDismiss,"data-testid":`billing-reconcile-dismiss`,onClick:me,children:t(`billing.reconcileDismiss`)})]}),(0,a.jsxs)(`section`,{className:x.hero,"data-testid":`billing-hero`,children:[_(`billing.dashboard.decor`,{position:`hero`}),(0,a.jsxs)(`div`,{className:x.heroTop,children:[(0,a.jsxs)(`div`,{className:x.heroMain,children:[(0,a.jsx)(`span`,{className:x.heroLabel,children:t(`billing.monthCost`)}),(0,a.jsxs)(`div`,{className:x.heroReadout,children:[(0,a.jsx)(`span`,{className:x.heroCurrency,"aria-hidden":`true`,children:m===`usd`?`$`:`¥`}),(0,a.jsx)(`span`,{className:x.heroValue,children:H(J).slice(1)})]}),(0,a.jsxs)(`span`,{className:x.heroMeta,children:[D.calls.toLocaleString(),` `,t(`billing.calls`)]})]}),(0,a.jsxs)(`div`,{className:x.heroGauge,"data-testid":`billing-hero-gauge`,children:[(0,a.jsxs)(`svg`,{className:x.heroGaugeSvg,viewBox:`0 0 120 120`,"aria-hidden":`true`,children:[(0,a.jsx)(`circle`,{className:x.heroGaugeTrack,cx:`60`,cy:`60`,r:`52`}),(0,a.jsx)(`circle`,{className:c(x.heroGaugeArc,Ge.over&&x.heroGaugeArcOver),cx:`60`,cy:`60`,r:`52`,style:{strokeDasharray:`${Ge.pct/100*326.7} 326.7`}})]}),(0,a.jsxs)(`span`,{className:x.heroGaugeCenter,children:[(0,a.jsxs)(`span`,{className:c(x.heroGaugePct,Ge.over&&x.heroGaugePctOver),children:[Ge.pct.toFixed(0),`%`]}),(0,a.jsx)(`span`,{className:x.heroGaugeLabel,children:Ge.label})]})]})]}),v&&y>0&&(0,a.jsxs)(`div`,{className:x.heroBudget,"data-testid":`billing-hero-budget`,children:[(0,a.jsx)(`span`,{className:x.heroBudgetLabel,children:t(`billing.budget`)}),(0,a.jsx)(`div`,{className:x.heroBudgetTrack,role:`progressbar`,"aria-valuenow":Math.min(Y,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`billing.budget`),children:(0,a.jsx)(`div`,{className:c(x.heroBudgetFill,Y>=100&&x.heroBudgetFillOver),style:{width:`${Math.min(Y,100)}%`}})}),(0,a.jsxs)(`span`,{className:x.heroBudgetValue,children:[H(J),` / `,H(y),` · `,Y.toFixed(1),`%`]})]}),(0,a.jsxs)(`div`,{className:x.heroSide,children:[(0,a.jsxs)(`div`,{className:x.heroSideItem,children:[(0,a.jsx)(`span`,{className:x.heroSideLabel,children:t(`billing.yearCost`)}),(0,a.jsx)(`span`,{className:x.heroSideValue,children:H(He)})]}),(0,a.jsxs)(`div`,{className:x.heroSideItem,children:[(0,a.jsx)(`span`,{className:x.heroSideLabel,children:t(`billing.todayCost`)}),(0,a.jsxs)(`span`,{className:x.heroSideValue,children:[H(Re),(0,a.jsxs)(`span`,{className:c(x.delta,ft>=0?x.deltaUp:x.deltaDown),children:[ft>=0?`▲`:`▼`,` `,Math.abs(ft).toFixed(1),`%`]})]})]}),We>0&&(0,a.jsxs)(`div`,{className:x.heroSideItem,children:[(0,a.jsx)(`span`,{className:x.heroSideLabel,children:t(`billing.monthProjected`)}),(0,a.jsx)(`span`,{className:x.heroSideValue,children:H(We)})]}),We<=0&&(0,a.jsx)(`span`,{className:x.heroSideSpacer,"aria-hidden":`true`})]})]}),(e.unpricedModels?.length??0)>0&&(0,a.jsx)(`div`,{className:x.unpricedHint,"data-testid":`billing-unpriced-hint`,children:t(`billing.unpricedHint`).replace(`{count}`,String(e.unpricedModels?.length??0))}),(0,a.jsxs)(`section`,{className:x.kpiGrid,"data-testid":`billing-kpi-grid`,children:[(0,a.jsxs)(`div`,{className:x.kpiTile,"data-testid":`billing-kpi-tile`,children:[(0,a.jsx)(`span`,{className:x.kpiLabel,children:t(`billing.cacheHitRate`)}),(0,a.jsx)(`span`,{className:c(x.kpiValue,x.kpiGreen),children:Te(K)}),(0,a.jsxs)(`span`,{className:x.kpiDetail,children:[V(D.cacheHit),` / `,V(D.cacheHit+D.cacheMiss)]})]}),(0,a.jsxs)(`div`,{className:x.kpiTile,children:[(0,a.jsx)(`span`,{className:x.kpiLabel,children:t(`billing.tokens`)}),(0,a.jsx)(`span`,{className:x.kpiValue,children:V(D.input+D.output)}),(0,a.jsxs)(`span`,{className:x.kpiDetail,children:[t(`billing.inputTokens`),` `,V(D.input),` · `,t(`billing.outputTokens`),` `,V(D.output)]})]}),(0,a.jsxs)(`div`,{className:x.kpiTile,children:[(0,a.jsx)(`span`,{className:x.kpiLabel,children:t(`billing.avgCost`)}),(0,a.jsx)(`span`,{className:x.kpiValue,children:H(ct)}),(0,a.jsxs)(`span`,{className:x.kpiDetail,children:[t(`billing.calls`),` `,D.calls.toLocaleString()]})]}),(0,a.jsxs)(`div`,{className:x.kpiTile,children:[(0,a.jsx)(`span`,{className:x.kpiLabel,children:t(`billing.calls`)}),(0,a.jsx)(`span`,{className:x.kpiValue,children:D.calls.toLocaleString()}),(0,a.jsxs)(`span`,{className:x.kpiDetail,children:[X.length,` `,t(`billing.models`)]})]})]}),(0,a.jsxs)(`section`,{className:x.panel,"data-testid":`billing-panel-heatmap`,children:[(0,a.jsxs)(`div`,{className:x.panelHead,children:[(0,a.jsx)(`h3`,{className:x.panelTitle,children:t(`billing.heatmap`)}),(0,a.jsx)(`div`,{className:x.heatmapRangeSwitch,"data-testid":`billing-heatmap-range`,role:`group`,"aria-label":t(`billing.heatmap`),children:[`month`,`year`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(x.heatmapRangeButton,he===e&&x.heatmapRangeButtonActive),"data-testid":`billing-heatmap-range-${e}`,"aria-pressed":he===e,onClick:()=>{j(e)},children:t(e===`month`?`billing.heatmapMonth`:`billing.heatmapYear`)},e))}),(0,a.jsxs)(`span`,{className:x.panelHint,"data-testid":`billing-heatmap-summary`,children:[t(`billing.activeDays`),` `,Xe,` · `,t(`billing.streakDays`),` `,Ze]})]}),(0,a.jsx)(Je,{days:Ye,currency:m,t,range:he})]})]}),k===`settings`&&(0,a.jsxs)(`div`,{className:x.tabPanel,"data-testid":`billing-tab-panel-settings`,children:[(0,a.jsxs)(`section`,{className:x.setCard,"data-testid":`billing-budget`,children:[(0,a.jsxs)(`div`,{className:x.setCardHead,children:[(0,a.jsxs)(`div`,{className:x.setCardMeta,children:[(0,a.jsx)(`h3`,{className:x.setCardTitle,children:t(`billing.budget`)}),(0,a.jsx)(`p`,{className:x.setCardDesc,children:t(`billing.budgetHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":v,"aria-label":t(`billing.budget`),"data-testid":`billing-budget-toggle`,className:c(x.switch,v&&x.switchOn),onClick:b,children:(0,a.jsx)(`span`,{className:x.switchKnob})})]}),v&&(0,a.jsxs)(`div`,{className:x.ctlCol,children:[(0,a.jsxs)(`div`,{className:x.ctlRow,children:[(0,a.jsx)(`span`,{className:x.ctlLabel,children:t(`billing.budgetAmount`)}),(0,a.jsxs)(`span`,{className:x.inp,"data-testid":`billing-budget-input-wrap`,children:[(0,a.jsx)(`span`,{className:x.affix,"aria-hidden":`true`,children:`¥`}),(0,a.jsx)(`input`,{className:x.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=>{ee(e.target.valueAsNumber)}})]})]}),y>0&&(()=>{let e=J/y*100;return(0,a.jsx)(`div`,{className:x.ctlRowStretch,children:(0,a.jsx)(`div`,{className:x.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,a.jsx)(`div`,{className:c(x.progFill,e>=100&&x.budgetFillOver,e>=80&&e<100&&x.budgetFillWarn),style:{width:`${Math.min(e,100)}%`}})})})})(),y>0&&(0,a.jsx)(`p`,{className:x.setCardDesc,"data-testid":`billing-budget-value`,children:t(`billing.budgetSummary`).replace(`{used}`,H(J)).replace(`{total}`,H(y))})]})]}),(0,a.jsxs)(`section`,{className:x.setCard,"data-testid":`billing-peak-alert-settings`,children:[(0,a.jsxs)(`div`,{className:x.setCardHead,children:[(0,a.jsxs)(`div`,{className:x.setCardMeta,children:[(0,a.jsx)(`h3`,{className:x.setCardTitle,children:t(`billing.peakAlert`)}),(0,a.jsx)(`p`,{className:x.setCardDesc,children:t(`billing.peakAlertHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":S.enabled,"aria-label":t(`billing.peakAlert`),"data-testid":`billing-peak-alert-toggle`,className:c(x.switch,S.enabled&&x.switchOn),onClick:()=>{C({...S,enabled:!S.enabled})},children:(0,a.jsx)(`span`,{className:x.switchKnob})})]}),S.enabled&&(0,a.jsxs)(`div`,{className:x.ctlCol,children:[(0,a.jsxs)(`label`,{className:x.ctlRow,children:[(0,a.jsx)(`span`,{className:x.ctlLabel,children:t(`billing.peakAlertLeadMin`)}),(0,a.jsx)(`span`,{className:x.inp,children:(0,a.jsx)(`input`,{type:`number`,min:1,max:30,step:1,value:S.leadMin,className:x.budgetInput,"aria-label":t(`billing.peakAlertLeadMin`),onChange:e=>{let t=Number(e.target.valueAsNumber);C({...S,leadMin:Number.isFinite(t)?Math.min(30,Math.max(1,Math.round(t))):S.leadMin})}})})]}),(0,a.jsxs)(`div`,{className:x.ctlRow,children:[(0,a.jsx)(`span`,{className:x.ctlLabel,children:t(`billing.peakAlertPos`)}),(0,a.jsx)(`div`,{className:x.ctlGroup,role:`radiogroup`,"aria-label":t(`billing.peakAlertPos`),children:[`bottom-right`,`center`].map(e=>(0,a.jsxs)(`label`,{className:x.rdo,children:[(0,a.jsx)(`input`,{type:`radio`,name:`peak-pos`,checked:S.position===e,onChange:()=>C({...S,position:e})}),(0,a.jsx)(`span`,{className:x.rdoDot,"aria-hidden":`true`}),t(e===`bottom-right`?`billing.peakAlertPosCorner`:`billing.peakAlertPosCenter`)]},e))})]}),(0,a.jsxs)(`div`,{className:x.ctlRow,children:[(0,a.jsx)(`span`,{className:x.ctlLabel,children:t(`billing.peakAlertMode`)}),(0,a.jsx)(`div`,{className:x.ctlGroup,role:`radiogroup`,"aria-label":t(`billing.peakAlertMode`),children:[`both`,`peak`,`offPeak`].map(e=>(0,a.jsxs)(`label`,{className:x.rdo,children:[(0,a.jsx)(`input`,{type:`radio`,name:`peak-mode`,checked:S.mode===e,onChange:()=>C({...S,mode:e})}),(0,a.jsx)(`span`,{className:x.rdoDot,"aria-hidden":`true`}),t(e===`both`?`billing.peakAlertModeBoth`:e===`peak`?`billing.peakAlertModePeak`:`billing.peakAlertModeOff`)]},e))})]}),(0,a.jsxs)(`label`,{className:x.ctlRow,children:[(0,a.jsx)(`span`,{className:x.ctlLabel,children:t(`billing.peakAlertWebNotify`)}),(0,a.jsx)(`input`,{type:`checkbox`,checked:S.webNotify,"aria-label":t(`billing.peakAlertWebNotify`),onChange:e=>{C({...S,webNotify:e.target.checked})}})]}),(0,a.jsx)(`div`,{className:x.ctlRow,children:(0,a.jsx)(`button`,{type:`button`,className:x.btn,onClick:w,children:t(`billing.peakAlertPreview`)})})]})]}),(0,a.jsx)(`section`,{className:x.setCard,"data-testid":`billing-usage-stats-tool-setting`,children:(0,a.jsxs)(`div`,{className:x.setCardHead,children:[(0,a.jsxs)(`div`,{className:x.setCardMeta,children:[(0,a.jsx)(`h3`,{className:x.setCardTitle,children:t(`billing.usageStatsTool`)}),(0,a.jsx)(`p`,{className:x.setCardDesc,children:t(`billing.usageStatsToolHint`)})]}),(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":I,"aria-label":t(`billing.usageStatsTool`),"data-testid":`billing-usage-stats-tool-toggle`,className:c(x.switch,I&&x.switchOn),onClick:ye,children:(0,a.jsx)(`span`,{className:x.switchKnob})})]})}),(0,a.jsxs)(`section`,{className:x.setCard,"data-testid":`billing-float-setting`,children:[(0,a.jsx)(`div`,{className:x.setCardHead,children:(0,a.jsxs)(`div`,{className:x.setCardMeta,children:[(0,a.jsx)(`h3`,{className:x.setCardTitle,children:t(`billing.floatWindow`)}),(0,a.jsx)(`p`,{className:x.setCardDesc,children:t(`billing.floatWindowHint`)})]})}),(0,a.jsxs)(`div`,{className:x.ctlCol,children:[(0,a.jsxs)(`div`,{className:x.ctlRow,children:[(0,a.jsx)(`span`,{className:x.ctlLabel,children:t(`billing.floatMode`)}),(0,a.jsxs)(`div`,{className:x.ctlGroup,"data-testid":`billing-float-mode`,children:[(0,a.jsx)(`button`,{type:`button`,className:c(x.floatModeBtn,T.mode===`combined`&&x.floatModeBtnOn),"data-testid":`billing-float-mode-combined`,onClick:()=>ne({mode:`combined`,targets:T.targets}),children:t(`billing.floatModeCombined`)}),(0,a.jsx)(`button`,{type:`button`,className:c(x.floatModeBtn,T.mode===`subscription`&&x.floatModeBtnOn),"data-testid":`billing-float-mode-subscription`,onClick:()=>ne({mode:`subscription`,targets:T.targets}),children:t(`billing.floatModeSubscription`)})]})]}),T.mode===`subscription`&&(0,a.jsxs)(`div`,{className:x.ctlRow,children:[(0,a.jsx)(`span`,{className:x.ctlLabel,children:t(`billing.floatTargets`)}),(0,a.jsxs)(`span`,{className:x.ctlGroup,"data-testid":`billing-float-targets`,children:[M.map(e=>{let t=T.targets.includes(e.id);return(0,a.jsxs)(`label`,{className:x.floatTarget,children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:t,"data-testid":`billing-float-target-${e.id}`,onChange:()=>ne({mode:`subscription`,targets:t?T.targets.filter(t=>t!==e.id):[...T.targets,e.id]})}),(0,a.jsx)(`span`,{className:x.floatTargetLabel,children:e.label})]},e.id)}),M.length===0&&(0,a.jsx)(`span`,{className:x.setCardDesc,children:t(`billing.floatNoTargetsHint`)})]})]})]})]}),(0,a.jsxs)(`section`,{className:x.setCard,"data-testid":`billing-card-setting`,children:[(0,a.jsx)(`div`,{className:x.setCardHead,children:(0,a.jsxs)(`div`,{className:x.setCardMeta,children:[(0,a.jsx)(`h3`,{className:x.setCardTitle,children:t(`billing.cardDisplay`)}),(0,a.jsx)(`p`,{className:x.setCardDesc,children:t(`billing.cardDisplayHint`)})]})}),(0,a.jsx)(`div`,{className:x.ctlCol,children:(0,a.jsxs)(`div`,{className:x.ctlRow,children:[(0,a.jsx)(`span`,{className:x.ctlLabel,children:t(`billing.cardMetric`)}),(0,a.jsxs)(`div`,{className:x.ctlGroup,"data-testid":`billing-card-metric`,children:[(0,a.jsx)(`button`,{type:`button`,className:c(x.floatModeBtn,E.metric===`money`&&x.floatModeBtnOn),"data-testid":`billing-card-money`,onClick:()=>re({metric:`money`}),children:t(`billing.cardMetricMoney`)}),(0,a.jsx)(`button`,{type:`button`,className:c(x.floatModeBtn,E.metric===`tokens`&&x.floatModeBtnOn),"data-testid":`billing-card-tokens`,onClick:()=>re({metric:`tokens`}),children:t(`billing.cardMetricTokens`)})]})]})})]}),(0,a.jsx)(an,{userPrices:o,onUserPrices:s,t}),(0,a.jsx)(Pe,{t,version:e.pluginVersion})]}),k===`trends`&&(0,a.jsxs)(`div`,{className:x.tabPanel,"data-testid":`billing-tab-panel-trends`,children:[(0,a.jsxs)(`section`,{className:c(x.ubCard,x.trendPanel),"data-testid":`billing-panel-trend`,children:[(0,a.jsxs)(`div`,{className:x.ubCardHead,children:[(0,a.jsx)(`h3`,{className:x.ubCardTitle,children:t(`billing.trend`)}),_(`billing.dashboard.decor`,{position:`trend`}),(0,a.jsxs)(`span`,{className:x.ubCardControlGroup,children:[(0,a.jsx)(`span`,{className:x.rangeToggle,role:`group`,"aria-label":t(`billing.trend`),children:[7,30].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(x.rangeButton,A===e&&x.rangeButtonActive),"aria-pressed":A===e,"data-testid":`billing-trend-${e}d`,onClick:()=>{ue(e)},children:t(e===7?`billing.trend7d`:`billing.trend30d`)},e))}),(0,a.jsx)(`span`,{className:x.rangeToggle,role:`group`,"aria-label":t(`billing.trendMetric`),children:[`cost`,`tokens`].map(e=>(0,a.jsx)(`button`,{type:`button`,className:c(x.rangeButton,ae===e&&x.rangeButtonActive),"aria-pressed":ae===e,"data-testid":`billing-trend-metric-${e}`,onClick:()=>{oe(e)},children:t(e===`cost`?`billing.trendMetricCost`:`billing.trendMetricTokens`)},e))})]}),(0,a.jsx)(`span`,{className:x.ubCardSub,children:qe})]}),(0,a.jsx)(Oe,{data:$e,models:lt,currency:m,metric:ae})]}),g.length>0&&(0,a.jsxs)(`section`,{className:x.ubCard,"data-testid":`billing-panel-rounds`,children:[(0,a.jsxs)(`div`,{className:x.ubCardHead,children:[(0,a.jsx)(`h3`,{className:x.ubCardTitle,children:t(`billing.rounds`)}),De.length>0&&(0,a.jsxs)(`span`,{className:x.ubTagError,"data-testid":`billing-rounds-flag-count`,children:[De.length,` `,t(`billing.anomaly`)]})]}),(0,a.jsx)(`p`,{className:x.ubCardSub,children:t(`billing.roundsHint`).replace(`{count}`,String(g.length))}),(0,a.jsx)(Ue,{rounds:g,flags:De,currency:m,t})]}),e.byTier!==void 0&&(()=>{let e=G.peak+G.offPeak;if(e<=0)return null;let n=G.peak/e*100;return(0,a.jsxs)(`section`,{className:x.ubCard,"data-testid":`billing-panel-share`,children:[(0,a.jsxs)(`div`,{className:x.ubCardHead,children:[(0,a.jsx)(`h3`,{className:x.ubCardTitle,children:t(`billing.peakShare`)}),(0,a.jsx)(`span`,{className:x.ubCardSub,children:t(`billing.peakSharePerCall`)})]}),(0,a.jsxs)(`div`,{className:x.shareTrack,"data-testid":`billing-share-track`,children:[(0,a.jsx)(`div`,{className:c(x.shareSeg,x.shareSegPeak),style:{width:`${n}%`}}),(0,a.jsx)(`div`,{className:c(x.shareSeg,x.shareSegOff),style:{width:`${100-n}%`}})]}),(0,a.jsxs)(`div`,{className:x.shareLegend,children:[(0,a.jsxs)(`span`,{className:x.shareItem,children:[(0,a.jsx)(`span`,{className:x.shareDot,style:{background:`var(--dsw-static-blue-500)`}}),t(`billing.peak`),(0,a.jsxs)(`span`,{className:x.shareValue,"data-testid":`billing-share-peak`,children:[H(G.peak),` · `,n.toFixed(1),`%`]})]}),(0,a.jsxs)(`span`,{className:x.shareItem,children:[(0,a.jsx)(`span`,{className:x.shareDot,style:{background:`color-mix(in srgb, var(--dsw-static-blue-500) 30%, var(--dsw-alias-bg-module-platform))`}}),t(`billing.offPeak`),(0,a.jsxs)(`span`,{className:x.shareValue,"data-testid":`billing-share-offpeak`,children:[H(G.offPeak),` · `,(100-n).toFixed(1),`%`]})]})]}),ke>0&&(0,a.jsx)(`div`,{className:x.staleNotice,"data-testid":`billing-share-savings`,children:t(`billing.offPeakSavings`).replace(`{amount}`,H(ke))})]})})()]}),k===`providers`&&(0,a.jsxs)(`div`,{className:x.tabPanel,"data-testid":`billing-tab-panel-providers`,children:[e.bySite!==void 0&&Object.keys(e.bySite).length>0&&(0,a.jsxs)(`section`,{className:x.panel,"data-testid":`billing-panel-relay-sites`,children:[(0,a.jsx)(`div`,{className:x.panelHead,children:(0,a.jsx)(`h3`,{className:x.panelTitle,children:t(`billing.panelRelay`)})}),(0,a.jsx)(`div`,{className:x.providerGroupList,"data-testid":`billing-relay-sites`,children:Object.entries(e.bySite).sort((e,t)=>(t[1].cost??0)-(e[1].cost??0)).map(([e,n])=>{let r=Rt(e,t);return(0,a.jsxs)(`div`,{className:x.siteRow,"data-testid":`billing-relay-site`,children:[(0,a.jsxs)(`span`,{className:x.siteRowName,children:[(0,a.jsx)(`span`,{className:c(x.siteKindTag,Vt[r.kind]),children:zt(r.kind,t)}),(0,a.jsx)(`span`,{className:x.siteRowTitle,children:r.name})]}),(0,a.jsxs)(`span`,{className:x.siteRowMeta,children:[(0,a.jsx)(`span`,{className:x.siteRowCost,children:H(n.cost)}),(0,a.jsxs)(`span`,{className:x.siteRowCalls,children:[n.calls,` `,t(`billing.relayCalls`)]})]})]},e)})})]}),p.length>0&&(0,a.jsxs)(`section`,{className:x.panel,"data-testid":`billing-panel-relay-quota`,children:[(0,a.jsx)(`div`,{className:x.panelHead,children:(0,a.jsx)(`h3`,{className:x.panelTitle,children:t(`billing.panelRelayQuota`)})}),(0,a.jsx)(`div`,{className:x.providerGroupList,"data-testid":`billing-relay-quotas`,children:p.map(e=>(0,a.jsxs)(`div`,{className:x.siteRow,"data-testid":`billing-relay-quota`,children:[(0,a.jsxs)(`span`,{className:x.siteRowName,children:[(0,a.jsx)(`span`,{className:c(x.siteKindTag,Ht[e.kind]),children:Bt(e.kind,t)}),(0,a.jsx)(`span`,{className:x.siteRowTitle,children:e.origin})]}),(0,a.jsxs)(`span`,{className:x.siteRowMeta,children:[e.balance!==void 0&&(0,a.jsxs)(`span`,{className:x.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,a.jsxs)(`span`,{className:c(x.siteRowCalls,n&&x.siteRowCallsLow),children:[t(`billing.relayWindowUsed`),` `,e.usedPercent,`%`]},e.kind)}):(0,a.jsx)(`span`,{className:x.siteRowCalls,children:t(`billing.relayNoQuota`)})]})]},e.route))})]}),(0,a.jsxs)(`section`,{className:x.panel,"data-testid":`billing-panel-providers`,children:[(0,a.jsxs)(`div`,{className:x.panelHead,children:[(0,a.jsx)(`h3`,{className:x.panelTitle,children:t(`billing.providerBilling`)}),_(`billing.dashboard.decor`,{position:`models`}),(0,a.jsx)(`span`,{className:x.panelHint,children:e.updatedAt===void 0?``:`${t(`billing.lastUpdated`)} ${Wt(e.updatedAt)}`})]}),ie&&(0,a.jsx)(`div`,{className:x.staleNotice,"data-testid":`billing-subscriptions-stale`,children:t(`billing.subscriptionsStale`)}),nt.length===0?(0,a.jsx)(`div`,{className:x.emptyRow,"data-testid":`billing-provider-empty`,children:t(`billing.noData`)}):(0,a.jsx)(`div`,{className:x.providerGroupList,"data-testid":`billing-provider-groups`,children:nt.map(e=>(0,a.jsxs)(`div`,{className:x.providerGroup,"data-testid":`billing-provider-group`,children:[(0,a.jsxs)(`div`,{className:x.providerGroupHead,children:[(0,a.jsxs)(`span`,{className:x.providerGroupTitle,children:[(0,a.jsx)(`span`,{className:c(x.healthDot,e.dot),"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:x.providerGroupName,children:U(e.name)})]}),(0,a.jsxs)(`span`,{className:x.providerGroupMeta,children:[e.subscriptions.length>0&&(0,a.jsxs)(`span`,{className:x.providerGroupBadge,"data-testid":`billing-provider-sub-count`,children:[e.subscriptions.length,` 套餐`]}),!Fe(e)&&e.balance!==void 0&&(0,a.jsxs)(`span`,{className:x.providerGroupBalance,"data-testid":`billing-provider-balance`,children:[(0,a.jsx)(`span`,{className:x.providerGroupBalanceLabel,children:t(`billing.balance`)}),Ie(e.balance)]})]})]}),e.models.length>0&&(0,a.jsx)(`div`,{className:c(x.tableScroll,x.modelTableScroll),"data-testid":`billing-table-scroll`,children:(0,a.jsxs)(`table`,{className:x.modelTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`billing.model`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.calls`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.inputTokens`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.outputTokens`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.cacheHitRate`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.actual`)})]})}),(0,a.jsx)(`tbody`,{children:e.models.map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:x.modelCell,children:[(0,a.jsx)(sn,{provider:e.provider,colorVar:e.color}),(0,a.jsxs)(`span`,{children:[(0,a.jsxs)(`span`,{className:x.modelName,children:[e.name,e.uncatalogued&&(0,a.jsx)(`span`,{className:x.uncataloguedTag,"data-testid":`billing-uncatalogued-tag`,children:t(`billing.uncatalogued`)}),e.estimatedPricing&&(0,a.jsx)(`span`,{className:x.estimatedTag,"data-testid":`billing-estimated-tag`,children:t(`billing.estimatedPricing`)})]}),(0,a.jsx)(`span`,{className:x.modelProvider,children:U(e.provider)})]})]})}),(0,a.jsx)(`td`,{className:x.numCol,children:e.calls.toLocaleString()}),(0,a.jsx)(`td`,{className:x.numCol,children:V(e.input)}),(0,a.jsx)(`td`,{className:x.numCol,children:V(e.output)}),(0,a.jsx)(`td`,{className:x.numCol,children:Te(e.cacheHitRate)}),(0,a.jsx)(`td`,{className:x.numCol,children:e.plan?(0,a.jsx)(`span`,{className:x.planTag,children:t(`billing.subscriptionIncluded`)}):e.actual===void 0?(0,a.jsx)(`span`,{className:x.na,children:`—`}):(()=>{let t=e.officialCost,n=e.actual-t;return t>0&&n>0?(0,a.jsxs)(`span`,{className:x.bucketCost,children:[(0,a.jsx)(`span`,{className:x.bucketOfficial,children:H(t)}),(0,a.jsx)(`span`,{className:x.bucketSep,children:`/`}),(0,a.jsx)(`span`,{className:x.bucketThird,children:H(n)})]}):H(e.actual)})()})]},e.key))})]})}),e.subscriptions.length>0&&(0,a.jsx)(`div`,{className:x.subscriptionGrid,"data-testid":`billing-subscriptions-grid`,children:e.subscriptions.map(e=>{let n=It(e.status,t);return(0,a.jsxs)(`div`,{className:x.subscriptionCard,"data-testid":`billing-subscription-card`,children:[(0,a.jsxs)(`div`,{className:x.subscriptionHead,children:[(0,a.jsx)(`span`,{className:x.subscriptionName,children:U(e.displayName)}),e.planType===`code`&&(()=>{let n=te(e.provider),r=n===void 0?void 0:t(`billing.subscriptionFeePerMonth`).replace(`{amount}`,n.currency===`USD`?`$${n.amount}`:`¥${n.amount}`);return(0,a.jsxs)(`span`,{className:x.subscriptionPlan,"data-kind":`code`,children:[r??(e.subscriptionAmount!==void 0&&e.subscriptionAmount>0?t(`billing.subscriptionFeePerMonth`).replace(`{amount}`,H(e.subscriptionAmount)):t(`billing.planTypeCode`)),n?.label!==void 0&&(0,a.jsx)(`span`,{className:x.subscriptionTier,"data-testid":`billing-tier-${e.provider}`,children:n.label}),n!==void 0&&(0,a.jsx)(`span`,{className:x.subscriptionAuto,"data-testid":`billing-auto-${e.provider}`,children:t(`billing.subscriptionAutoDetect`)})]})})(),e.planType===`token`&&(0,a.jsx)(`span`,{className:x.subscriptionPlan,"data-kind":`token`,children:t(`billing.planTypeToken`)}),e.plan!==void 0&&(0,a.jsx)(`span`,{className:x.subscriptionPlan,children:e.plan})]}),n!==``&&(0,a.jsx)(`div`,{className:x.subscriptionStatus,children:n}),e.windows.length===0&&n===``&&(0,a.jsx)(`div`,{className:x.subscriptionStatus,children:t(`billing.subscriptionNoApi`)}),e.windows.map(e=>(()=>{let n=Math.min(100,Math.max(0,e.usedPercent)),r=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,a.jsxs)(`div`,{className:x.subscriptionWindow,children:[(0,a.jsx)(`span`,{className:x.subscriptionWindowLabel,children:Lt(e.kind,t)}),(0,a.jsx)(`span`,{className:x.subscriptionTrack,"aria-hidden":`true`,children:(0,a.jsx)(`span`,{className:c(x.subscriptionFill,n>=100&&x.subscriptionFillOver,n>=80&&n<100&&x.subscriptionFillWarn),style:{width:`${n}%`}})}),(0,a.jsxs)(`span`,{className:x.subscriptionMeta,children:[(0,a.jsx)(`span`,{className:c(x.subscriptionPct,r&&x.subscriptionExhausted),children:r?t(`billing.subscriptionExhausted`):t(`billing.subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,a.jsx)(`span`,{className:x.subscriptionReset,children:t(`billing.subscriptionReset`).replace(`{date}`,`${$(new Date(e.resetsAt).getTime())} ${Wt(new Date(e.resetsAt).getTime())}`)})]})]},e.kind)})())]},e.provider)})})]},e.name))})]}),(0,a.jsxs)(`div`,{className:x.exportBar,"data-testid":`billing-export-bar`,role:`group`,"aria-label":t(`billing.export`),children:[(0,a.jsx)(`span`,{className:x.exportLabel,children:t(`billing.export`)}),(0,a.jsx)(`button`,{type:`button`,className:x.exportButton,"data-testid":`billing-export-day`,onClick:()=>{at(it(`usage-daily`,`csv`,Object.keys(O)),et(O),`text/csv`)},children:t(`billing.exportCsvDay`)}),e.bySession!==void 0&&(0,a.jsx)(`button`,{type:`button`,className:x.exportButton,"data-testid":`billing-export-sessions`,onClick:()=>{at(it(`usage-sessions`,`csv`,Object.keys(O)),rt(e.bySession??[]),`text/csv`)},children:t(`billing.exportCsvSession`)}),e.bySite!==void 0&&(0,a.jsx)(`button`,{type:`button`,className:x.exportButton,"data-testid":`billing-export-sites`,onClick:()=>{at(it(`usage-sites`,`csv`,Object.keys(O)),tt(e.bySite??{}),`text/csv`)},children:t(`billing.exportCsvSite`)}),(0,a.jsx)(`button`,{type:`button`,className:x.exportButton,"data-testid":`billing-export-json`,onClick:()=>{at(it(`usage-stats`,`json`,Object.keys(O)),JSON.stringify(e,null,2),`application/json`)},children:t(`billing.exportJson`)})]}),Ae.length>0&&(0,a.jsxs)(`section`,{className:x.panel,"data-testid":`billing-panel-roles`,children:[(0,a.jsxs)(`div`,{className:x.panelHead,children:[(0,a.jsx)(`h3`,{className:x.panelTitle,children:t(`billing.roleCost`)}),(0,a.jsx)(`span`,{className:x.panelHint,children:t(`billing.roleHint`)})]}),(0,a.jsx)(`div`,{className:x.shareTrack,"data-testid":`billing-role-track`,children:Ae.map(e=>(0,a.jsx)(`div`,{className:c(x.shareSeg,e.seg),style:{width:`${e.pct}%`}},e.label))}),(0,a.jsx)(`div`,{className:x.shareLegend,children:Ae.map(e=>(0,a.jsxs)(`span`,{className:x.shareItem,children:[(0,a.jsx)(`span`,{className:c(x.shareDot,e.seg)}),e.label,(0,a.jsxs)(`span`,{className:x.shareValue,children:[H(e.value),` · `,e.pct.toFixed(1),`%`]})]},e.label))})]}),Z!==void 0&&(()=>{let e=Z.officialCost+Z.thirdCost,n=e>0?Z.officialCost/e*100:0;return(0,a.jsxs)(`div`,{className:x.ubStatGrid,"data-testid":`billing-panel-buckets`,children:[(0,a.jsxs)(`div`,{className:x.ubStatCard,children:[(0,a.jsxs)(`span`,{className:x.ubStatLabel,children:[t(`billing.official`),`(=DeepSeek 直连)`]}),(0,a.jsx)(`span`,{className:x.ubStatValue,children:H(Z.officialCost)}),(0,a.jsxs)(`span`,{className:x.ubStatDetail,children:[Z.officialCalls,` `,t(`billing.calls`),` · `,n.toFixed(1),`%`]})]}),(0,a.jsxs)(`div`,{className:x.ubStatCard,children:[(0,a.jsxs)(`span`,{className:x.ubStatLabel,children:[t(`billing.thirdParty`),`(中转)`]}),(0,a.jsx)(`span`,{className:x.ubStatValue,children:H(Z.thirdCost)}),(0,a.jsxs)(`span`,{className:x.ubStatDetail,children:[Z.thirdCalls,` `,t(`billing.calls`),` · `,(100-n).toFixed(1),`%`]})]})]})})(),e.byWorkspace!==void 0&&e.byWorkspace.length>0&&(0,a.jsxs)(`section`,{className:x.ubCard,"data-testid":`billing-panel-workspaces`,children:[(0,a.jsxs)(`div`,{className:x.ubCardHead,children:[(0,a.jsx)(`h3`,{className:x.ubCardTitle,children:t(`billing.workspaces`)}),(0,a.jsx)(`span`,{className:x.ubCardSub,children:t(`billing.workspacesHint`)})]}),(0,a.jsx)(`ul`,{className:x.rowlist,children:e.byWorkspace.map(n=>(0,a.jsxs)(r.Fragment,{children:[(0,a.jsx)(`li`,{children:(0,a.jsxs)(`button`,{type:`button`,className:x.rowline,"data-testid":`billing-workspace-${n.name}`,onClick:()=>{F(P===n.name?void 0:n.name)},children:[(0,a.jsx)(`span`,{className:x.rowlineName,children:n.name}),(0,a.jsxs)(`span`,{className:x.rowlineRight,children:[(0,a.jsx)(`span`,{className:x.num,children:H(n.cost)}),(0,a.jsxs)(`span`,{className:x.rowlineMuted,children:[n.calls,` `,t(`billing.calls`)]}),(0,a.jsx)(`span`,{className:x.rowlineChev,"aria-hidden":`true`,children:`›`})]})]})}),P===n.name&&(0,a.jsx)(`li`,{className:x.rowlineDrillWrap,children:e.bySession?.filter(e=>bt(e.cwd)===n.name).slice(0,5).map(e=>(0,a.jsxs)(`div`,{className:x.rowlineDrill,children:[(0,a.jsx)(`span`,{className:x.rowlineName,children:e.title??e.id.slice(0,8)}),(0,a.jsxs)(`span`,{className:x.rowlineRight,children:[(0,a.jsx)(`span`,{className:x.num,children:H(e.cost)}),(0,a.jsxs)(`span`,{className:x.rowlineMuted,children:[e.calls,` `,t(`billing.calls`)]})]})]},e.id))})]},n.name))})]}),e.bySession!==void 0&&(0,a.jsxs)(`section`,{className:x.ubCard,"data-testid":`billing-panel-sessions`,children:[(0,a.jsxs)(`div`,{className:x.ubCardHead,children:[(0,a.jsx)(`h3`,{className:x.ubCardTitle,children:t(`billing.sessions`)}),(0,a.jsx)(`span`,{className:x.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,a.jsx)(`div`,{className:x.staleNotice,"data-testid":`billing-sessions-stale`,children:t(`billing.staleLedgerNotice`).replace(`{count}`,String(e.staleLedgerSessions))}),(0,a.jsx)(`div`,{className:x.ubTablewrap,"data-testid":`billing-sessions-table`,children:(0,a.jsxs)(`table`,{className:x.ubTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`billing.sessionTitle`)}),(0,a.jsx)(`th`,{children:t(`billing.project`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.calls`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.actual`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.lastActive`)})]})}),(0,a.jsxs)(`tbody`,{children:[e.bySession.length===0&&(0,a.jsx)(`tr`,{children:(0,a.jsx)(`td`,{colSpan:5,className:x.emptyRow,children:t(`billing.noData`)})}),e.bySession.slice(0,20).map(e=>(0,a.jsxs)(`tr`,{children:[(0,a.jsxs)(`td`,{children:[(0,a.jsx)(`span`,{className:x.modelName,children:e.title??e.id.slice(0,8)}),e.stale===!0&&(0,a.jsx)(`span`,{className:c(x.ubTag,x.ubTagNeutral),"data-testid":`billing-session-stale`,children:t(`billing.sessionStaleBadge`)})]}),(0,a.jsx)(`td`,{children:(0,a.jsx)(`span`,{className:x.modelProvider,children:bt(e.cwd)??`—`})}),(0,a.jsx)(`td`,{className:x.numCol,children:e.calls.toLocaleString()}),(0,a.jsx)(`td`,{className:x.numCol,children:H(e.cost)}),(0,a.jsx)(`td`,{className:x.numCol,children:e.lastActive>0?`${$(e.lastActive)} ${Wt(e.lastActive)}`:`—`})]},e.id))]})]})})]})]}),k===`token`&&(0,a.jsxs)(`div`,{className:x.tabPanel,"data-testid":`billing-tab-panel-token`,children:[(0,a.jsx)(Be,{stats:e,trendDays:A,onTrendDays:ue,t}),e.perf!==void 0&&(0,a.jsxs)(`section`,{className:x.panel,"data-testid":`billing-panel-perf`,children:[(0,a.jsxs)(`div`,{className:x.panelHead,children:[(0,a.jsx)(`h3`,{className:x.panelTitle,children:t(`billing.perfTitle`)}),(0,a.jsx)(`span`,{className:x.panelHint,children:t(`billing.perfHint`)})]}),(0,a.jsx)(je,{perf:e.perf,models:lt,t})]})]}),k===`pricing`&&(0,a.jsxs)(`div`,{className:x.tabPanel,"data-testid":`billing-tab-panel-pricing`,children:[(0,a.jsxs)(`div`,{className:x.ubAlert,role:`note`,children:[(0,a.jsxs)(`div`,{className:x.ubAlertLeft,children:[(0,a.jsxs)(`span`,{className:x.ubRate,"data-testid":`billing-rate`,children:[t(`billing.todayRate`),` 1 USD = `,B(R.rate)]}),(0,a.jsx)(`span`,{className:c(x.ubTag,R.live?x.ubTagSuccess:x.ubTagNeutral),children:R.live?t(`billing.rateLive`):t(`billing.rateBuiltin`)})]}),(0,a.jsx)(`p`,{className:x.ubAlertNote,children:t(`billing.pricingTip`)})]}),(0,a.jsxs)(`section`,{className:x.ubCard,"data-testid":`billing-panel-pricing`,children:[(0,a.jsxs)(`div`,{className:x.ubCardHead,children:[(0,a.jsx)(`h3`,{className:x.ubCardTitle,children:t(`billing.pricing`)}),(0,a.jsx)(`span`,{className:x.ubCardSub,children:t(`billing.pricingUnit`)})]}),(0,a.jsx)(`div`,{className:x.ubTablewrap,children:(0,a.jsxs)(`table`,{className:x.ubTable,children:[(0,a.jsx)(`thead`,{children:(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`th`,{children:t(`billing.thModel`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.thInputMiss`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.thInputHit`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.output`)}),(0,a.jsx)(`th`,{className:x.numCol,children:t(`billing.band`)})]})}),(0,a.jsx)(`tbody`,{children:be().map(e=>{let n=e.price.input>0||e.price.output>0;return(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)(`tr`,{children:[(0,a.jsx)(`td`,{children:(0,a.jsxs)(`span`,{className:x.ubModel,children:[(0,a.jsx)(sn,{provider:e.provider,colorVar:xe(e.colorVar)}),(0,a.jsxs)(`span`,{className:x.ubModelName,children:[e.name,e.uncatalogued&&(0,a.jsx)(`span`,{className:x.ubTagAlert,"data-testid":`billing-price-uncatalogued`,children:t(`billing.uncatalogued`)}),e.promo!==void 0&&ve(e.promo,Date.now())&&(0,a.jsx)(`span`,{className:x.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,a.jsx)(`td`,{className:x.numCol,children:n?W(e.price.input,e.price.currency):(0,a.jsx)(`span`,{className:x.na,children:`—`})}),(0,a.jsx)(`td`,{className:x.numCol,children:n?W(e.price.cacheHit,e.price.currency):(0,a.jsx)(`span`,{className:x.na,children:`—`})}),(0,a.jsx)(`td`,{className:x.numCol,children:n?W(e.price.output,e.price.currency):(0,a.jsx)(`span`,{className:x.na,children:`—`})}),(0,a.jsx)(`td`,{className:x.numCol,children:n&&e.price.offPeak!==void 0&&e.peakHours!==void 0?(0,a.jsxs)(`span`,{className:x.ubPricepair,children:[(0,a.jsxs)(`span`,{className:x.ubChipPeak,children:[(0,a.jsx)(`span`,{className:x.ubChipLabel,children:e.tierSemantics===`latency`?t(`billing.ubStd`):t(`billing.ubPeak`)}),(0,a.jsxs)(`span`,{className:x.num,children:[W(e.price.input,e.price.currency),` / `,W(e.price.output,e.price.currency)]})]}),(0,a.jsxs)(`span`,{className:x.ubChipOff,children:[(0,a.jsx)(`span`,{className:x.ubChipLabel,children:e.tierSemantics===`latency`?`Flex`:t(`billing.ubOff`)}),(0,a.jsxs)(`span`,{className:x.num,children:[W(e.price.offPeak.input,e.price.currency),` / `,W(e.price.offPeak.output,e.price.currency)]})]})]}):n?(0,a.jsx)(`span`,{className:x.flatTag,children:t(`billing.flat`)}):(0,a.jsx)(`span`,{className:x.na,children:`—`})})]}),(e.extraRows??[]).map(t=>(0,a.jsxs)(`tr`,{className:x.ubExtraRow,children:[(0,a.jsxs)(`td`,{children:[(0,a.jsx)(`span`,{className:x.ubExtraName,children:t.label}),t.note!==void 0&&(0,a.jsx)(`span`,{className:x.ubExtraNote,children:t.note})]}),(0,a.jsx)(`td`,{className:x.numCol,children:t.input===void 0?(0,a.jsx)(`span`,{className:x.na,children:`—`}):W(t.input,e.price.currency)}),(0,a.jsx)(`td`,{className:x.numCol,children:(0,a.jsx)(`span`,{className:x.na,children:`—`})}),(0,a.jsx)(`td`,{className:x.numCol,children:t.output===void 0?(0,a.jsx)(`span`,{className:x.na,children:`—`}):W(t.output,e.price.currency)}),(0,a.jsx)(`td`,{className:x.numCol,children:(0,a.jsx)(`span`,{className:x.na,children:`—`})})]},`${e.key}:${t.label}`))]},e.key)})})]})})]}),(0,a.jsxs)(`section`,{className:x.ubCard,children:[(0,a.jsx)(`div`,{className:x.ubCardHead,children:(0,a.jsx)(`h3`,{className:x.ubCardTitle,children:t(`billing.pricingNotes`)})}),(0,a.jsxs)(`ul`,{className:x.ubNotes,children:[(0,a.jsxs)(`li`,{className:x.ubNotesItem,children:[(0,a.jsx)(`span`,{className:x.ubNotesTerm,children:t(`billing.cacheHit`)}),(0,a.jsx)(`span`,{className:x.ubNotesDesc,children:t(`billing.noteCache`)})]}),(0,a.jsxs)(`li`,{className:x.ubNotesItem,children:[(0,a.jsx)(`span`,{className:x.ubNotesTerm,children:t(`billing.peakBand`)}),(0,a.jsx)(`span`,{className:x.ubNotesDesc,children:t(`billing.noteBand`)})]}),(0,a.jsxs)(`li`,{className:x.ubNotesItem,children:[(0,a.jsx)(`span`,{className:x.ubNotesTerm,children:t(`billing.pricingSource`)}),(0,a.jsx)(`span`,{className:x.ubNotesDesc,children:t(`billing.noteSource`)})]})]})]})]}),_(`billing.dashboard.decor`,{position:`footer`})]}),(0,a.jsxs)(`footer`,{className:x.modalFooter,"data-testid":`billing-footer`,children:[(0,a.jsx)(`span`,{children:t(`billing.footer`)}),(0,a.jsx)(`span`,{children:t(`billing.footerCredit`).replace(`{version}`,e.pluginVersion===void 0?`—`:`v${e.pluginVersion}`)})]})]})})}function sn({provider:e,colorVar:t}){let n=ft(e);return n===void 0?(0,a.jsx)(`span`,{className:x.vendorLetter,style:t===void 0?void 0:{background:t},"aria-hidden":`true`,children:e.trim().charAt(0).toUpperCase()}):(0,a.jsx)(`img`,{className:x.vendorLogo,src:n,alt:``,"aria-hidden":`true`})}function cn(e){let{t,checkModels:n,publishCosts:i,registerOpen:o,renderSlot:s,useStore:c,actions:l}=e,[u,p]=(0,r.useState)(Kt),[m,_]=(0,r.useState)(St),[b,x]=(0,r.useState)([]),[ee,S]=(0,r.useState)(void 0),[C,te]=(0,r.useState)([]),[w,T]=(0,r.useState)(!1),[ne,E]=(0,r.useState)([]),[re,ie]=(0,r.useState)(`cny`),[oe,D]=(0,r.useState)(()=>d()),se=(0,r.useCallback)(e=>{D(e),f(e)},[]),[k,le]=(0,r.useState)(()=>h()),ue=(0,r.useCallback)(e=>{le(e),g(e)},[]),[de,fe]=(0,r.useState)(()=>{let e=v();return ae(e),e}),pe=(0,r.useCallback)(e=>{fe(e),ae(e),y(e)},[]),me=(0,r.useMemo)(()=>jt(u),[u,de]),he=re===`usd`?`en`:`zh`,j=(0,r.useCallback)((e,n)=>{let r=(he===`en`?ct:st)[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},[he,t]),[M,ge]=(0,r.useState)(!1),N=(0,r.useCallback)(()=>{ge(!1)},[]),P=(0,r.useCallback)(()=>{qt().then(e=>{e!==null&&p(jt(e))}),Xt().then(({balances:e,reconcile:t})=>{e.length>0&&x(e),S(t)}),Zt().then(e=>{e.length>0&&te(e),T(!1)}).catch(()=>{T(!0)}),Qt().then(e=>{E(e)}).catch(()=>{})},[]),F=(0,r.useCallback)(()=>{P(),Yt(),ge(!0)},[P]);(0,r.useEffect)(()=>{P(),Yt()},[P]),(0,r.useEffect)(()=>{let e=setInterval(()=>{P(),Yt()},Ut);return()=>{clearInterval(e)}},[P]),(0,r.useEffect)(()=>{let e=!0;return n().then(t=>{e&&(_(t),O(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),ve=u.byDay[I]?.cost??0,ye=Pt(u.byDay).reduce((e,t)=>e+t.cost,0),be=(0,r.useMemo)(()=>Pt(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]),xe=Object.entries(u.byDay).filter(([e])=>e.startsWith(I.slice(0,7))).reduce((e,[,t])=>e+t.input+t.output,0),R=(()=>{let e=u.byDay[I];return e===void 0?0:e.input+e.output})(),Se=be.reduce((e,t)=>e+t.tokens,0),z=c(e=>e.enabled),Ce=c(e=>e.amount),we=c(e=>e.tierAlertDays),V=c(e=>e.lastTierSwitchAt),[Te,H]=(0,r.useState)(()=>ht()),[Ee,U]=(0,r.useState)(null),[W,De]=(0,r.useState)(null),[Oe,G]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{let e=setInterval(()=>G(Date.now()),Ut);return()=>{clearInterval(e)}},[]);let ke=(0,r.useCallback)(e=>{H(e),gt(e)},[]),Ae=(0,r.useCallback)(()=>{De({entering:A(Date.now())===`peak`?`offPeak`:`peak`,atMs:Date.now()+3*6e4})},[]),je=Ce>0?Ce:u.budget??0,Me=(0,r.useCallback)(()=>{let e=!z;l.setEnabled(e),e&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission()},[l,z]);(0,r.useEffect)(()=>{if(!z||je<=0)return;let e=L/je*100,t=$(),n=xt.filter(n=>e>=n&&we?.[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}`,B(L)).replace(`{budget}`,B(je)).replace(`{pct}`,String(r));try{new Notification(j(`billing.budget`),{body:i})}catch{}},[z,je,L,we,l,j]),(0,r.useEffect)(()=>{let e=_t(Oe,Te,V);if(e===null||(l.markTierSwitchAlerted(e.atMs),U(e),!Te.webNotify)||typeof Notification>`u`||Notification.permission!==`granted`)return;let t=Math.max(1,Math.round((e.atMs-Oe)/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{}},[Oe,V,Te,l,j]);let Ne=c(e=>e.lastBalanceAlertDay),Pe=(0,r.useMemo)(()=>{if(b.length===0)return;let e=u.lowBalanceThreshold??50,t=kt(u.byDay,I),n=ce().rate;for(let r of b){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}}},[b,u.lowBalanceThreshold,u.byDay,I]);(0,r.useEffect)(()=>{if(Pe===void 0)return;let e=$();if(Ne===e||(l.markBalanceAlerted(e),typeof Notification>`u`||Notification.permission!==`granted`))return;let t=j(`billing.balanceLowBody`).replace(`{name}`,Pe.name).replace(`{balance}`,B(Pe.cny)).replace(`{days}`,Pe.days===void 0?`—`:String(Pe.days));try{new Notification(j(`billing.balance`),{body:t})}catch{}},[Pe,Ne,l,j]);let Fe=(0,r.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=_e(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=b.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)}`:B(t.totalBalance),r=ce().rate;return{text:n,low:(t.currency===`USD`?t.totalBalance*r:t.totalBalance)<(u.lowBalanceThreshold??50)}},a=e=>{let t=C.find(t=>t.displayName===e||Ot(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,b,C,I]),Ie=(0,r.useMemo)(()=>{let e=u.total;return{totalToken:e.input+e.output,input:e.input,output:e.output,cacheRead:e.cacheHit,calls:e.calls}},[u]);(0,r.useEffect)(()=>{i({todayCost:ve,monthCost:L})},[ve,L,i]),(0,r.useEffect)(()=>o(F),[o,F]);let K=(0,r.useMemo)(()=>u.byTurn??[],[u.byTurn]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(tn,{...e,t:j,onOpen:F,monthCost:L,todayCost:ve,weekCost:ye,days:be,vendorStatus:Fe,dash:Ie,cardPrefs:k,monthTokens:xe,todayTokens:R,weekTokens:Se,floatPrefs:oe,subscriptions:C}),M&&(0,a.jsx)(on,{stats:me,t:j,onClose:N,userPrices:de,onUserPrices:pe,health:m,balances:b,...ee===void 0?{}:{reconcile:ee},quotas:C,relayQuotas:ne,currency:re,onCurrency:ie,turns:K,renderSlot:s,budgetEnabled:z,budgetAmount:je,onToggleBudget:Me,onBudgetAmount:l.setAmount,peakConfig:Te,onPeakConfig:ke,onPreviewPeak:Ae,floatPrefs:oe,onFloatPrefs:se,cardPrefs:k,onCardPrefs:ue,quotasStale:w}),(Ee!==null||W!==null)&&(0,a.jsx)(vt,{hit:Ee??W,config:Te,t:j,onDismiss:()=>{U(null),De(null)}})]})}function ln(e,t){return t===void 0||e?.bySession===void 0?0:e.bySession.find(e=>e.id===t)?.cost??0}function un(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 dn(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 fn(){try{let e=await fetch(`/api/billing/usage-stats`);if(!e.ok)return null;let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n)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 pn(){try{let e=await fetch(`/api/billing/subscriptions`);if(!e.ok)return[];let t=JSON.parse(await e.text());if(typeof t!=`object`||!t||!(`quotas`in t))return[];let n=t.quotas;return Array.isArray(n)?n:[]}catch{return[]}}function mn(e){switch(e){case`session`:return`billing.subscriptionSession`;case`weekly`:return`billing.subscriptionWeekly`;case`monthly`:return`billing.subscriptionMonthly`;default:return`billing.subscriptionBilling`}}function hn({useSession:e,t}){let n=e(e=>e.sessionId),[i,o]=(0,r.useState)(null),[s,c]=(0,r.useState)([]),[l,u]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{let e=!1,t=()=>{fn().then(t=>{!e&&t!==null&&o(t)}),pn().then(t=>{e||c(t)}),e||u(Date.now())};t();let n=setInterval(t,3e4);return()=>{e=!0,clearInterval(n)}},[n]);let d=(0,r.useMemo)(()=>ln(i,n),[i,n]),f=(0,r.useMemo)(()=>un(i,n),[i,n]),p=me(l),m=(0,r.useMemo)(()=>dn(s),[s]),h=e=>B(e,`cny`);if(n===void 0)return null;let g=d>0||f>0,_=p.tier===`peak`;return(0,a.jsxs)(`span`,{className:x.feeBar,"data-testid":`billing-live-cost-bar`,children:[(0,a.jsx)(`span`,{className:_?x.feeChipPrimary:x.feeChipOff,"data-testid":`billing-live-tier`,children:t(_?`billing.tierPeak`:`billing.tierOff`)}),(0,a.jsx)(`span`,{className:x.feeCount,children:j(p.nextSwitchInMs)}),(0,a.jsx)(`span`,{className:x.feeSuffix,children:t(_?`billing.tierToOff`:`billing.tierToPeak`)}),g&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{className:x.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:x.feeItem,"data-testid":`billing-live-turn`,children:[t(`billing.liveTurn`),` `,(0,a.jsx)(`span`,{className:x.feeNum,children:h(f)})]}),(0,a.jsx)(`span`,{className:x.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:x.feeItem,"data-testid":`billing-live-session`,children:[t(`billing.liveSession`),` `,(0,a.jsx)(`span`,{className:x.feeNum,children:h(d)})]})]}),m.map(e=>(0,a.jsxs)(`span`,{children:[(0,a.jsx)(`span`,{className:x.feeSep,"aria-hidden":`true`,children:`·`}),(0,a.jsxs)(`span`,{className:e.pct<=10?x.feeChipError:x.feeChipAlert,"data-testid":`billing-live-quota`,children:[e.name,` `,t(mn(e.kind)),` `,e.pct,`%`]})]},`${e.name}:${e.kind}`))]})}function gn(){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 _n(){return(0,o.defineStore)({init:()=>({enabled:!1,amount:0,tierAlertDays:{},lastBalanceAlertDay:``,lastTierSwitchAt:0}),persist:`dsh.ui-usage-billing.budget`,actions:{setEnabled:(e,t)=>{e.enabled=t},setAmount:(e,t)=>{e.amount=Number.isFinite(t)&&t>0?t:0},markTierAlerted:(e,t,n)=>{e.tierAlertDays??={};for(let r of t)e.tierAlertDays[String(r)]=n},markBalanceAlerted:(e,t)=>{e.lastBalanceAlertDay=t},markTierSwitchAlerted:(e,t)=>{e.lastTierSwitchAt=t}}})}let vn={enabled:!1,timeout:0};function yn(){try{let e=localStorage.getItem(`dsh-billing-completion-notify-v1`);if(e===null)return{...vn};let t=JSON.parse(e);return{enabled:t.enabled===!0,timeout:typeof t.timeout==`number`?t.timeout:0}}catch{return{...vn}}}function bn(e){return e.completed===!0?!0:e.running===!1}function xn(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)),bn(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=bn(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 Sn=[`slots`,`locale`,`connection`,`sessions`];function Cn(e){let t=gn();e.provide(`billingMetrics`,t);let n=_n(),r=e.get(`connection`);e.effect(()=>e.locale.register(ot,{zh:st,en:ct}),`ui-usage-billing: dictionaries`),e.slots.inject(`sidebar.footer.action`,()=>e.slots.register({name:`sidebar.footer.action`,id:`usage-billing`,order:-10,locale:ot,children:{"billing.dashboard.decor":{kind:`list`,scope:`root`}},store:n,inject:()=>({checkModels:async()=>{try{let{result:e}=await r.api.llm.models({});if(!e.ok)return{checked:!0,available:!1,models:0,failures:0,okProviders:[],badProviders:[]};let t=[];for(let n of e.value.groups)for(let e of n.models)t.push({id:e.id,...typeof e.name==`string`&&e.name!==``?{name:e.name}:{},provider:n.name});return{checked:!0,available:e.value.groups.length>0,models:e.value.groups.reduce((e,t)=>e+t.models.length,0),failures:e.value.failures.length,okProviders:e.value.groups.map(e=>e.name),badProviders:e.value.failures.map(e=>e.name),catalog:t}}catch{return{checked:!0,available:!1,models:0,failures:0,okProviders:[],badProviders:[]}}},publishCosts:e=>{t.publishCosts(e)},registerOpen:e=>t.registerOpen(e)})},cn)),e.slots.inject(`conversation.composer.dock`,()=>e.slots.register({name:`conversation.composer.dock`,id:`usage-billing-cost`,order:0,locale:ot},hn)),e.effect(()=>xn(e.sessions.list,yn),`ui-usage-billing: completion notifier`)}return n.UsageBilling=cn,n.apply=Cn,n.inject=Sn,t.exports}});
|
|
6
6
|
//# sourceMappingURL=client.js.map
|