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 e}from"./p-53e7f7d7.js";const{processors:n}=i(),{state:d,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}},...n},((e,o)=>JSON.stringify(e)!==JSON.stringify(o))),a=()=>o(d.processors,"processor_type",d.sortOrder.processors).filter((o=>(null==o?void 0:o.live_mode)===("live"===(null==e?void 0:e.mode)))).filter((e=>!(d.disabled.processors||[]).includes(e.processor_type))).filter((o=>{var s;return!(null===(s=null==e?void 0:e.checkout)||void 0===s?void 0:s.reusable_payment_method_required)||!!(null==o?void 0:o.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(d.manualPaymentMethods,"id",d.sortOrder.manualPaymentMethods).filter((e=>!(d.disabled.processors||[]).includes(null==e?void 0:e.id))).filter((o=>{var s;return!(null===(s=null==e?void 0:e.checkout)||void 0===s?void 0:s.reusable_payment_method_required)||!!(null==o?void 0:o.reusable)})),m=()=>o(d.methods,"id",d.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,d as s};