1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b6f03c05-9a66-4bf3-a013-9d94fc24d394",e._sentryDebugIdIdentifier="sentry-dbid-b6f03c05-9a66-4bf3-a013-9d94fc24d394")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3952],{54432:(e,t,n)=>{"use strict";function i(e){if(!e)return 0;let t=e.tariffs[0].priceComponents[0].price||0;return Math.ceil(t+t*(e.tariffs[0].priceComponents[0].gst||0)/100)}n.d(t,{Rt:()=>r,SW:()=>a,y8:()=>i});let r=e=>e.toLocaleString(void 0,{maximumFractionDigits:2,minimumFractionDigits:2});function s(e){return Math.round(100*e)/100}let a=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];let e=arguments.length>1?arguments[1]:void 0;arguments.length>2&&void 0!==arguments[2]&&arguments[2];let t=0*e,n=s(t/1.18),i=s(t-n);return{totalCost:t,charges:n,tax:i}}},62402:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/order-confirmed",function(){return n(65878)}])},65878:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var i=n(37876),r=n(54432),s=n(98975),a=n(7940),l=n(13215),o=n(92708);let d=(0,n(11860).A)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error");var c=n(40990);n(77328);var u=n(54587),p=n.n(u),m=n(14232);let g=()=>{let e=(0,m.useRef)(null),[t,n]=(0,m.useState)(!0),[u,g]=(0,m.useState)(null),[h,f]=(0,m.useState)(null),[y,x]=(0,m.useState)(!1),{clearCart:v}=(0,l.QN)(e=>e);return(0,m.useEffect)(()=>{if(e.current)return;e.current=!0;let t=async(e,t)=>{try{var n,i,r,s,l,o,c,u,p,m,g,h,f,y,x,v,b,_,w,N,S,C,j,A,I,D,T,k,M,O,P,E,F,L,B,W,q;let t,R={data:[{Street:(null==(r=e.orders[0])||null==(i=r.shippings[0])||null==(n=i.shippingAddress)?void 0:n.address1)+", "+(null==(o=e.orders[0])||null==(l=o.shippings[0])||null==(s=l.shippingAddress)?void 0:s.city)+", "+(null==(p=e.orders[0])||null==(u=p.shippings[0])||null==(c=u.shippingAddress)?void 0:c.postalCode),Country:"India",Website:null,Full_Name:"".concat(e.user.firstName," ").concat(e.user.lastName),Email:e.user.email,State:null==(h=e.orders[0])||null==(g=h.shippings[0])||null==(m
1=g.shippingAddress)?void 0:m.state,Region:"India",Mobile:e.user.phone,First_Name:e.user.firstName,Last_Name:e.user.lastName}]},U=await fetch("/api/create-customer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)}),z=await U.json();if(null==z||null==(x=z.data)||null==(y=x[0])||null==(f=y.details)?void 0:f.id)t=z.data[0].details.id;else if((null==z||null==(b=z.data)||null==(v=b[0])?void 0:v.code)==="DUPLICATE_DATA")t=z.data[0].details.id;else throw new d("Customer creation failed: ".concat(JSON.stringify(z)));if(!t)throw new d("No customer ID found in response");let J={data:[{Currency:"INR",Billing_Country:"India",Status:"Confirmed",Shipping_Country:"India",Customer_Type:"B2C",Shipping_Code:null==(N=e.orders[0])||null==(w=N.shippings[0])||null==(_=w.shippingAddress)?void 0:_.postalCode,Billing_City:null==(C=e.orders[0])||null==(S=C.billingAddress)?void 0:S.city,Shipping_Street:null==(I=e.orders[0])||null==(A=I.shippings[0])||null==(j=A.shippingAddress)?void 0:j.address1,Website_Order_ID:e.invoiceNumber,Shipping_State:null==(k=e.orders[0])||null==(T=k.shippings[0])||null==(D=T.shippingAddress)?void 0:D.state,Ordered_Items:e.orders.map(e=>{var t,n,i,r;return{Description:e.product.description,HSN_SAC:e.product.HSN_SAC,GST_Percent:(null==(n=e.product.tariffs[0])||null==(t=n.priceComponents[0])?void 0:t.gst)||0,Quantity:e.quantity,Rate:null==(r=e.product.tariffs[0])||null==(i=r.priceComponents[0])?void 0:i.price,Product_Name:{name:e.product.name,id:a.$_[e.product.modelId]}}}),Order_Value:e.totalAmount.toString(),Terms_and_Conditions:"test terms and Conditions",Order_Source:"Website - Buy Now",Contact_Name:{name:"".concat(e.user.firstName," ").concat(e.user.lastName),id:t},Layout:{name:"Website Orders",id:"277768000014623338"},Billing_Street:null==(O=e.orders[0])||null==(M=O.billingAddress)?void 0:M.address1,Billing_Code:null==(E=e.orders[0])||null==(P=E.billingAddress)?void 0:P.postalCode,Shipping_City:null==(B=e.orders[0])||null==(L=B.shippings[0])||null==(F=L.shippingAddress)?void 0:F.city,Total_Amount:null==e?void 0:e.totalAmount,$layout_id:{name:"Website Orders",id:"277768000014623338"},Shipping:e.orders.reduce((e,t)=>{var n;return e+((null==(n=t.shippings[0])?void 0:n.cost)||0)},0),Subject:"Order ".concat(e.invoiceNumber),Billing_State:null==(q=e.orders[0])||null==(W=q.billingAddress)?void 0:W.state}]},G=await fetch("/api/create-sales-order",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}),H=await G.json();if(!H.success)throw new d("Sales order creation failed: ".concat(JSON.stringify(H)))}catch(e){console.error("Error in Zoho operations:",e)}};(async()=>{try{let e=localStorage.getItem("boltUserPhone"),i=localStorage.getItem("boltUserId"),s=localStorage.getItem("boltInvoiceId");if(!e||!i||!s)return;n(!0);let l=await fetch("".concat(a.vf,"/user"),{headers:{phone:"+91"+e}}),c=await l.json();if(200!==c.status)throw new d("Failed to fetch user data");g(c.data);let u=c.data.orders.filter(e=>e.invoice===s),p=u[0],m={date:(0,o.TY)(p.createdAt),amount:u.reduce((e,t)=>e+t.amount+t.shippings[0].cost,0),trackingIds:u.map(e=>e.trackingId)};if(f(m),"CANCELLED"===p.status)return void window.open("https://order.bolt.earth/bolt/track-order?id=".concat(p.trackingId),"_self");let h=await fetch("".concat(a.vf,"/user/orders/payment/confirm"),{method:"POST",headers:{"Content-Type":"application/json","x-user":i},body:JSON.stringify({invoiceId:p.invoice})}),y=await h.json();if(n(!1),200!==y.status){"Payment not received"===y.message&&x(!0);return}let b=Math.ceil(y.data.orders.reduce((e,t)=>e+t.amount,0)),_={transaction_id:y.data.invoiceNumber,currency:"INR",value:b,shipping:y.data.orders.reduce((e,t)=>e+t.shippings[0].cost,0),items:y.data.orders.map(e=>({item_id:e.product.modelId,item_name:e.product.name,quantity:e.quantity,price:(0,r.y8)(e.product)}))};"undefined"!=typeof gtag&>ag("event","purchase",_),v(),t(y.data,e)}catch(e){n(!1),console.error("Error in order confirmation:",e)}})()},[]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("section",{style:{background:"#f7f7f7 url('".concat(a.ZU+"/images/pages/order-confirmed/bg.svg","') no-repeat center")},children:(0,i.jsx)("div",{className:"container py-10 lg:py-20",children:(0,i.jsx)("div",{className:"mx-auto flex w-full max-w-2xl flex-col items-center rounded-lg bg-white px-4 py-8 shadow-lg lg:rou
1nded-xl lg:px-6 lg:py-12",children:!u||t?(0,i.jsx)("div",{className:"py-20",children:(0,i.jsx)(c.A,{})}):y?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{className:"mt-4 mb-10 flex items-center font-bold text-amber-500 lg:text-xl",children:[(0,i.jsx)(d,{color:"inherit",fontSize:"inherit",sx:{mr:{xs:"4px",lg:"8px"},fontSize:24}}),"Your payment is still pending."]}),(0,i.jsx)("button",{className:(0,l.cn)((0,s.V)({size:"md"}),"mb-2"),onClick:()=>window.open(localStorage.getItem("boltPaymentLink")||"https://bolt.earth/404","_self"),children:"Make Payment"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h1",{className:"text-primary mb-2 text-2xl font-bold lg:mb-4 lg:text-3xl",children:"Order Successful"}),(0,i.jsx)(p(),{src:a.ZU+"/images/pages/order-confirmed/check.png",alt:"Check",width:202,height:202,className:"h-auto w-full max-w-[120px] lg:max-w-[202px]"}),(0,i.jsxs)("div",{className:"mt-6 text-center font-semibold lg:text-lg",children:[(0,i.jsxs)("p",{children:["Thank you, ",u.firstName," ",u.lastName,"."]}),(0,i.jsx)("p",{children:"Your order has been placed successfully."})]}),(0,i.jsxs)("div",{className:"mt-12 w-full max-w-sm text-xs lg:text-sm",children:[(0,i.jsx)("hr",{className:"border-[#A5A5A5]"}),(0,i.jsx)("div",{className:"text-custom-gray-tertiary mx-auto -mt-3 w-fit bg-white px-4 uppercase",children:"Order Details"}),(0,i.jsx)("div",{className:"mt-6 grid grid-cols-[4fr_5fr] gap-x-4 gap-y-3",children:[{label:"Date of Purchase",value:h.date},{label:"Amount Paid",value:"â¹".concat(h.amount.toLocaleString(void 0,{maximumFractionDigits:2,minimumFractionDigits:2}))},{label:"Tracking ID"+(h.trackingIds.length>1?"s":""),value:h.trackingIds.join(", ")},{label:"Phone",value:"".concat(u.phone.slice(0,3)," ").concat(u.phone.slice(3))},{label:"Email",value:u.email}].map((e,t)=>(0,i.jsxs)(m.Fragment,{children:[(0,i.jsx)("div",{className:"text-custom-gray-primary justify-self-end",children:e.label}),(0,i.jsx)("div",{className:"relative font-semibold",children:e.value})]},t))})]}),(0,i.jsx)("p",{className:"text-custom-gray-primary mt-12 text-center text-sm",children:"We hope you enjoy our product. Thank you for being a part of the green revolution."})]})})})})})}},92708:(e,t,n)=>{"use strict";n.d(t,{Eg:()=>s,TA:()=>l,TY:()=>a,qo:()=>o,us:()=>d});var i=n(59347),r=n(57720);let s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return(0,r.qD)(e,"Asia/Kolkata","dd MMM yyyy, hh:mm a").replace(/AM|PM/,e=>e.toLowerCase())},a=e=>(0,i.GP)(new Date(e),"MMM dd, yyyy"),l=e=>(0,i.GP)(new Date(e),"dd MMM, yyyy"),o=e=>(0,i.GP)(new Date(e),"dd-MM-yyyy"),d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return(0,r.qD)(e,"UTC","yyyy-MM-dd HH:mm:ss")}}},e=>{e.O(0,[7720,6593,636,8792],()=>e(e.s=62402)),_N_E=e.O()}]);
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.