1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8865],{14390:(e,t,s)=>{s.d(t,{Op:()=>i,cu:()=>n,hv:()=>a});var r=s(35844),l=s(2125);let a=async e=>{try{let t=await r.u.post(l.TV.PRICE_QUOTE,e);return await t.json()}catch{return null}},i=async e=>{let t=await r.u.post(l.TV.CREATE,e);return await t.json()},n=async e=>{try{let t=await r.u.get(l.TV.DETAILS+"?id="+e);return await t.json()}catch{return null}}},15800:(e,t,s)=>{s.d(t,{A:()=>m});var r=s(95155),l=s(12115),a=s(66088),i=s(23511),n=s(39457),o=s(80642),c=s(2693),d=s(23591),u=s(30081);let x=e=>{let t=(e.Title||"").trim().toLowerCase();return 0!==e.Amount&&"vat"!==t},m=({data:e,isLoading:t})=>{let s,m=(0,u.X)(),[h,p]=(0,l.useState)(!1),{language:f}=(0,c.n)(),g=d.P[f];return(0,r.jsxs)("div",{className:"bg-black-30 border border-white/10 shadow-[1px_11px_9px_-3px_rgba(0,_0,_0,_0.4)] p-6 md:p-4 !pb-10 squircleCost",children:[(0,r.jsxs)("button",{onClick:()=>p(!h),className:"w-full flex items-center justify-between cursor-pointer group",children:[(0,r.jsx)("span",{className:"text-[15px] font-bold uppercase text_gray_40 ml-0.5",children:g.checkout.total}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[e?(0,r.jsx)("span",{className:"text-[18px] font-bold text-white",children:m(e.Total)}):(0,r.jsx)(i.E,{className:"h-6 w-24 bg-white/10 rounded"}),(0,r.jsx)(n.P.div,{animate:{rotate:180*!!h},transition:{duration:.2},children:(0,r.jsx)(a.A,{className:"h-6 w-6 text_gray_50 group-hover:text-white transition-colors"})})]})]}),(0,r.jsx)(o.N,{children:h&&(0,r.jsx)(n.P.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:[.4,0,.2,1]},className:"overflow-hidden",children:t?(0,r.jsx)("div",{className:"space-y-4 pt-4 px-1",children:[1,2,3].map(e=>(0,r.jsxs)("div",{className:"flex justify-between items-center py-3 border-b border-white/5",children:[(0,r.jsx)(i.E,{className:"h-4 w-32 bg-white/10 rounded"}),(0,r.jsx)("div",{className:"flex items-center gap-4",children:(0,r.jsx)(i.E,{className:"h-4 w-16 bg-white/10 rounded"})})]},e))}):e?(0,r.jsxs)("div",{className:"pt-4 space-y-6 pb-6",children:[e.StoreOrders?.map((e,t)=>{let s=e.Items?.filter(x)||[];return 0===s.length?null:(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("h4",{className:"text-[12px] font-bold text_gray_50 uppercase px-1 mb-1",children:e.StoreName||g.productDetails.store}),s.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center justify-between py-2 px-1 border-b border-white/5 last:border-0",children:[(0,r.jsx)("span",{className:"text-[14px] font-medium text_gray_70 flex-1 truncate mr-4",children:e.Title||"Item"}),(0,r.jsx)("div",{className:"flex items-center gap-6",children:(0,r.jsx)("span",{className:"text-[14px] font-bold text_white_75 min-w-[60px] text-right",children:m(e.Amount,{})})})]},t))]},e.StoreId||t)}),0===(s=e.Items?.filter(x)||[]).length?null:(0,r.jsx)("div",{className:`space-y-1 ${e.StoreOrders&&e.StoreOrders.length>0?"pt-4 border-t border-white/10":""}`,children:s.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center justify-between py-2 px-1 border-b border-white/5 last:border-0",children:[(0,r.jsx)("span",{className:"text-[14px] font-medium text_gray_70 flex-1 truncate mr-4",children:e.Title||"Charge"}),(0,r.jsx)("div",{className:"flex items-center gap-6",children:(0,r.jsx)("span",{className:"text-[14px] font-bold text_white_75 min-w-[60px] text-right",children:m(e.Amount,{})})})]},t))})]}):null})})]})}},20193:(e,t,s)=>{s.d(t,{A:()=>p});var r=s(95155),l=s(12115),a=s(74350),i=s(39658),n=s(4474),o=s(33210),c=s(77012),d=s(21362),u=s(74937),x=s(37002),m=s(2693),h=s(23591);function p({isOpen:e,onClose:t,giftFrom:s,giftFor:f,onSave:g}){let{language:b}=(0,m.n)(),v=h.P[b],[y,j]=(0,l.useState)(s),[w,N]=(0,l.useState)(f),C=(0,x.useGlobalStore)(e=>e.current_user);return(0,l.useEffect)(()=>{e&&(j(s),N(f))},[e,s,f]),(0,r.jsx)(a.lG,{open:e,onOpenChange:t,children:(0,r.jsxs)(a.Cf,{className:"mx-auto max-h-[90vh] w-[95%] md:w-[480px] p-2 bg-background border-none squircle shadow-2xl overflow-hidden flex flex-col",children:[(0,r.jsxs)(a.c7,{className:"relative",children:[(0,r.jsx)(a.L3,{className:"text-[20px] font-bricolage md:text-xl mt-2 font-bold text-white text-center ",children:v.checkout.gift_preview||"Gift Preview"}),(0,r.jsx)("button",{onClick:t,className:"absolute right-0 top-0 p-2 rounded-full hover:bg-black/5 transition-colors cursor-pointer",children:(0,r.jsx)(o.A,{size:20,className:"text-gray-400"})})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto scrollbar-hide px-1",children:[(0,r.jsxs)("div",{className:"relative w-full h-full flex items-center justify-center p-4",children:[(0,r.jsx)(u.A,{src:"/sugary-web-assets/images/giftdemo.png",alt:"Gift Wrap",fill:!0,className:"object-cover transition-transform duration-500 group-hover:scale-105 rounded-[26px]"}),(0,r.jsxs)("div",{className:"relative aspect-square w-[90%] overflow-hidden group border-none",children:[(0,r.jsx)(u.A,{src:"/sugary-web-assets/images/wrap-paper.png",alt:"Gift Wrap",fill:!0,className:"object-cover transition-transform duration-700 group-hover:scale-105"}),(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 p-8",children:(0,r.jsx)("div",{className:"text-lg gap-5 relative w-full flex flex-col items-center justify-center p-4 transform !font-achiela",children:(0,r.jsxs)("div",{className:"!font-meow-script text-[#1B3C53]/80 text-[22px] md:text-xl select-none flex flex-col space-y-4 items-center",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsx)("p",{className:"text-[18px] md:text-lg",children:v.checkout.gift_from}),(0,r.jsx)("p",{className:"font-medium leading-tight",children:(y||C?.FirstName||v.checkout.you).slice(0,12)})]}),(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsx)("p",{className:"text-[18px] md:text-lg",children:v.checkout.for}),(0,r.jsx)("p",{className:"font-medium leading-tight",children:(w||v.checkout.recipient_placeholder).slice(0,12)})]})]})})})})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("label",{className:"text-lg md:text-sm font-bold mb-4 md:mb-2 text-white ml-2",children:v.checkout.gift_from}),(0,r.jsx)("div",{className:"bg-black/10 squircle p-4 border border-white/15 shadow-sm",children:(0,r.jsx)(i.p,{value:y,onChange:e=>j(e.target.value),placeholder:v.checkout.your_name||"Your Name",maxLength:12,className:"border-none p-0 h-[32px] bg-transparent focus-visible:ring-0 text_gray_70 font-semibold text-[12px] sm:text-[14px] lg:text-[17px] placeholder:text-[14px] md:placeholder:text-[16
1px] placeholder:text-white/60 shadow-none"})})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("label",{className:"text-lg md:text-sm font-bold mb-4 md:mb-2 text-white ml-2",children:v.checkout.for}),(0,r.jsx)("div",{className:"bg-black/10 squircle p-4 border border-white/15 shadow-sm",children:(0,r.jsx)(i.p,{value:w,onChange:e=>N(e.target.value),placeholder:v.checkout.receivers_name,maxLength:12,className:"border-none p-0 h-[32px] bg-transparent focus-visible:ring-0 text_gray_70 fontsemi-bold text-[12px] sm:text-[14px] lg:text-[17px] placeholder:text-[14px] md:placeholder:text-[16px] placeholder:text-white/60 shadow-none"})})]})]})]}),(0,r.jsx)("div",{className:"pt-2",children:(0,r.jsxs)(n.$,{onClick:()=>g(y,w),className:"w-full h-[52px] rounded-full bg-[#00553a] hover:bg-[#6A7A3C] text-white font-bold flex items-center justify-center gap-2 shadow-xl transition-all hover:scale-[1.02] active:scale-95 border-none",children:[(0,r.jsx)("div",{className:"bg-white/20 p-1.5 rounded-full",children:(0,r.jsx)(c.A,{size:20,className:"text-white"})}),(0,r.jsx)("span",{className:"text-xl md:text-sm",children:v.checkout.save_update||"Save & Update"}),(0,r.jsx)(d.A,{size:20,className:"opacity-60"})]})})]})})}},22167:(e,t,s)=>{s.d(t,{D:()=>a,L:()=>l});let r=e=>`sugary_purchase_usd_${e}`;function l(e,t){if(null!=e&&null!=t&&Number.isFinite(t))try{sessionStorage.setItem(r(e),String(t))}catch{}}function a(e){if(null==e)return null;try{let t=sessionStorage.getItem(r(e));if(null==t)return null;let s=Number(t);return Number.isFinite(s)?s:null}catch{return null}}},29868:(e,t,s)=>{s.d(t,{A:()=>k});var r=s(95155),l=s(12115),a=s(74350),i=s(39658),n=s(4474),o=s(52530),c=s(33210),d=s(41585),u=s(61878),x=s(6296),m=s(17758),h=s(80642),p=s(39457),f=s(66609),g=s(2125),b=s(35844),v=s(76348);async function y(e){try{let t=`${g.gf.APPLY_PROMO}?codeId=${e}`,s=await b.u.get(t);return await s.json()}catch(e){return{Success:!1,Message:(e instanceof Error?e.message:String(e||""))||"Failed to avail promo code",Data:null}}}async function j(e={}){try{let t=(0,v.B)(e),s=await b.u.get(`${g.gf.GET_BY_CODE}${t}`);return await s.json()}catch(e){return{Success:!1,Message:(e instanceof Error?e.message:String(e||""))||"Failed to fetch promo code by code",Data:null}}}async function w(e={}){try{let t=(0,v.B)(e),s=await b.u.get(`${g.gf.GET_ALL_ACTIVE}${t}`);return await s.json()}catch(e){return console.error("Failed to fetch active promo codes:",e),[]}}var N=s(17050),C=s(2693),_=s(23591);function k({giftingCountryIso2:e,appliedPromo:t,onApplyPromo:s,onPromoFailed:g,onOpenModal:b,storeIds:v,orderTypeId:I=N.qc.GiftMarket}){var P;let{language:S}=(0,C.n)(),A=_.P[S],[T,E]=(0,l.useState)(!1),[L,R]=(0,l.useState)(""),[G,$]=(0,l.useState)(!1),[D,U]=(0,l.useState)(null),[z,O]=(0,l.useState)(null),[M,q]=(0,l.useState)(!1),[F,B]=(0,l.useState)([]),[V,Z]=(0,l.useState)("");(0,l.useEffect)(()=>{T&&W()},[T]),(0,l.useEffect)(()=>{let e=setTimeout(()=>{Z(L.trim().toUpperCase())},400);return()=>clearTimeout(e)},[L]);let W=async()=>{try{let t=await w({orderTypeId:I,giftingCountryIso2:e});B(t)}catch(e){console.error("Failed to fetch active promos:",e)}},Q=(0,l.useMemo)(()=>V?F.filter(e=>(e.Code?.toUpperCase()||"").includes(V)):F,[F,V]);(0,l.useEffect)(()=>{if(!V){U(null),O(null),$(!1);return}F.some(e=>(e.Code?.toUpperCase()||"").includes(V))?(U(null),O(null),$(!1)):X(V)},[V,F]);let X=async t=>{if(t){$(!0),O(null),U(null);try{let s=await j({code:t,orderTypeId:I,giftingCountryIso2:e});if(!s){U(null),O(`No promo code found for "${t}"`);return}let r=s?.Data||s?.Promo||s?.data||null;if(!r&&s&&"object"==typeof s&&"Id"in s?r=s:Array.isArray(s)&&s.length>0&&(r=s[0]),r)U(r);else{U(null);let e="Message"in s&&s.Message||"message"in s&&s.message||`No promo code found for "${t}"`;O(e),g?.(e)}}catch(e){console.error("Error searching promo code:",e),O(e?.message||"Failed to search promo code"),U(null)}finally{$(!1)}}},J=async e=>{let t=e.Id;if(!t)return void f.oR.error("Invalid promo code ID");q(!0);try{let r=await y(t),l=r?.Message||r?.message,a=!!(r?.Success||r?.success),i=r?.Promo||r?.Data||r?.data||e;a||i?(f.oR.success(a?"Promo code applied successfully!":"Promo code applied!"),s&&s(i),W(),E(!1)):(f.oR.error(l||"Failed to apply promo code"),g?.(l||null))}catch(t){console.error("Error applying promo code:",t),e?(f.oR.success("Promo code applied!"),s&&s(e),E(!1)):f.oR.error("An error occurred while applying the promo code")}finally{q(!1)}},Y=t?.Code||t?.Title||t?.PromoCode?.Code||t?.PromoCode?.Title||t?.Tag||"PROMO",H=(P=t?.StoreId??t?.PromoCode?.StoreId,null==P||""===P||!v||0===v.length||v.some(e=>null!=e&&String(e)===String(P))),K=async()=>
1{b&&!1===await b()||(R(""),Z(""),U(null),O(null),W(),E(!0))};return(0,r.jsxs)("div",{children:[t?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsxs)("p",{onClick:K,className:"cursor-pointer text-xl md:text-sm font-bold text-white/50 hover:text-white transition-colors flex items-center justify-center gap-1.5 hover:underline text-center",children:[(0,r.jsx)(o.A,{size:18})," ",Y]}),(0,r.jsx)("button",{onClick:()=>{s&&s(null),f.oR.info("Promo code removed")},className:"p-1 rounded-full hover:bg-white/10 text-gray-400 hover:text-white transition-colors cursor-pointer",children:(0,r.jsx)(c.A,{size:16})})]}),!H&&(0,r.jsxs)("div",{className:"text-yellow-500/80 text-sm flex items-center justify-center gap-2",children:[(0,r.jsx)(d.A,{size:16,className:"shrink-0 text-yellow-500"}),(0,r.jsx)("span",{children:"Promo is not applicable for the selected stores"})]})]}):(0,r.jsxs)("p",{onClick:K,className:"cursor-pointer text-xl md:text-sm font-bold text-white/50 hover:text-white transition-colors flex items-center justify-center gap-1.5 hover:underline w-full text-center",children:[(0,r.jsx)(o.A,{size:18})," ",A.checkout.have_coupon||"Have promo code?"]}),(0,r.jsx)(a.lG,{open:T,onOpenChange:E,children:(0,r.jsxs)(a.Cf,{className:"sm:max-w-[480px] p-6 bg_primary border-none squircle shadow-2xl max-h-[85vh] flex flex-col",children:[(0,r.jsx)("button",{onClick:()=>E(!1),className:"absolute right-4 top-4 p-2 rounded-full hover:bg-white/10 transition-colors z-10 cursor-pointer border-none",children:(0,r.jsx)(c.A,{className:"h-5 w-5 text_gray_70"})}),(0,r.jsx)(a.c7,{className:"mb-4 flex-shrink-0",children:(0,r.jsx)(a.L3,{className:"text-2xl md:text-lg font-bold text-white text-center uppercase",children:A.checkout.apply_promo||"Promo Code"})}),(0,r.jsx)("div",{className:"flex-shrink-0 mb-4 space-y-2",children:(0,r.jsxs)("div",{className:"relative glass_card rounded-full flex items-center",children:[(0,r.jsx)("div",{className:"absolute left-4 text-white z-10 pointer-events-none",children:(0,r.jsx)(u.A,{size:22})}),(0,r.jsx)(i.p,{value:L,onChange:e=>R(e.target.value.toUpperCase()),onKeyDown:e=>{let t;"Enter"===e.key&&(t=L.trim().toUpperCase())&&Z(t)},placeholder:A.checkout.enter_promo||"Type Promo Code (e.g. NEWUSER)",className:"w-full h-14 pl-12 pr-28 border-none rounded-full text-white placeholder:text-gray-400 focus-visible:ring-1 focus-visible:ring-white/20 transition-all text-lg md:text-sm font-medium"})]})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto pr-1 -mr-1 scrollbar-hide",children:(0,r.jsxs)(h.N,{mode:"popLayout",children:[G?(0,r.jsxs)(p.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"flex flex-col items-center justify-center py-10 gap-2",children:[(0,r.jsx)(x.A,{className:"h-8 w-8 text-emerald-400 animate-spin"}),(0,r.jsx)("p",{className:"text-base md:text-xs text_gray_70 font-medium",children:A.checkout.searching_promo_code||"Searching promo code..."})]},"loader"):D?(0,r.jsxs)(p.P.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0},className:"space-y-2 mb-4",children:[(0,r.jsx)("p",{className:"text-base md:text-xs font-bold text-gray-300 uppercase mb-2",children:A.checkout.search_result||"Search Result"}),(0,r.jsxs)("div",{className:"bg-white/10 squircle p-4 shadow-sm relative overflow-hidden flex items-center justify-between border border-white/10",children:[(0,r.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-1.5",style:{backgroundColor:D.ColorCode||"#1B3C53"}}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 pl-3 flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h4",{className:"text-xl md:text-base font-bold text-white truncate",children:D.Code}),D.Tag&&(0,r.jsx)("span",{className:"text-sm md:text-[10px] font-bold px-3 py-1 rounded-full text-white whitespace-nowrap",style:{backgroundColor:D.ColorCode||"#1B3C53"},children:D.Tag})]}),D.Title&&(0,r.jsx)("p",{className:"text-base md:text-xs font-medium text-gray-200 truncate",children:D.Title})]}),(0,r.jsx)(n.$,{onClick:()=>J(D),disabled:M,style:{backgroundColor:D.ColorCode||"#1B3C53"},className:"cursor-pointer h-[52px] md:h-8 px-5 rounded-xl text-xl md:text-xs font-bold text-white hover:opacity-90 transition-opacity whitespace-nowrap min-w-[110px] ml-3",children:M?(0,r.jsx)(x.A,{size:18,className:"animate-spin"}):A.checkout.apply_coupon})]})]},"searchResult"):z?(0,r.jsxs)(p.P.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"text-center py-6 px-4 bg-white/5 rounded-xl border border-white/10 mb-4",children:[(0,r.jsx)(m.A,{className:"h-9 w-9 text_gray_30 mx-auto mb-2"}),(0,r.jsx)("p",{className:"text-base md:text-xs text_gray_70 font-medium",children:z})]},"searchError"):null,Q.length>0&&(0,r.jsx)("div",{className:"space-y-3",children:Q.map(e=>(0,r.jsxs)("div",{className:"bg-white/10 squircle p-4 shadow-sm relative overflow-hidden flex items-center justify-between border border-white/10",children:[(0,r.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-1.5"}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 pl-3 flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h4",{className:"text-xl md:text-base font-bold text-white truncate",children:e.Code}),e.Tag&&(0,r.jsx)("span",{className:"text-sm md:text-[10px] font-bold px-3 py-1 rounded-full text-white whitespace-nowrap",style:{backgroundColor:e.ColorCode||"#1B3C53"},children:e.Tag})]}),e.Title&&(0,r.jsx)("p",{className:"text-base md:text-xs font-medium text-gray-200 truncate",children:e.Title})]}),(0,r.jsx)(n.$,{onClick:()=>{f.oR.success("Promo code applied successfully!"),s&&s(e),E(!1)},style:{backgroundColor:e.ColorCode||"#1B3C53"},className:"cursor-pointer h-[52px] md:h-8 px-5 rounded-xl text-xl md:text-xs font-bold text-white hover:opacity-90 transition-opacity whitespace-nowrap min-w-[110px] ml-3",children:A.checkout.apply_coupon})]},e.Id))})]})})]})})]})}},30630:(e,t,s)=>{s.d(t,{F:()=>l,b:()=>a});let r=e=>`sugary_order_basket_items_${e}`;function l(e,t){if(null==e)return;let s=t.flatMap(e=>e.Items.map(e=>e.Id));if(0!==s.length)try{sessionStorage.setItem(r(e),JSON.stringify(s))}catch{}}function a(e){if(null==e)return null;try{let t=sessionStorage.getItem(r(e));if(null==t)return null;let s=JSON.parse(t);if(!Array.isArray(s))return null;let l=s.filter(e=>"number"==typeof e&&Number.isFinite(e));return l.length>0?l:null}catch{return null}}},39540:(e,t,s)=>{s.d(t,{T:()=>a});var r=s(95155);s(12115);var l=s(91337);function a({className:e,...t}){return(0,r.jsx)("textarea",{"data-slot":"textarea",className:(0,l.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-md border bg-background px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}},43209:(e,t,s)=>{s.d(t,{J5:()=>a,KF:()=>i});var r=s(2125),l=s(35844);async function a(e){try{let t=`${r.F_.GET_METHODS}?orderType=${e}`,s=await l.u.get(t);return await s.json()}catch(e){return console.error("Failed to fetch payment methods:",e),[]}}async function i(e,t=30){try{let s=`${r.X1}?paymentId=${e}&timeoutSeconds=${t}`,a=(Number(t)+5)*1e3,i=new Promise((e,t)=>{setTimeout(()=>{t(Error("Verification timeout"))},a)}),n=(async()=>{let e=await l.u.get(s);return await e.json()})();return await Promise.race([n,i])}catch(t){return console.error("Payment verification failed:",t),{Success:!1,PaymentId:e.toString(),Unverified:!0}}}},54590:(e,t,s)=>{s.d(t,{A:()=>b});var r=s(95155),l=s(74350),a=s(39658),i=s(41641),n=s(21362),o=s(33210),c=s(61878),d=s(12115),u=s(74937),x=s(2693),m=s(23591),h=s(30081),p=s(57185);let f=(0,d.memo)(({card:e,onSelectCard:t})=>{let s=(0,h.X)();return(0,r.jsxs)("button",{type:"button",onClick:()=>t(e),style:{borderColor:e.EnvelopColor??void 0},className:"group/card border border-neutral-700 relative flex-shrink-0 w-[140px] aspect-[3/4] rounded-xl overflow-hidden transition-transform duration-200 sm:hover:scale-[1.03] sm:hover:z-10 sm:hover:shadow-lg cursor-pointer shadow-sm snap-start bg-neutral-800 select-none",children:[e.CoverPhoto&&(0,r.jsx)(u.A,{src:e.CoverPhoto,fixedSize:u.n.sm,alt:"card",fill:!0,loading:"lazy",className:"w-full h-full object-cover"}),(0,r.jsx)("div",{className:"absolute bottom-2 left-2 bg-neutral-900/90 text-gray-100 text-[10px] font-semibold px-2 py-1 rounded-md shadow-sm z-20 pointer-events-none",children:(e.SalesPrice??0)===0?"FREE":s(e.SalesPrice)})]})});
1f.displayName="CardItem";let g=(0,d.memo)(({group:e,onSelectCard:t})=>{let s=(0,d.useRef)(null),l=e=>{s.current?.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})};return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-1",children:[(0,r.jsx)("h3",{className:"text-[18px] md:text-lg font-semibold text-gray-100 font-montas",children:e.Category.Title}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>l("left"),className:"p-3 md:p-1.5 bg-neutral-800 hover:bg-neutral-700 rounded-full text-gray-300 transition-colors cursor-pointer","aria-label":"Scroll left",children:(0,r.jsx)(i.A,{className:"h-4 w-4"})}),(0,r.jsx)("button",{type:"button",onClick:()=>l("right"),className:"p-3 md:p-1.5 bg-neutral-800 hover:bg-neutral-700 rounded-full text-gray-300 transition-colors cursor-pointer","aria-label":"Scroll right",children:(0,r.jsx)(n.A,{className:"h-4 w-4"})})]})]}),(0,r.jsx)("div",{ref:s,className:"flex gap-4 overflow-x-auto pb-2 scrollbar-hide snap-x",children:e.Cards.map(e=>(0,r.jsx)(f,{card:e,onSelectCard:t},e.Id))})]})});function b({isOpen:e,onClose:t,onSelectCard:s,initialCategories:i=[]}){let[n,u]=(0,d.useState)(""),[h,f]=(0,d.useState)(""),[v,y]=(0,d.useState)(i),[j,w]=(0,d.useState)(!1),[N,C]=(0,d.useState)(0),[_,k]=(0,d.useState)(!0),I=(0,d.useRef)(null),{language:P}=(0,x.n)(),S=m.P[P];(0,d.useEffect)(()=>{let e=setTimeout(()=>f(n),500);return()=>clearTimeout(e)},[n]);let A=(0,d.useCallback)(async(e,t)=>{w(!0);try{let s=await (0,p.q$)({skip:e,limit:10,cardPerCategory:20,keyword:h||null}),r=s.map(e=>{let t=new Set,s=e.Cards.filter(e=>!t.has(e.Id)&&(t.add(e.Id),!0));return{...e,Cards:s}});y(e=>{if(t)return r;let s=new Set(e.map(e=>e.Category.Id)),l=r.filter(e=>!s.has(e.Category.Id));return[...e,...l]}),k(s.length>=10)}finally{w(!1)}},[h]);(0,d.useEffect)(()=>{e&&(C(0),k(!0),A(0,!0))},[h,e]);let T=(0,d.useCallback)(()=>{if(!_||j)return;let e=N+10;C(e),A(e,!1)},[_,j,N,A]);return(0,d.useEffect)(()=>{let e=I.current;if(!e)return;let t=new IntersectionObserver(e=>{e[0].isIntersecting&&T()},{threshold:.1,rootMargin:"200px"});return t.observe(e),()=>t.disconnect()},[T]),(0,r.jsx)(l.lG,{open:e,onOpenChange:t,children:(0,r.jsxs)(l.Cf,{className:"w-[calc(100%-2rem)] sm:w-full h-[calc(100%-2rem)] sm:h-[80vh] max-w-full sm:max-w-2xl squircle flex flex-col p-0 gap-0 overflow-hidden bg-neutral-900 border border-neutral-800",children:[(0,r.jsxs)("div",{className:"border-b border-neutral-800 p-4 sm:p-5 space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(l.L3,{className:"text-[22px] md:text-lg font-bricolage font-semibold text-gray-100",children:S.checkout.choose_card}),(0,r.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-full hover:bg-neutral-800 text-gray-400 transition-colors cursor-pointer","aria-label":"Close",children:(0,r.jsx)(o.A,{className:"h-5 w-5"})})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(c.A,{className:"absolute left-5 top-1/2 -translate-y-1/2 h-6 w-6 text-gray-500"}),(0,r.jsx)(a.p,{value:n,onChange:e=>u(e.target.value),placeholder:S.checkout.search,className:"h-[52px] rounded-full pl-14 pr-9 bg-neutral-800 border-neutral-700 text-white placeholder:text-white/30 text-[12px] sm:text-[14px] lg:text-[17px] placeholder:text-[14px] md:placeholder:text-[16px]"}),n&&(0,r.jsx)("button",{type:"button",onClick:()=>u(""),className:"absolute right-5 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300",children:(0,r.jsx)(o.A,{className:"h-6 w-6 md:h-4 md:w-4"})})]})]}),(0,r.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 sm:p-5 space-y-6 custom-scrollbar-visible overscroll-contain",children:[v.map(e=>(0,r.jsx)(g,{group:e,onSelectCard:s},e.Category.Id)),!j&&0===v.length&&(0,r.jsxs)("div",{className:"py-20 text-center",children:[(0,r.jsx)("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-full bg-neutral-800 border border-neutral-700 mb-4",children:(0,r.jsx)(c.A,{className:"h-6 w-6 text-gray-500"})}),(0,r.jsx)("p",{className:"text-[20px] md:text-base font-medium text-gray-200",children:S.checkout.no_digital_cards_foun
1d}),(0,r.jsx)("p",{className:"text-xl md:text-sm text-gray-500 mt-1",children:S.checkout.try_different_search_digital})]}),j&&(0,r.jsxs)("div",{className:"py-8 text-center flex flex-col items-center gap-3",children:[(0,r.jsxs)("div",{className:"relative w-8 h-8",children:[(0,r.jsx)("div",{className:"absolute inset-0 border-4 border-neutral-800 rounded-full"}),(0,r.jsx)("div",{className:"absolute inset-0 border-4 border-t-gray-100 rounded-full animate-spin"})]}),(0,r.jsx)("span",{className:"text-xl md:text-sm text-gray-500",children:S.checkout.loading_cards})]}),(0,r.jsx)("div",{ref:I,className:"h-4"})]})]})})}g.displayName="CategorySection"},55241:(e,t,s)=>{s.d(t,{B:()=>i,M:()=>n});var r=s(7268),l=s(37002),a=s(17050);let i=e=>{let t=e.typeId===a.qc.EGift,s=t?null:e.storeBaskets.map(t=>{let s=(e.storeOrderStates??{})[t.StoreId]||{},r=t.Items.map(e=>({ItemId:e.ItemVariantId??e.ItemId,MaterialTypeId:e.MaterialTypeId,Quantity:e.Quantity,BasketId:e.Id,APSelectorId:e.APSelectorId??null}));return{StoreId:t.StoreId,Instruction:s.additionalInstructions??null,CouponId:null,DeliveryCouponId:null,GiftingLat:e.giftingPlace?.RequestLatitude??null,GiftingLong:e.giftingPlace?.RequestLongitude??null,GiftingCountryIso2:e.giftingPlace?.CountryIso2??null,GiftingStateUId:e.giftingPlace?.StateUId??null,GiftingStateName:e.giftingPlace?.StateName??null,GiftingCityUId:e.giftingPlace?.CityUId??null,GiftingCityName:e.giftingPlace?.CityName??null,GiftingAdminZoneUId:e.giftingPlace?.AdminZoneUId??null,GiftingAdminZoneName:e.giftingPlace?.AdminZoneName??null,ReceiverName:e.receiverName??null,ReceiverPhone:e.receiverPhoneNumber??null,ReceiverEmail:e.receiverEmail??null,ReceiverAddress:e.receiverAddress??null,DeliveryProfileId:s.selectedDeliveryProfile?.Id??0,MinDeliveryDate:e.deliveryProvidedByCustomer?s.minDate??null:null,MaxDeliveryDate:e.deliveryProvidedByCustomer?s.maxDate??null:null,MinDeliveryTime:e.deliveryProvidedByCustomer?s.minTime??null:null,MaxDeliveryTime:e.deliveryProvidedByCustomer?s.maxTime??null:null,DynamicDeliveryPricing:!1,Items:r}}),i=t?e.storeBaskets.flatMap(t=>t.Items.map(s=>({APSelectorId:s.APSelectorId??null,CouponId:null,GiftingAdminZoneName:e.giftingPlace?.AdminZoneName??null,GiftingAdminZoneUId:e.giftingPlace?.AdminZoneUId??null,GiftingCityName:e.giftingPlace?.CityName??null,GiftingCityUId:e.giftingPlace?.CityUId??null,GiftingCountryIso2:e.giftingPlace?.CountryIso2??null,GiftingLat:e.giftingPlace?.RequestLatitude??null,GiftingLong:e.giftingPlace?.RequestLongitude??null,GiftingStateName:e.giftingPlace?.StateName??null,GiftingStateUId:e.giftingPlace?.StateUId??null,ItemId:s.ItemId??null,ItemVariantId:s.ItemVariantId??null,MaterialTypeId:s.MaterialTypeId,ReceiverAddress:e.receiverAddress??null,ReceiverEmail:e.receiverEmail??null,ReceiverName:e.receiverName??null,ReceiverPhone:e.receiverPhoneNumber??null,SelectedOptionCoverPhotoPath:null,SelectedOptionTitle:null,StoreId:t.StoreId,VoucherAmount:s.GiftVoucherAmount??(0,r.bT)(s)}))):null;return{OrderIdToDiscard:e.orderIdToDiscard,ReferrerStoreUId:e.referrerStoreUId,IsDemo:e.isDemo,TypeId:e.typeId,SenderNickName:e.senderNickname,ReceiverNickName:e.receiverNickname,CustomerLat:e.customerLat,CustomerLong:e.customerLong,GiftingLat:e.giftingPlace?.RequestLatitude??null,GiftingLong:e.giftingPlace?.RequestLongitude??null,GiftingCountryIso2:e.giftingPlace?.CountryIso2??null,GiftingStateUId:e.giftingPlace?.StateUId??null,GiftingStateName:e.giftingPlace?.StateName??null,GiftingCityUId:e.giftingPlace?.CityUId??null,GiftingCityName:e.giftingPlace?.CityName??null,GiftingAdminZoneUId:e.giftingPlace?.AdminZoneUId??null,GiftingAdminZoneName:e.giftingPlace?.AdminZoneName??null,SendGiftLink:e.sendGiftLink,IsSelfGift:e.isSelfGift,IsRequest:e.isRequest,CanSwap:e.canSwap,DeliveryProvidedByCustomer:e.deliveryProvidedByCustomer,ReceiverUserId:e.receiverUserId,ReceiverName:e.receiverName,ReceiverRelationId:e.relation?.Id,ReceiverPhone:e.receiverPhoneNumber,ReceiverEmail:e.receiverEmail,ReceiverAddress:e.receiverAddress,ReceiverConnectionId:e.receiverConnectionId,ReceiverAddressId:e.receiverAddressId,UserPromoCodeId:e.userPromoCode?.Id,EGiftOrders:i,PaymentData:e.selectedPaymentMethod?{InAppPayment:!1,OrderId:null,Latitude:e.customerLat??null,Longitude:e.customerLong??null,Partial:1,PaymentMethodId:e.selectedPaymentMethod.Id,PlatformPayChosen:!1,Title:null,UserId:l.useGlobalStore.getState().current_user?.Id??null,SuccessUrl:`${a.ar}/payment/success`,FailUrl:`${a.ar}/payment/fail`,CancelUrl:`${a.ar}/payment/cancel`}:null,DigitalCard:e.selectedDigitalCard?{DigitalCardId:e.selectedDigitalCard.Id,CardText:e.digitalCardText}:null,StoreOrders:s}};function n(e){switch(e){case a.qc.GiftMarket:return"/checkout?orderType=4&retry=true";case a.qc.EGift:return"/checkout?orderType=5&retry=true";default:return"/home"}}},58246:(e,t,s)=>{s.d(t,{A:()=>
1o});var r=s(95155),l=s(37206),a=s(12115);let i=(0,l.default)(()=>Promise.all([s.e(9066),s.e(8444)]).then(s.t.bind(s,28444,23)),{loadableGenerated:{webpack:()=>[28444]},ssr:!1}),n=new Map;function o({src:e,...t}){let[l,c]=(0,a.useState)(null);return((0,a.useEffect)(()=>{let t,r=!1;return(!(t=n.get(e))&&((t=Promise.all([fetch(e).then(t=>{if(!t.ok)throw Error(`${t.status} ${e}`);return t.json()}),Promise.all([s.e(9066),s.e(8444)]).then(s.t.bind(s,28444,23))]).then(([e])=>e)).catch(()=>n.delete(e)),n.set(e,t)),t).then(e=>{r||c(e)},()=>{}),()=>{r=!0}},[e]),l)?(0,r.jsx)(i,{...t,animationData:l}):(0,r.jsx)("div",{className:t.className,style:t.style,"aria-hidden":!0})}},63864:(e,t,s)=>{s.d(t,{$p:()=>n,DN:()=>o,xD:()=>c});var r=s(93886),l=s(51781),a=s(29407);let i=["/sugary-web-assets/images/ProfileCover1.jpg","/sugary-web-assets/images/ProfileCover2.jpg","/sugary-web-assets/images/ProfileCover3.jpg","/sugary-web-assets/images/ProfileCover4.jpg","/sugary-web-assets/images/ProfileCover5.jpg","/sugary-web-assets/images/ProfileCover6.jpg","/sugary-web-assets/images/ProfileCover7.jpg"],n=e=>{if(!e)return 1;let t="0123456789",s=e.toLowerCase(),r="";for(let e=0;e<s.length;e++){let l="abcdefghijklmnopqrstuvwxyz-".indexOf(s[e]);-1!==l&&(r+=t[l%t.length])}return r.length>6&&(r=r.substring(0,6)),parseInt(r,10)%14+1},o=(e,t)=>{if(t&&t>0)return i[(t-1)%i.length];if(!e)return i[0];let s="0123456789",r=e.toLowerCase(),l="";for(let e=0;e<r.length;e++){let t="abcdefghijklmnopqrstuvwxyz-".indexOf(r[e]);-1!==t&&(l+=s[t%s.length])}l.length>6&&(l=l.substring(0,6));let a=parseInt(l,10)%i.length;return i[a]??i[0]};async function c(){let e=await (0,r.E)(a.F.REFERRAL_TRAIL);if(!e||!Array.isArray(e)||0===e.length)return null;let t=await (0,l.QB)();if(0===t.length)return null;let s=new Set(t.map(e=>e.toLowerCase()));for(let t=e.length-1;t>=0;t--)if(s.has(e[t].slug.toLowerCase()))return e[t].slug;return null}},65209:(e,t,s)=>{s.d(t,{H:()=>r});let r=e=>"true"===e||"1"===e||"false"!==e&&"0"!==e&&null},65367:(e,t,s)=>{s.d(t,{A:()=>d});var r=s(95155),l=s(74350),a=s(4474),i=s(33210),n=s(58246),o=s(2693),c=s(23591);function d({isOpen:e,onClose:t,onChangeNumber:s,onDeliverMe:u}){let{language:x}=(0,o.n)(),m=c.P[x].checkout;return(0,r.jsx)(l.lG,{open:e,onOpenChange:e=>!e&&t(),children:(0,r.jsxs)(l.Cf,{className:"mx-auto w-[95%] md:w-[400px] flex flex-col p-6 border-none squircle bg-[#161616] shadow-2xl",children:[(0,r.jsx)("button",{onClick:t,className:"absolute right-4 top-4 p-2 rounded-full hover:bg-white/10 transition-colors z-10 cursor-pointer text-white/50 hover:text-white border-none",children:(0,r.jsx)(i.A,{className:"h-5 w-5"})}),(0,r.jsx)(l.c7,{className:"p-0 border-b-0 space-y-0 pb-4",children:(0,r.jsx)(l.L3,{className:"text-center text-2xl font-semibold text-white",children:m.deliver_to_yourself_title})}),(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-6 pt-2",children:[(0,r.jsx)("div",{className:"w-full flex justify-center",children:(0,r.jsx)(n.A,{src:"/sugary-web-assets/animations/instant-gift-self-delivery.json",loop:!0,className:"w-[200px] h-[200px]"})}),(0,r.jsx)("p",{className:"text-white/70 text-center text-[15px] leading-relaxed",children:m.deliver_to_yourself_desc}),(0,r.jsxs)("div",{className:"flex w-full gap-3 pt-2",children:[(0,r.jsx)(a.$,{onClick:s,className:"text-xl lg:text-sm flex-1 h-[48px] bg-[#116e45] hover:bg-[#116e45]/80 text-white font-bold rounded-[14px]",children:m.change_number}),(0,r.jsx)(a.$,{onClick:u,className:"text-xl lg:text-sm flex-1 h-[48px] bg-[#2a2a2a] hover:bg-[#333333] text-white font-bold rounded-[14px]",children:m.deliver_me})]})]})]})})}},69355:(e,t,s)=>{s.d(t,{A:()=>f});var r=s(95155),l=s(12115),a=s(43209),i=s(74350),n=s(44478),o=s(99275),c=s(33210),d=s(21628),u=s(58246),x=s(4474),m=s(74937),h=s(2693),p=s(23591);let f=({orderType:e,paymentMethod:t,setPaymentMethod:s})=>{let{language:f}=(0,h.n)(),g=p.P[f],[b,v]=(0,l.useState)(!1),[y,j]=(0,l.useState)(null),w=(0,l.useCallback)(async()=>{j(await (0,a.J5)(e))},[e]);return(0,l.useEffect)(()=>{w()},[w]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"bg-[#18181B] border border-white/10 shadow-[1px_11px_9px_-3px_rgba(0,_0,_0,_0.4)] p-4 md:p-2 pb-5 space-y-2 -mt-11 relative z-10 squircleCheckoutCard",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center p-2 gap-4",children:[(0,r.jsx)("div",{className:"h-[1px] bg-white/5 w-full "}),(0,r.jsx)("h3",{className:"text-[18px] font-semibold font-bricolage uppercase text_gray_70 whitespace-nowrap",children:g.checkout.payment_method}),(0,r.jsx)("div",{className:"h-[1px] bg-white/5 w-full "})]}),(0,r.jsx)("div",{className:"space-y-1",children:null==y?(0,r.jsx)("div",{className:"flex items-center justify-center p-12",children:(0,r.jsx)("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-[#459850]"})}):y.length>0?y.map((e,l)=>{let a=t?.Id===e.Id;return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{onClick:()=>s(e),className:`relative squirclePayment p-2 md:p-2 cursor-pointer transition-all duration-300 ${a?"!bg-[#001D12]/40 border border-[#007044] shadow-lg":"bg-transparent hover:bg-white/5 border-transparent"}`,children:[(0,r.jsx)("div",{className:`p-4 ${a?"pb-3":"pb-4"}`,children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 relative flex-shrink-0 rounded-lg overflow-hidden",children:e.PhotoPath?(0,r.jsx)(m.A,{src:e.PhotoPath,alt:e.Title,fill:!0,className:"object-contain",fixedSize:m.n.sm}):(0,r.jsx)("div",{className:"w-full h-full bg-white/10 rounded-lg flex items-center justify-center text-gray-400",children:(0,r.jsx)(n.A,{className:"w-5 h-5"})})}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("h4",{className:"font-bold text-white text-[15px] uppercase flex-1",children:e.Title}),(0,r.jsx)("div",{className:"h-[1px] bg-white/10"})]})]}),(0,r.jsx)("div",{className:`w-6 h-6 rounded-full border-[2px] flex items-center justify-center flex-shrink-0 transition-colors ${a?"border-[#459850]":"border-white/30"}`,children:a&&(0,r.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#459850]"})})]})}),e.Description&&(0,r.jsx)("div",{className:`px-4 pb-4 ${a?"":"pt-0"}`,children:(0,r.jsx)("p",{className:`text-[12px] leading-relaxed font-medium ${a?"text-white/70":"text_gray_50"}`,children:e.Description})})]}),l!==y.length-1&&(0,r.jsx)("div",{className:"my-2 h-[1px] bg-white/3 w-full"})]},e.Id)}):(0,r.jsx)("p",{className:"text-sm font-bold text-gray-400 text-center p-8",children:g.checkout.no_payment_methods})}),(0,r.jsxs)("div",{onClick:()=>v(!0),className:"bg-white/5 rounded-2xl p-4 flex items-center justify-between text_gray_70 text-lg md:text-sm cursor-pointer hover:bg-white/5 transition-colors border-none",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(o.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{className:"font-bold",children:g.checkout.cod_not_supported})]}),(0,r.jsx)("div",{className:"w-4 h-4 rounded-full border border-gray-400 flex items-center justify-center text-[8px] font-black italic",children:"i"})]})]}),(0,r.jsx)(i.lG,{open:b,onOpenChange:v,children:(0,r.jsxs)(i.Cf,{className:"mx-auto max-h-[90vh] w-[95%] md:w-[480px] flex flex-col p-8 border-none squircle overflow-hidden glass_card",children:[(0,r.jsx)("button",{onClick:()=>v(!1),className:"absolute right-4 top-4 p-2 rounded-full hover:bg-gray-100 transition-colors z-10 cursor-pointer",children:(0,r.jsx)(c.A,{className:"h-5 w-5 text-gray-400"})}),(0,r.jsx)(i.c7,{className:"p-0 border-b-0 space-y-0",children:(0,r.jsx)(i.L3,{className:"text-center text-2xl font-bold text-white",children:g.checkout.cashless_system_title})}),(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-6 pt-4",children:[(0,r.jsx)("div",{className:"w-48 h-48",children:(0,r.jsx)(u.A,{src:"/sugary-web-assets/animations/cod.json",loop:!0,className:"w-full h-full"})}),(0,r.jsx)("div",{className:"glass_card p-5 rounded-2xl shadow-sm",children:(0,r.jsx)("p",{className:"text-lg text_gray_70 text-center leading-relaxed",children:g.checkout.cashless_system_desc})}),(0,r.jsxs)(x.$,{onClick:()=>v(!1),className:"w-full h-12 squircle color_green hover:brightness-110 text-white font-bold text-lg flex items-center justify-center gap-2 shadow-lg",children:[g.checkout.okay_btn," ",(0,r.jsx)(d.A,{size:16})]})]})]})})]})}},75251:(e,t,s)=>{s.d(t,{U:()=>a});var r=s(12115),l=s(52307);function a(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=e=>{e.persisted&&t(!1)};return window.addEventListener("pageshow",e),()=>window.removeEventListener("pageshow",e)},[]),{isRedirecting:e,redirectToGateway:(0,r.useCallback)(e=>{t(!0);try{(0,l.l)(),window.location.assign(e)}catch(e){throw t(!1),e}},[])}}},76429:(e,t,s)=>{s.d(t,{A:()=>m});var r=s(95155),l=s(74350),a=s(4474),i=s(39540),n=s(52760),o=s(74937),c=s(12115),d=s(41641),u=s(2693),x=s(23591);function m({isOpen:e,onClose:t,card:s,initialMessage:a,onConfirm:p}){let[f,g]=(0,c.useState)(a??""),b=s?(0,n.X)(s.CoverPhoto,"lg"):null,{language:v}=(0,u.n)(),y=x.P[v];return s?(0,r.jsx)(l.lG,{open:e,onOpenChange:t,children:(0,r.jsx)(l.Cf,{className:"mx-auto max-h-[92vh] w-[95%] md:!w-[600px] md:!max-w-[600px] flex flex-col p-0 border-none bg-[#343a45] shadow-2xl overflow-visible transform-gpu rounded-2xl",children:(0,r.jsxs)("div",{className:"relative w-full h-full z-10 overflow-visible",children:[(0,r.jsx)("button",{onClick:t,className:"cursor-pointer absolute -top-12 left-0 p-2.5 rounded-full glass_card text-white shadow-lg z-[100] border border-white/20 hover:scale-110 active:scale-95 transition-transform",children:(0,r.jsx)(d.A,{className:"h-5 w-5"})}),(0,r.jsx)("div",{className:"bg-background/20 backdrop-blur-[2px] rounded-xl overflow-hidden flex flex-col h-full",children:(0,r.jsxs)("div",{className:"relative z-10 flex flex-col h-full p-4",children:[(0,r.jsx)(l.c7,{className:"!m-0 p-0 border-b-0 flex flex-row items-center justify-between mb-4",children:(0,r.jsx)(l.L3,{className:"sr-only",children:y.checkout.write_digital_card||"Personalize Your Card"})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto scrollbar-hide -mx-2 px-2",children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row gap-4 md:gap-8",children:[e&&(0,r.jsx)("div",{className:"relative z-10 w-full max-w-[180px] md:max-w-[280px] rounded-2xl overflow-hidden shadow-xl flex justify-center mx-auto bg-gray-100",children:b&&(0,r.jsx)(o.A,{width:280,height:380,src:b,alt:"Digital Card",className:"object-cover w-full h-auto transform-gpu",priority:!0})}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,r.jsxs)("div",{className:"flex-1 space-y-4",children:[(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsx)("h3",{className:"text-2xl font-bold text-white",children:y.checkout.write_digital_card||"Write digital card"}),(0,r.jsx)("div",{className:"absolute -bottom-2 left-0 w-full opacity-60",children:(0,r.jsx)(o.A,{src:"/sugary-web-assets/images/digital-card-line.svg",alt:"underline",width:140,height:8,className:"w-full object-contain"})})]}),(0,r.jsx)("div",{className:"bg-white/5 backdrop-blur-md rounded-2xl p-4 mt-2 md:mt-6 flex-1 flex flex-col min-h-[140px] md:min-
1h-[250px] border-2 border-white/10 transition-all duration-300",children:(0,r.jsx)(i.T,{value:f,onChange:e=>g(e.target.value),placeholder:y.checkout.write_personal_message,className:"flex-1 bg-transparent border-none focus-visible:ring-0 resize-none text-white placeholder:text-white/20 p-0 text-[12px] sm:text-[14px] lg:text-[17px] placeholder:text-[14px] md:placeholder:text-[16px] leading-relaxed shadow-none"})})]}),(0,r.jsx)("div",{className:"hidden md:block pt-8",children:(0,r.jsx)(h,{card:s,message:f,onConfirm:(e,t)=>p(e,t)})})]})]})}),(0,r.jsx)("div",{className:"md:hidden pt-4 -mx-1",children:(0,r.jsx)(h,{card:s,message:f,onConfirm:(e,t)=>p(e,t)})})]})})]})})}):null}function h({card:e,message:t,onConfirm:s}){let{language:l}=(0,u.n)(),i=x.P[l];return(0,r.jsxs)(a.$,{onClick:()=>s(e,t),style:{backgroundColor:e.EnvelopColor||"#1B3C53"},className:"w-full h-[52px] text-xl md:text-sm rounded-full text-white font-bold shadow-xl transition-all hover:scale-[1.02] active:scale-95 border-none outline-none flex items-center justify-center gap-2",children:[(0,r.jsx)(o.A,{src:"/sugary-web-assets/icons/leaf-pen.svg",alt:"Confirm",width:20,height:20,className:"brightness-0 invert"}),i.checkout.save_confirm]})}},81277:(e,t,s)=>{s.d(t,{c:()=>l,g:()=>a});var r=s(35844);function l(e,t){if(t instanceof r.h)return 401===t.status?{kind:"unauthorized",reason:t.message}:{kind:"rejected",message:t.status<500?t.apiMessage:null,reason:t.message};if(null!=t)return{kind:"network",reason:t instanceof Error?t.message:String(t)};let s=e?.Message?.trim()||null;return{kind:"rejected",message:s,reason:s}}function a(e,t){return"network"===e.kind?t.order_failed_network??"We couldn't reach Sugary. Check your connection and try again.":"rejected"===e.kind&&e.message?`${t.order_failed??"Order failed"}: ${e.message}`:t.order_failed_retry??"We couldn't place your order. Please try again."}},86634:(e,t,s)=>{s.d(t,{X:()=>v});var r=s(95155),l=s(12115),a=s(62489),i=s(33210),n=s(61878),o=s(39658),c=s(16321),d=s(2693),u=s(23591),x=s(35844),m=s(2125);async function h(){try{let e=await x.u.get(m.mP);return await e.json()}catch{return[]}}var p=s(96621);let f={Id:-1,Title:"Myself",ColorCode:"#1B3C53",ReverseRelationMale:null,ReverseRelationFemale:null,OrderTypeId:null,AgeFrom:null,AgeTo:null,PronounId:null};function g({loading:e,error:t,relations:s,selectedRelation:l,search:a,onSearchChange:c,onSelect:x,onClose:m}){let{language:h}=(0,d.n)(),p=u.P[h],b=[f,...s].filter(e=>e.Title.toLowerCase().includes(a.toLowerCase()));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"p-4 border-b border-white/10 relative flex-shrink-0",children:[(0,r.jsx)("h2",{className:"text-center font-semibold text-white text-[20px] font-bricolage",children:p.checkout.relationship_person}),(0,r.jsx)("button",{onClick:m,className:"absolute right-4 top-1/2 -translate-y-1/2 p-2 rounded-full hover:bg-white/5 transition-colors cursor-pointer border-none",children:(0,r.jsx)(i.A,{className:"h-5 w-5 text_gray_70"})})]}),(0,r.jsxs)("div",{className:"p-4 flex-1 overflow-hidden flex flex-col min-h-[400px] max-h-[70vh]",children:[(0,r.jsxs)("div",{className:"relative mb-6 flex-shrink-0 glass_card rounded-full",children:[(0,r.jsx)("div",{className:"absolute left-5 top-1/2 -translate-y-1/2 text_gray_70 z-10 pointer-events-none",children:(0,r.jsx)(n.A,{className:"size-7"})}),(0,r.jsx)(o.p,{type:"text",placeholder:p.checkout.search_relation,value:a,onChange:e=>c(e.target.value),className:"w-full h-[52px] pl-16 pr-4 text-white placeholder:font-semibold placeholder:text-white/80 rounded-full text-xl outline-none border-none ring-0 focus-visible:ring-0"})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto scrollbar-hide min-h-0 p-1",children:e?(0,r.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,r.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-green-500"})}):t?(0,r.jsx)("div",{className:"flex items-center justify-center p-8 text-sm text-red-400",children:t}):0===b.length?(0,r.jsx)("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:(0,r.jsxs)("span",{className:"text-white/50 text-sm",children:[p.checkout.no_results_found,' "',a,'"']})}):(0,r.jsx)("div",{className:"flex flex-wrap gap-3",children:b.map(e=>(0,r.jsx)("button",{onClick:()=>x(e),style:{backgroundColor:e.ColorCode||"#eee",color:"white"},className:`px-8 py-4 rounded-full text-2xl font-semibold hover:scale-105 transition-transform cursor-pointer ${l?.Id===e.Id?"ring-4 ring-offset-2 ring-white/50":"border-transparent"}`,children:e.Title},e.Id))})})]})]})}function b({loading:e,error:t,relations:s,search:l,onSearchChange:a,onSelect:c}
1){let{language:x}=(0,d.n)(),m=u.P[x],h=[f,...s].filter(e=>e.Title.toLowerCase().includes(l.toLowerCase()));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"relative mb-2 shrink-0",children:[(0,r.jsx)(n.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-white/50"}),(0,r.jsx)(o.p,{placeholder:m.checkout.search_relation,value:l,onChange:e=>a(e.target.value),className:"pl-9 bg-white/5 border-none h-10 rounded-xl text-white placeholder:text-white/40 focus-visible:ring-1 focus-visible:ring-white/20 pr-9"}),l&&(0,r.jsx)("button",{onClick:()=>a(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-white/50 hover:text-white transition-colors p-1",children:(0,r.jsx)(i.A,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{className:"max-h-[250px] w-full p-1 overflow-y-auto custom-scrollbar-visible",style:{WebkitOverflowScrolling:"touch"},children:e?(0,r.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,r.jsx)("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-green-500"})}):t?(0,r.jsx)("div",{className:"flex items-center justify-center p-4 text-sm text-red-400",children:t}):0===h.length?(0,r.jsx)("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:(0,r.jsxs)("span",{className:"text-white/50 text-sm",children:[m.checkout.no_results_found,' "',l,'"']})}):h.map(e=>(0,r.jsx)("button",{onClick:()=>c(e),className:"w-full text-left px-3 py-2 cursor-pointer hover:bg-white/10 rounded-md my-0.5 text-sm font-medium transition-colors text-white",children:e.Title},e.Id))})]})}function v({selectedRelation:e,setSelectedRelation:t,relationPickerOpen:s,setRelationPickerOpen:i,trigger:n}){let o=(0,p.a)(),[d,u]=(0,l.useState)(""),[x,m]=(0,l.useState)([]),[f,y]=(0,l.useState)(!0),[j,w]=(0,l.useState)(null);(0,l.useEffect)(()=>{let e=!1;return(async()=>{y(!0),w(null);try{let t=await h();e||m(t)}catch{e||w("Failed to load relations")}finally{e||y(!1)}})(),()=>{e=!0}},[]),(0,l.useEffect)(()=>{s||u("")},[s]);let N=(0,l.useCallback)(e=>{t(e),i(!1)},[t,i]);return o?(0,r.jsxs)(c._s,{open:s,onOpenChange:i,children:[(0,r.jsx)(c.Uz,{asChild:!0,children:n}),(0,r.jsx)(c.zj,{className:"p-0 overflow-hidden glass_card_black border-none shadow-2xl z-[100001] !rounded-t-[24px] outline-none",children:(0,r.jsx)(g,{loading:f,error:j,relations:x,selectedRelation:e,search:d,onSearchChange:u,onSelect:N,onClose:()=>i(!1)})})]}):(0,r.jsxs)(a.AM,{open:s,onOpenChange:i,children:[(0,r.jsx)(a.Wv,{asChild:!0,children:n}),(0,r.jsx)(a.hl,{className:"w-[320px] p-2 z-[100001] bg-[#111114] border border-white/10 shadow-2xl rounded-2xl flex flex-col",side:"bottom",align:"start",onOpenAutoFocus:e=>e.preventDefault(),children:(0,r.jsx)(b,{loading:f,error:j,relations:x,search:d,onSearchChange:u,onSelect:N})})]})}},88797:(e,t,s)=>{s.d(t,{q:()=>a});var r=s(12115),l=s(14390);function a({buildCreateDto:e,storeBaskets:t,orderStates:s,deliveryLocation:i,sendGiftLink:n,hasConfirmedMap:o,withoutAddress:c,selectedDigitalCard:d,userPromoCodeId:u,onQuoteFailed:x}){let[m,h]=(0,r.useState)(!1),[p,f]=(0,r.useState)(null),g=(0,r.useRef)(e);(0,r.useEffect)(()=>{g.current=e},[e]);let b=(0,r.useRef)(x);(0,r.useEffect)(()=>{b.current=x},[x]);let v=(0,r.useMemo)(()=>t.map(e=>`${e.StoreId}:${e.Items.length}:${e.Items.map(e=>`${e.Id}-${e.Quantity}-${e.GiftVoucherAmount??0}-${e.ItemVariantId??0}-${e.CustomizationCost??0}`).join(",")}`).join("|"),[t]),y=(0,r.useMemo)(()=>Object.entries(s).map(([e,t])=>`${e}:${t.selectedDeliveryProfile?.Id??"none"}`).join("|"),[s]),j=(0,r.useMemo)(()=>i?[i.Level,i.CountryIso2,i.StateUId,i.CityUId,i.AdminZoneUId,i.RequestLatitude,i.RequestLongitude].join(":"):"none",[i]),w=(0,r.useMemo)(()=>d?`${d.card?.Id??""}:${d.message??""}`:"none",[d]);return(0,r.useEffect)(()=>{let e=!1;return(async()=>{try{h(!0);let t=g.current({});if(!o){t.GiftingLat=null,t.GiftingLong=null;for(let e=0;e<(t.StoreOrders?.length??0);e++)t.StoreOrders[e].GiftingLat=null,t.StoreOrders[e].GiftingLong=null}let s=await (0,l.hv)(t);!e&&(f(s),s||b.current?.(null))}catch(t){e||b.current?.(t instanceof Error?t.message:null)}finally{e||h(!1)}})(),()=>{e=!0}},[v,y,j,n,c,w,u]),{isCostBreakdownLoading:m,costBreakdown:p}}s(37002),s(23155),s(24723),s(17050)},90466:(e,t,s)=>{s.d(t,{d:()=>n});var r=s(95155),l=s(12115),a=s(23638),i=s(91337);let n=l.forwardRef(({className:e,...t},s)=>(0,r.jsx)(a.bL,{"data-slot":"switch",className:(0,i.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-6 w-11 shrink-0 items-center rounded-full border-2 border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:s,children:(0,r.jsx)(a.zi,{"data-slot":"switch-thumb",className:(0,i.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-5 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}
1));n.displayName=a.bL.displayName},93886:(e,t,s)=>{s.d(t,{E:()=>l});var r=s(9339);let l=(0,r.createServerReference)("40c8c3b8b35c117ca25e2b3953d64b1c383721c179",r.callServer,void 0,r.findSourceMapURL,"getServerCookie")},95580:(e,t,s)=>{s.d(t,{PaymentFooter:()=>o});var r=s(95155),l=s(2693),a=s(23591),i=s(41455),n=s(5772);let o=()=>{let{language:e}=(0,l.n)(),t=a.P[e];return(0,r.jsx)("div",{className:"w-full border-t border-white/10 landing-section-container",children:(0,r.jsxs)("div",{className:"w-full flex flex-col md:flex-row gap-6 justify-between items-center text-[12px] leading-loose text-white/30 pt-8 md:pt-3 pb-16 md:pb-4 landing-content-padding",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-center md:justify-start gap-x-6 gap-y-2 text-[13px] text-white/50",children:[(0,r.jsx)(i.N_,{href:"/",className:"flex items-center",children:(0,r.jsx)(n.default,{src:"/sugary-web-assets/logo/sugary-icon.svg",alt:"Sugary Icon",width:20,height:20,className:"object-contain"})}),(0,r.jsx)(i.N_,{href:"/terms",className:"hover:text-white transition-colors",children:"\xa9 Sugary LLC"}),(0,r.jsx)(i.N_,{href:"/terms",className:"hover:text-white transition-colors",children:t.footer.terms_of_service}),(0,r.jsx)(i.N_,{href:"/privacy",className:"hover:text-white transition-colors",children:t.footer.privacy_policy}),(0,r.jsx)(i.N_,{href:"/home",className:"hover:text-white transition-colors",children:t.footer.delivery_locations}),(0,r.jsx)(i.N_,{href:"/account-deletion",className:"hover:text-white transition-colors",children:t.footer.user_data_deletion}),(0,r.jsx)(i.N_,{href:"/sitemap.xml",className:"hover:text-white transition-colors",children:t.footer.sitemap})]}),(0,r.jsxs)("div",{className:"flex gap-6 items-center flex-wrap mt-4",children:[(0,r.jsx)(n.default,{src:"/sugary-web-assets/icons/stripe-icon.svg",alt:"Stripe",width:40,height:18,className:"object-contain opacity-60 hover:opacity-100 transition-opacity duration-300 ease-in-out"}),(0,r.jsx)(n.default,{src:"/sugary-web-assets/icons/visa-icon.svg",alt:"Visa",width:36,height:12,className:"object-contain opacity-60 hover:opacity-100 transition-opacity duration-300 ease-in-out"}),(0,r.jsx)(n.default,{src:"/sugary-web-assets/icons/bkash-icon.svg",alt:"bKash",width:55,height:22,className:"object-contain opacity-60 hover:opacity-100 transition-opacity duration-300 ease-in-out"}),(0,r.jsx)(n.default,{src:"/sugary-web-assets/icons/amex-icon.svg",alt:"Amex",width:48,height:11,className:"object-contain opacity-60 hover:opacity-100 transition-opacity duration-300 ease-in-out"}),(0,r.jsx)(n.default,{src:"/sugary-web-assets/icons/apple-pay.svg",alt:"Apple Pay",width:36,height:17,className:"object-contain opacity-60 hover:opacity-100 transition-opacity duration-300 ease-in-out"}),(0,r.jsx)(n.default,{src:"/sugary-web-assets/icons/gpay.svg",alt:"Google Pay",width:36,height:17,className:"object-contain opacity-60 hover:opacity-100 transition-opacity duration-300 ease-in-out"})]})]})})}}}]);
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.