/* WP PowerSuite Google reCAPTCHA — unlock submit targets after v2 solves */

/**
 * The lock is a stylesheet rule using !important, which outranks a normal inline style,
 * so the unlock has to be marked important too or the control stays dead.
 *
 * @param {string} selector Submit control selector.
 */
function wppsGrUnlock(selector) {
	document.querySelectorAll(selector).forEach(function (el) {
		el.style.setProperty('pointer-events', 'auto', 'important');
		el.style.setProperty('opacity', '1', 'important');
	});
}
function wppsGrWpCallback() {
	wppsGrUnlock('#wp-submit');
}
function wppsGrCommentCallback() {
	wppsGrUnlock('#commentform input#submit, #commentform button[type="submit"]');
}
function wppsGrWooLoginCallback() {
	wppsGrUnlock('.woocommerce-form-login__submit');
}
function wppsGrWooRegisterCallback() {
	wppsGrUnlock('.woocommerce-form-register__submit');
}
function wppsGrWooResetCallback() {
	wppsGrUnlock('.woocommerce-ResetPassword .button');
}
function wppsGrWooCheckoutCallback() {
	wppsGrUnlock(
		'#place_order, .wc-block-components-checkout-place-order-button, .wc-block-checkout__actions_row .wc-block-components-button'
	);
}
function wppsGrEDDLoginCallback() {
	wppsGrUnlock('#edd_login_submit');
}
function wppsGrEDDRegisterCallback() {
	wppsGrUnlock('#edd_register_form .edd-submit');
}
function wppsGrEDDCheckoutCallback() {
	wppsGrUnlock('.edd-submit');
}
function wppsGrElementorCallback() {
	wppsGrUnlock(
		'form.elementor-form button[type="submit"], form.elementor-form input[type="submit"], form.elementor-form .elementor-button[type="submit"]'
	);
}
function wppsGrCF7Callback() {
	wppsGrUnlock('.wpcf7-submit');
}
function wppsGrMC4WPCallback() {
	wppsGrUnlock('.mc4wp-form-fields input[type=submit]');
}
function wppsGrBuddyPressCallback() {
	wppsGrUnlock('#buddypress #signup-form .submit');
}
function wppsGrBBPressReplyCallback() {
	wppsGrUnlock('#bbp_reply_submit');
}
function wppsGrBBPressTopicCallback() {
	wppsGrUnlock('#bbp_topic_submit');
}
function wppsGrWPFCallback() {
	wppsGrUnlock('.wpforms-submit');
}
function wppsGrFluentCallback() {
	wppsGrUnlock('.fluentform .ff-btn-submit');
}
function wppsGrFormidableCallback() {
	wppsGrUnlock('.frm_forms .frm_button_submit');
}
function wppsGrGravityCallback() {
	wppsGrUnlock('.gform_button');
}
function wppsGrUMCallback() {
	wppsGrUnlock('#um-submit-btn');
}
function wppsGrMEPRCallback() {
	wppsGrUnlock('.mepr-submit');
}
function wppsGrJetpackCallback() {
	wppsGrUnlock(
		'.wp-block-jetpack-contact-form button[type="submit"], .wp-block-jetpack-contact-form button.wp-block-button__link'
	);
}
function wppsGrPmpCallback() {
	wppsGrUnlock('.pmpro_btn-submit');
}
