const c=[{value:"debit",label:"Débit"},{value:"credit",label:"Crédit"},{value:"net",label:"Net"},{value:"absolute",label:"Absolu"}],n=[{value:"debit",label:"Débit"},{value:"credit",label:"Crédit"},{value:"net",label:"Net"}],g=[{value:1,label:"+1"},{value:-1,label:"-1"}],u={1:"border-blue-200 bg-blue-50 text-blue-700",2:"border-indigo-200 bg-indigo-50 text-indigo-700",3:"border-violet-200 bg-violet-50 text-violet-700",4:"border-emerald-200 bg-emerald-50 text-emerald-700",5:"border-amber-200 bg-amber-50 text-amber-700",6:"border-orange-200 bg-orange-50 text-orange-700",7:"border-rose-200 bg-rose-50 text-rose-700",8:"border-cyan-200 bg-cyan-50 text-cyan-700"},_={purchase:"Achats",sale:"Ventes",cash:"Caisse",bank:"Banque",misc:"OD",payroll:"Paie",assets:"Immo"},S=e=>{var t;return((t=c.find(a=>a.value===e))==null?void 0:t.label)||e},f=e=>{var t;return((t=n.find(a=>a.value===e))==null?void 0:t.label)||e},m=e=>u[Number(e)]||"border-border bg-surface2 text-textMuted",v=e=>e?`${e.code} · Cadre ${e.cadre}${e.sub_cadre||""} · ${e.label}`:"",b=(e,t)=>e.find(a=>a.code===t)||null,A=({accounts:e,taxCodes:t,todayKey:a})=>e.filter(s=>!s.has_mapping).map(s=>{const i=String(s.code||""),d=String(s.label||"").toLowerCase();let l=null,r="credit",o=1;return/^70/.test(i)?(l=b(t,"E3B21"),r="credit"):/^445/.test(i)&&/(deduct|déduct|recuper|récup|achat)/.test(d)?(l=b(t,"E3B92"),r="debit"):/^445/.test(i)&&/(collect|vente|sortie)/.test(d)?(l=b(t,"E3B21"),r="credit"):/^6/.test(i)?(l=b(t,"E3B92"),r="debit"):/^(421|422|425)/.test(i)||/salaire|personnel|paie/.test(d)?(l=b(t,"E1L20"),r="credit"):/^444/.test(i)&&(l=b(t,"E1M10"),r="credit"),l?{account_id:s.id,account:s,tax_code_id:l.id,tax_code:l,amount_side:r,sign:o,effective_from:a,checked:!0}:null}).filter(Boolean);export{c as A,n as J,g as S,v as a,A as b,S as c,f as d,_ as e,m as g};
