PageSourceSearch

https://store.wizardzines.com/cdn/shopifycloud/checkout-web/assets/c1/receipt-mappers.C1qoDcop.js

js wizardzines.com collected 2026-09-24 15:22:48 UTC 24,158 bytes, 1 lines download raw bytes

1import{a as O}from"./esnext-vendor.BBoIVOQW.js";import{eN as k,aG as n,eO as M,eP as D,eQ as C,eR as U,cC as F,al as u,eS as m,V as b,aH as E,aJ as B,bD as T}from"./addresses-is-address-empty.ZJ1ThpFy.js";import{h as L,e as N,a as v,b as w,o as V,t as P,c as G}from"./shared-receipt-eager-mappers.DcURE_8N.js";import{e as H}from"./shared-receipt-merchandise-lines.C_2ay4rF.js";import"./app.CUBUOQtX.js";class W extends Error{constructor(){super(...arguments),this.name="ReceiptError"}}function De(e,t={pollingTimeoutReached:!1,skipToThankYouPage:!1,waitingForPostPurchaseDone:!1}){if(L(e))return N(e);switch(e.__typename){case"ProcessingRemoteCheckoutsReceipt":return{status:"processing_remote_checkouts",id:e.id,pollAt:Date.now()+e.pollDelay+U,remoteCheckouts:Oe(e.remoteCheckouts)};case"ProcessedReceipt":{if(e.postPurchasePageRequested&&e.postPurchaseVaultedPaymentMethodStatus==="NOT_READY"&&!t.pollingTimeoutReached)return{status:"polling_for_order",id:e.id,token:e.token};const r={amount:parseFloat(e.purchaseOrder.totalAmountToPay.amount),currencyCode:e.purchaseOrder.totalAmountToPay.currencyCode},s=k(e.purchaseOrder.note);return{status:"processed",id:e.id,token:e.token,redirectUrl:e.redirectUrl||null,mapUrl:e.mapUrl??null,mapVisibility:e.mapVisibility,confirmationPage:{url:e.confirmationPage.url,shouldRedirect:e.confirmationPage.shouldRedirect},analytics:{checkoutCompletedEventId:e.analytics?.checkoutCompletedEventId||null,emitConversionEvent:e.anal
1ytics?.emitConversionEvent||!1},orderIdentity:{buyerIdentifier:e.orderIdentity.buyerIdentifier,id:e.orderIdentity.id},paymentDetails:{paymentCardBrand:e.paymentDetails?.paymentCardBrand,creditCardLastFourDigits:e.paymentDetails?.creditCardLastFourDigits,paymentAmount:e.paymentDetails?.paymentAmount?.amount,paymentCurrency:e.paymentDetails?.paymentAmount?.currencyCode,paymentGateway:e.paymentDetails?.paymentGateway,financialPendingReason:e.paymentDetails?.financialPendingReason,paymentDescriptor:e.paymentDetails?.paymentDescriptor,buyerActionInfo:e.paymentDetails?.buyerActionInfo??void 0,paymentIcon:e.paymentDetails?.paymentIcon,installmentDetails:e.paymentDetails?.installmentDetails??void 0},purchaseOrder:{email:Y(e.purchaseOrder.buyerIdentity),phone:Q(e.purchaseOrder.buyerIdentity),checkoutCompletionTarget:e.purchaseOrder.checkoutCompletionTarget,shippingAddress:K(e.purchaseOrder.delivery,e.completedRemoteCheckouts),billingAddress:z(e.purchaseOrder.payment,e.completedRemoteCheckouts),paymentLines:S(e.purchaseOrder.payment.paymentLines),deliveryNext:q(e.purchaseOrder.delivery,s,e.completedRemoteCheckouts),deliveryExpectations:ne(e.purchaseOrder.deliveryExpectations),paymentDue:v(e.purchaseOrder.payment,r),runningTotal:r,merchandiseLines:H(e.purchaseOrder.merchandise),totalTaxes:e.purchaseOrder.tax.totalTaxAmountV2?c(e.purchaseOrder.tax.totalTaxAmountV2):void 0,metafields:e.purchaseOrder.metafields,cartMetafields:e.purchaseOrder.cartMetafields},purchaseOrderNumber:e.poNumber??void 0,orderStatusPageUrl:e.orderStatusPageUrl,orderCreationStatus:ie(e.orderCreationStatus),postPurchasePageUrl:e.postPurchasePageUrl,postPurchaseVaultingStatus:de(e.postPurchaseVaultedPaymentMethodStatus),postPurchasePageRequested:e.postPurchasePageRequested,shopPayArtifact:{optIn:e.purchaseOrder.shopPayArtifact?.optIn??void 0},shopAppLinksAndResources:{qrCodeUrl:e.shopAppLinksAndResources.qrCodeUrl,mobileUrl:e.shopAppLinksAndResources.mobileUrl,orderTrackingMobileUrl:e.shopAppLinksAndResources?.orderTrackingMobileUrl??void 0,canTrackOrderUpdates:e.shopAppLinksAndResources.canTrackOrderUpdates,shopInstallmentsViewSchedules:e.shopAppLinksAndResources.shopInstallmentsViewSchedules,installmentsHighlightEligible:e.shopAppLinksAndResources.installmentsHighlightEligible,shopInstallmentsMobileUrl:e.shopAppLinksAndResources.shopInstallmentsMobileUrl,mobileUrlAttributionPayload:e.shopAppLinksAndResources.mobileUrlAttributionPayload,shopAppEligible:e.shopAppLinksAndResources.shopAppEligible,payEscrowMayExist:!!e.shopAppLinksAndResources.payEscrowMayExist,shopAppQrCodeKillswitch:e.shopAppLinksAndResources.shopAppQrCodeKillswitch,shopPayOrder:e.shopAppLinksAndResources.shopPayOrder,buyerHasShopApp:e.shopAppLinksAndResources?.buyerHasShopApp??void 0,buyerHasShopPay:e.shopAppLinksAndResources?.buyerHasShopPay??void 0,buyerHasOrderTrackingPush:e.shopAppLinksAndResources?.buyerHasOrderTrackingPush??void 0,orderTrackingPushCtaVariant:e.shopAppLinksAndResources?.orderTrackingPushCtaVariant??void 0,orderUpdateOptions:e.shopAppLinksAndResources.orderUpdateOptions,giveawayAmount:e.shopAppLinksAndResources.giveawayAmount?{amount:parseFloat(e.shopAppLinksAndResources.giveawayAmount.amount),currencyCode:e.shopAppLinksAndResources.giveawayAmount.currencyCode}:void 0},skipToThankYouPage:!!t.skipToThankYouPage,waitingForPostPurchaseDone:!1,eligibleForMarketingOptIn:e.eligibleForMarketingOptIn,paymentExtensionBrand:e.paymentExtensionBrand,lpmDisclosure:e.lpmDisclosure??void 0,recurringTotals:C(e.purchaseOrder.recurringTotals),deferredTotal:D(e.purchaseOrder.deferredTotal??void 0),checkoutTotalBeforeTaxesAndShipping:e.purchaseOrder.checkoutTotalBeforeTaxesAndShipping?n(e.purchaseOrder.checkoutTotalBeforeTaxesAndShipping):void 0,checkoutTotal:n(e.purchaseOrder.checkoutTotal),checkoutTotalTaxes:e.purchaseOrder.checkoutTotalTaxes?n(e.purchaseOrder.checkoutTotalTaxes):void 0,taxes:P({...e.purchaseOrder.tax,totalTaxAmount:e.purchaseOrder.tax.totalTaxAmountV2??void 0}),legacyRepresentProductsAsFees:e.purchaseOrder.legacyRepresentProductsAsFees,totalSavings:n(e.purchaseOrder.totalSavings),subtotal:n(e.purchaseOrder.subtotalBeforeTaxesAndShipping),landedCostDetails:e.purchaseOrder.landedCostDetails?.incotermInformation??void 0,dutiesIncluded:e.purchaseOrder.dutiesIncluded??void 0,duties:ue(e.purchaseOrder.tax.totalDutyAmount),paymentFlexibilityPaymentTermsTemplate:e.paymentFlexibilityPaymentTermsTemplate??void 0,optionalDuties:e.purchaseOrder.optionalDuties?V(e.purchaseOrder.optionalDuties):void 0,discountLines:ce(e.purchaseOrder.discounts),tipLines:me
1(e.purchaseOrder.tip),hasOnlyDeferredShipping:e.purchaseOrder.hasOnlyDeferredShipping,acceptEmailMarketing:ye(e.purchaseOrder.buyerIdentity),acceptSmsMarketing:pe(e.purchaseOrder.buyerIdentity),smsMarketingPhone:fe(e.purchaseOrder.buyerIdentity),note:e.purchaseOrder.note.message??void 0,paymentMethods:he(e.purchaseOrder.payment.paymentLines),customerId:e.customerId??void 0,isFirstOrder:e.isFirstOrder??void 0,isRedacted:e.isRedacted,buyerIdentity:e.purchaseOrder.buyerIdentity?w(e.purchaseOrder.buyerIdentity):void 0,subtotalAfterMerchandiseDiscounts:e.purchaseOrder.subtotalAfterMerchandiseDiscounts?n(e.purchaseOrder.subtotalAfterMerchandiseDiscounts):void 0,subtotalBeforeReductions:n(e.purchaseOrder.subtotalBeforeReductions),customAttributes:e.purchaseOrder.note?.customAttributes??void 0,legacySubtotalBeforeTaxesShippingAndFees:n(e.purchaseOrder.legacySubtotalBeforeTaxesShippingAndFees),legacyMerchandiseLinesAsFees:M(e.purchaseOrder.legacyAggregatedMerchandiseTermsAsFees),consolidatedProposedSubtotalBeforeTaxesAndShipping:e.consolidatedProposedSubtotalBeforeTaxesAndShipping?n(e.consolidatedProposedSubtotalBeforeTaxesAndShipping):void 0,completedRemoteCheckouts:Ae(e.completedRemoteCheckouts),remotePaymentDue:v(e.purchaseOrder.payment,e.consolidatedTotals?.runningTotal?n(e.consolidatedTotals.runningTotal):void 0),consolidatedTotals:e.consolidatedTotals?j(e.consolidatedTotals):void 0,consolidatedTaxes:e.consolidatedTaxes?$(e.consolidatedTaxes,e.completedRemoteCheckouts):void 0,remoteMerchandiseDetails:Se(e.completedRemoteCheckouts)}}default:throw new W(`Unknown receipt type: ${e.__typename}`)}}function Y(e){const{contactMethod:t}=e;return t?.__typename==="PurchaseOrderEmailContactMethod"?t.email:void 0}function Q(e){const{contactMethod:t}=e;return t?.__typename==="PurchaseOrderSMSContactMethod"?t.phoneNumber:void 0}function K(e,t){const r=e.deliveryLines.find(i=>i.destinationAddress)?.destinationAddress,s=r?.__typename==="StreetAddress"?u(r):void 0;if(s)return s;const a=t?.find(i=>i.__typename==="SubmittedRemoteCheckout")?.processedRemoteReceipt.remotePurchaseOrder.delivery.deliveryLines.find(i=>i.destinationAddress)?.destinationAddress;return a?.__typename==="StreetAddress"?u(a):void 0}function X(e,t){if(e?.paymentMethod?.__typename!=="WalletPaymentMethod"||e?.paymentMethod?.walletContent.__typename==="FacebookPayWalletContent")return;const r=e?.paymentMethod?.walletContent.billingAddress??t??void 0;return r?u(r):void 0}function z(e,t){const r=e.billingAddress&&"address1"in e.billingAddress?e.billingAddress:void 0,s=e.paymentLines.find(d=>d.paymentMethod.__typename==="WalletPaymentMethod");if(s)return X(s,r);const o=e.paymentLines.map(d=>d.paymentMethod).filter(d=>"billingAddress"in d).find(d=>d.billingAddress&&"address1"in d.billingAddress)?.billingAddress??r??void 0,i=o?u(o):void 0;if(i)return i;for(const d of t??[]){if(d.__typename!=="SubmittedRemoteCheckout")continue;const l=d.processedRemoteReceipt.remotePurchaseOrder.payment;for(const x of l.paymentLines){const A=x.paymentMethod,p=A.__typename==="DirectPaymentMethod"?A.billingAddress:void 0;if(p&&"address1"in p)return u(p)}const y=l.billingAddress;if(y&&"address1"in y)return u(y)}}function J(e){if(!(e?.__typename!=="PickupInStoreLocation"&&e?.__typename!=="PickupPointLocation")){if(e?.__typename==="PickupPointLocation"){const{name:t,carrierCode:r,carrierName:s,carrierLogoUrl:a,fromDeliveryOptionGenerator:o,address:i}=e;return{name:t,address:u(i),carrierName:s,carrierCode:r,carrierLogoUrl:a,fromDeliveryOptionGenerator:o,type:e?.__typename}}return{name:e.name,address:u(e.address),instructions:e.instructions,type:e?.__typename}}}function $(e,t){if(!t)return;const r=new Map;for(const a of t)a.__typename==="SubmittedRemoteCheckout"&&r.set(a.shopId,P({...a.processedRemoteReceipt.remotePurchaseOrder.tax,totalTaxAmount:a.processedRemoteReceipt.remotePurchaseOrder.tax.totalTaxAmountV2??void 0}));const s=G(e);return{perShopTaxes:r,consolidatedTaxes:s}}function j(e){return{total:n(e.runningTotal),runningTotal:n(e.runningTotal),subtotal:n(e.subtotalBeforeTaxesAndShipping),subtotalBeforeReductions:n(e.subtotalBeforeReductions),totalSavings:n(e.totalSavings),checkoutTotalTaxes:e.checkoutTotalTaxes?n(e.checkoutTotalTaxes):void 0,checkoutTotalBeforeTaxesAndShipping:e.checkoutTotalBeforeTaxesAndShipping?n(e.checkoutTotalBeforeTaxesAndShipping):void 0,checkoutTotal:e.checkoutTotal?n(e.checkoutTotal):void 0}}function Z(e,t){const r={amountCombinabilityToken:e.deliveryStrategy.amountCombinabilityToken,deliveryPresentationGroupToken:e.deliveryStrategy.deliveryPresentationGroupToken,handle:e.deliveryStrategy.handle,title:e.deliveryStrategy.title,de
1scription:e.deliveryStrategy.description??void 0,cost:n(e.lineAmount),costAfterDiscounts:n(e.lineAmountAfterDiscounts),estimatedTimeInTransit:void 0,methodType:e.deliveryStrategy.methodType,brandedPromise:e.deliveryStrategy.brandedPromise,pickupLocation:J(e.deliveryStrategy.pickupLocation),deliveryPromisePresentmentTitle:e.deliveryStrategy.deliveryPromisePresentmentTitle,metafields:[],priceBreakdown:R(e.deliveryStrategy.deliveryStrategyBreakdown,t),deliveryPredictionEligible:!1};return!r||r.methodType==="NONE"?{status:"not_required",type:e.groupType,targetMerchandiseLines:h(e.targetMerchandise,t)}:{status:"available",methods:[r],selectedDeliveryMethodHandle:r.handle,type:e.groupType,targetMerchandiseLines:h(e.targetMerchandise,t),availableOn:e.availableOn}}function R(e,t){if(e)return e.map(({amount:r,discountRecurringCycleLimit:s,excludeFromDeliveryOptionPrice:a,targetMerchandise:o,flatRateGroupId:i})=>({amount:n(r),discountRecurringCycleLimit:s??void 0,excludeFromDeliveryOptionPrice:a,targetMerchandiseLines:h(o,t),flatRateGroupId:i??void 0}))}function h(e,t){return e.reduce((r,s)=>{if(s.__typename!=="PurchaseOrderMerchandiseLine"&&s.__typename!=="PurchaseOrderBundleLineComponent")return r;const{stableId:a,merchandise:o,quantity:i}=s;if(o.__typename==="ProductVariantSnapshot"){const d=_(i),l=o.image?{...o.image,altText:o.image.altText||void 0}:void 0;return[...r,{id:o.variantId,digest:o.digest,title:o.productTitle,stableId:a,requiresShipping:t?!1:o.requiresShipping??!0,properties:B(o.properties),subtitle:o.title??void 0,sellingPlan:E(o.sellingPlan),quantity:d,image:l}]}return r},[])}function q(e,t,r){const s=e.deliveryLines.map(o=>Z(o,t)),a=ee(r);return{status:"filled",lines:[...s,...a],splitShippingToggle:e.splitShippingToggle}}function ee(e){const t=e?.filter(r=>r.__typename==="SubmittedRemoteCheckout");return!t||t.length===0?[]:t.flatMap(r=>r.processedRemoteReceipt.remotePurchaseOrder.delivery.deliveryLines.filter(s=>s.deliveryStrategy.methodType!=="NONE").map(s=>te(s)))}function te(e){return{status:"available",methods:[{cost:n(e.lineAmount),costAfterDiscounts:n(e.lineAmount),deliveryPredictionEligible:!1,estimatedTimeInTransit:void 0,handle:e.deliveryStrategy.handle,metafields:[],methodType:e.deliveryStrategy.methodType,title:e.deliveryStrategy.title}],selectedDeliveryMethodHandle:e.deliveryStrategy.handle,type:e.groupType,targetMerchandiseLines:re(e.targetMerchandise),availableOn:e.availableOn}}function re(e){return e.reduce((t,r)=>{if(r.__typename!=="PurchaseOrderMerchandiseLine")return t;const{stableId:s,merchandise:a,quantity:o}=r;if(a.__typename==="ProductVariantSnapshot"){const i=_(o);return[...t,{digest:a.digest,title:a.productTitle,stableId:s,requiresShipping:a.requiresShipping,properties:[],quantity:i}]}return t},[])}function ne(e){return e?{status:"filled",deliveryExpectationLines:e.map(t=>({deliveryOptionHandle:void 0,deliveryStrategyHandle:t.deliveryStrategyHandle,brandedPromise:t.brandedPromise?{name:t.brandedPromise.name,logoUrl:t.brandedPromise.logoUrl,handle:t.brandedPromise.handle,darkThemeLogoUrl:t.brandedPromise.darkThemeLogoUrl,lightThemeLogoUrl:t.brandedPromise.lightThemeLogoUrl}:void 0,minDeliveryDateTime:void 0,maxDeliveryDateTime:void 0,deliveryExpectationPresentmentTitle:t.deliveryExpectationPresentmentTitle,promiseProviderApiClientId:void 0,returnability:t.returnability?.returnable}))}:{status:"unavailable",deliveryExpectationLines:null}}function se(e,t){const r=e.paymentMethod.__typename==="PurchaseOrderGiftCardPaymentMethod",s=t.paymentMethod.__typename==="PurchaseOrderGiftCardPaymentMethod";return r&&!s?-1:!r&&s?1:0}function S(e){return e.filter(t=>!t.due).sort(se).map(t=>({...ae(t.paymentMethod),cost:c(t.amount),specialInstructions:t.postPaymentMessage??void 0}))}function c(e){if(e!=null)return{amount:parseFloat(e.amount),currencyCode:e.currencyCode}}function ae(e){switch(e.__typename){case"DirectPaymentMethod":return{method:{type:"direct",sessionId:e.sessionId,paymentMethodIdentifier:e.paymentMethodIdentifier??"",brand:e.creditCard?.brand??void 0,creditCardLastFourDigits:e.creditCard?.lastDigits??void 0,vaultingAgreement:e.vaultingAgreement}};case"CustomerCreditCardPaymentMethod":return{method:{type:b.CreditCard,id:e.id,token:e.token,billingAddress:u(e.billingAddress),brand:e.brand,firstDigits:e.firstDigits??void 0,displayLastDigits:e.displayLastDigits,defaultPaymentMethod:e.defaultPaymentMethod,deletable:e.deletable,requiresCvvConfirmation:e.requiresCvvConfirmation}};case"PaymentOnDeliveryMethod":return{method:{type:"paymentOnDelivery",additionalDetails:e.additionalDetails??"",paymentInstructions:e.paymentInstructions??"",paymentMethodIdentifier:e.paymentMethodIdentifier??"",availablePresentmentCurrencies:[]}};case"PurchaseOrderGiftCardPaymentMethod":return{method:{type:"giftCard",code:e.code,balance:c(e.balance)}};case"WalletPaymentMethod":return{method:{type:"wallet",name:e.name,walletContent:oe(e.walletContent)}};case"WalletsPlatformPaymentMethod":return{method:{type:"walletsPlatformPaymentMethod",name:e.name,walletParams:e.walletParams}};case"LocalPaymentMethod":return{method:{type:"local",paymentMethodIdentifier:e.paymentMethodIdentifier??"",name:e.name}};case"DeferredPaymentMethod":return{method:{type:"deferred"}};case"ManualPaymentMethod":return{method:{type:"manualPayment",name:e.name,id:e.id,additionalDetails:e.additionalDetails??"",paymentInstructions:e.paymentInstructions??"",paymentMethodIdentifier:e.paymentMethodIdentifier??"",availablePresentmentCurrencies:[]}};case"CustomPaymentMethod":return{method:{type:"customManualPayment",name:e.name,id:e.id,additionalDetails:e.additionalDetails??"",paymentInstructions:e.paymentInstructions??"",paymentMethodIdentifier:e.paymentMethodIdentifier??"",availablePresentmentCurrencies:[]}};case"PaypalBillingAgreementPaymentMethod":return{method:{type:b.PayPal,token:e.token,billingAddress:u(e.billingAddress)}};case"OffsitePaymentMethod":return{method:{type:"offsite",paymentMethodIdentifier:e.paymentMethodIdentifier??void 0,name:e.name}};case"RedeemablePaymentMethod":switch(e.redemptionSource){case"CUSTOM":return{method:{type:"redeemable",redemptionSource:e.redemptionSource,redemptionContent:e.redemptionContent}};case"SHOP_CASH":return{method:{type:"redeemable",redemptionSource:e.redemptionSource,redemptionContent:e.redemptionContent}};default:return{method:{type:"redeemable",redemptionSource:e.redemptionSource}}}case"CustomOnsitePaymentMethod":return{method:{type:"customOnsite",paymentMethodIdentifier:e.paymentMethodIdentifier??void 0,name:e.name}};case"BankPaymentInstrument":return{method:{type:"bank",paymentMethodIdentifier:e.paymentMethodIdentifier,lastDigits:e.lastDigits??"",bankName:e.bankName??""}};case"ShopWalletPaymentInstrument":return{method:{type:"shopWallet"}};default:return{method:{type:"other"}}}}function oe(e){switch(e.__typename){case"ShopifyInstallmentsWalletContent":return{autoPayEnabled:e.autoPayEnabled,billingAddress:T(e.billingAddress),disclosureDetails:e.disclosureDetails,installmentsToken:e.installmentsToken,creditCardBrand:e.creditCard?.brand??void 0,creditCardLastFourDigits:e.creditCard?.lastDigits??void 0};case"ShopPayWalletContent":return{billingAddress:T(e.billingAddress),paymentMethod:e.paymentMethod,paymentAttributes:e.paymentAttributes,paymentMethodIdentifier:e.paymentMethodIdentifier}}}function ie(e){return e.__typename==="OrderCreationSucceeded"?{status:"created"}:{status:"processing"}}function de(e){switch(e){case"READY":return"ready";case"NOT_READY":return"notReady";case"EXPIRED":return"expired";case"DISABLED_FEATURE":return"disabled"}}function ue(e){return e?{status:"available_total",totalDuty:n(e)}:{status:"unavailable",reason:""}}function ce(e){return{lines:e.lines.map(le).filter(r=>!!r)}}function le(e){switch(e.discount.__typename){case"CustomDiscount":return{title:e.discount.title,de
1scription:e.discount.description??void 0,amount:n(e.lineAmount),allocations:f([...e.deliveryAllocations,...e.merchandiseAllocations]),discount:m(e.discount)};case"CodeDiscount":return{title:e.discount.title,amount:n(e.lineAmount),allocations:f([...e.deliveryAllocations,...e.merchandiseAllocations]),discount:m(e.discount)};case"DiscountCodeTrigger":return{title:e.discount.code,discount:m(e.discount)};case"AutomaticDiscount":return{title:e.discount.title,amount:n(e.lineAmount),allocations:f([...e.deliveryAllocations,...e.merchandiseAllocations]),discount:m(e.discount)};default:return}}function f(e){return e.map(t=>({target:{index:t.index,amount:n(t.amount),stableId:t.stableId,type:t.targetType}}))}function me(e){return e.tipLines.map(t=>({amount:n(t.amount)}))}function ye(e){return g(e)??e.marketingConsent.some(t=>t.__typename==="PurchaseOrderEmailContactMethod")}function pe(e){return g(e)??e.marketingConsent.some(t=>t.__typename==="PurchaseOrderSMSContactMethod")}function fe(e){return e.marketingConsent.find(r=>r.__typename==="PurchaseOrderSMSContactMethod")?.phoneNumber??""}function g(e){if(e.customer?.__typename==="DecodedCustomerProfile"||e.customer?.__typename==="BusinessCustomerProfile")return e.customer.acceptsEmailMarketing}function he(e){const t=Pe(e);return t?[t]:[]}function Pe(e){const t=e.map(r=>r.paymentMethod).find(r=>r.__typename==="LocalPaymentMethod");if(t)return{type:"local",name:t.name,displayName:t.displayName??"",paymentMethodIdentifier:t.paymentMethodIdentifier??"",orderingIndex:Number.MAX_SAFE_INTEGER}}function _(e){return typeof e=="number"?e:e.__typename==="PurchaseOrderMerchandiseQuantityByItem"?e.items:0}function Ae(e){if(e)return e.map(t=>{switch(t.__typename){case"SubmittedRemoteCheckout":return{status:"submitted",shopId:t.shopId,checkoutSessionToken:t.checkoutSessionToken,orderIdentity:{id:t.processedRemoteReceipt.orderIdentity.id,buyerIdentifier:t.processedRemoteReceipt.orderIdentity.buyerIdentifier},orderStatusPageUrl:t.processedRemoteReceipt.orderStatusPageUrl,remotePurchaseOrder:{paymentLines:S(t.processedRemoteReceipt.remotePurchaseOrder.payment.paymentLines.filter(r=>r.paymentMethod.__typename==="DirectPaymentMethod")),deliveryLines:be(t.processedRemoteReceipt.remotePurchaseOrder.delivery.deliveryLines),merchandiseLines:I(t.processedRemoteReceipt.remotePurchaseOrder.merchandise.merchandiseLines),checkoutTotal:n(t.processedRemoteReceipt.remotePurchaseOrder.checkoutTotal),subtotalBeforeTaxesAndShipping:n(t.processedRemoteReceipt.remotePurchaseOrder.subtotalBeforeTaxesAndShipping),tax:t.processedRemoteReceipt.remotePurchaseOrder.tax.totalTaxAmountV2?c(t.processedRemoteReceipt.remotePurchaseOrder.tax.totalTaxAmountV2):void 0}};case"FailedRemoteCheckout":return{status:"failed",shopId:t.shopId,checkoutSessionToken:t.checkoutSessionToken,recoveryUrl:t.recoveryUrl,merchandiseLines:t.failedRemoteReceipt?I(t.failedRemoteReceipt.remotePurchaseOrder.merchandise.merchandiseLines):Te(t.negotiatedProposal.merchandise),checkoutTotal:t.failedRemoteReceipt?n(t.failedRemoteReceipt.remotePurchaseOrder.checkoutTotal):ve(t.negotiatedProposal),subtotalBeforeTaxesAndShipping:t.failedRemoteReceipt?n(t.failedRemoteReceipt.remotePurchaseOrder.subtotalBeforeTaxesAndShipping):n(t.negotiatedProposal.subtotalBeforeTaxesAndShipping),tax:t.failedRemoteReceipt?.remotePurchaseOrder.tax.totalTaxAmountV2?c(t.failedRemoteReceipt?.remotePurchaseOrder.tax.totalTaxAmountV2):Ie(t.negotiatedProposal)};default:return O(t)}})}function be(e){return e.filter(({deliveryStrategy:t})=>t.methodType!=="NONE").map(({deliveryStrategy:{handle:t,title:r},lineAmount:s})=>({handle:t,title:r,lineAmount:n(s)}))}function I(e){return e.map(({quantity:{items:t},merchandise:r,stableId:s})=>({stableId:s,quantity:t,title:r.title??null,productTitle:r.productTitle,image:r.image?{url:r.image.url,altText:r.image.altText??void 0}:null,price:n(r.price)}))}function Te(e){return e.__typename!=="FilledMerchandiseTerms"?[]:e.merchandiseLines.map(t=>{if(t.merchandise.__typename!=="ProductVariantMerchandise"&&t.merchandise.__typename!=="ContextualizedProductVariantMerchandise")return;const r=t.quantity?.__typename==="ProposalMerchandiseQuantityByItem"&&t.quantity.items?.__typename==="IntValueConstraint"?t.quantity.items.value:0;return{stableId:t.stableId,quantity:r,title:t.merchandise.subtitle??null,productTitle:t.merchandise.title,image:t.merchandise.image?{url:t.merchandise.image.url,...t.merchandise.image.altText&&{altText:t.merchandise.image.altText}}:null,price:n(t.totalAmount)}}).filter(t=>!!t)}function ve(e){return e.checkoutTotal?.__typename==="MoneyValueConstraint"?n(e.checkoutTotal):n(e.runningTotal)}function Ie(e){const t=P(e.tax);if(t.status==="available_total")return t.totalTax}function Oe(e){return e.map(t=>{switch(t.__typename){case"SubmittingRemoteCheckout":return{status:"submitting",shopId:t.shopId};case"SubmittedRemoteCheckout":return{status:"submitted",shopId:t.shopId};case"FailedRemoteCheckout":return{status:"failed",shopId:t.shopId};default:return O(t)}})}function Se(e){if(!e)return;const t=new Map,r=[];for(const s of e)s.__typename==="SubmittedRemoteCheckout"&&s.processedRemoteReceipt.remotePurchaseOrder.merchandise.merchandiseLines.forEac
1h(a=>{const o=n(a.merchandise.price);t.set(a.stableId,s.shopId),r.push({...a,lineAmount:{__typename:"Money",amount:F(o.amount*a.quantity.items).toString(),currencyCode:o.currencyCode},legacyFee:!1,lineAllocations:[],lineComponents:[]})});return{stableIdToShopId:t,mergedBuyerProposalMerchandise:{__typename:"PurchaseOrderMerchandiseTerms",merchandiseLines:r}}}export{De as receiptForUI};

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.