1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7966],{682:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account",function(){return n(56760)}])},24049:function(e,t,n){"use strict";var s=n(85893),a=n(40359),r=n(9008),o=n.n(r),i=n(4298),c=n.n(i);t.Z=function(e){let{canonicalLink:t,imageAlt:n,imageSrc:r,noScriptImgSrc:i,pageDescription:l,pageTitle:d,siteName:u,trackingPixelJSCode:m,nonce:h="",jsonLd:x}=e;return(0,s.jsxs)(o(),{children:[(0,s.jsx)("meta",{property:"og:image",content:null!=r?r:a._G.OG_IMAGE}),(0,s.jsx)("meta",{name:"twitter:image",content:null!=r?r:a._G.OG_IMAGE}),(0,s.jsx)("meta",{property:"og:image:alt",content:null!=n?n:a._G.OG_IMAGE_ALT}),(0,s.jsx)("meta",{name:"twitter:image:alt",content:null!=n?n:a._G.OG_IMAGE_ALT}),(0,s.jsx)("meta",{property:"og:title",content:d}),(0,s.jsx)("meta",{name:"twitter:title",content:d}),(0,s.jsx)("meta",{name:"description",content:l}),(0,s.jsx)("meta",{property:"og:description",content:l}),(0,s.jsx)("meta",{name:"twitter:description",content:l}),(0,s.jsx)("meta",{property:"og:site_name",content:null!=u?u:"Whole Foods Market"}),(0,s.jsx)("meta",{name:"twitter:site",content:"@WholeFoods"}),(0,s.jsx)("meta",{property:"og:url",content:t}),(0,s.jsx)("link",{rel:"canonical",href:t}),m?(0,s.jsx)(c(),{id:"tracking-pixel",type:"text/javascript",nonce:h,dangerouslySetInnerHTML:{__html:m}}):null,i?(0,s.jsx)("noscript",{children:(0,s.jsx)("img",{height:"1",width:"1",alt:"",src:i})}):null,(0,s.jsx)("title",{children:d}),x?(0,s.jsx)("script",{type:"application/ld+json","data-testid":"product-jsonld",dangerouslySetInnerHTML:{__html:JSON.stringify(x).replace(/</g,"\\u003c")}}):null]})}},56760:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return _},default:function(){return AccountPage}});var s=n(85893),a=n(41664),r=n.n(a),o=n(67294);function AccountPanel(e){let{title:t,subtitle:n,id:a,children:r}=e;return(0,s.jsxs)("section",{id:a,className:"mb-8 rounded-lg border border-earl-grey bg-salt p-6 shadow-sm",children:[(0,s.jsxs)("div",{className:"mb-4 border-b border-earl-grey pb-4",children:[(0,s.jsx)("h2",{className:"bds--heading-3 mb-1",children:t}),(0,s.jsx)("p",{className:"bds--body-2 text-chia-seed",children:n})]}),(0,s.jsx)("div",{className:"mt-4",children:r})]})}var i=n(51312);function ContactInfo(e){let{fullName:t,phoneNumber:n,isLoading:a,isError:r}=e;return a?(0,s.jsx)(i.Z,{size:"default"}):r?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("p",{className:"bds--body-2 text-cayenne",children:"Unable to load contact information."}),(0,s.jsx)("div",{className:"mt-4 border-t border-earl-grey pt-4",children:(0,s.jsxs)("a",{href:"https://www.amazon.com/ax/account/manage",target:"_blank",rel:"noopener noreferrer",className:"bds--link-3 inline-flex items-center text-kale underline hover:text-avocado",children:["Edit on Amazon",(0,s.jsx)("svg",{className:"ml-1 h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})})]}):(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_auto] gap-x-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"bds--heading-5 mb-1",children:"Name"}),(0,s.jsx)("p",{className:"bds--body-2 text-chia-seed",children:t})]}),n?(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"bds--heading-5 mb-1",children:"Phone"}),(0,s.jsx)("p",{className:"bds--body-2 text-chia-seed",children:n})]}):(0,s.jsx)("div",{}),(0,s.jsx)("div",{className:"flex items-start",children:(0,s.jsxs)("a",{href:"https://www.amazon.com/ax/account/manage",target:"_blank",rel:"noopener noreferrer",className:"bds--link-3 inline-flex items-center text-kale underline hover:text-avocado",children:["Edit on Amazon",(0,s.jsx)("svg",{className:"ml-1 h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})})]})}var c=n(98029),l=n(40359);function EmailPreferences(e){let{subscriptions:t}=e,n=t.find(e=>e.subscribed),[a,r]=(0,o.useState)(!!n),[i,d]=(0,o.useState)((null==n?void 0:n.token)||""),[u,m]=(0,o.useState)(!1),[h,x]=(0,o.useState)({emailOptIn:!!n,selectedCountry:(null==n?void 0:n.token)||""}),{mutate:p,isPending:b,isSuccess:g,isError:j,error:y,reset:N}=(0,c.D)({mutationKey:["emailPreferences"],mutationFn:e=>(0,l._i)("/api/wwos/account/email-subscriptions",{method:"PUT",body:JSON.stringify(e)}),onSuccess:()=>{x({emailOptIn:a,selectedCountry:i}),m(!1)},onError:e=>{console.error("WFM component render error - Email Preferences: Error updating email preferences",e)}});(0,o.useEffect)(()=>{let e=a!==h.emailOptIn||i!==h.selectedCountry;m(e)},[a,i,h]);let handleCountryChange=e=>{d(e.target.value),N()};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("hr",{className:"border-earl-grey"}),g?(0,s.jsx)("div",{className:"bds--body-2 rounded-md bg-honeydew p-3 text-kale",role:"alert","aria-live":"polite",children:"Your email preferences have been saved successfully."}):null,j?(0,s.jsx)("div",{className:"bds--body-2 rounded-md bg-kewpie p-3 text-cayenne",role:"alert","aria-live":"assertive",children:(null==y?void 0:y.message)||"Failed to save changes. Please try again."}):null,(0,s.jsxs)("form",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-start",children:[(0,s.jsx)("input",{type:"checkbox",id:"emailOptIn",name:"emailOptIn",checked:a,onChange:e=>{r(e.target.checked),N()},disabled:b,className:"mt-1 h-5 w-5 cursor-pointer rounded accent-chard disabled:cursor-not-allowed disabled:opacity-50"}),(0,s.jsx)("label",{htmlFor:"emailOptIn",className:"bds--body-1 ml-3 text-squid-ink",children:"I would like to receive emails from Whole Foods Market"})]}),(0,s.jsxs)("fieldset",{className:"space-y-3",children:[(0,s.jsx)("legend",{className:"bds--form-label text-squid-ink",children:"Select your country / region"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("input",{type:"radio",id:"US",name:"region-subscription",value:"PROD_US_WFM",checked:"PROD_US_WFM"===i,onChange:handleCountryChange,disabled:b,className:"h-4 w-4 cursor-pointer accent-chard disabled:cursor-not-allowed disabled:opacity-50"}),(0,s.jsx)("label",{htmlFor:"US",className:"bds--body-1 ml-3 text-squid-ink",children:"United States"})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("input",{type:"radio",id:"CA",name:"region-subscription",value:"PROD_CA_WFM",checked:"PROD_CA_WFM"===i,onChange:handleCountryChange,disabled:b,className:"h-4 w-4 cursor-pointer accent-chard disabled:cursor-not-allowed disabled:opacity-50"}),(0,s.jsx)("label",{htmlFor:"CA",className:"bds--body-1 ml-3 text-squid-ink",children:"Canada"})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("input",{type:"radio",id:"GB",name:"region-subscription",value:"PROD_UK_WFM",checked:"PROD_UK_WFM"===i,onChange:handleCountryChange,disabled:b,className:"h-4 w-4 cursor-pointer accent-chard disabled:cursor-not-allowed disabled:opacity-50"}),(0,s.jsx)("label",{htmlFor:"GB",className:"bds--body-1 ml-3 text-squid-ink",children:"United Kingdom"})]})]})]}),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=t.map(e=>({token:e.token,subscribed:a&&e.token===i}));p({subscriptions:e})},disabled:!u||b,className:"bds--body-1 rounded-md bg-nickel px-6 py-2 font-medium text-squid-ink shadow-sm transition-colors hover:bg-earl-grey focus:outline-none focus:ring-2 focus:ring-kale focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:b?"Saving...":"Save changes"})]})]})}function StoreDetails(e){let{name:t,phone:n,address:a}=e;return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"bds--heading-5 mb-2",children:t}),(0,s.jsxs)("div",{className:"bds--body-2 space-y-1 text-chia-seed",children:[(0,s.jsx)("p",{children:a.streetAddress}),a.extendedAddress?(0,s.jsx)("p",{children:a.extendedAddress}):null,(0,s.jsxs)("p",{children:[a.city,", ",a.administrativeArea," ",a.postalCode]}),a.country?(0,s.jsx)("p",{children:a.country}):null]})]}),n?(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"bds--caption text-oyster",children:"Phone"}),(0,s.jsx)("p",{className:"bds--body-2 font-medium",children:(0,s.jsx)("a",{href:"tel:".concat(n),className:"text-kale hover:text-avocado hover:underline",children:n})})]}):null,(0,s.jsx)("div",{className:"mt-4 border-t border-earl-grey pt-4",children:(0,s.jsx)("a",{href:"/stores",className:"bds--link-3 text-kale underline hover:text-avocado",children:"Change your store"})})]})}var d=n(42550),u=n(24049),m=n(66252),h=n(16357),x=n(74257),p=n(38514);let b="".concat(x.ROUTES.Account.url,"?").concat(h.ACCOUNT_SIGN_IN_ATTEMPTED_PARAM,"=1");function setAttemptedSignIn(e){try{e?window.sessionStorage.setItem(h.ACCOUNT_SIGN_IN_ATTEMPTED_SESSION_KEY,"true"):window.sessionStorage.removeItem(h.ACCOUNT_SIGN_IN_ATTEMPTED_SESSION_KEY)}catch(e){}}var g=n(4654),j=n(78551),y=n(90210);let N={emailSubscriptions:[{token:"PROD_US_WFM",displayName:"United States",subscribed:!0}
1,{token:"PROD_CA_WFM",displayName:"Canada",subscribed:!1},{token:"PROD_UK_WFM",displayName:"United Kingdom",subscribed:!1}]},fetchEmailSubscriptions=()=>"true"===(0,y.OB)("NEXT_PUBLIC_LOCAL_AUTH")?Promise.resolve({subscriptions:N.emailSubscriptions}):(0,l._i)("/api/wwos/account/email-subscriptions");var f=n(81913),_=!0;function AccountPage(){let{isAuthenticated:e,isUserInitialized:t}=(0,o.useContext)(m.S),{shouldPromptSignIn:n,startSignIn:a}=function(){let{isAuthenticated:e,isUserInitialized:t,hasTriggeredSignIn:n}=(0,o.useContext)(m.S),[s,a]=(0,o.useState)(!1),r=(0,o.useCallback)(()=>{try{(0,p.Mv)({operation:"signin",method:"account"})}catch(e){}setAttemptedSignIn(!0),window.location.href="/api/wwos/auth/login?returnToUrl=".concat(encodeURIComponent(b))},[]);return(0,o.useEffect)(()=>{if(t){if(e){setAttemptedSignIn(!1),a(!1);return}if(!s){if(n||new URLSearchParams(window.location.search).has(h.ACCOUNT_SIGN_IN_ATTEMPTED_PARAM)||function(){try{return null!==window.sessionStorage.getItem(h.ACCOUNT_SIGN_IN_ATTEMPTED_SESSION_KEY)}catch(e){return!1}}()){a(!0);return}r()}}},[e,t,n,s,r]),(0,o.useEffect)(()=>{t&&(e||s)&&function(){try{let e=new URLSearchParams(window.location.search);if(!e.has(h.ACCOUNT_SIGN_IN_ATTEMPTED_PARAM))return;e.delete(h.ACCOUNT_SIGN_IN_ATTEMPTED_PARAM);let t=e.toString();window.history.replaceState(window.history.state,"","".concat(window.location.pathname).concat(t?"?".concat(t):"").concat(window.location.hash))}catch(e){}}()},[e,t,s]),{shouldPromptSignIn:s,startSignIn:r}}(),{storeId:c,data:l,isLoading:y,isError:N}=(0,f.c)(),{data:_,isLoading:v,isError:w}=(0,g.js)({enabled:e&&t}),{data:S,isLoading:k,isError:A,error:E}=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return(0,j.a)({queryKey:["emailSubscriptions"],queryFn:fetchEmailSubscriptions,enabled:e})}(e&&t);return((0,o.useEffect)(()=>{A&&E&&console.error("WFM component render error - Account Page: Error fetching account data",E)},[A,E]),n)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Z,{pageTitle:"Account Settings | Whole Foods Market",pageDescription:"Manage your Whole Foods Market account settings.",canonicalLink:x.ROUTES.Account.url}),(0,s.jsx)("main",{className:"mx-auto my-8 max-w-content px-4 text-center",children:(0,s.jsxs)("div",{id:"main-content",children:[(0,s.jsx)("h1",{className:"bds--heading-3 mb-2",children:"Sign in to see your account"}),(0,s.jsx)("p",{className:"bds--body-1 mb-4",children:"We could not confirm you are signed in. Please try again."}),(0,s.jsx)(d.ZP,{onClick:a,csaProps:{contentType:"cta",contentSlotId:"AccountSignIn",contentId:"Sign in with Amazon"},children:"Sign in with Amazon"})]})})]}):t&&e&&!k?A||!S?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Z,{pageTitle:"Account Settings | Whole Foods Market",pageDescription:"Manage your Whole Foods Market account settings.",canonicalLink:x.ROUTES.Account.url}),(0,s.jsx)("div",{className:"mx-auto my-8 max-w-content px-4",children:(0,s.jsx)("div",{className:"bds--body-1 rounded-lg bg-kewpie p-4 text-cayenne",children:(null==E?void 0:E.message)||"Unable to load account information. Please try again later."})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Z,{pageTitle:"Account Settings | Whole Foods Market",pageDescription:"Manage your Whole Foods Market account settings.",canonicalLink:x.ROUTES.Account.url}),(0,s.jsx)("main",{className:"w-auth--account",children:(0,s.jsx)("div",{id:"main-content",children:(0,s.jsxs)("div",{className:"w-auth-grid mx-auto max-w-content px-4 py-8",children:[(0,s.jsx)("h1",{className:"bds--heading-1 mb-8",children:"Account Settings"}),(0,s.jsx)(AccountPanel,{title:"My Whole Foods Market",subtitle:"Your preferred Whole Foods Market store",id:"store",children:null===c?(0,s.jsxs)("div",{className:"bds--body-2",children:[(0,s.jsx)("p",{children:"No preferred store selected."}),(0,s.jsx)(r(),{href:"/stores",className:"bds--link-3 text-kale underline hover:text-avocado",children:"Select a preferred store"})]}):y?(0,s.jsx)(i.Z,{size:"default"}):N?(0,s.jsx)("p",{className:"bds--body-2 text-cayenne",children:"Unable to load store information."}):l?(0,s.jsx)(StoreDetails,{name:l.displayName,phone:l.phone,address:{streetAddress:l.primaryLocation.address.STREET_ADDRESS_LINE1,city:l.primaryLocation.address.CITY,administrativeArea:l.primaryLocation.address.STATE,postalCode:l.primaryLocation.address.POSTAL_CODE,country:l.primaryLocation.address.COUNTRY}}):null}),(0,s.jsx)(AccountPanel,{title:"Contact Information",subtitle:"Update your Whole Foods Market and Amazon account information",id:"contact",children:(0,s.jsx)(ContactInfo,{fullName:null==_?void 0:_.fullName,phoneNumber:null==_?void 0:_.phoneNumber,isLoading:v,isError:w})}),(0,s.jsx)(AccountPanel,{title:"Email subscription preferences",subtitle:"Cho
1ose whether you would like to receive emails from Whole Foods Market.",id:"email",children:(0,s.jsx)(EmailPreferences,{subscriptions:S.subscriptions||[]})})]})})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Z,{pageTitle:"Account Settings | Whole Foods Market",pageDescription:"Manage your Whole Foods Market account settings.",canonicalLink:x.ROUTES.Account.url}),(0,s.jsx)("div",{className:"grid h-[900px] max-h-[75vh] w-full place-items-center",children:(0,s.jsx)(i.Z,{size:"large"})})]})}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=682)}),_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.