import{i as r,f as o,b as d,c as p,s as l}from"./getNormalizedPaymentMethodName.2fnRWc01.js";import{P as m}from"./utilities-rpc.Cil_Fuhe.js";const y={id:"594764f2541c2e7516f59c163e9286eed0e978d6422dacfa5b7f25c6300b714c",type:"query",name:"ShopPayCheckoutSession",source:"query ShopPayCheckoutSession($checkoutContextInput:CheckoutContextInput!,$shopifyDomain:String!,$redirectSource:String){checkoutSession(checkoutContextInput:$checkoutContextInput redirectSource:$redirectSource){user{publicId email phone phoneCountryCode addresses{...ShippingAddressFragment __typename}paymentMethods{...on CreditCard{...CreditCardFragment __typename}...on PaymentMethod{id paymentMethod paymentMethodName paymentAttributes lastUsedAt __typename}__typename}wallet{latestDiscount(shopifyDomain:$shopifyDomain){id shopifyDomain code redeemedAt __typename}__typename}installmentsRejected preselectSpiForReturningBuyer newUser shopAccountUuid enabledFlags installmentsPrequalification{prequalifiedAmount{value currency __typename}expiredAt __typename}installmentCredential{outcome requiresAdditionalInformation countryCode newUser __typename}experiments __typename}secureData spiServiceAvailable selectedPaymentMethodId selectedPaymentMethodOption __typename}userPrivacySettings{...UserPrivacySettingsFragment __typename}}fragment ShippingAddressFragment on Address{fields{key value __typename}id uuid lastUsedAt requiresVerification valid userPreferred explicitlyPreferred __typename}fragment CreditCardFragment on CreditCard{bank brand expired expiring expiryMonth expiryYear funding id uuid lastDigits lastUsedAt name nickname supportsInstallmentsInterestLoan supportsInstallmentsSplitPayLoan installmentsInterestLoanNotSupportedReason installmentsSplitPayLoanNotSupportedReason verified billingAddressValid billingAddress{fields{key value __typename}__typename}__typename}fragment UserPrivacySettingsFragment on UserPrivacySettings{dataSharingOptOut trackingConsentHeader consent{analytics{consented providedAt isExpired __typename}marketing{consented providedAt isExpired __typename}displayBanner __typename}__typename}"};function h(t){const{user:e,secureData:n,spiServiceAvailable:a,selectedPaymentMethodId:s,selectedPaymentMethodOption:i}=t.checkoutSession;return{status:"success",flow:"authenticated_user",addresses:e.addresses.map(l),creditCards:e.paymentMethods.filter(d).map(p),paymentMethods:o(e.paymentMethods),wallet:e.wallet,email:e.email,publicId:e.publicId,phone:e.phone,phoneCountryCode:e.phoneCountryCode,installmentsRejected:e.installmentsRejected,installmentsRetryable:!1,preselectSpi:e.preselectSpiForReturningBuyer?m.ReturningSpiBuyer:void 0,newUser:e.newUser,shopAccountUuid:e.shopAccountUuid,enabledFlags:e.enabledFlags,secureData:n??void 0,installmentsPrequalifiedAmount:r(e.installmentsPrequalification),installmentCredential:e.installmentCredential??null,experiments:e.experiments,spiServiceAvailable:a,userPrivacySettings:t.userPrivacySettings,selectedPaymentMethodId:s,selectedPaymentMethodOption:i}}export{h as n,y as s};
