1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8414],{43859:(e,s,l)=>{"use strict";l.r(s),l.d(s,{default:()=>x});var t=l(6029),a=l(55729),n=l(81278),r=l(71422),i=l(47623),c=l(25961),u=l(31240),o=l(13771),d=l(47165);let h={newCoachSlug:"",reason:"",hasCourtesyReview:!1},m=i.object({newCoachSlug:i.string(),reason:i.string()}),x=(0,l(72373).s5)(()=>{let e=(0,n.useRouter)(),[s,l]=(0,a.useState)(null),[i,x]=(0,a.useState)([]),[w,f]=(0,a.useState)(!1),{id:v,type:b,email:g,oldCoachSlug:j,returnPath:y}=e.query,p=async s=>{l(null);try{await (0,c.TWb)({id:v,hasCourtesyReview:w,newCoach:w?i.find(e=>e.slug===s.newCoachSlug):null,reason:w?s.reason:null}),e.push(y)}catch(e){l(e)}};return(0,a.useEffect)(()=>{(async()=>{try{let{coaches:e}=await (0,c.VJx)(),s="call"===b?"Resume Review Call":"Resume Review",l=e.filter(e=>{var l;return(null==(l=e.Services)?void 0:l.includes(s))&&e.slug!==j}).sort((e,s)=>e.Name.localeCompare(s.Name));x(l)}catch(e){l("Failed to load coaches")}})()},[]),(0,t.jsxs)("div",{className:"mx-auto max-w-6xl px-4 pt-6 pb-20",children:[(0,t.jsx)("h1",{className:"w-full block my-2 md:my-4 text-xl md:text-4xl text-center font-bold text-gray-900",children:"Refund Resume Review"}),(0,t.jsxs)("div",{className:"text-center font-medium",children:[(0,t.jsx)("p",{children:"Resume review for: ".concat(g)}),(0,t.jsx)("p",{children:"Coach: ".concat(j)})]}),(0,t.jsx)(r.l1,{initialValues:h,validationSchema:m,onSubmit:p,children:e=>{let{isSubmitting:l}=e;return(0,t.jsx)(r.lV,{className:"w-full flex flex-col items-center mt-10",children:(0,t.jsx)("div",{className:"w-full lg:w-3/5",children:(0,t.jsxs)(d.A,{className:"mt-5 mb-5",children:[(0,t.jsxs)("fieldset",{disabled:l,children:[(0,t.jsxs)("p",{className:"text-sm mt-2 bg-gray-100 p-3 rounded-lg mb-4",children:["This will mark the session in the backend as refunded. This will"," ",(0,t.jsx)("b",{children:"not"})," ","refund the money to the student. Optionally, you may provide the student with a courtesy session. An email will be sent out informing the new coach of this courtesy session."]}),(0,t.jsx)(u.Sc,{label:"Offer a courtesy review",name:"hasCourtesyReview",onClick:()=>f(!w)}),w&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.l6,{label:"Select new coach to assign this courtesy resume review to:",name:"newCoachSlug",className:"w-full mr-2",children:[(0,t.jsx)("option",{disabled:!0,selected:!0,value:"",children:"Use coach matching algorithm to decide"}),null==i?void 0:i.map(e=>(0,t.jsx)("option",{value:e.slug,children:e.Name}))]}),(0,t.jsx)(u.fs,{label:"Reason for refund (to be shared with new coach)",name:"reason",type:"text"})]})]}),(0,t.jsx)("div",{className:"flex mt-4 w-full",children:!l&&(0,t.jsx)(o.Ay,{type:"submit",className:"w-full",size:o.lO.LARGE,loading:l,disabled:l,children:"Submit"})}),s&&(0,t.jsx)("div",{className:"mt-2 text-base font-medium leading-tight text-red-600",children:s.message})]})})})}})]})})},47165:(e,s,l)=>{"use strict";l.d(s,{A:()=>n});var t=l(6029);l(55729);var a=l(51369);function n(e){let{shadow:s=!0,border:l=!1,className:n,children:r,...i}=e;return(0,t.jsx)("div",{className:(0,a.cx)("bg-white rounded-lg px-4 py-5 sm:p-6",{shadow:s,"border border-gray-200":l},n),...i,children:r})}},64795:(e,s,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/refund",function(){return l(43859)}])},72373:(e,s,l)=>{"use strict";l.d(s,{ZA:()=>c,rd:()=>i,s5:()=>u});var t=l(6029),a=l(55729),n=l(81278),r=l(57521);let i=e=>{let s=(0,n.useRouter)();return(0,a.useEffect)(()=>{s.replace(e.to)},[]),null},c=e=>s=>{let{currentUser:l,loading:a}=(0,r.Us)(),c=(0,n.useRouter)();return a?null:l?(0,t.jsx)(e,{...s}):(0,t.jsx)(i,{to:"/login?returnPath=".concat(c.asPath)})},u=e=>s=>{let{currentUser:l,loading:a}=(0,r.Us)();return a?null:(null==l?void 0:l.role)!=="admin"?(0,t.jsx)(i,{to:"/not-found"}):(0,t.jsx)(e,{...s})}}},e=>{e.O(0,[5789,1479,525,2342,6184,2953,7623,1240,6593,636,8792],()=>e(e.s=64795)),_N_E=e.O()}]); 2//# sourceMappingURL=refund-788b5a19163aeec6.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.