PageSourceSearch

https://schnucks.com/_next/static/chunks/pages/account/rewards-e2438f63219f9cfa.js

js schnucks.com collected 2026-10-01 11:34:19 UTC 6,177 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[48581],{16638:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/rewards",function(){return a(18689)}])},58666:function(e,s,a){"use strict";a.d(s,{J:function(){return n}});var t=a(45662),r=a(67294);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["LOYALTY_REWARDS","LOYALTY_POINTS","CHARITY_REWARDS"],s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,{mutate:a,...n}=(0,t.k)(a=>({url:"user/rewards/history",params:{walletTypes:e,page:a,size:s}}),s),l=(0,r.useCallback)(async()=>{await a()},[a]);return{rewardsHistory:n.data,refetchRewardsHistory:l,outOfRewardsHistoryPages:n.isOutOfPages,loadingFirstRewardsHistoryPage:n.isLoadingFirstPage,loadingRewardsHistory:n.isLoading,validatingRewardsHistory:n.isValidating,rewardsHistoryPage:n.page,rewardsHistoryError:n.error,nextRewardsHistoryPage:n.nextPage}}},18689:function(e,s,a){"use strict";a.r(s),a.d(s,{__N_SSG:function(){return E},default:function(){return k}});var t=a(85893),r=a(80054),n=a(26816),l=a(68092),i=a(17091),c=a(68004),o=a(32639),d=a(91307),u=a(67294),m=a(87536);let h=[{title:"Schnucks Rewards app only",description:"Rewards can only be redeemed using the in-app barcode",value:"BARCODE"},{title:"Schnucks Rewards app or phone number",description:"Rewards can only be redeemed using the in-app barcode or phone number",value:"ANY"}],x=[{title:"Decide at checkout",description:"Let your checker know your preferences at each trip",value:"PROMPT"},{title:"Always redeem",description:"Redeem rewards at every trip",value:"ALWAYS_REDEEM"},{title:"Always save",description:"Hold onto your rewards to redeem at a later date",value:"ALWAYS_BANK"}];function p(){let{user:e,loadingUser:s,patchUser:a}=(0,d.b)(),{control:r,formState:{isDirty:n,isSubmitting:c},handleSubmit:p,reset:w}=(0,m.cI)({defaultValues:{how:"ANY",when:"PROMPT"}}),j=async s=>{if(e)try{await a({redemptionPreference:s.when,redemptionIdPreference:s.how})}catch(e){(0,o.m)(e.message)}};return(0,u.useEffect)(()=>{e&&w(e.rewards)},[e,w]),(0,t.jsxs)(i.Z,{className:"p-5",children:[(0,t.jsx)("h2",{className:"mb-5 text-h4",children:"Redemption Preferences"}),(0,t.jsxs)("form",{onSubmit:p(j),children:[(0,t.jsx)(f,{control:r,name:"how",label:"How do you want to redeem Rewards?",loading:s,options:h}),(0,t.jsx)("hr",{className:"my-5 hidden md:block"}),(0,t.jsx)(f,{control:r,name:"when",label:"When do you want to redeem Rewards?",loading:s,options:x}),(0,t.jsx)(i.Z.Footer,{className:"mt-5",noPadding:!0,children:(0,t.jsx)(l.z,{className:"max-w-[21rem]",variant:"outlined",type:"submit",width:"custom",disabled:!n||c,children:c?"Updating...":"Update Preferences"})})]})]})}function f(e){let{control:s,name:a,label:r,loading:n,options:l}=e;return(0,t.jsxs)("div",{className:"my-5 flex flex-col gap-6 md:flex-row",children:[(0,t.jsx)(m.Qr,{name:a,control:s,rules:{required:!0},render:e=>{let{field:{value:s,onChange:i}}=e;return(0,t.jsx)(c.L,{fullWidth:!0,label:r,data:l.map(e=>({id:e.value,label:e.title})),value:s,onChange:e=>i(e),"data-testid":"rewards-".concat(a),loading:n})}}),(0,t.jsx)("ul",{className:"flex w-full list-disc flex-col gap-2 pl-5",children:l.map(e=>(0,t.jsxs)("li",{children:[(0,t.jsx)("div",{className:"text-h6",children:e.title}),(0,t.jsx)("p",{children:e.description})]},e.value))})]})}var w=a(24189),j=a(80407),g=a(58666);function y(){return(0,t.jsxs)("li",{className:"flex flex-col items-center text-center",children:[(0,t.jsx)(w.J,{name:"PastPurchases",size:"12.5rem",className:"mb-6 text-medium-grey"}),(0,t.jsx)("p",{className:"mb-2 text-h4",children:"No Rewards History to Show!"}),(0,t.jsx)("p",{className:"text-dark-grey",children:"Once you make a purchase it will appear here"})]})}var N=a(20265),v=a(30120);function R(e){let{transactionId:s,transactionDate:a,events:r}=e;return(0,t.jsx)(t.Fragment,{children:r.map((e,r)=>(0,t.jsxs)("li",{className:"flex w-full flex-col items-start gap-5 rounded-lg bg-background-grey p-5 text-body",children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-5 text-h5",children:[(0,t.jsx)("span",{className:"whitespace-nowrap",children:v.ou.fromMillis(a).toFormat("MMM dd, yyyy")}),(0,t.jsx)("span",{className:"whitespace-nowrap",children:(0,t.jsx)("p",{children:e.eventDescription})})]}),!!s&&(0,t.jsx)(N.r,{className:"items-end whitespace-nowrap",href:"/account/purchases/in-store/".concat(s),title:"View details of this transaction",color:"navy",size:"sm",target:"_blank",children:"View Details"})]}),(0,t.jsx)("div",{className:"flex flex-col gap-1",children:e.walletHistoryEvents.map((e,s)=>
1(0,t.jsxs)("p",{children:[e.note,": ",(0,t.jsx)("span",{className:"text-h6",children:e.amountChangedFormattedString})]},"".concat(e,"-").concat(s)))})]},"".concat(e,"-").concat(r)))})}function b(){let{loadingRewardsHistory:e,validatingRewardsHistory:s,outOfRewardsHistoryPages:a,rewardsHistory:r,nextRewardsHistoryPage:n}=(0,g.J)();return(0,t.jsxs)(i.Z,{className:"p-5",children:[(0,t.jsx)("h2",{className:"mb-5 w-full text-h4",children:"Rewards History"}),(0,t.jsx)("ul",{className:"flex w-full flex-col items-center gap-5",children:e?(0,t.jsx)("li",{children:(0,t.jsx)(j.P,{})}):(0,t.jsxs)(t.Fragment,{children:[!r.length&&(0,t.jsx)(y,{}),r.map((e,s)=>(0,t.jsx)(R,{...e},"".concat(e.transactionDate,"-").concat(s))),s&&(0,t.jsx)(j.P,{})]})}),!a&&!s&&(0,t.jsx)("footer",{className:"flex justify-center",children:(0,t.jsx)(l.z,{className:"-mb-2 mt-2",variant:"text",color:"navy",size:"sm",onClick:n,adornmentEnd:(0,t.jsx)(w.J,{name:"ChevronDown"}),children:"View More"})})]})}var P=a(1005),_=a(17428),E=!0;function k(e){let{siteSettings:s}=e,{fulfillmentType:a}=(0,P.s)(),l=(0,u.useRef)(!1);return(0,u.useEffect)(()=>{a&&!l.current&&((0,n.R)("Viewed My Rewards Screen",a),l.current=!0)},[a]),(0,t.jsx)(_.p,{siteSettings:s,title:r.F.REWARDS_PAGE_TITLE,children:(0,t.jsx)(A,{})})}function A(){return(0,t.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,t.jsx)(p,{}),(0,t.jsx)(b,{})]})}}},function(e){e.O(0,[96758,71706,17428,92888,49774,40179],function(){return e(e.s=16638)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.