1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1250],{11260:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/my-profile",function(){return r(10862)}])},77300:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var a=r(45929),s=r(75271),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},l=r(52095),i=s.forwardRef(function(e,t){return s.createElement(l.Z,(0,a.Z)({},e,{ref:t,icon:n}))})},59079:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var a=r(45929),s=r(75271),n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},l=r(52095),i=s.forwardRef(function(e,t){return s.createElement(l.Z,(0,a.Z)({},e,{ref:t,icon:n}))})},15036:function(e,t,r){"use strict";r.d(t,{Z:function(){return f}});var a=r(75271),s=r(82187),n=r.n(s),l=r(88859),i=r(79038),d=r(84759),c=r(42446),o=r(38841),u=r(83509);let m=e=>{let{componentCls:t}=e;return{[t]:{"&-horizontal":{["&".concat(t)]:{"&-sm":{marginBlock:e.marginXS},"&-md":{marginBlock:e.margin}}}}}},x=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:r,colorSplit:a,lineWidth:s,textPaddingInline:n,orientationMargin:l,verticalMarginInline:i}=e;return{[t]:Object.assign(Object.assign({},(0,c.Wf)(e)),{borderBlockStart:"".concat((0,d.unit)(s)," solid ").concat(a),"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:i,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:"".concat((0,d.unit)(s)," solid ").concat(a)},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:"".concat((0,d.unit)(e.marginLG)," 0")},["&-horizontal".concat(t,"-with-text")]:{display:"flex",alignItems:"center",margin:"".concat((0,d.unit)(e.dividerHorizontalWithTextGutterMargin)," 0"),color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:"0 ".concat(a),"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:"".concat((0,d.unit)(s)," solid transparent"),borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},["&-horizontal".concat(t,"-with-text-start")]:{"&::before":{width:"calc(".concat(l," * 100%)")},"&::after":{width:"calc(100% - ".concat(l," * 100%)")}},["&-horizontal".concat(t,"-with-text-end")]:{"&::before":{width:"calc(100% - ".concat(l," * 100%)")},"&::after":{width:"calc(".concat(l," * 100%)")}},["".concat(t,"-inner-text")]:{display:"inline-block",paddingBlock:0,paddingInline:n},"&-dashed":{background:"none",borderColor:a,borderStyle:"dashed",borderWidth:"".concat((0,d.unit)(s)," 0 0")},["&-horizontal".concat(t,"-with-text").concat(t,"-dashed")]:{"&::before, &::after":{borderStyle:"dashed none none"}},["&-vertical".concat(t,"-dashed")]:{borderInlineStartWidth:s,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},"&-dotted":{background:"none",borderColor:a,borderStyle:"dotted",borderWidth:"".concat((0,d.unit)(s)," 0 0")},["&-horizontal".concat(t,"-with-text").concat(t,"-dotted")]:{"&::before, &::after":{borderStyle:"dotted none none"}},["&-vertical".concat(t,"-dotted")]:{borderInlineStartWidth:s,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},["&-plain".concat(t,"-with-text")]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},["&-horizontal".concat(t,"-with-text-start").concat(t,"-no-default-orientation-margin-start")]:{"&::before":{width:0},"&::after":{width:"100%"},["".concat(t,"-inner-text")]:{paddingInlineStart:r}},["&-horizontal".concat(t,"-with-text-end").concat(t,"-no-default-orientation-margin-end")]:{"&::before":{width:"100%"},"&::after":{width:0},["".concat(t,"-inner-text")]:{paddingInlineEnd:r}}})}};var h=(0,o.I$)("Divider",e=>{let t=(0,u.mergeToken)(e,{dividerHorizontalWithTextGutterMargin:e.margin,sizePaddingEdgeHorizontal:0});return[x(t),m(t)]},e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}}),p=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,a=Object.getOwnPropertySymbols(e);s<a.length;s++)0>t.indexOf(a[s])&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(r[a[s]]=e[a[s]]);return r};let g={small:"sm",middle:"md"};var f=e=>{let{getPrefixCls:t,direction:r,className:s,style:d}=(0,l.dj)("divider"),{prefixCls:c,type:o="horizontal",orientation:u="center",orientationMargin:m,className:x,rootClassName:f,children:y,dashed:b,variant:j="solid",plain:v,style:N,size:w}=e,k=p(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","variant","plain","style","size"]),E=t("divider",c),[P,Z,S]=h(E),D=g[(0,i.Z)(w)],C=!!y,I=a.useMemo(()=>"left"===u?"rtl"===r?"end":"start":"right"===u?"rtl"===r?"start":"end":u,[r,u]),F="start"===I&&null!=m,A="end"===I&&null!=m,O=n()(E,s,Z,S,"".concat(E,"-").concat(o),{["".concat(E,"-with-text")]:C,["".concat(E,"-with-text-").concat(I
1)]:C,["".concat(E,"-dashed")]:!!b,["".concat(E,"-").concat(j)]:"solid"!==j,["".concat(E,"-plain")]:!!v,["".concat(E,"-rtl")]:"rtl"===r,["".concat(E,"-no-default-orientation-margin-start")]:F,["".concat(E,"-no-default-orientation-margin-end")]:A,["".concat(E,"-").concat(D)]:!!D},x,f),M=a.useMemo(()=>"number"==typeof m?m:/^\d+$/.test(m)?Number(m):m,[m]);return P(a.createElement("div",Object.assign({className:O,style:Object.assign(Object.assign({},d),N)},k,{role:"separator"}),y&&"vertical"!==o&&a.createElement("span",{className:"".concat(E,"-inner-text"),style:{marginInlineStart:F?M:void 0,marginInlineEnd:A?M:void 0}},y)))}},17332:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});let a=(0,r(35082).Z)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},7144:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});let a=(0,r(35082).Z)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]])},25918:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});let a=(0,r(35082).Z)("shopping-bag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]])},98111:function(e,t,r){"use strict";var a,s;r.d(t,{D:function(){return a}}),(s=a||(a={})).PENDING="PENDING",s.PROCESSING="PROCESSING",s.SHIPPED="SHIPPED",s.DELIVERED="DELIVERED",s.COMPLETED="COMPLETED",s.CANCELLED="CANCELLED",s.PAYMENT_FAILED="PAYMENT_FAILED",s.REFUND_REQUESTED="REFUND_REQUESTED",s.REFUNDED="REFUNDED",s.EXPIRED="EXPIRED"},10862:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return em},default:function(){return ex}});var a=r(52676),s=r(78051),n=r(47645),l=r(75218),i=r(69834),d=r(71030),c=r(18060),o=r(75271),u=r(52043),m=r.n(u),x=r(76517),h=r(83214),p=r(66380),g=()=>{let[e]=c.Z.useForm(),t=(0,i.a)({queryKey:["myProfile"],queryFn:async()=>await (0,l.US)(),select:e=>e.data});(0,o.useEffect)(()=>{t.data&&e.setFieldsValue({firstName:t.data.firstName,lastName:t.data.lastName,dob:t.data.dob?m()(t.data.dob):void 0,phone:t.data.phone||void 0})},[t.data]);let r=(0,d.D)({mutationKey:["myProfile"],mutationFn:l.lF}),s=e=>{x.Am.promise(r.mutateAsync(e),{pending:"Updating my profile...",success:"My profile updated successfully",error:{render(e){let{data:t}=e;return"Error updating my profile: ".concat((0,h._g)(t))}}})};return(0,a.jsx)(p.Z,{form:e,isMyProfile:!0,disabled:!1,loading:!1,onUpdateUserProfile:e=>{s({firstName:e.firstName,lastName:e.lastName,phone:e.phone,dob:e.dob})}})},f=r(29350),y=r(77471),b=r(21844),j=r(57597),v=r(10515),N=r(99085),w=()=>{let[e]=c.Z.useForm(),[t,r]=(0,o.useState)(""),n=(0,d.D)({mutationFn:l.Io,onSuccess:()=>{e.resetFields(),r("")}});return(0,a.jsxs)(c.Z,{form:e,onFinish:e=>{let t={oldPassword:e.oldPassword,newPassword:e.newPassword};x.Am.promise(n.mutateAsync(t),{pending:"Updating password...",success:"Password updated successfully",error:{render(e){let{data:t}=e;return"Error updating password: ".concat((0,h._g)(t))}}})},layout:"vertical",children:[(0,a.jsx)(f.Z,{gutter:16,children:(0,a.jsx)(y.Z,{xs:24,md:12,lg:12,xl:12,xxl:12,children:(0,a.jsx)(c.Z.Item,{name:"oldPassword",label:"Current Password",rules:[{required:!0,message:"Please enter current password"},{pattern:j.B,message:"Password format is incorrect"}],children:(0,a.jsx)(b.default.Password,{size:"large",classNames:{prefix:"!me-2"},prefix:(0,a.jsx)(v.Z,{})})})})}),(0,a.jsx)(f.Z,{gutter:16,children:(0,a.jsx)(y.Z,{xs:24,md:12,lg:12,xl:12,xxl:12,children:(0,a.jsx)(c.Z.Item,{name:"newPassword",label:"New Password",rules:[{required:!0,message:"Please enter a password"},{pattern:j.B,message:"Password format is incorrect"}],children:(0,a.jsx)(b.default.Password,{size:"large",classNames:{prefix:"!me-2"},prefix:(0,a.jsx)(v.Z,{}),onChange:e=>r(e.target.value)})})})}),(0,a.jsx)(f.Z,{gutter:16,children:(0,a.jsx)(y.Z,{xs:24,md:12,lg:12,xl:12,xxl:12,children:(0,a.jsx)(c.Z.Item,{name:"confirmPassword",label:"Confirm Password",dependencies:["newPassword"],rules:[{required:!0,message:"Please enter confirm password"},e=>{let{getFieldValue:t}=e;return{validator:(e,r)=>r&&t("newPassword")!==r?Promise.reject(Error("Password not match")):Promise.resolve()}}],children:(0,a.jsx)(b.default.Password,{size:"large",classNames:{prefix:"!me-2"},prefix:(0,a.jsx)(v.Z,{})})})})}),(0,a.jsx)(N.Z,{password:t}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(s.ZP,{block:!0,size:"large",htmlType:"submit",className:"!w-fit",type:"primary",loading:n.isPending,disabled:n.isPending,children:"Save"})})]})},k=r(16882),E=r(50706),P=r(98131),Z=r(95809),S=r(4475),D=r(79406),C=()=>{var e,t,r,n,u;let{visible:m,open:p,close:g}=(0,Z.Z)(),f=(0,Z.Z)(),{visible:y,open:b,close:j}=(0,Z.Z)(),[v]=c.Z.useForm(),[N]=c.Z.useForm(),[w,C]=(0,o.useState)(null),I=(0,i.a)({queryKey:["myProfile","addresses"],queryFn:async()=>await (0,l._z)(),placeholderData:S.Wk,select:e=>e.data}),F=(0,d.D)({mutationFn:e=>(0,l.p6)(e),onSuccess:()=>{I.refetch(),v.resetFields(),g()}});(0,i.a)({queryKey:["myProfile","addresses","id",w],enabled:!!w,queryFn:async()=>{let e=await (0,l.TJ)(w);return N.setFieldsValue(e.data),b(),e},select:e=>e.data});let A=(0,d.D)({mutationFn:e=>(0,l.y3)(e),onSuccess:()=>{I.refetch(),C(null),N.resetFields(),j()}}),O=(0,d.D)({mutationFn:e=>(0,l._N)(e),onSuccess:()=>{I.refetch(),C(null),N.resetFields(),j()}}),M=e=>{x.Am.promise(A.mutateAsync(e),{pending:"Updating address...",success:"Address updated successfully",error:{render(e){let{data:t}=e;return"Error updating address: ".concat((0,h._g)(t))}}})},R=e=>{x.Am.promise(O.mutateAsync(e),{pending:"Deleting address...",success:"Address deleted successfully",error:{render(e){let{data:t}=e;return"Error deleting address: ".concat((0,h._g)(t))}}})};return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex justify-end mb-6",children:(0,a.jsx)(s.ZP,{type:"primary",onClick:()=>{var e,t;let r=(null!==(t=null===(e=I.data)||void 0===e?void 0:e.length)&&void 0!==t?t:0)===0;v.setFieldValue("isDefault",r),p()},children:"Add Address"})}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3 2xl:grid-cols-4",children:null===(e=I.data)||void 0===e?void 0:e.map(e=>(0,a.jsx)(k.Z,{address:e,onEdit:()=>C(e.refId)},e.refId))}
1),(0,a.jsx)(D.Z,{open:m,onCancel:g,title:"Add Address",footer:null,children:(0,a.jsx)(E.Z,{form:v,onFinish:e=>{x.Am.promise(F.mutateAsync(e),{pending:"Creating address...",success:"Address created successfully",error:{render(e){let{data:t}=e;return"Error creating address: ".concat((0,h._g)(t))}}})},loading:!1,disabled:!1,defaultAddressValue:(null!==(n=null===(t=I.data)||void 0===t?void 0:t.length)&&void 0!==n?n:0)===0,defaultAddressLocked:(null!==(u=null===(r=I.data)||void 0===r?void 0:r.length)&&void 0!==u?u:0)===0})}),(0,a.jsxs)(D.Z,{open:y,onCancel:()=>{j(),C(null),N.resetFields()},title:"Edit Address",footer:null,children:[(0,a.jsx)("div",{className:"flex justify-end mb-4",children:(0,a.jsx)(s.ZP,{type:"primary",danger:!0,onClick:()=>f.open(),children:"Delete"})}),(0,a.jsx)(E.Z,{form:N,onFinish:e=>{M({id:w,...e})},loading:A.isPending,disabled:A.isPending})]}),(0,a.jsx)(P.Z,{loading:O.isPending,visible:f.visible,title:"Delete Address",content:"Are you sure you want to delete this address?",okButtonText:"Delete",onCancel:()=>{f.close()},onOk:()=>{R(w),f.close()}})]})},I=r(4948),F=r(57722),A=r(18374),O=r(56346),M=r(5409);let R=e=>M.Z.get("/orders",{params:e});var z=r(32623),_=r.n(z),L=r(22903),T=r(98111),q=r(25918),B=r(17332),U=r(33561);let V=Object.values(T.D),W=e=>(e||"").toLowerCase().replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase()),Y=e=>{switch(e){case"PENDING":return"gold";case"PROCESSING":return"blue";case"SHIPPED":return"purple";case"DELIVERED":case"COMPLETED":return"green";case"CANCELLED":case"PAYMENT_FAILED":return"red";case"REFUND_REQUESTED":return"orange";case"REFUNDED":return"lime";default:return"default"}};var G=()=>{var e;let t=(0,U.useRouter)(),[r,n]=(0,O.Z)(),[l,d]=(0,o.useState)(""),[c,u]=(0,o.useState)(void 0),m=(0,i.a)({queryKey:["my-orders",r,l,c],queryFn:async()=>{let e=await R({page:r.page,pageSize:r.pageSize,sortField:r.sortField,sortOrder:r.sortOrder,search:l||void 0,status:c||void 0});return n(t=>({...t,page:e.data.page,total:e.data.total})),e.data.rows}});return(0,a.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,a.jsxs)("div",{className:"mb-6 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-12 h-12 bg-primary rounded-xl",children:(0,a.jsx)(q.Z,{className:"w-6 h-6 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"My Orders"}),(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Track and manage your purchases"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,a.jsx)(b.default.Search,{allowClear:!0,className:"max-w-[320px]",placeholder:"Search by order number...",onSearch:e=>d(e)}),(0,a.jsx)(I.default,{allowClear:!0,placeholder:"All Orders",className:"min-w-[200px]",value:c,onChange:e=>u(e||void 0),options:V.map(e=>({label:W(e),value:e}))})]})]}),(0,a.jsxs)("div",{className:"mb-4 text-sm text-gray-500",children:["Showing ",(null===(e=m.data)||void 0===e?void 0:e.length)||0," orders"]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 mb-6 lg:grid-cols-2",children:(m.data||[]).map(e=>(0,a.jsx)("div",{className:"bg-white border border-gray-200 rounded-xl shadow-sm hover:shadow-md transition-shadow",children:(0,a.jsxs)("div",{className:"p-5 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-10 h-10 bg-red-50 rounded-lg",children:(0,a.jsx)(q.Z,{className:"w-5 h-5 text-primary"})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"font-semibold text-gray-900",children:["#",e.orderCode||"-"]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mt-1 text-xs text-gray-500",children:[(0,a.jsx)(B.Z,{className:"w-3.5 h-3.5"}),(0,h.i$)(e.createdAt,"-")]})]})]}),(0,a.jsx)(F.Z,{color:Y(e.status),className:"px-3 py-1",children:W(e.status)})]}),(0,a.jsxs)("div",{className:"pt-4 border-t border-gray-100",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("span",{className:"text-sm text-gray-600",children:"Total Amount"}),(0,a.jsxs)("span",{className:"text-xl font-bold text-gray-900",children:["RM ",Number(e.total).toFixed(2)]})]}),e.items&&e.items.length>0?(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"text-xs text-gray-500 mb-2",children:["Items (",e.items.length,")"]}),(0,a.jsxs)("div",{className:"flex gap-2 overflow-x-auto pb-2",children:[e.items.slice(0,4).map((e,t)=>(0,a.jsx)("div",{className:"flex-shrink-0 w-14 h-14 bg-gray-50 rounded-lg border border-gray-200 overflow-hidden",children:e.imageKey?(0,a.jsx)(_(),{src:(0,L.I)(e.imageKey),alt:e.productName||"product",width:56,height:56,className:"object-cover w-full h-full"}):(0,a.jsx)("div",{className:"flex items-center justify-center w-full h-full",children:(0,a.jsx)(q.Z,{className:"w-6 h-6 text-gray-400"})})},e.refId||t)),e.items.length>4&&(0,a.jsx)("div",{className:"flex-shrink-0 w-14 h-14 bg-gray-100 rounded-lg border border-gray-200 flex items-center justify-center",children:(0,a.jsxs)("span",{className:"text-xs font-medium text-gray-600",children:["+",e.items.length-4]})})]})]}):null,(0,a.jsx)(s.ZP,{type:"default",block:!0,className:"font-medium hover:!text-primary hover:!border-primary",onClick:()=>t.push("/my-order/".concat(e.refId)),children:"View Details â"})]})]})},e.refId))}),m.data&&0===m.data.length&&(0,a.jsxs)("div",{className:"py-16 text-center",children:[(0,a.jsx)(q.Z,{className:"w-16 h-16 mx-auto mb-4 text-gray-300"}),(0,a.jsx)("p",{className:"text-gray-500",children:"No orders found"})]}),(0,a.jsx)("div",{className:"flex justify-center mt-6",children:(0,a.jsx)(A.Z,{current:r.page,pageSize:r.pageSize,total:r.total,showSizeChanger:!0,pageSizeOptions:[10,25,50,100],showTotal:(e,t)=>"".concat(t[0],"-").concat(t[1]," of ").concat(e," items"),onChange:(e,t)=>
1n(r=>({...r,page:e,pageSize:t}))})})]})},K=r(46980),H=r(62581),X=r(69504),Q=r(87927),$=r(57418),J=e=>{var t;let{warrantyClaim:r}=e,n=(0,U.useRouter)();return(0,a.jsxs)("div",{className:"flex flex-col justify-between p-5 transition-all bg-white border border-gray-200 rounded-xl shadow-sm hover:shadow-md h-full group",children:[(0,a.jsxs)("div",{className:"flex-1 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-[10px] font-bold tracking-wider text-gray-400 uppercase mb-0.5",children:"Claim ID"}),(0,a.jsx)("p",{className:"text-sm font-bold truncate text-gray-900 font-mono bg-gray-50 inline-block px-1.5 py-0.5 rounded border border-gray-100",children:r.warrantyClaimId})]}),(0,a.jsx)("div",{className:"shrink-0",children:r.status===$.RL.PENDING?(0,a.jsx)(F.Z,{color:"orange",className:"m-0",children:"Pending"}):r.status===$.RL.IN_PROCESSING?(0,a.jsx)(F.Z,{color:"blue",className:"m-0",children:"Processing"}):r.status===$.RL.RESOLVED?(0,a.jsx)(F.Z,{color:"green",className:"m-0",children:"Resolved"}):(0,a.jsx)(F.Z,{color:"default",className:"m-0",children:"Closed"})})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("p",{className:"text-[10px] font-bold tracking-wider text-gray-400 uppercase",children:"Product"}),(0,a.jsx)("p",{className:"text-sm text-gray-800 break-words font-medium leading-snug line-clamp-2",children:(null===(t=r.product)||void 0===t?void 0:t.name)||"-"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-2 border-t border-gray-50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"block text-[10px] font-bold tracking-wider text-gray-400 uppercase mb-0.5",children:"Order No."}),(0,a.jsx)("span",{className:"block text-xs text-gray-700 font-mono truncate",title:r.orderNumber,children:r.orderNumber})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"block text-[10px] font-bold tracking-wider text-gray-400 uppercase mb-0.5",children:"Purchased"}),(0,a.jsx)("span",{className:"block text-xs text-gray-700",children:m()(r.dateOfPurchase).format("YYYY-MM-DD")})]})]})]})]}),(0,a.jsx)("div",{className:"mt-5 pt-3 border-t border-gray-100",children:(0,a.jsx)(s.ZP,{type:"default",block:!0,className:"group-hover:text-primary group-hover:border-primary transition-colors text-xs font-medium",onClick:()=>n.push("/my-warranty/claim/".concat(r.refId)),children:"View Details"})})]})},ee=e=>{let{warranty:t}=e,r=(0,U.useRouter)(),n=(t.products||[]).map(e=>e.name).filter(Boolean);return(0,a.jsxs)("div",{className:"flex flex-col justify-between p-5 transition-all bg-white border border-gray-200 rounded-xl shadow-sm hover:shadow-md h-full group",children:[(0,a.jsxs)("div",{className:"flex-1 space-y-4",children:[(0,a.jsx)("div",{className:"flex items-start justify-between gap-2",children:(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-[10px] font-bold tracking-wider text-gray-400 uppercase mb-0.5",children:"Warranty ID"}),(0,a.jsx)("p",{className:"text-sm font-bold truncate text-gray-900 font-mono bg-gray-50 inline-block px-1.5 py-0.5 rounded border border-gray-100",children:t.warrantyId})]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("p",{className:"text-[10px] font-bold tracking-wider text-gray-400 uppercase",children:"Registered products"}),(0,a.jsx)("p",{className:"text-sm text-gray-800 break-words font-medium leading-snug line-clamp-2",children:n.length?n.join(", "):"-"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-2 border-t border-gray-50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"block text-[10px] font-bold tracking-wider text-gray-400 uppercase mb-0.5",children:"Order No."}),(0,a.jsx)("span",{className:"block text-xs text-gray-700 font-mono truncate",title:t.orderNumber,children:t.orderNumber})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"block text-[10px] font-bold tracking-wider text-gray-400 uppercase mb-0.5",children:"Purchased"}),(0,a.jsx)("span",{className:"block text-xs text-gray-700",children:m()(t.dateOfPurchase).format("YYYY-MM-DD")})]}),(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)("span",{className:"block text-[10px] font-bold tracking-wider text-gray-400 uppercase mb-0.5",children:"Place of Purchase"}),(0,a.jsx)("span",{className:"block text-xs text-gray-700",children:t.placeOfPurchase?t.placeOfPurchase.replace(/_/g," "):"-"})]})]})]})]}),(0,a.jsx)("div",{className:"mt-5 pt-3 border-t border-gray-100",children:(0,a.jsx)(s.ZP,{type:"default",block:!0,className:"group-hover:text-primary group-hover:border-primary transition-colors text-xs font-medium",onClick:()=>r.push("/my-warranty/".concat(t.refId)),children:"View Details"})})]})},et=r(21413),er=r(3716),ea=r(7144),es=r(43146),en=()=>{var e,t;let{visible:r,open:n,close:d}=(0,Z.Z)(),c=(0,i.a)({queryKey:["warranty","myProfile"],queryFn:async()=>await (0,l.US)(),select:e=>e.data}),o=(0,i.a)({queryKey:["warranty","warrantyList"],queryFn:async()=>await (0,er.DQ)(),placeholderData:S.Wk,select:e=>e.data}),u=(0,i.a)({queryKey:["warranty","warrantyClaimList"],queryFn:async()=>await (0,er.e_)(),placeholderData:S.Wk,select:e=>e.data});return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex justify-end mb-6",children:(0,a.jsx)(s.ZP,{type:"primary",onClick:()=>{n()},children:"Register Warranty"})}),(0,a.jsx)("h1",{className:"mb-6 text-3xl font-semibold text-neutral-900",children:"Registered Warranties"}),o.data&&0===o.data.length?(0,a.jsxs)("div",{className:"py-16 text-center",children:[(0,a.jsx)(ea.Z,{className:"w-16 h-16 mx-auto mb-4 text-gray-300"}),(0,a.jsx)("p",{className:"text-gray-500",children:"No warranties registered yet"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-gray-400",children:'Click "Register Warranty" above to get started'})]}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3 2xl:grid-cols-4",children:null===(e=o.data)||void 0===e?void 0:e.map(e=>(0,a.jsx)(ee,{warranty:e},e.refId))}),(0,a.jsx)("h1",{className:"pt-12 mb-6 text-3xl font-semibold text-neutral-900",children:"Warranty Claims"}),u.data&&0===u.data.length?(0,a.jsxs)("div",{className:"py-16 text-center",children:[(0,a.jsx)(es.Z,{className:"w-16 h-16 mx-auto mb-4 text-gray-300"}),(0,a.jsx)("p",{className:"text-gray-500",children:"No warranty claims yet"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-gray-400",children:"You can submit claims from your registered warranties detail page"})]}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3 2xl:grid-cols-4",children:null===(t=u.data)||void 0===t?void 0:t.map(e=>(0,a.jsx)(J,{warrantyClaim:e},e.refId))}),(0,a.jsx)(et.Z,{user:c.data,open:r,onClose:d,onSuccess:o.refetch,enableVoucherClaim:!0})]})},el=r(9059),ei=r(96516);let ed=(0,r(35082).Z)("ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);var ec=r(49734),eo=r(54030),eu=()=>{let e=(0,U.useRouter)(),{data:t,isLoading:r}=(0,i.a)({queryKey:["claimed-coupons"],queryFn:()=>(0,ec.q7)().then(e=>e.data),staleTime:3e4}),n=null==t?void 0:t.filter(e=>!e.unavailable);return r?(0,a.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,a.jsx)(el.Z,{})}):n&&0!==n.length?(0,a.jsx)("div",{className:"grid grid-cols-1 gap-5 xl:grid-cols-2",children:n.map(t=>{let r=function(e){let t=[];return e.description?t.push(e.description):e.title&&t.push(e.title),e.minSubtotal&&e.minSubtotal>0&&t.push("Min. spend RM".concat(e.minSubtotal.toFixed(2))),null!==e.usesRemaining&&void 0!==e.usesRemaining&&t.push("".concat(e.usesRemaining," use").concat(1===e.usesRemaining?"":"s"," left")),e.endsAt&&t.push("Valid until ".concat(new Date(e.endsAt).toLocaleDateString("en-MY",{day:"numeric",month:"short",year:"numeric"}))),t.push(e.individualUseOnly?"Cannot be combined with other vouchers":"Can be stacked with other vouchers"),t}(t);return(0,a.jsxs)("div",{className:"flex flex-col items-center gap-6 rounded-2xl bg-[#F3F3F3] p-6 sm:flex-row",children:[(0,a.jsx)(eo.Z,{coupon:t,displayOnly:!0}),(0,a.jsxs)("div",{className:"flex w-full flex-1 flex-col",children:[(0,a.jsx)("ul",{className:"ml-4 list-disc space-y-1 text-sm text-neutral-700",children:r.map((e,t)=>(0,a.jsx)("li",{children:e},t))}),(0,a.jsx)(s.ZP,{type:"primary",size:"large",icon:(0,a.jsx)(ed,{size:16}),onClick:()=>e.push("/products"),className:"mt-5 w-full font-semibold",children:"USE NOW"})]})]},t.refId)})}):(0,a.jsx)("div",{className:"py-16",children:(0,a.jsx)(ei.Z,{description:"You haven't claimed any vouchers yet",children:(0,a.jsx)(s.ZP,{type:"primary",onClick:()=>
1e.push("/"),children:"Browse vouchers"})})})},em=!0,ex=e=>{let{user:t}=e,r=(0,U.useRouter)(),[l,i]=(0,Q.v1)("tab",Q.Oi.withDefault("profile")),{mutate:c}=(0,d.D)({mutationFn:X.kS,onError:e=>x.Am.error((0,h._g)(e)),onSuccess:()=>{r.push(H.Z.HOME)}});return(0,a.jsx)(K.Z,{user:t,children:(0,a.jsxs)("div",{className:"p-4 maxContainer",children:[(0,a.jsx)("div",{className:"flex justify-end mb-4",children:(0,a.jsx)(s.ZP,{type:"primary",danger:!0,onClick:()=>c(),children:"Logout"})}),(0,a.jsx)(n.Z,{activeKey:l,onChange:e=>i(e),items:[{key:"profile",label:"Profile",children:(0,a.jsx)(g,{})},{key:"credential",label:"Credential",children:(0,a.jsx)(w,{})},{key:"addresses",label:"Addresses",children:(0,a.jsx)(C,{})},{key:"vouchers",label:"Vouchers",children:(0,a.jsx)(eu,{})},{key:"orders",label:"Orders",children:(0,a.jsx)(G,{})},{key:"warranties",label:"Warranties",children:(0,a.jsx)(en,{})}]})]})})}},75218:function(e,t,r){"use strict";r.d(t,{Io:function(){return l},TJ:function(){return d},US:function(){return s},_N:function(){return u},_z:function(){return i},lF:function(){return n},p6:function(){return c},y3:function(){return o}});var a=r(5409);let s=()=>a.Z.get("/public/user"),n=e=>a.Z.put("/public/user",e),l=e=>a.Z.put("/public/user/credential",e),i=()=>a.Z.get("/public/user/address"),d=e=>a.Z.get("/public/user/address/".concat(e)),c=e=>a.Z.post("/public/user/address",e),o=e=>a.Z.put("/public/user/address/".concat(e.id),e),u=e=>a.Z.delete("/public/user/address/".concat(e))}},function(e){e.O(0,[5989,4237,7610,8174,9834,8051,9513,4540,4298,4190,6631,6220,9575,7444,9406,1887,8060,9059,9830,8672,8374,7645,8463,7005,7214,6980,4397,2888,9774,179],function(){return e(e.s=11260)}),_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.