1import{I as G,_ as K,j as e,d as ee,aG as je,ad as Y,p as w,a9 as x,C as N,b4 as M,b5 as y,dU as oe,T as Q,B as F,ac as P,l as ue,dV as ye,aC as me,u as ve,cu as we,al as Ce,a as Se,dW as le,cb as Re,z as ke}from"./index-Dzola9Kd.js";import{a as g,g as Ie}from"./echarts-DgtDMHXn.js";import{L as Ne}from"./LooseDatePicker-SI-CmKDN.js";import{u as E}from"./useMoneyFormatter-DdARfGZG.js";import{C as $e,a as Oe}from"./ConsoleHeader-By2BNBn8.js";import"./consoleMotifs-HD4rcuuE.js";import{R as se}from"./InfoCircleOutlined-CKx4Bo6Q.js";import{S}from"./index-W8Wq_8PZ.js";import{R as re}from"./DownloadOutlined-Dv-y-NL-.js";import{F as j}from"./Table-H1nqLpkd.js";import{T as D}from"./index-BIhIFrsy.js";import{R as ae}from"./WarningOutlined-CMfv84ln.js";import{R as Fe}from"./PrinterOutlined-BK-vIHi0.js";import{R as ze,a as Le}from"./ArrowUpOutlined-Fiemnlzh.js";import{R as xe}from"./SwapOutlined-CU5hWR18.js";import{E as De}from"./index-CrI3g7Ly.js";import{S as Z}from"./index-C3b1PNE2.js";import"./index-CnQQvX_j.js";import"./ArrowLeftOutlined-B9eHp_u0.js";import"./motifs-BzK3sym4.js";import"./DownOutlined-CsUcB2ZQ.js";var Me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M925.9 804l-24-199.2c-.8-6.6-8.9-9.4-13.6-4.7L829 659.5 557.7 388.3c-6.3-6.2-16.4-6.2-22.6 0L433.3 490 156.6 213.3a8.03 8.03 0 00-11.3 0l-45 45.2a8.03 8.03 0 000 11.3L422 591.7c6.2 6.3 16.4 6.3 22.6 0L546.4 490l226.1 226-59.3 59.3a8.01 8.01 0 004.7 13.6l199.2 24c5.1.7 9.5-3.7 8.8-8.9z"}}]},name:"fall",theme:"outlined"},Pe=function(r,l){return g.createElement(G,K({},r,{ref:l,icon:Me}))},he=g.forwardRef(Pe),Ee={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},Te=function(r,l){return g.createElement(G,K({},r,{ref:l,icon:Ee}))},Ae=g.forwardRef(Te),Be={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M956 686.5l-.1-.1-.1-.1C911.7 593 843.4 545 752.5 545s-159.2 48.1-203.4 141.3v.1a42.92 42.92 0 000 36.4C593.3 816 661.6 864 752.5 864s159.2-48.1 203.4-141.3c5.4-11.5 5.4-24.8.1-36.2zM752.5 800c-62.1 0-107.4-30-141.1-95.5C645 639 690.4 609 752.5 609c62.1 0 107.4 30 141.1 95.5C860 770 814.6 800 752.5 800z"}},{tag:"path",attrs:{d:"M697 705a56 56 0 10112 0 56 56 0 10-112 0zM136 232h704v253h72V192c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v520c0 17.7 14.3 32 32 32h352v-72H136V232z"}},{tag:"path",attrs:{d:"M724.9 338.1l-36.8-36.8a8.03 8.03 0 00-11.3 0L493 485.3l-86.1-86.2a8.03 8.03 0 00-11.3 0L251.3 543.4a8.03 8.03 0 000 11.3l36.8 36.8c3.1 3.1 8.2 3.1 11.3 0l101.8-101.8 86.1 86.2c3.1 3.1 8.2 3.1 11.3 0l226.3-226.5c3.2-3.1 3.2-8.2 0-11.3z"}}]},name:"fund-view",theme:"outlined"},We=function(r,l){return g.createElement(G,K({},r,{ref:l,icon:Be}))},qe=g.forwardRef(We),Ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917 211.1l-199.2 24c-6.6.8-9.4 8.9-4.7 13.6l59.3 59.3-226 226-101.8-101.7c-6.3-6.3-16.4-6.2-22.6 0L100.3 754.1a8.03 8.03 0 000 11.3l45 45.2c3.1 3.1 8.2 3.1 11.3 0L433.3 534 535 635.7c6.3 6.2 16.4 6.2 22.6 0L829 364.5l59.3 59.3a8.01 8.01 0 0013.6-4.7l24-199.2c.7-5.1-3.7-9.5-8.9-8.8z"}}]},name:"rise",theme:"outlined"},Ve=function(r,l){return g.createElement(G,K({},r,{ref:l,icon:Ye}))},te=g.forwardRef(Ve);const _e=({item:t})=>{const r=t.active;return e.jsxs("button",{type:"button",onClick:t.onSelect,"aria-current":r,className:`group relative flex w-full items-center gap-2.5 rounded-console-sm py-2 pl-3 pr-2 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-console-accent focus-visible:ring-offset-1 ${t.locked?"cursor-pointer opacity-55 hover:opacity-80":"cursor-pointer"}`,style:{backgroundColor:r?"var(--console-accent-soft)":void 0},children:[e.jsx("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 roun
1ded-full transition-all",style:{backgroundColor:"var(--console-accent)",width:r?4:3,height:r?"100%":"60%"},"aria-hidden":!0}),r?e.jsx("span",{className:"absolute right-0 top-0 h-full w-[3px]",style:{backgroundColor:"var(--console-accent)"},"aria-hidden":!0}):null,e.jsx("span",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-console-sm text-[15px] ${t.locked?"bg-console-surface-tint text-console-muted":"bg-console-accent-soft text-console-accent-strong"}`,children:t.icon}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[e.jsx("span",{className:"truncate text-[13px] font-medium leading-5 text-console-ink",children:t.label}),t.note?e.jsx(ee,{title:t.note,children:e.jsx(se,{className:"shrink-0 cursor-help text-[11px] text-console-muted opacity-60"})}):null]}),t.description?e.jsx("span",{className:"block truncate text-[12px] leading-4 text-console-muted",children:t.description}):null]}),t.locked?e.jsx(ee,{title:"å¼å¯ãé«çº§æ¨¡å¼ã以解éï¼è®¾ç½® â é«çº§æ¨¡å¼ï¼",children:e.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center text-[12px] text-console-muted",children:e.jsx(je,{})})}):t.metric!==void 0?e.jsxs("span",{className:"shrink-0 text-right",children:[e.jsx("span",{className:"block text-[13px] font-semibold tabular-nums leading-5 text-console-ink",children:t.metric}),t.metricLabel?e.jsx("span",{className:"block text-[11px] leading-4 text-console-muted",children:t.metricLabel}):null]}):null]})},He=({groups:t,className:r})=>e.jsx("div",{className:`flex flex-col ${r??""}`,children:t.map(l=>e.jsxs("div",{className:"mb-1 last:mb-0",children:[e.jsx("div",{className:"flex items-center gap-1.5 px-3 pb-1 pt-2",children:e.jsx("span",{className:"text-[12px] font-medium text-console-muted",children:l.label})}),l.items.map(p=>e.jsx(_e,{item:p},p.id))]},l.key))});var U={exports:{}},Ue=U.exports,ie;function Ge(){return ie||(ie=1,(function(t,r){(function(l,p){t.exports=p()})(Ue,(function(){var l="month",p="quarter";return function(m,h){var o=h.prototype;o.quarter=function(c){return this.$utils().u(c)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(c-1))};var b=o.add;o.add=function(c,u){return c=Number(c),this.$utils().p(u)===p?this.add(3*c,l):b.bind(this)(c,u)};var a=o.startOf;o.startOf=function(c,u){var n=this.$utils(),s=!!n.u(u)||u;if(n.p(c)===p){var f=this.quarter()-1;return s?this.month(3*f).startOf(l).startOf("day"):this.month(3*f+2).endOf(l).endOf("day")}return a.bind(this)(c,u)}}}))})(U)),U.exports}var Ke=Ge();const Qe=Ie(Ke),V=t=>{const r=new URLSearchParams;Object.entries(t).forEach(([p,m])=>{m&&r.set(p,m)});const l=r.toString();return l?`?${l}`:""},_={assetLiability:(t,r)=>Y(`/reports/asset-liability${V({currency:t,modules:r.join(",")})}`),investmentPerformance:t=>Y(`/reports/investment-performance${V({currency:t})}`),debtRepaymentSchedule:t=>Y(`/reports/debt-repayment-schedule${V({currency:t})}`),cashFlowSummary:(t,r)=>Y(`/reports/cash-flow-summary${V({startDate:t,endDate:r})}`)},Je={assets:{cash:0,lending:0,fund:0,stock:0,bond:0,deposit:0,wealth:0,insurance:0,realEstate:0,vehicle:0,total:0},liabilities:{mortgage:0,auto:0,consumer:0,personal:0,business:0,other:0,total:0},netAssets:0,pensionAssets:0},v=t=>Number(t??0),Xe={summary:!0,investment:!0,debt:!1,cashflow:!1},Ze=t=>{const r=t.currency||"CNY",[l,p]=g.useState(Je),[m,h]=g.useState([]),[o,b]=g.useState([]),[a,c]=g.useState({income:0,expense:0,net:0}),[u,n]=g.useState(!0),[s,f]=g.useState(null);return g.useEffect(()=>{let k=!1;n(!0),f(null);const T=t.dateRange?.[0]?.format("YYYY-MM-DD"),I=t.dateRange?.[1]?.format("YYYY-MM-DD");return Promise.all([_.assetLiability(r,t.modules),_.investmentPerformance(r),_.debtRepaymentSchedule(r),_.cashFlowSummary(T,I)]).then(([$,A,J,L])=>{if(k)return;p({assets:Object.fromEntries(Object.entries($.assets||{}).map(([d,C])=>[d,v(C)])),liabilities:Object.fromEntries(Object.entries($.liabilities||{}).map(([d,C])=>[d,v(C)])),netAssets:v($.netAssets),pensionAssets:v($.pensionAssets)}),h(A.filter(()=>t.modules.includes("all")||t.modules.includes("invest")).filter(d=>{const C=t.dateRange?.[0],O=t.dateRange?.[1];return!(d.status==="sold"&&d.soldDate&&C&&w(d.soldDate).isBefore(C,"day")||d.purchaseDate&&O&&w(d.purchaseDate).isAfter(O,"day"))}).map(d=>{const C=v(d.convertedPurchase),O=v(d.convertedCurrent),B=v(d.profit),W=v(d.profitRate),q=d.purchaseDate?w().diff(w(d.purchaseDate),"day"):0;return{...d,convertedPurchase:C,convertedCurrent:O,profit:B,profitRate:W,annualizedReturn:q>0?W/q*365:0}}));const X=J.map(d=>({...d,amount:v(d.amount),remainingPrincipal:v(d.remainingPrincipal)})).filter(d=>d.amount>0).sort((d,C)=>d.date.localeCompare(C.date));b(X),c({income:v(L.income),expense:v(L.expense),net:v(L.net)}),n(!1)}).catch($=>{k||(console.error("æ¥è¡¨æ°æ®å 载失败:",$),f("æ¥è¡¨æ°æ®å 载失败ï¼è¯·ç¨åéè¯"),n(!1))}),()=>{k=!0}},[t,r]),{assetLiabilityData:l,investmentPerformanceData:m,debtRepaymentSchedule:o,cashFlowData:a,targetCurrency:r,loading:u,error:s}},ne=(t,r,l)=>{const p=r.map(c=>c.title).join(","),m=l.map(c=>r.map(u=>{let n=c[u.dataIndex];u.render&&(n=u.render(n,c));const s=String(n??"");return s.includes(",")||s.includes('"')||s.includes(` 2`)?`"${s.replace(/"/g,'""')}"`:s}).join(",")),h="\uFEFF"+[p,...m].join(` 3`),o=new Blob([h],{type:"text/csv;charset=utf-8;"}),b=URL.createObjectURL(o),a=document.createElement("a");a.setAttribute("href",b),a.setAttribute("download",`${t}_${new Date().toISOString().split("T")[0]}.csv`),a.style.visibility="hidden",document.body.appendChild(a),a.click(),document.body.removeChild(a)},{Text:z}
3=Q,{useBreakpoint:et}=P,tt=({data:t,currency:r,hideZeroAssets:l=!1,onToggleHideZeroAssets:p})=>{const h=!et().md,o=E(),a=[...[{key:"cash",type:"ç°é/æ´»æ",amount:t.assets.cash||0},{key:"lending",type:"ååºå«èµ",amount:t.assets.lending||0},{key:"fund",type:"åºéæèµ",amount:t.assets.fund||0},{key:"stock",type:"è¡ç¥¨æèµ",amount:t.assets.stock||0},{key:"bond",type:"åºå¸æèµ",amount:t.assets.bond||0},{key:"deposit",type:"宿忬¾",amount:t.assets.deposit||0},{key:"wealth",type:"é¶è¡çè´¢",amount:t.assets.wealth||0},{key:"insurance",type:"ä¿é©èµäº§",amount:t.assets.insurance||0},{key:"realEstate",type:"ä¸å¨äº§",amount:t.assets.realEstate||0},{key:"vehicle",type:"车è¾èµäº§",amount:t.assets.vehicle||0}],{key:"pensionOfWhich",type:"å
¶ä¸ï¼å
»èèµäº§",amount:t.pensionAssets||0,ofWhich:!0}].filter(s=>!l||s.amount>0),c=[{key:"mortgage",type:"æ¿è´·",amount:t.liabilities.mortgage||0},{key:"auto",type:"车贷",amount:t.liabilities.auto||0},{key:"consumer",type:"æ¶è´¹è´·",amount:t.liabilities.consumer||0},{key:"personal",type:"ä¸ªäººåæ¬¾",amount:t.liabilities.personal||0},{key:"business",type:"ç»è¥è´·æ¬¾",amount:t.liabilities.business||0},{key:"other",type:"å
¶ä»åºå¡",amount:t.liabilities.other||0}].filter(s=>!l||s.amount>0),u=[{title:"ç±»å«",dataIndex:"type",key:"type",render:(s,f)=>f?.ofWhich?e.jsx("span",{style:{paddingLeft:16},children:s}):s},{title:`éé¢ (${r})`,dataIndex:"amount",key:"amount",align:"right",render:s=>o(s,r,{showCode:"never"})}],n=()=>{const s=[{title:"项ç®",dataIndex:"type"},{title:`éé¢ (${r})`,dataIndex:"amount",render:k=>typeof k=="number"?k.toFixed(2):""}],f=[{type:"--- èµäº§ ---",amount:0},...a,{type:"èµäº§æ»è®¡",amount:t.assets.total},{type:"注ï¼å
»èèµäº§æ¯è·¨ç±»å«çåçï¼å·²å
å«å¨ä¸è¿°åç±»ä¸ï¼ä¸éå¤è®¡å
¥èµäº§æ»è®¡ã",amount:""},{type:"",amount:0},{type:"--- è´åº ---",amount:0},...c,{type:"è´åºæ»è®¡",amount:t.liabilities.total},{type:"",amount:0},{type:"åèµäº§",amount:t.netAssets}];ne("èµäº§è´åºæ±æ»è¡¨",s,f)};return e.jsxs(x,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsx(N,{title:e.jsxs(x,{children:[e.jsx(oe,{style:{color:"#1677ff"}}),e.jsx("span",{children:"è´¢å¡æ¦è§"})]}),extra:e.jsxs(x,{wrap:!0,children:[e.jsx(F,{type:l?"primary":"default",onClick:p,children:l?"æ¾ç¤ºææé¡¹ç®":"éèé¶å¼é¡¹ç®"}),e.jsx(F,{icon:e.jsx(re,{}),onClick:n,children:"å¯¼åº CSV"})]}),styles:{body:{padding:"20px"}},children:e.jsxs(M,{gutter:[16,16],children:[e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-red-50 to-orange-50 border border-red-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(te,{style:{color:"#ff4d4f"}}),e.jsx("span",{children:"èµäº§æ»é¢"})]}),value:t.assets.total,precision:2,valueStyle:{color:"#ff4d4f",fontWeight:600},formatter:s=>o(s,r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-green-50 to-emerald-50 border border-green-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(he,{style:{color:"#52c41a"}}),e.jsx("span",{children:"è´åºæ»é¢"})]}),value:t.liabilities.total,precision:2,valueStyle:{color:"#52c41a",fontWeight:600},formatter:s=>o(s,r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:`p-4 rounded-lg border h-full ${t.netAssets>=0?"bg-gradient-to-br from-blue-50 to-indigo-50 border-blue-100":"bg-gradient-to-br from-amber-50 to-red-50 border-amber-100"}`,children:[e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(oe,{style:{color:t.netAssets>=0?"#1677ff":"#faad14"}}),e.jsx("span",{children:"åèµäº§"})]}),value:t.netAssets,precision:2,valueStyle:{color:t.netAssets>=0?"#1677ff":"#faad14",fontWeight:700},formatter:s=>o(s,r,{showCode:"never"})}),t.assets.total>0&&e.jsxs(z,{type:"secondary",style:{fontSize:"12px"},children:["èµäº§è´åºç: ",(t.liabilities.total/t.assets.total*100).toFixed(1),"%"]})]})})]})}),e.jsxs(M,{gutter:[20,20],children:[e.jsx(y,{xs:24,md:12,children:e.jsxs(N,{title:e.jsxs(x,{children:[e.jsx("div",{className:"w-1 h-4 bg-red-400 rounded-full"}),e.jsx("span",{children:"èµäº§æç»"})]}
3),styles:{header:{borderBottom:"2px solid #fee2e2"}},className:"h-full",children:[e.jsx(j,{dataSource:a,columns:u,pagination:!1,scroll:{x:"max-content"},size:h?"small":"middle",onRow:s=>s?.ofWhich?{style:{backgroundColor:"#fafafa"}}:{},summary:()=>e.jsxs(j.Summary.Row,{children:[e.jsx(j.Summary.Cell,{index:0,children:e.jsx(z,{strong:!0,style:{color:"#ff4d4f"},children:"èµäº§æ»è®¡"})}),e.jsx(j.Summary.Cell,{index:1,align:"right",children:e.jsx(z,{strong:!0,style:{color:"#ff4d4f"},children:o(t.assets.total,r,{showCode:"never"})})})]})}),e.jsx(z,{type:"secondary",style:{fontSize:"12px",display:"block",marginTop:8},children:"å
»èèµäº§æ¯è·¨ç±»å«çåçï¼ç°éãåºéãçè´¢ãä¿é©éé½å¯è½æä¸é¨åï¼ï¼å·²å
å«å¨ä¸è¿°åç±»ä¸ï¼ä¸éå¤è®¡å
¥èµäº§æ»è®¡ã"})]})}),e.jsx(y,{xs:24,md:12,children:e.jsx(N,{title:e.jsxs(x,{children:[e.jsx("div",{className:"w-1 h-4 bg-green-400 rounded-full"}),e.jsx("span",{children:"è´åºæç»"})]}),styles:{header:{borderBottom:"2px solid #dcfce7"}},className:"h-full",children:e.jsx(j,{dataSource:c,columns:u,pagination:!1,scroll:{x:"max-content"},size:h?"small":"middle",summary:()=>e.jsxs(j.Summary.Row,{children:[e.jsx(j.Summary.Cell,{index:0,children:e.jsx(z,{strong:!0,style:{color:"#52c41a"},children:"è´åºæ»è®¡"})}),e.jsx(j.Summary.Cell,{index:1,align:"right",children:e.jsx(z,{strong:!0,style:{color:"#52c41a"},children:o(t.liabilities.total,r,{showCode:"never"})})})]})})})})]})]})},{Text:H}=Q,{useBreakpoint:st}=P,rt=({data:t,currency:r})=>{const p=!st().md,m=E(),{advancedMode:h}=ue(),o=t.reduce((n,s)=>({purchase:n.purchase+s.convertedPurchase,current:n.current+s.convertedCurrent,profit:n.profit+s.profit}),{purchase:0,current:0,profit:0}),b=o.purchase!==0?o.profit/o.purchase*100:0,a=t.filter(n=>n.status==="holding").length,c=[{title:"åç§°",dataIndex:"name",key:"name"},{title:"ç±»å",dataIndex:"type",key:"type",filters:h?[{text:"åºé",value:"fund"},{text:"è¡ç¥¨",value:"stock"},{text:"å®å",value:"deposit"},{text:"åºå¸",value:"bond"}]:void 0,onFilter:h?(n,s)=>s.type===n:void 0,render:n=>({fund:"åºé",stock:"è¡ç¥¨",deposit:"å®å",bond:"åºå¸"})[n]||n},{title:`ä¹°å
¥éé¢ (${r})`,dataIndex:"convertedPurchase",key:"convertedPurchase",align:"right",render:n=>m(n,r,{showCode:"never"}),sorter:(n,s)=>n.convertedPurchase-s.convertedPurchase},{title:`å½åå¸å¼ (${r})`,dataIndex:"convertedCurrent",key:"convertedCurrent",align:"right",render:n=>m(n,r,{showCode:"never"}),sorter:(n,s)=>n.convertedCurrent-s.convertedCurrent},{title:`çäºéé¢ (${r})`,dataIndex:"profit",key:"profit",align:"right",render:n=>e.jsxs(H,{type:n>=0?"danger":"success",children:[n>=0?"+":"",m(n,r,{showCode:"never"})]}),sorter:(n,s)=>n.profit-s.profit},{title:"çäºç",dataIndex:"profitRate",key:"profitRate",align:"right",render:n=>e.jsxs(D,{color:n>=0?"error":"success",children:[n>=0?"+":"",n.toFixed(2),"%"]}),sorter:(n,s)=>n.profitRate-s.profitRate},{title:"å¹´åæ¶çç",dataIndex:"annualizedReturn",key:"annualizedReturn",align:"right",render:n=>e.jsxs(H,{strong:!0,type:n>=0?"danger":"success",children:[n.toFixed(2),"%"]}),sorter:(n,s)=>n.annualizedReturn-s.annualizedReturn},{title:"ç¶æ",dataIndex:"status",key:"status",render:n=>e.jsx(D,{color:n==="holding"?"blue":"default",children:n==="holding"?"ææä¸":"å·²ååº"}),filters:[{text:"ææä¸",value:"holding"},{text:"å·²ååº",value:"sold"}],onFilter:(n,s)=>s.status===n}],u=()=>{ne("æèµä¸ç»©æ¥è¡¨",[{title:"åç§°",dataIndex:"name"},{title:"ç±»å",dataIndex:"type"},{title:"ä¹°å
¥éé¢",dataIndex:"convertedPurchase",render:s=>s.toFixed(2)},{title:"å½åå¸å¼",dataIndex:"convertedCurrent",render:s=>s.toFixed(2)},{title:"çäºéé¢",dataIndex:"profit",render:s=>s.toFixed(2)},{title:"çäºç(%)",dataIndex:"profitRate",render:s=>s.toFixed(2)},{title:"å¹´åæ¶çç(%)",dataIndex:"annualizedReturn",render:s=>s.toFixed(2)},{title:"ç¶æ",dataIndex:"status"}],t)};return e.jsxs(x,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsx(N,{title:e.jsxs(x,{children:[e.jsx(me,{style:{color:"#722ed1"}}),e.jsx("span",{children:"æèµä¸ç»©æ¦è§"})]}),extra:h&&e.jsx(F,{icon:e.jsx(re,{}),onClick:u,children:"å¯¼åº CSV"}),styles:{body:{padding:"20px"}},children:e.jsxs(M,{gutter:[16,16],children:[e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:"p-4 rounded-lg bg-gradient-to-br from-purple-50 to-violet-50 border border-purple-100 h-full",children:[e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(ye,{style:{color:"#722ed1"}}),e.jsx("span",{children:"æå
¥æ¬é"})]}),value:o.purchase,precision:2,valueStyle:{color:"#722ed1",fontWeight:600},formatter:n=>m(n,r,{showCode:"never"})}),e.jsxs(H,{type:"secondary",style:{fontSize:"12px"},children:["æä»: ",a," / ",t.length," 项"]})]})}),e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-indigo-50 to-blue-50 border border-indigo-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(te,{style:{color:"#1677ff"}}),e.jsx("span",{children:"å½åå¸å¼"})]}),value:o.current,precision:2,valueStyle:{color:"#1677ff",fontWeight:600},formatter:n=>m(n,r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:`p-4 rounded-lg border h-full ${o.profit>=0?"bg-gradient-to-br from-red-50 to-orange-50 border-red-100":"bg-gradient-to-br from-green-50 to-emerald-50 border-green-100"}`,children:[e.jsx(S,{title:e.jsxs(x,{children:[o.profit>=0?e.jsx(te,{style:{color:"#ff4d4f"}}):e.jsx(he,{style:{color:"#52c41a"}}),e.jsx("span",{children:"累计çäº"})]}),value:o.profit,precision:2,valueStyle:{color:o.profit>=0?"#ff4d4f":"#52c41a",fontWeight:700},formatter:n=>`${o.profit>=0?"+":""}${m(n,r,{showCode:"never"})}`}),e.jsxs(D,{color:b>=0?"error":"success",style:{marginTop:4},children:[b>=0?"+":"",b.toFixed(2),"% æ¶çç"]})]})})]})}),e.jsx(N,{title:e.jsxs(x,{children:[e.jsx("div",{className:"w-1 h-4 bg-purple-400 rounded-full"}),e.jsx("span",{children:"æèµä¸ç»©æç»"})]}
3),styles:{header:{borderBottom:"2px solid #f3e8ff"}},children:e.jsx(j,{dataSource:t,columns:c,rowKey:"id",scroll:{x:"max-content"},size:p?"small":"middle",summary:()=>e.jsxs(j.Summary.Row,{style:{background:"#fafafa",fontWeight:"bold"},children:[e.jsx(j.Summary.Cell,{index:0,colSpan:2,children:"æ±æ»"}),e.jsx(j.Summary.Cell,{index:2,align:"right",children:m(o.purchase,r,{showCode:"never"})}),e.jsx(j.Summary.Cell,{index:3,align:"right",children:m(o.current,r,{showCode:"never"})}),e.jsx(j.Summary.Cell,{index:4,align:"right",children:e.jsxs(H,{type:o.profit>=0?"danger":"success",children:[o.profit>=0?"+":"",m(o.profit,r,{showCode:"never"})]})}),e.jsx(j.Summary.Cell,{index:5,align:"right",children:e.jsxs(D,{color:b>=0?"error":"success",children:[b>=0?"+":"",b.toFixed(2),"%"]})}),e.jsx(j.Summary.Cell,{index:6,colSpan:2})]})})})]})},{Text:ce}=Q,{useBreakpoint:nt}=P,ot=({data:t,currency:r})=>{const p=!nt().md,m=E(),h=ve(),o=t.reduce((s,f)=>s+(f.amount||0),0),b=new Set(t.map(s=>s.name)).size,a=t.length>0?o/12:0,c=[{title:"è¿æ¬¾æ¥æ",dataIndex:"date",key:"date",sorter:(s,f)=>s.date.localeCompare(f.date)},{title:"åºå¡åç§°",dataIndex:"name",key:"name",render:s=>e.jsx(F,{type:"link",onClick:()=>h("/assets/debts"),style:{padding:0},children:s})},{title:"åºæäºº",dataIndex:"creditor",key:"creditor"},{title:`æ¬æåºè¿ (${r})`,dataIndex:"amount",key:"amount",align:"right",render:s=>e.jsx(ce,{strong:!0,type:"success",children:m(s,r,{showCode:"never"})})},{title:`å©ä½æ¬é (${r})`,dataIndex:"remainingPrincipal",key:"remainingPrincipal",align:"right",render:s=>m(s,r,{showCode:"never"})}],u=()=>{ne("æªæ¥12个æè¿æ¬¾è®¡å",[{title:"è¿æ¬¾æ¥æ",dataIndex:"date"},{title:"åºå¡åç§°",dataIndex:"name"},{title:"åºæäºº",dataIndex:"creditor"},{title:"æ¬æåºè¿",dataIndex:"amount",render:f=>f.toFixed(2)},{title:"å©ä½æ¬é",dataIndex:"remainingPrincipal",render:f=>f.toFixed(2)}],t)},n=()=>{window.print()};return e.jsxs(x,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsx(N,{title:e.jsxs(x,{children:[e.jsx(ae,{style:{color:"#faad14"}}),e.jsx("span",{children:"è¿æ¬¾è®¡åæ¦è§"}),e.jsx(ee,{title:"åºäºå½ååºå¡è®¾ç½®æ¨¡æçæï¼ä»
ä¾åè",children:e.jsx(se,{style:{color:"#1677ff"}})})]}),extra:e.jsxs(x,{children:[e.jsx(F,{icon:e.jsx(Fe,{}),onClick:n,children:"æå°"}),e.jsx(F,{icon:e.jsx(re,{}),onClick:u,type:"primary",children:"å¯¼åº CSV"})]}),styles:{body:{padding:"20px"}},children:e.jsxs(M,{gutter:[16,16],children:[e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:"p-4 rounded-lg bg-gradient-to-br from-amber-50 to-yellow-50 border border-amber-100 h-full",children:[e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(we,{style:{color:"#faad14"}}),e.jsx("span",{children:"å¾
è¿ç¬æ°"})]}),value:t.length,suffix:"ç¬",valueStyle:{color:"#faad14",fontWeight:600}}),e.jsxs(ce,{type:"secondary",style:{fontSize:"12px"},children:["æ¶å ",b," 项åºå¡"]})]})}),e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-orange-50 to-red-50 border border-orange-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(Ce,{style:{color:"#f5222d"}}),e.jsx("span",{children:"é¢è®¡æ»è¿æ¬¾"})]}),value:o,precision:2,valueStyle:{color:"#f5222d",fontWeight:600},formatter:s=>m(s,r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:"p-4 rounded-lg bg-gradient-to-br from-cyan-50 to-blue-50 border border-cyan-100 h-full",children:[e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(ae,{style:{color:"#13c2c2"}}),e.jsx("span",{children:"æåè¿æ¬¾"})]}),value:a,precision:2,valueStyle:{color:"#13c2c2",fontWeight:700},formatter:s=>m(s,r,{showCode:"never"})}),e.jsx(D,{color:"blue",style:{marginTop:4},children:"æªæ¥ 12 个æ"})]})})]})}),e.jsx(N,{title:e.jsxs(x,{children:[e.jsx("div",{className:"w-1 h-4 bg-amber-400 rounded-full"}),e.jsx("span",{children:"æªæ¥ 12 个æè¿æ¬¾è®¡å"})]}),styles:{header:{borderBottom:"2px solid #fef3c7"}},children:e.jsx(j,{dataSource:t,columns:c,rowKey:"id",pagination:{pageSize:12},scroll:{x:"max-content"},size:p?"small":"middle"})})]})},{Paragraph:lt,Text:at}
3=Q,{useBreakpoint:it}=P,ct=({data:t,currency:r})=>{const p=!it().md,m=E(),h=t.income!==0||t.expense!==0;return e.jsxs(x,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsxs(N,{title:e.jsxs(x,{children:[e.jsx(qe,{style:{color:"#13c2c2"}}),e.jsx("span",{children:"ç°éæµæ¦è§"})]}),styles:{body:{padding:"20px"}},children:[e.jsx(lt,{type:"secondary",style:{marginTop:0},children:"åºäºçéæé´å
çæ´»å¨æ¥å¿ç»è®¡ãå®ä¹ï¼æ°å¢èµäº§è§ä¸ºæµåºï¼å é¤èµäº§è§ä¸ºæµå
¥ï¼éè´¦/åç°ï¼ã"}),e.jsxs(M,{gutter:[16,16],children:[e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-green-50 to-emerald-50 border border-green-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(ze,{style:{color:"#52c41a"}}),e.jsx("span",{children:"æé´æ»æµå
¥"})]}),value:t.income,precision:2,valueStyle:{color:"#52c41a",fontWeight:600},formatter:o=>m(Number(o),r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsx("div",{className:"p-4 rounded-lg bg-gradient-to-br from-red-50 to-orange-50 border border-red-100 h-full",children:e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(Le,{style:{color:"#ff4d4f"}}),e.jsx("span",{children:"æé´æ»æµåº"})]}),value:t.expense,precision:2,valueStyle:{color:"#ff4d4f",fontWeight:600},formatter:o=>m(Number(o),r,{showCode:"never"})})})}),e.jsx(y,{xs:24,sm:8,children:e.jsxs("div",{className:`p-4 rounded-lg border h-full ${t.net>=0?"bg-gradient-to-br from-cyan-50 to-blue-50 border-cyan-100":"bg-gradient-to-br from-rose-50 to-red-50 border-rose-100"}`,children:[e.jsx(S,{title:e.jsxs(x,{children:[e.jsx(xe,{style:{color:t.net>=0?"#13c2c2":"#f5222d"}}),e.jsx("span",{children:"åç°éæµ"})]}),value:t.net,precision:2,valueStyle:{color:t.net>=0?"#13c2c2":"#f5222d",fontWeight:700},formatter:o=>m(Number(o),r,{showCode:"never"})}),h&&t.income>0&&e.jsxs(at,{type:"secondary",style:{fontSize:"12px"},children:["åæµå
¥ç: ",((t.income-t.expense)/t.income*100).toFixed(1),"%"]})]})})]}),!h&&e.jsx(De,{description:"çéæé´å
ææ ç°éæµè®°å½",style:{marginTop:24}})]}),e.jsx(N,{title:e.jsxs(x,{size:p?4:8,children:[e.jsx("div",{className:"w-1 h-4 bg-cyan-400 rounded-full"}),e.jsx(se,{style:{color:"#13c2c2"}}),e.jsx("span",{children:"计ç®è§å说æ"})]}),styles:{header:{borderBottom:"2px solid #cffafe"}},size:p?"small":"default",children:e.jsxs("ul",{style:{paddingLeft:20,color:"rgba(0, 0, 0, 0.45)",margin:0},children:[e.jsx("li",{style:{marginBottom:8},children:"æ°æ®æ¥æºäºãæ´»å¨æ¥å¿ã模åç宿¶è®°å½ã"}),e.jsxs("li",{style:{marginBottom:8},children:[e.jsx("strong",{children:"æµå
¥"}),"ï¼å
æ¬èµäº§å é¤ï¼å¦å款æ¶åãèµäº§ååºç产ççè®°å½ï¼ã"]}),e.jsxs("li",{style:{marginBottom:8},children:[e.jsx("strong",{children:"æµåº"}),"ï¼å
æ¬æ°å¢èµäº§ï¼å¦ç°éå¢å ãè´å
¥è¡ç¥¨ãè´ä¹°æ¿äº§ç产ççè®°å½ï¼ã"]}),e.jsx("li",{children:"注æï¼è´¦æ·é´äºè½¬çå
é¨èµéæµå¨ææªåç¬åé¤ï¼ç»è®¡æ¶å¯è½éå¤è®¡å
¥ã"})]})})]})};w.extend(Qe);const{RangePicker:dt}=Ne,{useBreakpoint:ut}=P,mt=[{label:"å
¨é¨æ¨¡å",value:"all"},{label:"æµå¨é±å
",value:"liquid"},{label:"è´¢å¯å¼æ",value:"invest"},{label:"ä¿é©ä¿é",value:"insurance"},{label:"ç¡¬æ ¸èµäº§",value:"physical"},{label:"ä¿¡ç¨ç¾ç",value:"credit"}],xt=[{label:"æ¬æ",value:[w().startOf("month"),w().endOf("month")]},{label:"æ¬å£åº¦",value:[w().startOf("quarter"),w().endOf("quarter")]},{label:"æ¬å¹´",value:[w().startOf("year"),w().endOf("year")]}],de={summary:"èµäº§ä¸è´åºææéå¸ç§æ±çæç®åæ±æ»ï¼è¦çç°é / ååº / åºé / è¡ç¥¨ / åºå¸ / å®å / çè´¢ / ä¿é© / æ¿äº§ / 车è¾ï¼ä¸å«æ°åå®èã",investment:"ææ¨¡åçéï¼å
¨é¨ / è´¢å¯å¼æï¼å±ç¤ºæä»çäºï¼å·²ååºä¸ä¸å¨æ¶é´èå´å
çæä»ä¸è®¡å
¥ã"},Mt=()=>{const r=!ut().md,l=E(),{currencies:p,mainCurrency:m}=Se(),{advancedMode:h}=ue(),[o,b]=g.useState(!1),[a,c]=g.useState({dateRange:[w().startOf("month"),w().endOf("month")],modules:["all"],currency:m.code}),[u,n]=g.useState("summary"),{assetLiabilityData:s,investmentPerformanceData:f,debtRepaymentSchedule:k,cashFlowData:T,targetCurrency:I,loading:$,error:A}=Ze(a);g.useEffect(()=>{!h&&(u==="debt"||u==="cashflow")&&n("summary")}
3,[h,u]);const J=i=>{c({...a,dateRange:i})},L=i=>{i.includes("all")&&!a.modules.includes("all")?c({...a,modules:["all"]}):i.length>1&&i.includes("all")?c({...a,modules:i.filter(R=>R!=="all")}):i.length===0?c({...a,modules:["all"]}):c({...a,modules:i})},X=i=>{c({...a,currency:i})},d=(i,R)=>{if(R){ke.info("å¼å¯ãé«çº§æ¨¡å¼ãåå¯è§£éåºå¡è¿æ¬¾è®¡åä¸ç°éæµæ±æ»ï¼è®¾ç½® â é«çº§æ¨¡å¼ï¼");return}n(i)},C=s.netAssets,O=f.reduce((i,R)=>({purchase:i.purchase+(R.convertedPurchase||0),profit:i.profit+(R.profit||0)}),{purchase:0,profit:0}),B=O.purchase!==0?O.profit/O.purchase*100:0,W=k.reduce((i,R)=>i+(R.amount||0),0),q=T.net,pe=[{key:"basic",label:"åºç¡æ¥è¡¨",items:[{id:"summary",label:"èµäº§è´åºæ±æ»",icon:e.jsx(le,{}),description:"èµäº§ / è´åº / åèµäº§",note:de.summary,metric:l(C,I,{showCode:"never"}),metricLabel:"åèµäº§",active:u==="summary",onSelect:()=>d("summary",!1)},{id:"investment",label:"æèµä¸ç»©æ¥è¡¨",icon:e.jsx(me,{}),description:"æä»çäºä¸æ¶çç",note:de.investment,metric:`${B>=0?"+":""}${B.toFixed(1)}%`,metricLabel:"æ¶çç",active:u==="investment",onSelect:()=>d("investment",!1)}]},{key:"advanced",label:"é«çº§æ¥è¡¨",items:[{id:"debt",label:"åºå¡è¿æ¬¾è®¡å",icon:e.jsx(Ae,{}),description:"æªæ¥ 12 个æè¿æ¬¾",metric:l(W,I,{showCode:"never"}),metricLabel:"å¾
è¿æ»é¢",locked:!h,active:u==="debt",onSelect:()=>d("debt",!h)},{id:"cashflow",label:"ç°éæµæ±æ»",icon:e.jsx(xe,{}),description:"æé´æµå
¥ / æµåº",metric:l(q,I,{showCode:"never"}),metricLabel:"åç°éæµ",locked:!h,active:u==="cashflow",onSelect:()=>d("cashflow",!h)}]}],fe=Xe[u]===!1&&!(a.modules.length===1&&a.modules[0]==="all"),ge=()=>{switch(u){case"summary":return e.jsx(tt,{data:s,currency:I,hideZeroAssets:o,onToggleHideZeroAssets:()=>b(i=>!i)});case"investment":return e.jsx(rt,{data:f,currency:I});case"debt":return e.jsx(ot,{data:k,currency:I});case"cashflow":return e.jsx(ct,{data:T,currency:I});default:return null}},be=[{value:"summary",label:"èµäº§è´åºæ±æ»"},{value:"investment",label:"æèµä¸ç»©æ¥è¡¨"},{value:"debt",label:"åºå¡è¿æ¬¾è®¡å",disabled:!h},{value:"cashflow",label:"ç°éæµæ±æ»",disabled:!h}];return e.jsxs($e,{motif:"reports",children:[e.jsx(Oe,{title:"æ¥è¡¨ä¸å¿",subtitle:"å
¨é¢éè§æ¨çèµäº§åå¸ãæèµæ¶çåæªæ¥ç°éæµ",icon:e.jsx(le,{})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-console border border-console-border bg-console-surface px-3 py-2",children:[e.jsx(dt,{value:a.dateRange,onChange:J,className:"w-full sm:w-auto",size:"small"}),e.jsx(x,{size:4,wrap:!0,children:xt.map(i=>{const R=a.dateRange?.[0]?.isSame(i.value[0],"day")&&a.dateRange?.[1]?.isSame(i.value[1],"day");return e.jsx(F,{size:"small",type:R?"primary":"default",onClick:()=>c({...a,dateRange:i.value}),children:i.label},i.label)})}),e.jsx(Z,{mode:"multiple",size:"small",className:"min-w-[140px] flex-1 sm:flex-none",placeholder:"éæ©ç»è®¡æ¨¡å",maxTagCount:"responsive",value:a.modules,onChange:L,options:mt}),e.jsx(Z,{size:"small",className:"w-[120px]",value:a.currency,onChange:X,showSearch:!0,optionFilterProp:"label",options:p.map(i=>({label:`${i.name} (${i.code})`,value:i.code}))})]}),e.jsxs("div",{className:"flex gap-3 lg:gap-4",children:[e.jsx("aside",{className:"hidden w-[224px] shrink-0 rounded-console border border-console-border bg-console-surface p-1.5 md:flex md:flex-col lg:w-[296px]",children:e.jsx(He,{groups:pe})}),e.jsxs("main",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[r?e.jsx(Z,{value:u,onChange:i=>d(i,!h&&(i==="debt"||i==="cashflow")),options:be,className:"w-full"}):null,fe?e.jsx("div",{className:"rounded-console border border-console-border bg-console-surface-tint px-3 py-2 text-[13px] text-console-muted",children:"æ¬æ¥è¡¨ä¸ææ¨¡åç»è®¡ï¼é¡¶é¨ã模åãçé对å
¶ä¸çæï¼æ¶é´èå´ä¸å¸ç§ä»ç¶ææã"}):null,A?e.jsxs("div",{className:"rounded-console border border-console-border bg-console-surface px-3 py-6 text-center",children:[e.jsx("p",{className:"text-[14px] font-medium text-console-ink",children:A}),e.jsx("p",{className:"mt-1 text-[13px] text-console-muted",children:"å½åå±ç¤ºç 0 å¼ä¸ä»£è¡¨å®é
æ°æ®ï¼è¯·éè¯æç¨å忥ã"})]}):$?e.jsxs("div",{className:"rounded-console border border-console-border bg-console-surface px-3 py-10 text-center",children:[e.jsx(Re,{size:"small"}),e.jsx("p",{className:"mt-2 text-[13px] text-console-muted",children:"æ£å¨å è½½æ¥è¡¨æ°æ®â¦"})]}):ge()]})]})]})};export{Mt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.