import{s as o}from"./p-93127aa7.js";import{c as s}from"./p-03631502.js";import{g as i}from"./p-9dbc54d6.js";import{s as n}from"./p-f3141d53.js";const{processors:d}=i(),{state:e,onChange:r,on:l,dispose:t}=s({processors:[],methods:[],manualPaymentMethods:[],disabled:{processors:[]},sortOrder:{processors:["stripe","paystack","paypal","mollie","mock"],manualPaymentMethods:[],paymentMethods:{mollie:["creditcard","paypal"]}},instances:{stripe:void 0},config:{stripe:{paymentElement:!1}},...d},((e,o)=>JSON.stringify(e)!==JSON.stringify(o))),a=()=>o(e.processors,"processor_type",e.sortOrder.processors).filter((e=>(null==e?void 0:e.live_mode)===("live"===(null==n?void 0:n.mode)))).filter((o=>!(e.disabled.processors||[]).includes(o.processor_type))).filter((e=>{var o;return!(null===(o=null==n?void 0:n.checkout)||void 0===o?void 0:o.reusable_payment_method_required)||!!(null==e?void 0:e.recurring_enabled)})).filter(((e,o,s)=>!s.some((e=>"mollie"===e.processor_type))||"mollie"===e.processor_type||"mock"===e.processor_type)),p=e=>a().find((({processor_type:o})=>o===e)),v=e=>a().find((({processor_type:o})=>o===e)),c=e=>a().some((({processor_type:o})=>o!==e&&"paypal"!==o&&"mock"!==o)),u=()=>o(e.manualPaymentMethods,"id",e.sortOrder.manualPaymentMethods).filter((o=>!(e.disabled.processors||[]).includes(null==o?void 0:o.id))).filter((e=>{var o;return!(null===(o=null==n?void 0:n.checkout)||void 0===o?void 0:o.reusable_payment_method_required)||!!(null==e?void 0:e.reusable)})),m=()=>o(e.methods,"id",e.sortOrder.paymentMethods.mollie).filter((e=>{var o,s;return"applepay"!==e.id||(null===window||void 0===window?void 0:window.ApplePaySession)&&(null===(s=null===(o=null===window||void 0===window?void 0:window.ApplePaySession)||void 0===o?void 0:o.canMakePayments)||void 0===s?void 0:s.call(o))})),y=()=>[...a(),...u()],w=()=>{var e;return(null===(e=y())||void 0===e?void 0:e.length)>1},f=()=>[...m(),...u(),p("mock")].filter(Boolean),h=()=>{var e;return(null===(e=f())||void 0===e?void 0:e.length)>1};export{a,u as b,m as c,w as d,v as e,h as f,p as g,c as h,r as o,e as s};