import{nz as d,jY as p,m as f,nA as E}from"./getNormalizedPaymentMethodName.2fnRWc01.js";const D="f_9cacaad2",P="f_34c3590e",C="f_45b4f767";function N(n,e){return Object.keys(e).every(i=>{const a=e[i]??"",r=n[i]??"";return a===r})}const S="2.251.0",A=new Set(["mobilepay","bancontact","blik","bizum","mb","multibanco","mbway","eps","swish","twint","przelewy24","alipay","wechatpay","oxxo"]);function I(n){if(!n)return!1;const e=u=>u.split(".").map(t=>parseInt(t,10)||0),[s=0,i=0,a=0]=e(n),[r=0,o=0,l=0]=e(S);return s!==r?s>r:i!==o?i>o:a>=l}function y({brand:n,isShopAppLayout:e=!1,shopAppVersion:s}){if(e&&!I(s))return!1;const i=n.toLowerCase();return A.has(i)}function g(n,{identity:e,installmentsSelected:s,isApplePayAvailable:i,isUsdcEnabled:a,idealEnabled:r,isBareCardOnly:o,isShopAppLayout:l=!1,shopAppVersion:u}){return o?n.filter(t=>t.type==="direct"):e.current.value!=="shopPay"?n:s?n.filter(t=>t.type==="direct"):n.filter(t=>{if(t.type==="direct")return!0;if(t.type==="customOnsite"){const c=t.paymentBrands??[];return c.includes("bogus_app_coin")||a&&c.includes("usdc")||r&&c.includes("ideal")?!0:d(t.uiExtension?.appId)?c.some(_=>y({brand:_,isShopAppLayout:l,shopAppVersion:u})):!1}return p(t)?i:!1})}const h="company_location_shipping_address",M="one_time_shipping_address",R="company_location_billing_address",L="one_time_billing_address",T="sdk_cart_hints_address";function G(n){const{purchasingCompany:e,billingCountries:s,countryDetails:i,...a}=n;if(!e)return!1;if(!i)return!0;const r=f(e.location.billingAddress);return E(r,"billing",{...a,countryDetails:i,fallbackCountry:i,availableCountries:s,isMobilePhoneFieldVisible:!1}).size===0}function O({address:n,isDisabled:e,addressSettings:s,shopUserPhone:i}){return{id:n.id,address:b({address:n.address,addressSettings:s,shopUserPhone:i}),default:n.userPreferred,disabled:e?.(n)??!1}}function b({address:n,addressSettings:e,shopUserPhone:s}){const i=e?.isRequired("phone",{countryCode:n.countryCode,useMerchantSettings:!0})?s:void 0;return{district:void 0,subdistrict:void 0,...n,phone:n.phone||i}}function B(n,e){return!n.countryCode||!e.supportedCountries.includes(n.countryCode)}export{h as C,C as F,L as O,R as S,N as a,B as b,D as c,M as d,T as e,g as f,P as g,G as i,O as t,b as w};
