PageSourceSearch

https://hoyamoney.web.app/_nuxt/CBpyZa1i.js

js hoyamoney.web.app collected 2026-10-03 12:25:31 UTC 15,467 bytes, 1 lines download raw bytes

1import{g as G,m as ee,p as se,h as u,q as J,r as te,s as V,v as q,x as fe,y as X,c as k,o as v,a as n,b as m,k as K,t as f,l as e,z as L,A as Z,B as pe,C as H,D as ve,E,F as oe,G as ie,j as le,w as C,d as ae,H as W,I as A,J as U,i as z,K as _e,_ as ge,L as xe,M as he,N as re,O as N,P as ye,Q as De,R as we,S as be,T as Ce}from"./CTS1mvZH.js";import{u as ce,_ as ke,a as $e,b as Se,c as Te,d as Ie,e as je,f as Me}from"./CcV215Zb.js";import{$ as ne}from"./BfcAdsvC.js";import{_ as Ee}from"./veESVbGA.js";import{_ as Ye}from"./BDCwSkNF.js";import"./ByyuaxpM.js";const Oe={class:"glass-sm rounded-xl p-4"},Ve={class:"flex items-center justify-between mb-3"},Ae={class:"flex items-center gap-3"},Fe={class:"w-10 h-10 rounded-full bg-primary-500 flex items-center justify-center"},Pe={class:"font-medium"},ze={class:"text-sm text-muted"},Be={class:"grid grid-cols-3 gap-2 text-center text-xs"},He={class:"text-muted"},Ue={class:"font-semibold text-amount-success"},Re={class:"text-muted"},Ne={class:"font-semibold text-amount-negative"},We={class:"text-muted"},Le={class:"font-semibold text-amount-primary"},qe={class:"text-muted"},Ge={class:"font-semibold text-amount-primary"},Ke={class:"text-muted"},Qe={class:"text-muted"},Je={class:"font-semibold text-amount-primary"},Xe=G({__name:"Statistic",props:{statisticSetting:{},date:{default:()=>new Date}},setup(B){const{t:x}=ee(),{getCurrency:j}=se(),{getDetailTransactionStatisticInfoByCriteria:Y}=ce(),_=B,r=u(()=>_.statisticSetting?_.statisticSetting.txnFilterCriterion?.isRange?J(V(_.date,_.statisticSetting.txnFilterCriterion.dayRange??0)):te(_.statisticSetting.txnFilterCriterion.startDate):J(_.date)),$=u(()=>_.statisticSetting?_.statisticSetting.txnFilterCriterion?.isRange?null:q(_.statisticSetting.txnFilterCriterion.endDate):q(fe(_.date))),y=u(()=>{const t=r.value?X(r.value):x("statistic.period.infinite"),l=$.value?X($.value):x("statistic.period.infinite");return`${t} ~ ${l}`}),F=u(()=>_.statisticSetting?.name??x("statistic.period.this_month")),T=u(()=>Y(_.statisticSetting?.searchText??void 0,_.statisticSetting?.txnFilterCriterion??void 0,r.value,$.value).value),S=u(()=>T.value.reduce((t,l)=>t+l.income,0)),c=u(()=>T.value.reduce((t,l)=>t+l.expense,0)),M=u(()=>T.value.reduce((t,l)=>t+l.transferIn,0)),I=u(()=>T.value.reduce((t,l)=>t+l.transferOut,0)),g=u(()=>M.value-I.value),D=u(()=>S.value-c.value+g.value),h=u(()=>S.value===0?0:Math.round(D.value/S.value*100)),O=u(()=>new Set(T.value.map(l=>l.txnHeader.id)).size);return(t,l)=>{const s=K;return v(),k("div",Oe,[n("div",Ve,[n("div",Ae,[n("div",Fe,[m(s,{name:"i-heroicons-chart-pie-solid",class:"w-5 h-5 text-white"})]),n("div",null,[n("h3",Pe,f(e(F)),1),n("p",ze,f(e(y)),1)])])]),n("div",Be,[n("div",null,[n("div",He,f(e(x)("statistic.income")),1),n("p",Ue,f(("formatAmount"in t?t.formatAmount:e(L))({amount:e(S),currency:e(j),withSymbol:!1,compactDigits:6})),1)]),n("div",null,[n("div",Re,f(e(x)("statistic.expense")),1),n("p",Ne,f(("formatAmount"in t?t.formatAmount:e(L))({amount:e(c),currency:e(j),withSymbol:!1,compactDigits:6})),1)]),n("div",null,[n("div",We,f(e(x)("statistic.total")),1),n("p",Le,f(e(x)("statistic.transaction_count",{count:e(O)})),1)]),n("div",null,[n("div",qe,f(e(x)("statistic.net_transfer")),1),n("p",Ge,f(("formatAmount"in t?t.formatAmount:e(L))({amount:e(g),currency:e(j),withSymbol:!1,compactDigits:6})),1)]),n("div",null,[n("div",Ke,f(e(x)("statistic.net_amount")),1),n("p",{class:Z(["font-semibold",e(D)>=0?"text-amount-success":"text-amount-negative"])},f(("formatAmount"in t?t.formatAmount:e(L))({amount:e(D),currency:e(j),withSymbol:!1,compactDigits:6})),3)]),n("div",null,[n("div",Qe,f(e(x)("statistic.savings_rate")),1),n("p",Je,f(e(h))+"%",1)])])])}}}),Ze=Object.assign(Xe,{__name:"CardStatistic"}),et={class:"flex flex-col gap-2"},tt={class:"flex justify-between items-center gap-3"},at={class:"flex-1 flex justify-start items-center"},nt={class:"flex justify-between items-center"},st={class:"flex justify-between pl-2 pr-2 pb-2"},ot={class:"flex-1 flex justify-end items-center"},it={class:"grid grid-cols-7 gap-1 gap-y-3"},lt={class:"grid grid-cols-7 gap-1 gap-y-3"},rt=["onClick"],ct={class:"font-bold"},dt={class:"flex justify-center items-center gap-1"},ut={class:"flex justify-center items-center py-2"},mt=G({__name:"Calendar",props:{dateValue:{},biWeekValue:{type:Boolean,default:!1},eventCountCallback:{type:Function,default:()=>0}},emits:["update:dateValue","update:biWeekValue"],setup(B,{emit:x}){const{locale:j}=ee(),Y=B,_=x,r=u({get:()=>Y.dateValue,set:t=>{_("update:dateValue",t)}}),$=u({get:()=>{const t=r.value;return new ne(t.getFullYear(),t.getMonth()+1,t.getDate())},set:t=>{t&&(r.value=new Date(t.year,t.month-1,t.day))}}),y=u({get:()=>
1Y.biWeekValue,set:t=>{_("update:biWeekValue",t)}}),F=[0,1,2,3,4,5,6],T=u(()=>{const t=new Date,l=r.value.getFullYear(),s=r.value.getMonth();let o=new Date(l,s,1),d=new Date(l,s+1,0);const i=[];if(y.value){const a=g(r.value),p=pe(r.value,a),P=Math.floor(p/14);o=V(a,P*14),d=V(o,13)}o.getDay()!==0&&(o=V(o,-o.getDay())),d.getDay()!==6&&(d=V(d,6-d.getDay()));for(let a=o;a<=d;a=V(a,1))i.push({date:a,isThisMonth:ve(r.value,a),isToday:H(t,a),eventCount:Y.eventCountCallback?.(a)});return i}),S={d0:"option.weekdays.sunday",d1:"option.weekdays.monday",d2:"option.weekdays.tuesday",d3:"option.weekdays.wednesday",d4:"option.weekdays.thursday",d5:"option.weekdays.friday",d6:"option.weekdays.saturday"},c=()=>{y.value?r.value=new Date(r.value.getFullYear(),r.value.getMonth(),r.value.getDate()-14):r.value=new Date(r.value.getFullYear(),r.value.getMonth()-1,1)},M=()=>{y.value?r.value=new Date(r.value.getFullYear(),r.value.getMonth(),r.value.getDate()+14):r.value=new Date(r.value.getFullYear(),r.value.getMonth()+1,1)},I=()=>{const t=new Date;$.value=new ne(t.getFullYear(),t.getMonth()+1,t.getDate())},g=t=>{const l=t.getFullYear(),s=new Date(l,0,1),o=s.getDay(),d=new Date(s);return d.setDate(s.getDate()-o),d},D=E(),h=E(!1),O=(t,l)=>{h.value||(h.value=!0,l==="left"?M():l==="right"?c():l==="up"?y.value=!0:l==="down"&&(y.value=!1),requestAnimationFrame(()=>{h.value=!1}))};return oe(D,{onSwipeEnd:O}),ie(D,{onSwipeEnd:O}),(t,l)=>{const s=K,o=le,d=$e,i=ke,a=_e;return v(),k("div",{ref_key:"calendarEl",ref:D},[n("div",et,[n("div",tt,[n("div",at,[m(o,{variant:"ghost",size:"sm",class:"p-2",onClick:c},{default:C(()=>[m(s,{name:"i-heroicons-chevron-left",class:"w-5 h-5"})]),_:1})]),n("div",nt,[m(i,{class:"flex-1"},{content:C(()=>[m(d,{modelValue:e($),"onUpdate:modelValue":l[0]||(l[0]=p=>W($)?$.value=p:null),locale:e(j),class:"p-2"},null,8,["modelValue","locale"]),n("div",st,[m(o,{variant:"soft",block:!0,onClick:I},{default:C(()=>[ae(f(t.$t("common.today")),1)]),_:1})])]),default:C(()=>[m(o,{variant:"soft",block:!0,class:"flex-1 cursor-pointer",ui:{base:"ring-input! ring-0! bg-transparent! text-default p-0"}},{default:C(()=>[ae(f(("formatYYYYMMDDText"in t?t.formatYYYYMMDDText:e(X))(e(r))),1)]),_:1})]),_:1})]),n("div",ot,[m(o,{variant:"ghost",size:"sm",class:"p-2",onClick:l[1]||(l[1]=p=>y.value=!e(y))},{default:C(()=>[m(s,{name:e(y)?"fluent:calendar-week-start-28-regular":"fluent:calendar-month-28-regular",class:"w-5 h-5"},null,8,["name"])]),_:1}),m(o,{variant:"ghost",size:"sm",class:"p-2",onClick:M},{default:C(()=>[m(s,{name:"i-heroicons-chevron-right",class:"w-5 h-5"})]),_:1})])]),n("div",it,[(v(),k(A,null,U(F,p=>n("div",{key:p,class:Z(["text-center font-bold text-sm",{"text-secondary":p===0||p===6}])},f(t.$t(S[`d${p}`])),3)),64))]),n("div",lt,[(v(!0),k(A,null,U(e(T),(p,P)=>(v(),k("div",{key:P,class:Z(["text-center font-bold text-sm cursor-pointer flex flex-col justify-center items-center gap-0.5 pb-1.5",{"date-today":("isSameDate"in t?t.isSameDate:e(H))(new Date,p.date),"date-selected":("isSameDate"in t?t.isSameDate:e(H))(e(r),p.date),"text-muted/50":!p.isThisMonth}]),onClick:()=>r.value=p.date},[n("div",ct,f(p.date.getDate()),1),n("div",dt,[(v(!0),k(A,null,U(Math.min(5,p.eventCount),R=>(v(),z(a,{key:R,color:"primary",size:"2xs"}))),128))])],10,rt))),128))])]),n("div",ut,[n("div",{class:"w-30 h-1 rounded-full bg-neutral-400/20 dark:bg-neutral-200/10 cursor-pointer",onClick:l[2]||(l[2]=p=>y.value=!e(y))})])],512)}}}),ft=Object.assign(ge(mt,[["__scopeId","data-v-00379204"]]),{__name:"ChoiceCalendar"}),pt={class:"flex flex-col gap-2 h-full px-2 pb-2 md:px-4 md:pb-4"},vt={class:"flex-1 flex flex-col gap-2 min-h-0 overflow-y-auto no-scrollbar"},_t={key:0,class:"flex flex-col gap-2"},gt={class:"flex items-center justify-between px-2 text-xs font-semibold text-primary"},xt={key:1,class:"flex flex-col gap-2"},ht={class:"flex items-center justify-between px-2 text-xs font-semibold text-primary"},yt={class:"flex items-center justify-between px-2 text-xs font-semibold text-primary"},Dt={key:0,class:"flex-1 flex flex-col gap-2 justify-center items-center"},wt={class:"text-muted"},bt=G({__name:"CalendarTransactionInfo",props:{dateValue:{default:()=>new Date}},emits:["update:dateValue","select-transaction","realize-periodic"],setup(B,{emit:x}){const{allProjectMap:j,getGroup:Y}=xe(),{allPeriodicMap:_,getNextExecution:r}=he(),{allTxnHeaderMap:$}=re(),{getHeaderTransactionStatisticInfo:y,getTransactionInfo:F}=ce(),T=B,S=x,c=u({get:()=>T.dateValue,set:i=>{S("update:dateValue",i)}}),M=E(!0),I=u(()=>y(()=>!0,te(c.value),q(c.value)).value),g=u(()=>Object.values(j.value).filter(i=>i.toBeShown).filter(i=>Y(i,c.value)==="進行中").sort((i,a)=>(i.order??0)-(a.order??0))??[]),D=u(()=>Object.values(_.value).filter(i=>{const a=r(i,c.value);return a!==null&&H(a,c.value)}).filter(i=>I.value.every(a=>a.txnHeader.periodicId!==i.id))),h=E(null),O=u(()=>{if(!h.value)return null;const i={...h.value.savedTxnHeader,datetime:c.value,details:h.value.savedTxnHeader.txnDetails.map(a=>({...a}))};return F(i).value}),t=i=>Object.values($.value).filter(a=>H(a.datetime,i)).length,l=()=>{if(!h.value)return;const i=H(new Date,c.value)?new Date:c.value;S("realize-periodic",h.value,i),h.value=null},s=E(),o=E(!1),d=(i,a)=>{o.value||(o.value=!0,a==="left"?c.value=V(c.value,1):a==="right"&&(c.value=V(c.value,-1)),requestAnimationFrame(()=>{o.value=!1}))};return oe(s,{onSwipeEnd:d}),ie(s,{onSwipeEnd:d}),(i,a)=>{const p=ft,P=Se,R=Ee,b=Ye,de=Te,ue=K,me=Ie;return v(),k(A,null,[n("div",pt,[a[4]||(a[4]=n("div",{class:"top-inner-nav-spacing"},null,-1)),m(p,{"date-value":e(c),"onUpdate:dateValue":a[0]||(a[0]=w=>W(c)?c.value=w:null),"bi-week-value":e(M),"onUpdate:biWeekValue":a[1]||(a[1]=w=>
1W(M)?M.value=w:null),"event-count-callback":t},null,8,["date-value","bi-week-value"]),n("div",vt,[e(g).length>0?(v(),k("div",_t,[n("div",gt,f(i.$t("project.in_progress_projects")),1),m(R,{items:e(g).map((w,Q)=>Q)},{default:C(({index:w})=>[m(P,{project:e(g)[w],date:e(c),selected:!1},null,8,["project","date"])]),_:1},8,["items"])])):N("",!0),e(D).length>0?(v(),k("div",xt,[n("div",ht,f(i.$t("periodic.unrealized_periodics")),1),(v(!0),k(A,null,U(e(D),w=>(v(),z(b,{key:w.id,periodic:w,date:e(c),selected:!1,class:"cursor-pointer",onClick:Q=>h.value=w},null,8,["periodic","date","onClick"]))),128))])):N("",!0),n("div",{ref_key:"transactionListEl",ref:s,class:"flex-1 flex flex-col gap-2"},[n("div",yt,f(i.$t("transaction.today_transactions")),1),(v(!0),k(A,null,U(e(I),w=>(v(),z(de,{key:w.id,"transaction-info":w,selected:!1,onClick:Q=>S("select-transaction",w.txnHeader.id)},null,8,["transaction-info","onClick"]))),128)),e(I).length===0?(v(),k("div",Dt,[m(ue,{name:"i-heroicons-banknotes-solid",class:"w-16 h-16 text-muted"}),n("p",wt,f(i.$t("transaction.no_transactions")),1)])):N("",!0)],512),a[3]||(a[3]=n("div",{class:"bottom-inner-nav-spacing"},null,-1))])]),e(O)?(v(),z(me,{key:0,"transaction-info":e(O),editable:!1,realizable:"",onClose:a[2]||(a[2]=w=>h.value=null),onRealize:l},null,8,["transaction-info"])):N("",!0)],64)}}}),Ct=Object.assign(bt,{__name:"PanelCalendarTransactionInfo"}),kt={class:"flex flex-col gap-4 h-full px-2 md:px-0 top-nav-spacing"},$t={class:"flex-[0_0_auto] flex flex-col gap-3 overflow-x-auto bottom-nav-spacing"};const Yt=G({__name:"dashboard",setup(B){const{t:x}=ee(),{showLoading:j,hideLoading:Y,showNotify:_,showYesNo:r,hideYesNo:$}=ye(),{getCurrency:y}=se(),{currentLedger:F}=De(),{addOrUpdate:T}=re(),{allStatisticSettingMap:S}=we(),c=E(void 0),M=u(()=>x("pages.dashboard")),I=E(!1),g=E(new Date),D=E(!0),h=u(()=>be("(min-width: 768px)").value),O=async(s,o)=>{r({icon:"i-heroicons-arrow-path-solid",text:"periodic.confirm_realize_periodic_message",confirmAction:()=>t(s,o)})},t=async(s,o)=>{try{const d=s.savedTxnHeader.settlementCurrency??y.value,i={id:void 0,ledgerId:F.value.id,periodicId:s.id,name:s.savedTxnHeader.name,iconPath:s.savedTxnHeader.iconPath,iconColor:s.savedTxnHeader.iconColor,datetime:o,comment:s.savedTxnHeader.comment??"",settlementCurrency:d,exRateMap:Object.assign({[`${d}${d}`]:1},s.savedTxnHeader.exRateMap??{}),details:s.savedTxnHeader.txnDetails.map(a=>({id:void 0,txnHeaderId:void 0,amount:a.amount??0,currency:a.currency??d,toBeCounted:a.toBeCounted??!0,categoryId:a.categoryId,subcategoryId:a.subcategoryId,projectId:a.projectId,accountInId:a.accountInId,accountOutId:a.accountOutId,createdAt:new Date,updatedAt:new Date})),createdAt:new Date,updatedAt:new Date};j(),await T(i)}catch(d){const i=String(d instanceof Error?d.message:d);_({text:i})}finally{$(),Y()}},l=()=>{I.value=!0};return(s,o)=>{const d=K,i=le,a=Ze,p=Ct,P=je,R=Me;return v(),k(A,null,[m(P,{"selected-transaction-id-value":e(c),"onUpdate:selectedTransactionIdValue":o[3]||(o[3]=b=>W(c)?c.value=b:null),"header-title":e(M),"show-detail":e(D)||e(h),"detail-layout-class":e(D)||e(h)?"md:glass md:rounded-lg":""},{"header-left":C(()=>[m(i,{variant:"ghost",size:"sm",class:"p-2 md:hidden",onClick:o[0]||(o[0]=b=>D.value=!e(D))},{default:C(()=>[m(d,{name:e(D)?"i-heroicons-chart-pie-solid":"i-heroicons-calendar-solid",class:"w-5 h-5"},null,8,["name"])]),_:1})]),"header-right":C(()=>[m(i,{variant:"ghost",size:"sm",class:"p-2",onClick:l},{default:C(()=>[m(d,{name:"i-heroicons-magnifying-glass-solid",class:"w-5 h-5"})]),_:1})]),master:C(()=>[n("div",kt,[n("div",$t,[m(a,{"statistic-setting":{id:"this_day",ledgerId:"",name:e(x)("statistic.period.this_day"),searchText:"",txnFilterCriterion:{isRange:!1,startDate:("getStartOfDate"in s?s.getStartOfDate:e(te))(e(g)),endDate:("getEndOfDate"in s?s.getEndOfDate:e(q))(e(g)),accountIds:[],categoryIds:[],projectIds:[]},createdAt:new Date,updatedAt:new Date},date:e(g)},null,8,["statistic-setting","date"]),m(a,{"statistic-setting":null,date:e(g)},null,8,["date"]),m(a,{"statistic-setting":{id:"this_year",ledgerId:"",name:e(x)("statistic.period.this_year"),searchText:"",txnFilterCriterion:{isRange:!1,startDate:("getStartDateOfMonth"in s?s.getStartDateOfMonth:e(J))(new Date(e(g).getFullYear(),0,1)),endDate:("getEndDateOfYear"in s?s.getEndDateOfYear:e(Ce))(e(g)),accountIds:[],categoryIds:[],projectIds:[]},createdAt:new Date,updatedAt:new Date},date:e(g)},null,8,["statistic-setting","date"]),(v(!0),k(A,null,U(Object.values(e(S)),b=>(v(),z(a,{key:b.id,"statistic-setting":b,date:e(g)},null,8,["statistic-setting","date"]))),128))])])]),detail:C(()=>[(v(),z(p,{key:0,"date-value":e(g),"onUpdate:dateValue":o[1]||(o[1]=b=>W(g)?g.value=b:null),onSelectTransaction:o[2]||(o[2]=b=>c.value=b),onRealizePeriodic:O},null,8,["date-value"]))]),_:1},8,["selected-transaction-id-value","header-title","show-detail","detail-layout-class"]),e(I)?(v(),z(R,{key:0,onSelect:o[4]||(o[4]=b=>c.value=b),onClose:o[5]||(o[5]=b=>I.value=!1)})):N("",!0)],64)}}});
1export{Yt 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.