1"use strict";(self.webpackChunkzerobees=self.webpackChunkzerobees||[]).push([[440,916],{18916:(e,s,a)=>{a.r(s),a.d(s,{default:()=>j});var t=a(32542),n=a(84411),o=a(53536),r=a(65043),i=a(24858),l=a(14556),c=a(35323),m=a(97939),u=a(97864),d=a(40517),p=a(335),h=a(76145),x=a(18762),f=a(68045),g=a(70579);const b=e=>{let{onChange:s,values:a,errors:t}=e;return(0,g.jsx)(g.Fragment,{children:f.lf.map((e,n)=>(0,g.jsxs)("div",{className:"mb-5 w-100",children:[(0,g.jsxs)("div",{className:"d-flex align-items-baseline",children:[(0,g.jsx)("span",{style:{fontSize:"20px"},className:"mr-2",children:n+1+". "}),(0,g.jsxs)("p",{className:"text-left",style:{fontSize:"20px"},children:[e.label," ",e.info&&(0,g.jsx)(m.InfoTooltip,{content:e.info})]})]}),"reportingPeriod"===e.name?(0,g.jsx)(x.A,{onChange:s,data:a,errors:t}):e.options?(0,g.jsx)(m.BasicSelect,{options:e.options,name:e.name,onChange:s,defaultValue:a[e.name],required:!0,placeholder:e.placeholder}):(0,g.jsx)(m.BasicInput,{name:e.name,onChange:s,defaultValue:a[e.name],placeholder:e.placeholder}),t[e.name]&&(0,g.jsx)(m.ErrorText,{className:"text-left",value:t[e.name]})]},n))})},j=e=>{let{isOnboarding:s=!1}=e;const a=(0,l.d4)(h.UT)||"none",x=(0,i.mN)(),f=["esg-survey",a],{data:j}=(0,p.useDoc)(f),{updateDocument:y}=(0,d.u_)();(0,r.useEffect)(()=>{j&&x.reset(j)},[j]);const{showToast:v}=(0,d.Yf)(),S=(0,c.W6)(),{formState:{errors:N,isSubmitting:C,touchedFields:w}}=x,k=Object.keys(w||{}).length>0,{isEmail:z,isRequired:T,isUrl:B}=(0,d.$i)(),E=[{name:"orgName",options:T},{name:"periodFrom",options:T},{name:"periodTo",options:T},{name:"companyNumber",options:T},{name:"country",options:T},{name:"materialityAssessment",options:T},{name:"legalStructure",options:T},{name:"email",options:(0,o.merge)({},T,z)},{name:"website",options:(0,o.merge)({},T,B)}];return(0,r.useEffect)(()=>{E.forEach(e=>{x.register(e.name,e.options)})}),(0,g.jsxs)(u.xU,{children:[(0,g.jsxs)(n.CForm,{className:"w-100",onSubmit:x.handleSubmit(async e=>{try{await y(f,e),v({text:"Your data has been saved",type:"success"}),S.push("/survey")}catch(s){console.log(s),v({text:"There was an error saving your data",type:"error"})}}),noValidate:!0,children:[(0,g.jsx)("p",{style:{fontSize:"28px"},className:"font-bold text-center text-info mb-4",children:"About you"}),j?(0,g.jsx)(b,{onChange:e=>x.setValue(e.target.name,e.target.value,{shouldTouch:!0}),values:j,errors:N}):(0,g.jsx)(m.LoadingSpinner,{}),(0,g.jsx)(m.ButtonBasic,{size:"lg",disabled:!k||C,type:"submit",children:C?"Saving...":"Save & Continue"})]}),!s&&(0,g.jsxs)(m.ButtonGhost,{className:"align-self-start d-flex align-items-center summary-btn coreData-intro-back-button",onClick:()=>{S.push("/survey")},children:[(0,g.jsx)(t.Ay,{name:"cil-arrow-left"}),(0,g.jsx)("span",{className:"ml-2",style:{fontSize:"14px"},children:"Back"})]})]})}},61440:(e,s,a)=>{a.r(s),a.d(s,{default:()=>o});a(65043);var t=a(18916),n=a(70579);const o=()=>(0,n.jsx)(t.default,{isOnboarding:!0})}}]); 2//# sourceMappingURL=440.03dc9a13.chunk.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.