import"./index-IP_FWtso.js";import{a as i}from"./vendor-utils-BveVE6Uf.js";const e=n=>{const a=new FormData;return Object.entries(n).forEach(([t,r])=>{r instanceof File?a.append(t,r):r!=null&&a.append(t,String(r))}),a};class m{constructor(){this.registerWorkTimesAsync=async a=>{const t=await i.post("Salary/RegisterWorkTimes",a);return t==null?void 0:t.data},this.getWorkTimesAsync=async a=>{const t=await i.get("Salary/GetWorkTimes",{params:a});return t==null?void 0:t.data},this.getInsuredListAsync=async a=>{const t=await i.get("Salary/InsuredList",{params:a});return t==null?void 0:t.data},this.getTaxListAsync=async a=>{const t=await i.get("Salary/TaxList",{params:a});return t==null?void 0:t.data},this.importSalaryFromExcel=async(a,t)=>{if(!t)throw new Error("فایل انتخاب نشده است");if(!a.year||!a.month)throw new Error("سال و ماه باید مشخص شوند");const r=10*1024*1024;if(t.size>r)throw new Error(`حجم فایل نباید بیشتر از ${r/1024/1024}MB باشد`);const s=e({file:t}),o=await i.post("SalaryImportSalaryFromExcel",s,{params:a,headers:{"Content-Type":"multipart/form-data"}});return o==null?void 0:o.data}}}export{m as S};
