1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[4705],{64705:(e,t,a)=>{a.r(t),a.d(t,{ScanInRestaurantV2:()=>Se});var n=a(58168),i=a(59284),r=a(96290),s=a(90182),d=a(32694),o=a(77119),l=a(40937),c=a(26791),u=a(10134),m=a(56526),h=a(63563),f=a(77696),v=a(38285),p=a(63554),g=a(90536),x=a(76892),y=a(30250),C=a(40199),w=a(49187),b=a(75415),I=a(19193),R=a(19382),j=a(61295),A=a(42440),k=a(80187),S=a(56093),L=a(44296),M=a(59671),E=a(64674),O=a(6849),q=a(95188),T=a(14723),D=a(35135),$=a(78728),_=a(63289),F=a(39440),N=a(32309),P=a(53668),W=a(18953),B=a(39089),z=a(60582),Q=a(20147),V=a(84662),G=a(16049),J=a(89110);const Z=Q.Ay.div.withConfig({componentId:"sc-7q1itb-0"})(["display:flex;flex-direction:column;gap:16px;padding:16px;"]),Y=Q.Ay.div.withConfig({componentId:"sc-7q1itb-1"})(["margin-block-end:-24px;margin-inline:-24px;"]),U=Q.Ay.div.withConfig({componentId:"sc-7q1itb-2"})(["width:40px;height:40px;flex-shrink:0;"]),H=Q.Ay.div.withConfig({componentId:"sc-7q1itb-3"})(["display:flex;justify-content:space-between;align-items:center;"]),K=Q.Ay.div.withConfig({componentId:"sc-7q1itb-4"})(["display:flex;flex-direction:column;gap:0.25rem;"]),X=Q.Ay.div.withConfig({componentId:"sc-7q1itb-5"})(["display:flex;flex-direction:row;gap:12px;overflow-x:auto;align-items:stretch;padding-block-end:1rem;"]),ee=Q.Ay.div.withConfig({componentId:"sc-7q1itb-6"})(["position:relative;flex-shrink:0;width:148px;"]),te=(0,Q.Ay)(O.z).withConfig({componentId:"sc-7q1itb-7"})(["&:active{box-shadow:0 0 0 2px var(--shadow-color);}"]),ae=(0,Q.Ay)(O.z).withConfig({componentId:"sc-7q1itb-8"})(["[data-testid='single-card-content']{position:relative;padding-block-end:",";min-height:163px;}"],(e=>e.$limitReached?"0.835rem":"0")),ne=Q.Ay.div.withConfig({componentId:"sc-7q1itb-10"})(["position:absolute;inset-block-start:8px;inset-inline-end:8px;z-index:1;"]),ie=Q.Ay.div.withConfig({componentId:"sc-7q1itb-11"})(["display:flex;flex-direction:column;align-items:center;gap:8px;"]),re=(0,Q.Ay)(G.Q).withConfig({componentId:"sc-7q1itb-12"})(["height:32px;[data-testid='number-input-value']{height:32px;&:focus:not(:disabled):not(.keyboard-focus-visible){height:32px;}}"]),se=Q.Ay.div.withConfig({componentId:"sc-7q1itb-13"})(["position:absolute;inset-inline:0;inset-block-end:0;display:flex;flex-direction:column;align-items:center;gap:8px;"]),de=Q.Ay.div.withConfig({componentId:"sc-7q1itb-14"})(["height:32px;display:flex;align-items:center;justify-content:center;"]),oe=(0,Q.Ay)($.uv).withConfig({componentId:"sc-7q1itb-15"})(["text-align:center;"]),le=Q.Ay.div.withConfig({componentId:"sc-7q1itb-16"})(["display:flex;justify-content:center;align-items:center;width:8.25rem;height:4.125rem;flex-shrink:0;border-radius:0.5rem;overflow:hidden;aspect-ratio:2/1;> *{width:100%;height:100%;}img{width:100%;height:100%;object-fit:contain;}"]),ce=(0,Q.Ay)($.r).withConfig({componentId:"sc-7q1itb-17"})(["color:",";"],(e=>e.theme.colorV2.text.neutral)),ue=Q.Ay.div.withConfig({componentId:"sc-7q1itb-18"})(["display:flex;flex-direction:column;align-items:center;gap:0.25rem;min-height:",";flex:1;justify-content:",";"],(e=>e.$hasSub?"0":"3rem"),(e=>e.$hasSub?"flex-start":"center")),me=Q.Ay.div.withConfig({componentId:"sc-7q1itb-19"})(["display:flex;justify-content:center;gap:0.5rem;width:100%;padding-block-end:2rem;"]),he=(0,Q.Ay)($.r).withConfig({componentId:"sc-7q1itb-20"})(["font-weight:400;text-align:center;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:",";-webkit-box-orient:vertical;"],(e=>{let t=e.$lineClamp;return void 0===t?2:t})),fe=(V.M.$success,Q.Ay.div.withConfig({componentId:"sc-7q1itb-23"})(["display:flex;flex-direction:",";gap:0.5rem;flex:",";height:",";margin-inline-end:0.25rem;cursor:pointer;-webkit-tap-highlight-color:transparent;[data-testid='add-rewards-card'],[data-testid='add-offers-card']{flex:1;width:100%;justify-content:center;height:",";-webkit-tap-highlight-color:transparent;--shadow-color:",";}button{cursor:inherit;-webkit-tap-highlight-color:transparent;&::after{background-color:transparent !important;}&:focus:not(:focus-visible){outline:none;}}"],(e=>e.$hasCart?"column":"row"),(e=>{let t=e.$isMobile,a=e.$hasCart;return t?"1 0 187px":a?"0 0 150px":"1"}),(e=>e.$hasCart?"163px":"auto"),(e=>{let t=e.$isMobile;return e.$hasCart?"auto":t?"48px":"77px"}),(e=>
1e.theme.colorV2.container["neutral-tonal"]))),ve=Q.Ay.div.withConfig({componentId:"sc-7q1itb-24"})(["display:flex;flex-direction:column;align-items:center;gap:1rem;border-radius:1rem;text-align:center;padding-block-start:1rem;.scan-in-restaurant-qr-widget{padding:0.5rem;}"]),pe=Q.Ay.div.withConfig({componentId:"sc-7q1itb-25"})(["background-color:",";border-radius:0.5rem;padding:1rem;width:100%;display:flex;flex-direction:column;align-items:center;gap:0.25rem;"],(e=>e.theme.colorV2.container["neutral-tonal"])),ge=Q.Ay.div.withConfig({componentId:"sc-7q1itb-26"})(["display:flex;flex-direction:column;gap:0.5rem;"]),xe=Q.Ay.div.withConfig({componentId:"sc-7q1itb-27"})(["display:flex;flex-direction:column;align-items:center;gap:1rem;padding:1rem;text-align:center;"]),ye=(0,Q.Ay)(J.A).withConfig({componentId:"sc-7q1itb-28"})(["width:81px;height:81px;flex-shrink:0;path{fill:",";}"],V.M.bk.$crunchyGreen),Ce=(0,Q.Ay)($.r).withConfig({componentId:"sc-7q1itb-29"})(["color:",";"],(e=>e.theme.colorV2.text.neutral)),we=M.a,be=(0,Q.Ay)(we).withConfig({componentId:"sc-7q1itb-30"})(["z-index:1050;",""],(e=>e.$isDesktop&&(0,Q.AH)(["[data-testid='modal-container']{width:400px;max-width:400px;}"]))),Ie=Q.Ay.div.withConfig({componentId:"sc-7q1itb-31"})(["display:flex;flex-direction:column;gap:8px;padding-block-start:12px;text-align:center;"]),Re=(0,Q.Ay)($.s9).withConfig({componentId:"sc-7q1itb-32"})(["color:",";overflow-wrap:break-word;word-break:break-word;"],(e=>e.theme.colorV2.text["main-darkest"])),je=(0,Q.Ay)($.gH).withConfig({componentId:"sc-7q1itb-33"})(["color:",";"],(e=>e.theme.colorV2.text["main-darkest"])),Ae=(0,Q.Ay)($.eh).withConfig({componentId:"sc-1pot7h6-0"})(["color:",";text-align:center;"],V.M.bk.$bbqBrown);var ke=a(60712);const Se=e=>{var t,a,Q,V,G,J,we;let Se=e.onClose;const Le=(0,r.A)().formatMessage,Me=(0,D.d)().showSnackbar,Ee=(0,s.Zp)(),Oe=(0,s.zy)().pathname,qe=(0,l.U)("headerMobile"),Te=(0,R.I)().theme,De=(0,h.q)(),$e=De.trackEvent,_e=De.logPageView,Fe=(0,I.oX)().restaurantLogAttributesRef,Ne=(0,y.ye)(),Pe=Ne.inRestaurantRedemptionCart,We=Ne.removeInRestaurantRedemptionEntry,Be=Ne.updateInRestaurantRedemptionEntryQuantity,ze=Ne.generateShortCode,Qe=Ne.shortCode,Ve=Ne.shortCodeState,Ge=Ne.shortCodeLoading,Je=Ne.setIsRewardsModal,Ze=Ne.showRewardsModalSuccess,Ye=Ne.setShowRewardsModalSuccess,Ue=(0,i.useState)(null),He=Ue[0],Ke=Ue[1],Xe=(0,p.GV)(p.Tp.loyalty.selectUser),et=(0,o.JnR)({variables:{id:"earningCalculation"}}).data,tt=null!=(t=null==et||null==(a=et.EarningCalculation)||null==(a=a.rewardsRedemptionConfig)?void 0:a.standardRewardsLimit)?t:1,at=null!=(Q=null==et||null==(V=et.EarningCalculation)||null==(V=V.offerRedemptionLimits)?void 0:V.sameOfferLimit)?Q:1,nt=null!=(G=null==et||null==(J=et.EarningCalculation)||null==(J=J.offerRedemptionLimits)?void 0:J.standardOffersLimit)?G:1,it=(0,u.h)().getOfferCardPrice,rt=(0,v._F)().featureLoyaltyOffersUIId,st=Boolean(rt),dt=(0,g._P)(g.N$.ENABLE_PRICES_IN_OFFERS_PAGE),ot=(0,g._P)(g.N$.LOYALTY_IDENTIFICATION_CODE_TYPE),lt=(0,i.useRef)(null),ct=(0,c.m)(),ut=ct.redeemInRestaurantConfig,mt=ct.redeemInRestaurantConfigLoading,ht=null!=(we=null==ut?void 0:ut.widgets)?we:[];let ft=!1,vt=!1,pt=!1,gt="";ht.forEach((e=>{if("LoyaltyQRAndShortCodeWidget"===(null==e?void 0:e.__typename))ft=!0;else if("LoyaltyShortCodeWidget"===(null==e?void 0:e.__typename))vt=!0;else if("LoyaltyTextWidget"===(null==e?void 0:e.__typename)){var t,a;pt=!0,gt=null!=(t=null==(a=e.text)?void 0:a.locale)?t:""}}));const xt=Pe.reduce(((e,t)=>e+t.quantity),0),yt=Pe.filter((e=>e.type===y.OT.REWARD)),Ct=yt.reduce(((e,t)=>e+t.quantity),0),wt=yt.every((e=>1===e.quantity)),bt=Ct<tt||!wt,It=Pe.filter((e=>e.type===y.OT.OFFER));(0,i.useEffect)((()=>(Je(!0),()=>{Je(!1)})),[Je]),(0,i.useEffect)((()=>{const e=document.referrer,t=(0,n.A)({pathname:B.JZ.redeem,pathWithQuery:B.JZ.redeem,currentScreen:B.JZ.redeem,sanityId:"",Name:""},Fe.current),a={"Google.Page":B.JZ.redeem,"Google.DocumentReferrer":e};_e(B.JZ.redeem,t,a),$e({name:f.og.PAGE_VIEW,type:f.wf.Other,attributes:(0,n.A)({},t,a,{path:B.JZ.redeem})})}),[]),(0,i.useEffect)((()=>{Ge||Ve!==y.h2.None&&Ve!==y.h2.Expired||ze()}),[ze,Ge,Ve]),(0,i.useEffect)((()=>{Ge||mt||!qe||requestAnimationFrame((()=>{var e;null==(e=lt.current)||e.scrollIntoView({behavior:"auto",block:"start"})}))}),[Ge,mt,qe,Qe]),(0,i.useEffect)((()=>{Ze&&$e({name:f.og.MODAL_APPEARANCE,type:f.wf.Other,attributes:{Message:"Loyalty Shortcode Confirmation Modal","Source Page":Oe}}
1)}),[Ze,$e,Oe]);const Rt=Le(vt&&!ft?{id:"loyaltyInputCodeTitle",defaultMessage:"Input Code"}:{id:"loyaltyQrCodeTitle",defaultMessage:"Scan QR Code"}),jt=(0,i.useCallback)((e=>{Se(),Ee(e)}),[Ee,Se]),At=It.length>0,kt=It.length>1,St=yt.length>0,Lt=!At&&!St,Mt=Le(At&&St?{id:"rewardsOffersReadyToRedeem",defaultMessage:"Rewards & Offers Ready to Redeem"}:At?kt?{id:"loyaltyOffersReadyToRedeem",defaultMessage:"Offers Ready to Redeem"}:{id:"loyaltyOfferReadyToRedeem",defaultMessage:"Offer Ready to Redeem"}:!St&&st?{id:"rewardsOffersReadyToRedeem",defaultMessage:"Rewards & Offers Ready to Redeem"}:{id:"loyaltyRewardsReadyToRedeem",defaultMessage:"Rewards Ready to Redeem"}),Et=(0,ke.jsxs)(Z,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-Content",children:[(0,ke.jsx)(K,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-DescriptionContainer",children:(0,ke.jsx)(T.j,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-SkeletonLoader",height:"1.5rem",radius:"2rem",width:"60%"})}),(0,ke.jsx)(X,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-CartGrid",children:Array.from({length:10}).map(((e,t)=>(0,ke.jsx)(ee,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-RewardCardWrapper",children:(0,ke.jsx)(ae,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-RewardSingleCard",variant:q.D.FILLED,cardType:q.G.SMALL,mainContent:(0,ke.jsxs)(ie,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-CardMainContent",children:[(0,ke.jsx)(T.j,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-SkeletonLoader-1",height:"7rem",radius:"0.5rem"}),(0,ke.jsx)(T.j,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-SkeletonLoader-2",height:"0.75rem",radius:"2rem",style:{marginBlockStart:"0.5rem",marginBlockEnd:"0.5rem"}}),(0,ke.jsxs)(me,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-SkeletonInputRow",children:[(0,ke.jsx)(T.j,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-SkeletonLoader-3",height:"1.5rem",radius:"2rem",width:"45%"}),(0,ke.jsx)(T.j,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-SkeletonLoader-4",height:"1.5rem",radius:"2rem",width:"45%"})]})]})})},t)))}),(0,ke.jsx)(te,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-QRSingleCard",variant:q.D.OUTLINED,mainContent:(0,ke.jsxs)(ve,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-QRCodeContainer",children:[Qe&&ft&&(0,ke.jsx)(d.r,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-QRCode",barcode:Qe,options:(0,n.A)({},m.nA,{width:180,color:{dark:Te.colorV2.shape.disabled}}),className:"scan-in-restaurant-qr-widget"}),(0,ke.jsxs)(pe,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-ShortCodeContainer",children:[(0,ke.jsx)(T.j,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-SkeletonLoader-5",height:"1rem",radius:"2rem",style:{width:"75%",alignSelf:"center"}}),(0,ke.jsx)(T.j,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-SkeletonLoader-6",height:"1rem",radius:"2rem",style:{width:"50%",alignSelf:"center"}})]})]})})]}),Ot=(0,ke.jsxs)(Z,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-Content-1",children:[(0,ke.jsxs)(K,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-DescriptionContainer-1",children:[!Lt&&(0,ke.jsxs)(H,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-TitleContainer",children:[(0,ke.jsx)($.sD,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-TitleSmall",children:Mt}),xt>0&&(0,ke.jsx)(j.E,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-Badge",value:xt,label:"Items in cart",variant:"primary"})]}),(0,ke.jsx)(ce,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-SectionDescription",children:Le({id:"addRewardsOffersToScan",defaultMessage:"Add Rewards and Offers here to scan on the Kiosk, Drive-thru or Cashier."})})]}),(0,ke.jsxs)(X,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-CartGrid-1",children:[Pe.map((e=>{var t,a,n,i,r,s,d,o,l;const c=e.type===y.OT.REWARD,u=c?e.details:null,m=c?null:e.details,h=c?null!=(t=null==u||null==(a=u.reward.name)?void 0:a.locale)?t:"":null!=(n=(0,z.R8)(null==m?void 0:m.offer.name))?n:"",v=c?(0,W.M)(null==u?void 0:u.reward.image):null!=(i=null==m||null==(r=m.offer.localizedImage)||null==(r=r.locale)?void 0:r.app)?i:void 0,p=c?null!=(s=null==u||null==(d=u.reward.name)?void 0:d.locale)?s:"":null!=(o=null==m||null==(l=m.offer.localizedImage)||null==(l=l.locale)?void 0:l.imageDescription)?o:"",g=c?null==u?void 0:u.engineReward.pointCost:void 0,x=!c&&m?it(m.offer):null,I=!c&&(null==m?void 0:m.offer._t
1ype)===b.p4.SYSTEMWIDE,R=1!==nt&&I;let j=C.UP;if(c){const t=Pe.filter((t=>t.type===y.OT.REWARD&&t.referenceId!==e.referenceId)).reduce(((e,t)=>e+t.quantity),0);if(j=Math.min(j,tt-t),void 0!==g&&g>0){var A;const t=(0,w.Q_)(Pe)-e.quantity*g,a=(null!=(A=null==Xe?void 0:Xe.points)?A:0)-t,n=Math.floor(a/g);j=Math.min(j,n)}j=Math.max(j,C.Yw)}else{var L;const t=null!=(L=null==m?void 0:m.offer.loyaltyEngineId)?L:"",a=Pe.filter((t=>t.type===y.OT.OFFER&&t.referenceId!==e.referenceId)).reduce(((e,t)=>e+t.quantity),0),n=Pe.filter((a=>a.type===y.OT.OFFER&&a.referenceId!==e.referenceId&&a.details.offer.loyaltyEngineId===t)).reduce(((e,t)=>e+t.quantity),0);j=Math.min(j,nt-a,at-n),j=Math.max(j,C.Yw)}const M=c?1:dt?null!=x&&x.priceToShow?1:2:3;return(0,ke.jsxs)(ee,{"data-testid":"scan-in-restaurant-"+(c?"reward":"offer")+"-item",children:[(0,ke.jsx)(ne,{"data-testid":"scan-in-restaurant-"+(c?"reward":"offer")+"-remove-btn-container",children:(0,ke.jsx)(_.I,{icon:N.A,size:"small",variant:"elavated",inverse:!0,"aria-label":Le({id:"remove"}),onClick:()=>{$e({name:f.og.MODAL_APPEARANCE,type:f.wf.Other,attributes:{Message:"Remove Reward Confirmation"}}),Ke(e)},"data-testid":"scan-in-restaurant-"+(c?"reward":"offer")+"-remove-btn"})}),(0,ke.jsx)(ae,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-RewardSingleCard-1",variant:q.D.FILLED,cardType:q.G.SMALL,$limitReached:c&&!bt,mainContent:(0,ke.jsxs)(ie,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-CardMainContent-1",children:[v&&(0,ke.jsx)(le,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-RewardImageContainer",children:(0,ke.jsx)(S._,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-Image",image:v,alt:p,objectFitContain:"contain",lockedAspectRatio:!0,height:"100%",width:"100%"})}),(0,ke.jsxs)(ue,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-RewardNameAndPointsContainer",$hasSub:dt,children:[(0,ke.jsx)(he,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-RewardName",$lineClamp:M,children:h}),void 0!==g&&(0,ke.jsx)(k.C,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-Chips",variant:"informative",chipType:"rewards",chipStatus:"rewards",text:String(g)}),dt&&(null==x?void 0:x.priceToShow)&&(0,ke.jsx)(Ae,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-OfferPrice",children:x.priceToShow})]}),(0,ke.jsxs)(se,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-CardBottomControls",children:[(c?bt:R)&&(0,ke.jsx)(re,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-InRestaurantCartQuantityInput",value:e.quantity,min:C.Yw,max:j,disabled:!c&&!R,onChange:t=>Be(e,t)}),!c&&(1===nt||!I)&&(0,ke.jsx)(de,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-OfferLimitLabelContainer",children:(0,ke.jsx)(oe,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-OfferLimitLabel",children:Le({id:"offerLimitOnePerOrder",defaultMessage:"1 per order"})})})]})]})})]},e.referenceId)})),(0,ke.jsxs)(fe,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-AddButtonCard",$isMobile:qe,$hasCart:Pe.length>0,children:[(0,ke.jsx)(O.z,{"data-testid":"add-rewards-card",variant:q.D.FILLED,listItem:(0,ke.jsx)(L.c,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-ListItem",data:{title:(0,ke.jsx)($.r,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-FootnoteRegular",children:Le({id:"loyaltyAddRewards",defaultMessage:"Add Rewards"})}),trailingIcon:F.A}}),onClick:()=>jt(B.JZ.rewardsList)}),st&&ot===x.$e.DYNAMIC&&(0,ke.jsx)(O.z,{"data-testid":"add-offers-card",variant:q.D.FILLED,listItem:(0,ke.jsx)(L.c,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-ListItem-1",data:{title:(0,ke.jsx)($.r,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-FootnoteRegular-1",children:Le({id:"loyaltyAddOffers",defaultMessage:"Add Offers"})}),trailingIcon:F.A}}),onClick:()=>jt(B.JZ.offers)})]})]}),(ft||vt)&&(0,ke.jsx)(ge,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-CodeSectionWrapper",ref:lt,children:(0,ke.jsx)(te,{variant:q.D.OUTLINED,mainContent:(0,ke.jsxs)(ve,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-QRCodeContainer-1",children:[Qe&&ft&&(0,ke.jsx)(d.r,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-QRCode-1",barcode:Qe,options:(0,n.A)({}
1,m.nA,{width:180,color:{dark:Te.colorV2.shape.secondary}}),className:"scan-in-restaurant-qr-widget"}),(0,ke.jsxs)(pe,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-ShortCodeContainer-1",children:[(0,ke.jsx)($.uv,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-BodyMedium",children:Le(ft?{id:"loyaltyQrCodeShortCodeText"}:{id:"loyaltyShortCodeText",defaultMessage:"Give this code to the cashier"})}),(0,ke.jsx)($.s9,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-HeadlineSmall",children:(0,P.s)(null!=Qe?Qe:"",2," ")}),(0,ke.jsx)(A.$,{variant:"text",size:"small",fullWidth:!1,text:Le({id:"generateNewCode"}),onClick:ze,loading:Ge,"data-testid":"generate-new-code-btn",preserveLabelCasing:!0})]})]})})}),pt&>&&(0,ke.jsx)(Ce,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-TextWidgetContent",children:gt})]}),qt=Ge||mt?Et:Ot,Tt=(0,i.useMemo)((()=>{var e,t,a;if(null===He)return null;const n=He.type===y.OT.REWARD?null!=(e=null==(t=He.details.reward.name)?void 0:t.locale)?e:"":null!=(a=(0,z.R8)(He.details.offer.name))?a:"";return(0,ke.jsx)(be,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-ConfirmationModalWrapper",variant:"small",$isDesktop:!qe,onDismiss:()=>Ke(null),customContent:(0,ke.jsxs)(Ie,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-ConfirmationModalContent",children:[(0,ke.jsx)(Re,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-ConfirmationModalTitle",children:Le({id:"removeItem"})}),(0,ke.jsx)(je,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-ConfirmationModalBody",children:Le({id:"removeFromLoyaltyCartConfirmation",defaultMessage:"Are you sure you want to remove "+n+" from your loyalty cart?"},{name:n})})]}),primaryButton:{size:"small",text:Le({id:"remove",defaultMessage:"Remove"}),variant:"solid",onClick:()=>{$e({name:f.og.BUTTON_CLICK,type:f.wf.Other,attributes:{Name:"Remove"}}),We(He),Me({content:Le({id:"removedFromLoyaltyCart",defaultMessage:n+" removed from your loyalty cart"},{name:n}),autoClose:!0,showCloseIcon:!0}),Ke(null)}},outlineButton:{size:"small",text:Le({id:"dontRemove",defaultMessage:"Don't Remove"}),variant:"outline",onClick:()=>{$e({name:f.og.BUTTON_CLICK,type:f.wf.Other,attributes:{Name:"Don't Remove"}}),Ke(null)}},preserveLabelCasing:!0})}),[He,qe,Le,We,Me,$e]);return Ze?(0,ke.jsx)(M.a,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-Modal",variant:"small",customContent:(0,ke.jsxs)(xe,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-SuccessModalContent",children:[(0,ke.jsx)(ye,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-SuccessCheckCircleIcon"}),(0,ke.jsx)($.s9,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-HeadlineSmall-1",children:Le({id:"loyaltyScannedSuccessfullyTitle",defaultMessage:"Your code has been scanned successfully!"})})]}),primaryButton:{size:"small",text:Le({id:"gotIt"}),variant:"solid",onClick:()=>{Ye(!1),Se(),Ee(B.JZ.base,{replace:!0})}},preserveLabelCasing:!0}):qe?(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)(E.j,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-Sheets",hasLongTitle:!0,customHeight:"90dvh",leadingIcon:{icon:N.A,onClick:Se},title:Rt,sheetContent:qt,onDismiss:Se,preserveLabelCasing:!0,hasScrollable:!0}),Tt]}):(0,ke.jsxs)(ke.Fragment,{children:[Tt,(0,ke.jsx)(M.a,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-Modal-1",variant:"medium",leadingIcon:{icon:N.A,onClick:Se},trailingIcon:(0,ke.jsx)(U,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-HeaderTitleSpacer","aria-hidden":"true"}),headerTitle:Rt,customContent:(0,ke.jsx)(Y,{"data-testid":"scan-in-restaurant-v2-scan-in-restaurant-v2-DesktopContentWrapper",children:qt}),preserveLabelCasing:!0})]})}}}]);
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.