1"use strict";(self.webpackChunkdigital_world_trader=self.webpackChunkdigital_world_trader||[]).push([[430],{60430:function(e,a,t){t.r(a),t(35890);var l=t(96540),n=t.n(l),c=t(11775),r=t(40542),i=t(29863),s=t(78465),o=t.n(s),m=t(35105);let p=null;a.default=e=>{const{d:a=null,mobileOpen:t=!1,setMobileOpen:s=()=>{}}=e,[d,u]=(0,l.useState)({first_name:"",middle_name:"",last_name:"",date_of_birth:"",place_of_birth:"",gender:"Male",ssn:"",applicant_address:"",city:"",state:"UT",zip:"",contact_phone:"",contact_email:"",license_role:"Cosmetologist",license_number:"",school_name:"",graduation_date:"",apprenticeship_hours:"",exam_date:"",exam_score:"",salon_name:"",salon_address:"",employer_phone:"",conviction_history:"No",conviction_details:"",utah_identity:"",applicant_signature:!1,background_check_consent:!1}),[h,f]=(0,l.useState)(""),[E,N]=(0,l.useState)([]),[g,_]=(0,l.useState)([]),[b,v]=(0,l.useState)(null),[y,k]=(0,l.useState)(null),[F,C]=(0,l.useState)(null),[D,x]=(0,l.useState)(null),[w,S]=(0,l.useState)(!1),[L,$]=(0,l.useState)(!1),[P,q]=(0,l.useState)({}),[A,I]=(0,l.useState)({}),O=["first_name","last_name","date_of_birth","applicant_address","contact_phone","utah_identity","background_check_consent","applicant_signature"],B=e=>I(a=>a[e]?a:{...a,[e]:!0}),R=e=>A[e]&&P[e]?"is-invalid":"",M=(e={},a={})=>{const t={};if(O.forEach(a=>{"applicant_signature"===a||"background_check_consent"===a?e[a]||(t[a]="You must confirm this"):String(e[a]||"").trim()||(t[a]="This field is required")}),e.contact_phone&&!/^\+?[\d\s\-()]{7,15}$/.test(e.contact_phone)&&(t.contact_phone="Enter a valid phone number"),e.contact_email&&e.contact_email.length&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.contact_email)&&(t.contact_email="Enter a valid email"),e.date_of_birth){const a=new Date(e.date_of_birth),l=new Date;(isNaN(a.getTime())||a>l)&&(t.date_of_birth="Enter a valid date (not in the future)")}const l=(a,l)=>{if(e[a]){const n=new Date(e[a]);isNaN(n.getTime())&&(t[a]=`${l} must be a valid date`)}};l("graduation_date","Graduation date"),l("exam_date","Exam date"),(!a.identityDocs||a.identityDocs.length<1)&&(t.identityDocs="Please upload at least 1 identity document"),a.photoFile||(t.photoFile="Please upload a passport-style photo"),"Apprentice"!==e.license_role||a.apprenticeshipFile||(t.apprenticeshipFile="Please upload apprenticeship hours proof");const n=(e,a)=>{e&&e.forEach(e=>{e&&(e.size>10485760&&(t[a]="Each file must be under 10 MB"),e.type.startsWith("image/")||"application/pdf"===e.type||(t[a]="Only JPG, PNG or PDF files are allowed"))})};return n(a.identityDocs,"identityDocs"),n(a.residencyDocs,"residencyDocs"),a.photoFile&&n([a.photoFile],"photoFile"),a.educationCertFile&&n([a.educationCertFile],"educationCertFile"),a.apprenticeshipFile&&n([a.apprenticeshipFile],"apprenticeshipFile"),a.priorLicenseFile&&n([a.priorLicenseFile],"priorLicenseFile"),t},G=e=>{const{name:a,value:t,type:l,checked:n}=e.target,c="checkbox"===l?n:t,r={...d,[a]:c};u(r),A[a]&&q(M(r,{identityDocs:E,residencyDocs:g,photoFile:b,educationCertFile:y,apprenticeshipFile:F,priorLicenseFile:D}))},T=(e,a)=>{if("identity"===e){const e=E.filter((e,t)=>t!==a);N(e),q(M(d,{identityDocs:e,residencyDocs:g,photoFile:b,educationCertFile:y,apprenticeshipFile:F,priorLicenseFile:D}))}else if("residency"===e){const e=g.filter((e,t)=>t!==a);_(e),q(M(d,{identityDocs:E,residencyDocs:e,photoFile:b,educationCertFile:y,apprenticeshipFile:F,priorLicenseFile:D}))}};return n().createElement("div",{className:"admin-content-wrapper"},a?.session?.state===r.$t.IN&&n().createElement(c.A,{d:a,mobileOpen:t,setMobileOpen:s}),n().createElement("div",{className:"main-content"},n().createElement("div",{className:"white-bg-card"},n().createElement("div",{className:"white-bg-header border-0"},n().createElement("h4",null,(0,m.dt)()," Cosmetology / Barber License (",(0,m.dt)()," DOPL)")),n().createElement("div",{className:"white-bg-body"},n().createElement("form",{onSubmit:async e=>{if(e?.preventDefault?.(),(()=>{const e=M(d,{identityDocs:E,residencyDocs:g,photoFile:b,educationCertFile:y,apprenticeshipFile:F,priorLicenseFile:D});q(a=>({...a,...e}));const a={...A};
1return O.forEach(e=>a[e]=!0),a.identityDocs=!0,a.photoFile=!0,"Apprentice"===d.license_role&&(a.apprenticeshipFile=!0),I(a),0===Object.keys(e).length})())try{S(!0);const e=new FormData;Object.entries(d).forEach(([a,t])=>{"boolean"==typeof t?e.append(a,t?"1":"0"):e.append(a,t||"")}),E.forEach(a=>e.append("identity_documents[]",a)),g.forEach(a=>e.append("residency_documents[]",a)),b&&e.append("photo_file",b),y&&e.append("education_certificate",y),F&&e.append("apprenticeship_proof",F),D&&e.append("prior_license_document",D),h&&e.append("verkey",h);const a=await i.A.post("/dashboard/licenses/cosmetology/apply",e);a?.data?.success?o().fire("Success",a.data.message||"Application submitted.","success").then(()=>{window.location.href="/licenses/professional/list"}):o().fire("Error",a?.data?.message||"Submission failed.","error")}catch(e){o().fire("Error",e?.response?.data?.message||"Submission failed.","error")}finally{S(!1)}}},n().createElement("div",{className:"row"},n().createElement("div",{className:"col-lg-3"},n().createElement("div",{className:"form-group file-upload-wrapper"},n().createElement("label",{className:"form-label"},"Identity Documents (min 1) ",n().createElement("span",{className:"required"},"*")),n().createElement("div",{className:"file-input-container"},n().createElement("input",{type:"file",accept:"image/*,application/pdf",multiple:!0,onChange:e=>{const a=Array.from(e.target.files||[]);N(e=>[...e,...a]),B("identityDocs"),q(M(d,{identityDocs:[...E,...a],residencyDocs:g,photoFile:b,educationCertFile:y,apprenticeshipFile:F,priorLicenseFile:D}))},className:`file-input ${R("identityDocs")}`})),A.identityDocs&&P.identityDocs&&n().createElement("div",{className:"error-msg"},P.identityDocs),n().createElement("div",{className:"uploaded-list"},E.map((e,a)=>n().createElement("div",{key:a,className:"file-item"},n().createElement("span",{className:"file-name"},e.name),n().createElement("button",{type:"button",className:"btn btn-link",onClick:()=>T("identity",a)},"Remove")))),n().createElement("hr",null),n().createElement("label",{className:"form-label"},"Residency Documents (optional)"),n().createElement("div",{className:"file-input-container"},n().createElement("input",{type:"file",accept:"image/*,application/pdf",multiple:!0,onChange:e=>{const a=Array.from(e.target.files||[]);_(e=>[...e,...a]),B("residencyDocs"),q(M(d,{identityDocs:E,residencyDocs:[...g,...a],photoFile:b,educationCertFile:y,apprenticeshipFile:F,priorLicenseFile:D}))},className:"file-input"})),n().createElement("div",{className:"uploaded-list"},g.map((e,a)=>n().createElement("div",{key:a,className:"file-item"},n().createElement("span",{className:"file-name"},e.name),n().createElement("button",{type:"button",className:"btn btn-link",onClick:()=>T("residency",a)},"Remove")))),n().createElement("hr",null),n().createElement("label",{className:"form-label"},"Passport-style Photo ",n().createElement("span",{className:"required"},"*")),n().createElement("div",{className:"file-input-container"},n().createElement("input",{type:"file",accept:"image/*",onChange:e=>{const a=e.target.files?.[0];a&&(v(a),B("photoFile"),q(M(d,{identityDocs:E,residencyDocs:g,photoFile:a,educationCertFile:y,apprenticeshipFile:F,priorLicenseFile:D})))},className:`file-input ${R("photoFile")}`})),A.photoFile&&P.photoFile&&n().createElement("div",{className:"error-msg"},P.photoFile),b&&n().createElement("div",{className:"file-item"},n().createElement("span",{className:"file-name"},b.name),n().createElement("button",{type:"button",className:"btn btn-link",onClick:()=>v(null)},"Remove")),n().createElement("hr",null),n().createElement("label",{className:"form-label"},"Education / Certificate (diploma)"),n().createElement("div",{className:"file-input-container"},n().createElement("input",{type:"file",accept:"image/*,application/pdf",onChange:e=>{const a=e.target.files?.[0];a&&(k(a),B("educationCertFile"),q(M(d,{identityDocs:E,residencyDocs:g,photoFile:b,educationCertFile:a,apprenticeshipFile:F,priorLicenseFile:D})))},className:"file-input"})),y&&n().createElement("div",{className:"file-item"},n().createElement("span",{className:"file-name"},y.name),n().createElement("button",{type:"button",className:"btn btn-link",onClick:()=>k(null)},"Remove")),n().createElement("hr",null),n().createElement("label",{className:"form-label"},"Apprenticeship Proof (if Apprentice)"),n().createElement("div",{className:"file-input-container"},n().createElement("input",{type:"file",accept:"image/*,application/pdf",onChange:e=>{const a=e.target.files?.[0];a&&(C(a),B("apprenticeshipFile"),q(M(d,{identityDocs:E,residencyDocs:g,photoFile:b,educationCertFile:y,apprenticeshipFile:a,priorLicenseFile:D})))},className:`file-input ${R("apprenticeshipFile")}`})),F&&n().createElement("div",{className:"file-item"},n().createElement("span",{className:"file-name"},F.name),n().createElement("button",{type:"button",className:"btn btn-link",onClick:()=>C(null)},"Remove")),n().createElement("hr",null),n().createElement("label",{className:"form-label"},"Previous License Document (if renewal)"),n().createElement("div",{className:"file-input-container"},n().createElement("input",{type:"file",accept:"image/*,application/pdf",onChange:e=>{const a=e.target.files?.[0];a&&(x(a),B("priorLicenseFile"),q(M(d,{identityDocs:E,residencyDocs:g,photoFile:b,educationCertFile:y,apprenticeshipFile:F,priorLicenseFile:a})))},className:"file-input"})),D&&n().createElement("div",{className:"file-item"},n().createElement("span",{className:"file-name"},D.name),n().createElement("button",{type:"button",className:"btn btn-link",onClick:()=>x(null)},"Remove")))," "),n().createElement("div",{className:"col-lg-9"},n().createElement("div",{className:"row"},n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"First Name ",n().createElement("span",{className:"required"},"*")),n().createElement("input",{type:"text",name:"first_name",value:d.first_name,onChange:G,onBlur:()=>B("first_name"),className:`form-control ${R("first_name")}`}),A.first_name&&P.first_name&&n().createElement("div",{className:"error-msg"},P.first_name))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Middle Name"),n().createElement("input",{type:"text",name:"middle_name",value:d.middle_name,onChange:G,className:"form-control"}))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Last Name ",n().createElement("span",{className:"required"},"*")),n().createElement("input",{type:"text",name:"last_name",value:d.last_name,onChange:G,onBlur:()=>B("last_name"),className:`form-control ${R("last_name")}`}),A.last_name&&P.last_name&&n().createElement("div",{className:"error-msg"},P.last_name))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Date of Birth ",n().createElement("span",{className:"required"},"*")),n().createElement("input",{type:"date",name:"date_of_birth",value:d.date_of_birth,onChange:G,onBlur:()=>B("date_of_birth"),className:`form-control ${R("date_of_birth")}`}),A.date_of_birth&&P.date_of_birth&&n().createElement("div",{className:"error-msg"},P.date_of_birth))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Contact Phone ",n().createElement("span",{className:"required"},"*")),n().createElement("input",{type:"tel",name:"contact_phone",value:d.contact_phone,onChange:G,onBlur:()=>B("contact_phone"),className:`form-control ${R("contact_phone")}`}),A.contact_phone&&P.contact_phone&&n().createElement("div",{className:"error-msg"},P.contact_phone))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Email"),n().createElement("input",{type:"email",name:"contact_email",value:d.contact_email,onChange:G,onBlur:()=>B("contact_email"),className:`form-control ${R("contact_email")}`}),A.contact_email&&P.contact_email&&n().createElement("div",{className:"error-msg"},P.contact_email))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label d-block"},"Gender"),n().createElement("div",{className:"form-check form-check-inline"},n().createElement("input",{className:`form-check-input ${R("gender")}`,type:"radio",name:"gender",value:"Male",checked:"Male"===d.gender,onCh
1ange:G}),n().createElement("label",{className:"form-check-label"},"Male")),n().createElement("div",{className:"form-check form-check-inline"},n().createElement("input",{className:`form-check-input ${R("gender")}`,type:"radio",name:"gender",value:"Female",checked:"Female"===d.gender,onChange:G}),n().createElement("label",{className:"form-check-label"},"Female")),n().createElement("div",{className:"form-check form-check-inline"},n().createElement("input",{className:`form-check-input ${R("gender")}`,type:"radio",name:"gender",value:"Other",checked:"Other"===d.gender,onChange:G}),n().createElement("label",{className:"form-check-label"},"Other")))),n().createElement("div",{className:"col-lg-12"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Current Mailing Address ",n().createElement("span",{className:"required"},"*")),n().createElement("input",{type:"text",name:"applicant_address",value:d.applicant_address,onChange:G,onBlur:()=>B("applicant_address"),className:`form-control ${R("applicant_address")}`}),A.applicant_address&&P.applicant_address&&n().createElement("div",{className:"error-msg"},P.applicant_address),n().createElement("div",{className:"row mt-2"},n().createElement("div",{className:"col-lg-4"},n().createElement("input",{type:"text",name:"city",value:d.city,onChange:G,className:"form-control",placeholder:"City"})),n().createElement("div",{className:"col-lg-4"},n().createElement("input",{type:"text",name:"state",value:d.state,onChange:G,className:"form-control",placeholder:"State"})),n().createElement("div",{className:"col-lg-4"},n().createElement("input",{type:"text",name:"zip",value:d.zip,onChange:G,className:"form-control",placeholder:"ZIP"}))))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Role"),n().createElement("select",{name:"license_role",value:d.license_role,onChange:G,className:"form-select"},n().createElement("option",null,"Cosmetologist"),n().createElement("option",null,"Barber"),n().createElement("option",null,"Instructor"),n().createElement("option",null,"Apprentice")))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"License Number"),n().createElement("input",{type:"text",name:"license_number",value:d.license_number,onChange:G,className:"form-control"}))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"School / Training Provider"),n().createElement("input",{type:"text",name:"school_name",value:d.school_name,onChange:G,className:"form-control"}))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Graduation Date"),n().createElement("input",{type:"date",name:"graduation_date",value:d.graduation_date,onChange:G,className:"form-control"}))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Apprenticeship Hours"),n().createElement("input",{type:"text",name:"apprenticeship_hours",value:d.apprenticeship_hours,onChange:G,className:"form-control",placeholder:"e.g., 1600"}))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Exam Date"),n().createElement("input",{type:"date",name:"exam_date",value:d.exam_date,onChange:G,className:"form-control"}))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Exam Score"),n().createElement("input",{type:"text",name:"exam_score",value:d.exam_score,onChange:G,className:"form-control"}))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Salon / Employer Name"),n().createElement("input",{type:"text",name:"salon_name",value:d.salon_name,onChange:G,className:"form-control"}))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Salon / Employer Address"),n().createElement("input",{type:"text",name:"salon_address",value:d.salon_address,onChange:G,className:"form-control"}))),n().createElement("div",{className:"col-lg-4"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},"Employer Phone"),n().createElement("input",{type:"tel",name:"employer_phone",value:d.employer_phone,onChange:G,className:"form-control"}))),n().createElement("div",{className:"col-lg-12"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label d-block"},"Have you ever been convicted of a disqualifying offense?"),n().createElement("div",{className:"form-check form-check-inline"},n().createElement("input",{type:"radio",name:"conviction_history",value:"Yes",className:"form-check-input",checked:"Yes"===d.conviction_history,onChange:G}),n().createElement("label",{className:"form-check-label"},"Yes")),n().createElement("div",{className:"form-check form-check-inline"},n().createElement("input",{type:"radio",className:"form-check-input",n
1ame:"conviction_history",value:"No",checked:"No"===d.conviction_history,onChange:G}),n().createElement("label",{className:"form-check-label"},"No")),"Yes"===d.conviction_history&&n().createElement("div",{className:"mt-2"},n().createElement("textarea",{name:"conviction_details",value:d.conviction_details,onChange:G,className:"form-control",rows:"3",placeholder:"Provide details"})))),n().createElement("div",{className:"col-xxl-7 col-lg-8"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},(0,m.dt)()," Identity ",n().createElement("span",{className:"required"},"*")),n().createElement("div",{className:"d-flex gap-2 identity-input"},n().createElement("input",{type:"text",className:`form-control ${R("utah_identity")}`,value:d.utah_identity,readOnly:!0,onBlur:()=>B("utah_identity")}),n().createElement("button",{type:"button",className:"btn btn-primary",onClick:async()=>{try{$(!0);const e=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),a=await i.A.get("/register/qrcode?purpose=uuid");if(!a?.data?.success)return $(!1),void o().fire("Error",a?.data?.message||"Failed to generate QR code","error");const{verkey:t,challenge:l,qrcode_image_url:n}=a.data.data;if(!t||!l||!n)return $(!1),void o().fire("Error","Incomplete QR code data received from server.","error");f(t);const c=e?`<a href="clearlife://uuid/${l}" class="btn btn-primaryx app_opener_link">Open ${(0,m.dt)()}LIFE</a>`:"";o().fire({title:e?"":`Scan the above QR Code from your ${(0,m.dt)()}LIFE app to get a Unique Identity`,imageUrl:e?null:n,html:c,imageWidth:350,allowOutsideClick:!0,timer:4e4,timerProgressBar:!0,willClose:()=>{clearInterval(p),$(!1)},didOpen:()=>{o().showLoading(),p=setInterval(async()=>{try{const e=await i.A.get(`/register/publickey/${t}`);e?.data?.success&&e.data.data?.uuid&&(clearInterval(p),o().close(),u(a=>({...a,utah_identity:e.data.data.uuid})),B("utah_identity"),q(e=>{const a={...e};return delete a.utah_identity,a}),o().fire("Success",`${(0,m.dt)()} Identity Verified`,"success"),$(!1))}catch(e){clearInterval(p),o().fire("Error","Failed to verify identity.","error"),$(!1)}},3e3)}})}catch(e){$(!1),o().fire("Error","QR code generation failed.","error")}},disabled:L,style:{background:(0,m.$9)()}},L?"Generating...":"Get unique identity")),A.utah_identity&&P.utah_identity&&n().createElement("div",{className:"error-msg"},P.utah_identity))),n().createElement("div",{className:"col-lg-12"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},n().createElement("input",{type:"checkbox",name:"background_check_consent",checked:!!d.background_check_consent,onChange:G})," I consent to background and criminal history checks as required by ",(0,m.dt)()," DOPL. ",n().createElement("span",{className:"required"},"*")),A.background_check_consent&&P.background_check_consent&&n().createElement("div",{className:"error-msg"},P.background_check_consent))),n().createElement("div",{className:"col-lg-12"},n().createElement("div",{className:"form-group"},n().createElement("label",{className:"form-label"},n().createElement("input",{type:"checkbox",name:"applicant_signature",checked:!!d.applicant_signature,onChange:G})," I certify that the information provided is true and accurate to the best of my knowledge. ",n().createElement("span",{className:"required"},"*")),A.applicant_signature&&P.applicant_signature&&n().createElement("div",{className:"error-msg"},P.applicant_signature))),n().createElement("div",{className:"col-lg-12"},n().createElement("div",{className:"submit-btn d-flex justify-content-end gap-3"},n().createElement("button",{type:"button",className:"btn btn-cancel",onClick:()=>window.history.back()},"Cancel"),n().createElement("button",{type:"submit",className:"btn btn-primary",disabled:w||L},w?"Submitting...":"Submit ")))))))))))}}}]);
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.