1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="019fb28d-1af8-7110-be97-fc620a639ae9")}catch(e){}}();"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[1478],{15621:((I,f,s)=>{s.r(f),s.d(f,{default:()=>L});var e=s(74848),A=s(59905),x=s(85516),y=s(9474),g=s(97817),c=s(96540),j=s(61225),M=s(20913),O=s(81380),t=s(65979),u=s(98254),v=s(63386),K=s(37181);const L=F=>{const o=(0,j.wA)(),C=(0,M.useLocation)(),[a,E]=(0,c.useState)(1),[D,b]=(0,c.useState)(!1),[p,P]=(0,c.useState)(!0),i=(0,j.d4)(K.vH),{current:r}=(0,c.useRef)((0,v.A)(C.search)),_=(0,c.useRef)([]),T=n=>{var l;const d=i.map(m=>({...m}));!((l=_.current)===null||l===void 0)&&l.length||(_.current=[...i]);let S=!1;d.forEach((m,R)=>{m.id===n&&(m.isEnabled=!m.isEnabled),_.current[R].isEnabled!==m.isEnabled&&(S=!0)}),o((0,u.LE)(d)),P(!S)},B=n=>{const l=i.filter(d=>d.isEnabled);n&&(_.current=[...n]),l.length&&!D?E(2):D&&l.length?E(4):E(3)},N=()=>{if(a===3){const n=[...i];n.forEach(l=>{l.isEnabled=!0}),o((0,u.LE)(n))}else P(!0);E(1)},U=()=>{if(!p){const n={email:r.email,token:r.token,type:r.emailType};i.filter(d=>d.isEnabled).length?b(!1):b(!0),i.length&&o((0,u.W3)({data:i,callBack:B,urlDetails:n}))}};(0,c.useEffect)(()=>{const n={email:r.email,token:r.token,type:r.emailType};return o((0,u.gl)(n)),()=>{o((0,u.LE)([]))}},[o]);const h=decodeURIComponent(r.email);return i.length?(0,e.jsxs)("div",{className:`subscriptions-block${a===1?" subscriptions-settings-block":""}`,children:[a===1||a===2?(0,e.jsx)(A.A,{size:x.g.Medium,name:"email",color:"var(--text-primary-main-600)",customSize:286}):a===3?(0,e.jsx)(A.A,{size:x.g.Medium,name:"email-sad",color:"var(--text-primary-main-600)",customSize:286}):(0,e.jsx)(A.A,{size:x.g.Medium,name:"email-happy",color:"var(--text-primary-main-600)",customSize:286}),a===1&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("h1",{children:(0,e.jsx)(t.A,{translationKey:"emailSubscriptionSettings"})}),(0,e.jsx)("p",{className:"dear",children:(0,e.jsx)(t.A,{translationKey:"customizeYourPreferences"})}),(0,e.jsxs)("div",{className:"preferencesFor",children:[(0,e.jsx)("p",{className:"selectTypes",children:(0,e.jsx)(t.A,{translationKey:"selectEmailTypes"})}),(0,e.jsxs)("p",{className:"preferencesForEmail",children:[(0,e.jsx)(t.A,{translationKey:"preferencesFor"})," ",h]}),(0,e.jsx)(O.A,{setPreferenceCheck:T,subscriptions:[...i]}),(0,e.jsx)("p",{className:"orderNotificationMessage",children:(0,e.jsx)(t.A,{translationKey:"orderNotificationMessage"})})]})]}),a===2&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("h1",{className:"blue",children:(0,e.jsx)(t.A,{translationKey:"emailPreferencesHaveBeenUpdated"})}),(0,e.jsxs)("h6",{className:"blue",children:[(0,e.jsx)(t.A,{translationKey:"preferencesSuccessfullyUpdated"})," ",h]})]}),a===3&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("h1",{className:"blue",children:(0,e.jsx)(t.A,{translationKey:"weAreSorryToSeeYouGo"})}),(0,e.jsxs)("h6",{className:"blue",children:[(0,e.jsx)(t.A,{translationKey:"noLongerReceiveEmails"})," ",h]})]}),a===4&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("h1",{className:"blue",children:(0,e.jsx)(t.A,{translationKey:"thankYouForYourSubscribing"})}),(0,e.jsxs)("h6",{className:"blue",children:[(0,e.jsx)(t.A,{translationKey:"successfullySubscribedToReceive"})," ",h]})]}),(0,e.jsxs)("div",{className:"actionsSection",children:[a===1&&(0,e.jsx)("button",{className:(0,y.A)("button blue",p&&"disabled"),type:"button",onClick:U,children:(0,e.jsx)(t.A,{translationKey:"updateEmailPreferences"})}),a!==1&&(0,e.jsx)("button",{className:"button blue after-success-btn",type:"button",onClick:N,children:(0,e.jsx)(t.A,{translationKey:a!==3?"editEmailPreferences":"subscribeBack"})}),(0,e.jsxs)(g.A,{isNavLink:!0,className:"goToHomePage",style:{paddingBottom:"30px",color:"var(--link-primary-main-500)"},href:"/",children:[(0,e.jsx)(t.A,{translationKey:"goToHomePage"})," \u279C"]})]})]}):(0,e.jsx)("div",{})}})}]); 2 3//# sourceMappingURL=components-email-subscriptions-EmailSubscriptionSettings.9551f37.js.map 4//# chunkId=019fb28d-1af8-7110-be97-fc620a639ae9
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.