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='
'+e.msg+"
")}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=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'+e.msg+"")}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=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;o0);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;s0)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 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=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-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]*>|<\/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(/^