/**
* These scripts are part of the Conditional Fields for Contact Form 7 plugin.
* Should only be loaded when editing a form in the WP backend.
*/
if (typeof(_wpcf7) != 'undefined' || typeof(wpcf7) != 'undefined') {
var wpcf7cf = {};
wpcf7cf.MAX_CONDITIONS = 50;
wpcf7cf.$newEntry = jQuery(`
`);
wpcf7cf.$textView = jQuery('#wpcf7cf-settings-text').eq(0);
wpcf7cf.$textOnlyCheckbox = jQuery('#wpcf7cf-text-only-checkbox').eq(0);
wpcf7cf.$entriesUi = jQuery('#wpcf7cf-entries-ui').eq(0);
wpcf7cf.$addButton = jQuery('#wpcf7cf-add-button').eq(0);
wpcf7cf.$maxReachedWarning = jQuery('#wpcf7cf-a-lot-of-conditions').eq(0);
wpcf7cf.$formEditorForm = jQuery('#wpcf7-admin-form-element').eq(0);
wpcf7cf.$formEditor = jQuery('#wpcf7-form').eq(0);
// Smart Grid compat https://wordpress.org/support/topic/rule-sets-only-saving-when-in-text-mode/
if(jQuery('#cf7sg-editor').length>0) wpcf7cf.$formEditorForm = jQuery('form#post').eq(0);
wpcf7cf.regexCondition = /(?:show \[([^\]]*?)\]) if \[([^\]]*?)\] (?:(equals \(regex\)|not equals \(regex\)|equals|not equals|greater than or equals|greater than|less than or equals|less than|is empty|not empty|function)(?: \"(.*)\")?)/g;
wpcf7cf.regexConditionAnd = /and if \[([^\]]*?)\] (?:(equals \(regex\)|not equals \(regex\)|equals|not equals|greater than or equals|greater than|less than or equals|less than|is empty|not empty|function)(?: \"(.*)\")?)/g;
wpcf7cf.transformConditionsFromStringToArrayOfObjects = function(str) {
if (!str) str = '';
var conditionsAsStrings = str.split(/\r?\n(?=show)/);
var conditionsAsObjects = [];
for (var i = 0; i