PageSourceSearch

https://hsl.co.in/build/assets/Bill-DdwbKFF8.js

js hsl.co.in collected 2026-10-09 22:41:10 UTC 10,217 bytes, 7 lines download raw bytes

1import{j as e,x as b}from"./app-Mnt2IEGe.js";import{G as w}from"./GuestLayout-BYnLiqFZ.js";import{c as N}from"./ApplicationLogo-JvKRx6b1.js";import"./x-B1Pn9Kmg.js";import"./message-circle-D4MbkUVn.js";import"./phone-DSAsYLtt.js";import"./chevron-down-BlAiga6f.js";import"./user-ad0RTXxq.js";import"./package-CT4joqbC.js";import"./map-pin-BuVEKMGp.js";import"./truck-CpGakV_6.js";import"./shopping-cart-DokKNEt4.js";import"./search-BeXkNHdv.js";import"./clock-Dnho5FNh.js";import"./shield-Da3uiB5y.js";import"./mail-Ce-sk81h.js";/**
2 * @license lucide-react v0.525.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const _=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],P=N("arrow-down",_),c=t=>`₹${Number(t||0).toFixed(2)}`,D=t=>{if(!t)return"—";try{return new Intl.DateTimeFormat("en-IN",{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}};function z({order:t}){if(!t)return e.jsx(w,{children:e.jsx("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-16 text-center",children:e.jsxs("div",{className:"bg-white border rounded-3xl p-8 shadow-sm space-y-4",children:[e.jsx("h1",{className:"text-2xl font-semibold text-slate-900",children:"Order not found"}),e.jsx("p",{className:"text-sm text-slate-600",children:"This bill is not available."}),e.jsx(b,{href:typeof route=="function"?route("shop.index"):"/shop",className:"inline-flex items-center justify-center px-6 py-2 rounded-xl bg-indigo-600 text-white text-sm font-semibold hover:bg-indigo-700 transition",children:"Back to Shop"})]})})});const f={name:"HSL SALES (INDIA)",address:"721/A 11th Milestone, Faizabad Road, Chinhat, Lucknow, Uttar Pradesh, 226028",phone:"+91 8960221100"},y=Array.isArray(t.items)?t.items:[],j=[t.shipping_address,[t.city,t.state].filter(Boolean).join(", "),t.pincode].filter(s=>s&&String(s).trim()!==""),v=async()=>{if(typeof window>"u"||typeof document>"u")return;const s=document.getElementById("bill-printable");if(!s)return;const m=l=>new Promise((i,r)=>{if(document.querySelector(`script[src="${l}"]`))return i();const a=document.createElement("script");a.src=l,a.onload=()=>i(),a.onerror=u=>r(u),document.head.appendChild(a)});try{typeof window.html2canvas>"u"&&await m("https://cdn.jsdelivr.net/npm/[email protected]/dist/html2canvas.min.js"),typeof window.jspdf>"u"&&typeof window.jsPDF>"u"&&await m("https://cdn.jsdelivr.net/npm/[email protected]/dist/jspdf.umd.min.js");const l=window.html2canvas||window.HTML2Canvas||window.html2canvas&&window.html2canvas.default,i=window.jspdf||window.jspdf?window.jspdf:window.jspdf&&window.jspdf.jsPDF||window.jspdf&&window.jspdf.default||window.jsPDF||window.jspdf&&window.jspdf.jsPDF,r=i&&i.jsPDF?i.jsPDF:window.jsPDF||i&&i.default&&i.default.jsPDF;if(!l||!r)throw new Error("PDF libraries not available");const a=s.cloneNode(!0);a.querySelectorAll('button, a, [class*="print:hidden"], .no-export').forEach(g=>g.remove());const d=document.createElement("div");d.style.position="fixed",d.style.left="-9999px",d.style.top="0",d.appendChild(a),document.body.appendChild(d);const x=await l(a,{scale:1.5,useCORS:!0,backgroundColor:"#ffffff"});d.remove();const p=x.toDataURL("image/jpeg",.92),n=new r({unit:"mm",format:"a4",orientation:"portrait",compress:!0}),o=n.internal.pageSize.getWidth(),h=x.height*o/x.width;n.addImage(p,"JPEG",0,0,o,h),n.save(`${t.order_number}-bill.pdf`);return}catch(l){console.warn("PDF generation failed, falling back to HTML download",l)}try{const l=s.cloneNode(!0);l.querySelectorAll('button, a, [class*="print:hidden"], .no-export').forEach(o=>o.remove());let r="";for(const o of Array.from(document.styleSheets))try{if(!o.cssRules)continue;for(const h of Array.from(o.cssRules))r+=h.cssText+`
7`}catch{}const d=`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Bill - ${t.order_number}</title><style>body{background:#fff;color:#111;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial} ${r}</style></head><body>`+l.innerHTML+"</body></html>",x=new Blob([d],{type:"text/html"}),p=URL.createObjectURL(x),n=document.createElement("a");n.href=p,n.download=`${t.order_number}-bill.html`,document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(p)}catch(l){console.error("Fallback download failed",l)}};return e.jsxs(w,{children:[e.jsx("style",{children:"@media print { body * { visibility: hidden !important; } #bill-printable, #bill-printable * { visibility: visible !important; } #bill-printable { position: absolute; left: 0; top: 0; width: 100%; } }"}),e.jsx("style",{children:"@media print { #bill-printable .bill-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 1.5rem !important; } }"}),e.jsx("div",{id:"bill-printable",className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:e.jsxs("div",{className:"bg-white border rounded-2xl shadow-sm p-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/img/haslab-logo.png",alt:"Haslab",className:"h-12 mb-2"}),e.jsx("div",{className:"text-xs uppercase tracking-wide text-slate-500",children:"Invoice"}),e.jsx("div",{className:"text-2xl font-bold text-slate-900",children:"Bill"})]}),e.jsxs("div",{className:"sm:text-right",children:[e.jsx("div",{className:"text-xs text-slate-500",children:"Bill #"}),e.jsx("div",{className:"font-mono font-semibold text-lg text-slate-900",children:t.order_number}),e.jsxs("div",{className:"text-xs text-slate-500",children:["Placed: ",D(t.created_at)]})]})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-2 gap-6 bill-grid",children:[e.jsxs("div",{className:"rounded-xl border border-slate-100 bg-slate-50 p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-slate-500 mb-2",children:"Bill From"}),e.jsx("div",{className:"font-semibold text-slate-900",children:f.name}),e.jsx("div",{className:"text-sm text-slate-700",children:f.address}),e.jsxs("div",{className:"text-sm text-slate-700",children:["Phone: ",f.phone]})]}),e.jsxs("div",{className:"rounded-xl border border-slate-100 bg-slate-50 p-4 md:text-right",children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-slate-500 mb-2",children:"Bill To"}),e.jsx("div",{className:"font-semibold text-slate-900",children:t.customer_name}),e.jsx("div",{className:"text-sm text-slate-700",children:t.customer_email}),e.jsx("div",{className:"text-sm text-slate-700",children:t.customer_phone})]})]}),e.jsxs("div",{className:"mt-6 rounded-xl border border-slate-100 p-4",children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-slate-500 mb-2",children:"Shipping Address"}),j.length===0?e.jsx("div",{className:"text-sm text-slate-500",children:"Address not provided"}):e.jsx("div",{className:"text-sm text-slate-700 space-y-0.5",children:j.map((s,m)=>e.jsx("div",{children:s},`ship-${m}`))})]}),e.jsx("div",{className:"mt-6 overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-left text-xs text-slate-500 border-b border-slate-100",children:[e.jsx("th",{className:"py-2",children:"Item"}),e.jsx("th",{className:"py-2",children:"Qty"}),e.jsx("th",{className:"py-2 text-right",children:"Price"}),e.jsx("th",{className:"py-2 text-right",children:"Total"})]})}),e.jsx("tbody",{children:y.map((s,m)=>e.jsxs("tr",{className:"align-top border-b border-slate-100",children:[e.jsxs("td",{className:"py-3",children:[e.jsx("div",{className:"font-medium text-slate-900",children:s.name}),s.options&&typeof s.options=="object"&&e.jsx("div",{className:"text-xs text-slate-500",children:Object.entries(s.options).filter(([l,i])=>i).map(([l,i])=>`${l.replace(/_/g," ")}: ${i}`).join(", ")}),s.customizations&&typeof s.customizations=="object"&&e.jsx("div",{className:"text-xs text-slate-500",children:Object.entries(s.customizations).map(([l,i])=>Array.isArray(i)||i===null||i===""?null:typeof i=="object"?i.filename||i.value||"":`${l.replace(/_/g," ")}: ${i}
7`).filter(Boolean).join(", ")})]}),e.jsx("td",{className:"py-3",children:s.quantity}),e.jsx("td",{className:"py-3 text-right",children:c(s.price)}),e.jsx("td",{className:"py-3 text-right font-semibold",children:c((s.price||0)*(s.quantity||1))})]},`${s.id||s.name}-${m}`))})]})}),e.jsx("div",{className:"mt-6 flex justify-end",children:e.jsxs("div",{className:"w-full sm:w-1/2 lg:w-1/3",children:[e.jsxs("div",{className:"flex justify-between text-sm text-slate-700",children:[e.jsx("span",{children:"Subtotal"}),e.jsx("span",{children:c(t.subtotal)})]}),e.jsxs("div",{className:"flex justify-between text-sm text-slate-700",children:[e.jsx("span",{children:"Shipping"}),e.jsx("span",{children:c(t.shipping_fee)})]}),Number(t.coupon_discount||0)>0&&e.jsxs("div",{className:"flex justify-between text-sm text-rose-600",children:[e.jsx("span",{children:"Coupon"}),e.jsxs("span",{children:["-",c(t.coupon_discount)]})]}),Number(t.wallet_deduction||0)>0&&e.jsxs("div",{className:"flex justify-between text-sm text-emerald-600",children:[e.jsx("span",{children:"Wallet"}),e.jsxs("span",{children:["-",c(t.wallet_deduction)]})]}),e.jsxs("div",{className:"flex justify-between text-base font-semibold text-slate-900 mt-3 border-t pt-3",children:[e.jsx("span",{children:"Total"}),e.jsx("span",{children:c(t.total)})]})]})}),e.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs("div",{className:"text-xs text-slate-500",children:["Payment: ",t.payment_method||"—"," • Status:"," ",t.payment_status||"—"]}),e.jsxs("div",{className:"flex gap-2 sm:justify-end print:hidden",children:[e.jsxs("button",{onClick:v,className:"inline-flex items-center px-4 py-2 rounded-lg border bg-white text-sm",children:["Download Bill",e.jsx(P,{className:"w-4 h-4 ml-1"})]}),e.jsx(b,{href:route("order.confirmation",t.order_number),className:"inline-flex items-center px-4 py-2 rounded-lg bg-indigo-600 text-white text-sm",children:"Back"})]})]})]})})]})}export{z 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.