1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2824],{6802:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var a=s(85893),i=s(52353),n=s.n(i),o=s(67294),l=s(94184),c=s.n(l),u=s(3262),r=s(66862),p=s.n(r),_=s(61993),d=s(6669),h=s(43948),m=s(53502),b=s(70675);let C=[{context:d.Zv,mapStateToProps:e=>{let{userInfo:{currentUserId:t,guestUserId:s}}=e;return{userIdFromStore:t||s}}},{context:b.td,mapStateToProps:e=>{let{filterData:{careToDeclareOptions:{choices:t,allowMultipleChoice:s,title:a,groupId:i}}}=e;return{choices:t,allowMultipleChoice:s,title:a,interestGroupId:i}}}],x=(0,h.Z)({mapStateToProps:C})(e=>{let{allowMultipleChoice:t=!1,interestGroupId:s,choices:i,title:l="What's your deal?",onSave:r,registerGuestUserFn:d,userIdFromStore:h}=e,[b,C]=(0,o.useState)({}),[x,j]=(0,o.useState)(!1),k=Object.keys(b),N=e=>{var s;let a=e.currentTarget.value,o=null===(s=i.find(e=>e.displayName===a))||void 0===s?void 0:s.optionId;o&&(t?C(e=>{let t={...e};return n()(t[o])?t[o]=a:delete t[o],t}):C({[o]:a}))},f=(0,o.useCallback)(async(e,t)=>{let s=h;if(!s){let e=await d();e&&(s=e.id)}let a=(0,m.jl)();if(!s){a.log("UserID not present. Can't update User's Interests.",m.Mk);return}try{let a=new _.Z;await a.updateUserInterests(s,e,t)}catch(e){a.log("Error updating user interest.",m.Mk,e)}await r()},[r,d,h]);return(0,o.useEffect)(()=>{x&&(j(!1),f(s,k),(0,u.ZP)("ctd_interest_popup_submit",{choices:Object.values(b).join("|")},{labelTemplate:"choices"}))},[t,x,s,f,b,k]),(0,a.jsxs)("div",{className:p().main,children:[(0,a.jsx)("span",{className:p().title,children:l}),(0,a.jsx)("span",{className:p().subtitle,children:t?"select all that apply":"see how people like you ranked the list"}),(0,a.jsx)("div",{className:p().choicesContainer,children:i.map(e=>(0,a.jsx)("input",{type:"button",className:c()(p().input,p().button,{[p().selected]:b[e.optionId]}),value:e.displayName,onClick:N},e.optionId))}),(0,a.jsx)("span",{className:p().statusText,children:k.length?(0,a.jsx)("button",{type:"submit",onClick:()=>{j(!0)},disabled:x,className:c()(p().input,p().button,p().submit),children:"submit"}):t?"choose at least one to continue":"choose one to continue"})]})})},66862:e=>{e.exports={main:"Choice_main__jQUxq",title:"Choice_title__QGw9w",subtitle:"Choice_subtitle__NeuYs",input:"Choice_input__2xs_f",choicesContainer:"Choice_choicesContainer__9tiEU",button:"Choice_button__A665j",selected:"Choice_selected__hRXLX",genderButton:"Choice_genderButton__7mPbG",submit:"Choice_submit__ML1mt",statusText:"Choice_statusText__2y20P"}}}]); 2//# sourceMappingURL=2824.246afda2799196d4.js.map
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.