1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[128,546],{8128:function(e,t,a){a.r(t),a.d(t,{EditModal:function(){return O},ResumeModal:function(){return R},ResumeUploader:function(){return E},StatementModal:function(){return b}});var r=a(5893),o=a(7294),i=a(5313),n=a(3741),s=a(9578),l=a(6086),c=a(9356),u=a(9921),d=a(4892),m=a(1416),f=a(4202),p=a(3046),h=a(2154),g=a(5672),N=a(1835),x=a(9936);let T=()=>{let e=(0,p.Z)(),{fileStackKey:t}=(0,h.Z)(),[a,n]=(0,o.useState)(!1),l=(0,i.I0)(),c=(0,u.v)(e=>e.user),d=()=>{n(!0)},m=e=>t=>{l((0,x.KZ)({key:e,newValue:t}))},T=e=>{let{filesUploaded:t}=e;if(t.length>0){let[{filename:e,key:a,container:r}]=t,o={filename:"",s3:{keyName:null}};o.filename=e;let i=encodeURIComponent(a).replace("%2F","/");o.s3.keyName="https://s3.amazonaws.com/".concat(r,"/").concat(i),m("profilePicture")(o),n(!1)}},v=t=>(e.error("The user ".concat(c.email," with cognito_id ").concat(c.id,", had a error uploading their profile picture"),{meta_data:{error:t,...c.getIdentifiers()}}),(0,N.c0)(g.GT,5e3,"error",l));return(0,r.jsxs)(r.Fragment,{children:[a&&(0,r.jsx)(f.g9,{apikey:t,pickerOptions:{accept:["image/*"],storeTo:{access:"private",location:"S3",path:"/".concat(c.id,"/")},fromSources:["local_file_system","googledrive","dropbox","box","url","imagesearch"],concurrency:1,onClose:()=>{n(!a)}},onUploadDone:T,onError:v}),(0,r.jsx)(s.ht,{id:"profile-picture-upload",className:"ta-reggie__input",placeholder:"image.png",cta:"Add photo",label:"Upload your photo",customUploadFile:d,value:c.profilePicture.filename})]})};var v=a(2813),_=a(8077),I=a(2691),C=a(9462),S=a(3210),j=a(3433),U=a(8662);let y=()=>{let e=(0,u.v)(e=>e.user),{signedUrl:t}=(0,C.Ym)(e.profilePicture.s3.keyName);return(0,r.jsx)(s.qE,{size:"large",src:null!=t?t:S.L})},E=()=>{let e=(0,i.I0)(),t=(0,u.v)(e=>e.user),a=a=>{if(t.hasFieldValidation(a)){let r=t.validateField(a);e((0,x.Pv)({key:a,value:r}))}},o=t=>a=>{e((0,x.KZ)({key:t,newValue:a}))};return(0,r.jsx)(m.Z,{validate:a,setFocus:e=>null,onChangeProperty:o})},O=e=>{let{type:t}=e,{dropDownValues:{jobCategories:a}}=(0,o.useContext)(d.R0),{edit:{setShowEditModal:m}}=(0,I.ZP)("introduction"),f=(0,i.I0)(),h=(0,p.Z)(),C=(0,u.v)(e=>e.user),S={FIRST_NAME:{fieldName:"firstName",maxLength:255},LAST_NAME:{fieldName:"lastName",maxLength:255},PERSONAL_STATEMENT:{fieldName:"personalStatement",maxLength:2e3}},j=e=>{let t=(e.match(/\n/g)||[]).length;return e.length+t},O=(e,t)=>{let a=j(t);if(e===S.FIRST_NAME.fieldName||e===S.LAST_NAME.fieldName){if(a>S.FIRST_NAME.maxLength)return;R(e,t)}else if(e===S.PERSONAL_STATEMENT.fieldName&&a>S.PERSONAL_STATEMENT.maxLength)return;f((0,x.KZ)({key:e,newValue:t}))},R=(e,t)=>{let a=C.clone();if(a[e]=t,a.hasFieldValidation(e)){let t=a.validateField(e);f((0,x.Pv)({key:e,value:t}))}},b=()=>{(0,N.c0)(g.MP,2e3,"error",f)},P=e=>{O("jobCategory",e.value)},A=async()=>{m(!1),f((0,v.s)(C));try{let e=await n.g.currentAuthenticatedUser(),{name:t,family_name:a}=e.attributes;(C.firstName!==t||C.lastName!==a)&&n.g.updateUserAttributes(e,{name:C.firstName,family_name:C.lastName});let r={input:{profileStatus:_.eB.INTRODUCTION,id:C.id,firstName:C.firstName,lastName:C.lastName,userProfileJobCategoryId:C.jobCategory,personalStatement:C.personalStatement,profilePicture:C.profilePicture,resume:C.resume}};await U.Z.updateUserProfile(r),h.info("The user ".concat(C.email," with cognito_id ").concat(C.id,", update user profile info on ").concat(_.eB.INTRODUCTION," card on Profile successfully"),{meta_data:{...C.getIdentifiers(),section:_.eB.INTRODUCTION,action:"USER_UPDATE_".concat(_.eB.INTRODUCTION,"_SECTION")}}),f((0,x.wD)({text:"User profile successfully updated",delay:2e3}))}catch(e){throw h.error("The user ".concat(C.email," with cognito_id ").concat(C.id,", COULDN'T update user profile info on ").concat(_.eB.INTRODUCTION," card on Profile successfully"),{meta_data:{error:e,...C.getIdentifiers(),section:_.eB.INTRODUCTION,action:"USER_FAILED_UPDATE_".concat(_.eB.INTRODUCTION,"_SECTION")}}),e}},w=()=>O("profilePicture",{s3:{keyName:null,bucket:null}}),k=(0,r.jsx)(s.zx,{id:"delete-profile-picture",type:"ghost",size:"medium",onClick:w,children:(0,r.jsx)(s.zx.Icon,{icon:"trash",iconColor:"#727272"})}),D=()=>(0,r.jsxs)(s.zx,{id:"delete-profile-picture-mobile",type:"ghost",size:"small",onClick:w,children:[(0,r.jsx)(s.zx.Icon,{icon:"trash",iconColor:"#727272"}),(0,r.jsx)(s.zx.Text,{children:"Delete photo"})]});return(0,r.jsx)(c.Z,{id:"introduction-modal".concat("desktop"!==t?"-mobile":""),title:"Edit your introduction",onClose:()=>m(!1),onSave:C.firstName&&C.lastName&&(!C.resume.filename||C.resume.permissionToUse)?A:b,children:(0,r.jsxs)(s.aV,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(s.aV.Item,{title:"Profile photo",action:k}),(0,r.jsxs)("div",{id:"profile-picture-section",children:[(0,r.jsx)("div",{className:"avatar-wrapper",children:(0,r.jsx)(y,{})}),(0,r.jsx)(T,{})]}),(0,r.jsx)(D,{})]}),(0,r.jsxs)("div",{className:"profile-modal-section",children:[(0,r.jsx)(s.aV.Item,{title:"Intro"}),(0,r.jsxs)("div",{className:"profile-modal-section-elements",children:[(0,r.jsxs)("div",{id:"full-name",children:[(0,r.jsx)(l.o,{id:"first-name",fullWidth:!0,className:"ta-reggie__input",label:"First name",value:C.firstName,onChange:e=>O("firstName",e.target.value),error:C.errors.firstName.errorText}),(0,r.jsx)(l.o,{id:"last-name",fullWidth:!0,className:"ta-reggie__input",label:"Last name",value:C.lastName,onChange:e=>O("lastName",e.target.value),error:C.errors.lastName.errorText})]}),(0,r.jsx)(s.vO,{id:"job-category",fullWidth:!0,value:C.jobCategory,label:"What job title fits you best?",options:a,onChange:P}),(0,r.jsx)(l.F,{id:"personal-statement",fullWidth:!0,label:"Statement",value:C.personalStatement,onChange:e=>O("personalStatement",e.target.value),maxLength:"2000"})]})]}),(0,r.jsxs)("div",{className:"profile-modal-section",children:[(0,r.jsx)(s.aV.Item,{title:"Resume"}),(0,r.jsx)(E,{})]})]})})},R=e=>{let{type:t}=e,{add:{setShowAddModal:a}}=(0,I.ZP)("introduction"),{loading:o,saveResume:i}=(0,j.Z)();return(0,r.jsx)(c.Z,{id:"upload-resume-modal".concat("desktop"!==t?"-mobile":""),height:"auto",title:"Upload resume",onClose:()=>a(!1),onSave:i,loading:o,children:(0,r.jsx)(s.aV,{children:(0,r.jsx)(E,{})})})},b=e=>{let{onClose:t}=e,a=(0,u.v)(e=>e.user);return(0,r.jsx)(c.Z,{id:"personal-statement-modal",type:"info",height:"auto",title:"Personal statement",onClose:t,children:(0,r.jsx)("div",{className:"full-personal-statement",children:a.personalStatement})})}},3433:function(e,t,a){var r=a(7294),o=a(5313),i=a(4892),n=a(2691),s=a(9921),l=a(9936),c=a(2813),u=a(8662),d=a(1835),m=a(5672),f=a(8077),p=a(3046);let h=()=>{let{add:{setShowAddModal:e}}=(0,n.ZP)("introduction"),{edit:{setShowEditModal:t}}=(0,n.ZP)("strength"),a=(0,o.I0)(),h=(0,p.Z)(),g=(0,r.useContext)(i.R0),N=(0,s.v)(e=>e.user),x=(0,s.v)(e=>e.userCopy),[T,v]=(0,r.useState)(!1),_=x.id?x.resume:g.resume,I=()=>{v(!0),setTimeout(()=>{v(!1),(0,d.c0)("Please accept the terms and conditions to proceed",2e3,"error",a)},500)},C=()=>!N.resume.filename||N.resume.permissionToUse,S=async()=>
1{if(console.log(C()),C()){if(N.resume.filename)try{v(!0),await u.Z.saveResume(N.id,N.resume),v(!1),h.info("The user ".concat(N.email," with cognito_id ").concat(N.id,", save a Resume on ").concat(f.eB.INTRODUCTION," card on Profile successfully"),{meta_data:{...N.getIdentifiers(),section:f.eB.INTRODUCTION,action:"USER_SAVE_RESUME_".concat(f.eB.INTRODUCTION,"_SECTION")}}),e(!1),t(!1),a((0,c.s)(N)),a((0,l.wD)({text:"Sucessfully uploaded resume",delay:2e3}))}catch(e){throw h.error("The user ".concat(N.email," with cognito_id ").concat(N.id,", COULDN'T save a Resume on ").concat(f.eB.INTRODUCTION," card on Profile successfully"),{meta_data:{error:e,...N.getIdentifiers(),section:f.eB.INTRODUCTION,action:"USER_FAILED_SAVE_RESUME_".concat(f.eB.INTRODUCTION,"_SECTION")}}),(0,d.c0)(m.$Y,2e3,"error",a),v(!1),e}e(!1),t(!1)}else I()};return{resume:_,loading:T,saveResume:S}};t.Z=h},6086:function(e,t,a){a.d(t,{F:function(){return s},o:function(){return n}});var r=a(5893),o=a(9578);let i=RegExp('(\\p{Extended_Pictographic}|\\p{Emoji_Presentation})|["\\\\]',"gu"),n=e=>{let{blockChars:t=!0,...a}=e;return(0,r.jsx)(o.oi,{...a,blockChars:t?i:null})},s=e=>{let{blockChars:t=!0,...a}=e;return(0,r.jsx)(o.Fz,{...a,blockChars:t?i:null})}},1416:function(e,t,a){var r=a(5893),o=a(7294),i=a(5313),n=a(9578),s=a(4202),l=a(3046),c=a(2154),u=a(5672),d=a(1835),m=a(9921),f=a(8077);let p=e=>{let{validate:t,setFocus:a,onChangeProperty:p}=e,h=(0,l.Z)(),{fileStackKey:g}=(0,c.Z)(),[N,x]=(0,o.useState)(!1),T=(0,i.I0)(),v=(0,m.v)(e=>e.user),_=()=>{x(!0)},I=()=>{N||(t("resume"),a(!1))},C=()=>{a(!0)},S=e=>{let{target:{checked:t}}=e,a={...v.resume};a.permissionToUse=t,p("resume")(a)},j=e=>{let{filesUploaded:t}=e;if(t.length>0){let[{filename:e,key:a,container:r}]=t,o={filename:"",permissionToUse:v.resume.permissionToUse,s3:{keyName:null}};o.filename=e;let i=encodeURIComponent(a).replace("%2F","/");o.s3.keyName="https://s3.amazonaws.com/".concat(r,"/").concat(i),p("resume")(o),x(!1)}},U=e=>(h.error("The user ".concat(v.email," with cognito_id ").concat(v.id,", had a error uploading the resume"),{meta_data:{error:e,...v.getIdentifiers(),step:f.F1.ABOUT}}),(0,d.c0)(u.GT,5e3,"error",T));return(0,r.jsxs)(r.Fragment,{children:[N&&(0,r.jsx)(s.g9,{apikey:g,pickerOptions:{accept:[".pdf","image/*","text/*",".docx",".doc",".odt",".rtf"],storeTo:{access:"private",location:"S3",path:"/".concat(v.id,"/")},fromSources:["local_file_system","googledrive","dropbox","box","url","imagesearch"],concurrency:1,onClose:()=>{x(!N)}},onUploadDone:j,onError:U}),(0,r.jsx)(n.ht,{id:"resume",className:"ta-reggie__input",placeholder:"resume.pdf",cta:"Add resume",label:"Upload your resume or CV",customUploadFile:_,value:v.resume.filename,onBlur:I,onFocus:C}),(0,r.jsx)(n.XZ,{id:"checkbox",className:"ta-reggie__consent-checkbox",checked:v.resume.permissionToUse,onChange:S,label:"I consent to Teach Away receiving this document, storing this information and securely sharing with schools through the Teach Away platform.",value:"interactive",error:v.resume.filename?"Please accept the terms and conditions to proceed":""})]})};t.Z=p},9462:function(e,t,a){a.d(t,{VI:function(){return s},Ym:function(){return n}});var r=a(7294),o=a(6196);let i=e=>{var t,a;let i=(0,r.useMemo)(()=>e.map(e=>null!=e?e:null),[JSON.stringify(e.map(e=>null!=e?e:null))]),n=i.some(Boolean),s=o.S.files.sign.useQuery({urls:i},{enabled:n,refetchInterval:42e4,refetchOnWindowFocus:!1,keepPreviousData:!0});return{signedUrls:null!==(a=null===(t=s.data)||void 0===t?void 0:t.urls)&&void 0!==a?a:i.map(()=>null),isLoading:n&&s.isLoading,isError:s.isError}},n=e=>{var t;let{signedUrls:a,isLoading:r,isError:o}=i([e]);return{signedUrl:null!==(t=a[0])&&void 0!==t?t:null,isLoading:r,isError:o}},s=()=>{let e=o.S.useContext();return(0,r.useCallback)(async t=>{if(!t)return null;try{var a;let r=await e.files.sign.fetch({urls:[t]});return null!==(a=r.urls[0])&&void 0!==a?a:null}catch(e){return console.error("Failed to sign S3 URL",e),null}},[])}},3210:function(e,t,a){a.d(t,{L:function(){return r}});let r="/ta-regi-fe_assets_nextjs/no-profile.svg"}}]);
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.