const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/exceljs.min-BEz_Ja81.js","assets/chunk-aKtaBQYM.js"])))=>i.map(i=>d[i]);
import{i as e,t}from"./chunk-aKtaBQYM.js";import{Pt as n}from"./mui-BgU4WrXF.js";var r=t(((e,t)=>{(function(t,n){typeof define==`function`&&define.amd?define([],n):e===void 0?(n(),t.FileSaver={exports:{}}.exports):n()})(e,function(){function e(e,t){return t===void 0?t={autoBom:!1}:typeof t!=`object`&&(console.warn(`Deprecated: Expected third argument to be a object`),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([`﻿`,e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){s(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function r(e){var t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{var t=document.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||(typeof window!=`object`||window!==a?function(){}:`download`in HTMLAnchorElement.prototype&&!o?function(e,t,o){var s=a.URL||a.webkitURL,c=document.createElement(`a`);t=t||e.name||`download`,c.download=t,c.rel=`noopener`,typeof e==`string`?(c.href=e,c.origin===location.origin?i(c):r(c.href)?n(e,t,o):i(c,c.target=`_blank`)):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){i(c)},0))}:`msSaveOrOpenBlob`in navigator?function(t,a,o){if(a=a||t.name||`download`,typeof t!=`string`)navigator.msSaveOrOpenBlob(e(t,o),a);else if(r(t))n(t,a,o);else{var s=document.createElement(`a`);s.href=t,s.target=`_blank`,setTimeout(function(){i(s)})}}:function(e,t,r,i){if(i||=open(``,`_blank`),i&&(i.document.title=i.document.body.innerText=`downloading...`),typeof e==`string`)return n(e,t,r);var s=e.type===`application/octet-stream`,c=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||o)&&typeof FileReader<`u`){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,f=d.createObjectURL(e);i?i.location=f:location.href=f,i=null,setTimeout(function(){d.revokeObjectURL(f)},4e4)}});a.saveAs=s.saveAs=s,t!==void 0&&(t.exports=s)})}))(),i={top:{style:`thin`},left:{style:`thin`},bottom:{style:`thin`},right:{style:`thin`}},a=async(t,a,o,s)=>{if(o.size===0)return;let{default:c}=await n(async()=>{let{default:t}=await import(`./exceljs.min-BEz_Ja81.js`).then(t=>e(t.default,1));return{default:t}},__vite__mapDeps([0,1])),l=new c.Workbook,u=`FF${s.palette.primary.main.replace(`#`,``).toUpperCase()}`;o.forEach((e,n)=>{let r=l.addWorksheet(n),a=Object.keys(e[0]),o=r.addRow([t]);a.length>1&&r.mergeCells(1,1,1,a.length),o.font={bold:!0},r.addRow(a).eachCell(e=>{e.border=i,e.font={},e.fill={type:`pattern`,pattern:`solid`,fgColor:{argb:u}}}),e.forEach(e=>{let t=a.map(t=>e[t]);r.addRow(t).eachCell({includeEmpty:!0},e=>{e.border=i,e.font={}})}),a.forEach((t,n)=>{let i=String(t).length;e.forEach(e=>{let n=e[t];n!=null&&(i=Math.max(i,(typeof n==`string`?n:String(n)).length))}),r.getColumn(n+1).width=Math.max(i+2,10)})}),(0,r.saveAs)(new Blob([await l.xlsx.writeBuffer()],{type:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`}),a)};export{a as t};