Untitled
2 years ago in Plain Text
window.PAYPAL=window.PAYPAL||{},function(){"use strict";function validateOneField(e,t,n){function u(e){$(r).addClass("hasError"),r.style["z-index"]=100,$(i).addClass("show"),t&&$(t).addClass("moveLeft")}function a(){$(s).removeClass("hide")}function f(){$(o).removeClass("hide")}function l(){$(s).addClass("hide")}function c(){$(o).addClass("hide")}function h(e){e&&($(r).removeClass("hasError"),t&&$(t).removeClass("moveLeft")),r.style["z-index"]=1,$(i).removeClass("show")}function p(e){var t;return e?(t=e.value&&e.value.trim(),$(e).hasClass("validateEmpty")&&!t?(u(e),a(),!0):!1):!0}function d(e){var t;return e?(t=e.value&&e.value.trim(),$(e).hasClass("validate")&&n(t)?(l(),u(e),f(),!1):!0):!1}var r=e.querySelector(".textInput"),i=r.querySelector(".errorMessage"),s=r.querySelector(".emptyError"),o=r.querySelector(".invalidError");return{showError:u,showRequiredError:a,checkEmpty:p,showInvalidError:f,hideRequiredError:l,hideInvalidError:c,hideError:h,checkValid:d}}function verifyOtp(){function o(){var e=s.checkEmpty(t);if(!e)return s.checkValid(t)}function u(e){var t=getEventTarget(e);eventStopPropagation(e),s.hideInvalidError(),s.hideError(!0)}function a(e){var t=getEventTarget(e);eventStopPropagation(e),s.checkValid(t),s.hideError()}function f(e){var t=getEventTarget(e);eventStopPropagation(e),s.checkValid(t)}function l(e){function c(e){$(i).text(""),e&&e.msg&&(i.innerHTML='<p class="notification '+e.type+'" role="alert">'+e.msg+"</p>")}function h(e){login.utils.logCPLData({startTime:l,status:"success",flowName:"OTP"}),e=e||{},e.notifications&&(c(e.notifications),r.value=e._csrf,login.utils.hideSpinner()),e.disableSubmit&&f&&($(f).addClass("greyBackground"),$(".otpLoginViaLink")&&$(".otpLoginViaLink").remove(),f.setAttribute("disabled","disabled")),e.disableResend&&n&&($(n).addClass("greyOut"),n.removeAttribute("href"));if(PAYPAL.unifiedLoginInlinePostMessage){login.utils.sendPostMessage(e.showSuccess?"LOGIN_SUCCESS":"LOGIN_FAILED");return}e.showPassword&&(login.pubsub.publish("SHOW_PASSWORD"),login.utils.hideSpinner());if(e.isCookieDisabledRequest&&e.accessToken&&e.returnUrl)return login.logger.log({evt:"OTP_LOGIN",data:"PROCESS_SLR_INTERNAL_REDIRECT",calEvent:!0}),login.logger.pushLogs(),login.utils.handleSlrInternalRedirect(e);e.returnUrl&&setTimeout(function(){window.location.href=e.returnUrl},1e3)}var r=document.querySelector("#token")||{},i=document.querySelector(".notifications"),s={},u,a,f,l;eventPreventDefault(e),u=getEventTarget(e),a=u.querySelectorAll("input")||[],f=u.querySelector("button");if(!o()){t.focus();return}login.fn.updateFnSyncContext({sourceId:"OTP_LOGIN"}),login.fn.addFnSyncData(),$(i).text("");for(var p=0;p<a.length;p++)s[a[p].name]=a[p].value;l=$("body").data("loadStartTime"),login.utils.showSpinner(),$.ajax({url:u.getAttribute("action"),type:"POST",data:s,success:h,fail:function(){login.utils.logCPLData({startTime:l,status:"failure",flowName:"OTP"}),login.utils.hideSpinner()}})}function c(e){function h(e){setTimeout(function(){$(t).removeClass("greyOut"),$(t).removeClass("hide"),t.setAttribute("href",l),e&&$(e).addClass("hide"),addEvent(r,"click",c)},2e3)}function p(e){e=e||{};var n=e.resendFailed?f:a;i.value=e._csrf,$(t).addClass("hide"),$(n).removeClass("hide"),h(n)}var t=getEventTarget(e),n={},i=document.querySelector("#token")||{},s=document.querySelector("[name=challengeId]")||{},o=document.querySelector("[name=nonce]")||{},u=document.querySelector("[name=otpVariant]")||{},a=document.querySelector(".sent"),f=document.querySelector(".failed"),l=t.getAttribute("href");eventPreventDefault(e),removeEvent(t,"click",c),$(t).addClass("greyOut"),t.removeAttribute("href"),n[i.name]=i.value,n[s.name]=s.value,n[o.name]=o.value,n[u.name]=u.value,n.isResend="true",login.logger.log({evt:"state_name",data:"begin_verify_otp",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_resend_sms",instrument:!0}),login.logger.pushLogs(),$.ajax({url:l,type:"POST",data:n,success:p,fail:function(){h()}})}function h(){addEvent(e,"submit",l),addEvent(t,"keydown",u),addEvent(t,"focus",f),addEvent(t,"blur",a),addEvent(n,"click",c),addEvent(n,"focus",function(){t.focus()}),t.focus()}var e=document.querySelector("form[name=verifyOtp]"),t=document.querySelector("#security_code"),n=document.querySelector("#resendLink"),r=document.querySelector(".resend"),i=document.querySelector(".secondaryLink a"),s=validateOneField(e,r,function(e){return e&&e.length!==6});return{attachFormEvents:h}}function verifyOtpPrimary(e){function m(e){var t=getEventTarget(e);eventStopPropagation(e);var n=t.index;for(var r=1;r<n;r++){var i=document.querySelector("#otp"+r);if(!i.value){i.focus();break}}}function g(e){var t=e.which||e.keyCode;if(t!==h&&(t!==l||e.key!==p)&&(t!==c||e.key!==d))if(o.indexOf(e.key)!==-1||!u.test(e.key)||e.target.value){e.preventDefault();return}}function y(e){var t=getEventTarget(e),n=t.index,r=e.which||e.keyCode,i=document.querySelector("#otp"+(n-1)),s=document.querySelector("#otp"+n),o=document.querySelector("#otp"+(n+1)),u=e.key===d||r===c?!0:!1,a=e.key===p||r===l?!0:!1;if(u||a||r===h){e.preventDefault();return}e.preventDefault(),eventStopPropagation(e),v="manual_entry ";if(s.value){var f=S();if(f.length===6){C(v);return}}if(s.value&&(r>=48&&r<=57||r>=96&&r<=105)){s.value=e.key,o.focus();return}if(r===8||r===46){s.value="",n!==1&&i.focus();return}if(r===37){n===1?s.focus:i.focus();return}if(r===39&&n!==6){o.focus();return}if((r!==8||r!==46)&&n!==6){o.focus();return}}function b(e){var t=getEventTarget(e);if(t.value.length>1){login.logger.log({evt:"HANDLE_INPUT",data:"INPUT_PIN_GREATER_THAN_ONE",calEvent:!0}),login.logger.pushLogs();var n=document.createElement("input");n.setAttribute("hidden",!0),document.body.appendChild(n),n.value=t.value;var r=n.value;for(var s=0;s<r.length;s++)i[s].value=r[s],s<5&&i[s+1].focus();document.body.removeChild(n);var o=S();if(o.length===6){v="auto_entry",setTimeout(function(){C(v)},250);return}}}function w(e){var t=getEventTarget(e),n=t.index-1,r=e.clipboardData||window.clipboardData,s=r.getData("Text");for(var o=0;o<s.length;o++)if(!E(s[o])){e.preventDefault();return}e.preventDefault();var o=0;while(n<i.length&&o<s.length)i[n].value=s[o],i[n].focus(),login.logger.log({evt:"HANDLE_PASTE",data:"PASTE_IN_INPUT_BOXES"+o,calEvent:!0}),o++,n++;login.logger.pushLogs();var u=S();if(u.length===6){v="auto_entry",setTimeout(function(){C(v)},250);return}}function E(e){for(var t=0;t<e.length;t++)if(o.includes(e[t])&&!u.test(e[t]))return!1;return!0}function S(){var e="";for(var t=0;t<i.length;t++)e+=i[t].value;return e}function x(){for(var e=0;e<i.length;e++)i[e].value=""}function T(e){var t=0;while(t<i.length&&t<e.length)i[t].value=e[t],i[t].focus(),t++}function N(){var e=document.querySelector("#verifyOtp"),t=e.querySelector("#otpVerification"),n=e.querySelector(".otpError");$(t).addClass("hide"),$(n).removeClass("hide")}function C(e){function f(e){$(r).text(""),e&&e.msg&&(r.innerHTML='<p class="notification '+e.type+'" role="alert">'+e.msg+"</p>")}function l(e){x(),s.focus(),login.utils.logCPLData({startTime:u,status:"success",flowName:"OTP"}),e=e||{},e.notifications&&(f(e.notifications),n.value=e._csrf,login.utils.hideSpinner()),e.disableResend&&t&&N();if(PAYPAL.unifiedLoginInlinePostMessage){login.utils.sendPostMessage(e.showSuccess?"LOGIN_SUCCESS":"LOGIN_FAILED");return}if(e.showPassword){if(e.isOtpSmsUser){N(),login.utils.hideSpinner();return}login.pubsub.publish("SHOW_PASSWORD"),login.utils.hideSpinner()}if(e.isCookieDisabledRequest&&e.accessToken&&e.returnUrl)return login.logger.log({evt:"OTP_LOGIN",data:"PROCESS_SLR_INTERNAL_REDIRECT",calEvent:!0}),login.logger.pushLogs(),login.utils.handleSlrInternalRedirect(e);login.loadResources&&login.loadResources.lazyload(),e.returnUrl&&setTimeout(function(){window.location.href=e.returnUrl},1e3)}var n=document.querySelector("#token")||{},r=document.querySelector(".notifications"),i={},o,u,a=document.querySelector("#verifyOtp");o=a.querySelectorAll("input"),login.fn.updateFnSyncContext({sourceId:"OTP_LOGIN"}),login.fn.addFnSyncData(),$(r).text("");for(var c=0;c<o.length;c++)i[o[c].name]=o[c].value;i.security_code=S(),u=$("body").data("loadStartTime"),login.logger.log({evt:"entry_type",data:e,instrument:!0}),login.logger.pushLogs(),login.utils.showSpinner(),$.ajax({url:"/signin/challenge/sms/solve",type:"POST",data:i,success:l,fail:function(){login.utils.logCPLData({startTime:u,status:"failure",flowName:"OTP"}),login.utils.hideSpinner()}})}function k(n){function p(n,i){setTimeout(function(){i==="failed"?(login.logger.log({evt:"state_name",data:"begin_verify_otp",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_resend_sms",instrument:!0}),login.logger.log({evt:"int_error_desc",data:"process_resend_sms_max_failure"+(e?"_"+e:""),instrument:!0}),login.logger.pushLogs(),N()):($(r).removeClass("greyOut"),$(r).removeClass("hide"),r.setAttribute("href",h),n&&$(n).removeClass("showToast"),addEvent(t,"click",k))},2e3)}function d(e){s.focus(),e=e||{};var t=e.resendFailed?c:l,n=e.resendFailed?"failed":"sent";o.value=e._csrf,$(r).addClass("hide"),$(t).addClass("showToast"),p(t,n)}var r=getEventTarget(n),i={},o=document.querySelector("#token")||{},u=document.querySelector("[name=challengeId]")||{},a=document.querySelector("[name=nonce]")||{},f=document.querySelector("[name=otpVariant]")||{},l=document.querySelector(".sent"),c=document.querySelector(".failed"),h=r.getAttribute("href");eventPreventDefault(n),removeEvent(r,"click",k),$(r).addClass("greyOut"),r.removeAttribute("href"),i[o.name]=o.value,i[u.name]=u.value,i[a.name]=a.value,i[f.name]=f.value,i.isResend="true",login.logger.log({evt:"state_name",data:"begin_verify_otp",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_resend_sms"+(e?"_"+e:""),instrument:!0}),login.logger.pushLogs(),$.ajax({url:h,type:"POST",data:i,success:d,fail:function(){p()}})}function L(){for(var e=0;e<i.length;e++){i[e].index=e+1;var r=document.querySelector("#otp"+(e+1));addEvent(r,"focus",m),addEvent(r,"keyup",y),addEvent(r,"keydown",g),addEvent(r,"paste",w),addEvent(r,"input",b)}addEvent(t,"click",k),n&&(addEvent(n,"click",function(e){login.logger.log({evt:"state_name",data:"otp_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"otp_try_another_way_clicked",instrument:!0}),login.logger.log({evt:"otp_login",data:"otp_try_another_way_clicked",calEvent:!0}),login.logger.pushLogs(),login.utils.showTryAnotherWayModal(e,{integrationType:"otp"})}),login.utils.attachTryAnotherWayModalHandlers({integrationType:"otp"}));var s=document.querySelector("#otp1");addEvent(s,"click",function(e){s.focus()});var o=navigator.userAgent.match(/Chrome\/([0-9]+)\./i),u=window.navigator.vendor==="Google Inc."&&navigator.userAgent.match(/Android/i)&&o&&Number(o[1])>=84,a=$("body").data("otpAutofillEntryEnabled")==="true";if(a&&u&&window.OTPCredential){var f=new AbortController,l=document.querySelector("form[name=verifyOtp]");addEvent(l,"submit",function(e){f.abort()}),navigator.credentials.get({otp:{transport:["sms"]},signal:f.signal}).then(function(e){T(e.code);var t=S();if(t.length===6){v="autofill_entry",setTimeout(function(){C(v)},250);return}}).catch(function(e){login.logger.log({evt:"OTP_AUTOFILL",data:"otp_autofill_failure"+e.toString(),calEvent:!0}),login.logger.pushLogs()})}}var t=document.querySelector("#resendLink"),n=document.querySelector("#tryAnotherWayLink"),r=document.querySelector(".secondaryLink"),i=document.querySelectorAll("#security_code > *[id]"),s=document.querySelector("#otp1"),o=["-","+","e"],u=/^[0-9]$/,a={v:86,ctrl:17,cmd:91},f={ctrl:"Control",cmd:"Meta"},l=a.cmd,c=a.ctrl,h=a.v,p=f.cmd,d=f.ctrl,v;return{attachFormEvents:L}}function loadFeatures(){$("body").data("qrCodeFeatureEnabled")&&login.qrCode.initialize(),login.core(),login.jwt&&login.jwt(),login.oneTouchLogin&&login.oneTouchLogin(),login.singleSignOn&&login.singleSignOn();if(login.webAuthn){var e=$("body").data("partyIdHash"),t=$("body").data("webAuthnLoginContext");e&&t&&login.webAuthn.attachFormEvent(),login.webAuthn.setContext()}login.otp&&login.otp.prepareSendPage(),login.onboardingFlow&&login.onboardingFlow.prepareLandingPage(),login.noAccExists&&login.noAccExists.attachFormEvent(),login.ssoInterstitial&&login.ssoInterstitial.attachFormEvent(),login.oneTouch(),login.footer(),login.pwr(),login.ads.init();if(login.siapple){var n=document.querySelector('input[name="appleIdpJson"]'),r=n&&n.value;login.siapple({appleIdpJson:r})}login.keychain&&login.keychain(),login.smartLock&&login.smartLock(),login.tpdLogin&&login.tpdLogin.initialize(),login.geoEnablement&&login.geoEnablement.setGeoMessage(),login.showHidePassword()}function logPreloadAssetsDownloadData(){var e=window.PAYPAL&&window.PAYPAL.ulData||{};if(e){var t=e.preloadScriptUrl?e.preloadScriptUrl.split(",").length:0,n=e.preloadScriptDownloadLength||0;login.logger.log({evt:"preload_total_assets",data:t,instrument:!0}),login.logger.log({evt:"preload_downloaded_assets",data:n,instrument:!0}),login.logger.pushLogs()}}function asyncLoadAssetUrls(e){var t=$("body").data("enableLogPreloadAssetsDownloadData");t&&addEvent(window,"beforeunload",logPreloadAssetsDownloadData);var n=e.split(","),r,i,s=["js","css"];for(var o=0;o<n.length;o++){r=n[o],i=r.split(".");if(r&&r.slice(0,8)==="https://"&&s.includes(i[i.length-1]))try{var u=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");addEvent(u,"load",function(){PAYPAL.ulData.preloadScriptDownloadLength++}),u.open("GET",n[o]),u.send()}catch(a){}}}function showReturnToMerchantLink(){var e=document.querySelector("#returnToMerchant"),t=document.querySelector(".contentContainer");e&&!window.opener&&($(e).removeClass("hide"),t&&$(t).addClass("contentContainerShort"))}function trackHybridLoginRenderedEventInCal(){var e=login.utils.getIntent()==="checkout",t=$("body").hasClass("mobile")?"MOBILE":"DESKTOP";login.utils.isHybridLoginExperience()&&login.logger.log({evt:"HYBRID_LOGIN",data:"RENDERED"+(e?"_XO":"")+"_"+t,calEvent:!0})}function instrumentUlAsLandingPageLoad(){var e=document.querySelector("#password"),t,n=document.querySelector('input[name="locale.x"]'),r=document.querySelector('input[name="clientLogRecords"]');e&&(t=login.utils.isFieldPrefilled(e)||e.value.length>0);var i=$("body").data("oneTouchUser"),s=window.PAYPAL&&window.PAYPAL.ulData||{},o=s.aPayAuth;if(i||o)return;login.logger.logServerPreparedMetrics(),r||(login.logger.log({evt:"state_name",data:login.utils.getKmliCb()?"LOGIN_UL_RM":"LOGIN_UL",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_login_ul",instrument:!0})),login.logger.log({evt:"landing_page",data:"login",instrument:!0}),login.logger.log({evt:"is_pwd_autofill",data:t?"Y":"N",instrument:!0}),login.logger.log({evt:"is_pwd_autofill",data:t?"Y":"N",calEvent:!0}),login.logger.log({evt:"design",data:login.utils.isInContextIntegration()?"in-context":"full-context",instrument:!0}),n&&login.logger.log({evt:"page_lang",data:n.value,instrument:!0}),login.logger.pushLogs()}function instrumentSplitLoginPageLoad(e){var t="begin_email",n="prepare_email",r=login.utils.isFieldPrefilled(document.querySelector("#email")),i=document.querySelector('input[name="locale.x"]'),s=window.PAYPAL&&window.PAYPAL.slData&&window.PAYPAL.slData.slAction,o=$("body").data("oneTouchUser"),u=window.PAYPAL&&window.PAYPAL.ulData||{},a=u.aPayAuth,f=document.querySelector("#moreOptionsContainer"),l=$("body").data("ssoviatoken"),c=login.utils.isHybridLoginExperience(),h=document.querySelector("#forgotEmail"),p=document.querySelector("#forgotPassword");addEvent(h,"click",function(){login.logger.log({evt:"state_name",data:t,instrument:!0}),login.logger.log({evt:"transition_name",data:"forgot_public_credential",instrument:!0}),login.logger.pushLogs()}),addEvent(p,"click",function(){login.logger.log({evt:"state_name",data:t,instrument:!0}),login.logger.log({evt:"transition_name",data:"forgot_private_credential",instrument:!0}),login.logger.pushLogs()});if(o||a||l)return;if(s==="activation"||s==="optIn")return;c&&(t="begin_hybrid_login",n="prepare_hybrid"),e==="inputPassword"&&(t=c?"begin_hybrid_pwd":"begin_pwd",n=c?"prepare_hybrid_pwd":"prepare_pwd",n+=login.utils.getKmliCb()?"_ot":"",r=login.utils.isFieldPrefilled(document.querySelector("#password"))),e==="inputPhone"&&(t="begin_phone",n="prepare_phone"),e==="inputEmail"&&trackHybridLoginRenderedEventInCal(),f&&!$(f).hasClass("hide")&&e==="inputPassword"&&(n+="_more_opt",login.logger.log({evt:"exp_shown",data:"tpd",instrument:!0}));if(e==="inputPassword"){var d=document.querySelector("#phone");login.logger.log({evt:"pub_cred_type",data:d&&d.value?"phone":"email",instrument:!0})}login.logger.log({evt:"state_name",data:t,instrument:!0}),login.logger.log({evt:"transition_name",data:n,instrument:!0}),login.logger.log({evt:"autofill",data:r?"Y":"N",instrument:!0}),login.logger.log({evt:"autofill",data:r?"Y":"N",calEvent:!0}),login.utils.getIntent()==="checkout"&&(login.logger.log({evt:"landing_page",data:"login",instrument:!0}),login.logger.log({evt:"design",data:login.utils.isInContextIntegration()?"in-context":"full-context",instrument:!0})),i&&login.logger.log({evt:"page_lang",data:i.value,instrument:!0}),login.logger.pushLogs()}function instrumentProx(){var e=document.querySelector(".cancelUrl"),t;login.utils.isPpFrameMiniBrowser()?(login.utils.postPpBridgeMessage({flowtype:"prox",status:"loading",viewname:"login"}),login.utils.postPpBridgeMessage({flowtype:"prox",status:"complete",viewname:"login"}),login.utils.postPpBridgeMessage({operation:"init",cancelUrl:$("body").data("returnUrl")||"",landingUrl:window.location.href,secureWindowMsg:$("body").data("secureWindowMsg")||"",processingMsg:$("body").data("processingMsg")||""}),addEvent(window,"beforeunload",function(e){var t=getEventTarget(e),n=t&&t.activeElement&&t.activeElement.nodeName;n==="BODY"&&login.utils.postPpBridgeMessage({flowtype:"prox",status:"exit",viewname:"login",exit_type:"user_cancelled"})}),$(e).remove()):(t=login.utils.getOutboundLinksHandler(e,"login_ul","process_cancel_and_return_to_merchant"),login.pubsub.subscribe("WINDOW_CLICK",function(e){var n=getEventTarget(e);n&&$(n).hasClass("cancelLink")&&t.call(null,e)})),login.logger.log({evt:"state_name",data:"login_ul",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_login_ul",instrument:!0}),login.logger.pushLogs()}function autoLoginfallBackClientLog(e){var t=login.utils.getSplitLoginContext(),n=window.PAYPAL.ulData||{};e=e||{},document.querySelector("body").removeAttribute("data-one-touch-user"),n.aPayAuth=null,e.error_code&&login.logger.log({evt:"ext_error_code",data:e.error_code,instrument:!0});if(t){instrumentSplitLoginPageLoad(t);return}instrumentUlAsLandingPageLoad()}function isAPaySupported(){var e=navigator.userAgent.match(/Chrome\/([0-9]+)\./i);return window.navigator.vendor==="Google Inc."&&"PaymentRequest"in window&&navigator.userAgent.match(/Android/i)&&e&&Number(e[1])>=58}var login={};login.logger=function(){function t(t){t.timestamp=Date.now?Date.now():(new Date).getTime(),e.push(t)}function n(t){var n,r,i=login.utils.getIntent(),s=login.utils.getFlowId(),o=$("body").data("loginLiteExperience"),u;if(e.length===0)return;t=t||{},e.push({evt:"context_correlation_id",data:$("body").data("correlationId"),instrument:!0}),i&&(e.push({evt:"serverside_data_source",data:i,instrument:!0}),e.push({evt:"intent",data:i,instrument:!0})),s&&e.push({evt:"context_id",data:s,instrument:!0}),o&&e.push({evt:"lite_experience",data:"Y",instrument:!0}),n=document.querySelector("#token")||document.querySelector('input[name="_csrf"]'),r=n&&n.value,u={_csrf:r,currentUrl:window.location.href,logRecords:JSON.stringify(e),intent:i},typeof t.data=="object"&&Object.assign(u,t.data),$.ajax({url:"/signin/client-log",data:u,success:t.success,fail:t.fail,complete:t.complete}),e=[]}function r(e,r,i){e=e||[];if(!(e instanceof Array)){if(typeof r=="function")return r();return}for(var s=0;s<e.length;s++)t(e[s]);var o={complete:function(){if(typeof r=="function")return r()}};typeof i=="object"&&(o.data=i),n(o)}function i(){var e=login.utils.getSplitLoginContext(),t=login.utils.isHybridLoginExperience(),n=document.getElementById("keepMeLoggedIn"),r=n?"LOGIN_UL_RM":"LOGIN_UL",i={inputEmail:"begin_email",implicitEmail:"begin_email",inputPassword:t?"begin_hybrid_pwd":"begin_pwd",inputPhone:"begin_phone"};return e&&i[e]&&(r=i[e]),t&&e!=="inputPassword"&&(r="begin_hybrid_login"),r}function s(){var t,n=document.querySelector('input[name="clientLogRecords"]');if(n)try{t=JSON.parse(n.value)}catch(r){}t&&(e=e.concat(t))}var e=[];return{log:t,logServerPreparedMetrics:s,pushLogs:n,clientLog:r,getStateName:i}}(),login.pubsub=function(){var e={},t={};return e.publish=function(e,n){if(!t[e])return!1;var r=t[e],i=r?r.length:0;while(i>0)r[i-1].func(n),i-=1},e.subscribe=function(e,n){if(typeof n!="function")return;t[e]||(t[e]=[]),t[e].push({func:n})},e}(),login.store=function(){return function(t){function r(){return n}function i(e){var t=document.querySelector("input[name=splitLoginContext]");e.splitLoginContext||(e.splitLoginContext=t&&t.value);var r=Object.assign({},n.model,e);r.notifications=e.notifications,r.tpdVariant=e.tpdVariant,r.showSpinnerUpfront=e.showSpinnerUpfront,r.enableSmartlock=e.enableSmartlock,r.tpdAutoSend=e.tpdAutoSend,r.webAuthnLoginContext=e.webAuthnLoginContext,r.qrCodeFeatureEnabled=e.qrCodeFeatureEnabled,r.qrcPrerenderEnabled=e.qrcPrerenderEnabled;var i=Object.assign({},n,{model:r});n=i,login.pubsub.publish("STATE_UPDATED",i)}var n=t||{};return{updateModel:i,getState:r}}}();var addEvent=function(e,t,n){if(!e||!t||!n)return;e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)},removeEvent=function(e,t,n){if(!e||!t||!n)return;e.removeEventListener?e.removeEventListener(t,n,!1):e.attachEvent&&e.detachEvent("on"+t,n)},createNewEvent=function(e){if(typeof window.Event=="function")return new Event(e);var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t},eventPreventDefault=function(e){var t=e||window.event||{};t.preventDefault?t.preventDefault():t.returnValue=!1},eventStopPropagation=function(e){var t=e||window.event||{};t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},getEventTarget=function(e){var t=e||window.event||{};return t.target||t.srcElement},triggerEvent=function(e,t){if(!e||!t)return;var n=createNewEvent(t);e.dispatchEvent?e.dispatchEvent(n):e.fireEvent&&e.fireEvent("on"+t,n)},isEnterKeyPressed=function(e){return e?e.key?e.key==="Enter":e.which?e.which===13:e.keyCode===13:!1};login.utils=function(){function r(n){e&&(n&&n.qrCodeSpinner?$(e).addClass("qrcSpinner"):$(e).addClass("spinner"),n&&n.nonTransparentMask&&$(e).addClass("nonTransparentMask"),$(e).removeClass("hide"),e.setAttribute("aria-busy","true")),t&&$(t).removeClass("hide")}function i(){e&&($(e).removeClass("spinner"),$(e).removeClass("nonTransparentMask"),$(e).removeClass("qrcSpinner"),$(e).addClass("hide"),e.setAttribute("aria-busy","false")),t&&$(t).addClass("hide")}function s(e){var t;if(e!==""){t=document.querySelector(".transitioning p."+e),t&&$(t).removeClass("hide");return}$(n).removeClass("hide")}function o(e){var t;if(e!==""){t=document.querySelector(".transitioning p."+e),t&&$(t).addClass("hide");return}$(n).addClass("hide")}function u(){return $("body").data("isHybridLoginExperience")==="true"}function a(){return $("body").data("isHybridEditableOnCookied")==="true"}function f(e,t,n,i){var s=e&&e.getAttribute("href"),o=e&&e.getAttribute("id"),u,a,f;return function(o){o.preventDefault(),login.logger.log({evt:"state_name",data:t||login.logger.getStateName(),instrument:!0}),login.logger.log({evt:"transition_name",data:n,instrument:!0}),u=document.querySelector('input[name="locale.x"]'),u&&login.logger.log({evt:"page_lang",data:u.value,instrument:!0}),a=$(e).data("locale"),a&&login.logger.log({evt:"change_to_lang",data:a,instrument:!0}),f={complete:function(){if(typeof i=="function")return i();window.location=s}},login.logger.pushLogs(f),r()}}function l(e,t){eventPreventDefault(e);var n=document.querySelector("#email"),r=document.querySelector('label[for="email"]');n&&$(n).attr("placeholder",$("body").data("emailLabel")),r&&$(r).text($("body").data("emailLabel")),n&&$(n).attr("data-hybrid-in-email-only-mode",!0);var i=document.querySelector("#initialSplitLoginContext"),s={_csrf:document.querySelector("#token").value,notYou:!0,intent:L(),context_id:M(),switchToEmail:!0};i&&(s.initialSplitLoginContext=i.value),document.body.removeAttribute("data-web-authn-login-context"),$.ajax({type:"POST",url:"/signin/not-you",data:s,dataType:"json",success:w,fail:E,complete:function(){if(typeof t=="function")return t()}})}function c(e,t){eventPreventDefault(e),p(w,E,t)}function h(e,t){eventPreventDefault(e),p(function(){window.location.href=window.location.href},E,t)}function p(e,t,n){var r=document.querySelector("#initialSplitLoginContext"),i={_csrf:document.querySelector("#token").value,notYou:!0,intent:L(),context_id:M()};r&&(i.initialSplitLoginContext=r.value),document.body.removeAttribute("data-web-authn-login-context"),$.ajax({type:"POST",url:"/signin/not-you",data:i,dataType:"json",success:e,fail:t,complete:function(){if(typeof n=="function")return n()}})}function d(){return/^\s+|\s+$/}function v(){return/^\S+@\S+\.\S+$/}function m(){return/\s/g}function g(e){var t,n=document.querySelector("form[name=login]"),r=document.querySelector("#email"),i=document.querySelectorAll("form[name=login] input")||[],s={};if(!e||!r)return;t=!e.match(m()),t&&(e=e.replace(d(),""),t=e.match(v()));if(!t)return;for(var o=0;o<i.length;o++)s[i[o].name]=i[o].value;e&&(r.value=e,s.login_email=e,s.splitLoginContext="inputEmail",delete s.login_phone,delete s.phoneCode),delete s.login_password,delete s.login_pin,$.ajax({url:n.getAttribute("action"),data:s,success:login.utils.successfulXhrHandler,fail:login.utils.failedXhrSubmitHandler})}function y(e){login.storeInstance&&login.storeInstance.updateModel(e),e.ulSync&&login.fn.updateFnSyncContext(e.ulSync),!e.showSpinnerUpfront&&e.smartlockStatus!=="linked"&&i()}function b(){var e=document.querySelector(".onboardingFlowContentKey"),t=document.querySelector(".pwdContentKey"),n=$("body").data("pwdContentKeyExists");n&&(t&&$(t).removeClass("hide"),e&&$(e).addClass("hide"))}function w(e){var t=document.querySelector('input[name="ctxId"]'),n=document.querySelector("form[name=login]"),r=$("#headerText"),s=$("#newUserContainer"),o=$("#signupContainer"),u=document.querySelector('#main section[id="onboardingFlow"]'),a=document.querySelector('#main section[id="otpLogin"]'),f=document.querySelector('#main section[id="verifyOtp"]'),l=$(".startOnboardingFlow");b(),u&&($(u).remove(),$("#login").removeClass("hide")),a&&($(a).remove(),$("#login").removeClass("hide")),f&&($(f).remove(),$("#login").removeClass("hide"));if(e&&e.overlay&&e.overlay.variant){document.body.setAttribute("data-overlay-variant",e.overlay.variant),document.body.setAttribute("data-overlay-content-version",e.overlay.contentVersion||""),login.loadResources&&login.loadResources.lazyload();var c=document.getElementById("keepMeLogin");c&&e.overlay.variant==="oneTouch"&&$(c).addClass("hide")}e.splitLoginContext==="inputPassword"&&s&&(l&&l.addClass("hide"),s.addClass("hide")),e.splitLoginContext==="inputEmail"&&s&&(l&&l.removeClass("hide"),s.removeClass("hide")),e.hidePwdTagLine&&r&&r.addClass("hide"),!e.hidePwdTagLine&&r&&r.removeClass("hide"),e.otpMayflyKey&&n&&login.utils.addHiddenElement("otpMayflyKey",e.otpMayflyKey,n),!e.otpMayflyKey&&$("input[name=otpMayflyKey]")&&$("input[name=otpMayflyKey]").remove(),e.legalCountry&&n&&login.utils.addHiddenElement("legalCountry",e.legalCountry,n),!e.legalCountry&&$("input[name=legalCountry]")&&$("input[name=legalCountry]").remove();if(e&&e.htmlResponse){login.ads.handleAdsInterception(decodeURIComponent(e.htmlResponse));return}if(e&&e.returnUrl&&!e.notifications){window.location.href=e.returnUrl;return}!e.profile&&e.adsChallengeUrl&&login.ads.init(e.adsChallengeUrl);if(e.showNoAccExists&&login.noAccExists){i(),login.noAccExists.showNoAccExistsView(e);return}if(e.qrCodeFeatureEnabled){var h=document.querySelector(".qrCodeSection"),p=document.querySelector("#qrcCanvas > img"),d=document.querySelector(".qrHeaderText"),v=document.querySelector("#loginContent"),m=document.querySelector("#loginSection"),g=document.querySelector("#login > .corral"),w=document.querySelector("#header > .paypal-logo");$(h).removeClass("hide"),$(d).removeClass("hide"),$(v).addClass("loginContent"),$(m).addClass("loginSection"),$(g).addClass("corralQR"),$(w).removeClass("paypal-logo-long"),$(w).removeClass("signin-paypal-logo"),$(w).addClass("paypal-logo-qrc"),p.src=e.qrImageUrl,login.ref_str=e.ref_str,login.qrImageUrl=e.qrImageUrl,login.maxPollAttemptsInt=e.maxPollAttempts,login.pollTimeInterval=e.pollTimeInterval,login.qrCode.initialize({clientRender:!0})}if(e.isOtpSmsUser&&!e.notifications){login.otp.prepareSendPage(e);return}y(e),e.hideOnboardingFlowPwdPage&&o&&o.addClass("hide"),login.otp&&login.otp.prepareSendPage(e),e.verification&&e.verification.page==="pending"&&(login.verification.startPolling({accessToken:e.accessToken,authflowDocumentId:e.authflowDocumentId,_csrf:e._csrf,email:e.verification.email,variant:e.tpdVariant,tpdTriggerMethod:e.tpdTriggerMethod}),login.verification.showResendLink()),e.tpdDemoRefresh&&login.utils.isTpdDemo()&&t&&t.value&&(t.value="",document.body.removeAttribute("data-is-prefill-email-enabled"),document.body.removeAttribute("data-tpd-demo"),document.body.removeAttribute("data-tpd-variant"),window.location.href="/signin");var E=document.getElementById("keepMeLogin");!e.keepMeLoggedInEnabled&&E&&$(E).addClass("hide");if(e.autoRememberMe){var S=document.getElementById("keepMeLoggedIn");S&&(S.checked=!0)}q(),e.setBuyer&&setTimeout(function(){dt()&&login.xoPlanning.triggerSetBuyerCall(e.setBuyer)},300)}function E(t){if(t.status===429){$(e).removeClass("spinner");return}window.location.href=window.location.href}function S(e){login.pubsub&&login.pubsub.publish("WINDOW_CLICK",e)}function x(e){var t=document.querySelector(".rememberProfile .bubble-tooltip"),n,r;if(!t||!e||!getEventTarget(e))return;n=$(t),r=$(getEventTarget(e));if(r.hasClass("infoLink")||r.hasClass("bubble-tooltip")){eventPreventDefault(e),n.toggle();return}n.addClass("hide")}function T(e){return!!(e&&window.chrome&&window.chrome.webstore&&getComputedStyle(e).backgroundColor==="rgb(250, 255, 189)")}function N(e){return e?T(e)||e.value&&e.value.length>0:!1}function C(){return window.self!==window.top}function k(){var e=document.querySelector('input[name="splitLoginContext"]');return e&&e.value}function L(){var e=document.querySelector('input[name="intent"]');return e&&e.value||""}function A(){var e=document.querySelector('input[name="returnUri"]');return e&&e.value||""}function O(){var e=document.querySelector('input[name="state"]');return e&&e.value||""}function M(){var e=document.querySelector("input[name=flowId]");return e&&e.value||""}function _(){var e=document.querySelector("input[name=_sessionID]");return e&&e.value}function D(){return document.querySelector("#keepMeLoggedIn")}function P(){return!!window.xprops}function H(e){var t,n=document.querySelector('input[name="splitLoginCookiedFallback"]');if(!e||n)return t=document.querySelector("#captcha"),I(t);switch(e.value){case"inputEmail":t=document.querySelector(u()?"#splitHybridCaptcha":"#splitEmailCaptcha");break;case"inputPhone":t=document.querySelector(u()?"#splitHybridCaptcha":"#splitPhoneCaptcha");break;case"inputPassword":case"inputPin":t=document.querySelector(u()?"#splitHybridCaptcha":"#splitPasswordCaptcha");break;case"implicitEmail":t=document.querySelector("#implicitEmailCaptcha");break;default:t=null}return t&&$(t).hasClass("hide")?null:I(t)}function B(e,t){t=decodeURIComponent(t);var n=t&&t.split("?")[1],r={};if(!n)return;return n.split("&").forEach(function(e){var t=e.split("=");r[t[0]]=t[1]}),r[e]}function j(e){e=decodeURIComponent(e);var t=e&&e.split("?")[1],n={},r,i;if(!t)return;r=t.split("&");for(var s=0;s<r.length;s++)i=r[s].split("="),n[i[0]]=i[1];return n}function F(e,t,n){var r=login.utils.getQueryParamsObj(e),i,s;return r?r[t]!==undefined?(i=r[t],e.replace(t+"="+i,t+"="+n)):e+"&"+t+"="+n:e[e.length-1]==="?"?e+t+"="+n:e+"?"+t+"="+n}function I(e){return e?{container:e.querySelector("div.textInput"),field:e.querySelector("input[type=text]"),errMsgContainer:e.querySelector("div.errorMessage"),errMsg:e.querySelector("div.errorMessage .emptyError"),playAudioBtn:e.querySelector(".captchaPlay"),refreshCaptchaBtn:e.querySelector(".captchaRefresh"),audioTag:e.querySelector(".audio audio"),image:e.querySelector(".captcha-image img"),audioLink:e.querySelector(".audio a")}:null}function q(){var e=document.querySelector("#splitPassword");e&&$(e).addClass("transformRightToLeft")}function R(e,t,n){var r=document.createElement("input");if(!n)return;r.setAttribute("type","hidden"),r.setAttribute("name",e),r.setAttribute("value",t),n.appendChild(r)}function U(e,t,n){var r=n&&n.querySelector('input[name="'+e+'"]');if(r)return;R(e,t,n)}function z(e){try{PAYPAL.analytics.instance.recordImpression({data:e.sys.tracking.fpti.dataString})}catch(t){}}function W(e){var t=document.createElement("iframe"),n=["id","title","className","frameBorder","sandbox","src","style"];if(!e)return;for(var r=0;r<n.length;r++)e[n[r]]&&(t[n[r]]=e[n[r]]);return document.body.appendChild(t),t}function X(e){var t=window.opener;try{e=typeof e=="string"?e:JSON.stringify(e);if(t&&(window.navigator.userAgent.match(/edge/i)||t.postMessage&&!window.navigator.userAgent.match(/msie|trident/i)))return t.postMessage(e,"*"),!0;var n=t&&t.frames&&t.frames.length&&t.frames.PayPalBridge;if(n&&n.returnToParent)return n.returnToParent(e),!0}catch(r){return!1}return!1}function V(){return window.opener&&window.name&&window.name.indexOf("PPFrame")===0}function J(e,t){var n=document.querySelector(".notifications"),r,i;n&&(r=document.createElement("p"),i=document.createTextNode(e),r.setAttribute("class","notification "+t),r.setAttribute("role","alert"),r.appendChild(i),n.appendChild(r))}function K(){var e=document.getElementById("token");return e&&e.value||""}function Q(e){var t=document.getElementById("token");t&&e&&(t.value=e)}function G(e,t){return new Promise(function(n,i){var s={};t=t||{},t.data&&(s=t.data),s._csrf=K(),s._sessionID=s._sessionID||_(),r(),$.ajax({type:t.method||"POST",url:e,data:s,dataType:"json",success:function(e){return e?(Q(e._csrf),n(e)):i()},fail:function(e){return i(e)}})})}function Y(){return window.navigator.vendor==="Google Inc."&&navigator.userAgent.match(/Android/i)}function Z(e){return e?(e=e.replace(/[-()\.\+\s]/ig,""),!e||e.search(/\D+/g)>=0):!0}function et(){return $("body").data("isPrefillEmailEnabled")==="true"}function tt(){var e=document.querySelector("#splitPassword");e&&$(e).addClass("hide")}function nt(){var e=document.querySelector("input[name=isPrefillEmailEnabled]");return e&&e.value==="true"}function rt(){var e=document.querySelector(".profileRememberedEmail");e&&$(e).removeClass("cookiedProfile"),q(),y({splitLoginContext:"inputPassword",profile:{email:email&&email.value},verification:null,notifications:null})}function it(){return $("body").data("tpdDemo")==="true"}function st(){var e=document.querySelector("input[name=ctxId]");return e&&e.value||""}function ot(e){return e?e.isPwdlessPriorityEnabled:!!$("body").data("isPwdlessPriorityEnabled")}function ut(){var e=!!login.oneTouchLogin&&!!$("body").data("oneTouchUser");return e&&(login.logger.log({evt:"PWDLESS_PRIORITY_CLIENT",data:"ONETOUCH_PRIORITY",calEvent:!0}),login.logger.pushLogs()),e}function at(e){var t=e&&e.contextualLogin||window.PAYPAL&&window.PAYPAL.ulData||{},n=ot(e),r=n&&t.aPayAuth&&isAPaySupported();return t.canNotMakePayment||!n?!1:(r&&(login.logger.log({evt:"PWDLESS_PRIORITY_CLIENT",data:"APAY_PRIORITY",calEvent:!0}),login.logger.pushLogs()),r)}function ft(e){var t=e&&e.slAction||window.PAYPAL&&window.PAYPAL.slData&&window.PAYPAL.slData.slAction;return t==="activation"&&login.smartLock?(login.logger.log({evt:"PWDLESS_PRIORITY_CLIENT",data:"SL_PRIORITY",calEvent:!0}),login.logger.pushLogs(),!0):!1}function lt(){var e=!!(login.webAuthn&&login.webAuthn.setContext&&$("body").data("webAuthnLoginContext"));return e&&(login.logger.log({evt:"PWDLESS_PRIORITY_CLIENT",data:"WEB_AUTHN_PRIORITY",calEvent:!0}),login.logger.pushLogs()),e}function ct(e,t){if(!e||!t||typeof t!="function")return;addEvent(e,"input",function(n){eventPreventDefault(n);var r=n.inputType,i=n.data;if(r==="insertText"||r==="deleteContentBackward"||r==="insertFromPaste")return!0;if(!i)return t(n)})}function ht(e){var t;try{return t=JSON.parse(e),t}catch(n){return{}}}function pt(e){if(window.webkitRequestFileSystem)window.webkitRequestFileSystem(window.TEMPORARY,1,function(){e({isPrivate:!1})},function(){e({isPrivate:!0})});else if(/Safari/.test(window.navigator.userAgent))try{window.localStorage||e({isPrivate:!0}),window.openDatabase(null,null,null,null),window.localStorage.setItem("test",1),window.localStorage.getItem("test")==="1"&&(window.localStorage.removeItem("test"),e({isPrivate:!1}))}catch(t){e({isPrivate:!0})}else e({isPrivate:!1})}function dt(){var e=document.querySelector('input[name="fn_sync_data"]');return e&&e.value}function vt(){try{return!(typeof document.cookie=="string"&&document.cookie.length>0)}catch(e){return!0}}function mt(e){e=e||{};var t=_(),n=K(),r=document.createElement("form");return $(r).attr("method","POST"),$(r).attr("action","/signin/iroute"),R("_csrf",n,r),R("_sessionID",t,r),R("accessToken",e.accessToken,r),R("returnUrl",e.returnUrl,r),document.body.appendChild(r),r.submit()}function gt(e){PAYPAL.unifiedLoginInlinePostMessage&&typeof PAYPAL.unifiedLoginInlinePostMessage.processAndPostMessage=="function"&&PAYPAL.unifiedLoginInlinePostMessage.processAndPostMessage({event:e})}function yt(){return!!document.querySelector('input[name="isSiAppleActivationProcessing"]')}function bt(){function t(t){e=Object.assign(e,t)}function n(t){return e[t]}function r(t){e[t]&&delete e[t]}var e={};return{update:t,get:n,clear:r}}function wt(){var e=window.navigator.userAgent;return/(iPhone|iPod|iPad|Macintosh).*AppleWebKit(?!.*Safari)/i.test(e)||/\bwv\b/.test(e)||/Android.*Version\/(\d)\.(\d)/i.test(e)}function Et(){var e=document.querySelector(".transitioning");return $(e).hasClass("spinner")||$(e).hasClass("spinnerWithLockIcon")}function St(e){e=e||{},login.logger.log({evt:"state_name",data:"CPL_LATENCY_METRICS",instrument:!0}),login.logger.log({evt:"login_experience",data:e.flowName,instrument:!0});var t=JSON.stringify({start:e.startTime,tt:Date.now()-e.startTime});login.logger.log({evt:"login_auth_time",data:t,instrument:!0}),login.logger.log({evt:"status",data:e.status,instrument:!0}),login.logger.pushLogs()}function xt(){var e=window.navigator.userAgent,t=$("body").data("xhrTimeoutIneligibleList")&&$("body").data("xhrTimeoutIneligibleList").split("|");for(var n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return!0;return!1}function Tt(){return!!$("body").data("appDownloadBanner")}function Nt(){var e=document.querySelector("#email"),t=document.querySelector("#password");e&&e.hasAttribute("disabled")&&e.removeAttribute("disabled"),t&&t.hasAttribute("disabled")&&t.removeAttribute("disabled")}function Ct(e){eventPreventDefault(e);var t=document.querySelector("#tryAnotherWayModal"),n=document.querySelector("#closeModal"),r=$("#tryAnotherWayModal"),i=$(".modal-content");if(!r||!i)return;if(e&&e.target&&e.target!==t&&e.target!==n)return;login.logger.log({evt:"try_another_way",data:"try_another_way_close_window_clicked",calEvent:!0}),login.logger.pushLogs(),r.removeClass("transitioned"),i.removeClass("transitioned"),setTimeout(function(){r.addClass("hide")},400)}function kt(e){var t=document.querySelector("#closeModal"),n=document.querySelector("#guestCheckout"),r=document.querySelector("#loginWithOtp"),i=document.querySelector("#loginWithPassword"),s=document.querySelector("#tryAnotherWayModal"),o=document.querySelector("#setPasswordLink");if(!s)return;addEvent(s,"click",Ct),t&&addEvent(s,"click",Ct),n&&addEvent(n,"click",Lt),r&&addEvent(r,"click",function(){eventPreventDefault();if(!login.otp){login.logger.log({evt:"login_with_otp",data:"login_with_otp_not_shown",calEvent:!0}),login.logger.pushLogs();return}login.logger.log({evt:"state_name",data:"begin_account_exists",instrument:!0}),login.logger.log({evt:"transition_name",data:"click_otp_link",instrument:!0}),login.logger.pushLogs();var t=$("#login");if(!t&&e.integrationType==="webAuthn"){if(window.location.href.indexOf("loginType=otp_login")>=0){window.location.href=window.location.href;return}var n=window.location.href.indexOf("?")>=0?window.location.href+"&loginType=otp_login":window.location.href+"?loginType=otp_login";login.utils.showSpinner(),window.location.href=n;return}login.otp.prepareSendPage({integrationType:"onTryAnotherWayModal",otpLoginEligible:"true"})}),i&&addEvent(i,"click",function(){At(e)}),o&&addEvent(o,"click",Ot)}function Lt(e){eventPreventDefault(e),f(guestCheckout)(e),login.logger.log({evt:"try_another_way",data:"checkout_as_guest_clicked",instrument:!0}),login.logger.pushLogs()}function At(e){e=e||{};var t=document.querySelector('#main section[id="verifyOtp"]'),n=$("#beginOtpLogin"),r=document.querySelector("#fpLogIn"),i=$("#login");eventPreventDefault();if(!i&&e.integrationType==="webAuthn"){if(window.location.href.indexOf("prompt=login")>=0){window.location.href=window.location.href;return}var s=window.location.href.indexOf("?")>=0?window.location.href+"&prompt=login":window.location.href+"?prompt=login";login.utils.showSpinner(),window.location.href=s;return}e.integrationType==="webAuthn"&&$(r).remove(),e.integrationType==="otp"&&($(t)&&$(t).remove(),n&&n.hasClass("hidden")&&n.removeClass("hidden"),login.otp.loadChallengePage({loginPreference:"password_login"})),i&&$("#login").removeClass("hide"),Nt(),login.logger.log({evt:"state_name",data:"try_another_way",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_login_with_your_password",instrument:!0}),login.logger.log({evt:"button_label",data:"login_with_your_password",instrument:!0}),login.logger.log({evt:"try_another_way",data:"login_with_your_password_clicked",calEvent:!0}),login.logger.pushLogs()}function Ot(e){var t=document.querySelector(".setPasswordBtn");eventPreventDefault(e),login.utils.getOutboundLinksHandler(t)(e),login.logger.log({evt:"try_another_way",data:"pwd_recovery_link_clicked",instrument:!0}),login.logger.pushLogs()}function Mt(e,t){t=t||{},eventPreventDefault(e);var n=$("#tryAnotherWayModal"),r=$(".modal-content");if(!n||!r)return;n.removeClass("hide"),n.addClass("transitioned"),r.addClass("transitioned"),t.integrationType==="otp"&&$(loginWithOtp).addClass("hide")}var e=document.querySelector(".transitioning"),t=document.querySelector(".lockIcon"),n=document.querySelector(".transitioning p.checkingInfo");return{showSpinner:r,hideSpinner:i,showSpinnerMessage:s,hideSpinnerMessage:o,getOutboundLinksHandler:f,isFieldPrefilled:N,notYouClickHandler:c,notYouClickHandlerForCookiedUser:h,getEmptyPattern:d,getEmailPattern:v,getInvalidUserIdPattern:m,submitPublicCredential:g,successfulXhrHandler:w,failedXhrSubmitHandler:E,documentClickHandler:S,toggleRememberInfoTooltip:x,updateView:y,isInIframe:C,isInContextIntegration:P,getSplitLoginContext:k,getIntent:L,getReturnUri:A,getReturnUriState:O,getFlowId:M,getSessionId:_,getKmliCb:D,getActiveCaptchaElement:H,getCaptchaDom:I,getQueryParamFromUrl:B,setSliderToPasswordContainer:q,getQueryParamsObj:j,updateParamValue:F,addHiddenElement:R,addHiddenElementIfNotExist:U,doImpressionTracking:z,createIframe:W,postPpBridgeMessage:X,isPpFrameMiniBrowser:V,updatePageLevelError:J,makeServerRequestAndReturnPromise:G,getCSRFToken:K,setCSRFToken:Q,isAndroidDevice:Y,doesItLookLikeEmail:Z,isHybridLoginExperience:u,isHybridEditableOnCookied:a,isPrefillEmailEnabled:et,hidePasswordForPrefillHybrid:tt,isPrefilledEmailNext:nt,renderPasswordFromPrefillHybridView:rt,isTpdDemo:it,getCtxId:st,isPwdlessPriorityEnabled:ot,isOTEligible:ut,isAPayEnabled:at,isSLActivation:ft,isWebAuthnEligible:lt,addAutofillEventHandler:ct,parseJsonSafe:ht,isBrowserInPrivateMode:pt,isFnDataLoaded:dt,isCookieDisabledBrowser:vt,handleSlrInternalRedirect:mt,sendPostMessage:gt,isSiAppleActivationProcessing:yt,createCache:bt,isWebView:wt,switchToEmailHandler:l,isSpinnerShown:Et,logCPLData:St,isUserAgentIneligibleForTimeout:xt,isAppDownloadBannerSupported:Tt,updateOnboardingButton:b,attachTryAnotherWayModalHandlers:kt,showTryAnotherWayModal:Mt,loginWithPasswordHandler:At}}(),login.storageUtils=function(){function t(t,n,i){var s,o;s=r(),o=s[i]||{},o[t]=n,s[i]=o;try{window.localStorage.setItem("ulData",JSON.stringify(s))}catch(u){login.logger.log({evt:e,data:u,calEvent:!0,status:"ERROR"}),login.logger.pushLogs()}}function n(e,t){var n;return n=r(),n[t]&&n[t][e]}function r(){try{var t;t=JSON.parse(window.localStorage.getItem("ulData"))||{}}catch(n){login.logger.log({evt:e,data:n,calEvent:!0,status:"ERROR"}),login.logger.pushLogs()}return t||{}}function i(t,n){var i;i=r();if(i[n]){delete i[n][t];try{window.localStorage.setItem("ulData",JSON.stringify(i))}catch(s){login.logger.log({evt:e,data:s,calEvent:!0,status:"ERROR"}),login.logger.pushLogs()}}}var e="LOCALSTORAGE";return{setDataByUserId:t,readDataByUserId:n,removeDataByUserId:i}}(),login.countryList=function(){function n(t){e=Object.assign(e,t)}function r(t){return e[t]}function i(e){function s(){i.insertAdjacentHTML("beforeend",r("countryList").html),setTimeout(function(){$(".countryListModal").addClass("transitionUp")},10),window.scrollTo({top:0}),login.logger.log({evt:"actiontype",data:"country_overlay_loaded",instrument:!0}),login.logger.log({evt:"COUNTRY_LIST",data:"COUNTRY_OVERLAY_LOADED",calEvent:!0});var e=document.querySelector(".countryListModal .country-selector"),n=document.querySelector(".countryListModal .closeModal");n.focus(),addEvent(n,"click",function(){$(".countryListModal").removeClass("transitionUp"),setTimeout(function(){$(".countryListModal").remove()},300),login.logger.pushLogs()}),addEvent(e,"click",function(e){var n=getEventTarget(e);if(n.tagName==="A"){$(".countryListModal").removeClass("transitionUp");var r=$(n).data("countryCode"),i=$(n).data("locale"),s=$("input[name=requestUrl]").val();i&&r?(login.logger.log({evt:"actiontype",data:"click_country_change",instrument:!0}),login.logger.log({evt:"COUNTRY_LIST",data:"CLICK_COUNTRY_CHANGE",calEvent:!0}),s=t.updateParamValue(s,"country.x",r),s=t.updateParamValue(s,"locale.x",i),t.showSpinner(),setTimeout(function(){window.location.href=s},300)):setTimeout(function(){$(".countryListModal").remove()},300),login.logger.pushLogs()}})}function o(){var e=document.querySelectorAll(".picker button");e.forEach(function(e){$(e.parentElement).removeClass("hide"),addEvent(e,"click",function(){login.logger.log({evt:"actiontype",data:"click_country_picker",instrument:!0}),login.logger.log({evt:"COUNTRY_LIST",data:"CLICK_COUNTRY_PICKER",calEvent:!0}),s()})})}var i=document.querySelector(".main"),u=r("countryList");!e&&u&&(e=u,o()),e.countryList&&(document.head.insertAdjacentHTML("beforeend",e.countryList.css),n({countryList:e.countryList}),o())}var e={},t=login.utils;return{updateCache:n,getCache:r,showCountryDropDown:i}}(),login.loadResources=function(){function t(){var t,n="/signin/cookie-banner",r=$("body").data("cookieBannerVariant")||"",i=e.getFlowId()||"",s={flowId:i,cookieBannerVariant:r},o=Object.keys(s);for(var u=0;u<o.length;u++)u===0&&(n+="?"),n=s[o[u]]?n+o[u]+"="+s[o[u]]+"&":n;$.ajax({method:"GET",url:n,success:function(e){var n=e&&e.data&&e.data.cookieBanner,r,i=0;if(!n)return;document.querySelector("head").insertAdjacentHTML("beforeend",n.css),document.querySelector("#main").insertAdjacentHTML("beforeend",n.html),t=document.createElement("script"),t.setAttribute("nonce",$("body").data("nonce")),t.innerHTML=n.js.replace(/^<script[^>]*>|<\/script>$/g,""),$("body").append(t),typeof window.bindGdprEvents=="function"&&window.bindGdprEvents(),r=document.querySelector("#gdprCookieBanner"),r&&(i=$(r).outerHeight(),document.querySelector("body").style.marginBottom=i+"px")}})}function n(){var t,n=e.getFlowId(),r=e.getReturnUri()||"",i="/signin/app-download-banner?returnUrl="+encodeURIComponent(r);n&&(i=i+"&flowId="+n),$.ajax({method:"GET",url:i,success:function(e){var n=e&&e.data&&e.data.appDownloadMobileBanner;if(!n)return;document.querySelector("head").insertAdjacentHTML("beforeend",n.css),document.querySelector("#main").insertAdjacentHTML("beforebegin",n.html),t=document.createElement("script"),t.setAttribute("nonce",$("body").data("nonce")),t.innerHTML=n.js.replace(/^<script[^>]*>|<\/script>$/g,""),$("body").append(t)}})}function r(e){var t=document.querySelector("#phoneCode"),n=document.createDocumentFragment(),r=e&&e.countryPhoneList,i=e&&e.phoneCode,s;if(!r||!r.length||!t)return;for(var o=0;o<r.length;o++)s=document.createElement("option"),s.value=r[o].$value,s.setAttribute("data-code",r[o].$code),s.setAttribute("data-country",r[o].$country),s.textContent=r[o].$elt,r[o].$value===i&&s.setAttribute("selected","selected"),n.appendChild(s);t.innerHTML="",t.appendChild(n)}function i(e){var t=document.querySelector("#login");t&&e.overlayTemplate&&t.insertAdjacentHTML("beforeend",e.overlayTemplate)}function s(){function a(){var t={_csrf:e.getCSRFToken(),flowId:e.getFlowId(),intent:e.getIntent()},f=!1,l=$("body").data("overlay-variant");if(o>u)return;$("body").data("lazyLoadCountryCodes")==="true"&&(t.lazyLoadCountryCodes=!0,t["locale.x"]=n,f=!0),l&&(t.overlayVariant=l,t.overlayContentVersion=$("body").data("overlay-content-version"),login.utils.addHiddenElement("overlayVariant",l,document.querySelector("form[name=login]")),f=!0),login.countryList&&$(document.body).data("showCountryDropDown")==="true"&&!login.countryList.getCache("countryList")&&(t.showCountryDropDown="true",f=!0);if(!f)return;o+=1,$.ajax({url:s,method:"POST",data:t,success:function(e){login.countryList&&login.countryList.showCountryDropDown&&login.countryList.showCountryDropDown(e),r(e),i(e)},fail:a})}var t=document.querySelector('input[name="locale.x"]'),n=t&&t.value,s="/signin/load-resource",o=0,u=2;a()}var e=login.utils;return{showCookieBanner:t,showAppDownloadBanner:n,lazyload:s}}(),function(){var e=function(e){function t(t){return e.classList?e.classList.contains(t):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function n(n){e.classList?e.classList.add(n):t(n)||(e.className+=" "+n)}function r(n){if(e.classList)e.classList.remove(n);else if(t(n)){var r=new RegExp("(\\s|^)"+n+"(\\s|$)");e.className=e.className.replace(r," ")}}function i(t,n){var r;if(typeof t!="string")return;r="data-"+t.replace(/([A-Z])/g,"-$1").toLowerCase();if(!n)return e.getAttribute(r);e.setAttribute(r,n)}function s(){var t,n=e.offsetHeight;return typeof getComputedStyle=="undefined"?n:(t=getComputedStyle(e),n+=parseInt(t.marginTop)+parseInt(t.marginBottom),n)}function o(t,n){return n?e.setAttribute(t,n):e.getAttribute(t)}function u(t){return e.querySelectorAll(t)}function a(t){var n=e.textContent!==undefined&&e.textContent!==null;if(t===undefined)return n?e.textContent:e.innerText;n?e.textContent=t:e.innerText=t}function f(){e.parentNode.removeChild(e)}function l(){t("hide")?r("hide"):n("hide")}function c(t){e.appendChild(t)}function h(){e.focus()}function p(t){if(!t)return e.value;e.value=t}typeof e=="string"&&(e=document.querySelector(e));if(!e)return;return{hasClass:t,addClass:n,removeClass:r,data:i,outerHeight:s,text:a,attr:o,find:u,remove:f,toggle:l,append:c,focus:h,val:p}};e.ajax=function(e){var t,n,r,i=[],s,o=document.querySelector("input[name=_sessionID]");if(!e||e&&!e.url)return;try{t=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")}catch(u){}if(!t)return;e.onErrorEnabled&&(t.onerror=function(){!t.status&&typeof e.fail=="function"&&e.fail(t)});if(e.timeoutEnable){t.timeout=$("body").data("xhrTimeoutLimit");try{t.ontimeout=function(n){t.status!==200&&typeof e.fail=="function"&&(login.logger.log({evt:"TIMEOUT_WRAPPER",data:"TIMEOUT_ERROR"+e.url.replace(/\//g,"_").toUpperCase(),calEvent:!0}),login.logger.log({evt:"int_error_desc",data:"timeout_error",instrument:!0}),login.logger.pushLogs(),e.fail(t))}}catch(a){login.logger.log({evt:"TIMEOUT_WRAPPER",data:"TIMEOUT_USER_AGENT_ERROR",calEvent:!0}),login.logger.log({evt:"int_error_desc",data:"timeout_error_user_agent",instrument:!0}),login.logger.pushLogs()}}e.method=e.method||"POST";if(e.data&&typeof e.data!="string"){e.data._sessionID=e.data._sessionID||o&&o.value;for(s in e.data)i.push(encodeURIComponent(s)+"="+encodeURIComponent(e.data[s]))}t.onreadystatechange=function(){if(t.readyState!==4)return;n=t.response||t.responseText;if(t.status===200&&n){try{n=JSON.parse(n)}catch(r){}typeof e.success=="function"&&e.success(n)}t.status!==200&&typeof e.fail=="function"&&t.status!==0&&e.fail(t),typeof e.complete=="function"&&e.complete()},t.open(e.method,e.url),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.method==="POST"&&(t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.setRequestHeader("Accept","application/json")),e.method==="GET"&&t.setRequestHeader("Accept","application/json");if(typeof e.headers=="object"&&e.headers.length)for(r in e.headers)t.setRequestHeader(r,e.headers[r]);return t.send(i&&i.join("&")),t},window.$=e}(),login.view=function(){function e(e){var i=document.querySelector("input[name=splitLoginContext]"),s=e&&e.model||{};typeof window.showGdprBanner=="function"&&window.showGdprBanner(),i.value=s.splitLoginContext,g(s),h(s),r(s),o(s),u(s),a(s),f(s),m(s),l(s),p(s),n(s),login.verification&&login.verification.updateView(s),t(s)}function t(e){var t=document.querySelector("#password").parentElement,n=t.parentElement,r=e.webAuthnFpIconEnabled;e.partyIdHash&&(login.utils.addHiddenElement("partyIdHash",e.partyIdHash,document.querySelector("form[name=login]")),document.body.setAttribute("data-party-id-hash",e.partyIdHash));if(e.webAuthnLoginContext&&login.webAuthn&&login.webAuthn.setContext&&!e.verification){login.webAuthn.setContext(e);if(!r)return;document.body.setAttribute("data-web-authn-login-context",e.webAuthnLoginContext),login.utils.addHiddenElement("webAuthnLoginContext",e.webAuthnLoginContext,document.querySelector("form[name=login]")),e.wanSupportLookup&&document.body.setAttribute("data-web-authn-support-lookup","true"),n&&$(n).addClass("errorMessageFp"),e.isRtl?t&&$(t).addClass("rtlFpPlaceholder"):t&&$(t).removeClass("rtlFpPlaceholder")}}function n(e){var t=document.querySelector("#email"),n=document.querySelector('label[for="email"]'),r=document.querySelector("#phone"),i=document.querySelector("#isTpdOnboarded"),s=document.querySelector(".countryPhoneSelectWrapper"),o=document.querySelector("#login_emaildiv"),u=document.querySelector(".profileRememberedEmail");e.profile||(t&&t.removeAttribute("disabled"),r&&r.removeAttribute("disabled")),s&&$(s).addClass("hide"),o&&$(o).removeClass("phoneInputWrapper"),!e.profile&&u&&$(u).removeClass("cookiedProfile"),!e.phone&&r?r.value=null:e.phone&&t&&(t.value=null),e.notifications&&e.hybridInEmailOnlyMode&&e.contextualLogin&&e.contextualLogin.content&&(t&&$(t).attr("placeholder",e.contextualLogin.content.emailLabel),n&&$(n).text(e.contextualLogin.content.emailLabel),t&&$(t).attr("data-hybrid-in-email-only-mode",e.hybridInEmailOnlyMode)),i&&e.profile&&e.isTpdOnboarded&&(i.value=e.isTpdOnboarded)}function r(e){var t=document.querySelector("#splitEmail"),n=document.querySelector("#splitEmailSection"),r=document.querySelector("#splitPhoneSection"),i=document.querySelector("#rememberProfileEmail"),s=document.querySelector("#email"),o=document.querySelector("#phone"),u=document.querySelector(".forgotLink"),a=document.querySelector(".forgotLink .bubble-tooltip"),f=document.querySelector(".actions"),l=document.querySelector("#loginWithPhoneOption"),c=document.querySelector("#loginWithEmailOption"),h=$("body").data("phonePasswordEnabled"),p=$("body").data("phonePinEnabled"),v=document.querySelector("#signUpLinkOnEmail"),m=document.querySelector("#signUpLinkOnPassword");e.splitLoginContext==="inputEmail"||e.splitLoginContext==="inputPhone"?(t&&$(t).removeClass("hide"),i&&typeof e.rememberProfile!="undefined"&&(i.checked=e.rememberProfile==="true"||e.rememberProfile===!0),d(),v&&$(v).removeClass("hide"),m&&$(m).addClass("hide")):(e.tpdVariant!=="autoSend"&&t&&$(t).addClass("hide"),o&&o.blur(),s&&s.blur()),n&&e.splitLoginContext==="inputEmail"&&($(n).removeClass("hide"),s.removeAttribute("disabled"),p||h?(l&&$(l).removeClass("hide"),c&&$(c).addClass("hide"),u&&$(u).addClass("hide"),a&&$(a).addClass("hide")):u&&$(u).removeClass("hide"),$(f).removeClass("phonePresent"),r&&$(r).addClass("hide"),o&&(o.value="",o.setAttribute("disabled","disabled")));if(r&&e.splitLoginContext==="inputPhone"){n&&$(n).addClass("hide"),$(r).removeClass("hide");if(p||h)l&&$(l).addClass("hide"),c&&$(c).removeClass("hide")}login.geoEnablement&&login.geoEnablement.setGeoMessage(e)}function i(e){if(!e.enableSmartlock)return;login.smartLock(e)}function s(e){e=e||{};var t=e.appleIdpJson;if(typeof t!="string"||typeof login.siapple!="function")return;return login.siapple({appleIdpJson:t})}function o(e){var t=document.querySelector(".educationMessage");e.showEducationMessage===!0&&e.splitLoginContext==="inputPin"?t&&$(t).removeClass("hide"):t&&$(t).addClass("hide")}function u(e){var t=document.querySelector("#splitPassword"),n=document.querySelector("#splitPasswordSection"),r=document.querySelector("#splitPinSection"),o=document.querySelector("#password"),u=document.querySelector("#pin"),a=document.querySelector("#rememberProfilePassword"),f=document.querySelector(".forgotLink"),l=document.querySelector("#phone"),c=document.querySelector("#signUpLinkOnEmail"),h=document.querySelector("#signUpLinkOnPassword"),p=document.querySelector('#splitEmail input[type="password"]');p&&p.value.trim()&&(o.value=p.value,p.value=""),e.splitLoginContext==="inputPassword"||e.splitLoginContext==="inputPin"?(t&&e.tpdVariant!=="autoSend"&&$(t).removeClass("hide"),s(e),i(e),a&&(a.checked=e.rememberProfile==="true"||e.rememberProfile===!0),e.splitLoginContext==="inputPassword"&&!e.tpdVariant&&f&&$(f).removeClass("hide"),typeof e.appleIdpJson=="string"&&login.utils.addHiddenElement("appleIdpJson",e.appleIdpJson,document.querySelector("form[name=login]")),$(o).attr("disabled")==="disabled"&&o.removeAttribute("disabled"),e.smartlockStatus!=="linked"&&!e.verification&&v(e),c&&$(c).addClass("hide"),h&&$(h).removeClass("hide"),window.dispatchEvent&&window.dispatchEvent(createNewEvent("resize"))):(t&&$(t).addClass("hide"),o.value="",u&&(u.value="")),n&&e.splitLoginContext==="inputPassword"&&(r&&$(r).addClass("hide"),$(n).removeClass("hide")),r&&e.splitLoginContext==="inputPin"&&($(n).addClass("hide"),$(r).removeClass("hide")),e.profile&&e.profile.phone&&l&&(l.value=e.profile.phone),$("body").hasClass("desktop")&&o.focus()}function a(e){var t=document.querySelector("input[name=splitLoginContext]"),n=document.querySelector(".profileDisplayEmail"),r=document.querySelector(".profileDisplayName"),i=document.querySelector(".profileRememberedEmail"),s=document.querySelector(".profileIcon"),o=document.querySelector("#email"),u=document.querySelector(".profileDisplayPhoneCode"),a;if(e.tpdVariant==="autoSend")return;if(!e.profile){s&&($(s).addClass("hide"),$(s).text(""),s.removeAttribute("style"),$(s).removeClass("profilePhoto"),$(s).removeClass("profileInitials"),$(s).addClass("profilePlaceHolderImg")),n&&$(n).text(""),u&&$(u).text(""),r&&$(r).addClass("hide"),o.value="",i&&$(i).addClass("hide"),window.dispatchEvent&&window.dispatchEvent(createNewEvent("resize"));return}a=e.profile.phone||e.profile.email,a&&e.splitLoginContext!=="inputEmail"&&e.splitLoginContext!=="inputPhone"&&(n&&$(n).text(a),i&&$(i).removeClass("hide")),e.profile.phoneCode&&u&&$(u).text(e.profile.phoneCode)}function f(e){function t(e,t){var n=login.utils.getQueryParamFromUrl("ulPage",e);return n?login.utils.updateParamValue(e,"ulPage",t):e}var n=$(document.querySelector("#signupContainer")),r=e.splitLoginContext==="inputEmail"||e.splitLoginContext==="inputPhone",i=e.contextualLogin&&e.contextualLogin.guestEscapeHatch,s=e.isOtpSmsUser,o,u,a,f;if(!n)return;a=$(signupContainer.querySelector("#createAccount")),o=n.data("hideOnEmail")==="true"||i||s,u=n.data("hideOnPass")==="true",f=a&&a.attr("href"),r?(o?n.addClass("hide"):n.removeClass("hide"),a&&a.attr("href",t(f,"email"))):(u?n.addClass("hide"):n.removeClass("hide"),a&&a.attr("href",t(f,"pwd")))}function l(e){var t=document.querySelector("footer"),n=document.querySelector("#login"),r=document.querySelector("#login .contentContainer"),i=document.querySelector("#verification .contentContainer"),s=document.querySelector("#verification"),o;e.verification?(o=document.querySelector(".activeContent"),$(n).addClass("hide"),$(s)&&$(s).removeClass("hide"),$(t).addClass("footerWithIcon"),$(o).removeClass("activeContent"),$(i)&&$(i).addClass("activeContent"),c(e.verification),login.tpdLogin&&login.tpdLogin.instrumentVerificationViewRendered()):(o=document.querySelector(".activeContent"),$(n).removeClass("hide"),$(s)&&$(s).addClass("hide"),$(t).removeClass("footerWithIcon"),$(o).removeClass("activeContent"),$(r).addClass("activeContent"))}function c(e){if(!e)return;var t=document.querySelector(".account"),n=document.querySelector(".mobileNotification .pin"),r=document.querySelector(".twoDigitPin"),i=document.querySelector("#uncookiedMessage"),s=document.querySelector("#cookiedMessage");$(t).text(e.email),e.pin&&n?($(n).text(e.pin),$(r).text(e.pin),r.setAttribute("style","font-weight: bold"),$(i).removeClass("hide")):$(s).removeClass("hide")}function h(e){var t=document.querySelectorAll(".notifications"),n=e.isOtpSmsUser;for(var r=0;r<t.length;r++)$(t[r]).text(""),e.notifications&&e.notifications.msg&&(t[r].innerHTML='<p class="notification '+e.notifications.type+'" role="alert">'+e.notifications.msg+"</p>");e.notifications&&n&&login.utils.hideSpinner()}function p(e){var t=document.querySelector("#emailSubTagLine"),n=document.querySelector("#phoneSubTagLine"),r=document.querySelector("#pwdSubTagLine"),i=document.querySelector("#pwdSecondarySubTagLine");e.splitLoginContext==="inputPassword"||e.splitLoginContext==="inputPin"?(t&&$(t).addClass("hide"),n&&$(n).addClass("hide"),r&&$(r).removeClass("hide"),i&&$(i).removeClass("hide")):e.splitLoginContext==="inputPhone"?(n&&$(n).removeClass("hide"),t&&$(t).addClass("hide"),r&&$(r).addClass("hide"),i&&$(i).addClass("hide")):(t&&$(t).removeClass("hide"),n&&$(n).addClass("hide"),r&&$(r).addClass("hide"),i&&$(i).addClass("hide"))}function d(){var e=login.utils.isHybridLoginExperience();login.logger.log({evt:"state_name",data:e?"begin_hybrid_login":"begin_email",instrument:!0}),login.logger.log({evt:"transition_name",data:e?"prepare_hybrid":"prepare_email",instrument:!0}),login.logger.log({evt:"is_cookied",data:"N",instrument:!0}),login.logger.pushLogs()}function v(e){var t=document.querySelector("#password"),n=document.querySelector("#phone"),r=login.utils.isFieldPrefilled(t),i=login.utils.isHybridLoginExperience(),s=i?"prepare_hybrid_pwd":"prepare_pwd";s+=login.utils.getKmliCb()?"_ot":"",document.querySelector("#moreOptionsContainer")&&e.moreOptions===!0&&(s+="_more_opt",login.logger.log({evt:"exp_shown",data:"tpd",instrument:!0})),login.logger.log({evt:"state_name",data:i?"begin_hybrid_pwd":"begin_pwd",instrument:!0}),login.logger.log({evt:"pub_cred_type",data:n&&n.value?"phone":"email",instrument:!0}),login.logger.log({evt:"transition_name",data:s,instrument:!0}),login.logger.log({evt:"is_cookied",data:"Y",instrument:!0}),login.logger.log({evt:"autofill",data:r?"Y":"N",instrument:!0}),login.logger.pushLogs()}function m(e){function n(e){var t=document.querySelectorAll(".captcha-container");for(var n=0;n<t.length;n++)e?$(t[n]).removeClass("hide"):$(t[n]).addClass("hide")}var t;n(e.captcha);if(!e.captcha)return;t=login.utils.getActiveCaptchaElement({value:e.splitLoginContext});if(!t)return;e.captcha.captchaImgUrl&&t.image&&t.image.setAttribute("src",e.captcha.captchaImgUrl),e.captcha.captchaAudioUrl&&t.audioTag&&t.audioTag.setAttribute("src",e.captcha.captchaAudioUrl),e.captcha.captchaAudioUrl&&t.audioLink&&t.audioLink.setAttribute("href",e.captcha.captchaAudioUrl)}function g(e){if(!e.adsChallengeVerified)return;$("#login").removeClass("hide"),document.getElementById("ads-container")&&(document.getElementById("ads-container").style.display="none")}return login.storeInstance=login.store(),login.pubsub.subscribe("STATE_UPDATED",e),{render:e,updateNotificationView:h}}(),function(){typeof Object.assign!="function"&&(Object.assign=function(e,t){if(e===null)throw new TypeError("Cannot convert undefined or null to object");var n=Object(e);for(var r=1;r<arguments.length;r++){var i=arguments[r];if(i!==null)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})}(),login.fn=function(){function t(t){var n=document.getElementById("fconfig");n&&n.parentNode&&n.parentNode.removeChild(n),n=document.createElement("script"),n.id="fconfig",n.type="application/json",n.setAttribute("fncls",e),n.setAttribute("nonce",$("body").data("nonce"));var r={f:t.fnSessionId,s:t.sourceId,b:t.beaconUrl,ts:{type:"UL",fields:[{id:"email",min:6},{id:"password",min:6}],delegate:!1}};n.text=JSON.stringify(r),document.body.appendChild(n)}function n(e){var t=document.createElement("script");t.src=e.fnUrl,t.onload=function(){r(e)},document.body.appendChild(t)}function r(e){e.enableSpeedTyping&&typeof initTsFb=="function"&&initTsFb({detail:{type:"UL",fields:["email","password"]}})}function i(e){PAYPAL.syncData&&typeof PAYPAL.syncData.initSync=="function"&&e&&(e.detail={type:"UL",fields:["email","password"]},PAYPAL.syncData.initSync(e))}function s(){if(PAYPAL.syncData&&typeof PAYPAL.syncData.flushData=="function")try{PAYPAL.syncData.flushData()}catch(e){}else login.logger.log({evt:"FN_PAYLOAD",data:"fn_sync_data_not_load",instrument:!0}),login.logger.pushLogs()}function o(e){e&&e.sourceId&&typeof PAYPAL.ulSync=="object"&&(PAYPAL.ulSync.sourceId=e.sourceId,i(PAYPAL.ulSync))}function u(){var e=$("body").data("enableFnBeaconOnWebViews");return!e&&/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)?!1:!0}function a(){u()&&PAYPAL&&PAYPAL.ulData&&PAYPAL.ulData.fnUrl&&(t(PAYPAL.ulData),n(PAYPAL.ulData)),i(PAYPAL.ulSync)}var e="fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99";return{initialize:a,initializeFnSync:i,addFnSyncData:s,updateFnSyncContext:o}}(),login.qrCode=function(){function r(e){eventPreventDefault(e);var t=document.querySelector("#qrcSpinnerContainer");$(t).removeClass("hide"),$(n).addClass("hide"),login.logger.log({evt:"QRC",data:"QRC_CLICK_REFRESH",calEvent:!0}),login.logger.log({evt:"qrc_reason",data:"qrc_click_refresh",instrument:!0}),login.logger.log({evt:"qr_context_id",data:login.ref_str,instrument:!0}),login.logger.pushLogs(),login.fn.addFnSyncData(),$.ajax({type:"POST",url:"/signin/qrc/manage",data:{_csrf:login.utils.getCSRFToken(),fnId:PAYPAL.ulData&&PAYPAL.ulData.fnSessionId,fn_sync_data:document.querySelector('input[name="fn_sync_data"]').value,ref_str:login.ref_str,qrcOperation:"refresh"},onErrorEnabled:!0,timeoutEnable:!0,success:function(e){$(t).addClass("hide"),login.ref_str=e.ref_str,login.qrImageUrl=e.qrImageUrl,login.logger.log({evt:"QRC",data:"QRC_REFRESH_SUCCESS",calEvent:!0,status:"SUCCESS"}),login.logger.log({evt:"qrc_reason",data:"qrc_refresh_success",instrument:!0}),login.logger.log({evt:"qr_context_id",data:login.ref_str,instrument:!0}),login.logger.pushLogs(),i({refreshFlow:!0})},fail:function(e){login.logger.log({evt:"QRC",data:"QRC_REFRESH_FAILED",calEvent:!0,status:"ERROR"}),login.logger.log({evt:"qrc_reason",data:"qrc_refresh_failed",instrument:!0}),login.logger.log({evt:"qr_context_id",data:login.ref_str,instrument:!0}),login.logger.pushLogs(),$(t).addClass("hide"),$(n).removeClass("hide")}})}function i(e){e=e||{};if(!login.ref_str)return;try{window.localStorage.setItem("ref_str",login.ref_str)}catch(t){login.logger.log({evt:"localStorage not supported",data:t,calEvent:!0,status:"ERROR"}),login.logger.pushLogs()}login.logger.log({evt:"QRC",data:"QRC_GENERATE_SUCCESS",calEvent:!0}),login.logger.log({evt:"state_name",data:"qrc",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_qrc_generate_success",instrument:!0}),login.logger.log({evt:"qr_context_id",data:login.ref_str,instrument:!0}),login.logger.pushLogs();var r=document.getElementById("qrcSpinnerContainer");$(r)&&$(r).addClass("hide");var i=document.getElementById("qrPPLogo");$(i)&&$(i).removeClass("hide"),login.fn.addFnSyncData(),e.clientRender&&s(),!e.refreshFlow&&!e.clientRender&&$.ajax({url:"/signin/qrc/manage",method:"POST",data:{_csrf:login.utils.getCSRFToken(),fnId:PAYPAL.ulData&&PAYPAL.ulData.fnSessionId,fn_sync_data:document.querySelector('input[name="fn_sync_data"]').value,ref_str:login.ref_str,qrcOperation:"update"},onErrorEnabled:!0,timeoutEnable:!0,success:function(e){login.logger.log({evt:"QRC",data:"QRC_UPDATE_SUCCESS",calEvent:!0}),login.logger.log({evt:"state_name",data:"qrc",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_qrc_update_success",instrument:!0}),login.logger.log({evt:"qr_context_id",data:login.ref_str,instrument:!0}),login.logger.pushLogs(),login.qrcPolling.startPolling()},fail:function(e){login.logger.log({evt:"QRC",data:"QRC_UPDATE_ERROR",calEvent:!0,status:"ERROR"}),login.logger.log({evt:"qrc_reason",data:"qrc_update_error",instrument:!0}),login.logger.log({evt:"qr_context_id",data:login.ref_str,instrument:!0}),login.logger.pushLogs(),$(r).addClass("hide"),$(n).removeClass("hide")}}),e.refreshFlow&&s()}function s(){var e=document.querySelector("#qrcCanvas > img");e&&e.remove(),e=document.createElement("IMG"),e.src=login.qrImageUrl,document.getElementById("qrcCanvas").appendChild(e),login.logger.log({evt:"QRC",data:"QRC_SERV_RENDER_SUCCESS",calEvent:!0}),login.logger.log({evt:"state_name",data:"qrc",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_qrc_server_render_success",instrument:!0}),login.logger.log({evt:"qr_context_id",data:login.ref_str,instrument:!0}),login.logger.pushLogs(),login.qrcPolling.startPolling({refreshFlow:!0})}login.ref_str=$("body").data("ref_str"),login.qrImageUrl="";var e=document.querySelector("#refreshIcon"),t=document.querySelector("#refreshMessage"),n=document.querySelector("#refreshComponent");return e&&addEvent(e,"click",function(e){eventPreventDefault(e),r(e)}),t&&addEvent(t,"click",function(e){eventPreventDefault(e),r(e)}),{initialize:i}}(),login.qrcPolling=function(){function n(n){n=n||{},n.refreshFlow&&(e=!0);try{var i=window.localStorage.getItem("ref_str")}catch(s){login.logger.log({evt:"localStorage not supported",data:s,calEvent:!0,status:"ERROR"}),login.logger.pushLogs()}if(!login.ref_str||login.ref_str!==i){e=!1,$(t).removeClass("hide"),login.ref_str!==i&&(login.logger.log({evt:"QRC",data:"QRC_MULTI_TABS",calEvent:!0}),login.logger.log({evt:"qrc_reason",data:"qrc_multi_tabs"+ +$("body").data("loginPollCounter"),instrument:!0}),login.logger.log({evt:"qr_context_id",data:login.ref_str,instrument:!0}),login.logger.pushLogs()),$.ajax({url:"/signin/qrc/manage",method:"POST",data:{_csrf:login.utils.getCSRFToken(),ref_str:login.ref_str,intent:login.utils.getIntent(),qrcOperation:"destroy"}});return}e&&setTimeout(function(){r()},login.pollTimeInterval)}function r(){var e=document.querySelector("#qrcSpinnerContainer");$.ajax({url:"/signin/qrc/manage",method:"POST",data:{_csrf:login.utils.getCSRFToken(),ref_str:login.ref_str,intent:login.utils.getIntent(),qrcOperation:"validate"},onErrorEnabled:!0,timeoutEnable:!0,success:function(e){e.qrcStatus==="POLLING_IN_PROGRESS"&&n(),e.qrcStatus==="SUCCESS"&&(login.utils.showSpinner({qrCodeSpinner:!0}),login.utils.showSpinnerMessage("qrcMessage"),login.logger.log({evt:"QRC",data:"QRC_VERIFY_SUCCESSFUL",calEvent:!0,status:"SUCCESS"}),login.logger.log({evt:"qrc_reason",data:"process_qrc_verify"+$("body").data("loginPollCounter"),instrument:!0}),login.logger.log({evt:"qrc_count",data:$("body").data("loginPollCounter"),instrument:!0}),login.logger.log({evt:"qr_context_id",data:login.ref_str,instrument:!0}),login.logger.pushLogs(),window.location.href=e.returnUrl)},fail:function(n){login.logger.log({evt:"QRC",data:"QRC_VERIFY_FAILED",calEvent:!0,status:"ERROR"}),login.logger.log({evt:"qrc_reason",data:"process_qrc_verify_failed",instrument:!0}),login.logger.log({evt:"qr_context_id",data:login.ref_str,instrument:!0}),login.logger.pushLogs(),$(e).addClass("hide"),$(t).removeClass("hide")}})}var e=!0,t=document.querySelector("#refreshComponent");return login.pollTimeInterval=parseInt($("body").data("pollTimeInterval")),{startPolling:n}}();var initializeKeychainAutofillDetector=function(e){var t="autofill-email",n="autofill-pwd",r="change-email",i="change-pwd",s={};s[t]=[t,i],s[r]=[r,n];var o={};return o[t]=[t,r,n,i],o[r]=[r,t,r,n],function(a){function v(e){return p=[],l(e)}function m(){if(!(!f||p[0]!==n&&p[0]!==i))return v();if(g(p,d[t])||g(p,d[r]))return v()}function g(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length<t.length)return!1;var n=t[0],r=e.lastIndexOf(n);if(r<0)return!1;var i=!0;for(var s=1;s<t.length;s++)e[r+s]!==t[s]&&(i=!1);return i}function y(s,o){if(!s||!o)return;e.addAutofillEventHandler(s,function(){return p.push(t)}),e.addAutofillEventHandler(o,function(){return p.push(n),m()}),addEvent(s,"change",function(){return p.push(r)}),addEvent(o,"change",function(){return p.push(i),m()})}a=a||{};var f=a.isIosWebView,l=a.callback,c=a.emailInputDOM,h=a.pwdInputDOM,p=[],d=f?s:o;return y(c,h)}}(login.utils),Keychain=function(e){function a(){}function f(e,t){var n=document.querySelector("input[name=splitLoginContext]");return e===i.PPOT&&n.value!=="inputPassword"?!1:e===i.EMAIL?t!==r.EIGHTBALL&&t!==r.RISKY_LOGIN&&t!==r.CONNECT&&t!==r.CHECKOUT&&t!==r.DONATE:!0}function l(e,t){var n=document.querySelector(".transitioning"),r=Object.assign({},e,t);return $(n).addClass("nonTransparentMask"),o.showSpinnerMessage("secureMessage"),o.showSpinnerMessage("keychainOneTouchMessage"),o.makeServerRequestAndReturnPromise("/signin/keychain/handle/authenticate",{method:"POST",data:r})}function c(e){var t=g(),n=Object.assign({},t,e);return o.makeServerRequestAndReturnPromise("/signin/keychain/handle/token",{method:"POST",data:n})}function h(e,n,r){var i=r,s=$("body").data("csrfToken"),a=o.getFlowId(),f=document.querySelector("#keychain-interstitial #keychain-form-container"),l=document.createElement("form"),c=document.createElement("input"),h=document.createElement("input"),p=document.createElement("button");return $(l).attr("method","POST"),$(l).attr("action","/signin/keychain/handle/register"),$(c).attr("type","text"),$(c).attr("name","email"),$(c).attr("value",i),o.addHiddenElement("returnUrl",e,l),o.addHiddenElement("_csrf",s,l),o.addHiddenElement("flowId",a,l),$(h).attr("type","password"),$(h).attr("name","password"),$(h).attr("value",n),$(p).attr("type","submit"),$(l).append(c),$(l).append(h),$(l).append(p),$(f).append(l),u.log({evt:t,data:"SUCCEEDED_MOUNT_HIDDEN_FORM",calEvent:!0}),u.pushLogs(),p}function p(){var e=document.querySelector("#keychain-interstitial"),n=document.querySelector(".transitioning"),r=document.querySelector(".lockIcon"),i=document.querySelector("#login"),s=document.querySelector("footer.footer");return i&&$(i).addClass("hide"),s&&$(s).addClass("hide"),n&&$(n).addClass("hide"),r&&$(r).addClass("hide"),$(e).removeClass("hide"),u.log({evt:t,data:"PREPARE_INTERSTITIAL",calEvent:!0}),u.log({evt:"state_name",data:"keychain_interstitial",instrument:!0}),u.log({evt:"transition_name",data:"prepare_keychain_interstitial",instrument:!0}),u.pushLogs()}function d(e,n){var r=document.querySelector(".transitioning"),i=document.querySelector(".lockIcon"),s=document.querySelector("#login"),o=document.querySelector("footer.footer"),a=document.createElement("div");return s&&$(s).addClass("hide"),o&&$(o).addClass("hide"),r&&$(r).addClass("hide"),a.innerHTML=e,$("body").append(a),i&&$(i).addClass("hide"),u.log({evt:t,data:"PREPARE_INTERSTITIAL",calEvent:!0}),u.log({evt:"state_name",data:"keychain_interstitial",instrument:!0}),u.log({evt:"transition_name",data:"prepare_keychain_interstitial",instrument:!0}),u.pushLogs()}function v(e){e=e||{};var t=document.querySelector("#keychain-interstitial"),n=t.querySelector(".decline"),r=t.querySelector(".cta-decline"),i=t.querySelector("button.cta-keychain-optin");return o.hideSpinnerMessage("checkingInfo"),addEvent(n,"click",m("close_button",e)),addEvent(r,"click",m("do_this_later",e)),addEvent(i,"click",m("next_button",e,!0))}function m(e,n,r){n=n||{};var i=n.returnUrl,s=n.email,a=n.rdstr;return function(f){eventPreventDefault(f),o.showSpinner(),u.log({evt:t,data:"PROCESS_INTERSTITIAL_"+e.toUpperCase(),calEvent:!0}),u.log({evt:"state_name",data:"keychain_interstitial",instrument:!0}),u.log({evt:"transition_name",data:"process_keychain_interstitial",instrument:!0}),u.log({evt:"actionType",data:e,instrument:!0}),u.pushLogs();if(!r)return window.location.href=i;var l={email:s,rdstr:a};return c(l).then(function(t){t=t||{};var n=t.keychainDeviceToken;if(!n)return Promise.reject({message:"no-device-token"});var r=h(i,n,s);return r.click()}).catch(function(n){n=n||{};var r=n.message||"",s=n.responseText||"";if(r==="no-device-token")u.log({evt:t,data:"FAILED_CREATE_TOKEN_NO_TOKEN",calEvent:!0});else if(s.includes("CSRF token missing"))u.log({evt:t,data:"FAILED_CREATE_TOKEN_CSRF",calEvent:!0});else{var o=JSON.stringify(n);u.log({evt:t,data:"FAILED_CREATE_TOKEN_"+o,calEvent:!0})}return u.pushLogs(),window.location.href=i})}}function g(){return{ctxId:o.getCtxId(),intent:o.getIntent(),returnUri:o.getReturnUri(),state:o.getReturnUriState(),flowId:o.getFlowId()}}function y(e){var t=document.querySelector(".textInputMask.email"),n=t&&t.querySelector(".maskDisplay"),r=t&&t.querySelector(".maskChange"),i=document.querySelector("input#email");if(!t)return;$(t).removeClass("hide"),$(t).addClass("maskEnabled"),$(t).addClass("transformRightToLeft"),$(n).text(e),r.addEventListener("click",function(){$(t).addClass("hide"),$(t).removeClass("maskEnabled"),$(n).text(""),i.value=""})}var t="KEYCHAIN",n="PayPal One Touchâ„¢",r={EIGHTBALL:"signin",CHECKOUT:"checkout",DONATE:"donate",CONNECT:"connect",RISKY_LOGIN:"risky_login",UNKNOWN:"unknown"},i={PPOT:"ppot_token",EMAIL:"email_token",PD103:"pd103_token"},s=/^\S+@\S+\.\S+$/,o=login.utils,u=login.logger;return a.triggerOptin=function(t){t.isXHR?d(t.htmlDOM,t.returnUrl):p(),v(t)},a.triggerActivation=function(n){var r=g();return u.pushLogs(),l(r,n).then(function(n){return n.isCookieDisabledRequest&&n.accessToken&&n.returnUrl?(u.log({evt:t,data:"PROCESS_SLR_INTERNAL_REDIRECT",calEvent:!0}),u.pushLogs(),o.handleSlrInternalRedirect(n)):n.returnUrl?window.location.href=n.returnUrl:Promise.reject()}).catch(function(){return o.hideSpinner(),o.hideSpinnerMessage("secureMessage"),o.hideSpinnerMessage("keychainOneTouchMessage"),a.showErrorMessage({isFailed:!0})})},a.loginWithKeychainToken=function(t){t=t||{};var n=document.querySelector(".transitioning"),s=document.querySelector("form[name=login]"),a=s&&s.querySelector("#btnNext"),f=s&&s.querySelector("button#btnLogin");return t.flowName===r.RISKY_LOGIN&&t.tokenType===i.EMAIL?(f&&f.click(),u.pushLogs()):t.tokenType===i.PPOT?(y(t.email),o.addHiddenElementIfNotExist("ppot_login_email",t.email,s),a&&a.click(),u.pushLogs()):t.tokenType===i.EMAIL?(n&&$(n).addClass("nonTransparentMask"),o.addHiddenElementIfNotExist("isKeychainActivationWithEmailTokenOn8ball","true",s),f&&f.click(),u.pushLogs()):u.pushLogs()},a.getTokenInfo=function(t,r){var o=t&&t===n,u=typeof r=="string"&&r.split("-1:")||[],a=typeof u[1]=="string"&&u[1].match(s),f=u[1],l={};return o&&a?(l.tokenType=i.PPOT,l.email=f,l.token=r,l):!o&&a?(l.tokenType=i.EMAIL,l.email=f,l.token=r,l):o?(l.tokenType=i.PD103,l.token=r,l):undefined},a.showErrorMessage=function(t){t=t||{};var n=document.querySelector("#keychainErrorMessage");if(!n)return;$(n).removeClass("hide");if(t.isFailed){var i=n.querySelector(".keychain-activation-failure");return i&&$(i).removeClass("hide")}if(t.flowName===r.RISKY_LOGIN){var s=n.querySelector(".blocked-on-risky-login");return s&&$(s).removeClass("hide")}if(t.flowName===r.EIGHTBALL||t.flowName===r.CONNECT){var o=n.querySelector(".blocked-on-8ball");return o&&$(o).removeClass("hide")}},a.mapAutofillToKeychainActivationEvent=function(n,r,i){function u(){var e=s.value,t=o.value,n=a.getTokenInfo(e,t);if(!n)return;f(n.tokenType,i)&&(window.formAutofilledAt=Date.now());var u=createNewEvent("keychain:activation");return u.tokenType=n.tokenType,u.email=n.email,u.token=n.token,r.dispatchEvent(u)}var s=document.querySelector("input#email"),o=document.querySelector("input#password");if(!s||!o||!r)return;return e({isIosWebView:n,emailInputDOM:s,pwdInputDOM:o,callback:u})},a.getFlowName=function(){return $("body").data("isRiskyLogin")==="true"?r.RISKY_LOGIN:o.getIntent()||r.UNKNOWN},a.shouldBlockActivation=function(t,n,s){return t===r.EIGHTBALL||t===r.CONNECT||t===r.RISKY_LOGIN?n===i.PD103||n===i.PPOT:t===r.CHECKOUT||t===r.DONATE?!s:!1},a.shouldAllowLoginWithKeychain=function(t,n){return t===r.RISKY_LOGIN||t===r.EIGHTBALL||t===r.CONNECT||t===r.CHECKOUT||t===r.DONATE?n===i.EMAIL:!1},a.shouldAllowOneTouchLoginWithKeychain=function(t,n){return t===r.CHECKOUT||t===r.DONATE?n:!1},a.blockActivation=function(n,r){return r=r||"",n=n||"",a.showErrorMessage({flowName:n}),u.log({evt:t,data:"ACTIVATION_BLOCKED_"+n.toUpperCase()+"_"+r.toUpperCase(),calEvent:!0}),u.log({evt:"notification",data:"keychain_not_allowed",instrument:!0}),u.pushLogs()},a}(initializeKeychainAutofillDetector);login.keychain=function(e){var t="KEYCHAIN",n=login.utils,r=login.logger,i=n.parseJsonSafe($("body").data("keychainFlagsJson"))||{},s=i.activationOnXoEnabled,o=i.isIosWebView,u=i.isEligibleForXhrLogin;return function(a){a=a||{};var f=$("body"),l=document.querySelector("form[name=login]"),c=document.querySelector("input#email"),h=l&&l.querySelector("input#password"),p=a.isKeychainOptinRequired||f.data("isKeychainOptinRequired"),d=a.keychainReturnUrl||f.data("keychainReturnUrl"),v=parseInt(a.keychainOptinTime||f.data("keychainOptinTime")),m=a.keychainUiExp||f.data("keychainUiExp"),g=e.getFlowName();if(p)return e.triggerOptin({returnUrl:d,optinTime:v,uiExp:m,isXHR:u,htmlDOM:a.keychainHtml,email:a.email,rdstr:a.rdstr});e.mapAutofillToKeychainActivationEvent(o,l,g),l&&addEvent(l,"keychain:activation",function(u){u.preventDefault();var a=u.tokenType,f=u.email,p=u.token;return n.addHiddenElementIfNotExist("isFormAutofilled","true",l),r.log({evt:"keychain_type",data:a,instrument:!0}),r.log({evt:t,data:"TOKEN_TYPE_"+a.toUpperCase(),calEvent:!0}),e.shouldBlockActivation(g,a,s)?(c.value="",h.value="",e.blockActivation(g,a)):e.shouldAllowLoginWithKeychain(g,a)?e.loginWithKeychainToken({tokenType:a,email:f}):e.shouldAllowOneTouchLoginWithKeychain(g,s)?(h.value="",e.triggerActivation({deviceToken:p,isIosWebView:o})):(c.value="",h.value="",r.log({evt:t,data:"UNEXPECTED_FLOW_OR_INTENT",calEvent:!0}),r.pushLogs())})}}(Keychain),login.verification=function(){function A(e){login.utils.updateView({splitLoginContext:"inputPassword",profile:{email:h},verification:null,notifications:e.notifications})}function O(){var e,t=document.querySelector("#expired .slimP");t&&t.textContent&&(e={msg:t&&t.textContent,type:"notification-warning"}),login.utils.updateView({splitLoginContext:"inputPassword",profile:{email:h},tpdVariant:N,verification:null,ulSync:_("inputPassword"),notifications:e})}function M(){if(PAYPAL.syncData&&typeof PAYPAL.syncData.data=="object")return JSON.stringify(PAYPAL.syncData.data)}function _(e){var t=PAYPAL.ulSync&&PAYPAL.ulSync.sourceId||"",n=t.indexOf("REMEMBERED")!==-1?"_REMEMBERED":"",r={inputPassword:"UNIFIED_LOGIN_INPUT_PASSWORD"};return{sourceId:r[e]+n}}function D(){var e=login.storeInstance.getState().model.rememberProfile,t={_csrf:o.value,intent:"completeLogin",accessToken:l,"locale.x":u.value,rememberProfile:e==="true"||e===!0,login_email:h,flowId:login.utils.getFlowId(),tpdVariant:N,tpdTriggerMethod:k},n=M();n&&(t.fn_sync_data=n),login.utils.getCtxId()&&(t.ctxId=login.utils.getCtxId()),$.ajax({url:"/signin/challenge/push?intent="+login.utils.getIntent(),type:"POST",data:t,success:function(e){if(e&&e.pollStatus==="LoggedIn"&&e.returnUrl)return window.location.href=e.returnUrl;if(e&&e.pollStatus==="Failed")return A(e);O(),login.tpdLogin.instrumentTpdExpired("NO_RESPONSE")}})}function P(){if(!f)return;if(t>=e){O(),login.tpdLogin.instrumentTpdExpired("NO_ACTION");return}t++,a=$.ajax({url:"/signin/challenge/push",type:"POST",data:{_csrf:o.value,intent:"poll",accessToken:l,authflowDocumentId:c,retryCount:t,"locale.x":u.value,flowId:login.utils.getFlowId(),tpdVariant:N,tpdTriggerMethod:k},success:L,fail:function(){f&&P()}})}function H(e){e.preventDefault(),$(S).removeClass("hide")}function B(e){var n=document.querySelector("form[name=login]"),r;e=e||{},f=!0,l=e.accessToken||l,c=e.authflowDocumentId||c,h=e.email||h,t=0,N=e.variant||N,k=e.tpdTriggerMethod||k,P(),r=document.querySelector("[name=authdocId]"),r?r.setAttribute("value",c):login.utils.addHiddenElement("authdocId",c,n)}function j(){window.location.href=window.location.href}function F(e){var t=getEventTarget(e);if(!S)return;if($(t).hasClass("showSurvey"))return;$(S).addClass("hide")}function I(e){var t=getEventTarget(e),n=$(t).data("reason");e.preventDefault(),$(w).addClass("hide"),$(w).removeClass("greyOut"),q(),login.tpdLogin.instrumentUsePasswordInstead(n),p&&$(p).addClass("hide"),T&&$(T).removeClass("hide")}function q(){f=!1,a&&a.abort()}function R(){s=0,setTimeout(function(){$(w).removeClass("hide")},n)}function U(e){e.preventDefault();if($(e.target).hasClass("greyOut"))return;login.tpdLogin.instrumentResendClicked(),q(),t=0,$(w).addClass("greyOut"),s++,$.ajax({url:"/signin/challenge/push",type:"POST",data:{_csrf:o.value,intent:"resend",accessToken:l,authflowDocumentId:c,"locale.x":u.value,flowId:login.utils.getFlowId(),tpdVariant:N,tpdTriggerMethod:k},success:function(t){if(t&&t.resendStatus==="Success"){B({accessToken:l,authflowDocumentId:c,email:h}),$(w).addClass("hide"),$(E).removeClass("hide"),setTimeout(function(){$(E).addClass("hide"),s<i&&($(w).removeClass("hide"),$(w).removeClass("greyOut"))},r);return}t&&t.notifications&&login.view.updateNotificationView(t)},fail:function(){}})}function z(e){var t=document.querySelector("#moreOptionsContainer"),n=document.querySelector("#tpdButtonContainer"),r=document.querySelector('input[name="tpdEligible"]'),i=document.querySelector("form[name=login]"),s,o=document.querySelector("#btnNext");if(!e||!n||!t)return;if(e.tpdVariant||e.tpdAutoSend)r?r.value="true":(s=document.createElement("input"),s.setAttribute("type","hidden"),s.setAttribute("name","tpdEligible"),s.setAttribute("value","true"),$(i).append(s));e.tpdVariant==="moreOptions"&&($(t).removeClass("hide"),$(".forgotLink").addClass("hide")),e.tpdVariant==="tpdButton"&&($(t).addClass("hide"),$(n).removeClass("hide"),$(".forgotLink").removeClass("hide"),$("#signupContainer").addClass("hide")),e.tpdAutoSend&&(login.tpdLogin&&login.tpdLogin.instrumentTpdLoginAutoTriggered(),login.tpdLogin&&login.tpdLogin.attemptTpdLogin("autoSend")),e.splitLoginContext==="inputEmail"&&($(t).addClass("hide"),$(n).addClass("hide"),r&&r.value==="true"&&(r.value=""));if(login.utils.isTpdDemo()&&e.splitLoginContext!=="inputEmail"){var u=document.querySelector("#splitPassword");o&&$(o).addClass("hide"),u&&$(u).removeClass("hide")}else o&&$(o).removeClass("hide")}var e=9,t=0,n=5e3,r=3e3,i=3,s=0,o=document.querySelector("input[name=_csrf]"),u=document.querySelector('input[name="locale.x"]'),a,f=!1,l,c,h,p=document.querySelector("#verification"),d=document.querySelector(".verificationSubSection"),v=document.querySelector("#expired"),m=document.querySelector("#denied"),g=document.querySelector("#expiredTryAgainButton"),y=document.querySelector("#pendingNotYouLink"),b=document.querySelector("#pending #tryPasswordLink"),w=document.querySelector("#resend"),E=document.querySelector(".sentMessage"),S=document.querySelector("#passwordInsteadDropDown"),x=document.querySelector("#passwordInsteadGroup"),T=document.querySelector("#login"),N,C,k,L=function(e){e||P(),o.value=e._csrf||o.value;switch(e.pollStatus){case"Accepted":q(),C=C?!1:e.pollStatus==="Accepted",C&&(login.logger.log({evt:"TPD_CLIENT",data:"Approved_"+e.tpdTriggerMethod,calEvent:!0}),login.logger.pushLogs()),D();break;case"Downgraded":P();break;case"Denied":q(),$(d).addClass("hide"),$(m).removeClass("hide");break;case"Failed":q(),A(e);break;default:e.errorView?(O(),login.tpdLogin.instrumentTpdExpired("RCS_SERVICE_ERROR")):P()}};return g&&(g.onclick=j),y&&(y.onclick=function(e){q(),login.tpdLogin.instrumentNotYouClicked(),login.utils.notYouClickHandler(e)}),login.pubsub&&login.pubsub.subscribe("WINDOW_CLICK",F),b&&$(b).hasClass("showSurvey")?(addEvent(b,"click",H),addEvent(x,"click",I)):b&&addEvent(b,"click",I),addEvent(w,"click",U),{startPolling:B,showResendLink:R,updateView:z}}(),login.overlayUtils=function(){function t(t){eventPreventDefault(t),clearTimeout(e);var n=document.getElementById("overlaySpinner"),r=document.getElementById("overlaySpinnerSuccess"),i=$("body").data("return-url")||"/signin",o=document.getElementById("overlayOptIn");o.disabled=!0,$(r).removeClass("hide"),$(n).addClass("hide"),setTimeout(function(){s()},1300);var u;$.ajax({type:"POST",url:"/signin/provisionCapabilities/oneTouch",data:{flowId:login.utils.getFlowId(),optInSource:login.utils.getIntent()==="signin"?"overlay_dl":"overlay_xo",_csrf:document.querySelector("#token").value},dataType:"json",complete:function(){u=setInterval(function(){if($(overlayMask).hasClass("hide"))return clearInterval(u),login.logger.log({evt:"ONETOUCH",data:"REDIRECT_AFTER_ACTIVATION_RESPONSE_"+login.utils.getIntent().toUpperCase(),calEvent:!0}),login.logger.pushLogs(),window.location.href=i},100)}}),login.logger.log({evt:"flow_type",data:"onetouch",instrument:!0}),login.logger.log({evt:"actiontype",data:"turn_on",instrument:!0}),login.logger.log({evt:"state_name",data:"overlay",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_overlay",instrument:!0}),login.logger.log({evt:"ONETOUCH",data:"CLICK_OPT_IN_BUTTON_OVERLAY_"+login.utils.getIntent().toUpperCase(),calEvent:!0}),login.logger.pushLogs(),setTimeout(function(){return login.logger.log({evt:"ONETOUCH",data:"REDIRECT_WITHOUT_ACTIVATION_RESPONSE_"+login.utils.getIntent().toUpperCase(),calEvent:!0}),login.logger.pushLogs(),clearInterval(u),window.location.href=i},1e4)}function n(t){function o(e){e=e||0,setTimeout(function(){window.location.href=i||"/signin"},e)}eventPreventDefault(t),clearTimeout(e);var n={evt:"state_name",data:"FINGERPRINT_OPTIN",instrument:!0},r="WEBAUTH_N_CLIENT",i=$("body").data("return-url");login.logger.log({evt:"flow_type",data:"webauthn",instrument:!0}),login.logger.log({evt:"actiontype",data:"turn_on",instrument:!0}),login.logger.log({evt:"state_name",data:"overlay",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_overlay",instrument:!0}),login.logger.log({evt:"WEBAUTH_N_CLIENT",data:"PROCESS_OVERLAY_"+login.utils.getIntent().toUpperCase(),calEvent:!0}),login.logger.pushLogs(),s(),login.webAuthnOptInXHR().then(function(){login.logger.clientLog([n,{evt:"transition_name",data:"process_consent_XHR",instrument:!0},{evt:r,data:"BIND_SUCCESS_XHR_OVERLAY_"+login.utils.getIntent().toUpperCase(),calEvent:!0}],function(){return o()})}).catch(function(){login.logger.clientLog([n,{evt:"transition_name",data:"process_error_XHR",instrument:!0},{evt:r,data:"BIND_FAIL_XHR_OVERLAY_"+login.utils.getIntent().toUpperCase(),calEvent:!0,status:"ERROR"}],function(){return o()})})}function r(e){if($("body").data("overlay-variant")==="oneTouch")return t(e);if($("body").data("overlay-variant")==="webAuthn")return n(e)}function i(){login.logger.log({evt:"actiontype",data:"close_button",instrument:!0}),login.logger.log({evt:"flow_type",data:$("body").data("overlay-variant").toLowerCase(),instrument:!0}),login.logger.log({evt:"state_name",data:"overlay",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_overlay",instrument:!0}),login.logger.log({evt:l(),data:"CLICK_CLOSE_BUTTON_OVERLAY_"+login.utils.getIntent().toUpperCase(),calEvent:!0}),login.logger.pushLogs();var e=$("body").data("return-url"),t=document.getElementById("overlayContainer"),n=document.getElementById("overlayMask");$(t).removeClass("overlaySlideDown"),$(t).addClass("overlaySlideUp"),setTimeout(function(){return $(n).addClass("hide"),window.location.href=e||"/signin"},250)}function s(){var e=document.getElementById("overlayContainer"),t=document.getElementById("overlayMask");$(e).removeClass("overlaySlideDown"),$(e).addClass("overlaySlideUp"),setTimeout(function(){$(t).addClass("hide");return},250)}function o(){eventPreventDefault(event),clearTimeout(e);var t=document.getElementById("overlayExpandDetails"),n=document.getElementById("overlayCollapseDetails"),r=document.getElementById("overlayDetails");$(t).toggle(),$(n).toggle(),$(r).hasClass("overlaySlideUp")?($(r).removeClass("overlaySlideUp"),$(r).addClass("overlaySlideDown")):($(r).removeClass("overlaySlideDown"),$(r).addClass("overlaySlideUp"))}function u(t){var n=document.getElementById("overlayOptIn"),s=document.getElementById("overlayExpandDetails"),u=document.getElementById("overlayCollapseDetails"),a=document.getElementById("overlayClose"),f=$("body").data("return-url"),c=t&&t.closeOverlayTimeoutValue;n.onclick=r,a.onclick=i,s.onclick=o,u.onclick=o;if(!n.onclick||!a.onclick)return window.location.href=f||"/signin";var h=document.getElementById("email"),p=document.getElementById("password");h&&h.blur(),p&&p.blur();var d=document.getElementById("overlayContainer"),v=document.getElementById("overlayMask");$(v).removeClass("hide"),$(d).removeClass("overlaySlideUp"),$(d).addClass("overlaySlideDown"),login.logger.log({evt:"flow_type",data:$("body").data("overlay-variant").toLowerCase(),instrument:!0}),login.logger.log({evt:"state_name",data:"overlay",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_overlay",instrument:!0}),login.logger.log({evt:l(),data:"SHOWN_SUCCESSFULLY_OVERLAY_"+login.utils.getIntent().toUpperCase(),calEvent:!0}),login.logger.pushLogs(),a.focus(),c&&(e=setTimeout(function(){login.logger.log({evt:"flow_type",data:$("body").data("overlay-variant").toLowerCase(),instrument:!0}),login.logger.log({evt:"state_name",data:"overlay",instrument:!0}),login.logger.log({evt:"transition_name",data:"timeout_close_overlay",instrument:!0}),login.logger.log({evt:l(),data:"TIMEOUT_CLOSE_OVERLAY_AND_REDIRECT_"+login.utils.getIntent().toUpperCase(),calEvent:!0}),login.logger.pushLogs();var e=document.getElementById("overlayContainer"),t=document.getElementById("overlayMask");$(e).removeClass("overlaySlideDown"),$(e).addClass("overlaySlideUp"),setTimeout(function(){return $(t).addClass("hide"),window.location.href=f||"/signin"},250)},c))}function a(e){var t=$("body").data("overlay-variant")||"unknown",n=t==="oneTouch"&&e&&e.oneTouchOverlayPostOptinEligible,r=!!document.getElementById("overlay");return n&&!r&&(login.logger.log({evt:l(),data:"NOT_SHOWN_SINCE_TEMPLATE_NOT_LOADED_OVERLAY_"+login.utils.getIntent().toUpperCase(),calEvent:!0}),login.logger.pushLogs()),n&&r}function f(){var e=$("body").data("overlay-variant")||"unknown";return e==="webAuthn"||e==="oneTouch"?(login.logger.log({evt:l(),data:"XHR_LOGIN_ELIGIBLE_OVERLAY_"+login.utils.getIntent().toUpperCase(),calEvent:!0}),login.logger.pushLogs(),!0):!1}function l(){var e=$("body").data("overlay-variant")||"unknown",t="";switch(e){case"webAuthn":t="WEBAUTH_N_CLIENT";break;case"oneTouch":t="ONETOUCH";break;default:t="UNIFIED_LOGIN"}return t}var e;return{showOverlay:u,isEligibleToShowOverlay:a,isLoginXHREligbleForOverlay:f}}(),login.core=function(){return function(){function Q(e){var t=getEventTarget(e);if(!P||!e||!t)return;if($(t).hasClass("moreOptionsInfo")){eventPreventDefault(e),$(P).hasClass("hide")&&(login.logger.log({evt:"state_name",data:B?"begin_hybrid_pwd":"begin_pwd",instrument:!0}),login.logger.log({evt:"transition_name",data:B?"process_hybrid_pwd_more_opt":"process_pwd_more_opt",instrument:!0}),login.logger.log({evt:"TPD_CLIENT",data:"CLICKED_MORE_OPTIONS",calEvent:!0}),login.logger.pushLogs()),$(P).removeClass("hide");return}$(P).addClass("hide")}function G(e){var t=getEventTarget(e);if(!F||!e||!t)return;$(F).addClass("hide")}function Y(e){if(!a)return e;var t=a.container.querySelector(".phoneCode"),n=t&&$(t).text(),r=e.lastIndexOf(n,0)===0;return r?e.substr(n.length):e}function Z(e){if(c&&c.value==="inputPassword"&&!j)return;var t=c&&c.value==="inputEmail";!j&&t&&bt==="phone"&&(bt="email"),login.utils.doesItLookLikeEmail(e)?bt!=="email"&&(!j&&c.setAttribute("value","inputEmail"),bt="email",$(N)&&$(N).addClass("hide"),$(s.container).removeClass("phoneInputWrapper")):(f.field.value=e,bt!=="phone"&&(!j&&c.setAttribute("value","inputPhone"),bt="phone",$(N).removeClass("hide"),$(s.container).addClass("phoneInputWrapper")))}function et(){f.field.value=null,s.field.value=null,o&&$(o).addClass("hide");var e=login.storeInstance.getState().model,t=e&&e.contextualLogin&&e.contextualLogin.content&&e.contextualLogin.content.emailOrPhoneLabel;$(s.field).attr("placeholder",t),$(s.label).text(t),s.field.removeAttribute("data-hybrid-in-email-only-mode")}function tt(e){var t=getEventTarget(e),n=s.field&&$(s.field).attr("data-hybrid-in-email-only-mode")==="true";n&&bt!=="email"&&(bt="email");if(!t||n)return;login.pubsub.publish("CLEAR_OTP_LOGIN_CONTEXT"),Z(t.value)}function nt(){j&&s.field&&(login.logger.log({evt:"state_name",data:"cookied_user_change_email",instrument:!0}),login.logger.log({evt:"transition_name",data:"cookied_user_change_email",instrument:!0}),login.logger.pushLogs(),s.field.removeEventListener("input",nt))}function wt(e){if(!e||typeof e!="string")return;return e.replace(at,"")}function Et(e){return e.field?wt(e.field.value)?!0:(kt(e),Lt(e),!1):!0}function St(e){var t=e&&e.field&&e.field.value;return!e||!e.field||e.field.hasAttribute("disabled")?!0:t?(t=t&&t.replace(pt,""),!t||t.match(lt)?(kt(e),At(e),Mt(e),!1):!0):(kt(e),Lt(e),_t(e),!1)}function xt(e){var t=e&&e.field&&wt(e.field.value);return e&&e.field&&e.field.hasAttribute("disabled")?!0:t?t===ht?!0:t&&t.match(ct)?(kt(e),At(e),!1):!0:(kt(e),Lt(e),!1)}function Tt(e,t){var n,r,i=!0,s=login.utils.getActiveCaptchaElement(c);return n=Et(e),n?(r=Et(t),r?(s&&s.field&&(i=Et(s)),i?!0:!1):!1):!1}function Nt(e){if(e.value==="inputEmail")return document.querySelector("#rememberProfileEmail");if(e.value==="inputPassword")return document.querySelector("#rememberProfilePassword");return}function Ct(e){var t=e.field.value.replace(at,"");return t===ht?!0:!t.match(ft)&&!e.field.hasAttribute("disabled")?(kt(e),At(e),!1):!0}function kt(e){$(e.container).addClass("hasError"),e.container.style["z-index"]=100,$(e.errMsgContainer).addClass("show"),e.field.focus()}function Lt(e){$(e.errMsg).removeClass("hide")}function At(e){$(e.invalidMsg).removeClass("hide")}function Ot(e,t){t&&$(e.container).removeClass("hasError"),e.container.style["z-index"]=1,$(e.errMsgContainer).removeClass("show")}function Mt(e){$(e.errMsg).addClass("hide")}function _t(e){$(e.invalidMsg).addClass("hide")}function Dt(){var e,t=/\&passwordRecoveryByPhoneEnabled\=true/;if(M)for(var n=0;n<M.length;n++)e=M[n].getAttribute("href").replace(t,""),M[n].setAttribute("href",e);_&&_.setAttribute("data-src",_.getAttribute("data-src").replace(t,""))}function Pt(){var e;if(M)for(var t=0;t<M.length;t++)e=M[t].getAttribute("href")+"&passwordRecoveryByPhoneEnabled=true",M[t].setAttribute("href",e);_&&_.setAttribute("data-src",_.getAttribute("data-src")+"&passwordRecoveryByPhoneEnabled=true")}function Ht(){var e=document.querySelector('input[name="splitLoginContext"]'),t=document.querySelector('input[name="splitLoginCookiedFallback"]');$(m).removeClass("hide"),$(g).addClass("hide"),k&&$(k).addClass("hide"),s.field&&s.field.removeAttribute("disabled"),u.field&&u.field.removeAttribute("disabled"),a.field&&a.field.setAttribute("disabled","disabled"),f.field&&f.field.setAttribute("disabled","disabled"),l.field&&l.field.setAttribute("disabled","disabled"),gt||$(O).removeClass("hide"),x&&$(x).addClass("hide"),$(v).removeClass("phonePresent"),bt="email",e&&(L&&$(L).removeClass("hide"),e.value="inputEmail",t&&(e.value="inputPassword"))}function Bt(){var e=document.querySelector('input[name="splitLoginContext"]');$(g).removeClass("hide"),$(m).addClass("hide"),k&&!$(y).hasClass("hide")&&$(k).removeClass("hide"),a.field&&a.field.removeAttribute("disabled"),f.field&&f.field.removeAttribute("disabled"),l.field&&l.field.removeAttribute("disabled"),s.field&&s.field.setAttribute("disabled","disabled"),u.field&&u.field.setAttribute("disabled","disabled"),$(O).addClass("hide"),$(v).addClass("phonePresent"),E&&$(E).addClass("hide"),bt="phone",L&&$(L).addClass("hide"),e&&!gt&&(e.value=e.value==="inputPassword"?"inputPin":"inputPhone")}function jt(){function i(){var e=n.options[n.selectedIndex].value,t=e.split(" ");return{countryCode:t&&(t[0]||""),phoneCode:t&&(t[1]||"")}}var e=a.container.querySelector(".countryCode"),t=a.container.querySelector(".phoneCode"),n=a.field,r;r=i(),$(e).text(r.countryCode),$(t).text(r.phoneCode)}function Ft(){login.logger.log({evt:"state_name",data:"begin_hybrid_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"click_change_country_code",instrument:!0}),login.logger.pushLogs()}function It(e){eventPreventDefault(e);var t=document.querySelector('input[name="splitLoginContext"]'),n=document.querySelector(".countryPhoneSelectWrapper");$(g).removeClass("hide"),$(m).addClass("hide"),$(E).addClass("hide"),$(x).removeClass("hide"),Ot(s,!0),a.field&&a.field.removeAttribute("disabled"),f.field&&f.field.removeAttribute("disabled"),f.field.focus(),L&&$(L).addClass("hide"),A&&$(A).removeClass("hide"),s.field&&(s.field.value=""),login.view.updateNotificationView({}),s.field&&s.field.setAttribute("disabled","disabled"),t.value="inputPhone",login.logger.log({evt:"state_name",data:"begin_email",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_phone",instrument:!0}),login.logger.pushLogs(),login.logger.log({evt:"state_name",data:"begin_phone",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_phone",instrument:!0}),login.logger.pushLogs(),yt?(l.field&&l.field.removeAttribute("disabled"),u.field&&u.field.setAttribute("disabled","disabled"),bt="phone",$(v).addClass("phonePresent"),$(O).addClass("hide")):(u.field&&u.field.removeAttribute("disabled"),l.field&&l.field.setAttribute("disabled","disabled"),bt="phonePassword",n&&$(n).removeClass("hide"))}function qt(e){eventPreventDefault(e);var t=document.querySelector('input[name="splitLoginContext"]');$(m).removeClass("hide"),$(g).addClass("hide"),$(x).addClass("hide"),$(E).removeClass("hide"),k&&$(k).addClass("hide"),Ot(f,!0),s.field&&s.field.removeAttribute("disabled"),u.field&&u.field.removeAttribute("disabled"),s.field.focus(),a.field&&a.field.setAttribute("disabled","disabled"),f.field&&f.field.setAttribute("disabled","disabled"),l.field&&l.field.setAttribute("disabled","disabled"),A&&$(A).addClass("hide"),L&&$(L).removeClass("hide"),$(v).removeClass("phonePresent"),bt="email",t.value="inputEmail",login.logger.log({evt:"state_name",data:"begin_phone",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_email",instrument:!0}),login.logger.pushLogs(),login.logger.log({evt:"state_name",data:"begin_email",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_email",instrument:!0}),login.logger.pushLogs()}function Rt(e,t){eventPreventDefault(e),Dt(),bt="email",login.utils.notYouClickHandler(e,function(){login.logger.log({evt:"state_name",data:"begin_phone_pwd",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_email",instrument:!0}),login.logger.pushLogs(),login.logger.log({evt:"state_name",data:"begin_email",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_email",instrument:!0}),login.logger.pushLogs(),typeof t=="function"&&t()})}function Ut(e){var t=$("body").data("enableSuppressAutoSubmit")==="true",n=Date.now()-window.formAutofilledAt,r=parseInt($("body").data("suppressAutosubmitTime"))>=n,i="AUTOSUBMIT",s=document.querySelector('input[name="isKeychainActivationWithEmailTokenOn8ball"]'),o=document.querySelector("#continueInterstitial");if(o){eventPreventDefault(e);return}if(t&&n){login.logger.log({evt:i,data:"PREPARE_SUPPRESS_"+n,calEvent:!0}),login.logger.pushLogs();if(r){eventPreventDefault(e),delete window.formAutofilledAt;return}}var u=document.querySelector("input[name=splitLoginContext]"),a=document.querySelector("input[name=splitLoginCookiedFallback]"),f=u&&u.value||"";a||s?Zt(e):f==="inputEmail"||f==="inputPhone"||login.utils.isPrefilledEmailNext()||login.utils.isPrefillEmailEnabled()?Wt(e):Zt(e)}function zt(e){var t=Y(e);f.field.value=t,s.field.value=t}function Wt(e){var t,n=login.utils.getSplitLoginContext(),i=$("body").data("loginExperience")==="safari",o=login.utils.isFieldPrefilled(document.querySelector("#password")),u=i&&o;if(login.utils.isPrefillEmailEnabled()&&n.value!=="inputEmail"&&login.utils.isTpdDemo())return eventPreventDefault(e),login.tpdLogin&&login.tpdLogin.attemptTpdLogin("autoSend");B?(bt==="phone"&&s.field&&zt(s.field.value),t=bt==="email"?xt(s):St(s)):t=bt==="email"?xt(s):St(f);var a=document.querySelectorAll("form[name=login] input"),l={};l.isSafariAutofill=u;var p=login.utils.getActiveCaptchaElement(c),d=Nt(c),v=$("body").data("splitPasswordClientTransition"),m,g,y,b,w=document.querySelector("#phoneCode");dt=!0,eventPreventDefault(e),t&&$(s.field).hasClass("validate")&&n==="inputEmail"&&(t=Ct(s)),t&&p&&p.field&&(t=Et(p)),t&&(n==="inputEmail"||n==="inputPhone")&&(login.logger.log({evt:"state_name",data:login.logger.getStateName(),instrument:!0}),login.logger.log({evt:"transition_name",data:"process_next",instrument:!0}),login.logger.pushLogs());if(!t)return;login.utils.showSpinner(),login.fn.addFnSyncData(),(bt==="phonePassword"||bt==="phone")&&Pt(),r&&$(r).text("");if(!(!v||bt!=="phone"&&bt!=="phonePassword")){m=document.querySelector("#phone"),g=m&&m.value.replace(pt,""),y=document.querySelector("#phoneCode"),y=y&&y.value.replace(/[A-Z\s]/ig,""),m.value=g,login.storeInstance.updateModel({splitLoginContext:yt?"inputPin":"inputPassword",profile:{phone:g,phoneCode:y}}),login.logger.log({evt:"state_name",data:"begin_phone",instrument:!0}),login.logger.log({evt:"transition_name",data:yt?"prepare_pin":"prepare_pwd",instrument:!0}),login.logger.pushLogs(),login.utils.hideSpinner(),login.utils.setSliderToPasswordContainer();return}if(v&&bt==="email"){login.storeInstance.updateModel({splitLoginContext:"inputPassword",profile:{email:s&&s.field&&s.field.value},rememberProfile:d&&d.checked}),login.utils.hideSpinner(),login.utils.setSliderToPasswordContainer();return}for(var E=0;E<a.length;E++)l[a[E].name]=a[E].value;delete l.login_password,delete l.login_pin,l.splitLoginContext==="inputPhone"&&w&&(l.phoneCode=w.value,delete l.login_email),l.splitLoginContext==="inputEmail"&&(delete l.login_phone,delete l.phoneCode),B&&(l.splitLoginContext==="inputPassword"&&l.login_phone&&(l.phoneCode=w.value),l.splitLoginContext==="inputPhone"&&s.field?(s.field.setAttribute("disabled","disabled"),s.field.value=""):l.splitLoginContext==="inputEmail"&&f.field&&(f.field.setAttribute("disabled","disabled"),f.field.value="")),p&&p.field&&(l.captcha=p.field.value),d&&(l.rememberProfile=d.checked),login.utils.isInContextIntegration()&&(l.isInContextCheckout=!0),b=getEventTarget(e),$.ajax({url:h.getAttribute("action"),data:l,success:login.utils.successfulXhrHandler,fail:login.utils.failedXhrSubmitHandler})}function Xt(){var e=document.querySelector('input[name="splitLoginCookiedFallback"]'),t=document.querySelector("#phone"),n=document.querySelector("#email"),r=document.querySelector(".profileDisplayEmail"),i=r&&r.innerHTML;if(!i||e||!n||!t)return;n.hasAttribute("disabled")&&!t.hasAttribute("disabled")?(t.value=i,n.value=""):!n.hasAttribute("disabled")&&t.hasAttribute("disabled")&&(n.value=i,t.value="")}function Vt(){bt==="email"?f&&f.field&&f.field.setAttribute("disabled","disabled"):s&&s.field&&s.field.setAttribute("disabled","disabled")}function $t(){var e=document.querySelector("form[name=login]"),t=document.querySelector("#password"),n=document.querySelector("#btnLogin"),r=t.matches(":-webkit-autofill");if(r&&Object.prototype.hasOwnProperty.call(window,"getComputedStyle")){var i=window.getComputedStyle(t),s=i.backgroundColor,o=(s.match(/[0-5]{1,3}/g)||[]).join(",");login.utils.addHiddenElement("passwordFieldAutofillColor",o,e)}}function Jt(e,t,n,r){var i=document.querySelector(".profileDisplayPhoneCode"),s=document.querySelector("#keepMeLoggedIn"),o=s&&s.checked,u=document.querySelector("#phoneCode"),a={};for(var f=0;f<e.length;f++){if(e[f].disabled)continue;a[e[f].name]=e[f].value}return o?a.rememberMe="true":delete a.rememberMe,a.splitLoginContext==="inputPassword"&&a.login_phone&&u&&(a.phoneCode=u.value,delete a.login_email),a.splitLoginContext==="inputPassword"&&!a.login_phone&&i&&i.textContent===""&&(delete a.login_phone,delete a.phoneCode),r&&a.splitLoginContext==="inputPassword"&&a.login_phone&&i&&i.textContent!==""&&(a.phoneCode=i.textContent),a}function Kt(e){e=e||{};var t=document.querySelector("#keychain-interstitial"),r=document.querySelector("#content"),i=e.isSuaRequired,s=e.isKeychainOptinRequired,o=e.returnUrl||"/signin";d&&d.removeAttribute("disabled"),o&&document.body.setAttribute("data-return-url",o);if(login.overlayUtils.isEligibleToShowOverlay(e)&&(!e.notifications||!e.notifications.msg))return login.logger.log({evt:n,data:"XHR_LOGIN_SUCCESS",calEvent:!0}),login.logger.pushLogs(),login.overlayUtils.showOverlay(e);if(i&&o)return login.utils.hideSpinner(),login.utils.hideSpinnerMessage(),login.logger.log({evt:n,data:"XHR_LOGIN_SUCCESS",calEvent:!0}),login.logger.pushLogs(),login.sua(e);if(s&&o)return login.utils.hideSpinner(),login.utils.hideSpinnerMessage(),t&&$(t).removeClass("hide"),r&&$(r).addClass("hide"),login.logger.log({evt:n,data:"XHR_LOGIN_SUCCESS",calEvent:!0}),login.logger.pushLogs(),login.keychain(e);if(o&&!e.notifications)return login.logger.log({evt:n,data:"XHR_LOGIN_SUCCESS",calEvent:!0}),login.logger.pushLogs(),window.location.href=o;e.showSpinnerUpfront||(login.utils.hideSpinner(),login.utils.hideSpinnerMessage());if(e.notifications&&e.notifications.msg){var a=document.querySelector(".notifications"),f=document.createElement("p");f.innerHTML=e.notifications.msg,f.className+="notification "+(e.notifications.type||""),f.setAttribute("role","alert"),a.innerHTML="",a.appendChild(f)}u.field&&(u.field.value="");var l=document.querySelector("#emailPageSwitch");return l&&addEvent(l,"click",function(e){eventPreventDefault(e),bt="email",login.utils.switchToEmailHandler(e)}),login.logger.log({evt:n,data:"XHR_LOGIN_FAILURE",calEvent:!0}),login.otp&&login.otp.prepareSendPage(e),login.geoEnablement&&login.geoEnablement.setGeoMessage(e),login.logger.pushLogs()}function Qt(){login.utils.hideSpinner(),login.utils.hideSpinnerMessage(),d&&d.removeAttribute("disabled"),u.field&&(u.field.value=""),login.logger.log({evt:n,data:"XHR_FAILED",calEvent:!0}),login.logger.pushLogs(),login.utils.failedXhrSubmitHandler()}function Gt(e){var e=e||{};e._csrf=document.querySelector("#token").value,login.utils.showSpinner(),$.ajax({type:"POST",url:"/signin",data:e,dataType:"json",success:function(e){return e?(login.utils.setCSRFToken(e._csrf),Kt(e)):Qt()},fail:function(e){return Qt(e)}})}function Yt(){var e=login.utils.parseJsonSafe($("body").data("keychainFlagsJson"))||{},t=e.isEligibleForXhrLogin,n=document.querySelector('input[name="isKeychainActivationWithEmailTokenOn8ball"]'),r=document.querySelector('input[name="appleIdpJson"]')||{},i=login.utils.parseJsonSafe(r.value)||{};return login.utils.isCookieDisabledBrowser()||i.isOptin?!1:$("body").data("webAuthnOptinEligible")?!1:login.overlayUtils.isLoginXHREligbleForOverlay()?!0:t&&!n}function Zt(e){function m(){var e=c&&c.value;if(!f.field)return;j?n=St(s)&&u.field&&Tt(f,u):e==="inputPassword"?n=u.field&&Tt(f,u):n=l.field&&Tt(f,l)}var n,r=document.querySelector(".profileRememberedEmail"),i=$("body").data("isTrackPasswordFieldAutofillEnabled"),o=document.querySelector(".transitioning"),a=document.querySelectorAll("form[name=login] [name]:not(button)")||{},p=login.utils.getActiveCaptchaElement(c),v=Nt(c);j&&bt==="phone"&&s.field?zt(s.field.value):Xt(),dt=!0,bt==="email"?(n=xt(s)&&Tt(s,u),!r&&n&&$(s.field).hasClass("validate")&&(n=Ct(s))):m(),i&&$t();if(document.readyState!=="complete")return setTimeout(function(){Zt(e)},10);if(n){if(U){if(W||X)return setTimeout(function(){Zt(e)},10);V=!1,u.field.value=z,u.field.name="encrypted_password",login.logger.log({evt:"GEO_ENABLEMENT",data:"LOGIN_WITH_ENCRYPTED_PASSWORD",calEvent:!0}),login.logger.log({evt:"login_password_type",data:"encrypted_password",instrument:!0})}j&&Vt(),login.utils.showSpinner(),login.utils.showSpinnerMessage(),login.fn.addFnSyncData(),eventPreventDefault(e);if(Yt()){login.logger.log({evt:"login_type",data:"xhr",instrument:!0}),login.logger.log({evt:t,data:"LOGIN_TYPE_XHR",calEvent:!0}),login.logger.pushLogs(),$(o).addClass("nonTransparentMask"),login.utils.showSpinnerMessage("checkingInfo");var g=p&&p.field?p.field.value:null,y=v?v.checked:null,b=Jt(a,g,y,B);return Gt(b)}login.logger.log({evt:"login_type",data:"form_submit",instrument:!0}),login.logger.log({evt:t,data:"LOGIN_TYPE_FORM_SUBMIT",calEvent:!0}),login.logger.pushLogs(),h&&h.submit(),setTimeout(function(){d.setAttribute("disabled","disabled")},10)}else eventPreventDefault(e)}function en(e){var t;if(!dt)return!1;t=e.field.value.replace(at,"");if(t===""){Lt(e),e.type==="email"&&_t(e);return}Mt(e),e.type==="email"&&$(e.field).hasClass("validate")?t.match(ft)?(_t(e),Ot(e,!0)):(kt(e),At(e)):Ot(e,!0)}function tn(e){dt=!1,Ot(e)}function nn(e){$(e.container).hasClass("hasError")?dt=!0:dt=!1}function rn(){var e=f.field&&f.field.value;return f.field&&$(f.field).attr("type")!=="hidden"&&(s.field&&s.field.hasAttribute("disabled")||c&&c.value==="inputPhone")?yt?"phone":"phonePassword":c&&c.value==="inputPin"||e?"phone":"email"}function sn(e){var t=login.utils.getActiveCaptchaElement(c),n=t.audioTag,r=!!n.canPlayType&&!!n.canPlayType("audio/mpeg").replace(/no/,"");if(!r)return!0;eventPreventDefault(e),t.field.focus(),n.play()}function on(e){var t=login.utils.getActiveCaptchaElement(c);eventPreventDefault(e),eventStopPropagation(e),$.ajax({type:"POST",url:"/signin/refreshCaptcha",data:{_csrf:document.querySelector("#token").value},dataType:"json",success:function(e){e&&e.captcha&&(t.image.setAttribute("src",e.captcha.captchaImgUrl),t.audioTag.setAttribute("src",e.captcha.captchaAudioUrl),t.playAudioBtn.setAttribute("href",e.captcha.captchaAudioUrl),t.field.value="",$("body").hasClass("desktop")&&t.field.focus())}})}function un(e){var t=getEventTarget(e);if(!t)return;setTimeout(function(){$(t).hasClass("scTrack:unifiedlogin-rememberme-profile-opt-in")?($(t).removeClass("scTrack:unifiedlogin-rememberme-profile-opt-in"),$(t).addClass("scTrack:unifiedlogin-rememberme-profile-opt-out")):($(t).removeClass("scTrack:unifiedlogin-rememberme-profile-opt-out"),$(t).addClass("scTrack:unifiedlogin-rememberme-profile-opt-in"))},10)}function an(){function n(e){e.playAudioBtn.onclick=sn,e.refreshCaptchaBtn.onclick=on,e.field.onkeyup=en.bind(null,e),e.field.onblur=tn.bind(null,e),e.field.onfocus=nn.bind(null,e)}var e=document.querySelectorAll(".captcha-container");for(var t=0;t<e.length;t++)n(login.utils.getCaptchaDom(e[t]))}function fn(e){var t=getEventTarget(e),n,r,i;if(!t||t.id!=="iconCloseEducation")return;n=document.querySelector(".educationMessage");if(!n)return;r=document.querySelector(".contentContainer"),$(n).addClass("hide"),r&&$(r).removeClass("contentContainerShort"),i=document.createElement("input"),i.setAttribute("type","hidden"),i.setAttribute("name","removeEducationMsg"),i.setAttribute("value","true"),$(h).append(i)}function ln(e){var t=bt==="email"?xt(s):St(f),n=getEventTarget(e);eventPreventDefault(e),login.tpdLogin&&login.tpdLogin.instrumentTpdLoginClicked(n.id),document.body.setAttribute("data-tpd-survey-enabled",!1),t&&$(s.field).hasClass("validate")&&(t=Ct(s));if(!t)return;login.tpdLogin&&login.tpdLogin.attemptTpdLogin(n.id)}function cn(e,t){Dt(),bt="email",login.utils.notYouClickHandler(e,t),s.container&&Ot(s,!0),u.container&&Ot(u,!0),f.container&&Ot(f,!0),l.container&&Ot(l,!0)}function hn(){login.logger.log({evt:"user_action",data:"saml_link_clicked",instrument:!0}),login.logger.pushLogs()}var t="UNIFIED_LOGIN",n="XHR_LOGIN",r=document.querySelector("#notifications"),i=document.querySelector('input[name="splitLoginCookiedFallback"]'),s={container:document.querySelector("#login_emaildiv"),field:document.querySelector("#email"),label:document.querySelector('label[for="email"]'),errMsgContainer:document.querySelector("#emailErrorMessage"),errMsg:document.querySelector("#emailErrorMessage .emptyError"),invalidMsg:document.querySelector("#emailErrorMessage .invalidError"),phoneEmailToggleIcon:document.querySelector("#login_emaildiv .icon"),type:"email"},o=document.querySelector(".textInputMask.email"),u={container:document.querySelector("#login_passworddiv"),field:document.querySelector("#password"),errMsgContainer:document.querySelector("#passwordErrorMessage"),errMsg:document.querySelector("#passwordErrorMessage .emptyError")},a={container:document.querySelector("#pinSection")||document.querySelector(".splitPhoneSection"),field:document.querySelector("#phoneCode")},f={container:document.querySelector("#login_phonediv"),field:document.querySelector("#phone"),errMsgContainer:document.querySelector("#phoneErrorMessage"),errMsg:document.querySelector("#phoneErrorMessage .emptyError"),invalidMsg:document.querySelector("#phoneErrorMessage .invalidError")},l={container:document.querySelector("#login_pindiv"),field:document.querySelector("#pin"),errMsgContainer:document.querySelector("#pinErrorMessage"),errMsg:document.querySelector("#pinErrorMessage .emptyError")},c=document.querySelector("input[name=splitLoginContext]"),h=document.querySelector(".proceed"),p=document.querySelector("#btnNext"),d=document.querySelector("#btnLogin"),v=document.querySelector(".actions"),m=document.querySelector("#splitEmailSection")||document.querySelector("#passwordSection"),g=document.querySelector("#splitPhoneSection")||document.querySelector("#pinSection"),y=document.querySelector("#splitPassword")||document.querySelector("#splitPinSection")||document.querySelector("#pinSection"),b=document.querySelector(".email"),w=document.querySelector(".phone"),E=document.querySelector("#loginWithPhoneOption"),S=document.querySelector("#switchToPhone"),x=document.querySelector("#loginWithEmailOption"),T=document.querySelector("#switchToEmail"),N=document.querySelector(".countryPhoneSelectWrapper"),C=document.querySelector("#emailPageSwitch"),k=document.querySelector(".educationMessage"),L=document.querySelector("#emailSubTagLine"),A=document.querySelector("#phoneSubTagLine"),O=document.querySelector(".forgotLink"),M=O&&O.querySelectorAll(".pwrLink"),_=O&&O.querySelector("#pwdIframe"),D=document.querySelector("#moreOptionsMobile"),P=document.querySelector("#moreOptionsDropDown"),H=document.querySelector("#tpdButton"),B=login.utils.isHybridLoginExperience(),j=login.utils.isHybridEditableOnCookied(),F=document.querySelector("#tpdDemo"),I=document.querySelector('input[name="ctxId"]'),q=document.querySelector(".keepMeLogin"),R=document.querySelector("#samlSsoLogin"),U=document.body.hasAttribute("data-stspublickey"),z="",W=!0,X=!1,V=!0;if(U){U=document.body.getAttribute("data-stspublickey");var J=document.body.getAttribute("data-sm2PublicKey");u.field.addEventListener("copy",function(e){e.preventDefault()}),u.field.addEventListener("paste",function(e){e.preventDefault()}),document.querySelector(".showPassword").style.display="none";function K(e){function t(e){var t=new TextEncoder;return t.encode(e)}function n(e){return btoa(String.fromCharCode.apply(null,new Uint8Array(e)))}function r(e){var t=n(e);z=t,X=!1}function i(n){if(X||!V)return;X=!0;if(J){const i=J,s=1,o=sm2.doEncrypt(n,i,s);z=btoa(o),X=!1}else window.crypto.subtle.encrypt({name:"RSA-OAEP"},e,t(n)).then(r).catch(function(e){throw new Error(e)})}addEvent(u.field,"keyup",function(e){i(e.target.value)}),u.field.value&&!X&&V&&i(u.field.value),W=!1}window.crypto.subtle.importKey("jwk",JSON.parse(U),{name:"RSA-OAEP",hash:{name:"SHA-256"}},!0,["encrypt"]).then(K).catch(function(e){throw new Error(e)})}login.utils.isCookieDisabledBrowser()&&q&&$(q).addClass("hide"),R&&(login.logger.log({evt:"is_saml_link_shown",data:"y",instrument:!0}),login.logger.pushLogs()),B&&(addEvent(s.field,"input",tt),addEvent(s.field,"change",tt),addEvent(s.field,"input",nt),addEvent(R,"click",hn)),j&&Z(s.field.value),login.pubsub&&(login.pubsub.subscribe("WINDOW_CLICK",Q),login.pubsub.subscribe("WINDOW_CLICK",G));var rt=document.querySelector("#createAccount");rt&&(rt.onclick=function(e){var t=login.logger.getStateName();login.utils.getOutboundLinksHandler(rt,t,"process_signup")(e)});var it=document.querySelector("#backToInputEmailLink"),st=document.querySelector("#ssoInterstitialBackToInputEmailLink"),ot=document.querySelector("#backToEmailPasswordLink"),ut=document.querySelector("#rememberProfileEmail"),at=/^\s+|\s+$/,ft=/^\S+@\S+\.\S+$/,lt=/[^\d]+/g,ct=/\s/g,ht="PayPal One Touchâ„¢",pt=/[-().\s]/ig,dt=!1,vt=document.querySelector("form[name=smartlockForm]"),mt=document.querySelector("#secondaryLoginBtn"),gt=$("body").data("phonePasswordEnabled"),yt=$("body").data("phonePinEnabled"),bt=rn();s.field&&(s.field.onkeyup=en.bind(null,s),s.field.onblur=tn.bind(null,s),s.field.onfocus=nn.bind(null,s)),u.field&&(u.field.onkeyup=en.bind(null,u),u.field.onblur=tn.bind(null,u),u.field.onfocus=nn.bind(null,u)),f.field&&(f.field.onkeyup=en.bind(null,f),f.field.onblur=tn.bind(null,f),f.field.onfocus=nn.bind(null,f)),l.field&&(l.field.onkeyup=en.bind(null,l),l.field.onblur=tn.bind(null,l),l.field.onfocus=nn.bind(null,l)),a&&a.field&&(a.field.onchange=jt,B&&(a.field.onclick=Ft)),an(),b&&w?(b.onclick=Ht,w.onclick=Bt):b&&(b.onclick=Rt),gt&&S&&(S.onclick=It),gt&&T&&(T.onclick=qt),addEvent(N,"focusin",function(e){$(N).addClass("focus")}),addEvent(N,"focusout",function(e){$(N).removeClass("focus")}),C&&addEvent(C,"click",function(e){eventPreventDefault(e),bt="email",login.utils.switchToEmailHandler(e)}),addEvent(h,"keydown",function(e){var t=getEventTarget(e);isEnterKeyPressed(e)&&!t.href&&!$(t).hasClass("show-hide-password")&&Ut(e)}),addEvent(h,"submit",Ut),D&&addEvent(D,"click",ln),H&&addEvent(H,"click",ln),it&&addEvent(it,"click",function(e){cn(e,function(){var e=document.querySelector(".onboardingFlowContentKey"),t=document.querySelector(".pwdContentKey"),n=$("body").data("pwdContentKeyExists");n&&($(e).removeClass("hide"),$(t).addClass("hide"))}),B&&et()}),st&&addEvent(st,"click",function(e){cn(e,function(){var e=document.querySelector("#ssoInterstitialContainer"),t=$("#content");e&&t&&(e.remove(),t.removeClass("hide")),B&&et()})}),ot&&addEvent(ot,"click",function(e){e.preventDefault(),i?Ht():cn(e)}),ut&&(ut.onclick=un),login.pubsub&&login.pubsub.subscribe("WINDOW_CLICK",fn)}}(),login.oneTouchLogin=function(){function o(){var t=[],r=document.querySelector('input[name="locale.x"]');t.push({evt:"state_name",data:"Login_UL_RM",instrument:!0}),t.push({evt:"transition_name",data:"prepare_login_UL_RM",instrument:!0}),t.push({evt:"design",data:e.isInContextIntegration()?"in-context":"full-context",instrument:!0}),r&&t.push({evt:"page_lang",data:r.value,instrument:!0}),t.push({evt:i,data:"PREPARE_PAGE_"+s.toUpperCase(),calEvent:!0}),n.clientLog(t,null)}function u(e,t){var n=document.querySelector(".notifications"),r,i;n&&(r=document.createElement("p"),i=document.createTextNode(e),r.setAttribute("class","notification "+t),r.setAttribute("role","alert"),r.appendChild(i),n.appendChild(r))}function a(){var n=document.querySelectorAll("form[name=login] input[type=hidden]"),r=document.querySelector("input[name=login_email]"),i=document.querySelector("input[name=login_password]"),s=$("body").data("oneTouchUser"),a=$("body").data("oneTouchTenant"),f=login.utils.getIntent(),l=$("body").data("cookieBannerEnabled"),c=$("body").data("isKeychainOptinRequired"),h=!1,p={_csrf:1,intent:1,flowId:1,ctxId:1,returnUri:1,state:1,"locale.x":1,fn_sync_data:1},d={},v;for(var m=0;m<n.length;m++)p[n[m].name]&&(d[n[m].name]=n[m].value);if(!d.intent||f!=="prox"&&!d.returnUri||!s){e.hideSpinner(),autoLoginfallBackClientLog();return}d.otLoginIntent=d.intent,d.login_email=r&&r.value,a&&(d.oneTouchTenant=a),e.showSpinner(),o(),$("body").data("xhrTimeoutEnable")&&e.isSpinnerShown()&&!e.isUserAgentIneligibleForTimeout()&&(h=!0),$("#keepMeLogin")&&$("#keepMeLogin").addClass("hide"),v=$("body").data("loadStartTime"),$.ajax({url:"/signin/ot-token",method:"POST",data:d,timeoutEnable:h,success:function(n){var s;r&&r.removeAttribute("disabled"),i&&i.removeAttribute("disabled");if(n.keychainDeviceToken&&login.keychain)return login.keychain(n);if(n.smartlockOptIn&&login.smartLock){login.smartLock(n);return}if(n.incompleteContext){window.location.href=window.location.href;return}if(n.returnUrl){login.utils.logCPLData({startTime:v,status:"success",flowName:"One Touch"}),window.location.href=n.returnUrl;return}s=n.notifications,s&&u(s.msg,s.type),e.hideSpinner(),e.hideSpinnerMessage("secureMessage"),e.hideSpinnerMessage("oneTouchMessage"),autoLoginfallBackClientLog({error_code:"ot_login_failed"}),l&&t&&t.showCookieBanner()},fail:function(n){e.hideSpinner(),login.utils.logCPLData({startTime:v,status:"failure",flowName:"One Touch"}),r&&r.removeAttribute("disabled"),i&&i.removeAttribute("disabled"),e.hideSpinnerMessage("secureMessage"),e.hideSpinnerMessage("oneTouchMessage"),autoLoginfallBackClientLog({error_code:"ot_login_xhr_fail"}),l&&t&&t.showCookieBanner()}})}var e=login.utils,t=login.loadResources,n=login.logger,r=window.PAYPAL.ulData||{},i="ONETOUCH_LOGIN",s=e.getIntent();return function(){var i=$("body").data("oneTouchUser"),s=$("body").data("isKeychainOptinRequired")==="true",o=$("body").data("tpdAutoSend"),u=$("body").data("otpCookiedAutoSend"),f=r.aPayAuth,l=$("body").data("enableFnSyncPayloadOnOneTouch");l&&(n.log({evt:"FN_PAYLOAD",data:"send_fn_sync_data",instrument:!0}),n.pushLogs(),login.fn.addFnSyncData());if(!f&&i){a();return}if(f&&r.canNotMakePayment){a();return}!o&&!isAPaySupported()&&!i&&!s&&!u&&e.hideSpinner()}}(),login.showHidePassword=function(){function e(e,t){function s(){$(n).addClass("hide"),$(r).addClass("hide")}function o(e){t==="tel"?$(i).removeClass("tel-password"):i.setAttribute("type",t),$(n).addClass("hide"),$(r).removeClass("hide"),i.focus(),e.stopPropagation(),login.logger.log({evt:"is_pwd_sh",data:"Y",instrument:!0}),login.logger.pushLogs()}function u(e){t==="tel"?$(i).addClass("tel-password"):i.setAttribute("type","password"),$(n).removeClass("hide"),$(r).addClass("hide"),i.focus(),e.stopPropagation(),login.logger.log({evt:"is_pwd_sh",data:"N",instrument:!0}),login.logger.pushLogs()}function a(e){s();if(login.utils.isFieldPrefilled(i)||i&&i.value&&i.value.length>0)t==="text"?i.getAttribute("type")==="password"?$(n).removeClass("hide"):$(r).removeClass("hide"):$(i).hasClass("tel-password")?$(n).removeClass("hide"):$(r).removeClass("hide");e.stopPropagation()}var n=e.querySelector(".showPassword"),r=e.querySelector(".hidePassword"),i=e.querySelector(".pin-password");t=t||"text",t==="tel"&&$(i).addClass("tel-password"),n.onclick=o,r.onclick=u,i.onfocus=a,addEvent(i,"keyup",a),i.onclick=function(e){e.stopPropagation()},window.onclick=s}return function(){var n=document.querySelector("#signUpSection"),r=document.querySelector("#passwordSection"),i=document.querySelector("#pinSection")||document.querySelector("#splitPinSection"),s;i&&(s=i.querySelector(".pin-password")),n&&e(n),r&&e(r),i&&s&&e(i,s.getAttribute("type")==="tel"?"tel":"text")}}(),login.oneTouch=function(){return function(){var t=document.querySelector(".keepMeLoginAbout"),n=document.getElementById("keepMeLoginTerms"),r=document.querySelector(".keepMeLogin .tagLine"),i=login.utils.getKmliCb(),s="scTrack:unifiedlogin-rememberme-about-open",o="scTrack:unifiedlogin-rememberme-about-close",u="scTrack:unifiedlogin-rememberme-opt-in",a="scTrack:unifiedlogin-rememberme-opt-out";if(!i||!t||!n)return;t.setAttribute("href","#"),t.onclick=function(){$(n).hasClass("slideUp")?($(n).removeClass("slideUp"),$(n).addClass("slideDown"),$(t).attr("aria-expanded","true"),setTimeout(function(){$(t).removeClass(s),$(t).addClass(o)},10)):($(n).removeClass("slideDown"),$(n).addClass("slideUp"),$(t).attr("aria-expanded","false"),setTimeout(function(){$(t).removeClass(o),$(t).addClass(s)},10)),t.focus(),r&&$(r).toggle(),setTimeout(function(){window.dispatchEvent&&window.dispatchEvent(createNewEvent("resize"))},200)},i.onclick=function(){setTimeout(function(){$(i).hasClass(u)?($(i).removeClass(u),$(i).addClass(a)):($(i).removeClass(a),$(i).addClass(u))},10)}}}(),login.footer=function(){function n(){var e=document.querySelector(".footer"),t=document.querySelector(".activeContent"),n=document.querySelector("#returnToMerchant"),r,i,s=n&&$(n).outerHeight()||0;r=$(t).outerHeight()+$(e).outerHeight()+s,i=window.innerHeight||document.documentElement&&document.documentElement.clientHeight||window.screen&&window.screen.height||document.height||document.body&&document.body.offsetHeight,i<r?$(e).addClass("footerStayPut"):$(e).removeClass("footerStayPut")}var e=document.querySelectorAll(".localeSelector li a");for(var t=0;t<e.length;t++)e[t].onclick=login.utils.getOutboundLinksHandler(e[t],null,"process_language_change");return function(){n(),addEvent(window,"resize",n)}}(),login.pwr=function(){return function(){function o(e){e.preventDefault(),s=document.createElement("div"),s.className="modal-underlay",document.body.appendChild(s),n.style.display="block",setTimeout(function(){s.style.opacity=.7,n.style.opacity=1},0),r.setAttribute("src",$(r).data("src")),r.focus(),r.onload=function(){a(),r.focus()},login.logger.log({evt:"state_name",data:login.logger.getStateName(),instrument:!0}),login.logger.log({evt:"transition_name",data:"process_password_recovery",instrument:!0}),login.logger.pushLogs()}function u(){var e=document.querySelector(".modal-underlay");document.body.removeChild(e),n.style.display="none",r.setAttribute("src","about:blank"),r.setAttribute("title","pwdIframe"),t&&t.length>0&&t[1].focus()}function a(){var e=window.innerHeight||document.documentElement.clientHeight;e<=n.clientHeight?(n.style.transform="translate(-50%, 0%)",n.style.top=0):(n.style.transform="translate(-50%, -50%)",n.style.top="50%")}var t=document.querySelectorAll(".startPwrFlowBtn"),n=document.getElementById("password-recovery-modal"),r=document.getElementById("pwdIframe"),i,s;r&&login.utils.isInIframe()&&r.setAttribute("target","_blank");if(n&&t&&t.length>0&&!login.utils.isInIframe()){i=document.createElement("button"),i.className="ui-dialog-titlebar-close",i.setAttribute("type","button"),i.setAttribute("alt","Close"),n.appendChild(i);for(var f=0;f<t.length;f++)addEvent(t[f],"click",o);i.onclick=u,addEvent(r,"focusout",function(e){e.preventDefault(),i.focus()}),i.onkeydown=function(e){e.which===9&&r.focus()},addEvent(window,"resize",a)}}}(),login.authCaptcha=function(){return function(t){function a(e){e.preventDefault(),e.stopPropagation(),$.ajax({method:"GET",url:"/auth/refreshcaptcha",success:function(e){e!=="undefined"&&($(".captcha-container img").attr("src",e.captchaImgUrl),$(".captcha-container .audio a").attr("href",e.captchaAudioUrl),$(".captcha-container input").val(""),$("#captchaPlayer").attr("src",e.captchaAudioUrl),$("body").hasClass("desktop")&&$(".captcha-container input").focus())}})}function f(e){var t=document.getElementById("captchaPlayer"),n=!!t.canPlayType&&!!t.canPlayType("audio/mpeg;").replace(/no/,"");if(!n)return!0;e.preventDefault(),$(".captcha-container input").focus(),t.play()}function l(e){$(e.container).addClass("hasError"),e.container.style["z-index"]=100,$(e.errMsgContainer).addClass("show"),e.field.focus()}function c(e){$(e.errMsg).removeClass("hide")}function h(e){$(e.errMsg).addClass("hide")}function p(e){return e.field&&typeof e.field.value=="string"&&!e.field.value.trim()?(l(e),c(e),!1):!0}function d(e){var n=!0;return e&&e.field&&!t&&(n=p(e)),n}function v(e){return e?{container:e.querySelector("div.textInput"),field:e.querySelector("input[type=text]"),errMsgContainer:e.querySelector("div.errorMessage"),errMsg:e.querySelector("div.errorMessage .emptyError")}:null}function m(e){var t=d(o),n=document.querySelector("form[name=challenge]"),r={};u=!0,e&&eventPreventDefault(e);if(!t)return;login.utils.showSpinner();for(var i=0;i<n.length;i++)r[n[i].name]=n[i].value;$.ajax({url:s.getAttribute("action"),data:r,success:login.utils.successfulXhrHandler,fail:login.utils.failedXhrSubmitHandler})}function g(e){$(e.container).hasClass("hasError")?u=!0:u=!1}function y(e,t){t&&$(e.container).removeClass("hasError"),e.container.style["z-index"]=1,$(e.errMsgContainer).removeClass("show")}function b(e){u=!1,y(e)}function w(e){var t=e.field.value.trim();if(!u)return!1;t===""?c(e):(h(e),y(e,!0))}var n=document.querySelector(".captchaRefresh"),r=document.querySelector(".captchaPlay"),i=document.querySelector("#captcha"),s=document.querySelector("#ads-container form"),o=v(i),u=!1;if(t){m();return}n.onclick=a,r.onclick=f,s.onsubmit=m,o.field.onfocus=g.bind(null,o),o.field.onblur=b.bind(null,o),o.field.onkeyup=w.bind(null,o)}}(),login.ads=function(){function init(e){var t,n=e||$("body").data("adsChallengeUrl");$.ajax({url:n,method:"GET",success:function(e){t=document.createElement("script"),t.id="ads",t.type="text/javascript",t.setAttribute("nonce",$("body").data("nonce")),t.text=e.replace(/<\/?(html|body|script)>/g,""),document.body.appendChild(t)},fail:function(e){}})}function handleAdsInterception(htmlResponse){var isAutoSubmit=!0,adsContainerId="ads-container",adsContainerDiv,scriptNodes,adsCaptchaType;document.getElementById("ads-container")&&document.getElementById("ads-container").parentNode.removeChild(document.getElementById("ads-container")),adsContainerDiv=document.createElement("div"),adsContainerDiv.setAttribute("id",adsContainerId),adsContainerDiv.innerHTML=htmlResponse,$("#main").append(adsContainerDiv),scriptNodes=adsContainerDiv.getElementsByTagName("script");for(var i=0;i<scriptNodes.length;i++)eval.call(this,scriptNodes[i].innerHTML);typeof autosubmit!="undefined"&&(isAutoSubmit=autosubmit),typeof captchatype!="undefined"&&(adsCaptchaType=captchatype),isAutoSubmit?document.getElementById("ads-container").style.display="none":$("#login").addClass("hide"),typeof login.authCaptcha=="function"&&login.authCaptcha(isAutoSubmit),isAutoSubmit||(login.utils.hideSpinner(),login.utils.hideSpinnerMessage()),login.logger.log({evt:"ads_state_name",data:isAutoSubmit?"pre_jschallenge_served":adsCaptchaType,instrument:!0}),login.logger.pushLogs()}return{init:init,handleAdsInterception:handleAdsInterception}}(),login.tpdLogin=function(){function n(e){var t={};if(!e)return;login.logger.log({evt:"state_name",data:e.stateName,instrument:!0}),login.logger.log({evt:"transition_name",data:e.transitionName,instrument:!0}),e.calName&&login.logger.log({evt:"TPD_CLIENT",data:e.calName,calEvent:!0}),login.logger.pushLogs()}function r(){n({stateName:"begin_tpd",transitionName:"prepare_verification"})}function i(e){n({stateName:"begin_pwd",transitionName:"process_pwd_tpd_click",calName:"INIT_TPD"+(e&&"_"+e)})}function s(){n({stateName:"begin_tpd",transitionName:"process_pwd_tpd_auto",calName:"AUTO_TPD_LOGIN"})}function o(){n({stateName:"begin_tpd",transitionName:"process_not_you",calName:"PROCESS_NOT_YOU"})}function u(){n({stateName:"begin_tpd",transitionName:"process_resend",calName:"PROCESS_RESEND"})}function a(e){switch(e){case"passwordReason1":n({stateName:"begin_use_pwd",transitionName:"process_no_phone",calName:"USE_PASSWORD_NO_PHONE"});break;case"passwordReason2":n({stateName:"begin_use_pwd",transitionName:"process_no_notification",calName:"USE_PASSWORD_NO_NOTIFICATION"});break;case"passwordReason3":n({stateName:"begin_use_pwd",transitionName:"process_prefer_password",calName:"USE_PASSWORD_PREFER_PASSWORD"});break;case"passwordReason4":n({stateName:"begin_use_pwd",transitionName:"process_try_later",calName:"USE_PASSWORD_TRY_LATER"});break;case"passwordReason5":n({stateName:"begin_use_pwd",transitionName:"process_other",calName:"USE_PASSWORD_OTHER"});break;default:n({stateName:"begin_tpd",transitionName:"process_use_pwd",calName:"USE_PASSWORD"})}}function f(e){n({stateName:"end_tpd_notification",transitionName:"expired_tpd_no_action",calName:"EXPIRED_TPD_"+e})}function l(n){var r=document.querySelectorAll("form[name=login] input"),i={},s=$("body").data("tpdVariant");$("body").data("isPrefillEmailEnabled")&&$("body").data("tpdDemo")&&document.body.removeAttribute("data-is-prefill-email-enabled"),e.showSpinner();for(var o=0;o<r.length;o++)i[r[o].name]=r[o].value;if(i.tpdEligible!=="true"){e.hideSpinner();return}i.splitLoginContext="tpd",delete i.login_password,delete i.login_pin,i.tpdVariant=n,i.originalVariant=s,login.fn.addFnSyncData(),$.ajax({url:t.getAttribute("action"),method:"POST",data:i,success:e.successfulXhrHandler,fail:e.failedXhrSubmitHandler})}function c(){var e=$("body").data("tpdAutoSend");if(login.utils.isTpdDemo())return;e==="true"&&(s(),l("autoSend"))}var e=login.utils,t=document.querySelector("form[name=login]");return{instrumentVerificationViewRendered:r,instrumentTpdLoginClicked:i,instrumentTpdLoginAutoTriggered:s,instrumentNotYouClicked:o,instrumentResendClicked:u,instrumentUsePasswordInstead:a,initialize:c,attemptTpdLogin:l,instrumentTpdExpired:f}}(),login.singleSignOn=function(){function o(){return r?"inbound_sso_login":"sso_login"}function u(e){e=e||{},logger.log({evt:"state_name",data:"CPL_LATENCY_METRICS",instrument:!0}),logger.log({evt:"login_experience",data:"SSO",instrument:!0});var t=JSON.stringify({start:e.ssoTimeStart,tt:Date.now()-e.ssoTimeStart});logger.log({evt:"login_auth_time",data:t,instrument:!0}),logger.log({evt:"status",data:e.status,instrument:!0}),logger.pushLogs()}function a(){var u={},a=$("body").data("ssoDefaultContent"),f=document.querySelectorAll("form[name=login] input[type=hidden]"),l=o(),c=!1;n&&n==="venmo"?e.hideSpinner():r?(e.showSpinner(),t&&$(t).addClass("nonTransparentMask")):(e.showSpinner(),t&&$(t).addClass("nonTransparentMask"),a?e.showSpinnerMessage("oneSecond"):e.showSpinnerMessage("secureMessage")),u.ssoViaToken=!0,u.isInboundSso=r,login.fn.updateFnSyncContext({sourceId:"SSO_LOGIN"}),login.fn.addFnSyncData();var h={_csrf:1,intent:1,ctxId:1,returnUri:1,state:1,authContextId:1,authCode:1,billingId:1,"locale.x":1,fn_sync_data:1,flowId:1,assertion:1};for(var p=0;p<f.length;p++)h[f[p].name]&&(u[f[p].name]=f[p].value);login.logger.log({evt:"state_name",data:l,instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_"+l,instrument:!0}),login.logger.pushLogs(),$("body").data("xhrTimeoutEnable")&&e.isSpinnerShown()&&!e.isUserAgentIneligibleForTimeout()&&(c=!0);var d=$("body").data("loadStartTime");$.ajax({url:"/signin/sso",method:"POST",data:u,timeoutEnable:c,success:function(t){var i=t.returnUrl,o=t.failureReturnUrl;login.utils.logCPLData({startTime:d,status:"success",flowName:"SSO"}),login.logger.log({evt:"state_name",data:l,instrument:!0}),login.logger.log({evt:"transition_name",data:"process_"+l,instrument:!0}),login.logger.pushLogs();if(n&&(i||o)){e.isBrowserInPrivateMode(function(e){var t=e&&e.isPrivate;if(!t&&i){window.location.href=i;return}t&&(window.location.href=o||i)});return}if(r&&(i||o)){window.location.href=o||i;return}if(i){window.location.href=i;return}if(t.notifications){var u=document.querySelector(".notifications");u.innerHTML="",login.utils.updatePageLevelError(t.notifications.msg,t.notifications.type)}if(s){location.reload();return}n!=="venmo"&&(e.hideSpinner(),e.hideSpinnerMessage("oneSecond"),e.hideSpinnerMessage("secureMessage"))},fail:function(t){login.utils.logCPLData({startTime:d,status:"failure",flowName:"SSO"});var r=e.parseJsonSafe(t.response);if((n&&n==="venmo"||i&&i==="venmo")&&r.returnUrl){window.location.href=r.returnUrl;return}if(s){location.reload();return}e.hideSpinner(),e.hideSpinnerMessage("oneSecond"),e.hideSpinnerMessage("secureMessage")}})}var e=login.utils,t=document.querySelector(".transitioning"),n=$("body").data("tenantsso"),r=$("body").data("isInboundSso"),i=$("body").data("tenantssocontingency"),s=$("body").data("ssoInterstitial");return function(){var t=$("body").data("ssoviatoken");if(t){login.fn.initialize(),a();return}}}(),login.ssoInterstitial=function(){function e(){var e=$("body");e&&e.data("ssoviatoken","true"),login.singleSignOn&&login.singleSignOn()}function t(){var t=document.getElementById("continueInterstitial");addEvent(t,"click",e)}return{attachFormEvent:t}}(),login.smartLock=function(){function E(t){var n={};if(!t)return;login.logger.log({evt:"state_name",data:t.stateName,instrument:!0}),login.logger.log({evt:"transition_name",data:t.transitionName,instrument:!0}),login.logger.log({evt:"api_name",data:t.apiName,instrument:!0}),t.errorCode&&login.logger.log({evt:"ext_error_code",data:t.errorCode,instrument:!0}),t.calName&&login.logger.log({evt:"CROSS_DEVICE_OT_CLIENT",data:t.calName+"_"+a,calEvent:!0}),t.respDuration&&login.logger.log({evt:"resp_duration",data:t.respDuration,instrument:!0}),t.updateCapping&&(n.data={updateCapping:t.updateCapping}),t.resetCapping&&(n.data=n.data||{},n.data.resetCapping=t.resetCapping),t.googleSessionExists&&login.logger.log({evt:"google_session_exists",data:t.googleSessionExists,instrument:!0}),t.redirectOnComplete&&(n.complete=function(){login.utils.showSpinner(),window.location.href=e.slReturnUrl||""}),t.slTokenStatus&&login.logger.log({evt:"sl_token_status",data:t.slTokenStatus,instrument:!0}),t.isOneTap&&(login.logger.log({evt:"GOOGLE_ONE_TAP",data:"GOOGLE_ONE_TAP_ENABLED",calEvent:!0}),login.logger.log({evt:"sl_google_api",data:"google_one_tap_enabled",instrument:!0})),login.logger.pushLogs(n)}function S(){return $(t).hasClass("mobile")}function x(){return Date.now?Date.now():(new Date).getTime()}function T(e){var t=document.querySelector(".modal-underlay");S()&&(e.style.width="100%",e.style.height="100%"),t||(t=document.createElement("div"),t.className="modal-underlay",document.body.appendChild(t)),e.style.display="block",t.style.opacity=.7,e.style.opacity=1,login.logger.log({evt:"CROSS_DEVICE_OT_CLIENT",data:"LEARN_MORE_"+a,calEvent:!0})}function N(e){var t=document.querySelector(".modal-underlay");t&&document.body.removeChild(t),e.style.display="none"}function C(e){f=f&&$(f).remove();if(e&&e.target&&e.target.id==="backToInputEmailLink")return;login.logger.log({evt:"CROSS_DEVICE_OT_CLIENT",data:"CHANGE_"+a,calEvent:!0}),login.logger.log({evt:"clicked_not_you",data:"y",instrument:!0}),login.utils.notYouClickHandler(e,function(){i&&($(i).addClass("hide"),$(i).removeClass("activeContent")),o&&($(o).removeClass("hide"),$(o).addClass("activeContent"))})}function k(e,t,n){var r=document.querySelector(".transitioning p.oneSecond"),i={};e=e||{},e.data&&(i=e.data),i._csrf=login.utils.getCSRFToken(),login.utils.showSpinner(),r&&$(r).removeClass("hide"),$.ajax({type:e.method||"POST",url:"/signin/"+e.path,data:i,dataType:"json",success:function(e){return login.utils.setCSRFToken(e&&e._csrf),t(e)},fail:n})}function L(e){i&&($(i).addClass("hide"),$(i).removeClass("activeContent")),o&&($(o).removeClass("hide"),$(u).addClass("activeContent")),f=f&&$(f).remove(),triggerEvent(window,"resize"),login.utils.hideSpinnerMessage("retrieveInfo"),login.utils.hideSpinnerMessage("waitFewSecs"),login.utils.hideSpinner(),login.fn.updateFnSyncContext({sourceId:"UL_CHECKOUT_INPUT_PASSWORD"}),E({stateName:"switch_to_pwd",transitionName:"process_switch_to_pwd",calName:"PWD_FALLBACK_"+login.utils.getIntent(),errorCode:e});return}function A(t,n){var r=document.querySelector("input[name=ctxId]");k({path:"smart-lock-handler",data:{smartLockIdToken:t,nonce:g||"",actionIntent:n,returnUrl:e.slReturnUrl,slSessionExists:e.slSessionExists,scimContextId:e.scimContextId||"",intent:login.utils.getIntent(),ctxId:r&&r.value,flowId:login.utils.getFlowId(),isActivate:!0}},function(t){if(t.returnUrl){window.location.href=t.returnUrl;return}if(n==="optin"){window.location.href=e.slReturnUrl;return}login.logger.log({evt:"CROSS_DEVICE_OT_CLIENT",data:"ACTIVATION_FAILED_LOGIN_FALLBACK_"+a,calEvent:!0}),L("activation failed - prompt pwd");return},function(t){if(n==="optin"){window.location.href=e.slReturnUrl;return}login.logger.log({evt:"CROSS_DEVICE_OT_CLIENT",data:"ACTIVATION_ERROR_LOGIN_FALLBACK_"+a,calEvent:!0}),L("activation error");return})}function O(){return login.utils.showSpinner(),E({stateName:"begin_sl_activation",transitionName:"process_sl_activation_continue",calName:"ACTIVATE_INITIATED"}),A(m,"activation")}function M(){var e=i.querySelector("#linked"),t=i.querySelector("#unlinked"),n=document.querySelector("#optInLearnMoreDesc");if(p)return;clearTimeout(v),b?(y&&(g=y),o&&($(o).addClass("hide"),$(u).removeClass("activeContent")),i&&($(i).removeClass("hide"),$(s).addClass("activeContent")),e&&$(e).removeClass("hide"),n&&$(n).addClass("hide"),t&&$(t).addClass("hide"),c&&$(c).addClass("hide"),login.utils.hideSpinnerMessage("retrieveInfo"),login.utils.hideSpinnerMessage("waitFewSecs"),login.utils.hideSpinner(),E({stateName:"begin_sl_activation",transitionName:"prepare_sl_activation",calName:"ACTIVATION_SHOWN",respDuration:w,updateCapping:"smartlockActivate",slTokenStatus:"not_validated"})):(login.logger.log({evt:"CROSS_DEVICE_OT_CLIENT",data:"PARTNER_AUTH_FAILED_"+a,calEvent:!0}),L("partner token invalid"))}function _(t){var n=i.querySelector("#displayName"),r=i.querySelector("#partnerEmail"),s=i.querySelector("#partnerEmailDomain"),o=i.querySelector("#partnerPhoto"),u=i.querySelector(".loginEmail"),a=d?x()-d:0,f={stateName:"begin_google_auth",transitionName:"process_google_auth",apiName:"google_auth",respDuration:a};clearTimeout(v);if(!(!t||t.error||!t.idToken)){f.calName="AUTH_SUCCESS",u.textContent=e.slLoginEmail,n&&(n.textContent=t.name);var l=t.email&&t.email.indexOf("@");return r&&l>0&&(r.textContent=t.email.slice(0,l),s.textContent=t.email.slice(l)),o&&(o.style.backgroundImage="url("+t.image+")"),m=t.idToken,E(f),b=!0,M()}f.errorCode=t&&t.error,f.calName="AUTH_FAIL",L("auth failed"),f.updateCapping="smartlockBlockingAuth",E(f)}function D(e){var t=d?x()-d:0,n={stateName:"begin_nonblock_google_auth",transitionName:"process_nonblock_google_auth",apiName:"google_auth",respDuration:t};!e||e.error||!e.idToken?(n.errorCode=e&&e.error,n.calName="NB_AUTH_FAIL"):(n.calName="NB_AUTH_SUCCESS",n.resetCapping="smartlockBlockingAuth"),E(n)}function P(t){var n=d?x()-d:0,i=!t||t.error!=="userCanceled"&&t.method!=="oneTapCancel"?"process_gsl_error":"process_gsl_cancel",s=!t||t.error!=="userCanceled"&&t.method!=="oneTapCancel"?"LINK_ERROR":"LINK_CANCELLED",o={stateName:"begin_gsl",respDuration:n,isOneTap:e.googleOneTapEnable};clearTimeout(v),t.idToken?(o.transitionName="process_gsl",o.calName="LINK_INITIATED_"+login.utils.getIntent(),$(r).addClass("nonTransparentMask"),login.utils.showSpinner(),E(o),A(t.idToken,"optin")):(o.transitionName=i,o.errorCode=t&&t.error,o.redirectOnComplete=!0,o.calName=s,E(o))}function H(t){var n=d?x()-d:0,r=document.querySelector("form[name=login]"),i=t&&t.sessionExists,s={stateName:"begin_gsl_session_check",transitionName:"process_gsl_session_check",apiName:"smartlock_hintsAvailable",googleSessionExists:i,calName:"GOOGLE_SESSION_"+i+"_"+login.utils.getIntent(),respDuration:n,isOneTap:e.googleOneTapEnable};clearTimeout(v),!t||t.error||i!=="true"?(s.errorCode=t&&t.error,s.redirectOnComplete=e.slOptInOT,E(s)):(B("slSessionExists",t.sessionExists,r),B("partnerClientId",e.partnerClientId,r),B("scimContextId",e.scimContextId,r),E(s),e.slOptInOT&&(e.googleOneTapEnable||(e.slFrameSrc=e.slFrameSrc&&e.slFrameSrc.replace("hintsAvailable","hint")),e.slOptInOT=!1,X()))}function B(e,t,n){var r=document.querySelector("[name="+e+"]");r?r.setAttribute("value",t):login.utils.addHiddenElement(e,t,n)}function j(t){var n=t&&t.data||{},r;if(p)return;if(n.type==="verifyPing"&&t.source){t.source.postMessage({type:"verifyAck",data:n.data},"*");return}if(t&&t.data)try{r=JSON.parse(t.data)}catch(i){}if(!r)return;if(r.source==="smartlock"&&r.method==="hintsAvailable"||r.source==="oneTap"&&(r.method==="oneTapAvailable"||r.method==="oneTapNoSession"))return H(r);if(r.source==="smartlock"&&r.method==="hint"||r.source==="oneTap"&&(r.method==="oneTapAccept"||r.method==="oneTapCancel"))return P(r);if(r.source==="slAuth"&&e.slAction==="nonblockingAuth")return D(r);if(r.source==="slAuth")return _(r)}function F(e){p=!0,login.logger.log({evt:"CROSS_DEVICE_OT_CLIENT",data:"AUTH_TIMEOUT_"+a,calEvent:!0}),L(e)}function I(){p=!0,E({stateName:"begin_gsl",transitionName:"process_gsl_no_user_action",calName:"OPTIN_ACTION_TIMEOUT_"+login.utils.getIntent(),redirectOnComplete:!0})}function q(){var t=e.slOptInOT?"returning_ot_session_chk_timeout":"session_chk_timeout";p=!0,E({stateName:"begin_gsl_session_check",transitionName:"process_gsl_session_check",apiName:"smartlock_hintsAvailable",errorCode:t,calName:"SESSION_CHK_TIMEOUT_"+login.utils.getIntent(),redirectOnComplete:e.slOptInOT})}function R(t,n){function s(e){f.contentWindow.postMessage(JSON.stringify({source:"UL",email:r,clientId:i,authIntent:"authorize"}),"*")}var r=e.slLinkedEmail,i=e.partnerClientId;d=x(),$(o).removeClass("hide"),E({stateName:n.stateName,transitionName:n.transitionName,apiName:"google_auth"}),f?f.src=t:(f=login.utils.createIframe({id:"slAuthFrame",src:t,frameBorder:"0",sandbox:"allow-same-origin allow-scripts",style:"width:0;height:0"}),addEvent(f,"load",s))}function U(){var t=e.slAuthUrl,n=e.slAuthChkTimeout||"3000";d=x(),login.utils.showSpinner(),login.utils.showSpinnerMessage("retrieveInfo"),$(o).removeClass("hide");if(login.utils.isSiAppleActivationProcessing())return L("siapple login processing");if(!t)return L("Auth URL not found");v=setTimeout(function(){F("Auth Timeout")},n),R(t,{stateName:"begin_google_auth",transitionName:"prepare_google_auth"})}function z(){var t=e.slAuthUrl;d=x(),L("Perform non blockingAuth");if(!t)return;R(t,{stateName:"begin_nonblock_google_auth",transitionName:"prepare_nonblock_google_auth"})}function W(t){var n=e.slFrameSrc,r=e.googleOneTapEnable?"hide":"";t&&(r=S()?"popupMobile":"popupWeb"),l?l.src=n:l=login.utils.createIframe({id:"slFrame",title:"slFrame",src:n,frameBorder:"0",className:r,sandbox:"allow-same-origin allow-scripts"})}function X(){var t=e.slFrameSrc,n=i.querySelector(".cancelUrl"),r=e.slOptInTimeout||"30000",a,f=i.querySelector("#linked"),h=i.querySelector("#unlinked"),p=document.querySelector("#slLoginLearnMoreDesc"),m=i.querySelector("#slOptIn_notNow");d=x();if(e.slOptInOT)return V();n&&!e.slDisplayMerchantLink&&$(n).addClass("hide"),$(i).removeClass("hide"),$(s).addClass("activeContent"),o&&($(o).addClass("hide"),$(u).removeClass("activeContent")),f&&$(f).addClass("hide"),h&&$(h).removeClass("hide"),p&&$(p).addClass("hide"),c&&$(c).addClass("hide"),login.utils.hideSpinner(),E({stateName:"begin_gsl",transitionName:"prepare_gsl",apiName:"smartlock_hint",updateCapping:"smartlockOptIn",calName:"OPTIN_SHOWN_"+login.utils.getIntent()}),triggerEvent(window,"resize"),t?(v=setTimeout(function(){I()},r),e.googleOneTapEnable||W(!0),l=document.querySelector("#slFrame"),l?(e.googleOneTapEnable&&$(l).removeClass("hide"),a=$(l).outerHeight(),document.querySelector("body").style.marginBottom=a+"px"):W(!0),setTimeout(function(){m&&$(m).removeClass("hide")},"5000")):(login.utils.showSpinner(),window.location.href=e.slReturnUrl||"")}function V(){var t=e.slFrameSrc,n=e.slSessionChkTimeout||"3000",r={stateName:"begin_gsl_session_check",transitionName:"prepare_gsl_session_check",apiName:"smartlock_hintsAvailable",isOneTap:e.googleOneTapEnable};d=x(),t?(v=setTimeout(function(){q()},n),W(e.slOptInOT),E(r)):(r.errorCode="slFrameSrc not found",r.redirectOnComplete=e.slOptInOT,E(r))}function J(){var e=document.querySelector("#slLoginLearnMore"),t=document.querySelector("#learnMoreModal"),r=t.querySelector("button"),s=document.querySelector("#slOptInlearnMore"),o=document.querySelector("#learnMoreModal"),u=o.querySelector("button"),f=i&&i.querySelector("#continueBtn"),l=i&&i.querySelector("#secondaryLoginBtn"),c=document.querySelector("#changeLink"),h=i.querySelector("#slOptIn_notNow a"),p=document.querySelector("#backToInputEmailLink");addEvent(e,"click",function(){T(t)}),addEvent(r,"click",function(){N(t)}),addEvent(s,"click",function(){T(o)}),addEvent(u,"click",function(){N(o)}),addEvent(f,"click",function(){O()}),addEvent(l,"click",function(){login.logger.log({evt:"CROSS_DEVICE_OT_CLIENT",data:"USE_PASSWORD_"+a,calEvent:!0}),L()}),c&&addEvent(c,"click",C),p&&addEvent(p,"click",C),addEvent(window,"message",j),h&&addEvent(h,"click",function(){E({stateName:"begin_gsl",transitionName:"process_gsl_not_now",calName:"OPTIN_ACTION_NOTNOW_"+login.utils.getIntent(),redirectOnComplete:!0})}),n=!0}var e,t=document.body,n=!1,r=document.querySelector(".transitioning"),i=document.querySelector("#slLanding"),s=i&&i.querySelector("#slContent"),o=document.querySelector("#login"),u=o&&o.querySelector("#content"),a=$(t).hasClass("mobile")?"MOBILE":"DESKTOP",f=document.querySelector("#slAuthFrame"),l=document.querySelector("#slFrame"),c=i&&i.querySelector(".localeSelector"),h=document.querySelector("form[name=login]"),p=!1,d,v,m,g,y,b,w;return function(r){var s=document.querySelector("input[name=nextClick]");e=r?r:window.PAYPAL&&window.PAYPAL.slData;if(!e||!e.slAction||!i)return;e.slAction&&!n&&J(),login.logger.log({evt:"CROSS_DEVICE_OT_CLIENT",data:"IFRAME_URL_SRC_"+e.slFrameSrc,calEvent:!0});if(e.slAction==="activation"&&!login.utils.isAPayEnabled(r))return U();if(e.slAction==="nonblockingAuth")return z();if(e.slAction==="checkSession")return V();if(e.slAction==="optIn")return X()}}();var SiApple=function(){function n(){}function r(e,r){return function(s){return s.preventDefault(),t.log({evt:"actionType",data:e,instrument:!0}),t.log({evt:n.CAL_TYPE,data:"PROCESS_INTERSTITIAL_"+e.toUpperCase(),calEvent:!0}),t.log({evt:"state_name",data:"begin_siapple_interstitial",instrument:!0}),t.log({evt:"transition_name",data:"process_siapple_interstitial",instrument:!0}),t.pushLogs(),window.location.assign(r)}}function i(t){return e.makeServerRequestAndReturnPromise("/signin/oauth2/apple/link",{method:"POST",data:t})}function s(t){return e.makeServerRequestAndReturnPromise("/signin/oauth2/apple/activate",{method:"POST",data:t})}var e=login.utils,t=login.logger;return n.CAL_TYPE="SIAPPLE",n.handleLinkAndRedirect=function(r){return r=r||{},t.log({evt:n.CAL_TYPE,data:"PROCESS_HANDLE_LINK_AND_REDIRECT",calEvent:!0}),t.pushLogs(),i(r).then(function(){return window.location.replace(r.returnUrl)}).catch(function(){return t.log({evt:n.CAL_TYPE,data:"FAILED_HANDLE_LINK_AND_REDIRECT_AJAX",calEvent:!0}),t.pushLogs(),window.location.replace(r.returnUrl)})},n.handleActivateAndRedirect=function(t){return t=t||{},s(t).then(function(n){return n=n||{},window.location.replace(n.returnUrl||t.returnUrl)}).catch(function(){return window.location.replace(t.requestUrl||t.returnUrl)})},n.handleAuthFailure=function(r){return r=r||{},t.log({evt:n.CAL_TYPE,data:"PROCESS_HANDLE_AUTH_FAILURE",calEvent:!0}),t.pushLogs(),window.location.replace(r.returnUrl)},n.triggerOptin=function(s,o){t.log({evt:n.CAL_TYPE,data:"PROCESS_TRIGGER_OPTIN",calEvent:!0}),t.log({evt:"state_name",data:"begin_siapple_interstitial",instrument:!0}),t.log({evt:"transition_name",data:"prepare_siapple_interstitial",instrument:!0}),t.pushLogs();var u=s.authUrl,a=o.returnUrl,f=document.querySelector("section#siappleOptinInterstitial"),l=f&&f.querySelector("button.siappleConnectBtn.button.actionContinue"),c=f&&f.querySelector("a.siappleDecline");l&&l.addEventListener("click",function(t){l.disabled=!0,r("connect",u)(t)}),c&&c.addEventListener("click",function(n){e.showSpinner(),r("decline",a)(n)})},n.triggerActivate=function(r){return t.log({evt:n.CAL_TYPE,data:"PROCESS_TRIGGER_ACTIVATE",calEvent:!0}),t.log({evt:"state_name",data:"begin_siapple_login",instrument:!0}),t.log({evt:"transition_name",data:"prepare_siapple_login",instrument:!0}),t.pushLogs(),window.location.assign(r.authUrl)},n}();login.siapple=function(e){function n(e,t){var n=$(e);return n?n.data(t):null}var t=login.utils;return function(i){i=i||{};var s=document.querySelector("section#siappleOptinInterstitial"),o=document.querySelector("section#siappleRedirectInterstitial"),u=i.appleIdpJson||n(s,"appleIdpJson"),a=i.siAppleOptinDataJson||n(s,"siAppleOptinDataJson"),f=n(o,"siAppleRedirectDataJson"),l=t.parseJsonSafe(u)||{},c=t.parseJsonSafe(a)||{},h=t.parseJsonSafe(f)||{};if(c.isSiAppleOptinRequired&&l.authUrl&&c.returnUrl)return e.triggerOptin(l,c);if(l.isLinked&&l.authUrl)return t.addHiddenElementIfNotExist("isSiAppleActivationProcessing",!0,document.body),e.triggerActivate(l);if(h.isOptin&&h.returnUrl)return e.handleLinkAndRedirect(h);if(h.isLinked&&h.returnUrl)return e.handleActivateAndRedirect(h);if(h.isFailed&&h.returnUrl)return e.handleAuthFailure(h)}}(SiApple),document.onreadystatechange=function(){document.readyState==="complete"&&login.siapple&&login.siapple()},login.webAuthn=function(){function i(e){var t=e&&e.webAuthnLoginContext||$("body").data("webAuthnLoginContext"),i;if(!t){r&&(login.storageUtils.removeDataByUserId("wanId",r),login.logger.log({evt:"webauthn_cred",data:"cred_no_ctx",instrument:!0}),login.logger.log({evt:n,data:"CRED_NO_CTX",calEvent:!0}),login.logger.pushLogs());return}try{i=JSON.parse(t)}catch(s){}return i}function s(e){var t=document.querySelector("#main"),n=t.querySelectorAll("section")||[];for(var r=0;r<n.length;r++){var i=n[r].querySelector(".notifications");i&&$(i).text()&&$(i).text(""),$(n[r]).hasClass("hide")||$(n[r]).addClass("hide")}t.insertAdjacentHTML("afterbegin",e),login.footer&&login.footer(),login.countryList&&login.countryList.getCache("countryList")&&login.countryList.showCountryDropDown()}function o(){var e=$("body").data("loginExperience")==="safari",t=$("#fpLogIn"),n=$("#login");if(!t||t.hasClass("hide")||!n||!n.hasClass("hide")||!e)return;var r=document.querySelector("#email"),i=document.querySelector("#password");r&&!r.hasAttribute("disabled")&&r.setAttribute("disabled","disabled"),i&&!i.hasAttribute("disabled")&&i.setAttribute("disabled","disabled")}function u(){var e=document.querySelector(".webAuthnDisplayCredentials a");e&&addEvent(e,"click",function(e){login.utils.showSpinner({nonTransparentMask:!0}),eventPreventDefault(e),login.utils.notYouClickHandlerForCookiedUser(e,function(){login.logger.log({evt:"state_name",data:"begin_webauthn_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"click_not_you",instrument:!0}),login.logger.pushLogs(),location.reload()})})}function a(){var e=document.querySelector("#serviceError"),t=document.querySelector(".webAuthnDisplayCredentials"),n=document.querySelector("#webAuthnLogin");if(!e)return;$(e).removeClass("hide"),t&&$(t).addClass("hide"),n&&$(n).addClass("hide"),login.logger.log({evt:"state_name",data:"webauthn_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_error_page",instrument:!0}),login.logger.log({evt:"SERVICE_ERROR_PAGE",data:"SHOW_ERROR_PAGE_LOGIN",calEvent:!0}),login.logger.pushLogs()}function f(){var e=document.querySelector("#serviceError"),t=document.querySelector("#errorUsePasswordInstead");if(!e||!t)return;addEvent(t,"click",function(){login.utils.loginWithPasswordHandler({integrationType:"webAuthn"})})}function l(e){var t=$("body").data("isUvpaaExist");eventPreventDefault(e),login.logger.log({evt:"state_name",data:"webauthn_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_login",instrument:!0}),login.logger.log({evt:"button_label",data:"log_in",instrument:!0}),login.logger.log({evt:"WEBAUTH_N_CLIENT",data:"WEBAUTH_N_CLIENT_CLICKED_WEBAUTHN_LOGIN",calEvent:!0}),login.logger.pushLogs();if(t==="false")return login.logger.log({evt:"WEBAUTH_N_CLIENT",data:"ERROR_UVPAA_NOT_ENABLED",calEvent:!0}),login.logger.pushLogs(),a();login.webAuthn.performWebAuthnLogin()}function c(){var e=$("#fpLogIn");if(!e)return;var t=document.querySelector("#logIn_start"),n=document.querySelector("#logIn_notNow"),r=document.querySelector("#logIn_tryAnotherWay"),i=document.querySelector("#serviceError");addEvent(t,"click",l),n&&addEvent(n,"click",function(){login.logger.log({evt:"state_name",data:"webauthn_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_use_password_instead",instrument:!0}),login.logger.log({evt:"button_label",data:"use_password_instead",instrument:!0}),login.logger.log({evt:"WEBAUTH_N_CLIENT",data:"WEBAUTH_N_CLIENT_CLICKED_USE_PASSWORD_INSTEAD",calEvent:!0}),login.logger.pushLogs(),login.utils.loginWithPasswordHandler({integrationType:"webAuthn"})}),r&&(login.utils.attachTryAnotherWayModalHandlers({integrationType:"webAuthn"}),addEvent(r,"click",function(e){login.logger.log({evt:"state_name",data:"webauthn_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"webauthn_try_another_way_modal",instrument:!0}),login.logger.log({evt:"WEBAUTH_N_CLIENT",data:"WEBAUTH_N_CLIENT_CLICKED_TRY_ANOTHER_WAY",calEvent:!0}),login.logger.pushLogs(),login.utils.showTryAnotherWayModal(e,{integrationType:"webAuthn"})})),i&&f(),u()}function h(e){s(e),c()}function p(e){function o(){var e=s||{},t={authenticatorSelection:{authenticatorAttachment:"platform"},attestation:"direct",userVerification:"preferred"};return t.challenge=f(e.challenge),"timeout"in e&&(t.timeout=e.timeout),"rpId"in e&&(t.rpId=e.rpId),"allowCredentials"in e&&(t.allowCredentials=l(e.allowCredentials)),navigator.credentials.get({publicKey:t})}function u(e){return btoa((new Uint8Array(e)).reduce(function(e,t){return e+String.fromCharCode(t)},""))}function f(e){return Uint8Array.from(atob(e),function(e){return e.charCodeAt(0)})}function l(e){var t=[];for(var n=0;n<e.length;n++){var r={};r.type=e[n].type,r.id=f(e[n].id),r.transports=["internal"],t.push(r)}return t}function c(e){var r=document.querySelectorAll("form[name=login] input[type=hidden]"),i={},s={},o=document.querySelector("input[name=login_email]"),a=document.querySelector("input[name=login_phone]"),f=document.querySelector("#phoneCode");o=o&&o.value||$("body").data("loginEmail"),a=a&&a.value||$("body").data("loginPhone"),f=f&&f.value||$("body").data("phoneCode"),login.logger.log({evt:"state_name",data:"webauthn_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_proceed_login",instrument:!0}),login.logger.log({evt:n,data:n+"_PREPARE_PROCEED_LOGIN",calEvent:!0}),login.logger.pushLogs();for(var l=0;l<r.length;l++)s[r[l].name]=r[l].value;a&&f?(s.login_phone=a,s.phoneCode=f):s.login_email=o,"id"in e&&(i.id=e.id),"type"in e&&(i.type=e.type),"rawId"in e&&(i.rawId=u(e.rawId));if("response"in e){var c={};return c.clientDataJSON=u(e.response.clientDataJSON),c.authenticatorData=u(e.response.authenticatorData),c.signature=u(e.response.signature),c.userHandle=u(e.response.userHandle),i.response=c,s.webauthn_response=JSON.stringify(i),t.makeServerRequestAndReturnPromise("/signin",{data:s})}return Promise.reject()}var r=$("body").data("loadStartTime"),s=i(e);if(typeof navigator.credentials!="object"||typeof navigator.credentials.get!="function")return;login.logger.log({evt:"state_name",data:"webauthn_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_consent",instrument:!0}),login.logger.log({evt:n,data:n+"_PREPARE_CONSENT_LOGIN",calEvent:!0}),login.logger.pushLogs(),o().then(c).catch(function(e){t.addHiddenElement("webAuthnEnrolledUser",!0,document.querySelector("form[name=login]")),login.logger.log({evt:"state_name",data:"begin_fp_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_fp_assertion_failed",instrument:!0}),login.logger.log({evt:n,data:"PROCESS_FP_ASSERTION_FAILED",calEvent:!0,status:"ERROR"});var r=e&&e.toString()||"unknown_error";return login.logger.log({evt:n,data:"FP_ASSERTION_ERROR_"+r,calEvent:!0}),login.logger.log({evt:"ext_error_desc",data:r,instrument:!0}),Promise.reject()}).then(function(e){if(e.notifications)return Promise.reject("service error");login.logger.log({evt:"state_name",data:"begin_fp_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_fp_login_success",instrument:!0}),login.logger.log({evt:n,data:"PROCESS_FP_LOGIN_SUCCESS",calEvent:!0}),login.logger.pushLogs(),login.utils.logCPLData({startTime:r,status:"success",flowName:"Web Authn"}),e.returnUrl?window.location.href=e.returnUrl:t.hideSpinner()}).catch(function(e){login.logger.log({evt:"state_name",data:"begin_fp_login",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_fp_login_failed",instrument:!0}),login.logger.log({evt:n,data:"PROCESS_FP_LOGIN_FAILED",calEvent:!0,status:"ERROR"}),login.logger.pushLogs(),login.utils.logCPLData({startTime:r,status:"failure",flowName:"Web Authn"}),t.hideSpinner();if(e!=="service error")return;a()})}function d(e){var r=window.PublicKeyCredential,i=!0;r&&r.isUserVerifyingPlatformAuthenticatorAvailable&&(login.logger.log({evt:"state_name",data:"begin_fp_UVPAA",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_fp_UVPAA",instrument:!0}),r.isUserVerifyingPlatformAuthenticatorAvailable().then(function(e){return login.logger.log({evt:"eligibility_reason",data:"UVPAA_"+e,instrument:!0}),login.logger.log({evt:n,data:"UVPAA_ELIGIBLE_"+e,calEvent:!0,status:"SUCCESS"}),login.logger.pushLogs(),e===!0&&(t.addHiddenElementIfNotExist("isUVPAAExist","yes",document.querySelector("form[name=login]")),document.body.setAttribute("data-is-uvpaa-exist","true")),e===!1?(i=!1,document.body.setAttribute("data-is-uvpaa-exist","false"),Promise.reject(new Error("UVPAA not eligible"))):Promise.resolve(i)}).then(function(){e&&e.webAuthnEnrolledUser&&t.addHiddenElement("webAuthnEnrolledUser",!0,document.querySelector("form[name=login]"));var n=$("#fpLogIn"),r=$("#login");n&&!n.hasClass("hide")&&(r.addClass("hide"),o())}).catch(function(e){login.logger.log({evt:"eligibility_reason",data:"UVPAA_error",instrument:!0}),login.logger.log({evt:n,data:"UVPAA_CHECK_FAILED",calEvent:!0,status:"ERROR"}),login.logger.pushLogs(),document.body.setAttribute("data-is-uvpaa-exist","false")}))}var e=login.utils.createCache(),t=login.utils,n="WEBAUTH_N_CLIENT",r=$("body").data("partyIdHash");return $("body").data("webAuthnEnrolledUser")&&t.addHiddenElement("webAuthnEnrolledUser",!0,document.querySelector("form[name=login]")),r&&t.addHiddenElement("partyIdHash",r,document.querySelector("form[name=login]")),{setContext:function(t){var n=t&&t.wanSupportLookup||$("body").data("webAuthnSupportLookup"),r=window.PAYPAL.ulData||{},i=r.aPayAuth,s=$("body").data("userDeviceTokenLogin");if(!n||i||s)return;t&&t.webAuthnLoginHtml&&(e.update({webAuthnLoginPage:t.webAuthnLoginHtml}),h(t.webAuthnLoginHtml)),d(t)},performWebAuthnLogin:p,attachFormEvent:c}}(),login.webAuthnOptInXHR=function(){function e(e){return btoa((new Uint8Array(e)).reduce(function(e,t){return e+String.fromCharCode(t)},""))}function t(e){return Uint8Array.from(atob(e),function(e){return e.charCodeAt(0)})}function n(e){var n={},r;if(!e.response)throw new Error("no_bind_challenge_available");return r=e.response||{},n.publicKey={rp:{id:r.rp.id,name:r.rp.name},user:{id:t(r.user.id),name:r.user.name||"",displayName:r.user.displayName||""},challenge:t(r.challenge),pubKeyCredParams:r.pubKeyCredParams,authenticatorSelection:{authenticatorAttachment:"platform"}},navigator.credentials.create(n)}function r(t){var n={};"id"in t&&(n.id=t.id),"type"in t&&(n.type=t.type),"rawId"in t&&(n.rawId=e(t.rawId));if("response"in t){var r={};return r.clientDataJSON=e(t.response.clientDataJSON),r.attestationObject=e(t.response.attestationObject),n.response=r,login.utils.makeServerRequestAndReturnPromise("/signin/webauthn/process-credential",{data:{webauthn_response:JSON.stringify(n),flowId:login.utils.getFlowId()}})}return Promise.reject(!1)}return function(){var t="WEBAUTH_N_CLIENT";return login.utils.makeServerRequestAndReturnPromise("/signin/webauthn/get-create-challenge",{data:{flowId:login.utils.getFlowId()}}).then(n).catch(function(e){login.logger.log({evt:"fp_optin_error",data:"create_credential_failed_XHR",instrument:!0});var n=e&&e.toString()||"unknown_error";login.logger.log({evt:t,data:"CREATE_CREDENTIAL_FAILED_XHR"+n,status:"ERROR",calEvent:!0}),login.logger.log({evt:"ext_error_desc",data:n,instrument:!0})}).then(r).catch(function(){login.logger.log({evt:"fp_optin_error",data:"process_credential_failed",instrument:!0}),login.logger.log({evt:t,data:"PROCESS_CREDENTIAL_FAILED",status:"ERROR",calEvent:!0})}).then(function(e){if(!e||!e.bindSuccess)return Promise.reject(!1);var t=document.body.getAttribute("data-party-id-hash");return e.wanId&&t&&login.storageUtils.setDataByUserId("wanId",e.wanId,t),Promise.resolve({msg:"success"})}).catch(function(){return login.logger.log({evt:"fp_optin_error",data:"bind_credential_failed",instrument:!0}),login.logger.log({evt:t,data:"BIND_CREDENTIAL_FAILED",calEvent:!0}),login.logger.pushLogs(),Promise.reject(!1)})}}();var Sua=function(){function n(){}function r(t,n){return e.showSpinner(),t=t||{},t._csrf=e.getCSRFToken(),$.ajax({url:"/signin/sua/handle/accept-agreement",method:"POST",data:t,success:function(){return n()},fail:function(t){return n(t||"unexpected")}})}function i(e,i){return function(o){eventPreventDefault(o),t.log({evt:n.CAL_TYPE,data:"PROCESS_INTERSTITIAL_"+e.toUpperCase(),calEvent:!0}),t.pushLogs();var u="/signin/signout?returnUri="+encodeURIComponent(i.returnUrl);return e!==n.ACTION_ACCEPT?window.location.href=u:r(i,function(r){return r?(t.log({evt:n.CAL_TYPE,data:"FAILED_ACCEPT_AGREEMENT_AJAX",calEvent:!0}),t.pushLogs(),window.location.href=u):window.location.href=i.returnUrl})}}function s(){return{ctxId:e.getCtxId(),intent:e.getIntent(),returnUri:e.getReturnUri(),state:e.getReturnUriState(),flowId:e.getFlowId()}}function o(e){var t={};return t.suaNonce=e&&$(e).data("suaNonce"),t.returnUrl=e&&$(e).data("returnUrl"),t}function u(e){var t=document.querySelector("div#main");$(t).addClass("hide");var n=document.createElement("div");$(n).addClass("xhr-container"),n.innerHTML=e,document.body.appendChild(n)}var e=login.utils,t=login.logger;return n.CAL_TYPE="SUA",n.ACTION_ACCEPT="accept",n.Action_DECLINE="decline",n.triggerInterstitial=function(t){t&&u(t);var r=document.querySelector("#sua-interstitial"),a=r.querySelector("button.sua-agree"),f=r.querySelector("a.sua-log-out"),l=s(),c=o(r),h=Object.assign({},l,c);a.addEventListener("click",i(n.ACTION_ACCEPT,h)),f.addEventListener("click",i(n.Action_DECLINE,h))},n}();login.sua=function(e){return function(n){n=n||{};var r=n.isSuaRequired||$("body").data("isSuaRequired"),i=n.suaHtml;if(r)return e.triggerInterstitial(i)}}(Sua),login.geoEnablement=function(){function n(){}var e="GEO_ENABLEMENT",t=login.logger;return n.setGeoMessage=function(r){r=r||{};var i=$("body").data("geoRedirectUrl")||r.geoRedirectUrl,s=$("body").data("isGeoAutoRedirectEnabled")||r.isGeoAutoRedirectEnabled,o=document.querySelector("p.notification > a.geoRedirectUrl");if(!o||!i)return;o.addEventListener("click",function(){return t.log({evt:e,data:"USER_CLICKED_GEO_REDIRECT_LINK",calEvent:!0}),t.log({evt:"actionType",data:"geo_redirect_link",instrument:!0}),t.pushLogs(),window.location.href=i}),s&&(t.log({evt:e,data:"TRIGGERED_AUTO_REDIRECTION",calEvent:!0}),t.log({evt:"actionType",data:"geo_auto_redirection",instrument:!0}),t.pushLogs(),window.location.assign(i))},n}(),login.otp=function(){function i(e){var t=document.querySelector("#main"),n=t.querySelectorAll("section")||[];for(var r=0;r<n.length;r++){var i=n[r].querySelector(".notifications");i&&$(i).text()&&$(i).text(""),$(n[r]).hasClass("hide")||$(n[r]).addClass("hide")}t.insertAdjacentHTML("afterbegin",e),login.footer&&login.footer(),login.countryList&&login.countryList.getCache("countryList")&&login.countryList.showCountryDropDown()}function s(e){var t=document.querySelector(".notifications");$(t).text(""),e&&e.msg&&(t.innerHTML='<p class="notification '+e.type+'" role="alert">'+e.msg+"</p>")}function o(e){var n=document.querySelector(".otpDisplayCredentials a");n&&addEvent(n,"click",function(n){eventPreventDefault(n),login.utils.notYouClickHandlerForCookiedUser(n,function(){login.utils.showSpinner({nonTransparentMask:!0}),login.logger.log({evt:"state_name",data:"begin_"+e.stateName,instrument:!0}),login.logger.log({evt:"transition_name",data:"click_not_you"+(t?"_"+t:""),instrument:!0}),login.logger.pushLogs()})})}function u(){var e=document.querySelector(".otpLoginPrimary #signupContainer"),t=document.querySelector(".otpLoginPrimary #createAccount"),n=t&&t.getAttribute("href");if(!e)return;n&&addEvent(t,"click",function(e){eventPreventDefault(e),login.logger.log({evt:"state_name",data:"begin_otp",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_onboarding",instrument:!0}),login.logger.pushLogs(),window.location.href=n})}function a(){var e=document.querySelector(".otpLoginPrimary #forgotPasswordModal"),t=e&&e.getAttribute("href");if(!e)return;t&&addEvent(e,"click",function(e){eventPreventDefault(e),login.logger.log({evt:"state_name",data:"begin_otp",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_setup_pwd",instrument:!0}),login.logger.pushLogs(),window.location.href=t})}function f(){var e=document.querySelectorAll("input")||[],n={};for(var r=0;r<e.length;r++)n[e[r].name]=e[r].value;var i=n.otpNewExp;if(document.querySelector("#verifyOtp")&&n.autoSmsSent){i?verifyOtpPrimary(t).attachFormEvents():verifyOtp().attachFormEvents(),p({stateName:"verify_auto_otp"}),login.logger.log({evt:"state_name",data:"verify_auto_otp",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_verify_auto_otp"+(t?"_"+t:""),instrument:!0}),login.logger.pushLogs();var s=document.querySelector("#otp1");s.click()}}function l(e){function h(e){e=e||{},e.notifications&&(s(e.notifications),o.value=e._csrf,login.utils.hideSpinner()),e.html&&i(e.html),document.querySelector("#verifyOtp")&&($("#otpLogin").remove(),l?verifyOtpPrimary(t).attachFormEvents():verifyOtp().attachFormEvents(),p({stateName:"verify_otp"}),login.logger.log({evt:"state_name",data:"begin_verify_otp",instrument:!0}),login.logger.log({evt:"transition_name",data:"prepare_verify_otp"+(t?"_"+t:""),instrument:!0}),login.logger.pushLogs()),login.utils.hideSpinner();var n=document.querySelector("#otp1");n.click()}var n=getEventTarget(e),r=n.querySelectorAll("input")||[],o=document.querySelector("#token")||{},u=document.querySelector(".selectPhoneChallenges select"),a={};eventPreventDefault(e);for(var f=0;f<r.length;f++)a[r[f].name]=r[f].value;var l=a.otpNewExp;if(u){var c=u.options[u.selectedIndex];a.challengeId=c.value,a.maskedPhoneNumber=$(c).text()}login.utils.showSpinner(),$.ajax({url:n.getAttribute("action"),type:"POST",data:a,success:h,fail:function(){login.utils.hideSpinner()}})}function c(){n.hasAttribute("disabled")&&n.removeAttribute("disabled"),r.hasAttribute("disabled")&&r.removeAttribute("disabled")}function h(){var e=document.querySelector("#main section");$(e).remove(),c(),$("#login").removeClass("hide"),y({loginPreference:"password_login"})}function p(e){var t=document.querySelector(".secondaryLink a"),n=document.querySelector("form[name=sendOtp] input[name=otpVariant]")||document.querySelector("form[name=verifyOtp] input[name=otpVariant]"),r=document.querySelector("form[name=sendOtp] input[name=email]")||document.querySelector("form[name=verifyOtp] input[name=email]"),i=$("#beginOtpLogin");addEvent(t,"click",function(){eventPreventDefault(event);if(PAYPAL.unifiedLoginInlinePostMessage){login.utils.sendPostMessage("NOT_NOW");return}n&&n.value==="onOnboardingFlow"&&r&&r.value?(login.utils.showSpinner(),login.utils.submitPublicCredential(r.value)):h(),i&&i.hasClass("hidden")&&i.removeClass("hidden"),login.logger.log({evt:"state_name",data:"begin_"+e.stateName,instrument:!0}),login.logger.log({evt:"transition_name",data:"click_login_another_way",instrument:!0}),login.logger.pushLogs()})}function d(e){var t=document.querySelector(".selectedPhoneChallenge span"),n=getEventTarget(e),r=$(n.options[n.selectedIndex]).text();login.logger.log({evt:"state_name",data:"begin_verify_otp",instrument:!0}),login.logger.log({evt:"transition_name",data:"existing_linked_number_changed",instrument:!0}),login.logger.pushLogs(),$(t).text(r)}function v(){var e=document.querySelector("#otpLogin .proceed"),t=document.querySelector(".selectPhoneChallenges select");e&&addEvent(e,"submit",l),f(),p({stateName:"otp_interstitial"}),o({stateName:"verify_otp"}),u(),a(),login.pubsub.subscribe("SHOW_PASSWORD",h),t&&addEvent(t,"change",d)}function m(e){i(e),v(),login.logger.log({evt:"state_name",data:"begin_otp_interstitial",instrument:!0}),login.logger.log({evt:"transition_name",data:"otp_interstitial"+(t?"_"+t:""),instrument:!0}),login.logger.pushLogs()}function g(){var i=document.querySelector("#beginOtpLogin a")||document.querySelector("#beginOtpLogin button"),s=i&&$(i.parentNode),o=document.querySelector("#loginWithOtp"),u=$("body").data("otpLoginIntegrationType")||"";login.utils.hideSpinner(),o&&o.classList&&o.classList.remove("hide");if(!i||!s)return;addEvent(i,"click",function(i){eventPreventDefault(i),login.logger.log({evt:"state_name",data:"begin_pwd",instrument:!0}),login.logger.log({evt:"transition_name",data:"click_otp_login"+(t?"_"+t:""),instrument:!0}),login.logger.log({evt:"OTP_LOGIN",data:"CLICK_VIA_LINK",calEvent:!0}),login.logger.pushLogs(),e.get("sendSmsChallengePage")&&(m(e.get("sendSmsChallengePage")),n.hasAttribute("disabled")||n.setAttribute("disabled","disabled"),r.hasAttribute("disabled")||r.setAttribute("disabled","disabled")),y({loginPreference:"otp_login"})});if(u==="via_link"){s.removeClass("notVisible");return}u==="via_button"&&s.removeClass("hidden")}function y(t){function d(n){login.logger.log({evt:"CHALLENGE_SMS_SUCCESS",data:"CHALLENGE_SMS_SUCCESS",calEvent:!0}),login.logger.log({evt:"state_name",data:"otp_cs_eligibility",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_otp_cs_eligibility",instrument:!0});if(!h&&a&&(!t.otpLoginEligible||!l)){c(),login.logger.log({evt:"CHALLENGE_SMS_SUCCESS",data:"OTP_LOGIN_INELIGIBLE",calEvent:!0}),login.logger.log({evt:"int_error_code",data:"opt_login_ineligible_sms",instrument:!0}),login.logger.pushLogs(),login.utils.hideSpinner();return}if(n&&n.html){if(t.integrationType==="autoSendOtp"||t.integrationType==="onOnboardingFlow")e.update({sendSmsChallengePage:n.html}),m(n.html);g(),login.logger.log({evt:"source_decisioning",data:"otp_login_via_link_shown",instrument:!0}),login.logger.log({evt:"int_error_code",data:"opt_login_ineligible_html",instrument:!0}),login.logger.pushLogs(),e.update({sendSmsChallengePage:n.html});return}c(),login.logger.pushLogs(),login.utils.hideSpinner()}function v(e){login.logger.log({evt:"CHALLENGE_SMS_HANDLE_XHR",data:"CHALLENGE_SMS_HANDLE_XHR",calEvent:!0}),login.logger.log({evt:"state_name",data:"otp_cs_eligibility",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_otp_cs_eligibility",instrument:!0});if(!t.otpLoginEligible&&!h){login.logger.log({evt:"CHALLENGE_SMS_HANDLE_XHR",data:"OTP_LOGIN_INELIGIBLE",calEvent:!0}),login.logger.log({evt:"int_error_code",data:"opt_login_ineligible_handle_xhr",instrument:!0}),login.logger.pushLogs(),login.utils.hideSpinner();return}if(e.notifications){s(e.notifications),i.value=e._csrf,login.logger.log({evt:"CHALLENGE_SMS_HANDLE_XHR",data:"NOTIFICATIONS",calEvent:!0}),login.logger.log({evt:"int_error_code",data:"opt_login_notifications",instrument:!0}),login.logger.pushLogs(),login.utils.hideSpinner();return}e.html&&(login.logger.log({evt:"CHALLENGE_SMS_HANDLE_XHR",data:"HTML",calEvent:!0}),login.logger.log({evt:"int_error_code",data:"opt_login_html",instrument:!0}),m(e.html)),login.logger.pushLogs(),login.utils.hideSpinner()}var n=document.querySelector(".proceed"),r=n.querySelectorAll("input")||[],i=document.querySelector("#token")||{},o=t.integrationType==="viaLink"||t.integrationType==="autoSendOtp"||t.integrationType==="secondaryOtp"||t.integrationType==="onOnboardingFlow",u={},a=document.querySelector("#login"),f=document.querySelector("#phoneCode"),l=document.querySelector("#beginOtpLogin"),h=$("body").data("isOtpSmsUser");for(var p=0;p<r.length;p++)u[r[p].name]=r[p].value;u.login_phone&&f&&(u.phoneCode=f.value),u.otpVariant=t.integrationType,u.loginPreference=t.loginPreference,!o&&!t.loginPreference&&login.utils.showSpinner(),$.ajax({url:"/signin/challenge/sms",type:"POST",data:u,success:function(e){e=e||{};if(e.loginPreferenceUpdated){login.utils.hideSpinner();return}o?d(e):v(e)},fail:function(){login.logger.log({evt:"CHALLENGE_SMS_FAILURE",data:"CHALLENGE_SMS_FAILURE",calEvent:!0}),login.logger.log({evt:"state_name",data:"otp_cs_eligibility",instrument:!0}),login.logger.log({evt:"transition_name",data:"process_otp_cs_eligibility",instrument:!0}),login.logger.log({evt:"int_error_code",data:"challenge_sms_failure",instrument:!0}),login.logger.pushLogs(),!o&&login.utils.hideSpinner()}})}function b(e){var t=$("body").data("userDeviceTokenLogin"),n=window.PAYPAL.ulData||{},r=n.aPayAuth,i=$("body").data("oneTouchUser");login.logger.log({evt:"HANDLE_AUTO_SEND",data:"HANDLE_AUTO_SEND",calEvent:!0}),e.otpVariant==="autoSendOtp"&&y({integrationType:e.otpVariant,otpLoginEligible:e.otpLoginEligible});if($("body").data("otpVariant")!=="autoSendOtp"){login.logger.log({evt:"HANDLE_AUTO_SEND",data:"NOT_AUTO_OTP",calEvent:!0}),login.logger.pushLogs();return}if($("body").data("otpVariant")==="autoSendOtp"&&(r||t||i)){login.logger.log({evt:"HANDLE_AUTO_SEND",data:r||t||i?"PASSWORDLESS_LOGIN":"",calEvent:!0}),login.logger.pushLogs();return}login.logger.pushLogs(),y({integrationType:$("body").data("otpVariant"),otpLoginEligible:$("body").data("otpLoginEligible")})}function w(e){var t=document.querySelector(".startOtpLogin");addEvent(t,"click",function(t){eventPreventDefault(t),login.logger.log({evt:"state_name",data:"begin_pwd",instrument:!0}),login.logger.log({evt:"transition_name",data:"click_otp_link",instrument:!0}),login.logger.pushLogs(),y({integrationType:"onPasswordFailure",otpLoginEligible:$("body").data("otpLoginEligible")||e.otpLoginEligible})})}function E(e){if(e.integrationType!=="onOnboardingFlow")return;y({integrationType:e.integrationType,otpLoginEligible:$("body").data("otpLoginEligible")||e.otpLoginEligible})}function S(e){if(e.integrationType!=="onTryAnotherWayModal")return;y({integrationType:e.integrationType,otpLoginEligible:$("body").data("otpLoginEligible")||e.otpLoginEligible})}function x(e){var n=$("#beginOtpLogin");if(!e)return;!e.otpLoginOnPwdPageEnabled&&n&&n.hasClass("otpLoginViaLink")&&!n.hasClass("notVisible")&&n.addClass("notVisible"),!e.otpLoginOnPwdPageEnabled&&n&&n.hasClass("otpLoginViaButton")&&!n.hasClass("hidden")&&!login.otp.hideOnboardingModal&&n.addClass("hidden"),!Object.keys(e).length&&$("body").data("otpLoginOnPwdPageEnabled")&&$("body").data("otpVariant")!=="autoSendOtp"&&(t=$("body").data("otpVariant")?$("body").data("otpVariant"):"viaLink",setTimeout(y.bind(null,{integrationType:t,otpLoginEligible:$("body").data("otpLoginEligible")}),50)),e.otpLoginOnPwdPageEnabled&&e.otpVariant!=="autoSendOtp"&&(t=e.otpVariant?e.otpVariant:"viaLink",setTimeout(y.bind(null,{integrationType:t,otpLoginEligible:e.otpLoginEligible}),500))}function T(t){var n=$("body").data("loginExperience")==="safari",r=t.isOtpSmsUser,i=login.utils.isFieldPrefilled(document.querySelector("#password")),s=n&&i,o=$("body").data("otpVariant");t.otpInterstitialHtml&&(!login.utils.isSiAppleActivationProcessing()&&!s||r)&&(e.update({sendSmsChallengePage:t.otpInterstitialHtml}),login.otp.hideOnboardingModal||(o="autoSendOtp",m(t.otpInterstitialHtml)),r?login.utils.hideSpinner():g());if(t.otpInterstitialHtml&&s&&!r){var u=$("#beginOtpLogin");u&&u.hasClass("hidden")&&u.removeClass("hidden"),login.logger.log({evt:"autofilled_credentials",data:"Y",instrument:!0}),login.logger.pushLogs(),o="secondaryOtp",setTimeout(y.bind(null,{integrationType:o,otpLoginEligible:!0}),50)}}function N(){var t=$("#beginOtpLogin");if(!t)return;t.hasClass("otpLoginViaLink")&&!t.hasClass("notVisible")&&t.addClass("notVisible"),t.hasClass("otpLoginViaButton")&&!t.hasClass("hidden")&&t.addClass("hidden"),e.clear("sendSmsChallengePage")}var e=login.utils.createCache(),t=$("body").data("otpVariant"),n=document.querySelector("#email"),r=document.querySelector("#password");return{prepareSendPage:function(e){e=e||{},w(e),E(e),S(e),b(e),x(e),T(e),login.pubsub.subscribe("CLEAR_OTP_LOGIN_CONTEXT",N)},attachSendPageEvents:v,enableEmailPasswordField:c,loadChallengePage:y}}(),login.bootstrap=function(){login.fn.initialize(),login.checkoutIncontext&&login.checkoutIncontext();var e=$("body").data("autoTriggerLoginPriority"),t=login[e];return t?t(function(){return loadFeatures()}):loadFeatures()},document.onreadystatechange=function(){var e,t=login.utils.getSplitLoginContext(),n=login.utils.getIntent(),r=$("body").data("cookieBannerEnabled"),i=$("body").data("oneTouchUser"),s=document.querySelector('input[name="setBuyer"]'),o=$("body").data("loadStartTime"),u=$("body").data("isCookiedUser");document.readyState==="complete"&&(login.logger.log({evt:"transition_name",data:"cpl_prepare_login_ul",instrument:!0}),login.utils.logCPLData({startTime:o,status:"success",flowName:u?"Hybrid Login Cookied":"Hybrid Login Uncookied"}),login.bootstrap(),e=window.PAYPAL&&window.PAYPAL.ulData||{},e.preloadScriptUrl&&asyncLoadAssetUrls(e.preloadScriptUrl),t?instrumentSplitLoginPageLoad(t):(n==="checkout"&&instrumentUlAsLandingPageLoad(),n==="prox"&&instrumentProx()),addEvent(document,"click",login.utils.documentClickHandler),login.pubsub.subscribe("WINDOW_CLICK",login.utils.toggleRememberInfoTooltip),login.pubsub.subscribe("WINDOW_CLICK",function(e){var t=getEventTarget(e),n=$(t).data("clientLogActionType");n&&(login.logger.log({evt:"actiontype",data:n,instrument:!0}),login.logger.pushLogs())}),showReturnToMerchantLink(),e.fingerprintProceed==="lookup"&&fingerprint&&fingerprint.lookup(),e.fingerprintProceed==="login"&&fingerprint&&fingerprint.login(),r&&!i&&login.loadResources&&login.loadResources.showCookieBanner(),login.utils.isAppDownloadBannerSupported()&&login.loadResources&&login.loadResources.showAppDownloadBanner(),login.loadResources&&login.loadResources.lazyload(),s&&setTimeout(function(){login.utils.isFnDataLoaded()&&login.xoPlanning.triggerSetBuyerCall(s.value)},300))}}();
1