PageSourceSearch

https://www.popeyeschicken.ch/static/js/5921.17d4cbc6.chunk.js

js popeyeschicken.ch collected 2026-09-25 10:34:02 UTC 100,961 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[5921],{39637:(e,t,r)=>{r.d(t,{A:()=>o});var n,i=r(59284);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(null,arguments)}const d=(e,t)=>i.createElement("svg",a({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{verticalAlign:"middle"},ref:t},e),n||(n=i.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12C2 17.53 6.47 22 12 22C17.53 22 22 17.53 22 12C22 6.47 17.53 2 12 2ZM17 15.59L15.59 17L12 13.41L8.41 17L7 15.59L10.59 12L7 8.41L8.41 7L12 10.59L15.59 7L17 8.41L13.41 12L17 15.59Z",fill:"currentColor"}))),o=(0,i.forwardRef)(d)},40788:(e,t,r)=>{r.d(t,{p:()=>d});var n=r(59284),i=r(3499),a=r(90536);const d=e=>{var t;let r=e.rbiOrderId,d=e.posVendor,o=e.serviceMode;const s=(0,a.Zt)().attemptGetUpdatedLdFlag,l=(0,n.useState)(!1),c=l[0],u=l[1],m=(0,n.useState)(!1),g=m[0],p=m[1],v=(0,a._P)(a.N$.ENABLE_PROGRESS_BAR_ON_PICKUP_ORDER_CONFIRMATION_V02);(0,n.useEffect)((()=>{(async()=>{let e=v;try{e=await s(a.N$.ENABLE_PROGRESS_BAR_ON_PICKUP_ORDER_CONFIRMATION_V02,{custom:{storePosVendor:d,serviceMode:o}},v)}finally{u(e)}})()}),[d,o,v]);const h=(0,i.ZPm)({variables:{rbiOrderId:r||"",handleCommitError:!1},skip:!r}),f=h.data,x=h.startPolling,y=h.stopPolling,C=(null==f||null==(t=f.order)||null==(t=t.order)?void 0:t.status)||"",I=(0,n.useCallback)((()=>c&&r&&!g),[c,r,g]),b=(0,n.useCallback)((()=>g&&(!c||!r)),[g,c,r]),w=(0,n.useCallback)((()=>{I()&&(p(!0),x(1e4))}),[I,x]),E=(0,n.useCallback)((()=>{p(!1),y()}),[y]);return(0,n.useEffect)((()=>{I()&&w(),b()&&E()}),[I,b,w,E]),{isProgressBarEnabled:c,orderStatus:C,isPolling:g,startPolling:w,stopPolling:E}}},45921:(e,t,r)=>{r.r(t),r.d(t,{AccountOrders:()=>ui});var n=r(59284),i=r(48681),a=r(41657),d=r(96290),o=r(90182),s=r(20147),l=r(24822),c=r(10364),u=r(358),m=r(84159),g=r(61372),p=r(6308),v=r(94390),h=r(69886),f=r(53683),x=r(60712);const y=(0,s.Ay)(f.rA).withConfig({componentId:"sc-11xl8we-0"})(["background-color:",";"],(e=>e.theme.primaryBackground)),C=e=>{let t=e.children,r=e.onClick;return(0,x.jsx)(h.a,{"data-testid":"refresh-button-refresh-button-Box",center:!0,width:"100%",margin:"1rem auto",children:(0,x.jsx)(y,{"data-testid":"refresh-button-refresh-button-StyledActionButton",variant:f.Vs.OUTLINE,onClick:r,startIcon:(0,x.jsx)(v.I,{"data-testid":"refresh-button-refresh-button-Icon",icon:"refresh",color:"primary","aria-hidden":!0}),children:t})})};var I=r(99533),b=r(40937),w=r(67545),E=r(59011),j=r(29139),k=r(56770),O=r(30279),A=r(90536),R=r(42147),D=r(84662),S=r(39089),T=r(39815);var P=r(63246),M=r(5608),L=r.n(M),N=r(73162),_=r(18659),F=r(70222),V=r(4029),$=r(19193),B=r(18267),U=r(35898),z=r(16734),W=r(43033);const H=e=>{let t=e.order,r=e.loading,n=e.disabled,i=e.onTrack,a=e.onReorder,o=e.onFinish;const s=(0,d.A)().formatMessage,l=(0,B.f)();return(()=>{const e=t.delivery,r=t.cart;if(!e)return!1;const n=r.serviceMode===R.h1.DELIVERY,i=new Set([W.ni.ORDER_CANCELLED,W.ni.ORDER_ABANDONED,W.ni.ORDER_DROPPED_OFF]);return n&&!i.has(e.status)})()?(0,x.jsx)(f.rA,{fullWidth:!0,"data-testid":"track-order-button",onClick:i,children:s({id:"trackOrder"})}):(()=>{const e=t.status,r=t.cart,n=t.createdAt,i=t.fireOrderIn,a=new Set([R.h1.TAKEOUT,R.h1.CURBSIDE]),d=!!i&&(0,z.A)(new Date(n),i)>new Date;return a.has(r.serviceMode)&&d&&e===W.Re.INSERT_SUCCESSFUL})()?(0,x.jsx)(f.rA,{fullWidth:!0,"data-testid":"finish-order-button",onClick:o,disabled:n,children:s({id:"finishOrder"})}):(0,x.jsx)(f.rA,{fullWidth:!0,"data-testid":"reorder-button",onClick:a,isLoading:r,disabled:n,"aria-label":l({buttonType:"reorder",order:t}),children:s({id:"reorder"})})},q=()=>null;var G=r(73432),Z=r(68356).P;const Y=s.Ay.div.withConfig({componentId:"sc-gupx60-0"})(["align-items:center;display:flex;flex-direction:column;text-align:center;width:90%;","{max-width:",";}svg{fill:",";width:100px;}"],Z.desktop,Z.layout.smallerSectionMaxWidth,Z.color.primary),J=s.Ay.h2.withConfig({componentId:"sc-gupx60-1"})(["color:",";font-family:",";font-size:2rem;line-height:1;margin-block-end:0;text-transform:uppercase;"],Z.color.grey.one,Z.fontFamily.base),K=s.Ay.p.withConfig({componentId:"sc-gupx60-2"})(["margin-block-start:1rem;margin-block-end:2rem;margin-inline:0;"]),X=e=>{let t=e.header,r=e.subheader,n=e.linkText,i=e.linkTo;return(0,x.jsxs)(Y,{"data-testid":"empty-state-index-Container",children:[(0,x.jsx)(G.r,{"data-testid":"empty-state-index-BrandIcon"}),(0,x.jsx)(J,{"data-testid":"empty-state-index-Header",children:t}),(0,x.jsx)(K,{"data-testid":"empty-state-index-Subheader",children:r}),(0,x.jsx)(f.rA,{"data-testid":"empty-state-index-ActionButton",to:i,children:n})]})};var Q=r(40767),ee=r(68356).P;D.M.$spacing1,D.M.$spacing1,D.M.$spacing3,ee.desktop,D.M.$spacing7,D.M.$spacing6;const te=s.Ay.div.withConfig({componentId:"sc-clblwg-2"})(["background:",";box-shadow:",";border-radius:",";padding:"," ",";display:flex;flex-direction:column;align-items:center;","{min-height:174px;padding:"," ",";justify-content:space-between;flex-direction:row;}"],(e=>e.theme.token("background-pattern")),ee.boxShadow,ee.borderRadius,D.M.$spacing3,D.M.$spacing4,ee.desktop,D.M.$spacing7,D.M.$spacing10),re=s.Ay.div.withConfig({componentId:"sc-clblwg-3"})(["width:100%;&:nth-of-type(2n + 1){margin-block-end:",";}","{width:48%;margin-block-end:0;:nth-of-type(2n + 1){margin-block-end:0;}}"],D.M.$spacing2,ee.desktop),ne=s.Ay.button.withConfig({componentId:"sc-clblwg-5"})(["color:",";background:none;border:none;padding:0;font:",";cursor:pointer;&:hover{text-decoration:underline;}"],(e=>e.theme.token("text-button-secondary")),Q.Z.copyOne),ie=s.Ay.div.withConfig({componentId:"sc-clblwg-6"})(["font:",";text-transform:",";margin-block-end:",";
1"],Q.Z.headerTwo,ee.textTransform.headlines,D.M.$spacing1),ae=s.Ay.p.withConfig({componentId:"sc-clblwg-7"})(["display:inline-flex;font-weight:bold;align-items:center;color:",";"],(e=>e.theme.token("text-default"))),de=s.Ay.span.withConfig({componentId:"sc-clblwg-8"})(["margin-inline-start:",";"],D.M.$spacing1),oe=s.Ay.p.withConfig({componentId:"sc-clblwg-9"})(["position:relative;line-height:1.5rem;max-height:3rem;padding-inline-end:",";overflow:hidden;margin:0;"],D.M.$spacing4),se=s.Ay.div.withConfig({componentId:"sc-clblwg-10"})(["display:flex;align-items:center;p{color:",";}"],(e=>e.theme.token("text-default"))),le=s.Ay.div.withConfig({componentId:"sc-clblwg-11"})(["align-items:center;display:flex;justify-content:center;position:relative;","{height:auto;","{max-width:800px;}}"],ee.desktop,Y),ce=(D.M.$spacing7,D.M.$spacing5,ee.desktop,s.Ay.p.withConfig({componentId:"sc-clblwg-13"})(["font:",";color:",";margin:0;"],Q.Z.headerThree,(e=>e.theme.token("text-accent-order-number")))),ue=s.Ay.div.withConfig({componentId:"sc-clblwg-14"})(["display:flex;flex-direction:row;margin:"," 0;"],D.M.$spacing4),me=s.Ay.p.withConfig({componentId:"sc-clblwg-15"})(["font:",";text-transform:capitalize;margin-block:0;margin-inline-start:0;margin-inline-end:",";"],Q.Z.headerThree,D.M.$spacing1),ge=s.Ay.div.withConfig({componentId:"sc-clblwg-16"})(["padding-block-end:",";padding-inline:0;"],D.M.$spacing11);var pe=r(24057);const ve=e=>{let t=e.order,r=e.handleDisplayDetailsModal,i=e.setModalType,a=e.onModalDismiss;const s=(0,R.jg)().reorder.reorderedOrderId,c=(0,$.oX)(),u=c.store,m=c.fetchStore,g=(0,F.$)(t),p=g.handleReorderClick,v=g.disabled,y=(0,d.A)(),C=y.formatMessage,I=y.formatList,w=(0,o.Zp)(),E=(0,A._P)(A.N$.ENABLE_V2_REORDERING_EXPERIENCE),j=(0,b.U)("desktop"),k=(0,N.h)({modalAppearanceEventMessage:"Error: Fetch Store Failure"}),O=k[0],D=k[1];(0,n.useEffect)((()=>()=>(0,l.rf)()),[]);const T=(0,n.useMemo)((()=>new Date(t.createdAt).toLocaleString(C({id:"localeDateTime"}),{month:"short",day:"numeric",hour:"numeric",minute:"numeric"})),[C,t.createdAt]),P=(0,n.useMemo)((()=>{const e=L()(t,"cart.cartEntries",[]),r=e.map((e=>e.name)).join(", "),n=e.reduce(((e,t)=>e+t.quantity),0);return{itemCSV:r,numItems:n+" "+C(1===n?{id:"item"}:{id:"items"}).toLowerCase(),rewardRedeemed:e.some((e=>e.redeemable))}}),[t,C]),M=P.itemCSV,z=P.numItems,W=P.rewardRedeemed,G=(0,n.useCallback)((e=>{i(e),r(t.rbiOrderId)}),[r,t.rbiOrderId,i]),Z=(0,n.useCallback)((()=>{E?w(S.JZ.orderConfirmation+"/"+t.rbiOrderId):G(pe.l.SHOW_DETAILS)}),[E,w,t.rbiOrderId,G]),Y=M.split(","),J=Y.length-1,K=(0,B.f)(),X=(0,_.z)(t),Q=(0,n.useMemo)((()=>{var e;return v||!(0,U.wy)((null==t||null==(e=t.cart)?void 0:e.reorderCartEntries)||[])}),[v,t]),ee=(0,V.gW)(t),le=(0,n.useCallback)((()=>{(0,l.rf)(),null==a||a()}),[a]),ge=(0,n.useCallback)((()=>{E?w(S.JZ.orderConfirmation+"/"+t.rbiOrderId):((0,l.hs)({showSubLevelNavigation:!0,pageTitle:"Order #"+(X||""),onBack:le}),G(pe.l.SHOW_DETAILS))}),[X,le,G,E,w,t.rbiOrderId]);return(0,x.jsxs)(te,{"data-testid":"recent-order-"+t.rbiOrderId,children:[(0,x.jsxs)(re,{"data-testid":"account-orders-order-Col",children:[X?(0,x.jsxs)(ue,{"data-testid":"account-orders-order-OrderNumberWrapper",children:[(0,x.jsx)(me,{"data-testid":"account-orders-order-OrderNumberText",children:C({id:"orderNumber"})+":"}),(0,x.jsx)(ce,{"data-testid":"account-orders-order-OrderNumber",children:X})]}):null,(0,x.jsx)(ie,{"data-testid":"account-orders-order-FormattedDate",children:T}),!ee&&(0,x.jsx)(ae,{"data-testid":"account-orders-order-SubtitleContainer",children:(0,x.jsx)(de,{"data-testid":"account-orders-order-NumItems",children:z})}),!ee&&(0,x.jsxs)(se,{"data-testid":"account-orders-order-ItemNameContainer",children:[W&&(0,x.jsx)(q,{"data-testid":"account-orders-order-RewardText",text:C({id:"rewards"})}),(0,x.jsx)(oe,{"data-testid":"account-orders-order-Items",children:I([Y[0],...J>0?[(0,x.jsx)(ne,{"data-testid":"account-orders-order-MoreItems",onClick:Z,children:C({id:"moreItems"},{remainingItems:J})})]:[]],{type:"unit"})})]})]}),(0,x.jsx)(re,{"data-testid":"account-orders-order-Col-1",children:(0,x.jsxs)(h.a,{"data-testid":"account-orders-order-Box",flexDirection:j?"row":"column",center:!0,width:"100%",children:[(0,x.jsx)(h.a,{"data-testid":"account-orders-order-Box-1",width:"100%",minWidth:"auto",children:(0,x.jsx)(f.rA,{"data-testid":"recent-order-view-details",variant:f.Vs.OUTLINE,transparent:!0,fullWidth:!0,onClick:ge,"aria-label":K({buttonType:"view",order:t}),children:C({id:"viewDetails"})})}),(0,x.jsx)(h.a,{"data-testid":"account-orders-order-Box-2",margin:j?"0 0 0 1rem":"1rem 0 0",width:"100%",minWidth:"auto",children:(0,x.jsx)(H,{"data-testid":"account-orders-order-OrderAction",order:t,loading:s===t.rbiOrderId,disabled:Q,onTrack:()=>G(pe.l.TRACK_ORDER),onReorder:p,onFinish:async()=>{var e;const r=null!=(e=t.cart)&&e.storeId?t.cart.storeId.toString():"";if(u.number&&u.number!==r)try{await m(r)}
1catch(n){return D({message:C({id:"couldNotLocateStore"})})}w(S.JZ.orderConfirmation+"/"+t.rbiOrderId,{state:{showToast:!0}})}})})]})}),(0,x.jsx)(O,{"data-testid":"account-orders-order-ErrorDialog"})]})},he=e=>{let t=e.children;const r=(0,d.A)().formatMessage;return(0,x.jsxs)("div",{"data-testid":"account-orders-orders-empty-div",children:[(0,x.jsx)(le,{"data-testid":"account-orders-orders-empty-Wrap",children:(0,x.jsx)(X,{"data-testid":"account-orders-orders-empty-EmptyState",header:r({id:"noOrdersItemsYet"}),subheader:r({id:"recentOrdersEmptySubHeader"}),linkTo:S.JZ.menu,linkText:r({id:"startOrder"})})}),t]})};var fe=r(1944),xe=r(63751),ye=r(34189),Ce=r(63563),Ie=r(99160),be=r(19382),we=r(58690),Ee=r(78728),je=r(20405),ke=r(80854),Oe=r(77696);function Ae(e,t,r){e.trackEvent({name:Oe.og.RECENT_ORDERS_LIST_ITEM_VIEWED,type:Oe.wf.Other,attributes:{[Oe.Ny.ORDER_ID]:t,[Oe.Ny.SERVICE_MODE]:r}})}function Re(e,t){e.logEvent(Oe.og.ADD_RECENT_ITEM_TO_CART,Oe.wf.UserContent,{[Oe.Ny.PRODUCT_NAME]:t,[Oe.Ny.USER_LOCATION]:Oe.nE.RECENT_ORDERS})}var De=r(65733),Se=r(90849),Te=r(48405),Pe=r(68356).P;const Me=(0,s.I4)(Se.s3).withConfig({componentId:"sc-1sop9hr-0"})(["justify-content:center;"]),Le=(0,s.I4)(Se.mN).withConfig({componentId:"sc-1sop9hr-1"})(["","{margin-inline:-16px;width:100dvw;}"],Pe.mobile),Ne=()=>{const e=(0,d.A)().formatMessage,t=(0,Te.P)().loyaltyUser,r=(0,b.U)("mobile"),n=(null==t?void 0:t.points)||0;return(0,x.jsx)(Le,{"data-testid":"loyalty-order-banner-v2",children:(0,x.jsx)(Me,{"data-testid":"v2-loyalty-order-banner-v2-BannerInnerContainerV2",isMobile:r,children:(0,x.jsxs)(Se.tl,{"data-testid":"v2-loyalty-order-banner-v2-BannerPointsContainerV2",children:[(0,x.jsxs)(Se.K_,{"data-testid":"v2-loyalty-order-banner-v2-BannerPointsRow",children:[(0,x.jsx)(Se._x,{"data-testid":"v2-loyalty-order-banner-v2-BannerPointsIconBox",children:(0,x.jsx)(De.P,{"data-testid":"v2-loyalty-order-banner-v2-IconLoyaltyPoints"})}),(0,x.jsx)(Se.em,{"data-testid":"v2-loyalty-order-banner-v2-BannerPointsHeadline",children:n})]}),(0,x.jsx)(Se.t0,{"data-testid":"v2-loyalty-order-banner-v2-BannerAvailablePoints",children:e({id:"loyalty.availablePoints",defaultMessage:"Available Points"})})]})})})};var _e=r(3499),Fe=r(33715),Ve=r(40598),$e=r(6849),Be=r(95188),Ue=r(63289),ze=r(35070);const We="primary-tonal",He="80px",qe=s.I4.div.withConfig({componentId:"sc-yk584z-0"})(["width:",";height:",";flex-shrink:0;border-radius:8px;overflow:hidden;display:flex;align-items:center;justify-content:center;background-color:",";"],He,He,(e=>e.theme.colorV2.container["neutral-tonal"])),Ge=s.I4.span.withConfig({componentId:"sc-yk584z-1"})(["display:flex;align-items:center;justify-content:center;flex-shrink:0;width:40px;height:40px;border-radius:50%;background-color:",";svg{width:20px;height:20px;}"],(e=>e.theme.colorV2.container[We]));var Ze,Ye=r(75276),Je=r(64317);const Ke=s.I4.div.withConfig({componentId:"sc-111k20s-0"})(["display:flex;align-items:center;gap:8px;width:100%;padding:8px 0px;margin-block-end:-16px;grid-column:1 / -1;"]),Xe=(0,s.I4)(Je.c).withConfig({componentId:"sc-111k20s-1"})(["grid-column:1 / -1;"]),Qe=s.I4.span.withConfig({componentId:"sc-111k20s-2"})(["display:flex;align-items:center;justify-content:center;flex-shrink:0;width:26px;height:26px;border-radius:50%;background-color:",";svg{width:18px;height:18px;}"],(e=>e.theme.colorV2.container[We])),et=s.I4.div.withConfig({componentId:"sc-111k20s-3"})(["display:flex;align-items:center;justify-content:flex-start;min-width:0;",""],(e=>e.$fullWidth&&(0,s.AH)(Ze||(Ze=(0,Ye.A)(["\n      flex: 1;\n    "]))))),tt=(0,s.I4)(Je.c).withConfig({componentId:"sc-111k20s-4"})(["width:1px;height:12px;flex-shrink:0;margin:0 ","px;"],(e=>e.$marginPx)),rt=e=>{let t=e.loyaltyTransaction;const r=(0,d.A)().formatMessage;if(!t)return null;const i=t.pointsEarned,a=t.bonusPointsEarned,o=t.pointsUsed,s=[];if(i>0&&s.push(r({id:"loyalty.orderHistory.pointsEarned",defaultMessage:"{points} Pts Earned"},{points:i})),a>0&&s.push(r({id:"loyalty.orderHistory.pointsBonus",defaultMessage:"{points} Pts Bonus"},{points:a})),o>
10&&s.push(r({id:"loyalty.orderHistory.pointsUsed",defaultMessage:"{points} Pts Used"},{points:o})),!s.length)return null;const l=3===s.length?16:40;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Xe,{"data-testid":"order-card-v2-points-row-divider","aria-hidden":"true"}),(0,x.jsxs)(Ke,{"data-testid":"order-card-v2-points-row",children:[(0,x.jsx)(Qe,{"data-testid":"v2-order-card-v2-points-row-PointsRowIcon","aria-hidden":"true",children:(0,x.jsx)(De.P,{"data-testid":"v2-order-card-v2-points-row-IconLoyaltyPoints"})}),(0,x.jsx)(et,{"data-testid":"v2-order-card-v2-points-row-PointsRowSegments",$fullWidth:s.length>1,children:s.map(((e,t)=>(0,x.jsxs)(n.Fragment,{children:[t>0&&(0,x.jsx)(tt,{"data-testid":"order-card-v2-points-row-segment-divider",$marginPx:l,"aria-hidden":"true"}),(0,x.jsx)(Ee.r,{"data-testid":"v2-order-card-v2-points-row-FootnoteRegular",children:e})]},e)))})]})]})};var nt=r(42440),it=r(69015),at=r(42572),dt=r(60188),ot=r(68356).P;const st="border-color-default",lt="80px",ct=s.I4.div.withConfig({componentId:"sc-1neig67-0"})(["width:100%;"]),ut=s.I4.div.withConfig({componentId:"sc-1neig67-1"})(["display:flex;flex-direction:row;gap:12px;align-items:center;& > *:not(:first-child){flex:1;min-width:0;}"]),mt=s.I4.div.withConfig({componentId:"sc-1neig67-2"})(["width:",";height:",";flex-shrink:0;border-radius:8px;overflow:hidden;"],lt,lt),gt=s.I4.div.withConfig({componentId:"sc-1neig67-3"})(["display:grid;grid-template-columns:",";column-gap:12px;row-gap:8px;align-items:center;width:100%;min-width:0;"],(e=>e.$hasLeadingImage?lt+" minmax(0, 1fr)":"minmax(0, 1fr)")),pt=s.I4.div.withConfig({componentId:"sc-1neig67-4"})(["grid-column:",";padding-inline-end:8px;"],(e=>e.$hasLeadingImage?"2":"1")),vt=s.I4.div.withConfig({componentId:"sc-1neig67-5"})(["display:flex;flex-direction:column;gap:4px;flex:1;min-width:0;"]),ht=(0,s.I4)(Ee.qH).withConfig({componentId:"sc-1neig67-6"})(["display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;"]),ft=s.I4.div.withConfig({componentId:"sc-1neig67-7"})(["display:flex;align-items:center;gap:4px;flex-wrap:wrap;"]),xt=(0,s.I4)(it.KS).withConfig({componentId:"sc-1neig67-8"})(["",";"],(e=>e.theme.typography.footnoteRegular)),yt=s.I4.div.withConfig({componentId:"sc-1neig67-9"})(["display:flex;align-items:center;gap:4px;"]),Ct=s.I4.span.withConfig({componentId:"sc-1neig67-10"})(["display:flex;align-items:center;justify-content:center;width:18px;height:18px;color:",";svg{width:100%;height:100%;}"],(e=>e.theme.colorV2.text.error)),It=(0,s.I4)(Ee.r).withConfig({componentId:"sc-1neig67-11"})(["color:",";white-space:nowrap;"],(e=>e.theme.colorV2.text.neutral)),bt=s.I4.div.withConfig({componentId:"sc-1neig67-12"})(["margin-block-start:8px;display:flex;align-items:center;flex-wrap:wrap;gap:8px;"]),wt=s.I4.div.withConfig({componentId:"sc-1neig67-13"})(["display:flex;align-items:center;justify-content:space-between;gap:16px;padding-block:4px;"]),Et=s.I4.span.withConfig({componentId:"sc-1neig67-14"})(["flex:1;min-width:0;display:flex;align-items:center;color:",";overflow:hidden;text-overflow:ellipsis;"],(e=>e.theme.colorV2.text["main-darkest"])),jt=(0,s.I4)(Ee.r).withConfig({componentId:"sc-1neig67-15"})(["background-color:",";padding:4px 8px;border-radius:4px;margin-inline-end:8px;min-width:24px;text-align:center;display:inline-block;"],D.M.$blackOpacity4),kt=(0,s.I4)(o.N_).withConfig({componentId:"sc-1neig67-18"})(["color:",";text-decoration:underline;display:block;width:100%;padding-block:4px;"],(e=>e.theme.colorV2.text["main-darkest"])),Ot=s.I4.div.withConfig({componentId:"sc-1neig67-19"})(["display:flex;justify-content:space-between;align-items:center;gap:8px;padding:16px;"]),At=(0,s.I4)(nt.$).withConfig({componentId:"sc-1neig67-20"})(["flex:1;position:relative;z-index:1;"]),Rt=s.I4.div.withConfig({componentId:"sc-1neig67-21"})(["display:flex;align-items:center;gap:8px;flex-shrink:0;margin-inline-start:auto;> *{min-width:120px;}"]),Dt=s.I4.div.withConfig({componentId:"sc-1neig67-22"})(["display:flex;align-items:center;gap:16px;"]),St=s.I4.div.withConfig({componentId:"sc-1neig67-23"})(["flex-shrink:0;"]),Tt=s.I4.div.withConfig({componentId:"sc-1neig67-24"})(["flex:1;min-width:0;max-width:45%;"]),Pt=s.I4.div.withConfig({componentId:"sc-1neig67-25"})(["display:flex;flex-direction:column;gap:24px;width:100%;padding-block-start:16px;"]),Mt=s.I4.div.withConfig({componentId:"sc-1neig67-26"})(["display:flex;align-items:center;justify-content:center;position:relative;width:100%;padding-block:16px;","{padding-block:24px;}"],ot.desktop),Lt=s.I4.div.withConfig({componentId:"sc-1neig67-28"})(["position:absolute;inset-inline-start:0;"]),Nt=s.I4.div.withConfig({componentId:"sc-1neig67-31"})(["padding-inline:16px;display:flex;flex-direction:column;","{padding-inline:0;}"],ot.desktop),_t=s.I4.div.withConfig({componentId:"sc-1neig67-32"})(["max-width:1152px;margin:0 auto;padding-inline:8px;width:100%;display:flex;flex-direction:column;"]),Ft=s.I4.div.withConfig({componentId:"sc-1neig67-33"})(["display:flex;flex-direction:column;min-height:calc(100vh - 200px);padding-inline:1rem;padding-block:2rem;
1","{align-items:center;justify-content:center;}"],ot.desktop),Vt=s.I4.div.withConfig({componentId:"sc-1neig67-35"})(["height:1px;margin-inline:-16px;background-color:",";"],(e=>e.theme.token(st))),$t=s.I4.div.withConfig({componentId:"sc-1neig67-36"})(["display:flex;flex-direction:column;gap:24px;"]),Bt=s.I4.div.withConfig({componentId:"sc-1neig67-37"})(["display:flex;flex-direction:column;gap:24px;"]),Ut=(0,s.I4)(ut).withConfig({componentId:"sc-1neig67-38"})([""]),zt=(0,s.I4)(Dt).withConfig({componentId:"sc-1neig67-39"})([""]),Wt=(0,s.I4)(Tt).withConfig({componentId:"sc-1neig67-40"})(["max-width:none;"]),Ht=s.I4.div.withConfig({componentId:"sc-1neig67-41"})(["display:flex;flex-direction:column;"]),qt=s.I4.div.withConfig({componentId:"sc-1neig67-42"})(["display:flex;flex-direction:column;gap:4px;"]),Gt=s.I4.div.withConfig({componentId:"sc-1neig67-43"})(["display:flex;flex-direction:column;gap:12px;margin-block-start:8px;"]),Zt=s.I4.div.withConfig({componentId:"sc-1neig67-44"})(["display:flex;flex-direction:column;"]),Yt=(0,s.I4)(ht).withConfig({componentId:"sc-1neig67-45"})([""]),Jt=(0,s.I4)(at.H).withConfig({componentId:"sc-1neig67-46"})(["","{display:none;}"],dt.rx);var Kt=r(19527),Xt=r(67775),Qt=r(93145);function er(e,t){var r,n;const i=null!=(r=null==(n=e.cart)?void 0:n.cartEntries)?r:[];if(0===i.length)return null;if(1===i.length)return{item:i[0],index:0};const a=(null!=t?t:0)>0,d=e=>a&&"OfferItem"===e.type,o=a&&i.every(d),s=e=>{var t;const r=null!=(t=e.price)?t:0;return!o&&d(e)?0:r};let l=0,c=s(i[0]);for(let u=1;u<i.length;u++){const e=s(i[u]);e>c&&(c=e,l=u)}return{item:i[l],index:l}}function tr(e,t){const r=new Date(e);return Number.isNaN(r.getTime())?"":r.toLocaleString(t,{month:"short",day:"numeric",hour:"numeric",minute:"numeric"})}function rr(e){var t;return(null==(t=e.cart)?void 0:t.serviceMode)===R.h1.DELIVERY||Boolean(e.delivery)}const nr=new Set([W.ni.ORDER_DROPPED_OFF,W.ni.ORDER_ABANDONED,W.ni.ORDER_CANCELLED,W.ni.ORDER_ERROR,W.ni.ORDER_TIMEOUT]);function ir(e){var t;if(!rr(e)||lr(e.status))return!1;const r=null==(t=e.delivery)?void 0:t.status;return!!r&&!nr.has(r)}const ar=36e5;function dr(e,t,r){if(void 0===r&&(r=Date.now()),Qt.KV)return!1;let n=null;if(null!=t&&t.end)n=new Date(t.end).getTime();else{if(!e)return!1;n=new Date(e).getTime()}return r-n>ar}function or(e,t,r,n){void 0===n&&(n=new Date);return!(0,ye.T0)(null!=e?e:"",t,r,n).isTerminal}const sr=new Set([W.Re.REFUND_REQUESTED,W.Re.REFUND_SUCCESSFUL,W.Re.REFUND_ERROR]);function lr(e){return Boolean(e&&sr.has(e))}function cr(e,t){var r,n;if(void 0===t&&(t=new Date),!function(e){var t;const r=null==(t=e.cart)?void 0:t.serviceMode;return Boolean(r&&r!==R.h1.DELIVERY&&!e.delivery)}(e)||lr(e.status))return!1;return or(null!=(r=null==(n=e.order)?void 0:n.status)?r:"",e.createdAt,e.fireOrderIn||0,t)}const ur=(e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime();const mr=[{label:"",value:1},{label:"",value:2},{label:"",value:3},{label:"",value:4}];function gr(e,t){var r;return null==(null==(r=e.cart)?void 0:r.totalCents)?"":t(e.cart.totalCents)}function pr(e,t,r){var n,i,a;const d=null!=(n=null==(i=t.loyaltyTransaction)?void 0:i.pointsUsed)?n:0;if(0===d)return 0;const o=null==(a=t.cart)?void 0:a.rewardsApplied;if(!o||0===o.length)return d;if(1===o.length)return d;const s=o.find((t=>(null==t?void 0:t.cartId)===e));if(!s)return d;const l=r[s.rewardId];if(null!=l&&l.pointCost)return l.pointCost*s.timesApplied;const c=o.reduce(((e,t)=>{var r;return e+(null!=(r=null==t?void 0:t.timesApplied)?r:0)}),0);return c>0?Math.round(d/c)*s.timesApplied:d}const vr=new Set([_e.x8r.CLAIMED,_e.x8r.CONFIRMED]),hr={[Fe.G.Support]:"loyalty.orderHistory.channelSupport",[Fe.G.Campaign]:"loyalty.orderHistory.channelCampaign",[Fe.G.Quest]:"loyalty.orderHistory.channelQuest",[Fe.G.InitialPointBalance]:"loyalty.orderHistory.channelInitialPointBalance"},fr=e=>{var t;let r=e.transaction;const i=(0,d.A)().formatMessage,a=(0,Ve.fz)().formatCurrencyForLocale,o=null==(t=r.transactionDetails)?void 0:t.payments,s=(0,n.useMemo)((()=>(null!=o?o:[]).reduce(((e,t)=>e+t.amount),0)),[o]),l=(0,n.useMemo)((()=>tr(r.createdAt,i({id:"localeDateTime"}))),[r.createdAt,i]),c=vr.has(r.status),u={id:r.id,pointsEarned:r.pointsEarned,bonusPointsEarned:r.bonusPointsEarned,pointsUsed:r.pointsUsed,pointsBalance:0,rewardsUsed:0};return(0,x.jsxs)(gt,{$hasLeadingImage:!0,"data-testid":"loyalty-transaction-card-restaurant",children:[(0,x.jsx)(qe,{"data-testid":"v2-loyalty-transaction-card-LeadingIconImage",children:(0,x.jsx)(Ue.I,{"data-testid":"v2-loyalty-transaction-card-Icon",icon:ze.A,variant:"standard",size:"large","aria-hidden":"true"})}),(0,x.jsxs)(vt,{"data-testid":"v2-loyalty-transaction-card-ItemDetails",children:[(0,x.jsx)(ht,{"data-testid":"v2-loyalty-transaction-card-ClampedItemName",children:i({id:"loyalty.orderHistory.channelRestaurant",defaultMessage:"In Re
1staurant Scan"})}),(0,x.jsxs)(ft,{"data-testid":"v2-loyalty-transaction-card-PriceDateRow",children:[s>0&&(0,x.jsx)(Ee.eh,{"data-testid":"v2-loyalty-transaction-card-FootnoteBold",children:a(s)}),s>0&&l&&(0,x.jsx)(Ee.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular",children:" \u2022 "}),l&&(0,x.jsx)(Ee.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular-1",children:l}),c&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Ee.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular-2","aria-hidden":!0,children:" \xb7 "}),(0,x.jsx)(yt,{"data-testid":"loyalty-transaction-card-status",children:(0,x.jsx)(It,{"data-testid":"v2-loyalty-transaction-card-OrderStatusLabel",children:i({id:"orderCardCompleted",defaultMessage:"Completed"})})})]})]})]}),(0,x.jsx)(rt,{"data-testid":"v2-loyalty-transaction-card-OrderCardV2PointsRow",loyaltyTransaction:u})]})},xr=e=>{let t=e.transaction;const r=(0,d.A)().formatMessage,i=(0,n.useMemo)((()=>tr(t.createdAt,r({id:"localeDateTime"}))),[t.createdAt,r]),a=hr[t.channel],o=a?r({id:a,defaultMessage:t.channel}):t.channel.toLowerCase().split(/[-_]+/).map(((e,t)=>0===t?e.charAt(0).toUpperCase()+e.slice(1):e)).join(" ");const s=t.pointsEarned+t.bonusPointsEarned;return(0,x.jsxs)(gt,{$hasLeadingImage:!0,"data-testid":"loyalty-transaction-card-generic",children:[(0,x.jsx)(Ge,{"data-testid":"v2-loyalty-transaction-card-GenericTransactionIcon","aria-hidden":"true",children:(0,x.jsx)(De.P,{"data-testid":"v2-loyalty-transaction-card-IconLoyaltyPoints"})}),(0,x.jsxs)(vt,{"data-testid":"v2-loyalty-transaction-card-ItemDetails-1",children:[(0,x.jsx)(ht,{"data-testid":"v2-loyalty-transaction-card-ClampedItemName-1",children:r({id:"loyalty.orderHistory.pointsEarnedGeneric",defaultMessage:"{points} Points Earned"},{points:s})}),(0,x.jsxs)(ft,{"data-testid":"v2-loyalty-transaction-card-PriceDateRow-1",children:[i&&(0,x.jsx)(Ee.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular-3",children:i}),i&&(0,x.jsx)(Ee.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular-4",children:" \u2022 "}),(0,x.jsx)(Ee.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular-5",children:o})]})]})]})},yr=e=>{let t=e.transaction;const r=t.channel===Fe.G.Restaurant?(0,x.jsx)(fr,{"data-testid":"v2-loyalty-transaction-card-RestaurantScanContent",transaction:t}):(0,x.jsx)(xr,{"data-testid":"v2-loyalty-transaction-card-GenericTransactionContent",transaction:t});return(0,x.jsx)(ct,{"data-testid":"loyalty-transaction-card-"+t.id,children:(0,x.jsx)($e.z,{"data-testid":"v2-loyalty-transaction-card-SingleCard",variant:Be.D.OUTLINED,mainContent:r})})};var Cr=r(95105),Ir=r(31035),br=r(63554),wr=r(78169),Er=r(12671);function jr(e){if(!e)return null;try{var t;const r=JSON.parse(e);return null!=(t=null==r?void 0:r.app)?t:r}catch(r){return null}}var kr=r(56699),Or=r(39637);const Ar=new Set,Rr=e=>!(!e||Ar.has(e))&&(Ar.size>=500&&Ar.clear(),Ar.add(e),!0),Dr=e=>{let t=e.items,r=e.orderId,n=e.formatCurrency,i=e.pointsUsed,a=e.order,o=e.rewardsMap;const s=(0,d.A)().formatMessage,l=t.slice(0,2),c=t.length-2;return(0,x.jsxs)("div",{"data-testid":"v2-remaining-items-list-div",children:[l.map((e=>{var t,r;const d=(null!=i?i:0)>0&&"OfferItem"===e.type,s=d&&a&&o?pr(e.lineId,a,o):null!=i?i:0;return(0,x.jsxs)(wt,{"data-testid":"v2-remaining-items-list-RemainingItemRow",children:[(0,x.jsxs)(Et,{"data-testid":"v2-remaining-items-list-RemainingItemName",children:[(0,x.jsxs)(jt,{"data-testid":"v2-remaining-items-list-QuantityBadge",children:[null!=(r=e.quantity)?r:1,"x"]}),(0,x.jsx)(Ee.r,{"data-testid":"v2-remaining-items-list-FootnoteRegular",children:e.name})]}),d?(0,x.jsx)(xt,{value:s,"data-testid":"remaining-item-reward-points"}):null!=e.price&&(0,x.jsx)(Ee.r,{"data-testid":"v2-remaining-items-list-FootnoteRegular-1",style:{flexShrink:0},children:n(e.price)})]},null!=(t=e.lineId)?t:e.name+"-"+e.price)})),c>0&&(0,x.jsx)(kt,{"data-testid":"v2-remaining-items-list-MoreItemsLink",to:S.JZ.orderConfirmation+"/"+r,state:{from:"recentOrders"},children:(0,x.jsx)(Ee.r,{"data-testid":"v2-remaining-items-list-FootnoteRegular-2",children:s({id:"moreItemsV2",defaultMessage:"{remainingItems, plural, =0 {} other {{remainingItems}}} {remainingItems, plural, =0 {} one {more item} other {more items}}"},{remainingItems:c})})})]})},Sr=e=>{let t=e.orderStatusLabel,r=e.formatMessage;return(0,x.jsxs)(yt,{"data-testid":"order-card-v2-order-status",children:["orderCardCancelled"===t&&(0,x.jsx)(Ct,{"data-testid":"v2-order-card-v2-OrderStatusIcon","aria-hidden":"true",children:(0,x.jsx)(Ue.I,{"data-testid":"v2-order-card-v2-Icon",icon:Or.A,size:"small",variant:"standard"})}),(0,x.jsx)(It,{"data-testid":"v2-order-card-v2-OrderStatusLabel",children:r({id:t,defaultMessage:"orderCardCancelled"===t?"Cancelled":"Completed"})})]})},Tr=e=>{let t=e.refundChipLabel,r=e.refundChipStatus,n=e.formatMessage;return(0,x.jsx)(bt,{"data-testid":"v2-order-card-v2-RefundChipRow",children:(0,x.jsx)(kr.d,{text:n({id:t,defaultMessage:"orderCardRefundConfirmed"===t?"Refund Confirmed":"Refund Failed"}),chipStatus:r,"data-testid":"order-card-v2-refund-chip"})})},Pr=e=>{let t=e.isReward,r=e.points,n=e.formattedPrice,i=e.formattedDate,a=e.orderStatusLabel,d=e.refundChipLabel,o=e.formatMessage;const s=(t||n)&&i,l=i&&a&&(!d||"orderCardCancelled"===a);return(0,x.jsxs)(ft,{"data-testid":"v2-order-card-v2-PriceDateRow",children:[t?(0,x.jsx)(xt,{value:r,"data-testid":"order-card-reward-points"}):n&&(0,x.jsx)(Ee.eh,{"data-testid":"v2-order-card-v2-FootnoteBold",children:n}),s&&(0,x.jsx)(Ee.r,{"data-testid":"v2-order-card-v2-FootnoteRegular",children:" \u2022 "}),i&&(0,x.jsx)(Ee.r,{"data-testid":"v2-order-card-v2-FootnoteRegular-1",children:i}),l&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Ee.r,{"data-testid":"v2-order-card-v2-FootnoteRegular-2","aria-hidden":!0,
1children:" \xb7 "}),(0,x.jsx)(Sr,{"data-testid":"v2-order-card-v2-OrderStatusChip",orderStatusLabel:a,formatMessage:o})]})]})},Mr=e=>{var t,r,i,a,s,l,c,u,m,g;let p=e.order,v=e.selectedPreOrderTimeSlot,h=e.showPointsRow;const f=(0,d.A)().formatMessage,y=(0,o.Zp)(),C=(0,Ce.q)(),I=(0,F.$)(p),w=I.handleReorderClick,E=I.eligibility,j=I.isReordering,k=(0,Ve.fz)().formatCurrencyForLocale,O=(0,b.U)("desktop"),A=(0,n.useRef)(!1),D=(0,br.GV)(br.Tp.loyalty.selectAvailableLoyaltyRewardsMap),T=null!=(t=null==(r=p.loyaltyTransaction)?void 0:r.pointsUsed)?t:0,P=(0,n.useMemo)((()=>er(p,T)),[p,T]),M=(0,n.useMemo)((()=>P?function(e,t){var r,n;return(null!=(r=null==(n=e.cart)?void 0:n.cartEntries)?r:[]).filter(((e,r)=>r!==t))}(p,P.index):[]),[p,P]),L=(0,n.useMemo)((()=>{var e;return jr(null==P||null==(e=P.item)?void 0:e.image)}),[null==P||null==(i=P.item)?void 0:i.image]),N=(0,n.useMemo)((()=>tr(p.createdAt,f({id:"localeDateTime"}))),[p.createdAt,f]),_=(0,n.useMemo)((()=>{var e,t,r,n;return function(e,t){void 0===t&&(t=new Date);const r=e.rbiOrderStatus,n=e.partnerOrderStatus,i=e.createdAt,a=e.fireOrderIn,d=e.deliveryStatus,o=e.selectedPreOrderTimeSlot,s=e.serviceMode;let l=null,c=null;if(r!==W.Re.REFUND_REQUESTED&&r!==W.Re.REFUND_SUCCESSFUL||(l="orderCardRefundConfirmed",c="neutral"),r===W.Re.REFUND_ERROR&&(l="orderCardRefundFailed",c="warning"),n===Kt.l.CANCELED||d===W.ni.ORDER_CANCELLED||d===W.ni.ORDER_ERROR)return{orderStatusLabel:"orderCardCancelled",refundChipLabel:l,refundChipStatus:c};if(n===Kt.l.DONE||d===W.ni.ORDER_DROPPED_OFF||d===W.ni.ORDER_ABANDONED)return{orderStatusLabel:"orderCardCompleted",refundChipLabel:l,refundChipStatus:c};if(l)return{orderStatusLabel:null,refundChipLabel:l,refundChipStatus:c};const u=(0,ye.T0)(null!=n?n:"",i,null!=a?a:0,t),m=u.isTerminal,g=u.updatedStatus;return m&&g===Kt.l.DONE?{orderStatusLabel:"orderCardCompleted",refundChipLabel:null,refundChipStatus:null}:m&&g===Kt.l.CANCELED?{orderStatusLabel:"orderCardCancelled",refundChipLabel:null,refundChipStatus:null}:s===R.h1.DELIVERY&&dr(i,null!=o?o:null,t.getTime())?{orderStatusLabel:"orderCardCompleted",refundChipLabel:null,refundChipStatus:null}:{orderStatusLabel:null,refundChipLabel:null,refundChipStatus:null}}({rbiOrderStatus:p.status,deliveryStatus:null==(e=p.delivery)?void 0:e.status,partnerOrderStatus:null==(t=p.order)?void 0:t.status,createdAt:p.createdAt,fireOrderIn:null!=(r=p.fireOrderIn)?r:null,selectedPreOrderTimeSlot:v,serviceMode:null==(n=p.cart)?void 0:n.serviceMode})}),[p.status,null==(a=p.order)?void 0:a.status,null==(s=p.cart)?void 0:s.serviceMode,p.createdAt,p.fireOrderIn,null==(l=p.delivery)?void 0:l.status,v]),V=gr(p,k);(0,n.useEffect)((()=>{var e;const t=p.rbiOrderId;!A.current&&Rr(t)&&(A.current=!0,Ae(C,t,null==(e=p.cart)?void 0:e.serviceMode))}),[C,p.rbiOrderId,null==(c=p.cart)?void 0:c.serviceMode]);const $=(0,n.useCallback)((()=>{!function(e,t){e.logEvent(Oe.og.BUTTON_CLICK,Oe.wf.Navigation,{[Oe.Ny.NAME]:Oe.nE.VIEW_ORDER_DETAILS,[Oe.Ny.PATH]:t})}(C,S.JZ.orderConfirmation),y(S.JZ.orderConfirmation+"/"+p.rbiOrderId,{state:{from:"recentOrders"}})}),[C,y,p.rbiOrderId]),B=(0,n.useCallback)((()=>{!function(e,t){e.logEvent(Oe.og.BUTTON_CLICK,Oe.wf.Navigation,{[Oe.Ny.NAME]:Oe.nE.REORDER_CLICKED,[Oe.Ny.PATH]:t})}(C,S.JZ.orders);for(const n of null!=(e=null==(t=p.cart)?void 0:t.cartEntries)?e:[]){var e,t,r;Re(C,null!=(r=null==n?void 0:n.name)?r:"")}w()}),[C,null==(u=p.cart)?void 0:u.cartEntries,w]);if(!P)return null;const U=T>0&&"OfferItem"===P.item.type,z=U?pr(P.item.lineId,p,D):0,H=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(At,{"data-testid":"v2-order-card-v2-ActionButton",variant:"text",text:f({id:"viewDetails"}),onClick:$,preserveLabelCasing:!0}),E.canRenderReorderCTA&&(0,x.jsx)(At,{variant:"outline",text:f({id:"reorder"}),onClick:B,preserveLabelCasing:!0,loading:j,"data-testid":"order-card-v2-reorder-button"})]}),q=L?(0,x.jsx)(mt,{"data-testid":"v2-order-card-v2-ProductImage",children:(0,x.jsx)(Cr.V,{"data-testid":"v2-order-card-v2-Picture",image:L,alt:null!=(m=P.item.name)?m:"",placeholderAspectRatio:1})}):null,G=(0,x.jsxs)(vt,{"data-testid":"v2-order-card-v2-ItemDetails",children:[(0,x.jsx)(ht,{"data-testid":"v2-order-card-v2-ClampedItemName",children:f({id:"OrderConfirmation.orderNumberDis
1play",defaultMessage:"Order #{orderNumber}"},{orderNumber:null!=(g=p.orderNumberFormatted)?g:p.rbiOrderId})}),(0,x.jsx)(Pr,{"data-testid":"v2-order-card-v2-PriceAndDateDisplay",isReward:U,points:z,formattedPrice:V,formattedDate:N,orderStatusLabel:_.orderStatusLabel,refundChipLabel:_.refundChipLabel,formatMessage:f}),_.refundChipLabel&&_.refundChipStatus&&(0,x.jsx)(Tr,{"data-testid":"v2-order-card-v2-RefundChip",refundChipLabel:_.refundChipLabel,refundChipStatus:_.refundChipStatus,formatMessage:f})]}),Z=(0,x.jsxs)(gt,{"data-testid":"v2-order-card-v2-OrderDetailsContent",$hasLeadingImage:!!q,children:[q,G,M.length>0&&(0,x.jsx)(pt,{"data-testid":"v2-order-card-v2-RemainingItemsContent",$hasLeadingImage:!!q,children:(0,x.jsx)(Dr,{"data-testid":"v2-order-card-v2-RemainingItemsList",items:M,orderId:p.rbiOrderId,formatCurrency:k,pointsUsed:T,order:p,rewardsMap:D})}),h&&(0,x.jsx)(rt,{"data-testid":"v2-order-card-v2-OrderCardV2PointsRow",loyaltyTransaction:p.loyaltyTransaction})]});if(O){const e=(0,x.jsxs)(Dt,{"data-testid":"v2-order-card-v2-DesktopCardBody",children:[(0,x.jsx)(Tt,{"data-testid":"v2-order-card-v2-DesktopMainContent",children:Z}),(0,x.jsx)(Rt,{"data-testid":"v2-order-card-v2-DesktopTrailingActions",children:H})]});return(0,x.jsx)(ct,{"data-testid":"order-card-v2-"+p.rbiOrderId,children:(0,x.jsx)($e.z,{"data-testid":"v2-order-card-v2-SingleCard",variant:Be.D.OUTLINED,mainContent:e})})}const Y=Z,J=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Je.c,{"data-testid":"v2-order-card-v2-Divider"}),(0,x.jsx)(Ot,{"data-testid":"v2-order-card-v2-FooterActions",children:H})]});return(0,x.jsx)(ct,{"data-testid":"order-card-v2-"+p.rbiOrderId,children:(0,x.jsx)($e.z,{"data-testid":"v2-order-card-v2-SingleCard-1",variant:Be.D.OUTLINED,mainContent:Y,footer:J})})};var Lr=r(62334),Nr=r(34225);const _r=new Set([W.ni.ORDER_DROPPED_OFF,W.ni.ORDER_ABANDONED,W.ni.ORDER_CANCELLED,W.ni.ORDER_ERROR,W.ni.ORDER_TIMEOUT]);const Fr=(e,t)=>{var r,i,a;let d=t.enabled;const o=null!=(r=null==(i=e.delivery)?void 0:i.status)?r:W.ni.ORDER_CREATED,s=null!=(a=e.status)?a:"",l=(0,n.useState)(o),c=l[0],u=l[1],m=(0,n.useState)(s),g=m[0],p=m[1],v=(0,n.useState)((()=>d&&!_r.has(o))),h=v[0],f=v[1],x=(0,n.useState)(null),y=x[0],C=x[1],I=(0,n.useState)(void 0),b=I[0],w=I[1],E=(0,n.useState)(null),j=E[0],k=E[1],O=(0,Nr.vF)().query,A=(0,n.useRef)(null),R=(0,n.useRef)(!1),D=(()=>{const e=(0,n.useState)((()=>"visible"===document.visibilityState)),t=e[0],r=e[1];return(0,n.useEffect)((()=>{const e=()=>{r("visible"===document.visibilityState)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}}),[]),t})(),S=(0,n.useCallback)((()=>{R.current=!1,A.current&&(clearTimeout(A.current),A.current=null)}),[]);return(0,n.useEffect)((()=>{if(!d||!D||_r.has(o))return void f(!_r.has(o)&&d);R.current=!0;const t=(0,Lr.b)(e.rbiOrderId),r=()=>{A.current=globalThis.setTimeout(n,1e4)},n=()=>{O(t).then((t=>{!function(e,t,r,n,i){var a,d,o,s,l,c;if(!t.current)return;const u=null==e||null==(a=e.delivery)?void 0:a.status,m=null==e?void 0:e.status;var g,p;if(u&&r.setDeliveryStatus(u),m&&r.setRbiOrderStatus(m),null!=e&&null!=(d=e.delivery)&&d.dropoff&&r.setDropoff(e.delivery.dropoff),void 0!==(null==e||null==(o=e.delivery)||null==(o=o.vendorProperties)?void 0:o.vendor)&&r.setVendor(null!=(g=e.delivery.vendorProperties.vendor)?g:void 0),void 0!==(null==e||null==(s=e.delivery)?void 0:s.selectedPreOrderTimeSlot)&&r.setSelectedPreOrderTimeSlot(null!=(p=e.delivery.selectedPreOrderTimeSlot)?p:null),u&&_r.has(u))return r.setIsOngoing(!1),void(t.current=!1);if(dr(i,null!=(l=null==e||null==(c=e.delivery)?void 0:c.selectedPreOrderTimeSlot)?l:null))return r.setIsOngoing(!1),void(t.current=!1);t.current&&n()}(t,R,{setDeliveryStatus:u,setRbiOrderStatus:p,setIsOngoing:f,setDropoff:C,setVendor:w,setSelectedPreOrderTimeSlot:k},r,e.createdAt)})).catch((()=>{R.current&&r()}))};return n(),()=>{R.current=!1,A.current&&(clearTimeout(A.current),A.current=null)}}),[d,D,o,e.rbiOrderId,O]),{isOngoing:h,deliveryStatus:c,rbiOrderStatus:g,dropoff:y,vendor:b,selectedPreOrderTimeSlot:j,stopPolling:S}},Vr={bold:Ee.eh,regular:Ee.r,status:It},$r=e=>{let t=e.formattedDate,r=e.highlightedPoints,n=e.isHighlightedReward,i=e.priceDateStatusItems;return(0,x.jsxs)(ft,{"data-testid":"v2-ongoing-delivery-order-card-v2-PriceDateRow",children:[n&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(xt,{value:r,"data-testid":"ongoing-order-reward-points"}),t&&(0,x.jsx)(Ee.r,{"data-testid":"v2-ongoing-delivery-order-card-v2-FootnoteRegular",children:" \u2022 "})]}),i.map((e=>{let t=e.key,r=e.content,n=e.type;const i=Vr[n];return(0,x.jsx)(i,{"data-testid":"v2-ongoing-delivery-order-card-v2-Comp",children:r},t)}))]})},Br=e=>{var t,r,i,a,s,l,c,u,m;let g=e.order,p=e.onOrderTerminal;const v=(0,d.A)(),h=v.formatMessage,f=v.formatTime,y=(0,Ve.fz)().formatCurrencyForLocale,C=(0,o.Zp)(),I=(0,Ce.q)(),w=(0,b.U)("desktop"),E=(0,br.GV)(br.Tp.loyalty.selectAvailableLoyaltyRewardsMap),j=null!=(t=null==(r=g.loyaltyTransaction)?void 0:r.pointsUsed)?t:0,k=(0,n.useMemo)((()=>er(g,j)),[g,j]),O=ir(g),A=(0,n.useRef)(!1),R=Fr(g,{enabled:O}),D=R.isOngoing,T=R.deliveryStatus,P=R.rbiOrderStatus,M=R.dropoff,L=R.vendor,N=R.selectedPreOrderTimeSlot,_=(0,Ir.A)(T,M,L,N);(0,n.useEffect)((()=>{D||null==p||p(g.rbiOrderId)}),[D,p,g.rbiOrderId]),(0,n.useEffect)((()=>{var e;const t=g.rbiOrderId;!A.current&&Rr(t)&&(A.current=!0,Ae(I,t,null==(e=g.cart)?void 0:e.serviceMode))}),[I,g.rbiOrderId,null==(i=g.cart)?void 0:i.serviceMode]);const F=gr(g,y),V=(0,n.useMemo)((()=>tr(g.createdAt,h({id:"localeDateTime"}))),[g.createdAt,h]),$=(null!=(a=null==(s=g.cart)||null==(s=s.cartEntries)?void 0:s.length)?a:0)-1,B=(0,n.useMemo)((()=>{var e;return jr(null==k||null==(e=k.item)?void 0:e.image)}),[null==k||null==(l=k.item)?void 0:l.image]),U=(0,n.useCallback)((()=>{var e;const t=S.JZ.orderConfirmation+"/"+g.rbiOrderId;!function(e,t){e.logEvent(Oe.og.BUTTON_CLICK,Oe.wf.Navigation,{[Oe.Ny.NAME]:Oe.nE.TRACK_ORDER,[Oe.Ny.PATH]:t.path,[Oe.Ny.ORDER_ID]:t.orderId,[Oe.Ny.SERVICE_MODE]:t.serviceMode,[Oe.Ny.DELIVERY_STATUS]:t.deliveryStatus,[Oe.Ny.PARTNER_STATUS]:t.partnerStatus})}(I,{path:t,orderId:g.rbiOrderId,serviceMode:null==(e=g.cart)?void 0:e.serviceMode,deliveryStatus:T,partnerStatus:P}),C(t,{state:{from:"recentOrders"}})}),[I,g.rbiOrderId,null==(c=g.cart)?void 0:c.serviceMode,T,P,C]);if(!D)return(0,x.jsx)(Mr,{"data-testid":"v2-ongoing-delivery-order-card-v2-OrderCardV2",order:g,selectedPreOrderTimeSlot:N});if(!k)return null;const z=j>0&&"OfferItem"===k.item.type,H=z?pr(k.item.lineId,g,E):0,q=function(e,t,r){switch(e){case W.ni.ORDER_PICKED_UP:case W.ni.DRIVER_AT_CUSTOMER:return r({id:"ongoingOrder.driverEnroute",defaultMessage:"Driver enroute"});case W.ni.ORDER_DROPPED_OFF:case W.ni.ORDER_ABANDONED:return r({id:"orderCardCompleted",defaultMessage:"Completed"});case W.ni.ORDER_CREATED:case W.ni.DRIVER_ASSIGNED:case W.ni.DRIVER_UNASSIGNED:case W.ni.DRIVER_STARTING:case W.ni.DRIVER_AT_STORE:default:return t===W.Re.UPDATE_SUCCESSFUL?r({id:"ongoingOrder.beingPrepared",defaultMessage:"Be
1ing prepared"}):r({id:"ongoingOrder.orderPlaced",defaultMessage:"Order placed"})}}(T,P,h),G=function(e,t){switch(e){case W.ni.ORDER_DROPPED_OFF:case W.ni.ORDER_ABANDONED:return 4;case W.ni.DRIVER_AT_CUSTOMER:return 3.5;case W.ni.ORDER_PICKED_UP:return 3;case W.ni.DRIVER_AT_STORE:return 2.5;case W.ni.ORDER_CREATED:case W.ni.DRIVER_ASSIGNED:case W.ni.DRIVER_UNASSIGNED:case W.ni.DRIVER_STARTING:return t===W.Re.UPDATE_SUCCESSFUL?2:1.5;default:return 1}}(T,P),Z=function(e,t){switch(e){case 1.5:return t({id:"progressBar.delivery.inProgress",defaultMessage:"Your order is in progress!"});case 2:return t({id:"progressBar.delivery.preparing",defaultMessage:"Your order is being prepared!"});case 2.5:return t({id:"progressBar.delivery.pickingUp",defaultMessage:"Driver is picking up your order!"});case 3:return t({id:"progressBar.delivery.enroute",defaultMessage:"Your order is out for Delivery!"});case 3.5:return t({id:"progressBar.delivery.nearby",defaultMessage:"Your order is nearby!"});default:return t({id:"progressBar.delivery.initial",defaultMessage:"Your order has been placed!"})}}(G,h),Y=h(!!N?{id:"scheduledDeliveryTime"}:{id:"estimatedDeliveryTime"}),J=function(e,t,r){if(!e)return r;const n={hour:"numeric",minute:"2-digit",hour12:!0};return t(new Date(e.start),n)+" - "+t(new Date(e.end),n)}(N,f,_),K=(0,x.jsx)(At,{"data-testid":"v2-ongoing-delivery-order-card-v2-ActionButton",variant:"solid",size:w?"small":"large",text:h({id:"trackOrderV2",defaultMessage:"Track Order"}),onClick:U,iconLeading:Er.A,fullWidth:!w,preserveLabelCasing:!0}),X=B?(0,x.jsx)(mt,{"data-testid":"v2-ongoing-delivery-order-card-v2-ProductImage",children:(0,x.jsx)(Cr.V,{"data-testid":"v2-ongoing-delivery-order-card-v2-Picture",image:B,alt:null!=(u=k.item.name)?u:"",placeholderAspectRatio:1})}):null,Q=function(e,t,r){const n=[];return e&&n.push({key:"price",content:e,type:"bold"}),e&&t&&n.push({key:"sep-1",content:" \u2022 ",type:"regular"}),t&&n.push({key:"date",content:t,type:"regular"}),t&&r&&n.push({key:"sep-2",content:" \u2022 ",type:"regular"}),r&&n.push({key:"status",content:r,type:"status"}),n}(z?"":F,V,q),ee=(0,x.jsxs)(vt,{"data-testid":"v2-ongoing-delivery-order-card-v2-ItemDetails",children:[(0,x.jsxs)(Yt,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingItemName",children:[null!=(m=k.item.name)?m:"",$>0&&h({id:"recentOrdersAndMore",defaultMessage:" & more.."})]}),(0,x.jsx)($r,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingPriceDateRow",formattedDate:V,highlightedPoints:H,isHighlightedReward:z,priceDateStatusItems:Q}),(0,x.jsxs)(Gt,{"data-testid":"v2-ongoing-delivery-order-card-v2-ProgressBlock",children:[(0,x.jsxs)(Zt,{"data-testid":"v2-ongoing-delivery-order-card-v2-EtaBlock",children:[(0,x.jsx)(Ee.sD,{"data-testid":"v2-ongoing-delivery-order-card-v2-TitleSmall",children:J}),(0,x.jsx)(Ee.r,{"data-testid":"v2-ongoing-delivery-order-card-v2-FootnoteRegular-1",children:Y})]}),(0,x.jsx)(Jt,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingDeliveryProgressIndicator",segments:mr,currentValue:G,variant:wr.S.PRIMARY}),(0,x.jsx)(Ee.uv,{"data-testid":"v2-ongoing-delivery-order-card-v2-BodyMedium",children:Z})]})]}),te=(0,x.jsxs)(zt,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingDesktopCardBody",children:[X&&(0,x.jsx)(St,{"data-testid":"v2-ongoing-delivery-order-card-v2-DesktopLeadingContent",children:X}),(0,x.jsx)(Wt,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingDesktopMainContent",children:ee}),(0,x.jsx)(Rt,{"data-testid":"v2-ongoing-delivery-order-card-v2-DesktopTrailingActions",children:K})]}),re=(0,x.jsxs)(Ut,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingHighlightedSection",children:[X,ee]}),ne=(0,x.jsxs)(Ht,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingCardFooter",children:[(0,x.jsx)(Je.c,{"data-testid":"v2-ongoing-delivery-order-card-v2-Divider"}),(0,x.jsx)(Ot,{"data-testid":"v2-ongoing-delivery-order-card-v2-FooterActions",children:K})]});return(0,x.jsx)(ct,{"data-testid":"ongoing-delivery-order-card-v2-"+g.rbiOrderId,children:(0,x.jsx)($e.z,{"data-testid":"v2-ongoing-delivery-order-card-v2-SingleCard",variant:Be.D.FILLED,cardType:w?void 0:Be.G.SMALL,mainContent:w?te:re,footer
1:w?void 0:ne})})};var Ur=r(48553),zr=r(25312);var Wr=r(40788);const Hr=(e,t)=>{var r,i,a,d,o,s;let l=t.enabled;const c=null!=(r=null==(i=e.cart)?void 0:i.serviceMode)?r:R.h1.TAKEOUT,u=null!=(a=null==(d=e.cart)?void 0:d.posVendor)?a:"",m=(0,Wr.p)({rbiOrderId:l?e.rbiOrderId:void 0,posVendor:u,serviceMode:c}),g=m.orderStatus,p=m.isProgressBarEnabled,v=m.stopPolling,h=(0,n.useState)(""),f=h[0],x=h[1],y=(0,n.useState)((()=>{var t;return l&&or((null==(t=e.order)?void 0:t.status)||"",e.createdAt,e.fireOrderIn||0)})),C=y[0],I=y[1],b=(0,n.useCallback)((()=>{var t;if(!l)return!1;const r=g||(null==(t=e.order)?void 0:t.status)||"",n=r?(i=r,a=e.createdAt,d=e.fireOrderIn||0,i?(0,ye.T0)(i,a,d).updatedStatus:i):"";var i,a,d;const o=or(r,e.createdAt,e.fireOrderIn||0);return x(n),I(o),o||v(),!o}),[l,g,e.createdAt,e.fireOrderIn,null==(o=e.order)?void 0:o.status,v]);return(0,n.useEffect)((()=>{if(!l){var t;const r=or((null==(t=e.order)?void 0:t.status)||"",e.createdAt,e.fireOrderIn||0);return void I(r)}if(b())return;const r=setInterval((()=>{b()&&clearInterval(r)}),ye.Wx);return()=>clearInterval(r)}),[l,b,e.createdAt,e.fireOrderIn,null==(s=e.order)?void 0:s.status]),{isOngoing:C,effectiveStatus:f,isProgressBarEnabled:l&&p}},qr=e=>
1{let t=e.formattedPrice,r=e.formattedDate,n=e.statusLabel,i=e.pointsUsed,a=e.isHighlightedReward;return(0,x.jsxs)(ft,{"data-testid":"v2-ongoing-pickup-order-card-v2-PriceDateRow",children:[a?(0,x.jsx)(xt,{value:i,"data-testid":"ongoing-order-reward-points"}):t&&(0,x.jsx)(Ee.eh,{"data-testid":"v2-ongoing-pickup-order-card-v2-FootnoteBold",children:t}),(a||t)&&r&&(0,x.jsx)(Ee.r,{"data-testid":"v2-ongoing-pickup-order-card-v2-FootnoteRegular",children:" \u2022 "}),r&&(0,x.jsx)(Ee.r,{"data-testid":"v2-ongoing-pickup-order-card-v2-FootnoteRegular-1",children:r}),r&&n&&(0,x.jsx)(Ee.r,{"data-testid":"v2-ongoing-pickup-order-card-v2-FootnoteRegular-2",children:" \u2022 "}),n&&(0,x.jsx)(It,{"data-testid":"v2-ongoing-pickup-order-card-v2-OrderStatusLabel",children:n})]})},Gr=e=>{var t,r,i,a,s,l,c,u,m,g,p,v;let h=e.order,f=e.onOrderTerminal;const y=(0,d.A)().formatMessage,C=(0,Ve.fz)().formatCurrencyForLocale,I=(0,o.Zp)(),w=(0,Ce.q)(),E=(0,b.U)("desktop"),j=(0,br.GV)(br.Tp.loyalty.selectAvailableLoyaltyRewardsMap),k=null!=(t=null==(r=h.loyaltyTransaction)?void 0:r.pointsUsed)?t:0,O=(0,n.useMemo)((()=>er(h,k)),[h,k]),R=function(e,t){return void 0===t&&(t=new Date),cr(e,t)}(h),D=Hr(h,{enabled:R}),T=D.isOngoing,P=D.effectiveStatus,M=D.isProgressBarEnabled,L=(0,n.useState)(1),N=L[0],_=L[1],F=(0,n.useRef)(!1);(0,n.useEffect)((()=>{T||null==f||f(h.rbiOrderId)}),[T,f,h.rbiOrderId]);const V=(0,n.useMemo)((()=>{var e;return jr(null==O||null==(e=O.item)?void 0:e.image)}),[null==O||null==(i=O.item)?void 0:i.image]),B=(0,n.useMemo)((()=>tr(h.createdAt,y({id:"localeDateTime"}))),[h.createdAt,y]),U=null==(null==(a=h.cart)?void 0:a.totalCents)?"":C(h.cart.totalCents),z=(null!=(s=null==(l=h.cart)||null==(l=l.cartEntries)?void 0:l.length)?s:0)-1,W=null==(c=h.cart)?void 0:c.serviceMode,H=P||(null==(u=h.order)?void 0:u.status)||"",q=(e=>{let t=e.serverOrder,r=e.posOrderStatus,i=void 0===r?"":r;const a=(0,d.A)().formatMessage,o=(0,zr.X)({serverOrder:t}).pickupDate,s=(0,A._P)(A.N$.ENABLE_STORE_TIME_FOR_AVAILABILITY),l=(0,$.oX)().storeTimezoneOffsetMs,c=0===((null==t?void 0:t.fireOrderIn)||0),u=(0,n.useMemo)((()=>(0,ye.Cp)(o,s,l)),[o,s,l]);return{pickupTimeText:c?(0,Xt.fp)(i,a):a({id:"recentOrdersScheduledFor",defaultMessage:"Scheduled for"})+" "+u,pickupDate:o,isOrderFiredIn:c,readablePickupTime:u}})({serverOrder:h,posOrderStatus:H}),G=q.pickupTimeText;(0,n.useEffect)((()=>{P&&_(function(e,t){var r;const n=(0,Xt.pX)(e,t);return(null==(r=(0,Xt.ZW)(t).find((e=>e.label===n)))?void 0:r.value)||1}(P,y))}),[P,y]),(0,n.useEffect)((()=>{var e;const t=h.rbiOrderId;!F.current&&Rr(t)&&(F.current=!0,Ae(w,t,null==(e=h.cart)?void 0:e.serviceMode))}),[w,h.rbiOrderId,null==(m=h.cart)?void 0:m.serviceMode]);const Z=(0,n.useCallback)((()=>{var e;!function(e,t){e.logEvent(Oe.og.BUTTON_CLICK,Oe.wf.Navigation,{[Oe.Ny.NAME]:Oe.nE.TRACK_ORDER,[Oe.Ny.PATH]:t.path,[Oe.Ny.ORDER_ID]:t.orderId,[Oe.Ny.SERVICE_MODE]:t.serviceMode})}(w,{path:S.JZ.orderConfirmation+"/"+h.rbiOrderId,orderId:h.rbiOrderId,serviceMode:null==(e=h.cart)?void 0:e.serviceMode}),I(S.JZ.orderConfirmation+"/"+h.rbiOrderId,{state:{from:"recentOrders"}})}),[w,h.rbiOrderId,null==(g=h.cart)?void 0:g.serviceMode,I]);if(!T)return(0,x.jsx)(Mr,{"data-testid":"v2-ongoing-pickup-order-card-v2-OrderCardV2",order:h});if(!O)return null;const Y=k>0&&"OfferItem"===O.item.type,J=Y?pr(O.item.lineId,h,j):0,K=function(e,t){switch(e){case Kt.l.PREPARING:return t({id:"deliveryOrderBeingPrepared",defaultMessage:"Being Prepared"});case Kt.l.PREPARED:return t({id:"orderPrepared",defaultMessage:"Prepared"});case Kt.l.DONE:return t({id:"orderCardCompleted",defaultMessage:"Completed"});case Kt.l.CREATED:case Kt.l.PRICED:case Kt.l.COMMITTED:default:return t({id:"orderPlaced",defaultMessage:"Order Placed"})}}(H,y),X=(0,Xt.fX)(H,y),Q=(0,Ur.Q)(W),ee=(0,x.jsx)(At,{"data-testid":"v2-ongoing-pickup-order-card-v2-ActionButton",variant:"solid",size:E?"small":"large",text:y({id:"trackOrderV2",defaultMessage:"Track Order"}),onClick:Z,iconLeading:Q,fullWidth:!E,preserveLabelCasing:!0}),te=V?(0,x.jsx)(mt,{"data-testid":"v2-ongoing-pickup-order-card-v2-ProductImage",children:(0,x.jsx)(Cr.V,{"data-testid":"v2-ongoing-pickup-order-card-v2-Picture",image:V,alt:null!=(p=O.item.name)?p:"",placeholderAspectRatio:1})}):null,re=(0,x.jsxs)(vt,{"data-testid":"v2-ongoing-pickup-order-card-v2-ItemDetails",children:[(0,x.jsxs)(Yt,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingItemName",children:[null!=(v=O.item.name)?v:"",z>0&&y({id:"recentOrdersAndMore",defaultMessage:" & more.."})]}),(0,x.jsx)(qr,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingOrderPriceDateRow",formattedPrice:U,formattedDate:B,statusLabel:K,pointsUsed:J,isHighlightedReward:Y}),(0,x.jsxs)(Gt,{"data-testid":"v2-ongoing-pickup-order-card-v2-ProgressBlock",children:[(0,x.jsx)(qt,{"data-testid":"v2-ongoing-pickup-order-card-v2-PickupTimeBlock",children:(0,x.jsx)(Ee.sD,{"data-testid":"v2-ongoing-pickup-order-card-v2-TitleSmall",children:G})}),M&&(0,x.jsx)(at.H,{"data-testid":"v2-ongoing-pickup-order-card-v2-SegmentedProgressIndicator",segments:[{label:"",value:1},{label:"",value:2},{label:"",value:3}],currentValue:N,variant:wr.S.PRIMARY}),(0,x.jsx)(Ee.uv,{"data-testid":"v2-ongoing-pickup-order-card-v2-BodyMedium",children:X})]})]});return E?(0,x.jsx)(ct,{"data-testid":"ongoing-order-card-v2-"+h.rbiOrderId,children:(0,x.jsx)($e.z,{"data-testid":"v2-ongoing-pickup-order-card-v2-SingleCard",variant:Be.D.FILLED,mainContent:(0,x.jsxs)(zt,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingDesktopCardBody",children:[te&&(0,x.jsx)(St,{"data-testid":"v2-ongoing-pickup-order-card-v2-DesktopLeadingContent",children:te}),(0,x.jsx)(Wt,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingDesktopMainContent",children:re}),(0,x.jsx)(Rt,{"data-testid":"v2-ongoing-pickup-order-card-v2-DesktopTrailingActions",children:ee})]})})}):(0,x.jsx)(ct,{"data-testid":"ongoing-order-card-v2-"+h.rbiOrderId,children:(0,x.jsx)($e.z,{"data-testid":"v2-ongoing-pickup-order-card-v2-SingleCard-1",variant:Be.D.FILLED,cardType:Be.G.SMALL,mainContent:(0,x.jsxs)(Ut,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingHighlightedSection",children:[te,re]}),footer:(0,x.jsxs)(Ht,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingCardFooter",children:[(0,x.jsx)(Je.c,{"data-testid":"v2-ongoing-pickup-order-card-v2-Divider"}),(0,x.jsx)(Ot,{"data-testid":"v2-ongoing-pickup-order-card-v2-FooterActions",children:ee})]})})})};var Zr,Yr,Jr=r(54909),Kr=r(54356),Xr=r(44296),Qr=r(18091),en=r(8674);!function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"}(Zr||(Zr={})),function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"}(Yr||(Yr={}));var tn=function(e){var t=(0,d.A)(),r=e.value,n=e.children,i=(0,en.Tt)(e,["value","children"]);return n(t.formatNumberToParts(r,i))};tn.displayName="FormattedNumberParts";function rn(e){var t=function(t){var r=(0,d.A)(),n=t.value,i=t.children,a=(0,en.Tt)(t,["value","children"]),o="string"===typeof n?new Date(n||0):n;return i("formatDate"===e?r.formatDateToParts(o,a):r.formatTimeToParts(o,a))};return t.displayName=Yr[e],t}function nn(e){var t=function(t){var r=(0,d.A)(),i=t.value,a=t.children,o=(0,en.Tt)(t,["value","children"]),s=r[e](i,o);if("function"===typeof a)return a(s);var l=r.textComponent||n.Fragment;return n.createElement(l,null,s)};return t.displayName=Zr[e],t}tn.displayName="FormattedNumberParts";nn("formatDate"),nn("formatTime"),nn("formatNumber"),nn("formatList"),nn("formatDisplayName"),rn("formatDate"),rn("formatTime");const an={itemAddedToCart:{id:"recentItemsV2AddedToCart",defaultMessage:"{itemName} is added to your cart!"},itemUnavailableAtLocation:{id:"recentItemsV2UnavailableAtLocation",defaultMessage:"{itemName} is not available at your selected location."},addButtonLabel:{id:"addToCart",defaultMessage:"Add"}};var dn=r(21879),on=r(37571);const sn=s.I4.div.withConfig({componentId:"sc-7dw8eq-0"})(["overflow-x:auto;scroll-snap-type:x mandatory;display:flex;flex-direction:row;gap:16px;padding-block-start:4px;padding-block-end:20px;padding-inline-end:10px;scroll-padding-left:2px;& > :first-child{margin-inline-start:2px;}"]),ln=(0,s.I4)(on.c).withConfig({componentId:"sc-7dw8eq-1"})(["margin-block-start:1rem;margin-inline:-16px;width:calc(100% + 32px);"]),cn=s.I4.div.withConfig({componentId:"sc-7dw8eq-2"})(["",";margin-block-start:4px;"],(e=>e.theme.typography.footnoteRegular)),un=s.I4.section.withConfig({componentId:"sc-7dw8eq-3"})(["width:100%;> div{max-width:100%;}"]),mn=s.I4.h2.withConfig({componentId:"sc-7dw8eq-4"})(["margin-block-end:24px;"]),gn=s.I4.div.withConfig({componentId:"sc-7dw8eq-5"})(["width:309px;flex-shrink:0;scroll-snap-align:start;align-self:stretch;","{width:343px;margin-inline-end:8px;&:first-child{margin-inline-start:2px;}}> *{height:100%;}.list-item{overflow:hidden;}[data-testid='main-content']{overflow:hidden;min-width:0;}[data-testid='main-content'] > div:first-child{min-width:0;overflow:hidden;}[data-testid='description']{white-space:pre-line;}.list-item [data-testid='title']{-webkit-line-clamp:none;display:block;overflow:visible;}"],dn.H.desktop),pn=s.I4.div.withConfig({componentId:"sc-7dw8eq-6"})(["width:100px;height:80px;border-radius:8px;overflow:hidden;"]),vn=e=>{var t,r,i;let a=e.cartEntry,o=e.onAddPress;const s=(0,d.A)().formatMessage,l=(0,Jr.f)(),c=(0,Kr.x)(),u=(0,A._P)(A.N$.ENABLE_RECENT_ITEMS_WITH_MODIFIERS),m=(0,A._P)(A.N$.HIDE_UI_CALORIES),g=(0,n.use
1State)(null),p=g[0],v=g[1],h=(0,n.useState)(void 0),f=h[0],y=h[1];(0,n.useEffect)((()=>{let e=!1;return(async()=>{const t=await c(a),r=t.cartEntry,n=t.data;e||(v(r),y(n))})(),()=>{e=!0}}),[a,c]);const C=m?void 0:l({menuItem:f,frontendEntry:p,quantity:a.quantity}),I=u&&null!=p&&p.children?(0,U.ct)(p):[],b=I.length-1,w=null!=(t=I[0])?t:null,E=w&&"string"===typeof w.element?w.element:void 0;let j;E&&(j=b>0?E+"\n+"+b+" more":E);const k=null!=j?j:void 0,O=C?(0,x.jsx)(cn,{"data-testid":"recent-items-carousel-v2-recent-items-card-v2-CaloriesText",children:C}):void 0,R=(0,n.useCallback)((()=>{o(a)}),[o,a]);return(0,x.jsx)(gn,{"data-testid":"recent-items-carousel-v2-recent-items-card-v2-RecentItemCardWrapper",children:(0,x.jsx)($e.z,{variant:Be.D.OUTLINED,"data-testid":"recent-items-card-v2",listItem:(0,x.jsx)(Xr.c,{disableEvents:!0,data:{title:(0,x.jsx)(Ee.qH,{"data-testid":"recent-items-carousel-v2-recent-items-card-v2-TitleMedium",children:null!=(r=a.name)?r:""}),description:k,maxDescriptionLines:3,supportingContent:O,leadingContent:(0,x.jsx)(pn,{"data-testid":"recent-items-carousel-v2-recent-items-card-v2-LeadingImageContainer",children:(0,x.jsx)(Cr.V,{"data-testid":"recent-items-carousel-v2-recent-items-card-v2-Picture",objectFitContain:!0,image:(0,Qr.QG)({value:a.image||"{}"}),alt:null!=(i=a.name)?i:""})}),trailingContent:(0,x.jsx)(nt.$,{variant:"outline",size:"small",text:s(an.addButtonLabel),onClick:R,"data-testid":"recent-items-card-v2-add-button"})}})})})},hn=n.memo(vn);var fn=r(71828),xn=r(52075),yn=r(56268),Cn=r(68356).P;const In=s.I4.div.withConfig({componentId:"sc-1htxpyp-0"})(["width:100%;position:relative;display:flex;"]),bn=s.I4.div.withConfig({componentId:"sc-1htxpyp-1"})(["position:absolute;inset-block-start:50%;transform:translateY(-50%);z-index:",";display:flex;align-items:center;"],Cn.zIndex.overlay),wn=(0,s.I4)(bn).withConfig({componentId:"sc-1htxpyp-2"})(["inset-inline-start:-20px;"]),En=(0,s.I4)(bn).withConfig({componentId:"sc-1htxpyp-3"})(["inset-inline-end:-20px;"]),jn=e=>{var t;let r=e.children;const i=(0,n.useState)(0),a=i[0],d=i[1],o=(0,n.useState)(0),s=o[0],l=o[1],c=(0,n.useRef)(null),u=(0,n.useRef)(null);(0,n.useEffect)((()=>{var e,t;const r=null!=(e=null==(t=c.current)?void 0:t.clientWidth)?e:0;r>0&&r!==s&&l(r)}),[r,s]);const m=(0,n.useCallback)((()=>{d((e=>e+1))}),[]),g=(0,n.useCallback)((()=>{d((e=>e-1))}),[]),p=r.length,v=(null==u||null==(t=u.current)?void 0:t.offsetWidth)||1050,h=s+xn.D.SPACER,f=Math.min(v,1050),y=window.innerWidth>=f,C=y?f:window.innerWidth,I=h>xn.D.SPACER?Math.floor((C-16)/h):0,b=I*h,w=p>1?Math.round((C-b)/2):16,E=0!==a,j=I>0&&(a+1)*I<p;(0,n.useEffect)((()=>{if(I>0){const e=Math.max(0,Math.ceil(p/I)-1);d((t=>Math.min(t,e)))}}),[I,p]);const k=a*b,O=(0,n.useMemo)((()=>r.map(((e,t)=>{const r=n.isValidElement(e)?e.key:null;return(0,x.jsx)(fn.Ox,{ref:c,"data-testid":"single-carousel-card",children:e},null!=r?r:"single_carousel_card_"+t)}))),[r]);return(0,x.jsxs)(In,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-CarouselContainer",ref:u,children:[E&&(0,x.jsx)(wn,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-LeftArrowWrapper",children:(0,x.jsx)(yn.D9,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-LeftArrow",onPrevious:g})}),(0,x.jsx)(fn.nF,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-CardContainerWrapper",hideScrollBar:!0,isMobile:!1,children:(0,x.jsxs)(fn.Q_,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-CardContainer",className:"responsive-carousel-card-container",isMobile:!1,$innerPadding:w,$isMaxWidth:y,$centerContent:!1,children:[(0,x.jsx)(fn.vy,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-CardsWrapper",$offset:k,children:O}),(null==r?void 0:r.length)>1&&(0,x.jsx)(fn.hK,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-Spacer"})]})}),j&&(0,x.jsx)(En,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-RightArrowWrapper",children:(0,x.jsx)(yn.UU,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-RightArrow",onNext:m})})]})};var kn=r(5865),On=r(66281),An=r(74286),Rn=r(33882),Dn=r(35135),Sn=r(40281);const Tn=e=>e.sanityId||e.lineId||"",Pn=e=>(0,Sn.jr)({type:e.type,sanityId:e.sanityId,_id:e.sanityId}),Mn=()=>{const e=(0,d.A)().formatMessage,t=(0,A._P)(A.N$.ENABLE_RECENT_ITEMS_ADD_TO_CART),r=(0,b.U)("mobile"),i=(()=>{const e=(0,d.A)().formatMessage,t=(0,o.Zp)(),r=(0,O.Z2)().user,i=(0,Rn.K)().checkItemAvailability,a=(0,$.oX)(),s=a.isStoreOpenAndAvailable,l=a.store,c=a.prices,u=(0,R.jg)(),m=u.addToCart,g=u.cartEntries,p=u.recent,v=p.pendingRecentItem,h=p.setPendingRecentItem,f=(0,On._)().vendor,x=(0,Dn.d)().showSnackbar,y=(0,An.CR)().setStoreLocatorCallbackUrl,C=(0,Kr.x)(),b=(0,n.use
1State)([]),w=b[0],E=b[1],j=(0,n.useState)(!1),k=j[0],A=j[1],D=(0,n.useState)(new Set),T=D[0],P=D[1],M=(0,n.useMemo)((()=>{var e;return(null!=(e=null==r?void 0:r.uniquePurchasedItems)?e:[]).filter((e=>!e.isDonation&&(0,U.xO)(e))).slice(0,10)}),[null==r?void 0:r.uniquePurchasedItems]);(0,n.useEffect)((()=>{var e;if(!s)return E(M),void A(!1);let t=!1;A(!0);const r=null!=(e=null==l?void 0:l.number)?e:"";return Promise.all(M.map((async e=>{const t=Pn(e);if(!t)return null;try{return(await i({vendor:f,storeNumber:r,itemId:t})).availabilityStatus===kn.r.AVAILABLE?e:null}catch(n){return null}}))).then((e=>{t||E(e.filter((e=>null!==e)))})).finally((()=>{t||A(!1)})),()=>{t=!0}}),[s,M,i,f,null==l?void 0:l.number]);const L=(0,n.useMemo)((()=>{const e=new Set(g.map((e=>e._id)).filter(Boolean));return w.filter((t=>!T.has(Tn(t))&&(!t.sanityId||!e.has(t.sanityId))))}),[w,g,T]);return(0,I.S)((()=>{var t;if(!s||!v||!c)return;const r=v;h(null);const n=Pn(r);n&&i({vendor:f,storeNumber:null!=(t=null==l?void 0:l.number)?t:"",itemId:n}).then((async t=>{if(t.availabilityStatus===kn.r.AVAILABLE){var n;const t=(await C(r,g)).cartEntry;m(t,{skipToast:!0}),x({content:e(an.itemAddedToCart,{itemName:null!=(n=r.name)?n:""}),autoClose:!0})}else{var i;P((e=>new Set(e).add(Tn(r)))),x({content:e(an.itemUnavailableAtLocation,{itemName:null!=(i=r.name)?i:""}),autoClose:!0})}})).catch((()=>{var t;P((e=>new Set(e).add(Tn(r)))),x({content:e(an.itemUnavailableAtLocation,{itemName:null!=(t=r.name)?t:""}),autoClose:!0})}))})),{visibleItems:L,isCheckingAvailability:k,handleAddPress:(0,n.useCallback)((async r=>{if(s){const t=Pn(r);var n;if(!t)return P((e=>new Set(e).add(Tn(r)))),void x({content:e(an.itemUnavailableAtLocation,{itemName:null!=(n=r.name)?n:""}),autoClose:!0});let s;try{var a;s=(await i({vendor:f,storeNumber:null!=(a=null==l?void 0:l.number)?a:"",itemId:t})).availabilityStatus}catch(u){var d;return P((e=>new Set(e).add(Tn(r)))),void x({content:e(an.itemUnavailableAtLocation,{itemName:null!=(d=r.name)?d:""}),autoClose:!0})}if(s===kn.r.AVAILABLE){var o;const t=(await C(r,g)).cartEntry;m(t,{skipToast:!0}),x({content:e(an.itemAddedToCart,{itemName:null!=(o=r.name)?o:""}),autoClose:!0})}else{var c;P((e=>new Set(e).add(Tn(r)))),x({content:e(an.itemUnavailableAtLocation,{itemName:null!=(c=r.name)?c:""}),autoClose:!0})}}else y(S.JZ.orders),h(r),t(S.JZ.storeLocator,{state:{fromRecentOrders:!0}})}),[s,x,e,i,f,null==l?void 0:l.number,m,C,g,y,h,t])}})(),a=i.visibleItems,s=i.isCheckingAvailability,l=i.handleAddPress;if(!t)return null;if(s)return(0,x.jsx)(un,{"data-testid":"recent-items-carousel-v2-loading"});if(0===a.length)return null;const c=a.map((e=>(0,x.jsx)(hn,{"data-testid":"recent-items-carousel-v2-index-RecentItemsCardV2",cartEntry:e,onAddPress:l},e.sanityId)));return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(un,{"data-testid":"recent-items-carousel-v2",children:[(0,x.jsx)(mn,{"data-testid":"recent-items-carousel-v2-index-SectionHeader",children:(0,x.jsx)(Ee.qH,{"data-testid":"recent-items-carousel-v2-index-TitleMedium",children:e({id:"recentItems"})})}),r?(0,x.jsx)(sn,{"data-testid":"recent-items-carousel-v2-index-ItemsScrollContainer",children:c}):(0,x.jsx)(jn,{"data-testid":"recent-items-carousel-v2-index-ResponsiveCarouselV2",children:c})]}),r&&(0,x.jsx)(ln,{"data-testid":"recent-items-carousel-v2-index-BlockDivider",type:"block"})]})};var Ln=r(49426),Nn=r(68356).P;const _n=s.I4.div.withConfig({componentId:"sc-tqmpzm-0"})(["display:flex;flex-direction:column;align-items:center;width:100%;flex:1;","{flex:0;}"],Nn.desktop),Fn=s.I4.div.withConfig({componentId:"sc-tqmpzm-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;flex:1;"]),Vn=s.I4.div.withConfig({componentId:"sc-tqmpzm-2"})(["margin-block-end:1.5rem;"]),$n=s.I4.div.withConfig({componentId:"sc-tqmpzm-3"})(["width:100%;","{padding-block-start:2rem;padding-block-end:2rem;max-width:320px;margin-block-start:0;}"],Nn.desktop),Bn=()=>{const e=(0,d.A)().formatMessage,t=(0,o.Zp)(),r=(0,n.useCallback)((()=>t(S.JZ.menu)),[t]);return(0,x.jsxs)(_n,{"data-testid":"v2-recent-orders-empty-v2-EmptyContainer",children:[(0,x.jsxs)(Fn,{"data-testid":"v2-recent-orders-empty-v2-ContentGroup",children:[(0,x.jsx)(Vn,{"data-testid":"v2-recent-orders-empty-v2-LogoWrapper",children:(0,x.jsx)(Ln.p,{"data-testid":"v2-recent-orders-empty-v2-PaymentFailedLogo",width:160,height:160})}),(0,x.jsx)(Ee.UF,{"data-testid":"v2-recent-orders-empty-v2-TitleLarge",children:e({id:"noOrdersItemsYetV2",defaultMessage:"Recent orders & items will appear here"})}),(0,x.jsx)(Ee.uv,{"data-testid":"v2-recent-orders-empty-v2-BodyMedium",children:e({id:"recentOrdersEmptySubHeader"})})]}),(0,x.jsx)($n,{"data-testid":"v2-recent-orders-empty-v2-CTAWrapper",children:(0,x.jsx)(nt.$,{"data-testid":"v2-recent-orders-empty-v2-Button",fullWidth:!0,text:e({id:"startOrder"}),onClick:r,preserveLabelCasing:!0})})]})};var Un=r(14723),zn=r(30526),Wn=r(47335),Hn=r(70849);const qn=(0,zn.$)((e=>{let t=e.type;
1const r=(void 0===t?Hn.S.LIST:t)===Hn.S.GRID;return(0,x.jsxs)(Wn.X5,{"data-testid":"list-item-list-item-skeleton-ListItemWrapper",$isGrid:r,$isLoading:!0,"aria-label":"list-item-loader",children:[r?(0,x.jsx)(Un.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader",height:"9.875rem",radius:"0.5rem"}):(0,x.jsx)(Un.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader-1",width:"6.25rem",height:"5rem",radius:"0.5rem"}),(0,x.jsx)(Wn.J3,{"data-testid":"list-item-list-item-skeleton-MainContainer",$isGrid:r,children:(0,x.jsxs)(Wn.DF,{"data-testid":"list-item-list-item-skeleton-MainContent",$isGrid:r,children:[(0,x.jsxs)(Wn.Y0,{"data-testid":"list-item-list-item-skeleton-BodySkeleton",$isGrid:r,children:[(0,x.jsx)(Un.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader-2",width:"6.25rem",height:"1.25rem",radius:"0.625rem"}),!r&&(0,x.jsx)(Un.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader-3",width:"10.625rem",height:"1rem",radius:"0.5rem"})]}),r&&(0,x.jsx)(Un.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader-4",height:"1rem",radius:"0.5rem"}),!r&&(0,x.jsx)(Wn.Gs,{"data-testid":"list-item-list-item-skeleton-TrailingWrapper",children:(0,x.jsx)(Un.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader-5",width:"1.625rem",height:"1.25rem",radius:"0.625rem"})})]})})]})})),Gn=s.I4.div.withConfig({componentId:"sc-gev1cg-0"})(["display:flex;flex-direction:column;padding-block-start:16px;"]),Zn=s.I4.section.withConfig({componentId:"sc-gev1cg-1"})(["width:100%;"]),Yn=s.I4.div.withConfig({componentId:"sc-gev1cg-2"})(["margin-block-end:24px;"]),Jn=s.I4.div.withConfig({componentId:"sc-gev1cg-3"})(["display:flex;flex-direction:row;gap:16px;overflow:hidden;padding-block-end:20px;"]),Kn=s.I4.div.withConfig({componentId:"sc-gev1cg-4"})(["width:309px;flex-shrink:0;"]),Xn=s.I4.div.withConfig({componentId:"sc-gev1cg-5"})(["display:flex;flex-direction:column;gap:24px;padding-block-start:16px;"]),Qn=()=>(0,x.jsxs)(Gn,{"data-testid":"recent-orders-skeleton-v2","aria-hidden":!0,children:[(0,x.jsxs)(Zn,{"data-testid":"recent-items-skeleton-v2",children:[(0,x.jsx)(Yn,{"data-testid":"v2-recent-orders-skeleton-v2-RecentItemsTitleSkeleton",children:(0,x.jsx)(Un.j,{"data-testid":"v2-recent-orders-skeleton-v2-SkeletonLoader",width:"140px",height:"28px",radius:"8px"})}),(0,x.jsx)(Jn,{"data-testid":"v2-recent-orders-skeleton-v2-RecentItemsCardsSkeleton",children:Array.from({length:10},((e,t)=>(0,x.jsx)(Kn,{"data-testid":"v2-recent-orders-skeleton-v2-RecentItemCardSkeleton",children:(0,x.jsx)(qn,{"data-testid":"v2-recent-orders-skeleton-v2-ListItemSkeleton"})},"recent-item-"+t)))})]}),(0,x.jsx)(Vt,{"data-testid":"v2-recent-orders-skeleton-v2-FullWidthDivider"}),(0,x.jsx)(Xn,{"data-testid":"v2-recent-orders-skeleton-v2-OrdersSectionSkeleton",children:Array.from({length:20},((e,t)=>(0,x.jsx)(qn,{"data-testid":"v2-recent-orders-skeleton-v2-ListItemSkeleton-1"},"skeleton-"+t)))})]}),ei=new Set([Fe.G.App,Fe.G.Mobile,Fe.G.Web,Fe.G.Receipt]),ti=e=>!ei.has(e.channel)&&(e.channel===Fe.G.Restaurant||e.pointsEarned+e.bonusPointsEarned>0),ri=e=>{let t=e.loading,r=e.orders;const i=(0,d.A)().formatMessage,a=(0,o.Zp)(),l=(0,Ce.q)(),c=(0,be.I)().theme,u=(0,A._P)(A.N$.ENABLE_V2_REORDERING_EXPERIENCE),m=(0,A._P)(A.N$.ENABLE_QRCODE_REFILL),g=(0,b.U)("desktop"),p=(0,Ie.L)(),v=(0,fe.j)().checkRecentOrdersForRefill,h=(0,n.useCallback)((()=>a(S.JZ.account)),[a]),f=(0,n.useMemo)((()=>r.filter((e=>{var t;return null==(t=e.cart)||null==(t=t.cartEntries)?void 0:t.length}))),[r]),y=(0,n.useState)((()=>new Set)),C=y[0],I=y[1],w=(0,n.useState)((()=>new Date)),E=w[0],j=w[1];(0,n.useEffect)((()=>{I(new Set)}),[f]);const k=(0,n.useMemo)((()=>function(e,t,r){void 0===t&&(t=new Set),void 0===r&&(r=new Date);const n=[],i=[];for(const a of e)t.has(a.rbiOrderId)||!cr(a,r)&&!ir(a)?i.push(a):n.push(a);return n.sort(ur),i.sort(ur),{ongoingCandidates:n,completed:i}}(f,C,E)),[f,C,E]),O=k.ongoingCandidates,R=(e=>{let t=e.orders;const r=(0,Ie.L)(),i=(0,Te.P)().loyaltyUser,a=(0,_e.eqf)({skip:!r||!(null!=i&&i.id),variables:{loyaltyId:(null==i?void 0:i.id)||""},errorPolicy:"all"}),d=a.data,o=a.loading,s=(0,n.useMemo)((()=>{var e,t;return r&&null!=(e=null==d||null==(t=d.loyaltyUser)?void 0:t.transactions)?e:[]}),[d,r]);return{items:(0,n.useMemo)((()=>[...t.map((e=>({type:"order",date:e.createdAt,order:e}))),...s.filter(ti).map((e=>({type:"transaction",date:e.createdAt,transaction:e})))].sort(((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime()))),[t,s]),isLoyaltyEnabled:r,isTransactionsLoading:o}})({orders:k.completed}),D=R.items,T=R.isTransactionsLoading,P=t||T,M=(0,n.useRef)(!1);(0,n.useEffect)((()=>{t||!u||M.current||(M.current=!0,function(e,t){e.trackEvent({name:Oe.og.PAGE_VIEW,type:Oe.wf.Other,attributes:{[Oe.Ny.PATH]:t}})}(l,S.JZ.orders))}),[l,t,u]),(0,n.useEffect)((()=>
1{if(0===O.length)return;const e=setInterval((()=>{j(new Date)}),ye.Wx);return()=>clearInterval(e)}),[O.length]);const L=(0,n.useCallback)((e=>{I((t=>{if(t.has(e))return t;const r=new Set(Array.from(t));return r.add(e),r}))}),[]),N=(0,n.useCallback)((e=>rr(e)?(0,x.jsx)(Br,{"data-testid":"v2-recent-orders-v2-OngoingDeliveryOrderCardV2",order:e,onOrderTerminal:L},e.rbiOrderId):(0,x.jsx)(Gr,{"data-testid":"v2-recent-orders-v2-OngoingPickupOrderCardV2",order:e,onOrderTerminal:L},e.rbiOrderId)),[L]);(0,n.useEffect)((()=>{m&&f.length&&v(f)}),[v,m,f]);const _=(0,x.jsxs)(x.Fragment,{children:[p&&(0,x.jsx)(Ne,{"data-testid":"v2-recent-orders-v2-LoyaltyOrderBannerV2"}),(0,x.jsxs)(Pt,{"data-testid":"v2-recent-orders-v2-OrdersListContainer",children:[(0,x.jsx)(xe.g,{"data-testid":"v2-recent-orders-v2-RefillDrinksCardV2",timerSource:"recentOrder",outlinedShell:!0}),(0,x.jsx)(Mn,{"data-testid":"v2-recent-orders-v2-RecentItemsCarouselV2"}),O.length>0&&(0,x.jsx)($t,{"data-testid":"v2-recent-orders-v2-OngoingOrdersSection",children:O.map(N)}),D.length>0&&(0,x.jsx)(Bt,{"data-testid":"v2-recent-orders-v2-CompletedOrdersSection",children:D.map((e=>"order"===e.type?(0,x.jsx)(Mr,{"data-testid":"v2-recent-orders-v2-OrderCardV2",order:e.order,showPointsRow:p},e.order.rbiOrderId):(0,x.jsx)(yr,{"data-testid":"v2-recent-orders-v2-LoyaltyTransactionCard",transaction:e.transaction},e.transaction.id)))})]})]});return f.length||D.length||P?(0,x.jsxs)(Nt,{"data-testid":"v2-recent-orders-v2-RecentOrdersPageContainer-1",children:[g?(0,x.jsx)(s.NP,{"data-testid":"v2-recent-orders-v2-ThemeProvider",theme:c,children:(0,x.jsx)(we.x2,{"data-testid":"v2-recent-orders-v2-SubLevelNavContainer",children:(0,x.jsx)(we.Wx,{"data-testid":"v2-recent-orders-v2-MaxWidthContainer",children:(0,x.jsx)(we.jy,{"data-testid":"v2-recent-orders-v2-TopContainer",children:(0,x.jsxs)(we.hH,{"data-testid":"v2-recent-orders-v2-BackNavigationContainer",onClick:h,style:{cursor:"pointer"},children:[(0,x.jsx)(je.I,{"data-testid":"back-arrow-button",icon:ke.A,variant:"standard",size:"large","aria-label":i({id:"back"})}),(0,x.jsx)(we.Dc,{"data-testid":"v2-recent-orders-v2-BreadcrumbContainer",$language:"latin",children:(0,x.jsx)(we.UC,{"data-testid":"v2-recent-orders-v2-Content",children:i({id:"account"})})})]})})})})}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(Mt,{"data-testid":"v2-recent-orders-v2-HeaderContainer",children:[(0,x.jsx)(Lt,{"data-testid":"v2-recent-orders-v2-BackArrowWrapper",children:(0,x.jsx)(je.I,{"data-testid":"back-arrow-button",icon:ke.A,onClick:h,variant:"standard",size:"large","aria-label":i({id:"back"})})}),(0,x.jsx)(Ee.UF,{"data-testid":"v2-recent-orders-v2-TitleLarge",children:i({id:"orderHistory"})})]}),(0,x.jsx)(Vt,{"data-testid":"v2-recent-orders-v2-FullWidthDivider"}),P?(0,x.jsx)(Qn,{"data-testid":"v2-recent-orders-v2-RecentOrdersSkeletonV2"}):_,(0,x.jsx)(Vt,{"data-testid":"v2-recent-orders-v2-FullWidthDivider-1",style:{marginBlockStart:"16px"}})]}),g&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Vt,{"data-testid":"v2-recent-orders-v2-FullWidthDivider-2"}),(0,x.jsxs)(_t,{"data-testid":"v2-recent-orders-v2-DesktopContentContainer",children:[(0,x.jsx)(Mt,{"data-testid":"v2-recent-orders-v2-HeaderContainer-1",children:(0,x.jsx)(Ee.UF,{"data-testid":"v2-recent-orders-v2-TitleLarge-1",children:i({id:"orderHistory"})})}),P?(0,x.jsx)(Qn,{"data-testid":"v2-recent-orders-v2-RecentOrdersSkeletonV2-1"}):_]})]})]}):(0,x.jsx)(Nt,{"data-testid":"v2-recent-orders-v2-RecentOrdersPageContainer",children:(0,x.jsx)(Ft,{"data-testid":"v2-recent-orders-v2-EmptyStateWrapper",children:(0,x.jsx)(Bn,{"data-testid":"v2-recent-orders-v2-RecentOrdersEmptyV2"})})})};var ni=r(68356).P;const ii=s.I4.div.withConfig({componentId:"sc-vnl4sb-0"})(["margin-inline-start:auto;margin-inline-end:auto;max-width:",";padding-block-end:0;padding-block-start:0;width:calc(100% - ",");& > div{padding-block-start:0;}"],ni.layout.sectionMaxWidth,"2rem"),ai=s.I4.div.withConfig({componentId:"sc-vnl4sb-1"})(["min-height:70vh;display:flex;flex-direction:column;justify-content:center;"]),di=s.I4.div.withConfig({componentId:"sc-vnl4sb-2"})(["width:100%;& > *:not(:first-child){margin-block-start:",";}","{padding-block-start:",";}"],D.M.$spacing4,ni.desktop,D.M.$spacing7),oi=s.I4.div.withConfig({componentId:"sc-vnl4sb-3"})(["text-align:center;"]),si=s.I4.div.withConfig({componentId:"sc-vnl4sb-4"})(["padding-block-start:",";padding-block-end:",";padding-inline:0;"],D.M.$spacing5,D.M.$spacing11),li=s.I4.div.withConfig({componentId:"sc-vnl4sb-5"})(["position:fixed;inset:0;z-index:500;background:",";overflow-y:auto;","{position:static;z-index:auto;background:none;display:flex;overflow:visible;padding-block-end:",";}& > div{flex:1;padding-block:0;}& > div > div{overflow:visible;min-height:auto;}"],(e=>e.theme.token("background-default")),ni.desktop,D.M.$spacing11),ci=s.I4.div.withConfig({componentId:"sc-vnl4sb-6"})(["position:fixed;inset:0;z-index:9999;background:",";overflow:hidden;& > div{height:100dvh;}& > div > div{height:100dvh;overflow:hidden;}"],(e=>e.theme.token("background-default"))),ui=()=>{var e;const t=(0,o.Zp)(),r=(0,b.U)("headerMobile"),v=(0,O.Z2)().refreshCurrentUserWithNewSession,h=(0,o.g)()["*"],f=(0,n.use
1State)(h||""),y=f[0],D=f[1],M=(0,n.useState)(!1),L=M[0],N=M[1],_=(0,n.useState)(null),F=_[0],V=_[1],$=(0,E.k)({}),B=$.loading,U=$.data,z=$.refetch,W=$.orders,H=(0,R.jg)().unavailableCartEntries,q=(0,n.useCallback)((e=>{D(e),e&&t(S.JZ.orders+"/"+e,{replace:!0})}),[t]),G=(0,n.useCallback)((()=>{D(""),(0,l.rf)(),t(S.JZ.orders,{replace:!0})}),[t]),Z=(0,n.useState)(pe.l.SHOW_DETAILS),Y=Z[0],J=Z[1],K=(0,d.A)().formatMessage,X=(0,w.Y)(),Q=(0,s.DP)(),ee=(0,n.useCallback)((()=>{z()}),[z]),te=(0,n.useCallback)((()=>{t(S.JZ.base)}),[t]),re=(0,A._P)(A.N$.ENABLE_RECENT_ITEMS_ADD_TO_CART),ne=(0,A._P)(A.N$.ENABLE_V2_REORDERING_EXPERIENCE),ie=(0,A._P)(A.N$.ENABLE_V2_CART_CHECKOUT)&&ne;(0,I.S)((()=>{v()})),(0,n.useEffect)((()=>{H.length&&N(!0)}),[L,N,H.length]);const ae=(0,n.useCallback)((()=>{N(!1),t(S.JZ.cart)}),[t]),de=(0,x.jsx)(C,{"data-testid":"account-orders-index-RefreshButton",onClick:ee,children:K({id:"refresh"})}),oe=(null==U||null==(e=U.userOrders)?void 0:e.orders)||[],se=!!oe.length;if(F){const e=(0,x.jsx)(T.L,{"data-testid":"account-orders-index-CancelOrderSuccessView",variant:F,onClose:te,onGoHome:te});return r?(0,i.createPortal)((0,x.jsx)(ci,{"data-testid":"account-orders-index-MobileCancelResultOverlay",children:e}),document.body):(0,x.jsx)(li,{"data-testid":"account-orders-index-CancelResultWrapper",children:e})}return ie?(0,x.jsx)(ge,{"data-testid":"account-orders-index-AccountOrderWrapperV2",children:(0,x.jsxs)(k.k,{"data-testid":"account-orders-index-AuthRequired",children:[(0,x.jsx)(a.mg,{"data-testid":"account-orders-index-Helmet",title:K({id:"recentOrders"})}),(0,x.jsx)(ri,{"data-testid":"account-orders-index-RecentOrdersV2",loading:B,orders:oe})]})}):(0,x.jsx)(si,{"data-testid":"account-orders-index-AccountOrderWrapper",children:(0,x.jsxs)(k.k,{"data-testid":"account-orders-index-AuthRequired-1",children:[(0,x.jsx)(a.mg,{"data-testid":"account-orders-index-Helmet-1",title:K({id:"recentOrders"})}),(0,x.jsx)(ii,{"data-testid":"account-orders-index-OrdersContainer",children:(0,x.jsx)(p.s,{"data-testid":"account-orders-index-RefillDrinksQRCodeButton",recentOrders:W,timerSource:"recentOrder"})}),X&&(0,x.jsxs)(ii,{"data-testid":"account-orders-index-OrdersContainer-1",children:[(0,x.jsx)(m.l,{"data-testid":"account-orders-index-BackArrowHistory"}),re&&(0,x.jsx)(j.g,{"data-testid":"account-orders-index-AccountLayout",header:K({id:"recentItems"}),fullWidth:!0,mobileContainerPadding:"1.25rem 0 0 0",desktopContainerPadding:"0",children:(0,x.jsx)(g.u,{"data-testid":"account-orders-index-RecentItemsCarousel",locationName:"Recent Orders Page",containerHasTopPadding:!1})})]}),(0,x.jsx)(j.g,{"data-testid":"account-orders-index-AccountLayout-1",header:se?K({id:"recentOrders"}):null,fullWidth:!0,mobileContainerPadding:"1.25rem 0 0 0",desktopContainerPadding:"0",children:B?(0,x.jsx)(c.b,{"data-testid":"account-orders-index-LoadingAnimation",fillColor:Q.token("icon-active")}):(0,x.jsx)(ii,{"data-testid":"account-orders-index-OrdersContainer-2",children:se?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(oi,{"data-testid":"account-orders-index-OfferDisclaimer",children:K({id:"recentOrdersDisclaimer"})}),de,(0,x.jsx)(di,{"data-testid":"account-orders-index-OrdersPanel",children:oe.map((e=>(0,x.jsx)(ve,{"data-testid":"account-orders-index-Order",order:e,handleDisplayDetailsModal:q,setModalType:J,onModalDismiss:G},e.rbiOrderId)))})]}):(0,x.jsx)(ai,{"data-testid":"account-orders-index-OrdersEmptyWrapper",children:(0,x.jsx)(he,{"data-testid":"account-orders-index-OrdersEmpty",children:de})})})}),!ne&&y&&(0,x.jsx)(P.e,{"data-testid":"account-orders-index-DetailsModal",rbiOrderId:y,onModalDismiss:G,onCancelResult:V,type:Y,setModalType:J,setDetailsModalId:q,offsetForNavV2Header:!0}),L&&(0,x.jsx)(u.Q9,{"data-testid":"account-orders-index-ModalOrderUnavailable",onDismiss:ae,items:H})]})})}},56770:(e,t,r)=>{r.d(t,{k:()=>s,o:()=>l});var n=r(58168),i=(r(59284),r(59279)),a=r(12577),d=r(99533),o=r(60712);const s=e=>{let t=e.children;const r=(0,i.A)(),n=r.isAuthenticated,o=r.refreshCurrentUser,s=n();return(0,a.d)(),(0,d.S)((()=>{s&&o()})),s&&t},l=e=>t=>(0,o.jsx)(s,{"data-testid":"auth-required-index-AuthRequired",children:(0,o.jsx)(e,(0,n.A)({"data-testid":"auth-required-index-Component"},t))})},33715:(e,t,r)=>{r.d(t,{G:()=>n});let n=function(e){return e.App="APP",e.Campaign="CAMPAIGN",e.InitialPointBalance="INITIAL_POINT_BALANCE",e.Mobile="MOBILE",e.Orderless="ORDERLESS",e.PointsExpiration="POINTS_EXPIRATION",e.Prepaid="PREPAID",e.Quest="QUEST",e.Receipt="RECEIPT",e.Remediation="REMEDIATION",e.Restaurant="RESTAURANT",e.Support="SUPPORT",e.ThirdParty="THIRD-PARTY",e.Unsubscription="UNSUBSCRIPTION",e.Web="WEB",e}({})},67775:(e,t,r)=>{r.d(t,{ZW:()=>u,fX:()=>g,fp:()=>p,pX:()=>m});var n=r(19527);const i="ProgressBar.pickup.orderPlaced",a="ProgressBar.pickup.readyForPickup",d="ProgressBar.pickup.pickedUp",o="ProgressBar.pickup.heading.initial",s="ProgressBar.pickup.heading.inProgress",l="ProgressBar.pickup.heading.readyForPickup",c="ProgressBar.pickup.heading.pickedUp",u=e=>[{label:e({id:i}),value:1},{label:e({id:a}),value:2},{label:e({id:d}),value:3}],m=(e,t)=>
1{switch(e){case n.l.PREPARED:return t({id:a});case n.l.DONE:return t({id:d});case n.l.CREATED:case n.l.PRICED:case n.l.COMMITTED:case n.l.PREPARING:default:return t({id:i})}},g=(e,t)=>{switch(e){case n.l.PREPARING:return t({id:s});case n.l.PREPARED:return t({id:l});case n.l.DONE:return t({id:c});case n.l.CREATED:case n.l.PRICED:case n.l.COMMITTED:default:return t({id:o})}},p=(e,t)=>{switch(e){case n.l.PREPARING:case n.l.PREPARED:return t({id:"OrderConfirmation.pickupSoon",defaultMessage:"Pick up soon"});case n.l.DONE:return t({id:"OrderConfirmation.pickedUp",defaultMessage:"Picked up"});case n.l.CREATED:case n.l.PRICED:case n.l.COMMITTED:default:return t({id:"now"})}}},39815:(e,t,r)=>{r.d(t,{L:()=>x,o:()=>y});var n=r(59284),i=r(94390),a=r(48681),d=r(96290),o=r(90182),s=r(20147),l=r(53683),c=r(40937),u=r(60129),m=r(90748),g=r(39089),p=r(12070),v=r(60712);const h=(0,s.I4)(l.rA).withConfig({componentId:"sc-1tnzcdw-0"})(["display:flex;align-items:center;gap:0.5rem;width:44px;justify-self:start;"]),f=s.I4.div.withConfig({componentId:"sc-1tnzcdw-1"})(["position:fixed;inset:0;z-index:9999;background:",";overflow:hidden;& > div{height:100dvh;}& > div > div{height:100dvh;overflow:hidden;}"],(e=>e.theme.token("background-default"))),x=e=>{let t=e.onClose,r=e.onGoHome,n=e.variant,a=void 0===n?p.z.SUCCESS:n;const o=(0,(0,d.A)().formatMessage)({id:a===p.z.FAILED?"cancelOrderFailedHeading":"cancelOrderSuccessHeading"});return(0,v.jsx)(u.Kd,{"data-testid":"delivery-cancel-order-success-page-PageWrap",children:(0,v.jsxs)(u.qm,{"data-testid":"delivery-cancel-order-success-page-InnerBox",children:[(0,v.jsxs)(m.B3,{"data-testid":"delivery-cancel-order-success-page-HeaderContainer",children:[t?(0,v.jsx)(h,{onClick:t,variant:l.Vs.TEXT_ONLY,"data-testid":"cancel-success-close",children:(0,v.jsx)(m.iX,{"data-testid":"delivery-cancel-order-success-page-CloseButtonIcon",children:(0,v.jsx)(i.I,{"data-testid":"delivery-cancel-order-success-page-Icon",icon:"close",color:"icon-header-contrast","aria-hidden":!0})})}):(0,v.jsx)(m.oq,{to:g.JZ.base,variant:l.Vs.TEXT_ONLY,"data-testid":"cancel-success-close",children:(0,v.jsx)(m.iX,{"data-testid":"delivery-cancel-order-success-page-CloseButtonIcon-1",children:(0,v.jsx)(i.I,{"data-testid":"delivery-cancel-order-success-page-Icon-1",icon:"close",color:"icon-header-contrast","aria-hidden":!0})})}),(0,v.jsx)(m.zB,{"data-testid":"delivery-cancel-order-success-page-CenteredTitle",children:o})]}),(0,v.jsx)(p.Y,{"data-testid":"delivery-cancel-order-success-page-CancelOrderSuccessScreen",onGoHome:r,variant:a})]})})},y=()=>{var e;const t=(0,o.Zp)(),r=(0,c.U)("headerMobile"),i=(0,o.zy)().state,d=null!=(e=null==i?void 0:i.variant)?e:p.z.SUCCESS,s=n.useCallback((()=>{t(g.JZ.base)}),[t]);(0,n.useEffect)((()=>{r||window.scrollTo({top:0,left:0,behavior:"auto"})}),[r,d]);const l=(0,v.jsx)(x,{"data-testid":"delivery-cancel-order-success-page-CancelOrderSuccessView",variant:d,onClose:s,onGoHome:s});return r?(0,a.createPortal)((0,v.jsx)(f,{"data-testid":"delivery-cancel-order-success-page-MobileCancelSuccessOverlay",children:l}),document.body):l}},60129:(e,t,r)=>{r.d(t,{Av:()=>v,BK:()=>R,DH:()=>w,Kd:()=>u,MG:()=>x,P4:()=>P,RL:()=>b,Re:()=>k,Sg:()=>T,WT:()=>A,eY:()=>y,fK:()=>j,fW:()=>D,ic:()=>m,id:()=>C,p:()=>I,qM:()=>f,qm:()=>g,s4:()=>p,sM:()=>S,u3:()=>O,w:()=>h,wA:()=>E});var n=r(20147),i=r(21199),a=r(51180),d=r(53683),o=r(68356),s=r(40767),l=r(68376),c=r(84662);const u=n.Ay.div.withConfig({componentId:"sc-vq1yu1-0"})(["",";flex:1;width:100%;display:flex;justify-content:center;","{padding-block:10vh;}"],l.Hp,o.P.desktop),m=(0,n.Ay)(d.t5).withConfig({componentId:"sc-vq1yu1-1"})(["",";"],l.Hp),g=n.Ay.div.withConfig({componentId:"sc-vq1yu1-2"})(["",";flex:1;overflow:auto;","{max-width:",";border-radius:",";box-shadow:",";min-height:0;}"],l.Hp,o.P.desktop,o.P.layout.smallerSectionMaxWidth,o.P.borderRadius,o.P.boxShadow),p=n.Ay.div.withConfig({componentId:"sc-vq1yu1-3"})(["margin-block-start:",";margin-block-end:0;margin-inline:auto;display:flex;flex-direction:column;align-items:center;> *{width:90%;}overflow:auto;&.claims-optimization{margin-block-start:0;}"],(e=>e.$claimsOptimization?"0":"2rem")),v=n.Ay.h1.withConfig({componentId:"sc-vq1yu1-4"})(["font-size:2rem;font-weight:",";font-family:",";line-height:",";text-align:center;margin-block-start:",";","{font-size:1.5rem;}",""],o.P.fontWeight.black,(e=>e.$claimsOptimization?o.P.fontFamily.brand:o.P.fontFamily.body),(e=>e.$claimsOptimization?"1.75rem":"1.25"),(e=>e.$claimsOptimization?"1.5rem":"initial"),o.P.mobile,(e=>e.$claimsOptimization&&"\n    font-weight: "+o.P.fontWeight.normal+";\n    \n    "+o.P.desktop+" {\n      font-size: 1.875rem;\n      line-height: 2rem;\n    }\n  ")),h=n.Ay.h2.withConfig({componentId:"sc-vq1yu1-5"})(["text-align:center;font-size:1.5rem;font-weight:",";font-family:",";margin-block-start:",";line-height:",";",""],(e=>e.$claimsOptimization?o.P.fontWeight.normal:o.P.fontWeight.black),(e=>e.$claimsOptimization?o.P.fontFamily.brand:o.P.fontFamily.body),(e=>e.$claimsOptimization?"1.5rem":"0"),(e=>e.$claimsOptimization?"1.75rem":"initial"),(e=>e.$claimsOptimization&&"\n    "+o.P.desktop+" {\n      font-size: 2rem;\n      line-height: 2rem;\n    }\n  ")),f=(0,n.Ay)(h).withConfig({componentId:"sc-vq1yu1-6"})(["font-size:1.2rem;"]),x=n.Ay.div.withConfig({componentId:"sc-vq1yu1-7"})(["&.claims-optimization{border:1px solid ",";border-radius:12px;padding:1rem;margin-block-end:1rem;}"],c.M.$blackOpacity10),y=n.Ay.div.withConfig({componentId:"sc-vq1yu1-8"})(["margin-block-end:1rem;margin-inline-start:-1rem;margin-inline-end:-1rem;padding-inline-start:1rem;padding-inline-end:1rem;padding-block-end:1rem;border-block-end:1px solid ",";"],c.M.$blackOpacity10),C=n.Ay.span.withConfig({componentId:"sc-vq1yu1-9"})(["svg{margin-block-start:2px;}"]),I=n.Ay.div.withConfig({componentId:"sc-vq1yu1-10"})(["width:100%;height:100vh;display:flex;align-items:center;justify-content:center;"]),b=n.Ay.div.withConfig({componentId:"sc-vq1yu1-11"})(["display:flex;flex-direction:column;","{max-width:12rem;}"],o.P.mobile),w=n.Ay.div.withConfig({componentId:"sc-vq1yu1-12"})(["display:flex;align-items:center;justify-content:space-between;border:1px solid #e0e0e0;border-radius:12px;padding:1rem;background-color:inherit;"]),E=n.Ay.div.withConfig({componentId:"sc-vq1yu1-13"})(["font-family:",";font-size:1rem;font-weight:400;line-height:1.25rem;"],o.P.fontFamily.brand),j=n.Ay.div.withConfig({componentId:"sc-vq1yu1-14"})(["margin-block-start:0.3rem;font-family:",";font-size:0.75rem;line-height:1rem;"],o.P.fontFamily.body),k=n.Ay.span.withConfig({componentId:"sc-vq1yu1-15"})(["background-color:#d1fae5;color:#387f49;padding:0.25rem 0.5rem;border-radius:8px;font:",";font-weight:500;"],s.Z.copyTwo),O=n.Ay.div.withConfig({componentId:"sc-vq1yu1-16"})(["display:flex;flex-direction:column;align-items:center;justify-content:space-between;width:100%;min-height:",";padding:",";box-sizing:border-box;text-align:center;margin-block-start:3rem;@media (max-width:480px){padding:1.5rem 0.75rem;min-height:65vh;}@media (min-width:769px) and (max-width:1024px){padding:2.5rem 1.5rem;min-height:70vh;}> div:first-child{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;width:100%;}"],(e=>e.$isMobile?"70vh":"75vh"),(e=>e.$isMobile?"2rem 1rem":"3rem 2rem")),A=n.Ay.div.withConfig({componentId:"sc-vq1yu1-17"})(["display:flex;justify-content:center;align-items:center;width:100%;padding:0 1rem;margin-block-start:2rem;flex-shrink:0;> div{width:100%;max-width:90%;display:flex;justify-content:center;align-items:center;@media (max-width:768px){max-width:100%;padding:0;}@media (min-width:769px) and (max-width:1024px){max-width:95%;}p{font-size:0.75rem;}}"]),R=n.Ay.div.withConfig({componentId:"sc-vq1yu1-18"})(["display:flex;align-items:center;justify-content:center;width:",";height:",";flex-shrink:0;padding:0.4rem;background-color:",";border-radius:50%;@media (max-width:480px){width:56px;height:56px;}svg{width:100%;height:100%;path{fill:#ffffff;stroke-width:1;}@media (max-width:480px){width:100%;height:100%;}}"],(e=>e.$isMobile?"64px":"80px"),(e=>e.$isMobile?"64px":"80px"),c.M.$success),D=n.Ay.div.withConfig({componentId:"sc-vq1yu1-19"})(["display:flex;align-items:center;justify-content:center;width:",";height:",";flex-shrink:0;padding:0.4rem;border-radius:50%;@media (max-width:480px){width:56px;height:56px;}svg{width:100%;height:100%;@media (max-width:480px){width:100%;height:100%;}}"],(e=>e.$isMobile?"64px":"80px"),(e=>e.$isMobile?"64px":"80px")),S=n.Ay.h2.withConfig({componentId:"sc-vq1yu1-20"})(["font:",";font-size:1.5rem;margin-block-end:",";line-height:1.75rem;text-align:center;max-width:90%;width:100%;@media (max-width:480px){max-width:95%;}@media (min-width:769px) and (max-width:1024px){max-width:85%;}"],s.Z.headerTwo,(e=>e.$isMobile?"0.75rem":"1rem")),T=n.Ay.p.withConfig({componentId:"sc-vq1yu1-21"})(["font:",";font-size:1rem;margin-block-end:",";line-height:1.25rem;text-align:center;max-width:90%;width:100%;@media (max-width:480px){max-width:95%;}@media (min-width:769px) and (max-width:1024px){max-width:85%;}"],s.Z.copyOne,(e=>e.$isMobile?"1rem":"2rem")),P=(0,n.Ay)(i.A).withConfig({componentId:"sc-vq1yu1-22"})(["","{padding-inline-start:0;padding-inline-end:0;}","{padding-inline-start:0;padding-inline-end:0;}"],a.aI,a.N_)},56268:(e,t,r)=>{r.d(t,{D9:()=>f,UU:()=>x});var n=r(58168),i=r(98587),a=r(59284),d=r(19382),o=r(30526),s=r(63358),l=r(22685),c=r(82837),u=r(20147);const m=u.Ay.button.withConfig({componentId:"sc-1yeqbun-1"})(["width:40px;height:40px;cursor:pointer;text-align:center;background-color:",";border:2px solid ",";box-sizing:border-box;box-shadow:0px 0px 6px 0px ",";border-radius:50%;",";&:hover,&:focus{background-color:",";box-sizing:border-box;border:2px solid ",";box-shadow:0px 0px 6px 0px ",";}&:focus-visible{outline-width:3px;outline-style:solid;outline-offset:2px;outline-color:",";box-sizing:border-box;border:2px solid ",";box-shadow:0px 0px 6px 0px ",";}"],(e=>
1e.theme.colorV2.container.inverse),(e=>e.theme.colorV2.container["outline-neutral-tonal"]),(e=>e.theme.colorV2.container["neutral-tonal-darkest"]),(e=>(e=>(0,u.AH)(["--bg-neutral:transparent;--bg-hover:",";"],e.colorV2.container["inverse-darker"]))(e.theme)),(e=>e.theme.colorV2.container["inverse-darker"]),(e=>e.theme.colorV2.container["secondary-darker"]),(e=>e.theme.colorV2.container["neutral-tonal-darkest"]),(e=>e.theme.colorV2.container["secondary-bright"]),(e=>e.theme.colorV2.container["outline-neutral-tonal"]),(e=>e.theme.colorV2.container["neutral-tonal-darkest"])),g=u.Ay.div.withConfig({componentId:"sc-1yeqbun-2"})(["width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-size:1.5rem;color:",";"],(e=>e.theme.colorV2.shape.secondary));var p=r(60712);const v=["onPrevious"],h=["onNext"],f=(0,o.$)((e=>{let t=e.onPrevious,r=void 0===t?()=>{}:t,o=(0,i.A)(e,v);const u=(0,d.I)().readingDirection,h=void 0===u?"ltr":u;return(0,p.jsx)(m,(0,n.A)({"data-testid":"pagination-pagination-Wrapper",name:"Previous page","aria-label":"Previous page",onClick:r},o,{children:s.A&&l.A&&(0,p.jsx)(g,{"data-testid":"left-arrow-icon",children:a.createElement(h===c.x.LTR?s.A:l.A)})}))})),x=(0,o.$)((e=>{let t=e.onNext,r=void 0===t?()=>{}:t,o=(0,i.A)(e,h);const u=(0,d.I)().readingDirection,v=void 0===u?"ltr":u;return(0,p.jsx)(m,(0,n.A)({"data-testid":"pagination-pagination-Wrapper-1",name:"Next page","aria-label":"Next page",onClick:r},o,{children:s.A&&l.A&&(0,p.jsx)(g,{"data-testid":"right-arrow-icon",children:a.createElement(v===c.x.LTR?l.A:s.A)})}))}))},42572:(e,t,r)=>{r.d(t,{H:()=>C});var n=r(30526),i=r(58168),a=r(98587),d=r(59284),o=r(19382),s=r(71223),l=r(60712);const c=()=>(0,l.jsx)(l.Fragment,{children:s.A&&d.createElement(s.A,{"aria-hidden":"true"})});var u=r(60188),m=r(78169),g=r(73337);const p=["segments","currentValue","variant"],v=e=>{let t=e.$variant;return(0,l.jsx)(u.Ah,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-SvgIcon",$variant:t,children:t===m.S.LOYALTY?(0,l.jsx)(c,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-LoyaltyIcons"}):g.A&&d.createElement(g.A,{"aria-hidden":"true"})})},h=(e,t,r)=>{if(r&&e===m.C.ACTIVE)return(0,l.jsx)(v,{$variant:t,"data-testid":"segment-circle-last"});if(t===m.S.LOYALTY&&e===m.C.ACTIVE)return(0,l.jsx)(u.Ah,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-SvgIcon-1",$variant:t,children:(0,l.jsx)(c,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-LoyaltyIcons-1"})});switch(e){case m.C.COMPLETED:return(0,l.jsx)(u.ng,{$variant:t,"data-testid":"segment-circle-completed"});case m.C.ACTIVE:return(0,l.jsx)(u.Un,{$variant:t,"data-testid":"segment-circle-active"});default:return(0,l.jsx)(u.bc,{$variant:t,"data-testid":"segment-circle-default"})}},f=e=>{let t=e.index,r=e.segment,n=e.isLast,i=e.circleState,a=e.leftTrackState,d=e.rightTrackState,s=e.isMidActive,c=e.variant;const g=(0,o.I)().readingDirection,p=void 0===g?"ltr":g;return(0,l.jsxs)(u.fT,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-SegmentWrapper",$state:i,$isLast:n,$variant:c,"aria-current":i===m.C.ACTIVE?"step":void 0,"aria-label":r.label+" - "+i.toLowerCase(),$midActive:s,children:[(0,l.jsx)(u.XT,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-SegmentContainer",children:0===t?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-div",style:{flex:1,visibility:"hidden"}}),h(s?m.C.COMPLETED:i,c,n),!n&&(0,l.jsx)(u.Bg,{$variant:c,$state:s?m.C.COMPLETED:d,$readingDirection:p,"data-testid":"right-segment-track-first",style:{position:"relative"},children:s&&(0,l.jsx)(u.rx,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-SegmentCircleWrapper",$readingDirection:p,children:h(m.C.ACTIVE,c,!1)})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Bg,{$variant:c,$state:a,$readingDirection:p,"data-testid":"left-segment-track",style:{position:"relative"},children:s&&(0,l.jsx)(u.rx,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-SegmentCircleWrapper-1",$readingDirection:p,children:h(m.C.A
1CTIVE,c,!1)})}),h(s?m.C.DEFAULT:i,c,n),n&&(0,l.jsx)("div",{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-div-1",style:{flex:1,visibility:"hidden"}}),!n&&(0,l.jsx)(u.Bg,{$variant:c,$state:d,$readingDirection:p,"data-testid":"right-segment-track"})]})}),(0,l.jsx)(u.jG,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-SegmentLabelContainer",$state:i,$isLast:n,$variant:c,$midActive:s,children:(0,l.jsx)(u.o5,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-SegmentLabel",$state:s?m.C.DEFAULT:i,children:r.label})})]},r.value)},x=e=>{let t=e.segments,r=e.currentValue,n=e.variant,d=(0,a.A)(e,p),o=0;for(let i=0;i<t.length-1;i++){const e=t[i],n=t[i+1];r===e.value&&(o=i),r>e.value&&r<n.value&&(o=i+1.5)}return r<t[0].value&&(o=-1),r>=t[t.length-1].value&&(o=t.length-1),(0,l.jsx)(u.mO,(0,i.A)({"data-testid":"segmented-progress-indicator-segmented-progress-indicator-Wrapper"},d,{children:t.map(((e,i)=>{const a=i===t.length-1,d=i===Math.floor(o)&&o%1!==0;let s;s=a&&o>=t.length-.5||i===o||d?m.C.ACTIVE:i<o?m.C.COMPLETED:m.C.DEFAULT;const c=e.value<=r?m.C.COMPLETED:m.C.DEFAULT,u=i+.5<=Math.floor(o)?m.C.COMPLETED:m.C.DEFAULT;return(0,l.jsx)(f,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-Segment",index:i,segment:e,isLast:a,circleState:s,leftTrackState:c,rightTrackState:u,isMidActive:d,variant:n},e.value)}))}))},y=d.memo(x),C=(0,n.$)(y)},60188:(e,t,r)=>{r.d(t,{Ah:()=>f,Bg:()=>u,Un:()=>p,XT:()=>h,bc:()=>g,fT:()=>s,jG:()=>l,mO:()=>o,ng:()=>v,o5:()=>c,rx:()=>m});var n=r(20147),i=r(78169);const a=e=>({primary:{default:e.colorV2.container["primary-tonal-darkest"],active:e.colorV2.container.primary,completed:e.colorV2.container.primary},secondary:{default:e.colorV2.container["secondary-tonal-darkest"],active:e.colorV2.container.secondary,completed:e.colorV2.container.secondary},loyalty:{default:e.colorV2.container["secondary-tonal-variant-darkest"],active:e.colorV2.container.loyalty,completed:e.colorV2.container.loyalty}}),d=e=>{let t=e.$state,r=e.$isLast,n=e.$variant,a=e.$midActive;const d=n===i.S.LOYALTY,o=t===i.C.ACTIVE,s=!d&&o;return s&&r&&a?"6px":s&&r||d&&o&&!a?"2px":s&&!a?"5px":"6px"},o=n.Ay.div.withConfig({componentId:"sc-95h508-0"})(["display:flex;justify-content:space-between;width:100%;"]),s=n.Ay.div.withConfig({componentId:"sc-95h508-1"})(["display:flex;align-items:center;flex-direction:column;position:relative;flex:1;padding-block-start:",";"],d),l=n.Ay.div.withConfig({componentId:"sc-95h508-2"})(["text-align:center;padding-block-start:",";"],d),c=n.Ay.h2.withConfig({componentId:"sc-95h508-3"})(["",";color:",";text-align:center;word-break:break-word;overflow-wrap:break-word;hyphens:auto;white-space:normal;"],(e=>e.theme.typography.footnoteRegular),(e=>{let t=e.$state,r=e.theme;return t===i.C.COMPLETED||t===i.C.ACTIVE?r.colorV2.text["main-darkest"]:r.colorV2.text.neutral})),u=n.Ay.div.withConfig({componentId:"sc-95h508-4"})(["flex:1;height:2px;background-color:",";z-index:-100;"],(e=>{let t=e.$state,r=e.$variant,n=e.theme;return t===i.C.COMPLETED||t===i.C.ACTIVE?a(n)[r].completed:a(n)[r].default})),m=n.Ay.div.withConfig({componentId:"sc-95h508-5"})(["position:absolute;inset-block-start:50%;",""],(e=>"rtl"===e.$readingDirection?"\n        transform: translate(50%, -50%);\n      ":"\n        transform: translate(-50%, -50%);\n      ")),g=n.Ay.div.withConfig({componentId:"sc-95h508-6"})(["width:8px;height:8px;border-radius:100px;background-color:",";"],(e=>{let t=e.$variant,r=e.theme;return a(r)[t].default})),p=n.Ay.div.withConfig({componentId:"sc-95h508-7"})(["width:10px;height:10px;border-radius:100px;box-shadow:",";background-color:",";text-align:center;"],(e=>{let t=e.$variant,r=e.theme;return"inset 0 0 0 2px "+a(r)[t].active}),(e=>e.theme.colorV2.shape.inverse)),v=n.Ay.div.withConfig({componentId:"sc-95h508-8"})(["width:8px;height:8px;border-radius:4px;background-color:",";text-align:center;"],(e=>{let t=e.$variant,r=e.theme;return a(r)[t].completed})),h=n.Ay.div.withConfig({componentId:"sc-95h508-9"})(["display:flex;align-items:center;width:100%;"]),f=n.Ay.div.withConfig({componentId:"sc-95h508-11"})(["width:11px;height:11px;display:flex;justify-content:center;align-items:center;color:",";padding:2.5px;font-size:0.6875rem;border-radius:100px;background-color:",";"],(e=>
1e.theme.colorV2.shape.inverse),(e=>{let t=e.$variant,r=e.theme;return a(r)[t].completed}))},78169:(e,t,r)=>{r.d(t,{C:()=>n,S:()=>i});let n=function(e){return e.DEFAULT="default",e.ACTIVE="active",e.COMPLETED="completed",e}({}),i=function(e){return e.PRIMARY="primary",e.SECONDARY="secondary",e.LOYALTY="loyalty",e}({})}}]);

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.