1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[7189],{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)},40746:(e,t,r)=>{r.d(t,{D:()=>n});let n=function(e){return e.RBIOrderId="RBIOrderId",e}({})},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],p=(0,n.use
1State)(!1),m=p[0],g=p[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}),x=h.data,f=h.startPolling,y=h.stopPolling,C=(null==x||null==(t=x.order)||null==(t=t.order)?void 0:t.status)||"",I=(0,n.useCallback)((()=>c&&r&&!m),[c,r,m]),b=(0,n.useCallback)((()=>m&&(!c||!r)),[m,c,r]),w=(0,n.useCallback)((()=>{I()&&(g(!0),f(1e4))}),[I,f]),E=(0,n.useCallback)((()=>{g(!1),y()}),[y]);return(0,n.useEffect)((()=>{I()&&w(),b()&&E()}),[I,b,w,E]),{isProgressBarEnabled:c,orderStatus:C,isPolling:m,startPolling:w,stopPolling:E}}},57189:(e,t,r)=>{r.r(t),r.d(t,{AccountOrders:()=>Bi});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),p=r(84159),m=r(61372),g=r(6308),v=r(94390),h=r(69886),x=r(53683),f=r(60712);const y=(0,s.Ay)(x.rA).withConfig({componentId:"sc-11xl8we-0"})(["background-color:",";"],(e=>e.theme.primaryBackground)),C=e=>{let t=e.children,r=e.onClick;return(0,f.jsx)(h.a,{"data-testid":"refresh-button-refresh-button-Box",center:!0,width:"100%",margin:"1rem auto",children:(0,f.jsx)(y,{"data-testid":"refresh-button-refresh-button-StyledActionButton",variant:x.Vs.OUTLINE,onClick:r,startIcon:(0,f.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(67544),k=r(56770),A=r(30279),O=r(90536),R=r(42147),D=r(84662),S=r(39089),T=r(39815);var P=r(67571),M=r(5608),L=r.n(M),N=r(73162),_=r(18659),B=r(77216),$=r(70222),F=r(4029),V=r(98804),U=r(18267),W=r(35898),H=r(16734),z=r(43033);const q=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,U.f)();return(()=>{const e=t.delivery,r=t.cart;if(!e)return!1;const n=r.serviceMode===R.h1.DELIVERY,i=new Set([z.ni.ORDER_CANCELLED,z.ni.ORDER_ABANDONED,z.ni.ORDER_DROPPED_OFF]);return n&&!i.has(e.status)})()?(0,f.jsx)(x.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,H.A)(new Date(n),i)>new Date;return a.has(r.serviceMode)&&d&&e===z.Re.INSERT_SUCCESSFUL})()?(0,f.jsx)(x.rA,{fullWidth:!0,"data-testid":"finish-order-button",onClick:o,disabled:n,children:s({id:"finishOrder"})}):(0,f.jsx)(x.rA,{fullWidth:!0,"data-testid":"reorder-button",onClick:a,isLoading:r,disabled:n,"aria-label":l({buttonType:"reorder",order:t}),children:s({id:"reorder"})})},G=()=>null;var Z=r(24104),Y=r(68605).P;const K=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;}"],Y.desktop,Y.layout.smallerSectionMaxWidth,Y.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;"],Y.color.grey.one,Y.fontFamily.base),X=s.Ay.p.withConfig({componentId:"sc-gupx60-2"})(["margin-block-start:1rem;margin-block-end:2rem;margin-inline:0;"]),Q=e=>{let t=e.header,r=e.subheader,n=e.linkText,i=e.linkTo;return(0,f.jsxs)(K,{"data-testid":"empty-state-index-Container",children:[(0,f.jsx)(Z.r,{"data-testid":"empty-state-index-BrandIcon"}),(0,f.jsx)(J,{"data-testid":"empty-state-index-Header",children:t}),(0,f.jsx)(X,{"data-testid":"empty-state-index-Subheader",children:r}),(0,f.jsx)(x.rA,{"data-testid":"empty-state-index-ActionButton",to:i,children:n})]})};var ee=r(40767),te=r(68605).P;D.M.$spacing1,D.M.$spacing1,D.M.$spacing3,te.desktop,D.M.$spacing7,D.M.$spacing6;const re=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")),te.boxShadow,te.borderRadius,D.M.$spacing3,D.M.$spacing4,te.desktop,D.M.$spacing7,D.M.$spacing10),ne=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,te.desktop),ie=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")),ee.Z.copyOne),ae=s.Ay.div.withConfig({componentId:"sc-clblwg-6"})(["font:",";text-transform:",";margin-block-end:",";
1"],ee.Z.headerTwo,te.textTransform.headlines,D.M.$spacing1),de=s.Ay.p.withConfig({componentId:"sc-clblwg-7"})(["display:inline-flex;font-weight:bold;align-items:center;color:",";"],(e=>e.theme.token("text-default"))),oe=s.Ay.span.withConfig({componentId:"sc-clblwg-8"})(["margin-inline-start:",";"],D.M.$spacing1),se=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),le=s.Ay.div.withConfig({componentId:"sc-clblwg-10"})(["display:flex;align-items:center;p{color:",";}"],(e=>e.theme.token("text-default"))),ce=s.Ay.div.withConfig({componentId:"sc-clblwg-11"})(["align-items:center;display:flex;justify-content:center;position:relative;","{height:auto;","{max-width:800px;}}"],te.desktop,K),ue=(D.M.$spacing7,D.M.$spacing5,te.desktop,s.Ay.p.withConfig({componentId:"sc-clblwg-13"})(["font:",";color:",";margin:0;"],ee.Z.headerThree,(e=>e.theme.token("text-accent-order-number")))),pe=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:",";"],ee.Z.headerThree,D.M.$spacing1),ge=s.Ay.div.withConfig({componentId:"sc-clblwg-16"})(["padding-block-end:",";padding-inline:0;"],D.M.$spacing11);var ve=r(24057);const he=e=>{let t=e.order,r=e.handleDisplayDetailsModal,i=e.setModalType,a=e.onModalDismiss;const s=(0,R.jg)().reorder.reorderedOrderId,c=(0,V.oX)(),u=c.store,p=c.fetchStore,m=(0,$.$)(t),g=m.handleReorderClick,v=m.disabled,y=(0,d.A)(),C=y.formatMessage,I=y.formatList,w=(0,B.Ym)().locale,E=(0,o.Zp)(),j=(0,O._P)(O.N$.ENABLE_V2_REORDERING_EXPERIENCE),k=(0,b.U)("desktop"),A=(0,N.h)({modalAppearanceEventMessage:"Error: Fetch Store Failure"}),D=A[0],T=A[1];(0,n.useEffect)((()=>()=>(0,l.rf)()),[]);const P=(0,n.useMemo)((()=>new Date(t.createdAt).toLocaleString(w,{month:"short",day:"numeric",hour:"numeric",minute:"numeric"})),[w,t.createdAt]),M=(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]),H=M.itemCSV,z=M.numItems,Z=M.rewardRedeemed,Y=(0,n.useCallback)((e=>{i(e),r(t.rbiOrderId)}),[r,t.rbiOrderId,i]),K=(0,n.useCallback)((()=>{j?E(S.JZ.orderConfirmation+"/"+t.rbiOrderId):Y(ve.l.SHOW_DETAILS)}),[j,E,t.rbiOrderId,Y]),J=H.split(","),X=J.length-1,Q=(0,U.f)(),ee=(0,_.z)(t),te=(0,n.useMemo)((()=>{var e;return v||!(0,W.wy)((null==t||null==(e=t.cart)?void 0:e.reorderCartEntries)||[])}),[v,t]),ce=(0,F.gW)(t),ge=(0,n.useCallback)((()=>{(0,l.rf)(),null==a||a()}),[a]),he=(0,n.useCallback)((()=>{j?E(S.JZ.orderConfirmation+"/"+t.rbiOrderId):((0,l.hs)({showSubLevelNavigation:!0,pageTitle:"Order #"+(ee||""),onBack:ge}),Y(ve.l.SHOW_DETAILS))}),[ee,ge,Y,j,E,t.rbiOrderId]);return(0,f.jsxs)(re,{"data-testid":"recent-order-"+t.rbiOrderId,children:[(0,f.jsxs)(ne,{"data-testid":"account-orders-order-Col",children:[ee?(0,f.jsxs)(pe,{"data-testid":"account-orders-order-OrderNumberWrapper",children:[(0,f.jsx)(me,{"data-testid":"account-orders-order-OrderNumberText",children:C({id:"orderNumber"})+":"}),(0,f.jsx)(ue,{"data-testid":"account-orders-order-OrderNumber",children:ee})]}):null,(0,f.jsx)(ae,{"data-testid":"account-orders-order-FormattedDate",children:P}),!ce&&(0,f.jsx)(de,{"data-testid":"account-orders-order-SubtitleContainer",children:(0,f.jsx)(oe,{"data-testid":"account-orders-order-NumItems",children:z})}),!ce&&(0,f.jsxs)(le,{"data-testid":"account-orders-order-ItemNameContainer",children:[Z&&(0,f.jsx)(G,{"data-testid":"account-orders-order-RewardText",text:C({id:"rewards"})}),(0,f.jsx)(se,{"data-testid":"account-orders-order-Items",children:I([J[0],...X>0?[(0,f.jsx)(ie,{"data-testid":"account-orders-order-MoreItems",onClick:K,children:C({id:"moreItems"},{remainingItems:X})})]:[]],{type:"unit"})})]})]}),(0,f.jsx)(ne,{"data-testid":"account-orders-order-Col-1",children:(0,f.jsxs)(h.a,{"data-testid":"account-orders-order-Box",flexDirection:k?"row":"column",center:!0,width:"100%",children:[(0,f.jsx)(h.a,{"data-testid":"account-orders-order-Box-1",width:"100%",minWidth:"auto",children:(0,f.jsx)(x.rA,{"data-testid":"recent-order-view-details",variant:x.Vs.OUTLINE,transparent:!0,fullWidth:!0,onClick:he,"aria-label":Q({buttonType:"view",order:t}),children:C({id:"viewDetails"})})}),(0,f.jsx)(h.a,{"data-testid":"account-orders-order-Box-2",margin:k?"0 0 0 1rem":"1rem 0 0",width:"100%",minWidth:"auto",children:(0,f.jsx)(q,{"data-testid":"account-orders-order-OrderAction",order:t,loading:s===t.rbiOrderId,disabled:te,onTrack:()=>Y(ve.l.TRACK_ORDER),onReorder:g,onFinish:async()=>{var e;const r=null!=(e=t.cart)&&e.storeId?t.cart.storeId.toString():"";if(u.number&&u.number!==r)try{await p(r)}
1catch(n){return T({message:C({id:"couldNotLocateStore"})})}E(S.JZ.orderConfirmation+"/"+t.rbiOrderId,{state:{showToast:!0}})}})})]})}),(0,f.jsx)(D,{"data-testid":"account-orders-order-ErrorDialog"})]})},xe=e=>{let t=e.children;const r=(0,d.A)().formatMessage;return(0,f.jsxs)("div",{"data-testid":"account-orders-orders-empty-div",children:[(0,f.jsx)(ce,{"data-testid":"account-orders-orders-empty-Wrap",children:(0,f.jsx)(Q,{"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),ye=r(56096),Ce=r(63751),Ie=r(34189),be=r(63563),we=r(99160),Ee=r(19382),je=r(42440),ke=r(58690),Ae=r(78728),Oe=r(20405),Re=r(80854),De=r(77696);function Se(e,t,r){e.trackEvent({name:De.og.RECENT_ORDERS_LIST_ITEM_VIEWED,type:De.wf.Other,attributes:{[De.Ny.ORDER_ID]:t,[De.Ny.SERVICE_MODE]:r}})}function Te(e,t){e.logEvent(De.og.ADD_RECENT_ITEM_TO_CART,De.wf.UserContent,{[De.Ny.PRODUCT_NAME]:t,[De.Ny.USER_LOCATION]:De.nE.RECENT_ORDERS})}const Pe=s.I4.div.withConfig({componentId:"sc-1c79j1g-0"})(["display:flex;flex-direction:column;margin-block:24px;text-align:center;"]),Me=(0,s.I4)(Ae.qH).withConfig({componentId:"sc-1c79j1g-1"})(["display:inline;font-weight:bold;"]);var Le=r(97597),Ne=r(48405);var _e=r(58168),Be=r(19527),$e=r(67775),Fe=r(93145);function Ve(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 Ue(e,t){const r=new Date(e);return Number.isNaN(r.getTime())?"":r.toLocaleString(t,{month:"short",day:"numeric",hour:"numeric",minute:"numeric"})}function We(e){if(e>=11&&e<=13)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}const He=/^\d{4}-\d{2}-\d{2}$/;const ze={year:"2-digit",month:"numeric",day:"numeric",calendar:"gregory"};function qe(e,t){const r=new Date(e);if(Number.isNaN(r.getTime()))return"";const n=He.test(e)?(0,_e.A)({},ze,{timeZone:"UTC"}):ze;return r.toLocaleString(t,n)}function Ge(e,t,r){return void 0===r&&(r=new Date),(null!=e?e:[]).filter((e=>e.points>0)).reduce(((e,n)=>{const i=new Date(n.expirationDate);return Number.isNaN(i.getTime())||e.push({isExpired:i<r,label:qe(n.expirationDate,t)}),e}),[])}function Ze(e){var t;return(null==(t=e.cart)?void 0:t.serviceMode)===R.h1.DELIVERY||Boolean(e.delivery)}const Ye=new Set([z.ni.ORDER_DROPPED_OFF,z.ni.ORDER_ABANDONED,z.ni.ORDER_CANCELLED,z.ni.ORDER_ERROR,z.ni.ORDER_TIMEOUT]);function Ke(e){var t;if(!Ze(e)||tt(e.status))return!1;const r=null==(t=e.delivery)?void 0:t.status;return!!r&&!Ye.has(r)}const Je=36e5;function Xe(e,t,r){if(void 0===r&&(r=Date.now()),Fe.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>Je}function Qe(e,t,r,n){void 0===n&&(n=new Date);return!(0,Ie.T0)(null!=e?e:"",t,r,n).isTerminal}const et=new Set([z.Re.REFUND_REQUESTED,z.Re.REFUND_SUCCESSFUL,z.Re.REFUND_ERROR]);function tt(e){return Boolean(e&&et.has(e))}function rt(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)||tt(e.status))return!1;return Qe(null!=(r=null==(n=e.order)?void 0:n.status)?r:"",e.createdAt,e.fireOrderIn||0,t)}const nt=(e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime();const it=[{label:"",value:1},{label:"",value:2},{label:"",value:3},{label:"",value:4}];function at(e,t){var r;return null==(null==(r=e.cart)?void 0:r.totalCents)?"":t(e.cart.totalCents)}function dt(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;
1return e+(null!=(r=null==t?void 0:t.timesApplied)?r:0)}),0);return c>0?Math.round(d/c)*s.timesApplied:d}const ot=()=>{const e=(0,d.A)().formatMessage,t=(()=>{const e=(0,we.L)(),t=(0,Le.h)().data,r=(0,Ne.P)().loyaltyUser,n="BY_INACTIVITY_DAYS"===(null==t?void 0:t.pointsExpirationType);if(!e||!n||!r)return{type:"none"};const i=r.points,a=r.pointsExpiryDateKey;return i>0&&a&&"9999-12-31T23:59:59.999Z"!==a?{type:"upcoming",expiryDateKey:a}:0===i?{type:"expired"}:{type:"none"}})();if("none"===t.type)return null;if("upcoming"===t.type){const r=function(e,t){const r=new Date(e);if(Number.isNaN(r.getTime()))return"";const n=r.toLocaleString(t,{month:"long",timeZone:"UTC"}),i=r.getUTCDate();return n+" "+i+We(i)+"."}(t.expiryDateKey,e({id:"localeDateTime"}));return(0,f.jsxs)(Pe,{"data-testid":"loyalty-points-expiry-banner-v2",children:[(0,f.jsxs)(Ae.gH,{"data-testid":"v2-loyalty-expiry-banner-v2-BodyLarge",children:[e({id:"loyalty.orderHistory.pointsExpiryWarning",defaultMessage:"All the points will expire on"})," ",(0,f.jsx)(Me,{"data-testid":"v2-loyalty-expiry-banner-v2-InlineExpiryDate",children:r})]}),(0,f.jsx)(Ae.gH,{"data-testid":"v2-loyalty-expiry-banner-v2-BodyLarge-1",children:e({id:"loyalty.orderHistory.pointsExpiryMaintainMessage",defaultMessage:"Make a purchase or redeem a reward to maintain your points balance."})})]})}return(0,f.jsx)(Pe,{"data-testid":"loyalty-points-expiry-banner-v2",children:(0,f.jsx)(Ae.gH,{"data-testid":"v2-loyalty-expiry-banner-v2-BodyLarge-2",children:e({id:"loyalty.orderHistory.pointsExpiredMessage",defaultMessage:"Make a purchase to earn your points."})})})},st=()=>{const e=(0,d.A)().formatMessage,t=(()=>{var e;const t=(0,we.L)(),r=(0,Le.h)().data,n=(0,Ne.P)().loyaltyUser,i="BY_ISSUE_DATE"===(null==r?void 0:r.pointsExpirationType);if(!t||!i||!n)return{type:"none"};const a=[...null!=(e=n.expirationBuckets)?e:[]].sort(((e,t)=>e.expirationDate.localeCompare(t.expirationDate)))[0];return!a||a.pointsToExpire<=0?{type:"none"}:{type:"upcoming",expirationDate:a.expirationDate,pointsToExpire:a.pointsToExpire}})();if("none"===t.type)return null;const r=function(e,t){const r=new Date(e);if(Number.isNaN(r.getTime()))return"";const n=r.toLocaleString(t,{month:"long",timeZone:"UTC"}),i=r.getUTCDate(),a=r.getUTCFullYear();return n+" "+i+We(i)+" "+a}(t.expirationDate,e({id:"localeDateTime"}));return(0,f.jsx)(Pe,{"data-testid":"loyalty-issue-date-expiry-banner-v2",children:(0,f.jsxs)(Ae.gH,{"data-testid":"v2-loyalty-issue-date-expiry-banner-v2-BodyLarge",children:[e({id:"loyalty.orderHistory.issueDatePointsExpiryWarning",defaultMessage:"{points} points will expire on"},{points:t.pointsToExpire})," ",(0,f.jsx)(Me,{"data-testid":"v2-loyalty-issue-date-expiry-banner-v2-InlineExpiryDate",as:"div",children:r}),". ",e({id:"loyalty.orderHistory.issueDatePointsExpiryMaintainMessage",defaultMessage:"Redeem your points before they expire to enjoy your rewards."})]})})};var lt=r(54952),ct=r(23270),ut=r(68605).P;const pt=(0,s.I4)(ct.s3).withConfig({componentId:"sc-1sop9hr-0"})(["justify-content:center;"]),mt=(0,s.I4)(ct.mN).withConfig({componentId:"sc-1sop9hr-1"})(["","{margin-inline:-16px;width:100dvw;}"],ut.mobile),gt=()=>{const e=(0,d.A)().formatMessage,t=(0,Ne.P)().loyaltyUser,r=(0,b.U)("mobile"),n=(null==t?void 0:t.points)||0;return(0,f.jsx)(mt,{"data-testid":"loyalty-order-banner-v2",children:(0,f.jsx)(pt,{"data-testid":"v2-loyalty-order-banner-v2-BannerInnerContainerV2",isMobile:r,children:(0,f.jsxs)(ct.tl,{"data-testid":"v2-loyalty-order-banner-v2-BannerPointsContainerV2",children:[(0,f.jsxs)(ct.K_,{"data-testid":"v2-loyalty-order-banner-v2-BannerPointsRow",children:[(0,f.jsx)(ct._x,{"data-testid":"v2-loyalty-order-banner-v2-BannerPointsIconBox",children:(0,f.jsx)(lt.P,{"data-testid":"v2-loyalty-order-banner-v2-IconLoyaltyPoints"})}),(0,f.jsx)(ct.em,{"data-testid":"v2-loyalty-order-banner-v2-BannerPointsHeadline",children:n})]}),(0,f.jsx)(ct.t0,{"data-testid":"v2-loyalty-order-banner-v2-BannerAvailablePoints",children:e({id:"loyalty.availablePoints",defaultMessage:"Available Points"})})]})})})};var vt=r(11449),ht=r(68605).P;const xt=s.I4.div.withConfig({componentId:"sc-49vxiv-0"})(["display:flex;flex-direction:column;align-items:center;width:100%;flex:1;margin-block-start:2.25rem;","{flex:0;}"],ht.desktop),ft=s.I4.div.withConfig({componentId:"sc-49vxiv-1"})(["text-align:center;"]),yt=s.I4.div.withConfig({componentId:"sc-49vxiv-2"})(["margin-block-end:0.75rem;"]),Ct=s.I4.div.withConfig({componentId:"sc-49vxiv-3"})(["width:100%;margin-block-start:1.5rem;","{max-width:320px;}"],ht.desktop),It=()=>{const e=(0,d.A)().formatMessage,t=(0,o.Zp)(),r=(0,n.useCallback)((()=>t(S.JZ.menu)),[t]);return(0,f.jsxs)(xt,{"data-testid":"loyalty-recent-orders-empty-v2",children:[(0,f.jsxs)(ft,{"data-testid":"v2-loyalty-recent-orders-empty-v2-ContentGroup",children:[(0,f.jsx)(yt,{"data-testid":"v2-loyalty-recent-orders-empty-v2-LogoWrapper",children:(0,f.jsx)(vt.d,{"data-testid":"v2-loyalty-recent-orders-empty-v2-OfferSignInLogoAbV2",height:"106",width:"225"})}),(0,f.jsx)(Ae.gH,{"data-testid":"v2-loyalty-recent-orders-empty-v2-BodyLarge",children:e({id:"loyalty.orderHistory.emptyStateMessage",defaultMessage:"Place your first order and start collecting points instantly."})})]}),(0,f.jsx)(Ct,{"data-testid":"v2-loyalty-recent-orders-empty-v2-CTAWrapper",children:(0,f.jsx)(je.$,{"data-testid":"v2-loyalty-recent-orders-empty-v2-Button",fullWidth:!0,text:e({id:"loyalty.orderNowEarnRewards",defaultMessage:"Order Now & Earn Rewards"}),onClick:r,preserveLabelCasing:!0})})]})};var bt=r(3499),wt=r(40598),Et=r(6849),jt=r(95188),kt=r(63289),At=r(35070);const Ot=(0,s.I4)(Ae.r).withConfig({componentId:"sc-49g31r-0"})(["justify-self:end;align-self:center;color:",";white-space:nowrap;"],D.M.$indeterminate),Rt=e=>{let t=e.impactedExpirationBuckets;const r=(0,d.A)().formatMessage,n=function(e,t,r){void 0===r&&(r=new Date);const n=Ge(e,t,r)[0];return null!=n?n:null}(t,r({id:"localeDateTime"}));return n?(0,f.jsx)(Ot,{"data-testid":"issue-date-expiry-badge",children:r({id:n.isExpired?"loyalty.orderHistory.issueDateCardExpired":"loyalty.orderHistory.issueDateCardExpiry",defaultMessage:n.isExpired?"Expired on {date}":"Expiry {date}"},{date:n.label})}):null},Dt="warning",St="80px",Tt=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:",";"],St,St,(e=>
1e.theme.colorV2.container["neutral-tonal"])),Pt=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[Dt]));var Mt,Lt=r(75276),Nt=r(64317);const _t=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;"]),Bt=(0,s.I4)(Nt.c).withConfig({componentId:"sc-111k20s-1"})(["grid-column:1 / -1;"]),$t=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[Dt])),Ft=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)(Mt||(Mt=(0,Lt.A)(["\n flex: 1;\n "]))))),Vt=(0,s.I4)(Nt.c).withConfig({componentId:"sc-111k20s-4"})(["width:1px;height:12px;flex-shrink:0;margin:0 ","px;"],(e=>e.$marginPx)),Ut=s.I4.div.withConfig({componentId:"sc-111k20s-5"})(["display:flex;flex-direction:column;min-width:0;"]),Wt=(0,s.I4)(Ae.r).withConfig({componentId:"sc-111k20s-6"})(["color:",";white-space:nowrap;"],D.M.$indeterminate),Ht=e=>{let t=e.loyaltyTransaction,r=e.impactedExpirationBuckets;const i=(0,d.A)().formatMessage;if(!t)return null;const a=t.pointsEarned,o=t.bonusPointsEarned,s=t.pointsUsed,l=Ge(r,i({id:"localeDateTime"}));let c=0;const u=()=>{if(!l.length)return null;const e=Math.min(c,l.length-1);return c+=1,l[e]},p=[];if(a>0&&p.push({label:i({id:"loyalty.orderHistory.pointsEarned",defaultMessage:"{points} Pts Earned"},{points:a}),expiryStatus:u()}),o>0&&p.push({label:i({id:"loyalty.orderHistory.pointsBonus",defaultMessage:"{points} Pts Bonus"},{points:o}),expiryStatus:u()}),s>0&&p.push({label:i({id:"loyalty.orderHistory.pointsUsed",defaultMessage:"{points} Pts Used"},{points:s}),expiryStatus:null}),!p.length)return null;const m=3===p.length?16:40;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Bt,{"data-testid":"order-card-v2-points-row-divider","aria-hidden":"true"}),(0,f.jsxs)(_t,{"data-testid":"order-card-v2-points-row",children:[(0,f.jsx)($t,{"data-testid":"v2-order-card-v2-points-row-PointsRowIcon","aria-hidden":"true",children:(0,f.jsx)(lt.P,{"data-testid":"v2-order-card-v2-points-row-IconLoyaltyPoints"})}),(0,f.jsx)(Ft,{"data-testid":"v2-order-card-v2-points-row-PointsRowSegments",$fullWidth:p.length>1,children:p.map(((e,t)=>(0,f.jsxs)(n.Fragment,{children:[t>0&&(0,f.jsx)(Vt,{"data-testid":"order-card-v2-points-row-segment-divider",$marginPx:m,"aria-hidden":"true"}),(0,f.jsxs)(Ut,{"data-testid":"v2-order-card-v2-points-row-SegmentColumn",children:[(0,f.jsx)(Ae.r,{"data-testid":"v2-order-card-v2-points-row-FootnoteRegular",children:e.label}),e.expiryStatus&&(0,f.jsx)(Wt,{"data-testid":"issue-date-expiry-badge",children:i({id:e.expiryStatus.isExpired?"loyalty.orderHistory.issueDateCardExpired":"loyalty.orderHistory.issueDateCardExpiry",defaultMessage:e.expiryStatus.isExpired?"Expired on {date}":"Expiry {date}"},{date:e.expiryStatus.label})})]})]},e.label)))})]})]})};var zt=r(69015),qt=r(93231),Gt=r(60188),Zt=r(68605).P;const Yt="border-color-default",Kt="80px",Jt=s.I4.div.withConfig({componentId:"sc-1neig67-0"})(["width:100%;"]),Xt=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;}"]),Qt=s.I4.div.withConfig({componentId:"sc-1neig67-2"})(["width:",";height:",";flex-shrink:0;border-radius:8px;overflow:hidden;"],Kt,Kt),er=s.I4.div.withConfig({componentId:"sc-1neig67-3"})(["display:grid;grid-template-columns:",";column-gap:","px;row-gap:8px;align-items:center;width:100%;min-width:0;"],(e=>{let t=e.$hasLeadingImage,r=e.$leadingColumnWidth;return t?(null!=r?r:Kt)+" minmax(0, 1fr) auto":"minmax(0, 1fr) auto"}),(e=>{let t=e.$columnGapPx;return null!=t?t:12})),tr=s.I4.div.withConfig({componentId:"sc-1neig67-4"})(["grid-column:",";padding-inline-end:8px;"],(e=>e.$hasLeadingImage?"2":"1")),rr=s.I4.div.withConfig({componentId:"sc-1neig67-5"})(["display:flex;flex-direction:column;flex:1;min-width:0;"]),nr=(0,s.I4)(Ae.qH).withConfig({componentId:"sc-1neig67-6"})(["display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;"]),ir=s.I4.div.withConfig({componentId:"sc-1neig67-7"})(["display:flex;align-items:center;gap:4px;flex-wrap:wrap;"]),ar=(0,s.I4)(zt.KS).withConfig({componentId:"sc-1neig67-8"})(["",";"],(e=>e.theme.typography.footnoteRegular)),dr=s.I4.div.withConfig({componentId:"sc-1neig67-9"})(["display:flex;align-items:center;gap:4px;"]),or=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=>
1e.theme.colorV2.text.error)),sr=(0,s.I4)(Ae.r).withConfig({componentId:"sc-1neig67-11"})(["color:",";white-space:nowrap;"],(e=>e.theme.colorV2.text.neutral)),lr=s.I4.div.withConfig({componentId:"sc-1neig67-12"})(["margin-block-start:8px;display:flex;align-items:center;flex-wrap:wrap;gap:8px;"]),cr=s.I4.div.withConfig({componentId:"sc-1neig67-13"})(["display:flex;align-items:center;justify-content:space-between;gap:16px;padding-block:4px;"]),ur=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"])),pr=(0,s.I4)(Ae.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),mr=(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"])),gr=s.I4.div.withConfig({componentId:"sc-1neig67-19"})(["display:flex;justify-content:space-between;align-items:center;gap:8px;padding:16px;"]),vr=(0,s.I4)(je.$).withConfig({componentId:"sc-1neig67-20"})(["flex:1;position:relative;z-index:1;"]),hr=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;}"]),xr=s.I4.div.withConfig({componentId:"sc-1neig67-22"})(["display:flex;align-items:center;gap:16px;"]),fr=s.I4.div.withConfig({componentId:"sc-1neig67-23"})(["flex-shrink:0;"]),yr=s.I4.div.withConfig({componentId:"sc-1neig67-24"})(["flex:1;min-width:0;max-width:45%;"]),Cr=s.I4.div.withConfig({componentId:"sc-1neig67-25"})(["display:flex;flex-direction:column;gap:24px;width:100%;padding-block-start:16px;"]),Ir=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;}"],Zt.desktop),br=s.I4.div.withConfig({componentId:"sc-1neig67-28"})(["position:absolute;inset-inline-start:0;"]),wr=s.I4.div.withConfig({componentId:"sc-1neig67-31"})(["padding-inline:16px;display:flex;flex-direction:column;","{padding-inline:0;}"],Zt.desktop),Er=s.I4.div.withConfig({componentId:"sc-1neig67-32"})(["max-width:1152px;margin:0 auto;padding-inline:8px;width:100%;display:flex;flex-direction:column;"]),jr=s.I4.div.withConfig({componentId:"sc-1neig67-33"})(["display:flex;flex-direction:column;min-height:calc(100vh - 200px);padding-inline:1rem;padding-block:2rem;"]),kr=s.I4.div.withConfig({componentId:"sc-1neig67-34"})(["padding-inline:1rem;padding-block:1rem;"]),Ar=s.I4.div.withConfig({componentId:"sc-1neig67-36"})(["height:1px;margin-inline:-16px;background-color:",";"],(e=>e.theme.token(Yt))),Or=s.I4.div.withConfig({componentId:"sc-1neig67-37"})(["display:flex;flex-direction:column;gap:24px;"]),Rr=s.I4.div.withConfig({componentId:"sc-1neig67-38"})(["display:flex;flex-direction:column;gap:24px;"]),Dr=(0,s.I4)(Xt).withConfig({componentId:"sc-1neig67-39"})([""]),Sr=(0,s.I4)(xr).withConfig({componentId:"sc-1neig67-40"})([""]),Tr=(0,s.I4)(yr).withConfig({componentId:"sc-1neig67-41"})(["max-width:none;"]),Pr=s.I4.div.withConfig({componentId:"sc-1neig67-42"})(["display:flex;flex-direction:column;"]),Mr=s.I4.div.withConfig({componentId:"sc-1neig67-43"})(["display:flex;flex-direction:column;gap:4px;"]),Lr=s.I4.div.withConfig({componentId:"sc-1neig67-44"})(["display:flex;flex-direction:column;gap:12px;margin-block-start:8px;"]),Nr=s.I4.div.withConfig({componentId:"sc-1neig67-45"})(["display:flex;flex-direction:column;"]),_r=(0,s.I4)(nr).withConfig({componentId:"sc-1neig67-46"})([""]),Br=(0,s.I4)(qt.H).withConfig({componentId:"sc-1neig67-47"})(["","{display:none;}"],Gt.rx),$r=new Set([bt.x8r.CLAIMED,bt.x8r.CONFIRMED]),Fr={[ye.G.Support]:"loyalty.orderHistory.channelSupport",[ye.G.Campaign]:"loyalty.orderHistory.channelCampaign",[ye.G.Quest]:"loyalty.orderHistory.channelQuest",[ye.G.InitialPointBalance]:"loyalty.orderHistory.channelInitialPointBalance"},Vr=e=>{var t;let r=e.transaction;const i=(0,d.A)().formatMessage,a=(0,B.Ym)().locale,o=(0,wt.fz)().formatCurrencyForLocale,s=(0,b.U)("desktop"),l=null==(t=r.transactionDetail
1s)?void 0:t.payments,c=(0,n.useMemo)((()=>(null!=l?l:[]).reduce(((e,t)=>e+t.amount),0)),[l]),u=(0,n.useMemo)((()=>Ue(r.createdAt,a)),[r.createdAt,a]),p=$r.has(r.status),m={id:r.id,pointsEarned:r.pointsEarned,bonusPointsEarned:r.bonusPointsEarned,pointsUsed:r.pointsUsed,pointsBalance:0,rewardsUsed:0},g=(0,f.jsxs)(er,{$hasLeadingImage:!0,"data-testid":"loyalty-transaction-card-restaurant",children:[(0,f.jsx)(Tt,{"data-testid":"v2-loyalty-transaction-card-LeadingIconImage",children:(0,f.jsx)(kt.I,{"data-testid":"v2-loyalty-transaction-card-Icon",icon:At.A,variant:"standard",size:"large","aria-hidden":"true"})}),(0,f.jsxs)(rr,{"data-testid":"v2-loyalty-transaction-card-ItemDetails",children:[(0,f.jsx)(nr,{"data-testid":"v2-loyalty-transaction-card-ClampedItemName",children:i({id:"loyalty.orderHistory.channelRestaurant",defaultMessage:"In Restaurant Scan"})}),(0,f.jsxs)(ir,{"data-testid":"v2-loyalty-transaction-card-PriceDateRow",children:[c>0&&(0,f.jsx)(Ae.eh,{"data-testid":"v2-loyalty-transaction-card-FootnoteBold",children:o(c)}),c>0&&u&&(0,f.jsx)(Ae.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular",children:" \u2022 "}),u&&(0,f.jsx)(Ae.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular-1",children:u}),p&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Ae.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular-2","aria-hidden":!0,children:" \xb7 "}),(0,f.jsx)(dr,{"data-testid":"loyalty-transaction-card-status",children:(0,f.jsx)(sr,{"data-testid":"v2-loyalty-transaction-card-OrderStatusLabel",children:i({id:"orderCardCompleted",defaultMessage:"Completed"})})})]})]})]}),(0,f.jsx)(Ht,{"data-testid":"v2-loyalty-transaction-card-OrderCardV2PointsRow",loyaltyTransaction:m,impactedExpirationBuckets:r.impactedExpirationBuckets})]});return s?(0,f.jsx)(yr,{"data-testid":"v2-loyalty-transaction-card-DesktopMainContent",children:g}):g},Ur=e=>{let t=e.transaction;const r=(0,d.A)().formatMessage,i=(0,B.Ym)().locale,a=(0,n.useMemo)((()=>Ue(t.createdAt,i)),[t.createdAt,i]),o=Fr[t.channel],s=o?r({id:o,defaultMessage:t.channel}):t.channel.toLowerCase().split(/[-_]+/).map(((e,t)=>0===t?e.charAt(0).toUpperCase()+e.slice(1):e)).join(" ");const l=t.pointsEarned+t.bonusPointsEarned;return(0,f.jsxs)(er,{$hasLeadingImage:!0,$leadingColumnWidth:"40px",$columnGapPx:8,"data-testid":"loyalty-transaction-card-generic",children:[(0,f.jsx)(Pt,{"data-testid":"v2-loyalty-transaction-card-GenericTransactionIcon","aria-hidden":"true",children:(0,f.jsx)(lt.P,{"data-testid":"v2-loyalty-transaction-card-IconLoyaltyPoints"})}),(0,f.jsxs)(rr,{"data-testid":"v2-loyalty-transaction-card-ItemDetails-1",children:[(0,f.jsx)(nr,{"data-testid":"v2-loyalty-transaction-card-ClampedItemName-1",children:r({id:"loyalty.orderHistory.pointsEarnedGeneric",defaultMessage:"{points} Points Earned"},{points:l})}),(0,f.jsxs)(ir,{"data-testid":"v2-loyalty-transaction-card-PriceDateRow-1",children:[a&&(0,f.jsx)(Ae.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular-3",children:a}),a&&(0,f.jsx)(Ae.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular-4",children:" \u2022 "}),(0,f.jsx)(Ae.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular-5",children:s})]})]}),(0,f.jsx)(Rt,{"data-testid":"v2-loyalty-transaction-card-IssueDateExpiryBadge",impactedExpirationBuckets:t.impactedExpirationBuckets})]})},Wr=e=>{var t;let r=e.transaction;const i=(0,d.A)().formatMessage,a=(0,n.useMemo)((()=>qe(r.createdAt,i({id:"localeDateTime"}))),[r.createdAt,i]);return(0,f.jsxs)(er,{$hasLeadingImage:!0,$leadingColumnWidth:"40px",$columnGapPx:8,"data-testid":"loyalty-transaction-card-points-expired",children:[(0,f.jsx)(Pt,{"data-testid":"v2-loyalty-transaction-card-GenericTransactionIcon-1","aria-hidden":"true",children:(0,f.jsx)(lt.P,{"data-testid":"v2-loyalty-transaction-card-IconLoyaltyPoints-1"})}),(0,f.jsxs)(rr,{"data-testid":"v2-loyalty-transaction-card-ItemDetails-2",children:[(0,f.jsx)(nr,{"data-testid":"v2-loyalty-transaction-card-ClampedItemName-2",children:i({id:"loyalty.orderHistory.allPointsExpiredTitle",defaultMessage:"{points} Points"},{points:null!=(t=r.pointsDeducted)?t:0})}),(0,f.jsx)(ir,{"data-testid":"v2-loyalty-transaction-card-PriceDateRow-2",children:(0,f.jsx)(Ae.r,{"data-testid":"v2-loyalty-transaction-card-FootnoteRegular-6",children:i({id:"loyalty.orderHistory.expiredLabel",defaultMessage:"Expired"})})})]}),a&&(0,f.jsx)(Ot,{"data-testid":"loyalty-transaction-card-points-expired-on",children:i({id:"loyalty.orderHistory.issueDateCardExpired",defaultMessage:"Expired on {date}"},{date:a})})]})},Hr=e=>{let t=e.transaction;const r=(()=>{switch(t.channel){case ye.G.PointsExpiration:return(0,f.jsx)(Wr,{"data-testid":"v2-loyalty-transaction-card-PointsExpiredContent",transaction:t});case ye.G.Restaurant:return(0,f.jsx)(Vr,{"data-testid":"v2-loyalty-transaction-card-RestaurantScanContent",transaction:t});default:return(0,f.jsx)(Ur,{"data-testid":"v2-loyalty-transaction-card-GenericTransactionContent",transaction:t})}})();return(0,f.jsx)(Jt,{"data-testid":"loyalty-transaction-card-"+t.id,children:(0,f.jsx)(Et.z,{"data-testid":"v2-loyalty-transaction-card-SingleCard",variant:jt.D.OUTLINED,mainContent:r})})};var zr=r(95105),qr=r(31035),Gr=r(63554),Zr=r(78169),Yr=r(12671);function Kr(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 Jr=r(56699),Xr=r(39637);const Qr=new Set,en=e=>!(!e||Qr.has(e))&&(Qr.size>=500&&Qr.clear(),Qr.add(e),!0),tn=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,u=(0,b.U)("headerMobile");return(0,f.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?dt(e.lineId,a,o):null!=i?i:0;return(0,f.jsxs)(cr,{"data-testid":"v2-remaining-items-list-RemainingItemRow",children:[(0,f.jsxs)(ur,{"data-testid":"v2-remaining-items-list-RemainingItemName",children:[(0,f.jsxs)(pr,{"data-testid":"v2-remaining-items-list-QuantityBadge",children:[null!=(r=e.quantity)?r:1,"x"]}),(0,f.jsx)(Ae.r,{"data-testid":"v2-remaining-items-list-FootnoteRegular",children:e.name})]}),!u&&(d?(0,f.jsx)(ar,{value:s,"data-testid":"remaining-item-reward-points"}):null!=e.price&&(0,f.jsx)(Ae.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,f.jsx)(mr,{"data-testid":"v2-remaining-items-list-MoreItemsLink",to:S.JZ.orderConfirmation+"/"+r,state:{from:"recentOrders"},children:(0,f.jsx)(Ae.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})})})]})},rn=e=>{let t=e.orderStatusLabel,r=e.formatMessage;return(0,f.jsxs)(dr,{"data-testid":"order-card-v2-order-status",children:["orderCardCancelled"===t&&(0,f.jsx)(or,{"data-testid":"v2-order-card-v2-OrderStatusIcon","aria-hidden":"true",children:(0,f.jsx)(kt.I,{"data-testid":"v2-order-card-v2-Icon",icon:Xr.A,size:"small",variant:"standard"})}),(0,f.jsx)(sr,{"data-testid":"v2-order-card-v2-OrderStatusLabel",children:r({id:t,defaultMessage:"orderCardCancelled"===t?"Cancelled":"Completed"})})]})},nn=e=>{let t=e.refundChipLabel,r=e.refundChipStatus,n=e.formatMessage;return(0,f.jsx)(lr,{"data-testid":"v2-order-card-v2-RefundChipRow",children:(0,f.jsx)(Jr.d,{text:n({id:t,defaultMessage:"orderCardRefundConfirmed"===t?"Refund Confirmed":"Refund Failed"}),chipStatus:r,"data-testid":"order-card-v2-refund-chip"})})},an=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,f.jsxs)(ir,{"data-testid":"v2-order-card-v2-PriceDateRow",children:[t?(0,f.jsx)(ar,{value:r,"data-testid":"order-card-reward-points"}):n&&(0,f.jsx)(Ae.eh,{"data-testid":"v2-order-card-v2-FootnoteBold",children:n}),s&&(0,f.jsx)(Ae.r,{"data-testid":"v2-order-card-v2-FootnoteRegular",children:" \u2022 "}),i&&(0,f.jsx)(Ae.r,{"data-testid":"v2-order-card-v2-FootnoteRegular-1",children:i}),l&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Ae.r,{"data-testid":"v2-order-card-v2-FootnoteRegular-2","aria-hidden":!0,
1children:" \xb7 "}),(0,f.jsx)(rn,{"data-testid":"v2-order-card-v2-OrderStatusChip",orderStatusLabel:a,formatMessage:o})]})]})},dn=e=>{var t,r,i,a,s,l,c,u,p,m;let g=e.order,v=e.selectedPreOrderTimeSlot,h=e.showPointsRow,x=e.impactedExpirationBuckets;const y=(0,d.A)().formatMessage,C=(0,B.Ym)().locale,I=(0,o.Zp)(),w=(0,be.q)(),E=(0,$.$)(g),j=E.handleReorderClick,k=E.eligibility,A=E.isReordering,O=(0,wt.fz)().formatCurrencyForLocale,D=(0,b.U)("desktop"),T=(0,n.useRef)(!1),P=(0,Gr.GV)(Gr.Tp.loyalty.selectAvailableLoyaltyRewardsMap),M=null!=(t=null==(r=g.loyaltyTransaction)?void 0:r.pointsUsed)?t:0,L=(0,n.useMemo)((()=>Ve(g,M)),[g,M]),N=(0,n.useMemo)((()=>L?function(e,t){var r,n;return(null!=(r=null==(n=e.cart)?void 0:n.cartEntries)?r:[]).filter(((e,r)=>r!==t))}(g,L.index):[]),[g,L]),_=(0,n.useMemo)((()=>{var e;return Kr(null==L||null==(e=L.item)?void 0:e.image)}),[null==L||null==(i=L.item)?void 0:i.image]),F=(0,n.useMemo)((()=>Ue(g.createdAt,C)),[g.createdAt,C]),V=(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!==z.Re.REFUND_REQUESTED&&r!==z.Re.REFUND_SUCCESSFUL||(l="orderCardRefundConfirmed",c="neutral"),r===z.Re.REFUND_ERROR&&(l="orderCardRefundFailed",c="warning"),n===Be.l.CANCELED||d===z.ni.ORDER_CANCELLED||d===z.ni.ORDER_ERROR)return{orderStatusLabel:"orderCardCancelled",refundChipLabel:l,refundChipStatus:c};if(n===Be.l.DONE||d===z.ni.ORDER_DROPPED_OFF||d===z.ni.ORDER_ABANDONED)return{orderStatusLabel:"orderCardCompleted",refundChipLabel:l,refundChipStatus:c};if(l)return{orderStatusLabel:null,refundChipLabel:l,refundChipStatus:c};const u=(0,Ie.T0)(null!=n?n:"",i,null!=a?a:0,t),p=u.isTerminal,m=u.updatedStatus;return p&&m===Be.l.DONE?{orderStatusLabel:"orderCardCompleted",refundChipLabel:null,refundChipStatus:null}:p&&m===Be.l.CANCELED?{orderStatusLabel:"orderCardCancelled",refundChipLabel:null,refundChipStatus:null}:s===R.h1.DELIVERY&&Xe(i,null!=o?o:null,t.getTime())?{orderStatusLabel:"orderCardCompleted",refundChipLabel:null,refundChipStatus:null}:{orderStatusLabel:null,refundChipLabel:null,refundChipStatus:null}}({rbiOrderStatus:g.status,deliveryStatus:null==(e=g.delivery)?void 0:e.status,partnerOrderStatus:null==(t=g.order)?void 0:t.status,createdAt:g.createdAt,fireOrderIn:null!=(r=g.fireOrderIn)?r:null,selectedPreOrderTimeSlot:v,serviceMode:null==(n=g.cart)?void 0:n.serviceMode})}),[g.status,null==(a=g.order)?void 0:a.status,null==(s=g.cart)?void 0:s.serviceMode,g.createdAt,g.fireOrderIn,null==(l=g.delivery)?void 0:l.status,v]),U=at(g,O);(0,n.useEffect)((()=>{var e;const t=g.rbiOrderId;!T.current&&en(t)&&(T.current=!0,Se(w,t,null==(e=g.cart)?void 0:e.serviceMode))}),[w,g.rbiOrderId,null==(c=g.cart)?void 0:c.serviceMode]);const W=(0,n.useCallback)((()=>{!function(e,t){e.logEvent(De.og.BUTTON_CLICK,De.wf.Navigation,{[De.Ny.NAME]:De.nE.VIEW_ORDER_DETAILS,[De.Ny.PATH]:t})}(w,S.JZ.orderConfirmation),I(S.JZ.orderConfirmation+"/"+g.rbiOrderId,{state:{from:"recentOrders"}})}),[w,I,g.rbiOrderId]),H=(0,n.useCallback)((()=>{!function(e,t){e.logEvent(De.og.BUTTON_CLICK,De.wf.Navigation,{[De.Ny.NAME]:De.nE.REORDER_CLICKED,[De.Ny.PATH]:t})}(w,S.JZ.orders);for(const n of null!=(e=null==(t=g.cart)?void 0:t.cartEntries)?e:[]){var e,t,r;Te(w,null!=(r=null==n?void 0:n.name)?r:"")}j()}),[w,null==(u=g.cart)?void 0:u.cartEntries,j]);if(!L)return null;const q=M>0&&"OfferItem"===L.item.type,G=q?dt(L.item.lineId,g,P):0,Z=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(vr,{"data-testid":"v2-order-card-v2-ActionButton",variant:"text",text:y({id:"viewDetails"}),onClick:W,preserveLabelCasing:!0}),k.canRenderReorderCTA&&(0,f.jsx)(vr,{variant:"outline",text:y({id:"reorder"}),onClick:H,preserveLabelCasing:!0,loading:A,"data-testid":"order-card-v2-reorder-button"})]}),Y=_?(0,f.jsx)(Qt,{"data-testid":"v2-order-card-v2-ProductImage",children:(0,f.jsx)(zr.V,{"data-testid":"v2-order-card-v2-Picture",image:_,alt:null!=(p=L.item.name)?p:"",placeholderAspectRatio:1})}):null,K=(0,f.jsxs)(rr,{"data-testid":"v2-order-card-v2-ItemDetails",children:[(0,f.jsx)(nr,{"data-testid":"v2-order-card-v2-ClampedItemName",children:y({id:"OrderConfirmation.orderNumberDis
1play",defaultMessage:"Order #{orderNumber}"},{orderNumber:null!=(m=g.orderNumberFormatted)?m:g.rbiOrderId})}),(0,f.jsx)(an,{"data-testid":"v2-order-card-v2-PriceAndDateDisplay",isReward:q,points:G,formattedPrice:U,formattedDate:F,orderStatusLabel:V.orderStatusLabel,refundChipLabel:V.refundChipLabel,formatMessage:y}),V.refundChipLabel&&V.refundChipStatus&&(0,f.jsx)(nn,{"data-testid":"v2-order-card-v2-RefundChip",refundChipLabel:V.refundChipLabel,refundChipStatus:V.refundChipStatus,formatMessage:y})]}),J=(0,f.jsxs)(er,{"data-testid":"v2-order-card-v2-OrderDetailsContent",$hasLeadingImage:!!Y,children:[Y,K,N.length>0&&(0,f.jsx)(tr,{"data-testid":"v2-order-card-v2-RemainingItemsContent",$hasLeadingImage:!!Y,children:(0,f.jsx)(tn,{"data-testid":"v2-order-card-v2-RemainingItemsList",items:N,orderId:g.rbiOrderId,formatCurrency:O,pointsUsed:M,order:g,rewardsMap:P})}),h&&(0,f.jsx)(Ht,{"data-testid":"v2-order-card-v2-OrderCardV2PointsRow",loyaltyTransaction:g.loyaltyTransaction,impactedExpirationBuckets:x})]});if(D){const e=(0,f.jsxs)(xr,{"data-testid":"v2-order-card-v2-DesktopCardBody",children:[(0,f.jsx)(yr,{"data-testid":"v2-order-card-v2-DesktopMainContent",children:J}),(0,f.jsx)(hr,{"data-testid":"v2-order-card-v2-DesktopTrailingActions",children:Z})]});return(0,f.jsx)(Jt,{"data-testid":"order-card-v2-"+g.rbiOrderId,children:(0,f.jsx)(Et.z,{"data-testid":"v2-order-card-v2-SingleCard",variant:jt.D.OUTLINED,mainContent:e})})}const X=J,Q=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Nt.c,{"data-testid":"v2-order-card-v2-Divider"}),(0,f.jsx)(gr,{"data-testid":"v2-order-card-v2-FooterActions",children:Z})]});return(0,f.jsx)(Jt,{"data-testid":"order-card-v2-"+g.rbiOrderId,children:(0,f.jsx)(Et.z,{"data-testid":"v2-order-card-v2-SingleCard-1",variant:jt.D.OUTLINED,mainContent:X,footer:Q})})};var on=r(20538),sn=r(62334),ln=r(34225);const cn=new Set([z.ni.ORDER_DROPPED_OFF,z.ni.ORDER_ABANDONED,z.ni.ORDER_CANCELLED,z.ni.ORDER_ERROR,z.ni.ORDER_TIMEOUT]);const un=(e,t)=>{var r,i,a;let d=t.enabled;const o=null!=(r=null==(i=e.delivery)?void 0:i.status)?r:z.ni.ORDER_CREATED,s=null!=(a=e.status)?a:"",l=(0,n.useState)(o),c=l[0],u=l[1],p=(0,n.use
1State)(s),m=p[0],g=p[1],v=(0,n.useState)((()=>d&&!cn.has(o))),h=v[0],x=v[1],f=(0,n.useState)(null),y=f[0],C=f[1],I=(0,n.useState)(void 0),b=I[0],w=I[1],E=(0,n.useState)(null),j=E[0],k=E[1],A=(0,ln.vF)().query,O=(0,n.useRef)(null),R=(0,n.useRef)(!1),D=(0,on.T)(),S=(0,n.useCallback)((()=>{R.current=!1,O.current&&(clearTimeout(O.current),O.current=null)}),[]);return(0,n.useEffect)((()=>{if(!d||!D||cn.has(o))return void x(!cn.has(o)&&d);R.current=!0;const t=(0,sn.b)(e.rbiOrderId),r=()=>{O.current=globalThis.setTimeout(n,1e4)},n=()=>{A(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,p=null==e?void 0:e.status;var m,g;if(u&&r.setDeliveryStatus(u),p&&r.setRbiOrderStatus(p),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!=(m=e.delivery.vendorProperties.vendor)?m:void 0),void 0!==(null==e||null==(s=e.delivery)?void 0:s.selectedPreOrderTimeSlot)&&r.setSelectedPreOrderTimeSlot(null!=(g=e.delivery.selectedPreOrderTimeSlot)?g:null),u&&cn.has(u))return r.setIsOngoing(!1),void(t.current=!1);if(Xe(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:g,setIsOngoing:x,setDropoff:C,setVendor:w,setSelectedPreOrderTimeSlot:k},r,e.createdAt)})).catch((()=>{R.current&&r()}))};return n(),()=>{R.current=!1,O.current&&(clearTimeout(O.current),O.current=null)}}),[d,D,o,e.rbiOrderId,A]),{isOngoing:h,deliveryStatus:c,rbiOrderStatus:m,dropoff:y,vendor:b,selectedPreOrderTimeSlot:j,stopPolling:S}},pn={bold:Ae.eh,regular:Ae.r,status:sr},mn=e=>{let t=e.formattedDate,r=e.highlightedPoints,n=e.isHighlightedReward,i=e.priceDateStatusItems;return(0,f.jsxs)(ir,{"data-testid":"v2-ongoing-delivery-order-card-v2-PriceDateRow",children:[n&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ar,{value:r,"data-testid":"ongoing-order-reward-points"}),t&&(0,f.jsx)(Ae.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=pn[n];return(0,f.jsx)(i,{"data-testid":"v2-ongoing-delivery-order-card-v2-Comp",children:r},t)}))]})},gn=e=>{var t,r,i,a,s,l,c,u,p;let m=e.order,g=e.onOrderTerminal;const v=(0,d.A)(),h=v.formatMessage,x=v.formatTime,y=(0,B.Ym)().locale,C=(0,wt.fz)().formatCurrencyForLocale,I=(0,o.Zp)(),w=(0,be.q)(),E=(0,b.U)("desktop"),j=(0,Gr.GV)(Gr.Tp.loyalty.selectAvailableLoyaltyRewardsMap),k=null!=(t=null==(r=m.loyaltyTransaction)?void 0:r.pointsUsed)?t:0,A=(0,n.useMemo)((()=>Ve(m,k)),[m,k]),O=Ke(m),R=(0,n.useRef)(!1),D=un(m,{enabled:O}),T=D.isOngoing,P=D.deliveryStatus,M=D.rbiOrderStatus,L=D.dropoff,N=D.vendor,_=D.selectedPreOrderTimeSlot,$=(0,qr.A)(P,L,N,_);(0,n.useEffect)((()=>{T||null==g||g(m.rbiOrderId)}),[T,g,m.rbiOrderId]),(0,n.useEffect)((()=>{var e;const t=m.rbiOrderId;!R.current&&en(t)&&(R.current=!0,Se(w,t,null==(e=m.cart)?void 0:e.serviceMode))}),[w,m.rbiOrderId,null==(i=m.cart)?void 0:i.serviceMode]);const F=at(m,C),V=(0,n.useMemo)((()=>Ue(m.createdAt,y)),[m.createdAt,y]),U=(null!=(a=null==(s=m.cart)||null==(s=s.cartEntries)?void 0:s.length)?a:0)-1,W=(0,n.useMemo)((()=>{var e;return Kr(null==A||null==(e=A.item)?void 0:e.image)}),[null==A||null==(l=A.item)?void 0:l.image]),H=(0,n.useCallback)((()=>{var e;const t=S.JZ.orderConfirmation+"/"+m.rbiOrderId;!function(e,t){e.logEvent(De.og.BUTTON_CLICK,De.wf.Navigation,{[De.Ny.NAME]:De.nE.TRACK_ORDER,[De.Ny.PATH]:t.path,[De.Ny.ORDER_ID]:t.orderId,[De.Ny.SERVICE_MODE]:t.serviceMode,[De.Ny.DELIVERY_STATUS]:t.deliveryStatus,[De.Ny.PARTNER_STATUS]:t.partnerStatus})}(w,{path:t,orderId:m.rbiOrderId,serviceMode:null==(e=m.cart)?void 0:e.serviceMode,deliveryStatus:P,partnerStatus:M}),I(t,{state:{from:"recentOrders"}})}),[w,m.rbiOrderId,null==(c=m.cart)?void 0:c.serviceMode,P,M,I]);if(!T)return(0,f.jsx)(dn,{"data-testid":"v2-ongoing-delivery-order-card-v2-OrderCardV2",order:m,selectedPreOrderTimeSlot:_});if(!A)return null;const q=k>
10&&"OfferItem"===A.item.type,G=q?dt(A.item.lineId,m,j):0,Z=function(e,t,r){switch(e){case z.ni.ORDER_PICKED_UP:case z.ni.DRIVER_AT_CUSTOMER:return r({id:"ongoingOrder.driverEnroute",defaultMessage:"Driver enroute"});case z.ni.ORDER_DROPPED_OFF:case z.ni.ORDER_ABANDONED:return r({id:"orderCardCompleted",defaultMessage:"Completed"});case z.ni.ORDER_CREATED:case z.ni.DRIVER_ASSIGNED:case z.ni.DRIVER_UNASSIGNED:case z.ni.DRIVER_STARTING:case z.ni.DRIVER_AT_STORE:default:return t===z.Re.UPDATE_SUCCESSFUL?r({id:"ongoingOrder.beingPrepared",defaultMessage:"Being prepared"}):r({id:"ongoingOrder.orderPlaced",defaultMessage:"Order placed"})}}(P,M,h),Y=function(e,t){switch(e){case z.ni.ORDER_DROPPED_OFF:case z.ni.ORDER_ABANDONED:return 4;case z.ni.DRIVER_AT_CUSTOMER:return 3.5;case z.ni.ORDER_PICKED_UP:return 3;case z.ni.DRIVER_AT_STORE:return 2.5;case z.ni.ORDER_CREATED:case z.ni.DRIVER_ASSIGNED:case z.ni.DRIVER_UNASSIGNED:case z.ni.DRIVER_STARTING:return t===z.Re.UPDATE_SUCCESSFUL?2:1.5;default:return 1}}(P,M),K=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!"})}}(Y,h),J=h(!!_?{id:"scheduledDeliveryTime"}:{id:"estimatedDeliveryTime"}),X=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)}(_,x,$),Q=(0,f.jsx)(vr,{"data-testid":"v2-ongoing-delivery-order-card-v2-ActionButton",variant:"solid",size:E?"small":"large",text:h({id:"trackOrderV2",defaultMessage:"Track Order"}),onClick:H,iconLeading:Yr.A,fullWidth:!E,preserveLabelCasing:!0}),ee=W?(0,f.jsx)(Qt,{"data-testid":"v2-ongoing-delivery-order-card-v2-ProductImage",children:(0,f.jsx)(zr.V,{"data-testid":"v2-ongoing-delivery-order-card-v2-Picture",image:W,alt:null!=(u=A.item.name)?u:"",placeholderAspectRatio:1})}):null,te=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}(q?"":F,V,Z),re=(0,f.jsxs)(rr,{"data-testid":"v2-ongoing-delivery-order-card-v2-ItemDetails",children:[(0,f.jsxs)(_r,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingItemName",children:[null!=(p=A.item.name)?p:"",U>0&&h({id:"recentOrdersAndMore",defaultMessage:" & more.."})]}),(0,f.jsx)(mn,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingPriceDateRow",formattedDate:V,highlightedPoints:G,isHighlightedReward:q,priceDateStatusItems:te}),(0,f.jsxs)(Lr,{"data-testid":"v2-ongoing-delivery-order-card-v2-ProgressBlock",children:[(0,f.jsxs)(Nr,{"data-testid":"v2-ongoing-delivery-order-card-v2-EtaBlock",children:[(0,f.jsx)(Ae.sD,{"data-testid":"v2-ongoing-delivery-order-card-v2-TitleSmall",children:X}),(0,f.jsx)(Ae.r,{"data-testid":"v2-ongoing-delivery-order-card-v2-FootnoteRegular-1",children:J})]}),(0,f.jsx)(Br,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingDeliveryProgressIndicator",segments:it,currentValue:Y,variant:Zr.S.PRIMARY}),(0,f.jsx)(Ae.uv,{"data-testid":"v2-ongoing-delivery-order-card-v2-BodyMedium",children:K})]})]}),ne=(0,f.jsxs)(Sr,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingDesktopCardBody",children:[ee&&(0,f.jsx)(fr,{"data-testid":"v2-ongoing-delivery-order-card-v2-DesktopLeadingContent",children:ee}),(0,f.jsx)(Tr,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingDesktopMainContent",children:re}),(0,f.jsx)(hr,{"data-testid":"v2-ongoing-delivery-order-card-v2-DesktopTrailingActions",children:Q})]}),ie=(0,f.jsxs)(Dr,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingHighlightedSection",children:[ee,re]}),ae=(0,f.jsxs)(Pr,{"data-testid":"v2-ongoing-delivery-order-card-v2-OngoingCardFooter",children:[(0,f.jsx)(Nt.c,{"data-testid":"v2-ongoing-delivery-order-card-v2-Divider"}),(0,f.jsx)(gr,{"data-testid":"v2-ongoing-delivery-order-card-v2-FooterActions",children:Q})]});return(0,f.jsx)(Jt,{"data-testid":"ongoing-delivery-order-card-v2-"+m.rbiOrderId,children:(0,f.jsx)(Et.z,{"data-testid":"v2-ongoing-delivery-order-card-v2-SingleCard",variant:jt.D.FILLED,cardType:E?void 0:jt.G.SMALL,mainContent:E?ne:ie,footer:E?void 0:ae})})};var vn=r(48553),hn=r(25312);var xn=r(40788);const fn=(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:"",p=(0,xn.p)({rbiOrderId:l?e.rbiOrderId:void 0,posVendor:u,serviceMode:c}),m=p.orderStatus,g=p.isProgressBarEnabled,v=p.stopPolling,h=(0,n.use
1State)(""),x=h[0],f=h[1],y=(0,n.useState)((()=>{var t;return l&&Qe((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=m||(null==(t=e.order)?void 0:t.status)||"",n=r?(i=r,a=e.createdAt,d=e.fireOrderIn||0,i?(0,Ie.T0)(i,a,d).updatedStatus:i):"";var i,a,d;const o=Qe(r,e.createdAt,e.fireOrderIn||0);return f(n),I(o),o||v(),!o}),[l,m,e.createdAt,e.fireOrderIn,null==(o=e.order)?void 0:o.status,v]);return(0,n.useEffect)((()=>{if(!l){var t;const r=Qe((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)}),Ie.Wx);return()=>clearInterval(r)}),[l,b,e.createdAt,e.fireOrderIn,null==(s=e.order)?void 0:s.status]),{isOngoing:C,effectiveStatus:x,isProgressBarEnabled:l&&g}},yn=e=>{let t=e.formattedPrice,r=e.formattedDate,n=e.statusLabel,i=e.pointsUsed,a=e.isHighlightedReward;return(0,f.jsxs)(ir,{"data-testid":"v2-ongoing-pickup-order-card-v2-PriceDateRow",children:[a?(0,f.jsx)(ar,{value:i,"data-testid":"ongoing-order-reward-points"}):t&&(0,f.jsx)(Ae.eh,{"data-testid":"v2-ongoing-pickup-order-card-v2-FootnoteBold",children:t}),(a||t)&&r&&(0,f.jsx)(Ae.r,{"data-testid":"v2-ongoing-pickup-order-card-v2-FootnoteRegular",children:" \u2022 "}),r&&(0,f.jsx)(Ae.r,{"data-testid":"v2-ongoing-pickup-order-card-v2-FootnoteRegular-1",children:r}),r&&n&&(0,f.jsx)(Ae.r,{"data-testid":"v2-ongoing-pickup-order-card-v2-FootnoteRegular-2",children:" \u2022 "}),n&&(0,f.jsx)(sr,{"data-testid":"v2-ongoing-pickup-order-card-v2-OrderStatusLabel",children:n})]})},Cn=e=>{var t,r,i,a,s,l,c,u,p,m,g,v;let h=e.order,x=e.onOrderTerminal;const y=(0,d.A)().formatMessage,C=(0,B.Ym)().locale,I=(0,wt.fz)().formatCurrencyForLocale,w=(0,o.Zp)(),E=(0,be.q)(),j=(0,b.U)("desktop"),k=(0,Gr.GV)(Gr.Tp.loyalty.selectAvailableLoyaltyRewardsMap),A=null!=(t=null==(r=h.loyaltyTransaction)?void 0:r.pointsUsed)?t:0,R=(0,n.useMemo)((()=>Ve(h,A)),[h,A]),D=function(e,t){return void 0===t&&(t=new Date),rt(e,t)}(h),T=fn(h,{enabled:D}),P=T.isOngoing,M=T.effectiveStatus,L=T.isProgressBarEnabled,N=(0,n.useState)(1),_=N[0],$=N[1],F=(0,n.useRef)(!1);(0,n.useEffect)((()=>{P||null==x||x(h.rbiOrderId)}),[P,x,h.rbiOrderId]);const U=(0,n.useMemo)((()=>{var e;return Kr(null==R||null==(e=R.item)?void 0:e.image)}),[null==R||null==(i=R.item)?void 0:i.image]),W=(0,n.useMemo)((()=>Ue(h.createdAt,C)),[h.createdAt,C]),H=null==(null==(a=h.cart)?void 0:a.totalCents)?"":I(h.cart.totalCents),z=(null!=(s=null==(l=h.cart)||null==(l=l.cartEntries)?void 0:l.length)?s:0)-1,q=null==(c=h.cart)?void 0:c.serviceMode,G=M||(null==(u=h.order)?void 0:u.status)||"",Z=(e=>{let t=e.serverOrder,r=e.posOrderStatus,i=void 0===r?"":r;const a=(0,d.A)().formatMessage,o=(0,hn.X)({serverOrder:t}).pickupDate,s=(0,O._P)(O.N$.ENABLE_STORE_TIME_FOR_AVAILABILITY),l=(0,V.oX)().storeTimezoneOffsetMs,c=0===((null==t?void 0:t.fireOrderIn)||0),u=(0,n.useMemo)((()=>(0,Ie.Cp)(o,s,l)),[o,s,l]);return{pickupTimeText:c?(0,$e.fp)(i,a):a({id:"recentOrdersScheduledFor",defaultMessage:"Scheduled for"})+" "+u,pickupDate:o,isOrderFiredIn:c,readablePickupTime:u}})({serverOrder:h,posOrderStatus:G}),Y=Z.pickupTimeText;(0,n.useEffect)((()=>{M&&$(function(e,t){var r;const n=(0,$e.pX)(e,t);return(null==(r=(0,$e.ZW)(t).find((e=>e.label===n)))?void 0:r.value)||1}(M,y))}),[M,y]),(0,n.useEffect)((()=>{var e;const t=h.rbiOrderId;!F.current&&en(t)&&(F.current=!0,Se(E,t,null==(e=h.cart)?void 0:e.serviceMode))}),[E,h.rbiOrderId,null==(p=h.cart)?void 0:p.serviceMode]);const K=(0,n.useCallback)((()=>{var e;!function(e,t){e.logEvent(De.og.BUTTON_CLICK,De.wf.Navigation,{[De.Ny.NAME]:De.nE.TRACK_ORDER,[De.Ny.PATH]:t.path,[De.Ny.ORDER_ID]:t.orderId,[De.Ny.SERVICE_MODE]:t.serviceMode})}(E,{path:S.JZ.orderConfirmation+"/"+h.rbiOrderId,orderId:h.rbiOrderId,serviceMode:null==(e=h.cart)?void 0:e.serviceMode}),w(S.JZ.orderConfirmation+"/"+h.rbiOrderId,{state:{from:"recentOrders"}})}),[E,h.rbiOrderId,null==(m=h.cart)?void 0:m.serviceMode,w]);if(!P)return(0,f.jsx)(dn,{"data-testid":"v2-ongoing-pickup-order-card-v2-OrderCardV2",order:h});if(!R)return null;const J=A>0&&"OfferItem"===R.item.type,X=J?dt(R.item.lineId,h,k):0,Q=function(e,t){switch(e){case Be.l.PREPARING:return t({id:"deliveryOrderBeingPrepared",defaultMessage:"Be
1ing Prepared"});case Be.l.PREPARED:return t({id:"orderPrepared",defaultMessage:"Prepared"});case Be.l.DONE:return t({id:"orderCardCompleted",defaultMessage:"Completed"});case Be.l.CREATED:case Be.l.PRICED:case Be.l.COMMITTED:default:return t({id:"orderPlaced",defaultMessage:"Order Placed"})}}(G,y),ee=(0,$e.fX)(G,y),te=(0,vn.Q)(q),re=(0,f.jsx)(vr,{"data-testid":"v2-ongoing-pickup-order-card-v2-ActionButton",variant:"solid",size:j?"small":"large",text:y({id:"trackOrderV2",defaultMessage:"Track Order"}),onClick:K,iconLeading:te,fullWidth:!j,preserveLabelCasing:!0}),ne=U?(0,f.jsx)(Qt,{"data-testid":"v2-ongoing-pickup-order-card-v2-ProductImage",children:(0,f.jsx)(zr.V,{"data-testid":"v2-ongoing-pickup-order-card-v2-Picture",image:U,alt:null!=(g=R.item.name)?g:"",placeholderAspectRatio:1})}):null,ie=(0,f.jsxs)(rr,{"data-testid":"v2-ongoing-pickup-order-card-v2-ItemDetails",children:[(0,f.jsxs)(_r,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingItemName",children:[null!=(v=R.item.name)?v:"",z>0&&y({id:"recentOrdersAndMore",defaultMessage:" & more.."})]}),(0,f.jsx)(yn,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingOrderPriceDateRow",formattedPrice:H,formattedDate:W,statusLabel:Q,pointsUsed:X,isHighlightedReward:J}),(0,f.jsxs)(Lr,{"data-testid":"v2-ongoing-pickup-order-card-v2-ProgressBlock",children:[(0,f.jsx)(Mr,{"data-testid":"v2-ongoing-pickup-order-card-v2-PickupTimeBlock",children:(0,f.jsx)(Ae.sD,{"data-testid":"v2-ongoing-pickup-order-card-v2-TitleSmall",children:Y})}),L&&(0,f.jsx)(qt.H,{"data-testid":"v2-ongoing-pickup-order-card-v2-SegmentedProgressIndicator",segments:[{label:"",value:1},{label:"",value:2},{label:"",value:3}],currentValue:_,variant:Zr.S.PRIMARY}),(0,f.jsx)(Ae.uv,{"data-testid":"v2-ongoing-pickup-order-card-v2-BodyMedium",children:ee})]})]});return j?(0,f.jsx)(Jt,{"data-testid":"ongoing-order-card-v2-"+h.rbiOrderId,children:(0,f.jsx)(Et.z,{"data-testid":"v2-ongoing-pickup-order-card-v2-SingleCard",variant:jt.D.FILLED,mainContent:(0,f.jsxs)(Sr,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingDesktopCardBody",children:[ne&&(0,f.jsx)(fr,{"data-testid":"v2-ongoing-pickup-order-card-v2-DesktopLeadingContent",children:ne}),(0,f.jsx)(Tr,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingDesktopMainContent",children:ie}),(0,f.jsx)(hr,{"data-testid":"v2-ongoing-pickup-order-card-v2-DesktopTrailingActions",children:re})]})})}):(0,f.jsx)(Jt,{"data-testid":"ongoing-order-card-v2-"+h.rbiOrderId,children:(0,f.jsx)(Et.z,{"data-testid":"v2-ongoing-pickup-order-card-v2-SingleCard-1",variant:jt.D.FILLED,cardType:jt.G.SMALL,mainContent:(0,f.jsxs)(Dr,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingHighlightedSection",children:[ne,ie]}),footer:(0,f.jsxs)(Pr,{"data-testid":"v2-ongoing-pickup-order-card-v2-OngoingCardFooter",children:[(0,f.jsx)(Nt.c,{"data-testid":"v2-ongoing-pickup-order-card-v2-Divider"}),(0,f.jsx)(gr,{"data-testid":"v2-ongoing-pickup-order-card-v2-FooterActions",children:re})]})})})};var In,bn,wn=r(54909),En=r(54356),jn=r(44296),kn=r(18091),An=r(8674);!function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"}(In||(In={})),function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"}(bn||(bn={}));var On=function(e){var t=(0,d.A)(),r=e.value,n=e.children,i=(0,An.Tt)(e,["value","children"]);return n(t.formatNumberToParts(r,i))};On.displayName="FormattedNumberParts";function Rn(e){var t=function(t){var r=(0,d.A)(),n=t.value,i=t.children,a=(0,An.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=bn[e],t}function Dn(e){var t=function(t){var r=(0,d.A)(),i=t.value,a=t.children,o=(0,An.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=In[e],t}On.displayName="FormattedNumberParts";Dn("formatDate"),Dn("formatTime"),Dn("formatNumber"),Dn("formatList"),Dn("formatDisplayName"),Rn("formatDate"),Rn("formatTime");const Sn={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 Tn=r(21879),Pn=r(37571);const Mn=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)(Pn.c).withConfig({componentId:"sc-7dw8eq-1"})(["margin-block-start:1rem;margin-inline:-16px;width:calc(100% + 32px);"]),Nn=s.I4.div.withConfig({componentId:"sc-7dw8eq-2"})(["",";margin-block-start:4px;"],(e=>e.theme.typography.footnoteRegular)),_n=s.I4.section.withConfig({componentId:"sc-7dw8eq-3"})(["width:100%;> div{max-width:100%;}"]),Bn=s.I4.h2.withConfig({componentId:"sc-7dw8eq-4"})(["margin-block-end:24px;"]),$n=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;}"],Tn.H.desktop),Fn=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,wn.f)(),c=(0,En.x)(),u=(0,O._P)(O.N$.ENABLE_RECENT_ITEMS_WITH_MODIFIERS),p=(0,O._P)(O.N$.HIDE_UI_CALORIES),m=(0,n.use
1State)(null),g=m[0],v=m[1],h=(0,n.useState)(void 0),x=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=p?void 0:l({menuItem:x,frontendEntry:g,quantity:a.quantity}),I=u&&null!=g&&g.children?(0,W.ct)(g):[],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,A=C?(0,f.jsx)(Nn,{"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,f.jsx)($n,{"data-testid":"recent-items-carousel-v2-recent-items-card-v2-RecentItemCardWrapper",children:(0,f.jsx)(Et.z,{variant:jt.D.OUTLINED,"data-testid":"recent-items-card-v2",listItem:(0,f.jsx)(jn.c,{disableEvents:!0,data:{title:(0,f.jsx)(Ae.qH,{"data-testid":"recent-items-carousel-v2-recent-items-card-v2-TitleMedium",children:null!=(r=a.name)?r:""}),description:k,maxDescriptionLines:3,supportingContent:A,leadingContent:(0,f.jsx)(Fn,{"data-testid":"recent-items-carousel-v2-recent-items-card-v2-LeadingImageContainer",children:(0,f.jsx)(zr.V,{"data-testid":"recent-items-carousel-v2-recent-items-card-v2-Picture",objectFitContain:!0,image:(0,kn.QG)({value:a.image||"{}"}),alt:null!=(i=a.name)?i:""})}),trailingContent:(0,f.jsx)(je.$,{variant:"outline",size:"small",text:s(Sn.addButtonLabel),onClick:R,"data-testid":"recent-items-card-v2-add-button"})}})})})},Un=n.memo(Vn);var Wn=r(71828),Hn=r(52075),zn=r(56268),qn=r(68605).P;const Gn=s.I4.div.withConfig({componentId:"sc-1htxpyp-0"})(["width:100%;position:relative;display:flex;"]),Zn=s.I4.div.withConfig({componentId:"sc-1htxpyp-1"})(["position:absolute;inset-block-start:50%;transform:translateY(-50%);z-index:",";display:flex;align-items:center;"],qn.zIndex.overlay),Yn=(0,s.I4)(Zn).withConfig({componentId:"sc-1htxpyp-2"})(["inset-inline-start:-20px;"]),Kn=(0,s.I4)(Zn).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 p=(0,n.useCallback)((()=>{d((e=>e+1))}),[]),m=(0,n.useCallback)((()=>{d((e=>e-1))}),[]),g=r.length,v=(null==u||null==(t=u.current)?void 0:t.offsetWidth)||1050,h=s+Hn.D.SPACER,x=Math.min(v,1050),y=window.innerWidth>=x,C=y?x:window.innerWidth,I=h>Hn.D.SPACER?Math.floor((C-16)/h):0,b=I*h,w=g>1?Math.round((C-b)/2):16,E=0!==a,j=I>0&&(a+1)*I<g;(0,n.useEffect)((()=>{if(I>0){const e=Math.max(0,Math.ceil(g/I)-1);d((t=>Math.min(t,e)))}}),[I,g]);const k=a*b,A=(0,n.useMemo)((()=>r.map(((e,t)=>{const r=n.isValidElement(e)?e.key:null;return(0,f.jsx)(Wn.Ox,{ref:c,"data-testid":"single-carousel-card",children:e},null!=r?r:"single_carousel_card_"+t)}))),[r]);return(0,f.jsxs)(Gn,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-CarouselContainer",ref:u,children:[E&&(0,f.jsx)(Yn,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-LeftArrowWrapper",children:(0,f.jsx)(zn.D9,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-LeftArrow",onPrevious:m})}),(0,f.jsx)(Wn.nF,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-CardContainerWrapper",hideScrollBar:!0,isMobile:!1,children:(0,f.jsxs)(Wn.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,f.jsx)(Wn.vy,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-CardsWrapper",$offset:k,children:A}),(null==r?void 0:r.length)>1&&(0,f.jsx)(Wn.hK,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-Spacer"})]})}),j&&(0,f.jsx)(Kn,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-RightArrowWrapper",children:(0,f.jsx)(zn.UU,{"data-testid":"recent-items-carousel-v2-responsive-carousel-v2-RightArrow",onNext:p})})]})};var Xn=r(5865),Qn=r(66281),ei=r(74286),ti=r(33882),ri=r(35135),ni=r(40281);const ii=e=>e.sanityId||e.lineId||"",ai=e=>(0,ni.jr)({type:e.type,sanityId:e.sanityId,_id:e.sanityId}),di=()=>{const e=(0,d.A)().formatMessage,t=(0,O._P)(O.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,A.Z2)().user,i=(0,ti.K)().checkItemAvailability,a=(0,V.oX)(),s=a.isStoreOpenAndAvailable,l=a.store,c=a.prices,u=(0,R.jg)(),p=u.addToCart,m=u.cartEntries,g=u.recent,v=g.pendingRecentItem,h=g.setPendingRecentItem,x=(0,Qn._)().vendor,f=(0,ri.d)().showSnackbar,y=(0,ei.CR)().setStoreLocatorCallbackUrl,C=(0,En.x)(),b=(0,n.use
1State)([]),w=b[0],E=b[1],j=(0,n.useState)(!1),k=j[0],O=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,W.xO)(e))).slice(0,10)}),[null==r?void 0:r.uniquePurchasedItems]);(0,n.useEffect)((()=>{var e;if(!s)return E(M),void O(!1);let t=!1;O(!0);const r=null!=(e=null==l?void 0:l.number)?e:"";return Promise.all(M.map((async e=>{const t=ai(e);if(!t)return null;try{return(await i({vendor:x,storeNumber:r,itemId:t})).availabilityStatus===Xn.r.AVAILABLE?e:null}catch(n){return null}}))).then((e=>{t||E(e.filter((e=>null!==e)))})).finally((()=>{t||O(!1)})),()=>{t=!0}}),[s,M,i,x,null==l?void 0:l.number]);const L=(0,n.useMemo)((()=>{const e=new Set(m.map((e=>e._id)).filter(Boolean));return w.filter((t=>!T.has(ii(t))&&(!t.sanityId||!e.has(t.sanityId))))}),[w,m,T]);return(0,I.S)((()=>{var t;if(!s||!v||!c)return;const r=v;h(null);const n=ai(r);n&&i({vendor:x,storeNumber:null!=(t=null==l?void 0:l.number)?t:"",itemId:n}).then((async t=>{if(t.availabilityStatus===Xn.r.AVAILABLE){var n;const t=(await C(r,m)).cartEntry;p(t,{skipToast:!0}),f({content:e(Sn.itemAddedToCart,{itemName:null!=(n=r.name)?n:""}),autoClose:!0})}else{var i;P((e=>new Set(e).add(ii(r)))),f({content:e(Sn.itemUnavailableAtLocation,{itemName:null!=(i=r.name)?i:""}),autoClose:!0})}})).catch((()=>{var t;P((e=>new Set(e).add(ii(r)))),f({content:e(Sn.itemUnavailableAtLocation,{itemName:null!=(t=r.name)?t:""}),autoClose:!0})}))})),{visibleItems:L,isCheckingAvailability:k,handleAddPress:(0,n.useCallback)((async r=>{if(s){const t=ai(r);var n;if(!t)return P((e=>new Set(e).add(ii(r)))),void f({content:e(Sn.itemUnavailableAtLocation,{itemName:null!=(n=r.name)?n:""}),autoClose:!0});let s;try{var a;s=(await i({vendor:x,storeNumber:null!=(a=null==l?void 0:l.number)?a:"",itemId:t})).availabilityStatus}catch(u){var d;return P((e=>new Set(e).add(ii(r)))),void f({content:e(Sn.itemUnavailableAtLocation,{itemName:null!=(d=r.name)?d:""}),autoClose:!0})}if(s===Xn.r.AVAILABLE){var o;const t=(await C(r,m)).cartEntry;p(t,{skipToast:!0}),f({content:e(Sn.itemAddedToCart,{itemName:null!=(o=r.name)?o:""}),autoClose:!0})}else{var c;P((e=>new Set(e).add(ii(r)))),f({content:e(Sn.itemUnavailableAtLocation,{itemName:null!=(c=r.name)?c:""}),autoClose:!0})}}else y(S.JZ.orders),h(r),t(S.JZ.storeLocator,{state:{fromRecentOrders:!0}})}),[s,f,e,i,x,null==l?void 0:l.number,p,C,m,y,h,t])}})(),a=i.visibleItems,s=i.isCheckingAvailability,l=i.handleAddPress;if(!t)return null;if(s)return(0,f.jsx)(_n,{"data-testid":"recent-items-carousel-v2-loading"});if(0===a.length)return null;const c=a.map((e=>(0,f.jsx)(Un,{"data-testid":"recent-items-carousel-v2-index-RecentItemsCardV2",cartEntry:e,onAddPress:l},e.sanityId)));return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(_n,{"data-testid":"recent-items-carousel-v2",children:[(0,f.jsx)(Bn,{"data-testid":"recent-items-carousel-v2-index-SectionHeader",children:(0,f.jsx)(Ae.qH,{"data-testid":"recent-items-carousel-v2-index-TitleMedium",children:e({id:"recentItems"})})}),r?(0,f.jsx)(Mn,{"data-testid":"recent-items-carousel-v2-index-ItemsScrollContainer",children:c}):(0,f.jsx)(Jn,{"data-testid":"recent-items-carousel-v2-index-ResponsiveCarouselV2",children:c})]}),r&&(0,f.jsx)(Ln,{"data-testid":"recent-items-carousel-v2-index-BlockDivider",type:"block"})]})};var oi=r(43672),si=r(68605).P;const li=s.I4.div.withConfig({componentId:"sc-tqmpzm-0"})(["display:flex;flex-direction:column;align-items:center;width:100%;flex:1;","{flex:0;}"],si.desktop),ci=s.I4.div.withConfig({componentId:"sc-tqmpzm-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;flex:1;"]),ui=s.I4.div.withConfig({componentId:"sc-tqmpzm-2"})(["margin-block-end:1.5rem;"]),pi=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;}"],si.desktop),mi=()=>{const e=(0,d.A)().formatMessage,t=(0,o.Zp)(),r=(0,n.useCallback)((()=>t(S.JZ.menu)),[t]);return(0,f.jsxs)(li,{"data-testid":"v2-recent-orders-empty-v2-EmptyContainer",children:[(0,f.jsxs)(ci,{"data-testid":"v2-recent-orders-empty-v2-ContentGroup",children:[(0,f.jsx)(ui,{"data-testid":"v2-recent-orders-empty-v2-LogoWrapper",children:(0,f.jsx)(oi.p,{"data-testid":"v2-recent-orders-empty-v2-PaymentFailedLogo",width:160,height:160})}),(0,f.jsx)(Ae.UF,{"data-testid":"v2-recent-orders-empty-v2-TitleLarge",children:e({id:"noOrdersItemsYetV2",defaultMessage:"Recent orders & items will appear here"})}),(0,f.jsx)(Ae.uv,{"data-testid":"v2-recent-orders-empty-v2-BodyMedium",children:e({id:"recentOrdersEmptySubHeader"})})]}),(0,f.jsx)(pi,{"data-testid":"v2-recent-orders-empty-v2-CTAWrapper",children:(0,f.jsx)(je.$,{"data-testid":"v2-recent-orders-empty-v2-Button",fullWidth:!0,text:e({id:"startOrder"}),onClick:r,preserveLabelCasing:!0})})]})};var gi=r(14723),vi=r(30526),hi=r(47335),xi=r(70849);const fi=(0,vi.$)((e=>{let t=e.type;
1const r=(void 0===t?xi.S.LIST:t)===xi.S.GRID;return(0,f.jsxs)(hi.X5,{"data-testid":"list-item-list-item-skeleton-ListItemWrapper",$isGrid:r,$isLoading:!0,"aria-label":"list-item-loader",children:[r?(0,f.jsx)(gi.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader",height:"9.875rem",radius:"0.5rem"}):(0,f.jsx)(gi.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader-1",width:"6.25rem",height:"5rem",radius:"0.5rem"}),(0,f.jsx)(hi.J3,{"data-testid":"list-item-list-item-skeleton-MainContainer",$isGrid:r,children:(0,f.jsxs)(hi.DF,{"data-testid":"list-item-list-item-skeleton-MainContent",$isGrid:r,children:[(0,f.jsxs)(hi.Y0,{"data-testid":"list-item-list-item-skeleton-BodySkeleton",$isGrid:r,children:[(0,f.jsx)(gi.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader-2",width:"6.25rem",height:"1.25rem",radius:"0.625rem"}),!r&&(0,f.jsx)(gi.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader-3",width:"10.625rem",height:"1rem",radius:"0.5rem"})]}),r&&(0,f.jsx)(gi.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader-4",height:"1rem",radius:"0.5rem"}),!r&&(0,f.jsx)(hi.Gs,{"data-testid":"list-item-list-item-skeleton-TrailingWrapper",children:(0,f.jsx)(gi.j,{"data-testid":"list-item-list-item-skeleton-SkeletonLoader-5",width:"1.625rem",height:"1.25rem",radius:"0.625rem"})})]})})]})})),yi=s.I4.div.withConfig({componentId:"sc-gev1cg-0"})(["display:flex;flex-direction:column;padding-block-start:16px;"]),Ci=s.I4.section.withConfig({componentId:"sc-gev1cg-1"})(["width:100%;"]),Ii=s.I4.div.withConfig({componentId:"sc-gev1cg-2"})(["margin-block-end:24px;"]),bi=s.I4.div.withConfig({componentId:"sc-gev1cg-3"})(["display:flex;flex-direction:row;gap:16px;overflow:hidden;padding-block-end:20px;"]),wi=s.I4.div.withConfig({componentId:"sc-gev1cg-4"})(["width:309px;flex-shrink:0;"]),Ei=s.I4.div.withConfig({componentId:"sc-gev1cg-5"})(["display:flex;flex-direction:column;gap:24px;padding-block-start:16px;"]),ji=()=>(0,f.jsxs)(yi,{"data-testid":"recent-orders-skeleton-v2","aria-hidden":!0,children:[(0,f.jsxs)(Ci,{"data-testid":"recent-items-skeleton-v2",children:[(0,f.jsx)(Ii,{"data-testid":"v2-recent-orders-skeleton-v2-RecentItemsTitleSkeleton",children:(0,f.jsx)(gi.j,{"data-testid":"v2-recent-orders-skeleton-v2-SkeletonLoader",width:"140px",height:"28px",radius:"8px"})}),(0,f.jsx)(bi,{"data-testid":"v2-recent-orders-skeleton-v2-RecentItemsCardsSkeleton",children:Array.from({length:10},((e,t)=>(0,f.jsx)(wi,{"data-testid":"v2-recent-orders-skeleton-v2-RecentItemCardSkeleton",children:(0,f.jsx)(fi,{"data-testid":"v2-recent-orders-skeleton-v2-ListItemSkeleton"})},"recent-item-"+t)))})]}),(0,f.jsx)(Ar,{"data-testid":"v2-recent-orders-skeleton-v2-FullWidthDivider"}),(0,f.jsx)(Ei,{"data-testid":"v2-recent-orders-skeleton-v2-OrdersSectionSkeleton",children:Array.from({length:20},((e,t)=>(0,f.jsx)(fi,{"data-testid":"v2-recent-orders-skeleton-v2-ListItemSkeleton-1"},"skeleton-"+t)))})]});var ki=r(40746);const Ai=new Set([ye.G.App,ye.G.Mobile,ye.G.Web,ye.G.Receipt]),Oi=e=>{var t;return!Ai.has(e.channel)&&(e.channel===ye.G.Restaurant||e.channel===ye.G.PointsExpiration&&(null!=(t=e.pointsDeducted)?t:0)>0||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,be.q)(),c=(0,Ee.I)().theme,u=(0,O._P)(O.N$.ENABLE_V2_REORDERING_EXPERIENCE),p=(0,O._P)(O.N$.ENABLE_QRCODE_REFILL),m=(0,b.U)("desktop"),g=(0,we.L)(),v=(0,fe.j)().checkRecentOrdersForRefill,h=(0,n.useCallback)((()=>a(S.JZ.account)),[a]),x=(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)}),[x]);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)||!rt(a,r)&&!Ke(a)?i.push(a):n.push(a);return n.sort(nt),i.sort(nt),{ongoingCandidates:n,completed:i}}(x,C,E)),[x,C,E]),A=k.ongoingCandidates,R=(e=>{let t=e.orders;const r=(0,we.L)(),i=(0,Ne.P)().loyaltyUser,a=(0,bt.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]),l=(0,n.useMemo)((()=>[...t.map((e=>({type:"order",date:e.createdAt,order:e}))),...s.filter(Oi).map((e=>({type:"transaction",date:e.createdAt,transaction:e})))].sort(((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime()))),[t,s]),c=(0,n.useMemo)((()=>{const e=new Map;
1return s.forEach((t=>{var r;const n=null==(r=t.additionalReferenceIds)?void 0:r.find((e=>(null==e?void 0:e.type)===ki.D.RBIOrderId));null!=n&&n.id&&e.set(n.id,t)})),e}),[s]);return{items:l,isLoyaltyEnabled:r,isTransactionsLoading:o,transactionsByOrderId:c}})({orders:k.completed}),D=R.items,T=R.isTransactionsLoading,P=R.transactionsByOrderId,M=t||T,L=(0,n.useRef)(!1);(0,n.useEffect)((()=>{t||!u||L.current||(L.current=!0,function(e,t){e.trackEvent({name:De.og.PAGE_VIEW,type:De.wf.Other,attributes:{[De.Ny.PATH]:t}})}(l,S.JZ.orders))}),[l,t,u]),(0,n.useEffect)((()=>{if(0===A.length)return;const e=setInterval((()=>{j(new Date)}),Ie.Wx);return()=>clearInterval(e)}),[A.length]);const N=(0,n.useCallback)((e=>{I((t=>{if(t.has(e))return t;const r=new Set(Array.from(t));return r.add(e),r}))}),[]),_=(0,n.useCallback)((e=>Ze(e)?(0,f.jsx)(gn,{"data-testid":"v2-recent-orders-v2-OngoingDeliveryOrderCardV2",order:e,onOrderTerminal:N},e.rbiOrderId):(0,f.jsx)(Cn,{"data-testid":"v2-recent-orders-v2-OngoingPickupOrderCardV2",order:e,onOrderTerminal:N},e.rbiOrderId)),[N]);(0,n.useEffect)((()=>{p&&x.length&&v(x)}),[v,p,x]);const B=(0,n.useCallback)((()=>a(S.JZ.rewardsList)),[a]),$=!x.length&&!D.length,F=g&&1===D.length&&"transaction"===D[0].type&&D[0].transaction.channel===ye.G.InitialPointBalance,V=(0,f.jsxs)(f.Fragment,{children:[g&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(gt,{"data-testid":"v2-recent-orders-v2-LoyaltyOrderBannerV2"}),(0,f.jsx)(ot,{"data-testid":"v2-recent-orders-v2-LoyaltyPointsExpiryBannerV2"}),(0,f.jsx)(st,{"data-testid":"v2-recent-orders-v2-LoyaltyIssueDatePointsExpiryBannerV2"})]}),g&&$?(0,f.jsx)(jr,{"data-testid":"v2-recent-orders-v2-EmptyStateWrapper",children:(0,f.jsx)(It,{"data-testid":"v2-recent-orders-v2-LoyaltyRecentOrdersEmptyV2"})}):(0,f.jsxs)(f.Fragment,{children:[F&&(0,f.jsx)(kr,{"data-testid":"v2-recent-orders-v2-ExploreRewardsCTAWrapper",children:(0,f.jsx)(je.$,{"data-testid":"v2-recent-orders-v2-Button",fullWidth:!0,text:i({id:"exploreRewards",defaultMessage:"Explore Rewards"}),onClick:B,preserveLabelCasing:!0})}),(0,f.jsxs)(Cr,{"data-testid":"v2-recent-orders-v2-OrdersListContainer",children:[(0,f.jsx)(Ce.g,{"data-testid":"v2-recent-orders-v2-RefillDrinksCardV2",timerSource:"recentOrder",outlinedShell:!0}),(0,f.jsx)(di,{"data-testid":"v2-recent-orders-v2-RecentItemsCarouselV2"}),A.length>0&&(0,f.jsx)(Or,{"data-testid":"v2-recent-orders-v2-OngoingOrdersSection",children:A.map(_)}),D.length>0&&(0,f.jsx)(Rr,{"data-testid":"v2-recent-orders-v2-CompletedOrdersSection",children:D.map((e=>{var t;return"order"===e.type?(0,f.jsx)(dn,{"data-testid":"v2-recent-orders-v2-OrderCardV2",order:e.order,showPointsRow:g,impactedExpirationBuckets:null==(t=P.get(e.order.rbiOrderId))?void 0:t.impactedExpirationBuckets},e.order.rbiOrderId):(0,f.jsx)(Hr,{"data-testid":"v2-recent-orders-v2-LoyaltyTransactionCard",transaction:e.transaction},e.transaction.id)}))})]})]})]});return g||!$||M?(0,f.jsxs)(wr,{"data-testid":"v2-recent-orders-v2-RecentOrdersPageContainer-1",children:[m?(0,f.jsx)(s.NP,{"data-testid":"v2-recent-orders-v2-ThemeProvider",theme:c,children:(0,f.jsx)(ke.x2,{"data-testid":"v2-recent-orders-v2-SubLevelNavContainer",children:(0,f.jsx)(ke.Wx,{"data-testid":"v2-recent-orders-v2-MaxWidthContainer",children:(0,f.jsx)(ke.jy,{"data-testid":"v2-recent-orders-v2-TopContainer",children:(0,f.jsxs)(ke.hH,{"data-testid":"v2-recent-orders-v2-BackNavigationContainer",onClick:h,style:{cursor:"pointer"},children:[(0,f.jsx)(Oe.I,{"data-testid":"back-arrow-button",icon:Re.A,variant:"standard",size:"large","aria-label":i({id:"back"})}),(0,f.jsx)(ke.Dc,{"data-testid":"v2-recent-orders-v2-BreadcrumbContainer",$language:"latin",children:(0,f.jsx)(ke.UC,{"data-testid":"v2-recent-orders-v2-Content",children:i({id:"account"})})})]})})})})}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(Ir,{"data-testid":"v2-recent-orders-v2-HeaderContainer",children:[(0,f.jsx)(br,{"data-testid":"v2-recent-orders-v2-BackArrowWrapper",children:(0,f.jsx)(Oe.I,{"data-testid":"back-arrow-button",icon:Re.A,onClick:h,variant:"standard",size:"large","aria-label":i({id:"back"})})}),(0,f.jsx)(Ae.UF,{"data-testid":"v2-recent-orders-v2-TitleLarge",children:i({id:"orderHistory"})})]}),(0,f.jsx)(Ar,{"data-testid":"v2-recent-orders-v2-FullWidthDivider"}),M?(0,f.jsx)(ji,{"data-testid":"v2-recent-orders-v2-RecentOrdersSkeletonV2"}):V,(0,f.jsx)(Ar,{"data-testid":"v2-recent-orders-v2-FullWidthDivider-1",style:{marginBlockStart:"16px"}})]}),m&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Ar,{"data-testid":"v2-recent-orders-v2-FullWidthDivider-2"}),(0,f.jsxs)(Er,{"data-testid":"v2-recent-orders-v2-DesktopContentContainer",children:[(0,f.jsx)(Ir,{"data-testid":"v2-recent-orders-v2-HeaderContainer-1",children:(0,f.jsx)(Ae.UF,{"data-testid":"v2-recent-orders-v2-TitleLarge-1",children:i({id:"orderHistory"})})}),M?(0,f.jsx)(ji,{"data-testid":"v2-recent-orders-v2-RecentOrdersSkeletonV2-1"}):V]})]})]}):(0,f.jsx)(wr,{"data-testid":"v2-recent-orders-v2-RecentOrdersPageContainer",children:(0,f.jsx)(jr,{"data-testid":"v2-recent-orders-v2-EmptyStateWrapper-1",children:(0,f.jsx)(m
1i,{"data-testid":"v2-recent-orders-v2-RecentOrdersEmptyV2"})})})};var Di=r(68605).P;const Si=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;}"],Di.layout.sectionMaxWidth,"2rem"),Ti=s.I4.div.withConfig({componentId:"sc-vnl4sb-1"})(["min-height:70vh;display:flex;flex-direction:column;justify-content:center;"]),Pi=s.I4.div.withConfig({componentId:"sc-vnl4sb-2"})(["width:100%;& > *:not(:first-child){margin-block-start:",";}","{padding-block-start:",";}"],D.M.$spacing4,Di.desktop,D.M.$spacing7),Mi=s.I4.div.withConfig({componentId:"sc-vnl4sb-3"})(["text-align:center;"]),Li=s.I4.div.withConfig({componentId:"sc-vnl4sb-4"})(["padding-block-start:",";padding-block-end:",";padding-inline:0;"],D.M.$spacing5,D.M.$spacing11),Ni=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")),Di.desktop,D.M.$spacing11),_i=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"))),Bi=()=>{var e;const t=(0,o.Zp)(),r=(0,b.U)("headerMobile"),v=(0,A.Z2)().refreshCurrentUserWithNewSession,h=(0,o.g)()["*"],x=(0,n.useState)(h||""),y=x[0],D=x[1],M=(0,n.useState)(!1),L=M[0],N=M[1],_=(0,n.useState)(null),B=_[0],$=_[1],F=(0,E.k)({}),V=F.loading,U=F.data,W=F.refetch,H=F.orders,z=(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})}
1),[t]),Z=(0,n.useState)(ve.l.SHOW_DETAILS),Y=Z[0],K=Z[1],J=(0,d.A)().formatMessage,X=(0,w.Y)(),Q=(0,s.DP)(),ee=(0,n.useCallback)((()=>{W()}),[W]),te=(0,n.useCallback)((()=>{t(S.JZ.base)}),[t]),re=(0,O._P)(O.N$.ENABLE_RECENT_ITEMS_ADD_TO_CART),ne=(0,O._P)(O.N$.ENABLE_V2_REORDERING_EXPERIENCE),ie=(0,O._P)(O.N$.ENABLE_V2_CART_CHECKOUT)&≠(0,I.S)((()=>{v()})),(0,n.useEffect)((()=>{z.length&&N(!0)}),[L,N,z.length]);const ae=(0,n.useCallback)((()=>{N(!1),t(S.JZ.cart)}),[t]),de=(0,f.jsx)(C,{"data-testid":"account-orders-index-RefreshButton",onClick:ee,children:J({id:"refresh"})}),oe=(null==U||null==(e=U.userOrders)?void 0:e.orders)||[],se=!!oe.length;if(B){const e=(0,f.jsx)(T.L,{"data-testid":"account-orders-index-CancelOrderSuccessView",variant:B,onClose:te,onGoHome:te});return r?(0,i.createPortal)((0,f.jsx)(_i,{"data-testid":"account-orders-index-MobileCancelResultOverlay",children:e}),document.body):(0,f.jsx)(Ni,{"data-testid":"account-orders-index-CancelResultWrapper",children:e})}return ie?(0,f.jsx)(ge,{"data-testid":"account-orders-index-AccountOrderWrapperV2",children:(0,f.jsxs)(k.k,{"data-testid":"account-orders-index-AuthRequired",children:[(0,f.jsx)(a.mg,{"data-testid":"account-orders-index-Helmet",title:J({id:"recentOrders"})}),(0,f.jsx)(Ri,{"data-testid":"account-orders-index-RecentOrdersV2",loading:V,orders:oe})]})}):(0,f.jsx)(Li,{"data-testid":"account-orders-index-AccountOrderWrapper",children:(0,f.jsxs)(k.k,{"data-testid":"account-orders-index-AuthRequired-1",children:[(0,f.jsx)(a.mg,{"data-testid":"account-orders-index-Helmet-1",title:J({id:"recentOrders"})}),(0,f.jsx)(Si,{"data-testid":"account-orders-index-OrdersContainer",children:(0,f.jsx)(g.s,{"data-testid":"account-orders-index-RefillDrinksQRCodeButton",recentOrders:H,timerSource:"recentOrder"})}),X&&(0,f.jsxs)(Si,{"data-testid":"account-orders-index-OrdersContainer-1",children:[(0,f.jsx)(p.l,{"data-testid":"account-orders-index-BackArrowHistory"}),re&&(0,f.jsx)(j.g,{"data-testid":"account-orders-index-AccountLayout",header:J({id:"recentItems"}),fullWidth:!0,mobileContainerPadding:"1.25rem 0 0 0",desktopContainerPadding:"0",children:(0,f.jsx)(m.u,{"data-testid":"account-orders-index-RecentItemsCarousel",locationName:"Recent Orders Page",containerHasTopPadding:!1})})]}),(0,f.jsx)(j.g,{"data-testid":"account-orders-index-AccountLayout-1",header:se?J({id:"recentOrders"}):null,fullWidth:!0,mobileContainerPadding:"1.25rem 0 0 0",desktopContainerPadding:"0",children:V?(0,f.jsx)(c.b,{"data-testid":"account-orders-index-LoadingAnimation",fillColor:Q.token("icon-active")}):(0,f.jsx)(Si,{"data-testid":"account-orders-index-OrdersContainer-2",children:se?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Mi,{"data-testid":"account-orders-index-OfferDisclaimer",children:J({id:"recentOrdersDisclaimer"})}),de,(0,f.jsx)(Pi,{"data-testid":"account-orders-index-OrdersPanel",children:oe.map((e=>(0,f.jsx)(he,{"data-testid":"account-orders-index-Order",order:e,handleDisplayDetailsModal:q,setModalType:K,onModalDismiss:G},e.rbiOrderId)))})]}):(0,f.jsx)(Ti,{"data-testid":"account-orders-index-OrdersEmptyWrapper",children:(0,f.jsx)(xe,{"data-testid":"account-orders-index-OrdersEmpty",children:de})})})}),!ne&&y&&(0,f.jsx)(P.e,{"data-testid":"account-orders-index-DetailsModal",rbiOrderId:y,onModalDismiss:G,onCancelResult:$,type:Y,setModalType:K,setDetailsModalId:q,offsetForNavV2Header:!0}),L&&(0,f.jsx)(u.Q9,{"data-testid":"account-orders-index-ModalOrderUnavailable",onDismiss:ae,items:z})]})})}},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))})},56096:(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:()=>m,fp:()=>g,pX:()=>p});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}],p=(e,t)=>{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})}},m=(e,t)=>
1{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})}},g=(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:()=>f,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),p=r(90748),m=r(39089),g=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;"]),x=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"))),f=e=>{let t=e.onClose,r=e.onGoHome,n=e.variant,a=void 0===n?g.z.SUCCESS:n;const o=(0,(0,d.A)().formatMessage)({id:a===g.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)(p.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)(p.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)(p.oq,{to:m.JZ.base,variant:l.Vs.TEXT_ONLY,"data-testid":"cancel-success-close",children:(0,v.jsx)(p.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)(p.zB,{"data-testid":"delivery-cancel-order-success-page-CenteredTitle",children:o})]}),(0,v.jsx)(g.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:g.z.SUCCESS,s=n.useCallback((()=>{t(m.JZ.base)}),[t]);(0,n.useEffect)((()=>{r||window.scrollTo({top:0,left:0,behavior:"auto"})}),[r,d]);const l=(0,v.jsx)(f,{"data-testid":"delivery-cancel-order-success-page-CancelOrderSuccessView",variant:d,onClose:s,onGoHome:s});return r?(0,a.createPortal)((0,v.jsx)(x,{"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:()=>f,P4:()=>P,RL:()=>b,Re:()=>k,Sg:()=>T,WT:()=>O,eY:()=>y,fK:()=>j,fW:()=>D,ic:()=>p,id:()=>C,p:()=>I,qM:()=>x,qm:()=>m,s4:()=>g,sM:()=>S,u3:()=>A,w:()=>h,wA:()=>E});var n=r(20147),i=r(21199),a=r(51180),d=r(53683),o=r(68605),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),p=(0,n.Ay)(d.t5).withConfig({componentId:"sc-vq1yu1-1"})(["",";"],l.Hp),m=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),g=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 ")),x=(0,n.Ay)(h).withConfig({componentId:"sc-vq1yu1-6"})(["font-size:1.2rem;"]),f=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),A=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")),O=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:()=>x,UU:()=>f});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 p=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"])),m=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 g=r(60712);const v=["onPrevious"],h=["onNext"],x=(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,g.jsx)(p,(0,n.A)({"data-testid":"pagination-pagination-Wrapper",name:"Previous page","aria-label":"Previous page",onClick:r},o,{children:s.A&&l.A&&(0,g.jsx)(m,{"data-testid":"left-arrow-icon",children:a.createElement(h===c.x.LTR?s.A:l.A)})}))})),f=(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,g.jsx)(p,(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,g.jsx)(m,{"data-testid":"right-arrow-icon",children:a.createElement(v===c.x.LTR?l.A:s.A)})}))}))},93231:(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(23418),l=r(60712);const c=()=>(0,l.jsx)(l.Fragment,{children:s.A&&d.createElement(s.A,{"aria-hidden":"true"})});var u=r(60188),p=r(78169),m=r(73337);const g=["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===p.S.LOYALTY?(0,l.jsx)(c,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-LoyaltyIcons"}):m.A&&d.createElement(m.A,{"aria-hidden":"true"})})},h=(e,t,r)=>{if(r&&e===p.C.ACTIVE)return(0,l.jsx)(v,{$variant:t,"data-testid":"segment-circle-last"});if(t===p.S.LOYALTY&&e===p.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 p.C.COMPLETED:return(0,l.jsx)(u.ng,{$variant:t,"data-testid":"segment-circle-completed"});case p.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"})}},x=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 m=(0,o.I)().readingDirection,g=void 0===m?"ltr":m;return(0,l.jsxs)(u.fT,{"data-testid":"segmented-progress-indicator-segmented-progress-indicator-SegmentWrapper",$state:i,$isLast:n,$variant:c,"aria-current":i===p.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?p.C.COMPLETED:i,c,n),!n&&(0,l.jsx)(u.Bg,{$variant:c,$state:s?p.C.COMPLETED:d,$readingDirection:g,"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:g,children:h(p.C.ACTIVE,c,!1)})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Bg,{$variant:c,$state:a,$readingDirection:g,"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:g,children:h(p.C.ACTIVE,c,!1)})}),h(s?p.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:g,"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?p.C.DEFAULT:i,children:r.label})})]},r.value)},f=e=>{let t=e.segments,r=e.currentValue,n=e.variant,d=(0,a.A)(e,g),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?p.C.ACTIVE:i<o?p.C.COMPLETED:p.C.DEFAULT;const c=e.value<=r?p.C.COMPLETED:p.C.DEFAULT,u=i+.5<=Math.floor(o)?p.C.COMPLETED:p.C.DEFAULT;return(0,l.jsx)(x,{"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(f),C=(0,n.$)(y)},60188:(e,t,r)=>{r.d(t,{Ah:()=>x,Bg:()=>u,Un:()=>g,XT:()=>h,bc:()=>m,fT:()=>s,jG:()=>l,mO:()=>o,ng:()=>v,o5:()=>c,rx:()=>p});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})),p=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 ")),m=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})),g=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=>
1e.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%;"]),x=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=>e.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.