import{s as o}from"./p-6c2a2148.js";import{c as s}from"./p-35c4916d.js";import{a}from"./p-10aa7556.js";const{state:r,onChange:e}=s({processors:[],methods:[],manualPaymentMethods:[],disabled:{processors:[]},sortOrder:{processors:["stripe","paypal"],manualPaymentMethods:[],paymentMethods:{mollie:["creditcard","paypal"]}},config:{stripe:{paymentElement:!1}}},((o,s)=>JSON.stringify(o)!==JSON.stringify(s))),l=()=>o(r.processors,"processor_type",r.sortOrder.processors).filter((o=>(null==o?void 0:o.live_mode)===("live"===(null==a?void 0:a.mode)))).filter((o=>!(r.disabled.processors||[]).includes(o.processor_type))).filter((o=>{var s;return!(null===(s=null==a?void 0:a.checkout)||void 0===s?void 0:s.reusable_payment_method_required)||!!(null==o?void 0:o.recurring_enabled)})).filter(((o,s,a)=>!a.some((o=>"mollie"===o.processor_type))||"mollie"===o.processor_type)),i=o=>l().find((({processor_type:s})=>s===o)),d=()=>{var s;return(null===(s=null==a?void 0:a.checkout)||void 0===s?void 0:s.reusable_payment_method_required)?[]:o(r.manualPaymentMethods,"id",r.sortOrder.manualPaymentMethods).filter((o=>!(r.disabled.processors||[]).includes(null==o?void 0:o.id)))},t=()=>o(r.methods,"id",r.sortOrder.paymentMethods.mollie),n=()=>{var o;return(null===(o=[...l(),...d()])||void 0===o?void 0:o.length)>1},p=()=>{var o;return(null===(o=[...t(),...d()])||void 0===o?void 0:o.length)>1};export{l as a,d as b,t as c,p as d,i as g,n as h,e as o,r as s}