import{u as m,ca as k,j as t,B as i,aA as _,b,r as l,e as h,av as y,X as f,b0 as C,F as v,ak as g}from"./bundle.CHKSNOJF.js";var u=(e=>(e.Deposit="deposit",e.Withdrawal="withdrawal",e))(u||{}),p=(e=>(e.Credit="CREDIT",e.Debit="DEBIT",e))(p||{}),n=(e=>(e.Unmatched="1",e.Matched="2",e.Converted="3",e))(n||{});const T={[u.Deposit]:"deposit",[u.Withdrawal]:"withdrawal"},d={[n.Unmatched]:"unmatched",[n.Matched]:"matched",[n.Converted]:"converted"};function E(e){const[a]=m(),{is_deleted:o,archived_at:s,status_id:r}=e.transaction,c=k();return o?t.jsx(i,{variant:"red",children:a("deleted")}):s?t.jsx(i,{variant:"orange",children:a("archived")}):n.Unmatched===r?t.jsx(i,{variant:"generic",style:{backgroundColor:c.$1},children:a(d[1])}):n.Matched===r?t.jsx(i,{variant:"dark-blue",style:{backgroundColor:c.$2},children:a(d[2])}):n.Converted===r?t.jsx(i,{variant:"green",style:{backgroundColor:c.$3},children:a(d[3])}):t.jsx(t.Fragment,{})}function Q(e){return b(["/api/v1/bank_transactions",e.id],()=>l("GET",h("/api/v1/bank_transactions/:id",{id:e.id})).then(a=>a.data.data),{enabled:e.enabled??!0,staleTime:1/0})}function w(){const e=_();return b(["/api/v1/bank_transactions","create"],()=>l("GET",h("/api/v1/bank_transactions/create")).then(a=>a.data.data),{staleTime:1/0,enabled:e("create_bank_transaction")})}const x={convert_matched:"converted_transactions",unlink:"unlinked_payment"},B=()=>{const e=y(),a=f(C);return(o,s)=>{v.processing(),l("POST",h("/api/v1/bank_transactions/bulk"),{action:s,ids:o}).then(()=>{const r=x[s]||`${s}d_invoice`;v.success(r),g(["bank_transactions"]),a&&e.invalidateQueries([a])})}};export{p as A,E,n as T,u as a,B as b,w as c,T as t,Q as u};
