1import{f as Ht,r as i,A as ht,t as qt,M as pt,w as Bt,x as ot,j as e,F as aa,d as h,y as Ee,o as fe,s as lt,aB as sa,D as he,l as Ne,Q as Se,ay as Be,m as Pe,h as Vt,aC as ra,B as nt,Y as ia,$ as la,T as Xe,b as Kt,aD as Lt,n as oa,Z as na,H as da,aE as ca}from"./index-DOEDGpFv.js";import{f as ma,a as _a,m as ua,b as pa,n as ha,c as fa,W as ga,p as At}from"./userIcon-DRRYbDdc.js";import{c as ba,b as Ce,a as Ge,h as xa,d as ya,e as va,i as ja,u as wa}from"./index.esm-DaRz_fRj.js";import{C as Wt}from"./CustomDropdown-KMCu6Cw8.js";import{T as te}from"./ToolTip-Oz3uT3D_.js";import{C as Ca}from"./CustomDate-CuqrGms7.js";import{P as Na}from"./PillsDropdown-Cc7vs6KQ.js";import{R as ut}from"./Radio-BcikqwZL.js";import{F as Qe}from"./FormControlLabel-Cv1jetH4.js";import{C as Sa}from"./Checkbox-DKFnH0fc.js";import{C as Pa,i as $t,E as Fa,a as ka,P as Ta,S as Da,u as Ia,p as za,b as Ua}from"./PhysicalDescription-CWxUMfd1.js";import{u as Ea,a as Ra,P as Ba,D as Va,c as La,S as Aa,r as Wa,d as $a,e as Ma,C as Oa}from"./sortable.esm-CZTjz6Wk.js";import{M as Ya,O as Ha}from"./OnImgHover-Ckz1eiDS.js";import{S as qa,s as Re,a as Ka,b as Za,c as Ga}from"./Stepper-DIOmvNXx.js";import{S as Qa}from"./Stack-Wv7UNWCe.js";import"./OTPTimer-23lobUh5.js";import"./Autocomplete-BiTc0fK0.js";/* empty css */import"./info_circle-CPn1_Ob8.js";import"./AdapterDateFns-hg84jjcw.js";import"./DateCalendar-BvCUxFPP.js";import"./useThemeProps-AF4bYKqg.js";import"./useThemeProps-BeptFCZJ.js";import"./DesktopDatePicker-gwORp2KB.js";import"./InputAdornment-CYJ-dB-y.js";import"./listItemButtonClasses-COmYTSa9.js";import"./close_icon-CFZZ4lWI.js";/* empty css */import"./Approached-DVAAqn9n.js";import"./Newlink-Dq114FOE.js";import"./lookingtalentimg-C9ouOiIq.js";import"./arrowdown-CxN2_ZBY.js";import"./noTalent-DJxnUYyh.js";import"./recruiter_404-BprXiUuV.js";import"./ArrowDropDown-BNWd2-nS.js";import"./styled-Om9RrDqq.js";function Xa({HandleForms:c,formSubmit:u}){var rt,it,Me,Oe,Ye,He,qe,Ke,Ze,l,n,_,m,y,b,G,Ue,pe,ft,gt,bt,xt,yt,vt,jt,wt,Ct,Nt,St,Pt,Ft,kt,Tt,Dt,It;const[r,E]=Ht.useState(!1),[j,d]=i.useState(!1),[Q,k]=i.useState(!1),[D,x]=i.useState(!1),[f,V]=i.useState(!1),L=()=>{d(!0),be(180),xe(!1);let s={user_id:t.user_id,user_type:1,mobile:a.values.mobile};At.sendOTP(s).then(o=>{o.httpCode===200?(E(!0),O(null)):o.httpCode===409?(O(o.message||"This number is already registered. Please use a different number."),N(o.message||"This number is already in use","error")):o.httpCode===401||o.httpCode===403?(O("Session expired. Please login again."),N("Your session has expired. Please refresh and try again.","error")):(o.httpCode===500||o.httpCode>=400)&&(O(o.message||"Unable to send OTP. Please try again."),N(o.message||"Something went wrong. Please try again.","error"))}).catch(o=>{console.error("OTP send error:",o),O("Network error. Please check your connection and try again."),N("Network error. Please try again.","error")}).finally(()=>{d(!1)})},ae=()=>{E(!1)},{user:t,updateUser:R,dependencyData:B}=i.useContext(ht),{openSnackbar:N}=i.useContext(qt),[X,ge]=i.useState(!1),[Fe,be]=i.useState(180),[Z,xe]=i.useState(!1),[de,ke]=i.useState([]),Te=i.useRef(),[De,Ie]=i.useState(!1),[Ve,J]=i.useState([]),[Le,le]=i.useState(null),[ce,O]=i.useState(null),[Y,oe]=i.useState(!1),[se,w]=i.useState([]),[S,A]=i.useState(!1),I=i.useRef(null),ye=i.useRef(!0),ve=i.useRef(!0);i.useEffect(()=>{var s;if(B!=null&&B.city){const o=B.city.filter(W=>W.id!=1&&W.id!=2);ke(o);const p=o.slice(0,10);if((s=t==null?void 0:t.talenter)!=null&&s.current_city)if(p.find(F=>{var C;return F.id===((C=t==null?void 0:t.talenter)==null?void 0:C.current_city)}))J(p);else{const F=o.find(C=>{var T;return C.id===((T=t==null?void 0:t.talenter)==null?void 0:T.current_city)});J(F?[F,...p]:p)}else J(p)}window.scrollTo(0,0)},[B,(rt=t==null?void 0:t.talenter)==null?void 0:rt.current_city]);const H=s=>{Ie(!0);let o={user_id:t.user_id,otp:s,otp_type:"mobile",mobile:a.values.mobile};At.verifyOtp(o).then(p=>{p.httpCode===200?(ae(),le(a.values.mobile),a.setFieldValue("is_mobile_verified",!0),ze(a.values,!0)):k(!0)}).finally(()=>{Ie(!1)})},ne=(s,o,p)=>{s.target.value.length<=50?p(o,s.target.value):s.preventDefault(),s.stopPropagation()},P=s=>s.target.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1");function g(s,o){const p=new RegExp("("+o.join("|").replace(/\./g,"\\.")+")$").test(s.name.toLowerCase());return p||(a.setFieldValue("proof_doc",""),a.setFieldValue("proof_img","")),p}const q=pt("input")({display:"none"}),v=s=>s.trim().replace(/\s+/g,"_").replace(/[^a-zA-Z0-9_.-]/g,""),me=s=>{const o=v((t==null?void 0:t.first_name)||"talent"),p=v(s.name);return`Talent/${(t==null?void 0:t.user_id)||"unknown"}_${o}/${Date.now()}_${p}`};function ee(s,o=new Date){return o.setFullYear(o.getFullYear()-s),o}const _e=ba({talent_type:ja().min(1,"Please select at least one profession").required("Are you an Actor? Model? Or both?"),year:Ce().min(4),first_name:Ce().required("We work on a first name basis, so need this"),last_name:Ce().required("We also need to know y
1our last name"),current_city:Ce().required("Your current place of residence please"),date_of_birth:va().min(ee(100),"Please enter a vaild date of birth").max(new Date,"Please enter a vaild date of birth").required("When were you born?").default(void 0),mobile:Ce().required("We need this for notifications. No spam messages. Promise").matches(Bt,"Please enter valid mobile number"),gender:ya().required("Please select your gender").typeError("Please select your gender"),receive_whatsapp_updates:Ge(),is_mobile_verified:xa().test("is-verified","Please verify phone number to proceed",s=>s===!0),show_to_recruiters:Ge(),has_manager:Ge(),receive_manager_mobile_updates:Ge(),receive_manager_email_updates:Ge(),mananger_email_address:Ce().ensure().when("has_manager",{is:!0,then:s=>s.required("Your manager's email please").email("Please enter valid email")}),mananger_mobile_number:Ce().ensure().when("has_manager",{is:!0,then:s=>s.required("Your manager's mobile number").matches(Bt,"Please enter valid mobile number")})});let K=[{id:1,type_name:"Model"},{id:2,type_name:"Actor"}],je=[{id:"1",value:"Aadhaar Card"},{id:"2",value:"Driving License"},{id:"3",value:"Pan Card"},{id:"4",value:"Passport"},{id:"5",value:"Other"}];i.useEffect(()=>{w(K)},[]);const Ae=s=>{const o=[s.talent_type&&s.talent_type.length>0,s.first_name,s.last_name,s.current_city,s.date_of_birth,s.mobile,s.gender!==void 0&&s.gender!==null,s.is_mobile_verified];return s.has_manager&&o.push(s.mananger_email_address,s.mananger_mobile_number),o.every(p=>p)},ze=async(s,o=!1)=>{ye.current&&!o||(I.current&&clearTimeout(I.current),I.current=setTimeout(async()=>{var p,W,F,C,T,U,$,M,re,_t,zt,Ut;try{A(!0);const ie=(we,Rt,ta=!1)=>ta?!we||we.length===0?Rt||[]:we:we==null||we===""?Rt||null:we,Gt=s.mobile||(t==null?void 0:t.mobile)||"",Qt={first_name:s.first_name?ue(s.first_name):(t==null?void 0:t.first_name)||"",last_name:s.last_name?ue(s.last_name):(t==null?void 0:t.last_name)||"",date_of_birth:ie(s.date_of_birth,t==null?void 0:t.date_of_birth),mobile:Gt,receive_whatsapp_updates:s.receive_whatsapp_updates,last_updated_on:new Date},Xt=Ae(s),Jt={user_id:t.user_id,talent_type:ie(s.talent_type,(p=t==null?void 0:t.talenter)==null?void 0:p.talent_type,!0),current_city:ie(s.current_city,(W=t==null?void 0:t.talenter)==null?void 0:W.current_city),gender:s.gender!==void 0&&s.gender!==null?s.gender:(F=t==null?void 0:t.talenter)==null?void 0:F.gender,show_to_recruiters:s.show_to_recruiters,id_number:ie(s.id_number,(C=t==null?void 0:t.talenter)==null?void 0:C.id_number)||"",proof_doc:ie(s.proof_doc,(T=t==null?void 0:t.talenter)==null?void 0:T.proof_doc)||"",proof_img:ie(s.proof_img,(U=t==null?void 0:t.talenter)==null?void 0:U.proof_img)||"",last_activity_page:Xt?(($=t==null?void 0:t.talenter)==null?void 0:$.last_activity_page)>1?(M=t==null?void 0:t.talenter)==null?void 0:M.last_activity_page:1:0,has_manager:s.has_manager,id:(re=t==null?void 0:t.talenter)!=null&&re.id?(_t=t==null?void 0:t.talenter)==null?void 0:_t.id:null,personal_data_updated_on:new Date},ea={user_id:t.user_id,mananger_email_address:ie(s.mananger_email_address,(zt=t==null?void 0:t.manager)==null?void 0:zt.mananger_email_address)||"",mananger_mobile_number:ie(s.mananger_mobile_number,(Ut=t==null?void 0:t.manager)==null?void 0:Ut.mananger_mobile_number)||"",receive_manager_mobile_updates:s.receive_manager_mobile_updates,receive_manager_email_updates:s.receive_manager_email_updates},Et=await ot.handleUserData({user_id:t.user_id,user:Qt,talenter:Jt,manager:ea});(Et.status===200||Et.httpCode===200)&&await R()}catch(ie){console.error("Auto-save error:",ie),N("Failed to save data","error")}finally{A(!1)}},o?0:1e3))},a=wa({validateOnMount:!0,validateOnChange:!0,validateOnBlur:!0,initialValues:{talent_type:(it=t==null?void 0:t.talenter)!=null&&it.talent_type?Array.isArray((Me=t==null?void 0:t.talenter)==null?void 0:Me.talent_type)?(Oe=t==null?void 0:t.talenter)==null?void 0:Oe.talent_type:[(Ye=t==null?void 0:t.talenter)==null?void 0:Ye.talent_type]:[],first_name:t!=null&&t.first_name?t==null?void 0:t.first_name:"",last_name:t!=null&&t.last_name?t==null?void 0:t.last_name.trim():"",current_city:(He=t==null?void 0:t.talenter)!=null&&He.current_city?(qe=t==null?void 0:t.talenter)==null?void 0:qe.current_city:null,date_of_birth:t!=null&&t.date_of_birth?t==null?void 0:t.date_of_birth:null,mobile:t!=null&&t.mobile?t==null?void 0:t.mobile:"",gender:(Ke=t==null?void 0:t.talenter)==null?void 0:Ke.gender,receive_whatsapp_updates:(t==null?void 0:t.receive_whatsapp_updates)===!0||!1,show_to_recruiters:((Ze=t==null?void 0:t.talenter)==null?void 0:Ze.show_to_recruiters)===void 0||((l=t==null?void 0:t.talenter)==null?void 0:l.show_to_recruiters)===!0,id_number:(n=t==null?void 0:t.talenter)!=null&&n.id_number?(_=t==null?void 0:t.talenter)==null?void 0:_.id_number:"",proof_doc:(m=t==null?void 0:t.talenter)!=null&&m.proof_doc?(y=t==null?void 0:t.talenter)==null?void 0:y.proof_doc:"",proof_img:(b=t==null?void 0:t.talenter)!=null&&b.proof_img?(G=t==null?void 0:t.talenter)==null?void 0:G.proof_img:"",has_manager:((Ue=t==null?void 0:t.talenter)==null?void 0:Ue.has_manager)===!0?(pe=t==null?void 0:t.talenter)==null?void 0:pe.has_manager:!1,mananger_email_address:(ft=t==null?void 0:t.manager)!=null&&ft.mananger_email_address?(gt=t==null?void 0:t.manager)==null?void 0:gt.mananger_email_address:"",mananger_mobile_number:(bt=t==null?void 0:t.manager)!=null&&bt.mananger_mobile_number?(xt=t==null?void 0:t.manager)==null?void 0:xt.mananger_mobile_number:"",receive_manager_mobile_updates:((yt=t==null?void 0:t.manager)==null?void 0:yt.receive_manager_mobile_updates)==!1?(vt=t==null?void 0:t.manager)==null?void 0:vt.receive_manager_mobile_updates:!0,receive_manager_email_updates:((jt=t==null?void 0:t.manager)==null?void 0:jt.receive_manager_email_updates)===!1?(wt=t==null?void 0:t.manager)==null?void 0:wt.receive_manager_email_updates:!0,year:t!=null&&t.date_of_birth?new Date(t==null?void 0:t.date_of_birth).getFullYear():"",is_mobile_verified:t!=null&&t.mobile&&(t!=null&&t.is_mobile_verified)?t
1==null?void 0:t.is_mobile_verified:""},enableReinitialize:!0,validationSchema:_e,onSubmit:async s=>{var p,W,F,C;const o=await a.validateForm();if(Object.keys(o).length>0){a.setTouched({talent_type:!0,first_name:!0,last_name:!0,current_city:!0,date_of_birth:!0,mobile:!0,gender:!0,is_mobile_verified:!0,id_number:!0,mananger_email_address:s.has_manager,mananger_mobile_number:s.has_manager});const T=Object.keys(o)[0],U=document.querySelector(`[name="${T}"]`);U&&U.scrollIntoView({behavior:"smooth",block:"center"});return}ge(!0);try{const T={first_name:ue(s.first_name),last_name:ue(s.last_name),date_of_birth:s.date_of_birth,mobile:s.mobile,receive_whatsapp_updates:s.receive_whatsapp_updates,last_updated_on:new Date},U=Ae(s),$={user_id:t.user_id,talent_type:s.talent_type,current_city:s.current_city,gender:s.gender,show_to_recruiters:s.show_to_recruiters,id_number:s.id_number,proof_doc:s.proof_doc,proof_img:s.proof_img,last_activity_page:U?((p=t==null?void 0:t.talenter)==null?void 0:p.last_activity_page)>1?(W=t==null?void 0:t.talenter)==null?void 0:W.last_activity_page:1:0,has_manager:s.has_manager,id:(F=t==null?void 0:t.talenter)!=null&&F.id?(C=t==null?void 0:t.talenter)==null?void 0:C.id:null,personal_data_updated_on:new Date},M={user_id:t.user_id,mananger_email_address:s.mananger_email_address,mananger_mobile_number:s.mananger_mobile_number,receive_manager_mobile_updates:s.receive_manager_mobile_updates,receive_manager_email_updates:s.receive_manager_email_updates},re=await ot.handleUserData({user_id:t.user_id,user:T,talenter:$,manager:M});re.status===200||re.httpCode===200?(await R(),U?c(1):N("Please fill all mandatory fields","error")):(console.error("handleUserData did not return a recognized success shape:",re),N("Failed to save data. Please try again.","error"))}catch(T){console.error("Submit error:",T),N("Failed to save data","error")}finally{ge(!1)}}});i.useEffect(()=>{ve.current&&(ve.current=!1,setTimeout(()=>{ye.current=!1},500))},[]),i.useEffect(()=>{a.dirty&&!a.isSubmitting&&ze(a.values)},[a.values.talent_type,a.values.first_name,a.values.last_name,a.values.current_city,a.values.date_of_birth,a.values.gender,a.values.receive_whatsapp_updates,a.values.show_to_recruiters,a.values.id_number,a.values.proof_doc,a.values.proof_img,a.values.has_manager,a.values.mananger_email_address,a.values.mananger_mobile_number,a.values.receive_manager_mobile_updates,a.values.receive_manager_email_updates]),i.useEffect(()=>()=>{I.current&&clearTimeout(I.current)},[]);const dt=async s=>{var o,p;try{if(oe(!0),!s)throw new Error("No file selected for upload");const F={files:[{fileName:me(s),fileType:s.type||"application/octet-stream"}]},C=await ot.getPreSignedUrl(F),T=(C==null?void 0:C.files)||((o=C==null?void 0:C.data)==null?void 0:o.files);if(!Array.isArray(T)||T.length===0)throw console.error("Invalid pre-signed URL response:",C),new Error("Failed to generate pre-signed upload URL");const U=(p=T[0])==null?void 0:p.signedUrl;if(!U)throw console.error("Missing signedUrl in response:",T[0]),new Error("Pre-signed upload URL is missing");const $=await fetch(U,{method:"PUT",body:s,headers:{"Content-Type":s.type||"application/octet-stream"}});if(!$.ok){const re=await $.text().catch(()=>"No error details available");throw console.error(`Upload failed with status ${$.status}: ${re}`),new Error(`Upload failed with status: ${$.status}`)}const M=U.split("?")[0];return a.setFieldValue("proof_doc",s.name),a.setFieldValue("proof_img",M),a.setFieldTouched("proof_doc",!0,!0),a.setFieldTouched("proof_img",!0,!0),setTimeout(()=>{a.validateForm()},100),M}catch(W){return console.error("Error uploading proof:",W),N("Something went wrong while uploading your ID proof.","error"),a.setFieldValue("proof_img",""),a.setFieldValue("proof_doc",""),null}finally{oe(!1)}},We=(s,o,p,W,F,C)=>{if(W==="talent_type"){const U=(C||[]).map(M=>M.id);let $=s.filter(M=>!U.includes(M.id));if(F&&F.trim()!==""){const M=$.filter(re=>(re[o]||"").toLowerCase().startsWith(F.toLowerCase()));p(M)}else p($)}else if(F&&F.trim()!==""){let U=s.filter($=>($[o]||"").toLowerCase().startsWith(F.toLowerCase()));p(U.slice(0,10))}else p(s.slice(0,10))};function ue(s){return s?s.charAt(0).toUpperCase()+s.slice(1):""}const Je=()=>{V(!1),x(!1)},et=()=>{x(!0),V(!1),setTimeout(()=>{const s=document.getElementById("contained-button-proof");s&&s.click()},0)},ct=(s,o)=>{s||o?(V(!0),x(!1)):et()},mt=()=>{var s;ct((s=t==null?void 0:t.talenter)==null?void 0:s.proof_img,a.values.proof_img)},[$e,tt]=i.useState(null),at=s=>{tt(s.currentTarget)},z=()=>{tt(null)},st=!!$e;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"className='bg-white rounded-lg shadow-md'",children:[e.jsx("div",{className:"personal_data_section",children:e.jsxs("form",{ref:Te,children:[e.jsxs("div",{className:"outer_bg_section Pleasefillin MobileSpacereduce",children:[e.jsxs("div",{className:"personal_data_title",children:[e.jsx("label",{children:"Let's create your profile"}),e.jsxs("h2",{style:{position:"relative"},children:["Please fill-in your details ",S&&e.jsx("span",{style:{fontSize:"14px",color:"#9c27b0",position:"absolute"},children:"(Saving...)"})]}),e.jsx("span",{className:"divider"})]}),e.jsxs(aa,{variant:"standard",sx:{m:1,minWidth:120},children:[e.jsx("div",{className:"mt20",children:e.jsxs(h.Row,{children:[e.jsx(h.Col,{sm:6,children:e.jsxs("div",{className:"border_bottom",children:[e.jsxs("h5",{className:"label_text",children:["Professionally, I am",e.jsx(te,{message:"Please select your profession.",title:" Professionally, I am"})]}),e.jsx(Na,{error:a.touched.talent_type&&a.errors.talent_type,placeholder:"Select All Applicable",data:se,dropdownName:"type_",values:a.values.talent_type,handleChange:s=>{a.setFieldValue("talent_type",s)},suggestData:se,name:"talent type",onType:s=>We(K,"type_name",w,"talent_type",s,a.values.talent_type)}),a.errors.talent_type&&a.touched.talent_type?e.jsx("p",{className:"form_err",children:a.errors.talent_type}):null]})}),e.jsx(h.Col,{sm:6,children:e.jsxs("div",{className:a.values.current_city?"value_broder border_bottom":"border_bottom",children:[e.jsxs("h5",{className:"label_text onlyMobile",children:["Your present City (Search & Select)",e.jsx(te,{message:"Select the city you are currently living in.",title:"Your present City (Search & Select)"})]}),e.jsx(Wt,{error:a.errors.current_city&&a.touched.current_city,data:Ve,autoComplete:!0,dropdownName:"city_name",handleChange:s=>{a.setFieldValue("current_city",s),a.setFieldTouched("current_city",!0)},values:a.values.current_city,handleInputChange:s=>We(de,"city_name",J,"current_city",s,a.values.current_city)}),a.errors.current_city&&a.touched.current_city?e.jsx("p",{className:"form_err",children:a.errors.current_city}):null]})})]})}),e.jsx("div",{className:"mt20",children:e.jsxs(h.Row,{children:[e.jsx(h.Col,{sm:6,children:e.jsxs("div",{className:a.values.first_name?"value_broder border_bottom":"border_bottom",children:[e.jsxs("h5",{className:"label_text",children:["First name",e.jsx(te,{message:"Type your first name as mentioned on your ID Card.",title:"First name"})]}),e.jsx(Ee,{id:"standard-basic",variant:"standard",name:"first_name",slotProps:{htmlInput:{autoComplete:"new-password"}},value:ue(a.values.first_name),onChange:s=>{ne(s,"first_name",a.setFieldValue)},onBlur:a.handleBlur,error:a.touched.first_name&&a.errors.first_name,helperText:a.touched.first_name&&a.errors.first_name})]})}),e.jsxs(h.Col,{sm:6,children:[" ",e.jsxs("div",{className:a.values.last_name?"value_broder border_bottom":"border_bottom",children:[e.jsxs("h5",{className:"label_text onlyMobile",children:["Last name",e.jsx(te,{message:"Type your last name as mentioned on your ID Card.",title:"Last name"})]}),e.jsx(Ee,{variant:"standard",name:"last_name",value:ue(a.values.last_name),slotProps:{htmlInput:{autoComplete:"new-password"}},onChange:s=>{ne(s,"last_name",a.setFieldValue)},onBlur:a.handleBlur,error:a.touched.last_name&&a.errors.last_name,helperText:a.touched.last_name&&a.errors.last_name})]})]})]})}),e.jsx("div",{className:"mt20",children:e.jsxs(h.Row,{children:[e.jsx(h.Col,{sm:6,children:e.jsx("div",{className:"gender_list",children:e.jsxs("div",{children:[e.jsxs("h5",{className:"label_text",children:["Gender",e.jsx(te,{message:"Select your gender.",title:"Gender"})]}),e.jsx("span",{className:"slect_gender",children:"Select your gender"}),e.jsxs("label",{className:"radio-img",children:[e.jsx(ut,{checked:((Ct=a==null?void 0:a.values)==null?void 0:Ct.gender)===0,onChange:()=>{a.setFieldValue("gender",0),a.setFieldTouched("gender",!0)},value:0,name:"radio-buttons"}),e.jsx("div",{className:"image",children:((Nt=a==null?void 0:a.values)==null?void 0:Nt.gender)==0?e.jsx("img",{src:ma,alt:""}):e.jsx("img",{src:_a,alt:""})}),e.jsx("p",{className:"names_list",children:"Female"})]}),e.jsxs("label",{className:"radio-img",children:[e.jsx(ut,{checked:((St=a==null?void 0:a.values)==null?void 0:St.gender)===1,onChange:()=>{a.setFieldValue("gender",1),a.setFieldTouched("gender",!0)},value:0,name:"radio-buttons"}),e.jsx("div",{className:"image",children:((Pt=a==null?void 0:a.values)==null?void 0:Pt.gender)==1?e.jsx("img",{src:ua,alt:""}):e.jsx("img",{src:pa,alt:""})}),e.jsx("p",{className:"names_list",children:"Male"})]}),e.jsxs("label",{className:"radio-img",children:[e.jsx(ut,{checked:((Ft=a==null?void 0:a.values)==null?void 0:Ft.gender)===2,onChange:()=>{a.setFieldValue("gender",2),a.setFieldTouched("gender",!0)},value:0,name:"radio-buttons"}),e.jsx("div",{className:"image",children:((kt=a==null?void 0:a.values)==null?void 0:kt.gender)==2?e.jsx("img",{src:ha,alt:""}):e.jsx("img",{src:fa,alt:""})}),e.jsx("p",{className:"names_list",children:"Neutral"})]}),a.errors.gender&&a.touched.gender?e.jsx("p",{className:"form_err",children:a.errors.gender}):null]})})}),e.jsx(h.Col,{sm:6,children:e.jsxs("div",{className:a.values.date_of_birth?"value_broder border_bottom":"border_bottom",children:[e.jsxs("div",{className:"border_bottom_fixed",children:[e.jsx("h5",{className:"label_text",children:"Date of birth"}),e.jsx(te,{message:"Enter your birth date as mentioned on your ID Card.",title:"Date of birth"})]}),e.jsx(Ca,{formikDateValue:a.values.date_of_birth,setFormikDateValue:s=>{a.setFieldValue("date_of_birth",s),a.setFieldTouched("date_of_birth",!0)}}),e.jsx("em",{className:"background-space",children:"Your DoB will NOT be revealed to recruiters"}),a.errors.date_of_birth&&a.touched.date_of_birth?e.jsx("p",{className:"form_err",children:a.errors.date_of_birth}):null]})})]})}),e.jsx("div",{className:"mt20",children:e.jsxs(h.Row,{children:[e.jsx(h.Col,{sm:6,children:e.jsxs("div",{className:a.values.mobile?"value_broder border_bottom":"border_bottom",children:[e.jsxs("h5",{className:"label_text",children:["Whatsapp mobile number",e.jsx(te,{title:"Whatsapp mobile number",message:"Enter your 10-digit Whatsapp number and click on Verify."})]}),e.jsxs("div",{className:"flex justify-between phn_respon",children:[e.jsxs("div",{className:"phone_number",children:[e.jsx(Ee,{id:"standard-basic",variant:"standard",slotProps:{htmlInput:{autoComplete:"new-password"}},name:"mobile",placeholder:"Enter your 10-digit mobile number",value:a.values.mobile,onBlur:a.handleBlur,onChange:s=>{a.setFieldValue("is_mobile_verified",""),O(null),s.target.value.length<=10?(s.target.value.length==10&&(s.target.value==Le||s.target.value==(t==null?void 0:t.mobile))&&a.setFieldValue("is_mobile_verified",!0),a.setFieldValue("mobile",P(s))):(s.preventDefault(),s.stopPropagation())},error:a.touched.mobile&&a.errors.mobile,helperText:a.touched.mobile&&a.errors.mobile}),e.jsx("p",{className:"form_err",children:!a.values.is_mobile_verified&&!ce&&!a.errors.mobile&&a.touched.is_mobile_verified&&a.errors.is_mobile_verified}),e.jsx("p",{className:"form_err",children:!a.errors.mobile&&ce&&ce})]}),e.jsx(fe,{text:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"verfiy_icon not__vaild_img"})," ",a.values.is_mobile_verified?"Verified":"Verify"," "]}),noHover:!0,white:!0,disableBtn:a.values.is_mobile_verified||((Tt=a==null?void 0:a.errors)==null?void 0:Tt.mobile),disabled:a.values.is_mobile_verified||((Dt=a==null?void 0:a.errors)==null?void 0:Dt.mobile),onClick:L,isLoading:j,style:{height:"fit-content"},className:"verify_button"})]})]})}),e.jsx(h.Col,{sm:6,style:{maxHeight:"60px"},children:e.jsxs(h.Row,{style:{height:"100%",alignItems:"flex-end"},className:"person_data",children:[e.jsx(h.Col,{sm:6,className:"person_data_details",children:e.jsx("div",{className:"formLabelText",children:e.jsx(Qe,{control:e.jsx(lt,{color:"secondary",onChange:()=>{a.setFieldValue("receive_whatsapp_updates",!a.values.receive_whatsapp_updates)},checked:a.values.receive_whatsapp_updates,slotProps:{input:{"aria-label":"controlled"}}}
1),label:"Whatsapp Updates"})})}),e.jsx(h.Col,{sm:6,className:"person_data_details",children:e.jsx("div",{className:"formLabelText",children:e.jsx(Qe,{control:e.jsx(lt,{color:"secondary",onChange:()=>{a.setFieldValue("show_to_recruiters",!a.values.show_to_recruiters)},checked:a.values.show_to_recruiters,slotProps:{input:{"aria-label":"controlled"}}}),label:"Show to recruiters"})})})]})})]})}),e.jsx("div",{className:"mt20",children:e.jsxs(h.Row,{children:[e.jsx(h.Col,{sm:6,children:e.jsxs("div",{className:a.values.id_number?"value_broder border_bottom":"border_bottom",children:[e.jsxs("h5",{className:"label_text",children:["ID Proof Type (Optional)",e.jsx(te,{message:"Select your ID type.",title:"ID Type"})]}),e.jsx(Wt,{data:je,dropdownName:"value",autoComplete:!0,values:a.values.id_number,handleChange:s=>{a.setFieldValue("id_number",s).then(o=>{a.setFieldValue("proof_doc",""),a.setFieldValue("proof_img","")})},onType:()=>{}}),e.jsx("em",{children:"Passport, AADHAAR, Voter's ID, Driver's License, PAN Card, Other"})]})}),e.jsx(h.Col,{sm:6,className:"photo_id_flex",children:e.jsxs("div",{className:a.values.proof_doc?"value_broder border_bottom":"border_bottom",children:[e.jsx(te,{title:"Upload your Photo ID",message:"Upload your photo ID proof as a scanned PDF or a clear image that shows your name, photo and date of birth so that we can verify your ID."}),e.jsxs(h.Row,{className:"photo_id_flexRow",children:[e.jsxs(h.Col,{sm:8,xs:8,className:"id_profImg",children:[e.jsxs("h5",{className:"label_text",style:{marginBottom:"12px"},children:["Upload ID Proof (Optional)"," ",e.jsx("span",{onClick:at,style:{color:"#9c27b0",cursor:"pointer",fontWeight:600,fontFamily:"Poppins, sans-serif"},children:"(Why?)"})]}),e.jsx(Ee,{id:"standard-basic",variant:"standard",name:"proof_doc",placeholder:"Upload image/PDF smaller than 10MB",slotProps:{htmlInput:{autoComplete:"new-password"}},value:a.values.proof_doc,disabled:!0,onChange:a.handleChange,error:a.touched.proof_doc&&a.errors.proof_doc,helperText:a.touched.proof_doc&&a.errors.proof_doc}),e.jsx("em",{children:"Your Photo ID will NOT be revealed to recruiters"})]}),e.jsx(h.Col,{sm:4,xs:4,children:e.jsx("div",{className:"uplode_file",children:e.jsxs("label",{htmlFor:"",children:[!Y&&e.jsx(q,{accept:"image/*,.pdf",id:"contained-button-proof",type:"file",onChange:s=>{const o=s.currentTarget.files[0];o&&(o.size<=sa?g(o,[".jpeg",".jpg",".png",".pdf"])?dt(o):N("Please upload a valid image or PDF file.","error"):(a.setFieldValue("proof_img",""),a.setFieldValue("proof_doc",""),N("File size exceeds 10MB. Please choose a smaller file.","error")))}}),e.jsx(fe,{text:e.jsxs("div",{className:"flex",children:[e.jsx("span",{className:"uplode_icon"}),"Upload"]}),noHover:!0,white:!0,disableBtn:Y,isLoading:Y,component:"span",onClick:mt})]})})})]})]})})]})}),e.jsx("div",{className:"terms_and_condition_section",children:e.jsx(Qe,{control:e.jsx(Sa,{id:"has_manager",checked:a.values.has_manager,onChange:s=>{a.setFieldValue("has_manager",s.target.checked),s.target.checked&&(a.setFieldValue("receive_manager_mobile_updates",!0),a.setFieldValue("receive_manager_email_updates",!0))},slotProps:{input:{"aria-label":"controlled"}}}),label:e.jsx("span",{className:"to_add_style",children:"I'm managed by a manager"})})}),a.values.has_manager?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"afterclick_checkbox",children:[e.jsx("div",{className:"mt20",children:e.jsxs(h.Row,{children:[e.jsxs(h.Col,{sm:6,children:[" ",e.jsxs("div",{className:a.values.mananger_email_address?"value_broder border_bottom":"border_bottom",children:[e.jsxs("h5",{className:"label_text",children:["Manager's email",e.jsx(te,{message:"Type your manager's email here.",title:"Manager's email"})]}),e.jsx(Ee,{id:"standard-basic",slotProps:{htmlInput:{autoComplete:"new-password"}},variant:"standard",name:"mananger_email_address",value:a.values.mananger_email_address,onBlur:a.handleBlur,onChange:a.handleChange,error:a.touched.mananger_email_address&&a.errors.mananger_email_address,helperText:a.touched.mananger_email_address&&a.errors.mananger_email_address})]})]}),e.jsx(h.Col,{sm:6,style:{display:"flex",alignItems:"flex-end"},children:e.jsx("div",{className:"",children:e.jsx("div",{className:"formLabelText",children:e.jsx(Qe,{control:e.jsx(lt,{color:"secondary",onChange:()=>{a.setFieldValue("receive_manager_email_updates",!a.values.receive_manager_email_updates)},checked:a.values.receive_manager_email_updates,slotProps:{htmlInput:{"aria-label":"controlled"}}}),label:"Send updates to my manager's email"})})})})]})}),e.jsx("div",{className:"mt20",children:e.jsxs(h.Row,{children:[e.jsx(h.Col,{sm:6,children:e.jsxs("div",{className:a.values.mananger_mobile_number?"value_broder border_bottom":"border_bottom",children:[e.jsxs("h5",{className:"label_text",children:["Manager's Phone number",e.jsx(te,{message:"Type your manager's contact number here.",title:"Manager's Phone number"})]}),e.jsx(Ee,{id:"standard-basic",variant:"standard",onBlur:a.handleBlur,name:"mananger_mobile_number",slotProps:{htmlInput:{autoComplete:"new-password"}},value:a.values.mananger_mobile_number,onChange:s=>{s.target.value.length<=10?a.setFieldValue("mananger_mobile_number",P(s)):(s.preventDefault(),s.stopPropagation())},error:a.touched.mananger_mobile_number&&a.errors.mananger_mobile_number,helperText:a.touched.mananger_mobile_number&&a.errors.mananger_mobile_number})]})}),e.jsx(h.Col,{sm:6,style:{display:"flex",alignItems:"flex-end"},children:e.jsx("div",{className:"",children:e.jsx("div",{className:"formLabelText",children:e.jsx(Qe,{control:e.jsx(lt,{onChange:()=>{a.setFieldValue("receive_manager_mobile_updates",!a.values.receive_manager_mobile_updates)},checked:a.values.receive_manager_mobile_updates,color:"secondary",slotProps:{htmlInput:{"aria-label":"controlled"}}}),label:"Send updates to my manager's number"})})})})]})})]})}):e.jsx(e.Fragment,{})]})]}),e.jsx("div",{className:"Mobileresponsive",children:e.jsx("div",{className:"flex justify-end mt-12",children:e.jsx(fe,{text:!X&&a.isSubmitting?"Saved":"Save & Next",className:`${a.isValid?null:"opacity-50"}`,onClick:a.handleSubmit,type:"submit",isLoading:X,disabled:X||Y,style:{width:"145px"}})})})]})}),e.jsx(ga,{open:r,handleClose:ae,mobileNumber:(It=a==null?void 0:a.values)==null?void 0:It.mobile,HandleOtpVerification:L,loading:De,verifyOtp:H,setShowResend:xe,setTime:be,time:Fe,showResend:Z,invalidotp:Q,setInvalidotp:k})]}),f&&!D&&e.jsxs(he,{style:{padding:"15px"},open:f,onClose:Je,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e.jsx(Ne,{style:{fontSize:"20px",fontWeight:"600",color:"#9b26b6",textAlign:"center"},className:"popup__header",id:"alert-dialog-title",children:"Are you sure?"}),e.jsx(Se,{children:e.jsxs(Be,{style:{color:"#000",fontSize:"16px",fontWeight:"400"},id:"alert-dialog-description",children:["You have already uploaded your ID Card image. Uploading another image will over
1write the previous image. ",e.jsx("br",{}),e.jsx("br",{})," (",e.jsx("b",{children:"Note:"})," Your photo should be clearly visible in your ID Card)."]})}),e.jsxs(Pe,{style:{padding:"16px"},children:[e.jsx(Vt,{style:{border:"1px solid #E5E5E5",color:"#000",fontSize:"16px",fontWeight:"600"},className:"custom_backbutton",onClick:Je,children:"Cancel"}),e.jsx(Vt,{className:"custom_button",style:{background:"#9B26B6",color:"#fff",fontSize:"16px",fontWeight:"600"},onClick:et,autoFocus:!0,children:"Yes, upload"})]})]}),$e&&e.jsx(ra,{open:st,anchorEl:$e,onClose:z,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},slotProps:{paper:{sx:{borderRadius:2,padding:"16px",maxWidth:"400px",boxShadow:"0px 4px 20px rgba(0, 0, 0, 0.15)",mt:-1}}},children:e.jsxs(nt,{sx:{position:"relative"},children:[e.jsx(ia,{"aria-label":"close",onClick:z,sx:{position:"absolute",right:-8,top:-8,color:"#999",padding:"4px","&:hover":{color:"#44454D"}},children:e.jsx(la,{fontSize:"small"})}),e.jsx(Xe,{sx:{fontSize:"16px",fontWeight:600,fontFamily:"Poppins, sans-serif",color:"#333",mb:1.5,pr:2},children:"Why do we ask for Photo ID?"}),e.jsxs(Xe,{variant:"body2",sx:{fontSize:"14px",lineHeight:1.6,color:"#44454D",fontFamily:"Poppins, sans-serif",mb:1.5},children:[e.jsx("strong",{style:{color:"#333"},children:"For your own safety."})," Your photos and work links can be easily found online and used by someone to create a Fake profile. A Photo ID reduces the chance of someone else impersonating you and creating your Fake profile."]}),e.jsxs(Xe,{variant:"body2",sx:{fontSize:"14px",lineHeight:1.6,color:"#44454D",fontFamily:"Poppins, sans-serif"},children:["Rest assured, ",e.jsx("strong",{style:{color:"#333"},children:"your Photo ID is never shared externally."})," Moreover you may hide a few digits of your Photo ID before uploading for added privacy.",e.jsx("br",{})," ",e.jsx("br",{}),e.jsx("strong",{children:"An ID Proof also results in Verified status."})]})]})})]})}const Zt=(...c)=>{if(typeof window<"u"&&typeof window.fetch=="function")return window.fetch(...c);throw new Error("fetch is not available in this environment")},Mt=async c=>c instanceof Blob?c:typeof c=="string"?await(await Zt(c)).blob():new Blob,Ot=(c,u)=>{var E;const r=new Set;if(Array.isArray(c)&&c.forEach(j=>{j!=null&&j.size&&Number.isFinite(j.size)&&r.add(Number(j.size))}),Array.isArray(u)&&((E=u[0])!=null&&E.size)){const j=Number(u[0].size);Number.isFinite(j)&&r.add(j)}return r},Yt=(c,u,r)=>Number.isFinite(c)?u.has(c)||r.has(c):!1;function Ja({value:c}){return e.jsxs(nt,{sx:{position:"relative",display:"inline-flex"},children:[e.jsx(na,{variant:"determinate",value:c,size:100,thickness:6,sx:{color:"#9B26B6"}}),e.jsx(nt,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Xe,{variant:"caption",component:"div",sx:{color:"#E5E5E5",fontSize:"1rem",fontWeight:"bold"},children:`${Math.round(c)}%`})})]})}function es({id:c,index:u,ImgData:r,ImgCount:E,isImgUpload:j,isPlaceholder:d,updateCoverPhoto:Q,persistGalleryNow:k,setDate:D,setImgRow:x,coverPhoto:f,user:V,ImgArray:L,setImageIndex:ae,isDisable:t,openSnackbar:R,buildExistingSizeSet:B,isDuplicateSize:N,convertImagetoWebp:X,toBlob:ge,uploadFileWithPresignedUrl:Fe,setTotalFilesToUpload:be,setUploadedFilesCount:Z,setUploadProgress:xe,setIsLoaderDialog:de,setIsPlaceholder:ke,setImgCount:Te,checkValidFile:De}){var Y,oe,se;const{attributes:Ie,listeners:Ve,setNodeRef:J,transform:Le,transition:le,isDragging:ce}=Ma({id:c}),O={transform:Oa.Transform.toString(Le),transition:le,opacity:ce?.5:1,cursor:ce?"grabbing":"grab"};return e.jsxs("div",{ref:J,style:O,...Ie,...Ve,className:`${r[u].is_more?"image_item d-none":"image_item "} ${E===6?"normal":E<=20?"twenty":E>20?"small_imag":null} ${j||d?"img_bottom_space image_items_bg_none":" image_items_size image_items_size_outer "} `,children:[(Y=r[u])!=null&&Y.is_visible?e.jsx("div",{className:"hide_photo",children:e.jsx("img",{src:Fa,alt:"closeicon"})}):null,((oe=r[u])==null?void 0:oe.file_url)&&e.jsx(Ha,{index:u,src:(se=r[u])==null?void 0:se.file_url,handleMakeCover:async()=>{var w,S;await Q((w=r[u])==null?void 0:w.file_url,(S=r[u])==null?void 0:S.size)},ImgToggle:async()=>{r[u].is_visible=!r[u].is_visible,D(Math.random()),await k("toggle-visibility")},handleRemove:async()=>{var S;const w=r[u].file_url;if(r[u].file_url="",r[u].size="",r[u].key="",r[u].is_visible=!1,r[u].is_cover_photo=!1,D(Math.random()),(r==null?void 0:r.filter(A=>A.file_url).length)===0&&x(4),((S=f==null?void 0:f[0])==null?void 0:S.file_url)===w){const A=r.find(I=>I.file_url);if(A)await Q(A.file_url,A.size);else{const I={file_url:"",is_visible:!1,is_cover_photo:!0,key:"",user_id:V==null?void 0:V.user_id,size:null};setCoverPhoto([I]),await k("clear-cover",I)}D(Math.random())}else await k("remove")},is_visible:r[u].is_visible}),!j&&!d&&e.jsx("img",{src:ka,className:"image_placeholder",style:{width:"40px"},onClick:w=>{w.stopPropagation(),t||(setTimeout(()=>{L.current.value="",L.current.click()},500),ae(0))}}),!t&&e.jsx("input",{type:"file",multiple:!0,accept:"image/*",id:"file"+u,ref:L,style:{display:"none"},onChange:async w=>{var ye,ve;let S=r.findIndex(H=>H.file_url==="");const A=B(r,f);if(w.target.files.length>1){const H=new Set,ne=r==null?void 0:r.filter(P=>P.file_url==="").length;if(w.target.files.length<=ne){be(w.target.files.length),Z(0),xe(0),de(!0);for(let P=0;P<w.target.files.length;P++){const g=S+P,q=w.target.files[P];if(g>49)break;
1if(!De(q,[".jpeg",".jpg",".png"])){R("Please select Valid Image","error"),Z(v=>v+1);continue}try{const v=await X(q),me=await ge(v),ee=new File([me],"filename.webp",{type:"image/webp"});if(N(ee.size,A,H)){R("Please select a different Image (duplicate detected).","error"),Z(K=>K+1);continue}r[g].is_more=!1,Te(g),ke(!0);const _e=await Fe(ee,ee.name);r[g].file_url=_e,r[g].size=ee.size,D(Math.random()),A.add(ee.size),H.add(ee.size),(ye=f==null?void 0:f[0])!=null&&ye.file_url?await k("upload-multi"):await Q(_e,ee.size),Z(K=>K+1)}catch(v){console.error("Upload error:",v),R("Upload failed","error"),Z(me=>me+1)}}ke(!1)}else R("Check the Total Limit and upload the file","error");return}const I=w.target.files[0];if(I){if(!De(I,[".jpeg",".jpg",".png"])){R("Please select valid image","error");return}be(1),Z(0),xe(0),de(!0);try{const H=await X(I),ne=await ge(H),P=new File([ne],"filename.webp",{type:"image/webp"});if(N(P.size,A,new Set)){de(!1),R("Please select a different Image (duplicate detected).","error");return}const g=await Fe(P,P.name),q=u??r.findIndex(v=>!v.file_url);q>=0&&(r[q].file_url=g,r[q].size=P.size),D(Math.random()),(ve=f==null?void 0:f[0])!=null&&ve.file_url?await k("upload-single"):await Q(g,P.size),Z(1)}catch(H){console.error("Upload error:",H),R("Upload failed","error"),de(!1)}}}})]})}function ts({HandleForms:c,formSubmit:u}){var Me,Oe,Ye,He,qe,Ke,Ze;const r=i.useRef(null),E=Kt(),{openSnackbar:j}=i.useContext(qt),{user:d,updateUser:Q}=i.useContext(ht),k=i.useRef(null),[D,x]=i.useState(!1),f=Ht.useRef(),[V,L]=i.useState(new Date),[ae,t]=i.useState(null),[R,B]=i.useState(!1),[N,X]=i.useState(!1),[ge,Fe]=i.useState(!1),[be,Z]=i.useState(!1),[xe,de]=i.useState(!1),[ke,Te]=i.useState(!1),[De,Ie]=i.useState(8),[Ve,J]=i.useState(4),[Le,le]=i.useState(!1),[ce,O]=i.useState(0),[Y,oe]=i.useState(0),[se,w]=i.useState(0),[S,A]=i.useState(!0),[I,ye]=i.useState(!1),[ve,H]=i.useState(!1),[ne,P]=i.useState(!1),[g,q]=i.useState([]),[v,me]=i.useState([{file_url:"",is_visible:!1,is_cover_photo:!0,key:"",user_id:d==null?void 0:d.user_id,size:null}]),ee=Ea(Ra(Ba,{activationConstraint:{delay:200,tolerance:5}})),_e=!!((Me=v==null?void 0:v[0])!=null&&Me.file_url)||g&&g.some(l=>!!l.file_url),K=!_e||D;i.useLayoutEffect(()=>{function l(){J(n=>n-1)}return window.addEventListener("resize",l),l(),setTimeout(()=>{A(!1)},3e3),()=>window.removeEventListener("resize",l)},[]),i.useEffect(()=>{if(ne)if(_e)B(!1),X(!1);else{const l=setTimeout(()=>B(!0),3e3);return()=>clearTimeout(l)}},[ne,_e]),i.useEffect(()=>{if(Y>0){const l=se/Y*100;O(l),se>=Y&&setTimeout(()=>{le(!1),O(0),oe(0),w(0)},500)}},[se,Y]);const je=l=>({file_url:l.file_url,is_visible:!!l.is_visible,is_cover_photo:!!l.is_cover_photo,key:l.key||"",user_id:l.user_id,size:l.size??null}),Ae=async(l,n)=>{try{const _={files:[{fileName:`Tallent/${d.user_id}_${d.first_name}/cbell_${Date.now()}_${n}`,fileType:l.type}]},m=await ot.getPreSignedUrl(_),{signedUrl:y}=m.files[0],b=await Zt(y,{method:"PUT",body:l,headers:{"Content-Type":l.type}});if(!b.ok)throw new Error(`Upload failed with status: ${b.status}`);return y.split("?")[0]}catch(_){throw console.error("Error uploading file:",_),_}},ze=async(l="update",n=null)=>{if(!ve)try{H(!0);const _=g.filter(b=>b.file_url).map(je),y=[...n?[je(n)]:v.map(je),..._];await $t.imageUpload({gallary:y,isFinalSubmit:!1});try{await Q()}catch{}}catch(_){console.error("Persist failed:",_),j("Could not save changes. Please retry.","error")}finally{H(!1)}},a=async(l,n=null)=>{q(m=>m.map(y=>({...y,is_cover_photo:y.file_url===l})));const _={file_url:l||"",is_visible:!1,is_cover_photo:!0,key:"",user_id:d==null?void 0:d.user_id,size:n??null};me([_]),L(Math.random()),await ze("make-cover",_)},dt=async l=>{const{active:n,over:_}=l;_&&n.id!==_.id&&q(m=>{const y=m.findIndex((Ue,pe)=>pe===n.id),b=m.findIndex((Ue,pe)=>pe===_.id),G=$a(m,y,b);return setTimeout(()=>{ze("reorder")},0),G})};i.useEffect(()=>{},[g,V,v]),i.useEffect(()=>{let l=[];for(let n=0;n<=49;n++){let _={file_url:"",is_visible:!1,is_cover_photo:!1,key:"",user_id:d==null?void 0:d.user_id,is_more:n>=8,size:null};l.push(_)}q(l),window.scrollTo(0,0)},[]),i.useEffect(()=>{if(!d)return;const l=(d==null?void 0:d.gallary)||(d==null?void 0:d.gallery)||[];if(!Array.isArray(l)||l.length===0){P(!0);return}const n=l.find(m=>(m==null?void 0:m.is_cover_photo)&&(m==null?void 0:m.file_url)),_=l.filter(m=>!(m!=null&&m.is_cover_photo)&&(m==null?void 0:m.file_url));me([{file_url:(n==null?void 0:n.file_url)||"",is_visible:!!(n!=null&&n.is_visible),is_cover_photo:!0,key:(n==null?void 0:n.key)||"",user_id:d==null?void 0:d.user_id,size:(n==null?void 0:n.size)??null}]),q(m=>{const y=[...m].map((b,G)=>({...b,file_url:"",is_visible:!1,is_cover_photo:!1,key:"",user_id:d==null?void 0:d.user_id,is_more:G>=8,size:null}));for(let b=0;b<Math.min(_.length,50);b++)y[b]={...y[b],file_url:_[b].file_url||"",is_visible:!!_[b].is_visible,is_cover_photo:!1,key:_[b].key||"",user_id:d==null?void 0:d.user_id,size:_[b].size??null,is_more:!1};return y}),P(!0)},[d]),i.useEffect(()=>{var l;
1((l=r.current)==null?void 0:l.clientHeight)>520&&J(n=>n+1)},[(Oe=r.current)==null?void 0:Oe.clientHeight]);function We(l,n){var y;const _=((y=l==null?void 0:l.name)==null?void 0:y.toLowerCase())||"",m=n.map(b=>b.startsWith(".")?b:`.${b}`).map(b=>b.replace(/\./g,"\\.")).join("|");return new RegExp(`(${m})$`).test(_)}const ue=()=>e.jsxs(he,{open:ke,fullWidth:!0,maxWidth:"md",children:[e.jsx(Ne,{id:"first_alert__title",className:"first_alert__title",children:"Upload Cover Photo for now"}),e.jsx(Se,{children:e.jsx(Be,{id:"firrt-dialog-description",className:"firrt-dialog-description",children:e.jsx("p",{style:{padding:"0 135px"},children:"Only professional-looking headshots and portfolio photographs are acceptable on Casting Bell. This is to ensure that you put your best foot forward. More number of photos means showing up higher on the recruiter search."})})}),e.jsx(Pe,{children:e.jsxs("div",{className:"btn__container",children:[e.jsxs("div",{className:"cancel__btn action__btn",onClick:()=>{Te(!1),Z(!0)},children:[" ","Will upload later"," "]}),e.jsx("div",{className:"success__btn action__btn",onClick:()=>{S||k.current.click()},children:K?"Upload Cover Photo":"Change Cover Photo"})]})})]}),Je=()=>e.jsxs(he,{open:ge,fullWidth:!0,maxWidth:"md",children:[e.jsx(Ne,{id:"first_alert__title",className:"first_alert__title",children:"Please set your Cover Photo"}),e.jsx(Se,{children:e.jsx(Be,{id:"firrt-dialog-description",className:"firrt-dialog-description",children:e.jsxs("p",{children:[e.jsxs("b",{children:["Your cover photo will be the first image visible to recruiters."," "]})," ",e.jsx("br",{}),"Please upload a Cover Photo, preferably your Headshot (a mid-shot with face clearly visible)."]})})}),e.jsx(Pe,{children:e.jsxs("div",{className:"btn__container",children:[e.jsx("div",{className:"cancel__btn action__btn font-semibold text-gray-400",onClick:()=>{E("/talents")},children:"Save profile and exit"}),e.jsx("div",{className:"success__btn action__btn",onClick:()=>{S||k.current.click()},children:K?"Upload Cover Photo":"Change Cover Photo"})]})})]}),et=()=>e.jsxs(he,{open:xe,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Ne,{id:"first_alert__title",className:"first_alert__title",children:"Profile submitted!"}),e.jsx(Se,{children:e.jsxs(Be,{id:"firrt-dialog-description",className:"firrt-dialog-description",children:[e.jsx("p",{children:"A stunning profile is in the making. Let's hope the moderators publish your profile without any revision or comments. But if they do get back, it is in your best interest."}),e.jsx("p",{children:"Meanwhile, you can add details of your Past Works to increase the chances of being shortlisted."})]})}),e.jsx(Pe,{children:e.jsx("div",{className:"btn__container",children:e.jsx("div",{className:"success__btn action__btn",onClick:()=>{E(`/talent/${d==null?void 0:d.userUniqueId}#PastWorks`)},children:"Add Past Works"})})})]}),ct=()=>e.jsxs(he,{open:be,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Ne,{id:"first_alert__title",className:"first_alert__title",children:"Come back soon!"}),e.jsx(Se,{children:e.jsx(Be,{id:"firrt-dialog-description",className:"firrt-dialog-description",children:e.jsxs("p",{children:["Your profile cannot be submitted without images. To avoid missing out on good opportunities, we strongly recommend you to get your portoflio done soon and complete your profile."," "]})})}),e.jsx(Pe,{children:e.jsx("div",{className:"btn__container",children:e.jsx("div",{className:"success__btn action__btn",onClick:rt,children:"Save profile and exit"})})})]}),mt=()=>e.jsxs(he,{open:N,fullWidth:!0,maxWidth:"md",children:[e.jsx(Ne,{id:"first_alert__title",className:"first_alert__title",children:"Don't make this common mistake!"}),e.jsx(Se,{children:e.jsxs(Be,{id:"firrt-dialog-description",className:"firrt-dialog-description",children:[e.jsxs("p",{children:[e.jsx("b",{children:"9 out of 10"})," profiles are ",e.jsx("b",{children:"rejected right away"})," because they don't have a professional looking headshot or portfolio. We strongly recommend you get your portfolio done today."]}),e.jsxs("p",{children:[e.jsx("b",{children:"For now"}),", you can ",e.jsx("b",{children:"upload your professional headshot"}),", if you have one."]})]})}),e.jsx(Pe,{children:e.jsxs("div",{className:"btn__container btn__container_outerr",children:[e.jsxs("div",{className:"cancel__btn action__btn ",onClick:()=>{X(!1),Z(!0)},children:[" ","Will upload later"," "]}),e.jsx("div",{className:"success__btn action__btn",onClick:()=>{X(!1),Te(!0)},children:K?"Upload Cover Photo":"Change Cover Photo"})]})})]}),$e=()=>e.jsxs(he,{open:R,fullWidth:!0,maxWidth:"md",className:"img_guideliness",children:[e.jsx(Ne,{id:"first_alert__title",className:"first_alert__title",children:"IMPORTANT: Image guidelines"}),e.jsx(Se,{children:e.jsxs("div",{id:"firrt-dialog-description",className:"firrt-dialog-description",children:[e.jsx("b",{className:"bold_text",children:"Images play a critical role in casting decisions"}),e.jsxs("div",{className:"content_box content_box_outer",children:[e.jsx("p",{children:"To increase your chances of being shortlisted, upload your images that are:"}),e.jsxs("p",{children:[e.jsx("b",{children:"1."})," Diverse - to showcase you in different avatars - you can upload up to 50 images."]}),e.jsxs("p",{children:[e.jsx("b",{children:"2."})," Recent and reflective of your present appearance."]}),e.jsxs("p",{children:[e.jsx("b",{children:"3."})," Taken professionally and worthy of a good portfolio."]}),e.jsxs("p",{children:[e.jsx("b",{children:"4."})," Not heavily edited, photoshopped or cropped abruptly."]}),e.jsxs("p",{children:[e.jsx("b",{children:"5."})," Not taken in poor lighting, or with low resolution cameras."]}),e.jsxs("p",{children:[e.jsx("b",{children:"6."})," Avoid posting images that have total frontal or rear nudity."]})]}),e.jsx("b",{className:"bold_text",children:"Do you have your images handy?"})]})}),e.jsx(Pe,{children:e.jsxs("div",{className:"btn__container btn__container_outerr",children:[e.jsx("div",{className:"cancel__btn action__btn",style:{width:"200px"},onClick:()=>{B(!1),X(!0)},children:"No"}),e.jsx("div",{className:"success__btn action__btn",style:{width:"300px"},onClick:()=>{B(!1),setTimeout(()=>{f.current.value="",f.current.click()},500),t(z)},children:"Yes, Upload Portfolio images"})]})})]}),tt=()=>e.jsx(he,{open:!0,className:"image_loader image_loaderOuter",children:e.jsxs(nt,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"40px",gap:"20px"},children:[e.jsx(Ja,{value:ce}),e.jsxs(Xe,{variant:"body1",sx:{color:"#E5E5E5"},children:["Uploading ",se," of ",Y," images..."]})]})}),at=async()=>{var m;x(!0);const l=g.filter(y=>y.file_url).map(je),n=(m=v==null?void 0:v[0])!=null&&m.file_url?je(v[0]):l[0]?{...l[0],is_cover_photo:!0}:{file_url:"",is_visible:!1,is_cover_photo:!0,key:"",user_id:d==null?void 0:d.user_id,size:null},_=[n,...l];if(n.file_url)try{$t.imageUpload({gallary:_,isFinalSubmit:!0}).then(async y=>{y.data&&await Q().then(()=>{de(!0)}),x(!1)}).catch(()=>{x(!1)})}catch{j("Tried saving again but failed. Your changes were already being saved automatically.","warning")}finally{x(!1)}else Fe(!0),x(!1)},z=g==null?void 0:g.findIndex(l=>l.file_url===""),st=g==null?void 0:g.filter(l=>l.file_url==="").length,rt=()=>{E("/talents")},it=!!(g!=null&&g.filter(l=>l.file_url).length);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"className='bg-white rounded-lg shadow-md'",children:e.jsxs("div",{className:"personal_data_section",children:[e.jsxs("div",{className:"personal_data_title",children:[e.jsx("label",{children:"Get excited: Your profile is almost complete"}),e.jsx("h2",{children:" Upload upto 50 images"}),e.jsx("span",{className:"divider"})]}),e.jsx("form",{children:e.jsxs("div",{className:"images_uploders images_uploders_outer images_container",children:[e.jsx("div",{className:"mobile-only-content",children:e.jsxs("div",{className:"back_justify_button Chage_password_button",style:{textAlign:"right",marginBottom:"10px"},children:[e.jsx(fe,{className:"Rightsidemargin",text:z>=1?`Upload more images (${st})`:z===-1?"Limit Reached":"Upload Portfolio images",onClick:()=>{z!==-1&&(setTimeout(()=>{f.current.value="",f.current.click()},500),t(z))},disabled:S||D,white:!0,style:{paddingRight:z>=1?20:40,paddingLeft:z>=1?20:40}}),e.jsx(fe,{text:"Submit Application",isLoading:D,onClick:()=>at(),disabled:K})]})}),e.jsxs(h.Row,{className:"img_flex",children:[e.jsx(h.Col,{md:4,sm:12,xs:12,className:"images_uploader_right",children:e.jsxs("div",{className:"left_cover_images left_cover_images_inner",children:[e.jsx("img",{id:"headImg",src:(Ye=v[0])==null?void 0:Ye.file_url,className:`headImg previewImg ${(He=v[0])!=null&&He.file_url?" ":"display_none"}`,onClick:()=>{k.current.click()}}),e.jsx("img",{src:Pa,className:"image_placeholder",onClick:()=>{S||k.current.click()}}),!((qe=v[0])!=null&&qe.file_url)&&e.jsx("span",{className:"cover__info",children:e.jsx(fe,{text:K?"Upload Cover Photo":"Change Cover Photo",onClick:()=>{S||k.current.click()},white:!0})}),!S&&e.jsx("input",{type:"file",accept:"image/*",id:"file",ref:k,style:{display:"none"},onChange:async l=>{var _,m;const n=(m=(_=l==null?void 0:l.target)==null?void 0:_.files)==null?void 0:m[0];if(n){if(!We(n,[".jpeg",".jpg",".png"])){j("Please Select Valid Image","error");return}oe(1),w(0),O(0),le(!0);try{const y=await Lt(n),b=await Mt(y),G=new File([b],"filename.webp",{type:"image/webp"}),Ue=Ot(g,v);if(Yt(G.size,Ue,new Set)){le(!1),j("Please select different Image (duplicate detected).","error");return}const pe=await Ae(G,G.name);await a(pe,G.size),w(1)}catch(y){console.error("Upload error:",y),j("Upload failed","error"),le(!1)}}}})]})}),e.jsx(h.Col,{md:8,sm:12,xs:12,lg:8,className:"images_uploader_left",children:e.jsx("div",{className:"right_images",ref:r,children:e.jsx(Va,{sensors:ee,collisionDetection:La,onDragEnd:dt,children:e.jsx(Aa,{items:g.map((l,n)=>n),strategy:Wa,children:e.jsx(Ya,{breakpointCols:Ve,className:"my-masonry-grid my-masonry-grid_outer",columnClassName:"my-masonry-grid_column my-masonry-grid_column_outer",children:g.map((l,n)=>e.jsx(es,{id:n,index:n,ImgData:g,ImgCount:De,isImgUpload:it,isPlaceholder:I,updateCoverPhoto:a,persistGalleryNow:ze,setDate:L,setImgRow:J,coverPhoto:v,user:d,ImgArray:f,setImageIndex:t,isDisable:S,openSnackbar:j,buildExistingSizeSet:Ot,isDupl
1icateSize:Yt,convertImagetoWebp:Lt,toBlob:Mt,uploadFileWithPresignedUrl:Ae,setTotalFilesToUpload:oe,setUploadedFilesCount:w,setUploadProgress:O,setIsLoaderDialog:le,setIsPlaceholder:ye,setImgCount:Ie,checkValidFile:We},n))})})})})})]}),e.jsx("span",{className:"infoText infoText_outer mt-2",children:"Note: Click on the image for options. Long-press image and then drag to change the order."}),e.jsx("div",{className:" mt-4 signUP_submit_button",children:e.jsxs("div",{className:"flex justify-between items-center back_justify",children:[e.jsx(oa,{text:"Back",onClick:()=>{c(2)},disabled:D||S}),e.jsx("div",{className:"desktop-only-content",children:e.jsxs("div",{className:"back_justify_button",children:[e.jsx(fe,{className:"Rightsidemargin",text:z>=1?`Upload more images (${st})`:z===-1?"Limit Reached":"Upload Portfolio images",onClick:()=>{z!==-1&&(setTimeout(()=>{f.current.value="",f.current.click()},500),t(z))},disabled:S||D,white:!0,style:{paddingRight:z>=1?20:40,paddingLeft:z>=1?20:40}}),e.jsx(fe,{text:"Submit Application",isLoading:D,onClick:()=>at(),disabled:K})]})})]})})]})})]})}),$e(),mt(),ct(),et(),!((Ke=v[0])!=null&&Ke.file_url)&&ue(),!((Ze=v[0])!=null&&Ze.file_url)&&Je(),Le&&tt()]})}function Vs(){const[c,u]=i.useState(0),{user:r}=i.useContext(ht),E=Kt();i.useEffect(()=>{var x,f,V,L,ae,t,R,B,N;!((x=r==null?void 0:r.talenter)!=null&&x.is_profile_creation_completed)&&((f=r==null?void 0:r.talenter)!=null&&f.last_activity_page)&&((V=r==null?void 0:r.talenter)==null?void 0:V.last_activity_page)!=6?u((L=r==null?void 0:r.talenter)==null?void 0:L.last_activity_page):!((ae=r==null?void 0:r.talenter)!=null&&ae.is_profile_creation_completed)&&!((t=r==null?void 0:r.talenter)!=null&&t.last_activity_page)?u(0):(R=r==null?void 0:r.talenter)!=null&&R.is_profile_creation_completed&&((B=r==null?void 0:r.talenter)==null?void 0:B.last_activity_page)==6?E(`/talent/${r==null?void 0:r.userUniqueId}`):u((N=r==null?void 0:r.talenter)==null?void 0:N.last_activity_page)},[]);const j=x=>{u(x)},d=pt(qa)(({theme:x})=>({[`&.${Re.alternativeLabel}`]:{top:22},[`&.${Re.active}`]:{[`& .${Re.line}`]:{backgroundColor:"#9B26B6"}},[`&.${Re.completed}`]:{[`& .${Re.line}`]:{backgroundColor:"#9B26B6"}},[`& .${Re.line}`]:{height:3,border:0,backgroundColor:x.palette.mode==="dark"?x.palette.grey[800]:"#eaeaf0",borderRadius:1}})),Q=pt("div")(({theme:x,ownerState:f})=>({backgroundColor:x.palette.mode==="dark"?x.palette.grey[700]:"#ccc",zIndex:1,color:"#fff",width:50,height:50,display:"flex",borderRadius:"50%",justifyContent:"center",alignItems:"center",...f.active&&{backgroundColor:"#9B26B6",boxShadow:"0 4px 10px 0 rgba(0,0,0,.25)"},...f.completed&&{backgroundColor:"#9B26B6"}}));function k(x){const{active:f,completed:V,className:L}=x,ae={1:e.jsx("img",{src:ca,className:"step__icon",alt:"Personal Data"}),2:e.jsx("img",{src:Ua,className:"step__icon",alt:"Physical Description"}),3:e.jsx("img",{src:za,className:"step__icon",alt:"Key Details"}),4:e.jsx("img",{src:Ia,className:"step__icon",alt:"Languages & Travel"})};return e.jsx(Q,{ownerState:{completed:V,active:f},className:L,children:ae[String(x.icon)]})}const D=["Personal Data","Physical Description","Key Details","Upload Images"];return e.jsxs(e.Fragment,{children:[e.jsx(da,{htmlAttributes:!0,children:e.jsx("title",{children:c===0?"Personal Data | Casting Bell":c===1?"Physical Description | Casting Bell":c===2?"Preferences | Casting Bell":c===3?"Languages & Travel | Casting Bell":c===4?"Skills & Education | Casting Bell":c===5?"Upload Portfolio | Casting Bell":"Casting Bell"})}),e.jsx("div",{className:"className='bg-white rounded-lg shadow-md'",children:e.jsxs("div",{className:c===5?"talenter_profile_middle full_width_middle":"talenter_profile_middle",children:[e.jsx("div",{className:"steper_middle steper_middle_outer",children:e.jsx(Qa,{sx:{width:"100%"},spacing:4,className:"stepper__icon__contianer",children:e.jsx(Ka,{alternativeLabel:!0,activeStep:c,connector:e.jsx(d,{}),children:D.map(x=>e.jsx(Za,{children:e.jsx(Ga,{StepIconComponent:k,children:x})},x))})})}),e.jsxs("div",{className:"outer_bg_section_tab_common_section",children:[c===0&&e.jsx(Xa,{HandleForms:j}),c===1&&e.jsx(Ta,{HandleForms:j}),c===2&&e.jsx(Da,{HandleForms:j}),c===5&&e.jsx(ts,{HandleForms:j})]})]})})]})}export{Vs as default};
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.