PageSourceSearch

https://sugary.me/_next/static/chunks/9992.3df31e40bdad2967.js

js sugary.me collected 2026-09-24 11:00:27 UTC 34,179 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7534,9992],{29992:(e,t,s)=>{s.r(t),s.d(t,{default:()=>ev});var r=s(95155),l=s(12115),a=s(39457),i=s(4474),c=s(37206),o=s(80969),n=s(54590),d=s(76429),x=s(20193),m=s(98414),h=s(67534),u=s(74693),p=s(5519),f=s(96621),g=s(37002),b=s(66609),w=s(73321),v=s(41455),j=s(5772),N=s(21628),y=s(44478),k=s(33210),_=s(74350),C=s(14390),S=s(17050),P=s(2693),I=s(82464),R=s(7120),A=s(7268),M=s(83535),E=s(15800),O=s(55241),G=s(45601),q=s(54290),D=s(88797),$=s(95580),B=s(63864),F=s(8946),L=s(62756),U=s(2123),z=s(22167),T=s(29868),V=s(65209);let W="eGiftCheckoutBackup";function X(){try{let e=localStorage.getItem(W);if(!e)return null;let t=JSON.parse(e);if(Date.now()-t.savedAt>18e5)return localStorage.removeItem(W),null;return t.data}catch{return null}}var H=s(81566),Y=s(80526),J=s(68459),K=s(74937),Z=s(52760),Q=s(30081),ee=s(4858),et=s(46294),es=s(14783),er=s(63439),el=s(91459);function ea({items:e,handleRemoveItem:t}){let{language:s}=(0,P.n)(),a=I.P[s],c=(0,Q.X)(),o=(0,w.useSearchParams)(),[n,d]=(0,l.useState)(null);return e&&0!==e.length?(0,r.jsxs)("div",{className:"w-full flex flex-col space-y-4",children:[(0,r.jsx)("div",{className:"flex flex-col gap-4 w-full",children:e.map(e=>{let t=e.Material?.Title||e.Store?.Name||a.checkout.gift_card,s=e.Material?.ECardIconCoverPath||e.Material?.VariantCoverPhoto||e.Material?.CoverPhoto||e.Store?.LogoPath||e.Material?.StoreLogoPath,l=(0,A.un)(e),i=(0,ee.SV)(e.Material?.Title||e.Store?.Name||"Gift Voucher",e.ItemId,e.ItemVariantId??null,e.Store?.Name??null,e.Store?.UId??null),n=i?(0,et.q8)(i,"checkout",o.toString()):"#",x=e.Store?.Branches?.[0]?.CountryIso2;return(0,r.jsxs)(H.TrackingLink,{href:n,inRefId:Y.L.checkoutPage.storeDetails,className:"w-full squircle border-2 border-white/5 p-6 shadow-2xl relative overflow-hidden text-white flex flex-col justify-between min-h-[250px] md:min-h-[280px] group transition-all duration-300 hover:border-emerald-600/60 cursor-pointer block",children:[s?(0,r.jsx)(K.A,{src:(0,Z.X)(s,"lg")||"",alt:t,fill:!0,className:"object-cover object-center transition-transform duration-500 group-hover:scale-105"}):null,(0,r.jsx)("div",{className:"absolute bottom-0 inset-x-0 h-1/3 bg-gradient-to-t from-black/80 via-black/30 to-transparent pointer-events-none transition-opacity duration-300"}),(0,r.jsxs)("div",{className:"flex items-start justify-between z-10",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("h3",{className:"font-bold text-xl md:text-2xl text-white font-bricolage drop-shadow-md",children:e.Store?.Name||e.Material?.BrandName||a.productDetails.store}),(0,r.jsx)("p",{className:"text-xs text-white/80 font-medium drop-shadow-sm",children:a.checkout.gift_card})]}),(0,r.jsx)("button",{onClick:s=>{s.preventDefault(),s.stopPropagation(),d({id:e.Id,title:t})},className:"h-10 w-10 rounded-full bg-black/20 hover:bg-black/80 border border-white/20 flex items-center justify-center text-white/80 hover:text-white transition-all active:scale-95 cursor-pointer z-10",title:a.checkout.remove_item,type:"button",children:(0,r.jsx)(k.A,{className:"size-4"})})]}),(0,r.jsxs)("div",{className:"flex items-end justify-between z-10 w-full mt-auto",children:[x?(0,r.jsxs)(el.m_,{children:[(0,r.jsx)(el.k$,{asChild:!0,children:(0,r.jsxs)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation()},className:"flex items-center gap-2 bg-black/20 pl-2 pr-3 py-1.5 rounded-full border border-white/10 backdrop-blur-sm cursor-default",children:[(0,r.jsx)("div",{className:"w-6 h-6 relative shrink-0 overflow-hidden rounded-full shadow-sm flex items-center justify-center",children:(0,r.jsx)(er.iF,{countryIso2:x,countryName:es.A[x],fill:!0,className:"object-cover"})}),(0,r.jsx)("span",{className:"text-white/90 font-medium text-[12px] md:text-[14px]",children:es.A[x]||x})]})}),(0,r.jsx)(el.ZI,{side:"top",sideOffset:6,className:"bg-white text-sm font-medium py-2 px-3 rounded-xl  shadow-2xl max-w-[200px] text-center border border-white/10",children:(a.checkout?.egift_country_available_desc||"").replace("{country}",es.A[x]||x)})]}):(0,r.jsx)("div",{}),(0,r.jsx)("span",{className:"text-2xl md:text-3xl font-extrabold text-white font-montas drop-shadow-lg ml-auto",children:c(l)})]})]},e.Id)})}),(0,r.jsx)(_.lG,{open:null!==n,onOpenChange:e=>{e||d(null)},children:(0,r.jsxs)(_.Cf,{className:"max-w-[340px] sm:max-w-[340px] w-[88%] bg-neutral-900 border border-neutral-800 rounded-3xl p-6 shadow-2xl text-white",children:[(0,r.jsxs)(_.c7,{className:"flex flex-col items-center text-center space-y-3",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-500/10 border border-red-500/20 flex items-center justify-center text-red-400",children:(0,r.jsx)(J.A,{className:"size-6"})}),(0,r.jsx)(_.L3,{className:"text-xl font-bold font-bricolage text-white",children:a.checkout.remove_from_basket_title}),(0,r.jsx)(_.rr,{className:"text-sm text-neutral-400 text-center",children:(a.checkout.remove_from_basket_confirm||'Are you sure you want to remove "{title}" from your basket?').replace("{title}",n?.title||"")})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 pt-4",children:[(0,r.jsx)(i.$,{type:"button",variant:"outline",onClick:()=>d(null),className:"flex-1 h-11 rounded-full border-neutral-700 bg-neutral-800 text-white hover:bg-neutral-700 hover:text-white font-medium cursor-pointer",children:a.checkout.cancel}),(0,r.jsx)(i.$,{type:"button",onClick:()=>{n&&(t(n.id,n.title),d(null))},className:"flex-1 h-11 rounded-full bg-red-600 hover:bg-red-700 text-white font-bold cursor-pointer",children:a.checkout.remove})]})]})})]}):null}var ei=s(78340);let ec=(0,ei.A)("circle-user-round",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var eo=s(92289),en=s(22368),ed=s(66088),ex=s(22164);let em=(0,ei.A)("arrow-left-right",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);var eh=s(39658),eu=s(90466),ep=s(389),ef=s(86634),eg=s(80642);function eb({isSelfGift:e,setIsSelfGift:t,receiverName:s,setReceiverName:l,receiverPhone:c,setReceiverPhone:o,receiver
1Email:n,setReceiverEmail:d,selectedRelation:x,setSelectedRelation:m,relationPickerOpen:h,setRelationPickerOpen:u,sendGiftLink:p,setSendGiftLink:f,canSwap:g,setCanSwap:b,showValidation:w,showNoCardError:v,validationErrors:j,setValidationErrors:N,recipientNameRef:y,relationRef:_,phoneNumberRef:C,emailRef:S,digitalCardRef:P,savedDigitalCard:I,setSavedDigitalCard:R,onOpenCardSelect:A,onOpenPreview:M,senderNickname:E,onViewDemoLink:O,isDemoLoading:G,t:q}){let D=!e;return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"w-full flex items-center justify-between gap-2 bg_white_3 border border-white/10 rounded-[20px] p-[6px] shadow-[1px_11px_9px_-3px_rgba(0,_0,_0,_0.4)]",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{t(!1),f(!0)},className:`w-full flex items-center justify-center gap-2 h-[49px] text-[13px] sm:text-[14px] font-semibold rounded-[14px] uppercase cursor-pointer transition-all ${D?"bg_black_40 tabBorder text-white shadow-md":"text_gray_70 hover:text-white hover:bg-white/5"}`,children:[(0,r.jsx)(ec,{className:`h-4 w-4 ${D?"text-white":"text_white_40"}`}),q.checkout?.receiver_details||"Receiver Details"]}),(0,r.jsx)("div",{className:"w-[1px] h-6 bg-white/10 my-auto shrink-0"}),(0,r.jsxs)("button",{type:"button",onClick:()=>{t(!0),f(!1),b(!1)},className:`w-full flex items-center justify-center gap-2 h-[49px] text-[13px] sm:text-[14px] font-semibold rounded-[14px] uppercase cursor-pointer transition-all ${!D?"bg_black_40 tabBorder text-white shadow-md":"text_gray_70 hover:text-white hover:bg-white/5"}`,children:[(0,r.jsx)(eo.A,{className:`h-4 w-4 ${!D?"text-white":"text_white_40"}`}),q.checkout?.deliver_me||"Deliver Me"]})]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"w-full flex flex-col gap-1",children:[(0,r.jsx)("div",{ref:y,className:`checkoutInput rounded-2xl px-4 h-[61px] flex items-center shadow-[1px_11px_9px_-3px_rgba(0,_0,_0,_0.4)] ${w&&!s?"ring-1 ring-red-500":""}`,children:(0,r.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[(0,r.jsx)(en.A,{className:"h-5 w-5 text-gray-400"}),(0,r.jsx)(eh.p,{value:s,onChange:e=>{l(e.target.value),j.recipientName&&N(e=>({...e,recipientName:void 0}))},placeholder:D?q.checkout.receivers_name||"Receiver's Name":q.checkout.your_name||"Your Name",className:"text-[14px] sm:text-[15px] md:text-[16px] lg:text-[17px] placeholder:text-[14px] placeholder:sm:text-[15px] placeholder:md:text-[16px] placeholder:lg:text-[17px] border-0 p-0 text-white font-medium focus-visible:ring-0 shadow-none placeholder:text-white/70 bg-transparent"})]})}),j.recipientName&&(0,r.jsx)("p",{className:"text-red-400 text-sm font-thin mt-1 ml-1",children:j.recipientName})]}),D&&(0,r.jsxs)("div",{className:"flex flex-col gap-1 w-fit shrink-0",children:[(0,r.jsx)(ef.X,{selectedRelation:x,setSelectedRelation:e=>{if(-1===e.Id){t(!0),f(!1),b(!1),u(!1),j.relation&&N(e=>({...e,relation:void 0}));return}m(e),j.relation&&N(e=>({...e,relation:void 0}))},relationPickerOpen:h,setRelationPickerOpen:u,trigger:(0,r.jsxs)("button",{type:"button",ref:_,onClick:()=>u(!0),className:`checkoutInput rounded-2xl px-4 h-[61px] flex items-center justify-between gap-1 transition cursor-pointer shadow-[1px_11px_9px_-3px_rgba(0,_0,_0,_0.4)] w-full overflow-hidden ${j.relation?"ring-1 ring-red-500":""}`,children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-nowrap",children:[(0,r.jsx)(K.A,{priority:!0,src:"/sugary-web-assets/icons/relation-icon.svg",alt:"relation",width:18,height:18,className:"shrink-0"}),(0,r.jsx)("span",{className:`${x?"text-white":"text_gray_70"} text-[14px] md:text-[15px] whitespace-nowrap font-medium truncate`,children:x?.Title||q.checkout?.relation||"Relation"})]}),(0,r.jsx)(ed.A,{className:"h-4 w-4 text-gray-400 shrink-0"})]})}),j.relation&&(0,r.jsx)("p",{className:"text-red-400 text-sm font-thin mt-1 ml-1",children:j.relation})]})]}),(0,r.jsxs)("div",{ref:C,children:[(0,r.jsx)(ep.L,{value:c,onChange:e=>{o(e),j.phoneNumber&&N(e=>({...e,phoneNumber:void 0}))},initialCountryCode:"BD",placeholder:D?q.checkout.receivers_mobile||"Receiver's Mobile":q.checkout.your_mobile||"Your Mobile Number",hasError:w&&!c}),j.phoneNumber&&(0,r.jsx)("p",{className:"text-red-400 text-sm font-thin mt-1 ml-1",children:j.phoneNumber})]}),(0,r.jsxs)("div",{className:"w-full flex flex-col gap-1",children:[(0,r.jsx)("div",{ref:S,className:`checkoutInput rounded-2xl px-4 h-[61px] flex items-center shadow-[1px_11px_9px_-3px_rgba(0,_0,_0,_0.4)] ${j.email?"ring-1 ring-red-500":""}`,children:(0,r.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[(0,r.jsx)(eo.A,{className:"h-5 w-5 text-gray-400 shrink-0"}),(0,r.jsx)(eh.p,{type:"email",value:n,onChange:e=>{d(e.target.value),j.email&&N(e=>({...e,email:void 0}))},placeholder:D?q.checkout.receivers_email||"Receiver's Email Address":q.checkout.your_email||"Your Email Address",className:"text-[14px] sm:text-[15px] md:text-[16
1px] lg:text-[17px] placeholder:text-[14px] placeholder:sm:text-[15px] placeholder:md:text-[16px] placeholder:lg:text-[17px] border-0 p-0 text-white font-medium focus-visible:ring-0 shadow-none placeholder:text-white/70 bg-transparent"})]})}),j.email&&(0,r.jsx)("p",{className:"text-red-400 text-sm font-thin mt-1 ml-1",children:j.email})]}),(0,r.jsxs)("div",{className:"checkoutBg backdrop-blur-[25px] squirclePayment p-4 shadow-[1px_11px_9px_-3px_rgba(0,_0,_0,_0.4)]",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 mt-1 mx-2",children:[(0,r.jsx)(K.A,{height:20,width:20,alt:"gifticon",src:"/sugary-web-assets/icons/checkout_gift_icon_active.svg",className:"mt-1.5"}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 w-full",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("p",{className:"text-white font-semibold text-[19px] font-bricolage",children:q.checkout.gift_link}),(0,r.jsx)("div",{className:"h-[1px] w-[20%] bg-white/20"})]}),(0,r.jsx)(eu.d,{checked:!!D,disabled:!0,className:"flex-shrink-0 scale-125 origin-right md:scale-100 data-[state=checked]:bg-white data-[state=unchecked]:bg-white/20 cursor-pointer disabled:opacity-70"})]})})]}),(0,r.jsx)("p",{className:"text_gray_50 text-[12px] sm:text-[14px] lg:text-[17px] mt-2 mb-3 mx-2",children:p&&D?q.checkout.gift_link_desc_on:q.checkout.gift_link_desc_off}),p&&D&&(0,r.jsxs)("div",{className:"space-y-4 pt-2",children:[(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsxs)("div",{ref:P,className:"w-[40%] shrink-0 flex flex-col items-center",children:[(0,r.jsx)("div",{onClick:A,className:`hover:border-gray-400 relative w-full aspect-[4/5]  squircle flex flex-col items-center justify-center border overflow-hidden  transition-all duration-300 cursor-pointer hover:shadow-xl ${w&&!I?"border-red-500 ring-4 ring-red-500/10":"border-white/35 border-dashed"} ${v&&!I?"animate-pulse":""}`,children:I?(0,r.jsxs)("div",{className:"relative w-full h-full",children:[(0,r.jsx)(K.A,{src:(0,Z.X)(I.card.CoverPhoto,"md")||"",alt:"Selected Card",fill:!0,className:"object-cover"}),(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),R(null)},className:"absolute top-2 right-2 p-3 md:p-1.5 bg-black/50 hover:bg-gray-600 rounded-full transition-colors z-10 cursor-pointer hover:text-black border border-white/40",children:(0,r.jsx)(k.A,{className:"text-white ",size:18})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(K.A,{src:"/sugary-web-assets/icons/mouse-cursor.svg",alt:"No Card",width:50,height:50,priority:!0,className:"my-6 invert opacity-100"}),(0,r.jsx)("span",{className:"text-white/50 font-bold text-[10px] md:text-sm uppercase text-center px-2",children:q.checkout.choose_card})]})}),(0,r.jsx)(eg.N,{children:v&&!I&&(0,r.jsx)(a.P.span,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0},className:"text-red-500 text-[10px] font-bold mt-1 uppercase",children:q.checkout.no_card_selected})})]}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)("div",{onClick:M,className:"relative w-full h-full aspect-[16/9] squircle overflow-hidden shadow-sm flex items-center justify-center cursor-pointer group",children:(0,r.jsxs)("div",{className:"relative w-full h-full flex items-center justify-center",children:[(0,r.jsx)(K.A,{src:"/sugary-web-assets/images/giftdemo.png",alt:"Gift Wrap",fill:!0,className:"object-cover"}),(0,r.jsxs)("div",{className:"relative h-full w-full overflow-hidden group border-none",children:[(0,r.jsx)(K.A,{src:"/sugary-web-assets/images/wrap-paper.png",alt:"Gift Wrap",fill:!0,className:"object-cover scale-[1.05]"}),(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsx)("div",{className:"relative w-full flex flex-col items-center justify-center",children:(0,r.jsx)("div",{className:"text-sm relative w-full flex flex-col items-center justify-center transform font-playfair-display",children:(0,r.jsxs)("div",{className:"!font-meow-script text-[#1B3C53]/80 select-none flex flex-col space-y-4 items-center text-[28px] md:text-[25px]",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center mb-0",children:[(0,r.jsx)("p",{className:"opacity-60 text-[25px] md:text-[22px]",children:q.checkout.gift_from}),(0,r.jsx)("p",{className:"font-medium leading-tight text-[24px] md:text-[25px]",children:E||q.checkout.you})]}),(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsx)("p",{className:"opacity-60 text-[25px] md:text-[22px]",children:q.checkout.for}),(0,r.jsx)("p",{className:"font-medium leading-tight text-[24px] md:text-[25px]",children:s?.split(" ")?.[0]||q.checkout.recipient_placeholder})]})]})})})})]})]})})})]}),(0,r.jsx)("div",{className:"flex gap-4 mt-3",children:(0,r.jsx)(i.$,{onClick:O,disabled:G,className:"text-[12px] sm:text-[14px] flex-1 h-[52px] rounded-full bg-[#234a34]/60 hover:bg-[#234a34] text-white font-bold uppercase flex items-center justify-center gap-2 disabled:opacity-70",children:G?q.checkout.loading_demo:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ex.A,{className:"h-4 w-4"}),q.checkout.view_demo_link]})})}),(0,r.jsx)("p",{className:"text-[12px] sm:text-[14px] lg:text-[17px] font-semibold text-white/40 text-center mt-2 mb-4",children:q.checkout.receiver_link_desc})]})]}),D&&(0,r.jsxs)("div",{className:"checkoutBg backdrop-blur-[25px] squirclePayment p-4 shadow-[1px_11px_9px_-3px_rgba(0,_0,_0,_0.4)]",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 mt-1 mx-2",children:[(0,r.jsx)(em,{className:`h-5 w-5 mt-1 shrink-0 transition-colors ${g?"text-emerald-400":"text-gray-400"}`}),(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 w-full",children:[(0,r.jsx)("p",{className:"text-white font-semibold text-[19px] font-bricolage",children:g?q.checkout.swap_enabled||"Swap Enabled !":q.checkout.allow_swapping||"Allow Swapping?"}),(0,r.jsx)(eu.d,{checked:g,onCheckedChange:e=>b(e),className:"flex-shrink-0 scale-125 origin-right md:scale-100 data-[state=checked]:bg-white data-[state=unchecked]:bg-white/20 cursor-pointer disabled:opacity-70"})]})})]}),(0,r.jsx)("p",{className:"text_gray_50 text-[12px] sm:text-[14px] lg:text-[17px] mt-2 mx-2",children:g?q.checkout.swap_desc_on:q.checkout.swap_desc_off})]})]})]})}let ew=(0,c.default)(()=>Promise.all([s.e(9066),s.e(8444)]).then(s.t.bind(s,28444,23)),{loadableGenerated:{webpack:()=>[28444]},ssr:!1});function ev(){let e=(0,g.useGlobalStore)(e=>e.current_user),t=null!=e&&!e.IsGuest,{openAuthModal:s}=(0,G.w)(),c=(0,f.a)(),{language:H}=(0,P.n)(),Y=I.P[H],J=(0,v.rd)(),K=(0,w.useSearchParams)(),Z=(0,g.useGlobalStore)(e=>e.isHydrated),Q=(0,l.useState)(X)[0],ee=null!==K.get("deliverMe"),et=ee?(0,V.H)(K.get("deliverMe"))??!1:Q?.isSelfGifting??!1,[es,er]=(0,l.useState)(et),[el,ei]=(0,l.useState)(Q?.receiverName??""),[ec,eo]=(0,l.useState)(Q?.receiverPhone??void 0),[en,ed]=(0,l.useState)(Q?.receiver
1Email??""),[ex,em]=(0,l.useState)(Q?.selectedRelation??null),[eh,eu]=(0,l.useState)(!1),[ep,ef]=(0,l.useState)(ee?!et:Q?.sendGiftLink??!et),[eg,ev]=(0,l.useState)(Q?.canSwap??!1),[ej,eN]=(0,l.useState)(!1),[ey,ek]=(0,l.useState)(!1),[e_,eC]=(0,l.useState)({}),[eS,eP]=(0,l.useState)(Q?.selectedPaymentMethod??null),[eI,eR]=(0,l.useState)(Q?.userPromoCode??null),[eA,eM]=(0,l.useState)(!1),[eE,eO]=(0,l.useState)(!1),[eG,eq]=(0,l.useState)(null),[eD,e$]=(0,l.useState)(Q?.savedDigitalCard??null),[eB,eF]=(0,l.useState)(!1),[eL,eU]=(0,l.useState)(!1),[ez,eT]=(0,l.useState)(null),eV=(0,l.useRef)(null),eW=(0,l.useRef)(null),eX=(0,l.useRef)(null),eH=(0,l.useRef)(null),eY=(0,l.useRef)(null),eJ=(0,l.useRef)(null),[eK,eZ]=(0,l.useState)(!1),[eQ,e0]=(0,l.useState)(!1),[e1,e2]=(0,l.useState)(!1);(0,l.useEffect)(()=>{es||e2(!1)},[es]);let[e4,e5]=(0,l.useState)(!1),e3=Y.checkout?.demo_link_failed??"Couldn't build the demo link. Please try again.",e6=async()=>{if(!eL){if(!eD){ek(!0),eN(!0);return}if(tp()){if(!t&&!await s())return;eU(!0);try{let e=await (0,B.xD)(),t=await (0,C.Op)(tx({isDemo:!0,referrerStoreUId:e})),s=t?.OrderId;if(!s)throw Error(t?.Message||"No demo order id");eV.current=s;let r=await (0,C.cu)(s),l=r?.Link?.Id;if(!l)throw Error("No gift link on the demo order");eT(`${S.yV}/${l}`)}catch(e){console.error("[Checkout] View demo link failed:",e),b.oR.error(e3)}finally{eU(!1)}}}},{basketItems:e7,isLoading:e9,_hasHydrated:e8,removeItem:te}=(0,o.M)(),tt=K.get("basketItem"),ts="true"==K.get("retry"),tr=(0,l.useRef)(tt??ts?Q?.initialBasketItemParam??null:null);tt&&!tr.current&&(tr.current=tt);let tl=tt??tr.current,ta=(0,l.useMemo)(()=>{if(!tl)return null;let e=tl.split(",").map(e=>Number(e.trim())).filter(e=>Number.isFinite(e));return e.length>0?new Set(e):null},[tl]),ti=(0,l.useMemo)(()=>(e7||[]).filter(e=>e.IsInCoverage&&(e.OrderTypeId===S.qc.EGift||e.MaterialTypeId===S.vF.GiftVoucher||e.MaterialTypeId===S.vF.EGiftCard)&&(!ta||ta.has(e.Id))),[e7,ta]),tc=(0,l.useMemo)(()=>(0,A.yo)(ti),[ti]),to=(0,l.useRef)(null),tn=(0,l.useRef)(!1),td=(0,l.useRef)(!1);(0,l.useEffect)(()=>{if(td.current||!ti.length)return;td.current=!0;let e=ti.map(F.Ot),t=(0,F.KF)(ti);F.pl.beginCheckout(e,t),L.UJ.initiateCheckout(e,t),U.Tq.checkoutStarted(e,t)},[ti]),(0,l.useEffect)(()=>{var t;t={initialBasketItemParam:tr.current,isSelfGifting:es,receiverName:el,receiverPhone:ec,receiverEmail:en,selectedRelation:ex,sendGiftLink:ep,canSwap:eg,savedDigitalCard:eD,senderNickname:e?.FirstName??null,receiverNickname:el?.split(" ")?.[0]??null,userPromoCode:eI,selectedPaymentMethod:eS},queueMicrotask(()=>{try{let e={savedAt:Date.now(),data:t};localStorage.setItem(W,JSON.stringify(e))}catch{}})},[es,el,ec,en,ex,ep,eg,eD,e,eI,eS]);let tx=(0,l.useCallback)(({isDemo:t=!1,referrerStoreUId:s=null})=>(0,O.B)({orderIdToDiscard:to.current,referrerStoreUId:s,storeBaskets:tc,storeOrderStates:{},selectedPaymentMethod:eS,userPromoCode:eI,isRequest:!1,isSelfGift:es,relation:es?null:ex,isDemo:t,typeId:S.qc.EGift,sendGiftLink:!es&&ep,canSwap:!es&&eg,deliveryProvidedByCustomer:es,receiverName:el||(es?e?.FirstName:""),receiverPhoneNumber:ec,receiverEmail:en,selectedDigitalCard:eD?.card,digitalCardText:eD?.message,senderNickname:e?.FirstName??null,receiverNickname:el?.split(" ")?.[0]??null}),[es,es,tc,eS,eI,ex,ep,eg,el,e,ec,en,eD?.card,eD?.message]),{isCostBreakdownLoading:tm,costBreakdown:th}=(0,D.q)({buildCreateDto:tx,storeBaskets:tc,orderStates:{},deliveryLocation:null,sendGiftLink:!es&&ep,hasConfirmedMap:!1,withoutAddress:!es,selectedDigitalCard:eD,userPromoCodeId:eI?.Id}),tu=(0,l.useCallback)((e,t)=>{te(e),b.oR.success(`Removed ${t} from basket`)},[te]),tp=()=>{let e={},t=null;return!el.trim()&&(e.recipientName=Y.checkout?.recipient_name_required||"Recipient name is required",t||(t=eW)),es||ex||(e.relation=Y.checkout?.relation_required||"Relation is required",t||(t=eX)),!ec&&(e.phoneNumber=Y.checkout?.phone_number_required||"Phone number is required",t||(t=eH)),es&&!en?.trim()?(e.email=Y.checkout?.email_required||"Email address is required",t||(t=eY)):en?.trim()&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(en.trim())&&(e.email=Y.checkout?.invali
1d_email||"Please enter a valid email address",t||(t=eY)),es||!ep||eD?ek(!1):(e.digitalCard="No card is selected",ek(!0),t||(t=eJ)),eC(e),eN(Object.keys(e).length>0||ep&&!es&&!eD),t?.current&&t.current.scrollIntoView({behavior:"smooth",block:"center"}),0===Object.keys(e).length},tf=async()=>{if(!tp())return;if(!t)return void s();if(!e?.PhoneNumber||!e.PhoneNumber.trim()){eZ(!0),e5(!1);return}let r=ec?(0,u.lq)(ec.startsWith("+")?ec:`+${ec}`)?.number:null,l=g.useGlobalStore.getState().current_user,a=l?.PhoneNumber?(0,u.lq)(l.PhoneNumber.startsWith("+")?l.PhoneNumber:`+${l.PhoneNumber}`)?.number:null;if(!es&&r&&a&&r===a&&!e1){e0(!0),e5(!1);return}if(!eS)return void b.oR.error(Y.checkout?.select_payment_method||"Select payment method");e5(!0);try{let e=await (0,B.xD)(),t=tx({referrerStoreUId:e}),s=await (0,C.Op)(t);if(s&&s.Url){if(!tn.current){tn.current=!0;let e=ti.map(F.Ot),t=(0,F.KF)(ti);F.pl.addPaymentInfo(e,t,eS?.Title),L.UJ.addPaymentInfo(e,t)}to.current=s.OrderId,(0,z.L)(s.OrderId,s.AmountInUsd),J.push(s.Url)}else b.oR.error("Failed to generate payment redirect URL")}catch(e){console.error("[Digital Checkout] Error placing order:",e),b.oR.error(`${Y.checkout?.order_failed||"Order failed"}: ${e?.message||"Check your connection"}`)}finally{e5(!1)}};return e8&&Z&&(!e9||0!==ti.length)?0===ti.length?(0,r.jsx)("div",{className:"flex flex-col items-center justify-center min-h-[70vh] px-4",children:(0,r.jsxs)(a.P.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5,ease:"easeOut"},className:"rounded-[2.5rem] flex flex-col items-center text-center max-w-lg w-full",children:[(0,r.jsx)("div",{className:"w-48 h-48",children:(0,r.jsx)(ew,{animationData:p,loop:!0})}),(0,r.jsx)("h2",{className:"text-3xl lg:text-4xl font-montas font-bold text_gray_70 mb-4",children:Y.checkout?.your_basket_empty||"Your Basket is Empty"}),(0,r.jsx)("p",{className:"text_gray_50 text-sm mb-8 max-w-[300px]",children:Y.checkout?.your_basket_empty_desc||"Explore our digital gift vouchers and send gifts instantly."}),(0,r.jsx)(i.$,{asChild:!0,className:"bg-[#1B3C53] hover:bg-[#1B3C53]/90 text-white px-8 py-6 rounded-full text-sm font-bold shadow-lg transition-transform hover:scale-105 active:scale-95",children:(0,r.jsx)(v.N_,{href:"/search",children:Y.checkout?.start_gifting||"Start Gifting"})})]})}):(0,r.jsxs)("div",{className:"min-h-screen flex flex-col mx-4 ",children:[(0,r.jsx)(q.default,{redirect:!1,showLocationPicker:!1,showBasketButton:!1,isFloating:!1}),(0,r.jsx)("div",{className:"w-full landing-section-container",children:(0,r.jsxs)("div",{className:"grid landing-content-padding gap-6 grid-cols-1 md:grid-cols-2 xl:grid-cols-[0.9fr_1fr_0.6fr]",children:[(0,r.jsxs)("div",{className:"order-2 md:order-1 space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center mt-4 mb-2",children:[(0,r.jsxs)("h2",{className:"text-[18px] ml-3 uppercase font-semibold text_gray_40 font-bricolage whitespace-nowrap",children:[c?"2.":"1."," ",Y.checkout.your_gift_cards]}),(0,r.jsx)("div",{className:"h-[1px] bg-white/10 w-full mx-4"}),(0,r.jsxs)("p",{className:"text-[18px] ml-3 uppercase font-semibold text_gray_40 font-bricolage whitespace-nowrap",children:[ti.length," ",ti.length>1?Y.checkout.items_count:Y.checkout.item_count]})]}),(0,r.jsx)(ea,{items:ti,storeBaskets:tc,handleRemoveItem:tu})]}),(0,r.jsxs)("div",{className:"order-1 md:order-2 space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center mt-4 mb-2",children:[(0,r.jsxs)("h2",{className:"text-[18px] ml-3 uppercase font-semibold text_gray_40 font-bricolage whitespace-nowrap",children:[c?"1.":"2."," ",Y.checkout?.receiver_details||"Receiver Details"]}),(0,r.jsx)("div",{className:"h-[1px] bg-white/10 w-[50%] ml-4"})]}),(0,r.jsx)(eb,{isSelfGift:es,setIsSelfGift:er,receiverName:el,setReceiverName:ei,receiverPhone:ec,setReceiverPhone:eo,receiver
1Email:en,setReceiverEmail:ed,selectedRelation:ex,setSelectedRelation:em,relationPickerOpen:eh,setRelationPickerOpen:eu,sendGiftLink:ep,setSendGiftLink:ef,canSwap:eg,setCanSwap:ev,showValidation:ej,showNoCardError:ey,validationErrors:e_,setValidationErrors:eC,recipientNameRef:eW,relationRef:eX,phoneNumberRef:eH,emailRef:eY,digitalCardRef:eJ,savedDigitalCard:eD,setSavedDigitalCard:e$,onOpenCardSelect:()=>eO(!0),onOpenPreview:()=>eF(!0),onViewDemoLink:e6,isDemoLoading:eL,senderNickname:e?.FirstName||"",t:Y,availableCountryIso2:tc[0]?.Store?.Branches?.[0]?.CountryIso2})]}),(0,r.jsxs)("div",{className:"order-3 col-span-1 md:col-span-2 xl:col-span-1 space-y-5",children:[(0,r.jsxs)("div",{className:"flex items-center mt-4 mb-2",children:[(0,r.jsxs)("h2",{className:"text-[18px] ml-3 uppercase font-semibold text_gray_40 font-bricolage whitespace-nowrap",children:["3. ",Y.checkout?.payment_summary||"Payment & Summary"]}),(0,r.jsx)("div",{className:"h-[1px] bg-white/10 w-[50%] ml-4"})]}),(0,r.jsx)(E.A,{data:th,isLoading:tm}),(0,r.jsx)(M.A,{orderType:S.qc.EGift,paymentMethod:eS,setPaymentMethod:eP}),(0,r.jsx)(T.A,{appliedPromo:eI,onApplyPromo:eR,orderTypeId:S.qc.EGift,onOpenModal:async()=>!!t||await s(),storeIds:tc.map(e=>e.StoreId)}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("button",{onClick:tf,disabled:e4||!eS||0===ti.length,className:"flex items-center justify-center gap-2 cursor-pointer w-[97%] mt-4 mx-auto px-4 py-5 md:py-4 rounded-full text-[17px] font-bold uppercase confirm_order_gradient relative transition-all active:scale-95 disabled:bg-none disabled:bg-gray-700 disabled:text-gray-400 disabled:opacity-60 disabled:cursor-not-allowed disabled:shadow-none hover:opacity-90",style:{boxShadow:"inset 0 0 0 1px rgba(255,255,255,0.1)"},children:[(0,r.jsxs)("span",{className:`flex items-center justify-center gap-2 ${e4?"opacity-0":"opacity-100"}`,children:[(0,r.jsx)(j.default,{src:"/sugary-web-assets/icons/shopping-cart.svg",alt:"shopping icon",priority:!0,width:24,height:24}),Y.checkout?.pay_now||"Pay Now",(0,r.jsx)(N.A,{className:"w-5 h-5 text-current"})]}),e4&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsxs)("svg",{className:"animate-spin h-5 w-5 text-current",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})]}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-3 p-2 mt-3 ml-4 !text-[#518569]/86",children:[(0,r.jsx)(y.A,{size:30}),(0,r.jsx)("span",{className:"text-lg md:text-sm font-medium",children:Y.checkout?.secured_payment_desc||"Secured & Encrypted Checkout"})]})]})]})]})}),(0,r.jsx)(n.A,{isOpen:eE,onClose:()=>eO(!1),onSelectCard:e=>{eq(e),eO(!1),eM(!0)}}),(0,r.jsx)(d.A,{isOpen:eA,onClose:()=>{eM(!1),eq(null)},card:eG||eD?.card||null,onConfirm:(e,t)=>{e$({card:e,message:t}),eM(!1),eq(null)}}),(0,r.jsx)(x.A,{isOpen:eB,onClose:()=>eF(!1),giftFrom:e?.FirstName||"",giftFor:el,onSave:(e,t)=>{ei(t),eF(!1)}}),(0,r.jsx)(_.lG,{open:!!ez,onOpenChange:e=>!e&&eT(null),children:(0,r.jsxs)(_.Cf,{className:"w-full h-[100dvh] max-w-none sm:w-[390px] sm:h-auto sm:aspect-[9/19.5] max-h-none sm:max-h-[92vh] p-0 gap-0 overflow-hidden rounded-none sm:rounded-[24px] border-none bg-white shadow-2xl",children:[(0,r.jsx)(_.L3,{className:"sr-only",children:Y.checkout.view_demo_link}),(0,r.jsxs)("div",{className:"relative w-full h-full flex flex-col",children:[(0,r.jsx)("button",{type:"button","aria-label":Y.checkout.close,onClick:()=>eT(null),className:"cursor-pointer absolute top-2 right-2 z-50 p-2 bg-black/35 rounded-full text-white hover:bg-black/50 transition-colors border border-black/15",children:(0,r.jsx)(k.A,{size:28})}),ez&&(0,r.jsx)("iframe",{src:ez,className:"w-full h-full border-none",title:Y.checkout.view_demo_link})]})]})}),(0,r.jsx)(h.default,{isUserPhoneModalOpen:eK,setIsUserPhoneModalOpen:eZ,onSuccess:tf}),(0,r.jsx)(m.A,{isOpen:eQ,onClose:()=>e0(!1),onChangeNumber:()=>{e0(!1),eH.current?.scrollIntoView({behavior:"smooth",block:"center"})},onDeliverMe:()=>{e0(!1),e2(!0),er(!0),ef(!1),ev(!1)}}),(0,r.jsx)("div",{className:"mt-auto pt-8",children:(0,r.jsx)($.PaymentFooter,{})})]}):(0,r.jsx)(R.A,{})}},67534:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u});var r=s(95155),l=s(12115),a=s(4474),i=s(74350),c=s(389),o=s(66609),n=s(35927),d=s(37002),x=s(2693),m=s(82464),h=s(68477);let u=({isUserPhoneModalOpen:e,setIsUserPhoneModalOpen:t,userPhoneError:s,setUserPhoneError:u,deliveryLocation:p,handleUpdateUserPhone:f,isUpdatingPhone:g,onSuccess:b})=>{let[w,v]=(0,l.useState)(!1),[j,N]=(0,l.useState)(""),[y,k]=(0,l.useState)(void 0),_=(0,d.useGlobalStore)(e=>e.setField),{language:C}=(0,x.n)(),S=m.P[C],P=s??j,I=u??N,R=g??w,A=async()=>
1{if(f)return void f();if(!y||!y.trim())return void I(S.checkout?.phone_number_required||"Mobile number is required");try{v(!0),I("");let e=await (0,n.r7)({PhoneNumber:y});if(e?.Success||e?.User)o.oR.success("Phone number updated successfully"),await (0,h.G)(_),t(!1),b&&setTimeout(()=>{b()},100);else{let t=e?.Message||"Failed to update phone number";I(t),o.oR.error(t)}}catch(t){let e=t?.Message||t?.message||"Failed to update phone number";I(e),o.oR.error(e)}finally{v(!1)}};return(0,r.jsx)(i.lG,{open:e,onOpenChange:e=>{e||t(!1)},children:(0,r.jsxs)(i.Cf,{onOpenAutoFocus:e=>e.preventDefault(),className:"mx-auto max-h-[85vh] h-auto w-[95%] md:w-[440px] flex flex-col p-6 border border-white/10 squircle bg_secondary text-white gap-5 shadow-2xl",children:[(0,r.jsxs)(i.c7,{className:"p-0 border-b-0 space-y-1",children:[(0,r.jsx)(i.L3,{className:"text-left text-xl font-bold text-white font-bricolage",children:S.checkout.your_mobile_whatsapp||"Your Mobile/Whatsapp Number"}),(0,r.jsx)("p",{className:"text-sm text-white/60 text-left",children:S.checkout.provide_mobile_desc||"Please provide your number in case we need to contact you regarding your order."})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(c.L,{value:y,onChange:e=>{k(e),I("")},initialCountryCode:p?.CountryIso2??"BD",placeholder:S.checkout.enter_mobile||"Enter mobile number",hasError:!!P}),P&&(0,r.jsx)("p",{className:"text-red-400 text-xs font-thin mt-1 ml-1",children:P})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-3 pt-2",children:[(0,r.jsx)(a.$,{variant:"ghost",onClick:()=>t(!1),className:"rounded-full px-5 h-[52px] text-white/70 hover:text-white hover:bg-white/10 cursor-pointer",disabled:R,children:S.checkout.cancel}),(0,r.jsx)(a.$,{onClick:A,disabled:R,className:"squircle px-6 h-[52px] bg-[#19734a] hover:bg-[#19734a]/80 text-white font-bold transition-all shadow-md flex items-center gap-2 cursor-pointer ",children:R?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{className:"animate-spin h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),S.checkout.updating||"Updating..."]}):S.checkout.update_continue||"Update & Continue"})]})]})})}},68477:(e,t,s)=>{s.d(t,{G:()=>i,v:()=>c});var r=s(37002),l=s(35927),a=s(27714);async function i(e){try{let t=await (0,l.wz)();e(r.X.CurrentUser,t)}catch{}}async function c(e){try{let t=await (0,a.Rr)();t&&e(r.X.Currency,t)}catch{}}},92289:(e,t,s)=>{s.d(t,{A:()=>r});let r=(0,s(78340).A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]])}}]);

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.