1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8656],{22532:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/certificate",function(){return n(6354)}])},29035:function(e,t,n){"use strict";n.d(t,{R:function(){return r}});var r=function(e){return new Date(e).toLocaleString("en-US",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})}},6354:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return D}});var r=n(47568),i=n(70655),a=n(85893),o=n(67294),s=(n(48210),o.forwardRef((function(e,t){var n=e.name,r=e.workshopDetails,i=(0,o.useState)("2rem"),s=i[0],c=i[1];return(0,o.useEffect)((function(){var e=function(){window.innerWidth<=576?c("0.8rem"):c("2rem")};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),(0,a.jsx)("div",{className:"container",children:(0,a.jsx)("div",{className:"row d-flex justify-content-center align-items-center",children:(0,a.jsx)("div",{className:"col-12 col-md-8",children:(0,a.jsxs)("div",{ref:t,className:"certificate-container",style:{position:"relative"},children:[(0,a.jsx)("img",{src:r[0].template_image,alt:"Certificate Template",style:{width:"100%"},crossOrigin:"anonymous"}),(0,a.jsx)("div",{className:"participant-name",style:{fontFamily:"Nunito",position:"absolute",top:"45%",left:"0",width:"100%",textAlign:"center",fontSize:s,fontWeight:"bold",color:"#333",textTransform:"uppercase"},children:n})]})})})})}))),c=n(10682),l=n(78182),u=n(4492),d=n(35005),h=n(55892),f=n(49704),m=n.n(f),p=n(41664),g=n.n(p),x=n(73380),v=n.n(x),_=function(e){var t=e.onNameSubmit,n=e.canEdit,s=e.workshopDetails,f=e.isWorkshopsLoading,p=(0,o.useState)(""),x=p[0],_=p[1],w=(0,o.useState)(!1),j=w[0],b=w[1],k=(0,o.useState)(!1),N=k[0],S=k[1],y=(0,o.useState)(!1),C=y[0],Z=y[1],L=(0,o.useState)(!1),I=L[0],E=L[1],D=function(){var e=(0,r.Z)((function(e){var t,n,r,a,o,s;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return Z(!0),e.preventDefault(),S(!1),t=e.target.value,(n=localStorage.getItem("studentToken"))||setProfile(!1),r=m().decode(n),[4,h.Z.get("getUser/".concat(r.id))];case 1:return a=i.sent().data,o=a.data[0].firebase_uid,s={workshop:t,firebase_uid:o},[4,h.Z.post("/validate-certificate-user",s)];case 2:return i.sent().data.status?(b(!0),Z(!1)):(b(!1),Z(!1)),[2]}}))}));return function(t){return e.apply(this,arguments)}}();return(0,o.useEffect)((function(){var e=function(){var e=(0,r.Z)((function(){return(0,i.__generator)(this,(function(e){return s.length>0&&E(!1),[2]}))}));return function(){return e.apply(this,arguments)}}();e();var t=localStorage.getItem("Name"),n=localStorage.getItem("Certificate name");t&&_(n||t)}),[]),(0,a.jsx)(c.Z,{className:"padd mt-5",children:(0,a.jsxs)(l.Z,{className:"p-4 shadow",style:{maxWidth:"600px",margin:"0 auto"},children:[(0,a.jsx)("h2",{className:"text-center mb-4",children:"Aifer Certificate Generator"}),(0,a.jsxs)(u.Z,{onSubmit:function(e){e.preventDefault(),j?t(x):S(!0)},children:[(0,a.jsxs)(u.Z.Group,{controlId:"formName",className:"mb-3",children:[(0,a.jsx)(u.Z.Label,{children:"Enter Full Name"}),(0,a.jsx)(u.Z.Control,{type:"text",placeholder:"Participant Name",value:x,onChange:function(e){var t=e.target.value;n&&_(t)},required:!0,size:"lg"})]}),(0,a.jsx)(u.Z.Label,{children:"Select program"}),(0,a.jsxs)(u.Z.Select,{className:"mb-3",disabled:f,onChange:D,children:[(0,a.jsx)("option",{children:f?"Loading courses...":s.length>0?"Select the course":"No courses available"}),s.length>0&&s.map((function(e,t){return(0,a.jsx)("option",{value:e.course_id,children:e.program},t)}))]}),(0,a.jsx)(d.Z,{variant:"primary",type:"submit",className:"w-100 py-2",disabled:I,children:C?(0,a.jsxs)(a.Fragment,{children:["Please wait"," ",(0,a.jsx)(v(),{color:"#fff",size:13,speedMultiplier:1})]}):"Generate Certificate"})]}),N&&(0,a.jsxs)("p",{className:"text-danger",children:["Unable to download the certificate. Please verify your registered mobile number or ensure that you are enrolled in the selected course. ",(0,a.jsx)(g(),{href:"tel:+919339100300",children:"Need Help ?"})," "]})]})})},w=n(73103),j=n(25675),b=n.n(j),k=n(15606),N=n.n(k),S=n(6212),y=n(61120),C=n.n(y),Z=n(91819),L=n(9473),I=n(57307),E=n(29035);var D=function(){var e=(0,o.useState)(""),t=e[0],n=e[1],c=(0,o.useState)(""),l=c[0],u=c[1],f=(0,o.useState)(!1),p=f[0],x=f[1],v=(0,o.useState)(!1),j=v[0],k=v[1],y=(0,o.useState)(!1),D=y[0],F=y[1],M=(0,o.useState)(!1),P=M[0],z=M[1],T=(0,o.useState)(!0),B=T[0],R=T[1],A=(0,o.useState)([]),W=A[0],O=A[1],G=(0,o.useState)(!1),K=G[0],U=G[1],H=(0,L.I0)(),X=(0,L.v9)((function(e){return e.user.value})),J=(0,o.useRef)(),Q=function(){k(!1),window.location.reload()},Y=function(){var e=(0,r.Z)((function(){var e,t,n,r,a;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:if(!J.current)return[2];e=J.current,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,C()(e,{scale:2,useCORS:!0})];case 2:return t=i.sent(),n=t.toDataURL("image/png"),(r=new Z.ZP({orientation:"landscape",unit:"mm",format:[.264583*t.width,.264583*t.height]})).addImage(n,"PNG",0,0,.264583*t.width,.264583*t.height),r.save("Certificate-".concat(l,".pdf")),z(!0),localStorage.setItem("Download certificate",!0),localStorage.setItem("Certificate name",l),V(),[3,4];case 3:return a=i.sent(),console.error("Error generating PDF:",a),[3,4];case 4:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){H((0,I.Mi)())}),[H]),(0,o.useEffect)((function(){localStorage.getItem("Download certificate")&&R(!1);var e=localStorage.getItem("studentToken");if(e){if(m().decode(e).id){var t=localStorage.getItem("Name");n(t)}}else k(!0);var a=function(){var e=(0,r.Z)((function(){var e;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return U(!0),[4,h.Z.get("/get-all-workshps")];case 1:return(e=t.sent().data).status&&e.data.length>0&&O(e.data),U(!1),[2]}}))}));return function(){return e.apply(this,arguments)}}();a()}),[]);var V=function(){var e=(0,r.Z)((function(){var e,t;return(0,i.__generator)(this,(function(n){try{e=(0,E.R)(new Date),(t=new FormData).append("FullName",l),t.append("Date",e),t.append("Mobile",X.mobile),t.append("Program",W[0].program),fetch("https://script.google.com/macros/s/AKfycbwp92IgIugtVStwxX6K-f8obBItkch4tsYWolRr0vUdCiCJ-QVg77AXn0FJ0Ewxa9sOZA/exec",{method:"POST",body:t})}catch(r){console.log(r)}return[2]}))}));return function(){return e.apply(this,arguments)}}();return(0,a.jsxs)("div",{className:"padd",children:[(0,a.jsx)("section",{style:{position:"fixed",top:"0",width:"100%",zIndex:"1",padding:"0",paddingLeft:"20px",paddingRight:"20px",backgroundColor:"white"},children:(0,a.jsxs)("div",{className:"div-2 d-flex align-items-center justify-content-between",style:{paddingTop:"10px"},children:[(0,a.jsx)(g(),{href:"/",children:(0,a.jsx)(b(),{loading:"lazy",height:60,style:{cursor:"pointer",padding:"10px"},width:120,className:"img",src:"/images/Aifer Logo Final.png"})}),(0,a.jsx)("div",{}),t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{fontFamily:"Mulish, sans-serif",justifyContent:"center",borderRadius:"34px",border:"2px solid",fontWeight:"bold",color:"#003f3f",margin:"auto 0",padding:"10px 25px",cursor:"pointer"},onClick:function(){return F(!D)},children:t}),D&&(0,a.jsx)("div",{id:"more-menu",className:"ms-5 ".concat(N().openSigninsignup," ").concat(N().moreMenu," ").concat(N().doMoreMenu," ").concat(D?"d-block":""),children:(0,a.jsx)("div",{className:"hover-menu-container",children:(0,a.jsx)("div",{className:"".concat(N().hoverLinks),children:(0,a.jsx)("ul",{className:"".concat(N().hoverList),children:(0,a.jsx)("li",{className:"".concat(N().hoverLink),onClick:function(){localStorage.removeItem("studentToken"),localStorage.removeItem("Name"),localStorage.removeItem("Download certificate"),window.location.reload()},children:(0,a.jsxs)("a",{children:[(0,a.jsx)("i",{className:"fa fa-angle-right"})," Logout"]})})})})})})]}):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{style:{fontFamily:"Mulish, sans-serif",justifyContent:"center",borderRadius:"34px",border:"2px solid",fontWeight:"bold",color:"#003f3f",margin:"auto 0",padding:"10px 25px",cursor:"pointer"},onClick:function(){return k(!0)},children:"Join Now"})})]})}),j&&(0,a.jsx)(w.default,{onClose:Q,onSource:"Website",disableClose:!0}),(0,a.jsxs)("div",{className:"App",children:[p?(0,a.jsx)("div",{className:"mt-3 ",children:(0,a.jsxs)("div",{className:"text-center ",children:[(0,a.jsx)("div",{className:"",children:(0,a.jsx)("button",{onClick:Y,className:"zoom-pulse btn btn-lg btn-outline-success my-5 me-2 w-50 ",children:"Click to download"})}),(0,a.jsx)(s,{ref:J,name:l,workshopDetails:W})]})}):(0,a.jsx)(_,{onNameSubmit:function(e){u(e),x(!0)},canEdit:B,workshopDetails:W,isWorkshopsLoading:K}),P&&(0,a.jsxs)(S.Z,{show:P,onHide:function(){return Q()},centered:!0,children:[(0,a.jsx)(S.Z.Header,{closeButton:!0,children:(0,a.jsx)(S.Z.Title,{children:"Download Complete"})}),(0,a.jsx)(S.Z.Body,{children:"\ud83c\udf89 Your certificate is now downloaded! Thanks for learning with Aifer \u2014 we appreciate you!"}),(0,a.jsx)(S.Z.Footer,{children:(0,a.jsx)(d.Z,{variant:"secondary",onClick:function(){return Q()},children:"Close"})})]})]})]})}},15606:function(e){e.exports={joinNow:"k_tet_joinNow__I4nob",openSigninsignup:"k_tet_openSigninsignup__L9KG9",hoverLinks:"k_tet_hoverLinks__pewCF",hoverList:"k_tet_hoverList__Lz6nF",hoverLink:"k_tet_hoverLink__5lKLI",moreMenu:"k_tet_moreMenu__lCBlE","d-block":"k_tet_d-block__YhhuZ",doMoreMenu:"k_tet_doMoreMenu__kQrF_",homeBanner:"k_tet_homeBanner__SyPHs",ctaBtnDiv:"k_tet_ctaBtnDiv__nvEFE",ctaBtn:"k_tet_ctaBtn__QkvbK",container3:"k_tet_container3__Auzz5"}}},function(e){e.O(0,[4838,3365,4738,3590,5443,96,7847,5675,8662,1886,4575,4444,6433,2760,5318,8426,3103,9774,2888,179],(function(){return t=22532,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.