cc-viewer 1.6.76 → 1.6.78
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/cli.js +14 -2
- package/dist/assets/{App-Cem7PLHN.js → App-BymyWKHu.js} +8 -8
- package/dist/assets/{AppHeader.module-DzQM_UNC.js → AppHeader.module-CXq8iJHa.js} +164 -164
- package/dist/assets/{Mobile-BbTWcrwT.js → Mobile-DZHp8rqg.js} +1 -1
- package/dist/assets/{_basePickBy-BL9qcDyP.js → _basePickBy-CPUAv8Z-.js} +1 -1
- package/dist/assets/{_baseUniq-DfsMVTOw.js → _baseUniq-RziNyBX1.js} +1 -1
- package/dist/assets/{arc-Co7smN3K.js → arc-CRh33chy.js} +1 -1
- package/dist/assets/{architectureDiagram-2XIMDMQ5-Cq96F3ty.js → architectureDiagram-2XIMDMQ5-BbsG_m4f.js} +1 -1
- package/dist/assets/{blockDiagram-WCTKOSBZ-CPEk_KXK.js → blockDiagram-WCTKOSBZ-61O2BDmB.js} +1 -1
- package/dist/assets/{c4Diagram-IC4MRINW-CqQnopgr.js → c4Diagram-IC4MRINW-Chg7-Dav.js} +1 -1
- package/dist/assets/channel-VRTXZpAY.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-B2dBa51T.js → chunk-4BX2VUAB-W2zGxeV6.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-DY6g-Qrg.js → chunk-55IACEB6-D9LGyYpy.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-PYDVhW3e.js → chunk-FMBD7UC4-CSlz0HZK.js} +1 -1
- package/dist/assets/{chunk-JSJVCQXG-CUs_89dw.js → chunk-JSJVCQXG-DsiEGQyA.js} +1 -1
- package/dist/assets/{chunk-KX2RTZJC-DQa1MXsy.js → chunk-KX2RTZJC-DCgLq0oQ.js} +1 -1
- package/dist/assets/{chunk-NQ4KR5QH-BniQtHJh.js → chunk-NQ4KR5QH-B200c_zN.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-CnNoJR5-.js → chunk-QZHKN3VN-DlyBNqou.js} +1 -1
- package/dist/assets/{chunk-WL4C6EOR-D8QqYqFU.js → chunk-WL4C6EOR-DIEO3szD.js} +1 -1
- package/dist/assets/classDiagram-VBA2DB6C-CJgySoB2.js +1 -0
- package/dist/assets/classDiagram-v2-RAHNMMFH-CJgySoB2.js +1 -0
- package/dist/assets/clone-CTx-YQUS.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-BcVVVkB-.js → cose-bilkent-S5V4N54A-DumjBS1N.js} +1 -1
- package/dist/assets/{dagre-KLK3FWXG-eRhOYUbQ.js → dagre-KLK3FWXG-BUEcJVyS.js} +1 -1
- package/dist/assets/{diagram-E7M64L7V-DVkSJ48z.js → diagram-E7M64L7V-dUYt_Jnl.js} +1 -1
- package/dist/assets/{diagram-IFDJBPK2-M2BP9vIi.js → diagram-IFDJBPK2-BCeozSDN.js} +1 -1
- package/dist/assets/{diagram-P4PSJMXO-Cfme4rN_.js → diagram-P4PSJMXO-C16nqz52.js} +1 -1
- package/dist/assets/{erDiagram-INFDFZHY-CuPD9RUb.js → erDiagram-INFDFZHY-C27Z2fJ0.js} +1 -1
- package/dist/assets/{flowDiagram-PKNHOUZH-BiPFNyi1.js → flowDiagram-PKNHOUZH-DrgGjft9.js} +1 -1
- package/dist/assets/{ganttDiagram-A5KZAMGK-DjKcooBF.js → ganttDiagram-A5KZAMGK-BteztjnX.js} +1 -1
- package/dist/assets/{gitGraphDiagram-K3NZZRJ6-DQ_OhFJD.js → gitGraphDiagram-K3NZZRJ6-rsjwBwOI.js} +1 -1
- package/dist/assets/{graph-Dbm2nOd2.js → graph-E6UlUG3z.js} +1 -1
- package/dist/assets/{index-CroM21wy.js → index-DP7PQUCA.js} +2 -2
- package/dist/assets/{infoDiagram-LFFYTUFH-CSzeVHZ6.js → infoDiagram-LFFYTUFH-M3CjAUS_.js} +1 -1
- package/dist/assets/{ishikawaDiagram-PHBUUO56-CysAYgjF.js → ishikawaDiagram-PHBUUO56-CCBydLJV.js} +1 -1
- package/dist/assets/{journeyDiagram-4ABVD52K-C275-sr3.js → journeyDiagram-4ABVD52K-BMLFxbRB.js} +1 -1
- package/dist/assets/{kanban-definition-K7BYSVSG-zJ6NJosP.js → kanban-definition-K7BYSVSG-C3bbOrOS.js} +1 -1
- package/dist/assets/{layout-CcBlEtpn.js → layout-BCAgQpgA.js} +1 -1
- package/dist/assets/{linear-SCkR6QE4.js → linear-3uFQJ7RC.js} +1 -1
- package/dist/assets/{mermaid.core-oWoGcspE.js → mermaid.core-DV03xe8Z.js} +4 -4
- package/dist/assets/{mindmap-definition-YRQLILUH--0CBRL5M.js → mindmap-definition-YRQLILUH-DybjMsmW.js} +1 -1
- package/dist/assets/{pieDiagram-SKSYHLDU-CxNvmbe9.js → pieDiagram-SKSYHLDU-D1zzdQXv.js} +1 -1
- package/dist/assets/{quadrantDiagram-337W2JSQ-CmIc08l3.js → quadrantDiagram-337W2JSQ-9JZOcnVk.js} +1 -1
- package/dist/assets/{requirementDiagram-Z7DCOOCP-CG622xT3.js → requirementDiagram-Z7DCOOCP-W7_RpwFN.js} +1 -1
- package/dist/assets/{sankeyDiagram-WA2Y5GQK-CdJvYQHG.js → sankeyDiagram-WA2Y5GQK-CrX5P-NB.js} +1 -1
- package/dist/assets/{sequenceDiagram-2WXFIKYE-C7ilr7jC.js → sequenceDiagram-2WXFIKYE-BtBKmcQZ.js} +1 -1
- package/dist/assets/{stateDiagram-RAJIS63D-C1FZd_wM.js → stateDiagram-RAJIS63D-CaIRcTDT.js} +1 -1
- package/dist/assets/stateDiagram-v2-FVOUBMTO-BL3KqisK.js +1 -0
- package/dist/assets/{timeline-definition-YZTLITO2-CvDHfiEN.js → timeline-definition-YZTLITO2-p9xZsyWX.js} +1 -1
- package/dist/assets/{treemap-KZPCXAKY-BiZSznTP.js → treemap-KZPCXAKY-CEOceT_W.js} +1 -1
- package/dist/assets/{vennDiagram-LZ73GAT5-xQd88xeO.js → vennDiagram-LZ73GAT5-BQibA7qt.js} +1 -1
- package/dist/assets/{xychartDiagram-JWTSCODW-CIkJKf9U.js → xychartDiagram-JWTSCODW-CNC_qPsX.js} +1 -1
- package/dist/index.html +1 -1
- package/i18n.js +58 -18
- package/package.json +1 -1
- package/server.js +30 -2
- package/dist/assets/channel-CnoVkzJ3.js +0 -1
- package/dist/assets/classDiagram-VBA2DB6C-CDuJajwN.js +0 -1
- package/dist/assets/classDiagram-v2-RAHNMMFH-CDuJajwN.js +0 -1
- package/dist/assets/clone-DZBwKXWJ.js +0 -1
- package/dist/assets/stateDiagram-v2-FVOUBMTO-B1gKpoTR.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ms=Object.defineProperty;var Es=(n,s,t)=>s in n?Ms(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t;var A=(n,s,t)=>Es(n,typeof s!="symbol"?s+"":s,t);import{r as j,R as q,j as e,a as Rs}from"./index-CroM21wy.js";import{L as Is,M as Ls,_ as ie,c as ne,N as ot,P as Ps,Q as rt,d as jt,U as ye,V as Ct,W as st,X as bt,Y as As,Z as ft,$ as Bs,a0 as Nt,a1 as Os,g as Ds,m as Fs,u as Pe,a2 as $s,a3 as Hs,a4 as zs,a5 as Vs,a6 as Us,a7 as qs,a8 as Ws,a9 as _t,C as xt,I as xe,aa as Ks,ab as qt,ac as Gs,ad as Wt,ae as Js,af as Qs,ag as Ys,e as re,t as p,q as He,v as Xs,w as be,f as Zs,h as ea,j as ta,s as d,o as W,n as he,ah as Kt,ai as De,aj as J,ak as qe,al as Oe,k as sa,l as ze,am as aa,an as je,S as Gt,B as F,ao as na,ap as ia,aq as Fe,ar as la,as as fe,at as St,au as Ae,y as oa,J as ra,av as Jt,H as Be,aw as Ve,E as ct,ax as kt,G as dt,ay as ca,O as Qt,az as da,aA as ha,aB as ua,aC as we,aD as wt,aE as ma,aF as Tt,aG as Yt,aH as Xt,aI as Te,aJ as Me,aK as Zt,aL as at,aM as Mt,aN as Et,aO as Rt,aP as pa,aQ as ga,A as fa,aR as Ue,aS as It,aT as xa,z as ya,x as E,D as va,aU as ja}from"./AppHeader.module-DzQM_UNC.js";var Lt=j.createContext(null),es=j.createContext({}),Ca=["prefixCls","className","containerRef"],ba=function(s){var t=s.prefixCls,a=s.className,c=s.containerRef,i=Is(s,Ca),u=j.useContext(es),g=u.panel,l=Ls(g,c);return j.createElement("div",ie({className:ne("".concat(t,"-content"),a),role:"dialog",ref:l},ot(s,{aria:!0}),{"aria-modal":"true"},i))};function Pt(n){return typeof n=="string"&&String(Number(n))===n?(Ps(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(n)):n}var At={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Na(n,s){var t,a,c,i=n.prefixCls,u=n.open,g=n.placement,l=n.inline,h=n.push,o=n.forceRender,r=n.autoFocus,m=n.keyboard,v=n.classNames,x=n.rootClassName,f=n.rootStyle,y=n.zIndex,C=n.className,S=n.id,N=n.style,b=n.motion,T=n.width,R=n.height,B=n.children,L=n.mask,M=n.maskClosable,I=n.maskMotion,O=n.maskClassName,ee=n.maskStyle,te=n.afterOpenChange,V=n.onClose,K=n.onMouseEnter,ue=n.onMouseOver,k=n.onMouseLeave,z=n.onClick,le=n.onKeyDown,me=n.onKeyUp,G=n.styles,pe=n.drawerRender,oe=j.useRef(),ge=j.useRef(),ve=j.useRef();j.useImperativeHandle(s,function(){return oe.current});var se=function(ce){var Re=ce.keyCode,Ie=ce.shiftKey;switch(Re){case st.TAB:{if(Re===st.TAB){if(!Ie&&document.activeElement===ve.current){var Le;(Le=ge.current)===null||Le===void 0||Le.focus({preventScroll:!0})}else if(Ie&&document.activeElement===ge.current){var tt;(tt=ve.current)===null||tt===void 0||tt.focus({preventScroll:!0})}}break}case st.ESC:{V&&m&&(ce.stopPropagation(),V(ce));break}}};j.useEffect(function(){if(u&&r){var Z;(Z=oe.current)===null||Z===void 0||Z.focus({preventScroll:!0})}},[u]);var Y=j.useState(!1),D=rt(Y,2),X=D[0],ae=D[1],U=j.useContext(Lt),_e;typeof h=="boolean"?_e=h?{}:{distance:0}:_e=h||{};var Ce=(t=(a=(c=_e)===null||c===void 0?void 0:c.distance)!==null&&a!==void 0?a:U==null?void 0:U.pushDistance)!==null&&t!==void 0?t:180,_s=j.useMemo(function(){return{pushDistance:Ce,push:function(){ae(!0)},pull:function(){ae(!1)}}},[Ce]);j.useEffect(function(){if(u){var Z;U==null||(Z=U.push)===null||Z===void 0||Z.call(U)}else{var ce;U==null||(ce=U.pull)===null||ce===void 0||ce.call(U)}},[u]),j.useEffect(function(){return function(){var Z;U==null||(Z=U.pull)===null||Z===void 0||Z.call(U)}},[]);var Ss=j.createElement(jt,ie({key:"mask"},I,{visible:L&&u}),function(Z,ce){var Re=Z.className,Ie=Z.style;return j.createElement("div",{className:ne("".concat(i,"-mask"),Re,v==null?void 0:v.mask,O),style:ye(ye(ye({},Ie),ee),G==null?void 0:G.mask),onClick:M&&u?V:void 0,ref:ce})}),ks=typeof b=="function"?b(g):b,Se={};if(X&&Ce)switch(g){case"top":Se.transform="translateY(".concat(Ce,"px)");break;case"bottom":Se.transform="translateY(".concat(-Ce,"px)");break;case"left":Se.transform="translateX(".concat(Ce,"px)");break;default:Se.transform="translateX(".concat(-Ce,"px)");break}g==="left"||g==="right"?Se.width=Pt(T):Se.height=Pt(R);var ws={onMouseEnter:K,onMouseOver:ue,onMouseLeave:k,onClick:z,onKeyDown:le,onKeyUp:me},Ts=j.createElement(jt,ie({key:"panel"},ks,{visible:u,forceRender:o,onVisibleChanged:function(ce){te==null||te(ce)},removeOnLeave:!1,leavedClassName:"".concat(i,"-content-wrapper-hidden")}),function(Z,ce){var Re=Z.className,Ie=Z.style,Le=j.createElement(ba,ie({id:S,containerRef:ce,prefixCls:i,className:ne(C,v==null?void 0:v.content),style:ye(ye({},N),G==null?void 0:G.content)},ot(n,{aria:!0}),ws),B);return j.createElement("div",ie({className:ne("".concat(i,"-content-wrapper"),v==null?void 0:v.wrapper,Re),style:ye(ye(ye({},Se),Ie),G==null?void 0:G.wrapper)},ot(n,{data:!0})),pe?pe(Le):Le)}),vt=ye({},f);return y&&(vt.zIndex=y),j.createElement(Lt.Provider,{value:_s},j.createElement("div",{className:ne(i,"".concat(i,"-").concat(g),x,Ct(Ct({},"".concat(i,"-open"),u),"".concat(i,"-inline"),l)),style:vt,tabIndex:-1,ref:oe,onKeyDown:se},Ss,j.createElement("div",{tabIndex:0,ref:ge,style:At,"aria-hidden":"true","data-sentinel":"start"}),Ts,j.createElement("div",{tabIndex:0,ref:ve,style:At,"aria-hidden":"true","data-sentinel":"end"})))}var _a=j.forwardRef(Na),Sa=function(s){var t=s.open,a=t===void 0?!1:t,c=s.prefixCls,i=c===void 0?"rc-drawer":c,u=s.placement,g=u===void 0?"right":u,l=s.autoFocus,h=l===void 0?!0:l,o=s.keyboard,r=o===void 0?!0:o,m=s.width,v=m===void 0?378:m,x=s.mask,f=x===void 0?!0:x,y=s.maskClosable,C=y===void 0?!0:y,S=s.getContainer,N=s.forceRender,b=s.afterOpenChange,T=s.destroyOnClose,R=s.onMouseEnter,B=s.onMouseOver,L=s.onMouseLeave,M=s.onClick,I=s.onKeyDown,O=s.onKeyUp,ee=s.panelRef,te=j.useState(!1),V=rt(te,2),K=V[0],ue=V[1],k=j.useState(!1),z=rt(k,2),le=z[0],me=z[1];bt(function(){me(!0)},[]);var G=le?a:!1,pe=j.useRef(),oe=j.useRef();bt(function(){G&&(oe.current=document.activeElement)},[G]);var ge=function(X){var ae;if(ue(X),b==null||b(X),!X&&oe.current&&!((ae=pe.current)!==null&&ae!==void 0&&ae.contains(oe.current))){var U;(U=oe.current)===null||U===void 0||U.focus({preventScroll:!0})}},ve=j.useMemo(function(){return{panel:ee}},[ee]);if(!N&&!K&&!G&&T)return null;var se={onMouseEnter:R,onMouseOver:B,onMouseLeave:L,onClick:M,onKeyDown:I,onKeyUp:O},Y=ye(ye({},s),{},{open:G,prefixCls:i,placement:g,autoFocus:h,keyboard:r,width:v,mask:f,maskClosable:C,inline:S===!1,afterOpenChange:ge,ref:pe},se);return j.createElement(es.Provider,{value:ve},j.createElement(As,{open:G||N||K,autoDestroy:!1,getContainer:S,autoLock:f&&(G||K)},j.createElement(_a,Y)))};const ts=n=>{var s,t;const{prefixCls:a,ariaId:c,title:i,footer:u,extra:g,closable:l,loading:h,onClose:o,headerStyle:r,bodyStyle:m,footerStyle:v,children:x,classNames:f,styles:y}=n,C=ft("drawer");let S;l===!1?S=void 0:l===void 0||l===!0?S="start":S=(l==null?void 0:l.placement)==="end"?"end":"start";const N=j.useCallback(L=>j.createElement("button",{type:"button",onClick:o,className:ne(`${a}-close`,{[`${a}-close-${S}`]:S==="end"})},L),[o,a,S]),[b,T]=Bs(Nt(n),Nt(C),{closable:!0,closeIconRender:N}),R=()=>{var L,M;return!i&&!b?null:j.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(L=C.styles)===null||L===void 0?void 0:L.header),r),y==null?void 0:y.header),className:ne(`${a}-header`,{[`${a}-header-close-only`]:b&&!i&&!g},(M=C.classNames)===null||M===void 0?void 0:M.header,f==null?void 0:f.header)},j.createElement("div",{className:`${a}-header-title`},S==="start"&&T,i&&j.createElement("div",{className:`${a}-title`,id:c},i)),g&&j.createElement("div",{className:`${a}-extra`},g),S==="end"&&T)},B=()=>{var L,M;if(!u)return null;const I=`${a}-footer`;return j.createElement("div",{className:ne(I,(L=C.classNames)===null||L===void 0?void 0:L.footer,f==null?void 0:f.footer),style:Object.assign(Object.assign(Object.assign({},(M=C.styles)===null||M===void 0?void 0:M.footer),v),y==null?void 0:y.footer)},u)};return j.createElement(j.Fragment,null,R(),j.createElement("div",{className:ne(`${a}-body`,f==null?void 0:f.body,(s=C.classNames)===null||s===void 0?void 0:s.body),style:Object.assign(Object.assign(Object.assign({},(t=C.styles)===null||t===void 0?void 0:t.body),m),y==null?void 0:y.body)},h?j.createElement(Os,{active:!0,title:!1,paragraph:{rows:5},className:`${a}-body-skeleton`}):x),B())},ka=n=>{const s="100%";return{left:`translateX(-${s})`,right:`translateX(${s})`,top:`translateY(-${s})`,bottom:`translateY(${s})`}[n]},ss=(n,s)=>({"&-enter, &-appear":Object.assign(Object.assign({},n),{"&-active":s}),"&-leave":Object.assign(Object.assign({},s),{"&-active":n})}),as=(n,s)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${s}`}}},ss({opacity:n},{opacity:1})),wa=(n,s)=>[as(.7,s),ss({transform:ka(n)},{transform:"none"})],Ta=n=>{const{componentCls:s,motionDurationSlow:t}=n;return{[s]:{[`${s}-mask-motion`]:as(0,t),[`${s}-panel-motion`]:["left","right","top","bottom"].reduce((a,c)=>Object.assign(Object.assign({},a),{[`&-${c}`]:wa(c,t)}),{})}}},Ma=n=>{const{borderRadiusSM:s,componentCls:t,zIndexPopup:a,colorBgMask:c,colorBgElevated:i,motionDurationSlow:u,motionDurationMid:g,paddingXS:l,padding:h,paddingLG:o,fontSizeLG:r,lineHeightLG:m,lineWidth:v,lineType:x,colorSplit:f,marginXS:y,colorIcon:C,colorIconHover:S,colorBgTextHover:N,colorBgTextActive:b,colorText:T,fontWeightStrong:R,footerPaddingBlock:B,footerPaddingInline:L,calc:M}=n,I=`${t}-content-wrapper`;return{[t]:{position:"fixed",inset:0,zIndex:a,pointerEvents:"none",color:T,"&-pure":{position:"relative",background:i,display:"flex",flexDirection:"column",[`&${t}-left`]:{boxShadow:n.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:n.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:n.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:n.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${t}-mask`]:{position:"absolute",inset:0,zIndex:a,background:c,pointerEvents:"auto"},[I]:{position:"absolute",zIndex:a,maxWidth:"100vw",transition:`all ${u}`,"&-hidden":{display:"none"}},[`&-left > ${I}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:n.boxShadowDrawerLeft},[`&-right > ${I}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:n.boxShadowDrawerRight},[`&-top > ${I}`]:{top:0,insetInline:0,boxShadow:n.boxShadowDrawerUp},[`&-bottom > ${I}`]:{bottom:0,insetInline:0,boxShadow:n.boxShadowDrawerDown},[`${t}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:i,pointerEvents:"auto"},[`${t}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Pe(h)} ${Pe(o)}`,fontSize:r,lineHeight:m,borderBottom:`${Pe(v)} ${x} ${f}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:"none"},[`${t}-close`]:Object.assign({display:"inline-flex",width:M(r).add(l).equal(),height:M(r).add(l).equal(),borderRadius:s,justifyContent:"center",alignItems:"center",color:C,fontWeight:R,fontSize:r,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${g}`,textRendering:"auto",[`&${t}-close-end`]:{marginInlineStart:y},[`&:not(${t}-close-end)`]:{marginInlineEnd:y},"&:hover":{color:S,backgroundColor:N,textDecoration:"none"},"&:active":{backgroundColor:b}},$s(n)),[`${t}-title`]:{flex:1,margin:0,fontWeight:n.fontWeightStrong,fontSize:r,lineHeight:m},[`${t}-body`]:{flex:1,minWidth:0,minHeight:0,padding:o,overflow:"auto",[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${t}-footer`]:{flexShrink:0,padding:`${Pe(B)} ${Pe(L)}`,borderTop:`${Pe(v)} ${x} ${f}`},"&-rtl":{direction:"rtl"}}}},Ea=n=>({zIndexPopup:n.zIndexPopupBase,footerPaddingBlock:n.paddingXS,footerPaddingInline:n.padding}),ns=Ds("Drawer",n=>{const s=Fs(n,{});return[Ma(s),Ta(s)]},Ea);var is=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)s.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(t[a[c]]=n[a[c]]);return t};const Ra={distance:180},We=n=>{const{rootClassName:s,width:t,height:a,size:c="default",mask:i=!0,push:u=Ra,open:g,afterOpenChange:l,onClose:h,prefixCls:o,getContainer:r,panelRef:m=null,style:v,className:x,"aria-labelledby":f,visible:y,afterVisibleChange:C,maskStyle:S,drawerStyle:N,contentWrapperStyle:b,destroyOnClose:T,destroyOnHidden:R}=n,B=is(n,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","aria-labelledby","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),L=Hs(),M=B.title?L:void 0,{getPopupContainer:I,getPrefixCls:O,direction:ee,className:te,style:V,classNames:K,styles:ue}=ft("drawer"),k=O("drawer",o),[z,le,me]=ns(k),G=r===void 0&&I?()=>I(document.body):r,pe=ne({"no-mask":!i,[`${k}-rtl`]:ee==="rtl"},s,le,me),oe=j.useMemo(()=>t??(c==="large"?736:378),[t,c]),ge=j.useMemo(()=>a??(c==="large"?736:378),[a,c]),ve={motionName:_t(k,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},se=Ce=>({motionName:_t(k,`panel-motion-${Ce}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Y=zs(),D=Vs(m,Y),[X,ae]=Us("Drawer",B.zIndex),{classNames:U={},styles:_e={}}=B;return z(j.createElement(qs,{form:!0,space:!0},j.createElement(Ws.Provider,{value:ae},j.createElement(Sa,Object.assign({prefixCls:k,onClose:h,maskMotion:ve,motion:se},B,{classNames:{mask:ne(U.mask,K.mask),content:ne(U.content,K.content),wrapper:ne(U.wrapper,K.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},_e.mask),S),ue.mask),content:Object.assign(Object.assign(Object.assign({},_e.content),N),ue.content),wrapper:Object.assign(Object.assign(Object.assign({},_e.wrapper),b),ue.wrapper)},open:g??y,mask:i,push:u,width:oe,height:ge,style:Object.assign(Object.assign({},V),v),className:ne(te,x),rootClassName:pe,getContainer:G,afterOpenChange:l??C,panelRef:D,zIndex:X,"aria-labelledby":f??M,destroyOnClose:R??T}),j.createElement(ts,Object.assign({prefixCls:k},B,{ariaId:M,onClose:h}))))))},Ia=n=>{const{prefixCls:s,style:t,className:a,placement:c="right"}=n,i=is(n,["prefixCls","style","className","placement"]),{getPrefixCls:u}=j.useContext(xt),g=u("drawer",s),[l,h,o]=ns(g),r=ne(g,`${g}-pure`,`${g}-${c}`,h,o,a);return l(j.createElement("div",{className:r,style:t},j.createElement(ts,Object.assign({prefixCls:g},i))))};We._InternalPanelDoNotUseOrYouWillBeFired=Ia;var La={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},Pa=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:La}))},Ke=j.forwardRef(Pa),Aa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"swap",theme:"outlined"},Ba=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Aa}))},Bt=j.forwardRef(Ba);function Oa(n,s,t){return typeof t=="boolean"?t:n.length?!0:Ks(s).some(c=>c.type===qt)}var ls=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)s.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(t[a[c]]=n[a[c]]);return t};function et({suffixCls:n,tagName:s,displayName:t}){return a=>j.forwardRef((i,u)=>j.createElement(a,Object.assign({ref:u,suffixCls:n,tagName:s},i)))}const yt=j.forwardRef((n,s)=>{const{prefixCls:t,suffixCls:a,className:c,tagName:i}=n,u=ls(n,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:g}=j.useContext(xt),l=g("layout",t),[h,o,r]=Wt(l),m=a?`${l}-${a}`:l;return h(j.createElement(i,Object.assign({className:ne(t||m,c,o,r),ref:s},u)))}),Da=j.forwardRef((n,s)=>{const{direction:t}=j.useContext(xt),[a,c]=j.useState([]),{prefixCls:i,className:u,rootClassName:g,children:l,hasSider:h,tagName:o,style:r}=n,m=ls(n,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),v=Gs(m,["suffixCls"]),{getPrefixCls:x,className:f,style:y}=ft("layout"),C=x("layout",i),S=Oa(a,l,h),[N,b,T]=Wt(C),R=ne(C,{[`${C}-has-sider`]:S,[`${C}-rtl`]:t==="rtl"},f,u,g,b,T),B=j.useMemo(()=>({siderHook:{addSider:L=>{c(M=>[].concat(Js(M),[L]))},removeSider:L=>{c(M=>M.filter(I=>I!==L))}}}),[]);return N(j.createElement(Qs.Provider,{value:B},j.createElement(o,Object.assign({ref:s,className:R,style:Object.assign(Object.assign({},y),r)},v),l)))}),Fa=et({tagName:"div",displayName:"Layout"})(Da),$a=et({suffixCls:"header",tagName:"header",displayName:"Header"})(yt),Ha=et({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(yt),za=et({suffixCls:"content",tagName:"main",displayName:"Content"})(yt),Ne=Fa;Ne.Header=$a;Ne.Footer=Ha;Ne.Content=za;Ne.Sider=qt;Ne._InternalSiderContext=Ys;var Va={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},Ua=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Va}))},Ot=j.forwardRef(Ua),qa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"},Wa=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:qa}))},Dt=j.forwardRef(Wa),Ka={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"},Ga=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Ka}))},Ft=j.forwardRef(Ga),Ja={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},Qa=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Ja}))},Ge=j.forwardRef(Qa),Ya={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 385.6a446.7 446.7 0 00-96-142.4 446.7 446.7 0 00-142.4-96C631.1 123.8 572.5 112 512 112s-119.1 11.8-174.4 35.2a446.7 446.7 0 00-142.4 96 446.7 446.7 0 00-96 142.4C75.8 440.9 64 499.5 64 560c0 132.7 58.3 257.7 159.9 343.1l1.7 1.4c5.8 4.8 13.1 7.5 20.6 7.5h531.7c7.5 0 14.8-2.7 20.6-7.5l1.7-1.4C901.7 817.7 960 692.7 960 560c0-60.5-11.9-119.1-35.2-174.4zM761.4 836H262.6A371.12 371.12 0 01140 560c0-99.4 38.7-192.8 109-263 70.3-70.3 163.7-109 263-109 99.4 0 192.8 38.7 263 109 70.3 70.3 109 163.7 109 263 0 105.6-44.5 205.5-122.6 276zM623.5 421.5a8.03 8.03 0 00-11.3 0L527.7 506c-18.7-5-39.4-.2-54.1 14.5a55.95 55.95 0 000 79.2 55.95 55.95 0 0079.2 0 55.87 55.87 0 0014.5-54.1l84.5-84.5c3.1-3.1 3.1-8.2 0-11.3l-28.3-28.3zM490 320h44c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8h-44c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8zm260 218v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8zm12.7-197.2l-31.1-31.1a8.03 8.03 0 00-11.3 0l-56.6 56.6a8.03 8.03 0 000 11.3l31.1 31.1c3.1 3.1 8.2 3.1 11.3 0l56.6-56.6c3.1-3.1 3.1-8.2 0-11.3zm-458.6-31.1a8.03 8.03 0 00-11.3 0l-31.1 31.1a8.03 8.03 0 000 11.3l56.6 56.6c3.1 3.1 8.2 3.1 11.3 0l31.1-31.1c3.1-3.1 3.1-8.2 0-11.3l-56.6-56.6zM262 530h-80c-4.4 0-8 3.6-8 8v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8z"}}]},name:"dashboard",theme:"outlined"},Xa=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Ya}))},nt=j.forwardRef(Xa),Za={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},en=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Za}))},tn=j.forwardRef(en),sn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},an=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:sn}))},nn=j.forwardRef(an),ln={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},on=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:ln}))},$t=j.forwardRef(on),rn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},cn=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:rn}))},Ht=j.forwardRef(cn),dn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},hn=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:dn}))},zt=j.forwardRef(hn),un=Object.defineProperty,Je=Object.getOwnPropertySymbols,os=Object.prototype.hasOwnProperty,rs=Object.prototype.propertyIsEnumerable,Vt=(n,s,t)=>s in n?un(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t,ht=(n,s)=>{for(var t in s||(s={}))os.call(s,t)&&Vt(n,t,s[t]);if(Je)for(var t of Je(s))rs.call(s,t)&&Vt(n,t,s[t]);return n},ut=(n,s)=>{var t={};for(var a in n)os.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&Je)for(var a of Je(n))s.indexOf(a)<0&&rs.call(n,a)&&(t[a]=n[a]);return t};/**
|
|
1
|
+
var Ms=Object.defineProperty;var Es=(n,s,t)=>s in n?Ms(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t;var A=(n,s,t)=>Es(n,typeof s!="symbol"?s+"":s,t);import{r as j,R as q,j as e,a as Rs}from"./index-DP7PQUCA.js";import{L as Is,M as Ls,_ as ie,c as ne,N as ot,P as Ps,Q as rt,d as jt,U as ye,V as Ct,W as st,X as bt,Y as As,Z as ft,$ as Bs,a0 as Nt,a1 as Os,g as Ds,m as Fs,u as Pe,a2 as $s,a3 as Hs,a4 as zs,a5 as Vs,a6 as Us,a7 as qs,a8 as Ws,a9 as _t,C as xt,I as xe,aa as Ks,ab as qt,ac as Gs,ad as Wt,ae as Js,af as Qs,ag as Ys,e as re,t as p,q as He,v as Xs,w as be,f as Zs,h as ea,j as ta,s as d,o as W,n as he,ah as Kt,ai as De,aj as J,ak as qe,al as Oe,k as sa,am as aa,l as ze,an as na,ao as je,S as Gt,B as F,ap as ia,aq as la,ar as Fe,as as oa,at as fe,au as St,av as Ae,y as ra,J as ca,aw as Jt,H as Be,ax as Ve,E as ct,ay as kt,G as dt,az as da,O as Qt,aA as ha,aB as ua,aC as ma,aD as we,aE as wt,aF as pa,aG as Tt,aH as Yt,aI as Xt,aJ as Te,aK as Me,aL as Zt,aM as at,aN as Mt,aO as Et,aP as Rt,aQ as ga,aR as fa,A as xa,aS as Ue,aT as It,aU as ya,z as va,x as E,D as ja,aV as Ca}from"./AppHeader.module-CXq8iJHa.js";var Lt=j.createContext(null),es=j.createContext({}),ba=["prefixCls","className","containerRef"],Na=function(s){var t=s.prefixCls,a=s.className,c=s.containerRef,i=Is(s,ba),u=j.useContext(es),g=u.panel,l=Ls(g,c);return j.createElement("div",ie({className:ne("".concat(t,"-content"),a),role:"dialog",ref:l},ot(s,{aria:!0}),{"aria-modal":"true"},i))};function Pt(n){return typeof n=="string"&&String(Number(n))===n?(Ps(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(n)):n}var At={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function _a(n,s){var t,a,c,i=n.prefixCls,u=n.open,g=n.placement,l=n.inline,h=n.push,o=n.forceRender,r=n.autoFocus,m=n.keyboard,v=n.classNames,x=n.rootClassName,f=n.rootStyle,y=n.zIndex,C=n.className,S=n.id,N=n.style,b=n.motion,T=n.width,R=n.height,B=n.children,L=n.mask,M=n.maskClosable,I=n.maskMotion,O=n.maskClassName,ee=n.maskStyle,te=n.afterOpenChange,V=n.onClose,K=n.onMouseEnter,ue=n.onMouseOver,k=n.onMouseLeave,z=n.onClick,le=n.onKeyDown,me=n.onKeyUp,G=n.styles,pe=n.drawerRender,oe=j.useRef(),ge=j.useRef(),ve=j.useRef();j.useImperativeHandle(s,function(){return oe.current});var se=function(ce){var Re=ce.keyCode,Ie=ce.shiftKey;switch(Re){case st.TAB:{if(Re===st.TAB){if(!Ie&&document.activeElement===ve.current){var Le;(Le=ge.current)===null||Le===void 0||Le.focus({preventScroll:!0})}else if(Ie&&document.activeElement===ge.current){var tt;(tt=ve.current)===null||tt===void 0||tt.focus({preventScroll:!0})}}break}case st.ESC:{V&&m&&(ce.stopPropagation(),V(ce));break}}};j.useEffect(function(){if(u&&r){var Z;(Z=oe.current)===null||Z===void 0||Z.focus({preventScroll:!0})}},[u]);var Y=j.useState(!1),D=rt(Y,2),X=D[0],ae=D[1],U=j.useContext(Lt),_e;typeof h=="boolean"?_e=h?{}:{distance:0}:_e=h||{};var Ce=(t=(a=(c=_e)===null||c===void 0?void 0:c.distance)!==null&&a!==void 0?a:U==null?void 0:U.pushDistance)!==null&&t!==void 0?t:180,_s=j.useMemo(function(){return{pushDistance:Ce,push:function(){ae(!0)},pull:function(){ae(!1)}}},[Ce]);j.useEffect(function(){if(u){var Z;U==null||(Z=U.push)===null||Z===void 0||Z.call(U)}else{var ce;U==null||(ce=U.pull)===null||ce===void 0||ce.call(U)}},[u]),j.useEffect(function(){return function(){var Z;U==null||(Z=U.pull)===null||Z===void 0||Z.call(U)}},[]);var Ss=j.createElement(jt,ie({key:"mask"},I,{visible:L&&u}),function(Z,ce){var Re=Z.className,Ie=Z.style;return j.createElement("div",{className:ne("".concat(i,"-mask"),Re,v==null?void 0:v.mask,O),style:ye(ye(ye({},Ie),ee),G==null?void 0:G.mask),onClick:M&&u?V:void 0,ref:ce})}),ks=typeof b=="function"?b(g):b,Se={};if(X&&Ce)switch(g){case"top":Se.transform="translateY(".concat(Ce,"px)");break;case"bottom":Se.transform="translateY(".concat(-Ce,"px)");break;case"left":Se.transform="translateX(".concat(Ce,"px)");break;default:Se.transform="translateX(".concat(-Ce,"px)");break}g==="left"||g==="right"?Se.width=Pt(T):Se.height=Pt(R);var ws={onMouseEnter:K,onMouseOver:ue,onMouseLeave:k,onClick:z,onKeyDown:le,onKeyUp:me},Ts=j.createElement(jt,ie({key:"panel"},ks,{visible:u,forceRender:o,onVisibleChanged:function(ce){te==null||te(ce)},removeOnLeave:!1,leavedClassName:"".concat(i,"-content-wrapper-hidden")}),function(Z,ce){var Re=Z.className,Ie=Z.style,Le=j.createElement(Na,ie({id:S,containerRef:ce,prefixCls:i,className:ne(C,v==null?void 0:v.content),style:ye(ye({},N),G==null?void 0:G.content)},ot(n,{aria:!0}),ws),B);return j.createElement("div",ie({className:ne("".concat(i,"-content-wrapper"),v==null?void 0:v.wrapper,Re),style:ye(ye(ye({},Se),Ie),G==null?void 0:G.wrapper)},ot(n,{data:!0})),pe?pe(Le):Le)}),vt=ye({},f);return y&&(vt.zIndex=y),j.createElement(Lt.Provider,{value:_s},j.createElement("div",{className:ne(i,"".concat(i,"-").concat(g),x,Ct(Ct({},"".concat(i,"-open"),u),"".concat(i,"-inline"),l)),style:vt,tabIndex:-1,ref:oe,onKeyDown:se},Ss,j.createElement("div",{tabIndex:0,ref:ge,style:At,"aria-hidden":"true","data-sentinel":"start"}),Ts,j.createElement("div",{tabIndex:0,ref:ve,style:At,"aria-hidden":"true","data-sentinel":"end"})))}var Sa=j.forwardRef(_a),ka=function(s){var t=s.open,a=t===void 0?!1:t,c=s.prefixCls,i=c===void 0?"rc-drawer":c,u=s.placement,g=u===void 0?"right":u,l=s.autoFocus,h=l===void 0?!0:l,o=s.keyboard,r=o===void 0?!0:o,m=s.width,v=m===void 0?378:m,x=s.mask,f=x===void 0?!0:x,y=s.maskClosable,C=y===void 0?!0:y,S=s.getContainer,N=s.forceRender,b=s.afterOpenChange,T=s.destroyOnClose,R=s.onMouseEnter,B=s.onMouseOver,L=s.onMouseLeave,M=s.onClick,I=s.onKeyDown,O=s.onKeyUp,ee=s.panelRef,te=j.useState(!1),V=rt(te,2),K=V[0],ue=V[1],k=j.useState(!1),z=rt(k,2),le=z[0],me=z[1];bt(function(){me(!0)},[]);var G=le?a:!1,pe=j.useRef(),oe=j.useRef();bt(function(){G&&(oe.current=document.activeElement)},[G]);var ge=function(X){var ae;if(ue(X),b==null||b(X),!X&&oe.current&&!((ae=pe.current)!==null&&ae!==void 0&&ae.contains(oe.current))){var U;(U=oe.current)===null||U===void 0||U.focus({preventScroll:!0})}},ve=j.useMemo(function(){return{panel:ee}},[ee]);if(!N&&!K&&!G&&T)return null;var se={onMouseEnter:R,onMouseOver:B,onMouseLeave:L,onClick:M,onKeyDown:I,onKeyUp:O},Y=ye(ye({},s),{},{open:G,prefixCls:i,placement:g,autoFocus:h,keyboard:r,width:v,mask:f,maskClosable:C,inline:S===!1,afterOpenChange:ge,ref:pe},se);return j.createElement(es.Provider,{value:ve},j.createElement(As,{open:G||N||K,autoDestroy:!1,getContainer:S,autoLock:f&&(G||K)},j.createElement(Sa,Y)))};const ts=n=>{var s,t;const{prefixCls:a,ariaId:c,title:i,footer:u,extra:g,closable:l,loading:h,onClose:o,headerStyle:r,bodyStyle:m,footerStyle:v,children:x,classNames:f,styles:y}=n,C=ft("drawer");let S;l===!1?S=void 0:l===void 0||l===!0?S="start":S=(l==null?void 0:l.placement)==="end"?"end":"start";const N=j.useCallback(L=>j.createElement("button",{type:"button",onClick:o,className:ne(`${a}-close`,{[`${a}-close-${S}`]:S==="end"})},L),[o,a,S]),[b,T]=Bs(Nt(n),Nt(C),{closable:!0,closeIconRender:N}),R=()=>{var L,M;return!i&&!b?null:j.createElement("div",{style:Object.assign(Object.assign(Object.assign({},(L=C.styles)===null||L===void 0?void 0:L.header),r),y==null?void 0:y.header),className:ne(`${a}-header`,{[`${a}-header-close-only`]:b&&!i&&!g},(M=C.classNames)===null||M===void 0?void 0:M.header,f==null?void 0:f.header)},j.createElement("div",{className:`${a}-header-title`},S==="start"&&T,i&&j.createElement("div",{className:`${a}-title`,id:c},i)),g&&j.createElement("div",{className:`${a}-extra`},g),S==="end"&&T)},B=()=>{var L,M;if(!u)return null;const I=`${a}-footer`;return j.createElement("div",{className:ne(I,(L=C.classNames)===null||L===void 0?void 0:L.footer,f==null?void 0:f.footer),style:Object.assign(Object.assign(Object.assign({},(M=C.styles)===null||M===void 0?void 0:M.footer),v),y==null?void 0:y.footer)},u)};return j.createElement(j.Fragment,null,R(),j.createElement("div",{className:ne(`${a}-body`,f==null?void 0:f.body,(s=C.classNames)===null||s===void 0?void 0:s.body),style:Object.assign(Object.assign(Object.assign({},(t=C.styles)===null||t===void 0?void 0:t.body),m),y==null?void 0:y.body)},h?j.createElement(Os,{active:!0,title:!1,paragraph:{rows:5},className:`${a}-body-skeleton`}):x),B())},wa=n=>{const s="100%";return{left:`translateX(-${s})`,right:`translateX(${s})`,top:`translateY(-${s})`,bottom:`translateY(${s})`}[n]},ss=(n,s)=>({"&-enter, &-appear":Object.assign(Object.assign({},n),{"&-active":s}),"&-leave":Object.assign(Object.assign({},s),{"&-active":n})}),as=(n,s)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${s}`}}},ss({opacity:n},{opacity:1})),Ta=(n,s)=>[as(.7,s),ss({transform:wa(n)},{transform:"none"})],Ma=n=>{const{componentCls:s,motionDurationSlow:t}=n;return{[s]:{[`${s}-mask-motion`]:as(0,t),[`${s}-panel-motion`]:["left","right","top","bottom"].reduce((a,c)=>Object.assign(Object.assign({},a),{[`&-${c}`]:Ta(c,t)}),{})}}},Ea=n=>{const{borderRadiusSM:s,componentCls:t,zIndexPopup:a,colorBgMask:c,colorBgElevated:i,motionDurationSlow:u,motionDurationMid:g,paddingXS:l,padding:h,paddingLG:o,fontSizeLG:r,lineHeightLG:m,lineWidth:v,lineType:x,colorSplit:f,marginXS:y,colorIcon:C,colorIconHover:S,colorBgTextHover:N,colorBgTextActive:b,colorText:T,fontWeightStrong:R,footerPaddingBlock:B,footerPaddingInline:L,calc:M}=n,I=`${t}-content-wrapper`;return{[t]:{position:"fixed",inset:0,zIndex:a,pointerEvents:"none",color:T,"&-pure":{position:"relative",background:i,display:"flex",flexDirection:"column",[`&${t}-left`]:{boxShadow:n.boxShadowDrawerLeft},[`&${t}-right`]:{boxShadow:n.boxShadowDrawerRight},[`&${t}-top`]:{boxShadow:n.boxShadowDrawerUp},[`&${t}-bottom`]:{boxShadow:n.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${t}-mask`]:{position:"absolute",inset:0,zIndex:a,background:c,pointerEvents:"auto"},[I]:{position:"absolute",zIndex:a,maxWidth:"100vw",transition:`all ${u}`,"&-hidden":{display:"none"}},[`&-left > ${I}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:n.boxShadowDrawerLeft},[`&-right > ${I}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:n.boxShadowDrawerRight},[`&-top > ${I}`]:{top:0,insetInline:0,boxShadow:n.boxShadowDrawerUp},[`&-bottom > ${I}`]:{bottom:0,insetInline:0,boxShadow:n.boxShadowDrawerDown},[`${t}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:i,pointerEvents:"auto"},[`${t}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Pe(h)} ${Pe(o)}`,fontSize:r,lineHeight:m,borderBottom:`${Pe(v)} ${x} ${f}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${t}-extra`]:{flex:"none"},[`${t}-close`]:Object.assign({display:"inline-flex",width:M(r).add(l).equal(),height:M(r).add(l).equal(),borderRadius:s,justifyContent:"center",alignItems:"center",color:C,fontWeight:R,fontSize:r,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${g}`,textRendering:"auto",[`&${t}-close-end`]:{marginInlineStart:y},[`&:not(${t}-close-end)`]:{marginInlineEnd:y},"&:hover":{color:S,backgroundColor:N,textDecoration:"none"},"&:active":{backgroundColor:b}},$s(n)),[`${t}-title`]:{flex:1,margin:0,fontWeight:n.fontWeightStrong,fontSize:r,lineHeight:m},[`${t}-body`]:{flex:1,minWidth:0,minHeight:0,padding:o,overflow:"auto",[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${t}-footer`]:{flexShrink:0,padding:`${Pe(B)} ${Pe(L)}`,borderTop:`${Pe(v)} ${x} ${f}`},"&-rtl":{direction:"rtl"}}}},Ra=n=>({zIndexPopup:n.zIndexPopupBase,footerPaddingBlock:n.paddingXS,footerPaddingInline:n.padding}),ns=Ds("Drawer",n=>{const s=Fs(n,{});return[Ea(s),Ma(s)]},Ra);var is=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)s.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(t[a[c]]=n[a[c]]);return t};const Ia={distance:180},We=n=>{const{rootClassName:s,width:t,height:a,size:c="default",mask:i=!0,push:u=Ia,open:g,afterOpenChange:l,onClose:h,prefixCls:o,getContainer:r,panelRef:m=null,style:v,className:x,"aria-labelledby":f,visible:y,afterVisibleChange:C,maskStyle:S,drawerStyle:N,contentWrapperStyle:b,destroyOnClose:T,destroyOnHidden:R}=n,B=is(n,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","panelRef","style","className","aria-labelledby","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle","destroyOnClose","destroyOnHidden"]),L=Hs(),M=B.title?L:void 0,{getPopupContainer:I,getPrefixCls:O,direction:ee,className:te,style:V,classNames:K,styles:ue}=ft("drawer"),k=O("drawer",o),[z,le,me]=ns(k),G=r===void 0&&I?()=>I(document.body):r,pe=ne({"no-mask":!i,[`${k}-rtl`]:ee==="rtl"},s,le,me),oe=j.useMemo(()=>t??(c==="large"?736:378),[t,c]),ge=j.useMemo(()=>a??(c==="large"?736:378),[a,c]),ve={motionName:_t(k,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},se=Ce=>({motionName:_t(k,`panel-motion-${Ce}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Y=zs(),D=Vs(m,Y),[X,ae]=Us("Drawer",B.zIndex),{classNames:U={},styles:_e={}}=B;return z(j.createElement(qs,{form:!0,space:!0},j.createElement(Ws.Provider,{value:ae},j.createElement(ka,Object.assign({prefixCls:k,onClose:h,maskMotion:ve,motion:se},B,{classNames:{mask:ne(U.mask,K.mask),content:ne(U.content,K.content),wrapper:ne(U.wrapper,K.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},_e.mask),S),ue.mask),content:Object.assign(Object.assign(Object.assign({},_e.content),N),ue.content),wrapper:Object.assign(Object.assign(Object.assign({},_e.wrapper),b),ue.wrapper)},open:g??y,mask:i,push:u,width:oe,height:ge,style:Object.assign(Object.assign({},V),v),className:ne(te,x),rootClassName:pe,getContainer:G,afterOpenChange:l??C,panelRef:D,zIndex:X,"aria-labelledby":f??M,destroyOnClose:R??T}),j.createElement(ts,Object.assign({prefixCls:k},B,{ariaId:M,onClose:h}))))))},La=n=>{const{prefixCls:s,style:t,className:a,placement:c="right"}=n,i=is(n,["prefixCls","style","className","placement"]),{getPrefixCls:u}=j.useContext(xt),g=u("drawer",s),[l,h,o]=ns(g),r=ne(g,`${g}-pure`,`${g}-${c}`,h,o,a);return l(j.createElement("div",{className:r,style:t},j.createElement(ts,Object.assign({prefixCls:g},i))))};We._InternalPanelDoNotUseOrYouWillBeFired=La;var Pa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},Aa=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Pa}))},Ke=j.forwardRef(Aa),Ba={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"swap",theme:"outlined"},Oa=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Ba}))},Bt=j.forwardRef(Oa);function Da(n,s,t){return typeof t=="boolean"?t:n.length?!0:Ks(s).some(c=>c.type===qt)}var ls=function(n,s){var t={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(n);c<a.length;c++)s.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(n,a[c])&&(t[a[c]]=n[a[c]]);return t};function et({suffixCls:n,tagName:s,displayName:t}){return a=>j.forwardRef((i,u)=>j.createElement(a,Object.assign({ref:u,suffixCls:n,tagName:s},i)))}const yt=j.forwardRef((n,s)=>{const{prefixCls:t,suffixCls:a,className:c,tagName:i}=n,u=ls(n,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:g}=j.useContext(xt),l=g("layout",t),[h,o,r]=Wt(l),m=a?`${l}-${a}`:l;return h(j.createElement(i,Object.assign({className:ne(t||m,c,o,r),ref:s},u)))}),Fa=j.forwardRef((n,s)=>{const{direction:t}=j.useContext(xt),[a,c]=j.useState([]),{prefixCls:i,className:u,rootClassName:g,children:l,hasSider:h,tagName:o,style:r}=n,m=ls(n,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),v=Gs(m,["suffixCls"]),{getPrefixCls:x,className:f,style:y}=ft("layout"),C=x("layout",i),S=Da(a,l,h),[N,b,T]=Wt(C),R=ne(C,{[`${C}-has-sider`]:S,[`${C}-rtl`]:t==="rtl"},f,u,g,b,T),B=j.useMemo(()=>({siderHook:{addSider:L=>{c(M=>[].concat(Js(M),[L]))},removeSider:L=>{c(M=>M.filter(I=>I!==L))}}}),[]);return N(j.createElement(Qs.Provider,{value:B},j.createElement(o,Object.assign({ref:s,className:R,style:Object.assign(Object.assign({},y),r)},v),l)))}),$a=et({tagName:"div",displayName:"Layout"})(Fa),Ha=et({suffixCls:"header",tagName:"header",displayName:"Header"})(yt),za=et({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(yt),Va=et({suffixCls:"content",tagName:"main",displayName:"Content"})(yt),Ne=$a;Ne.Header=Ha;Ne.Footer=za;Ne.Content=Va;Ne.Sider=qt;Ne._InternalSiderContext=Ys;var Ua={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},qa=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Ua}))},Ot=j.forwardRef(qa),Wa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"},Ka=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Wa}))},Dt=j.forwardRef(Ka),Ga={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"},Ja=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Ga}))},Ft=j.forwardRef(Ja),Qa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},Ya=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Qa}))},Ge=j.forwardRef(Ya),Xa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 385.6a446.7 446.7 0 00-96-142.4 446.7 446.7 0 00-142.4-96C631.1 123.8 572.5 112 512 112s-119.1 11.8-174.4 35.2a446.7 446.7 0 00-142.4 96 446.7 446.7 0 00-96 142.4C75.8 440.9 64 499.5 64 560c0 132.7 58.3 257.7 159.9 343.1l1.7 1.4c5.8 4.8 13.1 7.5 20.6 7.5h531.7c7.5 0 14.8-2.7 20.6-7.5l1.7-1.4C901.7 817.7 960 692.7 960 560c0-60.5-11.9-119.1-35.2-174.4zM761.4 836H262.6A371.12 371.12 0 01140 560c0-99.4 38.7-192.8 109-263 70.3-70.3 163.7-109 263-109 99.4 0 192.8 38.7 263 109 70.3 70.3 109 163.7 109 263 0 105.6-44.5 205.5-122.6 276zM623.5 421.5a8.03 8.03 0 00-11.3 0L527.7 506c-18.7-5-39.4-.2-54.1 14.5a55.95 55.95 0 000 79.2 55.95 55.95 0 0079.2 0 55.87 55.87 0 0014.5-54.1l84.5-84.5c3.1-3.1 3.1-8.2 0-11.3l-28.3-28.3zM490 320h44c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8h-44c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8zm260 218v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8zm12.7-197.2l-31.1-31.1a8.03 8.03 0 00-11.3 0l-56.6 56.6a8.03 8.03 0 000 11.3l31.1 31.1c3.1 3.1 8.2 3.1 11.3 0l56.6-56.6c3.1-3.1 3.1-8.2 0-11.3zm-458.6-31.1a8.03 8.03 0 00-11.3 0l-31.1 31.1a8.03 8.03 0 000 11.3l56.6 56.6c3.1 3.1 8.2 3.1 11.3 0l31.1-31.1c3.1-3.1 3.1-8.2 0-11.3l-56.6-56.6zM262 530h-80c-4.4 0-8 3.6-8 8v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8z"}}]},name:"dashboard",theme:"outlined"},Za=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:Xa}))},nt=j.forwardRef(Za),en={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},tn=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:en}))},sn=j.forwardRef(tn),an={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},nn=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:an}))},ln=j.forwardRef(nn),on={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},rn=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:on}))},$t=j.forwardRef(rn),cn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},dn=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:cn}))},Ht=j.forwardRef(dn),hn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},un=function(s,t){return j.createElement(xe,ie({},s,{ref:t,icon:hn}))},zt=j.forwardRef(un),mn=Object.defineProperty,Je=Object.getOwnPropertySymbols,os=Object.prototype.hasOwnProperty,rs=Object.prototype.propertyIsEnumerable,Vt=(n,s,t)=>s in n?mn(n,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[s]=t,ht=(n,s)=>{for(var t in s||(s={}))os.call(s,t)&&Vt(n,t,s[t]);if(Je)for(var t of Je(s))rs.call(s,t)&&Vt(n,t,s[t]);return n},ut=(n,s)=>{var t={};for(var a in n)os.call(n,a)&&s.indexOf(a)<0&&(t[a]=n[a]);if(n!=null&&Je)for(var a of Je(n))s.indexOf(a)<0&&rs.call(n,a)&&(t[a]=n[a]);return t};/**
|
|
2
2
|
* @license QR Code generator library (TypeScript)
|
|
3
3
|
* Copyright (c) Project Nayuki.
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
@@ -6,7 +6,7 @@ var Ms=Object.defineProperty;var Es=(n,s,t)=>s in n?Ms(n,s,{enumerable:!0,config
|
|
|
6
6
|
* @license qrcode.react
|
|
7
7
|
* Copyright (c) Paul O'Shannessy
|
|
8
8
|
* SPDX-License-Identifier: ISC
|
|
9
|
-
*/var
|
|
9
|
+
*/var pn={L:$e.QrCode.Ecc.LOW,M:$e.QrCode.Ecc.MEDIUM,Q:$e.QrCode.Ecc.QUARTILE,H:$e.QrCode.Ecc.HIGH},cs=128,ds="L",hs="#FFFFFF",us="#000000",ms=!1,ps=1,gn=4,fn=0,xn=.1;function gs(n,s=0){const t=[];return n.forEach(function(a,c){let i=null;a.forEach(function(u,g){if(!u&&i!==null){t.push(`M${i+s} ${c+s}h${g-i}v1H${i+s}z`),i=null;return}if(g===a.length-1){if(!u)return;i===null?t.push(`M${g+s},${c+s} h1v1H${g+s}z`):t.push(`M${i+s},${c+s} h${g+1-i}v1H${i+s}z`);return}u&&i===null&&(i=g)})}),t.join("")}function fs(n,s){return n.slice().map((t,a)=>a<s.y||a>=s.y+s.h?t:t.map((c,i)=>i<s.x||i>=s.x+s.w?c:!1))}function yn(n,s,t,a){if(a==null)return null;const c=n.length+t*2,i=Math.floor(s*xn),u=c/s,g=(a.width||i)*u,l=(a.height||i)*u,h=a.x==null?n.length/2-g/2:a.x*u,o=a.y==null?n.length/2-l/2:a.y*u,r=a.opacity==null?1:a.opacity;let m=null;if(a.excavate){let x=Math.floor(h),f=Math.floor(o),y=Math.ceil(g+h-x),C=Math.ceil(l+o-f);m={x,y:f,w:y,h:C}}const v=a.crossOrigin;return{x:h,y:o,h:l,w:g,excavation:m,opacity:r,crossOrigin:v}}function vn(n,s){return s!=null?Math.max(Math.floor(s),0):n?gn:fn}function xs({value:n,level:s,minVersion:t,includeMargin:a,marginSize:c,imageSettings:i,size:u,boostLevel:g}){let l=q.useMemo(()=>{const x=(Array.isArray(n)?n:[n]).reduce((f,y)=>(f.push(...$e.QrSegment.makeSegments(y)),f),[]);return $e.QrCode.encodeSegments(x,pn[s],t,void 0,void 0,g)},[n,s,t,g]);const{cells:h,margin:o,numCells:r,calculatedImageSettings:m}=q.useMemo(()=>{let v=l.getModules();const x=vn(a,c),f=v.length+x*2,y=yn(v,u,x,i);return{cells:v,margin:x,numCells:f,calculatedImageSettings:y}},[l,u,i,a,c]);return{qrcode:l,margin:o,cells:h,numCells:r,calculatedImageSettings:m}}var jn=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),ys=q.forwardRef(function(s,t){const a=s,{value:c,size:i=cs,level:u=ds,bgColor:g=hs,fgColor:l=us,includeMargin:h=ms,minVersion:o=ps,boostLevel:r,marginSize:m,imageSettings:v}=a,f=ut(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:y}=f,C=ut(f,["style"]),S=v==null?void 0:v.src,N=q.useRef(null),b=q.useRef(null),T=q.useCallback(V=>{N.current=V,typeof t=="function"?t(V):t&&(t.current=V)},[t]),[R,B]=q.useState(!1),{margin:L,cells:M,numCells:I,calculatedImageSettings:O}=xs({value:c,level:u,minVersion:o,boostLevel:r,includeMargin:h,marginSize:m,imageSettings:v,size:i});q.useEffect(()=>{if(N.current!=null){const V=N.current,K=V.getContext("2d");if(!K)return;let ue=M;const k=b.current,z=O!=null&&k!==null&&k.complete&&k.naturalHeight!==0&&k.naturalWidth!==0;z&&O.excavation!=null&&(ue=fs(M,O.excavation));const le=window.devicePixelRatio||1;V.height=V.width=i*le;const me=i/I*le;K.scale(me,me),K.fillStyle=g,K.fillRect(0,0,I,I),K.fillStyle=l,jn?K.fill(new Path2D(gs(ue,L))):M.forEach(function(G,pe){G.forEach(function(oe,ge){oe&&K.fillRect(ge+L,pe+L,1,1)})}),O&&(K.globalAlpha=O.opacity),z&&K.drawImage(k,O.x+L,O.y+L,O.w,O.h)}}),q.useEffect(()=>{B(!1)},[S]);const ee=ht({height:i,width:i},y);let te=null;return S!=null&&(te=q.createElement("img",{src:S,key:S,style:{display:"none"},onLoad:()=>{B(!0)},ref:b,crossOrigin:O==null?void 0:O.crossOrigin})),q.createElement(q.Fragment,null,q.createElement("canvas",ht({style:ee,height:i,width:i,ref:T,role:"img"},C)),te)});ys.displayName="QRCodeCanvas";var Cn=q.forwardRef(function(s,t){const a=s,{value:c,size:i=cs,level:u=ds,bgColor:g=hs,fgColor:l=us,includeMargin:h=ms,minVersion:o=ps,boostLevel:r,title:m,marginSize:v,imageSettings:x}=a,f=ut(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:y,cells:C,numCells:S,calculatedImageSettings:N}=xs({value:c,level:u,minVersion:o,boostLevel:r,includeMargin:h,marginSize:v,imageSettings:x,size:i});let b=C,T=null;x!=null&&N!=null&&(N.excavation!=null&&(b=fs(C,N.excavation)),T=q.createElement("image",{href:x.src,height:N.h,width:N.w,x:N.x+y,y:N.y+y,preserveAspectRatio:"none",opacity:N.opacity,crossOrigin:N.crossOrigin}));const R=gs(b,y);return q.createElement("svg",ht({height:i,width:i,viewBox:`0 0 ${S} ${S}`,ref:t,role:"img"},f),!!m&&q.createElement("title",null,m),q.createElement("path",{fill:g,d:`M0,0 h${S}v${S}H0z`,shapeRendering:"crispEdges"}),q.createElement("path",{fill:l,d:R,shapeRendering:"crispEdges"}),T)});Cn.displayName="QRCodeSVG";const bn=[{label:"Auto",value:"auto"},{label:"Opus 4.6 (1M)",value:"opus-4.6-1m",tokens:1e6},{label:"Sonnet 4.6",value:"sonnet-4.6",tokens:2e5},{label:"GLM5",value:"glm5",tokens:2e5},{label:"Kimi K2.5",value:"kimi-k2.5",tokens:2e5},{label:"MiniMax 2.1",value:"minimax-2.1",tokens:2e5},{label:"Qwen 3.5",value:"Qwen 3.5",tokens:2e5}],Nn={calibrationModels:bn},it=Nn.calibrationModels,_n=[{value:"zh",short:"zh",label:"简体中文"},{value:"en",short:"en",label:"English"},{value:"zh-TW",short:"zh-TW",label:"繁體中文"},{value:"ko",short:"ko",label:"한국어"},{value:"ja",short:"ja",label:"日本語"},{value:"de",short:"de",label:"Deutsch"},{value:"es",short:"es",label:"Español"},{value:"fr",short:"fr",label:"Français"},{value:"it",short:"it",label:"Italiano"},{value:"da",short:"da",label:"Dansk"},{value:"pl",short:"pl",label:"Polski"},{value:"ru",short:"ru",label:"Русский"},{value:"ar",short:"ar",label:"العربية"},{value:"no",short:"no",label:"Norsk"},{value:"pt-BR",short:"pt-BR",label:"Português (Brasil)"},{value:"th",short:"th",label:"ไทย"},{value:"tr",short:"tr",label:"Türkçe"},{value:"uk",short:"uk",label:"Українська"}],Ut=n=>{const s=t=>t.toUpperCase().split("").map(a=>String.fromCodePoint(127462+a.charCodeAt(0)-65)).join("");return!n||n.length!==2?s("CN"):s(n)},ke=class ke extends q.Component{constructor(t){super(t);A(this,"handleShowPrompts",()=>{this.setState({promptModalVisible:!0,promptData:this.extractUserPrompts()})});A(this,"handleExportPromptsTxt",()=>{const t=this.state.promptData;if(!t||t.length===0)return;const a=[];for(const g of t){const l=[],h=g.timestamp?new Date(g.timestamp).toLocaleString():"";h&&l.push(`${h}:
|
|
10
10
|
`);const o=(g.segments||[]).filter(r=>r.type==="text").map(r=>r.content);o.length>0&&l.push(o.join(`
|
|
11
11
|
`)),a.push(l.join(`
|
|
12
12
|
`))}if(a.length===0)return;const c=new Blob([a.join(`
|
|
@@ -19,21 +19,21 @@ var Ms=Object.defineProperty;var Es=(n,s,t)=>s in n?Ms(n,s,{enumerable:!0,config
|
|
|
19
19
|
=== ${p("ui.systemPrompt")} (${i.system.length}) ===`),i.system.forEach(r=>o.push(r))),i.messages.length>0&&(o.push(`
|
|
20
20
|
=== ${p("ui.messages")} (${i.messages.length}) ===`),i.messages.forEach(r=>o.push(r))),o.join(`
|
|
21
21
|
|
|
22
|
-
`)},l=i.messages.map((o,r)=>({text:o,msgIdx:r})).filter(({text:o})=>o.startsWith("[user]")).map(({text:o,msgIdx:r})=>{const m=o.replace(/^\[user\]\s*/,"").trim();return!m||He(m)?{cleaned:"",msgIdx:r}:{cleaned:ke.parseSegments(m).filter(f=>f.type==="text").map(f=>f.content.trim()).filter(f=>f&&!He(f)).join(" ").trim(),msgIdx:r}}).filter(({cleaned:o})=>!(!o||/Implement the following plan:/i.test(o))),h=l.length>0?e.jsx("div",{className:d.cacheNavList,children:l.map(({cleaned:o,msgIdx:r})=>e.jsx("div",{className:d.cacheNavItem,onClick:()=>this.scrollToCacheMsg(r),children:o},r))}):null;return e.jsxs("div",{className:d.cachePopover,children:[e.jsx("div",{className:d.cachePopoverHeader,children:e.jsxs("div",{className:d.cachePopoverTitle,children:[p("ui.cachedContentTitle"),e.jsx(he,{doc:"KVCacheContent"}),e.jsx(De,{className:d.cacheCopyBtn,onClick:()=>{navigator.clipboard.writeText(g()).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})}}),e.jsx("span",{className:d.cacheCalibrationLabel,children:p("ui.calibrationModelLabel")}),e.jsx(qe,{size:"small",value:this.state.calibrationModel,onChange:this.handleCalibrationModelChange,options:it,className:d.calibrationSelect,popupMatchSelectWidth:!1})]})}),(()=>{const r=i.cacheCreateTokens>0||i.cacheReadTokens>0?i:this._lastCachedTokens,m=t>0?t:this._lastContextPercent||0;return r||h?e.jsxs("div",{className:d.cacheTokenInfo,children:[r&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:d.cacheWriteToken,children:["write ",W(r.cacheCreateTokens)]})," / ",e.jsxs("span",{className:d.cacheReadToken,children:["read ",W(r.cacheReadTokens)]}),m>0&&e.jsxs("span",{className:d.cacheCtxPercent,children:["(ctx:",m,"%)"]})]}),h&&e.jsx(Oe,{content:h,trigger:"hover",placement:"left",children:e.jsx("span",{className:d.cacheNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:d.cacheScrollArea,ref:o=>{this._cacheScrollEl=o,o&&!this._cacheScrollInited&&(this._cacheScrollInited=!0,requestAnimationFrame(()=>{o.scrollTop=o.scrollHeight}))},children:[u(p("ui.tools"),i.tools,void 0,"tools"),u(p("ui.systemPrompt"),i.system,d.cacheCodeBlockSystem,"system"),u(p("ui.messages"),i.messages,void 0,"messages")]})]})}renderCacheRebuildStats(){const{requests:t=[]}=this.props,a=sa(t),c=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],i={ttl:"cacheLoss.ttl",system_change:"cacheLoss.systemChange",tools_change:"cacheLoss.toolsChange",model_change:"cacheLoss.modelChange",msg_truncated:"cacheLoss.msgTruncated",msg_modified:"cacheLoss.msgModified",key_change:"cacheLoss.keyChange"},u=c.filter(y=>a[y].count>0),g=u.reduce((y,C)=>y+a[C].count,0),l=u.reduce((y,C)=>y+a[C].cacheCreate,0)
|
|
22
|
+
`)},l=i.messages.map((o,r)=>({text:o,msgIdx:r})).filter(({text:o})=>o.startsWith("[user]")).map(({text:o,msgIdx:r})=>{const m=o.replace(/^\[user\]\s*/,"").trim();return!m||He(m)?{cleaned:"",msgIdx:r}:{cleaned:ke.parseSegments(m).filter(f=>f.type==="text").map(f=>f.content.trim()).filter(f=>f&&!He(f)).join(" ").trim(),msgIdx:r}}).filter(({cleaned:o})=>!(!o||/Implement the following plan:/i.test(o))),h=l.length>0?e.jsx("div",{className:d.cacheNavList,children:l.map(({cleaned:o,msgIdx:r})=>e.jsx("div",{className:d.cacheNavItem,onClick:()=>this.scrollToCacheMsg(r),children:o},r))}):null;return e.jsxs("div",{className:d.cachePopover,children:[e.jsx("div",{className:d.cachePopoverHeader,children:e.jsxs("div",{className:d.cachePopoverTitle,children:[p("ui.cachedContentTitle"),e.jsx(he,{doc:"KVCacheContent"}),e.jsx(De,{className:d.cacheCopyBtn,onClick:()=>{navigator.clipboard.writeText(g()).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})}}),e.jsx("span",{className:d.cacheCalibrationLabel,children:p("ui.calibrationModelLabel")}),e.jsx(qe,{size:"small",value:this.state.calibrationModel,onChange:this.handleCalibrationModelChange,options:it,className:d.calibrationSelect,popupMatchSelectWidth:!1})]})}),(()=>{const r=i.cacheCreateTokens>0||i.cacheReadTokens>0?i:this._lastCachedTokens,m=t>0?t:this._lastContextPercent||0;return r||h?e.jsxs("div",{className:d.cacheTokenInfo,children:[r&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:d.cacheWriteToken,children:["write ",W(r.cacheCreateTokens)]})," / ",e.jsxs("span",{className:d.cacheReadToken,children:["read ",W(r.cacheReadTokens)]}),m>0&&e.jsxs("span",{className:d.cacheCtxPercent,children:["(ctx:",m,"%)"]})]}),h&&e.jsx(Oe,{content:h,trigger:"hover",placement:"left",children:e.jsx("span",{className:d.cacheNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:d.cacheScrollArea,ref:o=>{this._cacheScrollEl=o,o&&!this._cacheScrollInited&&(this._cacheScrollInited=!0,requestAnimationFrame(()=>{o.scrollTop=o.scrollHeight}))},children:[u(p("ui.tools"),i.tools,void 0,"tools"),u(p("ui.systemPrompt"),i.system,d.cacheCodeBlockSystem,"system"),u(p("ui.messages"),i.messages,void 0,"messages")]})]})}renderCacheRebuildStats(){const{requests:t=[]}=this.props,a=sa(t),c=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],i={ttl:"cacheLoss.ttl",system_change:"cacheLoss.systemChange",tools_change:"cacheLoss.toolsChange",model_change:"cacheLoss.modelChange",msg_truncated:"cacheLoss.msgTruncated",msg_modified:"cacheLoss.msgModified",key_change:"cacheLoss.keyChange"},u=c.filter(y=>a[y].count>0),g=u.reduce((y,C)=>y+a[C].count,0),l=u.reduce((y,C)=>y+a[C].cacheCreate,0);aa(t);const h={},o={};for(let y=0;y<t.length;y++){const C=ze(t[y],t[y+1]);if(C.type==="SubAgent"){const S=C.subType||"Other";h[S]=(h[S]||0)+1}else if(C.type==="Teammate"){const S=C.subType||"Teammate";o[S]=(o[S]||0)+1}}const r=Object.entries(h).sort((y,C)=>C[1]-y[1]),m=Object.entries(o).sort((y,C)=>C[1]-y[1]),v=u.length>0,x=r.length>0,f=m.length>0;return!v&&!x&&!f?null:e.jsxs("div",{className:d.toolStatsColumn,children:[v&&e.jsxs("div",{className:x?d.modelCardSpaced:d.modelCard,children:[e.jsxs("div",{className:d.modelName,children:["MainAgent",e.jsx(he,{doc:"MainAgent"})," ",p("ui.cacheRebuildStats"),e.jsx(he,{doc:"CacheRebuild"})]}),e.jsxs("table",{className:d.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${d.th} ${d.thLeft}`,children:p("ui.cacheRebuild.reason")}),e.jsx("td",{className:d.th,children:p("ui.cacheRebuild.count")}),e.jsx("td",{className:d.th,children:p("ui.cacheRebuild.cacheCreate")})]})}),e.jsxs("tbody",{children:[u.map(y=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label,children:p(`ui.${i[y]}`)}),e.jsx("td",{className:d.td,children:a[y].count}),e.jsx("td",{className:d.td,children:W(a[y].cacheCreate)})]},y)),u.length>1&&e.jsxs("tr",{className:d.rebuildTotalRow,children:[e.jsx("td",{className:d.label,children:"Total"}),e.jsx("td",{className:d.td,children:g}),e.jsx("td",{className:d.td,children:W(l)})]})]})]})]}),x&&e.jsxs("div",{className:f?d.modelCardSpaced:d.modelCard,children:[e.jsx("div",{className:d.modelName,children:p("ui.subAgentStats")}),e.jsxs("table",{className:d.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${d.th} ${d.thLeft}`,children:"SubAgent"}),e.jsx("td",{className:d.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[r.map(([y,C])=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsxs("td",{className:d.label,children:[y," ",e.jsx(he,{doc:`SubAgent-${y}`})]}),e.jsx("td",{className:d.td,children:C})]},y)),r.length>1&&e.jsxs("tr",{className:d.rebuildTotalRow,children:[e.jsx("td",{className:d.label,children:"Total"}),e.jsx("td",{className:d.td,children:r.reduce((y,C)=>y+C[1],0)})]})]})]})]}),f&&e.jsxs("div",{className:d.modelCard,children:[e.jsxs("div",{className:d.modelName,children:["Teammate",e.jsx(he,{doc:"Teammate"})]}),e.jsxs("table",{className:d.statsTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{className:`${d.th} ${d.thLeft}`,children:"Name"}),e.jsx("td",{className:d.th,children:p("ui.cacheRebuild.count")})]})}),e.jsxs("tbody",{children:[m.map(([y,C])=>e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label,children:y}),e.jsx("td",{className:d.td,children:C})]},y)),m.length>1&&e.jsxs("tr",{className:d.rebuildTotalRow,children:[e.jsx("td",{className:d.label,children:"Total"}),e.jsx("td",{className:d.td,children:m.reduce((y,C)=>y+C[1],0)})]})]})]})]})]})}renderTextPrompt(t){return e.jsx("div",{className:d.textPromptCard,children:t.segments.map((a,c)=>a.type==="text"?e.jsx("pre",{className:d.preText,children:a.content},c):e.jsx(na,{size:"small",className:d.systemCollapse,items:[{key:`sys-${c}`,label:e.jsx("span",{className:d.systemLabel,children:a.label}),children:e.jsx("pre",{className:d.preSys,children:a.content})}]},c))})}renderOriginalPrompt(t){const a=t.segments.filter(c=>c.type==="text");return a.length===0?null:e.jsx("div",{className:d.textPromptCard,children:a.map((c,i)=>e.jsx("pre",{className:d.preText,children:c.content},i))})}buildTextModeContent(){const{promptData:t}=this.state,a=[];for(const c of t){const i=(c.segments||[]).filter(u=>u.type==="text").map(u=>u.content);i.length>0&&a.push(i.join(`
|
|
23
23
|
`))}return a.join(`
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
`)}renderProjectStatsContent(){const{projectStats:t,projectStatsLoading:a}=this.state;if(a)return e.jsx("div",{className:d.projectStatsCenter,children:e.jsx(Gt,{})});if(!t)return e.jsx("div",{className:d.projectStatsEmpty,children:p("ui.projectStats.noData")});const{summary:c,models:i,updatedAt:u}=t;i&&Object.entries(i).sort((h,o)=>o[1]-h[1]);const g={};if(t.files){for(const h of Object.values(t.files))if(h.models)for(const[o,r]of Object.entries(h.models))g[o]||(g[o]={input:0,output:0,cacheRead:0,cacheCreation:0,count:0}),g[o].input+=r.input_tokens||0,g[o].output+=r.output_tokens||0,g[o].cacheRead+=r.cache_read_input_tokens||0,g[o].cacheCreation+=r.cache_creation_input_tokens||0,g[o].count+=r.count||0}const l=Object.entries(g).sort((h,o)=>o[1].count-h[1].count);return e.jsxs("div",{className:d.projectStatsContent,children:[u&&e.jsx("div",{className:d.projectStatsUpdated,children:p("ui.projectStats.updatedAt",{time:new Date(u).toLocaleString()})}),e.jsxs("div",{className:d.projectStatsSummary,children:[e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(c==null?void 0:c.requestCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.totalRequests")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(c==null?void 0:c.turnCount)??(c==null?void 0:c.sessionCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.turnCount")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(c==null?void 0:c.fileCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.totalFiles")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:W(c==null?void 0:c.input_tokens)}),e.jsx("div",{className:d.projectStatLabel,children:"Input Tokens"})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:W(c==null?void 0:c.output_tokens)}),e.jsx("div",{className:d.projectStatLabel,children:"Output Tokens"})]})]}),l.length>0&&e.jsxs("div",{className:d.projectStatsSection,children:[e.jsx("div",{className:d.projectStatsSectionTitle,children:p("ui.projectStats.modelUsage")}),l.map(([h,o])=>{const r=o.input+o.cacheRead+o.cacheCreation,m=r>0?(o.cacheRead/r*100).toFixed(1):"0.0";return e.jsxs("div",{className:d.projectStatsModelCard,children:[e.jsxs("div",{className:d.projectStatsModelHeader,children:[e.jsx("span",{className:d.projectStatsModelName,children:h}),e.jsxs("span",{className:d.projectStatsModelCount,children:[o.count," reqs"]})]}),e.jsx("table",{className:d.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:"Token"}),e.jsx("td",{className:d.th,children:"input"}),e.jsx("td",{className:d.th,children:"output"})]}),e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label}),e.jsx("td",{className:d.td,children:W(r)}),e.jsx("td",{className:d.td,children:W(o.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:"Cache"}),e.jsx("td",{className:d.th,children:"create"}),e.jsx("td",{className:d.th,children:"read"})]}),e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label}),e.jsx("td",{className:d.td,children:W(o.cacheCreation)}),e.jsx("td",{className:d.td,children:W(o.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:p("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:d.td,children:[m,"%"]})]})]})})]},h)})]})]})}render(){const{requestCount:t,requests:a=[],viewMode:c,cacheType:i,onToggleViewMode:u,onImportLocalLogs:g,onLangChange:l,isLocalLog:h,localLogFile:o,projectName:r,collapseToolResults:m,onCollapseToolResultsChange:v,expandThinking:x,onExpandThinkingChange:f,expandDiff:y,onExpandDiffChange:C,filterIrrelevant:S,onFilterIrrelevantChange:N,updateInfo:b,onDismissUpdate:T,cliMode:R,terminalVisible:B,onToggleTerminal:L,onReturnToWorkspaces:M,contextWindow:I,serverCachedContent:O,resumeAutoChoice:ee,onResumeAutoChoiceToggle:te,onResumeAutoChoiceChange:V}=this.props,{countdownText:K}=this.state,ue=[{key:"import-local",icon:e.jsx($t,{}),label:p("ui.importLocalLogs"),onClick:g},{key:"export-prompts",icon:e.jsx(tn,{}),label:p("ui.exportPrompts"),onClick:this.handleShowPrompts},{key:"plugin-management",icon:e.jsx(Ot,{}),label:p("ui.pluginManagement"),onClick:this.handleShowPlugins},{key:"switch-workspace",icon:e.jsx($t,{className:d.iconMirror}),label:e.jsx("span",{className:d.disabledMenuItem,children:p("ui.switchWorkspace")}),disabled:!0},{key:"process-management",icon:e.jsx(nt,{}),label:p("ui.processManagement"),onClick:this.handleShowProcesses},{key:"proxy-switch",icon:e.jsx(Bt,{}),label:p("ui.proxySwitch"),onClick:()=>this.setState({proxyModalVisible:!0})},{type:"divider"},{key:"project-stats",icon:e.jsx(Dt,{}),label:p("ui.projectStats"),onClick:this.handleShowProjectStats},...c==="raw"?[{key:"global-settings",icon:e.jsx(Ht,{}),label:p("ui.globalSettings"),onClick:()=>this.setState({globalSettingsVisible:!0})}]:[],...c==="chat"?[{key:"display-settings",icon:e.jsx(Ht,{}),label:p("ui.settings"),onClick:()=>this.setState({settingsDrawerVisible:!0})}]:[],{key:"language",icon:e.jsx(nn,{}),label:p("ui.languageSettings"),children:[{key:"lang-grid-container",type:"group",label:e.jsx("div",{className:d.langGrid,children:Nn.map(k=>e.jsx(F,{size:"small",type:k.value===ia()?"primary":"default",onClick:z=>{z.stopPropagation(),na(k.value),l&&l()},className:d.langBtn,children:k.label},k.value))})}]}];return e.jsxs("div",{className:d.headerBar,children:[e.jsxs(Fe,{size:"middle",children:[e.jsx(la,{menu:{items:ue,className:"logo-dropdown-menu"},trigger:["hover"],onOpenChange:k=>this.setState({logoDropdownOpen:k}),align:{offset:[-4,0]},children:e.jsx("span",{className:`${d.logoWrap}${this.state.logoDropdownOpen?` ${d.logoWrapActive}`:""}`,children:e.jsx("img",{src:"/favicon.ico",alt:"Logo",className:`${d.logoImage}${this.state.logoDropdownOpen?` ${d.logoImageActive}`:""}`})})}),e.jsx(Oe,{content:this.renderTokenStats(),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px",maxHeight:"80vh",overflowY:"auto"},children:e.jsxs(fe,{className:d.tokenStatsTag,children:[e.jsx(nt,{className:d.tokenStatsIcon}),p("ui.tokenStats")]})}),this.props.activeProxyId&&this.props.activeProxyId!=="max"&&(()=>{const k=(this.props.proxyProfiles||[]).find(z=>z.id===this.props.activeProxyId);return k?e.jsxs(fe,{className:d.proxyProfileTag,onClick:()=>this.setState({proxyModalVisible:!0}),children:[e.jsx(Bt,{className:d.proxySwapIcon}),k.name,k.activeModel?` · ${k.activeModel}`:""]}):null})(),(()=>{var G,pe,oe,ge,ve;let k=0;const z=it.find(se=>se.value===this.state.calibrationModel),le=z==null?void 0:z.tokens;if(!h){if(le&&(I==null?void 0:I.used_percentage)!=null){const se=D=>{var ae,U;const X=(U=(ae=D.response)==null?void 0:ae.body)==null?void 0:U.usage;return((X==null?void 0:X.input_tokens)||0)+((X==null?void 0:X.cache_creation_input_tokens)||0)+((X==null?void 0:X.cache_read_input_tokens)||0)};let Y=0;for(let D=a.length-1;D>=0;D--)if(be(a[D])&&((pe=(G=a[D].response)==null?void 0:G.body)!=null&&pe.usage)){Y=se(a[D]);break}if(Y>0){const D=le*.835;k=Math.min(100,Math.max(0,Math.round(Y/D*100)))}else{const D=I.context_window_size||2e5;k=Math.min(100,Math.max(0,Math.round(I.used_percentage*D/le/83.5*100)))}}else if((I==null?void 0:I.used_percentage)!=null){const se=this.state.settingsModel?St(this.state.settingsModel):0,Y=I.context_window_size||2e5;se&&se!==Y?k=Math.min(100,Math.max(0,Math.round(I.used_percentage*Y/se/83.5*100))):k=Math.min(100,Math.max(0,Math.round(I.used_percentage/83.5*100)))}else if(a.length>0){const se=Y=>{var X,ae;const D=(ae=(X=Y.response)==null?void 0:X.body)==null?void 0:ae.usage;return((D==null?void 0:D.input_tokens)||0)+((D==null?void 0:D.cache_creation_input_tokens)||0)+((D==null?void 0:D.cache_read_input_tokens)||0)};for(let Y=a.length-1;Y>=0;Y--)if(be(a[Y])&&((ge=(oe=a[Y].response)==null?void 0:oe.body)!=null&&ge.usage)){const D=se(a[Y]),ae=(le||(I==null?void 0:I.context_window_size)||St(((ve=a[Y].body)==null?void 0:ve.model)||this.state.settingsModel))*.835;ae>0&&D>0&&(k=Math.min(100,Math.max(0,Math.round(D/ae*100))));break}}}k===0&&this._lastContextPercent>0&&(k=this._lastContextPercent);const me=k>=80?"#ff4d4f":k>=60?"#faad14":"#52c41a";return h?e.jsx(fe,{className:`${d.liveTag} ${d.liveTagHistory}`,children:e.jsx("span",{className:d.liveTagText,children:p("ui.historyLog",{file:o})})}):e.jsx(Oe,{content:this.state._cachePopoverOpen?this.renderCacheContentPopover(k):e.jsx("div",{className:d.cachePopoverPlaceholder}),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px"},onOpenChange:se=>{this.setState({_cachePopoverOpen:se}),se||(this._cacheScrollInited=!1)},children:e.jsxs("span",{className:d.liveTag,style:{borderColor:me,color:me},children:[e.jsx("span",{className:d.liveTagFill,style:{width:`${k}%`,backgroundColor:me}}),e.jsx("span",{className:d.liveTagContent,children:e.jsxs("span",{className:d.liveTagText,children:[p("ui.liveMonitoring"),r?`:${r}`:""]})})]})})})(),b&&e.jsx(fe,{color:b.type==="completed"?"green":"orange",closable:!0,onClose:()=>T&&T(),children:b.type==="completed"?p("ui.update.completed",{version:b.version}):p("ui.update.majorAvailable",{version:b.version})})]}),e.jsxs(Fe,{size:"middle",children:[K&&e.jsxs(fe,{style:{background:"#2a2a2a",border:"1px solid #3a3a3a",color:K===p("ui.cacheExpired")?"#ff6b6b":"#ccc"},children:[p("ui.cacheCountdown",{type:i?`(${i})`:""}),e.jsx("strong",{className:d.countdownStrong,children:K})]}),c==="chat"&&R&&!h&&this.state.localUrl&&e.jsxs(e.Fragment,{children:[this.state.countryFlag&&e.jsx(Oe,{content:this.state.countryInfo?e.jsxs("div",{className:d.countryInfoPopover,children:[e.jsxs("div",{children:[this.state.countryFlag," ",this.state.countryInfo.country]}),this.state.countryInfo.region&&e.jsx("div",{children:this.state.countryInfo.region}),this.state.countryInfo.city&&e.jsx("div",{children:this.state.countryInfo.city}),this.state.countryInfo.org&&e.jsx("div",{className:d.countryInfoMeta,children:this.state.countryInfo.org}),this.state.countryInfo.ip&&e.jsx("div",{className:d.countryInfoMeta,children:this.state.countryInfo.ip})]}):null,trigger:"hover",placement:"bottomRight",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 12px"},children:e.jsx(F,{className:d.compactBtnNoBorder,icon:e.jsx("span",{className:d.countryFlagIcon,children:this.state.countryFlag})})}),e.jsx(Oe,{content:e.jsxs("div",{className:d.qrcodePopover,children:[e.jsx("div",{className:d.qrcodeTitle,children:p("ui.scanToCoding")}),e.jsx(ys,{value:this.state.localUrl,size:200,bgColor:"#141414",fgColor:"#d9d9d9",level:"M"}),e.jsx(Ae,{readOnly:!0,value:this.state.localUrl,className:d.qrcodeUrlInput,suffix:e.jsx(De,{className:d.qrcodeUrlCopy,onClick:()=>{navigator.clipboard.writeText(this.state.localUrl).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})}})})]}),trigger:"hover",placement:"bottomRight",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px"},children:e.jsx(F,{className:d.compactBtnNoBorder,icon:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:d.svgIcon,children:[e.jsx("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),e.jsx("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})]})})})]}),R&&c==="chat"&&!h&&e.jsx(F,{className:d.compactBtn,type:B?"primary":"default",ghost:B,icon:e.jsx(Ge,{}),onClick:L,children:p("ui.terminal")}),e.jsx(F,{className:d.compactBtn,type:c==="raw"?"primary":"default",icon:c==="raw"?e.jsx(oa,{}):e.jsx(Ke,{}),onClick:u,children:c==="raw"?p("ui.chatMode"):p("ui.rawMode")})]}),e.jsxs(je,{title:`${p("ui.userPrompt")} (${this.state.promptData.length}${p("ui.promptCountUnit")})`,open:this.state.promptModalVisible,onCancel:()=>this.setState({promptModalVisible:!1}),footer:null,width:700,children:[e.jsx("div",{className:d.promptExportBar,children:e.jsx(F,{icon:e.jsx(ra,{}),onClick:this.handleExportPromptsTxt,children:p("ui.exportPromptsTxt")})}),e.jsx(Jt,{activeKey:this.state.promptViewMode,onChange:k=>this.setState({promptViewMode:k}),size:"small",items:[{key:"original",label:p("ui.promptModeOriginal")},{key:"context",label:p("ui.promptModeContext")},{key:"text",label:p("ui.promptModeText")}]}),this.state.promptViewMode==="text"?e.jsx("textarea",{readOnly:!0,className:d.promptTextarea,value:this.buildTextModeContent()}):e.jsxs("div",{className:d.promptScrollArea,children:[this.state.promptData.length===0&&e.jsx("div",{className:d.promptEmpty,children:p("ui.noPrompt")}),this.state.promptData.map((k,z)=>{const le=k.timestamp?new Date(k.timestamp).toLocaleString():p("ui.unknownTime");return e.jsxs("div",{children:[e.jsxs("div",{className:d.promptTimestamp,children:[le,":"]}),this.state.promptViewMode==="original"?this.renderOriginalPrompt(k):this.renderTextPrompt(k)]},z)})]})]}),e.jsxs(We,{title:p("ui.settings"),placement:"left",width:360,open:this.state.settingsDrawerVisible,onClose:()=>this.setState({settingsDrawerVisible:!1}),children:[e.jsxs("div",{className:d.settingsGroupBox,children:[e.jsx("div",{className:d.settingsGroupTitle,children:p("ui.chatDisplaySwitches")}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.collapseToolResults")}),e.jsx(Be,{checked:!!m,onChange:k=>v&&v(k)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.expandThinking")}),e.jsx(Be,{checked:!!x,onChange:k=>f&&f(k)})]})]}),e.jsxs("div",{className:d.settingsGroupBox,children:[e.jsx("div",{className:d.settingsGroupTitle,children:p("ui.userPreferences")}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.resumeAutoChoice")}),e.jsx(Be,{checked:!!ee,onChange:k=>te&&te(k)})]}),ee&&e.jsx("div",{className:d.settingsItem,children:e.jsxs(Ve.Group,{value:ee,onChange:k=>V&&V(k.target.value),size:"small",children:[e.jsx(Ve,{value:"continue",children:p("ui.resumeAutoChoice.continue")}),e.jsx(Ve,{value:"new",children:p("ui.resumeAutoChoice.new")})]})})]})]}),e.jsxs(We,{title:p("ui.globalSettings"),placement:"left",width:400,open:this.state.globalSettingsVisible,onClose:()=>this.setState({globalSettingsVisible:!1}),children:[e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.filterIrrelevant")}),e.jsx(Be,{checked:!!S,onChange:k=>N&&N(k)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.expandDiff")}),e.jsx(Be,{checked:!!y,onChange:k=>C&&C(k)})]})]}),e.jsx(We,{title:e.jsxs("span",{children:[e.jsx(Dt,{className:d.titleIcon}),p("ui.projectStats")]}),placement:"left",width:400,open:this.state.projectStatsVisible,onClose:()=>this.setState({projectStatsVisible:!1}),children:this.renderProjectStatsContent()}),e.jsxs(je,{title:e.jsxs("span",{children:[e.jsx(Ot,{className:d.titleIcon}),p("ui.pluginManagement")]}),open:this.state.pluginModalVisible,onCancel:()=>this.setState({pluginModalVisible:!1}),footer:e.jsxs("div",{className:d.pluginModalFooter,children:[e.jsxs("div",{className:d.pluginModalFooterLeft,children:[e.jsx(F,{icon:e.jsx(kt,{}),onClick:this.handleAddPlugin,children:p("ui.plugins.add")}),e.jsx(F,{icon:e.jsx(Ft,{}),onClick:this.handleShowCdnModal,children:p("ui.plugins.cdnInstall")})]}),e.jsx(F,{icon:e.jsx(dt,{}),onClick:this.handleReloadPlugins,children:p("ui.plugins.reload")})]}),width:560,children:[this.state.pluginsDir&&e.jsxs("div",{className:d.pluginDirHint,children:[e.jsxs("span",{className:d.pluginDirLabel,children:[p("ui.plugins.pluginsDir"),":"]})," ",e.jsx("code",{className:d.pluginDirPath,onClick:()=>{navigator.clipboard.writeText(this.state.pluginsDir).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})},children:this.state.pluginsDir})]}),this.state.pluginsList.length===0?e.jsxs("div",{className:d.pluginEmpty,children:[e.jsx("div",{className:d.pluginEmptyTitle,children:p("ui.plugins.empty")}),e.jsx("div",{className:d.pluginEmptyHint,children:p("ui.plugins.emptyHint")})]}):e.jsx("div",{className:d.pluginList,children:this.state.pluginsList.map(k=>e.jsxs("div",{className:d.pluginItem,children:[e.jsxs("div",{className:d.pluginInfo,children:[e.jsx("span",{className:d.pluginName,children:k.name}),e.jsx("span",{className:d.pluginFile,children:k.file}),k.hooks.length>0&&e.jsx("span",{className:d.pluginHooks,children:k.hooks.map(z=>e.jsx("span",{className:d.pluginHookTag,children:z},z))})]}),e.jsxs("div",{className:d.pluginActions,children:[e.jsx(Be,{size:"small",checked:k.enabled,onChange:z=>this.handleTogglePlugin(k.name,z)}),e.jsx(F,{type:"text",size:"small",danger:!0,icon:e.jsx(ct,{}),onClick:()=>this.handleDeletePlugin(k.file,k.name)})]})]},k.file))})]}),e.jsx(je,{title:p("ui.plugins.delete"),open:this.state.deleteConfirmVisible,onCancel:()=>this.setState({deleteConfirmVisible:!1,deleteTarget:null}),onOk:this.handleDeletePluginConfirm,okType:"danger",okText:"OK",cancelText:"Cancel",children:e.jsx("p",{children:this.state.deleteTarget?p("ui.plugins.deleteConfirm",{name:this.state.deleteTarget.name}):""})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(Ft,{className:d.titleIcon}),p("ui.plugins.cdnInstall")]}),open:this.state.cdnModalVisible,onCancel:this.handleCdnCancel,onOk:this.handleCdnInstall,confirmLoading:this.state.cdnLoading,okText:p("ui.plugins.cdnInstallBtn"),cancelText:p("ui.cancel"),width:480,children:e.jsxs("div",{children:[e.jsx("div",{className:d.cdnUrlLabel,children:p("ui.plugins.cdnUrl")}),e.jsx(Ae,{placeholder:p("ui.plugins.cdnUrlPlaceholder"),value:this.state.cdnUrl,onChange:this.handleCdnUrlChange,onPressEnter:this.handleCdnInstall,className:d.cdnInput})]})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(nt,{className:d.titleIcon}),p("ui.processManagement")]}),open:this.state.processModalVisible,onCancel:()=>this.setState({processModalVisible:!1}),footer:e.jsx(F,{icon:e.jsx(dt,{}),onClick:this.fetchProcesses,loading:this.state.processLoading,children:p("ui.processManagement.refresh")}),width:780,children:e.jsx(ca,{dataSource:this.state.processList,rowKey:"pid",loading:this.state.processLoading,size:"middle",pagination:!1,columns:[{title:p("ui.processManagement.port"),dataIndex:"port",width:80,render:k=>k?e.jsx("a",{href:`${window.location.protocol}//127.0.0.1:${k}`,target:"_blank",rel:"noopener noreferrer",children:k}):""},{title:"PID",dataIndex:"pid",width:80},{title:p("ui.processManagement.command"),dataIndex:"command",ellipsis:!0},{title:p("ui.processManagement.startTime"),dataIndex:"startTime",width:200},{title:p("ui.processManagement.action"),width:100,render:(k,z)=>z.isCurrent?e.jsx(F,{size:"small",className:d.currentProcessBtn,children:p("ui.processManagement.current")}):e.jsx(F,{size:"small",danger:!0,onClick:()=>this.handleKillProcess(z.pid),children:p("ui.processManagement.kill")})}]})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(Qt,{apiEndpoint:re("/api/open-profile-dir"),title:p("ui.proxy.openConfigDir"),size:16})," ",p("ui.proxySwitch")," ",e.jsx(he,{doc:"ProxySwitch",zIndex:1100})]}),open:this.state.proxyModalVisible,onCancel:()=>this.setState({proxyModalVisible:!1,editingProxy:null}),footer:null,width:520,children:this.renderProxyProfileList()})]})}renderProxyProfileList(){const t=this.props.proxyProfiles||[],a=this.props.activeProxyId||"max",{editingProxy:c,editForm:i}=this.state;return e.jsxs("div",{children:[e.jsxs("div",{className:d.proxyWarning,children:["⚠️ ",p("ui.proxy.maxWarning")]}),e.jsx("div",{className:d.proxyList,children:t.map(u=>{var g;return e.jsxs("div",{className:`${d.proxyItem} ${u.id===a?d.proxyItemActive:""}`,children:[e.jsxs("div",{className:d.proxyItemMain,onClick:()=>{if(u.id!==a){const l={active:u.id,profiles:t};this.props.onProxyProfileChange(l)}},children:[e.jsx(Ve,{checked:u.id===a,style:{marginRight:8}}),e.jsxs("div",{className:d.proxyItemInfo,children:[e.jsxs("div",{className:d.proxyItemNameRow,children:[e.jsx("span",{className:d.proxyItemName,children:u.name}),u.id==="max"&&e.jsx(fe,{className:d.proxyBuiltinTag,children:p("ui.proxy.builtin")})]}),u.id==="max"&&this.props.defaultConfig&&e.jsxs("div",{className:d.proxyItemDetail,children:[(()=>{try{return new URL(this.props.defaultConfig.origin).host}catch{return this.props.defaultConfig.origin}})(),this.props.defaultConfig.authType?` · ${this.props.defaultConfig.authType}`:"",this.props.defaultConfig.apiKey?` · ${this.props.defaultConfig.apiKey}`:"",this.props.defaultConfig.model?` · ${this.props.defaultConfig.model}`:""]}),u.id!=="max"&&u.baseURL&&e.jsxs("div",{className:d.proxyItemDetail,children:[(()=>{try{return new URL(u.baseURL).host}catch{return u.baseURL}})(),u.activeModel?` · ${u.activeModel}`:(g=u.models)!=null&&g.length?` · ${u.models[0]}`:""]})]})]}),u.id!=="max"&&e.jsxs("div",{className:d.proxyItemActions,children:[e.jsx(F,{type:"text",size:"small",icon:e.jsx(da,{}),onClick:()=>this.setState({editingProxy:u.id,editForm:{name:u.name||"",baseURL:u.baseURL||"",apiKey:u.apiKey||"",models:(u.models||[]).join(", "),activeModel:u.activeModel||""}})}),e.jsx(F,{type:"text",size:"small",danger:!0,icon:e.jsx(ct,{}),onClick:()=>{je.confirm({title:p("ui.proxy.deleteProxy"),content:p("ui.proxy.deleteConfirm",{name:u.name}),okType:"danger",onOk:()=>{const l=t.filter(o=>o.id!==u.id),h=a===u.id?"max":a;this.props.onProxyProfileChange({active:h,profiles:l})}})}})]})]},u.id)})}),c&&e.jsxs("div",{className:d.proxyEditForm,children:[e.jsxs("div",{className:d.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.name")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(Ae,{size:"small",value:i.name,onChange:u=>{const g=u.target.value;this.setState(l=>({editForm:{...l.editForm,name:g}}))}})]}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.baseURL")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(Ae,{size:"small",value:i.baseURL,onChange:u=>{const g=u.target.value;this.setState(l=>({editForm:{...l.editForm,baseURL:g}}))},placeholder:"https://api.example.com"})]}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.apiKey")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(Ae.Password,{size:"small",value:i.apiKey,onChange:u=>{const g=u.target.value;this.setState(l=>({editForm:{...l.editForm,apiKey:g}}))},placeholder:"sk-..."})]}),e.jsx("div",{className:d.proxyEditDivider}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsx("label",{children:p("ui.proxy.models")}),e.jsx(Ae,{size:"small",value:i.models,onChange:u=>{const g=u.target.value;this.setState(l=>({editForm:{...l.editForm,models:g}}))},placeholder:"model-1, model-2"})]}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsx("label",{children:p("ui.proxy.activeModel")}),e.jsx(qe,{size:"small",className:d.fullWidthSelect,value:i.activeModel||void 0,onChange:u=>this.setState(g=>({editForm:{...g.editForm,activeModel:u}})),placeholder:p("ui.proxy.activeModel"),children:(i.models||"").split(",").map(u=>u.trim()).filter(Boolean).map(u=>e.jsx(qe.Option,{value:u,children:u},u))})]}),e.jsxs("div",{className:d.proxyEditBtns,children:[e.jsx(F,{size:"small",icon:e.jsx(ha,{}),type:"primary",onClick:()=>{var h,o,r;if(!((h=i.name)!=null&&h.trim())||!((o=i.baseURL)!=null&&o.trim())||!((r=i.apiKey)!=null&&r.trim())){J.warning(p("ui.proxy.requiredFields"));return}const u=(i.models||"").split(",").map(m=>m.trim()).filter(Boolean),g={id:c==="__new__"?`proxy_${Date.now()}`:c,name:i.name.trim(),baseURL:i.baseURL.trim(),apiKey:i.apiKey.trim(),models:u,activeModel:i.activeModel||u[0]||""};let l;c==="__new__"?l=[...t,g]:l=t.map(m=>m.id===c?{...m,...g,id:m.id}:m),this.props.onProxyProfileChange({active:a,profiles:l}),this.setState({editingProxy:null})},children:p("ui.proxy.save")}),e.jsx(F,{size:"small",icon:e.jsx(ua,{}),onClick:()=>this.setState({editingProxy:null}),children:p("ui.proxy.cancel")})]})]}),!c&&e.jsx(F,{block:!0,type:"dashed",icon:e.jsx(kt,{}),style:{marginTop:12},onClick:()=>this.setState({editingProxy:"__new__",editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""}}),children:p("ui.proxy.addProxy")})]})}};A(ke,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let Qe=ke;const _n="_centerEmpty_18l8t_1",Sn="_scrollContainer_18l8t_8",kn="_listItem_18l8t_15",wn="_listItemActive_18l8t_27",Tn="_itemContent_18l8t_36",Mn="_itemHeader_18l8t_41",En="_tagNoMargin_18l8t_49",Rn="_modelName_18l8t_54",In="_modelNameMain_18l8t_59",Ln="_time_18l8t_63",Pn="_detailRow_18l8t_69",An="_urlText_18l8t_76",Bn="_duration_18l8t_85",On="_statusOk_18l8t_90",Dn="_statusErr_18l8t_96",Fn="_statusDefault_18l8t_101",$n="_usageBox_18l8t_106",Hn="_cacheDot_18l8t_116",zn="_cacheDotLoss_18l8t_125",Vn="_cacheDotNormal_18l8t_130",Un="_tagMainAgent_18l8t_134",qn="_tagPlan_18l8t_140",Wn="_tagMuted_18l8t_146",Kn="_tooltipPreLine_18l8t_152",H={centerEmpty:_n,scrollContainer:Sn,listItem:kn,listItemActive:wn,itemContent:Tn,itemHeader:Mn,tagNoMargin:En,modelName:Rn,modelNameMain:In,time:Ln,detailRow:Pn,urlText:An,duration:Bn,statusOk:On,statusErr:Dn,statusDefault:Fn,usageBox:$n,cacheDot:Hn,cacheDotLoss:zn,cacheDotNormal:Vn,tagMainAgent:Un,tagPlan:qn,tagMuted:Wn,tooltipPreLine:Kn};class Gn extends q.Component{constructor(t){super(t);A(this,"handleKeyDown",t=>{if(t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;const{requests:a,selectedIndex:c,onSelect:i}=this.props;if(!a.length)return;t.preventDefault();const u=c??0,g=t.key==="ArrowUp"?Math.max(0,u-1):Math.min(a.length-1,u+1);g!==u&&i(g)});this.activeItemRef=q.createRef()}componentDidMount(){this.scrollToSelected(!0)}shouldComponentUpdate(t){return t.requests!==this.props.requests||t.selectedIndex!==this.props.selectedIndex||t.scrollCenter!==this.props.scrollCenter||t.cacheLossMap!==this.props.cacheLossMap}componentDidUpdate(t){this.props.scrollCenter&&t.selectedIndex!==this.props.selectedIndex?this.scrollToSelected(!0):t.selectedIndex!==this.props.selectedIndex&&(this.scrollToSelected(!1),this.activeItemRef.current&&this.activeItemRef.current.focus({preventScroll:!0}))}scrollToSelected(t){this.activeItemRef.current&&(this.activeItemRef.current.scrollIntoView({block:t?"center":"nearest",behavior:"instant"}),t&&this.props.onScrollDone&&this.props.onScrollDone())}render(){const{requests:t,selectedIndex:a,onSelect:c}=this.props;return t.length===0?e.jsx("div",{className:H.centerEmpty,children:e.jsx(we,{description:p("ui.waitingRequests")})}):e.jsx("div",{className:H.scrollContainer,onKeyDown:this.handleKeyDown,children:e.jsx(wt,{dataSource:t,size:"small",split:!1,renderItem:(i,u)=>{var T,R,B;const g=new Date(i.timestamp).toLocaleTimeString("zh-CN"),l=u===a,h=i.response&&i.response.status<400,o=i.response&&i.response.status>=400,r=ma((T=i.body)==null?void 0:T.model),m=u+1<t.length?t[u+1]:null,{type:v,subType:x}=ze(i,m),f=(B=(R=i.response)==null?void 0:R.body)==null?void 0:B.usage,y=f?(f.input_tokens||0)+(f.cache_read_input_tokens||0)+(f.cache_creation_input_tokens||0):null,C=(f==null?void 0:f.output_tokens)||null,S=(f==null?void 0:f.cache_read_input_tokens)||0,N=(f==null?void 0:f.cache_creation_input_tokens)||0;let b=i.url;try{const L=new URL(i.url);b=L.host+L.pathname}catch{}return e.jsx(wt.Item,{ref:l?this.activeItemRef:void 0,tabIndex:0,onClick:()=>c(u),className:`${H.listItem} ${l?H.listItemActive:""}`,children:e.jsxs("div",{className:H.itemContent,children:[e.jsxs("div",{className:H.itemHeader,children:[v==="MainAgent"?e.jsx(fe,{className:`${H.tagNoMargin} ${H.tagMainAgent}`,children:"MainAgent"}):v==="Plan"?e.jsx(fe,{className:`${H.tagNoMargin} ${H.tagPlan}`,children:Tt(v,x)}):v==="Count"||v==="Preflight"?e.jsx(fe,{className:`${H.tagNoMargin} ${H.tagMuted}`,children:v}):e.jsx(fe,{className:H.tagNoMargin,children:Tt(v,x)}),r&&e.jsx("span",{className:`${H.modelName} ${v==="MainAgent"?H.modelNameMain:""}`,children:r}),e.jsx("span",{className:H.time,children:g})]}),e.jsxs("div",{className:H.detailRow,children:[e.jsx("span",{className:H.urlText,title:i.url,children:b}),i.duration&&e.jsxs("span",{className:H.duration,children:[i.duration,"ms"]}),i.response&&e.jsx("span",{className:h?H.statusOk:o?H.statusErr:H.statusDefault,children:i.response.status})]}),f&&e.jsxs("div",{className:H.usageBox,children:[e.jsxs("div",{children:["token: output:",W(C)||0,", input: ",W(y)||0]}),(S>0||N>0)&&e.jsx("div",{children:(()=>{var O;const L=(O=this.props.cacheLossMap)==null?void 0:O.get(u),M={ttl:"ui.cacheLoss.ttl",system_change:"ui.cacheLoss.systemChange",tools_change:"ui.cacheLoss.toolsChange",model_change:"ui.cacheLoss.modelChange",msg_truncated:"ui.cacheLoss.msgTruncated",msg_modified:"ui.cacheLoss.msgModified",key_change:"ui.cacheLoss.keyChange"};let I;if(L){const te=(L.reasons||[L.reason]).map(V=>p(M[V]||M.key_change)).join(`
|
|
27
|
-
`);I=e.jsx(Yt,{title:e.jsx("span",{className:H.tooltipPreLine,children:te}),children:e.jsx("span",{className:`${H.cacheDot} ${H.cacheDotLoss}`})})}else I=e.jsx("span",{className:`${H.cacheDot} ${H.cacheDotNormal}`});return e.jsxs(e.Fragment,{children:["cache",I,": ",S>0?`read:${W(S)}`:"",S>0&&N>0?", ":"",N>0?`create:${W(N)}`:""]})})()})]})]})})}})})}}const Jn=n=>typeof n=="boolean"||n instanceof Boolean,Qn=n=>typeof n=="number"||n instanceof Number,Yn=n=>typeof n=="bigint"||n instanceof BigInt,vs=n=>!!n&&n instanceof Date,Xn=n=>typeof n=="string"||n instanceof String,Zn=n=>Array.isArray(n),js=n=>typeof n=="object"&&n!==null,Cs=n=>!!n&&n instanceof Object&&typeof n=="function";function Ye(n,s){return s===void 0&&(s=!1),!n||s?`"${n}"`:n}function ei(n,s,t){return t?JSON.stringify(n):s?`"${n}"`:n}function bs(n){let{field:s,value:t,data:a,lastElement:c,openBracket:i,closeBracket:u,level:g,style:l,shouldExpandNode:h,clickToExpandNode:o,outerRef:r,beforeExpandChange:m}=n;const v=j.useRef(!1),[x,f]=j.useState(()=>h(g,t,s)),y=j.useRef(null);j.useEffect(()=>{v.current?f(h(g,t,s)):v.current=!0},[h]);const C=j.useId();if(a.length===0)return ti({field:s,openBracket:i,closeBracket:u,lastElement:c,style:l});const S=x?l.collapseIcon:l.expandIcon,N=x?l.ariaLables.collapseJson:l.ariaLables.expandJson,b=g+1,T=a.length-1,R=M=>{x!==M&&(!m||m({level:g,value:t,field:s,newExpandValue:M}))&&f(M)},B=M=>{if(M.key==="ArrowRight"||M.key==="ArrowLeft")M.preventDefault(),R(M.key==="ArrowRight");else if(M.key==="ArrowUp"||M.key==="ArrowDown"){M.preventDefault();const I=M.key==="ArrowUp"?-1:1;if(!r.current)return;const O=r.current.querySelectorAll("[role=button]");let ee=-1;for(let V=0;V<O.length;V++)if(O[V].tabIndex===0){ee=V;break}if(ee<0)return;const te=(ee+I+O.length)%O.length;O[ee].tabIndex=-1,O[te].tabIndex=0,O[te].focus()}},L=()=>{var M;R(!x);const I=y.current;if(!I)return;const O=(M=r.current)===null||M===void 0?void 0:M.querySelector('[role=button][tabindex="0"]');O&&(O.tabIndex=-1),I.tabIndex=0,I.focus()};return j.createElement("div",{className:l.basicChildStyle,role:"treeitem","aria-expanded":x,"aria-selected":void 0},j.createElement("span",{className:S,onClick:L,onKeyDown:B,role:"button","aria-label":N,"aria-expanded":x,"aria-controls":x?C:void 0,ref:y,tabIndex:g===0?0:-1}),(s||s==="")&&(o?j.createElement("span",{className:l.clickableLabel,onClick:L,onKeyDown:B},Ye(s,l.quotesForFieldNames),":"):j.createElement("span",{className:l.label},Ye(s,l.quotesForFieldNames),":")),j.createElement("span",{className:l.punctuation},i),x?j.createElement("ul",{id:C,role:"group",className:l.childFieldsContainer},a.map((M,I)=>j.createElement(mt,{key:M[0]||I,field:M[0],value:M[1],style:l,lastElement:I===T,level:b,shouldExpandNode:h,clickToExpandNode:o,beforeExpandChange:m,outerRef:r}))):j.createElement("span",{className:l.collapsedContent,onClick:L,onKeyDown:B}),j.createElement("span",{className:l.punctuation},u),!c&&j.createElement("span",{className:l.punctuation},","))}function ti(n){let{field:s,openBracket:t,closeBracket:a,lastElement:c,style:i}=n;return j.createElement("div",{className:i.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:i.label},Ye(s,i.quotesForFieldNames),":"),j.createElement("span",{className:i.punctuation},t),j.createElement("span",{className:i.punctuation},a),!c&&j.createElement("span",{className:i.punctuation},","))}function si(n){let{field:s,value:t,style:a,lastElement:c,shouldExpandNode:i,clickToExpandNode:u,level:g,outerRef:l,beforeExpandChange:h}=n;return bs({field:s,value:t,lastElement:c||!1,level:g,openBracket:"{",closeBracket:"}",style:a,shouldExpandNode:i,clickToExpandNode:u,data:Object.keys(t).map(o=>[o,t[o]]),outerRef:l,beforeExpandChange:h})}function ai(n){let{field:s,value:t,style:a,lastElement:c,level:i,shouldExpandNode:u,clickToExpandNode:g,outerRef:l,beforeExpandChange:h}=n;return bs({field:s,value:t,lastElement:c||!1,level:i,openBracket:"[",closeBracket:"]",style:a,shouldExpandNode:u,clickToExpandNode:g,data:t.map(o=>[void 0,o]),outerRef:l,beforeExpandChange:h})}function ni(n){let{field:s,value:t,style:a,lastElement:c}=n,i,u=a.otherValue;return t===null?(i="null",u=a.nullValue):t===void 0?(i="undefined",u=a.undefinedValue):Xn(t)?(i=ei(t,!a.noQuotesForStringValues,a.stringifyStringValues),u=a.stringValue):Jn(t)?(i=t?"true":"false",u=a.booleanValue):Qn(t)?(i=t.toString(),u=a.numberValue):Yn(t)?(i=`${t.toString()}n`,u=a.numberValue):vs(t)?i=t.toISOString():Cs(t)?i="function() { }":i=t.toString(),j.createElement("div",{className:a.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:a.label},Ye(s,a.quotesForFieldNames),":"),j.createElement("span",{className:u},i),!c&&j.createElement("span",{className:a.punctuation},","))}function mt(n){const s=n.value;return Zn(s)?j.createElement(ai,Object.assign({},n)):js(s)&&!vs(s)&&!Cs(s)?j.createElement(si,Object.assign({},n)):j.createElement(ni,Object.assign({},n))}var $={"container-light":"_2IvMF _GzYRV","basic-element-style":"_2bkNM","child-fields-container":"_1BXBN","label-light":"_1MGIk","clickable-label-light":"_2YKJg _1MGIk _1MFti","punctuation-light":"_3uHL6 _3eOF8","value-null-light":"_2T6PJ","value-undefined-light":"_1Gho6","value-string-light":"_vGjyY","value-number-light":"_1bQdo","value-boolean-light":"_3zQKs","value-other-light":"_1xvuR","collapse-icon-light":"_oLqym _f10Tu _1MFti _1LId0","expand-icon-light":"_2AXVT _f10Tu _1MFti _1UmXx","collapsed-content-light":"_2KJWg _1pNG9 _1MFti","container-dark":"_11RoI _GzYRV","expand-icon-dark":"_17H2C _f10Tu _1MFti _1UmXx","collapse-icon-dark":"_3QHg2 _f10Tu _1MFti _1LId0","collapsed-content-dark":"_3fDAz _1pNG9 _1MFti","label-dark":"_2bSDX","clickable-label-dark":"_1RQEj _2bSDX _1MFti","punctuation-dark":"_gsbQL _3eOF8","value-null-dark":"_LaAZe","value-undefined-dark":"_GTKgm","value-string-dark":"_Chy1W","value-number-dark":"_2bveF","value-boolean-dark":"_2vRm-","value-other-dark":"_1prJR"};const Ns={collapseJson:"collapse JSON",expandJson:"expand JSON"},lt={container:$["container-light"],basicChildStyle:$["basic-element-style"],childFieldsContainer:$["child-fields-container"],label:$["label-light"],clickableLabel:$["clickable-label-light"],nullValue:$["value-null-light"],undefinedValue:$["value-undefined-light"],stringValue:$["value-string-light"],booleanValue:$["value-boolean-light"],numberValue:$["value-number-light"],otherValue:$["value-other-light"],punctuation:$["punctuation-light"],collapseIcon:$["collapse-icon-light"],expandIcon:$["expand-icon-light"],collapsedContent:$["collapsed-content-light"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:Ns,stringifyStringValues:!1},ii={container:$["container-dark"],basicChildStyle:$["basic-element-style"],childFieldsContainer:$["child-fields-container"],label:$["label-dark"],clickableLabel:$["clickable-label-dark"],nullValue:$["value-null-dark"],undefinedValue:$["value-undefined-dark"],stringValue:$["value-string-dark"],booleanValue:$["value-boolean-dark"],numberValue:$["value-number-dark"],otherValue:$["value-other-dark"],punctuation:$["punctuation-dark"],collapseIcon:$["collapse-icon-dark"],expandIcon:$["expand-icon-dark"],collapsedContent:$["collapsed-content-dark"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:Ns,stringifyStringValues:!1},li=()=>!0,oi=n=>{let{data:s,style:t=lt,shouldExpandNode:a=li,clickToExpandNode:c=!1,beforeExpandChange:i,compactTopLevel:u,...g}=n;const l=j.useRef(null);return j.createElement("div",Object.assign({"aria-label":"JSON view"},g,{className:t.container,ref:l,role:"tree"}),u&&js(s)?Object.entries(s).map(h=>{let[o,r]=h;return j.createElement(mt,{key:o,field:o,value:r,style:{...lt,...t},lastElement:!0,level:1,shouldExpandNode:a,clickToExpandNode:c,beforeExpandChange:i,outerRef:l})}):j.createElement(mt,{value:s,style:{...lt,...t},lastElement:!0,level:0,shouldExpandNode:a,clickToExpandNode:c,outerRef:l,beforeExpandChange:i}))},ri="_container_1h2lr_1",ci={container:ri},di={...ii,container:"rjv-container"};class Xe extends q.Component{shouldComponentUpdate(s){return s.data!==this.props.data||s.defaultExpand!==this.props.defaultExpand||s.expandNode!==this.props.expandNode}render(){const{data:s,defaultExpand:t,expandNode:a}=this.props;if(s==null)return null;const c=typeof a=="function"?a:t==="all"?()=>!0:t==="root"?i=>i<2:i=>i<1;return e.jsx("div",{className:ci.container,children:e.jsx(oi,{data:s,shouldExpandNode:c,style:di})})}}function hi({currentId:n,visibleIds:s=[],key:t}){if(t!=="ArrowUp"&&t!=="ArrowDown")return null;const a=s.findIndex(i=>i===n),c=t==="ArrowUp"?-1:1;return a>=0?s[a+c]??null:null}const ui="_root_9isis_1",mi="_sidebar_9isis_9",pi="_section_9isis_18",gi="_sectionHeader_9isis_22",fi="_arrow_9isis_48",xi="_sectionTitle_9isis_54",yi="_sectionCount_9isis_62",vi="_sectionBody_9isis_71",ji="_historyToggle_9isis_76",Ci="_historyToggleLabel_9isis_102",bi="_item_9isis_107",Ni="_itemActive_9isis_133",_i="_itemContent_9isis_143",Si="_itemLabel_9isis_149",ki="_itemSublabel_9isis_157",wi="_itemTime_9isis_166",Ti="_content_9isis_175",Mi="_contentEmpty_9isis_183",Ei="_contentInner_9isis_190",Ri="_emptyWrap_9isis_194",Ii="_roleHeader_9isis_202",Li="_roleBadge_9isis_210",Pi="_role_user_9isis_219",Ai="_role_assistant_9isis_225",Bi="_roleLabel_9isis_231",Oi="_contentTime_9isis_238",Di="_turnDivider_9isis_246",Fi="_textBlock_9isis_253",$i="_textBlockBar_9isis_260",Hi="_textBlockBody_9isis_269",zi="_textBlockCompact_9isis_277",Vi="_textBlockCompactFloat_9isis_284",Ui="_thinkingBlock_9isis_291",qi="_thinkingHeader_9isis_299",Wi="_thinkingPreview_9isis_314",Ki="_thinkingBody_9isis_324",Gi="_toolBlock_9isis_330",Ji="_toolBlockResult_9isis_337",Qi="_toolBlockError_9isis_341",Yi="_toolBlockHeader_9isis_345",Xi="_toolBlockBody_9isis_356",Zi="_toolName_9isis_361",el="_toolId_9isis_367",tl="_errorLabel_9isis_374",sl="_blockTag_9isis_384",al="_blockTagText_9isis_397",nl="_blockTagThinking_9isis_403",il="_blockTagResult_9isis_409",ll="_blockTagError_9isis_415",ol="_jsonBlock_9isis_422",rl="_jsonBlockLabel_9isis_429",cl="_blockSeparator_9isis_439",dl="_markdownBody_9isis_446",w={root:ui,sidebar:mi,section:pi,sectionHeader:gi,arrow:fi,sectionTitle:xi,sectionCount:yi,sectionBody:vi,historyToggle:ji,historyToggleLabel:Ci,item:bi,itemActive:Ni,itemContent:_i,itemLabel:Si,itemSublabel:ki,itemTime:wi,content:Ti,contentEmpty:Mi,contentInner:Ei,emptyWrap:Ri,roleHeader:Ii,roleBadge:Li,role_user:Pi,role_assistant:Ai,roleLabel:Bi,contentTime:Oi,turnDivider:Di,textBlock:Fi,textBlockBar:$i,textBlockBody:Hi,textBlockCompact:zi,textBlockCompactFloat:Vi,thinkingBlock:Ui,thinkingHeader:qi,thinkingPreview:Wi,thinkingBody:Ki,toolBlock:Gi,toolBlockResult:Ji,toolBlockError:Qi,toolBlockHeader:Yi,toolBlockBody:Xi,toolName:Zi,toolId:el,errorLabel:tl,blockTag:sl,blockTagText:al,blockTagThinking:nl,blockTagResult:il,blockTagError:ll,jsonBlock:ol,jsonBlockLabel:rl,blockSeparator:cl,markdownBody:dl},{Text:hl}=Xt;function pt(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}if(Array.isArray(n)){const s=[];for(const t of n)if(t)if(t.type==="text"){const a=(t.text||"").trim();a&&s.push({type:"markdown",text:a})}else if(t.type==="tool_use")s.push({type:"tool_use",name:t.name||"unknown",id:t.id||"",input:t.input??{}});else if(t.type==="tool_result"){const a=ul(t.content);s.push({type:"tool_result",tool_use_id:t.tool_use_id||"",is_error:t.is_error,content:a})}else if(t.type==="thinking"){const a=t.thinking||"";a.trim()&&s.push({type:"thinking",text:a})}else t.type==="image"?s.push({type:"json",label:"image",data:t}):s.push({type:"json",label:t.type||"block",data:t});return s}return[{type:"json",label:"content",data:n}]}function ul(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}return Array.isArray(n)?n.flatMap(s=>{if(!s)return[];if(s.type==="text"){const t=(s.text||"").trim();return t?[{type:"markdown",text:t}]:[]}return[{type:"json",label:s.type||"block",data:s}]}):[{type:"json",label:"content",data:n}]}function ml(n){if(!n)return null;if(typeof n=="string")return[{type:"markdown",text:n}];if(Array.isArray(n)){const s=[];return n.forEach((t,a)=>{a>0&&s.push({type:"separator"}),t&&(typeof t=="string"?s.push({type:"markdown",text:t}):t.type==="text"?s.push({type:"markdown",text:t.text||""}):s.push({type:"json",label:t.type||"item",data:t}))}),s}return[{type:"json",label:"system",data:n}]}function pl(n){const s=[],t=(n==null?void 0:n.name)||"unknown",a=(n==null?void 0:n.description)||"";let c=`### ${t}
|
|
26
|
+
`)}renderProjectStatsContent(){const{projectStats:t,projectStatsLoading:a}=this.state;if(a)return e.jsx("div",{className:d.projectStatsCenter,children:e.jsx(Gt,{})});if(!t)return e.jsx("div",{className:d.projectStatsEmpty,children:p("ui.projectStats.noData")});const{summary:c,models:i,updatedAt:u}=t;i&&Object.entries(i).sort((h,o)=>o[1]-h[1]);const g={};if(t.files){for(const h of Object.values(t.files))if(h.models)for(const[o,r]of Object.entries(h.models))g[o]||(g[o]={input:0,output:0,cacheRead:0,cacheCreation:0,count:0}),g[o].input+=r.input_tokens||0,g[o].output+=r.output_tokens||0,g[o].cacheRead+=r.cache_read_input_tokens||0,g[o].cacheCreation+=r.cache_creation_input_tokens||0,g[o].count+=r.count||0}const l=Object.entries(g).sort((h,o)=>o[1].count-h[1].count);return e.jsxs("div",{className:d.projectStatsContent,children:[u&&e.jsx("div",{className:d.projectStatsUpdated,children:p("ui.projectStats.updatedAt",{time:new Date(u).toLocaleString()})}),e.jsxs("div",{className:d.projectStatsSummary,children:[e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(c==null?void 0:c.requestCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.totalRequests")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(c==null?void 0:c.turnCount)??(c==null?void 0:c.sessionCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.turnCount")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:(c==null?void 0:c.fileCount)??0}),e.jsx("div",{className:d.projectStatLabel,children:p("ui.projectStats.totalFiles")})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:W(c==null?void 0:c.input_tokens)}),e.jsx("div",{className:d.projectStatLabel,children:"Input Tokens"})]}),e.jsxs("div",{className:d.projectStatCard,children:[e.jsx("div",{className:d.projectStatValue,children:W(c==null?void 0:c.output_tokens)}),e.jsx("div",{className:d.projectStatLabel,children:"Output Tokens"})]})]}),l.length>0&&e.jsxs("div",{className:d.projectStatsSection,children:[e.jsx("div",{className:d.projectStatsSectionTitle,children:p("ui.projectStats.modelUsage")}),l.map(([h,o])=>{const r=o.input+o.cacheRead+o.cacheCreation,m=r>0?(o.cacheRead/r*100).toFixed(1):"0.0";return e.jsxs("div",{className:d.projectStatsModelCard,children:[e.jsxs("div",{className:d.projectStatsModelHeader,children:[e.jsx("span",{className:d.projectStatsModelName,children:h}),e.jsxs("span",{className:d.projectStatsModelCount,children:[o.count," reqs"]})]}),e.jsx("table",{className:d.statsTable,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:"Token"}),e.jsx("td",{className:d.th,children:"input"}),e.jsx("td",{className:d.th,children:"output"})]}),e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label}),e.jsx("td",{className:d.td,children:W(r)}),e.jsx("td",{className:d.td,children:W(o.output)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:"Cache"}),e.jsx("td",{className:d.th,children:"create"}),e.jsx("td",{className:d.th,children:"read"})]}),e.jsxs("tr",{className:d.rowBorder,children:[e.jsx("td",{className:d.label}),e.jsx("td",{className:d.td,children:W(o.cacheCreation)}),e.jsx("td",{className:d.td,children:W(o.cacheRead)})]}),e.jsxs("tr",{children:[e.jsx("td",{className:d.label,children:p("ui.hitRate")}),e.jsxs("td",{colSpan:2,className:d.td,children:[m,"%"]})]})]})})]},h)})]})]})}render(){const{requestCount:t,requests:a=[],viewMode:c,cacheType:i,onToggleViewMode:u,onImportLocalLogs:g,onLangChange:l,isLocalLog:h,localLogFile:o,projectName:r,collapseToolResults:m,onCollapseToolResultsChange:v,expandThinking:x,onExpandThinkingChange:f,expandDiff:y,onExpandDiffChange:C,filterIrrelevant:S,onFilterIrrelevantChange:N,updateInfo:b,onDismissUpdate:T,cliMode:R,terminalVisible:B,onToggleTerminal:L,onReturnToWorkspaces:M,contextWindow:I,serverCachedContent:O,resumeAutoChoice:ee,onResumeAutoChoiceToggle:te,onResumeAutoChoiceChange:V}=this.props,{countdownText:K}=this.state,ue=[{key:"import-local",icon:e.jsx($t,{}),label:p("ui.importLocalLogs"),onClick:g},{key:"export-prompts",icon:e.jsx(sn,{}),label:p("ui.exportPrompts"),onClick:this.handleShowPrompts},{key:"plugin-management",icon:e.jsx(Ot,{}),label:p("ui.pluginManagement"),onClick:this.handleShowPlugins},{key:"switch-workspace",icon:e.jsx($t,{className:d.iconMirror}),label:e.jsx("span",{className:d.disabledMenuItem,children:p("ui.switchWorkspace")}),disabled:!0},{key:"process-management",icon:e.jsx(nt,{}),label:p("ui.processManagement"),onClick:this.handleShowProcesses},{key:"proxy-switch",icon:e.jsx(Bt,{}),label:p("ui.proxySwitch"),onClick:()=>this.setState({proxyModalVisible:!0})},{type:"divider"},{key:"project-stats",icon:e.jsx(Dt,{}),label:p("ui.projectStats"),onClick:this.handleShowProjectStats},...c==="raw"?[{key:"global-settings",icon:e.jsx(Ht,{}),label:p("ui.globalSettings"),onClick:()=>this.setState({globalSettingsVisible:!0})}]:[],...c==="chat"?[{key:"display-settings",icon:e.jsx(Ht,{}),label:p("ui.settings"),onClick:()=>this.setState({settingsDrawerVisible:!0})}]:[],{key:"language",icon:e.jsx(ln,{}),label:p("ui.languageSettings"),children:[{key:"lang-grid-container",type:"group",label:e.jsx("div",{className:d.langGrid,children:_n.map(k=>e.jsx(F,{size:"small",type:k.value===la()?"primary":"default",onClick:z=>{z.stopPropagation(),ia(k.value),l&&l()},className:d.langBtn,children:k.label},k.value))})}]}];return e.jsxs("div",{className:d.headerBar,children:[e.jsxs(Fe,{size:"middle",children:[e.jsx(oa,{menu:{items:ue,className:"logo-dropdown-menu"},trigger:["hover"],onOpenChange:k=>this.setState({logoDropdownOpen:k}),align:{offset:[-4,0]},children:e.jsx("span",{className:`${d.logoWrap}${this.state.logoDropdownOpen?` ${d.logoWrapActive}`:""}`,children:e.jsx("img",{src:"/favicon.ico",alt:"Logo",className:`${d.logoImage}${this.state.logoDropdownOpen?` ${d.logoImageActive}`:""}`})})}),e.jsx(Oe,{content:this.renderTokenStats(),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px",maxHeight:"80vh",overflowY:"auto"},children:e.jsxs(fe,{className:d.tokenStatsTag,children:[e.jsx(nt,{className:d.tokenStatsIcon}),p("ui.tokenStats")]})}),this.props.activeProxyId&&this.props.activeProxyId!=="max"&&(()=>{const k=(this.props.proxyProfiles||[]).find(z=>z.id===this.props.activeProxyId);return k?e.jsxs(fe,{className:d.proxyProfileTag,onClick:()=>this.setState({proxyModalVisible:!0}),children:[e.jsx(Bt,{className:d.proxySwapIcon}),k.name,k.activeModel?` · ${k.activeModel}`:""]}):null})(),(()=>{var G,pe,oe,ge,ve;let k=0;const z=it.find(se=>se.value===this.state.calibrationModel),le=z==null?void 0:z.tokens;if(!h){if(le&&(I==null?void 0:I.used_percentage)!=null){const se=D=>{var ae,U;const X=(U=(ae=D.response)==null?void 0:ae.body)==null?void 0:U.usage;return((X==null?void 0:X.input_tokens)||0)+((X==null?void 0:X.cache_creation_input_tokens)||0)+((X==null?void 0:X.cache_read_input_tokens)||0)};let Y=0;for(let D=a.length-1;D>=0;D--)if(be(a[D])&&((pe=(G=a[D].response)==null?void 0:G.body)!=null&&pe.usage)){Y=se(a[D]);break}if(Y>0){const D=le*.835;k=Math.min(100,Math.max(0,Math.round(Y/D*100)))}else{const D=I.context_window_size||2e5;k=Math.min(100,Math.max(0,Math.round(I.used_percentage*D/le/83.5*100)))}}else if((I==null?void 0:I.used_percentage)!=null){const se=this.state.settingsModel?St(this.state.settingsModel):0,Y=I.context_window_size||2e5;se&&se!==Y?k=Math.min(100,Math.max(0,Math.round(I.used_percentage*Y/se/83.5*100))):k=Math.min(100,Math.max(0,Math.round(I.used_percentage/83.5*100)))}else if(a.length>0){const se=Y=>{var X,ae;const D=(ae=(X=Y.response)==null?void 0:X.body)==null?void 0:ae.usage;return((D==null?void 0:D.input_tokens)||0)+((D==null?void 0:D.cache_creation_input_tokens)||0)+((D==null?void 0:D.cache_read_input_tokens)||0)};for(let Y=a.length-1;Y>=0;Y--)if(be(a[Y])&&((ge=(oe=a[Y].response)==null?void 0:oe.body)!=null&&ge.usage)){const D=se(a[Y]),ae=(le||(I==null?void 0:I.context_window_size)||St(((ve=a[Y].body)==null?void 0:ve.model)||this.state.settingsModel))*.835;ae>0&&D>0&&(k=Math.min(100,Math.max(0,Math.round(D/ae*100))));break}}}k===0&&this._lastContextPercent>0&&(k=this._lastContextPercent);const me=k>=80?"#ff4d4f":k>=60?"#faad14":"#52c41a";return h?e.jsx(fe,{className:`${d.liveTag} ${d.liveTagHistory}`,children:e.jsx("span",{className:d.liveTagText,children:p("ui.historyLog",{file:o})})}):e.jsx(Oe,{content:this.state._cachePopoverOpen?this.renderCacheContentPopover(k):e.jsx("div",{className:d.cachePopoverPlaceholder}),trigger:"hover",placement:"bottomLeft",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px"},onOpenChange:se=>{this.setState({_cachePopoverOpen:se}),se||(this._cacheScrollInited=!1)},children:e.jsxs("span",{className:d.liveTag,style:{borderColor:me,color:me},children:[e.jsx("span",{className:d.liveTagFill,style:{width:`${k}%`,backgroundColor:me}}),e.jsx("span",{className:d.liveTagContent,children:e.jsxs("span",{className:d.liveTagText,children:[p("ui.liveMonitoring"),r?`:${r}`:""]})})]})})})(),b&&e.jsx(fe,{color:b.type==="completed"?"green":"orange",closable:!0,onClose:()=>T&&T(),children:b.type==="completed"?p("ui.update.completed",{version:b.version}):p("ui.update.majorAvailable",{version:b.version})})]}),e.jsxs(Fe,{size:"middle",children:[K&&e.jsxs(fe,{style:{background:"#2a2a2a",border:"1px solid #3a3a3a",color:K===p("ui.cacheExpired")?"#ff6b6b":"#ccc"},children:[p("ui.cacheCountdown",{type:i?`(${i})`:""}),e.jsx("strong",{className:d.countdownStrong,children:K})]}),c==="chat"&&R&&!h&&this.state.localUrl&&e.jsxs(e.Fragment,{children:[this.state.countryFlag&&e.jsx(Oe,{content:this.state.countryInfo?e.jsxs("div",{className:d.countryInfoPopover,children:[e.jsxs("div",{children:[this.state.countryFlag," ",this.state.countryInfo.country]}),this.state.countryInfo.region&&e.jsx("div",{children:this.state.countryInfo.region}),this.state.countryInfo.city&&e.jsx("div",{children:this.state.countryInfo.city}),this.state.countryInfo.org&&e.jsx("div",{className:d.countryInfoMeta,children:this.state.countryInfo.org}),this.state.countryInfo.ip&&e.jsx("div",{className:d.countryInfoMeta,children:this.state.countryInfo.ip})]}):null,trigger:"hover",placement:"bottomRight",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 12px"},children:e.jsx(F,{className:d.compactBtnNoBorder,icon:e.jsx("span",{className:d.countryFlagIcon,children:this.state.countryFlag})})}),e.jsx(Oe,{content:e.jsxs("div",{className:d.qrcodePopover,children:[e.jsx("div",{className:d.qrcodeTitle,children:p("ui.scanToCoding")}),e.jsx(ys,{value:this.state.localUrl,size:200,bgColor:"#141414",fgColor:"#d9d9d9",level:"M"}),e.jsx(Ae,{readOnly:!0,value:this.state.localUrl,className:d.qrcodeUrlInput,suffix:e.jsx(De,{className:d.qrcodeUrlCopy,onClick:()=>{navigator.clipboard.writeText(this.state.localUrl).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})}})})]}),trigger:"hover",placement:"bottomRight",overlayInnerStyle:{background:"#1e1e1e",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 8px"},children:e.jsx(F,{className:d.compactBtnNoBorder,icon:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:d.svgIcon,children:[e.jsx("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),e.jsx("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})]})})})]}),R&&c==="chat"&&!h&&e.jsx(F,{className:d.compactBtn,type:B?"primary":"default",ghost:B,icon:e.jsx(Ge,{}),onClick:L,children:p("ui.terminal")}),e.jsx(F,{className:d.compactBtn,type:c==="raw"?"primary":"default",icon:c==="raw"?e.jsx(ra,{}):e.jsx(Ke,{}),onClick:u,children:c==="raw"?p("ui.chatMode"):p("ui.rawMode")})]}),e.jsxs(je,{title:`${p("ui.userPrompt")} (${this.state.promptData.length}${p("ui.promptCountUnit")})`,open:this.state.promptModalVisible,onCancel:()=>this.setState({promptModalVisible:!1}),footer:null,width:700,children:[e.jsx("div",{className:d.promptExportBar,children:e.jsx(F,{icon:e.jsx(ca,{}),onClick:this.handleExportPromptsTxt,children:p("ui.exportPromptsTxt")})}),e.jsx(Jt,{activeKey:this.state.promptViewMode,onChange:k=>this.setState({promptViewMode:k}),size:"small",items:[{key:"original",label:p("ui.promptModeOriginal")},{key:"context",label:p("ui.promptModeContext")},{key:"text",label:p("ui.promptModeText")}]}),this.state.promptViewMode==="text"?e.jsx("textarea",{readOnly:!0,className:d.promptTextarea,value:this.buildTextModeContent()}):e.jsxs("div",{className:d.promptScrollArea,children:[this.state.promptData.length===0&&e.jsx("div",{className:d.promptEmpty,children:p("ui.noPrompt")}),this.state.promptData.map((k,z)=>{const le=k.timestamp?new Date(k.timestamp).toLocaleString():p("ui.unknownTime");return e.jsxs("div",{children:[e.jsxs("div",{className:d.promptTimestamp,children:[le,":"]}),this.state.promptViewMode==="original"?this.renderOriginalPrompt(k):this.renderTextPrompt(k)]},z)})]})]}),e.jsxs(We,{title:p("ui.settings"),placement:"left",width:360,open:this.state.settingsDrawerVisible,onClose:()=>this.setState({settingsDrawerVisible:!1}),children:[e.jsxs("div",{className:d.settingsGroupBox,children:[e.jsx("div",{className:d.settingsGroupTitle,children:p("ui.chatDisplaySwitches")}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.collapseToolResults")}),e.jsx(Be,{checked:!!m,onChange:k=>v&&v(k)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.expandThinking")}),e.jsx(Be,{checked:!!x,onChange:k=>f&&f(k)})]})]}),e.jsxs("div",{className:d.settingsGroupBox,children:[e.jsx("div",{className:d.settingsGroupTitle,children:p("ui.userPreferences")}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.resumeAutoChoice")}),e.jsx(Be,{checked:!!ee,onChange:k=>te&&te(k)})]}),ee&&e.jsx("div",{className:d.settingsItem,children:e.jsxs(Ve.Group,{value:ee,onChange:k=>V&&V(k.target.value),size:"small",children:[e.jsx(Ve,{value:"continue",children:p("ui.resumeAutoChoice.continue")}),e.jsx(Ve,{value:"new",children:p("ui.resumeAutoChoice.new")})]})})]})]}),e.jsxs(We,{title:p("ui.globalSettings"),placement:"left",width:400,open:this.state.globalSettingsVisible,onClose:()=>this.setState({globalSettingsVisible:!1}),children:[e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.filterIrrelevant")}),e.jsx(Be,{checked:!!S,onChange:k=>N&&N(k)})]}),e.jsxs("div",{className:d.settingsItem,children:[e.jsx("span",{className:d.settingsLabel,children:p("ui.expandDiff")}),e.jsx(Be,{checked:!!y,onChange:k=>C&&C(k)})]})]}),e.jsx(We,{title:e.jsxs("span",{children:[e.jsx(Dt,{className:d.titleIcon}),p("ui.projectStats")]}),placement:"left",width:400,open:this.state.projectStatsVisible,onClose:()=>this.setState({projectStatsVisible:!1}),children:this.renderProjectStatsContent()}),e.jsxs(je,{title:e.jsxs("span",{children:[e.jsx(Ot,{className:d.titleIcon}),p("ui.pluginManagement")]}),open:this.state.pluginModalVisible,onCancel:()=>this.setState({pluginModalVisible:!1}),footer:e.jsxs("div",{className:d.pluginModalFooter,children:[e.jsxs("div",{className:d.pluginModalFooterLeft,children:[e.jsx(F,{icon:e.jsx(kt,{}),onClick:this.handleAddPlugin,children:p("ui.plugins.add")}),e.jsx(F,{icon:e.jsx(Ft,{}),onClick:this.handleShowCdnModal,children:p("ui.plugins.cdnInstall")})]}),e.jsx(F,{icon:e.jsx(dt,{}),onClick:this.handleReloadPlugins,children:p("ui.plugins.reload")})]}),width:560,children:[this.state.pluginsDir&&e.jsxs("div",{className:d.pluginDirHint,children:[e.jsxs("span",{className:d.pluginDirLabel,children:[p("ui.plugins.pluginsDir"),":"]})," ",e.jsx("code",{className:d.pluginDirPath,onClick:()=>{navigator.clipboard.writeText(this.state.pluginsDir).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})},children:this.state.pluginsDir})]}),this.state.pluginsList.length===0?e.jsxs("div",{className:d.pluginEmpty,children:[e.jsx("div",{className:d.pluginEmptyTitle,children:p("ui.plugins.empty")}),e.jsx("div",{className:d.pluginEmptyHint,children:p("ui.plugins.emptyHint")})]}):e.jsx("div",{className:d.pluginList,children:this.state.pluginsList.map(k=>e.jsxs("div",{className:d.pluginItem,children:[e.jsxs("div",{className:d.pluginInfo,children:[e.jsx("span",{className:d.pluginName,children:k.name}),e.jsx("span",{className:d.pluginFile,children:k.file}),k.hooks.length>0&&e.jsx("span",{className:d.pluginHooks,children:k.hooks.map(z=>e.jsx("span",{className:d.pluginHookTag,children:z},z))})]}),e.jsxs("div",{className:d.pluginActions,children:[e.jsx(Be,{size:"small",checked:k.enabled,onChange:z=>this.handleTogglePlugin(k.name,z)}),e.jsx(F,{type:"text",size:"small",danger:!0,icon:e.jsx(ct,{}),onClick:()=>this.handleDeletePlugin(k.file,k.name)})]})]},k.file))})]}),e.jsx(je,{title:p("ui.plugins.delete"),open:this.state.deleteConfirmVisible,onCancel:()=>this.setState({deleteConfirmVisible:!1,deleteTarget:null}),onOk:this.handleDeletePluginConfirm,okType:"danger",okText:"OK",cancelText:"Cancel",children:e.jsx("p",{children:this.state.deleteTarget?p("ui.plugins.deleteConfirm",{name:this.state.deleteTarget.name}):""})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(Ft,{className:d.titleIcon}),p("ui.plugins.cdnInstall")]}),open:this.state.cdnModalVisible,onCancel:this.handleCdnCancel,onOk:this.handleCdnInstall,confirmLoading:this.state.cdnLoading,okText:p("ui.plugins.cdnInstallBtn"),cancelText:p("ui.cancel"),width:480,children:e.jsxs("div",{children:[e.jsx("div",{className:d.cdnUrlLabel,children:p("ui.plugins.cdnUrl")}),e.jsx(Ae,{placeholder:p("ui.plugins.cdnUrlPlaceholder"),value:this.state.cdnUrl,onChange:this.handleCdnUrlChange,onPressEnter:this.handleCdnInstall,className:d.cdnInput})]})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(nt,{className:d.titleIcon}),p("ui.processManagement")]}),open:this.state.processModalVisible,onCancel:()=>this.setState({processModalVisible:!1}),footer:e.jsx(F,{icon:e.jsx(dt,{}),onClick:this.fetchProcesses,loading:this.state.processLoading,children:p("ui.processManagement.refresh")}),width:780,children:e.jsx(da,{dataSource:this.state.processList,rowKey:"pid",loading:this.state.processLoading,size:"middle",pagination:!1,columns:[{title:p("ui.processManagement.port"),dataIndex:"port",width:80,render:k=>k?e.jsx("a",{href:`${window.location.protocol}//127.0.0.1:${k}`,target:"_blank",rel:"noopener noreferrer",children:k}):""},{title:"PID",dataIndex:"pid",width:80},{title:p("ui.processManagement.command"),dataIndex:"command",ellipsis:!0},{title:p("ui.processManagement.startTime"),dataIndex:"startTime",width:200},{title:p("ui.processManagement.action"),width:100,render:(k,z)=>z.isCurrent?e.jsx(F,{size:"small",className:d.currentProcessBtn,children:p("ui.processManagement.current")}):e.jsx(F,{size:"small",danger:!0,onClick:()=>this.handleKillProcess(z.pid),children:p("ui.processManagement.kill")})}]})}),e.jsx(je,{title:e.jsxs("span",{children:[e.jsx(Qt,{apiEndpoint:re("/api/open-profile-dir"),title:p("ui.proxy.openConfigDir"),size:16})," ",p("ui.proxySwitch")," ",e.jsx(he,{doc:"ProxySwitch",zIndex:1100})]}),open:this.state.proxyModalVisible,onCancel:()=>this.setState({proxyModalVisible:!1,editingProxy:null}),footer:null,width:520,children:this.renderProxyProfileList()})]})}renderProxyProfileList(){const t=this.props.proxyProfiles||[],a=this.props.activeProxyId||"max",{editingProxy:c,editForm:i}=this.state;return e.jsxs("div",{children:[e.jsxs("div",{className:d.proxyWarning,children:["⚠️ ",p("ui.proxy.maxWarning")]}),e.jsx("div",{className:d.proxyList,children:t.map(u=>{var g;return e.jsxs("div",{className:`${d.proxyItem} ${u.id===a?d.proxyItemActive:""}`,children:[e.jsxs("div",{className:d.proxyItemMain,onClick:()=>{if(u.id!==a){const l={active:u.id,profiles:t};this.props.onProxyProfileChange(l)}},children:[e.jsx(Ve,{checked:u.id===a,style:{marginRight:8}}),e.jsxs("div",{className:d.proxyItemInfo,children:[e.jsxs("div",{className:d.proxyItemNameRow,children:[e.jsx("span",{className:d.proxyItemName,children:u.name}),u.id==="max"&&e.jsx(fe,{className:d.proxyBuiltinTag,children:p("ui.proxy.builtin")})]}),u.id==="max"&&this.props.defaultConfig&&e.jsxs("div",{className:d.proxyItemDetail,children:[(()=>{try{return new URL(this.props.defaultConfig.origin).host}catch{return this.props.defaultConfig.origin}})(),this.props.defaultConfig.authType?` · ${this.props.defaultConfig.authType}`:"",this.props.defaultConfig.apiKey?` · ${this.props.defaultConfig.apiKey}`:"",this.props.defaultConfig.model?` · ${this.props.defaultConfig.model}`:""]}),u.id!=="max"&&u.baseURL&&e.jsxs("div",{className:d.proxyItemDetail,children:[(()=>{try{return new URL(u.baseURL).host}catch{return u.baseURL}})(),u.activeModel?` · ${u.activeModel}`:(g=u.models)!=null&&g.length?` · ${u.models[0]}`:""]})]})]}),u.id!=="max"&&e.jsxs("div",{className:d.proxyItemActions,children:[e.jsx(F,{type:"text",size:"small",icon:e.jsx(ha,{}),onClick:()=>this.setState({editingProxy:u.id,editForm:{name:u.name||"",baseURL:u.baseURL||"",apiKey:u.apiKey||"",models:(u.models||[]).join(", "),activeModel:u.activeModel||""}})}),e.jsx(F,{type:"text",size:"small",danger:!0,icon:e.jsx(ct,{}),onClick:()=>{je.confirm({title:p("ui.proxy.deleteProxy"),content:p("ui.proxy.deleteConfirm",{name:u.name}),okType:"danger",onOk:()=>{const l=t.filter(o=>o.id!==u.id),h=a===u.id?"max":a;this.props.onProxyProfileChange({active:h,profiles:l})}})}})]})]},u.id)})}),c&&e.jsxs("div",{className:d.proxyEditForm,children:[e.jsxs("div",{className:d.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.name")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(Ae,{size:"small",value:i.name,onChange:u=>{const g=u.target.value;this.setState(l=>({editForm:{...l.editForm,name:g}}))}})]}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.baseURL")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(Ae,{size:"small",value:i.baseURL,onChange:u=>{const g=u.target.value;this.setState(l=>({editForm:{...l.editForm,baseURL:g}}))},placeholder:"https://api.example.com"})]}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsxs("label",{children:[p("ui.proxy.apiKey")," ",e.jsx("span",{className:d.proxyRequired,children:"*"})]}),e.jsx(Ae.Password,{size:"small",value:i.apiKey,onChange:u=>{const g=u.target.value;this.setState(l=>({editForm:{...l.editForm,apiKey:g}}))},placeholder:"sk-..."})]}),e.jsx("div",{className:d.proxyEditDivider}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsx("label",{children:p("ui.proxy.models")}),e.jsx(Ae,{size:"small",value:i.models,onChange:u=>{const g=u.target.value;this.setState(l=>({editForm:{...l.editForm,models:g}}))},placeholder:"model-1, model-2"})]}),e.jsxs("div",{className:d.proxyEditRow,children:[e.jsx("label",{children:p("ui.proxy.activeModel")}),e.jsx(qe,{size:"small",className:d.fullWidthSelect,value:i.activeModel||void 0,onChange:u=>this.setState(g=>({editForm:{...g.editForm,activeModel:u}})),placeholder:p("ui.proxy.activeModel"),children:(i.models||"").split(",").map(u=>u.trim()).filter(Boolean).map(u=>e.jsx(qe.Option,{value:u,children:u},u))})]}),e.jsxs("div",{className:d.proxyEditBtns,children:[e.jsx(F,{size:"small",icon:e.jsx(ua,{}),type:"primary",onClick:()=>{var h,o,r;if(!((h=i.name)!=null&&h.trim())||!((o=i.baseURL)!=null&&o.trim())||!((r=i.apiKey)!=null&&r.trim())){J.warning(p("ui.proxy.requiredFields"));return}const u=(i.models||"").split(",").map(m=>m.trim()).filter(Boolean),g={id:c==="__new__"?`proxy_${Date.now()}`:c,name:i.name.trim(),baseURL:i.baseURL.trim(),apiKey:i.apiKey.trim(),models:u,activeModel:i.activeModel||u[0]||""};let l;c==="__new__"?l=[...t,g]:l=t.map(m=>m.id===c?{...m,...g,id:m.id}:m),this.props.onProxyProfileChange({active:a,profiles:l}),this.setState({editingProxy:null})},children:p("ui.proxy.save")}),e.jsx(F,{size:"small",icon:e.jsx(ma,{}),onClick:()=>this.setState({editingProxy:null}),children:p("ui.proxy.cancel")})]})]}),!c&&e.jsx(F,{block:!0,type:"dashed",icon:e.jsx(kt,{}),style:{marginTop:12},onClick:()=>this.setState({editingProxy:"__new__",editForm:{name:"",baseURL:"",apiKey:"",models:"",activeModel:""}}),children:p("ui.proxy.addProxy")})]})}};A(ke,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let Qe=ke;const Sn="_centerEmpty_18l8t_1",kn="_scrollContainer_18l8t_8",wn="_listItem_18l8t_15",Tn="_listItemActive_18l8t_27",Mn="_itemContent_18l8t_36",En="_itemHeader_18l8t_41",Rn="_tagNoMargin_18l8t_49",In="_modelName_18l8t_54",Ln="_modelNameMain_18l8t_59",Pn="_time_18l8t_63",An="_detailRow_18l8t_69",Bn="_urlText_18l8t_76",On="_duration_18l8t_85",Dn="_statusOk_18l8t_90",Fn="_statusErr_18l8t_96",$n="_statusDefault_18l8t_101",Hn="_usageBox_18l8t_106",zn="_cacheDot_18l8t_116",Vn="_cacheDotLoss_18l8t_125",Un="_cacheDotNormal_18l8t_130",qn="_tagMainAgent_18l8t_134",Wn="_tagPlan_18l8t_140",Kn="_tagMuted_18l8t_146",Gn="_tooltipPreLine_18l8t_152",H={centerEmpty:Sn,scrollContainer:kn,listItem:wn,listItemActive:Tn,itemContent:Mn,itemHeader:En,tagNoMargin:Rn,modelName:In,modelNameMain:Ln,time:Pn,detailRow:An,urlText:Bn,duration:On,statusOk:Dn,statusErr:Fn,statusDefault:$n,usageBox:Hn,cacheDot:zn,cacheDotLoss:Vn,cacheDotNormal:Un,tagMainAgent:qn,tagPlan:Wn,tagMuted:Kn,tooltipPreLine:Gn};class Jn extends q.Component{constructor(t){super(t);A(this,"handleKeyDown",t=>{if(t.key!=="ArrowUp"&&t.key!=="ArrowDown")return;const{requests:a,selectedIndex:c,onSelect:i}=this.props;if(!a.length)return;t.preventDefault();const u=c??0,g=t.key==="ArrowUp"?Math.max(0,u-1):Math.min(a.length-1,u+1);g!==u&&i(g)});this.activeItemRef=q.createRef()}componentDidMount(){this.scrollToSelected(!0)}shouldComponentUpdate(t){return t.requests!==this.props.requests||t.selectedIndex!==this.props.selectedIndex||t.scrollCenter!==this.props.scrollCenter||t.cacheLossMap!==this.props.cacheLossMap}componentDidUpdate(t){this.props.scrollCenter&&t.selectedIndex!==this.props.selectedIndex?this.scrollToSelected(!0):t.selectedIndex!==this.props.selectedIndex&&(this.scrollToSelected(!1),this.activeItemRef.current&&this.activeItemRef.current.focus({preventScroll:!0}))}scrollToSelected(t){this.activeItemRef.current&&(this.activeItemRef.current.scrollIntoView({block:t?"center":"nearest",behavior:"instant"}),t&&this.props.onScrollDone&&this.props.onScrollDone())}render(){const{requests:t,selectedIndex:a,onSelect:c}=this.props;return t.length===0?e.jsx("div",{className:H.centerEmpty,children:e.jsx(we,{description:p("ui.waitingRequests")})}):e.jsx("div",{className:H.scrollContainer,onKeyDown:this.handleKeyDown,children:e.jsx(wt,{dataSource:t,size:"small",split:!1,renderItem:(i,u)=>{var T,R,B;const g=new Date(i.timestamp).toLocaleTimeString("zh-CN"),l=u===a,h=i.response&&i.response.status<400,o=i.response&&i.response.status>=400,r=pa((T=i.body)==null?void 0:T.model),m=u+1<t.length?t[u+1]:null,{type:v,subType:x}=ze(i,m),f=(B=(R=i.response)==null?void 0:R.body)==null?void 0:B.usage,y=f?(f.input_tokens||0)+(f.cache_read_input_tokens||0)+(f.cache_creation_input_tokens||0):null,C=(f==null?void 0:f.output_tokens)||null,S=(f==null?void 0:f.cache_read_input_tokens)||0,N=(f==null?void 0:f.cache_creation_input_tokens)||0;let b=i.url;try{const L=new URL(i.url);b=L.host+L.pathname}catch{}return e.jsx(wt.Item,{ref:l?this.activeItemRef:void 0,tabIndex:0,onClick:()=>c(u),className:`${H.listItem} ${l?H.listItemActive:""}`,children:e.jsxs("div",{className:H.itemContent,children:[e.jsxs("div",{className:H.itemHeader,children:[v==="MainAgent"?e.jsx(fe,{className:`${H.tagNoMargin} ${H.tagMainAgent}`,children:"MainAgent"}):v==="Plan"?e.jsx(fe,{className:`${H.tagNoMargin} ${H.tagPlan}`,children:Tt(v,x)}):v==="Count"||v==="Preflight"?e.jsx(fe,{className:`${H.tagNoMargin} ${H.tagMuted}`,children:v}):e.jsx(fe,{className:H.tagNoMargin,children:Tt(v,x)}),r&&e.jsx("span",{className:`${H.modelName} ${v==="MainAgent"?H.modelNameMain:""}`,children:r}),e.jsx("span",{className:H.time,children:g})]}),e.jsxs("div",{className:H.detailRow,children:[e.jsx("span",{className:H.urlText,title:i.url,children:b}),i.duration&&e.jsxs("span",{className:H.duration,children:[i.duration,"ms"]}),i.response&&e.jsx("span",{className:h?H.statusOk:o?H.statusErr:H.statusDefault,children:i.response.status})]}),f&&e.jsxs("div",{className:H.usageBox,children:[e.jsxs("div",{children:["token: output:",W(C)||0,", input: ",W(y)||0]}),(S>0||N>0)&&e.jsx("div",{children:(()=>{var O;const L=(O=this.props.cacheLossMap)==null?void 0:O.get(u),M={ttl:"ui.cacheLoss.ttl",system_change:"ui.cacheLoss.systemChange",tools_change:"ui.cacheLoss.toolsChange",model_change:"ui.cacheLoss.modelChange",msg_truncated:"ui.cacheLoss.msgTruncated",msg_modified:"ui.cacheLoss.msgModified",key_change:"ui.cacheLoss.keyChange"};let I;if(L){const te=(L.reasons||[L.reason]).map(V=>p(M[V]||M.key_change)).join(`
|
|
27
|
+
`);I=e.jsx(Yt,{title:e.jsx("span",{className:H.tooltipPreLine,children:te}),children:e.jsx("span",{className:`${H.cacheDot} ${H.cacheDotLoss}`})})}else I=e.jsx("span",{className:`${H.cacheDot} ${H.cacheDotNormal}`});return e.jsxs(e.Fragment,{children:["cache",I,": ",S>0?`read:${W(S)}`:"",S>0&&N>0?", ":"",N>0?`create:${W(N)}`:""]})})()})]})]})})}})})}}const Qn=n=>typeof n=="boolean"||n instanceof Boolean,Yn=n=>typeof n=="number"||n instanceof Number,Xn=n=>typeof n=="bigint"||n instanceof BigInt,vs=n=>!!n&&n instanceof Date,Zn=n=>typeof n=="string"||n instanceof String,ei=n=>Array.isArray(n),js=n=>typeof n=="object"&&n!==null,Cs=n=>!!n&&n instanceof Object&&typeof n=="function";function Ye(n,s){return s===void 0&&(s=!1),!n||s?`"${n}"`:n}function ti(n,s,t){return t?JSON.stringify(n):s?`"${n}"`:n}function bs(n){let{field:s,value:t,data:a,lastElement:c,openBracket:i,closeBracket:u,level:g,style:l,shouldExpandNode:h,clickToExpandNode:o,outerRef:r,beforeExpandChange:m}=n;const v=j.useRef(!1),[x,f]=j.useState(()=>h(g,t,s)),y=j.useRef(null);j.useEffect(()=>{v.current?f(h(g,t,s)):v.current=!0},[h]);const C=j.useId();if(a.length===0)return si({field:s,openBracket:i,closeBracket:u,lastElement:c,style:l});const S=x?l.collapseIcon:l.expandIcon,N=x?l.ariaLables.collapseJson:l.ariaLables.expandJson,b=g+1,T=a.length-1,R=M=>{x!==M&&(!m||m({level:g,value:t,field:s,newExpandValue:M}))&&f(M)},B=M=>{if(M.key==="ArrowRight"||M.key==="ArrowLeft")M.preventDefault(),R(M.key==="ArrowRight");else if(M.key==="ArrowUp"||M.key==="ArrowDown"){M.preventDefault();const I=M.key==="ArrowUp"?-1:1;if(!r.current)return;const O=r.current.querySelectorAll("[role=button]");let ee=-1;for(let V=0;V<O.length;V++)if(O[V].tabIndex===0){ee=V;break}if(ee<0)return;const te=(ee+I+O.length)%O.length;O[ee].tabIndex=-1,O[te].tabIndex=0,O[te].focus()}},L=()=>{var M;R(!x);const I=y.current;if(!I)return;const O=(M=r.current)===null||M===void 0?void 0:M.querySelector('[role=button][tabindex="0"]');O&&(O.tabIndex=-1),I.tabIndex=0,I.focus()};return j.createElement("div",{className:l.basicChildStyle,role:"treeitem","aria-expanded":x,"aria-selected":void 0},j.createElement("span",{className:S,onClick:L,onKeyDown:B,role:"button","aria-label":N,"aria-expanded":x,"aria-controls":x?C:void 0,ref:y,tabIndex:g===0?0:-1}),(s||s==="")&&(o?j.createElement("span",{className:l.clickableLabel,onClick:L,onKeyDown:B},Ye(s,l.quotesForFieldNames),":"):j.createElement("span",{className:l.label},Ye(s,l.quotesForFieldNames),":")),j.createElement("span",{className:l.punctuation},i),x?j.createElement("ul",{id:C,role:"group",className:l.childFieldsContainer},a.map((M,I)=>j.createElement(mt,{key:M[0]||I,field:M[0],value:M[1],style:l,lastElement:I===T,level:b,shouldExpandNode:h,clickToExpandNode:o,beforeExpandChange:m,outerRef:r}))):j.createElement("span",{className:l.collapsedContent,onClick:L,onKeyDown:B}),j.createElement("span",{className:l.punctuation},u),!c&&j.createElement("span",{className:l.punctuation},","))}function si(n){let{field:s,openBracket:t,closeBracket:a,lastElement:c,style:i}=n;return j.createElement("div",{className:i.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:i.label},Ye(s,i.quotesForFieldNames),":"),j.createElement("span",{className:i.punctuation},t),j.createElement("span",{className:i.punctuation},a),!c&&j.createElement("span",{className:i.punctuation},","))}function ai(n){let{field:s,value:t,style:a,lastElement:c,shouldExpandNode:i,clickToExpandNode:u,level:g,outerRef:l,beforeExpandChange:h}=n;return bs({field:s,value:t,lastElement:c||!1,level:g,openBracket:"{",closeBracket:"}",style:a,shouldExpandNode:i,clickToExpandNode:u,data:Object.keys(t).map(o=>[o,t[o]]),outerRef:l,beforeExpandChange:h})}function ni(n){let{field:s,value:t,style:a,lastElement:c,level:i,shouldExpandNode:u,clickToExpandNode:g,outerRef:l,beforeExpandChange:h}=n;return bs({field:s,value:t,lastElement:c||!1,level:i,openBracket:"[",closeBracket:"]",style:a,shouldExpandNode:u,clickToExpandNode:g,data:t.map(o=>[void 0,o]),outerRef:l,beforeExpandChange:h})}function ii(n){let{field:s,value:t,style:a,lastElement:c}=n,i,u=a.otherValue;return t===null?(i="null",u=a.nullValue):t===void 0?(i="undefined",u=a.undefinedValue):Zn(t)?(i=ti(t,!a.noQuotesForStringValues,a.stringifyStringValues),u=a.stringValue):Qn(t)?(i=t?"true":"false",u=a.booleanValue):Yn(t)?(i=t.toString(),u=a.numberValue):Xn(t)?(i=`${t.toString()}n`,u=a.numberValue):vs(t)?i=t.toISOString():Cs(t)?i="function() { }":i=t.toString(),j.createElement("div",{className:a.basicChildStyle,role:"treeitem","aria-selected":void 0},(s||s==="")&&j.createElement("span",{className:a.label},Ye(s,a.quotesForFieldNames),":"),j.createElement("span",{className:u},i),!c&&j.createElement("span",{className:a.punctuation},","))}function mt(n){const s=n.value;return ei(s)?j.createElement(ni,Object.assign({},n)):js(s)&&!vs(s)&&!Cs(s)?j.createElement(ai,Object.assign({},n)):j.createElement(ii,Object.assign({},n))}var $={"container-light":"_2IvMF _GzYRV","basic-element-style":"_2bkNM","child-fields-container":"_1BXBN","label-light":"_1MGIk","clickable-label-light":"_2YKJg _1MGIk _1MFti","punctuation-light":"_3uHL6 _3eOF8","value-null-light":"_2T6PJ","value-undefined-light":"_1Gho6","value-string-light":"_vGjyY","value-number-light":"_1bQdo","value-boolean-light":"_3zQKs","value-other-light":"_1xvuR","collapse-icon-light":"_oLqym _f10Tu _1MFti _1LId0","expand-icon-light":"_2AXVT _f10Tu _1MFti _1UmXx","collapsed-content-light":"_2KJWg _1pNG9 _1MFti","container-dark":"_11RoI _GzYRV","expand-icon-dark":"_17H2C _f10Tu _1MFti _1UmXx","collapse-icon-dark":"_3QHg2 _f10Tu _1MFti _1LId0","collapsed-content-dark":"_3fDAz _1pNG9 _1MFti","label-dark":"_2bSDX","clickable-label-dark":"_1RQEj _2bSDX _1MFti","punctuation-dark":"_gsbQL _3eOF8","value-null-dark":"_LaAZe","value-undefined-dark":"_GTKgm","value-string-dark":"_Chy1W","value-number-dark":"_2bveF","value-boolean-dark":"_2vRm-","value-other-dark":"_1prJR"};const Ns={collapseJson:"collapse JSON",expandJson:"expand JSON"},lt={container:$["container-light"],basicChildStyle:$["basic-element-style"],childFieldsContainer:$["child-fields-container"],label:$["label-light"],clickableLabel:$["clickable-label-light"],nullValue:$["value-null-light"],undefinedValue:$["value-undefined-light"],stringValue:$["value-string-light"],booleanValue:$["value-boolean-light"],numberValue:$["value-number-light"],otherValue:$["value-other-light"],punctuation:$["punctuation-light"],collapseIcon:$["collapse-icon-light"],expandIcon:$["expand-icon-light"],collapsedContent:$["collapsed-content-light"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:Ns,stringifyStringValues:!1},li={container:$["container-dark"],basicChildStyle:$["basic-element-style"],childFieldsContainer:$["child-fields-container"],label:$["label-dark"],clickableLabel:$["clickable-label-dark"],nullValue:$["value-null-dark"],undefinedValue:$["value-undefined-dark"],stringValue:$["value-string-dark"],booleanValue:$["value-boolean-dark"],numberValue:$["value-number-dark"],otherValue:$["value-other-dark"],punctuation:$["punctuation-dark"],collapseIcon:$["collapse-icon-dark"],expandIcon:$["expand-icon-dark"],collapsedContent:$["collapsed-content-dark"],noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:Ns,stringifyStringValues:!1},oi=()=>!0,ri=n=>{let{data:s,style:t=lt,shouldExpandNode:a=oi,clickToExpandNode:c=!1,beforeExpandChange:i,compactTopLevel:u,...g}=n;const l=j.useRef(null);return j.createElement("div",Object.assign({"aria-label":"JSON view"},g,{className:t.container,ref:l,role:"tree"}),u&&js(s)?Object.entries(s).map(h=>{let[o,r]=h;return j.createElement(mt,{key:o,field:o,value:r,style:{...lt,...t},lastElement:!0,level:1,shouldExpandNode:a,clickToExpandNode:c,beforeExpandChange:i,outerRef:l})}):j.createElement(mt,{value:s,style:{...lt,...t},lastElement:!0,level:0,shouldExpandNode:a,clickToExpandNode:c,outerRef:l,beforeExpandChange:i}))},ci="_container_1h2lr_1",di={container:ci},hi={...li,container:"rjv-container"};class Xe extends q.Component{shouldComponentUpdate(s){return s.data!==this.props.data||s.defaultExpand!==this.props.defaultExpand||s.expandNode!==this.props.expandNode}render(){const{data:s,defaultExpand:t,expandNode:a}=this.props;if(s==null)return null;const c=typeof a=="function"?a:t==="all"?()=>!0:t==="root"?i=>i<2:i=>i<1;return e.jsx("div",{className:di.container,children:e.jsx(ri,{data:s,shouldExpandNode:c,style:hi})})}}function ui({currentId:n,visibleIds:s=[],key:t}){if(t!=="ArrowUp"&&t!=="ArrowDown")return null;const a=s.findIndex(i=>i===n),c=t==="ArrowUp"?-1:1;return a>=0?s[a+c]??null:null}const mi="_root_9isis_1",pi="_sidebar_9isis_9",gi="_section_9isis_18",fi="_sectionHeader_9isis_22",xi="_arrow_9isis_48",yi="_sectionTitle_9isis_54",vi="_sectionCount_9isis_62",ji="_sectionBody_9isis_71",Ci="_historyToggle_9isis_76",bi="_historyToggleLabel_9isis_102",Ni="_item_9isis_107",_i="_itemActive_9isis_133",Si="_itemContent_9isis_143",ki="_itemLabel_9isis_149",wi="_itemSublabel_9isis_157",Ti="_itemTime_9isis_166",Mi="_content_9isis_175",Ei="_contentEmpty_9isis_183",Ri="_contentInner_9isis_190",Ii="_emptyWrap_9isis_194",Li="_roleHeader_9isis_202",Pi="_roleBadge_9isis_210",Ai="_role_user_9isis_219",Bi="_role_assistant_9isis_225",Oi="_roleLabel_9isis_231",Di="_contentTime_9isis_238",Fi="_turnDivider_9isis_246",$i="_textBlock_9isis_253",Hi="_textBlockBar_9isis_260",zi="_textBlockBody_9isis_269",Vi="_textBlockCompact_9isis_277",Ui="_textBlockCompactFloat_9isis_284",qi="_thinkingBlock_9isis_291",Wi="_thinkingHeader_9isis_299",Ki="_thinkingPreview_9isis_314",Gi="_thinkingBody_9isis_324",Ji="_toolBlock_9isis_330",Qi="_toolBlockResult_9isis_337",Yi="_toolBlockError_9isis_341",Xi="_toolBlockHeader_9isis_345",Zi="_toolBlockBody_9isis_356",el="_toolName_9isis_361",tl="_toolId_9isis_367",sl="_errorLabel_9isis_374",al="_blockTag_9isis_384",nl="_blockTagText_9isis_397",il="_blockTagThinking_9isis_403",ll="_blockTagResult_9isis_409",ol="_blockTagError_9isis_415",rl="_jsonBlock_9isis_422",cl="_jsonBlockLabel_9isis_429",dl="_blockSeparator_9isis_439",hl="_markdownBody_9isis_446",w={root:mi,sidebar:pi,section:gi,sectionHeader:fi,arrow:xi,sectionTitle:yi,sectionCount:vi,sectionBody:ji,historyToggle:Ci,historyToggleLabel:bi,item:Ni,itemActive:_i,itemContent:Si,itemLabel:ki,itemSublabel:wi,itemTime:Ti,content:Mi,contentEmpty:Ei,contentInner:Ri,emptyWrap:Ii,roleHeader:Li,roleBadge:Pi,role_user:Ai,role_assistant:Bi,roleLabel:Oi,contentTime:Di,turnDivider:Fi,textBlock:$i,textBlockBar:Hi,textBlockBody:zi,textBlockCompact:Vi,textBlockCompactFloat:Ui,thinkingBlock:qi,thinkingHeader:Wi,thinkingPreview:Ki,thinkingBody:Gi,toolBlock:Ji,toolBlockResult:Qi,toolBlockError:Yi,toolBlockHeader:Xi,toolBlockBody:Zi,toolName:el,toolId:tl,errorLabel:sl,blockTag:al,blockTagText:nl,blockTagThinking:il,blockTagResult:ll,blockTagError:ol,jsonBlock:rl,jsonBlockLabel:cl,blockSeparator:dl,markdownBody:hl},{Text:ul}=Xt;function pt(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}if(Array.isArray(n)){const s=[];for(const t of n)if(t)if(t.type==="text"){const a=(t.text||"").trim();a&&s.push({type:"markdown",text:a})}else if(t.type==="tool_use")s.push({type:"tool_use",name:t.name||"unknown",id:t.id||"",input:t.input??{}});else if(t.type==="tool_result"){const a=ml(t.content);s.push({type:"tool_result",tool_use_id:t.tool_use_id||"",is_error:t.is_error,content:a})}else if(t.type==="thinking"){const a=t.thinking||"";a.trim()&&s.push({type:"thinking",text:a})}else t.type==="image"?s.push({type:"json",label:"image",data:t}):s.push({type:"json",label:t.type||"block",data:t});return s}return[{type:"json",label:"content",data:n}]}function ml(n){if(n==null)return[];if(typeof n=="string"){const s=n.trim();return s?[{type:"markdown",text:s}]:[]}return Array.isArray(n)?n.flatMap(s=>{if(!s)return[];if(s.type==="text"){const t=(s.text||"").trim();return t?[{type:"markdown",text:t}]:[]}return[{type:"json",label:s.type||"block",data:s}]}):[{type:"json",label:"content",data:n}]}function pl(n){if(!n)return null;if(typeof n=="string")return[{type:"markdown",text:n}];if(Array.isArray(n)){const s=[];return n.forEach((t,a)=>{a>0&&s.push({type:"separator"}),t&&(typeof t=="string"?s.push({type:"markdown",text:t}):t.type==="text"?s.push({type:"markdown",text:t.text||""}):s.push({type:"json",label:t.type||"item",data:t}))}),s}return[{type:"json",label:"system",data:n}]}function gl(n){const s=[],t=(n==null?void 0:n.name)||"unknown",a=(n==null?void 0:n.description)||"";let c=`### ${t}
|
|
28
28
|
|
|
29
29
|
`;a&&(c+=`${a}
|
|
30
30
|
|
|
31
|
-
`),s.push({type:"markdown",text:c});const i=(n==null?void 0:n.input_schema)||(n==null?void 0:n.parameters)||null;return i&&s.push({type:"json",label:"Parameters",data:i}),s}function gl(n){var s;if(typeof n=="string")return n.slice(0,60).replace(/\n/g," ");if(Array.isArray(n)){for(const t of n)if((t==null?void 0:t.type)==="text"&&((s=t.text)!=null&&s.trim()))return t.text.trim().slice(0,60).replace(/\n/g," ")}return""}function fl(n){var a;const s=[];let t=0;for(;t<n.length;){const c=n[t];if((c==null?void 0:c.role)!=="user"){t++;continue}const i=((a=n[t+1])==null?void 0:a.role)==="assistant"?n[t+1]:null;s.push({id:`turn__${t}`,isTurn:!0,turnIndex:s.length,timestamp:c._timestamp||null,assistantTimestamp:(i==null?void 0:i._timestamp)||null,userBlocks:pt(c==null?void 0:c.content),assistantBlocks:i?pt(i.content):null,preview:gl(c==null?void 0:c.content)}),t+=i?2:1}return s}function gt(n){try{return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return null}}function xl({text:n,compact:s}){const t=Zt(n);return s?e.jsx("div",{className:w.textBlockCompact,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:t}})}):e.jsxs("div",{className:w.textBlock,children:[e.jsx("div",{className:w.textBlockBar,children:e.jsx("span",{className:`${w.blockTag} ${w.blockTagText}`,children:"text"})}),e.jsx("div",{className:`chat-md ${w.textBlockBody}`,dangerouslySetInnerHTML:{__html:t}})]})}function yl({block:n}){const[s,t]=j.useState(!0),a=n.text.length>60?n.text.slice(0,60).replace(/\n/g," ")+"…":n.text.replace(/\n/g," ");return e.jsxs("div",{className:w.thinkingBlock,children:[e.jsxs("div",{className:w.thinkingHeader,onClick:()=>t(c=>!c),children:[s?e.jsx(Te,{className:w.arrow}):e.jsx(Me,{className:w.arrow}),e.jsx("span",{className:`${w.blockTag} ${w.blockTagThinking}`,children:"thinking"}),!s&&e.jsx("span",{className:w.thinkingPreview,children:a})]}),s&&e.jsx("div",{className:w.thinkingBody,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:Zt(n.text)}})})]})}function Ze({blocks:n,compact:s}){return!n||n.length===0?null:e.jsx(e.Fragment,{children:n.map((t,a)=>e.jsx(vl,{block:t,compact:s},a))})}function vl({block:n,compact:s}){var t;return n.type==="separator"?e.jsx("hr",{className:w.blockSeparator}):n.type==="markdown"?(t=n.text)!=null&&t.trim()?e.jsx(xl,{text:n.text,compact:s}):null:n.type==="thinking"?e.jsx(yl,{block:n}):n.type==="tool_use"?e.jsxs("div",{className:w.toolBlock,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:w.blockTag,children:"tool_use"}),e.jsx("span",{className:w.toolName,children:n.name}),n.id&&e.jsx("span",{className:w.toolId,children:n.id})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(Xe,{data:n.input,defaultExpand:"root"})})]}):n.type==="tool_result"?e.jsxs("div",{className:`${w.toolBlock} ${n.is_error?w.toolBlockError:w.toolBlockResult}`,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:`${w.blockTag} ${n.is_error?w.blockTagError:w.blockTagResult}`,children:"tool_result"}),n.tool_use_id&&e.jsx("span",{className:w.toolId,children:n.tool_use_id}),n.is_error&&e.jsx("span",{className:w.errorLabel,children:"error"})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(Ze,{blocks:n.content,compact:!0})})]}):n.type==="json"?e.jsxs("div",{className:w.jsonBlock,children:[n.label&&e.jsx("div",{className:w.jsonBlockLabel,children:n.label}),e.jsx(Xe,{data:n.data,defaultExpand:"root"})]}):null}function jl({turn:n}){const s=n.timestamp?gt(n.timestamp):null,t=n.assistantTimestamp?gt(n.assistantTimestamp):null;return e.jsxs("div",{children:[e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_user}`,children:"user"}),e.jsx("span",{className:w.roleLabel,children:`Turn ${n.turnIndex+1}`}),s&&e.jsx("span",{className:w.contentTime,children:s})]}),e.jsx(Ze,{blocks:n.userBlocks}),n.assistantBlocks&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:w.turnDivider}),e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_assistant}`,children:"assistant"}),t&&e.jsx("span",{className:w.contentTime,children:t})]}),e.jsx(Ze,{blocks:n.assistantBlocks})]})]})}function Cl({sectionKey:n,title:s,items:t,historyItems:a=[],onSelect:c,onSelectById:i,selectedId:u,sidebarRef:g}){const[l,h]=j.useState(n!=="tools"),[o,r]=j.useState(!1),m=t.length+a.length,v=`${n}__history_toggle`;function x(C){var N;const S=(N=g.current)==null?void 0:N.querySelector(`[data-context-sidebar-control="${C}"]`);S&&(S.focus(),S.scrollIntoView({block:"nearest"}))}function f(C,S){var T;const N=Array.from(((T=g.current)==null?void 0:T.querySelectorAll("[data-context-sidebar-control]"))||[]).map(R=>R.dataset.contextSidebarControl).filter(Boolean),b=hi({currentId:S,visibleIds:N,key:C.key});b&&(C.preventDefault(),typeof window<"u"&&window.requestAnimationFrame(()=>{var B;x(b);const R=(B=g.current)==null?void 0:B.querySelector(`[data-context-sidebar-control="${b}"]`);(R==null?void 0:R.dataset.controlType)==="item"&&i(b)}))}function y(C){const S=u===C.id;return e.jsxs("button",{type:"button",className:`${w.item} ${S?w.itemActive:""}`,onClick:()=>c(C),onKeyDown:N=>f(N,C.id),"aria-current":S?"true":void 0,"data-context-sidebar-control":C.id,"data-control-type":"item",children:[e.jsxs("div",{className:w.itemContent,children:[e.jsx("span",{className:w.itemLabel,children:C.label}),C.sublabel&&!S&&e.jsx("div",{className:w.itemSublabel,children:C.sublabel})]}),C.time&&e.jsx("span",{className:w.itemTime,children:C.time})]},C.id)}return e.jsxs("div",{className:w.section,children:[e.jsxs("button",{type:"button",className:w.sectionHeader,onClick:()=>h(C=>!C),"aria-expanded":l,children:[l?e.jsx(Te,{className:w.arrow}):e.jsx(Me,{className:w.arrow}),e.jsx("span",{className:w.sectionTitle,children:s}),e.jsx("span",{className:w.sectionCount,children:m})]}),l&&e.jsxs("div",{className:w.sectionBody,children:[a.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:w.historyToggle,onClick:()=>r(C=>!C),onKeyDown:C=>f(C,v),"aria-expanded":o,"data-context-sidebar-control":v,"data-control-type":"toggle",children:[o?e.jsx(Te,{className:w.arrow}):e.jsx(Me,{className:w.arrow}),e.jsxs("span",{className:w.historyToggleLabel,children:[p("ui.context.history")," (",a.length,")"]})]}),o&&a.map(y)]}),t.map(y)]})]})}function bl({body:n,response:s}){const[t,a]=j.useState(null),c=j.useRef(null),i=j.useMemo(()=>{if(!Array.isArray(n==null?void 0:n.messages))return[];const o=fl(n.messages);if(o.length===0)return o;const r=o[o.length-1],m=s!=null&&s.content?pt(s.content):null;return[...o.slice(0,-1),{...r,assistantBlocks:m??r.assistantBlocks}]},[n,s]);if(j.useEffect(()=>{i.length>0?a(i[i.length-1]):a(null)},[n,s]),!n||typeof n!="object")return e.jsx("div",{className:w.emptyWrap,children:e.jsx(we,{description:p("ui.context.noData")})});const u=[];Array.isArray(n.tools)&&n.tools.length>0&&u.push({key:"tools",title:e.jsxs(e.Fragment,{children:[p("ui.context.tools")," ",e.jsx(he,{doc:"ToolsFirst"})]}),items:n.tools.map((o,r)=>({id:`tool__${r}`,label:(o==null?void 0:o.name)||`Tool ${r}`,blocks:pl(o)}))});const g=ml(n.system);if(g!=null&&u.push({key:"system",title:p("ui.context.systemPrompt"),items:[{id:"system__0",label:p("ui.context.systemPrompt"),blocks:g}]}),i.length>0){const o=x=>({...x,label:p("ui.context.historyTurnNoTime",{n:x.turnIndex+1}),time:x.timestamp?gt(x.timestamp):null,sublabel:x.preview||void 0}),r=x=>({...x,label:p("ui.context.currentTurn"),sublabel:x.preview||void 0}),m=i.slice(0,-1).map(o),v=r(i[i.length-1]);u.push({key:"messages",title:p("ui.context.messages"),historyItems:m.length>0?m:void 0,items:[v]})}if(u.length===0)return e.jsx("div",{className:w.emptyWrap,children:e.jsx(we,{description:p("ui.context.noFields")})});const l=t!=null&&t.isTurn?i.find(o=>o.id===t.id)??null:t,h=new Map;return u.forEach(o=>{(o.historyItems||[]).forEach(r=>h.set(r.id,r)),o.items.forEach(r=>h.set(r.id,r))}),e.jsxs("div",{className:w.root,children:[e.jsx("div",{ref:c,className:w.sidebar,children:u.map(o=>e.jsx(Cl,{sectionKey:o.key,title:o.title,items:o.items,historyItems:o.historyItems,selectedId:l==null?void 0:l.id,onSelect:r=>a(r),onSelectById:r=>{const m=h.get(r);m&&a(m)},sidebarRef:c},o.key))}),e.jsx("div",{className:w.content,children:l==null?e.jsx("div",{className:w.contentEmpty,children:e.jsx(hl,{type:"secondary",children:p("ui.context.selectPrompt")})}):e.jsx("div",{className:w.contentInner,children:l.isTurn?e.jsx(jl,{turn:l}):e.jsxs(e.Fragment,{children:[l.role&&e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w[`role_${l.role}`]||""}`,children:l.role}),e.jsx("span",{className:w.roleLabel,children:l.label})]}),e.jsx(Ze,{blocks:l.blocks})]})},l.id)})]})}const Nl="_container_1yyka_1",_l="_emptyState_1yyka_9",Sl="_urlSection_1yyka_16",kl="_urlLeft_1yyka_23",wl="_tokenStatsBox_1yyka_28",Tl="_tokenGrid_1yyka_35",Ml="_tokenRows_1yyka_45",El="_tokenRow_1yyka_45",Rl="_tokenRowBorder_1yyka_53",Il="_tokenLabel_1yyka_57",Ll="_tokenTd_1yyka_64",Pl="_tokenHitRate_1yyka_73",Al="_tokenHitRateLabel_1yyka_86",Bl="_urlText_1yyka_96",Ol="_metaText_1yyka_103",Dl="_headersContainer_1yyka_107",Fl="_headerRow_1yyka_111",$l="_headerKey_1yyka_117",Hl="_headerValue_1yyka_122",zl="_streamingBox_1yyka_127",Vl="_rawTextPre_1yyka_140",Ul="_tabContent_1yyka_153",ql="_bodyLabel_1yyka_161",Wl="_bodyHeader_1yyka_165",Kl="_diffSection_1yyka_172",Gl="_diffToggle_1yyka_176",Jl="_diffIcon_1yyka_182",Ql="_reminderSelect_1yyka_208",Yl="_diffHeaderRow_1yyka_227",Xl="_diffSpaceRight_1yyka_233",Zl="_reminderFilterWrapper_1yyka_237",eo="_reminderLabel_1yyka_243",to="_cacheTabContent_1yyka_249",so="_userPromptList_1yyka_254",ao="_userPromptItem_1yyka_260",no="_userPromptNavBtn_1yyka_271",io="_cacheContent_1yyka_282",lo="_cacheTokenBar_1yyka_289",oo="_cacheTokenWrite_1yyka_299",ro="_cacheTokenRead_1yyka_303",co="_cacheCopyIcon_1yyka_307",ho="_cacheScrollArea_1yyka_314",uo="_cacheSectionBlock_1yyka_320",mo="_cacheSectionHeader_1yyka_324",po="_cacheCollapseArrow_1yyka_336",go="_cachePre_1yyka_342",fo="_cacheHighlightSvg_1yyka_356",xo="_cachePreSystem_1yyka_365",_={container:Nl,emptyState:_l,urlSection:Sl,urlLeft:kl,tokenStatsBox:wl,tokenGrid:Tl,tokenRows:Ml,tokenRow:El,tokenRowBorder:Rl,tokenLabel:Il,tokenTd:Ll,tokenHitRate:Pl,tokenHitRateLabel:Al,urlText:Bl,metaText:Ol,headersContainer:Dl,headerRow:Fl,headerKey:$l,headerValue:Hl,streamingBox:zl,rawTextPre:Vl,tabContent:Ul,bodyLabel:ql,bodyHeader:Wl,diffSection:Kl,diffToggle:Gl,diffIcon:Jl,reminderSelect:Ql,diffHeaderRow:Yl,diffSpaceRight:Xl,reminderFilterWrapper:Zl,reminderLabel:eo,cacheTabContent:to,userPromptList:so,userPromptItem:ao,userPromptNavBtn:no,cacheContent:io,cacheTokenBar:lo,cacheTokenWrite:oo,cacheTokenRead:ro,cacheCopyIcon:co,cacheScrollArea:ho,cacheSectionBlock:uo,cacheSectionHeader:mo,cacheCollapseArrow:po,cachePre:go,cacheHighlightSvg:fo,cachePreSystem:xo},{Text:de,Paragraph:yo}=Xt;class vo extends q.Component{constructor(s){super(s),this.state={bodyViewMode:{request:"json",response:"json",diff:"json"},diffExpanded:!1,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null,cacheHighlightIdx:null,cacheHighlightFading:!1,cacheCollapsed:{tools:!1,system:!1,messages:!1}}}_cacheUnbindScrollFade(){this._cacheOnScrollFade&&this._cacheScrollEl&&(this._cacheScrollEl.removeEventListener("scroll",this._cacheOnScrollFade),this._cacheOnScrollFade=null)}_cacheClearAllTimers(){clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&this._cacheScrollEl&&(this._cacheScrollEl.removeEventListener("scrollend",this._cacheScrollEndHandler),this._cacheScrollEndHandler=null)}componentWillUnmount(){this._cacheClearAllTimers()}_cacheBindScrollFade(){this._cacheUnbindScrollFade();const s=this._cacheScrollEl;s&&(this._cacheOnScrollFade=()=>{clearTimeout(this._cacheAutoFadeTimer),this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade()},s.addEventListener("scroll",this._cacheOnScrollFade,{passive:!0}))}scrollToCacheMsg(s){if(this.state.cacheCollapsed.messages){this.setState(g=>({cacheCollapsed:{...g.cacheCollapsed,messages:!1}}),()=>this.scrollToCacheMsg(s));return}const t=this._cacheScrollEl;if(!t)return;const a=t.querySelector(`[data-msg-idx="${s}"]`);if(!a)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&t.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let c=!1,i=!1;const u=()=>{!c||!i||(this.setState({cacheHighlightIdx:s,cacheHighlightFading:!1}),this._cacheScrollSettleTimer=setTimeout(()=>this._cacheBindScrollFade(),200),this._cacheAutoFadeTimer=setTimeout(()=>{this.state.cacheHighlightIdx===s&&!this.state.cacheHighlightFading&&(this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade())},3e3))};this._cacheScrollEndHandler=()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),c=!0,u()},t.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),c=!0,u()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{i=!0,u()},500),a.scrollIntoView({behavior:"smooth",block:"center"})}shouldComponentUpdate(s,t){if(s.request!==this.props.request){const c=be(s.request);this.setState({diffExpanded:c&&!!s.expandDiff,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null}),this._cacheClearAllTimers()}const a=s.currentTab==="kv-cache-text";return s.request!==this.props.request||s.currentTab!==this.props.currentTab||s.onTabChange!==this.props.onTabChange||s.selectedIndex!==this.props.selectedIndex||s.expandDiff!==this.props.expandDiff||s.pendingCacheHighlight!==this.props.pendingCacheHighlight||t.bodyViewMode!==this.state.bodyViewMode||a&&t.cacheHighlightIdx!==this.state.cacheHighlightIdx||a&&t.cacheHighlightFading!==this.state.cacheHighlightFading||t.diffExpanded!==this.state.diffExpanded||t.requestHeadersExpanded!==this.state.requestHeadersExpanded||t.responseHeadersExpanded!==this.state.responseHeadersExpanded||t.reminderFilters!==this.state.reminderFilters||a&&t.cacheCollapsed!==this.state.cacheCollapsed}componentDidUpdate(s){const t=this.props.pendingCacheHighlight;t&&t!==s.pendingCacheHighlight&&setTimeout(()=>{var a,c;this.scrollToCacheMsg(t.msgIdx),(c=(a=this.props).onCacheHighlightDone)==null||c.call(a)},150)}toggleBodyViewMode(s){this.setState(t=>({bodyViewMode:{...t.bodyViewMode,[s]:t.bodyViewMode[s]==="json"?"text":"json"}}))}copyBody(s){var u;const{request:t}=this.props;if(!t)return;let a;if(s==="diff"?a=this._lastDiffResult:a=s==="request"?t.body:(u=t.response)==null?void 0:u.body,a==null)return;const c=typeof a=="object"?at(a):a,i=typeof c=="string"?c:JSON.stringify(c,null,2);navigator.clipboard.writeText(i).then(()=>J.success(p("ui.copySuccess")))}renderHeaders(s){return!s||Object.keys(s).length===0?e.jsx(de,{type:"secondary",children:p("ui.noHeaders")}):e.jsx("div",{className:_.headersContainer,children:Object.entries(s).map(([t,a])=>e.jsxs("div",{className:_.headerRow,children:[e.jsx(de,{code:!0,className:_.headerKey,children:t}),t==="authorization"&&e.jsx(he,{doc:"TranslateContextPollution"}),e.jsx(de,{type:"secondary",className:_.headerValue,children:String(a)})]},t))})}getRequestExpandNode(s,t){if(t!=="request"||!s||typeof s!="object")return;const{request:a,requests:c,selectedIndex:i}=this.props;if(!a)return;const u=c&&i!=null?c[i+1]:null,{type:g}=ze(a,u);let l=null;if(this.state.reminderFilters==="claudeMd"&&Array.isArray(s.messages)){l=new Set,l.add(s.messages);for(const r of s.messages){if(!r||typeof r!="object")continue;const m=r.content;if(typeof m=="string")Mt(m)&&l.add(r);else if(Array.isArray(m)){let v=!1;for(const x of m)x&&x.type==="text"&&Mt(x.text)&&(l.add(x),v=!0);v&&(l.add(r),l.add(m))}}}let h=null;if(this.state.reminderFilters==="skills"&&Array.isArray(s.messages)){h=new Set,h.add(s.messages);for(const r of s.messages){if(!r||typeof r!="object")continue;const m=r.content;if(typeof m=="string")Et(m)&&h.add(r);else if(Array.isArray(m)){let v=!1;for(const x of m)x&&x.type==="text"&&Et(x.text)&&(h.add(x),v=!0);v&&(h.add(r),h.add(m))}}}const o=l||h;if(g==="Preflight"){const r=new Set,m=v=>{v&&typeof v=="object"&&(r.add(v),Array.isArray(v)?v.forEach(m):Object.values(v).forEach(m))};return Array.isArray(s.messages)&&m(s.messages),Array.isArray(s.system)&&s.system.length>=3&&m(s.system[2]),(v,x,f)=>!!(v<2||r.has(x)||o&&o.has(x)||v===1&&f==="system")}if(g==="MainAgent"&&Array.isArray(s.messages)&&s.messages.length===1){const r=s.messages[0],m=r&&Array.isArray(r.content)?r.content:null,v=m&&m.length>0?m[m.length-1]:null,x=new Set,f=y=>{y&&typeof y=="object"&&(x.add(y),Array.isArray(y)?y.forEach(f):Object.values(y).forEach(f))};return v&&f(v),x.add(s.messages),r&&typeof r=="object"&&x.add(r),m&&x.add(m),(y,C,S)=>!!(y<2||x.has(C)||o&&o.has(C))}if(o)return(r,m,v)=>!!(r<2||o.has(m))}renderBody(s,t){const{bodyViewMode:a}=this.state;if(s==null)return e.jsx(de,{type:"secondary",children:p("ui.noBody")});if(typeof s=="string"&&s.includes("Streaming Response"))return e.jsx("div",{className:_.streamingBox,children:e.jsx(de,{type:"secondary",children:p("ui.streamingResponse")})});const c=typeof s=="object"?at(s):s,i=a[t]==="json",u=this.getRequestExpandNode(c,t);return e.jsx("div",{children:i?e.jsx(Xe,{data:c,defaultExpand:t==="response"?"all":"root",expandNode:u}):e.jsx("pre",{className:_.rawTextPre,children:typeof c=="string"?c:JSON.stringify(c,null,2)})})}getPrevMainAgentRequest(){const{requests:s,selectedIndex:t}=this.props;if(!s||t==null)return null;for(let a=t-1;a>=0;a--)if(be(s[a])){const c=s[a];return c._slimmed?Rt(c,this.props.allRequests||s):c}return null}computeDiff(s,t){if(s==null||t==null||typeof s!="object"||typeof t!="object")return null;const a={},c=new Set([...Object.keys(s),...Object.keys(t)]);for(const i of c)if(!i.startsWith("_"))if(!(i in s))a[i]=t[i];else if(i in t){const u=JSON.stringify(s[i]),g=JSON.stringify(t[i]);u!==g&&(i==="messages"&&Array.isArray(s[i])&&Array.isArray(t[i])&&t[i].length>s[i].length?a[i]=t[i].slice(s[i].length):a[i]=t[i])}else continue;return Object.keys(a).length?a:null}render(){var m,v,x;let{request:s,currentTab:t,onTabChange:a}=this.props;if(!s)return e.jsx("div",{className:_.emptyState,children:e.jsx(we,{description:"选择一个请求查看详情"})});s._slimmed&&(s=Rt(s,this.props.allRequests||this.props.requests));const c=new Date(s.timestamp).toLocaleString("zh-CN"),i=s.response&&s.response.status<400;let u=null;if(be(s)){const f=this.getPrevMainAgentRequest();if(f){const y=JSON.stringify(s.body).length,C=JSON.stringify(f.body).length;if(y<C)u=e.jsxs("div",{className:_.diffSection,children:[e.jsxs(de,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(N=>({diffExpanded:!N.diffExpanded})),children:["Body Diff JSON ",e.jsx(he,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Te,{className:_.diffIcon}):e.jsx(Me,{className:_.diffIcon})]}),this.state.diffExpanded&&e.jsx(de,{type:"secondary",children:p("ui.diffSessionChanged")})]});else{const N=at(this.computeDiff(f.body,s.body));N&&(this._lastDiffResult=N,u=e.jsxs("div",{className:_.diffSection,children:[e.jsxs("div",{className:_.diffHeaderRow,children:[e.jsxs(de,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(b=>({diffExpanded:!b.diffExpanded})),children:["Body Diff JSON ",e.jsx(he,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Te,{className:_.diffIcon}):e.jsx(Me,{className:_.diffIcon})]}),this.state.diffExpanded&&e.jsxs(Fe,{size:"small",className:_.diffSpaceRight,children:[e.jsx(F,{size:"small",icon:this.state.bodyViewMode.diff==="json"?e.jsx(Ke,{}):e.jsx(Ge,{}),onClick:()=>this.toggleBodyViewMode("diff"),children:this.state.bodyViewMode.diff==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(De,{}),onClick:()=>this.copyBody("diff"),children:p("ui.copy")})]})]}),this.state.diffExpanded&&e.jsx(e.Fragment,{children:this.state.bodyViewMode.diff==="json"?e.jsx(Xe,{data:N,defaultExpand:"all"}):e.jsx("pre",{className:_.rawTextPre,children:JSON.stringify(N,null,2)})})]}))}}}const g=pa(s.body),l=ga(s.body),h=[{key:"request",label:"Request",children:e.jsxs("div",{className:_.tabContent,children:[e.jsxs("div",{className:_.diffSection,children:[e.jsxs(de,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(f=>({requestHeadersExpanded:!f.requestHeadersExpanded})),children:["Headers ",this.state.requestHeadersExpanded?e.jsx(Te,{className:_.diffIcon}):e.jsx(Me,{className:_.diffIcon})]}),this.state.requestHeadersExpanded&&this.renderHeaders(s.headers)]}),u,e.jsxs("div",{children:[e.jsxs("div",{className:_.bodyHeader,children:[e.jsxs(de,{strong:!0,className:_.bodyLabel,children:["Body",e.jsx(he,{doc:"BodyFields"})]}),e.jsxs(Fe,{size:"small",children:[(g||l)&&e.jsxs("span",{className:_.reminderFilterWrapper,children:[e.jsx("span",{className:_.reminderLabel,children:"system-reminder:"}),e.jsx(qe,{size:"small",className:_.reminderSelect,placeholder:"filter",value:this.state.reminderFilters||void 0,onChange:f=>this.setState({reminderFilters:f||null}),options:[{label:"CLAUDE.md",value:"claudeMd",disabled:!g},{label:"Skills",value:"skills",disabled:!l}],popupMatchSelectWidth:!1,allowClear:!0})]}),e.jsx(F,{size:"small",icon:this.state.bodyViewMode.request==="json"?e.jsx(Ke,{}):e.jsx(Ge,{}),onClick:()=>this.toggleBodyViewMode("request"),children:this.state.bodyViewMode.request==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(De,{}),onClick:()=>this.copyBody("request"),children:p("ui.copy")})]})]}),this.renderBody(s.body,"request")]})]})},{key:"response",label:"Response",children:e.jsx("div",{className:_.tabContent,children:s.response?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:_.diffSection,children:[e.jsxs(de,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(f=>({responseHeadersExpanded:!f.responseHeadersExpanded})),children:["Headers ",this.state.responseHeadersExpanded?e.jsx(Te,{className:_.diffIcon}):e.jsx(Me,{className:_.diffIcon})]}),this.state.responseHeadersExpanded&&this.renderHeaders(s.response.headers)]}),e.jsxs("div",{children:[e.jsxs("div",{className:_.bodyHeader,children:[e.jsxs(de,{strong:!0,className:_.bodyLabel,children:["Body",e.jsx(he,{doc:"ResponseFields"})]}),e.jsxs(Fe,{size:"small",children:[e.jsx(F,{size:"small",icon:this.state.bodyViewMode.response==="json"?e.jsx(Ke,{}):e.jsx(Ge,{}),onClick:()=>this.toggleBodyViewMode("response"),children:this.state.bodyViewMode.response==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(De,{}),onClick:()=>this.copyBody("response"),children:p("ui.copy")})]})]}),this.renderBody(s.response.body,"response")]})]}):e.jsx(we,{description:p("ui.responseNotCaptured")})})},{key:"kv-cache-text",label:e.jsxs("span",{children:["KV-Cache-Text ",e.jsx(he,{doc:"KVCacheContent"})]}),children:e.jsx("div",{className:`${_.tabContent} ${_.cacheTabContent}`,children:(()=>{const f=Kt([s]),y=s.timestamp+"|"+s.url;if(f&&(f.cacheCreateTokens>0||f.cacheReadTokens>0)&&(this._lastCachedTokensKey=y,this._lastCachedTokens={cacheCreateTokens:f.cacheCreateTokens,cacheReadTokens:f.cacheReadTokens}),!f||f.system.length===0&&f.messages.length===0&&f.tools.length===0)return e.jsx(we,{description:p("ui.noCachedContent"),image:we.PRESENTED_IMAGE_SIMPLE});const C=()=>{const b=[];return f.tools.length>0&&(b.push(`=== ${p("ui.tools")} ===`),f.tools.forEach(T=>b.push(T))),f.system.length>0&&(b.push(`
|
|
31
|
+
`),s.push({type:"markdown",text:c});const i=(n==null?void 0:n.input_schema)||(n==null?void 0:n.parameters)||null;return i&&s.push({type:"json",label:"Parameters",data:i}),s}function fl(n){var s;if(typeof n=="string")return n.slice(0,60).replace(/\n/g," ");if(Array.isArray(n)){for(const t of n)if((t==null?void 0:t.type)==="text"&&((s=t.text)!=null&&s.trim()))return t.text.trim().slice(0,60).replace(/\n/g," ")}return""}function xl(n){var a;const s=[];let t=0;for(;t<n.length;){const c=n[t];if((c==null?void 0:c.role)!=="user"){t++;continue}const i=((a=n[t+1])==null?void 0:a.role)==="assistant"?n[t+1]:null;s.push({id:`turn__${t}`,isTurn:!0,turnIndex:s.length,timestamp:c._timestamp||null,assistantTimestamp:(i==null?void 0:i._timestamp)||null,userBlocks:pt(c==null?void 0:c.content),assistantBlocks:i?pt(i.content):null,preview:fl(c==null?void 0:c.content)}),t+=i?2:1}return s}function gt(n){try{return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return null}}function yl({text:n,compact:s}){const t=Zt(n);return s?e.jsx("div",{className:w.textBlockCompact,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:t}})}):e.jsxs("div",{className:w.textBlock,children:[e.jsx("div",{className:w.textBlockBar,children:e.jsx("span",{className:`${w.blockTag} ${w.blockTagText}`,children:"text"})}),e.jsx("div",{className:`chat-md ${w.textBlockBody}`,dangerouslySetInnerHTML:{__html:t}})]})}function vl({block:n}){const[s,t]=j.useState(!0),a=n.text.length>60?n.text.slice(0,60).replace(/\n/g," ")+"…":n.text.replace(/\n/g," ");return e.jsxs("div",{className:w.thinkingBlock,children:[e.jsxs("div",{className:w.thinkingHeader,onClick:()=>t(c=>!c),children:[s?e.jsx(Te,{className:w.arrow}):e.jsx(Me,{className:w.arrow}),e.jsx("span",{className:`${w.blockTag} ${w.blockTagThinking}`,children:"thinking"}),!s&&e.jsx("span",{className:w.thinkingPreview,children:a})]}),s&&e.jsx("div",{className:w.thinkingBody,children:e.jsx("div",{className:`chat-md ${w.markdownBody}`,dangerouslySetInnerHTML:{__html:Zt(n.text)}})})]})}function Ze({blocks:n,compact:s}){return!n||n.length===0?null:e.jsx(e.Fragment,{children:n.map((t,a)=>e.jsx(jl,{block:t,compact:s},a))})}function jl({block:n,compact:s}){var t;return n.type==="separator"?e.jsx("hr",{className:w.blockSeparator}):n.type==="markdown"?(t=n.text)!=null&&t.trim()?e.jsx(yl,{text:n.text,compact:s}):null:n.type==="thinking"?e.jsx(vl,{block:n}):n.type==="tool_use"?e.jsxs("div",{className:w.toolBlock,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:w.blockTag,children:"tool_use"}),e.jsx("span",{className:w.toolName,children:n.name}),n.id&&e.jsx("span",{className:w.toolId,children:n.id})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(Xe,{data:n.input,defaultExpand:"root"})})]}):n.type==="tool_result"?e.jsxs("div",{className:`${w.toolBlock} ${n.is_error?w.toolBlockError:w.toolBlockResult}`,children:[e.jsxs("div",{className:w.toolBlockHeader,children:[e.jsx("span",{className:`${w.blockTag} ${n.is_error?w.blockTagError:w.blockTagResult}`,children:"tool_result"}),n.tool_use_id&&e.jsx("span",{className:w.toolId,children:n.tool_use_id}),n.is_error&&e.jsx("span",{className:w.errorLabel,children:"error"})]}),e.jsx("div",{className:w.toolBlockBody,children:e.jsx(Ze,{blocks:n.content,compact:!0})})]}):n.type==="json"?e.jsxs("div",{className:w.jsonBlock,children:[n.label&&e.jsx("div",{className:w.jsonBlockLabel,children:n.label}),e.jsx(Xe,{data:n.data,defaultExpand:"root"})]}):null}function Cl({turn:n}){const s=n.timestamp?gt(n.timestamp):null,t=n.assistantTimestamp?gt(n.assistantTimestamp):null;return e.jsxs("div",{children:[e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_user}`,children:"user"}),e.jsx("span",{className:w.roleLabel,children:`Turn ${n.turnIndex+1}`}),s&&e.jsx("span",{className:w.contentTime,children:s})]}),e.jsx(Ze,{blocks:n.userBlocks}),n.assistantBlocks&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:w.turnDivider}),e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w.role_assistant}`,children:"assistant"}),t&&e.jsx("span",{className:w.contentTime,children:t})]}),e.jsx(Ze,{blocks:n.assistantBlocks})]})]})}function bl({sectionKey:n,title:s,items:t,historyItems:a=[],onSelect:c,onSelectById:i,selectedId:u,sidebarRef:g}){const[l,h]=j.useState(n!=="tools"),[o,r]=j.useState(!1),m=t.length+a.length,v=`${n}__history_toggle`;function x(C){var N;const S=(N=g.current)==null?void 0:N.querySelector(`[data-context-sidebar-control="${C}"]`);S&&(S.focus(),S.scrollIntoView({block:"nearest"}))}function f(C,S){var T;const N=Array.from(((T=g.current)==null?void 0:T.querySelectorAll("[data-context-sidebar-control]"))||[]).map(R=>R.dataset.contextSidebarControl).filter(Boolean),b=ui({currentId:S,visibleIds:N,key:C.key});b&&(C.preventDefault(),typeof window<"u"&&window.requestAnimationFrame(()=>{var B;x(b);const R=(B=g.current)==null?void 0:B.querySelector(`[data-context-sidebar-control="${b}"]`);(R==null?void 0:R.dataset.controlType)==="item"&&i(b)}))}function y(C){const S=u===C.id;return e.jsxs("button",{type:"button",className:`${w.item} ${S?w.itemActive:""}`,onClick:()=>c(C),onKeyDown:N=>f(N,C.id),"aria-current":S?"true":void 0,"data-context-sidebar-control":C.id,"data-control-type":"item",children:[e.jsxs("div",{className:w.itemContent,children:[e.jsx("span",{className:w.itemLabel,children:C.label}),C.sublabel&&!S&&e.jsx("div",{className:w.itemSublabel,children:C.sublabel})]}),C.time&&e.jsx("span",{className:w.itemTime,children:C.time})]},C.id)}return e.jsxs("div",{className:w.section,children:[e.jsxs("button",{type:"button",className:w.sectionHeader,onClick:()=>h(C=>!C),"aria-expanded":l,children:[l?e.jsx(Te,{className:w.arrow}):e.jsx(Me,{className:w.arrow}),e.jsx("span",{className:w.sectionTitle,children:s}),e.jsx("span",{className:w.sectionCount,children:m})]}),l&&e.jsxs("div",{className:w.sectionBody,children:[a.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:w.historyToggle,onClick:()=>r(C=>!C),onKeyDown:C=>f(C,v),"aria-expanded":o,"data-context-sidebar-control":v,"data-control-type":"toggle",children:[o?e.jsx(Te,{className:w.arrow}):e.jsx(Me,{className:w.arrow}),e.jsxs("span",{className:w.historyToggleLabel,children:[p("ui.context.history")," (",a.length,")"]})]}),o&&a.map(y)]}),t.map(y)]})]})}function Nl({body:n,response:s}){const[t,a]=j.useState(null),c=j.useRef(null),i=j.useMemo(()=>{if(!Array.isArray(n==null?void 0:n.messages))return[];const o=xl(n.messages);if(o.length===0)return o;const r=o[o.length-1],m=s!=null&&s.content?pt(s.content):null;return[...o.slice(0,-1),{...r,assistantBlocks:m??r.assistantBlocks}]},[n,s]);if(j.useEffect(()=>{i.length>0?a(i[i.length-1]):a(null)},[n,s]),!n||typeof n!="object")return e.jsx("div",{className:w.emptyWrap,children:e.jsx(we,{description:p("ui.context.noData")})});const u=[];Array.isArray(n.tools)&&n.tools.length>0&&u.push({key:"tools",title:e.jsxs(e.Fragment,{children:[p("ui.context.tools")," ",e.jsx(he,{doc:"ToolsFirst"})]}),items:n.tools.map((o,r)=>({id:`tool__${r}`,label:(o==null?void 0:o.name)||`Tool ${r}`,blocks:gl(o)}))});const g=pl(n.system);if(g!=null&&u.push({key:"system",title:p("ui.context.systemPrompt"),items:[{id:"system__0",label:p("ui.context.systemPrompt"),blocks:g}]}),i.length>0){const o=x=>({...x,label:p("ui.context.historyTurnNoTime",{n:x.turnIndex+1}),time:x.timestamp?gt(x.timestamp):null,sublabel:x.preview||void 0}),r=x=>({...x,label:p("ui.context.currentTurn"),sublabel:x.preview||void 0}),m=i.slice(0,-1).map(o),v=r(i[i.length-1]);u.push({key:"messages",title:p("ui.context.messages"),historyItems:m.length>0?m:void 0,items:[v]})}if(u.length===0)return e.jsx("div",{className:w.emptyWrap,children:e.jsx(we,{description:p("ui.context.noFields")})});const l=t!=null&&t.isTurn?i.find(o=>o.id===t.id)??null:t,h=new Map;return u.forEach(o=>{(o.historyItems||[]).forEach(r=>h.set(r.id,r)),o.items.forEach(r=>h.set(r.id,r))}),e.jsxs("div",{className:w.root,children:[e.jsx("div",{ref:c,className:w.sidebar,children:u.map(o=>e.jsx(bl,{sectionKey:o.key,title:o.title,items:o.items,historyItems:o.historyItems,selectedId:l==null?void 0:l.id,onSelect:r=>a(r),onSelectById:r=>{const m=h.get(r);m&&a(m)},sidebarRef:c},o.key))}),e.jsx("div",{className:w.content,children:l==null?e.jsx("div",{className:w.contentEmpty,children:e.jsx(ul,{type:"secondary",children:p("ui.context.selectPrompt")})}):e.jsx("div",{className:w.contentInner,children:l.isTurn?e.jsx(Cl,{turn:l}):e.jsxs(e.Fragment,{children:[l.role&&e.jsxs("div",{className:w.roleHeader,children:[e.jsx("span",{className:`${w.roleBadge} ${w[`role_${l.role}`]||""}`,children:l.role}),e.jsx("span",{className:w.roleLabel,children:l.label})]}),e.jsx(Ze,{blocks:l.blocks})]})},l.id)})]})}const _l="_container_1yyka_1",Sl="_emptyState_1yyka_9",kl="_urlSection_1yyka_16",wl="_urlLeft_1yyka_23",Tl="_tokenStatsBox_1yyka_28",Ml="_tokenGrid_1yyka_35",El="_tokenRows_1yyka_45",Rl="_tokenRow_1yyka_45",Il="_tokenRowBorder_1yyka_53",Ll="_tokenLabel_1yyka_57",Pl="_tokenTd_1yyka_64",Al="_tokenHitRate_1yyka_73",Bl="_tokenHitRateLabel_1yyka_86",Ol="_urlText_1yyka_96",Dl="_metaText_1yyka_103",Fl="_headersContainer_1yyka_107",$l="_headerRow_1yyka_111",Hl="_headerKey_1yyka_117",zl="_headerValue_1yyka_122",Vl="_streamingBox_1yyka_127",Ul="_rawTextPre_1yyka_140",ql="_tabContent_1yyka_153",Wl="_bodyLabel_1yyka_161",Kl="_bodyHeader_1yyka_165",Gl="_diffSection_1yyka_172",Jl="_diffToggle_1yyka_176",Ql="_diffIcon_1yyka_182",Yl="_reminderSelect_1yyka_208",Xl="_diffHeaderRow_1yyka_227",Zl="_diffSpaceRight_1yyka_233",eo="_reminderFilterWrapper_1yyka_237",to="_reminderLabel_1yyka_243",so="_cacheTabContent_1yyka_249",ao="_userPromptList_1yyka_254",no="_userPromptItem_1yyka_260",io="_userPromptNavBtn_1yyka_271",lo="_cacheContent_1yyka_282",oo="_cacheTokenBar_1yyka_289",ro="_cacheTokenWrite_1yyka_299",co="_cacheTokenRead_1yyka_303",ho="_cacheCopyIcon_1yyka_307",uo="_cacheScrollArea_1yyka_314",mo="_cacheSectionBlock_1yyka_320",po="_cacheSectionHeader_1yyka_324",go="_cacheCollapseArrow_1yyka_336",fo="_cachePre_1yyka_342",xo="_cacheHighlightSvg_1yyka_356",yo="_cachePreSystem_1yyka_365",_={container:_l,emptyState:Sl,urlSection:kl,urlLeft:wl,tokenStatsBox:Tl,tokenGrid:Ml,tokenRows:El,tokenRow:Rl,tokenRowBorder:Il,tokenLabel:Ll,tokenTd:Pl,tokenHitRate:Al,tokenHitRateLabel:Bl,urlText:Ol,metaText:Dl,headersContainer:Fl,headerRow:$l,headerKey:Hl,headerValue:zl,streamingBox:Vl,rawTextPre:Ul,tabContent:ql,bodyLabel:Wl,bodyHeader:Kl,diffSection:Gl,diffToggle:Jl,diffIcon:Ql,reminderSelect:Yl,diffHeaderRow:Xl,diffSpaceRight:Zl,reminderFilterWrapper:eo,reminderLabel:to,cacheTabContent:so,userPromptList:ao,userPromptItem:no,userPromptNavBtn:io,cacheContent:lo,cacheTokenBar:oo,cacheTokenWrite:ro,cacheTokenRead:co,cacheCopyIcon:ho,cacheScrollArea:uo,cacheSectionBlock:mo,cacheSectionHeader:po,cacheCollapseArrow:go,cachePre:fo,cacheHighlightSvg:xo,cachePreSystem:yo},{Text:de,Paragraph:vo}=Xt;class jo extends q.Component{constructor(s){super(s),this.state={bodyViewMode:{request:"json",response:"json",diff:"json"},diffExpanded:!1,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null,cacheHighlightIdx:null,cacheHighlightFading:!1,cacheCollapsed:{tools:!1,system:!1,messages:!1}}}_cacheUnbindScrollFade(){this._cacheOnScrollFade&&this._cacheScrollEl&&(this._cacheScrollEl.removeEventListener("scroll",this._cacheOnScrollFade),this._cacheOnScrollFade=null)}_cacheClearAllTimers(){clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&this._cacheScrollEl&&(this._cacheScrollEl.removeEventListener("scrollend",this._cacheScrollEndHandler),this._cacheScrollEndHandler=null)}componentWillUnmount(){this._cacheClearAllTimers()}_cacheBindScrollFade(){this._cacheUnbindScrollFade();const s=this._cacheScrollEl;s&&(this._cacheOnScrollFade=()=>{clearTimeout(this._cacheAutoFadeTimer),this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade()},s.addEventListener("scroll",this._cacheOnScrollFade,{passive:!0}))}scrollToCacheMsg(s){if(this.state.cacheCollapsed.messages){this.setState(g=>({cacheCollapsed:{...g.cacheCollapsed,messages:!1}}),()=>this.scrollToCacheMsg(s));return}const t=this._cacheScrollEl;if(!t)return;const a=t.querySelector(`[data-msg-idx="${s}"]`);if(!a)return;clearTimeout(this._cacheScrollSettleTimer),clearTimeout(this._cacheFadeClearTimer),clearTimeout(this._cacheAutoFadeTimer),clearTimeout(this._cacheHighlightDelayTimer),this._cacheUnbindScrollFade(),this._cacheScrollEndHandler&&t.removeEventListener("scrollend",this._cacheScrollEndHandler),this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1});let c=!1,i=!1;const u=()=>{!c||!i||(this.setState({cacheHighlightIdx:s,cacheHighlightFading:!1}),this._cacheScrollSettleTimer=setTimeout(()=>this._cacheBindScrollFade(),200),this._cacheAutoFadeTimer=setTimeout(()=>{this.state.cacheHighlightIdx===s&&!this.state.cacheHighlightFading&&(this.setState({cacheHighlightFading:!0}),this._cacheFadeClearTimer=setTimeout(()=>{this.setState({cacheHighlightIdx:null,cacheHighlightFading:!1})},3e3),this._cacheUnbindScrollFade())},3e3))};this._cacheScrollEndHandler=()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),c=!0,u()},t.addEventListener("scrollend",this._cacheScrollEndHandler,{once:!0}),this._cacheScrollSettleTimer=setTimeout(()=>{t.removeEventListener("scrollend",this._cacheScrollEndHandler),c=!0,u()},800),this._cacheHighlightDelayTimer=setTimeout(()=>{i=!0,u()},500),a.scrollIntoView({behavior:"smooth",block:"center"})}shouldComponentUpdate(s,t){if(s.request!==this.props.request){const c=be(s.request);this.setState({diffExpanded:c&&!!s.expandDiff,requestHeadersExpanded:!1,responseHeadersExpanded:!1,reminderFilters:null}),this._cacheClearAllTimers()}const a=s.currentTab==="kv-cache-text";return s.request!==this.props.request||s.currentTab!==this.props.currentTab||s.onTabChange!==this.props.onTabChange||s.selectedIndex!==this.props.selectedIndex||s.expandDiff!==this.props.expandDiff||s.pendingCacheHighlight!==this.props.pendingCacheHighlight||t.bodyViewMode!==this.state.bodyViewMode||a&&t.cacheHighlightIdx!==this.state.cacheHighlightIdx||a&&t.cacheHighlightFading!==this.state.cacheHighlightFading||t.diffExpanded!==this.state.diffExpanded||t.requestHeadersExpanded!==this.state.requestHeadersExpanded||t.responseHeadersExpanded!==this.state.responseHeadersExpanded||t.reminderFilters!==this.state.reminderFilters||a&&t.cacheCollapsed!==this.state.cacheCollapsed}componentDidUpdate(s){const t=this.props.pendingCacheHighlight;t&&t!==s.pendingCacheHighlight&&setTimeout(()=>{var a,c;this.scrollToCacheMsg(t.msgIdx),(c=(a=this.props).onCacheHighlightDone)==null||c.call(a)},150)}toggleBodyViewMode(s){this.setState(t=>({bodyViewMode:{...t.bodyViewMode,[s]:t.bodyViewMode[s]==="json"?"text":"json"}}))}copyBody(s){var u;const{request:t}=this.props;if(!t)return;let a;if(s==="diff"?a=this._lastDiffResult:a=s==="request"?t.body:(u=t.response)==null?void 0:u.body,a==null)return;const c=typeof a=="object"?at(a):a,i=typeof c=="string"?c:JSON.stringify(c,null,2);navigator.clipboard.writeText(i).then(()=>J.success(p("ui.copySuccess")))}renderHeaders(s){return!s||Object.keys(s).length===0?e.jsx(de,{type:"secondary",children:p("ui.noHeaders")}):e.jsx("div",{className:_.headersContainer,children:Object.entries(s).map(([t,a])=>e.jsxs("div",{className:_.headerRow,children:[e.jsx(de,{code:!0,className:_.headerKey,children:t}),t==="authorization"&&e.jsx(he,{doc:"TranslateContextPollution"}),e.jsx(de,{type:"secondary",className:_.headerValue,children:String(a)})]},t))})}getRequestExpandNode(s,t){if(t!=="request"||!s||typeof s!="object")return;const{request:a,requests:c,selectedIndex:i}=this.props;if(!a)return;const u=c&&i!=null?c[i+1]:null,{type:g}=ze(a,u);let l=null;if(this.state.reminderFilters==="claudeMd"&&Array.isArray(s.messages)){l=new Set,l.add(s.messages);for(const r of s.messages){if(!r||typeof r!="object")continue;const m=r.content;if(typeof m=="string")Mt(m)&&l.add(r);else if(Array.isArray(m)){let v=!1;for(const x of m)x&&x.type==="text"&&Mt(x.text)&&(l.add(x),v=!0);v&&(l.add(r),l.add(m))}}}let h=null;if(this.state.reminderFilters==="skills"&&Array.isArray(s.messages)){h=new Set,h.add(s.messages);for(const r of s.messages){if(!r||typeof r!="object")continue;const m=r.content;if(typeof m=="string")Et(m)&&h.add(r);else if(Array.isArray(m)){let v=!1;for(const x of m)x&&x.type==="text"&&Et(x.text)&&(h.add(x),v=!0);v&&(h.add(r),h.add(m))}}}const o=l||h;if(g==="Preflight"){const r=new Set,m=v=>{v&&typeof v=="object"&&(r.add(v),Array.isArray(v)?v.forEach(m):Object.values(v).forEach(m))};return Array.isArray(s.messages)&&m(s.messages),Array.isArray(s.system)&&s.system.length>=3&&m(s.system[2]),(v,x,f)=>!!(v<2||r.has(x)||o&&o.has(x)||v===1&&f==="system")}if(g==="MainAgent"&&Array.isArray(s.messages)&&s.messages.length===1){const r=s.messages[0],m=r&&Array.isArray(r.content)?r.content:null,v=m&&m.length>0?m[m.length-1]:null,x=new Set,f=y=>{y&&typeof y=="object"&&(x.add(y),Array.isArray(y)?y.forEach(f):Object.values(y).forEach(f))};return v&&f(v),x.add(s.messages),r&&typeof r=="object"&&x.add(r),m&&x.add(m),(y,C,S)=>!!(y<2||x.has(C)||o&&o.has(C))}if(o)return(r,m,v)=>!!(r<2||o.has(m))}renderBody(s,t){const{bodyViewMode:a}=this.state;if(s==null)return e.jsx(de,{type:"secondary",children:p("ui.noBody")});if(typeof s=="string"&&s.includes("Streaming Response"))return e.jsx("div",{className:_.streamingBox,children:e.jsx(de,{type:"secondary",children:p("ui.streamingResponse")})});const c=typeof s=="object"?at(s):s,i=a[t]==="json",u=this.getRequestExpandNode(c,t);return e.jsx("div",{children:i?e.jsx(Xe,{data:c,defaultExpand:t==="response"?"all":"root",expandNode:u}):e.jsx("pre",{className:_.rawTextPre,children:typeof c=="string"?c:JSON.stringify(c,null,2)})})}getPrevMainAgentRequest(){const{requests:s,selectedIndex:t}=this.props;if(!s||t==null)return null;for(let a=t-1;a>=0;a--)if(be(s[a])){const c=s[a];return c._slimmed?Rt(c,this.props.allRequests||s):c}return null}computeDiff(s,t){if(s==null||t==null||typeof s!="object"||typeof t!="object")return null;const a={},c=new Set([...Object.keys(s),...Object.keys(t)]);for(const i of c)if(!i.startsWith("_"))if(!(i in s))a[i]=t[i];else if(i in t){const u=JSON.stringify(s[i]),g=JSON.stringify(t[i]);u!==g&&(i==="messages"&&Array.isArray(s[i])&&Array.isArray(t[i])&&t[i].length>s[i].length?a[i]=t[i].slice(s[i].length):a[i]=t[i])}else continue;return Object.keys(a).length?a:null}render(){var m,v,x;let{request:s,currentTab:t,onTabChange:a}=this.props;if(!s)return e.jsx("div",{className:_.emptyState,children:e.jsx(we,{description:"选择一个请求查看详情"})});s._slimmed&&(s=Rt(s,this.props.allRequests||this.props.requests));const c=new Date(s.timestamp).toLocaleString("zh-CN"),i=s.response&&s.response.status<400;let u=null;if(be(s)){const f=this.getPrevMainAgentRequest();if(f){const y=JSON.stringify(s.body).length,C=JSON.stringify(f.body).length;if(y<C)u=e.jsxs("div",{className:_.diffSection,children:[e.jsxs(de,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(N=>({diffExpanded:!N.diffExpanded})),children:["Body Diff JSON ",e.jsx(he,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Te,{className:_.diffIcon}):e.jsx(Me,{className:_.diffIcon})]}),this.state.diffExpanded&&e.jsx(de,{type:"secondary",children:p("ui.diffSessionChanged")})]});else{const N=at(this.computeDiff(f.body,s.body));N&&(this._lastDiffResult=N,u=e.jsxs("div",{className:_.diffSection,children:[e.jsxs("div",{className:_.diffHeaderRow,children:[e.jsxs(de,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(b=>({diffExpanded:!b.diffExpanded})),children:["Body Diff JSON ",e.jsx(he,{doc:"BodyDiffJSON"})," ",this.state.diffExpanded?e.jsx(Te,{className:_.diffIcon}):e.jsx(Me,{className:_.diffIcon})]}),this.state.diffExpanded&&e.jsxs(Fe,{size:"small",className:_.diffSpaceRight,children:[e.jsx(F,{size:"small",icon:this.state.bodyViewMode.diff==="json"?e.jsx(Ke,{}):e.jsx(Ge,{}),onClick:()=>this.toggleBodyViewMode("diff"),children:this.state.bodyViewMode.diff==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(De,{}),onClick:()=>this.copyBody("diff"),children:p("ui.copy")})]})]}),this.state.diffExpanded&&e.jsx(e.Fragment,{children:this.state.bodyViewMode.diff==="json"?e.jsx(Xe,{data:N,defaultExpand:"all"}):e.jsx("pre",{className:_.rawTextPre,children:JSON.stringify(N,null,2)})})]}))}}}const g=ga(s.body),l=fa(s.body),h=[{key:"request",label:"Request",children:e.jsxs("div",{className:_.tabContent,children:[e.jsxs("div",{className:_.diffSection,children:[e.jsxs(de,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(f=>({requestHeadersExpanded:!f.requestHeadersExpanded})),children:["Headers ",this.state.requestHeadersExpanded?e.jsx(Te,{className:_.diffIcon}):e.jsx(Me,{className:_.diffIcon})]}),this.state.requestHeadersExpanded&&this.renderHeaders(s.headers)]}),u,e.jsxs("div",{children:[e.jsxs("div",{className:_.bodyHeader,children:[e.jsxs(de,{strong:!0,className:_.bodyLabel,children:["Body",e.jsx(he,{doc:"BodyFields"})]}),e.jsxs(Fe,{size:"small",children:[(g||l)&&e.jsxs("span",{className:_.reminderFilterWrapper,children:[e.jsx("span",{className:_.reminderLabel,children:"system-reminder:"}),e.jsx(qe,{size:"small",className:_.reminderSelect,placeholder:"filter",value:this.state.reminderFilters||void 0,onChange:f=>this.setState({reminderFilters:f||null}),options:[{label:"CLAUDE.md",value:"claudeMd",disabled:!g},{label:"Skills",value:"skills",disabled:!l}],popupMatchSelectWidth:!1,allowClear:!0})]}),e.jsx(F,{size:"small",icon:this.state.bodyViewMode.request==="json"?e.jsx(Ke,{}):e.jsx(Ge,{}),onClick:()=>this.toggleBodyViewMode("request"),children:this.state.bodyViewMode.request==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(De,{}),onClick:()=>this.copyBody("request"),children:p("ui.copy")})]})]}),this.renderBody(s.body,"request")]})]})},{key:"response",label:"Response",children:e.jsx("div",{className:_.tabContent,children:s.response?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:_.diffSection,children:[e.jsxs(de,{strong:!0,className:_.diffToggle,onClick:()=>this.setState(f=>({responseHeadersExpanded:!f.responseHeadersExpanded})),children:["Headers ",this.state.responseHeadersExpanded?e.jsx(Te,{className:_.diffIcon}):e.jsx(Me,{className:_.diffIcon})]}),this.state.responseHeadersExpanded&&this.renderHeaders(s.response.headers)]}),e.jsxs("div",{children:[e.jsxs("div",{className:_.bodyHeader,children:[e.jsxs(de,{strong:!0,className:_.bodyLabel,children:["Body",e.jsx(he,{doc:"ResponseFields"})]}),e.jsxs(Fe,{size:"small",children:[e.jsx(F,{size:"small",icon:this.state.bodyViewMode.response==="json"?e.jsx(Ke,{}):e.jsx(Ge,{}),onClick:()=>this.toggleBodyViewMode("response"),children:this.state.bodyViewMode.response==="json"?"Text":"JSON"}),e.jsx(F,{size:"small",icon:e.jsx(De,{}),onClick:()=>this.copyBody("response"),children:p("ui.copy")})]})]}),this.renderBody(s.response.body,"response")]})]}):e.jsx(we,{description:p("ui.responseNotCaptured")})})},{key:"kv-cache-text",label:e.jsxs("span",{children:["KV-Cache-Text ",e.jsx(he,{doc:"KVCacheContent"})]}),children:e.jsx("div",{className:`${_.tabContent} ${_.cacheTabContent}`,children:(()=>{const f=Kt([s]),y=s.timestamp+"|"+s.url;if(f&&(f.cacheCreateTokens>0||f.cacheReadTokens>0)&&(this._lastCachedTokensKey=y,this._lastCachedTokens={cacheCreateTokens:f.cacheCreateTokens,cacheReadTokens:f.cacheReadTokens}),!f||f.system.length===0&&f.messages.length===0&&f.tools.length===0)return e.jsx(we,{description:p("ui.noCachedContent"),image:we.PRESENTED_IMAGE_SIMPLE});const C=()=>{const b=[];return f.tools.length>0&&(b.push(`=== ${p("ui.tools")} ===`),f.tools.forEach(T=>b.push(T))),f.system.length>0&&(b.push(`
|
|
32
32
|
=== ${p("ui.systemPrompt")} ===`),f.system.forEach(T=>b.push(T))),f.messages.length>0&&(b.push(`
|
|
33
33
|
=== ${p("ui.messages")} ===`),f.messages.forEach(T=>b.push(T))),b.join(`
|
|
34
34
|
|
|
35
|
-
`)},S=f.messages.map((b,T)=>({text:b,msgIdx:T})).filter(({text:b})=>b.startsWith("[user]")).map(({text:b,msgIdx:T})=>{const R=b.replace(/^\[user\]\s*/,"").trim();return!R||He(R)?{cleaned:"",msgIdx:T}:{cleaned:Qe.parseSegments(R).filter(M=>M.type==="text").map(M=>M.content.trim()).filter(M=>M&&!He(M)).join(" ").trim(),msgIdx:T}}).filter(({cleaned:b})=>!(!b||/Implement the following plan:/i.test(b))),N=S.length>0?e.jsx("div",{className:_.userPromptList,children:S.map(({cleaned:b,msgIdx:T})=>e.jsx("div",{className:_.userPromptItem,onMouseEnter:R=>{R.currentTarget.style.background="rgba(22,104,220,0.2)",R.currentTarget.style.color="#fff"},onMouseLeave:R=>{R.currentTarget.style.background="",R.currentTarget.style.color="#ccc"},onClick:()=>this.scrollToCacheMsg(T),children:b},T))}):null;return e.jsxs("div",{className:_.cacheContent,children:[(()=>{const T=f.cacheCreateTokens>0||f.cacheReadTokens>0?f:this._lastCachedTokensKey===y?this._lastCachedTokens:null;return T||N?e.jsxs("div",{className:_.cacheTokenBar,children:[T&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:_.cacheTokenWrite,children:["write ",W(T.cacheCreateTokens)]})," / ",e.jsxs("span",{className:_.cacheTokenRead,children:["read ",W(T.cacheReadTokens)]}),e.jsx(Yt,{title:p("ui.copyAllCacheText"),children:e.jsx(De,{className:_.cacheCopyIcon,onClick:()=>{navigator.clipboard.writeText(C()).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})}})})]}),N&&e.jsx(Oe,{content:N,trigger:"hover",placement:"left",children:e.jsx("span",{className:_.userPromptNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:_.cacheScrollArea,ref:b=>{this._cacheScrollEl=b},children:[f.tools.length>0&&e.jsxs("div",{className:_.cacheSectionBlock,children:[e.jsxs("div",{className:_.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,tools:!b.cacheCollapsed.tools}})),children:[e.jsx("span",{className:_.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.tools?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.tools")," (",f.tools.length,")"]}),!this.state.cacheCollapsed.tools&&f.tools.map((b,T)=>e.jsx("pre",{className:_.cachePre,children:b},T))]}),f.system.length>0&&e.jsxs("div",{className:_.cacheSectionBlock,children:[e.jsxs("div",{className:_.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,system:!b.cacheCollapsed.system}})),children:[e.jsx("span",{className:_.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.system?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.systemPrompt")," (",f.system.length,")"]}),!this.state.cacheCollapsed.system&&f.system.map((b,T)=>e.jsx("pre",{className:_.cachePreSystem,children:b},T))]}),f.messages.length>0&&e.jsxs("div",{className:_.cacheSectionBlock,children:[e.jsxs("div",{className:_.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,messages:!b.cacheCollapsed.messages}})),children:[e.jsx("span",{className:_.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.messages?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.messages")," (",f.messages.length,")"]}),!this.state.cacheCollapsed.messages&&f.messages.map((b,T)=>{const R=T===this.state.cacheHighlightIdx,B=R?this.state.cacheHighlightFading?{boxShadow:"0 0 10px rgba(22,104,220,0)",transition:"box-shadow 3s ease-out",position:"relative"}:{boxShadow:"0 0 10px rgba(22,104,220,0.6)",transition:"box-shadow 0.2s ease-in",position:"relative"}:{};return e.jsxs("pre",{"data-msg-idx":T,className:_.cachePre,style:B,children:[R&&e.jsx("svg",{className:_.cacheHighlightSvg,style:{opacity:this.state.cacheHighlightFading?0:1,transition:this.state.cacheHighlightFading?"opacity 3s ease-out":void 0},preserveAspectRatio:"none",children:e.jsx("rect",{x:"0.5",y:"0.5",width:"calc(100% - 1px)",height:"calc(100% - 1px)",rx:"4",ry:"4",fill:"none",stroke:"#1668dc",strokeWidth:"1",strokeDasharray:"6 4",children:e.jsx("animate",{attributeName:"stroke-dashoffset",from:"0",to:"-100",dur:"4s",repeatCount:"indefinite"})})}),b]},T)})]})]})]})})()})},{key:"context",label:"Context",children:e.jsx("div",{className:`${_.tabContent} ${_.cacheTabContent}`,children:e.jsx(
|
|
35
|
+
`)},S=f.messages.map((b,T)=>({text:b,msgIdx:T})).filter(({text:b})=>b.startsWith("[user]")).map(({text:b,msgIdx:T})=>{const R=b.replace(/^\[user\]\s*/,"").trim();return!R||He(R)?{cleaned:"",msgIdx:T}:{cleaned:Qe.parseSegments(R).filter(M=>M.type==="text").map(M=>M.content.trim()).filter(M=>M&&!He(M)).join(" ").trim(),msgIdx:T}}).filter(({cleaned:b})=>!(!b||/Implement the following plan:/i.test(b))),N=S.length>0?e.jsx("div",{className:_.userPromptList,children:S.map(({cleaned:b,msgIdx:T})=>e.jsx("div",{className:_.userPromptItem,onMouseEnter:R=>{R.currentTarget.style.background="rgba(22,104,220,0.2)",R.currentTarget.style.color="#fff"},onMouseLeave:R=>{R.currentTarget.style.background="",R.currentTarget.style.color="#ccc"},onClick:()=>this.scrollToCacheMsg(T),children:b},T))}):null;return e.jsxs("div",{className:_.cacheContent,children:[(()=>{const T=f.cacheCreateTokens>0||f.cacheReadTokens>0?f:this._lastCachedTokensKey===y?this._lastCachedTokens:null;return T||N?e.jsxs("div",{className:_.cacheTokenBar,children:[T&&e.jsxs(e.Fragment,{children:[p("ui.tokens"),": ",e.jsxs("span",{className:_.cacheTokenWrite,children:["write ",W(T.cacheCreateTokens)]})," / ",e.jsxs("span",{className:_.cacheTokenRead,children:["read ",W(T.cacheReadTokens)]}),e.jsx(Yt,{title:p("ui.copyAllCacheText"),children:e.jsx(De,{className:_.cacheCopyIcon,onClick:()=>{navigator.clipboard.writeText(C()).then(()=>{J.success(p("ui.copied"))}).catch(()=>{})}})})]}),N&&e.jsx(Oe,{content:N,trigger:"hover",placement:"left",children:e.jsx("span",{className:_.userPromptNavBtn,children:p("ui.userPromptNav")})})]}):null})(),e.jsxs("div",{className:_.cacheScrollArea,ref:b=>{this._cacheScrollEl=b},children:[f.tools.length>0&&e.jsxs("div",{className:_.cacheSectionBlock,children:[e.jsxs("div",{className:_.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,tools:!b.cacheCollapsed.tools}})),children:[e.jsx("span",{className:_.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.tools?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.tools")," (",f.tools.length,")"]}),!this.state.cacheCollapsed.tools&&f.tools.map((b,T)=>e.jsx("pre",{className:_.cachePre,children:b},T))]}),f.system.length>0&&e.jsxs("div",{className:_.cacheSectionBlock,children:[e.jsxs("div",{className:_.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,system:!b.cacheCollapsed.system}})),children:[e.jsx("span",{className:_.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.system?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.systemPrompt")," (",f.system.length,")"]}),!this.state.cacheCollapsed.system&&f.system.map((b,T)=>e.jsx("pre",{className:_.cachePreSystem,children:b},T))]}),f.messages.length>0&&e.jsxs("div",{className:_.cacheSectionBlock,children:[e.jsxs("div",{className:_.cacheSectionHeader,onClick:()=>this.setState(b=>({cacheCollapsed:{...b.cacheCollapsed,messages:!b.cacheCollapsed.messages}})),children:[e.jsx("span",{className:_.cacheCollapseArrow,style:{transform:this.state.cacheCollapsed.messages?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),p("ui.messages")," (",f.messages.length,")"]}),!this.state.cacheCollapsed.messages&&f.messages.map((b,T)=>{const R=T===this.state.cacheHighlightIdx,B=R?this.state.cacheHighlightFading?{boxShadow:"0 0 10px rgba(22,104,220,0)",transition:"box-shadow 3s ease-out",position:"relative"}:{boxShadow:"0 0 10px rgba(22,104,220,0.6)",transition:"box-shadow 0.2s ease-in",position:"relative"}:{};return e.jsxs("pre",{"data-msg-idx":T,className:_.cachePre,style:B,children:[R&&e.jsx("svg",{className:_.cacheHighlightSvg,style:{opacity:this.state.cacheHighlightFading?0:1,transition:this.state.cacheHighlightFading?"opacity 3s ease-out":void 0},preserveAspectRatio:"none",children:e.jsx("rect",{x:"0.5",y:"0.5",width:"calc(100% - 1px)",height:"calc(100% - 1px)",rx:"4",ry:"4",fill:"none",stroke:"#1668dc",strokeWidth:"1",strokeDasharray:"6 4",children:e.jsx("animate",{attributeName:"stroke-dashoffset",from:"0",to:"-100",dur:"4s",repeatCount:"indefinite"})})}),b]},T)})]})]})]})})()})},{key:"context",label:"Context",children:e.jsx("div",{className:`${_.tabContent} ${_.cacheTabContent}`,children:e.jsx(Nl,{body:s.body,response:(m=s.response)==null?void 0:m.body})})}],o=(x=(v=s.response)==null?void 0:v.body)==null?void 0:x.usage,r=o?(()=>{const f=o.input_tokens||0,y=o.output_tokens||0,C=o.cache_creation_input_tokens||0,S=o.cache_read_input_tokens||0,N=f+C+S,b=N>0?(S/N*100).toFixed(1):"0.0";return{input:f,output:y,cacheCreate:C,cacheRead:S,hitRate:b}})():null;return e.jsxs("div",{className:_.container,children:[e.jsxs("div",{className:_.urlSection,children:[e.jsxs("div",{className:_.urlLeft,children:[e.jsx(vo,{className:_.urlText,ellipsis:{rows:2,expandable:!0},children:s.url}),e.jsxs(Fe,{size:"small",wrap:!0,children:[e.jsx(fe,{color:s.method==="POST"?"blue":"green",children:s.method}),e.jsxs(de,{type:"secondary",className:_.metaText,children:["🕐 ",c]}),s.duration&&e.jsxs(de,{type:"secondary",className:_.metaText,children:["⏱️ ",s.duration,"ms"]}),s.response&&e.jsxs(fe,{color:i?"success":"error",children:["HTTP ",s.response.status]})]})]}),r&&e.jsx("div",{className:_.tokenStatsBox,children:e.jsxs("div",{className:_.tokenGrid,children:[e.jsxs("div",{className:_.tokenRows,children:[e.jsxs("div",{className:_.tokenRow,children:[e.jsx("span",{className:_.tokenLabel,children:"Token"}),e.jsxs("span",{className:_.tokenTd,children:["input: ",W(r.input)]}),e.jsxs("span",{className:_.tokenTd,children:["output: ",W(r.output)]})]}),e.jsxs("div",{className:`${_.tokenRow} ${_.tokenRowBorder}`,children:[e.jsx("span",{className:_.tokenLabel,children:"Cache"}),e.jsxs("span",{className:_.tokenTd,children:["create: ",W(r.cacheCreate)]}),e.jsxs("span",{className:_.tokenTd,children:["read: ",W(r.cacheRead)]})]})]}),e.jsxs("div",{className:_.tokenHitRate,children:[e.jsxs("div",{children:[r.hitRate,"%"]}),e.jsx("div",{className:_.tokenHitRateLabel,children:p("ui.hitRate")})]})]})})]}),e.jsx(Jt,{activeKey:t,onChange:a,items:h,size:"small"})]})}}const Co="_resizer_1xl2m_1",bo={resizer:Co};class No extends q.Component{constructor(s){super(s),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this)}handleMouseDown(s){s.preventDefault(),document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp)}handleMouseMove(s){this.props.onResize&&this.props.onResize(s.clientX)}handleMouseUp(){document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}componentWillUnmount(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}render(){return e.jsx("div",{onMouseDown:this.handleMouseDown,className:bo.resizer})}}class Mo extends xa{constructor(t){super(t);A(this,"handleViewRequest",t=>{this.setState({viewMode:"raw",selectedIndex:t,scrollCenter:!0})});A(this,"handleViewInChat",()=>{this.setState(t=>{const c=(t.showAll?t.requests:Ue(t.requests))[t.selectedIndex];if(!c)return null;let i=null;if(be(c)&&c.timestamp)i=c.timestamp;else{const u=ze(c);if((u.type==="SubAgent"||u.type==="Teammate")&&c.timestamp)i=c.timestamp;else{const g=t.requests.indexOf(c);g>=0&&(i=It(t.requests,g))}i||J.info(p("ui.cannotMap"))}return{viewMode:"chat",chatScrollToTs:i}})});A(this,"handleToggleViewMode",()=>{this.setState(t=>{const a=t.viewMode==="raw"?"chat":"raw";if(a==="raw"){if(t.selectedIndex===null){const u=t.showAll?t.requests:Ue(t.requests);return{viewMode:a,selectedIndex:u.length>0?u.length-1:null,scrollCenter:!0}}return{viewMode:a,scrollCenter:!0}}const c=t.showAll?t.requests:Ue(t.requests),i=t.selectedIndex!=null?c[t.selectedIndex]:null;if(i){let u=null;if(be(i)&&i.timestamp)u=i.timestamp;else{const g=ze(i);if((g.type==="SubAgent"||g.type==="Teammate")&&i.timestamp)u=i.timestamp;else{const l=t.requests.indexOf(i);l>=0&&(u=It(t.requests,l)),u||J.info(p("ui.cannotMap"))}}return{viewMode:a,chatScrollToTs:u}}return{viewMode:a,chatScrollToTs:null}},()=>{this.state.viewMode==="chat"&&this.state.terminalVisible&&this.state.cliMode&&!Rs&&requestAnimationFrame(()=>{const t=document.querySelector(".xterm-helper-textarea");t&&t.focus()})})});A(this,"handleTabChange",t=>{this.setState({currentTab:t})});A(this,"handleCacheHighlightDone",()=>{this.setState({pendingCacheHighlight:null})});A(this,"handleNavigateCacheMsg",t=>{const a=this.state.showAll?this.state.requests:Ue(this.state.requests);let c=-1;for(let i=a.length-1;i>=0;i--)if(be(a[i])){c=i;break}c<0||this.setState({selectedIndex:c,scrollCenter:!0,currentTab:"kv-cache-text",pendingCacheHighlight:{msgIdx:t,key:Date.now()}})});A(this,"handleResize",t=>{const a=this.mainContainerRef.current;if(!a)return;const c=a.getBoundingClientRect(),i=t-c.left;i>=250&&i<=800&&this.setState({leftPanelWidth:i})});A(this,"handleLoadLocalJsonlFile",()=>{const t=document.createElement("input");t.type="file",t.accept=".jsonl",t.multiple=!0,t.onchange=a=>{const c=Array.from(a.target.files);if(c.length===0)return;if(c.reduce((h,o)=>h+o.size,0)>500*1024*1024){J.error(p("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let u=0;const g=[],l=[];c.forEach(h=>{const o=new FileReader;o.onload=r=>{try{const v=r.target.result.split(`
|
|
36
36
|
---
|
|
37
37
|
`).filter(x=>x.trim()).map(x=>{try{return JSON.parse(x)}catch{return null}}).filter(Boolean);g.push(...v),l.push(h.name)}catch{}u++,u===c.length&&this._finishLocalLoad(g,l)},o.readAsText(h)})},t.click()});A(this,"_processJsonlFiles",t=>{if(!t||t.length===0)return;if(t.reduce((g,l)=>g+l.size,0)>500*1024*1024){J.error(p("ui.fileTooLarge"));return}this.setState({fileLoading:!0,fileLoadingCount:0});let c=0;const i=[],u=[];t.forEach(g=>{const l=new FileReader;l.onload=h=>{try{const r=h.target.result.split(`
|
|
38
38
|
---
|
|
39
|
-
`).filter(m=>m.trim()).map(m=>{try{return JSON.parse(m)}catch{return null}}).filter(Boolean);i.push(...r),u.push(g.name)}catch{}c++,c===t.length&&this._finishLocalLoad(i,u)},l.readAsText(g)})});A(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));A(this,"_onDragOver",t=>{t.preventDefault(),!this._isInternalDrag(t)&&(this.state.isDragging||this.setState({isDragging:!0}))});A(this,"_onDragLeave",t=>{const a=this._layoutRef.current;a&&!a.contains(t.relatedTarget)&&this.setState({isDragging:!1})});A(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const a=Array.from(t.dataTransfer.files);a.length&&Promise.all(a.map(c=>xa(c).then(i=>({name:c.name,path:i})).catch(i=>(J.error(`${c.name}: ${i.message}`),null)))).then(c=>{const i=c.filter(Boolean).map(u=>`"${u.path}"`);i.length>0&&this.setState(u=>({pendingUploadPaths:[...u.pendingUploadPaths||[],...i]}))})});A(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"request",pendingCacheHighlight:null})}render(){const{filteredRequests:t,selectedRequest:a,fileLoading:c,fileLoadingCount:i,mainAgentSessions:u,viewMode:g}=this.renderPrepare(),{selectedIndex:l,leftPanelWidth:h,currentTab:o}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(ya,{theme:this.darkThemeConfig,children:[c&&e.jsx("div",{className:E.loadingOverlay,children:e.jsxs("div",{className:E.loadingText,children:["Loading...(",i,")"]})}),this.state.isDragging&&e.jsx("div",{className:E.dragOverlay,children:e.jsxs("div",{className:E.dragOverlayContent,children:[e.jsx(zt,{className:E.dragIcon}),e.jsx("p",{children:p("ui.dragDropHint")})]})}),e.jsxs(Ne,{className:E.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Ne.Header,{className:E.header,children:e.jsx(Qe,{requestCount:t.length,requests:t,viewMode:g,cacheExpireAt:this.state.cacheExpireAt,cacheType:this.state.cacheType,onToggleViewMode:this.handleToggleViewMode,onLangChange:this.handleLangChange,onImportLocalLogs:this.handleImportLocalLogs,isLocalLog:!!this._isLocalLog,localLogFile:this._localLogFile,projectName:this.state.projectName,collapseToolResults:this.state.collapseToolResults,onCollapseToolResultsChange:this.handleCollapseToolResultsChange,expandThinking:this.state.expandThinking,onExpandThinkingChange:this.handleExpandThinkingChange,expandDiff:this.state.expandDiff,onExpandDiffChange:this.handleExpandDiffChange,filterIrrelevant:!this.state.showAll,onFilterIrrelevantChange:this.handleFilterIrrelevantChange,updateInfo:this.state.updateInfo,onDismissUpdate:()=>this.setState({updateInfo:null}),cliMode:this.state.cliMode,terminalVisible:this.state.terminalVisible,onToggleTerminal:()=>this.setState(r=>({terminalVisible:!r.terminalVisible})),onReturnToWorkspaces:this.state.cliMode?this.handleReturnToWorkspaces:null,contextWindow:this.state.contextWindow,onNavigateCacheMsg:this.handleNavigateCacheMsg,serverCachedContent:this.state.serverCachedContent||this._lastKvCacheContent,resumeAutoChoice:this.state.resumeAutoChoice,onResumeAutoChoiceToggle:this.handleResumeAutoChoiceToggle,onResumeAutoChoiceChange:this.handleResumeAutoChoiceChange,proxyProfiles:this.state.proxyProfiles,activeProxyId:this.state.activeProxyId,defaultConfig:this.state.defaultConfig,onProxyProfileChange:this.handleProxyProfileChange})}),e.jsxs(Ne.Content,{className:E.content,children:[g==="raw"&&(t.length===0?e.jsx("div",{className:E.guideContainer,children:e.jsxs("div",{className:E.guideContent,children:[e.jsx("h2",{className:E.guideTitle,children:p("ui.guide.title")}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"1"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step1")}),e.jsx("code",{className:E.guideCode,children:p("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"2"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step2")}),e.jsx("code",{className:E.guideCode,children:p("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"3"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step3")}),e.jsx("code",{className:E.guideCode,children:"npm install -g @anthropic-ai/claude-code"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:E.mainContainer,children:[e.jsxs("div",{className:E.leftPanel,style:{width:h},children:[e.jsxs("div",{className:E.leftPanelHeader,children:[e.jsx("span",{children:p("ui.requestList")}),e.jsx("span",{className:E.leftPanelCount,children:p("ui.totalRequests",{count:t.length})})]}),e.jsx("div",{className:E.leftPanelBody,children:e.jsx(Gn,{requests:t,selectedIndex:l,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(bo,{onResize:this.handleResize}),e.jsx("div",{className:E.rightPanel,children:e.jsx(vo,{request:a,requests:t,allRequests:this.state.requests,selectedIndex:l,currentTab:o,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:E.chatViewWrapper,style:{display:g==="chat"?"flex":"none"},children:e.jsx(va,{requests:t,mainAgentSessions:u,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:this.handleViewRequest,scrollToTimestamp:this.state.chatScrollToTs,onScrollTsDone:this.handleScrollTsDone,cliMode:this._isLocalLog?!1:this.state.cliMode,terminalVisible:this._isLocalLog?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(r=>({terminalVisible:!r.terminalVisible})),pendingUploadPaths:this.state.pendingUploadPaths,onUploadPathsConsumed:this.handleUploadPathsConsumed,fileLoading:this.state.fileLoading,isStreaming:this.state.isStreaming,hasMoreHistory:this.state.hasMoreHistory,loadingMore:this.state.loadingMore,onLoadMoreHistory:()=>this.loadMoreHistory(),loadingSessionId:this.state.loadingSessionId,onLoadSession:r=>this.loadSession(r)})})]}),e.jsx("div",{className:E.footer,children:e.jsxs("div",{className:E.footerRight,children:[e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:E.footerLink,children:[e.jsx("svg",{className:E.footerIcon,viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),"GitHub",this.state.githubStars!=null?` ★ ${this.state.githubStars}`:""]}),e.jsx("span",{className:E.footerDivider,children:"|"}),e.jsx("a",{href:"dingtalk://dingtalkclient/action/sendmsg?dingtalk_id=sthk5es",className:E.footerLink,children:p("ui.footer.contact")})]})})]}),e.jsx(je,{title:p("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:E.resumeFooterRight,children:[e.jsx(F,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:E.btnMarginRight,children:p("ui.resume.continue")},"continue"),e.jsx(F,{onClick:()=>this.handleResumeChoice("new"),children:p("ui.resume.new")},"new")]}),e.jsx("div",{className:E.resumeFooterLeft,children:e.jsx(ja,{checked:this.state.resumeRememberChoice,onChange:r=>this.setState({resumeRememberChoice:r.target.checked}),className:E.resumeCheckboxOpacity,children:e.jsx("span",{className:E.resumeCheckboxOpacity,children:p("ui.resume.remember")})})})]}),children:e.jsx("p",{children:p("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(je,{title:e.jsxs("span",{className:E.modalTitleInline,children:[e.jsx(Qt,{apiEndpoint:re("/api/open-log-dir"),title:p("ui.openLogDir"),size:16}),p("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:E.modalActions,children:[e.jsx(F,{icon:e.jsx(zt,{}),onClick:this.handleLoadLocalJsonlFile,children:p("ui.loadLocalJsonl")}),e.jsx(F,{size:"small",type:this.state.selectedLogs.size>1?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,className:E.btnMarginLeft,children:p("ui.mergeLogs")}),e.jsx(F,{size:"small",danger:!0,icon:e.jsx(ct,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:E.btnMarginLeft,children:p("ui.deleteLogs")}),e.jsx(F,{size:"small",icon:e.jsx(dt,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:E.btnMarginLeft,children:p("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:E.spinCenter,children:e.jsx(Gt,{})}):(()=>{const r=this.state.localLogs[this.state.currentProject];return!r||r.length===0?e.jsx("div",{className:E.emptyCenter,children:p("ui.noLogs")}):e.jsx("div",{className:E.logListContainer,children:this.renderLogTable(r,!1)})})()]})]})}}export{To as default};
|
|
39
|
+
`).filter(m=>m.trim()).map(m=>{try{return JSON.parse(m)}catch{return null}}).filter(Boolean);i.push(...r),u.push(g.name)}catch{}c++,c===t.length&&this._finishLocalLoad(i,u)},l.readAsText(g)})});A(this,"_isInternalDrag",t=>t.dataTransfer.types.includes("text/x-preset-reorder"));A(this,"_onDragOver",t=>{t.preventDefault(),!this._isInternalDrag(t)&&(this.state.isDragging||this.setState({isDragging:!0}))});A(this,"_onDragLeave",t=>{const a=this._layoutRef.current;a&&!a.contains(t.relatedTarget)&&this.setState({isDragging:!1})});A(this,"_onDrop",t=>{if(t.preventDefault(),this._isInternalDrag(t))return;this.setState({isDragging:!1});const a=Array.from(t.dataTransfer.files);a.length&&Promise.all(a.map(c=>ya(c).then(i=>({name:c.name,path:i})).catch(i=>(J.error(`${c.name}: ${i.message}`),null)))).then(c=>{const i=c.filter(Boolean).map(u=>`"${u.path}"`);i.length>0&&this.setState(u=>({pendingUploadPaths:[...u.pendingUploadPaths||[],...i]}))})});A(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})});Object.assign(this.state,{leftPanelWidth:380,terminalVisible:!0,currentTab:"request",pendingCacheHighlight:null})}render(){const{filteredRequests:t,selectedRequest:a,fileLoading:c,fileLoadingCount:i,mainAgentSessions:u,viewMode:g}=this.renderPrepare(),{selectedIndex:l,leftPanelWidth:h,currentTab:o}=this.state;return this.state.workspaceMode?this.renderWorkspaceMode():e.jsxs(va,{theme:this.darkThemeConfig,children:[c&&e.jsx("div",{className:E.loadingOverlay,children:e.jsxs("div",{className:E.loadingText,children:["Loading...(",i,")"]})}),this.state.isDragging&&e.jsx("div",{className:E.dragOverlay,children:e.jsxs("div",{className:E.dragOverlayContent,children:[e.jsx(zt,{className:E.dragIcon}),e.jsx("p",{children:p("ui.dragDropHint")})]})}),e.jsxs(Ne,{className:E.layout,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[e.jsx(Ne.Header,{className:E.header,children:e.jsx(Qe,{requestCount:t.length,requests:t,viewMode:g,cacheExpireAt:this.state.cacheExpireAt,cacheType:this.state.cacheType,onToggleViewMode:this.handleToggleViewMode,onLangChange:this.handleLangChange,onImportLocalLogs:this.handleImportLocalLogs,isLocalLog:!!this._isLocalLog,localLogFile:this._localLogFile,projectName:this.state.projectName,collapseToolResults:this.state.collapseToolResults,onCollapseToolResultsChange:this.handleCollapseToolResultsChange,expandThinking:this.state.expandThinking,onExpandThinkingChange:this.handleExpandThinkingChange,expandDiff:this.state.expandDiff,onExpandDiffChange:this.handleExpandDiffChange,filterIrrelevant:!this.state.showAll,onFilterIrrelevantChange:this.handleFilterIrrelevantChange,updateInfo:this.state.updateInfo,onDismissUpdate:()=>this.setState({updateInfo:null}),cliMode:this.state.cliMode,terminalVisible:this.state.terminalVisible,onToggleTerminal:()=>this.setState(r=>({terminalVisible:!r.terminalVisible})),onReturnToWorkspaces:this.state.cliMode?this.handleReturnToWorkspaces:null,contextWindow:this.state.contextWindow,onNavigateCacheMsg:this.handleNavigateCacheMsg,serverCachedContent:this.state.serverCachedContent||this._lastKvCacheContent,resumeAutoChoice:this.state.resumeAutoChoice,onResumeAutoChoiceToggle:this.handleResumeAutoChoiceToggle,onResumeAutoChoiceChange:this.handleResumeAutoChoiceChange,proxyProfiles:this.state.proxyProfiles,activeProxyId:this.state.activeProxyId,defaultConfig:this.state.defaultConfig,onProxyProfileChange:this.handleProxyProfileChange})}),e.jsxs(Ne.Content,{className:E.content,children:[g==="raw"&&(t.length===0?e.jsx("div",{className:E.guideContainer,children:e.jsxs("div",{className:E.guideContent,children:[e.jsx("h2",{className:E.guideTitle,children:p("ui.guide.title")}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"1"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step1")}),e.jsx("code",{className:E.guideCode,children:p("ui.guide.exampleQuestion")})]})]}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"2"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step2")}),e.jsx("code",{className:E.guideCode,children:p("ui.guide.troubleshootCmd")})]})]}),e.jsxs("div",{className:E.guideStep,children:[e.jsx("div",{className:E.guideStepNum,children:"3"}),e.jsxs("div",{className:E.guideStepBody,children:[e.jsx("p",{className:E.guideText,children:p("ui.guide.step3")}),e.jsx("code",{className:E.guideCode,children:"npm install -g @anthropic-ai/claude-code"})]})]})]})}):e.jsxs("div",{ref:this.mainContainerRef,className:E.mainContainer,children:[e.jsxs("div",{className:E.leftPanel,style:{width:h},children:[e.jsxs("div",{className:E.leftPanelHeader,children:[e.jsx("span",{children:p("ui.requestList")}),e.jsx("span",{className:E.leftPanelCount,children:p("ui.totalRequests",{count:t.length})})]}),e.jsx("div",{className:E.leftPanelBody,children:e.jsx(Jn,{requests:t,selectedIndex:l,scrollCenter:this.state.scrollCenter,onSelect:this.handleSelectRequest,onScrollDone:this.handleScrollDone,cacheLossMap:this._cacheLossMap})})]}),e.jsx(No,{onResize:this.handleResize}),e.jsx("div",{className:E.rightPanel,children:e.jsx(jo,{request:a,requests:t,allRequests:this.state.requests,selectedIndex:l,currentTab:o,onTabChange:this.handleTabChange,onViewInChat:this.handleViewInChat,expandDiff:this.state.expandDiff,pendingCacheHighlight:this.state.pendingCacheHighlight,onCacheHighlightDone:this.handleCacheHighlightDone})})]})),e.jsx("div",{className:E.chatViewWrapper,style:{display:g==="chat"?"flex":"none"},children:e.jsx(ja,{requests:t,mainAgentSessions:u,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:this.handleViewRequest,scrollToTimestamp:this.state.chatScrollToTs,onScrollTsDone:this.handleScrollTsDone,cliMode:this._isLocalLog?!1:this.state.cliMode,terminalVisible:this._isLocalLog?!1:this.state.terminalVisible,onToggleTerminal:()=>this.setState(r=>({terminalVisible:!r.terminalVisible})),pendingUploadPaths:this.state.pendingUploadPaths,onUploadPathsConsumed:this.handleUploadPathsConsumed,fileLoading:this.state.fileLoading,isStreaming:this.state.isStreaming,hasMoreHistory:this.state.hasMoreHistory,loadingMore:this.state.loadingMore,onLoadMoreHistory:()=>this.loadMoreHistory(),loadingSessionId:this.state.loadingSessionId,onLoadSession:r=>this.loadSession(r),lang:this.state.lang})})]}),e.jsx("div",{className:E.footer,children:e.jsxs("div",{className:E.footerRight,children:[e.jsxs("a",{href:"https://github.com/weiesky/cc-viewer",target:"_blank",rel:"noopener noreferrer",className:E.footerLink,children:[e.jsx("svg",{className:E.footerIcon,viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),"GitHub",this.state.githubStars!=null?` ★ ${this.state.githubStars}`:""]}),e.jsx("span",{className:E.footerDivider,children:"|"}),e.jsx("a",{href:"dingtalk://dingtalkclient/action/sendmsg?dingtalk_id=sthk5es",className:E.footerLink,children:p("ui.footer.contact")})]})})]}),e.jsx(je,{title:p("ui.resume.title"),open:this.state.resumeModalVisible,closable:!1,maskClosable:!1,keyboard:!1,footer:e.jsxs("div",{children:[e.jsxs("div",{className:E.resumeFooterRight,children:[e.jsx(F,{type:"primary",onClick:()=>this.handleResumeChoice("continue"),className:E.btnMarginRight,children:p("ui.resume.continue")},"continue"),e.jsx(F,{onClick:()=>this.handleResumeChoice("new"),children:p("ui.resume.new")},"new")]}),e.jsx("div",{className:E.resumeFooterLeft,children:e.jsx(Ca,{checked:this.state.resumeRememberChoice,onChange:r=>this.setState({resumeRememberChoice:r.target.checked}),className:E.resumeCheckboxOpacity,children:e.jsx("span",{className:E.resumeCheckboxOpacity,children:p("ui.resume.remember")})})})]}),children:e.jsx("p",{children:p("ui.resume.message",{file:this.state.resumeFileName})})}),e.jsxs(je,{title:e.jsxs("span",{className:E.modalTitleInline,children:[e.jsx(Qt,{apiEndpoint:re("/api/open-log-dir"),title:p("ui.openLogDir"),size:16}),p("ui.importLocalLogs")]}),open:this.state.importModalVisible,onCancel:this.handleCloseImportModal,footer:null,width:1e3,styles:{body:{overflow:"hidden"}},children:[e.jsxs("div",{className:E.modalActions,children:[e.jsx(F,{icon:e.jsx(zt,{}),onClick:this.handleLoadLocalJsonlFile,children:p("ui.loadLocalJsonl")}),e.jsx(F,{size:"small",type:this.state.selectedLogs.size>1?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,className:E.btnMarginLeft,children:p("ui.mergeLogs")}),e.jsx(F,{size:"small",danger:!0,icon:e.jsx(ct,{}),disabled:this.state.selectedLogs.size===0,onClick:this.handleDeleteLogs,className:E.btnMarginLeft,children:p("ui.deleteLogs")}),e.jsx(F,{size:"small",icon:e.jsx(dt,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,className:E.btnMarginLeft,children:p("ui.refreshStats")})]}),this.state.localLogsLoading?e.jsx("div",{className:E.spinCenter,children:e.jsx(Gt,{})}):(()=>{const r=this.state.localLogs[this.state.currentProject];return!r||r.length===0?e.jsx("div",{className:E.emptyCenter,children:p("ui.noLogs")}):e.jsx("div",{className:E.logListContainer,children:this.renderLogTable(r,!1)})})()]})]})}}export{Mo as default};
|