1import{r as e,j as t,u as s,R as a}from"./vendor-react-DejgYtBM.js";import{i as n,V as l}from"./vendor-charts-CKochBGt.js";import{m as r}from"./marked.esm-B28mcIGu.js";import{M as i,j as o,B as c,Q as d,l as m,a2 as u,z as p,m as x,i as h,f as g,P as f,E as y,g as j,h as b,D as v,o as k,S as w,T as N,a as C,c as _,X as S,F as M}from"./vendor-semi-D8d7bTtM.js";import{N as T,A as z,s as $,w as D,B as I,u as P,U as q,S as F,a as R,$ as A,a2 as Q,J as E,Y as W,as as L,at as H,v as K,au as O,av as B,W as U,g as V}from"./index-BeIIFw6E.js";import{p as Y}from"./i18nField-BKdpiJH6.js";import{_ as X}from"./index-BOZr6JVI.js";import{C as G}from"./Captcha-DqOlJ3BU.js";import{a1 as J,bs as Z,Q as ee,aM as te,af as se,ba as ae,bk as ne,bt as le,bu as re,bc as ie,v as oe,bv as ce,ah as de,bw as me,bx as ue,a7 as pe,by as xe,X as he,R as ge,bz as fe,a3 as ye,ag as je,B as be,aL as ve,x as ke,q as we}from"./vendor-icons-EJvJ5X-w.js";import"./vendor-motion-Chfy_MiU.js";import"./i18nFieldCore-CS3IirKt.js";import"./captchaCrypto-qWW2iG_E.js";const Ne=({t:s,status:a,turnstileEnabled:n,turnstileSiteKey:l})=>{const[r,x]=e.useState(!1),[h,g]=e.useState(!1),[f,y]=e.useState(!1),[j,b]=e.useState(!1),[v,k]=e.useState(0),[w,N]=e.useState(!1),[C,_]=e.useState({enabled:!1,stats:{checked_in_today:!1,total_checkins:0,total_quota:0,checkin_count:0,records:[]}}),[S,M]=e.useState((new Date).toISOString().slice(0,7)),P=e.useMemo(()=>{const e={};return(C.stats?.records||[]).forEach(t=>{e[t.checkin_date]=t.quota_awarded}),e},[C.stats?.records]),q=e.useMemo(()=>{const e=C.stats?.records||[],[t,s]=S.split("-"),a=e.filter(e=>e.checkin_date.startsWith(`${t}-${s}`));return{totalDays:a.length,totalQuota:a.reduce((e,t)=>e+(t.quota_awarded||0),0)}},[C.stats?.records,S]),F=async e=>{x(!0);try{const t=await z.get(`/api/user/checkin?month=${e}`),{success:a,data:n,message:l}=t.data;a?_(n):$(l||s("è·åç¾å°ç¶æå¤±è´¥"))}catch(t){$(s("è·åç¾å°ç¶æå¤±è´¥"))}finally{x(!1)}},R=e=>!!n&&("string"!=typeof e||e.includes("Turnstile")),A=async(e,t)=>{g(!0);try{const a=await(async(e,t)=>{let s="/api/user/checkin";const a=[];return e&&a.push(`turnstile=${encodeURIComponent(e)}`),t&&a.push(`captcha_token=${encodeURIComponent(t)}`),a.length>0&&(s+="?"+a.join("&")),z.post(s)})(e,t),{success:n,data:r,message:i}=a.data;if(n)D(s("ç¾å°æåï¼è·å¾")+" "+T(r.quota_awarded,6)),F(S),y(!1),b(!1);else{if(!e&&R(i))return l?void y(!0):void $("Turnstile is enabled but site key is empty.");e&&R(i)&&k(e=>e+1),$(i||s("ç¾å°å¤±è´¥"))}}catch(a){$(s("ç¾å°å¤±è´¥"))}finally{g(!1)}};if(e.useEffect(()=>{a?.checkin_enabled&&F(S),a?.captcha_checkin_enabled&&N(!0)},[a?.checkin_enabled,a?.captcha_checkin_enabled,S]),!a?.checkin_enabled)return null;const Q=()=>{const e=new Date,t=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`;return S===t};return t.jsxs(t.Fragment,{children:[t.jsx(i,{title:"Security Check",visible:f,footer:null,centered:!0,onCancel:()=>{y(!1),k(e=>e+1)},children:t.jsx("div",{className:"flex justify-center py-2",children:t.jsx(X,{sitekey:l,onVerify:e=>{A(e)},onExpire:()=>{k(e=>e+1)}},v)})}),t.jsx(i,{title:s("æ»å人æºéªè¯"),visible:j,footer:null,centered:!0,onCancel:()=>b(!1),bodyStyle:{padding:0},children:t.jsx(G,{inline:!0,onVerified:e=>{A(null,e)}})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid hsl(var(--border))",background:"hsl(var(--card))",flexWrap:"wrap",gap:"8px"},children:[t.jsxs(o,{spacing:8,children:[t.jsx(c,{icon:t.jsx(J,{size:16}),size:"small",onClick:()=>{const[e,t]=S.split("-").map(Number),s=new Date(e,t-2,1).toISOString().slice(0,7);M(s)},type:"tertiary"}),t.jsx(d,{content:t.jsxs("div",{style:{padding:"8px"},children:[t.jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"hsl(var(--muted-foreground))"},children:s("éæ©æä»½")}),t.jsx("input",{type:"month",value:S,max:(new Date).toISOString().slice(0,7),onChange:e=>M(e.target.value),style:{padding:"6px 10px",border:"1px solid hsl(var(--border))",borderRadius:"4px",fontSize:"14px",cursor:"pointer"}})]}),trigger:"click",position:"bottom",children:t.jsx(c,{icon:t.jsx(Z,{size:16}),size:"small",type:"tertiary",style:{fontWeight:500},children:(()=>{const[e,t]=S.split("-");return`${e}${s("å¹´")}${parseInt(t)}${s("æ")}`})()})}),t.jsx(c,{icon:t.jsx(ee,{size:16}),size:"small",onClick:()=>{const[e,t]=S.split("-").map(Number),a=new Date,n=`${a.getFullYear()}
1-${String(a.getMonth()+1).padStart(2,"0")}`;if(S>=n)return void I(s("ä¸è½æ¥çæªæ¥æä»½çç¾å°è®°å½"));const l=new Date(e,t,1).toISOString().slice(0,7);M(l>n?n:l)},type:"tertiary",disabled:Q()}),t.jsx(c,{size:"small",onClick:()=>{const e=new Date,t=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`;M(t)},type:Q()?"primary":"tertiary",theme:Q()?"solid":"borderless",children:s("ä»å¤©")})]}),t.jsxs(o,{spacing:12,style:{fontSize:"13px",color:"hsl(var(--foreground) / 0.80)"},children:[t.jsxs("span",{children:[s("æ¬æç¾å°"),": ",t.jsx("strong",{style:{color:"hsl(var(--primary))"},children:q.totalDays})," ",s("天")]}),t.jsx("span",{style:{color:"hsl(var(--border))"},children:"|"}),t.jsxs("span",{children:[s("æ»é¢åº¦"),": ",t.jsx("strong",{style:{color:"hsl(var(--success))"},children:T(q.totalQuota,6)})]})]})]}),t.jsx("div",{className:"h-full w-full",children:t.jsx(m,{spinning:r,children:t.jsxs("div",{className:"checkin-calendar-compact",children:[t.jsx("style",{children:"\n .checkin-calendar-compact {\n min-height: 480px;\n height: 100%;\n }\n .checkin-calendar-compact .semi-calendar {\n font-size: 13px;\n height: 100%;\n }\n .checkin-calendar-compact .semi-calendar-month-header {\n padding: 12px 16px;\n }\n .checkin-calendar-compact .semi-calendar-month-week-row {\n height: 32px;\n }\n .checkin-calendar-compact .semi-calendar-month-week-row th {\n font-size: 12px;\n padding: 6px 0;\n font-weight: 600;\n }\n .checkin-calendar-compact .semi-calendar-month-grid-row {\n height: auto;\n }\n .checkin-calendar-compact .semi-calendar-month-grid-row td {\n height: 60px;\n padding: 4px;\n }\n .checkin-calendar-compact .semi-calendar-month-grid-row-cell {\n position: relative;\n height: 100%;\n min-height: 44px;\n }\n .checkin-calendar-compact .semi-calendar-month-grid-row-cell-day {\n position: absolute;\n top: 6px;\n left: 50%;\n transform: translateX(-50%);\n font-size: 13px;\n z-index: 1;\n }\n .checkin-calendar-compact .semi-calendar-month-same {\n background: transparent;\n }\n .checkin-calendar-compact .semi-calendar-month-today .semi-calendar-month-grid-row-cell-day {\n background: hsl(var(--primary));\n color: white;\n border-radius: 50%;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 600;\n }\n .checkin-calendar-compact .semi-calendar-month-grid-row-cell:hover {\n background: hsl(var(--foreground) / 0.02);\n }\n "}),t.jsx(u,{mode:"month",defaultValue:new Date(S+"-01"),displayValue:new Date(S+"-01"),onChange:e=>{const t=e.toISOString().slice(0,7);M(t)},dateGridRender:(e,a)=>(e=>{const a=new Date(e);if(isNaN(a.getTime()))return null;const l=a.getFullYear(),r=String(a.getMonth()+1).padStart(2,"0"),i=String(a.getDate()).padStart(2,"0");if(`${l}-${r}`!==S)return null;const o=P[`${l}-${r}-${i}`],c=void 0!==o,d=(e=>{const t=new Date(e),s=new Date;return t.toDateString()===s.toDateString()})(e);if(d&&c)return t.jsx(p,{content:`${s("å·²ç¾å°ï¼è·å¾")} ${T(o,6)}`,children:t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx("div",{className:"w-7 h-7 rounded-full bg-green-500 flex items-center justify-center shadow-md",children:t.jsx(te,{size:16,className:"text-white",strokeWidth:3})})})});if(d&&!c)return t.jsx(p,{content:s("ç¹å»ç¾å°"),children:t.jsx("div",{className:"absolute inset-0 flex items-center justify-center cursor-pointer hover:bg-green-50 dark:hover:bg-green-900/20 rounded transition-colors",onClick:e=>{e.stopPropagation(),h||C.stats?.checked_in_today||(w?b(!0):n?y(!0):A())},children:t.jsx("div",{className:"w-7 h-7 rounded-full border-2 border-green-500 border-dashed flex items-center justify-center animate-pulse shadow-sm",children:t.jsx(se,{size:14,className:"text-green-500"})})})});if(c)return t.jsx(p,{content:`${s("è·å¾")} ${T(o,6)}`,children:t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx("div",{className:"w-6 h-6 rounded-full bg-green-500 flex items-center justify-center shadow-sm",children:t.jsx(te,{size:12,className:"text-white",strokeWidth:3})})})});const m=(e=>{const t=new Date(e),s=new Date;return s.setHours(0,0,0,0),t.setHours(0,0,0,0),t<s})(e);return m&&!c?t.jsx(p,{content:s("éè¿ç¾å°"),children:t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center opacity-60",children:t.jsx(ae,{size:10,
1className:"text-gray-600 dark:text-gray-300",strokeWidth:2})})})}):null})(e)})]})})})]})},{Text:Ce,Title:_e}=g,Se=()=>{const{t:s}=P(),[a,n]=e.useState(!0),[l,r]=e.useState(null);if(e.useEffect(()=>{let e=!0;return(async()=>{try{const t=await z.get("/api/user/tier"),{success:s,data:a}=t.data;e&&s&&a?.enabled&&r(a)}catch(t){}finally{e&&n(!1)}})(),()=>{e=!1}},[]),!a&&!l)return null;const i=Number(l?.topup_usd)||0,o=Number(l?.next_min_topup)||0,u=l?.next_name&&o>0,p=u?Math.max(o-i,0):0,g=u&&o>0?Math.min(Math.round(i/o*100),100):0;return t.jsx(x,{style:{borderRadius:12},bodyStyle:{padding:20},title:t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t.jsx(le,{size:18}),t.jsx("span",{children:s("æçéçå±çº§")})]}),children:t.jsx(m,{spinning:a,children:l&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[t.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:10},children:[t.jsx(h,{color:"blue",size:"large",style:{fontWeight:600},children:l.name}),t.jsxs(_e,{heading:4,style:{margin:0},children:[l.max_rpm," ",t.jsx(Ce,{type:"tertiary",style:{fontSize:14},children:"RPM"})]})]}),t.jsx(Ce,{type:"tertiary",style:{fontSize:13},children:s("æ¯åéæå¤å¯åèµ· {{n}} 次请æ±",{n:l.max_rpm})}),t.jsxs(Ce,{type:"secondary",style:{fontSize:13},children:[s("累计ææå
å¼"),"ï¼$",i.toFixed(2)]}),u&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[t.jsx(f,{percent:g,"aria-label":"tier-progress"}),t.jsx(Ce,{type:"tertiary",style:{fontSize:12},children:s("è· {{tier}} è¿éå
å¼ ${{amount}}",{tier:l.next_name,amount:p.toFixed(2)})})]}),Array.isArray(l.tiers)&&l.tiers.length>0&&t.jsx("div",{style:{marginTop:4},children:t.jsx(d,{trigger:"hover",position:"topLeft",showArrow:!0,content:t.jsxs("div",{style:{padding:4,minWidth:300},children:[t.jsx(Ce,{type:"tertiary",style:{fontSize:12,display:"block",marginBottom:6},children:s("åå±çº§é¨æ§")}),t.jsx("div",{style:{border:"1px solid var(--semi-color-border)",borderRadius:8,overflow:"hidden"},children:l.tiers.map((e,a)=>{const n=e.name===l.name;return t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 12px",fontSize:13,background:n?"var(--semi-color-primary-light-default)":"transparent",borderTop:0===a?"none":"1px solid var(--semi-color-border)",fontWeight:n?600:400},children:[t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[t.jsx(h,{size:"small",color:n?"blue":"grey",children:e.name}),n&&t.jsx(Ce,{type:"primary",style:{fontSize:12},children:s("å½å")})]}),t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:12},children:[t.jsx(Ce,{type:"tertiary",style:{fontSize:12},children:Number(e.min_topup)>0?s("累计å
å¼ â¥ ${{amount}}",{amount:Number(e.min_topup).toFixed(2)}):s("æ éå
å¼")}),t.jsxs(Ce,{style:{fontSize:13,fontWeight:600,minWidth:84,textAlign:"right"},children:[e.max_rpm," RPM"]})]})]},e.name??a)})})]}),children:t.jsx(c,{theme:"borderless",type:"tertiary",size:"small",icon:t.jsx(ne,{size:14}),children:s("åå±çº§é¨æ§")})})})]})})})},Me=o=>{const[d,u]=e.useContext(q),[p,g]=e.useContext(F),{t:I,i18n:X}=P(),G=s(),J=R(),Z=e.useRef(),ee=e.useRef(!1),te=e.useRef(null),se=e.useRef({bar:null,line:null,pie:null,rankBar:null}),ae={mode:"desktop-browser"},ne={shadows:"always",bordered:!1,headerLine:!0},Ce={className:"w-full mb-2 !rounded-lg",size:"large"},_e="flex items-center gap-2",Me={width:96,height:96};let Te=new Date;const ze=A(),$e=Q(),De=E(),Ie=p?.status?.quota_per_unit,Pe=p?.status?.api_info_enabled??!0,qe=p?.status?.announcements_enabled??!0,Fe=p?.status?.faq_enabled??!0,Re=p?.status?.uptime_kuma_enabled??!0,Ae=p?.status?.checkin_enabled??!1,Qe=Pe,Ee=qe||Fe||Re,We=e.useCallback(e=>t=>{if(!t.model||!t.value)return;const s=Array.isArray(t.value)?t.value[0]:t.value;se.current[e]===s?(se.current[e]=null,setTimeout(()=>{try{const e=t.model,s=e._legendData||e._data;let a=[];if(s){const e=s._data||s;if(e&&e.latestData)a=e.latestData.map(e=>e.label||e.key);else if(e&&"function"==typeof e.getLatestData)a=e.getLatestData().map(e=>e.label||e.key);else if(e&&e._data){const t=e._data.latestData||e._data;Array.isArray(t)&&(a=t.map(e=>e.label||e.key))}}a.length>0&&e.setSelectedData(a)}catch(s){console.warn(`${e} legend reset failed:`,s)}},0)):se.current[e]=s},[]),Le=e.useMemo(()=>We("bar"),[We]),He=e.useMemo(()=>We("line"),[We]),Ke=e.useMemo(()=>We("pie"),[We]),Oe=e.useMemo(()=>We("rankBar"),[We]),Be=e.useCallback(()=>localStorage.getItem("data_export_default_time")||"hour",[]),Ue=e.useCallback((e,t=!1)=>{const s={hour:t?3600:60,day:t?86400:1440,week:t?604800:10080,month:t?2592e3:43200};return s[e]||s.hour},[]),Ve=e.useCallback(()=>{const e=Be(),t=(new Date).getTime()/1e3;switch(e){case"hour":return W(t-86400);case"week":return W(t-2592e3);case"month":return W(t-15552e3);default:return W(t-604800)}},[Be]),Ye=e.useCallback((e,t,s)=>{e.has(t)||e.set(t,0),e.set(t,e.get(t)+s)},[]),Xe=e.useCallback((e,...t)=>{t.forEach(t=>{t.has(e)||t.set(e,0)})},[]),Ge=e.useCallback((e,t,s,a,n)=>{e(e=>({...e,data:[{id:n,values:t}],title:{...e.title,subtext:s},color:{specified:a}}))},[]),Je=e.useCallback((e,s)=>t.jsxs("div",{className:_e,children:[t.jsx(e,{size:16}),s]}),[]),Ze=e.useCallback((e,s)=>t.jsx(e,{...Ce,...s}),[]),et=e.useMemo(()=>[{label:I("å°æ¶"),value:"hour"},{label:I("天"),value:"day"},{label:I("å¨"),value:"week"},{label:I("æ"),value:"month"}],[I]),[tt,st]=e.useState({username:"",token_name:"",model_name:"",start_timestamp:Ve(),end_timestamp:W(Te.getTime()/1e3+3600),channel:"",data_export_default_time:""}),[at,nt]=e.useState(Be()),[lt,rt]=e.useState(!0),[it,ot]=e.useState(!1),[ct,dt]=e.useState([]),[mt,ut]=e.useState(0),[pt,xt]=e.useState(0),[ht,gt]=e.useState(0),[ft,yt]=e.useState(0),[jt,bt]=e.useState(0),[vt,kt]=e.useState([{type:"null",value:"
10"}]),[wt,Nt]=e.useState([]),[Ct,_t]=e.useState({}),[St,Mt]=e.useState("0"),Tt=Ae||"0"!==St?St:"1",[zt,$t]=e.useState(!1),[Dt,It]=e.useState(!1),[Pt,qt]=e.useState({balance:[],usedQuota:[],requestCount:[],times:[],consumeQuota:[],tokens:[],promptTokens:[],completionTokens:[],rpm:[],tpm:[]}),Ft=e.useRef(null),Rt=e.useRef(null),At=e.useRef(null),Qt=e.useRef({}),[Et,Wt]=e.useState(!1),[Lt,Ht]=e.useState(!1),[Kt,Ot]=e.useState(!1),[Bt,Ut]=e.useState([]),[Vt,Yt]=e.useState(!1),[Xt,Gt]=e.useState(""),[Jt,Zt]=e.useState(""),{username:es,model_name:ts,start_timestamp:ss,end_timestamp:as,channel:ns}=tt,[ls,rs]=e.useState({type:"pie",data:[{id:"id0",values:vt}],outerRadius:.8,innerRadius:.5,padAngle:.6,valueField:"value",categoryField:"type",pie:{style:{cornerRadius:10},state:{hover:{outerRadius:.85,stroke:"#000",lineWidth:1},selected:{outerRadius:.85,stroke:"#000",lineWidth:1}}},title:{visible:!0,text:I("模åè°ç¨æ¬¡æ°å æ¯"),subtext:`${I("æ»è®¡")}ï¼${H(jt)}`},legends:{visible:!0,orient:"left",selectMode:"single"},label:{visible:!0},tooltip:{mark:{content:[{key:e=>e.type,value:e=>H(e.value)}]}},color:{specified:L}}),[is,os]=e.useState({type:"bar",data:[{id:"barData",values:wt}],xField:"Time",yField:"Usage",seriesField:"Model",stack:!0,legends:{visible:!0,selectMode:"single"},title:{visible:!0,text:I("æ¨¡åæ¶èåå¸"),subtext:`${I("æ»è®¡")}ï¼${T(mt,2)}`},bar:{state:{hover:{stroke:"#000",lineWidth:1}}},tooltip:{mark:{content:[{key:e=>e.Model,value:e=>T(e.rawQuota||0,4)}]},dimension:{content:[{key:e=>e.Model,value:e=>e.rawQuota||0}],updateContent:e=>{e.sort((e,t)=>t.value-e.value);let t=0;for(let s=0;s<e.length;s++){if("å
¶ä»"==e[s].key)continue;let a=parseFloat(e[s].value);isNaN(a)&&(a=0),e[s].datum&&e[s].datum.TimeSum&&(t=e[s].datum.TimeSum),e[s].value=T(a,4)}return e.unshift({key:I("æ»è®¡"),value:T(t,4)}),e}}},color:{specified:L}}),[cs,ds]=e.useState({type:"line",data:[{id:"lineData",values:[]}],xField:"Time",yField:"Count",seriesField:"Model",legends:{visible:!0,selectMode:"single"},title:{visible:!0,text:I("æ¨¡åæ¶èè¶å¿"),subtext:""},tooltip:{mark:{content:[{key:e=>e.Model,value:e=>H(e.Count)}]}},color:{specified:L}}),[ms,us]=e.useState({type:"bar",data:[{id:"rankData",values:[]}],xField:"Model",yField:"Count",seriesField:"Model",legends:{visible:!0,selectMode:"single"},title:{visible:!0,text:I("模åè°ç¨æ¬¡æ°æè¡"),subtext:""},bar:{state:{hover:{stroke:"#000",lineWidth:1}}},tooltip:{mark:{content:[{key:e=>e.Model,value:e=>H(e.Count)}]}},color:{specified:L}}),ps=e.useMemo(()=>{const e=(Date.parse(as)-Date.parse(ss))/6e4;return{avgRPM:isNaN(jt/e)?"0":(jt/e).toFixed(3),avgTPM:isNaN(pt/e)?"0":(pt/e).toFixed(3),timeDiff:e}},[jt,pt,as,ss]),xs=e.useMemo(()=>{const e=(new Date).getHours();let t="";return t=I(e>=5&&e<12?"æ©ä¸å¥½":e>=12&&e<14?"ä¸å好":e>=14&&e<18?"ä¸å好":"æä¸å¥½"),`ð${t}ï¼${d?.user?.username||""}`},[I,d?.user?.username]),hs=e.useCallback((e,t)=>({type:"line",data:[{id:"trend",values:e.map((e,t)=>({x:t,y:e}))}
1],xField:"x",yField:"y",height:40,width:100,axes:[{orient:"bottom",visible:!1},{orient:"left",visible:!1}],padding:0,autoFit:!1,legends:{visible:!1},tooltip:{visible:!1},crosshair:{visible:!1},line:{style:{stroke:t,lineWidth:2}},point:{visible:!1},background:"transparent"}),[]),gs=e.useMemo(()=>[{title:Je(oe,I("è´¦æ·æ°æ®")),color:"bg-blue-50",items:[{title:I("å½åä½é¢"),value:T(d?.user?.quota),icon:t.jsx(re,{size:16}),avatarColor:"blue",onClick:()=>G("/console/topup"),trendData:[],trendColor:"#3b82f6"},{title:I("å岿¶è"),value:T(d?.user?.used_quota),icon:t.jsx(ie,{size:16}),avatarColor:"purple",trendData:[],trendColor:"#8b5cf6"}]},{title:Je(de,I("使ç¨ç»è®¡")),color:"bg-green-50",items:[{title:I("è¯·æ±æ¬¡æ°"),value:d.user?.request_count,icon:t.jsx(ce,{size:16}),avatarColor:"green",trendData:[],trendColor:"#10b981"},{title:I("ç»è®¡æ¬¡æ°"),value:jt,icon:t.jsx(de,{size:16}),avatarColor:"cyan",trendData:Pt.times,trendColor:"#06b6d4"}]},{title:Je(pe,I("èµæºæ¶è")),color:"bg-yellow-50",items:[{title:I("ç»è®¡é¢åº¦"),value:T(mt),icon:t.jsx(me,{size:16}),avatarColor:"yellow",trendData:Pt.consumeQuota,trendColor:"#f59e0b"},{title:I("æ»Tokens"),value:isNaN(pt)?0:pt,icon:t.jsx(ue,{size:16}),avatarColor:"pink",trendData:Pt.tokens,trendColor:"#ec4899"}]},{title:Je(le,I("æ§è½ææ ")),color:"bg-indigo-50",items:[{title:I("å¹³åRPM"),value:ps.avgRPM,icon:t.jsx(xe,{size:16}),avatarColor:"indigo",trendData:Pt.rpm,trendColor:"#6366f1"},{title:I("å¹³åTPM"),value:ps.avgTPM,icon:t.jsx(ce,{size:16}),avatarColor:"orange",trendData:Pt.tpm,trendColor:"#f97316"}]}],[Je,I,d?.user?.quota,d?.user?.used_quota,d?.user?.request_count,jt,mt,pt,ht,ft,Pt,ps,G,Ie]),fs=e.useCallback(async e=>{await K(e)&&D(I("å¤å¶æå"))},[I]),ys=e.useCallback(e=>{const t=`https://www.tcptest.cn/http/${encodeURIComponent(e)}`;window.open(t,"_blank","noopener,noreferrer")},[]),js=e.useCallback((e,t)=>{"data_export_default_time"!==t?st(s=>({...s,[t]:e})):nt(e)},[]),bs=e.useCallback(async()=>{rt(!0);const e=Date.now();try{let e="",t=Date.parse(ss)/1e3,s=Date.parse(as)/1e3;e=ze||$e&&String(es||"").trim()||De&&String(es||"").trim()?`/api/data/?username=${encodeURIComponent(es||"")}&start_timestamp=${t}&end_timestamp=${s}&default_time=${at}`:`/api/data/self/?start_timestamp=${t}&end_timestamp=${s}&default_time=${at}`;const a=await z.get(e),{success:n,message:l,data:r}=a.data;n?(dt(r),0===r.length&&r.push({count:0,model_name:"æ æ°æ®",quota:0,created_at:Te.getTime()/1e3}),r.sort((e,t)=>e.created_at-t.created_at),qs(r)):$(l)}finally{const t=Date.now()-e,s=Math.max(0,500-t);setTimeout(()=>{rt(!1)},s)}},[ss,as,es,at,ze,$e,De]),vs=e.useCallback(async()=>{Yt(!0);try{const e=await z.get("/api/uptime/status"),{success:t,message:s,data:a}=e.data;t?(Ut(a||[]),a&&a.length>0&&!Xt&&Gt(a[0].categoryName)):$(s)}catch(e){console.error(e)}finally{Yt(!1)}},[Xt]),ks=e.useCallback(async()=>{await Promise.all([bs(),vs()])},[bs,vs]),ws=e.useCallback(()=>{ks(),It(!1)},[ks]),Ns=e.useCallback(async()=>{await bs(),await vs()},[bs,vs]),Cs=e.useCallback(()=>{st(e=>({...e,username:""})),It(!0)},[]),_s=e.useCallback(()=>{It(!1)},[]),Ss=()=>{if(te.current){const e=te.current,t=e.scrollHeight>e.clientHeight,s=e.scrollTop+e.clientHeight>=e.scrollHeight-5;$t(t&&!s)}},Ms=(e,t)=>{if(e.current){const s=e.current,a=s.scrollHeight>s.clientHeight,n=s.scrollTop+s.clientHeight>=s.scrollHeight-5;t(a&&!n)}},Ts=(e,t)=>{Ms(e,t)};e.useEffect(()=>{const e=setTimeout(()=>{if(Ss(),Ms(Ft,Wt),Ms(Rt,Ht),1===Bt.length)Ms(At,Ot);else if(Bt.length>1&&Xt){const e=Qt.current[Xt];e&&Ms(e,Ot)}},100);return()=>clearTimeout(e)},[Bt,Xt]),e.useEffect(()=>{const e=setTimeout(()=>{ot(!0)},100);return()=>clearTimeout(e)},[]);const zs=e.useCallback(e=>{const t={totalQuota:0,totalTimes:0,totalTokens:0,totalPromptTokens:0,totalCompletionTokens:0,uniqueModels:new Set,timePoints:[],timeQuotaMap:new Map,timeTokensMap:new Map,timePromptTokensMap:new Map,timeCompletionTokensMap:new Map,timeCountMap:new Map};return e.forEach(e=>{t.uniqueModels.add(e.model_name),t.totalTokens+=e.token_used||0,t.totalPromptTokens+=e.prompt_tokens||0,t.totalCompletionTokens+=e.completion_tokens||0,t.totalQuota+=e.quota,t.totalTimes+=e.count;const s=O(e.created_at,at);t.timePoints.includes(s)||t.timePoints.push(s),Xe(s,t.timeQuotaMap,t.timeTokensMap,t.timeCountMap),t.timePromptTokensMap.has(s)||t.timePromptTokensMap.set(s,0),t.timeCompletionTokensMap.has(s)||t.timeCompletionTokensMap.set(s,0),Ye(t.timeQuotaMap,s,e.quota),Ye(t.timeTokensMap,s,e.token_used||0),Ye(t.timePromptTokensMap,s,e.prompt_tokens||0),Ye(t.timeCompletionTokensMap,s,e.completion_tokens||0),Ye(t.timeCountMap,s,e.count)}),t.timePoints.sort(),t},[at,Xe,Ye]),$s=e.useCallback((e,t,s,a,n,l)=>{const r=e.map(e=>t.get(e)||0),i=e.map(e=>s.get(e)||0),o=e.map(e=>n.get(e)||0),c=e.map(e=>l.get(e)||0),d=e.map(e=>a.get(e)||0),m=[],u=[];
1if(e.length>=2){const t=Ue(at);for(let n=0;n<e.length;n++)m.push(a.get(e[n])/t),u.push(s.get(e[n])/t)}return{balance:[],usedQuota:[],requestCount:[],times:d,consumeQuota:r,tokens:i,promptTokens:o,completionTokens:c,rpm:m,tpm:u}},[at,Ue]),Ds=e.useCallback(e=>{const t={};return Array.from(e).forEach(e=>{t[e]=L[e]||B(e)}),t},[]),Is=e.useCallback(e=>{const t=new Map;return e.forEach(e=>{const s=O(e.created_at,at),a=e.model_name,n=`${s}-${a}`;t.has(n)||t.set(n,{time:s,model:a,quota:0,count:0});const l=t.get(n);l.quota+=e.quota,l.count+=e.count}),t},[at]),Ps=e.useCallback((e,t)=>{let s=Array.from(new Set([...e.values()].map(e=>e.time)));const a=(e=>{switch(e){case"hour":case"day":default:return 7;case"week":return 4;case"month":return 3}})(at);if(s.length<a){const e=Math.max(...t.map(e=>e.created_at)),n=Ue(at,!0);s=Array.from({length:a},(t,s)=>O(e-(a-1-s)*n,at))}return s},[at,Ue]),qs=e.useCallback(e=>{const t=zs(e),{totalQuota:s,totalTimes:a,totalTokens:n,totalPromptTokens:l,totalCompletionTokens:r,uniqueModels:i,timePoints:o,timeQuotaMap:c,timeTokensMap:d,timePromptTokensMap:m,timeCompletionTokensMap:u,timeCountMap:p}=t,x=$s(o,c,d,p,m,u);qt(x);const h=Ds(i);_t(h);const g=Is(e),f=new Map;for(let[w,N]of g)Ye(f,N.model,N.count);const y=Array.from(f).map(([e,t])=>({type:e,value:t})).sort((e,t)=>t.value-e.value),j=Ps(g,e);let b=[];j.forEach(e=>{let t=Array.from(i).map(t=>{const s=`${e}-${t}`,a=g.get(s);return{Time:e,Model:t,rawQuota:a?.quota||0,Usage:a?.quota?U(a.quota,4):0}});const s=t.reduce((e,t)=>e+t.rawQuota,0);t.sort((e,t)=>t.rawQuota-e.rawQuota),t=t.map(e=>({...e,TimeSum:s})),b.push(...t)}),b.sort((e,t)=>e.Time.localeCompare(t.Time)),Ge(rs,y,`${I("æ»è®¡")}ï¼${H(a)}`,h,"id0"),Ge(os,b,`${I("æ»è®¡")}ï¼${T(s,2)}`,h,"barData");let v=[];j.forEach(e=>{const t=Array.from(i).map(t=>{const s=`${e}-${t}`,a=g.get(s);return{Time:e,Model:t,Count:a?.count||0}});v.push(...t)}),v.sort((e,t)=>e.Time.localeCompare(t.Time));const k=Array.from(f).map(([e,t])=>({Model:e,Count:t})).sort((e,t)=>t.Count-e.Count);Ge(ds,v,`${I("æ»è®¡")}ï¼${H(a)}`,h,"lineData"),Ge(us,k,`${I("æ»è®¡")}ï¼${H(a)}`,h,"rankData"),kt(y),Nt(b),ut(s),bt(a),xt(n),gt(l),yt(r)},[zs,$s,Ds,Is,Ps,Ge,Ye,I]),Fs=e.useMemo(()=>[{color:"grey",label:I("é»è®¤"),type:"default"},{color:"blue",label:I("è¿è¡ä¸"),type:"ongoing"},{color:"green",label:I("æå"),type:"success"},{color:"orange",label:I("è¦å"),type:"warning"},{color:"red",label:I("å¼å¸¸"),type:"error"}],[I]),Rs=e.useMemo(()=>({1:{color:"#10b981",label:I("æ£å¸¸"),text:I("å¯ç¨ç")},0:{color:"#ef4444",label:I("å¼å¸¸"),text:I("æå¼å¸¸")},2:{color:"#f59e0b",label:I("é«å»¶è¿"),text:I("é«å»¶è¿")},3:{color:"#3b82f6",label:I("ç»´æ¤ä¸"),text:I("ç»´æ¤ä¸")}}),[I]),As=e.useMemo(()=>Object.entries(Rs).map(([e,t])=>({status:Number(e),color:t.color,label:t.label})),[Rs]),Qs=e.useCallback(e=>Rs[e]?.color||"#8b9aa7",[Rs]),Es=e.useCallback(e=>Rs[e]?.text||I("æªç¥"),[Rs,I]),Ws=e.useMemo(()=>(p?.status?.api_info||[]).map(e=>({...e,...Y(e,["route","description"])})),[p?.status?.api_info,X.language]),Ls=e.useMemo(()=>(p?.status?.announcements||[]).map(e=>({...e,...Y(e,["content","extra"]),time:V(e.publishDate)})),[p?.status?.announcements,X.language]),Hs=e.useMemo(()=>(p?.status?.faq||[]).map(e=>({...e,...Y(e,["question","answer"])})),[p?.status?.faq,X.language]),Ks=e.useCallback((e,t)=>{if(!e||!t||!t.trim())return e||[];const s=t.trim().toLowerCase();return e.filter(e=>(e.name||"").toLowerCase().includes(s)||(e.group||"").toLowerCase().includes(s))},[]),Os=e.useCallback(e=>{if(!e||0===e.length)return t.jsx("div",{className:"flex justify-center items-center py-4",children:t.jsx(y,{image:t.jsx(b,{style:Me}),darkModeImage:t.jsx(j,{style:Me}),title:I("ææ çæ§æ°æ®")})});const s={};e.forEach(e=>{const t=e.group||"";s[t]||(s[t]=[]),s[t].push(e)});const a=(e,s)=>
1t.jsxs("div",{className:"p-2 hover:bg-foreground/5 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center justify-between mb-1 gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-wrap min-w-0",children:[t.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:Qs(e.status)}}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:e.name}),Array.isArray(e.tags)&&e.tags.map((e,s)=>t.jsx("span",{className:"text-[10px] leading-none px-1.5 py-0.5 rounded text-white whitespace-nowrap",style:{backgroundColor:e.color||"#8b9aa7"},title:e.value?`${e.name}: ${e.value}`:e.name,children:e.value?`${e.name}: ${e.value}`:e.name},s))]}),t.jsxs("span",{className:"text-xs text-foreground/50 flex-shrink-0",children:[(100*(e.uptime||0)).toFixed(2),"%"]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-xs text-foreground/50",children:Es(e.status)}),t.jsx("div",{className:"flex-1",children:t.jsx(f,{percent:100*(e.uptime||0),showInfo:!1,"aria-label":`${e.name} uptime`,stroke:Qs(e.status)})})]})]},s);return Object.entries(s).map(([e,s])=>t.jsxs("div",{className:"mb-2",children:[e&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-md font-semibold text-gray-500 px-2 py-1",children:e}),t.jsx(v,{})]}),s.map(a)]},e||"default"))},[I,Qs,Es]);return e.useEffect(()=>{(async()=>{let e=await z.get("/api/user/self");const{success:t,message:s,data:a}=e.data;t?u({type:"login",payload:a}):$(s)})(),ee.current||(n({isWatchingThemeSwitch:!0}),ee.current=!0,Ns())},[]),t.jsxs("div",{className:"h-full px-2 bg-transparent",children:[" ",t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-2xl font-semibold text-foreground transition-opacity duration-1000 ease-in-out",style:{opacity:it?1:0},children:xs}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(c,{theme:"borderless",type:"tertiary",icon:t.jsx(he,{size:16}),onClick:Cs,className:"!rounded-full"}),t.jsx(c,{theme:"borderless",type:"tertiary",icon:t.jsx(ge,{size:16}),onClick:ks,loading:lt,className:"!rounded-full"})]})]}),t.jsx(i,{title:I("æç´¢æ¡ä»¶"),visible:Dt,onOk:ws,onCancel:_s,closeOnEsc:!0,size:J?"full-width":"small",centered:!0,children:t.jsxs(k,{ref:Z,layout:"vertical",className:"w-full",children:[Ze(k.DatePicker,{field:"start_timestamp",label:I("èµ·å§æ¶é´"),initValue:ss,value:ss,type:"dateTime",name:"start_timestamp",onChange:e=>js(e,"start_timestamp")}),Ze(k.DatePicker,{field:"end_timestamp",label:I("ç»ææ¶é´"),initValue:as,value:as,type:"dateTime",name:"end_timestamp",onChange:e=>js(e,"end_timestamp")}),Ze(k.Select,{field:"data_export_default_time",label:I("æ¶é´ç²åº¦"),initValue:at,placeholder:I("æ¶é´ç²åº¦"),name:"data_export_default_time",optionList:et,onChange:e=>js(e,"data_export_default_time")}),(ze||$e||De)&&Ze(k.Input,{field:"username",label:I("ç¨æ·åç§°"),value:es,placeholder:I("å¯éå¼"),name:"username",onChange:e=>js(e,"username")})]})}),t.jsx("div",{className:"mb-4",children:t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:gs.map((e,s)=>t.jsx(x,{...ne,className:"border-0 !rounded-2xl w-full",title:e.title,children:t.jsx("div",{className:"space-y-4",children:e.items.map((e,s)=>t.jsxs("div",{className:"flex items-center justify-between cursor-pointer",onClick:e.onClick,children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"mr-3 flex-shrink-0 flex items-center justify-center rounded-lg",style:{width:32,height:32,backgroundColor:e.trendColor?`${e.trendColor}18`:"var(--semi-color-fill-0)",color:e.trendColor||"currentColor"},children:e.icon}),t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-gray-500",children:e.title}),t.jsx("div",{className:"text-lg font-semibold",children:t.jsx(w,{loading:lt||!p?.status,placeholder:t.jsx(w.Paragraph,{rows:1,style:{width:"65px",height:"24px",marginTop:"4px"}}),children:e.value})})]})]}),(lt||!p?.status||e.trendData&&e.trendData.length>0)&&t.jsx("div",{className:"w-24 h-10 trend-sparkline",children:t.jsx(l,{spec:hs(e.trendData,e.trendColor),option:ae})})]},s))})},s))})}),t.jsx("div",{className:"mb-4",children:t.jsx(Se,{})}),t.jsx("div",{className:"mb-4",children:t.jsxs("div",{className:"grid grid-cols-1 gap-4 "+(Qe?"lg:grid-cols-4":""),children:[t.jsx(x,{...ne,className:"shadow-sm !rounded-2xl "+(Qe?"lg:col-span-3":""),title:t.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between w-full gap-3",children:[t.jsxs("div",{className:_e,children:[t.jsx(fe,{size:16}),I("æ¨¡åæ°æ®åæ")]}),t.jsxs(N,{type:"button",activeKey:Tt,onChange:Mt,children:[Ae&&t.jsx(C,{tab:t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(me,{size:14}),I("ç¾å°æ¥å")]}),itemKey:"0"}),t.jsx(C,{tab:t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(ie,{size:14}),I("æ¶èåå¸")]}),itemKey:"1"}),t.jsx(C,{tab:t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(de,{size:14}),I("æ¶èè¶å¿")]}),itemKey:"2"}),t.jsx(C,{tab:t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(fe,{size:14}),I("è°ç¨æ¬¡æ°åå¸")]}),itemKey:"3"}),t.jsx(C,{tab:t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(ie,{size:14}),I("è°ç¨æ¬¡æ°æè¡")]}),itemKey:"4"})]})]}),bodyStyle:{padding:0},children:t.jsxs("div",{className:"h-[680px] p-2",ref:e=>{},children:[Ae&&t.jsx("div",{style:{display:"0"===Tt?"block":"none",height:"100%"},children:t.jsx(Ne,{t:I,status:p?.status,turnstileEnabled:p?.status?.turnstile_check,turnstileSiteKey:p?.status?.turnstile_site_key})}),"1"===Tt&&t.jsx(l,{spec:is,option:ae,onLegendItemClick:Le}),"2"===Tt&&t.jsx(l,{spec:cs,option:ae,onLegendItemClick:He}),"3"===Tt&&t.jsx(l,{spec:ls,option:ae,onLegendItemClick:Ke}),"4"===Tt&&t.jsx(l,{spec:ms,option:ae,onLegendItemClick:Oe})]})}),Qe&&t.jsx(x,{...ne,className:"border-0 !rounded-2xl",title:t.jsxs("div",{className:_e,children:[t.jsx(je,{size:16}),I("APIä¿¡æ¯")]}),bodyStyle:{padding:0},children:t.jsxs("div",{className:"card-content-container",children:[t.jsx("div",{ref:te,className:"p-2 max-h-96 overflow-y-auto card-content-scroll",onScroll:()=>{Ss()},children:Ws.length>0?Ws.map((e,s)=>t.jsxs(a.Fragment,{children:[s>0&&t.jsx(v,{margin:"0"}
1),t.jsxs("div",{className:"px-3 py-2.5 hover:bg-foreground/5 rounded-lg transition-colors",children:[t.jsxs("div",{className:"flex items-center justify-between gap-1",children:[t.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:e.route}),t.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[t.jsx(c,{size:"small",theme:"borderless",type:"tertiary",icon:t.jsx(le,{size:13}),onClick:()=>ys(e.url),className:"!rounded-full",title:I("æµé")}),t.jsx(c,{size:"small",theme:"borderless",type:"tertiary",icon:t.jsx(ye,{size:13}),onClick:()=>window.open(e.url,"_blank","noopener,noreferrer"),className:"!rounded-full",title:I("跳转")})]})]}),t.jsx("div",{className:"!text-primary text-xs break-all cursor-pointer hover:underline mt-0.5",onClick:()=>fs(e.url),children:e.url}),e.description&&t.jsx("div",{className:"text-xs text-foreground/50 mt-0.5",children:e.description})]})]},e.id)):t.jsx("div",{className:"flex justify-center items-center py-8",children:t.jsx(y,{image:t.jsx(b,{style:Me}),darkModeImage:t.jsx(j,{style:Me}),title:I("ææ APIä¿¡æ¯"),description:I("请è系管çåå¨ç³»ç»è®¾ç½®ä¸é
ç½®APIä¿¡æ¯")})})}),t.jsx("div",{className:"card-content-fade-indicator",style:{opacity:zt?1:0}})]})})]})}),Ee&&t.jsx("div",{className:"mb-4",children:t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-4",children:[qe&&t.jsx(x,{...ne,className:"shadow-sm !rounded-2xl lg:col-span-2",title:t.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-2 w-full",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(be,{size:16}),I("ç³»ç»å
¬å"),t.jsx(h,{color:"white",shape:"circle",children:I("æ¾ç¤ºææ°20æ¡")})]}),t.jsx("div",{className:"flex flex-wrap gap-3 text-xs",children:Fs.map((e,s)=>t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"grey"===e.color?"#8b9aa7":"blue"===e.color?"#3b82f6":"green"===e.color?"#10b981":"orange"===e.color?"#f59e0b":"red"===e.color?"#ef4444":"#8b9aa7"}}),t.jsx("span",{className:"text-foreground/80",children:e.label})]},s))})]}),bodyStyle:{padding:0},children:t.jsxs("div",{className:"card-content-container",children:[t.jsx("div",{ref:Ft,className:"p-2 max-h-96 overflow-y-auto card-content-scroll",onScroll:()=>Ts(Ft,Wt),children:Ls.length>0?t.jsx(_,{mode:"alternate",children:Ls.map((e,s)=>t.jsx(_.Item,{type:e.type||"default",time:e.time,children:t.jsxs("div",{children:[t.jsx("div",{dangerouslySetInnerHTML:{__html:r.parse(e.content||"")}}),e.extra&&t.jsx("div",{className:"text-xs text-gray-500",dangerouslySetInnerHTML:{__html:r.parse(e.extra)}})]})},s))}):t.jsx("div",{className:"flex justify-center items-center py-8",children:t.jsx(y,{image:t.jsx(b,{style:Me}),darkModeImage:t.jsx(j,{style:Me}),title:I("ææ ç³»ç»å
¬å"),description:I("请è系管çåå¨ç³»ç»è®¾ç½®ä¸é
ç½®å
¬åä¿¡æ¯")})})}),t.jsx("div",{className:"card-content-fade-indicator",style:{opacity:Et?1:0}})]})}),Fe&&t.jsx(x,{...ne,className:"shadow-sm !rounded-2xl lg:col-span-1",title:t.jsxs("div",{className:_e,children:[t.jsx(we,{size:16}),I("常è§é®ç")]}),bodyStyle:{padding:0},children:t.jsxs("div",{className:"card-content-container",children:[t.jsx("div",{ref:Rt,className:"p-2 max-h-96 overflow-y-auto card-content-scroll",onScroll:()=>Ts(Rt,Ht),children:Hs.length>0?t.jsx(S,{accordion:!0,expandIcon:t.jsx(ke,{size:16}),collapseIcon:t.jsx(ve,{size:16}),children:Hs.map((e,s)=>t.jsx(S.Panel,{header:e.question,itemKey:s.toString(),children:t.jsx("div",{dangerouslySetInnerHTML:{__html:r.parse(e.answer||"")}})},s))}):t.jsx("div",{className:"flex justify-center items-center py-8",children:t.jsx(y,{image:t.jsx(b,{style:Me}),darkModeImage:t.jsx(j,{style:Me}),title:I("ææ å¸¸è§é®ç"),description:I("请è系管çåå¨ç³»ç»è®¾ç½®ä¸é
置常è§é®ç")})})}),t.jsx("div",{className:"card-content-fade-indicator",style:{opacity:Lt?1:0}})]})}),Re&&t.jsxs(x,{...ne,className:"shadow-sm !rounded-2xl lg:col-span-1",title:t.jsxs("div",{className:_e,children:[t.jsx(le,{size:16}),I("æå¡å¯ç¨æ§")]}),extra:t.jsx(c,{icon:t.jsx(ge,{size:16}),onClick:vs,loading:Vt,theme:"borderless",type:"tertiary",className:"!rounded-full"}),bodyStyle:{padding:0},children:[Bt.length>0&&t.jsx("div",{className:"px-3 pt-2 pb-1 border-b border-border",children:t.jsx(M,{prefix:t.jsx(he,{size:16}),placeholder:I("æç´¢æå¡åç§°"),value:Jt,onChange:Zt,size:"small",clearable:!0,className:"w-full","aria-label":I("æç´¢æå¡åç§°")})}),t.jsx("div",{className:"relative",children:t.jsx(m,{spinning:Vt,children:Bt.length>0?1===Bt.length?t.jsxs("div",{className:"card-content-container",children:[t.jsx("div",{ref:At,className:"p-2 max-h-[24rem] overflow-y-auto card-content-scroll",onScroll:()=>Ts(At,Ot),children:Os(Ks(Bt[0].monitors,Jt))}),t.jsx("div",{className:"card-content-fade-indicator",style:{opacity:Kt?1:0}})]}):t.jsx(N,{type:"card",collapsible:!0,activeKey:Xt,onChange:Gt,size:"small",children:Bt.map((e,s)=>{Qt.current[e.categoryName]||(Qt.current[e.categoryName]=a.createRef());const n=Qt.current[e.categoryName];return t.jsx(C,{tab:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(le,{size:14}),e.categoryName,t.jsx(h,{color:Xt===e.categoryName?"red":"grey",size:"small",shape:"circle",children:e.monitors?e.monitors.length:0})]}),itemKey:e.categoryName,children:t.jsxs("div",{className:"card-content-container",children:[t.jsx("div",{ref:n,className:"p-2 max-h-[21.5rem] overflow-y-auto card-content-scroll",onScroll:()=>Ts(n,Ot),children:Os(Ks(e.monitors,Jt))}),t.jsx("div",{className:"card-content-fade-indicator",style:{opacity:Xt===e.categoryName&&Kt?1:0}})]})},s)})}):t.jsx("div",{className:"flex justify-center items-center py-8",children:t.jsx(y,{image:t.jsx(b,{style:Me}),darkModeImage:t.jsx(j,{style:Me}),title:I("ææ çæ§æ°æ®"),description:I("请è系管çåå¨ç³»ç»è®¾ç½®ä¸é
ç½®Uptime")})})})}),Bt.length>0&&t.jsx("div",{className:"p-3 bg-card rounded-b-2xl",children:t.jsx("div",{className:"flex flex-wrap gap-3 text-xs justify-center",children:As.map((e,s)=>t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}
1),t.jsx("span",{className:"text-foreground/80",children:e.label})]},s))})})]})]})})]})};export{Me as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.