1"use strict";(self.webpackChunknyp_membership=self.webpackChunknyp_membership||[]).push([[3599],{3599:function(e,l,a){a.r(l),a.d(l,{ProfileOptional:function(){return v}});var n=a(1085),s=a(4041),t=a(7309),i=a(824),r=a(5472),o=a(7093),d=a(3486),c=a(316),u=a(7661),p=a(7682),g=a(4120),m={control:e=>Object.assign(Object.assign({},e),{borderRadius:"0px"}),dropdownIndicator:()=>({color:"#9b9898",height:"20px",marginRight:"10px",width:"16px"}),indicatorSeparator:()=>({display:"none"}),menu:e=>Object.assign(Object.assign({},e),{marginTop:"0px"}),placeholder:(e,l)=>Object.assign(Object.assign({},e),{color:"#585858",fontFamily:"Arial, Regular",fontSize:l.isFocused?"10px":"14px",position:"absolute",top:"auto",transform:l.isFocused&&"translateY(-100%)",transition:"transform 0.2s ease-out, font-size 0.2s ease-out"}),option:e=>Object.assign(Object.assign({},e),{color:"#585858",fontFamily:"Arial, Regular",fontSize:"14px"}),singleValue:e=>Object.assign(Object.assign({},e),{color:"#585858",fontFamily:"Arial, Regular",fontSize:"14px"}),valueContainer:e=>Object.assign(Object.assign({},e),{padding:"14px 10px"})};const b=(0,t.__)("Male","nypost"),h=(0,t.__)("Female","nypost"),_=[{value:1,label:(0,t.__)("January","nypost")},{value:2,label:(0,t.__)("February","nypost")},{value:3,label:(0,t.__)("March","nypost")},{value:4,label:(0,t.__)("April","nypost")},{value:5,label:(0,t.__)("May","nypost")},{value:6,label:(0,t.__)("June","nypost")},{value:7,label:(0,t.__)("July","nypost")},{value:8,label:(0,t.__)("August","nypost")},{value:9,label:(0,t.__)("September","nypost")},{value:10,label:(0,t.__)("October","nypost")},{value:11,label:(0,t.__)("November","nypost")},{value:12,label:(0,t.__)("December","nypost")}],y=[{value:"18-24",label:(0,t.__)("18 - 24","nypost")},{value:"25-34",label:(0,t.__)("25 - 34","nypost")},{value:"35-44",label:(0,t.__)("35 - 44","nypost")},{value:"45+",label:(0,t.__)("45+","nypost")}],v=()=>{var e;
1const[l,a]=(0,s.useState)(!1),{state:v,dispatch:x}=(0,g.rR)(),{setVisible:j,setShowSuccess:f}=(0,p.Yc)(),{user:{profile:N={}}={}}=v,S=N.gender&&![h,b].includes(N.gender||""),{handleSubmit:O,register:w,reset:F,setError:k,setValue:A,watch:C,formState:{errors:T}}=(0,i.mN)({defaultValues:{gender:S?"tell-us":N.gender||"",genderTellUs:S?N.gender:"",month:N.birthMonth?null===(e=_.find(e=>e.label===N.birthMonth))||void 0===e?void 0:e.value:"",day:N.birthDay,ageGroup:N.ageGroup}}),[G,U,D,M,V]=C(["gender","genderTellUs","month","day","ageGroup"]);(0,s.useEffect)(()=>{U&&"tell-us"!==G&&A("genderTellUs","")},[G,U]);const R=l?(0,t.__)("Loading...","nypost"):(0,t.__)("Update","nypost"),z=()=>{const e=(e=>new Date(2e3,e,0).getDate())(D||1),l=[];for(let a=1;a<=e;a+=1)l.push({value:a,label:a});return l};return(0,n.jsxs)("form",{onSubmit:O(e=>{return l=void 0,n=void 0,t=function*(){var l;const{gender:n,genderTellUs:s,month:t,day:i,ageGroup:r}=e;a(!0);const c={gender:s||n||"",birthMonth:(null===(l=_[t-1])||void 0===l?void 0:l.label)||"",birthDay:i||"",ageGroup:r||""};if(yield(0,o.r7)(c)){x((0,u.Uu)(c)),f(!0),j(!1);const e=N.gender&&![h,b].includes(N.gender||"");F({gender:e?"tell-us":n||"",genderTellUs:e?n:""},{keepDirty:!1,keepValues:!1})}else k("zephr",{type:"sephr",message:d.y.updatingProfile()});a(!1)},new((s=void 0)||(s=Promise))(function(e,a){function i(e){try{o(t.next(e))}catch(e){a(e)}}function r(e){try{o(t.throw(e))}catch(e){a(e)}}function o(l){var a;l.done?e(l.value):(a=l.value,a instanceof s?a:new s(function(e){e(a)})).then(i,r)}o((t=t.apply(l,n||[])).next())});var l,n,s,t}),children:[(0,n.jsx)("h4",{className:"member-profile__heading sub-heading sub-heading--semi",children:(0,t.__)("Gender","nypost")}),(0,n.jsx)("span",{className:"profile-data profile-data--gender",children:N.gender}),(0,n.jsxs)("div",{className:"member-profile__details grid-container optional-details--gender",children:[(0,n.jsxs)("div",{className:"grid-col grid-col-5 grid-col-md-2",children:[(0,n.jsx)("input",Object.assign({id:"male",name:"gender"},w("gender"),{type:"radio",value:b})),(0,n.jsx)("label",{htmlFor:"male",children:b})]}),(0,n.jsxs)("div",{className:"grid-col grid-col-5 grid-col-md-2",children:[(0,n.jsx)("input",Object.assign({id:"female",name:"gender"},w("gender"),{type:"radio",value:h})),(0,n.jsx)("label",{htmlFor:"female",children:h})]}),(0,n.jsxs)("div",{className:"grid-col grid-col-10 grid-col-md-4",children:[(0,n.jsx)("input",Object.assign({"data-testid":"tell-us-input",id:"tell-us",name:"gender"},w("gender"),{type:"radio",value:"tell-us",onClick:()=>{document.getElementById("tell-us-input").focus()}})),(0,n.jsxs)("div",{className:"input-container input-container--floating-label input-container--no-margin",children:[(0,n.jsx)("input",Object.assign({className:"floating-label__input","data-testid":"gender-textbox",id:"tell-us-input",name:"gender"},w("genderTellUs",{setValueAs:e=>c.S.plainText(e),required:{value:"tell-us"===G,message:(0,t.__)("Please enter your gender.","nypost")}}),{placeholder:" ",type:"text",onClick:()=>{A("gender","tell-us"),document.getElementById("tell-us").click()}})),(0,n.jsx)("div",{className:"floating-label__label-wrap",children:(0,n.jsx)("label",{className:"floating-label__label",htmlFor:"tell-us-input",children:(0,t.__)("Tell us","nypost")})})]})]})]}),(0,n.jsx)("h4",{className:"member-profile__heading sub-heading sub-heading--semi",children:(0,t.__)("Birthday","nypost")}),(0,n.jsxs)("div",{className:"member-profile__details grid-container optional-details--birthday",children:[(0,n.jsx)("div",{className:"grid-col grid-col-10 grid-col-md-2",children:(0,n.jsx)("div",{className:"input-container",children:(0,n.jsx)(r.Ay,{className:"reactSelect",name:"month",isSearchable:!1,onChange:e=>A("month",e.value),options:_,placeholder:(0,t.__)("Select a Month","nypost"),styles:m,defaultValue:_[D-1]})})}),(0,n.jsx)("div",{className:"grid-col grid-col-5 grid-col-md-2",children:(0,n.jsx)("div",{className:"input-container",children:(0,n.jsx)(r.Ay,{className:"reactSelect",isSearchable:!1,name:"day",onChange:e=>A("day",e.value),options:z(),placeholder:(0,t.__)("Select a Day","nypost"),styles:m,value:z()[M-1]})})}),(0,n.jsx)("div",{className:"grid-col grid-col-5 grid-col-md-3",children:(0,n.jsx)("div",{className:"input-container",children:(0,n.jsx)(r.Ay,{className:"reactSelect",isSearchable:!1,name:"age-group",onChange:e=>A("ageGroup",e.value),options:y,placeholder:(0,t.__)("Select Age Group","nypost"),styles:m,value:y.find(e=>e.value===V)})})}),(0,n.jsx)("div",{className:"grid-col grid-col-1",children:(0,n.jsx)(p.lg,{})})]}),(0,n.jsx)("div",{children:(0,n.jsx)(p.dF,{errors:T})}),(0,n.jsxs)("div",{className:"member-profile__form input-container input-container--submit",children:[(0,n.jsx)("button",{className:"button button--solid button--solid--alt","data-testid":"submit",disabled:l,type:"submit",children:R}),(0,n.jsx)("button",{className:"button button--secondary",onClick:()=>{f(!1),j(!1)},type:"button",children:(0,t.__)("Cancel","nypost")})]})]})}}}]); 2//# sourceMappingURL=3599.bc8cd2f2b8b770e93909.bundle.min.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.