import{a as s}from"./formatters-jmx2pV9o.js";const u={balance_sheet:"Bilan",income_statement:"Compte de résultat",cash_flow:"Flux de trésorerie"},l=[{value:1,label:"+1 Ajouter"},{value:-1,label:"-1 Soustraire"}],o=new Date().toISOString().slice(0,10),c=(e,t)=>{const a=/filename="?([^"]+)"?/i.exec(e||"");return(a==null?void 0:a[1])||t},m=(e,t)=>{var r,d;const a=window.URL.createObjectURL(new Blob([e.data],{type:((r=e.headers)==null?void 0:r["content-type"])||"application/octet-stream"})),n=document.createElement("a");n.href=a,n.download=c((d=e.headers)==null?void 0:d["content-disposition"],t),document.body.append(n),n.click(),n.remove(),window.setTimeout(()=>{window.URL.revokeObjectURL(a)},1e4)},b=(e,t)=>{var a;return{fiscalYearId:String(((a=t==null?void 0:t.fiscalYear)==null?void 0:a.id)||""),asOfDate:o,dateFrom:"",dateTo:"",comparative:!0,sections:[],statementKey:e}},f=(e,t,a)=>{const n={company_id:a,fiscal_year_id:t.fiscalYearId||void 0};switch(e){case"bilan":n.as_of_date=t.asOfDate||void 0,n.comparative=t.comparative;break;case"income-statement":n.date_from=t.dateFrom||void 0,n.date_to=t.dateTo||void 0;break}return n},_=e=>e?e.is_current&&o<e.end_date?o:e.end_date:o,p=e=>Number(e||0)>0?"text-accent":Number(e||0)<0?"text-danger":"text-text",x=e=>e==="result"?"bg-accent/10 font-semibold text-text":e==="computed_primary"?"bg-blue-50 font-semibold text-text":e==="computed"?"bg-surface2 font-semibold text-text":"",S=e=>(e==null?void 0:e.formatted)||(typeof(e==null?void 0:e.value)=="number"?s(e.value):"—");export{u as F,l as S,_ as a,f as b,p as c,m as d,x as e,S as f,b as g};
