`;
pdfZoneList.insertAdjacentHTML('beforeend', block);
});
const canvas = await html2canvas(pdfReportElement, { scale: 2 });
const imgData = canvas.toDataURL('image/jpeg', 0.9);
const pdf = new jsPDF('p', 'mm', 'a4');
const pdfWidth = pdf.internal.pageSize.getWidth();
const pdfHeight = (canvas.height * pdfWidth) / canvas.width;
pdf.addImage(imgData, 'JPEG', 0, 0, pdfWidth, pdfHeight);
pdf.save('Shipping-Zone-Configuration.pdf');
}
// --- INITIALIZATION ---
function init() {
shippingZones = [
{ id: 1, name: 'West Coast', locations: ['CA', 'OR', 'WA', 'NV', 'AZ'] },
{ id: 2, name: 'Midwest', locations: ['IL', 'IN', 'IA', 'KS', 'MI', 'MN', 'MO', 'NE', 'ND', 'OH', 'SD', 'WI'] },
{ id: 3, name: 'Northeast', locations: ['CT', 'ME', 'MA', 'NH', 'NJ', 'NY', 'PA', 'RI', 'VT'] },
{ id: 4, name: 'Canada', locations: ['CANADA']}
];
renderAll();
}
init();
});
