1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bbd2b087-bf7f-480d-97a9-d2b2ab61a459",e._sentryDebugIdIdentifier="sentry-dbid-bbd2b087-bf7f-480d-97a9-d2b2ab61a459")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4127],{882:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/hr/[tenant]/performance/reviews/[rpid]",function(){return n(88109)}])},79337:function(e,t,n){"use strict";var r=n(52322),s=n(55351),i=n(45847),a=n.n(i),o=n(13980),l=n.n(o);let c=e=>{let{title:t="The leading job board for the modern workforce.",description:n="The #1 job board for the modern workforce.",canonical:i="https://www.elevolt.co.ke/",page:o="",thirdParty:l=!0,children:c}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.PB,{canonical:i+o,description:"".concat(n," | Elevolt"),facebook:{appId:"346824926505117"},openGraph:{type:"website",url:i+o,title:"".concat(t," | Elevolt"),description:"".concat(n," | Elevolt"),images:[{url:"https://www.elevolt.co.ke/elevolt-og.png",width:1600,height:800,alt:"Elevolt"}],site_name:"Elevolt"},title:"".concat(t," | Elevolt"),twitter:{handle:"@ElevoltK",site:"@ElevoltK",cardType:"summary_large_image"}}),!!l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a(),{id:"hs-script-loader",src:"//js-eu1.hs-scripts.com/25842252.js",strategy:"lazyOnload"}),(0,r.jsx)(a(),{dangerouslySetInnerHTML:{__html:"(function(h,o,t,j,a,r){\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n h._hjSettings={hjid:2328489,hjsv:6};\n a=o.getElementsByTagName('head')[0];\n r=o.createElement('script');r.async=1;\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n a.appendChild(r);\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');"},id:"hotjar",strategy:"lazyOnload"}),(0,r.jsx)(a(),{dangerouslySetInnerHTML:{__html:"!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n fbq('init', '583365066890254');\n fbq('track', 'PageView');"},id:"meta",strategy:"lazyOnload"}),(0,r.jsx)("noscript",{children:(0,r.jsx)("img",{height:"1",src:"https://www.facebook.com/tr?id=583365066890254&ev=PageView&noscript=1",style:{display:"none"},width:"1"})})]}),c]})};c.propTypes={title:l().string,description:l().string,canonical:l().string,page:l().string,thirdParty:l().bool,children:l().node},t.Z=c},88109:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return e6}});var r=n(52322),s=n(57989),i=n(65232),a=n(1973),o=n(77590),l=n(30900),c=n(20270),d=n(61231),u=n(23627),h=n(75588),m=n(84475),p=n(88393),f=n(5632),v=n(13980),g=n.n(v),b=n(2784),y=n(79337),x=n(17047),w=n(76467),E=n(59417),j=n(99603),N=n(25237),_=n.n(N),C=n(28316),R=n(62202),k=n(95432),S=n(19613),O=n(12524),I=n.n(O),A=n(32128);let D=[1,2,3,4,5],q=e=>Array.isArray(e)&&e.length===D.length&&e.every(e=>"string"==typeof e&&e.trim().length>0),T=e=>{let{name:t,value:n=null,onChange:s,labels:i,label:a,description:o,error:l,cannotAssess:c=!1,onCannotAssessChange:d,allowCannotAssess:u=!0,cannotAssessLabel:h="Cannot assess",required:m=!1,disabled:p=!1,className:f,ariaDescribedBy:v,ariaLabelledBy:g}=e,y=(0,b.useId)(),x=a?"".concat(y,"-label"):void 0,E=[g,x].filter(Boolean).join(" ")||void 0,j=o?"".concat(y,"-description"):void 0,N=l?"".concat(y,"-error"):void 0,_="".concat(y,"-").concat(t),C=[v,j,N].filter(Boolean).join(" ")||void 0,R=(0,b.useCallback)(e=>{p||(c&&d(!1),s(e))},[p,c,d,s]),k=(0,b.useRef)(null),S=c&&!p,O=(0,b.useCallback)((e,t)=>{var n,r;if(p)return;let s=null;switch(e.key){case"ArrowLeft":case"ArrowUp":s=t>0?t-1:D.length-1;break;case"ArrowRight":case"ArrowDown":s=t<D.length-1?t+1:0;break;case"Home":s=0;break;case"End":s=D.length-1;break;default:return}e.preventDefault(),R(D[s]);let i=null===(n=k.current)||void 0===n?void 0:n.querySelectorAll('input[type="radio"]');null==i||null===(r=i[s])||void 0===r||r.focus()},[p,R]),T=(0,b.useCallback)(e=>{p||d(e.target.checked)},[p,d]);if(!q(i))throw Error("RatingInput requires a `labels` prop: an array of exactly 5 non-empty strings, one anchor per rating point (1-5) â every scale point must "+"be anchored per FR-3.4. Received ".concat(JSON.stringify(i),"."));if("function"!=typeof s)throw Error("RatingInput requires an `onChange` function: every one of the 5 "+"rating options is a live radio that calls it on selection. Received ".concat(JSON.stringify(s),"."));if((u||!0===c)&&"function"!=typeof d)throw Error("RatingInput requires an `onCannotAssessChange` function whenever the cannot-assess control is reachable â either `allowCannotAssess` is on (the checkbox renders and calls it on toggle) or `cannotAssess` is already true (selecting a rating clears it through the same handler). "+"Received ".concat(JSON.stringify(d),"."));return(0,r.jsxs)("div",{className:I()("flex flex-col gap-2",f),children:[!!a&&(0,r.jsxs)(w.Z,{as:"span",id:x,variant:"label",children:[a,!!m&&(0,r.jsx)("span",{"aria-hidden":"true",className:"text-red-400 text-xs ml-1",children:"*"})]}),(0,r.jsx)("div",{"aria-describedby":C,"aria-invalid":!!l||void 0,"aria-labelledby":E,"aria-required":m||void 0,className:"flex flex-wrap gap-2",ref:k,role:"radiogroup",children:D.map((e,t)=>
1{let s="".concat(y,"-option-").concat(e),a=n===e,o=D.includes(n)?a:0===t;return(0,r.jsxs)("label",{className:I()("flex min-h-[44px] flex-1 basis-24 items-center gap-2 rounded border px-3 py-2 transition-colors duration-150","focus-within:ring-2 focus-within:ring-blue-dark focus-within:ring-offset-1",a?"border-blue bg-blue-50 font-medium":"border-gray-200 bg-white",!p&&!S&&!a&&"hover:border-blue-200",p&&"cursor-not-allowed opacity-50",S&&"cursor-pointer opacity-60",!p&&!S&&"cursor-pointer"),htmlFor:s,children:[(0,r.jsx)("input",{checked:a,className:"form-radio h-4 w-4 text-blue focus:ring-blue-300",disabled:p,id:s,name:_,onChange:()=>R(e),onKeyDown:e=>O(e,t),tabIndex:o?0:-1,type:"radio",value:e}),(0,r.jsxs)(w.Z,{as:"span",variant:"bodySmall",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"text-gray-500 mr-1",children:e}),i[t]]})]},e)})}),!!o&&(0,r.jsx)(w.Z,{as:"span",color:"text-gray-500",id:j,variant:"caption",children:o}),!!l&&(0,r.jsx)(w.Z,{as:"span",color:"text-red-400",id:N,variant:"caption",children:l}),!!u&&(0,r.jsx)(A.J,{checked:c,disabled:p,label:h,name:"".concat(y,"-cannot-assess"),onChange:T})]})};T.propTypes={name:g().string.isRequired,value:g().oneOf([...D,null]),onChange:g().func.isRequired,labels:(e,t,n)=>{let r=e[t];return q(r)?null:Error("Invalid prop `".concat(t,"` supplied to `").concat(n,"`. Expected an ")+"array of exactly ".concat(D.length," non-empty strings (one anchor label ")+"per rating point). Received ".concat(JSON.stringify(r),"."))},label:g().string,description:g().string,error:g().string,cannotAssess:g().bool,onCannotAssessChange:(e,t,n)=>(!1!==e.allowCannotAssess||!0===e.cannotAssess)&&"function"!=typeof e[t]?Error("Invalid prop `".concat(t,"` supplied to `").concat(n,"`. It is required ")+"whenever the cannot-assess control is reachable (`allowCannotAssess` is not "+"false, or `cannotAssess` is true). Received ".concat(JSON.stringify(e[t]),".")):null,allowCannotAssess:g().bool,cannotAssessLabel:g().string,required:g().bool,disabled:g().bool,className:g().string,ariaDescribedBy:g().string,ariaLabelledBy:g().string};let L=Object.freeze({RATING:"rating",TEXT:"text",MULTIPLE_CHOICE:"multiple_choice",YES_NO:"yes_no"}),P=Object.freeze([{value:"yes",label:"Yes"},{value:"no",label:"No"}]),Z="A comment is required when you give this rating.",W="answers.",M=Object.freeze({INVALID_ANCHORS:"invalid_anchors",MISSING_OPTIONS:"missing_options",UNKNOWN_TYPE:"unknown_type"}),U=e=>null==e,F=e=>U(e)||0===String(e).trim().length,B=(e,t)=>{var n,r,s;return{rcqid:e,rating_value:null!==(n=null==t?void 0:t.rating_value)&&void 0!==n?n:null,cannot_assess:(null==t?void 0:t.cannot_assess)===!0,text_value:null!==(r=null==t?void 0:t.text_value)&&void 0!==r?r:null,choice_value:null!==(s=null==t?void 0:t.choice_value)&&void 0!==s?s:null}},Y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,d.z8)(t);return e.reduce((e,t)=>(null==t?void 0:t.rcqid)?{...e,[t.rcqid]:B(t.rcqid,n.get(t.rcqid))}:e,{})},V=(e,t)=>Object.prototype.hasOwnProperty.call(null!=e?e:{},t)?e[t]:null,G=e=>{switch(null==e?void 0:e.type){case L.RATING:return q(e.rating_anchors)?null:M.INVALID_ANCHORS;case L.TEXT:return null;case L.MULTIPLE_CHOICE:return Array.isArray(e.options)&&e.options.length>0?null:M.MISSING_OPTIONS;case L.YES_NO:return null;default:return M.UNKNOWN_TYPE}},z=(e,t)=>{if(!t)return!0;if(!0===t.cannot_assess)return!1;switch(null==e?void 0:e.type){case L.RATING:return U(t.rating_value);case L.TEXT:return U(t.text_value);case L.MULTIPLE_CHOICE:case L.YES_NO:return U(t.choice_value);default:return!0}},H=(e,t)=>"number"==typeof e&&(e===(null==t?void 0:t.extreme_low)||e===(null==t?void 0:t.extreme_high)),K=e=>(null==e?void 0:e.points)===5&&"number"==typeof(null==e?void 0:e.extreme_low)&&"number"==typeof(null==e?void 0:e.extreme_high),X=(e,t)=>Math.min(Number.isInteger(null==e?void 0:e.max_length)&&e.max_length>0?e.max_length:1/0,Number.isInteger(t)&&t>0?t:2e3),J=(e,t)=>(null==e?void 0:e.type)===L.TEXT||(null==e?void 0:e.type)===L.RATING?null==t?void 0:t.text_value:null,Q=e=>"unidentified-question-".concat(e),$=e=>{let{questions:t=[],answers:n={},ratingScale:r,textAnswerMaxLength:s}=e,i=Object.create(null),a=[];return t.forEach((e,t)=>{let{rcqid:o}=null!=e?e:{};if(!o){(null==e?void 0:e.is_required)&&a.push(Q(t));return}let l=V(n,o);if(G(e)){e.is_required&&a.push(o);return}if(e.is_required&&z(e,l)){i[o]="This question is required.",a.push(o);return}if(e.type===L.RATING&&l&&H(l.rating_value,r)&&F(l.text_value)){i[o]=Z,a.push(o);return}(0,S.tP)(J(e,l),X(e,s))&&a.push(o)}),{errorsByRcqid:i,blockingRcqids:a}},ee=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Set(t.map(e=>null==e?void 0:e.rcqid)),r=Object.create(null),s=[];return Object.entries(null!=e?e:{}
1).forEach(e=>{let[t,i]=e;if("string"==typeof i&&0!==i.length){if(t.startsWith(W)){let e=t.slice(W.length);if(n.has(e)){r[e]=i;return}}s.push(i)}}),{byRcqid:r,formLevel:s}},et=e=>{let{questions:t=[],answers:n={}}=e,r=t.filter(e=>!!(null==e?void 0:e.rcqid)),s=r.filter(e=>!z(e,V(n,e.rcqid))).length,i=r.filter(e=>{var t;return(null===(t=V(n,e.rcqid))||void 0===t?void 0:t.cannot_assess)===!0}).length;return{percent_complete:0===r.length?0:Math.round(s/r.length*100),cannot_assess_count:i}};var en=n(31515);let er=Object.freeze({IDLE:"idle",PENDING:"pending",SAVING:"saving",SAVED:"saved",UNSAVED:"unsaved",BLOCKED:"blocked"}),es=Object.freeze({SAVED:"saved",QUEUED:"queued",FAILED:"failed",BLOCKED:"blocked",IDLE:"idle"}),ei=(e,t)=>{try{(0,p.N2)(e,"useAutosaveDraft",t)}catch(e){}},ea=new Set([er.PENDING,er.SAVING,er.UNSAVED]),eo=e=>{let{rpid:t,getAnswers:n,enabled:r=!0,onSaved:s}=e,[i,a]=(0,b.useState)(er.IDLE),[o,l]=(0,b.useState)(null),c=(0,b.useRef)(new Map),u=(0,b.useRef)(0),h=(0,b.useRef)(0),m=(0,b.useRef)(null),p=(0,b.useRef)(!1),f=(0,b.useRef)(!1),v=(0,b.useRef)(!1),g=(0,b.useRef)(!1),y=(0,b.useRef)(!1),x=(0,b.useRef)(null),w=(0,b.useRef)([]),E=(0,b.useRef)(n),j=(0,b.useRef)(s),N=(0,b.useRef)(r),_=(0,b.useRef)(t);(0,b.useEffect)(()=>{E.current=n,j.current=s,N.current=r,_.current=t});let C=(0,d.hx)(),R=(0,b.useRef)(C.mutateAsync);(0,b.useEffect)(()=>{R.current=C.mutateAsync});let k=(0,b.useCallback)(()=>{null!==m.current&&(clearTimeout(m.current),m.current=null)},[]),S=(0,b.useCallback)(()=>{let e=w.current;return w.current=[],e},[]),O=(0,b.useCallback)(()=>{var e,t;return Promise.resolve(null!==(t=null===(e=x.current)||void 0===e?void 0:e.call(x))&&void 0!==t?t:es.IDLE).catch(e=>(ei(e,{phase:"run"}),es.FAILED))},[]),I=(0,b.useCallback)(()=>{k(),m.current=setTimeout(()=>{m.current=null,O()},1200)},[k,O]),A=(0,b.useCallback)(()=>{try{var e;null===(e=j.current)||void 0===e||e.call(j)}catch(e){ei(e,{phase:"on_saved"})}},[]),D=(0,b.useCallback)(async()=>{if(g.current)return es.SAVED;if(v.current)return es.BLOCKED;if(!N.current)return es.IDLE;if(0===c.current.size)return y.current?es.FAILED:es.SAVED;if(p.current)return f.current=!0,new Promise(e=>{w.current.push(e)});let e=h.current;p.current=!0;let t="build_payload";try{var n;let r=new Map(c.current),s=null!==(n=E.current(Array.from(r.keys())))&&void 0!==n?n:[],i=new Map(s.map(e=>[null==e?void 0:e.rcqid,r.get(null==e?void 0:e.rcqid)]).filter(e=>{let[,t]=e;return void 0!==t}));if(0===i.size)return y.current=!0,a(er.UNSAVED),es.FAILED;if(t="request",a(er.SAVING),await R.current({rpid:_.current,answers:s}),t="commit",h.current!==e)return es.IDLE;y.current=!1,i.forEach((e,t)=>{c.current.get(t)===e&&c.current.delete(t)}),l(Date.now());let o=c.current.size>0;return a(o?er.PENDING:er.SAVED),A(),o?es.QUEUED:es.SAVED}catch(n){if(ei(n,{phase:t,dirtyCount:c.current.size}),h.current!==e)return es.IDLE;if(y.current=!0,d.Cz.has((0,d.AN)(n).reason))return v.current=!0,k(),a(er.BLOCKED),es.BLOCKED;return a(er.UNSAVED),es.FAILED}finally{if(h.current===e){p.current=!1;let e=f.current;if(f.current=!1,e){let e=S();(v.current||y.current?Promise.resolve(v.current?es.BLOCKED:es.FAILED):O()).then(t=>{e.forEach(e=>e(t))})}else v.current||y.current||!(c.current.size>0)||null!==m.current||I()}}},[k,A,O,I,S]);(0,b.useEffect)(()=>{x.current=D},[D]);let q=(0,b.useCallback)(function(e){let{immediate:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!g.current&&!v.current&&N.current){if(!e){ei(Error("queueSave called without an rcqid"),{phase:"queue"});return}if(u.current+=1,c.current.set(e,u.current),a(y.current?er.UNSAVED:er.PENDING),t){k(),O();return}I()}},[k,O,I]),T=(0,b.useCallback)(()=>(k(),O()),[k,O]),L=(0,b.useCallback)(()=>{g.current=!0,k(),h.current+=1,c.current=new Map,y.current=!1,S().forEac
1h(e=>e(es.SAVED)),a(er.SAVED),l(Date.now())},[k,S]),P=(0,b.useCallback)(()=>{v.current=!0,k(),h.current+=1,S().forEach(e=>e(es.BLOCKED)),a(er.IDLE)},[k,S]);return(0,b.useEffect)(()=>{k(),h.current+=1,c.current=new Map,p.current=!1,f.current=!1,v.current=!1,g.current=!1,y.current=!1,S().forEach(e=>e(es.IDLE)),a(er.IDLE),l(null)},[t,k,S]),(0,b.useEffect)(()=>{if(!ea.has(i))return;let e=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[i]),(0,b.useEffect)(()=>()=>{k(),0!==c.current.size&&O()},[k,O]),{status:i,savedAt:o,queueSave:q,flush:T,markFinal:L,markAbandoned:P}},el=new Map([[er.PENDING,{sentence:"Unsaved changes",tone:"muted",icon:E.IwR}],[er.SAVING,{sentence:"Savingâ¦",tone:"muted",icon:E.LM3}],[er.SAVED,{sentence:"Saved",tone:"success",icon:E.fV7}],[er.UNSAVED,{sentence:"Not saved",description:"Your latest changes have not been saved. Select Save draft to try again.",tone:"error",icon:E.xHz}],[er.BLOCKED,{sentence:"Saving stopped",description:"This review can no longer be saved. Reload the page to see its current status.",tone:"error",icon:E.ik8}]]),ec={muted:"text-gray-500",success:"text-green-600",error:"text-red"},ed=e=>{var t;let{status:n,savedAt:s,isLive:i=!0,isReviewGone:a=!1}=e,[,o]=(0,b.useState)(0),l=n===er.SAVED&&!!s;(0,b.useEffect)(()=>{if(!l)return;let e=setInterval(()=>o(e=>e+1),6e4);return()=>clearInterval(e)},[l]);let c=el.get(n),d=ec[null!==(t=null==c?void 0:c.tone)&&void 0!==t?t:"muted"],u=!!(null==c?void 0:c.description)&&!(a&&n===er.UNSAVED);return(0,r.jsxs)("div",{className:"flex flex-col items-start gap-0.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(w.Z,{"aria-live":i?"polite":void 0,as:"span",className:"flex items-center gap-1.5",color:d,variant:"caption",children:!!c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.G,{"aria-hidden":"true",className:n===er.SAVING?"animate-spin":void 0,icon:c.icon}),c.sentence]})}),!!l&&(0,r.jsx)(w.Z,{as:"span",color:"text-gray-400",variant:"caption",children:(0,en.Go)(s)})]}),!!u&&(0,r.jsx)(w.Z,{color:d,variant:"caption",children:c.description})]})};ed.propTypes={status:g().string.isRequired,savedAt:g().number,isLive:g().bool,isReviewGone:g().bool};var eu=n(47023);let eh=e=>"review-question-".concat(e),em={required:"You picked the top or bottom of the scale, so a short explanation is required.",optional:"This comment is optional at the rating you picked, but it still saves with your answer. Clear it if you no longer want it."},ep={[M.INVALID_ANCHORS]:"This rating question is missing its scale labels, so it cannot be shown. Ask your HR team to fix the question in the review template.",[M.MISSING_OPTIONS]:"This question is missing its answer options, so it cannot be shown. Ask your HR team to fix the question in the review template.",[M.UNKNOWN_TYPE]:"This question uses a format this page cannot show yet. Ask your HR team about it."},ef=e=>e.type===L.YES_NO?P:e.options.map(e=>({value:String(e),label:String(e)})),ev=e=>{let{options:t,value:n,onChange:s,labelledBy:i,required:a,error:o,describedBy:l,disabled:c}=e,d=(0,b.useId)();return(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)("div",{"aria-describedby":l,"aria-invalid":!!o||void 0,"aria-labelledby":i,"aria-required":a||void 0,className:"flex flex-wrap gap-2",role:"radiogroup",children:t.map(e=>{let t="".concat(d,"-").concat(e.value),i=n===e.value;return(0,r.jsxs)("label",{className:"flex min-h-[44px] flex-1 basis-32 items-center gap-2 rounded border px-3 py-2 transition-colors duration-150 focus-within:ring-2 focus-within:ring-blue-dark focus-within:ring-offset-1 ".concat(i?"border-blue bg-blue-50 font-medium":"border-gray-200 bg-white"," ").concat(c?"cursor-not-allowed opacity-50":"cursor-pointer hover:border-blue-200"),htmlFor:t,children:[(0,r.jsx)("input",{checked:i,className:"form-radio h-4 w-4 text-blue focus:ring-blue-300",disabled:c,id:t,name:d,onChange:()=>s(e.value),type:"radio",value:e.value}),(0,r.jsx)(w.Z,{as:"span",variant:"bodySmall",children:e.label})]},e.value)})}),!!(null!=n&&!c)&&(0,r.jsx)("div",{children:(0,r.jsx)(eu.Z,{design:"text",onClick:()=>s(null),size:"sm",type:"button",children:"Clear answer"})})]})};ev.propTypes={options:g().arrayOf(g().shape({value:g().string,label:g().string})).isRequired,value:g().string,onChange:g().func.isRequired,labelledBy:g().str
1ing.isRequired,required:g().bool,error:g().string,describedBy:g().string,disabled:g().bool};let eg=e=>{var t,n,s,i;let{question:a,answer:o,onAnswerChange:l,onTextBlur:c,error:d,ratingScale:u,textAnswerMaxLength:h,isUnattributed:m,allowCannotAssess:p=!0,disabled:f=!1}=e,{rcqid:v}=a,g=(0,b.useId)(),y="".concat(g,"-prompt"),x="".concat(g,"-help"),[N,_]=(0,b.useState)(!1),C=G(a),R=X(a,h),k=f?void 0:R,O=!f&&!!a.is_required,I=a.help_text?x:void 0,A=(0,b.useCallback)((e,t)=>l(v,e,t),[l,v]),D=(0,b.useCallback)(e=>A({rating_value:e,cannot_assess:!1},{immediate:!0}),[A]),q=(0,b.useCallback)(e=>A({cannot_assess:e,rating_value:e?null:o.rating_value},{immediate:!0}),[A,o.rating_value]),P=(0,b.useCallback)(e=>A({choice_value:e},{immediate:!0}),[A]),W=(0,b.useCallback)(e=>A({text_value:""===e?null:e}),[A]),M=(0,b.useCallback)(()=>{_(!0),c(v)},[c,v]),U=a.type===L.RATING&&H(o.rating_value,u),F=(null!==(t=o.text_value)&&void 0!==t?t:"").length>0,B=0===(null!==(n=o.text_value)&&void 0!==n?n:"").trim().length,Y=U?em.required:em.optional,V=f?void 0:Y,z=U&&B,K=z?null!=d?d:N?Z:void 0:void 0,J=z?void 0:d,Q=!C&&(a.type===L.RATING||a.type===L.TEXT);return(0,r.jsxs)("div",{className:"flex flex-col gap-3 border-b border-gray-100 py-6 last:border-b-0 fs-exclude","data-hj-suppress":!0,"data-hs-do-not-collect":"true","data-testid":"review-question-".concat(v),id:eh(v),children:[(0,r.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:(0,r.jsxs)(w.Z,{className:"max-w-2xl",id:y,variant:"labelValue",children:[a.prompt,!!O&&(0,r.jsx)("span",{"aria-hidden":"true",className:"text-red-400 text-xs ml-1",children:"*"})]})}),!!a.help_text&&(0,r.jsx)(w.Z,{color:"text-gray-500",id:x,variant:"caption",children:a.help_text}),!!C&&(0,r.jsxs)("div",{className:"flex items-start gap-2 rounded border border-orange-200 bg-orange-50 p-3",children:[(0,r.jsx)(j.G,{"aria-hidden":"true",className:"mt-0.5 text-orange",icon:E.ik8}),(0,r.jsx)(w.Z,{color:"text-gray-700",variant:"bodySmall",children:ep[C]})]}),!!(!C&&a.type===L.RATING)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T,{allowCannotAssess:p,ariaDescribedBy:I,ariaLabelledBy:y,cannotAssess:o.cannot_assess,disabled:f,error:J,labels:a.rating_anchors,name:v,onCannotAssessChange:q,onChange:D,required:O,value:o.rating_value}),!!(U||F)&&(0,r.jsx)(S.ZP,{description:V,disabled:f,error:K,label:"Why this rating?",maxLength:k,name:"".concat(v,"-comment"),onBlur:M,onChange:W,required:!f&&U,rows:3,value:null!==(s=o.text_value)&&void 0!==s?s:""})]}),!!(!C&&a.type===L.TEXT)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.ZP,{ariaDescribedBy:I,ariaLabelledBy:y,disabled:f,error:d,maxLength:k,name:v,onBlur:M,onChange:W,required:O,value:null!==(i=o.text_value)&&void 0!==i?i:""}),!!m&&(0,r.jsx)(w.Z,{color:"text-gray-500",variant:"caption",children:"Specific examples make feedback far more useful. They can also make it clear who wrote it â write what you would still stand behind if it were traced back to you."})]}),!!(!C&&(a.type===L.MULTIPLE_CHOICE||a.type===L.YES_NO))&&(0,r.jsx)(ev,{describedBy:I,disabled:f,error:d,labelledBy:y,onChange:P,options:ef(a),required:O,value:o.choice_value}),!!(d&&!Q)&&(0,r.jsx)(w.Z,{color:"text-red-400",variant:"caption",children:d})]})};eg.propTypes={question:g().shape({rcqid:g().string.isRequired,prompt:g().string,help_text:g().string,type:g().string,options:g().array,rating_anchors:g().array,is_required:g().bool,max_length:g().number}).isRequired,answer:g().shape({rating_value:g().number,cannot_assess:g().bool,text_value:g().string,choice_value:g().string}).isRequired,onAnswerChange:g().func.isRequired,onTextBlur:g().func.isRequired,error:g().string,ratingScale:g().object,textAnswerMaxLength:g().number,isUnattributed:g().bool,allowCannotAssess:g().bool,disabled:g().bool};class eb extends b.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){try{(0,p.N2)(e,"ReviewQuestion",{rcqid:this.props.rcqid})}catch(e){}}render(){let{children:e,error:t,rcqid:n}=this.props;return this.state.hasError?(0,r.jsxs)("div",{className:"flex items-start gap-2 rounded border border-orange-200 bg-orange-50 p-3","data-testid":"review-question-crashed",id:eh(n),children:[(0,r.jsx)(j.G,{"aria-hidden":"true",className:"mt-0.5 text-orange",icon:E.ik8}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,r.jsx)(w.Z,{color:"text-gray-700",variant:"bodySmall",children:"This question could not be shown, so it cannot be answered here. Your other answers are safe. Ask your HR team to fix it in the review template."}),!!("string"==typeof t&&t.length>0)&&(0,r.jsx)(w.Z,{color:"text-red-400",variant:"caption",children:t})]})]}):e}constructor(e){super(e),this.state={hasError:!1}}}
1eb.propTypes={rcqid:g().string.isRequired,children:g().node,error:g().string};let ey=new Set([er.UNSAVED,er.BLOCKED]),ex=e=>{let{onSaveDraft:t,onSubmit:n,canSaveDraft:s,canSubmit:i,autosaveStatus:a,isSubmitting:o,blockingCount:l,isReviewGone:c=!1,canDecline:d=!1,onDecline:u,isDeclining:h=!1,isDeclined:m=!1}=e,p=c||m,f=p||ey.has(a);return(0,r.jsxs)("div",{className:"sticky bottom-0 z-40 -mx-4 flex flex-wrap items-center justify-between gap-3 border-t border-gray-200 bg-white px-4 py-3 md:-mx-8 md:px-8 lg:-mx-12 lg:px-12",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[l>0&&(0,r.jsx)(w.Z,{color:"text-gray-500",variant:"caption",children:"".concat(l," ").concat(1===l?"question needs":"questions need"," an answer before you can submit")}),!!(s&&0===l&&!f)&&(0,r.jsx)(w.Z,{color:"text-gray-500",variant:"caption",children:"Your answers save as you go"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[!!d&&(0,r.jsx)(eu.Z,{design:"plain",disabled:p||h||o,onClick:u,size:"sm",type:"button",children:"Decline"}),(0,r.jsx)(eu.Z,{design:"secondary",disabled:!s||o||h||p||a===er.BLOCKED,onClick:t,size:"sm",type:"button",children:"Save draft"}),(0,r.jsx)(eu.Z,{design:"primary",disabled:!i||p||h,isLoading:o,onClick:n,size:"sm",type:"button",children:"Submit review"})]})]})};ex.propTypes={onSaveDraft:g().func.isRequired,onSubmit:g().func.isRequired,canSaveDraft:g().bool.isRequired,canSubmit:g().bool.isRequired,autosaveStatus:g().string.isRequired,isSubmitting:g().bool,blockingCount:g().number.isRequired,isReviewGone:g().bool,canDecline:g().bool,onDecline:g().func,isDeclining:g().bool,isDeclined:g().bool};var ew=n(10988);let eE=e=>{var t;let{subject:n,reviewCycle:s,relationshipLabel:i,answeredCount:a,questionCount:o,autosaveStatus:l,savedAt:c,isReviewGone:d=!1,isDeclined:u=!1}=e,h=null==n?void 0:null===(t=n.user)||void 0===t?void 0:t.name,m=(0,en.ci)(null==s?void 0:s.review_closes_at),p=0===o?0:Math.round(a/o*100);return(0,r.jsxs)("div",{className:"sticky top-[50px] z-40 -mx-4 border-b border-gray-200 bg-white px-4 py-3 md:-mx-8 md:top-14 md:px-8 lg:-mx-12 lg:top-16 lg:px-12",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1 fs-exclude","data-hj-suppress":!0,"data-hs-do-not-collect":"true",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(w.Z,{variant:"heading5",children:h||"Name unavailable"}),!!i&&(0,r.jsx)(ew.Z,{color:"blue",label:i,size:"sm"})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[!h&&(0,r.jsx)(w.Z,{as:"span",color:"text-gray-500",variant:"caption",children:"We could not read this employeeâs record. The review is still owed."}),!!(null==n?void 0:n.job_title_snapshot)&&(0,r.jsx)(w.Z,{as:"span",color:"text-gray-500",variant:"caption",children:n.job_title_snapshot}),!!(null==s?void 0:s.name)&&(0,r.jsx)(w.Z,{as:"span",color:"text-gray-500",variant:"caption",children:s.name}),!u&&(0,r.jsx)(w.Z,{as:"span",color:m.isOverdue?"text-red":"text-gray-500",variant:"caption",children:m.label})]})]}),(0,r.jsxs)("div",{className:"flex flex-col items-start gap-1 md:items-end",children:[(0,r.jsx)(ed,{isReviewGone:d,savedAt:c,status:l}),!u&&(0,r.jsxs)(w.Z,{as:"span",color:"text-gray-500",variant:"caption",children:[a," of ",o," answered"]})]})]}),!u&&(0,r.jsx)("div",{"aria-hidden":"true",className:"mt-2 h-1 w-full overflow-hidden rounded-full bg-gray-100",children:(0,r.jsx)("div",{className:"h-full rounded-full bg-blue transition-all duration-300",style:{width:"".concat(p,"%")}})})]})};eE.propTypes={subject:g().object,reviewCycle:g().object,relationshipLabel:g().string,answeredCount:g().number.isRequired,questionCount:g().number.isRequired,autosaveStatus:g().string.isRequired,savedAt:g().number,isReviewGone:g().bool,isDeclined:g().bool};let ej=Object.freeze({SELF:"self",MANAGER:"manager",PEER:"peer",UPWARD:"upward"}),eN=new Set([ej.PEER,ej.UPWARD]),e_=e=>eN.has(e),eC=new Map([[ej.SELF,"Your manager and HR will read this self-assessment with your name on it."],[ej.MANAGER,"The employee you are reviewing and HR will read these answers with your name on them."],[ej.PEER,"Your answers go to the employee and their manager without your name, grouped with feedback from other colleagues."],[ej.UPWARD,"Your answers go to your manager and HR without your name, grouped with feedback from the rest of the team."]]),eR=new Map([[ej.SELF,"Your name is shown on every answer in this review."],[ej.MANAGER,"Your name is shown on every answer in this review."],[ej.PEER,"Your name is not shown on any answer in this review."],[ej.UPWARD,"Your name is not shown on any answer in this review."]]),ek=e=>{var t,n;let{relationship:s,purpose:i}=e,a=null!==(t=eC.get(s))&&void 0!==t?t:"Your answers will be shared with the people running this review cycle. Ask your HR team who reads them before you write anything you would not want attributed to you.",o=null!==(n=eR.get(s))&&void 0!==n?n:null;return(0,r.jsxs)("div",{className:"flex items-start gap-3 rounded-lg border border-blue-100 bg-blue-50 p-4","data-testid":"review-privacy-notice",children:[(0,r.jsx)(j.G,{"aria-hidden":"true",className:"mt-0.5 text-blue",icon:E.Mdf}),(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(w.Z,{color:"text-gray-900",variant:"labelValue",children:"Who reads your answers"}),(0,r.jsx)(w.Z,{color:"text-gray-700",variant:"bodySmall",children:a}),!!o&&(0,r.jsx)(w.Z,{color:"text-gray-900",variant:"bodySmall",weight:"font-medium",children:o}),"evaluation"===i&&(0,r.jsx)(w.Z,{color:"text-gray-700",variant:"bodySmall",children:"This cycle can inform pay, promotion or performance decisions. Feedback used in a formal process may have to be disclosed."})]})]})};
1ek.propTypes={relationship:g().string,purpose:g().string};let eS=Object.freeze({UNKNOWN:"unknown",NOT_YET_OPEN:"not_yet_open",OPEN:"open",CLOSED:"closed"}),eO=new Map([["draft",eS.NOT_YET_OPEN],["nominating",eS.NOT_YET_OPEN],["calibrating",eS.CLOSED],["moderating",eS.CLOSED],["closed",eS.CLOSED],["released",eS.CLOSED],["cancelled",eS.CLOSED]]),eI=e=>{let t=(0,en.ci)(e.review_opens_at).dayDelta,n=(0,en.ci)(e.review_closes_at).dayDelta;return null!==t&&t>0?eS.NOT_YET_OPEN:null!==n&&n<0?eS.CLOSED:eS.UNKNOWN},eA=e=>{var t;return e?!0===e.is_review_window_open?eS.OPEN:null!==(t=eO.get(e.status))&&void 0!==t?t:eI(e):eS.UNKNOWN},eD=Object.freeze({UNKNOWN:"unknown",NOT_YET_OPEN:"not_yet_open",WINDOW_CLOSED:"window_closed",DECLINED:"declined",EXPIRED:"expired",CANCELLED:"cancelled"}),eq=new Map([["declined",eD.DECLINED],["expired",eD.EXPIRED],["cancelled",eD.CANCELLED]]),eT=new Map([[eS.NOT_YET_OPEN,eD.NOT_YET_OPEN],[eS.CLOSED,eD.WINDOW_CLOSED]]),eL=e=>{var t,n;let{participant:r,reviewCycle:s}=e;return null!==(n=null!==(t=eq.get(null==r?void 0:r.status))&&void 0!==t?t:eT.get(eA(s)))&&void 0!==n?n:eD.UNKNOWN},eP=new Map([[eD.NOT_YET_OPEN,e=>{let{opensOn:t}=e;return t?{message:"This review is not open yet",description:"You can read the questions now. Answers can be written from ".concat(t,".")}:{message:"This review is not open yet",description:"You can read the questions now. Answers can be written once your HR team opens the review window."}}],[eD.WINDOW_CLOSED,e=>{let{closesOn:t}=e;return t?{message:"This review is closed",description:"The review window closed on ".concat(t,". You can read your answers, but they can no longer be changed.")}:{message:"This review is closed",description:"The review window has closed. You can read your answers, but they can no longer be changed."}}],[eD.DECLINED,()=>({message:"You declined this review",description:"It is no longer yours to complete, so nothing on this form can be changed or saved."})],[eD.EXPIRED,e=>{let{closesOn:t}=e;return t?{message:"This review was not submitted in time",description:"The review window closed on ".concat(t," before it was submitted, so it can no longer be changed.")}:{message:"This review was not submitted in time",description:"The review window closed before it was submitted, so it can no longer be changed."}}],[eD.CANCELLED,()=>({message:"This review was cancelled",description:"Your HR team withdrew it, so there is nothing left to answer here."})],[eD.UNKNOWN,()=>({message:"This review cannot be edited",description:"You can read your answers, but they can no longer be changed."})]]),eZ=e=>{var t;let{participant:n,reviewCycle:r}=e,s=eL({participant:n,reviewCycle:r});return(null!==(t=eP.get(s))&&void 0!==t?t:eP.get(eD.UNKNOWN))({opensOn:(0,en.mn)(null==r?void 0:r.review_opens_at,null),closesOn:(0,en.mn)(null==r?void 0:r.review_closes_at,null)})},eW=e=>(null==e?void 0:e.can_save_draft)===!0;var eM=()=>(0,r.jsx)(i.ZP,{children:(0,r.jsx)(i.eW,{children:(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(w.Z,{variant:"sectionHeader",children:"You are assessing yourself"}),(0,r.jsx)(w.Z,{color:"text-gray-600",variant:"bodySmall",children:"The questions below are worded about the person being reviewed. In this round that person is you, so answer them about your own work."})]})})});let eU=_()(()=>n.e(512).then(n.bind(n,10512)),{loadableGenerated:{webpack:()=>[10512]},ssr:!1}),eF=Object.freeze({byRcqid:{},formLevel:[]}),eB=(e,t)=>"radio"===t.type&&Array.from(e.querySelectorAll('input[type="radio"], input[type="checkbox"]')).some(e=>e.checked),eY="review-read-only-notice",eV=(e,t)=>{try{(0,p.N2)(e,t)}catch(e){}},eG=(e,t)=>Object.prototype.hasOwnProperty.call(null!=e?e:{},t)?e[t]:void 0,ez=e=>{let{status:t,reason:n}=e;return"string"==typeof n&&n.length>0?n:422===t?"validation_failed":403===t?"forbidden":404===t?"not_found":"number"==typeof t&&t>=500?"server_error":"number"==typeof t?"http_".concat(t):"network_error"},eH=e=>{let t=e/6e4;return t<2?"under_2m":t<5?"2_5m":t<15?"5_15m":t<30?"15_30m":"over_30m"},eK=e=>{let{id:t}=e;return(0,r.jsxs)("div",{className:"flex items-start gap-2 rounded border border-orange-200 bg-orange-50 p-3",id:t,children:[(0,r.jsx)(j.G,{"aria-hidden":"true",className:"mt-0.5 text-orange",icon:E.ik8}),(0,r.jsx)(w.Z,{color:"text-gray-700",variant:"bodySmall",children:"This question is not set up correctly, so it cannot be answered here. Ask your HR team to fix it in the review template."})]})};
1eK.propTypes={id:g().string.isRequired};let eX=e=>{let t=null==e?void 0:e.section;return"string"==typeof t&&t.trim().length>0?t:null},eJ=e=>e.reduce((e,t,n)=>{let r=eX(t),s=e[e.length-1];return s&&s.section===r?s.entries.push({question:t,index:n}):e.push({section:r,entries:[{question:t,index:n}]}),e},[]),eQ=()=>{let[e,t]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{var e;if("function"!=typeof window.matchMedia)return;let n=window.matchMedia("(min-width: 1024px)"),r=()=>t(n.matches);return r(),null===(e=n.addEventListener)||void 0===e||e.call(n,"change",r),()=>{var e;return null===(e=n.removeEventListener)||void 0===e?void 0:e.call(n,"change",r)}},[]),e},e$=e=>{let{review:t,rpid:n,tenantName:s,reviewerUid:o,isReviewGone:c=!1,onDeclined:h}=e,m=(0,f.useRouter)(),{track:p}=(0,u.Ke)({app:"portal"}),v=null==t?void 0:t.participant,g=null==t?void 0:t.subject,y=null==t?void 0:t.review_cycle,E=(0,b.useMemo)(()=>{var e;return null!==(e=null==t?void 0:t.questions)&&void 0!==e?e:[]},[null==t?void 0:t.questions]),j=null==t?void 0:t.rating_scale,N=null==t?void 0:t.text_answer_max_length,_=null==v?void 0:v.relationship,S=_===ej.SELF,O=e_(_),I=eW(v),A=(null==v?void 0:v.can_submit)===!0,D=!I,q=(0,d.WL)(v,g)&&!D,T=(0,b.useRef)(null),P=(0,b.useRef)(null),[Z,W]=(0,b.useState)(()=>(T.current=Y(E,null==v?void 0:v.answers),P.current=n,T.current));P.current!==n&&(P.current=n,T.current=Y(E,null==v?void 0:v.answers),W(T.current));let[M,U]=(0,b.useState)(eF),[F,G]=(0,b.useState)(!1),[H,X]=(0,b.useState)(!1),[J,en]=(0,b.useState)(!1),ei=(0,d.jg)({rpid:n}),ea=D||J,el=(0,b.useMemo)(()=>D?eZ({participant:v,reviewCycle:y}):null,[D,v,y]),ec=eQ(),eu=(0,b.useRef)(Date.now()),em=(0,b.useRef)(!1),{status:ep,savedAt:ef,queueSave:ev,flush:ey,markFinal:ew,markAbandoned:eN}=eo({rpid:n,getAnswers:(0,b.useCallback)(e=>e.map(e=>V(T.current,e)).filter(Boolean),[]),enabled:I,onSaved:(0,b.useCallback)(()=>{p(l.dW.PERF_REVIEW_DRAFT_SAVED,{relationship:_,surface:l.S9.PERFORMANCE_REVIEWS,...et({questions:E,answers:T.current})})},[_,E,p])}),eC=(0,d.Hq)(),eR=(0,b.useCallback)(function(e,t){var n;let{immediate:r=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=null!==(n=V(T.current,e))&&void 0!==n?n:B(e),i={...T.current,[e]:{...s,...t}};T.current=i,W(i),U(t=>void 0===eG(t.byRcqid,e)?t:{...t,byRcqid:Object.fromEntries(Object.entries(t.byRcqid).filter(t=>{let[n]=t;return n!==e}))}),ev(e,{immediate:r})},[ev]),eS=(0,b.useCallback)(()=>{ey()},[ey]),{errorsByRcqid:eO,blockingRcqids:eI}=(0,b.useMemo)(()=>$({questions:E,answers:Z,ratingScale:j,textAnswerMaxLength:N}),[E,Z,j,N]),eA=(0,b.useMemo)(()=>E.filter(e=>!z(e,V(Z,e.rcqid))).length,[E,Z]),eD=(0,b.useMemo)(()=>eJ(E),[E]),eq=(0,b.useCallback)(e=>{var t,n;let[r]=e;if(!r)return;let s=document.getElementById(eh(r));if(!s){eV(Error("No node to focus for a blocking question"),"ReviewForm.focusFirstOffender");return}null===(t=s.scrollIntoView)||void 0===t||t.call(s,{behavior:"smooth",block:"center"});let i=null!==(n=s.querySelector('input[aria-invalid="true"]:not([disabled]), textarea[aria-invalid="true"]:not([disabled]), select[aria-invalid="true"]:not([disabled])'))&&void 0!==n?n:s.querySelector("input:not([disabled]), textarea:not([disabled]), select:not([disabled])");!i||eB(s,i)||i.focus()},[]),eT=(0,b.useCallback)(e=>E.map(e=>e.rcqid).filter(t=>void 0!==eG(e,t)),[E]),eL=(0,b.useCallback)(async(e,t)=>{try{let t=await m.push("/hr/".concat(s,"/performance/reviews"));if(!1!==t)return;eV(Error("Route change did not happen"),e)}catch(t){eV(t,e)}R.default.error(t)},[m,s]),eP=(0,b.useCallback)(async()=>{try{R.default.success("Review submitted"),await eL("ReviewForm.submitRedirect","Review submitted. We could not open your reviews list, so select My reviews at the top of this page."),p(l.dW.PERF_REVIEW_SUBMITTED,{relationship:_,duration_bucket:eH(Date.now()-eu.current),surface:l.S9.PERFORMANCE_REVIEWS,cannot_assess_count:et({questions:E,answers:T.current}).cannot_assess_count})}catch(e){eV(e,"ReviewForm.notifySubmitted")}},[p,_,E,eL]),eX=(0,b.useCallback)(e=>{try{let t=(0,d.AN)(e),n=ee(t.fieldErrors,E);(0,C.flushSync)(()=>U(n)),eq(eT(n.byRcqid)),p(l.dW.PERF_REVIEW_SUBMIT_FAILED,{error_reason:ez(t),surface:l.S9.PERFORMANCE_REVIEWS})}catch(e){eV(e,"ReviewForm.notifySubmitFailed")}},[E,eq,eT,p]),e$=(0,b.useCallback)(async()=>{try{await eC.mutateAsync({rpid:n,answers:Object.values(T.current)})}catch(e){eX(e);return}ew(),await eP()},[eC,n,ew,eX,eP]),e0=(0,b.useCallback)(async()=>{try{R.default.success("Review declined"),await eL("ReviewForm.declineRedirect","Review declined. We could not open your reviews list, so select My reviews at the top of this page.")}catch(e){eV(e,"ReviewForm.notifyDeclined")}},[eL]),e1=(0,b.useCallback)(async()=>{eN(),en(!0),X(!1);try{null==h||h()}catch(e){eV(e,"ReviewForm.onDeclined")}await e0()},[eN,e0,h]),e2=(0,b.useCallback)(()=>X(!0),[]),e5=(0,b.useCallback)(()=>X(!1),[]),e4=(0,b.useCallback)(()=>
1{if((0,C.flushSync)(()=>{G(!0),U(eF)}),eI.length>0){eq(eI);return}(0,x.Z)({title:"Submit this review?",message:"Your answers are final once you submit. You will not be able to change them.",confirmButtonText:"Yes, submit",cancelButtonText:"Keep editing",handler:e$})},[eI,eq,e$]),e3=(0,b.useCallback)(async()=>{let e=await ey();if(e===es.SAVED){R.default.success("Everything is saved");return}if(e===es.QUEUED){R.default.success("Saved. Your newest changes are still saving.");return}e===es.FAILED&&R.default.error("We could not save your changes. Check your connection and try again.")},[ey]);(0,b.useEffect)(()=>{let e=null==m?void 0:m.events;if(!e)return;let t=()=>{ey().then(e=>e!==es.QUEUED?e:ey()).then(e=>{e===es.FAILED&&R.default.error("Some of your answers did not save. Open the review again to check them.")}).catch(e=>{eV(e,"ReviewForm.saveBeforeLeaving")})};return e.on("routeChangeStart",t),()=>e.off("routeChangeStart",t)},[m,ey]),(0,b.useEffect)(()=>{em.current||(em.current=!0,p(l.dW.PERF_REVIEW_FORM_OPENED,{relationship:_,question_count:E.length,surface:l.S9.PERFORMANCE_REVIEWS}))},[p,_,E.length]);let e8=E.some(e=>e.type===L.RATING)&&!K(j);return 0===E.length||e8?(0,r.jsx)(i.ZP,{children:(0,r.jsx)(i.eW,{children:(0,r.jsx)(a.Z,{description:e8?"The rating scale for this cycle is not set up correctly, so we cannot show the questions. Ask your HR team to check the cycle settings.":"There are no questions for you to answer in this review.",design:"wrapped",isError:e8,message:e8?"We cannot show this review":"Nothing to review"})})}):(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(eE,{answeredCount:eA,autosaveStatus:ep,isDeclined:J,isReviewGone:c,questionCount:E.length,relationshipLabel:null==v?void 0:v.relationship_label,reviewCycle:y,savedAt:ef,subject:g}),(0,r.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[(0,r.jsx)(ek,{purpose:null==y?void 0:y.purpose,relationship:_}),(0,r.jsx)("div",{className:J?void 0:"sr-only",role:"status",children:!!J&&(0,r.jsx)(i.ZP,{children:(0,r.jsx)(i.eW,{children:(0,r.jsx)("div",{id:eY,children:(0,r.jsx)(a.Z,{description:"It is no longer yours to complete, so nothing on this form can be changed or saved.",design:"wrapped",message:"You declined this review",showIcon:!1})})})})}),!!(D&&!J)&&(0,r.jsx)(i.ZP,{children:(0,r.jsx)(i.eW,{children:(0,r.jsx)("div",{id:eY,children:(0,r.jsx)(a.Z,{description:el.description,design:"wrapped",message:el.message,showIcon:!1})})})}),!!S&&(0,r.jsx)(eM,{}),M.formLevel.length>0&&(0,r.jsxs)("div",{className:"flex flex-col gap-1 rounded-lg border border-red-200 bg-red-50 p-4",role:"alert",children:[(0,r.jsx)(w.Z,{color:"text-red",variant:"labelValue",children:"We could not submit this review"}),M.formLevel.map(e=>(0,r.jsx)(w.Z,{color:"text-gray-700",variant:"bodySmall",children:e},e))]}),(0,r.jsx)(i.ZP,{children:(0,r.jsx)(i.eW,{children:(0,r.jsxs)("fieldset",{"aria-describedby":ea?eY:void 0,className:"min-w-0",disabled:ea,children:[(0,r.jsx)("legend",{className:"sr-only",children:"Review questions"}),eD.map((e,t)=>(0,r.jsxs)(b.Fragment,{children:[!!e.section&&(0,r.jsx)(w.Z,{className:0===t?void 0:"pt-6",variant:"sectionHeader",children:e.section}),e.entries.map(e=>{var t,n;let{question:s,index:i}=e;if(!(null==s?void 0:s.rcqid))return(0,r.jsx)(eK,{id:eh(Q(i))},Q(i));let a=null!==(t=eG(M.byRcqid,s.rcqid))&&void 0!==t?t:F?eG(eO,s.rcqid):void 0;return(0,r.jsx)(eb,{error:a,rcqid:s.rcqid,children:(0,r.jsx)(eg,{allowCannotAssess:!S,answer:null!==(n=V(Z,s.rcqid))&&void 0!==n?n:B(s.rcqid),disabled:ea,error:a,isUnattributed:O,onAnswerChange:eR,onTextBlur:eS,question:s,ratingScale:j,textAnswerMaxLength:N})},s.rcqid)})]},"section-".concat(e.entries[0].index)))]})})})]}),!!(S&&ec)&&(0,r.jsx)("aside",{className:"w-full lg:w-80 lg:shrink-0",children:(0,r.jsx)(eU,{userId:o})})]}),(0,r.jsx)(ex,{autosaveStatus:ep,blockingCount:eI.length,canDecline:q,canSaveDraft:I,canSubmit:A,isDeclined:J,isDeclining:H||ei,isReviewGone:c,isSubmitting:eC.isPending,onDecline:e2,onSaveDraft:e3,onSubmit:e4}),ep!==er.IDLE&&(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(ed,{isLive:!1,isReviewGone:c,savedAt:ef,status:ep})}),!!H&&(0,r.jsx)(k.Z,{answeredCount:eA,maxCharacters:N,onClose:e5,onDeclined:e1,participant:v,questionCount:E.length,rpid:n,show:!0,subject:g})]})};
1e$.propTypes={review:g().shape({participant:g().object,subject:g().object,review_cycle:g().object,questions:g().array,rating_scale:g().object,text_answer_max_length:g().number}).isRequired,rpid:g().string.isRequired,tenantName:g().string.isRequired,reviewerUid:g().string,isReviewGone:g().bool,onDeclined:g().func};let e0=new Map([[d.fM.FEATURE_DISABLED,{message:"Performance reviews are not available yet",description:"Elevolt switches this on, not your settings. Contact support if you need it."}],[d.fM.SUBSCRIPTION_REQUIRED,{message:"Performance reviews are not on your plan",description:"Ask an admin to add the Performance module to your subscription."}],[d.fM.FORBIDDEN,{message:"You do not have access to this review",description:"Only the reviewer it was assigned to can open it. Check you are signed in to the right workspace."}],["subject_removed",{message:"This review is no longer needed",description:"The employee was removed from this review cycle, so there is nothing left to answer."}],["no_questions_configured_for_relationship",{message:"There are no questions for you in this cycle",description:"This cycle does not ask anything of your relationship to the employee. Ask your HR team if you think that is wrong."}]]),e1={message:"We could not load this review",description:"Refresh the page, and ask your HR team to check this review if that does not help."},e2={title:"We could not refresh this review",description:"You are seeing the version loaded earlier, so anything changed since may be missing. Your answers are still here, and you can keep writing."},e5={title:"We could not find this review any more",description:"Nothing you write from now on will save. Copy what you want to keep, then open the review again from My reviews."},e4={message:"We could not find this review",description:"It may have been removed from the cycle, or you may be signed in to a different workspace. Check your reviews list, and ask your HR team if it should still be there."},e3=Object.freeze({WRITABLE:"Write a review",READ_ONLY:"Your review"}),e8=/^[A-Za-z0-9_-]{1,64}$/,e7=e=>e0.get(null==e?void 0:e.reason)||((null==e?void 0:e.status)===404?e4:e?{message:"We could not load this review",description:e.message}:e1),e9=e=>{let{tenantName:t}=e,n=(0,f.useRouter)().query.rpid,m="string"==typeof n&&e8.test(n)?n:void 0,{track:v}=(0,u.Ke)({app:"portal"}),{data:g,error:x}=(0,c.Pi)({enabled:!0}),{data:w,isMissingContext:E,reviewError:j,isPending:N}=(0,d.rv)({rpid:m}),[_,C]=(0,b.useState)(null),R=(0,b.useCallback)(()=>C(m),[m]),k=!!m&&_===m;(0,b.useEffect)(()=>{var e;x&&(0,p.N2)(x,"ReviewFormPage.identity",{statusCode:null==x?void 0:null===(e=x.response)||void 0===e?void 0:e.status})},[x]);let S=(0,b.useMemo)(()=>[{href:"/hr/".concat(t,"/performance"),name:"Performance",nodeType:"Link"},{href:"/hr/".concat(t,"/performance/reviews"),name:"My reviews",nodeType:"Link"}],[t]),O=!E&&!j&&!N&&!w,I=!w&&(!!j||O),A=!!w&&(null==j?void 0:j.status)===404,D=!!w&&!!j&&!A&&!k,q=!E&&!!w,T=!E&&!q,L=(0,b.useRef)(!1);(0,b.useEffect)(()=>{!L.current&&T&&(null==j?void 0:j.reason)===d.fM.SUBSCRIPTION_REQUIRED&&(L.current=!0,v(l.dW.PAYWALL_SHOWN,{reason:l.V$.PERFORMANCE_MODULE,surface:l.S9.PERFORMANCE_REVIEWS}))},[T,j,v]);let P=I?e7(j):null,Z=w&&!eW(w.participant)?e3.READ_ONLY:e3.WRITABLE;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y.Z,{thirdParty:!1,title:"".concat((0,o.kC)((0,o.parseUnderScore)(t))," - Review")}),(0,r.jsxs)("main",{className:"container mx-auto flex flex-col gap-4 px-4 pb-6 md:px-8 lg:px-12",children:[(0,r.jsx)(h.Z,{breadcrumbs:S,tenantName:t,title:Z}),!!E&&(0,r.jsx)(i.ZP,{children:(0,r.jsx)(i.eW,{children:(0,r.jsx)(a.Z,{description:"Open it from your reviews list, and sign in again if that does not help.",design:"wrapped",isError:!0,message:"We could not work out which review to open"})})}),!!T&&(0,r.jsx)(i.ZP,{children:(0,r.jsx)(i.eW,{children:(0,r.jsx)(a.Z,{description:null==P?void 0:P.description,design:"wrapped",isError:!!I,isLoading:!!(!I&&N),message:null==P?void 0:P.message})})}),(0,r.jsx)("div",{className:D?void 0:"sr-only",role:"status",children:!!D&&(0,r.jsx)(s.W,{description:e2.description,title:e2.title})}),!!A&&(0,r.jsx)(s.W,{description:e5.description,role:"alert",title:e5.title}),!!q&&(0,r.jsx)(e$,{isReviewGone:A,onDeclined:R,review:w,reviewerUid:null==g?void 0:g.uid,rpid:m,tenantName:t},m)]})]})};e9.getInitialProps=async e=>{let{tenant:t}=e.query;return{tenantName:t}},e9.propTypes={tenantName:g().string.isRequired};var e6=(0,m.withAuthSync)(e9)},57989:function(e,t,n){"use strict";n.d(t,{W:function(){return l}});var r=n(52322),s=n(2369),i=n(92942),a=n(13980),o=n.n(a);n(2784);let l=e=>{let{title:t,description:n,button:a=null,flow:o="y",...l}=e;return(0,r.jsxs)("div",{...l,className:"w-full bg-red-100 border border-red-300 p-3 rounded flex flex-col md:flex-row md:justify-between items-center relative",children:[(0,r.jsxs)("div",{className:"flex justify-start flex-col",children:[(0,r.jsx)("span",{className:"absolute -top-2 -left-1",children:(0,r.jsx)(i.FontAwesomeIcon,{className:"text-red-600 text-lg",icon:s.RLE,size:"1x"})}),!!t&&(0,r.jsx)("h6",{className:"text-center md:text-left font-semibold text-gray-800 md:leading-none mb-2",children:t}),(0,r.jsx)("p",{className:"text-center md:text-left font-normal leading-tight text-gray-800",children:n}),!!("y"===o&&a)&&(0,r.jsx)("div",{className:"mt-3",children:a})]}),!!("x"===o&&a)&&(0,r.jsx)("div",{className:"mt-3 md:ml-2 md:mt-auto",children:a})]})};l.propTypes={title:o().string,description:o().string,button:o().element,flow:o().string},t.Z=l},10988:function(e,t,n){"use strict";var r=n(52322),s=n(13980),i=n.n(s),a=n(12524),o=n.n(a);let l={blue:"bg-blue-100 text-blue-700",green:"bg-green-100 text-green-700",red:"bg-red-100 text-red-700",yellow:"bg-yellow-100 text-yellow-700",gray:"bg-gray-100 text-gray-700",orange:"bg-orange-100 text-orange-700",purple:"bg-purple-100 text-purple-700"},c={sm:"text-xs px-1.5 py-0.5",md:"text-xs px-2 py-1"},d=e=>{let{label:t,color:n="gray",size:s="sm",className:i}=e,a=l[n]||l.gray,d=c[s];return(0,r.jsx)("span",{className:o()("inline-flex items-center rounded font-medium",a,d,i),children:t})};d.propTypes={label:i().string.isRequired,color:i().oneOf(["blue","green","red","yellow","gray","orange","purple"]),size:i().oneOf(["sm","md"]),className:i().string},t.Z=d},65232:function(e,t,n){"use strict";n.d(t,{Ol:function(){return a},eW:function(){return o}});var r=n(52322),s=n(13980),i=n.n(s);n(2784);let a=e=>{let{heading:t,padding:n={}}=e,{x:s=4,y:i=3}=n;return(0,r.jsxs)("div",{className:"card-header",children:[(0,r.jsxs)("div",{className:"px-".concat(s," py-").concat(i),children:[!!t&&(0,r.jsx)("h3",{className:"text-xl font-semibold",children:t}),e.children]}),(0,r.jsx)("hr",{className:"border-gray-200"})]})};a.propTypes={heading:i().string,children:i().node,padding:i().object};let o=e=>{let{padding:t=4}=e;return(0,r.jsx)("div",{className:"p-".concat(t," w-full relative"),children:e.children})};o.propTypes={padding:i().number,children:i().node};let l=e=>
1{let{heading:t,footer:n,className:s="",...i}=e;return(0,r.jsxs)("div",{className:"w-full bg-white rounded ".concat(s),...i,children:[t?(0,r.jsx)(a,{heading:t}):null,e.children,n]})};l.propTypes={heading:i().string,className:i().node,children:i().node,footer:i().node},t.ZP=l},17047:function(e,t,n){"use strict";var r=n(52322),s=n(2784),i=n(94217);n(56486);var a=n(47023),o=n(59578),l=n(42369),c=n(76467);let d=e=>{let{onClose:t,handler:n,preOnCloseFn:i,title:d,message:u,details:h,confirmButtonText:m,cancelButtonText:p,initialIsLoading:f,suppressRecording:v}=e,[g,b]=(0,s.useState)(!1),y=f||g,x=(0,s.useCallback)(async()=>{b(!0);try{await n(),i(),t()}catch(e){b(!1),(0,o.N2)(e,"ConfirmDialogContent")}},[n,i,t]),w=(0,s.useCallback)(()=>{g||(i(),t())},[g,i,t]);return(0,r.jsxs)("div",{className:"confirm-dialog flex flex-col bg-white py-3 px-3 sm:py-4 sm:px-4 rounded shadow-sm relative".concat(v?" ".concat("fs-exclude"):""),"data-hj-suppress":v||void 0,"data-hs-do-not-collect":v?"true":void 0,children:[!!y&&(0,r.jsx)(l.J,{fixed:!1,size:"sm"}),(0,r.jsx)("div",{className:"w-full border-gray-200",children:(0,r.jsx)(c.Z,{className:"leading-none",variant:"heading5",children:d})}),(0,r.jsx)("hr",{className:"-mx-3 sm:-mx-4 my-2 sm:my-3"}),(0,r.jsxs)("div",{className:"w-full py-2",children:[(0,r.jsx)(c.Z,{variant:"body",children:u}),!!h&&(0,r.jsx)(c.Z,{className:"mt-2 break-all",color:"text-gray-600",variant:"caption",children:h})]}),(0,r.jsx)("hr",{className:"-mx-3 sm:-mx-4 my-2 sm:my-3"}),(0,r.jsxs)("div",{className:"w-full flex flex-col-reverse sm:flex-row sm:justify-between gap-2 border-gray-200",children:[(0,r.jsx)(a.Z,{className:"w-full sm:w-auto",design:"secondary",disabled:g,onClick:w,children:p}),(0,r.jsx)(a.Z,{className:"w-full sm:w-auto",design:"primary",disabled:g,isLoading:g,onClick:x,children:m})]})]})};t.Z=e=>{let{handler:t,preOnCloseFn:n=()=>{},title:s="Are you sure?",message:a="It may not be possible to undo this action. Are you sure you want to proceed?",details:o="",confirmButtonText:l="Yes, Proceed.",cancelButtonText:c="No, Let me check.",canExit:u=!0,isLoading:h=!1,suppressRecording:m=!1}=e;(0,i._1)({closeOnEscape:u,closeOnClickOutside:u,customUI:e=>{let{onClose:i}=e;return(0,r.jsx)(d,{cancelButtonText:c,confirmButtonText:l,details:o,handler:t,initialIsLoading:h,message:a,onClose:i,preOnCloseFn:n,suppressRecording:m,title:s})}})}},1973:function(e,t,n){"use strict";var r=n(52322),s=n(2369),i=n(92942),a=n(13980),o=n.n(a);n(2784);var l=n(42369);let c=e=>{let{items:t,message:n,description:a,icon:o,showIcon:l,action:c}=e;return(0,r.jsxs)("div",{className:"w-full h-full flex justify-center items-center flex-col p-8",children:[!!l&&(0,r.jsx)(i.FontAwesomeIcon,{className:"text-gray-400 mb-2 text-3xl",icon:o||s.wK3,size:"xl"}),!!t&&(0,r.jsxs)("p",{className:"text-gray-500 text-center font-medium",children:["We couldn't load any ",t,"."]}),!!n&&(0,r.jsx)("p",{className:"text-gray-500 text-center font-medium",children:n}),!!a&&(0,r.jsx)("p",{className:"text-gray-400 text-center text-sm mt-1",children:a}),!!c&&(0,r.jsx)("div",{className:"mt-4",children:c})]})};c.propTypes={showIcon:o().bool,items:o().string,message:o().string,description:o().string,icon:o().object,action:o().node};let d=e=>{let{className:t,isLoading:n,action:a,items:o,message:d,description:u,icon:h,showIcon:m,isError:p}=e;return(0,r.jsxs)("div",{className:"w-full bg-transparent text-center flex flex-col items-center ".concat(t),children:[!n&&!p&&(0,r.jsx)(c,{action:a,description:u,icon:h,items:o,message:d,showIcon:m}),!n&&!!p&&(0,r.jsxs)("div",{className:"w-full flex flex-col justify-center items-center text-red-500",children:[(0,r.jsx)(i.FontAwesomeIcon,{className:"mb-2",icon:s.eHv,size:"xl"}),(0,r.jsx)("p",{className:"text-center font-medium",children:d||"An error occurred loading ".concat(null!=o?o:"data","...")}),!!u&&(0,r.jsx)("p",{className:"text-red-400 text-center text-sm mt-1",children:u}),!!a&&(0,r.jsx)("div",{className:"mt-4",children:a})]}),!!n&&(0,r.jsx)("div",{className:"w-full flex justify-center items-center",children:(0,r.jsx)(l.Z,{size:"sm"})})]})};d.propTypes={items:o().string,message:o().string,description:o().string,icon:o().object,action:o().node,className:o().string,
1showIcon:o().bool,isLoading:o().bool,isError:o().bool};let u=e=>{let{items:t,message:n,description:s,icon:i,action:a,className:o,showIcon:l=!0,design:c,isLoading:u=!1,isError:h=!1}=e;return"wrapped"===c?(0,r.jsx)("div",{className:"w-full bg-blue-50 p-4 rounded border border-dashed",children:(0,r.jsx)(d,{action:a,className:o,description:s,icon:i,isError:h,isLoading:u,items:t,message:n,showIcon:l})}):(0,r.jsx)(d,{action:a,className:o,description:s,icon:i,isError:h,isLoading:u,items:t,message:n,showIcon:l})};u.propTypes={items:o().string,message:o().string,description:o().string,icon:o().object,action:o().node,className:o().string,showIcon:o().bool,design:o().oneOf(["wrapped","default"]),isLoading:o().bool,isError:o().bool},t.Z=u},56486:function(){},94217:function(e,t,n){"use strict";var r,s,i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t._1=function(e){var t;document.body.classList.add("react-confirm-alert-body-element"),function(){if(!document.getElementById("react-confirm-alert-firm-svg")){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"feGaussianBlur");t.setAttribute("stdDeviation","0.3");var n=document.createElementNS(e,"filter");n.setAttribute("id","gaussian-blur"),n.appendChild(t);var r=document.createElementNS(e,"svg");r.setAttribute("id","react-confirm-alert-firm-svg"),r.setAttribute("class","react-confirm-alert-svg"),r.appendChild(n),document.body.appendChild(r)}}(),t=document.getElementById(e.targetId||f),e.targetId&&!t&&console.error("React Confirm Alert:","Can not get element id (#"+e.targetId+")"),t||(document.body.children[0].classList.add("react-confirm-alert-blur"),(t=document.createElement("div")).id=f,document.body.appendChild(t)),(p=(0,d.createRoot)(t)).render(l.default.createElement(m,e))};var o=n(2784),l=u(o),c=u(n(13980)),d=n(17029);function u(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var m=(s=r=function(e){function t(){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,t);for(var e,n,r,s=arguments.length,i=Array(s),a=0;a<s;a++)i[a]=arguments[a];return n=r=h(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.handleClickButton=function(e){e.onClick&&e.onClick(),r.close()},r.handleClickOverlay=function(e){var t=r.props,n=t.closeOnClickOutside,s=t.onClickOutside,i=e.target===r.overlay;n&&i&&(s(),r.close()),e.stopPropagation()},r.close=function(){var e,t,n,s=r.props.afterClose;document.body.classList.remove("react-confirm-alert-body-element"),e=r.props,(t=document.getElementById(e.targetId||f))&&p.unmount(t),(n=document.getElementById("react-confirm-alert-firm-svg"))&&n.parentNode.removeChild(n),document.body.children[0].classList.remove("react-confirm-alert-blur"),s()},r.keyboard=function(e){var t=r.props,n=t.closeOnEscape,s=t.onKeypressEscape,i=t.onkeyPress,a=t.keyCodeForClose,o=e.keyCode,l=27===o;a.includes(o)&&r.close(),n&&l&&(s(e),r.close()),i&&i()},r.componentDidMount=function(){document.addEventListener("keydown",r.keyboard,!1)},r.componentWillUnmount=function(){document.removeEventListener("keydown",r.keyboard,!1),r.props.willUnmount()},r.renderCustomUI=function(){var e=r.props,t=e.title,n=e.message,s=e.buttons;return(0,e.customUI)({title:t,message:n,buttons:s,onClose:r.close})},h(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.title,r=t.message,s=t.buttons,a=t.childrenElement,o=t.customUI,c=t.overlayClassName;return l.default.createElement("div",{className:"react-confirm-alert-overlay "+c,ref:function(t){return e.overlay=t},onClick:this.handleClickOverlay},l.default.createElement("div",{className:"react-confirm-alert"},o?this.renderCustomUI():l.default.createElement("div",{className:"react-confirm-alert-body"},n&&l.default.createElement("h1",null,n),r,a(),l.default.createElement("div",{className:"react-confirm-alert-button-group"},s.map(function(t,n){return l.default.createElement("button",i({ke
1y:n,className:t.className},t,{onClick:function(n){return e.handleClickButton(t)}}),t.label)})))))}}]),t}(o.Component),r.propTypes={title:c.default.string,message:c.default.string,buttons:c.default.array.isRequired,childrenElement:c.default.func,customUI:c.default.func,closeOnClickOutside:c.default.bool,closeOnEscape:c.default.bool,keyCodeForClose:c.default.arrayOf(c.default.number),willUnmount:c.default.func,afterClose:c.default.func,onClickOutside:c.default.func,onKeypressEscape:c.default.func,onkeyPress:c.default.func,overlayClassName:c.default.string},r.defaultProps={buttons:[{label:"Cancel",onClick:function(){return null},className:null},{label:"Confirm",onClick:function(){return null},className:null}],childrenElement:function(){return null},closeOnClickOutside:!0,closeOnEscape:!0,keyCodeForClose:[],willUnmount:function(){return null},afterClose:function(){return null},onClickOutside:function(){return null},onKeypressEscape:function(){return null}},s),p=null,f="react-confirm-alert"}},function(e){e.O(0,[4976,5351,9603,270,5855,2888,9774,179],function(){return e(e.s=882)}),_N_E=e.O()}]);
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.