1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7700],{47900:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/adminResumeGenerator",function(){return r(47397)}])},70749:function(e,n,r){"use strict";r.d(n,{f:function(){return l}});var t=r(24246),s=r(90005),i=r.n(s),u=r(84079),a=r.n(u),l=function(e){var n=e.id,r=e.label,s=e.error,u=e.children,l=e.className,c=e.errorClassName;return(0,t.jsxs)("div",{className:i()("position-relative",l),children:[r&&(0,t.jsx)("label",{htmlFor:n,className:i()("d-block z-leading-18px z-font-600 z-mb-14",{"red-text":!!s}),children:r}),u,s&&(0,t.jsx)("span",{className:i()("d-block position-absolute formInputError z-font-12 z-leading-16px z-font-600",a().error,c),children:s})]})}},31014:function(e,n,r){"use strict";r.d(n,{D:function(){return t}});var t="rb-subscription-modal"},98556:function(e,n,r){"use strict";r.d(n,{R:function(){return f}});var t=r(29132),s=r(78203),i=r(59312),u=r(44706),a=r(31014),l=r(12766),c=r(2294),o=r(34293),d=r(30816).Buffer;var f=function(){var e,n=(0,s.Z)((0,l.dE)(),2),r=n[0],f=n[1],m=(0,s.Z)((0,l.Nm)(),2),p=m[0],h=m[1],v=(0,u.Zk)(),b=(e=(0,t.Z)((function(e,n){var t,s,l,f,m,h,b,g,_,x;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return s=(t=n||{}).filename,l=t.saveToS3,f=void 0===l||l,m=t.dontForceRedirect,e?(h=!1,[4,(f?function(){return r({id:e._id})}:function(){return p({resume:e})})()]):[2,{size:null,success:!1}];case 1:return b=i.sent(),g=b.data,function(e){return e&&void 0!==e.status}(_=b.error)&&403===_.status&&(h=!0),h?(v.enqueuePopup({id:a.D,priority:u.Xl.IMMEDIATE,props:{dontForceRedirect:m}}),[2,{size:null,success:!1}]):g?(x=function(e){if((null==e?void 0:e.resumeName)&&"My Resume"!==(null==e?void 0:e.resumeName))return(null==e?void 0:e.resumeName.replace(/\s+/g,"_").replace(/[^a-zA-Z0-9_\.]/g,""))+".pdf";var n=["zippia_resume",(0,c.Omm)(e.firstName),(0,c.Omm)(e.lastName),(0,c.Omm)(e.headline)].filter(Boolean).join("_");return"".concat(n,".pdf")}(e),(0,o.qG)(g.data,null!=s?s:x),[2,{size:d.from(g.data).byteLength,success:!0}]):[2,{size:null,success:!1}]}}))})),function(n,r){return e.apply(this,arguments)});return{download:b,isDownloading:f.isLoading||f.isFetching||h.isLoading||h.isFetching}}},47397:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return p}});var t=r(29132),s=r(78203),i=r(59312),u=r(24246),a=r(27378),l=r(70749),c=r(94847),o=r(98556),d=r(20601),f=r(34293),m=["userid","zippiauserid"];function p(){var e,n=(0,a.useRef)(null),r=(0,a.useState)([]),p=r[0],h=r[1],v=(0,a.useState)(null),b=v[0],g=v[1],_=(0,a.useState)(null),x=_[0],z=_[1],w=(0,a.useRef)([]),N=(0,a.useState)(!1),j=N[0],I=N[1],y=(0,a.useState)(!1),R=y[0],k=y[1],S=(0,s.Z)((0,d.X4)(),2),T=S[0],Z=S[1].data,C=(0,o.R)(),E=function(e){return new Promise((function(n,r){var t=new FileReader;t.onload=function(e){var t,s=(null===(t=e.target)||void 0===t?void 0:t.result).split("\n"),i=s[0].split(",").findIndex((function(e){var n=e.toLowerCase().trim();return m.includes(n)}));if(-1===i)return alert('CSV file must contain a "userId" or "zippiaUserId" column'),void r('CSV file must contain a "userId" or "zippiaUserId" column');var u=s.slice(1).map((function(e){var n;return null===(n=e.split(",")[i])||void 0===n?void 0:n.trim()})).filter(Boolean);h(u),n(u)},t.onerror=function(e){r(e)},t.readAsText(e)}))},F=(e=(0,t.Z)((function(e){var n,r;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:n=function(n){var r,t,s,u,a;return(0,i.__generator)(this,(function(l){switch(l.label){case 0:r=e[n],setTimeout((function(){return z(n)}),0),l.label=1;case 1:return l.trys.push([1,9,,10]),[4,T({userIdFromAdminGenerator:r,start:0,numResumes:50}).unwrap()];case 2:if(!((t=l.sent()).length>0))return[3,7];s=function(e){var n,s;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return n=t[e],setTimeout((function(){return g(e)}),0),[4,(u=500,new Promise((function(e){return setTimeout(e,u)})))];case 1:return i.sent(),[4,C.download(n)];case 2:return s=i.sent(),w.current.push({userId:r,resumeId:n._id,size:String(s.size),success:s.success}),[2]}var u}))},setTimeout((function(){return k(!0)}),0),u=0,l.label=3;case 3:return u<t.length?[5,(0,i.__values)(s(u))]:[3,6];case 4:l.sent(),l.label=5;case 5:return u++,[3,3];case 6:return[3,8];case 7:w.current.push({userId:r,resumeId:null,size:null,success:!1}),l.label=8;case 8:return[3,10];case 9:return a=l.sent(),w.current.push({userId:r,resumeId:null,size:null,success:!1}),console.error(a),[3,10];case 10:return[2]}}
1))},r=0,t.label=1;case 1:return r<e.length?[5,(0,i.__values)(n(r))]:[3,4];case 2:t.sent(),t.label=3;case 3:return r++,[3,1];case 4:return I(!0),k(!1),[2]}}))})),function(n){return e.apply(this,arguments)}),D=function(){var e=(0,t.Z)((function(e){var r,t,s,u,a,l,c;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return e.preventDefault(),(s=null===(r=n.current)||void 0===r||null===(t=r.files)||void 0===t?void 0:t[0])?[4,E(s)]:[3,3];case 1:return u=i.sent(),[4,F(u)];case 2:return i.sent(),[2];case 3:return a=new FormData(e.target),(l=a.get("userId"))?(h(c=[l]),[4,F(c)]):[3,5];case 4:i.sent(),i.label=5;case 5:return[2]}}))}));return function(n){return e.apply(this,arguments)}}();return(0,u.jsxs)("main",{className:"container z-py-48",children:[(0,u.jsx)("h1",{className:"interH3",children:"Admin resume generator"}),(0,u.jsxs)("p",{className:"z-mb-48",children:["This page is used to generate resumes for a list of users.",(0,u.jsx)("br",{}),'The CSV file should have a header called "userId" or "zippiaUserId" and the rest of the columns will be ignored.']}),(0,u.jsxs)("form",{className:"d-flex gg-20 align-items-end",onSubmit:D,children:[(0,u.jsx)(l.f,{label:"User ID",id:"userId",children:(0,u.jsx)("input",{id:"userId",type:"text",className:"zp-input zp-input-l",disabled:R})}),(0,u.jsxs)(l.f,{label:"CSV File",id:"csvFile",children:[(0,u.jsx)("input",{ref:n,id:"csvFile",type:"file",hidden:!0}),(0,u.jsx)(c.ZP,{type:"button",theme:"secondary",size:"big",onClick:function(){var e;return null===(e=n.current)||void 0===e?void 0:e.click()},disabled:R,children:"Upload file"})]}),(0,u.jsx)(c.ZP,{type:"submit",size:"big",disabled:R,children:"Generate"})]}),(0,u.jsxs)("div",{className:"z-mt-24 d-flex gg-20",children:[null!==x&&!!(null==p?void 0:p.length)&&(0,u.jsx)("span",{children:"".concat(x+1," / ").concat(p.length," Users processed")}),null!==b&&!!(null==Z?void 0:Z.length)&&(0,u.jsx)("span",{children:"".concat(b+1," / ").concat(null==Z?void 0:Z.length," Resumes generated for ").concat(p[x])})]}),j&&(0,u.jsxs)("div",{className:"z-mt-48",children:[(0,u.jsx)("h2",{className:"interH3",children:"Done"}),(0,u.jsx)("p",{className:"z-mt-24",children:"The resumes have been generated. You can download the report below."}),(0,u.jsx)(c.ZP,{type:"button",theme:"secondary",size:"big",onClick:function(){var e=(0,f.EG)(w.current),n=new Blob([e],{type:"text/csv"}),r=URL.createObjectURL(n),t=document.createElement("a");t.href=r,t.download="report.csv",t.click()},children:"Download report"})]})]})}p.getInitialProps=f.kK},84079:function(e){e.exports={error:"inputContainer_error___4Z4t"}}},function(e){e.O(0,[2888],(function(){return n=47900,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
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.