PageSourceSearch

https://store.enabot.com/cdn/shopifycloud/checkout-web/assets/c1/utilities-shopCashMoney.B9eyOzz9.js

js enabot.com collected 2026-09-24 12:19:09 UTC 3,978 bytes, 1 lines download raw bytes

1import{o as f}from"./esnext-vendor.D7ldIee_.js";import{m_ as O,ke as y,m$ as C,cc as E,n0 as S,jZ as g,cg as h,n1 as I}from"./addresses-is-address-empty.-MuOhIyI.js";function N(e,n){return Object.keys(n).every(s=>{const o=n[s]??"",d=e[s]??"";return o===d})}function M(e,n){if(!e)return!1;const[r=0,s=0,o=0]=_(e),[d=0,u=0,a=0]=_(n);return r!==d?r>d:s!==u?s>u:o>=a}function _(e){return e.split(".").map(n=>parseInt(n,10)||0)}const H="2.251.0",T=new Set(["mobilepay","bancontact","blik","bizum","mb","multibanco","mbway","eps","swish","twint","przelewy24","alipay","wechatpay","oxxo","satispay","vipps"]);function v(e){return M(e,H)}function m({brand:e,isShopAppLayout:n=!1,shopAppVersion:r}){if(n&&!v(r))return!1;const s=e.toLowerCase();return T.has(s)}function R(e,{identity:n,installmentsSelected:r,isApplePayAvailable:s,idealEnabled:o,isBareCardOnly:d,isShopAppLayout:u=!1,shopAppVersion:a}){return d?e.filter(i=>i.type==="direct"):n.current.value!=="shopPay"?e:r?e.filter(i=>i.type==="direct"):e.filter(i=>{if(i.type==="direct")return!0;if(i.type==="customOnsite"){const p=i.paymentBrands??[];return p.includes("bogus_app_coin")||p.includes("usdc")||o&&p.includes("ideal")?!0:O(i.uiExtension?.appId)?p.some(t=>m({brand:t,isShopAppLayout:u,shopAppVersion:a})):!1}return y(i)?s:!1})}function D(e){return typeof e=="boolean"?e:e.value}function x(e,{isApplePayAvailable:n}){const{identity:r,shopPay:s,negotiatedFields:o}=e;return f(()=>{const d=o.paymentMethods.value??[];return R(d,{identity:r,installmentsSelected:!1,isApplePayAvailable:D(n),idealEnabled:h({managedByMarketsPro:o.managedByMarketsPro.value}
1),isBareCardOnly:!1,isShopAppLayout:g(s.app.config),shopAppVersion:s.app.config.version})})}function G({checkout:e,shopPay:n,observability:r,shippingAddress:s,billingAddress:o,fallbackPhoneNumber:d,buyerAddresses:u}){if(!s&&!o)return{};const a=e.proposal.proposed,i=e.proposal.negotiated.fields,p=C({canUpdateDeliveryAddress:i.canUpdateDeliveryAddress.value,mustSelectProvidedAddress:i.mustSelectProvidedAddress.value,proposedAddress:a.shippingAddress.value,buyerAddresses:u}),t=s&&p?s:void 0,l=o;if(!t&&!l)return{};const A=e.configuration.addressSettings.nonBillingAddressSettings.value;if(t){const c=A.isRequired("phone",{countryCode:t.countryCode,useMerchantSettings:!0})&&!t.phone?d:t.phone;r.log("wallets_shipping_address_update","update with Shop Pay vaulted address",{isPostalCodePadded:E(t.postalCode,t.countryCode),countryCode:t.countryCode}),a.shippingAddress.value={...t,phone:c,oneTimeUse:t.oneTimeUse||!1}}if(l){const c=A.isRequired("phone",{countryCode:l.countryCode,useMerchantSettings:!0})&&!l.phone?d:l.phone;a.billingAddress.value={...l,phone:c}}t&&S(a.shippingAddress),l&&S(a.billingAddress);const P=N(t??a.shippingAddress.value,l??a.billingAddress.value);return n.user.hasCreditCards.value&&(a.billingAddressOption.value=P?"shipping":"custom"),{shippingAddress:t,billingAddress:l}}const k="SHOP_CASH",b="SHOP_CASH_BALANCE",B="SHOP_DISCOUNT_OFFER",L="SHOP_PROMOTION",q=[b,B,L],z={SHOP_CASH_BALANCE:null,SHOP_DISCOUNT_OFFER:null,SHOP_PROMOTION:[]};var U=(e=>(e.ShopCashMerchantNotSupported="SHOP_CASH_MERCHANT_NOT_SUPPORTED",e.ShopCashInvalidShippingAddress="SHOP_CASH_INVALID_SHIPPING_ADDRESS",e.ShopCashInvalidBillingAddress="SHOP_CASH_INVALID_BILLING_ADDRESS",e.ShopCashInsufficientFundingLedgerBalance="INSUFFICIENT_FUNDING_LEDGER_BALANCE",e.ShopCashCheckoutNotReadyToFetch="SHOP_CASH_CHECKOUT_NOT_READY_TO_FETCH",e.ShopCashCreditCardVaultedRequired="CREDIT_CARD_VAULT_REQUIRED",e.ShopCashNotAvailable="SHOP_CASH_NOT_AVAILABLE",e))(U||{});const F=e=>!!(e.amount&&!isNaN(e.amount)&&e.amount>0&&e.currencyCode&&I[e.currencyCode]),w=e=>"amount"in e&&typeof e.amount=="string",V=e=>w(e)?{amount:Number(e.amount),currencyCode:e.currencyCode}:{amount:Number(e.value),currencyCode:e.currency},K=e=>{if(!e)return null;const n=V(e);return F(n)?n:null};export{z as E,q as S,V as a,U as b,k as c,B as d,L as e,b as f,R as g,M as h,N as i,G as j,x as s,K as t};

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.