PageSourceSearch

https://www.sfb.fr/cdn/shopifycloud/checkout-web/assets/c1/9011490c.DbWlkmGr.js

js sfb.fr collected 2026-10-02 10:32:09 UTC 25,178 bytes, 1 lines download raw bytes

1import{u as e,w as n,T as i,S as t,s as a,m as r,q as o,C as s,t as c,l,D as d,v as u,x as m,a as h,_ as p,z as f}from"./2c1ab0fe.GMbxnz74.js";import{ak as g,S as _,bE as y,fb as v,fc as b,fd as k,fe as S,E as w,ff as R,e_ as L,fg as I,fh as P,T as E,fi as D,eV as U,df as A,fj as C,eW as T,ax as x,fk as O,fl as j,fm as z,cj as q}from"./4c290a1e.C6TDJ9Fn.js";import{u as F,a as B,S as W}from"./8c0eaf27.2fgFaqTf.js";import{a as M,U as V}from"./a25deb9a.DBfpGDzj.js";import{L as N,B as H,fd as $,fp as K,b as G,bj as J,eR as Q,i as X,fq as Y,fr as Z,fs as ee,eS as ne,a7 as ie,t as te,ft as ae,bq as re,aW as oe,c as se,ah as ce,eQ as le,bu as de,V as ue,X as me,n as he,e as pe}from"./164ad2e3.BbIvMjRY.js";import{c as fe}from"./dfca5da5.BFrL439g.js";import{R as ge,D as _e,d as ye,e as ve,a as be,b as ke,p as Se,S as we,c as Re}from"./91319467.CaV5Q69j.js";import{R as Le,n as Ie,i as Pe,a as Ee,s as De}from"./945a08d6.BXUdjYDL.js";import{g as Ue}from"./d5d34b3b.81uMJHYl.js";import{MobileOrderSummary as Ae}from"./d2e6a587.DCUh30CB.js";import{u as Ce,S as Te}from"./ca5e9c49.BT49yYQL.js";import"./app.CepNJbvh.js";import"./e39bc11c.BPwkTsU-.js";import"./9f047e05.CCJUgz_L.js";import"./0a7dffce.DfUtZWCu.js";import"./5fda1420.KYpufQ--.js";import"./60a453ce.CkhHeRBc.js";import"./21cc90a2.DAzJmttM.js";import"./bb728e1c.iawBHR84.js";import"./7b0c98ea.CqdLBMXo.js";import"./1ed8f5e3.DkmKdCgD.js";function xe({isShopPayExternal:i}){const t=g();return i?null:e(n,{when:t,children:e(Oe,{})})}function Oe(){const{i18n:n}=_();return i(()=>{const e=""!==document.referrer,n=window.history&&window.history.length>1;return e||n},[])?e(H,{inlineAlignment:"center",children:e(N,{onClick:()=>{window.history.back()},accessibilityLabel:n.translate("account_management.back"),textDecoration:"none",children:n.translate("account_management.back")})}):null}function je(){const{href:n,label:i,onClick:a}=$(K.Login);return e(t,{children:[e(G,{blockSize:"large-100"}),e(H,{inlineAlignment:"center",children:e(N,{href:n,onClick:a,textDecoration:"none",children:i})})]})}function ze({iframeOrigin:e,observability:n,onError:i,onLoaded:t,onLoggedIn:o,skip:s=!1}){const c=a(e=>{switch(e.action){case ge.Loaded:return t?.();case ge.Error:return i?.(e.message)}},[t,i]);r(()=>{if(s)return;const t=t=>{if((a=t.origin)!==e&&!ve.includes(a))return;var a;const{data:r}=t;if((e=>e&&"object"==typeof e&&"redirect_url_on_complete"===e.type&&e.postSignInUrl)(r))try{const e=new URL(r.postSignInUrl).searchParams.get("token");e&&o?.(e)}catch{i?.("shop_pay_embedded_login_url_parse_error"),n?.log("shop_pay_embedded_login_url_parse_error","Failed to parse redirect URL")}else if((e=>e&&"string"==typeof e&&e.includes(_e))(r))try{const[e,...n]=r.split(_e);if(e!==ye)return;const i=JSON.parse(n.join(_e));c(i)}catch{i?.("shop_pay_embedded_login_event_error"),n?.log("shop_pay_embedded_login_event_error","Failed to parse event")}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[o,n,e,i,c,s])}var qe=(e=>(e.Seamless="seamless",e.OAuth="oauth",e.OAuthWithEmbeddedContext="oauthWithEmbeddedContext",e.Embedded="embedded",e))(qe||{});function Fe(){const{shop:e,shopPay:n,embed:i,mobileCheckoutSdk:t}=_(),a=t.enabled||i?.isCheckoutKit();return y(i?.embedder)?"embedded":i?.isFlagshipPartner||v(n)?"seamless":b(n)||a&&e.hasFlagEnabled(k)?"embedded":a&&e.hasFlagEnabled(S)?"oauthWithEmbeddedContext":a?"seamless":"oauth"}function Be(e,n,i){return Boolean(e?.isFlagshipPartner)||i&&R(n)}function We(){const e=function(){const{checkout:e}=_(),n=function(){const e=o(!1);return s(()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const n=window.matchMedia("(prefers-color-scheme: dark)");e.value=n.matches;const i=n=>{e.value=n.matches};return"function"==typeof n.addEventListener?(n.addEventListener("change",i),()=>n.removeEventListener("change",i)):void 0}),e}();return c(()=>{const{customProperties:i,darkModeCustomProperties:t}=e.configuration.branding.theme,a=function({customProperties:e}){return e?.color?.schemes?.scheme1?.base?.background}({customProperties:n.value&&t.value||i.value});if("undefined"!=typeof document&&"undefined"!=typeof window&&"function"==typeof window.getComputedStyle){const e=Ue(document.body);if(Le.test(e))return e}return a})}();return c(()=>{const n=Ie(e.value??"rgba(255, 255, 255, 1)");
1return{isDark:Pe(n,"rgb(255, 255, 255)"),parentBackgroundColor:n}})}function Me(){const e=We();return l(e.peek()).current}function Ve(e){const n=l("");return!n.current&&L(e)&&(n.current=e),n.current}const Ne=(e="")=>{const{client:n,shopPay:t,environment:a,i18n:{locale:r},shop:o,source:{checkoutSessionIdentifier:s},embed:c,checkout:{proposal:{proposed:l}}}=_(),d=o.hasFlagEnabled(I),u=Be(c,t,d),m=Ve(l.email.value),h=d?m:l.email.value,p=P(n.initialRequest.url),f=E().buyerIdentity.value?.customerProfile,g=t.signup.skipAutomaticLoginAttempt.value,y=J({include:{shopId:!0}}),{parentBackgroundColor:v,isDark:k}=Me();return i(()=>{if(!s)return{origin:"c1_login",frameUrl:"",flow:"pay_checkout_login"};const{origin:i,flowVersion:l}=function(e){return b(e)?{origin:Q.PaymentRequest,flowVersion:"iframe"}:{origin:"c1_login",flowVersion:"iframe"}}(t),d=new URLSearchParams(n.initialRequest.url.search),m=new URLSearchParams;m.set("locale",r),m.set("analytics_trace_id",e),m.set("origin",i),m.set("checkout_token",s),m.set("flow","pay_checkout_login"),m.set("flow_version",l??""),m.set("authentication_level","phone"),m.set("target_origin",window.location.origin),m.set("storefront_domain",o.domain),m.set("layout","full"),k&&m.set("theme","dark"),v&&m.set("parent_background_color",v),p&&(m.set("force_authentication","true"),m.set("prompt","login"));const _=d.get("login_hint");_?m.set("login_hint",_):u&&h&&!p&&!g?m.set("login_hint",h):!g&&f?.email&&m.set("login_hint",f.email);const S=d.get("shop_client_uuid")??c?.shopClientUuid??d.get("client_uuid");S&&m.set("client_uuid",S),y(m,d);const w=new URL("/accounts/login/embedded",a.services.shopServer.url);return w.search=m.toString(),{origin:i,frameUrl:w.href,flow:"pay_checkout_login"}},[e,k,v,s,n.initialRequest.url.search,f?.email,a.services.shopServer.url,p,r,c?.shopClientUuid,y,o.domain,h,t,g,u])};function He({analyticsTraceId:e,loginData:n}){const{progress:i}=X(),{shopPay:t,observability:r}=_(),{config:o,updateAccessToken:s}=t,{exchangeSessionTokenForCookie:c}=be(),{extendBuyerIdentity:l}=ke(),{checkoutAsGuestUrl:d}=o,{replaceShopPayInHistory:u}=D(),{flow:m,origin:h}=n;return a(async(n,a)=>{if(a)s(a);else if(n){const i=await c({token:n,origin:h,analytics_trace_id:e,flow:m});i.ok||(r.log("shop_pay_login_frame_session_token_exchange_failed","exchangeSessionTokenForCookie request failed",{status:i.status}),i.status>=500&&u(d))}await l(),t.signup.unstable_setSkipAutomaticLoginAttempt(!1),i("shop-pay-login-success")},[i,s,c,h,m,e,l,d,u,r,t.signup])}const $e="vUvXb",Ke="WC8Ph",Ge="oX06g",Je=d(function({title:n,src:i,height:t,hidden:a=!1,onLoad:r,className:o,allow:s=Qe()},c){return e("iframe",{ref:c,id:Z,title:n,src:i,onLoad:r,height:t,width:Y,className:u("_5Z70J",{[$e]:a},o),"aria-hidden":!!a||void 0,allow:s})});function Qe(){return ee}function Xe({hidden:n=!1,iframeLoaded:s=!1,loginData:c,onIframeLoad:d,renderListeners:u,serverDrivenAuth:h,serverRenderedIframe:p=!1}){const f=o(!1),{client:g,environment:y,i18n:v,observability:b,shop:k,shopPay:S}=_(),w=l(null),L=Fe(),{frameUrl:P}=c,E=Boolean(P),D=!(s||f.value);F(D);const U=i(()=>{try{return new URL(P).origin}catch{return""}},[P]),A=R(S);let C="empty";U===y.services.shopServer.url?C="shop_server":U===y.services.payShopifyCom.url?C="pay_shopify":U&&(C="merchant_storefront"),function({frameUrl:e,loginVariant:n,sdkLoginHintFlagEnabled:i,shopPaySdkCheckout:t}){const{checkout:a,client:o,observability:s}=_(),c=Boolean(e),l=function(e){try{return new URL(e).searchParams.has("login_hint")}catch{return!1}}(e),d=Boolean(a.proposal.proposed.email.value),u=new URLSearchParams(o.initialRequest.url.search).has("login_hint");r(()=>{c&&s.counter({name:"shop_pay_login_hint",value:1,attributes:{checkoutUrlHint:u,loginHintSent:l,loginVariant:n,proposedEmailAvailable:d,sdkLoginHintFlagEnabled:i,shopPaySdkCheckout:t}})},[u,c,l,n,s,d,i,t])}({frameUrl:P,loginVariant:L,sdkLoginHintFlagEnabled:k.hasFlagEnabled(I),shopPaySdkCheckout:A});const T={serverDrivenAuth:h,hidden:n,shopPaySdkCheckout:A,serverRendered:g.initialRequest.isServerRendered,serverRenderedIframe:p,loginVariant:L};ne({enabled:E&&D,onTimeout:e=>{const n={timeout:e,...T,frameHostKind:C,documentReadyState:document.readyState};b.counter({name:"shop_pay_login_frame_load_timeout",value:1,exportImmediately:!0,attributes:n}
1),b.log("shop_pay_login_frame_load_timeout","Shop Pay login iframe never fired its load event",{...n,iframeOrigin:U},{exportImmediately:!0})}}),ne({enabled:!E,onTimeout:e=>{const n={timeout:e,...T,documentReadyState:document.readyState};b.counter({name:"shop_pay_login_frame_url_missing",value:1,exportImmediately:!0,attributes:n}),b.log("shop_pay_login_frame_url_missing","Shop Pay login frame never received a URL",n,{exportImmediately:!0})}});const x=h?370:250,[O,j]=m(x),z=a(e=>{j(e)},[]),q=a(()=>{f.value=!0,d?.()},[f,d]);return P?e(t,{children:[u?.({iframeOrigin:U,iframeRef:w,onResized:z}),e(Je,{ref:w,title:v.translate("verification.title"),src:P,onLoad:q,height:O,hidden:n})]}):null}function Ye({iFrameRef:e,iframeOrigin:n,isEmbeddedShopPayTheme:i=!1}){const t=ie(),r=We(),o=i&&n?n:window.location.origin;return{dispatchThemeMessage:a(()=>{if(!e.current?.contentWindow)return;const{isDark:n,parentBackgroundColor:i}=r.value,t={theme:n?"dark":"light",type:"theme"};i&&(t.parentBackgroundColor=i),e.current.contentWindow.postMessage(t,o)},[e,r,o]),dispatchStyleMessage:a(()=>{if(!e.current?.contentWindow)return;const n=function(e){return en(Object.fromEntries(Object.entries(e).filter(([e])=>Ze(e))),A)}(t.customProperties.value);!function(e,n,i){const t=U(),a=A.borderRadius.base,r=A.borderRadius.large,o=A.control.borderRadius,s=n=>t||!e[n],c=n.configuration.cornerRadius.base?`${n.configuration.cornerRadius.base}px`:te.borderRadius.base,l=n.configuration.primaryButton.cornerRadius;let d=te.borderRadius.base;"none"===l?d="0px":l&&(d=te.borderRadius[l]??te.borderRadius.base),s(a)&&(e[a]=c),i?e[r]=te.borderRadius.base:s(r)&&(e[r]=d),e[o]||(e[o]=te.borderRadius.base)}(n,t,i),e.current.contentWindow.postMessage({type:"style",style:nn(n)},o)},[e,t,o,i]),resolvedParentBackground:r}}const Ze=e=>["borderRadius","control"].includes(e);function en(e,n){const i=Object.entries(e).flatMap(([e,i])=>"object"!=typeof i||Array.isArray(i)||null==i?null!=n[e]&&null!=i?[[n[e],i]]:[]:n[e]?Object.entries(en(i,n[e])):[]);return Object.fromEntries(i)}const nn=e=>Object.entries(e).map(([e,n])=>`${e}: ${n};`).join("");function tn({iframeRef:e,iframeOrigin:n,onLoggedIn:i}){const{checkout:t,observability:o}=_(),{isEmbeddedShopPayTheme:s}=t.configuration.branding,{dispatchThemeMessage:c,dispatchStyleMessage:l,resolvedParentBackground:d}=Ye({iFrameRef:e,iframeOrigin:n,isEmbeddedShopPayTheme:s}),u=d.value,m=a(()=>{c(),l()},[c,l]);return r(()=>{c()},[c,u]),ze({iframeOrigin:n,observability:o,onLoaded:m,onLoggedIn:i}),null}function an({analyticsTraceId:n,...i}){const t=Ne(n),a=He({analyticsTraceId:n,loginData:t});return e(Xe,{...i,loginData:t,renderListeners:({iframeOrigin:n,iframeRef:i})=>e(tn,{iframeRef:i,iframeOrigin:n,onLoggedIn:a}),serverDrivenAuth:!0})}const rn="c1_login",on="pay_checkout_login";function sn(){return{origin:rn,frameUrl:"",flow:on}}function cn(e="",{includeEmbeddedContext:n=!1}={}){const{client:t,embed:a,shopPay:r,i18n:{locale:o},shop:s,source:{checkoutSessionIdentifier:c,sourceId:l},checkout:{proposal:{proposed:d}}}=_(),{config:u,signup:m}=r,h=s.hasFlagEnabled(I),p=Ve(d.email.value),f=h?p:d.email.value,g=Be(a,r,h),y=P(t.initialRequest.url),v=E().buyerIdentity.value?.customerProfile,b=ae(),k=m.skipAutomaticLoginAttempt.value,{redirectUrl:S}=u,w=J({include:{shopId:!0}}),{parentBackgroundColor:R,isDark:L}=Me(),D=n?w:void 0,U=n?a?.shopClientUuid:void 0,A=n?void 0:b,C=t.unstable_getSerialization("shopPayLoginOAuthState"),T=i(()=>C??function(){const e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(36)).join("")}(),[C]);return i(()=>{if(!c)return sn();const n=new URLSearchParams;!function(e,{analyticsTraceId:n,checkoutSessionIdentifier:i,domain:t,locale:a,oAuthState:r,sourceId:o}){e.set("client_id",""),e.set("redirect_uri",`https://${t}/services/login_with_shop/callback`),e.set("scope","openid email profile"),e.set("response_type","code"),e.set("state",r),e.set("storefront_domain",t),e.set("locale",a),e.set("analytics_trace_id",n),e.set("origin",rn),e.set("checkout_token",i),e.set("checkout_source_id",o),e.set("flow",on),e.set("target_origin",`https://${t}`),e.set("ux_mode","iframe"),e.set("layout","full")}(n,{analyticsTraceId:e,checkoutSessionIdentifier:c,domain:s.domain,locale:o,oAuthState:T,sourceId:l}),void 0!==A&&n.set("shop_id",String(A)),L&&n.set("theme","dark"),R&&n.set("parent_background_color",R),S&&n.set("checkout_redirect_url",S),y&&(n.set("force_authentication","true"),n.set("prompt","login")),u.transactionParams&&n.set("transaction_params",u.transactionParams);const i=new URLSearchParams(t.initialRequest.url.search),a=i.get("login_hint");a?n.set("login_hint",a):g&&f&&!y&&!k?n.set("login_hint",f):!k&&v?.email&&n.set("login_hint",v.email);const r=function(e,n){return e.get("shop_client_uuid")??n??e.get("client_uuid")}(i,U);r&&n.set("client_uuid",r),D?.(n,i);
1try{const e=new URL("/services/login_with_shop/authorize",`https://${s.domain}`);return e.search=n.toString(),{origin:rn,frameUrl:e.href,flow:on}}catch{return sn()}},[u.transactionParams,e,D,c,t.initialRequest.url.search,g,v?.email,s.domain,U,y,f,L,R,o,A,S,k,T,l])}const ln=(e="")=>cn(e,{includeEmbeddedContext:!0});function dn({analyticsTraceId:n,...i}){const t=ln(n),a=He({analyticsTraceId:n,loginData:t});return e(Xe,{...i,loginData:t,renderListeners:({iframeOrigin:n,iframeRef:i})=>e(tn,{iframeRef:i,iframeOrigin:n,onLoggedIn:a}),serverDrivenAuth:!0})}const un=(e="")=>cn(e);function mn({iframeRef:e}){const{checkout:n,environment:i,observability:t,router:a,source:o}=_(),{replaceShopPayInHistory:s}=D(),c=new URL(i.services.shopServer.url).origin,d=o.checkoutSessionIdentifier,u=l(!1);return r(()=>{const i=({data:i,origin:r,source:o})=>{if(u.current||r!==c||!e.current?.contentWindow||o!==e.current.contentWindow||!i||"object"!=typeof i||!("type"in i)||"pay_guest_session_ready"!==i.type)return;const l=new URL(window.location.href);C(l.pathname)&&(u.current=!0,t.counter({name:"guest_handoff_received",value:1,exportImmediately:!0,requiresKeepalive:!0}),t.log("guest_handoff_received","Shop Pay guest handoff received",{checkoutToken:d},{exportImmediately:!0,requiresKeepalive:!0}),l.pathname=a.resolve("/shoppay").pathname,n.unstable_setRedirectingExternally(!0),setTimeout(()=>s(l.toString()),0))};return window.addEventListener("message",i),()=>window.removeEventListener("message",i)},[n,d,e,t,s,a,c]),null}function hn({analyticsTraceId:n,hidden:i,iframeLoaded:t,onIframeLoad:a,serverRenderedIframe:r}){const o=un(n);return e(Xe,{hidden:i,iframeLoaded:t,loginData:o,onIframeLoad:a,renderListeners:({iframeRef:n})=>e(mn,{iframeRef:n}),serverDrivenAuth:!0,serverRenderedIframe:r})}var pn=(e=>(e.Partner="sdk_partner",e.Merchant="sdk_merchant",e))(pn||{});const fn=(e="")=>{const{client:n,shopPay:t,embed:a,environment:r,i18n:{locale:o},observability:s,shop:c,source:{checkoutSessionIdentifier:l},mobileCheckoutSdk:d,checkout:{proposal:{proposed:u}}}=_(),m=c.hasFlagEnabled(I),h=Ve(u.email.value),p=m?h:u.email.value,{config:f}=t,g=P(n.initialRequest.url),{transactionParams:y,tokens:v}=f,k=E().buyerIdentity.value?.customerProfile,S=re().value,w=Ee(),R=M(),L=r.services.payShopifyCom.url,D=n.unstable_getSerialization("shopClientUuid"),U=J({include:{shopId:!0}}),A=Boolean(a?.isFlagshipPartner),C=Be(a,t,m),x=a?.shopClientUuid,O=t.signup.skipAutomaticLoginAttempt.value;return i(()=>{if(!l)throw new T({groupingHash:"ShopPayCheckoutIdentifierMissingError::LoginFrame"});const{origin:i,flowVersion:a,flow:r}=function(e){return b(e)?{origin:Q.PaymentRequest,flowVersion:e.flowVersion,flow:"payment_request"}:{origin:"c1_login",flowVersion:void 0,flow:void 0}}(t),u=a??(A?"iframe":void 0),m=new URLSearchParams(n.initialRequest.url.search),h=gn(m,"shop_client_uuid")??x??gn(m,"client_uuid")??D;A&&!h&&s.log("shop_pay_login_seamless_missing_client_uuid","[ShopPayLoginFrame] Embedded checkout missing shop_client_uuid for Login Seamless.");const f=new URLSearchParams({flow:r??"",locale:o,origin:i,isPointOfSale:String(S),transaction_params:y??"",flow_version:u??"",shopify_domain:c.myshopifyDomain,checkout_token:l,analytics_trace_id:e,shop_pay_button_variant:t.logoBrand,shop_pay_new_signup_login_variant:R});h&&f.set("client_uuid",h);const _=m.get("login_hint");_?f.set("login_hint",_):C&&p&&!g&&!O&&f.set("login_hint",p),!O&&k?.email&&f.set("storefront_account_email",k.email),w&&f.set(De,d.variant.isPartner()?pn.Partner:pn.Merchant),g||f.set("authorization",v.authorization??""),U(f,m);const I=new URL("/pay/authentication/login-seamless",L);return I.search=f.toString(),{origin:i,frameUrl:I.href}},[e,U,n.initialRequest.url.search,v,l,k?.email,g,L,w,A,S,o,c.myshopifyDomain,d,x,p,D,t,R,C,O,s,y])};function gn(e,n){return e.get(n)||void 0}function _n({iframeRef:e,iframeOrigin:n,onLoggedIn:i,onResized:t}){const{checkout:o,shopPay:s}=_(),{isEmbeddedShopPayTheme:c}=o.configuration.branding,{dispatchThemeMessage:l,dispatchStyleMessage:d,resolvedParentBackground:u}=Ye({iFrameRef:e,iframeOrigin:n,isEmbeddedShopPayTheme:c}),m=u.value,h=a(()=>{Se(e.current,{action:we.Ready}),e.current?.contentDocument?.body&&oe(e.current.contentDocument.body)?.focu
1s(),c&&(l(),d())},[l,d,e,c]);r(()=>{c&&l()},[l,c,m]);const p=a(e=>{s.signup.unstable_setHcaptchaToken(e)},[s.signup]);return Re({onLoaded:h,onLoggedIn:i,onResized:t,onShareCaptchaToken:p}),null}function yn({analyticsTraceId:n,...i}){const t=fn(n),a=He({analyticsTraceId:n,loginData:t});return e(Xe,{...i,loginData:t,renderListeners:({iframeOrigin:n,iframeRef:i,onResized:t})=>e(_n,{iframeRef:i,iframeOrigin:n,onLoggedIn:a,onResized:t}),serverDrivenAuth:!1})}function vn({serverRenderedIframe:n,...t}){const{client:a}=_(),r=Fe(),o=a.unstable_getSerialization("shopPayLoginAnalyticsTraceId"),s=i(()=>o??w(),[o]);switch(r){case qe.OAuth:return e(hn,{...t,analyticsTraceId:s,serverRenderedIframe:n});case qe.OAuthWithEmbeddedContext:return e(dn,{...t,analyticsTraceId:s});case qe.Embedded:return e(an,{...t,analyticsTraceId:s});case qe.Seamless:return e(yn,{...t,analyticsTraceId:s});default:return h(r)}}function bn({className:n}){const{i18n:i}=_(),t=i.translate("general.loading");return e(H,{accessibilityRole:"status",accessibilityLabel:t,"aria-live":"polite",className:n,children:e(se,{blockSize:"100%",padding:"large-200",gap:"large-100",children:[e(se,{alignItems:"center",gap:"large-100",children:[e(ce,{delay:!1,contentDisplay:"block",inlineSize:"92px",blockSize:"32px"}),e(ce,{delay:!1,contentDisplay:"block",inlineSize:"50%",blockSize:"16px"})]}),e(se,{gap:"small-400",children:e(ce,{delay:!1,contentDisplay:"block",inlineSize:"100%",blockSize:"52px"})}),e(ce,{delay:!1,contentDisplay:"block",inlineSize:"100%",blockSize:"52px"}),e(H,{paddingBlockStart:"large-200",children:e(se,{alignItems:"center",gap:"large-400",children:[e(ce,{delay:!1,contentDisplay:"block",inlineSize:"34%",blockSize:"14px"}),e(ce,{delay:!1,contentDisplay:"block",inlineSize:"100%",blockSize:"14px"})]})})]})})}function kn({serverRenderedIframe:n=!1}={}){const{client:i,environment:t,observability:r}=_(),s=t.services.shopServer.url,c=i.unstable_legacyNavigationPerformance,l=g(),d=o(!1),m=o(n&&!l.peek()),h=m.value,f=l.value||h,y=d.value,v=!y,b=c?.navigationStartTime??0,k=i.initialRequest.isServerRendered,S=a((e,n)=>{r.histogram({name:"shop_pay_login_form_visible_duration",value:Math.round(e-b),unit:"ms",attributes:{serverRendered:k,serverRenderedIframe:m.value,revealSource:n}})},[b,r,k,m]),w=a((e,n=performance.now())=>{d.value||(d.value=!0,S(n,e))},[d,S]),R=a(()=>{w("iframe_load")},[w]),L=a(()=>{w("login_message")},[w]);return ze({iframeOrigin:s,observability:r,onLoaded:L,skip:!f}),p(()=>
1{if(!h||!l.value)return;const e=()=>{w("page_load_fallback")};if("complete"!==document.readyState)return window.addEventListener("load",e,{once:!0}),()=>{window.removeEventListener("load",e)};e()},[l.value,h,w]),f?e("div",{className:u("K7GTB",{[Ke]:v}),children:[v&&e(bn,{className:Ge}),e(vn,{hidden:!y,iframeLoaded:d.value,onIframeLoad:R,serverRenderedIframe:h})]}):e(bn,{className:Ge})}function Sn(){const i=g(),{embed:t}=_();return y(t?.embedder)?e(n,{when:i,children:e(wn,{})}):null}function wn(){const{observability:e,source:n,embed:t,environment:a,url:o,shop:s}=_(),{iframeUrl:c,source:l}=function(e=""){const n={seamless:fn(e),embedded:Ne(e),oauth:un(e),oauthWithEmbeddedContext:ln(e)},t=Fe(),{serverDrivenAuth:a,variant:r}=(e=>{switch(e){case qe.OAuth:return{serverDrivenAuth:!0,variant:"oauth"};case qe.OAuthWithEmbeddedContext:return{serverDrivenAuth:!0,variant:"oauthWithEmbeddedContext"};case qe.Embedded:return{serverDrivenAuth:!0,variant:"embedded"};case qe.Seamless:default:return{serverDrivenAuth:!1,variant:"seamless"}}})(t),{frameUrl:o,origin:s,flow:c}=n[r];return{flow:c,iframeOrigin:i(()=>{try{return new URL(o).origin}catch{return""}},[o]),serverDrivenAuth:a,source:s,iframeUrl:o,variant:r}}(),d=t?.client?.embedderHostname;return r(()=>{if(!y(t?.embedder)||!c||!d)return;const i=new URL(c);i.searchParams.set("target_origin",`https://${d}`),function(e,n){e&&y(e.embedder)&&e.client?.error({code:"UC_LOGIN_REQUIRED",message:JSON.stringify(n),severity:"recoverable",timestamp:Date.now()})}(t,{loginUrl:i.href,exchangeUrl:new URL(o.shopPaySession(),a.services.shopServer.url).href,origin:l,shopifyDomain:s.myshopifyDomain,checkoutToken:n.
1checkoutSessionIdentifier??void 0}),e.counter({name:"universal_checkout_shop_pay_login_required_emitted",value:1})},[t,d,c,l,a.services.shopServer.url,o,s.myshopifyDomain,n.checkoutSessionIdentifier,e]),null}function Rn(){!function(){const{client:e,userEvents:n,source:i,checkout:t,shop:a,shopPay:o}=_(),{redirectSource:s,tracking:c}=o.config,{checkoutSessionIdentifier:l="checkout_identifier_undefined"}=i,d=le(O.SHOP_PAY_LOGIN),u=re().value;Ce({stage:Te.Complete,id:"ShopPayLogin"}),r(()=>{U()&&n.monorailEvent({schemaId:"shop_app_page_load/9.0",payload:{...x(i,t,a),platform:"web",locale:navigator.language,userToken:c.unique??e.cookies.get("_shopify_y")??"",webSessionToken:c.visit??e.cookies.get("_shopify_s")??"",pageType:"pay_checkout_login",pageValue:l}}),n.monorailEvent({schemaId:"shopify_pay_page_load/2.6",payload:{...x(i,t,a),pageType:"checkout_login",clientTimestampMs:Date.now(),redirectSource:s}}),u&&n.monorailEvent({schemaId:"retail_shop_pay/2.0",payload:d})},[e.cookies,n,i,t,a,s,d,u,l,c.unique,c.visit])}();const{client:n,router:i,shop:t,source:a,shopPay:o}=_(),s="shopPayExternal"===a.type,c=Fe(),l=c===qe.Seamless,d=i.currentUrl.value,m=d.href===n.initialRequest.url.href&&n.initialRequest.isServerRendered&&c===qe.OAuth,{isAppLayout:h}=de(),p=t.hasFlagEnabled(j)&&!s&&!h&&!U(d.search)&&!o.config.isReferral&&!d.searchParams.has(z)&&!0===n.unstable_getSerialization("shopPayConfig").has_remember_me_cookie&&o.visibility.showCheckoutAsGuestFeature;return e("div",{children:[e(Sn,{}),e(fe,{padding:"none",dividerDisplay:"@media (inline-size >= medium) none, auto",children:e(H,{padding:"@media (inline-size >= small) none none large-300 none, none",maxInlineSize:"@media (inline-size >= small) 425px, 432px",className:u("oSdnC"),children:e(fe,{padding:"none",borderWidth:l?"@media (inline-size >= small) base, none":void 0,borderRadius:l?"@media (inline-size >= small) base, none":void 0,hideDivider:!0,children:e(kn,{serverRenderedIframe:m})})})}),o.visibility.showUnauthedOrderSummary&&e(ue,{section:"summary",children:e(me,{section:"summary",children:e(he,{above:"small",children:e(fe,{hideDivider:!0,padding:"none none large-200 none",children:e(Ae,{})})})})}),p?e(je,{}):e(xe,{isShopPayExternal:s})]})}function Ln(){const{client:n,observability:i,shopPay:t}=_(),{shouldUseAccessToken:a,user:o}=t,s=P(n.initialRequest.url),l=M(),d=!!l&&V.includes(l),u=f(l),h=pe(),p=c(()=>"shopPayLogin"===h.value.currentDetour?.type),g=B(),y=c(()=>g()),v=t.accessToken.value,{refetch:b}=q(W,{isOnShopPayLoginDetour:p,newSignupLoginVariant:u,simulatedBuyerDetails:y}),[k,S]=m(!1),w=!a||Boolean(v),R=o.email.value,L=d&&!s||Boolean(k&&R&&w),I=null==l||L;F(I);const E=n.unstable_legacyNavigationPerformance,{progress:D}=X();return r(()=>{const e=t.session.initialization.peek();"failed"===e.status&&"fetch"===e.reason&&t.session.unstable_setInitialization({status:"pending"})},[t.session]),r(()=>{v&&(s||(b(),S(!0)))},[v,s,b]),r(()=>{L&&(E?.usable(),D("shop-pay-login-loader-complete"))},[L,E,D]),ne({enabled:I,onTimeout:e=>{i.counter({name:"shop_pay_login_loader_loading_timeout",value:1}),i.log("shop_pay_login_loader_loading_timeout","ShopPayLoginLoader loading timeout",{timeout:e,variant:l,isUnauthenticatedVariant:d})}}),I?null:e(Rn,{})}export{Ln as default};

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