const jsi=function(){async function e(){let e=document.getElementById("jsi_menu_slot");if(e){let t='\n
\n Sign In\n Sign Up\n
\n ';e.innerHTML=t,document.getElementById("jsi_sign_in_link").addEventListener("click",I(k)),document.getElementById("jsi_sign_up_link").addEventListener("click",I(A))}}async function t(){let e=document.getElementById("jsi_menu_slot");if(e){let t=`\n Hi, ${fe?fe.firstName:c("jsiun")}\n `;e.innerHTML=t,document.getElementById("jsi_users_name").addEventListener("click",i)}}function i(){document.getElementById("jsi_users_name").classList.contains("jsi_users_menu_open")?s():function(){let e=document.getElementById("jsi_users_name");e.classList.contains("jsi_users_menu_open")||e.classList.add("jsi_users_menu_open");let t=null;try{t=window.getUserMenuItems()}catch(e){}let i="";if(t)for(const e in t){i+=`${t[e].name}`}let s=`\n ${p()}\n ${fe.email}\n
\n ${i?`${i}
`:""}\n Sign In Settings\n Sign Out\n `,a=document.getElementById("jsi_user_menu");if(!a){if(a=document.createElement("div"),a.setAttribute("id","jsi_user_menu"),a.innerHTML=s,document.getElementById("jsi_menu_slot").appendChild(a),document.getElementById("jsi_user_menu_sign_in_settings_link").addEventListener("click",I((()=>{n(L)}))),document.getElementById("jsi_user_menu_sign_out_link").addEventListener("click",I((()=>{n(Q)}))),t)for(const e in t){let i=t[e];i.callback&&document.getElementById(`jsi_additional_user_menu_item_${e}`).addEventListener("click",I((()=>{n(i.callback)})))}requestAnimationFrame((function(){let e=a.offsetHeight+5+"px";a.style.maxHeight="0",a.style.transition="max-height .2s ease, opacity .2s ease",requestAnimationFrame((function(){a.style.visibility="unset",a.style.maxHeight=e,a.style.opacity=1}))}))}}()}function s(){let e=document.getElementById("jsi_users_name");e.classList.contains("jsi_users_menu_open")&&e.classList.remove("jsi_users_menu_open");let t=document.getElementById("jsi_user_menu");t&&(t.style.maxHeight="0",t.style.opacity=0,t.addEventListener("transitionend",(function(e){t.remove()})))}function n(e){if(s(),e)try{e()}catch(e){}return!1}function a(e,t){if(e){let i=c("jsid")||"",s=i.split("|"),n=[];for(const t of s)t&&t.includes(":")&&!t.startsWith(`${e}:`)&&n.push(t);t&&n.push(`${e}:${t}`),i=n.join("|"),_("jsid",i,365)}}function o(e){let t=d();if(t&&e){let i=`${e}:`;for(const e of t)if(e&&e.startsWith(i))return e.split(":")[1]}return""}function d(){let e=[],t=c("jsid");if(t){let i=t.split("|");if(i&&i.length>0)for(const t of i)t&&t.includes(":")&&e.push(t)}return e}function r(){return c("jsis")}function _(e,t,i,s=ce){let n=new Date;n.setTime(n.getTime()+24*i*60*60*1e3);let a=`${e}=${t};path=/;samesite=strict;expires=${n.toUTCString()}`;le||(a+=`;domain=${s};secure`),document.cookie=a}function l(e){_(e,"",-10,ce)}function c(e,t=!0){!function(e){let t=ce.split(".").slice(1);for(;t.length>=2;)_(e,"",-10,t.join(".")),t=t.slice(1)}(e);for(var i=e+"=",s=decodeURIComponent(document.cookie).split(";"),n=0;n\n
\n
\n
\n
\n
${e}
\n \n
\n
\n ${t}\n
\n
\n \n `,n=document.getElementById("jsi");n?n.innerHTML=s:(n=document.createElement("div"),n.setAttribute("id","jsi"),n.innerHTML=s,document.getElementsByTagName("body")[0].appendChild(n)),document.getElementById("jsi_modal_close").addEventListener("click",I((async()=>{let e=!0;i&&(e=await i()),e&&h()})))}function h(){document.getElementById("jsi").remove()}function g(e){let t="jsi_modal_loading_show",i=document.getElementById("jsi_modal_loading");i&&(e?i.classList.contains(t)||i.classList.add(t):i.classList.contains(t)&&i.classList.remove(t))}function w(e){j(e.toUpperCase(),'
'),g(!0)}let y=null;function v(e,t){let i=document.getElementById("jsi_modal_toast");i.innerText=e,i.classList.contains("jsi_modal_toast_success")?t&&(i.classList.add("jsi_modal_toast_error"),i.classList.remove("jsi_modal_toast_success")):i.classList.contains("jsi_modal_toast_error")?t||(i.classList.add("jsi_modal_toast_success"),i.classList.remove("jsi_modal_toast_error")):i.classList.add(t?"jsi_modal_toast_error":"jsi_modal_toast_success"),i.classList.contains("jsi_modal_toast_show")||i.classList.add("jsi_modal_toast_show"),null!=y&&(clearTimeout(y),y=null),y=setTimeout((()=>{y=null,i.classList.remove("jsi_modal_toast_show"),i.innerText=""}),5e3)}async function E(e,t,i){try{let s={appId:_e};t&&(s.sessionId=r()),i&&(s=Object.assign(s,i));let n=await async function(e="",t={}){try{return await fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"same-origin",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(t)})}catch(e){return null}}(`https://${de}/api/v1/web/${e}`,s);if(!n)throw"No response from api";let a=await n.json();return{status:n.status,data:a,response:n}}catch(e){return{status:500,data:null,response:null}}}function I(e){return async t=>(t.preventDefault(),await e(),!1)}function k(){fe&&fe.id&&Q(),j("SIGN IN",`\n ${me||ue?`
\n ${me?'\n
\n ':""}\n ${ue?`\n
 Sign in with Apple
\n `:""}\n
or
\n
`:""}\n \n \n Forgot your password?\n \n Don't have an account?\n `),document.getElementById("jsi_modal_forgot_password_link").addEventListener("click",I(b)),document.getElementById("jsi_modal_sign_up_link").addEventListener("click",I(A)),document.getElementById("jsi_email").addEventListener("keyup",Z(q)),document.getElementById("jsi_password").addEventListener("keyup",Z(q)),document.getElementById("jsi_sign_in_button").addEventListener("click",q),me&&ee(te),ue&&(document.getElementById("jsi_apple_sign_in_btn").addEventListener("click",(async()=>{try{AppleID.auth.init({clientId:ue,scope:"name email",redirectURI:pe,usePopup:!0});let e=await AppleID.auth.signIn({clientId:ue,scope:"name email",redirectURI:pe,usePopup:!0});q({vendor:"APPLE",token:e.authorization.id_token,firstName:e.user&&e.user.name&&e.user.name.firstName?e.user.name.firstName:"",lastName:e.user&&e.user.name&&e.user.name.lastName?e.user.name.lastName:""})}catch(e){e&&"popup_closed_by_user"!=e.error&&v("Sign In with Apple didn't work",!0)}})),oe())}function b(){j("FORGOT YOUR PASSWORD",'\n
Enter your email address for help resetting your password
\n \n \n '),document.getElementById("jsi_email").addEventListener("keyup",Z(W)),document.getElementById("jsi_forgot_password_button").addEventListener("click",W)}function S(e){j("RESET PASSWORD",`\n
Your password reset code was sent to:
${e}
\n \n
\n Password strength: \n
\n \n \n
\n Show password\n
\n Need another password reset code?\n \n `),document.getElementById("jsi_modal_another_password_reset_code_link").addEventListener("click",I((()=>{!async function(e){g(!0);try{let{status:t,data:i}=await E("forgotPassword",!1,{email:e});if(200==t)v("We just sent you another code",!1);else{if(400!=t)throw"";v("Invalid email address",!0)}}catch(e){v("Something went wrong",!0)}g(!1)}(e)}))),document.getElementById("jsi_password").addEventListener("keyup",F),document.getElementById("jsi_show_passwords").addEventListener("click",z),document.getElementById("jsi_password_again").addEventListener("keyup",Z((()=>{M(e)}))),document.getElementById("jsi_password").addEventListener("keyup",Z((()=>{M(e)}))),document.getElementById("jsi_password_reset_code").addEventListener("keyup",Z((()=>{M(e)}))),document.getElementById("jsi_reset_forgotten_password_button").addEventListener("click",(t=>{M(e)}))}let B=null;async function L(){let e="SIGN IN SETTINGS";if(w(e),B=null,B=await async function(){try{let{status:e,data:t}=await E("signInSettings",!0);if(200==e)return m(t.session),t;if(401==e&&"VERIFY_SESSION"==t.error)return t;throw""}catch(e){return null}}(),!B)return k(),void v("Something went wrong, and you were signed out",!0);if("VERIFY_SESSION"==B.error)return P(B),void(B=null);j(e,`\n
\n
Name
\n Cancel\n Save\n Edit\n
\n \n \n \n
\n
Email
\n Cancel\n Save\n Edit\n
\n \n ${B.emailVerificationRequired?`\n ${B.emailVerified?'\n
Your email address has been Verified
\n ':'\n
You will be asked to verify your email address next time you sign in
\n '}\n `:""}\n\n
\n
Password
\n ${B.passwordSet?"Change":"Set"}\n
\n ${B.passwordSet?"":'\n
\n You have not set a password yet\n
\n '}\n\n ${"NONE"!=B.mfa?`\n
\n
2 Step Verification
\n ${"OPT-IN"==B.mfa?``:""}\n
\n
\n `:""}\n `),document.getElementById("jsi_name_first").value=fe.firstName,document.getElementById("jsi_name_last").value=fe.lastName;const i=()=>{document.getElementById("jsi_name_first").value=fe.firstName,document.getElementById("jsi_name_last").value=fe.lastName,document.getElementById("jsi_name_first").setAttribute("disabled","disabled"),document.getElementById("jsi_name_last").setAttribute("disabled","disabled"),document.getElementById("jsi_cancel_name_link").classList.add("jsi_hide"),document.getElementById("jsi_save_name_link").classList.add("jsi_hide"),document.getElementById("jsi_change_name_link").classList.remove("jsi_hide")};document.getElementById("jsi_change_name_link").addEventListener("click",I((()=>{document.getElementById("jsi_name_first").removeAttribute("disabled"),document.getElementById("jsi_name_last").removeAttribute("disabled"),document.getElementById("jsi_name_first").focus(),document.getElementById("jsi_cancel_name_link").classList.remove("jsi_hide"),document.getElementById("jsi_save_name_link").classList.remove("jsi_hide"),document.getElementById("jsi_change_name_link").classList.add("jsi_hide")}))),document.getElementById("jsi_cancel_name_link").addEventListener("click",I(i)),document.getElementById("jsi_save_name_link").addEventListener("click",I((async()=>{g(!0);try{let e=document.getElementById("jsi_name_first").value,s=document.getElementById("jsi_name_last").value;try{if(!e)throw"Please enter your first name";if(e.length>25)throw"First name may not be longer than 25 characters";if(!Y.test(e))throw"Enter your first name using only letters";if(!s)throw"Please enter your last name";if(s.length>25)throw"Last name may not be longer than 25 characters";if(!Y.test(s))throw"Enter your last name using only letters"}catch(e){return v(e,!0),void g(!1)}let{status:n,data:a}=await E("updateName",!0,{first:e,last:s});if(200!=n){if(401==n&&"VERIFY_SESSION"==a.error)return void P(a);throw""}m(a.session),B=a,document.getElementById("jsi_name_first").value=fe.firstName,document.getElementById("jsi_name_last").value=fe.lastName,v("Your name has been saved",!1),i(),t()}catch(e){v("Something went wrong",!0)}g(!1)}))),document.getElementById("jsi_email").value=fe.email;const s=()=>{document.getElementById("jsi_email").value=fe.email,document.getElementById("jsi_email").setAttribute("disabled","disabled"),document.getElementById("jsi_cancel_email_link").classList.add("jsi_hide"),document.getElementById("jsi_save_email_link").classList.add("jsi_hide"),document.getElementById("jsi_change_email_link").classList.remove("jsi_hide")};document.getElementById("jsi_change_email_link").addEventListener("click",I((()=>{document.getElementById("jsi_email").removeAttribute("disabled"),document.getElementById("jsi_email").focus(),document.getElementById("jsi_cancel_email_link").classList.remove("jsi_hide"),document.getElementById("jsi_save_email_link").classList.remove("jsi_hide"),document.getElementById("jsi_change_email_link").classList.add("jsi_hide")}))),document.getElementById("jsi_cancel_email_link").addEventListener("click",I(s)),document.getElementById("jsi_save_email_link").addEventListener("click",I((async()=>{g(!0);try{let e=document.getElementById("jsi_email").value;try{if(!e)throw"Please enter your email address";if(!e.match(V))throw"Please enter a valid email address";if(e.trim().toLowerCase()==fe.email)return v("Your email address has remained unchanged"),s(),void g(!1)}catch(e){return v(e,!0),void g(!1)}let{status:t,data:i}=await E("updateEmail",!0,{email:e});if(200==t)return k(),void v("Your email address has been saved. Please sign in with the new email address...",!1);if(401==t&&"VERIFY_SESSION"==i.error)return void P(i);throw 403==t?"That email address is already in use":""}catch(e){v(e||"Something went wrong",!0)}g(!1)}))),document.getElementById("jsi_change_password_link").addEventListener("click",I((()=>{!function(e){let t=e?"CHANGE PASSWORD":"SET PASSWORD";!async function(e,t){try{if(w(e),!await f())throw"Not logged in.";t()}catch(e){Q(),k()}}(t,(()=>{j(t,`\n ${e?'\n \n ':""}\n
\n New password strength: \n
\n \n \n
\n Show ${e?"new password":"password"}\n
\n \n `),document.getElementById("jsi_password").addEventListener("keyup",F),document.getElementById("jsi_show_passwords").addEventListener("click",z),e&&document.getElementById("jsi_password_current").addEventListener("keyup",Z((()=>{G(e)}))),document.getElementById("jsi_password").addEventListener("keyup",Z((()=>{G(e)}))),document.getElementById("jsi_password_again").addEventListener("keyup",Z((()=>{G(e)}))),document.getElementById("jsi_change_password_button").addEventListener("click",(()=>{G(e)}))}))}(B.passwordSet)}))),"NONE"!=B.mfa&&("OPT-IN"==B.mfa&&document.getElementById("jsi_mfa_optin").addEventListener("change",(async()=>{if(document.getElementById("jsi_mfa_optin").checked!=B.mfaOptIn){g(!0);try{let e=document.getElementById("jsi_mfa_optin").checked,t={optIn:e};o(fe.userId)&&(t.deviceId=o(fe.userId));let{status:i,data:s}=await E("updateMfaOptIn",!0,t);if(200!=i){if(401==i&&"VERIFY_SESSION"==s.error)return void P(s);throw""}e||a(fe.userId,""),B=s,v(e?"You have enabled 2 Step Verification":"You have disabled 2 Step Verification",!1)}catch(e){v("Something went wrong",!0),document.getElementById("jsi_mfa_optin").checked=B.mfaOptIn}g(!1),N(B)}})),N(B))}function N(e){document.getElementById("jsi_2step_verification").innerHTML=`\n ${"OPT-IN"==e.mfa?e.mfaOptIn?'\n
You will be asked to verify your identity during Sign In by entering a code that will be sent to your phone
\n ':'\n
You have opted out of 2 Step Verification
\n ':'\n
You will be asked to verify your identity during Sign In by entering a code that will be sent to your phone
\n '}\n\n ${e.mfaPhone?`\n
\n
${e.mfaPhone}
\n ${e.mfaPhoneVerified?'\n
Verified
\n ':'\n Verify Phone\n '}\n
\n Remove Phone\n `:""}\n\n ${e.mfaPhone||"REQUIRED"!=e.mfa&&!e.mfaOptIn?"":'\n
Setup your phone number now
\n
Or next time you sign in
\n '}\n \n `,e.mfaPhone&&(document.getElementById("jsi_remove_phone_link").addEventListener("click",I((async()=>{g(!0);try{let{status:t,data:i}=await E("removeMfaPhone",!0);if(200!=t){if(401==t&&"VERIFY_SESSION"==i.error)return void P(i);throw""}e=i,v("Your phone number has been removed",!1)}catch(e){v("Something went wrong",!0)}g(!1),N(e)}))),e.mfaPhoneVerified||document.getElementById("jsi_verify_phone_link").addEventListener("click",I((async()=>{g(!0);try{let{status:e,data:t}=await E("sendAnotherMfaCode",!0);if(200==e)return void O("SIGN-IN-SETTINGS");throw""}catch(e){v("Something went wrong",!0)}g(!1),N(e)})))),e.mfaPhone||"REQUIRED"!=e.mfa&&!e.mfaOptIn||document.getElementById("jsi_mfa_setup_link").addEventListener("click",I((()=>{x("SIGN-IN-SETTINGS")})))}function P(e){j("VERIFY YOUR IDENTITY",`\n ${"MFA"==e.method?'\n
To continue, please enter the code sent to your phone
\n \n ':"EMAIL"==e.method?'\n
To continue, please enter the code sent to your email
\n \n ':""}\n \n Need another verification code?\n `);let t=async()=>{g(!0);try{let e=document.getElementById("jsi_verify_identity_input").value,{status:t,data:i}=await E("verifyIdentity",!0,{code:e});if(200==t)return void L();if(400!=t)throw"";v("Invalid verification code",!0)}catch(e){v("Something went wrong",!0)}g(!1)};document.getElementById("jsi_modal_another_verify_identity_code_link").addEventListener("click",I((async()=>{g(!0);try{let{status:e,data:t}=await E("sendAnotherVerifyIdentityCode",!0);if(200!=e)throw"";v("Another code was just sent")}catch(e){v("Something went wrong",!0)}g(!1)}))),document.getElementById("jsi_verify_identity_input").addEventListener("keyup",Z(t)),document.getElementById("jsi_verify_identity_button").addEventListener("click",t)}function A(){fe&&fe.id&&Q(),j("SIGN UP",`\n ${me||ue?`
\n ${me?'\n
\n ':""}\n ${ue?`\n
 Sign up with Apple
\n `:""}\n
or
\n
`:""}\n \n \n \n \n \n
\n Password strength: \n
\n \n \n
\n Show passwords\n
\n \n Already have an account?\n `),document.getElementById("jsi_password").addEventListener("keyup",F),document.getElementById("jsi_show_passwords").addEventListener("click",z),document.getElementById("jsi_password").addEventListener("keyup",Z(D)),document.getElementById("jsi_password_again").addEventListener("keyup",Z(D)),document.getElementById("jsi_sign_up_button").addEventListener("click",D),me&&ee(se),ue&&(document.getElementById("jsi_apple_sign_in_btn").addEventListener("click",(async()=>{try{AppleID.auth.init({clientId:ue,scope:"name email",redirectURI:pe,usePopup:!0});let e=await AppleID.auth.signIn({clientId:ue,scope:"name email",redirectURI:pe,usePopup:!0});D({vendor:"APPLE",token:e.authorization.id_token,firstName:e.user&&e.user.name&&e.user.name.firstName?e.user.name.firstName:"",lastName:e.user&&e.user.name&&e.user.name.lastName?e.user.name.lastName:""})}catch(e){e&&"popup_closed_by_user"!=e.error&&v("Sign Up with Apple didn't work",!0)}})),oe()),document.getElementById("jsi_modal_sign_in_link").addEventListener("click",I(k))}function x(e="SIGN-IN-UP"){let t="SETUP_MFA_REQUIRED"==fe.nextAction;j("SETUP YOUR PHONE",`\n
We'll text you 6 digit codes to verify your identity while signing in
\n \n
Please enter a phone number that can accept SMS text messages
\n \n ${t?"":'Opt out of setting up your phone'}\n `,(()=>(Q(),!0))),document.getElementById("jsi_phone").addEventListener("keyup",Z((()=>{R(e)}))),document.getElementById("jsi_setup_mfa_phone_button").addEventListener("click",(t=>{R(e)})),t||document.getElementById("jsi_modal_skip_mfa_link").addEventListener("click",I((async()=>{await async function(e="SIGN-IN-UP"){g(!0);try{try{if("SETUP_MFA_REQUIRED"==fe.nextAction)throw"MFA is Required, can't opt-out"}catch(e){return v(e,!0),void g(!1)}let{status:t,data:i}=await E("mfaOptOut",!0);if(200==t)return void("SIGN-IN-UP"==e?$(i.nextAction):"SIGN-IN-SETTINGS"==e&&L());throw""}catch(e){v("Something went wrong",!0)}g(!1)}(e)})))}function O(e="SIGN-IN-UP"){j("VERIFY YOUR PHONE",`\n Use a different phone number?\n
Your phone verification code was sent to:
${fe.codeSentTo}
\n \n Need another verification code?\n \n `),document.getElementById("jsi_modal_change_phone_link").addEventListener("click",I((()=>{x(e)}))),document.getElementById("jsi_modal_another_mfa_code_link").addEventListener("click",I(J)),document.getElementById("jsi_mfa_code").addEventListener("keyup",Z((()=>{T(e)}))),document.getElementById("jsi_verify_mfa_button").addEventListener("click",(()=>{T(e)}))}function $(e){if(fe.nextAction=e,"VERIFY_EMAIL_CODE"==e)j("VERIFY EMAIL",`\n
Your email verification code was sent to:
${fe.email}
\n \n Need another email verification code?\n \n `),document.getElementById("jsi_modal_another_email_verification_code_link").addEventListener("click",I(U)),document.getElementById("jsi_verify_email_code").addEventListener("keyup",Z((()=>{C()}))),document.getElementById("jsi_verify_email_button").addEventListener("click",(e=>{C()}));else if("SETUP_MFA_REQUIRED"==e)x("SIGN-IN-UP");else if("SETUP_MFA_OPTIONAL"==e)x("SIGN-IN-UP");else if("VERIFY_MFA_CODE"==e)j("ENTER YOUR VERIFICATION CODE",`\n
Your verification code was sent to:
${fe.codeSentTo}
\n \n
\n Don't ask again on this computer\n
\n \n Need another verification code?\n `),document.getElementById("jsi_modal_another_mfa_code_link").addEventListener("click",I(J)),document.getElementById("jsi_mfa_code").addEventListener("keyup",Z(H)),document.getElementById("jsi_verify_mfa_button").addEventListener("click",H);else{h(),t(),fe.lastSignInUTC?function(){try{signedIn()}catch(e){console.log("User signed in... create a JS function named signedIn() and it will be called automatically when a user signs in.")}}():function(){try{signedUp()}catch(e){console.log("User signed up... create a JS function named signedUp() and it will be called automatically when a user signs up.")}}()}}async function T(e="SIGN-IN-UP"){g(!0);try{let t=document.getElementById("jsi_mfa_code").value;try{if(!t)throw"Please enter your code"}catch(e){return v(e,!0),void g(!1)}let{status:i,data:s}=await E("verifyMfaPhone",!0,{code:t});if(200==i)return void("SIGN-IN-UP"==e?$(s.nextAction):"SIGN-IN-SETTINGS"==e&&L());if(400!=i)throw"";v("Invalid verification code",!0)}catch(e){v("Something went wrong",!0)}g(!1)}async function R(e="SIGN-IN-UP"){g(!0);try{let t=document.getElementById("jsi_phone").value||"";t=t.replace(/\D/g,"");try{if(!t||10!=t.length||!t.match(/^[0-9]+$/))throw"Please enter your 10 digit phone number"}catch(e){return v(e,!0),void g(!1)}let{status:i,data:s}=await E("setupMfaPhone",!0,{phone:t});if(200==i)return fe.codeSentTo=s.codeSentTo,void O(e);throw""}catch(e){v("Something went wrong",!0)}g(!1)}async function U(){g(!0);try{let{status:e,data:t}=await E("sendAnotherEmailVerificationCode",!0);if(200!=e)throw"";v("We just sent you another code",!1)}catch(e){v("Something went wrong",!0)}g(!1)}async function C(){g(!0);try{let e=document.getElementById("jsi_verify_email_code").value;try{if(!e)throw"Please enter your 6 digit email verification code";if(6!=e.length||!e.match(/^[0-9]+$/))throw"Email verification code must be 6 digits"}catch(e){return v(e,!0),void g(!1)}let{status:t,data:i}=await E("verifyEmailCode",!0,{code:e});if(200==t)return m(i),void $(i.nextAction);if(400!=t||"INVALID_EMAIL_VERIFICATION_CODE"!=i.errorCode)throw"";v("Invalid email verification code",!0)}catch(e){v("Something went wrong",!0)}g(!1)}const Y=/^[a-zA-Z., ]+$/,V=/^\w+([\.\-+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;async function D(e){g(!0);try{let t={};if(e&&e.vendor&&e.token)t.ssoVendor=e.vendor,t.ssoToken=e.token,e.firstName&&(t.ssoFirstName=e.firstName),e.lastName&&(t.ssoLastName=e.lastName);else{let e=document.getElementById("jsi_name_first").value.trim(),i=document.getElementById("jsi_name_last").value.trim(),s=document.getElementById("jsi_email").value,n=document.getElementById("jsi_password").value,a=document.getElementById("jsi_password_again").value;try{if(!e)throw"Please enter your first name";if(e.length>25)throw"First name may not be longer than 25 characters";if(!Y.test(e))throw"Enter your first name using only letters";if(!i)throw"Please enter your last name";if(i.length>25)throw"Last name may not be longer than 25 characters";if(!Y.test(i))throw"Enter your last name using only letters";if(!s)throw"Please enter your email address";if(!s.match(V))throw"Please enter a valid email address";if(!n)throw"Please choose a password";if(!a)throw"Please re-enter your password";if(n!=a)throw"Your passwords do not match";if(n.length>100)throw"Password may not be longer than 100 characters"}catch(e){return v(e,!0),void g(!1)}t.first=e,t.last=i,t.email=s,t.password=n}let{status:i,data:s}=await E("signUp",!1,t);if(200==i)return m(s),void $(s.nextAction);if(403==i)v("Email address is already signed up",!0);else if(400==i&&t.ssoVendor)await gapi.auth2.getAuthInstance().signOut(),v("Something went wrong with Google's sign in",!0);else{if(400!=i||"PASSWORD_TOO_WEAK"!=s.errorCode)throw"";v(`New password strength must be at least '${K(s.requiredPasswordComplexity)}'`,!0)}}catch(e){v("Something went wrong",!0)}g(!1)}async function G(e){g(!0);try{let t=e?document.getElementById("jsi_password_current").value:null,i=document.getElementById("jsi_password").value,s=document.getElementById("jsi_password_again").value;try{if(e&&!t)throw"Please enter your current password";if(e&&t.length>100)throw"Current password may not be longer than 100 characters";if(!i)throw"Please enter your new password";if(!s)throw"Please re-enter your new password";if(i!=s)throw"Your new passwords do not match";if(i.length>100)throw"New password may not be longer than 100 characters"}catch(e){return v(e,!0),void g(!1)}let n={newPassword:i};e&&(n.currentPassword=t);let{status:a,data:o}=await E("changePassword",!0,n);if(200==a)return void function(e){j(e?"PASSWORD CHANGED":"PASSWORD SET",'\n
Your password has been saved
\n \n '),document.getElementById("jsi_password_changed_button").addEventListener("click",L)}(e);if(401==a&&"VERIFY_SESSION"==o.error)return void P(o);if(400==a&&"INVALID_CURRENT_PASSWORD"==o.errorCode)v("Invalid current password",!0);else{if(400!=a||"NEW_PASSWORD_TOO_WEAK"!=o.errorCode)throw"";v(`${e?"New password":"Password"} strength must be at least '${K(o.requiredPasswordComplexity)}'`,!0)}}catch(e){return k(),void v("Something went wrong",!0)}g(!1)}function z(){let e=document.getElementById("jsi_show_passwords").checked;document.getElementById("jsi_password").type=e?"text":"password",document.getElementById("jsi_password_again").type=e?"text":"password"}function F(){let e="",t="",i=document.getElementById("jsi_password").value;if(i&&i.length>0){let s=function(e){let t=0;(function(e){return e.length>=8})(e)&&(t+=1);(function(e){return e.match(/(?=.*[a-z])/)})(e)&&(t+=1);(function(e){return e.match(/(?=.*[A-Z])/)})(e)&&(t+=1);(function(e){return e.match(/(?=.*[0-9])/)})(e)&&(t+=1);(function(e){return e.match(/(?=.*[!@#\$%\^&\*])/)})(e)&&(t+=1);return t}(i);switch(e=K(s),s){case 1:t="jsi_password_complexity_very_weak";break;case 2:t="jsi_password_complexity_weak";break;case 3:t="jsi_password_complexity_average";break;case 4:t="jsi_password_complexity_strong";break;case 5:t="jsi_password_complexity_very_strong";break;default:t=""}}document.getElementById("jsi_password_complexity").setAttribute("class",t),document.getElementById("jsi_password_complexity").innerText=e}async function M(e){g(!0);try{let t=document.getElementById("jsi_password_reset_code").value,i=document.getElementById("jsi_password").value,s=document.getElementById("jsi_password_again").value;try{if(!t)throw"Please enter your 6 digit password reset code";if(6!=t.length||!t.match(/^[0-9]+$/))throw"Password reset code must be 6 digits";if(!i)throw"Please enter your new password";if(!s)throw"Please re-enter your new password";if(i!=s)throw"Your new passwords do not match";if(i.length>100)throw"Password may not be longer than 100 characters"}catch(e){return v(e,!0),void g(!1)}let{status:n,data:a}=await E("resetForgottenPassword",!1,{email:e,code:t,newPassword:i});if(200==n)return k(),void v("Your password was successfully saved",!1);if(400==n&&"INVALID_RESET_CODE"==a.errorCode)v("Invalid password reset code",!0);else{if(400!=n||"NEW_PASSWORD_TOO_WEAK"!=a.errorCode)throw"";v(`New password strength must be at least '${K(a.requiredPasswordComplexity)}'`,!0)}}catch(e){v("Something went wrong",!0)}g(!1)}async function W(){g(!0);try{let e=document.getElementById("jsi_email").value;try{if(!e)throw"Please enter your email address";if(!e.match(V))throw"Please enter a valid email address"}catch(e){return v(e,!0),void g(!1)}let{status:t,data:i}=await E("forgotPassword",!1,{email:e});if(200==t)return void S(e);if(400!=t)throw"";v("Invalid email address",!0)}catch(e){v("Something went wrong",!0)}g(!1)}async function H(){g(!0);try{let e=document.getElementById("jsi_mfa_code").value,t=document.getElementById("jsi_mfa_remember_device").checked,{status:i,data:s}=await E("verifyMfaCode",!0,{code:e,rememberDevice:t});if(200==i)return s.deviceId&&a(fe.userId,s.deviceId),void $(s.nextAction);if(400!=i)throw"";v("Invalid verification code",!0)}catch(e){v("Something went wrong",!0)}g(!1)}async function J(){g(!0);try{let{status:e,data:t}=await E("sendAnotherMfaCode",!0);if(200!=e)throw"";v("We just sent you another code",!1)}catch(e){v("Unable to send another verification code",!0)}g(!1)}async function q(e){g(!0);try{let t={deviceIds:d()};if(e&&e.vendor&&e.token)t.ssoVendor=e.vendor,t.ssoToken=e.token,e.firstName&&(t.ssoFirstName=e.firstName),e.lastName&&(t.ssoLastName=e.lastName);else{let e=document.getElementById("jsi_email").value,i=document.getElementById("jsi_password").value;try{if(!e||!i)throw"Invalid email or password"}catch(e){return v(e,!0),void g(!1)}t.email=e,t.password=i}let{status:i,data:s}=await E("signIn",!1,t);if(200==i)return m(s),void $(s.nextAction);if(400!=i||!t.ssoToken)throw"";"GOOGLE"==t.ssoVendor?(await gapi.auth2.getAuthInstance().signOut(),v("No account found for that Google user",!0)):"APPLE"==t.ssoVendor?v("No account found for that Apple user",!0):v("No account found for that user",!0)}catch(e){v("Invalid email or password",!0)}document.getElementById("jsi_password").value="",g(!1)}async function Q(){try{fe&&fe.id&&E("signOut",!0)}catch(e){}u(),e(),function(){try{signedOut()}catch(e){console.log("User signed out... create a JS function named signedOut() and it will be called automatically when a user signs out.")}}()}function K(e){let t="";switch(e){case 1:t="Very Weak";break;case 2:t="Weak";break;case 3:t="Average";break;case 4:t="Strong";break;case 5:t="Very Strong";break;default:t=""}return t}function Z(e){return t=>{13===t.keyCode&&(t.preventDefault(),e())}}let X=!1;function ee(e){if(X)e();else{window.onGoogleLibraryLoad=()=>{X=!0,window.onGoogleLibraryLoad=null,e()};let t=document.createElement("script");t.setAttribute("src","https://accounts.google.com/gsi/client"),t.setAttribute("async",""),t.setAttribute("defer",""),document.head.appendChild(t)}}function te(){google.accounts.id.initialize({client_id:me,state_cookie_domain:ce,callback:ie}),google.accounts.id.renderButton(document.getElementById("jsi_gsi_b"),{type:"standard",theme:"filled_blue",size:"large",text:"signin_with",shape:"rectangular",logo_alignment:"left"})}function ie(e){q({vendor:"GOOGLE",token:e.credential})}function se(){google.accounts.id.initialize({client_id:me,state_cookie_domain:ce,callback:ne}),google.accounts.id.renderButton(document.getElementById("jsi_gsi_b"),{type:"standard",theme:"filled_blue",size:"large",text:"signup_with",shape:"rectangular",logo_alignment:"left"})}function ne(e){D({vendor:"GOOGLE",token:e.credential})}let ae=!1;function oe(){if(!ae){let e=document.createElement("script");e.setAttribute("src","https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"),e.setAttribute("async",""),e.setAttribute("defer",""),document.head.appendChild(e),ae=!0}}const de="www.justsignin.com",re="cdn.justsignin.com",_e="329770541706642003",le=!1,ce="justsignin.com",me="453123342375-9p95cpo3spbjlj4ma41usc1ctkj61dg7.apps.googleusercontent.com",ue="service.com.justsignin",pe="https://www.justsignin.com";let fe=null;try{if(!le&&!window.location.hostname.endsWith(ce)){let e="Unathorized use of JustSignIn on this website! Notifying the JustSignIn security team!";throw console.error(e),e}if(!le&&"https:"!=window.location.protocol.toLowerCase()){let e="JustSignIn requires this page to be hosted over HTTPS!";throw console.error(e),e}return{init:async function(){r()?(t(),await f()?(t(),function(){try{alreadySignedIn()}catch(e){console.log("User is already signed in... create a JS function named alreadySignedIn() and it will be called automatically when the page loads and the user is already signed in.")}}()):(u(),e())):e()},showSignIn:k,showSignUp:A,signOut:Q,closeUserMenu:s,isSignedIn:()=>null!=fe,getSession:()=>fe?{session:{id:fe.id,user:{id:fe.userId,email:fe.email,firstName:fe.firstName,lastName:fe.lastName,fullName:p()}}}:null,showSignInSettings:L,showJsiMenu:async function(){r()?t():e()}}}catch(e){return{}}}();