PageSourceSearch

https://thecannacraft.com/_next/static/chunks/pages/OrderDetail-18a80e98fef9640e.js

js thecannacraft.com collected 2026-10-08 21:59:27 UTC 16,740 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3595],{5449:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});var l=t(37876);t(14232);var a=t(91725),n=t(28379),s=t(78e3);let i=e=>{let{onRetry:r}=e;return(0,l.jsx)("div",{className:"col-span-full text-center my-20",children:(0,l.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,l.jsx)(a.Zp,{className:"p-6 text-center max-w-md ",children:(0,l.jsxs)(a.Wu,{children:[(0,l.jsx)(n.A,{className:"mx-auto h-12 w-12 text-red-500"}),(0,l.jsx)("h2",{className:"mt-4 text-xl font-semibold text-gray-800",children:"Oops! Something went wrong"}),(0,l.jsx)("p",{className:"mt-2 text-gray-500",children:"An unexpected error occurred. Please try again."}),r&&(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsxs)("button",{className:"mt-4 px-4 py-2 bg-red-500 text-white rounded-xl hover:bg-red-600 transition border flex justify-center gap-2",onClick:r,children:[(0,l.jsx)(s.A,{}),"Retry"]})})]})})})})}},13845:(e,r,t)=>{"use strict";t.d(r,{A:()=>l});let l=(0,t(22369).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},17636:(e,r,t)=>{"use strict";t.d(r,{A:()=>l});let l=(0,t(22369).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},23156:(e,r,t)=>{"use strict";t.d(r,{E:()=>i});var l=t(37876);t(14232);var a=t(47137),n=t(56680);let s=(0,a.F)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i(e){let{className:r,variant:t,...a}=e;return(0,l.jsx)("div",{className:(0,n.cn)(s({variant:t}),r),...a})}},26283:(e,r,t)=>{"use strict";t.d(r,{$:()=>d,r:()=>o});var l=t(37876),a=t(14232),n=t(82987),s=t(47137),i=t(56680);let o=(0,s.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground  hover:bg-destructive/90",outline:"border border-input bg-background  hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground  hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef((e,r)=>{let{className:t,variant:a,size:s,asChild:d=!1,...c}=e,u=d?n.DX:"button";return(0,l.jsx)(u,{className:(0,i.cn)(o({variant:a,size:s,className:t})),ref:r,...c})});d.displayName="Button"},32210:(e,r,t)=>{"use strict";t.d(r,{$:()=>m});var l,a,n,s,i,o,d,c,u=t(65364);let m={BASE_URL:"https://v2.thecannacraft.com",SITE_URL:"https://thecannacraft.com",SECRET_KEY:"?H3u+oIe1q2E5@D1y",IV:"W%ss_85azsda1",ALGORITHM:"aes-256-gcm",MODE:"production",PAYU_API_URL:null!=(l=u.env.NEXT_PUBLIC_PAYU_API_URL)?l:"",PAYU_KEY:null!=(a=u.env.NEXT_PUBLIC_PAYU_KEY)?a:"",PAYU_SALT:null!=(n=u.env.NEXT_PUBLIC_PAYU_SALT)?n:"",PHONEPAY_MERCHANT_ID:null!=(s=u.env.PHONEPAY_MERCHANT_ID)?s:"",PHONEPAY_SALT_KEY:null!=(i=u.env.PHONEPAY_SALT_KEY)?i:"",PHONEPAY_SALT_INDEX:null!=(o=u.env.PHONEPAY_SALT_INDEX)?o:"",PHONEPAY_PAY_API:null!=(d=u.env.PHONEPAY_PAY_API)?d:"",PHONEPAY_BASE_URL:null!=(c=u.env.PHONEPAY_BASE_URL)?c:"",POWERED_BY_URL:"https://yashworldproducts.com/",POWERED_BY_NAME:"yashworld products private limited"};u.env.FIREBASE_APIKEY,u.env.FIREBASE_AUTHDOMAIN,u.env.FIREBASE_PROJECTID,u.env.FIREBASE_STORAGEBUCKET,u.env.FIREBASE_MESSAGINGSENDERID,u.env.FIREBASE_APPID,u.env.FIREBASE_MEASUREMENTID},47137:(e,r,t)=>{"use strict";t.d(r,{F:()=>s});
1var l=t(69241);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=l.$,s=(e,r)=>t=>{var l;if((null==r?void 0:r.variants)==null)return n(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:s,defaultVariants:i}=r,o=Object.keys(s).map(e=>{let r=null==t?void 0:t[e],l=null==i?void 0:i[e];if(null===r)return null;let n=a(r)||a(l);return s[e][n]}),d=t&&Object.entries(t).reduce((e,r)=>{let[t,l]=r;return void 0===l||(e[t]=l),e},{});return n(e,o,null==r||null==(l=r.compoundVariants)?void 0:l.reduce((e,r)=>{let{class:t,className:l,...a}=r;return Object.entries(a).every(e=>{let[r,t]=e;return Array.isArray(t)?t.includes({...i,...d}[r]):({...i,...d})[r]===t})?[...e,t,l]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}},49567:(e,r,t)=>{"use strict";t.d(r,{A:()=>s});var l=t(37876),a=t(54587),n=t.n(a);let s=()=>(0,l.jsxs)("div",{className:"flex items-center justify-center flex-col h-[100dvh]",children:[(0,l.jsx)(n(),{src:"/new_logo_updated.webp",alt:"logo",width:80,height:80,className:"mx-auto h-20 w-20",priority:!0}),(0,l.jsx)("h2",{className:"mt-4 text-xl font-semibold text-gray-800",children:"Loading..."}),(0,l.jsx)("p",{className:"mt-2 text-gray-500",children:"Please wait while we fetch the data."})]})},50477:()=>{},56661:(e,r,t)=>{"use strict";t.d(r,{FH:()=>i,O5:()=>d});var l=t(78028),a=t(32210),n=t(98255);let s=a.$.BASE_URL,i=l.A.create({baseURL:s}),o=(0,n.Gq)("AUTH_KEY");o&&(i.defaults.headers.common.Authorization="".concat(o));let d=e=>{e?i.defaults.headers.common.Authorization="".concat(e):delete i.defaults.headers.common.Authorization}},56680:(e,r,t)=>{"use strict";t.d(r,{cn:()=>n});var l=t(69241),a=t(29573);function n(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return(0,a.QP)((0,l.$)(r))}},71656:(e,r,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/OrderDetail",function(){return t(75752)}])},75752:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>R});var l=t(37876),a=t(5449),n=t(49567),s=t(23156),i=t(26283),o=t(91725),d=t(14232),c=t(66326),u=Object.defineProperty,m=(e,r)=>u(e,"name",{value:r,configurable:!0}),x="horizontal",h=["horizontal","vertical"],p=d.forwardRef(m(function(e,r){let{decorative:t,orientation:a=x,...n}=e,s=f(a)?a:x;return(0,l.jsx)(c.sG.div,{"data-orientation":s,...t?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"},...n,ref:r})},"Separator"));function f(e){return h.includes(e)}m(f,"isValidOrientation");var v=t(56680);let g=d.forwardRef((e,r)=>{let{className:t,orientation:a="horizontal",decorative:n=!0,...s}=e;return(0,l.jsx)(p,{ref:r,decorative:n,orientation:a,className:(0,v.cn)("shrink-0 bg-border","horizontal"===a?"h-[1px] w-full":"h-full w-[1px]",t),...s})});g.displayName=p.displayName;var y=t(96868),_=t(56661),j=t(32210);let b=(e,r)=>{fetch(e).then(e=>e.blob()).then(e=>{let t=document.createElement("a"),l=window.URL.createObjectURL(e);t.href=l,t.download="".concat(r,".pdf"),document.body.appendChild(t),t.click(),document.body.removeChild(t),window.URL.revokeObjectURL(l)}).catch(e=>console.error("Download error:",e))};var N=t(13845),E=t(17636);let A=(0,t(22369).A)("FileChartColumn",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 18v-1",key:"zg0ygc"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"M16 18v-3",key:"j5jt4h"}]]);var w=t(54587),k=t.n(w),P=t(48230),S=t.n(P);let R=e=>{var r,t,c,u;let{orderId:m}=e,[x,h]=(0,d.useState)(null),[p,f]=(0,d.useState)(!1),[v,w]=(0,d.useState)(null);return(0,d.useEffect)(()=>{f(!0),_.FH.get("".concat(j.$.BASE_URL,"/api/order/all/").concat(m)).then(e=>{var r;h(null==e||null==(r=e.data)?void 0:r.order),f(!1)}).catch(()=>{w("Failed to fetch order data."),f(!1)})},[m]),(0,l.jsx)("div",{className:"mb-14",children:v?(0,l.jsx)(a.A,{}):(0,l.jsx)(l.Fragment,{children:p?(0,l.jsx)(n.A,{}):(0,l.jsx)(y.Bc,{children:(0,l.jsx)("div",{className:"px-3 bg-white min-h-screen sm:pt-40 pt-32",children:(0,l.jsx)(o.Zp,{className:"border border-gray-200 rounded-2xl  max-w-4xl mx-auto",children:(0,l.jsxs)(o.Wu,{className:"p-6 space-y-6",children:[(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)(y.m_,{children:[(0,l.jsx)(y.k$,{asChild:!0,children:(0,l.jsxs)(i.$,{variant:"link",className:"text-black border border-black hover:bg-gray-100 rounded-full px-4 py-2 mb-5",onClick:()=>window.history.back(),children:[(0,l.jsx)(N.A,{className:"w-5"}),"Back"]})}),(0,l.jsx)(y.ZI,{children:"Go Back to Orders"})]}),(0,l.jsxs)("h2",{className:"text-2xl font-semibold text-black",children:["Order #",null==x?void 0:x.order_number]}),(0,l.jsx)(s.E,{className:"mt-2 px-3 py-1 rounded-full text-sm ",children:(null==x?void 0:x.order_status)==="prescription_pending"?"Prescription Pending":null==x?void 0:x.order_status}),(0,l.jsx)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-700",children:(null==x?void 0:x.is_store_pickup_order)?"Store Pickup":"Online Order"}),(0,l.jsx)("span",{children:(null==x?void 0:x.prescription_id)&&x.prescription_id.length>5&&(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("p",{className:"inline-flex items-center rounded-full text-xs font-medium bg-green-100 text-green-700 ml-2 px-3 py-1",children:["Prescription Serial Number -",(null==x||null==(r=x.prescriptions)?void 0:r.prescription_serial_number)||"N/A"]})})})]}),(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 mt-4 sm:mt-0",children:[(null==x?void 0:x.invoice_url)&&(0,l.jsxs)(y.m_,{children:[(0,l.jsx)(y.k$,{asChild:!0,children:(0,l.jsx)(i.$,{variant:"ghost",className:"text-black border border-black hover:bg-gray-100 rounded-full px-4 py-2",onClick:()=>b("".concat(null===j.$||void 0===j.$?void 0:j.$.BASE_URL,"/").concat(null==x?void 0:x.invoice_url),null==x?void 0:x.order_number),children:(0,l.jsx)(E.A,{})})}),(0,l.jsx)(y.ZI,{children:"Download Order Invoice"})]}),(null==x||null==(t=x.prescriptions)?void 0:t.pdf_url)&&(0,l.jsxs)(y.m_,{children:[(0,l.jsx)(y.k$,{asChild:!0,children:(0,l.jsx)(i.$,{variant:"ghost",className:"text-black border border-black hover:bg-gray-100 rounded-full px-4 py-2",onClick:()=>{var e;return b("".concat(null===j.$||void 0===j.$?void 0:j.$.BASE_URL,"/").concat(null==x||null==(e=x.prescriptions)?void 0:e.pdf_url),"Prescription.pdf")},children:(0,l.jsx)(A,{})})}),(0,l.jsx)(y.ZI,{children:"Download Prescription PDF"})]}),(null==x?void 0:x.shipping_url)&&(null==x||null==(c=x.shipping_url)?void 0:c.length)>10&&(0,l.jsxs)(y.m_,{children:[(0,l.jsx)(y.k$,{asChild:!0,children:(0,l.jsx)(S(),{href:null!=(u=null==x?void 0:x.shipping_url)?u:"",children:(0,l.jsx)(i.$,{variant:"ghost",className:"text-black border border-black hover:bg-gray-100 rounded-full px-4 py-2",children:"Track Order"})})}),(0,l.jsx)(y.ZI,{children:"Track Your Order Status"})]})]})]}),(0,l.jsx)(g,{}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-lg font-medium text-black",children:"Customer Info"}),(0,l.jsx)("p",{className:"text-gray-600",children:null==x?void 0:x.user.first_name}),(0,l.jsx)("p",{className:"text-gray-600",children:null==x?void 0:x.user.email})]}),(null==x?void 0:x.doctor)&&(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-lg font-medium text-black",children:"Doctor Info"}),(0,l.jsxs)("p",{className:"text-gray-600",children:["Dr. ",null==x?void 0:x.doctor.first_name," ",null==x?void 0:x.doctor.last_name]}),(0,l.jsx)("p",{className:"text-gray-600",children:null==x?void 0:x.doctor.email})]})]}),(0,l.jsx)(g,{}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-lg font-medium text-black",children:"Products"}),(0,l.jsx)("div",{className:"space-y-4",children:null==x?void 0:x.products.map(e=>{var r;return(0,l.jsxs)("div",{className:"flex items-center gap-4 border-b pb-4",children:[(0,l.jsx)(k(),{src:e.product_main_img&&"string"==typeof e.product_main_img?"".concat((null==(r=j.$.BASE_URL)?void 0:r.endsWith("/"))?j.$.BASE_URL:"".concat(j.$.BASE_URL,"/")).concat(e.product_main_img.replace(/^\/+/,"")):"/static/empty_image.jpg",alt:e.product,className:"w-16 h-16 object-cover rounded-lg",width:50,height:30}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-black font-medium",children:e.product}),(0,l.jsxs)("p",{className:"text-gray-600",children:["Qty: ",e.product_quantity]}),(0,l.jsxs)("p",{className:"text-gray-600",children:["₹",e.price]})]})]},e.product_id)})})]})]}),(0,l.jsx)(g,{}),(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between",children:[(0,l.jsx)("p",{className:"text-gray-600",children:"Payment Status:"}),(0,l.jsx)("p",{className:"text-black font-medium",children:null==x?void 0:x.payment_status})]}),(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between",children:[(0,l.jsx)("p",{className:"text-gray-600",children:"Total Amount:"}),(0,l.jsxs)("p",{className:"text-black font-medium",children:["₹",null==x?void 0:x.final_total_amount]})]})]})})})})})})}},78e3:(e,r,t)=>{"use strict";t.d(r,{A:()=>l});let l=(0,t(22369).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},91725:(e,r,t)=>{"use strict";t.d(r,{BT:()=>d,Wu:()=>c,ZB:()=>o,Zp:()=>s,aR:()=>i,wL:()=>u});
1var l=t(37876),a=t(14232),n=t(56680);let s=a.forwardRef((e,r)=>{let{className:t,...a}=e;return(0,l.jsx)("div",{ref:r,className:(0,n.cn)("rounded-xl border bg-card text-card-foreground",t),...a})});s.displayName="Card";let i=a.forwardRef((e,r)=>{let{className:t,...a}=e;return(0,l.jsx)("div",{ref:r,className:(0,n.cn)("flex flex-col space-y-1.5 p-6",t),...a})});i.displayName="CardHeader";let o=a.forwardRef((e,r)=>{let{className:t,...a}=e;return(0,l.jsx)("div",{ref:r,className:(0,n.cn)("font-semibold leading-none tracking-tight",t),...a})});o.displayName="CardTitle";let d=a.forwardRef((e,r)=>{let{className:t,...a}=e;return(0,l.jsx)("div",{ref:r,className:(0,n.cn)("text-sm text-muted-foreground",t),...a})});d.displayName="CardDescription";let c=a.forwardRef((e,r)=>{let{className:t,...a}=e;return(0,l.jsx)("div",{ref:r,className:(0,n.cn)("p-6 pt-0",t),...a})});c.displayName="CardContent";let u=a.forwardRef((e,r)=>{let{className:t,...a}=e;return(0,l.jsx)("div",{ref:r,className:(0,n.cn)("flex items-center p-6 pt-0",t),...a}
1)});u.displayName="CardFooter"},96868:(e,r,t)=>{"use strict";t.d(r,{Bc:()=>i,ZI:()=>c,k$:()=>d,m_:()=>o});var l=t(37876),a=t(14232),n=t(63490),s=t(56680);let i=n.Kq,o=n.bL,d=n.l9,c=a.forwardRef((e,r)=>{let{className:t,sideOffset:a=4,...i}=e;return(0,l.jsx)(n.ZL,{children:(0,l.jsx)(n.UC,{ref:r,sideOffset:a,className:(0,s.cn)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",t),...i})})});c.displayName=n.UC.displayName},98255:(e,r,t)=>{"use strict";t.d(r,{Ai:()=>i,Gq:()=>d,SO:()=>o,sw:()=>c});var l=t(30896),a=t.n(l),n=t(32210);let s=()=>{let e=n.$.SECRET_KEY;if(!e)throw Error("Missing SECRET_KEY in config");return e},i=e=>{localStorage.removeItem(e)},o=(e,r)=>{try{let t=a().AES.encrypt(JSON.stringify(r),s()).toString();localStorage.setItem(e,t)}catch(e){console.error("Failed to set item in localStorage: ".concat(e))}},d=e=>{{let r=localStorage.getItem(e);if(r)try{let e=a().AES.decrypt(r,s()).toString(a().enc.Utf8);return JSON.parse(e)}catch(r){console.error("Failed to parse item from localStorage: ".concat(r)),i(e)}}return null},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r={};e.forEach(e=>{r[e]=localStorage.getItem(e)}),localStorage.clear(),e.forEach(e=>{let t=r[e];null!==t&&localStorage.setItem(e,t)})}}},e=>{e.O(0,[2749,4587,8230,6131,2125,6164,636,6593,8792],()=>e(e.s=71656)),_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.