1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="369afda9-434e-4dfb-997b-6d829bda9a9d",e._sentryDebugIdIdentifier="sentry-dbid-369afda9-434e-4dfb-997b-6d829bda9a9d")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2334,2526,7778,8116],{653:(e,t,r)=>{"use strict";r.d(t,{F:()=>l});var s=r(37876),a=r(14232),i=r(11079),n=r(87240),d=r(2361),o=r.n(d);let l=e=>{let{children:t,onPageChange:r,onScroll:d,additionalClasses:l}=e,c=(0,a.useRef)(null),[m,u]=(0,a.useState)(0);(0,a.useEffect)(()=>{var e;let t=e=>{if(!(e.target instanceof HTMLDivElement))return;let t=e.target,s=t.children.length,a=Math.round(t.scrollLeft/(t.scrollWidth/s));null==r||r(a),u(a)};return null==(e=c.current)||e.addEventListener("scroll",t),()=>{var e;return null==(e=c.current)?void 0:e.removeEventListener("scroll",t)}},[]);let p=a.Children.toArray(t);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:c,className:(0,i.lM)(o().carousel,null==l?void 0:l.carousel),onScroll:d,children:a.Children.map(p,(e,t)=>(0,s.jsx)("div",{className:o().carouselItem,children:e},t))}),(0,s.jsx)(n.d,{className:(0,i.lM)(o().pageIndicator,null==l?void 0:l.pageIndicator),currentPage:m,numberOfPages:a.Children.count(p),additionalClasses:{activePageIndication:null==l?void 0:l.activePageIndication},"data-sentry-element":"PageIndicator","data-sentry-source-file":"carousel.tsx"})]})}},2361:e=>{e.exports={carousel:"carousel_carousel__YxcZe",carouselItem:"carousel_carouselItem__DrUpo",pageIndicator:"carousel_pageIndicator__8bxys"}},3502:(e,t,r)=>{"use strict";r.d(t,{L2:()=>n,PS:()=>d,am:()=>o});var s=r(14232),a=r(84408);let i={ROYAL_MAIL_1ST_CLASS:"Royal Mail, 1st Class",USPS_1ST_CLASS:"USPS, 1st Class",DEUTSCHE_POST_1ST_CLASS:"Deutsche Post, 1st Class",AUSTRALIA_POST_1ST_CLASS:"Australia Post, 1st Class","1ST_CLASS_POSTAL_SERVICES":"1st Class Postal Services"},n=i["1ST_CLASS_POSTAL_SERVICES"],d=e=>{var t;if(null==e||null==e.deliveryDate)return null;let{deliveryDate:r,inProductText:s,postalService:d}=e;return{postalServiceName:null!=(t=i[d])?t:n,deliveryEstimateText:(0,a.i)(s,r)}},o=e=>(0,s.useMemo)(()=>d(e),[e])},3830:e=>{e.exports={container:"my-membership_container__0_PLj",loaderContainer:"my-membership_loaderContainer__J7Z4X",titleBar:"my-membership_titleBar__OJIMs",backButton:"my-membership_backButton__zVmRh",
1innerContainer:"my-membership_innerContainer__Cv1BX",panel:"my-membership_panel__e8iMM",panelTitle:"my-membership_panelTitle__T5iif",error:"my-membership_error__hUMDC",perkContainer:"my-membership_perkContainer__KQJ_s",perk:"my-membership_perk__BXBar",icon:"my-membership_icon__pPhLI",perkFooter:"my-membership_perkFooter__HJjJL",perkTitle:"my-membership_perkTitle__OHX1b",detailsContainer:"my-membership_detailsContainer__BjyuI",detailRow:"my-membership_detailRow__T7YE_",chevron:"my-membership_chevron__YOXGF",leadingText:"my-membership_leadingText__A_rON",trailingText:"my-membership_trailingText__nMlo6",clickable:"my-membership_clickable__xAX94",cancellationLoaderContainer:"my-membership_cancellationLoaderContainer__BrxIo",churnkeyModal:"my-membership_churnkeyModal__c8xl1",content:"my-membership_content__NVWOP"}},4860:e=>{e.exports={orderHistoryContainer:"order-history_orderHistoryContainer__o1m2X",ordersContainer:"order-history_ordersContainer__PZHoD",orderTitle:"order-history_orderTitle__u_aMM",paragraphBold:"order-history_paragraphBold__K_c4d",status:"order-history_status__WnF_7",orderBody:"order-history_orderBody___uzjj",orderBodyDesktop:"order-history_orderBodyDesktop__PDu0T",leftContainer:"order-history_leftContainer__jFesn",thumbnail:"order-history_thumbnail__evXUg",thumbnailPortrait:"order-history_thumbnailPortrait__KZpnd",thumbnailBig:"order-history_thumbnailBig__tn1AP",clickable:"order-history_clickable__dwgtv",info:"order-history_info__Jp7NV",infoPortrait:"order-history_infoPortrait__0GN4M",rightContainer:"order-history_rightContainer____J_v",rotateImg:"order-history_rotateImg__VgTPs",rightContainerMore:"order-history_rightContainerMore__RXh5U",reachOutMessage:"order-history_reachOutMessage__hsxO2",orderBodyMore:"order-history_orderBodyMore__7nqTT",more:"order-history_more__5A16k",orderItemSummary:"order-history_orderItemSummary__6BSzo",orderItemMeta:"order-history_orderItemMeta__zwASJ",orderItemField:"order-history_orderItemField__Lx1hW",orderItemLabel:"order-history_orderItemLabel__3pNat",orderItemValue:"order-history_orderItemValue__n58PL",orderItemRecipientName:"order-history_orderItemRecipientName__Z0Hnd",orderItemStatusCancelled:"order-history_orderItemStatusCancelled__KSH_S",orderItemDivider:"order-history_orderItemDivider__MRSIi",orderItemBody:"order-history_orderItemBody__dXQk8",orderItemThumbnail:"order-history_orderItemThumbnail__TDkfB",isLandscape:"order-history_isLandscape__V41Xv",isPortrait:"order-history_isPortrait__ioEyg",deliveryAddressSection:"order-history_deliveryAddressSection__zFRDq",orderItemExpandBtn:"order-history_orderItemExpandBtn__kNz_4",ordersContainerMobile:"order-history_ordersContainerMobile__FVlHZ",orderItemMetaMobile:"order-history_orderItemMetaMobile__ueqEQ",orderItemBodyMobile:"order-history_orderItemBodyMobile__v5sC_",orderItemNavBtn:"order-history_orderItemNavBtn__koVDQ",orderItemMobileDetails:"order-history_orderItemMobileDetails___YQ5Z",orderItemMobileCreated:"order-history_orderItemMobileCreated__QEaHg",orderExpandedDesktop:"order-history_orderExpandedDesktop__WObjf",orderExpandedContent:"order-history_orderExpandedContent__0ESFL",orderExpandedPreviewMain:"order-history_orderExpandedPreviewMain__CwxeJ",thumbnailBigPortrait:"order-history_thumbnailBigPortrait__MdtlN",thumbnailBigLandscape:"order-history_thumbnailBigLandscape__xysvZ",orderExpandedPreviewSelectors:"order-history_orderExpandedPreviewSelectors__ms9Rf",orderExpandedTimelineSection:"order-history_orderExpandedTimelineSection__6aSdX",orderExpandedTimelineSectionCompact:"order-history_orderExpandedTimelineSectionCompact__ces8t",orderExpandedAddressSection:"order-history_orderExpandedAddressSection__AMgkv",orderExpandedDeliveryAddress:"order-history_orderExpandedDeliveryAddress__tYadI",orderExpandedTimeline:"order-history_orderExpandedTimeline__KspS_",orderExpandedTimelineStretched:"order-history_orderExpandedTimelineStretched__JX4YO",orderExpandedTimelineConnector:"order-history_orderExpandedTimelineConnector__4xoRf",orderExpandedTimelineLine:"order-history_orderExpandedTimelineLine__DnZEC",orderExpandedTimelineCompact:"order-history_orderExpandedTimelineCompact__jz9x3",orderExpandedTimelineItem:"order-history_orderExpandedTimelineItem__XwgFf",orderExpandedTimelineTrack:"order-history_orderExpandedTimelineTrack__GcYnw",orderExpandedTimelineContent:"order-history_orderExpandedTimelineContent__OOJyz",orderExpandedTimelineLineComplete:"order-history_orderExpandedTimelineLineComplete__5ZTVA",orderExpandedTimelineLineCancelled:"order-history_orderExpandedTimelineLineCancelled__aTKWc",orderExpandedTimelineLineDashed:"order-history_orderExpandedTimelineLineDashed__2kePY",orderExpandedTimelineLineDashedComplete:"order-history_orderExpandedTimelineLineDashedComplete__0Yfui",orderExpandedTimelineIconComplete:"order-history_orderExpandedTimelineIconComplete__9iHlf",orderExpandedTimelineIconCancelled:"order-history_orderExpandedTimelineIconCancelled__xwHYx",orderExpandedTimelineIconEstimatedDelivery:"order-history_orderExpandedTimelineIconEstimatedDelivery__e8p_s",orderExpandedTimelineCircle:"order-history_orderExpandedTimelineCircle__7OUGd",orderExpandedTimelineLabel:"order-history_orderExpandedTimelineLabel__uX4BN",orderExpandedTimelineLabelComplete:"order-history_orderExpandedTimelineLabelComplete__z6m0R",orderExpandedTimelineLabelCancelled:"order-history_orderExpandedTimelineLabelCancelled__FaLjB",orderExpandedTimelineSubtext:"order-history_orderExpandedTimelineSubtext__LEUHC",orderExpandedFooter:"order-history_orderExpandedFooter__3GHV_",orderExpandedHelp:"order-history_orderExpandedHelp__AIkk5",orderExpandedLink:"order-history_orderExpandedLink__9wztZ",orderExpandedActions:"order-history_orderExpandedActions__72fsA",noOrdersContainer:"order-history_n
1oOrdersContainer__p3_ig",orderTimeline:"order-history_orderTimeline__qwYiP",timeLineItem:"order-history_timeLineItem__mvv_7",circle:"order-history_circle__biFl6",circleRed:"order-history_circleRed__97RBx",circleTeal:"order-history_circleTeal__YMwF6",line:"order-history_line__JJ9d_",lineHighlighted:"order-history_lineHighlighted__eiJNP",currentStatus:"order-history_currentStatus__Crq6C",loadingContainer:"order-history_loadingContainer__iazln",lottie:"order-history_lottie__7uVA4",smallLoading:"order-history_smallLoading__lEtmn",ordered:"order-history_ordered__z_7Wj",printing:"order-history_printing__aKS_K",shipped:"order-history_shipped__QMoYW","on-hold":"order-history_on-hold__n7wU1",cancelled:"order-history_cancelled__mJGfn",scheduled:"order-history_scheduled__1kjTj",mobileStatus:"order-history_mobileStatus__wJZJZ",loadMore:"order-history_loadMore__xfZS1",infiniteScrollSentinel:"order-history_infiniteScrollSentinel__4NJQ_",multipleOrder:"order-history_multipleOrder__PGoeE",viewOrdersButton:"order-history_viewOrdersButton__ODFF3",orderAgainCta:"order-history_orderAgainCta__AAsTn",mobileDetailsContainer:"order-history_mobileDetailsContainer__9ZVKJ",mobileDetailsCard:"order-history_mobileDetailsCard__bD66Y",mobileDetailsMeta:"order-history_mobileDetailsMeta__NdB0J",mobileDetailsOrderMeta:"order-history_mobileDetailsOrderMeta__WelTw",mobileDetailsCreated:"order-history_mobileDetailsCreated__BPtiM",mobileDetailsPreview:"order-history_mobileDetailsPreview__poHog",mobileDetailsPreviewSingle:"order-history_mobileDetailsPreviewSingle__VRS_0",mobileDetailsPreviewFrame:"order-history_mobileDetailsPreviewFrame__jwBsq",mobileDetailsPreviewPortrait:"order-history_mobileDetailsPreviewPortrait__7XbhH",mobileDetailsPreviewSlide:"order-history_mobileDetailsPreviewSlide__Qr5VI",mobileDetailsPreviewLandscape:"order-history_mobileDetailsPreviewLandscape__rLjDJ",mobileDetailsCarousel:"order-history_mobileDetailsCarousel__NZBni",mobileDetailsPageIndicator:"order-history_mobileDetailsPageIndicator__FQk41",mobileDetailsPageIndicatorActive:"order-history_mobileDetailsPageIndicatorActive__fC3M9",mobileDetailsTimeline:"order-history_mobileDetailsTimeline__IBidO",mobileDetailsStatusTitle:"order-history_mobileDetailsStatusTitle__guMHu",mobileDetailsActions:"order-history_mobileDetailsActions__BjS9n",mobileDetailsAddressCard:"order-history_mobileDetailsAddressCard__o6KUm",mobileDetailsFooter:"order-history_mobileDetailsFooter__P4M5w",mobileDetailsFooterText:"order-history_mobileDetailsFooterText__UyeAL",mobileDetailsLink:"order-history_mobileDetailsLink__aCnQa"}},6170:(e,t,r)=>{"use strict";r.d(t,{U:()=>j});var s=r(37876);r(14232);var a=r(26404),i=r(91576),n=r(41591),d=r(43715),o=r(11079),l=r(43188),c=r.n(l);let m=e=>{let{openLogoutModal:t,activeItem:r}=e,{supportedFeatures:i}=(0,d.Y)(),{isMobileOrTablet:o}=(0,n.Ln)(),{data:l}=(0,a.Q2)(),m=!!l&&(0,a.tJ)(l);return(0,s.jsxs)("div",{className:c().accountLinks,"data-sentry-component":"AccountLinks","data-sentry-source-file":"account-links.tsx",children:[(0,s.jsx)(u,{label:"Account details",iconUrl:"/assets/icons/details.svg",href:"/account/details",isActive:"details"===r,"data-sentry-element":"AccountLink","data-sentry-source-file":"account-links.tsx"}),(0,s.jsx)(u,{label:"Order history",iconUrl:"/assets/icons/orders.svg",href:"/account/orders",isActive:"orders"===r,"data-sentry-element":"AccountLink","data-sentry-source-file":"account-links.tsx"}),!1===o&&(0,s.jsx)(u,{label:"Drafts",iconUrl:"/assets/icons/drafts.svg",href:"/account/drafts",isActive:"drafts"===r}),(0,s.jsx)(u,{label:"Address book",iconUrl:"/assets/icons/address-book.svg",href:"/account/address-book",isActive:"address-book"===r,"data-sentry-element":"AccountLink","data-sentry-source-file":"account-links.tsx"}),(0,s.jsx)(u,{label:"Reminders",iconUrl:"/assets/icons/reminders.svg",href:"/account/reminders",isActive:"reminders"===r}),!(null==l?void 0:l.isUnlimited)&&(0,s.jsx)(u,{label:"Buy ".concat(m?"cards":"credits"),iconUrl:"/assets/icons/buy-credits.svg",href:"/account/buy-credits",paramsAndValues:[],isActive:"buy-credits"===r}),(null==l?void 0:l.isMember)&&(0,s.jsx)(u,{label:"Membership",iconUrl:"/assets/icons/membership.svg",href:"/account/membership",isActive:"membership"===r}),i.referAFriend&&(0,s.jsx)(u,{label:"Refer a friend",iconUrl:"/assets/icons/raf.svg",href:"/refer-a-friend",isActive:"refer-a-friend"===r,isDirect:!0}),(0,s.jsx)(p,{label:"Logout",iconUrl:"/assets/icons/logout.svg",onClick:t,isActive:!1,"data-sentry-element":"AccountButton","data-sentry-source-file":"account-links.tsx"})]})},u=e=>{let{iconUrl:t,label:r,href:a,isActive:n,isDirect:l,paramsAndValues:m}=e,{locale:u}=(0,d.Y)(),p=l?"a":i.N_;return a=l?(0,i.O2)(a,u):a,(null==m?void 0:m.length)&&(a=((e,t)=>t.length?"".concat(e,"?").concat(t.map(e=>Object.values(e).join("=")).join("&")):e)(a,m)),(0,s.jsxs)(p,{href:a,className:c().linkContent,rel:"nofollow","data-sentry-element":"LinkElement","data-sentry-component":"AccountLink","data-sentry-source-file":"account-links.tsx",children:[(0,s.jsxs)("span",{className:(0,o.lM)(n&&c().activeLinkTitle),children:[(0,s.jsx)("img",{src:t,alt:r,width:16,height:16}),r]}),(0,s.jsx)("img",{src:"/assets/icons/chevron-small-right.svg",alt:"arrow right",width:24,height:24})]})},p=e=>{let{iconUrl:t,label:r,onClick:a,isActive:i}=e;return(0,s.jsxs)("button",{type:"button",onClick:a,className:c().linkContent,"data-sentry-component":"AccountButton","data-sentry-source-file":"account-links.tsx",children:[(0,s.jsxs)("span",{className:(0,o.lM)(i&&c().activeLinkTitle),children:[(0,s.jsx)("img",{src:t,alt:r,width:16,height:16}),r]}),(0,s.jsx)("img",{src:"/assets/icons/chevron-small-right.svg",alt:"arrow right",width:24,height:24})]})};var h=r(95726),_=r(14308),x=r(91785),y=r(52549),v=r.n(y);let g=()=>{var e;let{data:t}=(0,_.Jd)(),{data:r}=(0,h.IM)(),{data:i}=(0,a.Q2)(),n=!!i&&(0,a.tJ)(i),d=(0,x.IM)(null==t?void 0:t.firstName,null==t?void 0:t.lastName),o=null!=(e=null==r?void 0:r.creditBalance)?e:0;return(0,s.jsxs)("div",{className:v().container,"data-sentry-component":"UserDetails","data-sentry-source-file":"user-details.tsx",children:[(0,s.jsx)("div",{className:v().nameTag,children:d}),(0,s.jsxs)("h2",{children:["Hey, ",null==t?void 0:t.firstName," ",(null==i?void 0:i.isMember)&&(0,s.jsx)("img",{src:"/assets/icons/crown.png",alt:"membership crown",width:24,height:15})]}),!(null==i?void 0:i.isUnlimited)&&(0,s.jsxs)("p",{children:["You have"," ",(0,s.jsxs)("strong",{children:[o," ",n?"card":"credit",1===o?"":"s"]})," ",(0,s.jsx)("img",{src:"/assets/icons/coin.png",alt:"coin",width:21,height:21})]})]})};var f=r(51149),b=r.n(f);let j=e=>{let{activeItem:t=null,openLogoutModal:r=()=>{}}=e;return(0,s.jsxs)("aside",{className:b().container,"data-sentry-component":"AccountSidebar","data-sentry-source-file":"account-sidebar.tsx",children:[(0,s.jsx)(g,{"data-sentry-element":"UserDetails","data-sentry-source-file":"account-sidebar.tsx"}),(0,s.jsx)(m,{openLogoutModal:r,activeItem:t,"data-sentry-element":"AccountLinks","data-sentry-source-file":"account-sidebar.tsx"})]})}},15568:e=>
1{e.exports={container:"account-form-container_container__2psm4",innerContainer:"account-form-container_innerContainer__py2gq"}},18855:e=>{e.exports={pageIndicator:"page-indicator_pageIndicator__ZmbMQ",circle:"page-indicator_circle__6DQXE",active:"page-indicator_active__glVVM"}},19844:e=>{e.exports={remindersContainer:"reminders_remindersContainer__Hwg5Y",noReminder:"reminders_noReminder__P79EB",icon:"reminders_icon__KOZ9Y",heading2:"reminders_heading2__1BnQD",subHeading:"reminders_subHeading__4MeXn"}},20386:(e,t,r)=>{"use strict";r.d(t,{g:()=>l});var s=r(37876),a=r(14232),i=r(6926),n=r(96227),d=r(70093),o=r.n(d);let l=e=>{let{draft:t}=e,[r,d]=(0,a.useState)("");return(0,a.useEffect)(()=>{if(t.renderedImageURL){if("landscape"===t.orientation){var e;d(null!=(e=t.renderedImageURL)?e:"");return}(0,n.tF)(t.renderedImageURL,90).then(e=>d(e))}},[t]),(0,s.jsx)("div",{className:o().container,style:{aspectRatio:(0,i.iI)(t,"front").aspectRatio},"data-sentry-component":"CardFrontPreview","data-sentry-source-file":"card-front.tsx",children:r?(0,s.jsx)("img",{src:r,alt:"Card front preview",width:(0,i.iI)(t,"front").width,height:(0,i.iI)(t,"front").height}):null})}},37556:e=>{e.exports={logoutModal:"account-logout_logoutModal__kyAp_",logoutTitle:"account-logout_logoutTitle__WFJf1",logoutMessage:"account-logout_logoutMessage__khAfV",logoutButtons:"account-logout_logoutButtons__rg0vO"}},38582:e=>{e.exports={searchBar:"reminders-list-top-section_searchBar__myiaZ",subTitle:"reminders-list-top-section_subTitle__xs8u4"}},43188:e=>{e.exports={accountLinks:"account-links_accountLinks__HnsOe",activeLinkTitle:"account-links_activeLinkTitle__UolEI",linkContent:"account-links_linkContent__gUtRb",activeLink:"account-links_activeLink__e11yC",link:"account-links_link__iF806"}},45321:(e,t,r)=>{"use strict";r.d(t,{U:()=>l});var s=r(37876),a=r(14232),i=r(91613),n=r(6955),d=r(64929),o=r.n(d);let l=e=>{let{address:t}=e,r=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=r.current;if(!e)return()=>{};let t=()=>{let t=e.offsetWidth;e.style.setProperty("--scaleFactor","".concat(t/648))};t();let s=new ResizeObserver(t);return s.observe(e),()=>{s.disconnect()}},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.s,{"data-sentry-element":"EditorFonts","data-sentry-source-file":"greeeting-card-envelope-preview.tsx"}),(0,s.jsx)("div",{ref:r,className:o().container,style:{aspectRatio:714/508},children:t&&(0,s.jsxs)("div",{className:o().text,children:[t.firstName," ",t.lastName,(0,s.jsx)("br",{}),(0,n.o)(t,!1)]})})]})}},51149:e=>{e.exports={container:"account-sidebar_container__K4A2e"}},51236:e=>{e.exports={remindersHeadingContainer:"reminders-heading_remindersHeadingContainer__FukWy",heading:"reminders-heading_heading__3B1QT",reminderIcon:"reminders-heading_reminderIcon__t1Ebz"}},52549:e=>{e.exports={container:"user-details_container__NHxOu",nameTag:"user-details_nameTag__8XJsV"}},54183:(e,t,r)=>{"use strict";r.d(t,{CD:()=>i});var s=r(91423),a=r(6926);let i=(e,t,r)=>{var i;let n=(0,s.A)();e({type:"add_local_recipient",recipient:{id:n,firstName:t.firstName,countryId:t.countryId,line1:t.line1,line2:t.line2,countyState:t.countyState,town:t.town,postCode:t.postCode,type:"recipient"}});let d=null!=(i=r.selectedAddressIds)?i:[];return e({type:"set_recipient_address_ids",recipientAddressIds:(0,a._Y)(d,n,r.isCardPack),copyMessage:!0}),n}},55336:e=>{e.exports={permissionLabel:"update-permissions-form_permissionLabel__cVq2h"}},55909:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSG:()=>tL,default:()=>tA});var s=r(37876),a=r(41228),i=r.n(a),n=r(14232),d=r(63569),o=r(26741),l=r(86189),c=r(18271),m=r(43715),u=r(1319),p=r(91785),h=r(6170),_=r(67768),x=r(40097),y=r(95726),v=r(14308),g=r(50710),f=r(15568),b=r.n(f);let j=e=>{let{children:t}=e;return(0,s.jsx)("div",{className:b().container,"data-sentry-component":"AccountFormContainer","data-sentry-source-file":"account-form-container.tsx",children:(0,s.jsx)("div",{className:b().innerContainer,children:t})})};var C=r(89555);let I=()=>{var e;let t=(0,_.jE)(),{data:r}=(0,y.IM)(),{ctx:a,requestContextState:i}=(0,l._8)(),n=(0,x.n)({mutationFn:async e=>{if("user"===i){await (0,v.TK)(a,{operations:[{op:"replace",path:"/countryId",value:e.countryId}]});let t={countryId:e.countryId,countyState:e.state||null,postCode:e.zipCode||null};await (0,y.uR)(a,{operations:[{op:"replace",path:"/billingAddress",value:t}]})}},onSuccess:()=>{t.invalidateQueries({queryKey:["user"]}),t.invalidateQueries({queryKey:["user/account"]}),t.invalidateQueries({queryKey:["bundle"]})}});return(0,s.jsxs)(j,{"data-sentry-element":"AccountFormContainer","data-sentry-component":"UpdateAccountCountryForm","data-sentry-source-file":"update-account-country-form.tsx",children:[(0,s.jsx)(g.P,{button:{type:"secondary",cta:"Update location"},heading:"Current location",isLoading:n.isPending,onSubmit:e=>n.mutate(e),defaultValue:(null==r||null==(e=r.billingAddress)?void 0:e.countryId)?{countryId:null==r?void 0:r.billingAddress.countryId,state:(null==r?void 0:r.billingAddress.countyState)||void 0,zipCode:r.billingAddress.postCode||void 0}:void 0,"data-sentry-element":"CountrySelectionForm","data-sentry-source-file":"update-account-country-form.tsx"}),n.isSuccess&&(0,s.jsx)(C.G,{})]})};var w=r(88992),k=r(70609),N=r(56798),T=r(78434),S=r(45095);let M=()=>{let{data:e}=(0,v.Jd)(),{ctx:t,requestContextState:r}=(0,l._8)(),a=(0,_.jE)(),{register:i,handleSubmit:d,formState:{errors:o,isValid:c},setFocus:m,reset:u}=(0,w.mN)({mode:"onTouched"});(0,n.useEffect)(()=>{m("email")},[m]),(0,n.useEffect)(()=>{e&&u({email:e.email})},[e]);let p=(0,x.n)({mutationFn:async e=>{"user"===r&&await (0,v.Ww)(t,e)},onSuccess:()=>{a.invalidateQueries({queryKey:["user"]})}});return(0,s.jsxs)(j,{"data-sentry-element":"AccountFormContainer","data-sentry-component":"UpdateEmailForm","data-sentry-source-file":"update-email-form.tsx",children:[(0,s.jsxs)(N.M,{heading:"Email",onSubmit:d(e=>p.mutate(e)),submit:(0,s.jsx)(k.oG,{disabled:!c,size:"large",isLoading:p.isPending,variant:p.isPending?"primary":"secondary",children:"Update Email"}),"data-sentry-element":"FormContainer","data-sentry-source-file":"update-email-form.tsx",children:[(0,s.jsx)(T.F,{type:"email",labelName:"Email Address",placeholder:"[email protected]",invalid:!!o.email,...i("email",{required:!0,pattern:S.X}),"data-sentry-element":"InputField","data-sentry-source-file":"update-email-form.tsx"}),(0,s.jsx)(T.F,{type:"password",labelName:"Current password",invali
1d:!!o.password,...i("password",{required:!0,minLength:6,validate:{atLeastOneUpperCaseLetter:e=>/[A-Z]/.test(e),atLeastOneLowerCaseLetter:e=>/[a-z]/.test(e),atLeastOneNumber:e=>/\d/.test(e)}}),"data-sentry-element":"InputField","data-sentry-source-file":"update-email-form.tsx"})]}),p.isSuccess&&(0,s.jsx)(C.G,{})]})};var E=r(70243),L=r(82618);let A=()=>{let{ctx:e,requestContextState:t}=(0,l._8)(),r=(0,_.jE)(),{data:a}=(0,E._c)(),i=null==a?void 0:a.find(e=>"home"===e.type),n=(0,x.n)({mutationFn:async r=>{if("user"===t){let t={operations:[{op:"replace",path:"/line1",value:r.line1},{op:"replace",path:"/line2",value:r.line2},{op:"replace",path:"/town",value:r.town},{op:"replace",path:"/postCode",value:r.postCode},{op:"replace",path:"/countryId",value:r.countryId},{op:"replace",path:"/countyState",value:r.countyState}]};await (0,v.xu)(e,t)}},onSuccess:()=>{r.invalidateQueries({queryKey:["address"]})}});return i?(0,s.jsxs)(j,{"data-sentry-element":"AccountFormContainer","data-sentry-component":"UpdateHomeAddressForm","data-sentry-source-file":"update-home-address-form.tsx",children:[(0,s.jsx)(L.u,{type:"myAddress",address:i,button:{type:"secondary",cta:"Update address"},header:"Your address",isLoading:n.isPending,onComplete:e=>n.mutate(e),"data-sentry-element":"AddressEditor","data-sentry-source-file":"update-home-address-form.tsx"}),n.isSuccess&&(0,s.jsx)(C.G,{})]}):null},D=()=>{let{data:e,isLoading:t}=(0,v.Jd)(),{ctx:r,requestContextState:a}=(0,l._8)(),i=(0,_.jE)(),{register:d,handleSubmit:o,formState:{errors:c,isValid:m},reset:u}=(0,w.mN)({mode:"onTouched"}),p=(0,x.n)({mutationFn:async e=>{"user"===a&&await (0,v.D4)(r,{operations:[{op:"replace",path:"/firstName",value:e.firstName},{op:"replace",path:"/lastName",value:e.lastName}]})},onSuccess:()=>{i.invalidateQueries({queryKey:["user"]})}});return((0,n.useEffect)(()=>{e&&u({firstName:e.firstName,lastName:e.lastName})},[e]),t)?null:(0,s.jsx)(j,{"data-sentry-element":"AccountFormContainer","data-sentry-component":"UpdateNameForm","data-sentry-source-file":"update-name-form.tsx",children:(0,s.jsxs)(N.M,{heading:"Name",onSubmit:o(e=>p.mutate(e)),submit:(0,s.jsx)(k.oG,{disabled:!m,size:"large",isLoading:p.isPending,variant:p.isPending?"primary":"secondary",children:"Update name"}),"data-sentry-element":"FormContainer","data-sentry-source-file":"update-name-form.tsx",children:[(0,s.jsx)(T.F,{labelName:"First name",placeholder:"John",invalid:!!c.firstName,...d("firstName",{required:!0}),"data-sentry-element":"InputField","data-sentry-source-file":"update-name-form.tsx"}),(0,s.jsx)(T.F,{labelName:"Last name",placeholder:"Doe",invalid:!!c.lastName,...d("lastName",{required:!0}),"data-sentry-element":"InputField","data-sentry-source-file":"update-name-form.tsx"}),p.isSuccess&&(0,s.jsx)(C.G,{})]})})},P=()=>{let{ctx:e,requestContextState:t}=(0,l._8)(),{register:r,handleSubmit:a,formState:{errors:i,isValid:n}}=(0,w.mN)({mode:"onTouched"}),d=(0,x.n)({mutationFn:async r=>{"user"===t&&await (0,v.f3)(e,r)}});return(0,s.jsxs)(j,{"data-sentry-element":"AccountFormContainer","data-sentry-component":"UpdatePasswordForm","data-sentry-source-file":"update-password-form.tsx",children:[(0,s.jsxs)(N.M,{heading:"Password",onSubmit:a(e=>d.mutate(e)),subHeading:"* Your new password must be 6 characters long and must contain a capital letter and a number",submit:(0,s.jsx)(k.oG,{disabled:!n,size:"large",isLoading:d.isPending,variant:d.isPending?"primary":"secondary",children:"Update password"}),"data-sentry-element":"FormContainer","data-sentry-source-file":"update-password-form.tsx",children:[(0,s.jsx)(T.F,{type:"password",labelName:"Current password",invalid:!!i.currentPassword,...r("currentPassword",{required:!0,minLength:6,validate:{atLeastOneUpperCaseLetter:e=>/[A-Z]/.test(e),atLeastOneLowerCaseLetter:e=>/[a-z]/.test(e),atLeastOneNumber:e=>/\d/.test(e)}}),"data-sentry-element":"InputField","data-sentry-source-file":"update-password-form.tsx"}),(0,s.jsx)(T.F,{type:"password",labelName:"New password",invalid:!!i.newPassword,...r("newPassword",{required:!0,minLength:6,validate:{atLeastOneUpperCaseLetter:e=>/[A-Z]/.test(e),atLeastOneLowerCaseLetter:e=>/[a-z]/.test(e),atLeastOneNumber:e=>/\d/.test(e)}}),"data-sentry-element":"InputField","data-sentry-source-file":"update-password-form.tsx"})]}),d.isSuccess&&(0,s.jsx)(C.G,{})]})};var F=r(65548),U=r(55336),O=r.n(U);let R=()=>{let{ctx:e,requestContextState:t}=(0,l._8)(),{data:r}=(0,v.JT)(),a=(0,_.jE)(),i=(0,x.n)({mutationFn:async r=>{"user"===t&&await (0,v.LA)(e,{permissions:{allowEmailMarketing:r}})},onSuccess:()=>{a.invalidateQueries({queryKey:["permission"]})}});return(0,s.jsxs)(j,{"data-sentry-element":"AccountFormContainer","data-sentry-component":"UpdatePermissionsForm","data-sentry-source-file":"update-permissions-form.tsx",children:[(0,s.jsx)(N.M,{heading:"Your Permissions","data-sentry-element":"FormContainer","data-sentry-source-file":"update-permissions-form.tsx",children:(0,s.jsxs)("label",{className:O().permissionLabel,children:[(0,s.jsx)(F.Y,{checked:!!(null==r?void 0:r.allowEmailMarketing),onClick:e=>i.mutate(e.currentTarget.checked),"data-sentry-element":"CheckboxField","data-sentry-source-file":"update-permissions-form.tsx"}
1),(0,s.jsx)("p",{children:"Subscribe to receive offers and savings, reminders, news and handy tips by email. If you unsubscribe, it may take 72 hours."})]})}),i.isSuccess&&(0,s.jsx)(C.G,{})]})};var B=r(41591),H=r(2330),V=r(73980),z=r.n(V);let Y=()=>{let{isMobile:e}=(0,B.Ln)(),t=(0,H.r)();return(0,s.jsxs)("div",{className:z().accountDetailContainer,"data-sentry-component":"AccountDetails","data-sentry-source-file":"account-details.tsx",children:[(0,s.jsxs)("h2",{className:z().title,children:[e&&(0,s.jsx)("img",{src:"/assets/icons/chevron-bg-gray-left.png",alt:"icon-left",width:24,height:24,onClick:()=>t.back()}),"Account details"]}),(0,s.jsx)("p",{className:z().subTitle,children:"Feel free to edit any of your details below so your TouchNote account is totally up to date."}),(0,s.jsxs)("div",{className:z().formsContainer,children:[(0,s.jsx)(M,{"data-sentry-element":"UpdateEmailForm","data-sentry-source-file":"account-details.tsx"}),(0,s.jsx)(P,{"data-sentry-element":"UpdatePasswordForm","data-sentry-source-file":"account-details.tsx"}),(0,s.jsx)(D,{"data-sentry-element":"UpdateNameForm","data-sentry-source-file":"account-details.tsx"}),(0,s.jsx)(A,{"data-sentry-element":"UpdateHomeAddressForm","data-sentry-source-file":"account-details.tsx"}),(0,s.jsx)(I,{"data-sentry-element":"UpdateAccountCountryForm","data-sentry-source-file":"account-details.tsx"}),(0,s.jsx)(R,{"data-sentry-element":"UpdatePermissionsForm","data-sentry-source-file":"account-details.tsx"})]})]})};var W=r(62318),G=r.n(W),q=r(90088),J=r(8920),Q=r(69403),Z=r(26404),K=r(4650),X=r(1461),$=r(7941),ee=r(50213),et=r(72145),er=r(3830),es=r.n(er),ea=r(56557),ei=r.n(ea),en=r(17618),ed=r(91576),eo=r(85667),el=r(65534),ec=r(37581),em=r(11079),eu=r(17825);let ep=e=>{let{isOpen:t,url:r,onDismiss:a,onMembershipUpdate:i,onError:d}=e;return((0,n.useEffect)(()=>{let e=e=>{switch(e.data){case"goBack":a();break;case"showDowngradeSuccess":case"showCancellationSuccess":case"subscriptionCollectionResumed":case"subscriptionCollectionPaused":i();break;case"showDowngradeFailure":d()}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]),void 0===r)?null:(0,s.jsx)(eu.a,{shouldStyle:!1,bgColor:"bgTransparent",isOpen:t,closeModal:a,"data-sentry-element":"Modal","data-sentry-component":"ChurnkeyModal","data-sentry-source-file":"my-memberhsip-modals.tsx",children:(0,s.jsx)("div",{className:es().churnkeyModal,children:(0,s.jsx)("iframe",{className:es().content,src:r,title:"Cancel membership"})})})},eh=e=>{var t,r;let{user:a,account:i,subscription:d,plan:o,onSubscriptionUpdate:c,onClickChangePaymentMethod:m}=e,{getChurnkeyUrl:u}=(()=>{let{ctx:e}=(0,l._8)();return{getChurnkeyUrl:async function(){if(!e)return null;try{let t;return await (t=e,(0,el.Em)(t,{apiVersion:"v3",method:"GET",path:"/churnkey/auth-hash"}))}catch(e){return null}}}})(),[p,h]=(0,n.useState)(!1),_="churnkey";(0,n.useEffect)(()=>{h(!1)},[d]);let[x,y]=(0,n.useState)(void 0),[v,g]=(0,n.useState)(!1),f=()=>{u().then(e=>{let t=null==e?void 0:e.tnChurnkeyPreCancelPageURL;t?y(t):g(!0)})},b=d.cancelAtPeriodEnd||"cancelled"===d.status;return(0,s.jsxs)("div",{className:es().panel,"data-sentry-component":"MyMembershipDetails","data-sentry-source-file":"my-membership-details.tsx",children:[(0,s.jsx)(e_,{"data-sentry-element":"Titlebar","data-sentry-source-file":"my-membership-details.tsx"}),p?(0,s.jsx)("div",{className:es().loaderContainer,children:(0,s.jsx)(X.a,{})}):(0,s.jsxs)("div",{className:es().detailsContainer,children:[(0,s.jsx)(ex,{subscription:d,plan:o,isPlanPaused:null!==d.pauseCollection}),(0,s.jsx)(eg,{pauseCollection:d.pauseCollection,onResume:f}),(d.nextPayment||b)&&(0,s.jsx)(ef,{timestamp:null!=(r=d.validUntil)?r:null==(t=d.nextPayment)?void 0:t.billingDate,cancelAtPeriodEnd:b}),d.nextPayment&&(0,s.jsx)(eb,{subscription:d}),d.nextPayment&&(0,s.jsx)(ej,{subscription:d,onClick:e=>m(e)}),(0,s.jsx)(eC,{}),(0,s.jsx)(eI,{}),b&&(0,s.jsx)(ek,{subscriptionID:d.subscriptionId,onProcessing:()=>h(!0),onRenew:()=>{h(!0),c()},onError:()=>h(!1),splitCancellationFlow:_}),!b&&a&&i&&(0,s.jsx)(ew,{splitCancellationFlow:_,onCancelWithChurnkey:f,onCancellationError:()=>g(!0)}),(0,s.jsx)(ep,{isOpen:!!x,url:x,onDismiss:()=>y(void 0),onMembershipUpdate:()=>{y(void 0),c()},onError:()=>{y(void 0),g(!0)}}),(0,s.jsx)(ee.z,{isOpen:v,onClose:()=>g(!1)})]})]})},e_=()=>(0,s.jsx)("p",{className:es().panelTitle,"data-sentry-component":"Titlebar","data-sentry-source-file":"my-membership-details.tsx",children:"Membership details"}),ex=e=>{var t;let{isPlanPaused:r,subscription:a,plan:i}=e,n=(0,K.uX)(i.handle),d=null!=(t=(0,K.Oi)(a))?t:"";return(0,s.jsx)(ey,{infoTitle:n,infoValue:r?"Plan paused":"".concat(d),boldValue:!0,"data-sentry-element":"TextInfo","data-sentry-component":"NameAndPrice","data-sentry-source-file":"my-membership-details.tsx"})},ey=e=>{let{infoTitle:t,infoValue:r,boldTitle:a=!1,boldValue:i=!1}=e;return(0,s.jsxs)("div",{className:es().detailRow,"data-sentry-component":"TextInfo","data-sentry-source-file":"my-membership-details.tsx",children:[(0,s.jsx)("div",{children:a?(0,s.jsx)("b",{children:t}):t}),(0,s.jsx)("div",{children:i?(0,s.jsx)("b",{children:r}):r})]})},ev=e=>{let{title:t,onClick:r}=e;return(0,s.jsx)("button",{className:es().detailRow,type:"button",onClick:r,"data-sentry-component":"TextButton","data-sentry-source-file":"my-membership-details.tsx",children:t})},eg=e=>{let{pauseCollection:t,onResume:r}=e;if(!t||!(null==t?void 0:t.resumesAt))return null;let a=ei()(1e3*t.resumesAt),i=ei()(a).format("DD MMMM YYYY");return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ey,{infoTitle:"Resume Date",infoValue:i,"data-sentry-element":"TextInfo","data-sentry-source-file":"my-membership-details.tsx"}
1),(0,s.jsx)(ev,{title:"Resume plan now",onClick:r,"data-sentry-element":"TextButton","data-sentry-source-file":"my-membership-details.tsx"})]})},ef=e=>{let{timestamp:t,cancelAtPeriodEnd:r}=e,a=ei()(1e3*t),i=ei()(a).format("DD MMMM YYYY");return(0,s.jsx)(ey,{infoTitle:r?"Membership ending":"Renewal date",infoValue:i,"data-sentry-element":"TextInfo","data-sentry-component":"RenewalDate","data-sentry-source-file":"my-membership-details.tsx"})},eb=e=>{var t,r;let{subscription:a}=e,i=null!=(r=null==(t=a.nextPayment)?void 0:t.amount)?r:0,n=(0,ec.AZ)(i,a.currency);return(0,s.jsx)(ey,{infoTitle:"Renewal price",infoValue:n,"data-sentry-element":"TextInfo","data-sentry-component":"RenewalPrice","data-sentry-source-file":"my-membership-details.tsx"})},ej=e=>{let{subscription:t,onClick:r}=e,{ctx:a}=(0,l._8)(),[i,d]=(0,n.useState)();return(0,n.useEffect)(()=>{var e;let r=null==(e=t.nextPayment)?void 0:e.paymentMethodId;(null==r?void 0:r.startsWith("pm_"))&&(0,en.gY)(a,r).then(e=>{var t;d(null!=(t=e.paymentMethod)?t:void 0)})},[t.nextPayment]),(0,s.jsxs)("button",{type:"button",className:es().detailRow,disabled:!1,style:{cursor:"pointer"},onClick:()=>r(i),"data-sentry-component":"SubscriptionPaymentMethod","data-sentry-source-file":"my-membership-details.tsx",children:[(0,s.jsx)("div",{className:es().leadingText,children:"Payment method"}),i&&(0,s.jsx)("div",{className:(0,em.lM)(es().trailingText,es().clickable),children:(0,en.I4)(i)})]})},eC=()=>(0,s.jsxs)(ed.N_,{className:es().detailRow,href:"https://touchnote-support.freshdesk.com/support/home","data-sentry-element":"Link","data-sentry-component":"FAQ","data-sentry-source-file":"my-membership-details.tsx",children:[(0,s.jsx)("div",{children:"FAQ"}),(0,s.jsx)("img",{className:es().chevron,src:"/assets/icons/chevron-right.svg",alt:"right arrow icon",width:10,height:20})]}),eI=()=>{let{locale:e}=(0,m.Y)();return(0,s.jsxs)(ed.N_,{className:es().detailRow,href:(0,ed.O2)("/terms-and-conditions",e),"data-sentry-element":"Link","data-sentry-component":"Terms","data-sentry-source-file":"my-membership-details.tsx",children:[(0,s.jsx)("div",{children:"T&Cs"}),(0,s.jsx)("img",{className:es().chevron,src:"/assets/icons/chevron-right.svg",alt:"right arrow icon",width:10,height:20})]})},ew=e=>{let{onCancelWithChurnkey:t,onCancellationError:r,splitCancellationFlow:a}=e,{trackEvent:i}=(0,et.z1)(),[d,o]=(0,n.useState)(!1),l=(0,n.useCallback)(()=>{switch(i("CTATapped",{handle:"Yes Please",origin:"Membership Page"}),o(!1),a){case"churnkey":case"control":t()}},[a]),c=(0,n.useCallback)(()=>{i("CTATapped",{handle:"Cancel Membership",origin:"Membership Page"}),"contact_cs"===a?r():o(!0)},[a]);return(0,s.jsxs)("div",{"data-sentry-component":"CancelMembership","data-sentry-source-file":"my-membership-details.tsx",children:[(0,s.jsxs)("button",{className:es().detailRow,type:"button",onClick:c,children:[(0,s.jsx)("div",{children:"Cancel membership"}),(0,s.jsx)("img",{className:es().chevron,src:"/assets/icons/chevron-right.svg",alt:"right arrow icon",width:10,height:20})]}),(0,s.jsx)(eo.R,{text:"Ending your membership will cancel all perks you currently have",isOpen:d,onConfirm:l,onClose:()=>o(!1),"data-sentry-element":"ConfirmationModal","data-sentry-source-file":"my-membership-details.tsx"})]})},ek=e=>{let{subscriptionID:t,onProcessing:r,onRenew:a,onError:i,splitCancellationFlow:d}=e,{ctx:o}
1=(0,l._8)(),[c,m]=(0,n.useState)(!1),[u,p]=(0,n.useState)(!1);return(0,s.jsxs)("div",{"data-sentry-component":"RenewMembership","data-sentry-source-file":"my-membership-details.tsx",children:[(0,s.jsx)(ev,{title:"Renew membership",onClick:()=>p(!0),"data-sentry-element":"TextButton","data-sentry-source-file":"my-membership-details.tsx"}),(0,s.jsx)(eo.R,{text:"Would you like to reactivate your membership? Itâll remain on your original billing cycle.",isOpen:u,onConfirm:()=>{p(!1),o&&(r(),(0,Z.fK)(o,t,"brightback"!==d).then(e=>{a()}).catch(e=>{i(),m(!0)}))},onClose:()=>p(!1),"data-sentry-element":"ConfirmationModal","data-sentry-source-file":"my-membership-details.tsx"}),(0,s.jsx)(ee.z,{isOpen:c,onClose:()=>m(!1),"data-sentry-element":"ErrorContactCustomerSupportModal","data-sentry-source-file":"my-membership-details.tsx"})]})},eN=e=>{let{plan:t}=e,{perks:r,footer:a}=(0,n.useMemo)(()=>eM(t),[t]);return(0,s.jsxs)("div",{className:es().panel,"data-sentry-component":"MyMembershipPerks","data-sentry-source-file":"my-membership-perks.tsx",children:[(0,s.jsx)(eT,{"data-sentry-element":"Titlebar","data-sentry-source-file":"my-membership-perks.tsx"}),(0,s.jsx)("div",{className:es().perkContainer,children:r.map(e=>(0,s.jsx)(eS,{perk:e},e.alt))}),a&&(0,s.jsx)("p",{className:es().perkFooter,children:a})]})},eT=()=>(0,s.jsx)("p",{className:es().panelTitle,"data-sentry-component":"Titlebar","data-sentry-source-file":"my-membership-perks.tsx",children:"My member perks"}),eS=e=>{let{perk:t}=e,r="/assets/icons/membership/".concat(t.iconName,".svg");return(0,s.jsxs)("div",{className:es().perk,"data-sentry-component":"SinglePerk","data-sentry-source-file":"my-membership-perks.tsx",children:[(0,s.jsx)("img",{src:r,className:es().icon,width:34,height:34,alt:t.alt}),(0,s.jsx)("div",{className:es().perkTitle,children:t.title})]})},eM=e=>{let t=e&&eD(e.handle);return t?{perks:[{iconName:"2024_membership_perk_icon_0",alt:t.allowance,title:t.allowance},...t.hasTopUpDiscount?[eE]:[],...eL],footer:t.footer}:{perks:[eE,...eL]}},eE={iconName:"2024_membership_perk_icon_2",alt:"Extra 15% off card top-ups",title:"Extra 15% off card top-ups"},eL=[{iconName:"2024_membership_perk_icon_3",alt:"Custom Stamps",title:"Custom Stamps"},{iconName:"2024_membership_perk_icon_6",alt:"Fun Stickers",title:"Fun Stickers"},{iconName:"2024_membership_perk_icon_4",alt:"Add your location to postcards",title:"Add your location to postcards"},{iconName:"2024_membership_perk_icon_7",alt:"Capture your handwriting",title:"Capture your handwriting"}],eA=[{prefix:"BRONZE",allowance:"1 card credit a month",validity:"Allocated card credit must be used monthly."},{prefix:"SILVER",allowance:"2 card credits a month",validity:"Allocated credits are valid for 3 months."},{prefix:"GOLD",allowance:"6 card credits a month",validity:"Allocated credits are valid for 6 months."},{prefix:"PLATINUM",allowance:"12 card credits a month",validity:"Allocated credits are valid for 6 months."},{prefix:"PLUS",allowance:"2 card credits a month",validity:"Allocated credits are valid for 6 months."},{prefix:"PREMIUM",allowance:"5 card credits a month",validity:"Allocated credits are valid for 12 months."},{prefix:"YEARLY",allowance:"1 card credit a month",validity:"Allocated credits must be used monthly."},{prefix:"ANNUAL",allowance:"1 card credit a month",validity:"Allocated credits must be used monthly."}],eD=e=>{let t=e.toUpperCase();if(t.includes("UNLIMITED"))return{allowance:"Unlimited cards",hasTopUpDiscount:!1};if(t.includes("ANNUAL_2024"))return{allowance:"24 cards a year",hasTopUpDiscount:!0,footer:"Card credits are valid for 12 months"};if(t.includes("MONTHLY_2024"))return{allowance:"2 cards a month",hasTopUpDiscount:!0,footer:"Card credits are valid for 12 months"};let r=eA.find(e=>{let{prefix:r}=e;return t.startsWith(r)});return r&&{allowance:r.allowance,hasTopUpDiscount:!0,footer:"".concat(r.validity," ").concat("1 card credit = a postcard, 2 card credits = a greeting card.")}};var eP=r(22448);let eF=()=>{let e;(0,et.z1)("memberTabViewed");let{data:t}=(0,v.Jd)(),{data:r}=(0,y.IM)(),a=(0,H.r)(),{isLoading:i,data:d,refetch:o}=(0,Z.Q2)({ignoreCache:!0}
1),[l,c]=(0,n.useState)(),[m,u]=(0,n.useState)(),[p,h]=(0,n.useState)(!1),[_,x]=(0,n.useState)(!1),[g,f]=(0,n.useState)(),[b,j]=(0,n.useState)();return(0,n.useEffect)(()=>{h(i)},[i]),(0,n.useEffect)(()=>{if(!i&&d&&r){let t=null==d?void 0:d.subscriptions;if(t){let r=t[0];c(t[0]);let s=null==d?void 0:d.planGroups;if(s&&r){var e;let t=r.planId;u(null!=(e=(0,K.Md)(s,t))?e:void 0)}}h(!1)}},[i,d,r]),e=p?{type:"loading"}:b?{type:"paymentMethodUpdateError",message:b}:_?{type:"paymentMethodSelector"}:l&&m&&(null==d?void 0:d.components)?{type:"membershipInfo",subscriptionData:d,subscription:l,plan:m}:{type:"loadingError"},(0,s.jsxs)(eP.K0,{onChangePaymentMethodSuccess:()=>{x(!1),o()},onChangePaymentMethodError:e=>{var t;t=e.message,h(!1),j(t)},subscriptionId:null==l?void 0:l.subscriptionId,"data-sentry-element":"MembershipPaymentProvider","data-sentry-component":"MyMembership","data-sentry-source-file":"my-membership.tsx",children:["paymentMethodSelector"===e.type&&(0,s.jsx)($.R,{initialPaymentMethod:g,currentWallet:void 0,setPaymentMethodOnExistingSubscription:!0,onSelectPaymentMethod:()=>{x(!1),h(!0)},maximumNumberOfCardMethods:10,onClickBack:()=>x(!1)}),"membershipInfo"===e.type&&(0,s.jsxs)("div",{className:es().container,children:[(0,s.jsx)(eU,{goBack:()=>a.back()}),(0,s.jsxs)("div",{className:es().innerContainer,children:[(0,s.jsx)(eN,{plan:e.plan}),(0,s.jsx)(eh,{user:t,account:r,subscription:e.subscription,plan:e.plan,onSubscriptionUpdate:o,onClickChangePaymentMethod:e=>{h(!1),f(e),x(!0)}})]})]}),"loading"===e.type&&(0,s.jsx)("div",{className:es().loaderContainer,children:(0,s.jsx)(X.a,{})}),"loadingError"===e.type&&(0,s.jsx)("div",{className:es().error,children:"There was a problem loading your membership details."}),"paymentMethodUpdateError"===e.type&&(0,s.jsx)(ee.W,{message:e.message,isOpen:!0,onClose:()=>j(void 0)})]})},eU=e=>{let{goBack:t}=e,{isMobile:r}=(0,B.Ln)();return(0,s.jsxs)("div",{className:es().titleBar,"data-sentry-component":"TitleBar","data-sentry-source-file":"my-membership.tsx",children:[r?(0,s.jsx)("button",{type:"button",onClick:t,className:es().backButton,children:(0,s.jsx)("img",{src:"/assets/icons/chevron-bg-gray-left.png",alt:"icon-left",width:24,height:24})}):(0,s.jsx)("img",{src:"/assets/icons/crown-black-outline.svg",alt:"address book icon",width:32,height:32}),(0,s.jsx)("div",{children:(0,s.jsx)("h2",{children:"Membership"})})]})};
1var eO=r(33845),eR=r.n(eO),eB=r(78319),eH=r(87144),eV=r(85013),ez=r(1520),eY=r(653),eW=r(6926),eG=r(58935),eq=r(20386),eJ=r(48936),eQ=r(24295),eZ=r(96937),eK=r(5551);r(83750);var eX=r(7486),e$=r(76708),e0=r(94248),e1=r(4860),e2=r.n(e1),e4=r(3502),e3=r(85283);let e6=e=>e?[[e.line1,e.line2].filter(Boolean).join(", "),[e.town,e.postCode].filter(Boolean).join(", ")].filter(Boolean):[],e8=e=>{var t,r;return e.shipments.length>1?"Multiple recipients":null!=(r=null==(t=e.shipments[0])?void 0:t.address.firstName)?r:""},e9=(e,t)=>(0,em.lM)(e2().orderExpandedTimelineLine,e.isCancelled&&e2().orderExpandedTimelineLineCancelled,e.isEstimatedDelivery?(0,em.lM)(e2().orderExpandedTimelineLineDashed,(null==t?void 0:t.isComplete)&&!e.isCancelled&&e2().orderExpandedTimelineLineDashedComplete):e.isComplete&&!e.isCancelled&&e2().orderExpandedTimelineLineComplete),e5=e=>{let{order:t,isCompact:r=!1}=e,a=(e=>{var t,r,s,a,i,n;let d=null!=(i=null==(t=e.shipments.at(0))?void 0:t.shipmentHistory)?i:[],o=null==(r=e.shipments.at(0))?void 0:r.deliveryEstimate,l=(0,e4.PS)(o),c=!!(null==(a=e.shipments.at(0))||null==(s=a.orderedGifts)?void 0:s.length),m=(null==o?void 0:o.postalService)==="USPS_1ST_CLASS",u=d.some(e=>"Rejected"===e.status),p=d.some(e=>"Initiated"===e.status||"Processed"===e.status),h=d.some(e=>"Printing"===e.status),_=d.some(e=>"Shipped"===e.status),x=[{id:"confirmed",label:"Order confirmed",isComplete:p},{id:"printing",label:u?"Cancelled":"Printing in progress",isComplete:u||h,isCancelled:u}];return u?x:[...x,{id:"on-its-way",label:"On its way",subtext:null!=(n=null==l?void 0:l.postalServiceName)?n:e4.L2,isComplete:_},{id:"delivered",label:m?c?"Card & gift delivered":"Card delivered":"Estimated delivery",subtext:m?null==l?void 0:l.deliveryEstimateText:(null==o?void 0:o.deliveryDate)?(0,e3.yf)(o.deliveryDate).format("dddd Do MMMM"):void 0,isComplete:!!m&&!!(null==o?void 0:o.isDelivered),isEstimatedDelivery:!m}]})(t);return(0,s.jsx)("div",{className:(0,em.lM)(e2().orderExpandedTimeline,r?e2().orderExpandedTimelineCompact:e2().orderExpandedTimelineStretched),style:r?void 0:{height:"100%"},"data-sentry-component":"OrderExpandedTimeline","data-sentry-source-file":"order-expanded-desktop.tsx",children:a.map((e,t)=>{let i=t>0?a[t-1]:void 0;return(0,s.jsxs)(n.Fragment,{children:[!r&&t>0&&(0,s.jsx)("div",{className:e2().orderExpandedTimelineConnector,children:(0,s.jsx)("div",{className:e9(e,i)})}),(0,s.jsxs)("div",{className:e2().orderExpandedTimelineItem,children:[(0,s.jsxs)("div",{className:e2().orderExpandedTimelineTrack,children:[r&&0!==t&&(0,s.jsx)("div",{className:e9(e,i)}),e.isCancelled?(0,s.jsx)("img",{src:"/assets/icons/red-circle.svg",alt:"",width:16,height:16,className:e2().orderExpandedTimelineIconCancelled}):e.isEstimatedDelivery?(0,s.jsx)("img",{src:"/assets/icons/estimated-delivery.svg",alt:"",width:20,height:16,className:e2().orderExpandedTimelineIconEstimatedDelivery}):e.isComplete?(0,s.jsx)("img",{src:"/assets/icons/white-tick-in-green-circle.svg",alt:"",width:16,height:16,className:e2().orderExpandedTimelineIconComplete}):(0,s.jsx)("div",{className:e2().orderExpandedTimelineCircle})]}),(0,s.jsxs)("div",{className:e2().orderExpandedTimelineContent,children:[(0,s.jsx)("p",{className:(0,em.lM)(e2().orderExpandedTimelineLabel,(e.isComplete||e.isEstimatedDelivery)&&e2().orderExpandedTimelineLabelComplete,e.isCancelled&&e2().orderExpandedTimelineLabelCancelled),children:e.label}),e.subtext&&(0,s.jsx)("p",{className:e2().orderExpandedTimelineSubtext,children:e.subtext})]})]})]},e.id)})})},e7=e=>{var t,r,a,i,d;let{order:o,cancelOrder:l,canCancelOrder:c,showOrderAgain:m,orderAgainHref:u,onOrderAgainClick:p,getThumbnail:h}=e,[_,x]=(0,n.useState)("front"),y=null==(t=o.shipments.at(0))?void 0:t.orderedProducts.at(0),v=null==(r=o.shipments.at(0))?void 0:r.address,g=(e=>{var t,r,s;return null!=(s=null==(r=e.shipments.at(0))||null==(t=r.shipmentHistory)?void 0:t.some(e=>"Rejected"===e.status))&&s})(o),f=(0,eG.g)(o),b=e6(v),j="/account/reminders/?preSelectedRecipientAddressId=".concat(null!=(i=null==v?void 0:v.addressId)?i:""),C=(0,n.useMemo)(()=>
1{if(!f)return[];let{editorDraft:e,backOfCardPreview:t,envelopPreviewGC:r}=f,a=[{id:"front",ariaLabel:"Card front",content:(0,s.jsx)(eq.g,{draft:e}),expandWidth:"landscape"===e.orientation,expandHeight:"landscape"!==e.orientation}];return t&&a.push({id:"message",ariaLabel:"Card message",content:t,expandWidth:"landscape"===e.orientation||e.productHandle.includes("PC"),expandHeight:"landscape"!==e.orientation&&!e.productHandle.includes("PC")}),e.productHandle.includes("GC")&&r&&a.push({id:"envelope",ariaLabel:"Envelope",content:r,expandWidth:!0}),a},[f]),I=(null!=(d=null==f?void 0:f.editorDraft.orientation)?d:null==y||null==(a=y.orientation)?void 0:a.toLowerCase())==="landscape",w=f?(0,s.jsxs)(s.Fragment,{children:["front"===_&&(0,s.jsx)(eq.g,{draft:f.editorDraft}),"message"===_&&f.backOfCardPreview,"envelope"===_&&f.envelopPreviewGC]}):(0,s.jsx)("img",{src:h(y),alt:"Product Thumbnail",width:317,height:236});return(0,s.jsxs)("div",{className:e2().orderExpandedDesktop,"data-sentry-component":"OrderDetailsDesktop","data-sentry-source-file":"order-expanded-desktop.tsx",children:[(0,s.jsxs)("div",{className:e2().orderExpandedContent,children:[(0,s.jsx)("div",{className:e2().orderExpandedPreviewMain,children:(0,s.jsx)("div",{className:(0,em.lM)(e2().thumbnail,e2().thumbnailBig,I?e2().thumbnailBigLandscape:e2().thumbnailBigPortrait),children:w})}),(0,s.jsx)("div",{className:(0,em.lM)(e2().orderExpandedTimelineSection,g&&e2().orderExpandedTimelineSectionCompact),children:(0,s.jsx)(e5,{order:o,isCompact:g,"data-sentry-element":"OrderExpandedTimeline","data-sentry-source-file":"order-expanded-desktop.tsx"})}),C.length>0?(0,s.jsx)(e0.l,{items:C,selectedId:_,onSelect:e=>x(e),className:e2().orderExpandedPreviewSelectors}):(0,s.jsx)("div",{className:e2().orderExpandedPreviewSelectors,"aria-hidden":!0}),(0,s.jsx)("div",{className:e2().orderExpandedAddressSection,children:(0,s.jsxs)("div",{className:e2().orderExpandedDeliveryAddress,children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"Delivery address"}),b.map(e=>(0,s.jsx)("p",{className:e2().orderItemValue,children:e},e))]})})]}),(0,s.jsxs)("div",{className:e2().orderExpandedFooter,children:[(0,s.jsxs)("p",{className:e2().orderExpandedHelp,children:[c&&(0,s.jsxs)(s.Fragment,{children:["You have 30 minutes to"," ",(0,s.jsx)("button",{type:"button",className:e2().orderExpandedLink,onClick:()=>l(o),children:"cancel"})," ","your order."," "]}),"Need help with your order?"," ",(0,s.jsx)("a",{className:e2().orderExpandedLink,href:"mailto:".concat(eX.Q),children:"Contact support"})]}),(0,s.jsxs)("div",{className:e2().orderExpandedActions,children:[m&&(0,s.jsx)(k._F,{onClick:p,variant:"primary",size:"small",href:u,children:"Order again"}),(0,s.jsx)(k._F,{variant:"secondary",size:"small",href:j,"data-sentry-element":"CallToActionLink","data-sentry-source-file":"order-expanded-desktop.tsx",children:"Add reminder"})]})]})]})};var te=r(34905);let tt=e=>{if(e){var t,r;return e.productThumbnailImages.length?null!=(t=e.productThumbnailImages[0])?t:"":null!=(r=e.productImages[0])?r:""}return""},tr=e=>{if(e){var t,r,s,a,i;if((null==(t=e.shipments[0])?void 0:t.processStatus)==="Rejected")return!1;let n=null==(s=e.shipments[0])||null==(r=s.shipmentHistory[0])?void 0:r.timestamp;if(!n)return!1;let d=(0,te.kt)(n),o=null!=e&&null!=(a=e.shipments[0])&&!!a.shipmentDate&&(0,te.Hl)(null==e||null==(i=e.shipments[0])?void 0:i.shipmentDate);return d<30||o}return!1},ts=()=>(0,s.jsxs)("section",{className:e2().noOrdersContainer,"data-sentry-component":"NoOrders","data-sentry-source-file":"order-components.tsx",children:[(0,s.jsx)("img",{src:"/assets/icons/post.svg",alt:"send post icon",width:64,height:64}),(0,s.jsx)("h3",{children:"Send your first card to view your orders"}),(0,s.jsx)(k._F,{href:"/uk/personalised-cards/p/".concat(e$.G,"/"),variant:"primary",size:"large","data-sentry-element":"CallToActionLink","data-sentry-source-file":"order-components.tsx",children:"Send Card"})]}),ta=()=>(0,s.jsxs)("div",{className:e2().smallLoading,"data-sentry-component":"MoreOrdersLoading","data-sentry-source-file":"order-components.tsx",children:[" ",(0,s.jsx)(eR(),{animationData:ez,className:e2().lottie,"data-sentry-element":"Lottie","data-sentry-source-file":"order-components.tsx"})]}),ti=e=>{var t,r,a,i,d,o,l,c,m;let{order:u,cancelOrder:p,disableCTAs:h}=e,_=null==(t=u.shipments.at(0))?void 0:t.orderedProducts.at(0),x=null==(r=u.shipments.at(0))?void 0:r.address,y=(0,te.BS)(u.shipments[0]),v=tr(u),g=e6(x),f="/account/reminders/?preSelectedRecipientAddressId=".concat(null!=(l=null==x?void 0:x.addressId)?l:""),{setEditorDraft:b}=(0,eQ.J)(),[j,C]=(0,eJ.F)("activeDraftId"),{url:I}=(0,eK.C)("front"),{trackEvent:w}=(0,et.z1)(),{orderedDrafts:N}=(0,eZ.x)(),T=N.find(e=>{var t;return null==(t=e.orderIds)?void 0:t.some(e=>e===u.uuid)}),S=null==_?void 0:_.themeId,M=null==_||null==(a=_.productImages)?void 0:a.at(0),E=[I,T?"":[S?"themeId=".concat(S):"",M?"preOrderedCardImageUrl=".concat(M):"",_?"productHandle=".concat(_.product.handle):"",_?"orientation=".concat(_.orientation.toLowerCase()):""].filter(
1Boolean).join("&")].filter(Boolean).join("?"),L=(0,eG.g)(u),A=(null!=(c=null==L?void 0:L.editorDraft.orientation)?c:null==_||null==(i=_.orientation)?void 0:i.toLowerCase())==="landscape",D=(0,n.useMemo)(()=>{if(!L)return[{id:"thumbnail",isLandscapePreview:A,content:(0,s.jsx)("img",{src:tt(_),alt:"Product Thumbnail",width:A?220:140,height:A?165:190,className:(0,em.lM)(A?e2().isLandscape:e2().isPortrait)})}];let{editorDraft:e,backOfCardPreview:t,envelopPreviewGC:r}=L,a=[{id:"front",isLandscapePreview:"landscape"===e.orientation,content:(0,s.jsx)(eq.g,{draft:e})}];return t&&a.push({id:"message",isLandscapePreview:"landscape"===e.orientation||e.productHandle.includes("PC"),content:t}),e.productHandle.includes("GC")&&r&&a.push({id:"envelope",isLandscapePreview:!0,content:r}),a},[_,A,L]),[P,F]=(0,n.useState)(0);(0,n.useEffect)(()=>{F(0)},[u.uuid]);let U=null!=(m=null==(d=D[P])?void 0:d.isLandscapePreview)?m:A,O=()=>{if(j&&C(null),T){let e=(0,eW.hw)(T);C(e.draftID),b(e)}};return(0,n.useEffect)(()=>{w("orderStatusViewed",{orderId:u.id})},[u.id,w]),(0,s.jsxs)("div",{className:e2().mobileDetailsContainer,"data-sentry-component":"OrderDetailsMobile","data-sentry-source-file":"order-components.tsx",children:[(0,s.jsxs)("div",{className:e2().mobileDetailsCard,children:[(0,s.jsxs)("div",{className:(0,em.lM)(e2().orderItemMeta,e2().orderItemMetaMobile,e2().mobileDetailsMeta),children:[(0,s.jsxs)("div",{className:e2().orderItemField,children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"Status"}),(0,s.jsx)("span",{className:(0,em.lM)(e2().orderItemValue,"cancelled"===y.toLowerCase()&&e2().orderItemStatusCancelled),children:y})]}),(0,s.jsxs)("div",{className:e2().orderItemField,children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"To"}),(0,s.jsx)("span",{className:(0,em.lM)(e2().orderItemValue,e2().orderItemRecipientName),children:e8(u)})]})]}),(0,s.jsx)("hr",{className:e2().orderItemDivider}),(0,s.jsxs)("div",{className:e2().mobileDetailsOrderMeta,children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"Order no. "}),(0,s.jsx)("span",{className:e2().orderItemValue,children:null==(o=u.shipments[0])?void 0:o.serialId})]}),(0,s.jsxs)("p",{className:e2().mobileDetailsCreated,children:["Created ",(0,te.po)(new Date(1e3*u.createdAt))]})]}),(0,s.jsx)("div",{className:(0,em.lM)(e2().mobileDetailsPreview,D.length<=1&&e2().mobileDetailsPreviewSingle),children:(0,s.jsx)("div",{className:(0,em.lM)(e2().mobileDetailsPreviewFrame,U?e2().mobileDetailsPreviewLandscape:e2().mobileDetailsPreviewPortrait),children:(0,s.jsx)(eY.F,{onPageChange:F,additionalClasses:{carousel:e2().mobileDetailsCarousel,pageIndicator:e2().mobileDetailsPageIndicator,activePageIndication:e2().mobileDetailsPageIndicatorActive},"data-sentry-element":"Carousel","data-sentry-source-file":"order-components.tsx",children:D.map(e=>(0,s.jsx)("div",{className:e2().mobileDetailsPreviewSlide,children:e.content},e.id))})})}),(0,s.jsxs)("div",{className:e2().mobileDetailsTimeline,children:[(0,s.jsx)("h3",{className:e2().mobileDetailsStatusTitle,children:"Order Status"}),(0,s.jsx)(e5,{order:u,isCompact:!0,"data-sentry-element":"OrderExpandedTimeline","data-sentry-source-file":"order-components.tsx"})]})]}),(0,s.jsxs)("div",{className:e2().mobileDetailsActions,children:[(0,s.jsx)(k._F,{onClick:O,variant:"primary",size:"medium",href:E,children:"Order again"}),(0,s.jsx)(k._F,{variant:"secondary",size:"medium",href:f,"data-sentry-element":"CallToActionLink","data-sentry-source-file":"order-components.tsx",children:"Add reminder"})]}),(0,s.jsxs)("div",{className:e2().mobileDetailsAddressCard,children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"Delivery address"}),g.map(e=>(0,s.jsx)("p",{className:e2().orderItemValue,children:e},e))]}),(0,s.jsxs)("div",{className:e2().mobileDetailsFooter,children:[v&&(0,s.jsxs)("p",{className:e2().mobileDetailsFooterText,children:["You have 30 minutes to"," ",(0,s.jsx)("a",{className:e2().mobileDetailsLink,href:E,onClick:O,children:"edit"})," ","or"," ",(0,s.jsx)("button",{type:"button",className:e2().mobileDetailsLink,onClick:()=>p(u),disabled:h,children:"cancel"})," ","your order."]}),(0,s.jsxs)("p",{className:e2().mobileDetailsFooterText,children:["Still need help?"," ",(0,s.jsx)("a",{className:e2().mobileDetailsLink,href:"mailto:".concat(eX.Q),children:"Contact support"})]})]})]})},tn=e=>{var t,r,a,i,d;let{order:o,setShowMultipleOrder:l,setShowOrderDetailsMobile:c,cancelOrder:m,onThumbnailClick:u}=e,p=null==(t=o.shipments.at(0))?void 0:t.orderedProducts.at(0),h=null==p?void 0:p.themeId,_=null==p||null==(r=p.productImages)?void 0:r.at(0),[x,y]=(0,n.use
1State)(0),{isMobileOrTablet:v}=(0,B.Ln)(),{setEditorDraft:g}=(0,eQ.J)(),[f,b]=(0,eJ.F)("activeDraftId"),{url:j}=(0,eK.C)("front"),{trackEvent:C}=(0,et.z1)(),{orderedDrafts:I}=(0,eZ.x)(),w=I.find(e=>{var t;return null==(t=e.orderIds)?void 0:t.some(e=>e===o.uuid)});(0,n.useEffect)(()=>{x>0&&C("orderStatusViewed",{orderId:o.id})},[x]);let k=[j,w?"":[h?"themeId=".concat(h):"",_?"preOrderedCardImageUrl=".concat(_):"",p?"productHandle=".concat(p.product.handle):"",p?"orientation=".concat(p.orientation.toLowerCase()):""].filter(Boolean).join("&")].filter(Boolean).join("?"),N=(0,te.BS)(o.shipments[0]),T=x===o.id,S=o.shipments.length>1?["Multiple recipients"]:e6(null==(a=o.shipments[0])?void 0:a.address);return v?(0,s.jsx)("section",{className:(0,em.lM)(e2().ordersContainer,e2().ordersContainerMobile),"data-sentry-component":"OrderItem","data-sentry-source-file":"order-components.tsx",children:(0,s.jsxs)("div",{className:e2().orderItemSummary,children:[(0,s.jsxs)("div",{className:(0,em.lM)(e2().orderItemMeta,e2().orderItemMetaMobile),children:[(0,s.jsxs)("div",{className:e2().orderItemField,children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"Status"}),(0,s.jsx)("span",{className:(0,em.lM)(e2().orderItemValue,"cancelled"===N.toLowerCase()&&e2().orderItemStatusCancelled),children:N})]}),(0,s.jsxs)("div",{className:e2().orderItemField,children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"To"}),(0,s.jsx)("span",{className:(0,em.lM)(e2().orderItemValue,e2().orderItemRecipientName),children:e8(o)})]}),(0,s.jsx)("button",{type:"button",className:e2().orderItemNavBtn,onClick:()=>{if(o.shipments.length>1)return void l(o.id);c(o)},"aria-label":"View order details",children:(0,s.jsx)("img",{src:"/assets/icons/chevron-right-dark-teal.svg",alt:"",width:24,height:24})})]}),(0,s.jsx)("hr",{className:e2().orderItemDivider}),(0,s.jsxs)("div",{className:(0,em.lM)(e2().orderItemBody,e2().orderItemBodyMobile),children:[(0,s.jsx)("div",{className:e2().orderItemThumbnail,children:(0,s.jsx)("img",{src:tt(p),alt:"Product Thumbnail",width:95,height:129,className:(0,em.lM)((null==p?void 0:p.orientation.toLowerCase())==="landscape"?e2().isLandscape:e2().isPortrait)})}),(0,s.jsxs)("div",{className:e2().orderItemMobileDetails,children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"Order no. "}),(0,s.jsx)("span",{className:e2().orderItemValue,children:null==(i=o.shipments[0])?void 0:i.serialId})]}),(0,s.jsxs)("p",{className:e2().orderItemMobileCreated,children:["Created ",(0,te.po)(new Date(1e3*o.createdAt))]})]})]})]})},o.id):(0,s.jsx)("section",{className:e2().ordersContainer,children:(0,s.jsxs)("div",{className:(0,em.lM)(e2().orderBody,e2().orderBodyDesktop,T&&e2().orderBodyMore),children:[(0,s.jsxs)("div",{className:e2().orderItemSummary,children:[(0,s.jsxs)("div",{className:e2().orderItemMeta,children:[(0,s.jsxs)("div",{className:e2().orderItemField,children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"Status"}),(0,s.jsx)("span",{className:(0,em.lM)(e2().orderItemValue,"cancelled"===N.toLowerCase()&&e2().orderItemStatusCancelled),children:N})]}),(0,s.jsxs)("div",{className:e2().orderItemField,children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"To"}),(0,s.jsx)("span",{className:(0,em.lM)(e2().orderItemValue,e2().orderItemRecipientName),children:e8(o)})]}),(0,s.jsxs)("div",{className:e2().orderItemField,children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"Order no."}),(0,s.jsx)("span",{className:e2().orderItemValue,children:null==(d=o.shipments[0])?void 0:d.serialId})]}),(0,s.jsxs)("div",{className:e2().orderItemField,children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"Created on"}),(0,s.jsx)("span",{className:e2().orderItemValue,children:(0,te.po)(new Date(1e3*o.createdAt))})]}),(0,s.jsx)("button",{type:"button",className:e2().orderItemExpandBtn,onClick:()=>{if(o.shipments.length>1)return void l(o.id);y(T?0:o.id)},"aria-expanded":T,"aria-label":T?"Collapse order details":"Expand order details",children:(0,s.jsx)("img",{className:(0,em.lM)(T&&e2().rotateImg),src:"/assets/icons/chevron-down-dark-teal.svg",alt:"",width:24,height:24})})]}),(0,s.jsx)("hr",{className:e2().orderItemDivider}),!T&&(0,s.jsxs)("div",{className:e2().orderItemBody,children:[(0,s.jsx)("div",{className:(0,em.lM)(e2().orderItemThumbnail),children:(0,s.jsx)("img",{src:tt(p),alt:"Product Thumbnail",width:95,height:129,className:(0,em.lM)((null==p?void 0:p.orientation.toLowerCase())==="landscape"?e2().isLandscape:e2().isPortrait)})}),(0,s.jsxs)("div",{className:e2().deliveryAddressSection,children:[(0,s.jsx)("span",{className:e2().orderItemLabel,children:"Delivery address"}),S.map(e=>(0,s.jsx)("p",{className:e2().orderItemValue,children:e},e))]})]})]}),T&&1===o.shipments.length&&(0,s.jsx)(e7,{order:o,cancelOrder:m,canCancelOrder:tr(o),showOrderAgain:!0,orderAgainHref:k,onOrderAgainClick:()=>
1{if(f&&b(null),w){let e=(0,eW.hw)(w);b(e.draftID),g(e)}},getThumbnail:tt})]})},o.id)},td=i()(()=>Promise.all([r.e(6119),r.e(9131),r.e(4167),r.e(2271),r.e(8018)]).then(r.bind(r,8018)).then(e=>e.FinalOrderPreviews),{loadableGenerated:{webpack:()=>[8018]},ssr:!1}),to=()=>{let{isMobile:e}=(0,B.Ln)(),{ctx:t}=(0,l._8)(),[r,a]=(0,n.useState)(null),[i,d]=(0,n.useState)(null),{value:o,isLoading:c}=(0,eV.p)("orderId","string"),{refetch:m}=(0,y.IM)(),{data:u,isLoading:p,isFetchingNextPage:h,fetchNextPage:_,hasNextPage:x,refetch:v}=(0,eB.h)(),g=(0,H.r)(),[f,b]=(0,n.useState)(null),[j,C]=(0,n.useState)(),{trackEvent:I}=(0,et.z1)("orderHistoryViewed");(0,n.useEffect)(()=>{c||f||b(Number(o))},[o,c]);let w=(0,n.useMemo)(()=>{var e;return null!=(e=null==u?void 0:u.pages.filter(Boolean).flatMap(e=>e))?e:[]},[null==u?void 0:u.pages]),k=(0,n.useRef)(null),N=async e=>{if(!t||!("userToken"in t)||!e)return!1;let r=e.shipments[0];if(I("orderStatusCancelCard",{orderId:null==r?void 0:r.serialId}),r){let s=await (0,eB.t0)(t,e,r);s&&(v().then(()=>{let{shipment:t}=s,a=[{...t,orderedProducts:r.orderedProducts,shipmentHistory:[...t.shipmentHistory,{status:"Rejected",timestamp:ei()().unix(),tracking:null}]},...e.shipments.filter(e=>e.shipmentId!==r.shipmentId)];j&&C({...j,shipments:a})}),m())}return!1},T=(0,n.useMemo)(()=>{let e=w;if(f){let t=w.find(e=>e.id===f);if(t){let r=[];t.shipments.forEach(e=>{let s={...t};s.shipments=[e],r.push(s)}),e=r}}return e},[f,w]);return((0,n.useEffect)(()=>{let e=k.current;if(!e||j)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&x&&!p&&!h&&_()},{threshold:0,rootMargin:"200px 0px"});return t.observe(e),()=>t.disconnect()},[_,x,h,p,j,T.length]),p)?(0,s.jsxs)("div",{className:e2().loadingContainer,children:[" ",(0,s.jsx)(eR(),{animationData:ez,className:e2().lottie})]}):(0,s.jsxs)("div",{className:e2().orderHistoryContainer,"data-sentry-component":"OrderHistory","data-sentry-source-file":"order-history.tsx",children:[f?(0,s.jsx)("button",{type:"button",className:e2().multipleOrder,onClick:()=>{if(j)return void C(void 0);f&&b(null),o&&g.replace({pathname:window.location.pathname,query:{}})},children:(0,s.jsx)("img",{src:"/assets/icons/chevron-bg-gray-left.png",alt:"icon-left",width:24,height:24})}):(0,s.jsx)(eH.A,{title:"Order history",details:"Here is a list of all your orders, tap one to select it and get more information",desktopIcon:"/assets/icons/orders.svg",showMobileIcon:e||!!j,showDesktopIcon:!e&&!j,showDetail
1s:!e&&!j,onMobileIconClick:()=>{j?C(void 0):g.back()}}),(0,s.jsx)(td,{type:i,onClose:()=>d(null),order:r,"data-sentry-element":"FinalOrderPreviews","data-sentry-source-file":"order-history.tsx"}),j?(0,s.jsx)(ti,{order:j,cancelOrder:N,disableCTAs:p}):(0,s.jsx)(s.Fragment,{children:(null==T?void 0:T.length)?(0,s.jsxs)(s.Fragment,{children:[T.map((e,t)=>(0,s.jsx)(tn,{order:e,cancelOrder:N,setShowMultipleOrder:b,setShowOrderDetailsMobile:e=>{C(e)},onThumbnailClick:()=>{a(e),d("front")}},"".concat(e.uuid,"-").concat(t))),h&&!f&&(0,s.jsx)(ta,{}),(0,s.jsx)("div",{ref:k,className:e2().infiniteScrollSentinel,"aria-hidden":!0})]}):(0,s.jsx)(ts,{})})]})};var tl=r(32021),tc=r(80133),tm=r(84281),tu=r(19844),tp=r.n(tu),th=r(16730),t_=r(84961),tx=r(51236),ty=r.n(tx);let tv=e=>(0,s.jsxs)("div",{className:ty().remindersHeadingContainer,"data-sentry-component":"RemindersHeading","data-sentry-source-file":"reminders-heading.tsx",children:[(null==e?void 0:e.displayBackButton)&&(0,s.jsx)(t_.b,{onClick:e.onBackButtonClick}),e.displayReminderIcon&&(0,s.jsx)("img",{src:"/assets/icons/reminders.svg",alt:"reminder icon",width:32,height:32,className:ty().reminderIcon}),e.displayHeadingText&&(0,s.jsx)("span",{className:ty().heading,children:"Reminders"})]});var tg=r(44763),tf=r(31667),tb=r(98682),tj=r.n(tb);let tC=e=>{let{trackEvent:t}=(0,et.z1)(),[,r]=(0,eJ.F)("recipientAddressId"),{data:a}=(0,E._c)();return e.remindersFound?(0,s.jsx)("div",{className:tj().remindersList,"data-sentry-component":"RemindersList","data-sentry-source-file":"reminders-list.tsx",children:Object.entries(e.reminders).map(i=>{let[n,d]=i;return(0,s.jsx)("div",{className:tj().listItem,children:(0,s.jsx)(tg.n,{defaultState:!!d.length,button:n,iconSrc:"/assets/icons/chevron-down-dark-teal.svg",additionalClassNames:{accordionButton:tj().monthAccordion,innerContent:tj().accordionHeading,expandIcon:tj().expandIcon,expandedContent:tj().reminderContents},children:(0,s.jsx)("ul",{className:tj().reminders,children:d.map(i=>(0,s.jsx)("li",{className:tj().reminderItemContainer,children:(0,s.jsx)(tf.U,{reminder:i,onSend:()=>{r(i.addressId),t("createNewCardTapped",{origin:"remindersCalendarSend"})},onEdit:t=>{e.setEditReminder(t);let r=null==a?void 0:a.find(e=>e.addressId===t.addressId);r&&e.setReminderAddress(r)}})},i.nextReminderDate))})})},n)})}):(0,s.jsx)(tm.T,{heading:"No reminder found",subHeading:(0,s.jsxs)(s.Fragment,{children:["Set reminders and never ",(0,s.jsx)("br",{})," forget to send a card"]}),addEntity:"address",onAdd:()=>{t(tc.zv,{origin:tl.rq}),e.onAddNewAddress()},"data-sentry-element":"NoReminderEntity","data-sentry-component":"RemindersList","data-sentry-source-file":"reminders-list.tsx"})};var tI=r(31328),tw=r(38582),tk=r.n(tw);let tN=e=>{let{trackEvent:t}=(0,et.z1)();return(0,s.jsxs)("section",{"data-sentry-component":"RemindersListTopSection","data-sentry-source-file":"reminders-list-top-section.tsx",children:[(0,s.jsx)("p",{className:tk().subTitle,children:"Here is a list of all your reminders, tap one to select it and send a card!"}),(0,s.jsx)("input",{className:tk().searchBar,type:"text",placeholder:"Start typing to search for a reminder",value:e.searchTerm,onChange:t=>e.onSearch(t.target.value)}),!e.searchTerm&&(0,s.jsx)(tI.f,{entity:"reminder",onClick:()=>{t(tc.PY,{origin:tl.rq}),e.onAddReminder()}})]})};var tT=r(54019),tS=r(26619);let tM=()=>{let{ctx:e}=(0,l._8)(),{isMobile:t}=(0,B.Ln)(),{trackEvent:r}=(0,et.z1)(),a=(0,H.r)(),{data:i,refetch:d}=(0,E._c)(),[o,c]=(0,n.useState)(""),[m,u]=(0,n.useState)(),[p,h]=(0,n.useState)(!1),[_,x]=(0,n.useState)(null),[y,v]=(0,n.use
1State)(null),[g,f]=(0,n.useState)(null),[b,j]=(0,n.useState)(!1),{reminders:C,totalReminders:I}=(0,n.useMemo)(()=>(0,th.d_)(i),[i]),{value:w,isLoading:k}=(0,eV.p)("showAddressBook","boolean"),{value:N,isLoading:T}=(0,eV.p)("eventOrigin","string");(0,n.useEffect)(()=>{k||m||u(!0===w)},[w,k,m]),(0,n.useEffect)(()=>{T||r("remindersCalendarViewed",{origin:null!=N?N:"accountSection"})},[N,T]);let{value:S,isLoading:M}=(0,eV.p)("eventMonth","string"),{value:L,isLoading:A}=(0,eV.p)("eventId","string"),{value:D,isLoading:P}=(0,eV.p)("preSelectedRecipientAddressId","string");(0,n.useEffect)(()=>{var e;if(A||M||g)return;let t=S&&(null==(e=C[S])?void 0:e.find(e=>e.eventId===L));if(t){f(t);let e=null==i?void 0:i.find(e=>(null==e?void 0:e.addressId)===t.addressId);x(null!=e?e:null)}},[L,A,S,M,C]),(0,n.useEffect)(()=>{if(P||!D||!i||_||g)return;let e=i.find(e=>e.addressId===D);e&&x(e)},[D,P,i,_,g]);let F=Object.fromEntries(Object.entries(C).map(e=>{let[t,r]=e;return[t,(0,th._w)(r,o,["firstName","lastName","type"])]})),U=e=>{let{address:t,reminderRequest:r,deleteEventId:s}=e;return{operations:[{op:"replace",path:"/recipientEvents",value:t&&r?[...(null==r?void 0:r.eventId)?t.recipientEvents.filter(e=>e.eventId!==r.eventId):t.recipientEvents,r]:t&&s?[...t.recipientEvents.filter(e=>e.eventId!==s)]:[...t.recipientEvents]}]}},O=()=>{d(),v(null),x(null),u(!1),f(null)},R=async t=>{e&&"userToken"in e&&_&&(await (0,E.nW)(e,_.addressId,U({address:_,reminderRequest:t}))).address&&(t.eventId||r("eventReminderAdded",{eventType:t.type}),r("reminderAdded",{eventType:t.type}),j(!0),O())},V=async t=>{e&&"userToken"in e&&_&&(await (0,E.nW)(e,_.addressId,U({address:_,deleteEventId:t}))).address&&O()},z=I>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tN,{searchTerm:o,onSearch:c,onAddReminder:()=>u(!0)}),(0,s.jsx)(tC,{remindersFound:!o||Object.values(F).some(e=>e.length),reminders:F,setEditReminder:f,setReminderAddress:x,onAddNewAddress:()=>u(!0)})]}):(0,s.jsx)(tm.T,{heading:"Add your first reminder",subHeading:(0,s.jsxs)(s.Fragment,{children:["Add a reminder to never forget an ",(0,s.jsx)("br",{})," important event coming up!"]}),addEntity:"reminder",onAdd:()=>{r(tc.PY,{origin:tl.rq}),u(!0)}});m&&!g&&(z=(0,s.jsx)(q.A,{setReminderAddress:e=>x(e),onFormVisibilityToggle:()=>h(e=>!e),isReminderScreen:!0})),_&&!g&&(z=(0,s.jsx)(tS.A,{onOccasionClick:v,eventOrigin:null!=N?N:tl.rq})),(y||g)&&_&&(z=(0,s.jsx)(tT.v,{reminder:g,address:_,type:y,onSave:R,onDelete:V,origin:"account"}));let Y=[y,_,m,g].some(e=>e);return(0,s.jsxs)("div",{className:tp().remindersContainer,"data-sentry-component":"Reminders","data-sentry-source-file":"reminders.tsx",children:[(0,s.jsx)(tv,{onBackButtonClick:()=>{if((y||g)&&_)return void(g?(f(null),x(null),(L||S)&&a.replace({pathname:window.location.pathname,query:{}})):v(null));if(_&&!g){x(null),D&&a.replace({pathname:window.location.pathname,query:{}});return}if(m&&!g){u(!1),w&&a.replace({pathname:window.location.pathname,query:{}});return}a.back()},displayBackButton:(Y||!!t)&&!p,displayReminderIcon:(!Y||!t)&&!p,displayHeadingText:(!Y||!!t)&&!p,"data-sentry-element":"RemindersHeading","data-sentry-source-file":"reminders.tsx"}),z,(0,s.jsx)(eo.R,{modalTitle:"Reminder saved",text:"All set! Your reminder has been successfully saved.",modalIcon:"/assets/icons/green-tick.svg",isOpen:b,onConfirm:()=>{j(!1)},confirmCTAText:"Thanks!","data-sentry-element":"ConfirmationModal","data-sentry-source-file":"reminders.tsx"})]})},tE=i()(()=>Promise.all([r.e(35),r.e(683),r.e(1768),r.e(313),r.e(5859),r.e(4924)]).then(r.bind(r,96045)).then(e=>e.SavedDrafts),{loadableGenerated:{webpack:()=>[96045]},ssr:!1});var tL=!0;let tA=e=>{let{layout:t,item:r,creditsModel:a}=e,{requestContextState:i}=(0,l._8)(),[_,x]=(0,n.useState)(!1),{locale:y}=(0,m.Y)(),v=r.split("-").map(e=>(0,p.Zn)(e)).join(" "),g=(0,s.jsx)(c.G,{title:(0,u.bh)(y,[v,"Account"]),noIndex:!0,noFollow:!0});return"user"===i||_?(0,s.jsxs)(s.Fragment,{children:[g,(0,s.jsxs)(o.P,{data:t,bottomMargin:!1,"data-sentry-element":"Layout","data-sentry-source-file":"index.page.tsx",children:[(0,s.jsxs)("div",{className:G().container,children:[(0,s.jsx)("div",{className:G().sidebar,children:(0,s.jsx)(h.U,{openLogoutModal:()=>x(!0),activeItem:r,"data-sentry-element":"AccountSidebar","data-sentry-source-file":"index.page.tsx"})}),(0,s.jsx)("div",{className:G().itemContainer,children:(()=>{switch(r){case"details":return(0,s.jsx)(Y,{});case"orders":return(0,s.jsx)(to,{});case"drafts":return(0,s.jsx)(tE,{});case"payment-methods":default:return null;case"address-book":return(0,s.jsx)(q.A,{isAccountsScreen:!0});case"reminders":return(0,s.jsx)(tM,{});
1case"buy-credits":return(0,s.jsx)(J.L,{creditsModel:a});case"membership":return(0,s.jsx)(eF,{})}})()})]}),_&&(0,s.jsx)(Q.i,{isOpen:_,closeModal:()=>x(!1)})]})]}):(0,s.jsxs)(s.Fragment,{children:[g,(0,s.jsx)(o.P,{data:t,bottomMargin:!1,children:(0,s.jsx)(d.O,{isOpen:!0,closeModal:()=>{},onComplete:()=>{}})})]})}},58935:(e,t,r)=>{"use strict";r.d(t,{N:()=>o,g:()=>d});var s=r(37876),a=r(45321),i=r(9911),n=r(22093);let d=(e,t)=>{var r,d,o,l,c,m,u,p;let h=null!=t?t:null==(r=e.shipments.at(0))?void 0:r.address,_=null==(d=e.shipments.at(0))?void 0:d.orderedProducts.at(0),x=null==_||null==(o=_.product)?void 0:o.handle,y=null==_?void 0:_.orientation.toLowerCase(),v=null==_?void 0:_.productImages.at(0),g=null==_?void 0:_.orderMessageImageUrl,f=null==_?void 0:_.additionalImages,b=null==_||null==(l=_.geolocation)?void 0:l.mapCaption;if(!x||!y||!v)return null;let j={productHandle:x.includes("PC")?"PC":"GC",orientation:y,renderedImageURL:v,...(null==f?void 0:f.stampUrl)?{stampUrl:f.stampUrl}:{},...(null==f?void 0:f.mapUrl)?{map:{type:"map",mapUrl:f.mapUrl,...b?{mapCaption:b}:{}}}:{},recipients:[{recipientAddressId:null!=(u=null==h?void 0:h.addressId)?u:null,messages:[null!=(p=null==_||null==(m=_.orderMessage)||null==(c=m.at(0))?void 0:c.text)?p:""],renderedMessageUrl:g}]},C=h&&g?j.productHandle.includes("PC")?(0,s.jsx)(n.R,{draft:j,address:h,displayMode:"preview",renderMessageAsImage:!0,selectedRecipientAddressId:h.addressId}):(0,s.jsx)(i.A,{draft:j,displayMode:"preview",renderMessageAsImage:!0,selectedRecipientAddressId:h.addressId}):null,I=h&&j.productHandle.includes("GC")?(0,s.jsx)(a.U,{address:h}):null;return{editorDraft:j,backOfCardPreview:C,envelopPreviewGC:I}},o=(e,t)=>{var r,d;let o=t?e.recipients.find(e=>e.recipientAddressId===t.addressId):e.recipients.at(0),l=null!=(d=null!=(r=null==t?void 0:t.addressId)?r:null==o?void 0:o.recipientAddressId)?d:null;return{backOfCardPreview:t&&(null==o?void 0:o.renderedMessageUrl)?"PC"===e.productHandle?(0,s.jsx)(n.R,{draft:e,address:t,displayMode:"preview",renderMessageAsImage:!0,selectedRecipientAddressId:l}):(0,s.jsx)(i.A,{draft:e,displayMode:"preview",renderMessageAsImage:!0,selectedRecipientAddressId:l}):null,envelopPreviewGC:t&&"GC"===e.productHandle?(0,s.jsx)(a.U,{address:t}):null}}},60603:(e,t,r)=>{"use strict";r.d(t,{p:()=>d});var s=r(79801),a=r(87669),i=r(59144),n=r(6926);let d=(e,t)=>{var r,d,o;switch(t.type){case"switch_product_type":e.productHandle=t.productType;break;case"set_rendered_image":e.renderedImageURL=t.imageUrl;break;case"set_rendered_image_thumbnail":e.renderedImageThumbnailURL=t.imageUrl;break;case"toggle_orientation":e.orientation="portrait"===e.orientation?"landscape":"portrait";break;case"set_stamp":e.stampUrl=t.stampUrl;break;case"set_map":e.map=t.map;break;case"set_order_message":{let r=e.recipients.find(e=>e.recipientAddressId===t.recipientAddressId);if(!r)return;r.messages[t.index]=t.orderMessage,r.renderedMessageUrl=void 0;break}case"switch_text_layout":{e.textLayoutHandle=t.textLayoutHandle;let s=(0,a.T5)(t.textLayoutHandle),i=null!=(r=s.textFields.findIndex(e=>"main"===e.type))?r:0,d=s.textFields[i];if(!d)return;e.fontAlignment=d.horizontalAlign,e.recipients.forEach(e=>{let r=(0,n.xK)(e.messages);if(r){e.messages=s.textFields.map(()=>""),e.messages[i]=r;return}e.messages=s.textFields.map(r=>{switch(r.type){case"greeting":return"Dear";case"recipient":var s,a,i;return null!=(i=null==(a=t.addresses.find(t=>t.addressId===e.recipientAddressId))||null==(s=a.firstName)?void 0:s.split(" ")[0])?i:"";case"sender":return"From ".concat(t.sender);default:return""}})});break}case"set_font_id":e.fontId=t.fontId,(0,s.p)(t.fontId).supportedWeights.some(t=>t===e.fontWeight)||(e.fontWeight=400);break;case"set_font_weight":e.fontWeight=t.fontWeight;break;case"set_font_color":e.fontColor=t.fontColor;break;case"set_font_alignment":e.fontAlignment=t.fontAlignment;break;case"set_viewport_image":if(t.replaceUrlOnly){let r=e.imageData[t.index];if(!r||r.imageURL===t.imageUrl)return;if(void 0!==t.expectedOldUrl&&String(r.imageURL).trim()!==String(t.expectedOldUrl).trim())return;r.imageURL=t.imageUrl;break}if((null==(d=e.imageData[t.index])?void 0:d.imageURL)===t.imageUrl)return;e.imageData[t.index]=(0,n.jB)(t.imageUrl,!1,t.illustrationId);break;case"swap_viewports":{let r=e.imageData[t.viewportAIndex],s=e.imageData[t.viewportBIndex];e.imageData[t.viewportAIndex]=s,e.imageData[t.viewportBIndex]=r;break}case"set_viewport_image_position":{let r=e.imageData[t.index];if(!r)return;r.x=t.x,r.y=t.y;break}case"set_viewport_image_size":{let r=e.imageData[t.index];if(!r)return;r.width=t.width,r.height=t.height;break}case"increment_viewport_image_zoom":{let r=e.imageData[t.index],s=t.template.viewports[t.index];if(!r||!s)return;let a=r.zoom+t.zoomIncrement;r.zoom=Math.max(Math.min(a,2.5),1);break}case"rotate_image":{let r=e.imageData[t.index],s=t.template.viewports[t.index];if(!r||!s)return;let a=(r.rotate+t.rotate)%360;r.rotate=a;break}case"set_editor_template":e.templateHandle=t.template;break;case"set_message_image":{let r=e.recipients.find(e=>e.recipientAddressId===t.recipientAddressId);if(!r)throw Error("Unexpected");r.renderedMessageUrl=t.messageImageUrl;break}case"set_caption_text":e.captionText=t.captionText;break;case"remove_viewport_image":if(!e.imageData[t.index])return;e.imageData[t.index]=void 0,t.unlockFrontIfLocked&&e.lockFrontOfCard&&(e.lockFrontOfCard=!1);break;case"set_flow_metadata":e.flowMetadata=t.metadata;break;case"add_image_sticker":e.stickers.push({id:t.id,x:.5,y:.5,scale:1,rotation:0,type:"image_sticker",stickerUrl:t.stickerImageUrl,width:null,height:null,stickerId:t.stickerId});break;case"add_text_sticker":e.stickers.push({...i.En,id:t.id});break;case"set_text_sticker_text":{let r=e.stickers.find(e=>e.id===t.id);if(!r||"text_sticker"!==r.type)return;r.text=t.text;break}case"set_text_sticker_font_id":{let r=e.stickers.find(e=>e.id===t.id);if(!r||"text_sticker"!==r.type)return;r.fontId=t.fontId;break}case"set_text_sticker_color":{let r=e.stickers.find(e=>e.id===t.id);if(!r||"text_sticker"!==r.type)return;r.color=t.color;break}case"set_text_sticker_alignment":{let r=e.stickers.find(e=>e.id===t.id);if(!r||"text_sticker"!==r.type)return;r.fontAlignment=t.alignment;break}case"set_sticker_size":{let r=e.stickers.find(e=>e.id===t.id);if(!r)return;r.width=t.width,r.height=t.height;break}case"set_sticker_position":{let r=e.stickers.find(e=>e.id===t.id);if(!r)return;r.x=t.x,r.y=t.y;break}case"set_sticker_rotation":{let r=e.stickers.find(e=>e.id===t.id);if(!r)return;r.rotation=t.rotation;break}case"set_sticker_scale":{let r=e.stickers.find(e=>e.id===t.id);if(!r)return;r.scale=t.scale;break}case"remove_sticker":e.stickers=e.stickers.filter(e=>e.id!==t.id);break;case"remove_all_stickers":e.stickers=[];break;case"bring_sticker_to_top":{let r=e.stickers.findIndex(e=>e.id===t.id);if(r<0)return;let s=e.stickers.splice(r,1)[0];if(!s)return;e.stickers.push(s);break}case"set_order_ids":e.orderIds=(null!=(o=e.orderIds)?o:[]).concat(t.orderId);break;case"set_recipient_address_ids":{let r=e.recipients[0];if(!r)throw Error("Unexpected state");e.recipients=e.recipients.filter(e=>{var r;return t.recipientAddressIds.includes(null!=(r=e.recipientAddressId)?r:"")});let s=t.recipientAddressIds.filter(t=>!e.recipients.some(e=>e.recipientAddressId===t)),a=t.copyMessage?r.messages:[""];e.recipients.push(...s.map(e=>({messages:a,recipientAddressId:e,renderedMessageUrl:r.renderedMessageUrl,quantity:1})));let i=e.recipients[0];i?i.messages=r.messages:e.recipients[0]={...r,recipientAddressId:null};break}case"add_local_recipient":null!=e.localRecipients||(e.localRecipients=[]),e.localRecipients.push(t.recipient);break;
1case"replace_local_recipient_address_ids":e.recipients.forEach(e=>{let r=e.recipientAddressId;r&&t.addressIdsByLocalId[r]&&(e.recipientAddressId=t.addressIdsByLocalId[r])});break;case"clear_local_recipients":e.localRecipients=[];break;case"set_sts_quantity":e.stsQuantity=t.quantity;break;case"set_gift_id":e.giftId=t.giftId;break;case"set_pdp_credit_upsell_bundle_id":e.pdpCreditUpsellBundleId=t.bundleId;break;default:throw Error("Unknown action")}}},61447:e=>{e.exports={header:"detached-header_header__MoeYl",title:"detached-header_title__u_ogp",details:"detached-header_details__myFKJ"}},62318:e=>{e.exports={container:"account-item_container__0I1Fx",sidebar:"account-item_sidebar__5yuVj",itemContainer:"account-item_itemContainer__T9jnT"}},64929:e=>{e.exports={container:"greeting-card-envelope-preview_container__JW_dP",text:"greeting-card-envelope-preview_text__ZWcH2"}},69403:(e,t,r)=>{"use strict";r.d(t,{i:()=>m});var s=r(37876),a=r(70609),i=r(17825),n=r(86189),d=r(41591),o=r(96937),l=r(37556),c=r.n(l);let m=e=>{let{isOpen:t,closeModal:r}=e,{logOut:l}=(0,n._8)(),{unOrderedDrafts:m}=(0,o.x)(),{isMobileOrTablet:u}=(0,d.Ln)(),p=!1===u&&!!m.length;return(0,s.jsxs)(i.a,{className:c().logoutModal,isOpen:t,closeModal:r,"data-sentry-element":"Modal","data-sentry-component":"AccountLogout","data-sentry-source-file":"account-logout.tsx",children:[(0,s.jsx)("h3",{className:c().logoutTitle,children:p?"You have ".concat(m.length," unsent drafts"):"Logout"}),(0,s.jsxs)("p",{className:c().logoutMessage,children:[p&&"If you log out, they will be deleted."," ","Are you sure you want to logout?"]}),(0,s.jsxs)("div",{className:c().logoutButtons,children:[(0,s.jsx)(a.oG,{onClick:r,variant:"secondary",size:"large","data-sentry-element":"CallToActionButton","data-sentry-source-file":"account-logout.tsx",children:"Cancel"}),(0,s.jsx)(a.oG,{onClick:()=>{l()},variant:"primary",size:"large","data-sentry-element":"CallToActionButton","data-sentry-source-file":"account-logout.tsx",children:"Logout"})]})]})}},69772:e=>{e.exports={banner:"success-banner_banner__Exuzw"}},70093:e=>{e.exports={container:"card-front_container__bFeqL"}},73490:(e,t,r)=>{"use strict";r.d(t,{V6:()=>l,Iw:()=>d});var s=r(18334),a=r(91423),i=r(65534),n=r(6926);let d=/^https:\/\/infra-app-cdn-images(?:-[a-zA-Z0-9]+)?\.s3\.eu-west-1\.amazonaws\.com\/.*$/,o=async(e,t,r,d,o)=>{let l=await fetch(t),c=await l.blob(),m=(0,a.A)(),u=c.type.split("/")[1];m+=".".concat(u);try{let t,{uploadUrls:s}=await (t={images:[(0,n.w8)(m,r,o)]},(0,i.Em)(e,{path:"/image-upload",method:"POST",body:t,apiVersion:"v1"})),{url:a,thumbnail:l}=s.find(e=>e.type===r)||{};if(a){let e=await fetch(a,{method:"PUT",headers:{"Content-Type":"image/".concat(u),...d?{"x-amz-meta-user_uuid":d}:{},...(null==o?void 0:o.orientation)?{"x-amz-meta-orientation":o.orientation}:{}},body:c});if(200===e.status){var p;return{imageURL:null!=(p=e.url.split("?").at(0))?p:"",thumbnailURL:null!=l?l:""}}throw Error("S3 upload failed - response not 200")}throw Error("S3 upload failed - no presigned upload url")}catch(e){throw(0,s.Cp)(e,{tags:{feature:"s3_upload_failed"},extra:{type:r,userId:d,metadata:o}}),e}},l=(e,t,r,s,a)=>o(e,t,r,s,a)},73980:e=>{e.exports={accountDetailContainer:"account-details_accountDetailContainer__l9EgC",formsContainer:"account-details_formsContainer__mqrlT",title:"account-details_title__vOKQy",subTitle:"account-details_subTitle__HkRFi"}},74642:(e,t,r)=>{"use strict";r.d(t,{N$:()=>a,Sh:()=>i,sU:()=>n});let s={checkout:"checkout"},a={signInWeb:"signInWeb",signUpWeb:"signUpWeb",simpleLogin:"simpleLogin",ccfLocalDeliveryDetails:"ccfLocalDeliveryDetails"},i={existing:"existing",new:"new"},n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{origin:s.checkout,...e}}},76708:(e,t,r)=>{"use strict";r.d(t,{G:()=>s});let s="5f78bb98-8359-49f5-8799-b9de4520ebc1"},81350:e=>{e.exports={backButton:"chevron-back-button_backButton__sKLIt",chevronIcon:"chevron-back-button_chevronIcon__9FhGp"}},81530:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[locale]/account/[item]",function(){return r(55909)}])},84408:(e,t,r)=>{"use strict";r.d(t,{i:()=>a});var s=r(85283);let a=(e,t)=>"".concat(e," ").concat((0,s.yf)(t).format("dddd Do MMMM"))},84961:(e,t,r)=>{"use strict";r.d(t,{b:()=>n});var s=r(37876);r(14232);var a=r(81350),i=r.n(a);let n=e=>(0,s.jsx)("button",{type:"button","aria-label":"Back",className:i().backButton,onClick:e.onClick,"data-sentry-component":"ChevronBackButton","data-sentry-source-file":"chevron-back-button.tsx",children:(0,s.jsx)("img",{src:"/assets/icons/chevron-bg-gray-left.png",alt:"icon-left",width:24,height:24,className:i().chevronIcon})})},87144:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(37876);r(14232);var a=r(61447),i=r.n(a);let n=e=>{let{title:t,details:r,desktopIcon:a,showMobileIcon:n,showDesktopIcon:d,showDetail
1s:o,onMobileIconClick:l=()=>{}}=e;return(0,s.jsxs)("header",{className:i().header,"data-sentry-component":"DetachedHeader","data-sentry-source-file":"detached-header.tsx",children:[(0,s.jsxs)("h2",{className:i().title,children:[n&&(0,s.jsx)("button",{type:"button",onClick:l,children:(0,s.jsx)("img",{src:"/assets/icons/chevron-bg-gray-left.png",alt:"icon-left",width:24,height:24})}),d&&(0,s.jsx)("img",{src:a,alt:"".concat(t.toLowerCase()," icon"),width:32,height:32}),t]}),o&&(0,s.jsx)("p",{className:i().details,children:r})]})}},87240:(e,t,r)=>{"use strict";r.d(t,{d:()=>d});var s=r(37876),a=r(11079),i=r(18855),n=r.n(i);let d=e=>{var t;let{numberOfPages:r,currentPage:i,className:d,onPageClick:o,additionalClasses:l}=e,c=null!=(t=null==l?void 0:l.activePageIndication)?t:n().active;return(0,s.jsx)("div",{className:(0,a.lM)(n().pageIndicator,d),"data-sentry-component":"PageIndicator","data-sentry-source-file":"page-indicator.tsx",children:Array.from({length:r}).map((e,t)=>o?(0,s.jsx)("button",{type:"button",onClick:()=>o(t),className:(0,a.lM)(n().circle,t===i&&c)},t):(0,s.jsx)("span",{className:(0,a.lM)(n().circle,t===i&&c)},t))})}},89555:(e,t,r)=>{"use strict";r.d(t,{G:()=>d});var s=r(37876),a=r(37683),i=r(69772),n=r.n(i);let d=()=>(0,s.jsx)(a.l,{className:n().banner,duration:3e3,successBanner:!0,icon:(0,s.jsx)("img",{src:"/assets/icons/check-teal.svg",width:24,height:24,alt:"banner icon"}),backgroundColor:"#DFF8E2",textColor:"#000000","data-sentry-element":"Banner","data-sentry-component":"SuccessBanner","data-sentry-source-file":"success-banner.tsx",children:"Changes Saved"})},93575:e=>{e.exports={previewSelectors:"preview-selectors_previewSelectors___8Ow6",previewSelector:"preview-selectors_previewSelector__JqOWt",isSelected:"preview-selectors_isSelected__dOm5X",expandWidth:"preview-selectors_expandWidth__7UREq",expandHeight:"preview-selectors_expandHeight__X1RAz"}},94248:(e,t,r)=>{"use strict";r.d(t,{l:()=>d});var s=r(37876),a=r(11079),i=r(93575),n=r.n(i);let d=e=>{let{items:t,selectedId:r,onSelect:i,className:d}=e;return(0,s.jsx)("div",{className:(0,a.lM)(n().previewSelectors,d),"data-sentry-component":"PreviewSelectors","data-sentry-source-file":"preview-selectors.tsx",children:t.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>i(e.id),"aria-label":e.ariaLabel,"aria-pressed":r===e.id,className:(0,a.lM)(n().previewSelector,r===e.id&&n().isSelected,e.expandWidth&&n().expandWidth,e.expandHeight&&n().expandHeight),children:e.content},e.id))})}},96937:(e,t,r)=>{"use strict";r.d(t,{x:()=>i});var s=r(14232),a=r(78258);let i=()=>{let[e,t]=(0,a.M)("editorDrafts"),[r,i]=(0,s.useState)([]),[n,d]=(0,s.useState)([]);return(0,s.useEffect)(()=>{i(e.filter(e=>{var t;return null==(t=e.orderIds)?void 0:t.length})),d(e.filter(e=>{var t;return!(null==(t=e.orderIds)?void 0:t.length)}))},[]),{orderedDrafts:r,unOrderedDrafts:n,deleteEditorDraft:r=>{let s=[...e].filter(e=>e.draftID!==r);t(s),d(s.filter(e=>{var t;return!(null==(t=e.orderIds)?void 0:t.length)}))}}}},98682:e=>{e.exports={remindersList:"reminders-list_remindersList__UU9Xk",listItem:"reminders-list_listItem__MQRc4",accordionHeading:"reminders-list_accordionHeading__KMgzU",monthAccordion:"reminders-list_monthAccordion__Vmryr",expandIcon:"reminders-list_expandIcon__vQwR7",reminderContents:"reminders-list_reminderContents__CghZw",reminders:"reminders-list_reminders__P6_oG",reminderItemContainer:"reminders-list_reminderItemContainer__nPVj1"}}},e=>{e.O(0,[7366,4609,9313,8144,787,6741,6926,216,999,2618,88,1795,3970,9500,9131,636,6593,8792],()=>e(e.s=81530)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.