PageSourceSearch

https://www.ashcare.com/react/assets/SelectedRoleStep1-461dd9e1.esm-DV7D-T4P.js

js ashcare.com collected 2026-10-08 09:11:11 UTC 11,136 bytes, 2 lines download raw bytes

1import{m as Fe,u as Ne,D as ke,r as P,n as x,j as r,E as Y,S as F,T as N,F as G,w as b,B as je,H as Te,y as K,z as k,L as Ee,x as Re}from"./index-HIYmxtGU.js";import{F as Ae,v as Ue,y as Ve}from"./formik.esm-DUT4wmox.js";import{c as R,a as S}from"./index.esm-BgjGvt5U.js";import{u as _e}from"./useSubmitRegistrationStep1Form-ef5ad9a6.esm-Bv3mrquU.js";import{v as X,e as L}from"./languages-8b5a4213.esm-CEGNtLgk.js";import{l as Ce}from"./identityHelperFunctions-d26170b9.esm-6TEjWtYQ.js";import{R as Be}from"./RegistrationFormWrapper-ae9c71b9.esm-Dvn6E36j.js";import{e as J}from"./validationSchemas-5fb2dca2.esm-hkbfc0TD.js";import{A as Me}from"./AlertTitle-Cc-0UNiC.js";import"./apiCalls-48ad95db.esm-CE3z2abO.js";import"./index-3RCf7ic3.js";import"./___vite-browser-external_commonjs-proxy-kNWilrCz.js";import"./dataService-80ac0122.esm-BPBT0wTx.js";function Q(o,i){var a=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);i&&(t=t.filter(function(I){return Object.getOwnPropertyDescriptor(o,I).enumerable})),a.push.apply(a,t)}return a}function y(o){for(var i=1;i<arguments.length;i++){var a=arguments[i]!=null?arguments[i]:{};i%2?Q(Object(a),!0).forEach(function(t){Re(o,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):Q(Object(a)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(a,t))})}return o}var He={1:R().shape({userId:S().trim("trim empty spaces").required("Please enter a User Id."),pin:S().trim("trim empty spaces").required("Please enter a pin."),password:S().required("Please enter a password.")}),2:R().shape(y(y({},J),{},{taxIdNumber:S().when("$showTaxIdNumber",function(o,i){var a=x(o,1),t=a[0];return t?i.trim("trim empty spaces").required("Please enter a tax ID number."):i}),npi1:S().when("$showNpi",function(o,i){var a=x(o,1),t=a[0];return t?i.trim("trim empty spaces").required("Please enter your NPI."):i})})),3:R().shape(y(y({},J),{},{facilityId:S().when("$showFitnessFacilityId",function(o,i){var a=x(o,1),t=a[0];return t?i.trim("trim empty spaces").required("Please enter a location ID number.").matches(X.facilityId):i})}))},er=function(){var i=Fe("identity"),a=i.clientId,t=i.blob,I=i.redirectUri,j=i.customerServicePhoneNumber,A=i.customerServicePhoneNumberFitness,Z=i.customerServiceOptionForFitness,U=Ne(),ee=ke(),w=ee["selected-user-role"],re=function(){return w==="Existing ASHLink User"?{clientId:a,blob:t,redirectUri:I,userRoleValue:1,title:"Log in to your existing primary ASHLink Account",registrationFormLanguage:"Please log in to your existing primary ASHLink account."}:w==="Clinical User"?{clientId:a,blob:t,redirectUri:I,userRoleValue:2,title:"Verify Eligibility",registrationFormLanguage:"Enter the following information to confirm that you are eligible for ASHLink access. You will receive a link to register if confirmed."}:w==="Fitness User"?{clientId:a,blob:t,redirectUri:I,userRoleValue:3,title:"Verify Eligibility",registrationFormLanguage:"Enter the following information to confirm that you are eligible for ASHLink access."}:{clientId:a,blob:t,redirectUri:I,userRoleValue:1,title:"Log in to your existing primary ASHLink Account",registrationFormLanguage:"Please log in to your existing primary ASHLink account."}},ie=P.useState({clientId:"empowered-decisions.code",blob:"test-blob",redirectUri:"https://dev.empowered-decisions.com/callback",userRoleValue:1,title:"Log in to your existing primary ASHLink Account",registrationFormLanguage:"Please log in to your existing primary ASHLink account."}),V=x(ie,2),s=V[0],ae=V[1],te=P.useState({errorMessage:null}),_=x(te,2),C=_[0],d=_[1],se=P.useState(!1),B=x(se,2),ne=B[0],oe=B[1],le=P.useState(""),M=x(le,2),ue=M[0],ce=M[1];P.useEffect(function(){if(w){var h=re();ae(h),d({errorMessage:null})}},[w]);var de=[1],me=[1],he=[1],ge=[2],fe=[2,3],ye=[2],ve=[3],H=ge.includes(s.userRoleValue),O=ve.includes(s.userRoleValue),D=fe.includes(s.userRoleValue),$=ne&&ye.includes(s.userRoleValue),q=he.includes(s.userRoleValue),be=de.includes(s.userRoleValue),xe=me.includes(s.userRoleValue),Ie=w==="Existing ASHLink User"?"Next":"Verify Eligibility",we=(function(){var h=K(k.mark(function e(n){var f,l,u,c,m,v,E,z,p;return k.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(l=(f=n.data.status||"")===null||f===void 0?void 0:f.toLowerCase(),!(l==="valid"||l==="ok")){g.next=1;break}s.userRoleValue===1?U("../../registration/step2",{state:{email:(u=n.data)===null||u===void 0?void 0:u.email,isASHLinkPrimaryAccount:(c=n.data)===null||c===void 0?void 0:c.isPrimary,ASHLinkUserType:(m=n.data)===null||m===void 0?void 0:m.registrationUserType,ASHLinkDisplayInfo:(v=n.data)===null||v===void 0?void 0:v.displayInfo,token:(E=n.data)===null||E===void 0?void 0:E.token,userIsEligible:!0,firstName:null,lastName:null,phone:null,userCredentialCode:null}}):U("../check-email-to-register-success-message"),g.next=4;break;case 1:if(!(l==="alreadyregistered"||l==="alreadyexist")){g.next=3;break}return g.next=2,L.userExistsWithLoginLink("../../login");case 2:z=g.sent,d({errorMessage:z}),g.next=4;break;case 3:l==="legacyuser"?d({errorMessage:r.jsxs("span",{children:["An account with the provided information already exists. To activate your account, please"," ",r.jsx(Ee,{to:"../Existing ASHLink User",children:"click here"})," ","and follow the instructions for existing ASHLink user."]})}):l==="requiredmoreinfo"?(ce(n.data.token),oe(!0),d({errorMessage:L.duplicateClinicalUser})):l==="invalid"?((p=n.data)===null||p===void 0||(p=p.invalidCode)===null||p===void 0?void 0:p.toLowerCase())==="primaryaccountnotregistered"?d({errorMessage:"We're sorry, we are unable to confirm your eligibility. If you are a clinical sub-account user, the primary account must register before you can create your account. Please contact the primary account holder. If you feel this is incorrect, please contact us. <br/> For clinical Users:  ".concat(j," <br/>For Fitness Users: ").concat(A,", option 4")}):d({errorMessage:"We're sorry, we are unable to confirm your eligibility. If you feel this is incorrect, please contact us. <br/>For clinical Users:  ".concat(j," <br/>For Fitness Users: ").concat(A,", option 4")}):d({errorMessage:L.generic});case 4:case"end":return g.stop()}},e)}));return function(n){return h.apply(this,arguments)}})(),pe=function(e,n){var f=["userId","password","email","pin","taxIdNumber","facilityId","npi1"],l=s.userRoleValue,u="".concat(L.selectRoleStepServerErrorPrefix," ").concat(j);l===2?u="".concat(u,"."):l===3&&(u="".concat(u,", option ").concat(Z,".")),e.length>0?e.map(function(c){return y(y({},c),{},{fieldName:c.fieldName==="TaxId"?"TaxIdNumber":c.fieldName})}
1).forEach(function(c){var m=Ce(c.fieldName);f.includes(m)?n(m,X[m]):d({errorMessage:L.serverError})}):[2,3].includes(l)?d({errorMessage:u}):d({errorMessage:L.serverError})},W=_e(we,pe),T=W.isLoading,Se=W.mutate,Le=(function(){var h=K(k.mark(function e(n,f){var l,u,c,m;return k.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:l=f.setFieldError,u=new Map([[1,"ExistingUser"],[2,"ClinicalUser"],[3,"FitnessUser"]]),c=y(y({},n),{},{blob:s.blob,client_id:s.clientId,redirect_uri:s.redirectUri,registrationUserType:u.get(s.userRoleValue),status:"",token:ue}),m={requestData:c,setFieldError:l},T!==!0&&(d({errorMessage:null}),Se(m));case 1:case"end":return v.stop()}},e)}));return function(n,f){return h.apply(this,arguments)}})(),Pe={userId:"",password:"",email:"",pin:"",taxIdNumber:"",facilityId:"",npi1:""};return r.jsx(Be,{children:r.jsx(Ae,{initialValues:Pe,onSubmit:Le,validate:function(e){try{Ue(e,He[s.userRoleValue],!0,{showEmail:D,showPin:q,showTaxIdNumber:H,showFitnessFacilityId:O,showNpi:$})}catch(n){return Ve(n)}return{}},children:function(e){return r.jsxs(Y,{component:"form",id:"registrationStep1Form",onSubmit:e.handleSubmit,children:[r.jsxs(F,{spacing:2,mt:4,children:[r.jsx(N,{variant:"h5",component:"h1",color:"primary",children:s.title}),r.jsx(N,{variant:"subtitle1",component:"h2",color:"text.primary",children:"Step 1 of 2"})]}),r.jsxs(F,{spacing:3,children:[r.jsx(N,{color:"text.secondary",children:s.registrationFormLanguage}),C.errorMessage&&r.jsx(G,{severity:"error","data-testid":"errorMessage",children:C.errorMessage}),be&&r.jsx(b,{id:"userId",name:"userId",label:"User Id",InputLabelProps:{shrink:!0},value:e.values.userId,onChange:e.handleChange,onBlur:e.handleBlur,error:!!e.touched.userId&&!!e.errors.userId,helperText:e.touched.userId&&e.errors.userId}),xe&&r.jsx(b,{id:"password",name:"password",label:"Password",type:"password",InputLabelProps:{shrink:!0},value:e.values.password,onChange:e.handleChange,onBlur:e.handleBlur,error:!!e.touched.password&&!!e.errors.password,helperText:e.touched.password&&e.errors.password}),H&&r.jsx(b,{id:"taxIdNumber",name:"taxIdNumber",label:"Tax ID Number",value:e.values.taxIdNumber,inputProps:{inputMode:"numeric"},onChange:e.handleChange,onBlur:e.handleBlur,error:e.touched.taxIdNumber&&!!e.errors.taxIdNumber,helperText:e.touched.taxIdNumber&&e.errors.taxIdNumber?e.errors.taxIdNumber:"Please enter your Tax ID Number."}),O&&r.jsxs(F,{spacing:1,children:[r.jsx(G,{severity:"warning",children:r.jsxs(F,{spacing:.5,children:[r.jsx(Me,{children:r.jsx("strong",{children:"Primary Accounts Only"})}),"Creating this primary account for the facility should be limited to ownership and/or management."]})}),r.jsx(b,{id:"facilityId",name:"facilityId",label:"Location Identifier Number",value:e.values.facilityId,inputProps:{inputMode:"numeric"},onChange:e.handleChange,onBlur:e.handleBlur,error:e.touched.facilityId&&!!e.errors.facilityId,helperText:e.touched.facilityId&&e.errors.facilityId?e.errors.facilityId:"The Location Identifier Number is the number associated with your fitness center location and ASH Agreement."})]}),D&&r.jsx(b,{id:"email",name:"email",label:"Email Address",type:"email",value:e.values.email,onChange:e.handleChange,onBlur:e.handleBlur,error:e.touched.email&&!!e.errors.email,helperText:e.touched.email&&e.errors.email?e.errors.email:"The email address should be the email address associated with the agreement you signed when joining the network(s) applicable to your ASHLink use."}),$&&r.jsx(b,{id:"npi1",name:"npi1",label:"Type 1 Individual National Provider NPI",value:e.values.npi1,onChange:e.handleChange,onBlur:e.handleBlur,error:e.touched.npi1&&!!e.errors.npi1,helperText:e.touched.npi1&&e.errors.npi1?e.errors.npi1:"Please enter your Type 1 Individual National Provider NPI"}),q&&r.jsx(b,{id:"pin",name:"pin",label:"Pin",value:e.values.pin,inputProps:{inputMode:"numeric"},onChange:e.handleChange,onBlur:e.handleBlur,error:e.touched.pin&&!!e.errors.pin,helperText:e.touched.pin&&e.errors.pin}),r.jsx(Y,{textAlign:"center",children:r.jsx(je,{size:"large",type:"submit",fullWidth:!0,variant:"contained",color:"secondary",disabled:T,children:T?"Loading...":Ie})}),(s.userRoleValue===2||s.userRoleValue===3)&&r.jsxs(N,{textAlign:"center",variant:"body2",children:["Already have an account? ",r.jsx(Te,{href:"../login",children:"Log In"})," "]})]})]})}})})};export{er as default};
2//# sourceMappingURL=SelectedRoleStep1-461dd9e1.esm-DV7D-T4P.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.