let bspb_trycnt = 0;
const bspb_init = () => {
    bspb_trycnt++;
    if (bspb_trycnt >= 100) return;
    if ( (typeof(wc) === 'undefined') || (typeof(wp) === 'undefined') || ( typeof(wc.wcSettings) === 'undefined' ) || ( typeof(wc.wcBlocksRegistry) === 'undefined' ) ) setTimeout(bspb_init,100);
    else {
        const bspbModuleId = 'woocommerce-bspb';
        const bspbSettings = wc.wcSettings.getSetting(bspbModuleId+'_data',{});

        wc.wcBlocksRegistry.registerPaymentMethod({
            name: bspbModuleId,
            label: React.createElement(()=>wp.htmlEntities.decodeEntities(bspbSettings.title)),
            content: React.createElement(()=>wp.htmlEntities.decodeEntities(bspbSettings.description)),
            edit: React.createElement(()=>wp.htmlEntities.decodeEntities(bspbSettings.description)),
            canMakePayment: () => bspbSettings.enabled,
            ariaLabel: wp.htmlEntities.decodeEntities(bspbSettings.title),
            supports: {
                features: ['products'],
            },
        });
    }
}
bspb_init();
