1import{j as e,N as M,K as P,r as x,d as b,y as Ze,$ as W,M as R,al as Xe,b4 as qe,p as q,am as Ke,an as de,aO as fe,a1 as Ae,a3 as es,a5 as ss}from"./vendor-d8e6286f.js";import{c as n,cB as ts,b2 as as,cC as rs,I as g,m as B,cD as Le,av as O,p as D,w as l,cE as is,br as _e,H as re,a0 as F,M as Y,cF as ns,aR as cs,bv as ie,bH as ls,cG as ee,cH as os,T,t as Ve,cI as ds,q as ye,al as k,by as ms,cJ as hs,g as ue,h as je,j as ve,aw as ne,af as te,cK as ps,am as Fe,cp as xs,c3 as us,c4 as js,c9 as vs,cL as Ns,cM as Ce,cN as we,bh as bs,ax as le,ay as oe,cO as gs,u as me,o as fs,aB as _s,ao as ys,bz as As,bB as We,K as Q,a1 as Cs,F as ws,cP as Ss,cQ as ks,an as Ps,a2 as Is,x as He,cR as se,e as Ne,J as be,cS as Es,aW as Ds,bt as Ts}from"./index-b580583e.js";import{A as Os,u as Bs,a as Ms}from"./useAddressUsageFilter-ed43b632.js";import{M as U,P as Rs,R as zs,L as Ls,S as Vs}from"./MainSidebar-e2467249.js";import{M as J}from"./MobileHeaderTitle-6fd2729a.js";import{M as Fs,u as Ge}from"./MobileHeaderAddress-1f749f0d.js";import{S as Ue,u as Ws,a as Hs}from"./useIsPudoOrder-acb3574d.js";import{P as Gs}from"./useOrderDeliveryZone-2d11ffef.js";import{PaymentPage as $r}from"./PaymentMethod-c1755eff.js";import{u as Us}from"./DebounceHook-7f37d973.js";import{I as Qs}from"./InfinityScrollLoader-15c90626.js";import{u as Ys}from"./usePromocode-3a376761.js";import{B as Js}from"./Breadcrumbs-76189c5b.js";import{s as y}from"./ReferralProgram.module-6ac94d49.js";import"./pure-9cabf600.js";import"./ProductCardSkeleton-c2df297f.js";const $s=s=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...s,children:[e.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2,d:"M14.166 8a6.1 6.1 0 0 1-1.52 4.047 6.1 6.1 0 0 1-3.76 2.046A5.5 5.5 0 0 1 8 14.16c-.307 0-.594-.02-.887-.067a6.1 6.1 0 0 1-3.76-2.046A6.1 6.1 0 0 1 1.833 8c0-1.547.573-2.973 1.52-4.047a6.1 6.1 0 0 1 3.76-2.046q.428-.069.887-.067c.306 0 .593.02.886.067a6.1 6.1 0 0 1 3.76 2.046A6.1 6.1 0 0 1 14.166 8"}),e.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2,d:"M7.78 14.1c-.427-.447-2.447-2.653-2.447-6.1s2.02-5.653 2.447-6.1M8.22 14.1c.426-.447 2.446-2.653 2.446-6.1S8.646 2.347 8.22 1.9M1.833 8h12.333"})]});const Zs="_container_1fc54_2",Xs="_titleContainer_1fc54_2",ge={container:Zs,titleContainer:Xs},qs="_itemContainer_sedvd_15",Ks="_item_sedvd_15",et="_addressButton_sedvd_18",$={itemContainer:qs,item:Ks,addressButton:et},st=({address:s,isActive:t,isShowDeleteBtn:a,onDelete:r,onEdit:m})=>{const{t:h}=P(),[,o]=x.useState(""),d={type:s.type,street:s.street_address_1,city:s.city},i=async()=>{if(t){B.setIsChangeAddressPopover(!1);return}try{const p=n.showDeliveryMethodSwitcher?Le(s.usage):void 0;p&&O.setDeliveryMethod(p);const c=await D.fetchETA(`${s.latitude},${s.longitude}`,p,p?void 0:{receivePrioritizedDeliveryMethod:!0});if(!c){o(h("deliveryAddressPage:errorAddressNotCovered"));return}l.setDeliveryAddress({zip:s.postcode||"",country:s.country_code||"",city:s.city||"",region:"",address1:s.street_address_1||"",address2:s.street_address_2??"",addressFloor:s.floor??"",addressBld:s.building??"",addressApt:s.apartment??"",type:s.type||is(),shortAddress:s.street_address_1||"",coordinates:{lat:s.latitude,lng:s.longitude},placeId:s.place_id||"",addressId:s.id,comment:s.comment||"",instructions:Ze(s.instructions||[]),usage:s.usage,warehouseCode:s.warehouse_code??void 0}),D.setEtaCalculation(c),B.setIsChangeAddressPopover(!1),O.setDeliverySlots(c.deliverySlots||null)}catch{o(h("deliveryAddressPage:errorAddressNotCovered"))}};return e.jsxs("div",{className:b([$.itemContainer,"item-container"]),"data-company":n.name,children:[e.jsx("input",{type:"radio",className:b(["radio",$.radioInput]),name:"address",id:`address-${s.id}`,value:s.id,checked:t,onChange:i}),e.jsxs("label",{className:b([$.item,"item"]),htmlFor:`address-${s.id}`,children:[e.jsx("div",{className:"left-block",children:e.jsxs("div",{className:"radio-wrapper",children:[e.jsx("span",{className:"mark"}),e.jsxs("div",{className:"text-wrapper",children:[e.jsxs("div",{className:"name flex min-w-0 items-center gap-1",children:[e.jsx("span",{className:"truncate",children:ts(d,h(s.type??""))}),e.jsx(Os,{usage:s.usage,className:"shrink-0"})]}),e.jsx("div",{className:"address",children:as(d)?rs({...d,apartment:s.apartment,floor:s.floor},h):s.street_address_1})]})]})}),e.jsx("div",{className:"right-block",children:e.jsxs("div",{className:b(["icon-wrapper",$.iconButtons]),children:[e.jsx("button",{className:b(["button _no-padding",$.addressButton]),onClick:m,children:e.jsx(g,{type:"edit",size:24})}),a&&e.jsx("button",{className:b(["button _no-padding",$.addressButton]),onClick:r,children:e.jsx(g,{type:"trash",size:24})})]})})]})]})},tt=M(st),at=()=>e.jsx(_e,{rows:12,children:e.jsxs("div",{className:b([ge.itemContainer,"item-container skeleton"]),children:[e.jsx(W,{containerClassName:"control",className:"control"}),e.jsx(W,{containerClassName:"content",className:"content"})]})}),rt=()=>{const{t:s}=P(),{openModal:t}=re(),a=()=>{n.addressSelectedAtCheckout?t(F.CheckoutDestination):n.showNewAddressModal?t(F.EditAddressLocation):t(F.DeliveryAddress)};return e.jsxs("div",{className:"empty-cart",children:[e.jsx("img",{className:"empty-cart__img",src:n.images.address.empty,alt:""}),e.jsx("p",{className:"empty-cart__title",children:s("phrases:emptyAddresses")}),e.jsx("div",{className:"empty-cart__content",children:e.jsxs("button",{className:"button _primary btn-wrapper",onClick:a,children:[e.jsx(g,{type:"plus",size:24}),s("addAddress")]})})]})},Se=M(rt),it=()=>{var v;const{t:s}=P(),{openModal:t}
1=re(),[a,r]=x.useState(null),[m,h]=x.useState(!1),{usage:o,setUsage:d,visibleAddresses:i,isEnabled:p}=Bs({addresses:l.addressList}),c=()=>{n.addressSelectedAtCheckout?t(F.CheckoutDestination):n.showNewAddressModal?t(F.EditAddressLocation,void 0,ns):t(F.DeliveryAddress)},j=u=>{const N=n.showNewAddressModal?F.EditAddressDetails:F.DeliveryAddress;t(N,"cabinet/address",{[cs]:u},!1,!0)},f=async()=>{h(!0),await l.fetchAddresses(),h(!1)};return x.useEffect(()=>{f()},[l.addressList.length]),x.useEffect(()=>{const u=l.deliveryAddress,N=l.addressList.find(({id:_,usage:C})=>_!==(u==null?void 0:u.addressId)?!1:!n.showDeliveryMethodSwitcher||Le(C)===O.deliveryMethod);r((N==null?void 0:N.id)??null)},[(v=l.deliveryAddress)==null?void 0:v.addressId,l.addressList.length,O.deliveryMethod]),e.jsxs(e.Fragment,{children:[e.jsx(Y,{content:e.jsx(J,{isVisibleBackButton:!n.newDesignSystemEnabled,text:s("deliveryAddresses")})}),e.jsxs("div",{className:"content address","data-company":n.name,children:[e.jsx("aside",{className:"sidebar",children:e.jsx(U,{})}),e.jsxs("main",{className:b(["container",ge.container]),children:[e.jsxs("div",{className:ge.titleContainer,children:[e.jsx("h1",{className:"page-title",children:s("deliveryAddresses")}),n.showButtonInTitleAddress&&l.addressList.length>0&&e.jsxs("button",{className:"button _primary btn-wrapper",onClick:c,children:[e.jsx(g,{type:"plus",size:24}),s("addAddress")]})]}),l.addressList.length>0||m?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"top-block",children:[!n.showButtonInTitleAddress&&e.jsx("section",{className:"header",children:e.jsxs("button",{className:"button _primary btn-wrapper",onClick:c,children:[e.jsx(g,{type:"plus",size:24}),s("addAddress")]})}),p&&e.jsx("div",{className:"mb-4 max-desktop:px-4",children:e.jsx(Ms,{value:o,onChange:d})}),e.jsx("section",{className:"address-items",children:l.addressList.length===0?e.jsx(at,{}):i.map(u=>e.jsx(tt,{address:u,isActive:u.id===a,isEditingList:!0,isShowDeleteBtn:!0,onDelete:()=>{l.setAddressToDelete(u.id),t(F.DeleteAddress)},onEdit:()=>j(u.id)},u.id))}),l.addressList.length>0&&i.length===0&&e.jsx(Se,{})]}),e.jsx("div",{className:"bottom-block",children:e.jsxs("button",{className:"button _bordered",onClick:c,children:[e.jsx(g,{type:"plus",size:24}),e.jsx("div",{className:"btn",children:s("addMore")})]})})]}):e.jsx(Se,{})]})]})]})},zr=M(it);const nt="_deliveringWrapper_87yxl_14",ct="_blockOne_87yxl_27",lt="_leftBlock_87yxl_33",ot="_orderTitleWrapper_87yxl_39",dt="_title_87yxl_43",mt="_track_87yxl_47",ht="_point_87yxl_56",pt="_passed_87yxl_63",xt="_icon_87yxl_71",ut="_line_87yxl_79",jt="_active_87yxl_13",vt="_pulse_87yxl_1",Nt="_delivering_87yxl_14",bt="_rightBlock_87yxl_121",gt="_estimateWrapper_87yxl_121",ft="_text_87yxl_128",_t="_short_87yxl_135",yt="_time_87yxl_138",At="_blockTwo_87yxl_147",Ct="_progress_87yxl_154",wt="_inviteWrapper_87yxl_161",St="_referWrapper_87yxl_161",S={deliveringWrapper:nt,blockOne:ct,leftBlock:lt,orderTitleWrapper:ot,title:dt,track:mt,point:ht,passed:pt,icon:xt,line:ut,active:jt,pulse:vt,delivering:Nt,rightBlock:bt,estimateWrapper:gt,text:ft,short:_t,time:yt,blockTwo:At,progress:Ct,inviteWrapper:wt,referWrapper:St},kt=s=>{const{order:t,className:a}=s,{t:r}=P(),m=ie(t.order_id),h=ls(t),o=x.useMemo(()=>{const d=ee.length+1,i=ee.indexOf(t.public_status)+1;return Math.ceil(i/d*100)},[t]);return e.jsxs(R,{to:`/order/${t.id}`,className:b([S.deliveringWrapper,a]),children:[e.jsxs("div",{className:S.blockOne,children:[e.jsxs("div",{className:S.leftBlock,children:[e.jsxs("div",{className:S.orderTitleWrapper,children:[e.jsx("div",{className:S.title,children:r("phrases:orderNum",{number:`#${m}`})}),e.jsx("div",{className:S.track,children:ee.map((d,i)=>{const p=i>=ee.length-1,c=ee.indexOf(t.public_status);return e.jsxs("div",{className:b([S.point,{[S.passed]:i>c,[S.active]:d===t.public_status}]),children:[e.jsx("div",{className:S.icon}),!p&&e.jsx("div",{className:S.line})]},d)})})]}),e.jsx("div",{className:S.delivering,children:r(`orderStatus:${t.public_status}.value`,{context:n.orderStatusContext})})]}
1),e.jsx("div",{className:S.rightBlock,children:e.jsxs("div",{className:S.estimateWrapper,children:[e.jsxs("div",{className:S.text,children:[e.jsx("span",{children:r("phrases:estTimeOfDelivery")}),e.jsx("span",{className:S.short,children:r("phrases:estTimeOfDeliveryShort")})]}),e.jsx("div",{className:S.time,children:h})]})})]}),e.jsx("div",{className:S.blockTwo,children:e.jsx("div",{className:S.progress,style:{width:`${o}%`}})}),n.showReferralProgram&&e.jsx(R,{to:"/cabinet/referral",className:S.inviteWrapper,children:e.jsxs("div",{className:S.referWrapper,children:[e.jsx(g,{type:"refferal",size:16}),e.jsx("div",{className:S.text,children:r("phrases:referFriend")})]})})]})},ke=M(kt),Pt=({isOpen:s,onClose:t})=>{const{t:a}=P(),{setLanguage:r}=os(),m=l.lang||n.config.lang,h=o=>{if(o===m){t();return}r(o)};return x.useEffect(()=>{if(!s)return;const o=d=>{d.key==="Escape"&&t()};return document.addEventListener("keydown",o),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=""}},[s,t]),s?Xe.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex items-end justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:t,role:"presentation"}),e.jsxs("div",{className:"relative w-full max-w-lg rounded-t-6.5 bg-bg-content",children:[e.jsxs("div",{className:"flex items-center py-4 pr-4 pl-6",children:[e.jsx(T.Header150Medium,{className:"flex-1 py-1 text-text-primary",children:a("chooseLanguage")}),e.jsx(Ve,{size:"S",variant:"outline",icon:"close",onClick:t,"aria-label":a("close")})]}),e.jsx(ds,{currentLang:m,onSelect:h,className:"px-6 pt-2 pb-safe-offset-6"})]})]}),document.body):null},It=M(Pt),he=()=>{x.useEffect(()=>{ye.promotionStore.getRewardedPromocodesStatus()},[])},Et=(s,t)=>qe(s,{addSuffix:!0,locale:t}),Dt="_noOrders_2q23j_14",Tt="_slide_2q23j_23",Ot="_inactiveSlide_2q23j_31",Bt="_activeOrdersSlider_2q23j_39",Mt="_activeOrdersSliderContent_2q23j_45",Rt="_commonSlide_2q23j_49",Z={noOrders:Dt,slide:Tt,inactiveSlide:Ot,activeOrdersSlider:Bt,activeOrdersSliderContent:Mt,commonSlide:Rt},Pe=48*3,zt=s=>xs(s,{width:Pe,height:Pe}),Lt=({activeOrders:s,name:t,phone:a,className:r,...m})=>{const[h,o]=x.useState(!1),d=x.useCallback(()=>o(!1),[]);return e.jsxs("section",{...m,className:k("-mx-4 overflow-hidden bg-[radial-gradient(150%_130%_at_-10%_80%,var(--graphic-regular-brand)_-80%,transparent_100%)] px-4 pt-safe-offset-4 pb-8",r),children:[n.images.profileBackground&&e.jsx("div",{style:{backgroundImage:`url(${n.images.profileBackground})`},className:"absolute -top-2 -right-[31px] h-[124px] w-[173px] bg-center bg-contain mix-blend-luminosity"}),e.jsxs("div",{className:"relative flex items-center justify-between pb-4",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(T.Header200Medium,{className:"py-1 text-text-primary",children:t}),e.jsx(T.Text200Regular,{className:"text-text-secondary",children:a})]}),e.jsx(Ve,{size:"L",variant:"shadowXS",onClick:()=>o(!0),children:e.jsx(ms,{className:"text-icon-brand"})}),e.jsx(hs,{isOpen:h,onClose:d,isFullHeight:!0})]}),s.length>0&&e.jsx(ue,{opts:{align:"start",slidesToScroll:1,containScroll:"trimSnaps"},className:"py-6",children:e.jsx(je,{className:"overscreen-4! overflow-visible!",children:s.map(i=>e.jsx(ve,{className:"mr-2 rounded-5 pl-0! shadow-md",children:e.jsx(Vt,{order:i})},i.id))})})]})},Vt=({order:s,className:t})=>{var p;const{t:a}=P(),{locale:r,dateFormat:m}=ne(),h=ie(s.order_id),o=a("orderDeliveryDate",{date:q(new Date(s.sla.deliver_by_max),m,{timeZone:n.config.timeZone,locale:r})}),d=te(ps(s.paid_total||0)),i=c=>{c.preventDefault(),c.stopPropagation(),navigator.clipboard.writeText(h)};return e.jsxs(R,{to:`/order/${s.id}`,className:k("flex gap-3 overflow-hidden rounded-[inherit] bg-bg-content",t),children:[e.jsx("div",{className:"grid shrink-0 grid-cols-[repeat(2,48px)] grid-rows-[repeat(2,48px)] gap-[2px] overflow-hidden rounded-r-4",children:s.items.filter(c=>c.image).slice(0,4).map(c=>e.jsx("img",{src:zt(c.image),alt:c.name,className:"h-full w-full bg-surface-transparent-2 object-contain"},c.id))}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1 self-stretch pt-2 pr-2",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(T.Text200Medium,{className:"truncate text-text-primary",children:o}),e.jsx(Fe,{className:"shrink-0 text-icon-primary"})]}),e.jsx("div",{className:"inline-flex",children:e.jsx(T.Text50Medium,{className:"rounded-full bg-system-success-subtle px-1.5 py-0.5 text-system-success",children:a(`orderStatus:${s.public_status}.value`,{context:n.orderStatusContext})})})]}),e.jsx(T.Text100Medium,{className:"truncate py-0.5 text-text-secondary",children:(p=s.address)==null?void 0:p.address_1}),e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsx(T.Text100Semibold,{className:"truncate text-text-primary",children:d}),e.jsxs("button",{type:"button",onClick:i,className:"flex shrink-0 cursor-pointer items-center gap-1 border-none bg-transparent pr-0.5 outline-none active:opacity-60","aria-label":a("phrases:orderNumber",{number:h}),children:[e.jsxs(T.Text100Medium,{className:"truncate text-text-tertiary",children:["#",h]}),e.jsx(Ue,{className:"text-icon-tertiary"})]})]})]})]})},Ft="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMkAAADICAMAAAB1RDWSAAAAQlBMVEUAAAAbGRkbGhobGRkaGRkQEBAYGBgaGhocGBgbGhoYGBgbGRkbGhoYGBgaGRkbGhocGRkbGBgaGRkgICAgGBgbGhp0ont6AAAAFXRSTlMAn2C/3xAggEDvQJCvMFDPb19wECBfSj2SAAAFCElEQVR42u2d7XajIBBAh28QFU3j+7/qxmST
1SdYkGy0Q8Mz90/b0VM4VhwEqEyAIgiAIgiAIgiAIgiAIgtgDqoN90DvJNOwALTWYyUD9eDbrhPpV5i45cfBQO8ZffOqPlE7OzxWrv0sANJNNU2WXdEMr3TRJ4RsFZ7iUFqqDC+f58aRwtEZMYmigThopLCDK+uDasb4U34ibB6J7JiUb9aLzRrhHFRRIWsjx1a9464LvFdzxKK3CCIWgmDMK3mAHMQlzC5sfB/e0pYzSykj0eM0cNmI4hw1v4Q7fQhEo47yCz1B/w4aNgJigoAS4FHpdRPFWuhbDxpSRN5sg7JbhehBO+HPYjEWI4MC7Dj9H+CV39iWI4MC7lmCvubOdXDt8MXfiwLsJ7XD5cjjnznZc2TNpB96Pb63116tIcxsEJOsz2qCHY+omoK/5bXXMBPMwiXZhnkBnAT00/ni4xqw3sA7GXswEMsGvM15U6WCmF7AKE54/epmWAzhzR3rZ42TqY35a9XIm8GI5kD6BdPIAJ2KlBlwO9ICk9ED0ZePhANvQ3AtYwh2DFDSYCF+o6A19opqhdZIN9tl98ylMtHCHt0+98LCeQbjg+fHVfeMsvscHCb3b0s9WvWwPYGGSeCUVf96kzN/7xlkGD8TiIBOzPTTJuSLsBmHiTiDQJOp1M4Er0PgmnQwWMoETiBQm3OWa0GHiTWTC8uyIYuJNZ7LYEU2EZph405gsdkSToDwm3nQmSJdiHYQJJI/Jckc09ko6nwmiooYNd5hA8prgjmhgvYqXQPKbIB3uiP4qgXzfBLcPuo0e8/K/FJNL2ATcQ1y5civKZEbz88xerUwgBZrc7SGuSCClmszgP+H/v+Ip2+Sy6+bcu7AZzgmkApMTYuTs1dZ7f04g1ZjYOWz4det9kUAqM1lsvavGuPk3NZk0+vHdlSkIIeQUzMmjLpMFnbX2CCeqNymgfTIpr30yKa/9bVcyei8mwpIJmZAJmdRn0uxmFN5PZiQTMiGTN+zOhObCZEImZEImNBemzHiGTMiETP7P7kxoLkwm6a7EdmOyj4hXzflYczvquk2UcWz+0vFW+opNHt+XvXynVY0mP61e5pZJmCZS+2oYv3RPsOhKF6X9ljHZfbd3FX75RfuNBOhFWpOm1Z88fP
1jS56b2/QGAbzeJ9L4svvQpNrdv5aik3WwS631ZtLn81Zb2bZhMwogX6LGCfq4eUe4ojHxYQmbcg8mMVmWYNB3EoQ2+Ud8zaYSIYYJvfmt4gjGpTRoRu3Td88uJPrGJdwdIws8/xz+cTmyiFcQHj38YrP9X4JptBd3tkZJjApP8hfW4YBJSmQzOQz741Efs6LA4sZcNLQ8xxxKnblJCZD4qbyAmgt9uUVYP5V3shCUgM3iSKzKZy9DiSa7oWGkCZKVPNLDoSapnpfoS3DU8yZUGxdhCxbBj9AKhODNNh1+U5WL81CZERws3QlK4ZI8uJvDWQESwKmNitJGPB+E5i9koHgWOwvqD8KUnkBUH4aMxRC1+tPEgfKyqjPnBg/DlJ5A1B+FLTyAfgOUn9e/K+pZSE/1v2OjNVQDLKMB9Bg/CF5tA3vPbGrTKFNYfWz/EwbjCPwTpWrKs2ASyAixZVmwCWUWHYbP0CPV4vClZ1pSTQFawKFmmB1HugPXhhzgIxphwjtX2XC1QlnNuj0AQBEEQBEEQBEEQBEEQBEEQBEHk4Q9WLiiS4yROpQAAAABJRU5ErkJggg==",Wt="_container_zkpb5_13",Ht="_img_zkpb5_17",Gt="_text_zkpb5_21",pe={container:Wt,img:Ht,text:Gt},Ut=({className:s,...t})=>{const{t:a}=P();return e.jsxs("div",{...t,className:k(pe.container,s),children:[e.jsx("img",{className:pe.img,src:Ft,alt:"",width:"201",height:"200px"}),e.jsx("p",{className:pe.text,children:e.jsx(Ke,{i18nKey:"phrases:ordersWillBeHereSoon",t:a})}),e.jsx(R,{to:"/shop",className:"button _primary",children:a("goShopping")})]})},Ie='relative z-1 before:absolute before:-top-8 before:-left-4 before:-z-1 before:block before:h-8 before:w-screen before:rounded-t-6.5 before:bg-bg-content max-md:before:content-[""]',X=()=>e.jsx(g,{type:"chevron",size:16,className:"icon__rotate-270"}),H=({to:s,icon:t,label:a,state:r})=>e.jsxs(R,{to:s,state:r,className:"sidebar-section-item",children:[typeof t=="string"?e.jsx(g,{type:t,size:24}):t,e.jsx("p",{className:"sidebar-section-item__text",children:a}),!n.is("mcosmetic")&&e.jsx(X,{})]}),Qt=M(()=>{var V;const{t:s}=P(),[t,a]=x.useState(void 0),{onPrevButtonClick:r,onNextButtonClick:m,prevBtnDisabled:h,nextBtnDisabled:o}=us(t),[d,i]=x.useState(!1),{openModal:p}=re(),{isMobile:c}=js(),j=de();vs({initialColor:"dark-content",disableScrollDetection:!0,enabled:n.is("mcosmetic")});const f=()=>p(F.Logout),{orderList:v}=D,u=(v==null?void 0:v.filter(({public_status:A})=>A==="delivered").slice(0,Ns))??[],N=n.is("mcosmetic")?[...Ce,"ready_for_pickup"]:Ce,_=(v==null?void 0:v.filter(A=>N.includes(A.public_status)))??[];x.useEffect(()=>{D.setOrdersPollingEnabled(!0)},[]),he();const C=e.jsx(ue,{opts:{align:"start",slidesToScroll:1,containScroll:"trimSnaps"},className:Z.activeOrdersSlider,children:e.jsx(je,{className:Z.activeOrdersSliderContent,children:_.map(A=>e.jsx(ve,{className:Z.slide,children:e.jsx(ke,{order:A})},A.id))})});return x.useEffect(()=>{n.is("mcosmetic")&&!c&&j("/cabinet/personal-data")},[c]),e.jsxs("div",{className:Z.contentWr,"data-company":n.name,children:[e.jsx(Y,{content:e.jsx(Fs,{}),showPersonalData:n.showPersonalDataButtonMobileCabinetPage}),e.jsxs("div",{className:"content cabinet content-layout",children:[e.jsx("aside",{className:"sidebar",children:e.jsx(U,{})}),e.jsxs("main",{className:"container",children:[e.jsx("section",{className:"header",children:e.jsx("div",{className:"title",children:s("cabinet")})}),D.isLoading?e.jsxs("div",{className:"skeleton-container",children:[e.jsx(W,{className:"title"}),e.jsx(_e,{rows:10,children:e.jsx(W,{className:"skeleton-container__item"})})]}):n.match({mcosmetic:e.jsx(Lt,{activeOrders:_,name:l.fullName,phone:`+${l.phone}`}),default:_.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"active-orders list",children:[e.jsx("div",{className:"title",children:s("activeOrders")}),_.map(A=>e.jsx(ke,{order:A},A.id))]}),e.jsxs("section",{className:"active-orders slider",children:[e.jsx("div",{className:"title",children:s("activeOrders")}),C]})]}):e.jsx(Ut,{className:Z.noOrders})}),u.length>0&&e.jsxs("section",{className:k("last-orders",n.match({mcosmetic:Ie})),children:[e.jsx("div",{className:"title",children:s("lastOrders")}),e.jsxs("div",{className:"slider2",children:[e.jsx(we,{onClick:r,position:"left",variant:"white",disabled:h}),e.jsx("div",{className:"slider2-items",children:e.jsx(ue,{setApi:a,opts:{align:"start",slidesToScroll:1,containScroll:"trimSnaps"},dir:l.dir,children:e.jsx(je,{children:u.map(A=>e.jsx(ve,{className:Z.inactiveSlide,children:e.jsx(R,{to:`/order/${A.id}`,children:e.jsx(Jt,{order:A})})},A.id))})},l.dir)}),e.jsx(we,{onClick:m,position:"right",variant:"white",disabled:o})]})]}),e.jsxs("div",{className:k("sidebar-section-container mobile",!u.length&&n.match({mcosmetic:Ie})),children:[e.jsxs("section",{className:k("sidebar-section",n.match({mcosmetic:"-mt-4"})),children:[e.jsx(H,{to:"/cabinet/personal-data",icon:"filter",label:n.match({citydrinks:s("cabinet"),default:s("personalData")})}),n.match({citydrinks:e.jsx(H,{to:bs.favs,icon:"fav",label:s("savedAndPurchased")}),default:null}),e.jsx(H,{to:"/cabinet/orders",icon:"orders",label:s("orders")}),e.jsx(H,{to:"/cabinet/address",icon:n.match({circlek:"location-fill-pin",default:"location"}),label:s("deliveryAddress")}),n.showSavedPaymentCards&&e.jsx(H,{to:"/cabinet/payment-method",icon:"cards",label:s("paymentMethod")}),(((V=n.config.langs)==null?void 0:V.length)??0)>=2&&e.jsxs("button",{type:"button",className:"sidebar-section-item cursor-pointer border-none bg-transparent text-text-primary",onClick:()=>i(!0),children:[e.jsx($s,{width:24,height:24}),e.jsx("p",{className:"sidebar-section-item__text",children:s("language")}),!n.is("mcosmetic")&&e.jsx(X,{})]})]}),e.jsxs("section",{className:"sidebar-section",children:[n.match({citydrinks:e.jsx(Rs,{className:"sidebar-section-item",labelClassName:"sidebar-section-item__text",children:e.jsx(X,{})}),default:n.showReferralProgram&&e.jsx(zs,{className:"sidebar-section-item",labelClassName:"sidebar-section-item__text",children:e.jsx(X,{})})}),e.jsx(Ls,{className:"sidebar-section-item",labelClassName:"sidebar-section-item__text",children:e.jsx(X,{})}),!n.hideAboutUs&&e.jsx(H,{to:n.match({localee:"/about",default:"/our-story"}),icon:"link",label:s("aboutUs")}),n.match({electronium:e.jsxs(e.Fragment,{children:[e.jsx(H,{to:"/about",icon:"info",label:s("about")}),e.jsx(H,{to:"/faq",icon:"message",label:s("faq")}),e.jsx(H,{to:"/customer-care",icon:"phone",label:s("customerCare")}),e.jsx(H,{to:"/payment",icon:"cash",label:s("payment")})]})}),n.match({circlek:e.jsx(H,{to:`tel:${n.config.phoneNumber}`,icon:"message",label:s("contactUs")}),citydrinks:e.jsx(Vs,{analyticsSource:"cabinet",icon:"edit",label:s("contactUs"),children:e.jsx(X,{})}),default:!n.hideContactUs&&e.jsx(H,{to:n.match({dubaiexpress:"/contacts",dubaiexpresscom:"/contacts",mcosmetic:"/contacts",default:"/contact-us"}),icon:"edit",label:s("contactUs")})}),e.jsx(H,{to:"/legals",icon:"document",label:s(n.isDefaultCompany||n.is("mcosmetic")?"legals":"termsAndConditions"),state:{source:"cabinet"}})]}),e.jsx("section",{className:"sidebar-section",children:e.jsxs("button",{className:"button no-padding item sidebar-section__logout",onClick:f,children:[e.jsx(g,{type:"logout",size:24}),s("logOut")]})})]})]})]}),e.jsx(It,{isOpen:d,onClose:()=>i(!1)})]})}),Yt=3,Jt=M(({order:s})=>{const{locale:t}=ne(),a=s.items.filter(i=>!i.bundle_id),m=[...s.bundles??[],...a],h=m.slice(0,Yt),o=m.length-h.length,d=Et(new Date(s.sla.deliver_by_max),t);return e.jsxs("div",{className:"item",children:[e.jsxs("div",{className:"number-wrapper",children:[e.jsxs("div",{className:"number",children:["#",ie(s.order_id)]}),e.jsx("div",{className:"ago",children:d})]}),e.jsxs("div",{className:"buttle-wrapper",children:[h.map(i=>e.jsx("div",{className:"buttle",children:e.jsx(le,{src:i.image??"",srcParams:{width:48,height:48},srcSetParams:oe,alt:i.name,loading:"lazy"})},i.id)),o>0&&e.jsx("div",{className:"buttle",children:e.jsxs("div",{className:"count",children:["+",o]})})]})]})}),Lr=Qt;const $t="_titleWrapper_1hszh_3",Zt="_content_1hszh_9",Ee={titleWrapper:$t,content:Zt},Xt=()=>
1{const[s,t]=x.useState(0);return e.jsxs(e.Fragment,{children:[e.jsx(Y,{content:e.jsx(J,{text:"My Events"})}),e.jsx("div",{className:"content-layout",children:e.jsxs("div",{className:b(["content events",Ee.content]),children:[e.jsx("aside",{className:"sidebar",children:e.jsx(U,{})}),e.jsxs("main",{className:"container",children:[e.jsxs("div",{className:b(["title-wrapper",Ee.titleWrapper]),children:[e.jsx("button",{className:"button _no-color",children:e.jsx(g,{type:"arrow",size:24,className:"icon__rotate-180"})}),e.jsx("div",{className:"title",children:"My Events"}),e.jsx("div",{className:"badge",children:"1"})]}),e.jsx("section",{className:"tools-btn",children:e.jsxs("div",{className:"text-wrapper",children:[e.jsx("button",{className:b(["left-btn",s===1&&"active"]),onClick:()=>t(1),children:"Upcoming Events"}),e.jsx("button",{className:b(["right-btn",s===2&&"active"]),onClick:()=>t(2),children:"Visited Events"})]})}),s!==2&&e.jsx("section",{className:"events-upcoming",children:e.jsxs("div",{className:"content-wrapper",children:[e.jsx("div",{className:"title",children:"Upcoming"}),e.jsx("div",{className:"items",children:e.jsxs("div",{className:"item",children:[e.jsx("div",{className:"item-bg"}),e.jsx("div",{className:"top-block",children:e.jsxs("div",{className:"text-wrapper",children:[e.jsx(g,{type:"friends",size:24}),e.jsx("div",{className:"text",children:"108"})]})}),e.jsx("div",{className:"middle-block",children:e.jsx("div",{className:"text-wrapper",children:e.jsx("div",{className:"text",children:"MAR 8 | 8:30 PM"})})}),e.jsx("div",{className:"bottom-block",children:e.jsx("div",{className:"text-wrapper",children:e.jsx("div",{className:"text",children:"Some event title degustation and some other text"})})})]})})]})}),s!==1&&e.jsx("section",{className:"events-visited",children:e.jsxs("div",{className:"content-wrapper",children:[e.jsx("div",{className:"title",children:"Visited"}),e.jsxs("div",{className:"items",children:[e.jsxs("div",{className:"item item1",children:[e.jsx("div",{className:"item-bg"}),e.jsx("div",{className:"top-block",children:e.jsxs("div",{className:"text-wrapper",children:[e.jsx(g,{type:"friends",size:24}),e.jsx("div",{className:"text",children:"72"})]})}),e.jsx("div",{className:"middle-block",children:e.jsx("div",{className:"text-wrapper",children:e.jsx("div",{className:"text",children:"MAR 8 | 8:30 PM"})})}),e.jsx("div",{className:"bottom-block",children:e.jsx("div",{className:"text-wrapper",children:e.jsx("div",{className:"text",children:"Some event title degustation"})})})]}),e.jsxs("div",{className:"item item2",children:[e.jsx("div",{className:"item-bg"}),e.jsx("div",{className:"top-block",children:e.jsxs("div",{className:"text-wrapper",children:[e.jsx(g,{type:"friends",size:24}),e.jsx("div",{className:"text",children:"56"})]})}),e.jsx("div",{className:"middle-block",children:e.jsx("div",{className:"text-wrapper",children:e.jsx("div",{className:"text",children:"MAR 8 | 8:30 PM"})})}),e.jsx("div",{className:"bottom-block",children:e.jsx("div",{className:"text-wrapper",children:e.jsx("div",{className:"text",children:"Some event title degustation"})})})]}),e.jsxs("div",{className:"item item3",children:[e.jsx("div",{className:"item-bg"}),e.jsx("div",{className:"top-block",children:e.jsxs("div",{className:"text-wrapper",children:[e.jsx(g,{type:"friends",size:24}),e.jsx("div",{className:"text",children:"223"})]})}),e.jsx("div",{className:"middle-block",children:e.jsx("div",{className:"text-wrapper",children:e.jsx("div",{className:"text",children:"MAR 8 | 8:30 PM"})})}),e.jsx("div",{className:"bottom-block",children:e.jsx("div",{className:"text-wrapper",children:e.jsx("div",{className:"text",children:"Some event title degustation"})})})]})]})]})})]})]})})]})},Vr=Xt;const qt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMkAAADICAMAAAB1RDWSAAAA/FBMVEUAAAAAAAAAAAAAAAAAAAALCwsYGBgaGRkAAAAbGhoAAAAAAAAAAAAAAAAbGBgbGhobGRkAAAD///8AAAAbGRn///8bGhobGhoZGBgaGhoREREAAAAAAAAbGhobGhoAAAD///////////8bGxv///8bGRkbGRkAAAD///8AAAD////////a2tr///+goKD19fUaGRnz8/P///+AgICampoiIiI3Nzc7Ozu/v7+AgIAAAAAbGRnf399AQEChoaH///+AgID///+fn58AAADf398fHx9gYGDv7+9AQECAgIC/v78QEBAwMDDPz8+vr69wcHBQUFCQkJCPj49fX18BMYD5AAAAQXRSTlMAn98fQBAg32CAgHC/72BQrzDvz3AQn49Az++QjzDvr4BA3++/v5BQIKBfcGowv7ewp5Ag7+/fz7+/sKCAgH9QQPSzF6IAAAXtSURBVHja7dxpc5pAGMDxR3BBLo9qvWKStmmO3vd9PgisgFfS7/9dSlOSokLtRASX7u9N05mMw382u+ICAsdxHMdxHMdxHMdxHMdlQxWaFSiCwQ9rYqvAPnWMiFYBUjTbwoA1egxsezK1MPQQWHZ2DxGLkHI7GoK3ngCzniEWI+UOLqJvRGDSY1xmCkymlMcUl10IBJgjChNcNdeANaJwgTFc9t7rmy7GsOwyMGYwx1XU9VVYIA6evjiDXfbVprhqXhIh6u4L26X4dpcXgW8Y49ad2xBVfoqXRju8CJzdwiXUW+64+8E38ZKnw646u7cyP/rK0njoHqUY8nd1Fbi9FEJnfZVA1HfdvqB4zd2D3fRyeX58Wey4e5+aS79xG3aRMkma52EHrnoEO0izLbxiOa+X16tnGOc+/AWBXDT86xBvZKhkaZ6PLIx1FxJJMiyoQSaIMMXQNKbDwwQvIVH1OUQpPchEzcHQrc9L8/x9bMf6OV+vLoTIBDJxF3+ZrMzzh/fx7+5AkiMJ/mjJEmQjeC+h3kh4DIsd93AN+g4SdHvR/wQhWTm77+sVWFARJrjWqAzxOifRyb8P+SkLIw/XO9chXq8bCanCzbXC4SR1uJFXYw//BfXJujVYkhXYQDX8yyQHcCOP8B85FYhTbUOI9IKQNFJkabsl89M1a3D9BDak/G6o1+Ambt+aUlyPnifshHXI1Q91gHRSOq0bThTdGA5d/MUdBmJ+doZDQxfXHESPQEoprRPISXgIqb3OfhXyU0slJDxty1V185Bu+BL7wLqWfFyFHUK6rfpR9YYDWz9qS/BHo6KWtk/VyrBMqnZ6B8cnVQI3JVVrEBJVw3Zcc/vc2cgoNSBiXz6ot7oEUkEGvmthVizTXth8lSA1DWFGMVOuUYEtOO1PMVPburWi0Z9g9ixbg5SJgod5sFLfNC65mI9pytdYyzbmZaSmOyQm5sUzIEWij/kZlSE9lTnm53wP0rN3jvmZNCE9uof5oQakR5hgjoZplliYI1vkJbwkxEt4CS9Zj5fwEl6yHi/5hVoxWCuhpjP2DSEOUyXU9XWtQSAWQ2f11O2rsRWslVjjQxFiMVYy8TVIwFbJpN+AJEyVWP51SEMblBKIDJRc78ZXdHt2Ycazy7tf4pbgkqiPPEw02v0SSxD/PHjDdImjhSEmsl1yNSSCiyHLoimVSJ2OlF3JeQl+qTjX5yyGMBybaZRIsvJJrmVWMi5HX9/sqyIAlJu2tXlJWwHYl7sZlVAjelFjKjTgN9WmG5aEtzsqSkYl4eNAhyYGop9D9mYblxxJAESuZlQSXuQxLAyYpchxGHTDEqjJCmm3IaMSV4UA8SNzJvTgfPO1q24fk4xKwltrG+PVyySaw9b7SXJJhbUSDQKivbqForpslYTPMw8jWaGmx1aJWYocticQuFKxGTvvsoTon9KPQeR+H8ZK0CcQaPgUA/RqY6IsuMydC4dzQw+P3B0eapWBbnvsndWHpyti37q6+XHmuB6Ln08w/ICujSnjn7TQ1OGSOrYYL8HxaZhim4yXeIZ49WiabU5YLsGLJoHfTh8IQzuez0IJ/ijBH2ICwkIJ/miKkICpfeGAKySlsFaC4cMAq5grQcsZlsqwir2SoMUcG/pA1SoxCFMlAepduDNnlc/Utd/C3VnwX5VI7U6tGCWy0urVi1DSPQaAI1KAkmobgBwUYUyI3K512kUoAal1rJBClBRnFeYlvCRNPoHUNAvzTNChifmZCJAebYb5mX6E9JTHmB+nAikyPMwL9UVIkepgXswSpInkNiiWLUKqTm2KuXBUSNneHPPgNiF1DxyK/26n91n3bAuzRedb2vvWBCfLFur6e7Al4oPh3JxgFqzpzNcbsD1i5bA5zIJwqO3yV6ZzHMcVXrdWkGVYOajLEhRALchoHdSAedLleOzLCjBOkmvhv6yPSu05/NZqA9u6PSm87LNT33W6yRdNMz9PAFryftBThwII1q2OXIz3RulEKUYIx3Ecx3Ecx3Ecx3Ecx3FF8BP+rusaofDouAAAAABJRU5ErkJggg==",Kt={active:"phrases:noActiveOrders",completed:"phrases:noCompletedOrders"},ea=({orderType:s="active"})=>{const{t}=P();return e.jsxs("div",{className:"empty-cart",children:[e.jsxs("div",{className:"empty-cart__content",children:[e.jsx("img",{className:"empty-cart__img",src:n.images.order.empty??qt,alt:""}),e.jsx("p",{className:"empty-cart__title",children:t(Kt[s])})]}),e.jsx("div",{className:"empty-cart__buttons",children:e.jsx(R,{to:"/shop",className:"button _primary btn-wrapper",children:t("goShopping")})})]})},sa=M(ea);var w=(s=>(s.ACTIVE="active",s.HISTORY="history",s))(w||{});const xe={[w.ACTIVE]:["accepted","picking","wh_created","confirmed","delivery_created","ready_to_ship","ready_for_pickup","in_delivery","in_logistic"],[w.HISTORY]:["delivered","delivered_partially","finished","cancelled","not_collected","in_logistic"]},Qe=s=>{const{runObserver:t,stopObserver:a,tab:r}=s||{},[m,h]=x.useState(!1),[o,d]=x.useState(!1),[i,p]=x.useState([]),[c,j]=x.useState();x.useEffect(()=>{const u=D.currentOrdersPage,N=r?{status:xe[r]}:void 0,_=C=>{u>1?h(C):d(C)};_(!0),D.requestPaginatedOrders({page:u,filters:N}).then(C=>{if(_(!1),!C){p([]);return}const{result:V,hasNext:A,totalCount:E}=C;j(E),D.setDownloadIsPossible(A),p(G=>
1{const K=u===1?V:[...G,...V];return K.filter((I,Je)=>K.findIndex($e=>$e.id===I.id)===Je)}),D.downloadIsPossible&&u===1?t==null||t():D.downloadIsPossible||a==null||a()}).catch(()=>{_(!1)})},[D.currentOrdersPage,r]),gs(r,(u,N)=>{u!==N&&(p([]),j(void 0),D.setCurrentOrdersPage(1))}),x.useEffect(()=>()=>{p([]),j(void 0),h(!1),d(!1),D.setCurrentOrdersPage(1)},[]);const f=x.useMemo(()=>i.filter(({public_status:u})=>xe[w.ACTIVE].includes(u)),[i]),v=x.useMemo(()=>i.filter(({public_status:u})=>xe[w.HISTORY].includes(u)),[i]);return{isLoading:o,orderList:i,setOrderList:p,isPageLoading:m,activeOrders:f,finishedOrders:v,totalCount:c}},ta="_container_1bhns_14",aa="_orderItem_1bhns_19",ra="_partiallyPicked_1bhns_23",ia="_loadingSpinner_1bhns_27",ae={container:ta,orderItem:aa,partiallyPicked:ra,loadingSpinner:ia},na=({order:s,isActive:t})=>{var _,C,V,A,E,G,K;const{t:a}=P(),{locale:r,dateFormat:m}=ne(),[h,o]=x.useState("accepted"),d=s.public_status==="in_delivery",{isMobile:i}=me(),{timeFormat:p}=fs(),c=s.delivery_method===_s.CLICK_AND_COLLECT;x.useEffect(()=>{let I;switch(s.public_status){case"in_delivery":I="inDelivery";break;case"ready_to_ship":I="readyToShip";break;case"ready_for_pickup":I="readyForPickup";break;case"not_collected":I="notCollected";break;default:I=s.public_status;break}o(I)},[]);const j=[(_=s.address)==null?void 0:_.zip,(C=s.address)==null?void 0:C.address_1,(V=s.address)==null?void 0:V.address_2,(A=s.address)==null?void 0:A.city,(E=s.address)==null?void 0:E.country_id].filter(I=>I).join(", "),f="order_delivery"in s?(G=s.order_delivery)==null?void 0:G.warehouse_address:"",v=c&&f||j,N=x.useMemo(()=>s.items.some(I=>I.requested_quantity-I.actual_quantity>0),[s])&&n.showPartiallyPickedInfo&&e.jsx(Gs,{classNames:ae.partiallyPicked});return e.jsx(R,{to:`/order/${s.id}`,state:t?void 0:{tab:w.HISTORY},replace:!0,className:ae.orderItem,children:e.jsxs("div",{className:b(["order-wrapper",t&&"_active",s.public_status==="cancelled"&&"_cancelled",d&&"_delivering"]),children:[e.jsxs("div",{className:b(["header",t&&"activeOrder"]),children:[e.jsxs("div",{className:"title-wrapper",children:[e.jsx("div",{className:"title",children:a("dayAtTime",{day:q(new Date(s.created_at),m,{timeZone:n.config.timeZone,locale:r}),time:q(new Date(s.created_at),p,{timeZone:n.config.timeZone,locale:r})})}),e.jsxs("div",{className:"subtitle",children:["#",ie(s.order_id)]})]}),e.jsx("div",{className:"right-block",children:e.jsx("div",{className:b(["badge-closed",s.public_status]),children:a(h)})})]}),e.jsxs("div",{className:"body",children:[s.public_status!=="cancelled"&&e.jsxs("div",{className:"left-block",children:[e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"paid-wrapper",children:[e.jsx("div",{className:"title",children:a("paid")}),e.jsx("div",{className:"value",children:te(B.convertPenceToPounds(s.converted_paid_total??s.paid_total??0))})]}),n.showProductCustomsInfo&&!!s.customs_duties_fee&&e.jsxs("div",{className:"paid-wrapper",children:[e.jsx("div",{className:"title",children:a("customsDutiesFee")}),e.jsx("div",{className:"value",children:te(B.convertPenceToPounds(s.converted_customs_duties_fee??s.customs_duties_fee))})]}),e.jsxs("div",{className:"paid-wrapper",children:[e.jsx("div",{className:"title",children:c?`${a("deliveryMethods:pickup")} ${a("address")}`:a("deliveryAddress")}),e.jsx("div",{className:"address",children:v})]}),!t&&e.jsxs("div",{className:"paid-wrapper",children:[e.jsx("div",{className:"title",children:a("dateOfDelivery")}),e.jsx("div",{className:"address",children:a("dayAtTime",{day:q(new Date(s.sla.ship_by),m,{timeZone:n.config.timeZone,locale:r}),time:q(new Date(s.sla.ship_by),p,{timeZone:n.config.timeZone,locale:r})})})]})]}),!i&&N]}),e.jsx("div",{className:"right-block",children:e.jsxs("div",{className:"buttle-wrapper",children:[s.items.filter(I=>!I.bundle_id).map(I=>e.jsx("div",{className:"buttle-wrapper-image",children:e.jsx(le,{src:I.image??"",srcParams:{width:54,height:62},srcSetParams:oe,alt:"",loading:"lazy"})},I.image)),(K=s.bundles)==null?void 0:K.map(I=>e.jsx("div",{className:"buttle-wrapper-image",children:e.jsx(le,{src:I.image??"",srcParams:{width:54,height:62},srcSetParams:oe,alt:"",loading:"lazy"})},I.image))]})}),i&&N]})]})})},ca=M(na),la=({isActive:s})=>e.jsx("div",{className:b([ae.orderItem,"order-item_skeleton"]),children:e.jsxs("div",{className:b(["order-wrapper",s&&"_active"]),children:[e.jsxs("div",{className:"header",children:[e.jsxs("div",{className:"title-wrapper",children:[e.jsx(W,{className:"title"}),e.jsx(W,{className:"subtitle"})]}),e.jsx(W,{className:"badge-skeleton"})]}),e.jsxs("div",{className:"body",children:[e.jsx("div",{className:"left-block",children:e.jsxs("div",{className:"paid-wrapper",children:[e.jsx(W,{className:"title"}),e.jsx(W,{className:"value"})]})}),e.jsx("div",{className:"right-block",children:e.jsx("div",{className:"buttle-wrapper",children:[1,2,3].map(t=>e.jsx(W,{className:"buttle-wrapper-image"},t))})})]})]})}),De=(s,t)=>typeof t=="number"?`${s} ⢠${t}`:s,oa=()=>{const{t:s}=P(),t=de(),a=x.useRef(null),{isObservableElementVisible:r,stopObserver:m,runObserver:h}=Ge(),o=!1,{tab:d=w.ACTIVE}=fe(),{isLoading:i,orderList:p,isPageLoading:c,activeOrders:j,finishedOrders:f,totalCount:v}=Qe({stopObserver:m,runObserver:()=>{m(),h(a)},tab:d});x.useEffect(()=>{i||!r||!D.downloadIsPossible||(d===w.ACTIVE?j:f).length===0||D.setCurrentOrdersPage(D.currentOrdersPage+1)},[r,d,o]);const u=()=>i?e.jsx("section",{className:"order-history-items",children:e.jsx("div",{className:"order-items",children:e.jsx(_e,{rows:8,children:e.jsx(la,{})})})}):p.length?e.jsx("section",{className:"order-history-items",children:e.jsx("div",{className:"order-items",children:p.map(_=>e.jsx(ca,{order:_,isActive:d===w.ACTIVE},_.id))})}):e.jsx(sa,{orderType:d===w.ACTIVE?"active":"completed"}),N=()=>{t(n.match({default:"/cabinet"}))};return e.jsxs(e.Fragment,{children:[e.jsx(Y,{content:e.jsx(J,{text:s("orders"),onBackClick:N})}),e.jsxs("div",{className:"content orders","data-company":n.name,children:[e.jsx("aside",{className:"sidebar",children:e.jsx(U,{})}),e.jsxs("main",{className:b(["container",ae.container]),"data-company":n.name,children:[e.jsx("h1",{className:"page-title",children:s("orders")}),e.jsx("section",{className:"filters",children:e.jsx("div",{className:"right-block",children:e.jsxs("div",{className:"years-wrapper",children:[e.jsx(R,{to:"/cabinet/orders",replace:!0,className:b(["year",d===w.ACTIVE&&"current"]),children:De(s("activeOrders"),d===w.ACTIVE?v:void 0)}),e.jsx(R,{to:"/cabinet/orders/history",replace:!0,className:b(["year",d===w.HISTORY&&"current"]),children:De(s("orderHistory"),d===w.HISTORY?v:void 0)})]})})}
1),u(),e.jsx("div",{style:{height:10},ref:a}),c&&e.jsx("div",{className:ae.loadingSpinner,children:e.jsx("span",{className:"spinner"})})]})]})]})},Fr=M(oa),da={active:"phrases:noActiveOrders",completed:"phrases:noCompletedOrders"},ma=({orderType:s,className:t,...a})=>{const{t:r}=P(),m=de();return e.jsxs("div",{...a,className:k("flex w-full flex-col items-center gap-6 py-8 text-center",t),children:[n.images.order.empty&&e.jsx("img",{src:n.images.order.empty,alt:"",className:"size-40 object-contain"}),e.jsx(T.Header150Medium,{as:"h2",className:"text-text-primary",children:r(da[s])}),e.jsx(ys,{variant:"brand",size:"lg",onClick:()=>m("/shop"),children:r("goShopping")})]})},ha=({className:s,...t})=>e.jsxs("div",{...t,className:k("flex items-stretch gap-3 overflow-hidden rounded-5 border border-stroke-tertiary bg-surface-transparent-2",s),children:[e.jsx("div",{className:"size-[98px] shrink-0 bg-surface-transparent-3"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5 pt-2 pr-2",children:[e.jsx("div",{className:"h-4 w-20 rounded-full bg-surface-transparent-3"}),e.jsx("div",{className:"h-4 w-16 rounded-full bg-surface-transparent-3"}),e.jsx("div",{className:"h-3.5 w-3/4 rounded-full bg-surface-transparent-3"}),e.jsxs("div",{className:"mt-auto flex items-end justify-between gap-2 pb-2",children:[e.jsx("div",{className:"h-3.5 w-16 rounded-full bg-surface-transparent-3"}),e.jsx("div",{className:"h-3.5 w-12 rounded-full bg-surface-transparent-3"})]})]})]}),pa={1:{grid:"grid-cols-1 grid-rows-1",slots:[{key:"single",cellClass:"rounded-4"}]},2:{grid:"grid-cols-2 grid-rows-1",slots:[{key:"left",cellClass:"rounded-l-4"},{key:"right",cellClass:"rounded-r-4"}]},3:{grid:"grid-cols-2 grid-rows-2",slots:[{key:"tl",cellClass:"rounded-tl-4"},{key:"tr",cellClass:"rounded-tr-4"},{key:"bottom",cellClass:"col-span-2 rounded-b-4"}]},4:{grid:"grid-cols-2 grid-rows-2",slots:[{key:"tl",cellClass:"rounded-tl-4"},{key:"tr",cellClass:"rounded-tr-4"}
1,{key:"bl",cellClass:"rounded-bl-4"},{key:"br",cellClass:"rounded-br-4"}]}},xa=({images:s,className:t,...a})=>{const r=s.length>4,m=r?s.slice(0,3):s.slice(0,4),h=r?s.length-3:0,o=r?4:Math.max(1,m.length),{grid:d,slots:i}=pa[o];return e.jsx("div",{...a,className:k("grid size-[98px] shrink-0 gap-[2px] overflow-hidden",d,t),children:i.map((p,c)=>{const j=m[c],f=r&&c===i.length-1;return e.jsxs("div",{className:k("relative overflow-hidden bg-surface-transparent-2",p.cellClass),children:[!f&&j&&e.jsxs(e.Fragment,{children:[e.jsx(le,{src:j,srcParams:{width:96,height:96},srcSetParams:oe,alt:"",loading:"lazy",className:"size-full object-contain"}),e.jsx("div",{className:"pointer-events-none absolute inset-0 bg-surface-transparent-2"})]}),f&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-graphic-transparent-black-25",children:e.jsxs(T.Text100Semibold,{as:"span",className:"text-graphic-regular-white",children:["+",h]})})]},p.key)})})},ua=({order:s,isActive:t,className:a,...r})=>{const{t:m}=P(),{locale:h,dateFormat:o}=ne(),d=Ws(s),i=Hs(s),p=s.address?[s.address.address_1,s.address.city].filter(Boolean).join(", "):null,c=i?d??p:p,j=x.useMemo(()=>{var A;const C=s.items.filter(E=>!E.bundle_id).map(E=>E.image).filter(E=>!!E),V=((A=s.bundles)==null?void 0:A.map(E=>E.image).filter(E=>!!E))??[];return[...C,...V]},[s.items,s.bundles]),f=q(new Date(s.sla.deliver_by_max),o,{timeZone:n.config.timeZone,locale:h}),v=t?m("orderDeliveryDate",{date:f}):f,u=te(B.convertPenceToPounds(s.paid_total||0)),N=`#${ie(s.order_id)}`,_=async C=>{C.preventDefault(),C.stopPropagation(),await We({text:s.order_id,successMessage:m("codeCopied")})};return e.jsxs(R,{...r,to:`/order/${s.id}`,state:t?void 0:{tab:w.HISTORY},className:k("flex items-stretch gap-3 overflow-hidden rounded-5 border border-stroke-tertiary bg-surface-transparent-2","transition-colors hover:bg-surface-transparent-3",a),children:[e.jsx(xa,{images:j}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1 pt-2 pr-2",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx(T.Text200Medium,{as:"span",className:"truncate text-text-primary",children:v}),e.jsx(Fe,{className:"size-4 shrink-0 text-icon-primary"})]}),e.jsx(As,{status:s.public_status,size:"sm",className:"self-start"})]}),c&&e.jsx("div",{className:"flex items-center py-0.5",children:e.jsx(T.Text100Medium,{as:"p",className:"min-w-0 flex-1 truncate text-text-secondary",children:c})}),e.jsxs("div",{className:"flex items-end justify-between gap-2",children:[e.jsx(T.Text100Semibold,{as:"span",className:"truncate text-text-primary",children:u}),e.jsxs("button",{type:"button",onClick:_,className:"flex shrink-0 cursor-pointer items-center gap-1 border-none bg-transparent pr-0.5 pl-4","aria-label":m("copy"),children:[e.jsx(T.Text100Medium,{as:"span",className:"truncate text-text-tertiary",children:N}),e.jsx(Ue,{className:"size-3 text-icon-tertiary"})]})]})]})]})},ja=M(ua),Te=({to:s,label:t,isActive:a,count:r})=>e.jsx(R,{to:s,replace:!0,className:k("-mb-px flex h-7 shrink-0 flex-col items-start border-transparent border-b-2",a&&"border-graphic-regular-brand"),children:e.jsxs(T.Text300Semibold,{as:"span",className:k("whitespace-nowrap -tracking-[0.16px]",a?"text-text-primary":"text-text-tertiary"),children:[t,typeof r=="number"&&` (${r})`]})}),va=({activeTab:s,activeCount:t,historyCount:a,className:r,...m})=>{const{t:h}=P();return e.jsxs("div",{...m,className:k("scrollbar-hide flex w-full items-start gap-6 overflow-x-auto border-stroke-secondary border-b",r),children:[e.jsx(Te,{to:"/cabinet/orders",label:h("activeOrders"),isActive:s===w.ACTIVE,count:t}),e.jsx(Te,{to:"/cabinet/orders/history",label:h("orderHistory"),isActive:s===w.HISTORY,count:a})]})},Na=6,ba=M(()=>{const{t:s}=P(),{isMobile:t}=me(),a=x.useRef(null),{isObservableElementVisible:r,stopObserver:m,runObserver:h}=Ge(),{tab:o=w.ACTIVE}=fe(),{isLoading:d,orderList:i,isPageLoading:p,activeOrders:c,finishedOrders:j,totalCount:f}=Qe({stopObserver:m,runObserver:()=>{m(),h(a)},tab:o});x.useEffect(()=>{d||!r||!D.downloadIsPossible||(o===w.ACTIVE?c:j).length===0||D.setCurrentOrdersPage(D.currentOrdersPage+1)},[r,o]);const v=()=>d?e.jsx("div",{className:"flex w-full flex-col gap-2",children:Array.from({length:Na}).map((N,_)=>e.jsx(ha,{},_))}):i.length?e.jsx("div",{className:"flex w-full flex-col gap-2",children:i.map(N=>e.jsx(ja,{order:N,isActive:o===w.ACTIVE},`${o}-${N.id}`))}):e.jsx(ma,{orderType:o===w.ACTIVE?"active":"completed"}),u=e.jsxs("div",{className:"mx-auto flex w-full desktop:max-w-[480px] flex-col gap-6",children:[!t&&e.jsx(T.Header200Medium,{as:"h1",className:"text-text-primary",children:s("orders")}),e.jsx(va,{activeTab:o,activeCount:o===w.ACTIVE&&f||void 0,historyCount:o===w.HISTORY&&f||void 0}),v(),e.jsx("div",{ref:a,className:"h-2.5 w-full shrink-0"}),p&&e.jsx("div",{className:"flex w-full justify-center py-4",children:e.jsx("span",{className:"spinner"})})]});return t?e.jsx("main",{className:"w-full px-4 py-4",children:u}):e.jsxs("div",{className:"content orders","data-company":n.name,children:[e.jsx("aside",{className:"sidebar",children:e.jsx(U,{})}),e.jsx("main",{className:"container",children:u})]})}),Wr=ba;const ga=()=>{const s=()=>{B.setStartVerificationLocation(Cs.CABINET),l.requestKYCSession(`${window.location.origin}${window.location.pathname}`).then(({data:a})=>{B.isRN&&Number(B.appVersion.replaceAll(".",""))>=1029?B.sendToRN("openInAppBrowser",{url:a.url}):window.location.href=a.url}).catch(()=>{})},t=x.useMemo(()=>{switch(l.personalData.kycStatus){case Q.NotVerified:return e.jsxs(e.Fragment,{children:["Start verification"," ",e.jsx(g,{type:"chevron",size:24,className:"icon__rotate-270"})]});case Q.Declined:return e.jsxs(e.Fragment,{children:["Start verification"," ",e.jsx(g,{type:"chevron",size:24,className:"icon__rotate-270"})]});case Q.Started:return e.jsxs(e.Fragment,{children:["Continue verification"," ",e.jsx(g,{type:"chevron",size:24,className:"icon__rotate-270"})]});case Q.ResubmissionRequested:return e.jsxs(e.Fragment,{children:["Resubmit ",e.jsx(g,{type:"refresh",size:24})]})}},[l.personalData.kycStatus]);return x.useEffect(()=>{if(![Q.Started,Q.ResubmissionRequested].includes(l.personalData.kycStatus))return;const a=setInterval(()=>{l.requestPersonalData().catch(()=>{})},5e3);return()=>clearInterval(a)},[l.personalData.kycStatus]),!l.isAuthorized||l.personalData.kycStatus===Q.Verified?e.jsx(e.Fragment,{}):t?e.jsx("div",{className:b(["button _bordered _block kyc-verify"]),onClick:s,children:t}):null},fa=M(ga);
1const Ye=M(()=>{const s=ws[l.personalData.kycStatus];return s?e.jsxs("div",{className:b(["verification",s.style]),children:[e.jsxs("div",{className:"verification__header",children:[e.jsxs("div",{className:"verification__header-status",children:[s.icon&&e.jsx(g,{type:s.icon,size:24}),s.title]}),e.jsx("div",{className:"verification__header-control",children:e.jsx(fa,{})})]}),s.description&&e.jsx("div",{className:"verification__body",children:e.jsx("p",{className:"verification__body-message",children:s.description})})]}):null}),_a="_personalData_18m03_14",ya="_header_18m03_27",Aa="_field_18m03_34",Ca="_action_18m03_42",wa="_field__label_18m03_45",Sa="_field__value_18m03_49",ka="_field__error_18m03_54",Pa="_modal_18m03_77",Ia="_container_18m03_24",Ea="_close_18m03_93",Da="_error_18m03_96",Ta="_label_18m03_101",Oa="_input_18m03_110",Ba="_button_18m03_127",L={personalData:_a,header:ya,field:Aa,action:Ca,field__label:wa,field__value:Sa,field__error:ka,delete:"_delete_18m03_62",modal:Pa,container:Ia,close:Ea,error:Da,label:Ta,input:Oa,button:Ba},Ma=s=>s?new Date(s).toLocaleDateString(void 0,{day:"2-digit",month:"2-digit",year:"numeric"}):null,Ra=M(()=>{const{t:s}=P(),{isMobile:t}=me(),[a,r]=x.useState(null),[m,h]=x.useState(null),{openModal:o}=re();he();const d=x.useMemo(()=>({name:{type:"name",title:s("yourName"),defaultValue:l.fullName,error:s("pleaseEnterName"),placeholder:s("messageReceiverNamePlaceholder")},"e-mail":{type:"e-mail",title:s("email"),defaultValue:l.email,error:n.isCustomerEmailOptional?void 0:s("pleaseEnterEmail"),placeholder:s("messageEmailAddressPlaceholder")},"phone-number":{type:"phone-number",title:s("phoneNumber"),defaultValue:B.prettyPhoneNumber(l.phone)},"birth-date":{type:"birth-date",title:s("phrases:yourDateOfBirth"),defaultValue:Ma(l.dateOfBirth)??""}}),[l.fullName,l.email,l.phone,l.dateOfBirth,s]),i=()=>o(F.DeleteAccount),p=v=>["phone-number","birth-date"].includes(v)?d[v]:{...d[v],onClick:()=>{h(null),r(d[v])}},c=async(v,u)=>{h(null);try{switch(u){case"name":{const{firstName:N,middleName:_,lastName:C}=l.splitFullName(v);N&&await l.updatePersonalData({first_name:N,middle_name:_,last_name:C,email:l.personalData.email});break}case"e-mail":{await l.updatePersonalData({email:v.trim()||null});break}}r(null)}catch(N){typeof N=="string"&&h(s(N))}},j=()=>{r(null),h(null)},f=n.match({default:!0,mcosmetic:!1});return e.jsxs(e.Fragment,{children:[e.jsx(Y,{content:e.jsx(J,{text:s("personalData")})}),e.jsxs("div",{className:k("content personal-data",L.personalData),"data-company":n.name,children:[e.jsx("aside",{className:"sidebar",children:e.jsx(U,{})}),e.jsxs("main",{className:"container",children:[!t&&e.jsxs("section",{className:k("header",L.header),children:[e.jsx(g,{type:"arrow",size:24,className:"icon__rotate-180"}),e.jsx("div",{className:"title",children:s("personalData")})]}),n.needVerification&&e.jsx(Ye,{}),e.jsxs("div",{className:"flex w-full flex-col gap-4",children:[e.jsx(ce,{...p("name")}),e.jsx(ce,{...p("e-mail")}),e.jsx(ce,{...p("phone-number")}),n.hasAgeRestriction&&l.personalData.dateOfBirth&&e.jsx(ce,{...p("birth-date")})]}),f&&e.jsx("section",{className:k("delete-accaunt",L.delete),children:e.jsxs("button",{className:"button _bordered",onClick:i,children:[e.jsx(g,{type:"trash",size:24}),e.jsx("div",{className:"btn",children:s("deleteAccount")})]})})]})]}),a&&e.jsx(za,{...a,serverError:m,onSubmit:c,onClose:j})]})}),ce=({title:s,defaultValue:t,error:a,onClick:r})=>n.is("mcosmetic")?e.jsxs("div",{onClick:r,className:k("w-full",r?"cursor-pointer":void 0),children:[e.jsx("div",{className:"px-2 pb-2",children:a&&!t?e.jsx(T.Text100Semibold,{className:"text-system-error",children:a}):e.jsx(T.Text100Semibold,{className:"text-text-primary",children:s})}),e.jsx("div",{className:"flex h-10 items-center rounded-3 bg-surface-transparent-2 px-4",children:e.jsx(T.Text200Regular,{className:"truncate text-text-primary",children:t||e.jsx(e.Fragment,{children:"Â "})})})]}):e.jsxs("div",{onClick:r,className:k(L.field,r&&L.action),children:[e.jsx("div",{children:a&&!t?e.jsx("div",{className:L.field__error,children:a}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:L.field__label,children:s}),e.jsx("div",{className:k(L.field__value,"phoneNumber"),children:t||e.jsx(e.Fragment,{children:"Â "})})]})}),r&&e.jsx(g,{type:"chevron",size:24})]}),za=({type:s,title:t,defaultValue:a,placeholder:r,serverError:m,onSubmit:h,onClose:o})=>{var A;const{t:d}=P(),i=s,[p,c]=x.useState(null);x.useEffect(()=>{c(m??null)},[m]);const j=i==="name"?Ae({name:Ss(d).default(i==="name"?a:"")}):Ae({"e-mail":ks(d,n.isCustomerEmailOptional).default(i==="e-mail"?a:"")}),{register:f,handleSubmit:v,setValue:u,formState:{errors:N}}=es({resolver:ss(j)});x.useEffect(()=>{u(i,a)},[a]);const _=f(i),C={..._,onChange:E=>(c(null),_.onChange(E))},V=((A=N[i])==null?void 0:A.message)||p;return e.jsx(Ps,{isShow:!0,className:L.modal,children:e.jsxs("form",{className:L.container,onSubmit:v(E=>h(E[i],i)),children:[e.jsxs("div",{className:L.header,children:[t,e.jsx("button",{className:k("button",L.close),onClick:o,children:e.jsx(g,{type:"close",size:32})})]}),e.jsxs("label",{className:L.label,children:[e.jsx("input",{...C,className:L.input,placeholder:r}),e.jsx("button",{className:"button _no-padding",onClick:()=>u(i,""),type:"button",children:e.jsx(g,{type:"close",size:24})})]}),e.jsx("div",{className:L.error,children:V}),e.jsx("button",{type:"submit",className:k("button _primary",L.button),children:d("apply")})]})})},La=()=>{const s=x.useRef(null),t=l.personalData.kycStatus!==Q.Verified&&l.isAuthorized;x.useEffect(()=>{t&&l.requestPersonalData(!0)},[t]),x.useEffect(()=>(t&&(s.current=setInterval(()=>{l.requestPersonalData(!0)},15*Is)),()=>{if(s.current)return clearInterval(s.current)}),[l.isAuthorized,l.personalData.kycStatus])},Va="_content_19dzw_3",Fa="_header_19dzw_6",Oe={content:Va,header:Fa},Wa=M(()=>{const{t:s}=P(),{openModal:t}=re(),a=Us(O.nameVal,600),[r,m]=x.useState(!1),[h,o]=x.useState(null);La(),x.useEffect(()=>{r&&d()},[a,r]);const d=async()=>{const{firstName:v,middleName:u,lastName:N}=l.splitFullName(a);v&&await l.updatePersonalData({first_name:v,middle_name:u,last_name:N,email:O.isEmailValid?O.emailVal.trim():l.personalData.email||""}).catch(_=>{typeof _=="string"&&o(s(_))}),O.setIsPersonalDataSync(!0)};x.useEffect(()=>{O.setPhoneVal(l.personalData.phone||""),O.setNameVal(l.fullName),O.setEmailVal(l.personalData.email||""),O.initStateData()},[]);const i=()=>t(F.ChangeEmail),p=()=>t(F.ChangeName),c=()=>t(F.ChangeNotifications),j=()=>t(F.DeleteAccount),f=v=>{o(null),O.setIsPersonalDataChanged(!0),O.setIsPersonalDataSync(!1),O.setNameVal(v.currentTarget.value)};return he(),e.jsxs(e.Fragment,{children:[e.jsx(Y,{content:e.jsx(J,{text:s("personalData")})}),e.jsxs("div",{className:b(["content personal-data",Oe.content]),children:[e.jsx("aside",{className:"sidebar",children:e.jsx(U,{})}),e.jsxs("main",{className:"container",children:[e.jsxs("section",{className:b(["header",Oe.header]),children:[e.jsx(g,{type:"arrow",size:24,className:"icon__rotate-180"}),e.jsx("div",{className:"title",children:s("personalData")})]}),n.needVerification&&e.jsx(Ye,{}),e.jsxs("section",{className:"login-credentials",children:[e.jsx("div",{className:"title",children:s("loginCredentials")}),e.jsx("div",{className:"subtitle",children:s("phrases:editYourDetails")}),e.jsxs("div",{className:"personal-data-wrapper",children:[e.jsxs("div",{className:"block-1",children:[e.jsxs("div",{className:"name",children:[e.jsx("div",{className:"label",children:s("name")}
1),e.jsx("input",{onFocus:()=>m(!0),onBlur:()=>m(!1),className:"input",value:O.nameVal,onChange:f}),h&&e.jsx("p",{className:"name__error",children:h})]}),e.jsxs("div",{className:"name-mobile",onClick:p,children:[e.jsxs("div",{className:"label-wrapper",children:[e.jsx("div",{className:"label",children:s("name")}),e.jsx("div",{className:"text",children:l.fullName})]}),e.jsx("div",{className:"arrow-right",children:e.jsx(g,{type:"chevron",size:24,className:"icon__rotate-270"})})]})]}),e.jsxs("div",{className:"block-2",children:[e.jsxs("div",{className:"phone",children:[e.jsx("div",{className:"label",children:s("phoneNumber")}),e.jsx("div",{className:"value",children:B.prettyPhoneNumber(O.phoneVal||"")})]}),e.jsx("div",{className:"phone-mobile",children:e.jsxs("div",{className:"label-wrapper",children:[e.jsx("div",{className:"label",children:s("phoneNumber")}),e.jsx("div",{className:"value",children:B.prettyPhoneNumber(O.phoneVal)||""})]})}),e.jsxs("div",{className:"email",children:[e.jsx("div",{className:"label",children:s("email")}),e.jsxs("div",{className:"content-container",children:[l.email.length>0&&e.jsx("div",{className:"value",children:l.email}),e.jsx("button",{className:"button _bordered _xs",onClick:i,children:s("change")})]})]}),e.jsxs("div",{className:"email-mobile",onClick:i,children:[e.jsxs("div",{className:"label-wrapper",children:[e.jsx("div",{className:"label",children:s("email")}),e.jsx("div",{className:"value",children:l.email})]}),e.jsx("div",{className:"arrow-right",children:e.jsx(g,{type:"chevron",size:24,className:"icon__rotate-270"})})]})]})]})]}),e.jsxs("section",{className:"notifications-mobile",onClick:c,children:[e.jsxs("div",{className:"label-wrapper",children:[e.jsx("div",{className:"title",children:s("notifications")}),e.jsx("div",{className:"subtitle",children:s("newslettersSettings")})]}),e.jsx("div",{className:"arrow-right",children:e.jsx(g,{type:"chevron",size:24,className:"icon__rotate-270"})})]}),e.jsx("section",{className:"delete-accaunt",children:e.jsxs("button",{className:"button _bordered",onClick:j,children:[e.jsx(g,{type:"trash",size:24}),e.jsx("div",{className:"btn",children:s("deleteAccount")})]})})]})]})]})}),Hr=n.match({citydrinks:Wa,default:Ra}),Ha="/assets/promocodes-banner-desktop-59296a9d.png",Ga="/assets/promocodes-banner-mobile-0cd58155.png",Ua="/assets/promocodes-not-found-eba764ce.png",Qa="/assets/promocode-8b3403e5.png",Ya="_promocodeCard_wozs4_2",Ja="_promocodeCardImage_wozs4_17",$a="_promocodeCardImageInactive_wozs4_22",Za="_promocodeCardContent_wozs4_25",Xa="_promocodeCardContentHeader_wozs4_40",qa="_promocodeCardContentHeaderTitle_wozs4_45",Ka="_promocodeCardTitle_wozs4_51",er="_promocodeCardDate_wozs4_56",sr="_promocodeCardDescription_wozs4_60",tr="_promocodeCardCategories_wozs4_64",ar="_promocodeCardCategory_wozs4_81",rr="_promocodeCardCodeButton_wozs4_89",ir="_promocodeCardNewBadge_wozs4_92",nr="_promocodeBadge_wozs4_109",z={promocodeCard:Ya,promocodeCardImage:Ja,promocodeCardImageInactive:$a,promocodeCardContent:Za,promocodeCardContentHeader:Xa,promocodeCardContentHeaderTitle:qa,promocodeCardTitle:Ka,promocodeCardDate:er,promocodeCardDescription:sr,promocodeCardCategories:tr,promocodeCardCategory:ar,promocodeCardCodeButton:rr,promocodeCardNewBadge:ir,promocodeBadge:nr},cr=({promocode:s,...t})=>{const{locale:a}=ne(),[r,m]=x.useState(!1),h=x.useRef(null),{t:o}=P(),{checkPromocode:d,setPromocodeVal:i}=Ys({checkPercentageType:!0,watchPaidWithDiscount:!0}),{allowedCategories:p,isActive:c,isInactive:j,inactiveReason:f,code:v,description:u,title:N,usageLimitCustomerDescription:_,titleWithOrder:C}=s,V=x.useMemo(()=>s.getDateWithOrder(a),[s,a]),A=x.useMemo(()=>s.getValidUntil(a),[s,a]),E=G=>{G.stopPropagation(),We({text:v,successMessage:o("promocodeApplied")}),m(!0),h.current=setTimeout(()=>m(!1),2e3),i(v),d(v)};return e.jsxs("div",{...t,className:b([z.promocodeCard,t.className]),children:[s.isNew&&e.jsx("span",{className:z.promocodeCardNewBadge,children:o("new")}),e.jsx("img",{src:Qa,alt:"Promocode",className:b([z.promocodeCardImage,!c&&z.promocodeCardImageInactive])}),e.jsxs("div",{className:z.promocodeCardContent,children:[e.jsxs("div",{className:z.promocodeCardContentHeader,children:[e.jsxs("div",{className:z.promocodeCardContentHeaderTitle,children:[e.jsx("h4",{className:z.promocodeCardTitle,children:C??N}),V&&e.jsx("span",{className:z.promocodeCardDate,children:V})]}),C&&e.jsx("p",{className:z.promocodeCardDescription,children:N}),u&&e.jsx("p",{className:z.promocodeCardDescription,children:u}),c&&p.length>0&&e.jsx("div",{className:z.promocodeCardCategories,children:p.map(G=>e.jsx(R,{to:`/c/${G.slug}?showProducts=true`,className:z.promocodeCardCategory,children:G.name},G.id))}),_&&e.jsx("p",{className:z.promocodeCardDescription,children:_})]}),c&&e.jsxs(He,{variant:"secondary",size:"M",className:z.promocodeCardCodeButton,onClick:E,children:[v,e.jsx(g,{type:r?"check":"copy-promocode"})]})]}),(j&&f||c&&A)&&e.jsx("div",{className:z.promocodeBadge,children:j?f
1:A})]})},lr="_promocodesSkeleton_11vl4_2",or="_bannerSkeleton_11vl4_23",dr="_tabs_11vl4_31",mr="_cards_11vl4_49",hr="_card_11vl4_49",pr="_cardContent_11vl4_75",Be={promocodesSkeleton:lr,bannerSkeleton:or,tabs:dr,cards:mr,card:hr,cardContent:pr},Me=()=>e.jsx(e.Fragment,{children:Array.from({length:4}).map((s,t)=>e.jsxs("div",{className:Be.card,children:[e.jsx(W,{height:64,width:64}),e.jsxs("div",{className:Be.cardContent,children:[e.jsx(W,{height:12,width:123,inline:!1}),e.jsx(W,{height:7,width:"100%",inline:!1}),e.jsx(W,{height:40,width:"100%",inline:!1})]})]},t))}),xr=()=>{const{t:s}=P(),t=de(),{isMobile:a}=me(),{promocodes:r,isPromocodesLoading:m,promocodesTab:h,setPromocodesTab:o,canLoadMorePromocodes:d,fetchNextPage:i}=ye.promotionStore,{promocodesTab:p=se.AVAILABLE}=fe(),c=[{alias:se.AVAILABLE,title:s("availablePromocodes")},{alias:se.REFERRAL,title:s("referralPromocodes")},{alias:se.HISTORY,title:s("historyPromocodes")}];return x.useEffect(()=>{if(!c.some(({alias:j})=>j===p)){t(`/cabinet/promocodes/${se.AVAILABLE}`,{replace:!0});return}p!==h&&o(p)},[p,h,o,t]),e.jsxs(e.Fragment,{children:[e.jsx(Y,{content:e.jsx(J,{text:s("promocodes")})}),e.jsxs("div",{className:"content promocodes",children:[e.jsx("aside",{className:"sidebar",children:e.jsx(U,{})}),e.jsxs("main",{className:"container",children:[e.jsx("h1",{className:"page-title",children:s("promocodes")}),n.hasPromocodeCDBanner&&e.jsxs("section",{className:"banner",children:[e.jsx("img",{src:a?Ga:Ha,alt:"Promocode Banner"}),e.jsx("div",{className:"banner-overlay",children:e.jsxs("div",{className:"banner-content",children:[e.jsx("h2",{className:"banner-title",children:s("promocodesBannerTitle")}),e.jsx("p",{className:"banner-description",children:s("promocodesBannerDescription")}),e.jsx(R,{to:"/cabinet/referral",children:e.jsx(He,{variant:"shadowS",size:a?"XS":"XL",className:"banner-button",children:s("promocodesBannerButton")})})]})})]}),e.jsx("section",{className:"navigation",children:e.jsx("div",{className:"tabs",children:c.map(({alias:j,title:f})=>e.jsx(R,{to:`/cabinet/promocodes/${j}`,replace:!0,className:b(["tab",h===j&&"current"]),onClick:()=>o(j),children:f},j))})}),e.jsx("section",{className:"tab-content",children:m?e.jsx(Me,{}):r.length>0?e.jsxs(e.Fragment,{children:[r.map(j=>e.jsx(cr,{promocode:j},j.id)),d&&e.jsx(Qs,{embedded:!0,onLoadMore:()=>i(),skeletons:e.jsx(Me,{})})]}):e.jsxs("div",{className:"promocodes-not-found",children:[e.jsx("img",{src:Ua,alt:"Promocodes Not Found"}),e.jsx("h3",{children:s(`promocodesNotFoundTitle.${h}`)})]})})]})]})]})},Gr=M(xr),Re=({isLoading:s})=>{var d;const{t}=P(),a=i=>{if(!i)return"";const{type:p,value:c}=i;return p==="PERCENTAGE"?`${c}%`:B.addCurrencySymbol(B.convertPenceToPounds(c))},r=()=>{var c;if(!l.refereeInfo||!((c=l.personalData)!=null&&c.id))return"";const i=Es(l.refereeInfo.code,l.personalData.id),p=l.referralInfo&&l.referralInfo.minimumPurchase>0?t("referralProgram:shareAmount",{amount:l.referralInfo.minimumPurchase}):"";return t("referralProgram:shareText",{discount:a(l.referralInfo),code:l.refereeInfo.code,amount:p,link:i})},m=async i=>{try{await navigator.clipboard.writeText(i),B.pushAlert("success",t("codeCopied"))}catch{B.pushAlert("error",t("codeCopyError"))}Ne.track(be.REFERRAL_PROGRAM_COPY_CODE,{})},h=async()=>{l.refereeInfo&&await m(l.refereeInfo.code)},o=async()=>{if(!l.refereeInfo)return;Ne.track(be.REFERRAL_PROGRAM_SHARE);const i=r();if(typeof navigator>"u"||!navigator.share){await m(i);return}try{await navigator.share({title:t("referralProgram:shareTitle"),text:i})}catch(p){p.name!=="AbortError"&&await m(i)}};return e.jsxs("div",{className:y.code__wrapper,children:[e.jsxs("div",{className:y.code,role:"button",onClick:h,children:[e.jsx("span",{className:y.code__value,children:s?e.jsx("span",{className:"spinner _primary"}):(d=l.refereeInfo)==null?void 0:d.code}),e.jsx("span",{className:y.code__copy,children:e.jsx(g,{type:"copy"})})]}),e.jsxs("button",{type:"button",className:b(["button _primary _big",y.code__share]),onClick:o,children:[e.jsx(g,{type:"share"})," ",t("share")]})]})},ur=s=>s?s.split(` 2`):[],jr=[{text:"home",link:"/"},{text:"cabinet",link:"/cabinet"},{text:"referralProgram",link:"/cabinet/referral"}],vr=[{text:"home",link:"/"},{text:"referralProgram",link:"/cabinet/referral"}],Nr=[{step:1,title:"referralProgram:steps.one.title",caption:"referralProgram:steps.one.caption"},{step:2,title:"referralProgram:steps.two.title",caption:"referralProgram:steps.two.caption"},{step:3,title:"referralProgram:steps.three.title",caption:"referralProgram:steps.three.caption"}],br=()=>{var i,p;const{t:s}=P(),t=Ds(`(max-width: ${Ts.phone}
2px)`),[a,r]=x.useState(!1),m=ye.promotionStore;x.useEffect(()=>{Ne.track(be.REFERRAL_PROGRAM_OPEN)},[]),x.useEffect(()=>(r(!0),l.fetchReferralProgramInfo().finally(()=>{r(!1)}),()=>{l.clearReferralProgramInfo()}),[]),he();const h=c=>{if(!c)return"";const{type:j,value:f}=c;return j==="PERCENTAGE"?`${f}%`:B.addCurrencySymbol(B.convertPenceToPounds(f))},o={discount:h(l.refereeInfo),referralDiscount:h(l.referralInfo),amount:te((((p=(i=l)==null?void 0:i.refereeInfo)==null?void 0:p.minimumPurchase)||0)/100)},d=e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:y.title,children:ur(s("phrases:referralProgram")).map(c=>e.jsx("span",{children:c},c))}),o.referralDiscount&&e.jsx("p",{className:y.description,children:s("phrases:referralProgramDescription",o)})]});return e.jsxs("div",{className:y.root,children:[t&&!n.newDesignSystemEnabled&&e.jsx(R,{to:"/cabinet",className:y.goBack,children:e.jsx(g,{type:"arrow"})}),e.jsx("div",{className:b([y.hero__wrapper,n.newDesignSystemEnabled&&y.newLayout]),children:e.jsx("div",{className:y.container,children:e.jsxs("div",{className:y.hero,children:[!t&&e.jsxs("div",{className:y.title__wrapper,children:[e.jsx(Js,{items:n.variant({1:jr,2:vr}).map(c=>({...c,text:s(c.text)}))}),d,e.jsx(Re,{isLoading:a})]}),e.jsx("img",{src:n.images.referral.hero,alt:"",className:y.hero__image})]})})}),m.promocodeRewardStatus.total>0&&e.jsx("div",{className:y.awardStatusWr,children:e.jsx("div",{className:y.container,children:e.jsxs("div",{className:y.awards,"data-company":n.name,children:[e.jsxs("div",{className:y.awards__counters,children:[e.jsxs("div",{className:y.awards__counters__item,children:[e.jsx("h3",{children:m.promocodeRewardStatus.new}),e.jsx("p",{children:s("new")})]}),e.jsxs("div",{className:y.awards__counters__item,children:[e.jsx("h3",{children:m.promocodeRewardStatus.total}),e.jsx("p",{children:s("available")})]})]}),e.jsx(R,{to:"/cabinet/promocodes/referral",className:b(["button","_primary","_big",y.viewAwardsLink]),children:s("referralProgram:viewRewards")})]})})}),e.jsx("div",{className:y.info,children:e.jsxs("div",{className:y.container,children:[t&&d,e.jsx("h2",{className:y.info__title,children:s("phrases:referralProgramSteps")}),e.jsx("div",{className:y.steps,children:Nr.filter(c=>o.referralDiscount?!0:c.step!==3).map(c=>e.jsxs("div",{className:y.step,children:[e.jsx("div",{className:y.step__numberWr,children:e.jsx("span",{className:y.step__number,children:c.step})}),e.jsxs("div",{className:y.step__description,children:[e.jsx("p",{children:s(c.title,o)}),e.jsx("span",{children:s(c.caption,o)})]})]},c.step))}),t&&e.jsx(Re,{isLoading:a})]})})]})},Ur=M(br);const gr="_container_n84kr_3",fr="_titleWrapper_n84kr_9",ze={container:gr,titleWrapper:fr},_r=()=>{const[s,t]=x.useState(1);return e.jsxs(e.Fragment,{children:[e.jsx(Y,{content:e.jsx(J,{text:"Subscriptions"})}),e.jsx("div",{className:"content-layout",children:e.jsxs("div",{className:b(["content subscription",ze.container]),children:[e.jsx("aside",{className:"sidebar",children:e.jsx(U,{})}),e.jsxs("main",{className:"container",children:[e.jsxs("div",{className:b(["title-wrapper",ze.titleWrapper]),children:[e.jsx("button",{className:"button _no-padding _no-color",children:e.jsx(g,{type:"arrow",size:24,className:"icon__rotate-180"})}),e.jsx("div",{className:"title",children:"Subscriptions"}),e.jsx("div",{className:"badge",children:"3"})]}),e.jsx("section",{className:"tools-btn",children:e.jsxs("div",{className:"text-wrapper",children:[e.jsx("div",{className:b(["left-btn",s===1&&"active"]),onClick:()=>t(1),children:"Current"}),e.jsx("div",{className:b(["right-btn",s===2&&"active"]),onClick:()=>t(2),children:"Expired"})]})}),e.jsx("section",{className:"subscriptions",children:e.jsx("div",{className:"content-wrapper",children:e.jsxs("div",{className:"items",children:[e.jsxs("div",{className:"item item1",children:[e.jsx("div",{className:"item-bg"}),e.jsx("div",{className:"top-block",children:e.jsxs("div",{className:"text-wrapper",children:[e.jsx("div",{className:"text",children:"Next delivery (2/3)"}),e.jsx("div",{className:"date",children:"APR 19"})]})}),e.jsx("div",{className:"bottom-block",children:e.jsx("div",{className:"text-wrapper",children:e.jsx("div",{className:"text",children:"Three Month Gin Subscription"})})})]}),e.jsxs("div",{className:"item item2",children:[e.jsx("div",{className:"item-bg"}),e.jsx("div",{className:"top-block",children:e.jsxs("div",{className:"text-wrapper",children:[e.jsx("div",{className:"text",children:"Next delivery (2/3)"}),e.jsx("div",{className:"date",children:"APR 19"})]})}),e.jsx("div",{className:"bottom-block",children:e.jsx("div",{className:"text-wrapper",children:e.jsx("div",{className:"text",children:"Three Month Gin Subscription"})})})]}),e.jsxs("div",{className:"item item3",children:[e.jsx("div",{className:"item-bg"}),e.jsx("div",{className:"top-block",children:e.jsxs("div",{className:"text-wrapper",children:[e.jsx("div",{className:"text",children:"Next delivery (2/3)"}),e.jsx("div",{className:"date",children:"APR 19"})]})}),e.jsx("div",{className:"bottom-block",children:e.jsx("div",{className:"text-wrapper",children:e.jsx("div",{className:"text",children:"Three Month Gin Subscription"})})})]})]})})})]})]})})]})},Qr=_r;export{zr as Address,Lr as Cabinet,Vr as Events,Fr as Orders,Wr as OrdersV3,$r as PaymentPage,Hr as PersonalData,Gr as Promocodes,Ur as ReferralProgram,Qr as Subscription}; 3//# sourceMappingURL=cabinetRoutes-2b528115.js.map
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.