1"use strict";(self.webpackChunkzerobees=self.webpackChunkzerobees||[]).push([[59],{17821:(e,n,t)=>{t.d(n,{A:()=>l});var a=t(98289),o=t(65043),r=t(87721),s=t(54331);const l=e=>{let{orgId:n="none",periodId:t,isStandalone:l}=e;const{internalSurveyResponses:i,externalSurveyResponses:c,adminSurveyResponses:u}=(0,s.A)({orgId:n,periodId:t,isStandalone:l}),{currentSurvey:d,setRefresh:m,currentVersionIdPath:v}=(0,r.A)({orgId:n,periodId:t,isStandalone:l}),[y,f]=(0,o.useState)("");return(0,o.useEffect)(()=>{if(y)return;if(l)return void f((null===i||void 0===i?void 0:i.orgName)||"");(async()=>{try{var e;const t=await a.A.firestore().collection("organisations").doc(n).get();f(null===(e=t.data())||void 0===e?void 0:e.name)}catch(t){console.log(t)}})()},[i]),{internalSurveyResponses:i,externalSurveyResponses:c,adminSurveyResponses:u,currentSurvey:d,setRefresh:m,respondentName:y,currentVersionIdPath:v}}},33905:(e,n,t)=>{t.d(n,{Bd:()=>c,IA:()=>v,ZP:()=>d,kN:()=>m,qb:()=>u});var a=t(7270),o=t(46475),r=t(68045),s=t(55009),l=t(53536);function i(e){return(null===e||void 0===e?void 0:e.replace(/<[^>]*>?/gm,""))||""}const c=e=>{let{surveyAreas:n,internalSurveyResponses:t,externalSurveyResponses:l,adminSurveyResponses:c}=e;const u=[],d=[];n.forEach((e,n)=>{e.questions.forEach((n,d)=>{var m,v,y,f;const h=(null===t||void 0===t||null===(m=t[e.key])||void 0===m||null===(v=m[n.key])||void 0===v?void 0:v.score)||0,p=(0,s.nc)(null===c||void 0===c||null===(y=c[e.key])||void 0===y||null===(f=y[n.key])||void 0===f?void 0:f.score,h),g=n.weight,b=(0,s.x_)(l,e.key,n.key),w=(0,s.D7)(p,b),S=(0,o.$W)(n)?(0,s.c8)(n):4,x=(0,s.E1)(l,e.key,n.key),k=(0,a.roundNumber)(w/S*100,2),Z={[r.mZ.idx]:d+1+".",[r.mZ.question]:i(n.label),[r.mZ.maxPossibleScore]:S,"weighted-score":+w*g||0,"max-weighted-score":S*g||0,[r.mZ.selfValue]:+h||0,[r.mZ.adminScore]:+p||0,[r.mZ.numExternalAnswers]:x,[r.mZ.externalAverage]:+b||0,[r.mZ.finalScore]:+w||0,[r.mZ.weight]:+g||"",[r.mZ.area]:e.label,type:n.type||"select",percentage:k};u.push(Z)});const m=u.filter(n=>n.area===e.label).reduce((e,n)=>e+(n["weighted-score"]||0),0),v=u.filter(n=>n.area===e.label).reduce((e,n)=>e+(n["max-weighted-score"]||0),0),y=(0,a.roundNumber)(m/v*100,2),f={[r.mZ.idx]:(0,s.A)(n+1),[r.mZ.area]:"Totals",[r.mZ.question]:e.label,"weighted-score":m,"max-weighted-score":v,percentage:y};u.push({}),d.push(f)});const m=u.reduce((e,n)=>e+(n["weighted-score"]||0),0),v=u.reduce((e,n)=>e+(n["max-weighted-score"]||0),0),y=(0,a.roundNumber)(m/v*100,2),f={[r.mZ.area]:"Totals",[r.mZ.question]:"Final","weighted-score":m,"max-weighted-score":v,percentage:y};return u.push({}),u.push(...d),u.push(f),u};function u(e){let{surveyAreas:n,internalSurveyResponses:t,externalSurveyResponses:a,adminSurveyResponses:l}=e;const i=[],c=[];n.forEach((e,n)=>{e.questions.forEach((c,u)=>{var d,m,v,y,f,h,p,g,b,w;const S=void 0!==(null===t||void 0===t||null===(d=t[e.key])||void 0===d||null===(m=d[c.key])||void 0===m?void 0:m.score),x=(null===t||void 0===t||null===(v=t[e.key])||void 0===v||null===(y=v[c.key])||void 0===y?void 0:y.score)||0,k=(null===(f=c.answers.find(e=>e.value==x))||void 0===f?void 0:f.label)||"",Z=void 0!==x&&null!==x?((e,n,t)=>{if(0===+t)return n;let a=n.indexOf("</strong>");-1===a&&(a=n.indexOf("</p>"));const o=n.slice(0,a+9),r=n.slice(a+9),s=1==e?"point":"points";return"".concat(o," <span>(").concat(e," ").concat(s,")</span> ").concat(r)})(x,k,c.weight):"",A=(0,s.E1)(a,e.key,c.key),I=(0,s.nc)(null===l||void 0===l||null===(h=l[e.key])||void 0===h||null===(p=h[c.key])||void 0===p?void 0:p.score,x,c.weight),E=null===l||void 0===l||null===(g=l[e.key])||void 0===g||null===(b=g[c.key])||void 0===b?void 0:b.adminComment,q=(0,s.x_)(a,e.key,c.key),N=(0,s.D7)(I,q),P=(0,s.c8)(c),T=(null===(w=c.answers.find(e=>e.value>N))||void 0===w?void 0:w.label)||"";if(!(0,o.$W)(c)){var V;const a=null===(V=t[e.key])||void 0===V?void 0:V[c.key];let o=(null===a||void 0===a?void 0:a.answer)||"";"date-range"===c.type&&o&&(o="".concat(o.from," - ").concat(o.to));const s={[r.mZ.idx]:u+1+".",[r.mZ.question]:c.label,[r.mZ.maxPossibleScore]:4,[r.mZ.selfValue]:0,[r.mZ.selfScore]:"",[r.mZ.adminScore]:I,[r.mZ.numExternalAnswers]:A,[r.mZ.externalAverage]:0,[r.mZ.finalScore]:N,[r.mZ.weight]:c.weight,[r.mZ.area]:e.label,[r.mZ.nextAnswerLabel]:"",key:c.key,answer:o,adminComment:E,type:c.type,isAnswered:S,_classes:"table-question row-".concat(n)};return void i.push(s)}const C={[r.mZ.idx]:u+1+".",[r.mZ.question]:c.label,[r.mZ.maxPossibleScore]:P,[r.mZ.selfValue]:x,[r.mZ.selfScore]:Z,[r.mZ.adminScore]:I,[r.mZ.numExternalAnswers]:A,[r.mZ.externalAverage]:q,[r.mZ.finalScore]:N,[r.mZ.weight]:c.weight,[r.mZ.area]:e.label,[r.mZ.nextAnswerLabel]:T,key:c.key,adminComment:E,type:"select",isAnswered:S,_classes:"table-question row-".concat(n)};i.push(C)});const{totalScore:u,totalPercentage:d,totalPossibleScore:m}=(0,s.aD)(i,e.label),{totalText:v}=(0,s.PZ)(i,e.label),{totalText:y}=(0,s.J3)(i,e.label),f={[r.mZ.idx]:(0,s.A)(n+1),[r.mZ.question]:e.label,[r.mZ.selfScore]:"",[r.mZ.adminScore]:v,[r.mZ.numExternalAnswers]:"",[r.mZ.externalAverage]:y,[r.mZ.finalScore]:d+"%",[r.mZ.weight]:"",_classes:"table-sector row-".concat(n)},h=i.findIndex(n=>n.area===e.label);-1!==h&&i.splice(h,0,f),c.push({label:e.label,score:u,percentage:d,total:m})});const{totalPercentage:u,totalScore:d,totalPossible:m}=(0,s.aD)(i),v={[r.mZ.idx]:"",[r.mZ.question]:"Total",[r.mZ.selfScore]:(0,s.Iq)(i).totalPercentage+"%",[r.mZ.adminScore]:(0,s.PZ)(i).totalText,[r.mZ.numExternalAnswers]:"",[r.mZ.externalAverage]:(0,s.J3)(i).totalText,[r.mZ.finalScore]:u+"%",[r.mZ.weight]:"",_classes:"table-total"};return i.push(v),{rows:i,areas:c,finalPercentage:u,finalScore:d,totalPossible:m}}function d(e){let{surveyAreas:n}=e;const t=[];
1return null===n||void 0===n||n.forEach((e,n)=>{t.push({idx:(0,s.A)(n+1),question:e.label,weight:"",_classes:"table-sector",edit:""}),e.questions.forEach((e,a)=>{t.push({idx:a+1,question:e.label,weight:e.weight,edit:!0,areaIdx:n,questionIdx:a,questionName:"areas.".concat(n,".questions.").concat(a)})})}),t}function m(e){let{surveyAreas:n,adminSurveyResponses:t}=e;const a=[];return n.forEach(e=>{e.questions.forEach(n=>{var o,r;const s=(null===t||void 0===t||null===(o=t[e.key])||void 0===o||null===(r=o[n.key])||void 0===r?void 0:r.adminComment)||"";a.push({area:(0,l.upperFirst)(e.key),question:i(n.label),adminComment:s})})}),a}function v(e){let{orgId:n,surveyAreas:t,internalSurveyResponses:a,adminSurveyResponses:r,isStandalone:l}=e;const i=[];return t.forEach((e,t)=>{i.push({idx:(0,s.A)(t+1),question:e.label,"self-score":"","admin-score":"n/a",_classes:"table-sector"}),e.questions.forEach((t,c)=>{var u,d,m,v,y,f,h,p,g,b;const w=l?"survey/standalone/".concat(n,"/").concat(e.key,"/").concat(t.key):"survey/".concat(n,"/").concat(e.key,"/").concat(t.key),S=(null===(u=a[e.key])||void 0===u||null===(d=u[t.key])||void 0===d?void 0:d.evidence)||"",x=(null===(m=a[e.key])||void 0===m||null===(v=m[t.key])||void 0===v?void 0:v.score)||0,k=(null===t||void 0===t||null===(y=t.answers)||void 0===y||null===(f=y.find(e=>e.value===+x))||void 0===f?void 0:f.label)||"",Z=void 0!==x&&null!==x?((e,n,t)=>{if(0===+t)return n;let a=n.indexOf("</strong>");-1===a&&(a=n.indexOf("</p>"));const o=n.slice(0,a+9),r=n.slice(a+9),s=1==e?"point":"points";return"".concat(o," <span>(").concat(e," ").concat(s,")</span> ").concat(r)})(x,k,t.weight):"",A=(0,s.nc)(null===r||void 0===r||null===(h=r[e.key])||void 0===h||null===(p=h[t.key])||void 0===p?void 0:p.score),I=null===r||void 0===r||null===(g=r[e.key])||void 0===g||null===(b=g[t.key])||void 0===b?void 0:b.adminComment;let E=0;if(t.answers.forEach(e=>{e.value>E&&(E=e.value)}),!(0,o.$W)(t)){var q;const n=null===(q=a[e.key])||void 0===q?void 0:q[t.key];let o=(null===n||void 0===n?void 0:n.answer)||"";return"date-range"===t.type&&o&&(o="".concat(o.from," - ").concat(o.to)),void i.push({idx:c+1,weight:t.weight,question:t.label,area:e.key,key:t.key,"self-score":0,"admin-score":A,"self-value":0,maxScore:4,evidence:S,storagePath:w,adminComment:I,answer:o,type:t.type})}i.push({idx:c+1,weight:t.weight,question:t.label,area:e.key,key:t.key,"self-score":Z,"admin-score":A,"self-value":x,maxScore:E,evidence:S,adminComment:I,storagePath:w,type:"select"})})}),i.push({idx:"",question:"Total","self-score":(0,s.Iq)(i).totalText,"admin-score":(0,s.PZ)(i).totalText,_classes:"table-total"}),i}},46475:(e,n,t)=>{t.d(n,{$Q:()=>o,$W:()=>r,ZP:()=>a.qb});var a=t(33905);const o=e=>{let{password:n,link:t,orgName:a,supplierName:o,date:r,template:s,firstName:l}=e,i=s;return[[n,"<password>"],[t,"<link>"],[a,"<orgName>"],[o,"<supplierName>"],[r,"<date>"],[l,"<firstName>"]].filter(e=>void 0!==e[0]).forEach(e=>i=i.replaceAll(e[1],e[0])),i},r=e=>!e.type||"select"===e.type},53081:(e,n,t)=>{t.d(n,{A:()=>r});var a=t(40517),o=t(46475);const r=()=>{const{sendBasicEmail:e}=(0,a.Eb)(),{updateDocument:n}=(0,a.u_)();return{sendEsgEmail:async t=>{let{respondentId:a,orgName:r,firstName:s,email:l,type:i}=t;const c="".concat("https://esg-zerobees.netlify.app","/#/results/").concat(a),u="result"===i?"Dear <firstName>,\n\nThank you for completing the Business Impact Survey for <orgName>.\n\nYour can view your results here: <link>\n\nThank you,\n\nZeroBees Team\n":"Dear <firstName>,\n\nThank you for completing the Business Impact Survey for <orgName>.\n\nAdmin has reviewed your results based on the information you have provided.\n\nYour can view your results here: <link>\n\nThank you,\n\nZeroBees Team\n",d=(0,o.$Q)({template:u,orgName:r,link:c,firstName:s});try{await e({email:l,subject:"ZeroBees | Your Business Impact Survey Results",text:d}),await n(["esg-survey",a,"entries","self"],{resultEmailSent:!0})}catch(m){console.log(m)}},sendEsgContactEmail:async n=>{const{name:t,email:a,organisation:o,message:r}=n,s={email:"[email protected]",subject:"BIT Self Assessment Next Steps",text:"Name: ".concat(t,"\nOrganisation: ").concat(o,"\nEmail: ").concat(a,"\n\n").concat(r)};try{await e(s)}catch(l){console.log(l)}}
1,sendEsgSubmittedForValidationEmail:async t=>{let{name:a,email:o,respondentId:r}=t;const s="Dear <firstName>,\n\nThank you for submitting your ESG assessment for validation through the Business Impact Tracker from ZeroBees.\n\nOnce your payment is confirmed, we'll let you know who your analyst is.\n\nHere\u2019s what happens now:\n\nWe'll assign you an analyst within 3 working days, and they'll be in touch within the next 3 weeks to ask for clarifications or further evidence - by email and potentially scheduling a call where needed. Please feel free to request a call once you have the details of your analyst if you need further support.\nYour analyst will assess your evidence and proposed score against our framework. We\u2019ll be looking to discuss with you where your evidence may be insufficient or even where you may score better than you proposed. You'll have an opportunity to submit further evidence or discuss the question further with the analyst. You can escalate issues with ZeroBees upon request, but the decision of the escalation manager is final.\nExpect verification to take between 3 weeks and 3 months from submission. The cut-off for additional evidence if 3 months post submission, at which point your score will become finalised. This time to verification will depend on how complete your evidence base is, as well as the number of organisations going through accreditation at the time.\nOnce verification of your score is complete, your score will be ready for disclosure.\n\nBest regards,\n\nZeroBees Team\n".replace("<firstName>",a);try{await e({email:o,subject:"BIT Self Assessment Submitted for Validation",text:s}),await n(["esg-survey",r],{validationEmailSent:!0})}catch(l){console.log(l)}}}}},54331:(e,n,t)=>{t.d(n,{A:()=>o});var a=t(335);const o=e=>{let n,{orgId:t="none",periodId:o="none",isStandalone:r}=e;n=r?["esg-survey",t,"entries"]:["organisations",t,"periods",o,"details","assessment-survey","entries"];const{data:s=[],status:l}=(0,a.useCollection)(n),i=s.filter(e=>"self"!==e.id&&"admin"!==e.id),c=s.find(e=>"self"===e.id)||{},u=s.find(e=>"admin"===e.id)||{};return{totalSurveyResponses:s.length,externalSurveyResponses:i,internalSurveyResponses:c,adminSurveyResponses:u,status:l}}},55009:(e,n,t)=>{t.d(n,{A:()=>p,D7:()=>i,E1:()=>r,Iq:()=>v,J3:()=>f,PZ:()=>y,aD:()=>h,c8:()=>c,nc:()=>s,x_:()=>l});var a=t(7270),o=t(68045);function r(e,n,t){return e.filter(e=>{var a,o;return null===(a=e[n])||void 0===a||null===(o=a[t])||void 0===o?void 0:o.score}).length}function s(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"n/a";return 0===+(arguments.length>2?arguments[2]:void 0)?0:isNaN(e)?n:+e}function l(e,n,t){const o=e.filter(e=>{var a,o,r,s;return(null===(a=e[n])||void 0===a||null===(o=a[t])||void 0===o?void 0:o.score)&&"n/a"!==(null===(r=e[n])||void 0===r||null===(s=r[t])||void 0===s?void 0:s.score)}),r=o.length;if(!r)return"n/a";if(r<4){const e=o.reduce((e,a)=>{var o,r;return e+(+(null===(o=a[n])||void 0===o||null===(r=o[t])||void 0===r?void 0:r.score)||0)},0);return(0,a.roundNumber)(e/r,2)}{const e=o.map(e=>{var a,o;return+(null===(a=e[n])||void 0===a||null===(o=a[t])||void 0===o?void 0:o.score)}).sort((e,n)=>e-n),r=Math.floor(e.length/2),s=[e[r-1],e[r],e[r+1]];return(0,a.roundNumber)(s.reduce((e,n)=>e+n,0)/3,2)}}function i(e,n){return"n/a"===n||n>=e?e:(0,a.roundNumber)((+e+ +n)/2,2)}function c(e){let n=0;return e.answers.forEach(e=>{e.value>n&&(n=e.value)}),n}const u=e=>e.filter(e=>{var n,t;return!(null!==(n=e._classes)&&void 0!==n&&n.includes("table-sector"))&&!(null!==(t=e._classes)&&void 0!==t&&t.includes("table-total"))}),d=e=>e.reduce((e,n)=>e+ +n.weight*(n.maxScore||0),0);function m(e,n,t){let r=null;switch(t){case"self":r=e=>+e[o.mZ.selfValue]||0;break;case"admin":r=e=>e[o.mZ.adminScore]&&!isNaN(+e[o.mZ.adminScore])?+e[o.mZ.adminScore]:0===e[o.mZ.adminScore]?0:e[o.mZ.selfValue]&&!isNaN(+e[o.mZ.selfValue])?+e[o.mZ.selfValue]:0;break;case"external":r=e=>+e["external-average"];break;case"final":r=e=>+e["final-score"]}let s=e;n&&(s=e.filter(e=>e.area===n));const l=u(s),i=l.map(e=>r(e)*e[o.mZ.weight]),c=d(l),m=(0,a.roundNumber)(i.reduce((e,n)=>e+(+n||0),0),2),v=Math.round(m/c*100);return{totalText:"".concat(m," / ").concat(c," = ").concat(v,"%"),totalPercentage:v,totalScore:m,totalPossible:c}}function v(e,n){return m(e,n,"self")}function y(e,n){return m(e,n,"admin")}function f(e,n){return m(e,n,"external")}function h(e,n){return m(e,n,"final")}function p(e){switch(e){case 1:return"I";case 2:return"II";case 3:return"III";case 4:return"IV";case 5:return"V";case 6:return"VI";case 7:return"VII";case 8:return"VIII";case 9:return"IX";case 10:return"X";default:return""}}},68045:(e,n,t)=>{t.d(n,{p9:()=>r,Op:()=>s,mZ:()=>o,lf:()=>a.lf,fP:()=>a.fP,My:()=>a.My});var a=t(78193);const o={idx:"idx",question:"question",maxPossibleScore:"maxScore",selfValue:"self-value",selfScore:"self-score",adminScore:"admin-score",numExternalAnswers:"external-answers",externalAverage:"external-average",finalScore:"final-score",next:"next",weight:"weight",area:"area",
1nextAnswerLabel:"nextAnswerLabel"},r=(o.idx,o.question,o.selfScore,o.finalScore,o.next,o.idx,o.question,o.selfScore,o.finalScore,o.idx,o.question,o.numExternalAnswers,o.externalAverage,[{key:[o.idx],label:""},o.question,o.weight,"edit"]),s=[{key:[o.idx],label:""},o.question,{key:o.selfScore,label:"User answer"},{key:o.adminScore,label:"Admin score"}]},77059:(e,n,t)=>{t.d(n,{_G:()=>a.A,c9:()=>o.A,wI:()=>r.A,T0:()=>u,O7:()=>h});var a=t(53081),o=t(87721),r=t(54331),s=(t(17821),t(89379)),l=t(40624),i=t(64739),c=t(40517);const u=()=>{const{setOrUpdateDocument:e,addDocumentToCollection:n}=(0,c.u_)();return{updateSurveyVersion:async function(n){let{data:t,currentVersionId:a}=n;await e([...i.DB_PATHS.globalSurveyVersions,a],t)},addNewVersion:async function(t){let{currentVersionId:a,orgId:o,metadata:r,currentVersionIdPath:c}=t;const u=(await(0,l.or)([...i.DB_PATHS.globalSurveyVersions,a]).get()).data(),{label:d,description:m}=r,v=await n(i.DB_PATHS.globalSurveyVersions,(0,s.A)((0,s.A)({},u),{},{org:o,createdAt:Date.now(),label:d||"",description:m||""}));"global"===o?await e(i.DB_PATHS.globalSurvey,{currentGlobalVersion:v}):await e(c,{currentVersion:v})}}};var d=t(73012),m=t(335),v=t(46475);t(80057);var y=t(14556),f=t(76145);const h=e=>{let{surveyAreas:n,respondentId:t}=e;const{createGetStepsFn:a}=(()=>{const{isRequired:e,isNonNull:n}=(0,c.$i)();return{createGetStepsFn:(n,t)=>{if(null!==n&&void 0!==n&&n.length)return t=>Object.fromEntries(n.map((n,t)=>[t+1,n.questions.filter(e=>(0,v.$W)(e)).map(t=>({name:"".concat(n.key,".").concat(t.key,".score"),options:e}))||[]]))}}})(),o=["esg-survey",t,"entries","self"],{status:r,data:l}=(0,m.useDoc)(o),i=a(n,(0,y.d4)(f.k7)),u=(0,c.AB)({pathArr:o,dataDB:l,canAdvanceEmpty:!1,getFieldsObject:e=>(null===i||void 0===i?void 0:i(e))||[]}),{prev:h,current:p,next:g,hasNext:b}=(0,d.fS)(),{updateDocument:w}=(0,c.u_)(),{formMethods:S,onFormSubmit:x}=u||{},{getValues:k}=S||{};return(0,s.A)((0,s.A)({},u),{},{nextClickHandler:async e=>{if(await x(e)&&b){(k("highest-completed")||0)<p&&w(["esg-survey",t,"entries","self"],{"highest-completed":p}),g(e)}},prevClickHandler:h,status:r})}},78193:(e,n,t)=>{t.d(n,{My:()=>r,fP:()=>o,lf:()=>s});var a=t(47976);const o=[{label:"Community Interest Company (CIC)",value:"cic"},{label:"Cooperative",value:"cooperative"},{label:"Charitable Incorporated Organisation",value:"charitable"},{label:"Sole Trader/partnership",value:"soleTrader"},{label:"Limited Company",value:"limitedCompany"},{label:"Limited Company with specific changes to Articles of Association to include society and environment as stakeholders (i.e. B-Corp)",value:"bCorp"},{label:"Other",value:"other"}],r=[{label:"None",value:"none"},{label:"Single",value:"single"},{label:"Double",value:"double"}],s=[{label:"What's your organisation called?",name:"orgName",placeholder:"Enter organisation name"},{label:"What period are you assessing your organisation for?",name:"reportingPeriod",placeholder:"Select reporting period",info:"This should reflect the most recent calendar or financial year for example, and be a period of time that you can evidence your environmental, social and governance impacts and interventions over."},{label:"What's your company number?",name:"companyNumber",placeholder:"Enter company number"},{label:"What country is your organisation registered in?",name:"country",placeholder:"Select country",options:a.A},{label:"What's your organisation's web address?",name:"website",placeholder:"Enter website"},{label:"What's your contact email address?",name:"email",placeholder:"Enter email"},{label:"What was your most recent materiality assessment?",name:"materialityAssessment",placeholder:"Select materiality assessment",options:r,info:"A materiality assessment is a formal exercise aimed at engaging external stakeholders to find out how important Environmental, Social and Governance (ESG) issues are to them."},{label:"What is your organisation's legal structure?",name:"legalStructure",placeholder:"Select legal structure",options:o}]},87721:(e,n,t)=>{t.d(n,{A:()=>l});var a=t(65043),o=t(40624),r=t(64739),s=t(92597);const l=e=>{let n,{orgId:t,periodId:l,isStandalone:i}=e;n=i?["esg-survey",t]:[...r.DB_PATHS.assessmentSurvey.join("/").replace("ORG_ID",t).replace("PERIOD_ID",l).split("/")];const[c,u]=(0,a.useState)(null);(0,a.useEffect)(()=>
1{if(!t||"none"===t)return;const e=s.Ay.firestore().collection("esg-survey").doc(t).onSnapshot(e=>{const n=e.data();u(null===n||void 0===n?void 0:n.currentVersion)});return()=>{e&&e()}},[t]);const[d,m]=(0,a.useState)(0),[v,y]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!t||"none"===t)return;if(!c)return;let e;return(async()=>{try{const n=(0,o.or)(["global","esg-survey","questions",c]);e=n.onSnapshot(e=>{const n=e.data();null!==n&&void 0!==n&&n.areas&&y(n)})}catch(n){console.log(n)}})(),()=>{e&&e()}},[t,d,c]),{currentSurvey:v,setRefresh:m,currentVersionIdPath:n}}}}]); 2//# sourceMappingURL=59.3a8e4b0d.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.