1import{r as h,j as e,X as k,t as v}from"./index-DSugmHUS.js";import{B as m}from"./button-m1DExL1R.js";import{D as P,a as T,b as I,c as E}from"./dialog-CIarVAiX.js";import{e as S,h as N}from"./forms-sync-AQymZ2vX.js";import{f as R}from"./alert-dialog-B3LhExJT.js";import{U as A}from"./upload-K036n70S.js";import{C}from"./index-PNcq8FZ2.js";import{E as q}from"./eye-DKj9YflC.js";import"./index-Be40SeTS.js";import"./client-ChDlC2U2.js";import"./duplicate-block-message-3iGWS-XC.js";import"./app-settings-store-xfeo64yl.js";import"./auth-identity-DzeYk6GR.js";import"./forms-data-C22rYxwX.js";import"./orders-data-BfL7ogtZ.js";import"./UIPreferencesProvider-z_xzDbof.js";const s={brand:"Your Brand",storeAddress:"12 Shop Way, Lekki Phase 1, Lagos",storePhone:"+234 900 000 0000",storeEmail:"[email protected]",orderId:"KX-1042",date:"May 29, 2026",customer:"Femi Eze",customerPhone:"+234 807 000 0000",email:"[email protected]",items:[{name:"Premium Hair Oil 100ml",qty:2,price:7500},{name:"Silk Pillowcase",qty:1,price:12e3},{name:"Wide-Tooth Comb",qty:1,price:2500}],currency:"â¦",shipping:1500,tax:0},p=a=>a.items.reduce((t,l)=>t+l.qty*l.price,0),x=a=>p(a)+a.shipping+a.tax,i=(a,t="â¦")=>R(a,t),L=({logo:a})=>e.jsxs("div",{className:"bg-white text-neutral-900 p-6 font-serif text-[11px] leading-relaxed",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-neutral-300 pb-3",children:[a?e.jsx("img",{src:a,alt:"logo",className:"h-8 object-contain"}):e.jsx("div",{className:"text-lg font-semibold tracking-wide",children:s.brand}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"uppercase tracking-[0.2em] text-[10px] text-neutral-500",children:"Receipt"}),e.jsx("div",{className:"font-medium",children:s.orderId})]})]}),e.jsxs("div",{className:"text-[10px] text-neutral-500 mt-1",children:[s.storeAddress," · ",s.storePhone," · ",s.storeEmail]}),e.jsxs("div",{className:"flex justify-between text-[10px] text-neutral-500 mt-3",children:[e.jsxs("div",{children:[e.jsxs("div",{children:["Billed to ",s.customer]}),e.jsxs("div",{children:[s.customerPhone," · ",s.email]})]}),e.jsx("span",{children:s.date})]}),e.jsx("table",{className:"w-full mt-4",children:e.jsx("tbody",{children:s.items.map((t,l)=>e.jsxs("tr",{className:"border-b border-dashed border-neutral-200",children:[e.jsxs("td",{className:"py-1.5",children:[t.name," ",e.jsxs("span",{className:"text-neutral-400",children:["à ",t.qty]})]}),e.jsx("td",{className:"py-1.5 text-right",children:i(t.qty*t.price)})]},l))})}),e.jsxs("div",{className:"mt-3 space-y-1 text-[10px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Subtotal"}),e.jsx("span",{children:i(p(s))})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Shipping"}),e.jsx("span",{children:i(s.shipping)})]})]}),e.jsxs("div",{className:"border-t border-neutral-900 mt-3 pt-2 flex justify-between font-semibold text-[12px]",children:[e.jsx("span",{children:"Total"}),e.jsx("span",{children:i(x(s))})]}),e.jsx("p",{className:"text-center text-[10px] text-neutral-500 mt-4 italic",children:"Thank you for your purchase."})]}),O=({logo:a})=>e.jsx("div",{className:"bg-yellow-300 text-black p-6 font-mono text-[11px]",children:e.jsxs("div",{className:"border-4 border-black p-3 bg-white",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[a?e.jsx("img",{src:a,alt:"logo",className:"h-8 object-contain"}):e.jsx("div",{className:"text-xl font-black uppercase",children:s.brand}),e.jsx("div",{className:"bg-black text-yellow-300 px-2 py-0.5 text-[10px] font-bold",children:"PAID"})]}),e.jsxs("div",{className:"mt-1 text-[9px] uppercase",children:[s.storeAddress," · ",s.storePhone," · ",s.storeEmail]}),e.jsxs("div",{className:"mt-3 text-[10px] uppercase tracking-wider",children:["Order ",s.orderId," · ",s.date]}),e.jsxs("div",{className:"mt-1 text-[10px]",children:["Buyer: ",s.customer," · ",s.customerPhone," · ",s.email]}),e.jsx("div",{className:"border-t-2 border-dashed border-black my-3"}),s.items.map((t,l)=>e.jsxs("div",{className:"flex justify-between py-0.5",children:[e.jsxs("span",{children:[t.qty,"à ",t.name]}),e.jsx("span",{className:"font-bold",children:i(t.qty*t.price)})]},l)),e.jsx("div",{className:"border-t-2 border-dashed border-black my-3"}),e.jsxs("div",{className:"flex justify-between text-[14px] font-black uppercase",children:[e.jsx("span",{children:"Total"}),e.jsx("span",{children:i(x(s))})]})]})}),B=({logo:a})=>e.jsxs("div",{className:"bg-neutral-950 text-neutral-100 p-6 font-sans text-[11px]",children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsxs("div",{children:[a?e.jsx("img",{src:a,alt:"logo",className:"h-8 object-contain"}):e.jsx("div",{className:"text-lg font-light tracking-[0.3em]",children:s.brand.toUpperCase()}),e.jsxs("div",{className:"text-[10px] text-neutral-500 mt-1",children:["RECEIPT · ",s.orderId]}),e.jsx("div",{className:"text-[9px] text-neutral-500",children:s.storeAddress}),e.jsxs("div",{className:"text-[9px] text-neutral-500",children:[s.storePhone," · ",s.storeEmail]})]}),e.jsxs("div",{className:"text-right text-[10px] text-neutral-500",children:[e.jsx("div",{children:s.date}),e.jsx("div",{className:"mt-2 text-neutral-300",children:s.customer}),e.jsx("div",{children:s.customerPhone}),e.jsx("div",{children:s.email})]})]}),e.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-amber-400 to-transparent my-4"}),s.items.map((t,l)=>e.jsxs("div",{className:"flex justify-between py-1.5 border-b border-neutral-800",children:[e.jsxs("div",{children:[e.jsx("div",{children:t.name}),e.jsxs("div",{className:"text-[10px] text-neutral-500",children:["Qty ",t.qty]})]}),e.jsx("div",{className:"text-amber-400",children:i(t.qty*t.price)})]},l)),e.jsxs("div",{className:"mt-4 flex justify-between items-baseline",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-widest text-neutral-500",children:"Total Due"}),e.jsx("span",{className:"text-2xl font-light text-amber-400",children:i(x(s))})]})]}),z=({logo:a})=>e.jsx("div",{className:"bg-gradient-to-br from-pink-400 via-fuchsia-500 to-indigo-500 p-6 text-white font-sans text-[11px]",children:e.jsxs("div",{className:"bg-white/15 backdrop-blur rounded-2xl p-4 border border-white/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[a?e.jsx("img",{src:a,alt:"logo",className:"h-8 object-contain"}):e.jsxs("div",{className:"text-lg font-bold",children:["⨠",s.brand]}),e.jsxs("div",{className:"text-[10px] bg-white/20 rounded-full px-2 py-0.5",children:["#",s.orderId]})]}),e.jsxs("div",{className:"mt-1 text-[9px] opacity-80",children:[s.storeAddress," · ",s.storePhone," · ",s.storeEmail]}),e.jsxs("div",{className:"mt-3 text-[10px] opacity-90",children:["Hey ",s.customer.split(" ")[0],"! â ",s.customer,e.jsx("br",{}),s.customerPhone," · ",s.email]}),e.jsx("div",{className:"mt-3 space-y-2",children:s.items.map((t,l)=>e.jsxs("div",{className:"flex justify-between bg-white/10 rounded-lg px-3 py-1.5",children:[e.jsx("span",{children:t.name}),e.jsx("span",{className:"font-semibold",children:i(t.qty*t.price)})]},l))}),e.jsxs("div",{className:"mt-4 flex justify-between border-t border-white/30 pt-3",children:[e.jsx("span",{className:"opacity-80",children:"Total"}),e.jsx("span",{className:"font-bold text-lg",children:i(x(s))})]})]})}),D=({logo:a})=>e.jsx("div",{className:"bg-neutral-100 p-4 font-mono text-[10px] text-black flex justify-center",children:e.jsxs("div",{className:"bg-white px-3 py-4 w-full max-w-[220px] shadow-sm",style:{backgroundImage:"repeating-linear-gradient(0deg,#fff,#fff 2px,#fafafa 2px,#fafafa 4px)"},children:[e.jsxs("div",{className:"text-center",children:[a?e.jsx("img",{src:a,alt:"logo",className:"h-8 object-contain mx-auto"}):e.jsx("div",{className:"font-bold text-[12px]",children:s.brand.toUpperCase()}),e.jsx("div",{className:"text-[9px]",children:s.storeAddress}),e.jsx("div",{className:"text-[9px]",children:s.storePhone}),e.jsx("div",{className:"text-[9px]",children:s.storeEmail}),e.jsx("div",{children:"--- RECEIPT ---"}),e.jsx("div",{children:s.date}),e.jsxs("div",{children:["Order: ",s.orderId]})]}),e.jsx("div",{className:"border-t border-dashed border-black my-2"}),e.jsxs("div",{className:"text-[9px]",children:[e.jsxs("div",{children:["Customer: ",s.customer]}),e.jsxs("div",{children:["Tel: ",s.customerPhone]}),e.jsxs("div",{children:["Email: ",s.email]})]}),e.jsx("div",{className:"border-t border-dashed border-black my-2"}),s.items.map((t,l)=>e.jsxs("div",{children:[e.jsx("div",{children:t.name}),e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("span",{children:[" ",t.qty," x ",i(t.price)]}),e.jsx("span",{children:i(t.qty*t.price)})]})]},l)),e.jsx("div",{className:"border-t border-dashed border-black my-2"}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"SUBTOTAL"}),e.jsx("span",{children:i(p(s))})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"SHIPPING"}),e.jsx("span",{children:i(s.shipping)})]}),e.jsxs("div",{className:"flex justify-between font-bold",children:[e.jsx("span",{children:"TOTAL"}),e.jsx("span",{children:i(x(s))})]}),e.jsx("div",{className:"border-t border-dashed border-black my-2"}),e.jsx("div",{className:"text-center",children:"** THANK YOU **"})]})}),U=({logo:a})=>e.jsxs("div",{className:"bg-white text-slate-900 p-6 font-sans text-[11px]",children:[e.jsxs("div",{className:"bg-slate-900 -m-6 mb-4 p-6 text-white flex justify-between items-start",children:[e.jsxs("div",{children:[a?e.jsx("img",{src:a,alt:"logo",className:"h-10 object-contain bg-white rounded p-1"}):e.jsx("div",{className:"text-xl font-bold",children:s.brand}),e.jsx("div",{className:"text-[9px] opacity-80 mt-1",children:s.storeAddress}),e.jsxs("div",{className:"text-[9px] opacity-80",children:[s.storePhone," · ",s.storeEmail]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider opacity-70",children:"Invoice"}),e.jsx("div",{className:"text-lg font-semibold",children:s.orderId})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-[10px] mb-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-slate-500 uppercase tracking-wider mb-1",children:"Bill To"}),e.jsx("div",{className:"font-medium",children:s.customer}),e.jsx("div",{className:"text-slate-500",children:s.customerPhone}),e.jsx("div",{className:"text-slate-500",children:s.email})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-slate-500 uppercase tracking-wider mb-1",children:"Issued"}),e.jsx("div",{className:"font-medium",children:s.date})]})]}),e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-slate-100 text-[10px] uppercase tracking-wider text-slate-600",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left p-2",children:"Item"}),e.jsx("th",{className:"text-right p-2",children:"Qty"}),e.jsx("th",{className:"text-right p-2",children:"Amount"})]})}),e.jsx("tbody",{children:s.items.map((t,l)=>e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsx("td",{className:"p-2",children:t.name}),e.jsx("td",{className:"p-2 text-right",children:t.qty}),e.jsx("td",{className:"p-2 text-right",children:i(t.qty*t.price)})]},l))})]}),e.jsx("div",{className:"mt-3 flex justify-end",children:e.jsxs("div",{className:"w-40 space-y-1 text-[10px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-500",children:"Subtotal"}),e.jsx("span",{children:i(p(s))})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-500",children:"Shipping"}),e.jsx("span",{children:i(s.shipping)})]}),e.jsxs("div",{className:"flex justify-between border-t pt-1 font-bold text-[12px]",children:[e.jsx("span",{children:"Total"}),e.jsx("span",{children:i(x(s))})]})]})})]}),M=({logo:a})=>e.jsxs("div",{className:"bg-stone-50 text-stone-900 p-6 text-[11px]",style:{fontFamily:"Georgia, serif"},children:[e.jsxs("div",{className:"border-t-4 border-stone-900 pt-3",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[a?e.jsx("img",{src:a,alt:"logo",className:"h-7 object-contain"}):e.jsx("div",{className:"text-2xl italic font-light",children:s.brand}),e.jsxs("div",{className:"text-[10px] uppercase tracking-[0.3em] text-stone-500",children:["No. ",s.orderId]})]}),e.jsxs("div",{className:"text-[10px] text-stone-500 italic mt-1",children:[s.storeAddress," · ",s.storePhone," · ",s.storeEmail]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-5 text-[10px]",children:[e.jsxs("div",{className:"col-span-1 border-r border-stone-300 pr-3",children:[e.jsx("div",{className:"uppercase tracking-widest text-stone-500 mb-1",children:"Patron"}),e.jsx("div",{className:"italic",children:s.customer}),e.jsx("div",{className:"italic text-stone-600",children:s.customerPhone}),e.jsx("div",{className:"italic text-stone-600",children:s.email}),e.jsx("div",{className:"uppercase tracking-widest text-stone-500 mt-3 mb-1",children:"Date"}),e.jsx("div",{className:"italic",children:s.date})]}),e.jsxs("div",{className:"col-span-2",children:[s.items.map((t,l)=>e.jsxs("div",{className:"flex justify-between py-2 border-b border-stone-200",children:[e.jsx("span",{className:"italic",children:t.name}),e.jsx("span",{children:i(t.qty*t.price)})]},l)),e.jsxs("div",{className:"flex justify-between mt-3 text-[14px] font-semibold",children:[e.jsx("span",{className:"italic",children:"Total"}),e.jsx("span",{children:i(x(s))})]})]})]})]}),G=({logo:a})=>e.jsx("div",{className:"bg-emerald-950 text-emerald-100 p-6 font-mono text-[11px]",children:e.jsxs("div",{className:"border border-emerald-700/50 rounded-md p-4 bg-emerald-900/40",children:[e.jsxs("div",{className:"flex items-center justify-between text-emerald-300",children:[a?e.jsx("img",{src:a,alt:"logo",className:"h-7 object-contain"}):e.jsxs("div",{className:"text-[12px]",children:["[ ",s.brand.toLowerCase()," ]"]}),e.jsxs("div",{className:"text-[10px]",children:["$ receipt --id ",s.orderId]})]}),e.jsxs("div",{className:"mt-1 text-[9px] text-emerald-500",children:["# store: ",s.storeAddress," · ",s.storePhone," · ",s.storeEmail]}),e.jsxs("div",{className:"mt-3 text-[10px] text-emerald-500",children:["> customer: ",s.customer,e.jsx("br",{}),"> phone: ",s.customerPhone,e.jsx("br",{}),"> email: ",s.email,e.jsx("br",{}),"> date: ",s.date]}),e.jsx("div",{className:"mt-3 border-t border-emerald-800 pt-2",children:s.items.map((t,l)=>e.jsxs("div",{className:"flex justify-between py-1",children:[e.jsxs("span",{children:["ââ ",t.name," ",e.jsxs("span",{className:"text-emerald-500",children:["Ã",t.qty]})]}),e.jsx("span",{className:"text-emerald-300",children:i(t.qty*t.price)})]},l))}),e.jsxs("div",{className:"mt-3 border-t border-emerald-800 pt-2 space-y-0.5 text-emerald-500",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"subtotal"}),e.jsx("span",{children:i(p(s))})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"shipping"}),e.jsx("span",{children:i(s.shipping)})]})]}),e.jsxs("div",{className:"mt-2 flex justify-between text-emerald-200 text-[14px]",children:[e.jsx("span",{children:"=> TOTAL"}),e.jsx("span",{children:i(x(s))})]})]})}),H=({logo:a})=>{const t={name:s.brand,address:s.storeAddress,phone:s.storePhone,email:s.storeEmail},l={name:s.customer,phone:s.customerPhone,address:"52, Akinmakinwa Street, Abuja",email:s.email};return e.jsxs("div",{className:"bg-white text-neutral-900 p-6 font-sans text-[11px] leading-relaxed",children:[e.jsx("div",{className:"text-center text-[10px] uppercase tracking-[0.25em] text-neutral-500 mb-3",children:"Order Invoice"}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("div",{className:"text-right",children:[a&&e.jsx("img",{src:a,alt:"logo",className:"h-8 object-contain ml-auto mb-1"}),e.jsx("div",{className:"font-bold text-[13px]",children:t.name}),e.jsx("div",{className:"text-neutral-600",children:t.address}),e.jsx("div",{className:"text-neutral-600",children:t.phone}),e.jsx("div",{className:"text-neutral-600",children:t.email})]})}),e.jsx("div",{className:"flex justify-end mt-3",children:e.jsxs("div",{className:
1"text-right text-[10px]",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-semibold uppercase tracking-wider",children:"Invoice #:"})," ",e.jsx("span",{className:"text-neutral-700",children:s.orderId})]}),e.jsxs("div",{className:"text-neutral-500 mt-0.5",children:["Order Placed On: ",s.date]})]})}),e.jsxs("div",{className:"mt-5",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-neutral-500 mb-1",children:"Invoice To:"}),e.jsx("div",{className:"font-semibold",children:l.name}),e.jsx("div",{className:"text-neutral-600",children:l.phone}),e.jsx("div",{className:"text-neutral-600",children:l.address}),e.jsx("div",{className:"text-neutral-600",children:l.email})]}),e.jsxs("table",{className:"w-full mt-5 border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-neutral-100 text-[10px] uppercase tracking-wider text-neutral-700",children:[e.jsx("th",{className:"text-left p-2 border border-neutral-300",children:"Product Name"}),e.jsx("th",{className:"text-left p-2 border border-neutral-300",children:"Quantity"}),e.jsx("th",{className:"text-right p-2 border border-neutral-300",children:"Total"})]})}),e.jsxs("tbody",{children:[s.items.map((c,o)=>e.jsxs("tr",{children:[e.jsx("td",{className:"p-2 border border-neutral-300 align-top",children:c.name}),e.jsxs("td",{className:"p-2 border border-neutral-300 align-top",children:[c.qty," Unit",c.qty>1?"s":""]}),e.jsx("td",{className:"p-2 border border-neutral-300 text-right align-top",children:i(c.qty*c.price)})]},o)),e.jsxs("tr",{className:"bg-neutral-50 font-bold",children:[e.jsx("td",{className:"p-2 border border-neutral-300 uppercase",children:"Grand Total"}),e.jsx("td",{className:"p-2 border border-neutral-300"}),e.jsx("td",{className:"p-2 border border-neutral-300 text-right",children:i(x(s))})]})]})]}),e.jsx("p",{className:"text-center mt-4 text-[11px]",children:"Thank you!"}),e.jsxs("div",{className:"mt-3 text-[10px]",children:[e.jsx("div",{className:"font-semibold uppercase tracking-wider",children:"Notice:"}),e.jsx("div",{className:"text-neutral-600",children:"VAT 7.5% Incl."})]}),e.jsx("p",{className:"text-[9px] text-neutral-500 italic text-center mt-3",children:"Invoice was created on a computer and is valid without the signature and seal."})]})},b=[{id:"tpl9",name:"Business Invoice",vibe:"Formal · itemized",Render:H},{id:"tpl1",name:"Classic Minimal",vibe:"Serif · whitespace",Render:L},{id:"tpl2",name:"Bold Brutalist",vibe:"High contrast · mono",Render:O},{id:"tpl3",name:"Elegant Dark",vibe:"Premium · gold accent",Render:B},{id:"tpl4",name:"Playful Gradient",vibe:"Vibrant · glass",Render:z},{id:"tpl5",name:"Thermal Print",vibe:"POS slip style",Render:D},{id:"tpl6",name:"Corporate Invoice",vibe:"Structured · slate",Render:U},{id:"tpl7",name:"Editorial",vibe:"Magazine · serif",Render:M},{id:"tpl8",name:"Tech Terminal",vibe:"Mono · console",Render:G}];function le(){var g;const[a,t]=h.useState("tpl9"),[l,c]=h.useState(""),[o,j]=h.useState(null),f=h.useRef(null);h.useEffect(()=>{S().then(r=>{r.templateId&&t(r.templateId),r.logo&&c(r.logo)})},[]);const u=r=>{var d;t(r),N({templateId:r}),v({title:"Template selected",description:(d=b.find(n=>n.id===r))==null?void 0:d.name})},y=r=>{if(r.size>2*1024*1024){v({title:"Logo too large",description:"Use an image under 2MB.",variant:"destructive"});return}const d=new FileReader;d.onload=()=>{const n=String(d.result||"");c(n),N({logo:n}),v({title:"Logo uploaded"})},d.readAsDataURL(r)},w=()=>{c(""),N({logo:""})};return e.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Receipt Templates"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose how your order invoices & receipts look. Selected template applies to all new orders."})]}),e.jsxs("div",{className:"flex items-center gap-3 border border-border rounded-lg p-3 bg-card",children:[e.jsx("div",{className:"h-10 w-10 rounded-md bg-muted flex items-center justify-center overflow-hidden",children:l?e.jsx("img",{src:l,alt:"logo",className:"h-full w-full object-contain"}):e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"LOGO"})}),e.jsxs("div",{className:"text-xs",children:[e.jsx("div",{className:"font-medium",children:"Brand logo"}),e.jsx("div",{className:"text-muted-foreground",children:"PNG / JPG · up to 2MB"})]}),e.jsx("input",{ref:f,type:"file",accept:"image/*",className:"hidden",onChange:r=>{var n;const d=(n=r.target.files)==null?void 0:n[0];d&&y(d),r.target.value=""}}),e.jsxs(m,{size:"sm",variant:"outline",onClick:()=>{var r;return(r=f.current)==null?void 0:r.click()},children:[e.jsx(A,{className:"h-3.5 w-3.5 mr-1.5"})," ",l?"Replace":"Upload"]}),l&&e.jsx(m,{size:"sm",variant:"ghost",onClick:w,children:e.jsx(k,{className:"h-3.5 w-3.5"})})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4",children:b.map(r=>{const d=a===r.id;return e.jsxs("div",{className:`group relative border rounded-lg overflow-hidden bg-card transition-all cursor-pointer ${d?"border-primary ring-2 ring-primary/30":"border-border hover:border-primary/50"}`,onClick:()=>u(r.id),children:[d&&e.jsx("div",{className:"absolute top-2 right-2 z-10 bg-primary text-primary-foreground rounded-full h-6 w-6 flex items-center justify-center shadow",children:e.jsx(C,{className:"h-3.5 w-3.5"})}),e.jsx("div",{className:"h-72 overflow-hidden",children:e.jsx(r.Render,{logo:l})}),e.jsxs("div",{className:"border-t border-border p-3 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium truncate",children:r.name}),e.jsx("div",{className:"text-[11px] text-muted-foreground truncate",children:r.vibe})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsxs(m,{size:"sm",variant:"ghost",onClick:n=>{n.stopPropagation(),j(r.id)},title:"Preview",children:[e.jsx(q,{className:"h-3.5 w-3.5 mr-1"})," Preview"]}),e.jsx(m,{size:"sm",variant:d?"default":"outline",onClick:n=>{n.stopPropagation(),u(r.id)},children:d?"Selected":"Select"})]})]})]},r.id)})}),e.jsx(P,{open:!!o,onOpenChange:r=>!r&&j(null),children:e.jsxs(T,{className:"max-w-3xl p-0 overflow-hidden",children:[e.jsx(I,{className:"px-6 pt-5 pb-3 border-b border-border",children:e.jsxs(E,{children:[(g=b.find(r=>r.id===o))==null?void 0:g.name," â Full preview"]})}),e.jsx("div",{className:"max-h-[75vh] overflow-y-auto bg-muted/30 p-6",children:e.jsx("div",{className:"mx-auto max-w-2xl shadow-lg rounded-md overflow-hidden bg-white",children:(()=>{const r=b.find(n=>n.id===o);if(!r)return null;const d=r.Render;return e.jsx("div",{className:"text-[14px]",children:e.jsx(d,{logo:l})})})()})}),e.jsxs("div",{className:"px-6 py-3 border-t border-border flex justify-end gap-2",children:[e.jsx(m,{variant:"outline",onClick:()=>j(null),children:"Close"}),o&&e.jsx(m,{onClick:()=>{u(o),j(null)},children:a===o?"Selected":"Select this template"})]})]})})]})}export{le as ReceiptTemplatesPage};
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.