PageSourceSearch

https://joshrosebrook.com/cdn/shopifycloud/checkout-web/assets/c1/cross-border-hooks.xPE4TSQ5.js

js joshrosebrook.com collected 2026-09-26 04:52:10 UTC 4,932 bytes, 1 lines download raw bytes

1import{f as u,h as w,q as a}from"./esnext-vendor.B9Da21W6.js";import{bv as S,bO as g,S as _,T as d,dD as D,df as I}from"./addresses-is-address-empty.Bn2lNY_L.js";import{iN as M,cj as B}from"./hydrate.DZ4YTm7p.js";var v=(e=>(e.ApplePay="ApplePay",e.Checkout="Checkout",e.PayPalV6="PayPalV6",e.Venmo="Venmo",e.GooglePay="GooglePay",e.ShopifyPay="ShopifyPay",e.ShopPayApplePay="ShopPayApplePay",e))(v||{}),z=(e=>(e.Attempt="attempt",e.Success="success",e.Cancelled="cancelled",e.Failure="failure",e.Clicked="clicked",e.Initialized="initialized",e.NascarDrawerOpen="open",e.NascarDrawerClose="close",e))(z||{}),F=(e=>(e.Express="express",e.PaymentMethod="payment_method",e))(F||{}),T=(e=>(e.InitCalled="spb_init_called",e.ClickAcceleratedClicked="spb_instrument_click__accelerated__clicked",e.ClickSheetClicked="spb_instrument_click__sheet__clicked",e.ClickAcceleratedInitialized="spb_instrument_click__accelerated__initialized",e.ClickSheetInitialized="spb_instrument_click__sheet__initialized",e.ClickAcceleratedSuccess="spb_instrument_click__accelerated__success",e.ClickSheetSuccess="spb_instrument_click__sheet__success",e.ClickAcceleratedCancelled="spb_instrument_click__accelerated__cancelled",e.ClickSheetCancelled="spb_instrument_click__sheet__cancelled",e.ClickAcceleratedFailed="spb_instrument_click__accelerated__failure",e.ClickSheetFailed="spb_instrument_click__sheet__failure",e.SheetLoaded="spb_instrument_sheet_loaded",e.AuthAcceleratedAttempt="spb_instrument_auth__accelerated__attempt",e.AuthSheetAttempt="spb_instrument_auth__sheet__attempt",e.AuthAcceleratedSuccess="spb_instrument_auth__accelerated__success",e.AuthSheetSuccess="spb_instrument_auth__sheet__success",e.AuthAcceleratedFailure="spb_instrument_auth__accelerated__failure",e.AuthSheetFailure="spb_instrument_auth__sheet__failure",e.AuthorizationAttempt="wallets_authorization_attempt",e.AuthorizationComplete="wallets_authorization_complete",e.CryptoModalCancelled="checkout_crypto_payment_modal__cancelled",e.CryptoModalCompleted="checkout_crypto_payment_modal__completed",e.CryptoModalRendered="checkout_crypto_payment_modal__rendered",e.CryptoModalWalletAction="checkout_crypto_payment_modal__wallet_action",e.CryptoModalError="checkout_crypto_payment_modal__error",e.RecoveryFlowInitiated="spb_instrument_recovery_flow__initiated",e))(T||{});function x(){const e=S();return u(()=>({screenWidth:typeof window>"u"?0:window.innerWidth,cartValue:e.value?.amount,currencyCode:e.value?.currencyCode}))}function H(e,t){const r=g(),{userEvents:c}=_(),s=x();w(()=>{const{defaultAttributes:o}=r.value;if(!o)return;const n=p(e),i=l({walletName:void 0,shopId:o.shopId,eventName:"spb_init_called",nascarData:{...s.value,walletsRenderedCount:t,walletsRenderedNames:n},walletType:"payment_method"});i&&c.monorailEvent(i)},[c,s.value,e,t,r])}function O({state:e,shopId:t,paymentMethods:r,nascarData:c}){const s=p(r);return l({walletName:"NascarDrawer",shopId:t,eventName:e,nascarData:{...c,walletsRenderedNames:s}})}function l({walletName:e,shopId:t,eventName:r,nascarData:c,walletType:s,ttl:o,eventSubtype:n}){const i=M();return i?G({eventName:r,shopId:t,defaultAttributes:i,nascarData:c,walletType:s,walletName:e,ttl:o,eventSubtype:n}):null}function G({eventName:e,shopId:t,defaultAttributes:r,nascarData:c,walletName:s,walletType:o,ttl:n,eventSubtype:i}){const{uniqToken:h,visitToken:m,microSessionId:k,microSessionCount:y=0,themeId:C,themeCityHash:f,contentLanguage:A,referer:b,checkoutToken:P}=r??{};return{schemaId:"shopify_wallet_checkout_track/6.3",payload:{event:e,eventSubtype:i??o??"express",appName:"checkout",pageType:"checkout",checkoutToken:P,instrumentId:s,checkoutOne:!0,uniqToken:h,visitToken:m,microSessionId:k,microSessionCount:y,shopId:t,themeId:C,themeCityHash:f||"",contentLanguage:A,referer:b,...n&&{ttl:n},...c&&{...c}}}}function q(e,t){return`${e?"spb_instrument_click__accelerated_":"spb_instrument_click__sheet_"}_${t}`}function J(e,t){return`spb_instrument_auth__${e?"accelerated":"sheet"}__${t}`}function p(e){return e.map(t=>t.name).join(",")}function L(e,t,{dismissible:r=!0,onCancel:c}={}){let s=null;const o=new Promise(n=>{s=n});e.setCrossBorderConfirmState({onConfirm:n=>{e.setCrossBorderConfirmState(null),n.setSelectedMethodTypes(["SHIPPING"]),t(),s?.()},...r&&{onCancel:()=>{e.setCrossBorderConfirmState(null),c?.(),s?.()}},modalPromise:o})}function K(){const{checkout:e}=_(),{locationAddress:t}=d(),r=B(),c=a(o=>{const n=t.fields.countryCode.value;return!!(r.value&&n&&o!==n)},[t,r]),s=a((o,{dismissible:n=!0,onCancel:i}={})=>{L(e,o,{dismissible:n,onCancel:i})},[e]);return{shouldGateCrossBorder:c,crossBorderGate:s}}function Q(){const{shippingAddress:e}=d(),t=D();return u(()=>{const r=e.value?.countryCode;if(!r)return!1;const c=t.value;if(!c)return!1;const s=I(c)?.pickupLocation?.address.countryCode;return s?r!==s:!1})}export{T as W,v as a,F as b,z as c,x as d,H as e,O as f,G as g,Q as h,q as i,l as j,J as k,K as u};

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.