1import{r as D,j as e}from"./index-BzPuTbLk.js";import{E as I}from"./jspdf.es.min-Cmv1E2Cg.js";import{B as F}from"./building-2-BNNJIR_0.js";import{U as k}from"./upload--bSQWYdB.js";import{U as S}from"./user-Dc2R9D8c.js";import{F as h}from"./file-text-BnSX2-DV.js";import{S as P}from"./shopping-cart-Yyv1Aq3W.js";import{P as T}from"./plus-QecSF6bM.js";import{T as L}from"./trash-2-DJiNXjxe.js";import{C as E}from"./calculator-D4I4NkRV.js";import{F as $}from"./file-down-CjGjOnv1.js";import{R}from"./refresh-cw-IbdK4zuP.js";import{E as A}from"./eye-CZMQmEpS.js";import"./FooterTailwind-enAT_Y5V.js";import"./button-C52vHxr1.js";import"./anime.es-DjbxoOUh.js";const _=()=>{const[t,g]=D.useState({businessName:"",businessAddress:"",businessPhone:"",businessEmail:"",businessLicense:"",businessLogo:"",patientName:"",patientContact:"",patientId:"",invoiceNumber:`INV-${Date.now().toString().slice(-6)}`,invoiceDate:new Date().toISOString().split("T")[0],dueDate:new Date(Date.now()+2592e6).toISOString().split("T")[0],lineItems:[],taxRate:0,discount:0,notes:"",currency:"USD"}),i=(s,o)=>{g(n=>({...n,[s]:o}))},f=s=>{var n;const o=(n=s.target.files)==null?void 0:n[0];if(o){const r=new FileReader;r.onloadend=()=>{i("businessLogo",r.result)},r.readAsDataURL(o)}},N=()=>{const s={id:Date.now().toString(),description:"",quantity:1,unitPrice:0,total:0};i("lineItems",[...t.lineItems,s])},j=s=>{i("lineItems",t.lineItems.filter(o=>o.id!==s))},p=(s,o,n)=>{const r=t.lineItems.map(d=>{if(d.id===s){const l={...d,[o]:n};return(o==="quantity"||o==="unitPrice")&&(l.total=l.quantity*l.unitPrice),l}return d});i("lineItems",r)},a=s=>({USD:"$",EUR:"â¬",GBP:"£",INR:"â¹",AUD:"$",CAD:"$"})[s]||"$",y=()=>!(!t.businessName.trim()||!t.patientName.trim()||t.lineItems.length===0),v=()=>{if(y())try{const s=new I({orientation:"portrait",unit:"mm",format:"a4"}),o=s.internal.pageSize.getWidth(),n=15;let r=20;s.setFontSize(20),s.setTextColor(116,86,218),s.text(t.businessName||"Business Name",n,r),r+=7,s.setFontSize(10),s.setTextColor(100,100,100),t.businessAddress&&(s.text(t.businessAddress,n,r),r+=5),t.businessPhone&&(s.text(t.businessPhone,n,r),r+=5),t.businessEmail&&(s.text(t.businessEmail,n,r),r+=5),t.businessLicense&&(s.text(`License: ${t.businessLicense}`,n,r),r+=5),s.setFontSize(18),s.setTextColor(116,86,218),s.text("INVOICE",o-n,20,{align:"right"}),s.setFontSize(9),s.setTextColor(100,100,100),s.text(`Invoice #: ${t.invoiceNumber}`,o-n,28,{align:"right"}),s.text(`Date: ${t.invoiceDate}`,o-n,33,{align:"right"}),s.text(`Due Date: ${t.dueDate}`,o-n,38,{align:"right"}),r+=5,s.setDrawColor(116,86,218),s.setLineWidth(.5),s.line(n,r,o-n,r),r+=10,s.setFontSize(12),s.setTextColor(116,86,218),s.text("Bill To:",n,r),r+=6,s.setFontSize(10),s.setTextColor(0,0,0),s.text(t.patientName||"Patient Name",n,r),r+=5,s.setTextColor(100,100,100),t.patientContact&&(s.text(t.patientContact,n,r),r+=5),t.patientId&&(s.text(`Patient ID: ${t.patientId}`,n,r),r+=5),r+=5,t.lineItems.length>0&&(s.setFillColor(116,86,218,.1),s.rect(n,r,o-2*n,8,"F"),s.setFontSize(10),s.setTextColor(116,86,218),s.text("Description",n+2,r+5.5),s.text("Qty",o-n-80,r+5.5),s.text("Unit Price",o-n-55,r+5.5),s.text("Total",o-n-2,r+5.5,{align:"right"}),r+=10,s.setTextColor(0,0,0),s.setFontSize(9),t.lineItems.forEach(c=>{s.text(c.description||"Service",n+2,r+4),s.text(c.quantity.toString(),o-n-80,r+4),s.text(`${a(t.currency)}${c.unitPrice.toFixed(2)}`,o-n-55,r+4),s.text(`${a(t.currency)}${c.total.toFixed(2)}`,o-n-2,r+4,{align:"right"}),r+=7,s.setDrawColor(200,200,200),s.setLineWidth(.1),s.line(n,r,o-n,r),r+=2})),r+=5;const d=o-n-60;if(s.setFontSize(9),s.setTextColor(100,100,100),s.text("Subtotal:",d,r),s.text(`${a(t.currency)}${u.toFixed(2)}`,o-n-2,r,{align:"right"}),r+=5,t.taxRate>0&&(s.text(`Tax (${t.taxRate}%):`,d,r),s.text(`${a(t.currency)}${m.toFixed(2)}`,o-n-2,r,{align:"right"}),r+=5),t.discount>0&&(s.setTextColor(220,38,38),s.text(`Discount (${t.discount}%):`,d,r),s.text(`-${a(t.currency)}${x.toFixed(2)}`,o-n-2,r,{align:"right"}),r+=5),s.setDrawColor(116,86,218),s.setLineWidth(.5),s.line(d,r,o-n,r),r+=6,s.setFontSize(12),s.setTextColor(116,86,218),s.text("Total:",d,r),s.text(`${a(t.currency)}${b.toFixed(2)}`,o-n-2,r,{align:"right"}),r+=10,t.notes){s.setFillColor(243,244,246);const c=20;s.rect(n,r,o-2*n,c,"F"),s.setFontSize(9),s.setTextColor(116,86,218),s.text("Notes:",
1n+2,r+5),s.setTextColor(60,60,60),s.setFontSize(8);const C=s.splitTextToSize(t.notes,o-2*n-4);s.text(C,n+2,r+10),r+=c+5}const l=s.internal.pageSize.getHeight()-20;s.setDrawColor(200,200,200),s.setLineWidth(.1),s.line(n,l,o-n,l),s.setFontSize(9),s.setTextColor(100,100,100),s.text("Thank you for your business!",o/2,l+5,{align:"center"}),t.businessEmail&&s.text(`For inquiries, contact us at ${t.businessEmail}`,o/2,l+10,{align:"center"}),s.save(`invoice-${t.invoiceNumber}.pdf`)}catch(s){console.error("PDF generation error:",s)}},w=()=>{g({businessName:"",businessAddress:"",businessPhone:"",businessEmail:"",businessLicense:"",businessLogo:"",patientName:"",patientContact:"",patientId:"",invoiceNumber:`INV-${Date.now().toString().slice(-6)}`,invoiceDate:new Date().toISOString().split("T")[0],dueDate:new Date(Date.now()+720*60*60*1e3).toISOString().split("T")[0],lineItems:[],taxRate:0,discount:0,notes:"",currency:"USD"})},u=t.lineItems.reduce((s,o)=>s+o.total,0),m=u*t.taxRate/100,x=u*t.discount/100,b=u+m-x;return e.jsxs("div",{className:"bg-background",children:[e.jsx("header",{className:"bg-primary text-primary-foreground py-8 px-4 shadow-lg",children:e.jsxs("div",{className:"container mx-auto",children:[e.jsx("h1",{className:"text-4xl font-bold mb-2",children:"Medical Invoice Generator"}),e.jsx("p",{className:"text-lg opacity-90",children:"Professional invoices for healthcare businesses"})]})}),e.jsx("main",{className:"container mx-auto px-4 py-8",children:e.jsxs("div",{className:"grid lg:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-card rounded-lg shadow-md border border-border",children:[e.jsx("div",{className:"p-6 border-b border-border",children:e.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2 text-card-foreground",children:[e.jsx(F,{className:"h-5 w-5"}),"Business Information"]})}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"businessName",className:"block text-sm font-medium text-foreground",children:"Business Name *"}),e.jsx("input",{id:"businessName",type:"text",placeholder:"Enter clinic/business name",value:t.businessName,onChange:s=>i("businessName",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"businessAddress",className:"block text-sm font-medium text-foreground",children:"Address"}),e.jsx("input",{id:"businessAddress",type:"text",placeholder:"Business address",value:t.businessAddress,onChange:s=>i("businessAddress",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"businessPhone",className:"block text-sm font-medium text-foreground",children:"Phone"}),e.jsx("input",{id:"businessPhone",type:"tel",placeholder:"Phone number",value:t.businessPhone,onChange:s=>i("businessPhone",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"businessEmail",className:"block text-sm font-medium text-foreground",children:"Email"}),e.jsx("input",{id:"businessEmail",type:"email",placeholder:"Email address",value:t.businessEmail,onChange:s=>i("businessEmail",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"businessLicense",className:"block text-sm font-medium text-foreground",children:"License/Registration Number"}),e.jsx("input",{id:"businessLicense",type:"text",placeholder:"License or registration number",value:t.businessLicense,onChange:s=>i("businessLicense",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"logo",className:"block text-sm font-medium text-foreground",children:"Business Logo"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{htmlFor:"logo",className:"cursor-pointer inline-flex items-center gap-2 px-4 py-2 border border-border rounded-md bg-background text-foreground hover:bg-secondary transition-colors",children:[e.jsx(k,{className:"h-4 w-4"}),"Upload Logo",e.jsx("input",{id:"logo",type:"file",accept:"image/*",className:"hidden",onChange:f})]}),t.businessLogo&&e.jsx("img",{src:t.businessLogo,alt:"Logo preview",className:"h-12 w-12 object-contain"})]})]})]})]}),e.jsxs("div",{className:"bg-card rounded-lg shadow-md border border-border",children:[e.jsx("div",{className:"p-6 border-b border-border",children:e.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2 text-card-foreground",children:[e.jsx(S,{className:"h-5 w-5"}),"Patient/Client Information"]})}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"patientName",className:"block text-sm font-medium text-foreground",children:"Patient Name *"}),e.jsx("input",{id:"patientName",type:"text",placeholder:"Enter patient/client name",value:t.patientName,onChange:s=>i("patientName",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"patientContact",className:"block text-sm font-medium text-foreground",children:"Contact Information"}),e.jsx("input",{id:"patientContact",type:"text",placeholder:"Phone or email",value:t.patientContact,onChange:s=>i("patientContact",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"patientId",className:"block text-sm font-medium text-foreground",children:"Patient ID/Record Number"}),e.jsx("input",{id:"patientId",type:"text",placeholder:"Patient ID or record number",value:t.patientId,onChange:s=>i("patientId",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"})]})]})]}),e.jsxs("div",{className:"bg-card rounded-lg shadow-md border border-border",children:[e.jsx("div",{className:"p-6 border-b border-border",children:e.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2 text-card-foreground",children:[e.jsx(h,{className:"h-5 w-5"}),"Invoice Details"]}
1)}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"invoiceNumber",className:"block text-sm font-medium text-foreground",children:"Invoice Number"}),e.jsx("input",{id:"invoiceNumber",type:"text",value:t.invoiceNumber,onChange:s=>i("invoiceNumber",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"currency",className:"block text-sm font-medium text-foreground",children:"Currency"}),e.jsxs("select",{id:"currency",value:t.currency,onChange:s=>i("currency",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary",children:[e.jsx("option",{value:"USD",children:"USD ($)"}),e.jsx("option",{value:"EUR",children:"EUR (â¬)"}),e.jsx("option",{value:"GBP",children:"GBP (£)"}),e.jsx("option",{value:"INR",children:"INR (â¹)"}),e.jsx("option",{value:"AUD",children:"AUD ($)"}),e.jsx("option",{value:"CAD",children:"CAD ($)"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"invoiceDate",className:"block text-sm font-medium text-foreground",children:"Invoice Date"}),e.jsx("input",{id:"invoiceDate",type:"date",value:t.invoiceDate,onChange:s=>i("invoiceDate",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"dueDate",className:"block text-sm font-medium text-foreground",children:"Due Date"}),e.jsx("input",{id:"dueDate",type:"date",value:t.dueDate,onChange:s=>i("dueDate",s.target.value),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"})]})]})]})]}),e.jsxs("div",{className:"bg-card rounded-lg shadow-md border border-border",children:[e.jsx("div",{className:"p-6 border-b border-border",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2 text-card-foreground",children:[e.jsx(P,{className:"h-5 w-5"}),"Services & Items"]}),e.jsxs("button",{onClick:N,className:"inline-flex items-center gap-1 px-3 py-1.5 bg-accent hover:bg-accent/90 text-accent-foreground rounded-md text-sm font-medium transition-colors",children:[e.jsx(T,{className:"h-4 w-4"}),"Add Item"]})]})}),e.jsx("div",{className:"p-6",children:t.lineItems.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:e.jsx("p",{children:'No items added yet. Click "Add Item" to start.'})}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-3 px-2 text-sm font-semibold text-foreground w-[40%]",children:"Description"}),e.jsx("th",{className:"text-left py-3 px-2 text-sm font-semibold text-foreground w-[15%]",children:"Quantity"}),e.jsx("th",{className:"text-left py-3 px-2 text-sm font-semibold text-foreground w-[20%]",children:"Unit Price"}),e.jsx("th",{className:"text-left py-3 px-2 text-sm font-semibold text-foreground w-[20%]",children:"Total"}),e.jsx("th",{className:"w-[5%]"})]})}),e.jsx("tbody",{children:t.lineItems.map(s=>e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-3 px-2",children:e.jsx("input",{type:"text",placeholder:"Service or item description",value:s.description,onChange:o=>p(s.id,"description",o.target.value),className:"w-full px-2 py-1 border border-input rounded bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-primary"})}),e.jsx("td",{className:"py-3 px-2",children:e.jsx("input",{type:"number",min:"1",value:s.quantity,onChange:o=>p(s.id,"quantity",parseFloat(o.target.value)||0),className:"w-full px-2 py-1 border border-input rounded bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-primary"})}),e.jsx("td",{className:"py-3 px-2",children:e.jsx("input",{type:"number",min:"0",step:"0.01",value:s.unitPrice,onChange:o=>p(s.id,"unitPrice",parseFloat(o.target.value)||0),className:"w-full px-2 py-1 border border-input rounded bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-primary"})}),e.jsxs("td",{className:"py-3 px-2 font-semibold text-foreground text-sm",children:[a(t.currency),s.total.toFixed(2)]}),e.jsx("td",{className:"py-3 px-2",children:e.jsx("button",{onClick:()=>j(s.id),className:"p-1 hover:bg-destructive hover:text-destructive-foreground rounded transition-colors",children:e.jsx(L,{className:"h-4 w-4"})})})]},s.id))})]})})})]}),e.jsxs("div",{className:"bg-card rounded-lg shadow-md border border-border",children:[e.jsx("div",{className:"p-6 border-b border-border",children:e.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2 text-card-foreground",children:[e.jsx(E,{className:"h-5 w-5"}),"Calculations"]})}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"taxRate",className:"block text-sm font-medium text-foreground",children:"Tax Rate (%)"}),e.jsx("input",{id:"taxRate",type:"number",min:"0",max:"100",step:"0.1",value:t.taxRate,onChange:s=>i("taxRate",parseFloat(s.target.value)||0),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"discount",className:"block text-sm font-medium text-foreground",children:"Discount (%)"}),e.jsx("input",{id:"discount",type:"number",min:"0",max:"100",step:"0.1",value:t.discount,onChange:s=>i("discount",parseFloat(s.target.value)||0),className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary"})]})]}),e.jsxs("div",{className:"border-t border-border pt-4 space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Subtotal:"}),e.jsxs("span",{className:"font-medium text-foreground",children:[a(t.currency),u.toFixed(2)]})]}),t.taxRate>0&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:["Tax (",t.taxRate,"%):"]}),e.jsxs("span",{className:"font-medium text-foreground",children:[a(t.currency),m.toFixed(2)]})]}),t.discount>0&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:["Discount (",t.discount,"%):"]}),e.jsxs("span",{className:"font-medium text-destructive",children:["-",a(t.currency),x.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between text-lg font-bold pt-2 border-t border-border",children:[e.jsx("span",{className:"text-foreground",children:"Total:"}),e.jsxs("span",{className:"text-primary",children:[a(t.currency),b.toFixed(2)]})]})]})]})]}),e.jsxs("div",{className:"bg-card rounded-lg shadow-md border border-border",children:[e.jsx("div",{className:"p-6 border-b border-border",children:e.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2 text-card-foreground",children:[e.jsx(h,{className:"h-5 w-5"}),"Notes & Instructions"]})}),e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"notes",className:"block text-sm font-medium text-foreground",children:"Payment Terms, Notes, or Instructions"}),e.jsx("textarea",{id:"notes",placeholder:"Enter payment instructions, terms, or any additional notes...",value:t.notes,onChange:s=>i("notes",s.target.value),rows:4,className:"w-full px-3 py-2 border border-input rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary resize-none"})]})})]}),e.jsxs("div",{className:"flex gap-4 pt-4",children:[e.jsxs("button",{onClick:v,className:"flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-accent hover:bg-accent/90 text-accent-foreground rounded-md font-medium transition-colors",children:[e.jsx($,{className:"h-5 w-5"}),"Generate PDF"]}),e.jsxs("button",{onClick:w,className:"inline-flex items-center justify-center gap-2 px-6 py-3 border border-border hover:bg-secondary rounded-md font-medium transition-colors",children:[e.jsx(R,{className:"h-5 w-5"}),"Reset"]})]})]}),e.jsx("div",{className:"lg:sticky lg:top-4 h-fit",children:e.jsxs("div",{className:"bg-card rounded-lg shadow-md border border-border",children:[e.jsx("div",{className:"p-6 border-b border-border",children:e.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2 text-card-foreground",children:[e.jsx(A,{className:"h-5 w-5"}),"Invoice Preview"]})}),e.jsx("div",{className:"p-6",children:e.jsxs("div",{id:"invoice-preview",className:"bg-white p-8 rounded-lg border border-border",children:[e.jsxs("div",{className:"flex justify-between items-start mb-8 pb-6 border-b-2 border-primary",children:[e.jsxs("div",{children:[t.businessLogo&&e.jsx("img",{src:t.businessLogo,alt:"Logo",className:"h-16 mb-4 object-contain"}),e.jsx("h1",{className:"text-3xl font-bold text-primary mb-2",children:t.businessName||"Business N
1ame"}),t.businessAddress&&e.jsx("p",{className:"text-sm text-muted-foreground",children:t.businessAddress}),t.businessPhone&&e.jsx("p",{className:"text-sm text-muted-foreground",children:t.businessPhone}),t.businessEmail&&e.jsx("p",{className:"text-sm text-muted-foreground",children:t.businessEmail}),t.businessLicense&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["License: ",t.businessLicense]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("h2",{className:"text-2xl font-bold text-primary mb-2",children:"INVOICE"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Invoice #:"})," ",t.invoiceNumber]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Date:"})," ",t.invoiceDate]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Due Date:"})," ",t.dueDate]})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h3",{className:"text-lg font-semibold text-primary mb-2",children:"Bill To:"}),e.jsx("p",{className:"text-foreground font-medium",children:t.patientName||"Patient Name"}),t.patientContact&&e.jsx("p",{className:"text-sm text-muted-foreground",children:t.patientContact}),t.patientId&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Patient ID: ",t.patientId]})]}),t.lineItems.length>0&&e.jsx("div",{className:"mb-8",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-primary/10",children:[e.jsx("th",{className:"text-left py-3 px-4 text-primary font-semibold",children:"Description"}),e.jsx("th",{className:"text-center py-3 px-4 text-primary font-semibold",children:"Qty"}),e.jsx("th",{className:"text-right py-3 px-4 text-primary font-semibold",children:"Unit Price"}),e.jsx("th",{className:"text-right py-3 px-4 text-primary font-semibold",children:"Total"})]})}),e.jsx("tbody",{children:t.lineItems.map(s=>e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-3 px-4 text-foreground",children:s.description||"Service"}),e.jsx("td",{className:"py-3 px-4 text-center text-foreground",children:s.quantity}),e.jsxs("td",{className:"py-3 px-4 text-right text-foreground",children:[a(t.currency),s.unitPrice.toFixed(2)]}),e.jsxs("td",{className:"py-3 px-4 text-right font-medium text-foreground",children:[a(t.currency),s.total.toFixed(2)]})]},s.id))})]})}),e.jsx("div",{className:"flex justify-end mb-8",children:e.jsxs("div",{className:"w-64 space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Subtotal:"}),e.jsxs("span",{className:"font-medium text-foreground",children:[a(t.currency),u.toFixed(2)]})]}),t.taxRate>0&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:["Tax (",t.taxRate,"%):"]}),e.jsxs("span",{className:"font-medium text-foreground",children:[a(t.currency),m.toFixed(2)]})]}),t.discount>0&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:["Discount (",t.discount,"%):"]}),e.jsxs("span",{className:"font-medium text-red-600",children:["-",a(t.currency),x.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between text-lg font-bold pt-2 border-t-2 border-primary",children:[e.jsx("span",{className:"text-primary",children:"Total:"}),e.jsxs("span",{className:"text-primary",children:[a(t.currency),b.toFixed(2)]})]})]})}),t.notes&&e.jsxs("div",{className:"mb-8 p-4 bg-muted/50 rounded",children:[e.jsx("h3",{className:"text-sm font-semibold text-primary mb-2",children:"Notes:"}),e.jsx("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:t.notes})]}),e.jsxs("div",{className:"text-center pt-6 border-t border-border",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Thank you for your business!"}),t.businessEmail&&e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["For inquiries, contact us at ",t.businessEmail]})]})]})})]})})]})})]})};export{_ as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.