"use strict";const mutations=require("./mutations-10a18c83.js"),watchers=require("./watchers-2ad3abd1.js"),getters=require("./getters-ae03ef93.js"),maybeUpdateProcessor=()=>{var e,t;const a=[...getters.availableProcessors().map((({processor_type:e})=>e)),...getters.availableManualPaymentMethods().map((({id:e})=>e))];a.includes(watchers.state.id)||(null===(t=null===(e=null===window||void 0===window?void 0:window.wp)||void 0===e?void 0:e.hooks)||void 0===t?void 0:t.applyFilters)&&!window.wp.hooks.applyFilters("surecart_auto_select_payment_method",!0)||(watchers.state.id=(null==a?void 0:a.length)?null==a?void 0:a[0]:null)},maybeUpdateMethod=()=>{const e=(getters.availableMethodTypes()||[]).map((({id:e})=>e));"mollie"===(null===watchers.state||void 0===watchers.state?void 0:watchers.state.id)?e.includes(watchers.state.method)||(watchers.state.method=(null==e?void 0:e.length)?null==e?void 0:e[0]:null):watchers.state.method=null};mutations.onChange("checkout",(()=>{maybeUpdateProcessor(),maybeUpdateMethod()})),watchers.onChange("id",(()=>maybeUpdateProcessor())),getters.onChange("processors",(()=>maybeUpdateProcessor())),getters.onChange("disabled",(()=>maybeUpdateProcessor())),getters.onChange("methods",(()=>maybeUpdateMethod()));