Everest Forms – Easy Contact Form and Form Builder - Version 1.7.9

Version Description

  • 12-11-2021 =
  • fix - Row setting hidden issue.
  • Enhancement - Datepicker glitches in builder page.
Download this release

Release Info

Developer everestforms
Plugin Icon 128x128 Everest Forms – Easy Contact Form and Form Builder
Version 1.7.9
Comparing to
See all releases

Code changes from version 1.7.8 to 1.7.9

assets/js/admin/form-builder.js CHANGED
@@ -19,29 +19,37 @@
19
  }
20
  });
21
 
22
- $( document ).ready( function( $ ) {
23
- if ( '1' === $( '.everest-forms-min-max-date-format input' ).val() ) {
24
- $( '.everest-forms-min-max-date-option' ).find( 'input' ).datepicker({
25
- defaultDate: '',
26
- dateFormat: 'yy-mm-dd',
27
- numberOfMonths: 1,
28
- showButtonPanel: true,
29
- onSelect: function() {
30
- var option = $( this ).is( '.everest-forms-min-date' ) ? 'minDate' : 'maxDate',
31
- dates = $( this ).closest( '.everest-forms-min-max-date-option' ).find( 'input' ),
32
- date = $( this ).datepicker( 'getDate' );
33
-
34
- dates.not( this ).datepicker( 'option', option, date );
35
- $( this ).change();
36
- }
37
- } );
 
 
 
 
 
 
38
  }
 
 
39
 
40
  if ( ! $( 'evf-panel-payments-button a' ).hasClass( 'active' ) ) {
41
  $( '#everest-forms-panel-payments' ).find( '.everest-forms-panel-sidebar a' ).first().addClass( 'active' );
42
  $( '.everest-forms-panel-content' ).find( '.evf-payment-setting-content' ).first().addClass( 'active' );
43
  }
44
- });
45
 
46
  // Copy shortcode from the builder.
47
  $( document.body ).find('#copy-shortcode' )
@@ -2633,11 +2641,36 @@ jQuery( function ( $ ) {
2633
  }
2634
  });
2635
 
 
2636
  $( document ).on( 'click', '.everest-forms-min-max-date-format input', function() {
 
 
2637
  if ( $( this ).is( ':checked' ) ) {
2638
  $( '.everest-forms-min-max-date-option' ).removeClass( 'everest-forms-hidden' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2639
  } else {
2640
- $( '.everest-forms-min-max-date-option' ).addClass( 'everest-forms-hidden' );
2641
  }
2642
  });
2643
 
19
  }
20
  });
21
 
22
+
23
+ $(document).ready( function( $ ) {
24
+ if( '1' === $( '.everest-forms-min-max-date-format input' ).val() ) {
25
+ $('.everest-forms-min-date').addClass('flatpickr-field').flatpickr({
26
+ disableMobile : true,
27
+ onChange : function(selectedDates, dateStr, instance) {
28
+ $('.everest-forms-min-date').val(dateStr);
29
+ },
30
+ onOpen: function(selectedDates, dateStr, instance) {
31
+ instance.set('maxDate', $('.everest-forms-max-date').val());
32
+ },
33
+ });
34
+
35
+ $('.everest-forms-max-date').addClass('flatpickr-field').flatpickr({
36
+ disableMobile : true,
37
+ onChange : function(selectedDates, dateStr, instance) {
38
+ $('.everest-forms-max-date').val(dateStr);
39
+ },
40
+ onOpen: function(selectedDates, dateStr, instance) {
41
+ instance.set('minDate', $('.everest-forms-min-date').val());
42
+ },
43
+ });
44
  }
45
+ });
46
+
47
 
48
  if ( ! $( 'evf-panel-payments-button a' ).hasClass( 'active' ) ) {
49
  $( '#everest-forms-panel-payments' ).find( '.everest-forms-panel-sidebar a' ).first().addClass( 'active' );
50
  $( '.everest-forms-panel-content' ).find( '.evf-payment-setting-content' ).first().addClass( 'active' );
51
  }
52
+
53
 
54
  // Copy shortcode from the builder.
55
  $( document.body ).find('#copy-shortcode' )
2641
  }
2642
  });
2643
 
2644
+
2645
  $( document ).on( 'click', '.everest-forms-min-max-date-format input', function() {
2646
+ var minDate = $( this ).closest( '.everest-forms-date' ).find( '.everest-forms-min-date' ).val();
2647
+ var maxDate = $(this).closest('.everest-forms-date').find('.everest-forms-min-date').val();
2648
  if ( $( this ).is( ':checked' ) ) {
2649
  $( '.everest-forms-min-max-date-option' ).removeClass( 'everest-forms-hidden' );
2650
+ if( '' === minDate ){
2651
+ $('.everest-forms-min-date').addClass('flatpickr-field').flatpickr({
2652
+ disableMobile : true,
2653
+ onChange : function(selectedDates, dateStr, instance) {
2654
+ $( '.everest-forms-min-date' ).val(dateStr);
2655
+ },
2656
+ onOpen: function(selectedDates, dateStr, instance) {
2657
+ instance.set('maxDate', $('.everest-forms-max-date').val());
2658
+ },
2659
+ });
2660
+ }
2661
+ if('' === maxDate ){
2662
+ $( '.everest-forms-max-date' ).addClass( 'flatpickr-field' ).flatpickr({
2663
+ disableMobile : true,
2664
+ onChange : function(selectedDates, dateStr, instance) {
2665
+ $( '.everest-forms-max-date' ).val(dateStr);
2666
+ },
2667
+ onOpen: function(selectedDates, dateStr, instance) {
2668
+ instance.set('minDate', $( '.everest-forms-min-date' ).val());
2669
+ },
2670
+ });
2671
+ }
2672
  } else {
2673
+ $( '.everest-forms-min-max-date-option' ).addClass( 'everest-forms-hidden' );
2674
  }
2675
  });
2676
 
assets/js/admin/form-builder.min.js CHANGED
@@ -1 +1 @@
1
- !function(v,c){var a,m={init:function(){v(document).ready(function(e){e("evf-panel-integrations-button a").hasClass("active")||(e("#everest-forms-panel-integrations").find(".everest-forms-panel-sidebar a").first().addClass("active"),e("#everest-forms-panel-integrations").find(".everest-forms-panel-sidebar a").hasClass("active")&&e("#everest-forms-panel-integrations").find(".everest-forms-panel-sidebar a").next(".everest-forms-active-connections").first().addClass("active"),e(".everest-forms-panel-content").find(".evf-panel-content-section").first().addClass("active"))}),v(document).ready(function(o){"1"===o(".everest-forms-min-max-date-format input").val()&&o(".everest-forms-min-max-date-option").find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,onSelect:function(){var e=o(this).is(".everest-forms-min-date")?"minDate":"maxDate",t=o(this).closest(".everest-forms-min-max-date-option").find("input"),i=o(this).datepicker("getDate");t.not(this).datepicker("option",e,i),o(this).change()}}),o("evf-panel-payments-button a").hasClass("active")||(o("#everest-forms-panel-payments").find(".everest-forms-panel-sidebar a").first().addClass("active"),o(".everest-forms-panel-content").find(".evf-payment-setting-content").first().addClass("active"))}),v(document.body).find("#copy-shortcode").on("click",this.copyShortcode).on("aftercopy",this.copySuccess).on("aftercopyfailure",this.copyFail),v(document.body).find(".evf-copy-shortcode").each(function(){v(this).on("click",m.copyShortcode).on("aftercopy",m.copySuccess).on("aftercopyfailure",m.copyFail)}),v(document).ready(m.ready),v(window).on("load",m.load),v(document.body).on("evf-init-builder-fields",function(){m.bindFields()}).trigger("evf-init-builder-fields"),v(document.body).on("adjust_builder_width",function(){var e=v("#adminmenuwrap").width();v("#everest-forms-builder-form").css({width:"calc(100% - "+e+"px)"})}).trigger("adjust_builder_width"),v(document.body).on("click","#collapse-button",function(){v("#everest-forms-builder-form").width(""),v(document.body).trigger("adjust_builder_width")}),v(window).on("resize orientationchange",function(){clearTimeout(void 0),setTimeout(function(){v("#everest-forms-builder").width(""),v(document.body).trigger("adjust_builder_width")},250)}).trigger("resize")},copyShortcode:function(e){evfClearClipboard(),evfSetClipboard(v(this).closest(".evf-shortcode-field").find("input").val(),v(this)),e.preventDefault()},copySuccess:function(){v(this).tooltipster("content",v(this).attr("data-copied")).trigger("mouseenter").on("mouseleave",function(){var e=v(this);setTimeout(function(){e.tooltipster("content",e.attr("data-tip"))},1e3)})},copyFail:function(){v(this).closest(".evf-shortcode-field").find("input").focus().select()},load:function(){v(".everest-forms-overlay").fadeOut()},ready:function(){var e,t;a=v("#everest-forms-builder"),m.bindUIActions(),m.bindEditActions(),jconfirm.defaults={closeIcon:!0,backgroundDismiss:!0,escapeKey:!0,animationBounce:1,useBootstrap:!1,theme:"modern",boxWidth:"400px",columnClass:"evf-responsive-class"},"undefined"!=typeof PerfectScrollbar&&(e=v(".everest-forms-tab-content"),t=v(".everest-forms-panel"),1<=e.length&&(window.evf_tab_scroller=new PerfectScrollbar(".everest-forms-tab-content",{suppressScrollX:!0})),t.each(function(){var e=v(this),t=e.attr("id");1<=e.find(".everest-forms-panel-sidebar").length&&(window.evf_setting_scroller=new PerfectScrollbar("#"+t+" .everest-forms-panel-sidebar"))})),a.on("change",".everest-forms-field-option-row-limit_enabled input",function(e){m.updateTextFieldsLimitControls(v(e.target).parents(".everest-forms-field-option-row-limit_enabled").data().fieldId,e.target.checked)}),a.on("change",".everest-forms-field-option-select .everest-forms-field-option-row-enhanced_select input",function(e){m.enhancedSelectFieldStyle(v(e.target).parents(".everest-forms-field-option-row-enhanced_select").data().fieldId,e.target.checked)}),a.on("click",".everest-forms-field-option-row-choices .everest-forms-btn-group span",function(e){v(this).hasClass("upgrade-modal")&&"checkbox"===v(this).data("type")?(v(this).parent().find("span").addClass("is-active"),v(this).removeClass("is-active"),m.updateEnhandedSelectField(v(e.target).parents(".everest-forms-field-option-row-choices").data().fieldId,!1)):(v(this).parent().find("span").removeClass("is-active"),v(this).addClass("is-active"),m.updateEnhandedSelectField(v(e.target).parents(".everest-forms-field-option-row-choices").data().fieldId,"multiple"===v(this).data("selection")))}),a.on("keyup",".everest-forms-search-fields",function(){var t=v(this).val().toLowerCase();v(".evf-registered-item").each(function(){var e=v(this);field_type=e.data("field-type"),field_label=e.text().toLowerCase(),-1<field_type.search(t)||-1<field_label.search(t)?(e.addClass("evf-searched-item"),e.show()):(e.removeClass("evf-searched-item"),e.hide())}),v(".everest-forms-add-fields-group").each(function(){v(this).find(".evf-registered-item.evf-searched-item").length<=0?v(this).hide():v(this).show()}),v(".evf-registered-item.evf-searched-item").length?v(".everest-forms-fields-not-found").addClass("hidden"):v(".everest-forms-fields-not-found").removeClass("hidden")}),v(document).trigger("everest_forms_ready")},updateTextFieldsLimitControls:function(e,t){t?v("#everest-forms-field-option-row-"+e+"-limit_controls").removeClass("everest-forms-hidden"):v("#everest-forms-field-option-row-"+e+"-limit_controls").addClass("everest-forms-hidden")},enhancedSelectFieldStyle:function(e,t){var i=v("#everest-forms-field-"+e+" .primary-input"),e=v("#everest-forms-field-option-"+e+"-enhanced_select").is(":checked");t&&e&&i.prop("multiple")?(i.addClass("evf-enhanced-select"),v(document.body).trigger("evf-enhanced-select-init")):(i.removeClass("evf-enhanced-select enhanced"),i.filter(".select2-hidden-accessible").selectWoo("destroy"))},updateEnhandedSelectField:function(e,t){var i=v("#everest-forms-field-"+e+" .primary-input"),o=i.find(".placeholder"),s=v("#everest-forms-field-option-"+e+"-multiple_choices"),n=v("#everest-forms-field-option-row-"+e+"-choices input.default"),r=n.filter(":checked");s.val(t?1:0),i.prop("multiple",t),n.prop("type",t?"checkbox":"radio"),!t&&r.length&&(n.prop("checked",!1),v(r.get(0)).prop("checked",!0)),o.length&&t&&o.prop("selected",!t),m.enhancedSelectFieldStyle(e,t)},bindUIActions:function(){m.bindDefaultTabs(),m.checkEmptyGrid(),m.bindFields(),m.bindFormPreview(),m.bindGridSwitcher(),m.bindFieldSettings(),m.bindFieldDelete(),m.bindFieldDeleteWithKeyEvent(),m.bindCloneField(),m.bindSaveOption(),m.bindAddNewRow(),m.bindRemoveRow(),m.bindFormSettings(),m.bindFormEmail(),m.bindFormIntegrations(),m.bindFormPayment(),m.choicesInit(),m.bindToggleHandleActions(),m.bindLabelEditInputActions(),m.bindSyncedInputActions(),m.init_datepickers(),m.bindBulkOptionActions(),m.bindUIActionsFields(),"field-options"===c.tab&&v(".evf-panel-field-options-button").trigger("click"),v(document.body).on("everest-forms-field-drop",".evf-registered-buttons .evf-registered-item",function(){m.fieldDrop(v(this).clone())})},bindBulkOptionActions:function(){v(document.body).on("click",".evf-toggle-bulk-options",function(e){v(this).closest(".everest-forms-field-option").find(".everest-forms-field-option-row-add_bulk_options").slideToggle()}),v(document.body).on("click",".evf-toggle-presets-list",function(e){v(this).closest(".everest-forms-field-option").find(".everest-forms-field-option-row .evf-options-presets").slideToggle()}),v(document.body).on("click",".evf-add-bulk-options",function(e){var t,i=v(this).closest(".everest-forms-field-option-row"),o=i.data("field-id");i.length&&(t=i.closest(".everest-forms-field-option").find(".everest-forms-field-option-row-choices .evf-choices-list"),o=(i=i.find("textarea#everest-forms-field-option-"+o+"-add_bulk_options")).val().split("\n"),m.addBulkOptions(o,t),i.val(""))}),v(document.body).on("click",".evf-options-preset-label",function(e){var t,i=v(this).closest(".everest-forms-field-option-row"),o=i.data("field-id");i.length&&(t=v(this).closest(".evf-options-preset").find(".evf-options-preset-value").val(),i.find("textarea#everest-forms-field-option-"+o+"-add_bulk_options").val(t),v(this).closest(".evf-options-presets").slideUp())}),v(document.body).on("click",".everest-forms-field-option-row-password_strength",function(){v(this).find('[type="checkbox"]:first').prop("checked")&&v(this).next().find('[type="checkbox"]:first').prop("checked",!1)}),v(document.body).on("click",".everest-forms-field-option-row-password_validation",function(){v(this).find('[type="checkbox"]:first').prop("checked")&&(v(this).prev().find('[type="checkbox"]:first').prop("checked",!1),v(this).prev().find(".everest-forms-inner-options").addClass("everest-forms-hidden"))})},addBulkOptions:function(e,i){e.forEach(function(e){var t;""!==e&&(t=i.find("li").last().find("a.add"),m.choiceAdd(null,t,e.trim()))})},init_datepickers:function(){var e=v(".everest-forms-disable-dates").data("date-format");v(".everest-forms-disable-dates").each(function(){v(this).get(0)._flatpickr||v(this).flatpickr({dateFormat:e,mode:"multiple"})}),v(document.body).on("change",".evf-date-format",function(e){var t=v(".everest-forms-field-option:visible .everest-forms-disable-dates"),i=t.get(0)._flatpickr,o=i.selectedDates,s=v(this).val(),n=[];o.forEach(function(e){n.push(flatpickr.formatDate(e,s))}),i.set("dateFormat",s),t.val(n.join(", "))}),v(document.body).on("click",".evf-clear-disabled-dates",function(){v(".everest-forms-field-option:visible .everest-forms-disable-dates").get(0)._flatpickr.clear()}),v(".everest-forms-field-date-time").each(function(){var e=v(this).attr("data-field-id");m.dateSettingToggler(e,v("#everest-forms-field-option-"+e+"-datetime_style").val())})},bindEditActions:function(){v("#edit-form-name").on("click",function(e){e.stopPropagation(),""!==v("#evf-edit-form-name").val().trim()&&m.toggleEditTitle(e)}),v("#evf-edit-form-name").on("change keypress",function(e){var t=v(this);e.stopPropagation(),13===e.which&&""!==v(this).val().trim()&&m.toggleEditTitle(e),""!==t.val().trim()&&v("#everest-forms-panel-field-settings-form_title").val(t.val().trim())}).on("click",function(e){e.stopPropagation()}),v(document).not(v(".everest-forms-title-desc")).on("click",function(e){var t=v("#evf-edit-form-name");e.stopPropagation(),!t.prop("disabled")&&t.val()&&""!==t.val().trim()&&m.toggleEditTitle(e)})},toggleEditTitle:function(e){var t=v("#edit-form-name").siblings("#evf-edit-form-name");e.preventDefault(),t.prop("disabled",function(e,t){return!t}),t.hasClass("everst-forms-name-editing")||t.focus(),t.toggleClass("everst-forms-name-editing")},formObject:function(e){for(var t=jQuery(e).find("[name]"),i={},o={},s=0;s<t.length;s++){var n=jQuery(t[s]),r=n.prop("name").replace(/\]/gi,"").split("["),a=n.val(),d={};if(!n.is(":radio")&&!n.is(":checkbox")||n.is(":checked")){for(var l=r.length-1;0<=l;l--){var f=r[l];if(0===(f=void 0===f?"":f).length&&(d=[],"undefined"==typeof o[r[l-1]]?o[r[l-1]]=0:o[r[l-1]]+=1,f=o[r[l-1]]),l===r.length-1){if(a)if("true"===a)a=!0;else if("false"===a)a=!1;else if(isNaN(parseFloat(a))||parseFloat(a).toString()!==a)if("string"!=typeof a||"{"!==a.substr(0,1)&&"["!==a.substr(0,1)){if("object"==typeof a&&a.length&&n.is("select")){for(var c={},l=0;l<a.length;l++)c["n"+l]=a[l];a=c}}else try{a=JSON.parse(a)}catch(p){}else a=parseFloat(a);d[f]=a}else{var m=d;(d={})[f]=m}}v.extend(!0,i,d)}}return i},bindUIActionsFields:function(){a.on("click",".everest-forms-field-option-row-choices .add",function(e){m.choiceAdd(e,v(this))}),a.on("click",".everest-forms-field-option-row-choices .remove",function(e){m.choiceDelete(e,v(this))}),a.on("mousedown",".everest-forms-field-option-row-choices input[type=radio]",function(){var e=v(this);e.is(":checked")?e.attr("data-checked","1"):e.attr("data-checked","0")}),a.on("click",".everest-forms-field-option-row-choices input[type=radio]",function(){var e=v(this),t=e.parent().parent();e.parent().parent().find("input[type=radio]").not(this).prop("checked",!1),"1"===e.attr("data-checked")&&(e.prop("checked",!1),e.attr("data-checked","0")),m.choiceUpdate(t.data("field-type"),t.data("field-id"))}),a.on("change",".everest-forms-field-option-row-choices input[type=checkbox]",function(e){var t=v(this).parent().parent();m.choiceUpdate(t.data("field-type"),t.data("field-id"))}),a.on("keyup paste focusout",".everest-forms-field-option-row-choices input.label, .everest-forms-field-option-row-choices input.value",function(e){var t=v(this).parent().parent().parent();m.choiceUpdate(t.data("field-type"),t.data("field-id"))}),a.on("change",".everest-forms-field-option-row-show_values input",function(e){v(this).closest(".everest-forms-field-option").find(".everest-forms-field-option-row-choices ul").toggleClass("show-values")}),a.on("change",".everest-forms-field-option-row-choices_images input",function(){var e=v(this),t=e.parent().data("field-id"),i=v("#everest-forms-field-option-"+t),o=v("#everest-forms-field-option-"+t+"-input_columns"),s=v("#everest-forms-field-option-"+t).find(".everest-forms-field-option-hidden-type").val();e.parent().find(".notice").toggleClass("hidden"),i.find(".everest-forms-field-option-row-choices ul").toggleClass("show-images"),(e.is(":checked")?o.val("inline"):o.val("")).trigger("change"),m.choiceUpdate(s,t)}),a.on("click",".everest-forms-attachment-media-view .upload-button",function(e){var t,i,o=v(this);e.preventDefault(),i||(i=wp.media.frames.everestforms_media_frame=wp.media({title:c.i18n_upload_image_title,className:"media-frame everest-forms-media-frame",frame:"select",multiple:!1,library:{type:"image"},button:{text:c.i18n_upload_image_button}})).on("select",function(){var e=i.state().get("selection").first().toJSON();(t=o.hasClass("button-add-media")?(o.hide(),o.parent()):o.parent().parent().parent()).find(".source").val(e.url),t.find(".attachment-thumb").remove(),t.find(".thumbnail-image").prepend('<img class="attachment-thumb" src="'+e.url+'">'),t.find(".actions").show(),a.trigger("everestFormsImageUploadAdd",[o,t])}),i.open()}),a.on("click",".everest-forms-attachment-media-view .remove-button",function(e){e.preventDefault();e=v(this).parent().parent();e.find(".attachment-thumb").remove(),e.parent().find(".source").val(""),e.parent().find(".button-add-media").show(),a.trigger("everestFormsImageUploadRemove",[v(this),e])}),a.on("everestFormsImageUploadAdd everestFormsImageUploadRemove",function(e,t,i){var o=i.closest(".evf-choices-list"),i=o.data("field-type"),o=o.data("field-id");m.choiceUpdate(i,o)}),a.on("change",".everest-forms-field-option-row-input_columns select",function(){var e=v(this),t=e.val(),i=e.parent().data("field-id"),e="";"inline"===t?e="everest-forms-list-inline":""!==t&&(e="everest-forms-list-"+t+"-columns"),v("#everest-forms-field-"+i).removeClass("everest-forms-list-inline everest-forms-list-2-columns everest-forms-list-3-columns").addClass(e)}),a.on("click",".everest-forms-fields-tab a",function(e){e.preventDefault(),m.fieldTabChoice(v(this).attr("id"))}),a.on("change",".everest-forms-field-option-address input.hide",function(){var e=v(this),t=e.parent().parent().data("field-id"),e=e.parent().parent().data("subfield");v("#everest-forms-field-"+t).find(".everest-forms-"+e).toggleClass("hidden")}),a.on("input",".everest-forms-field-option-row-label input",function(){var e=v(this),t=e.val(),e=e.parent().data("field-id");$label=v("#everest-forms-field-"+e).find(".label-title .text"),$label.hasClass("nl2br")?$label.html(t.replace(/\n/g,"<br>")):$label.html(t)}),a.on("input",".everest-forms-field-option-row-description textarea",function(){var e=v(this),t=e.val(),e=e.parent().data("field-id"),e=v("#everest-forms-field-"+e).find(".description");e.hasClass("nl2br")?e.html(t.replace(/\n/g,"<br>")):e.html(t)}),a.on("change",".everest-forms-field-option-row-required input",function(e){var t=v(this).parent().data("field-id");v("#everest-forms-field-"+t).toggleClass("required"),v(e.target).is(":checked")?v("#everest-forms-field-option-row-"+t+"-required-field-message").show():v("#everest-forms-field-option-row-"+t+"-required-field-message").hide()}),a.on("change",".everest-forms-field-option-row-confirmation input",function(e){var t=v(this).parent().data("field-id");v(e.target).is(":checked")?(v("#everest-forms-field-"+t).find(".everest-forms-confirm").removeClass("everest-forms-confirm-disabled").addClass("everest-forms-confirm-enabled"),v("#everest-forms-field-option-"+t).removeClass("everest-forms-confirm-disabled").addClass("everest-forms-confirm-enabled")):(v("#everest-forms-field-"+t).find(".everest-forms-confirm").removeClass("everest-forms-confirm-enabled").addClass("everest-forms-confirm-disabled"),v("#everest-forms-field-option-"+t).removeClass("everest-forms-confirm-enabled").addClass("everest-forms-confirm-disabled"))}),a.on("input",".everest-forms-field-option-row-placeholder input",function(e){var t=v(this),i=t.val(),t=t.parent().data("field-id"),t=v("#everest-forms-field-"+t).find(".widefat:not(.secondary-input)");t.is("select")?i.length?(t.find(".placeholder").length?t.find(".placeholder").text(i):t.prepend('<option class="placeholder" selected>'+i+"</option>"),t.data("placeholder",i),t.hasClass("enhanced")&&t.parent().find(".select2-search__field").prop("placeholder",i)):t.find(".placeholder").remove():t.attr("placeholder",i)}),a.on("input",".everest-forms-field-option-address input.placeholder",function(e){var t=v(this),i=t.val(),o=t.parent().parent().data("field-id"),t=t.parent().parent().data("subfield");v("#everest-forms-field-"+o).find(".everest-forms-"+t+" input").attr("placeholder",i)}),a.on("input",".everest-forms-field-option-row-confirmation_placeholder input",function(){var e=v(this),t=e.val(),e=e.parent().data("field-id");v("#everest-forms-field-"+e).find(".secondary-input").attr("placeholder",t)}),a.on("change",".everest-forms-field-option-row-label_hide input",function(){var e=v(this).parent().data("field-id");v("#everest-forms-field-"+e).toggleClass("label_hide")}),a.on("change",".everest-forms-field-option-row-sublabel_hide input",function(){var e=v(this).parent().data("field-id");v("#everest-forms-field-"+e).toggleClass("sublabel_hide")}),a.on("change",".everest-forms-field-option-row-datetime_format select, .everest-forms-field-option-row-phone_format select, .everest-forms-field-option-row-item_price select, .everest-forms-field-option-row-format select",function(e){var t=v(this),i=t.val(),t=t.parent().data("field-id");v("#everest-forms-field-"+t).find(".format-selected").removeClass().addClass("format-selected format-selected-"+i),v("#everest-forms-field-option-"+t).find(".format-selected").removeClass().addClass("format-selected format-selected-"+i)}),a.on("change",".everest-forms-field-option-row-datetime_style select",function(){m.dateSettingToggler(v(this).parent().attr("data-field-id"),v(this).val())}),v(".everest-forms-field-option-row-time_interval_format [id*=enable_min_max_time]").each(function(){v(this).prop("checked")?(v(this).parent().parent().find(".input-group-col-2").has(" [id*=min_time_hour]").show(),v(this).parent().parent().find(".input-group-col-2").has(" [id*=max_time_hour]").show(),v(this).parent().parent().find(".input-group-col-2").has(" [for*=select_min_time]").show(),v(this).parent().parent().find(".input-group-col-2").has("[for*=select_max_time]").show()):(v(this).parent().parent().find(".input-group-col-2").has("[id*=min_time_hour]").hide(),v(this).parent().parent().find(".input-group-col-2").has("[id*=max_time_hour]").hide(),v(this).parent().parent().find("[for*=select_min_time]").hide(),v(this).parent().parent().find("[for*=select_max_time]").hide())}),a.on("click",".everest-forms-field-option-row-time_interval_format [id*=enable_min_max_time]",function(){v(this).prop("checked")?(v(this).parent().parent().find(".input-group-col-2").has(" [id*=min_time_hour]").show(),v(this).parent().parent().find(".input-group-col-2").has(" [id*=max_time_hour]").show(),v(this).parent().parent().find("[for*=select_min_time]").show(),v(this).parent().parent().find("[for*=select_max_time]").show()):(v(this).parent().parent().find(".input-group-col-2").has("[id*=min_time_hour]").hide(),v(this).parent().parent().find(".input-group-col-2").has("[id*=max_time_hour]").hide(),v(this).parent().parent().find("[for*=select_min_time]").hide(),v(this).parent().parent().find("[for*=select_max_time]").hide())}),a.on("change",".everest-forms-field-option-row-time_interval_format select[id*=time_format]",function(){min_hour=v(this).parent().siblings(".input-group-col-2").find("[id*=min_time_hour]"),max_hour=v(this).parent().siblings(".input-group-col-2").find("[id*=max_time_hour]");var e,t,o=min_hour.find("option:selected").val(),s=max_hour.find("option:selected").val(),n="";for(i=0;i<=23;i++)"H:i"===v(this).val()?n+='<option value = "'+i+'">'+(i<10?"0"+i:i)+"</option>":(e=" PM",0==(t=i<12?(e=" AM",i):i-12)&&(t=12),n+='<option value = "'+i+'">'+t+e+"</option>");min_hour.html(n),max_hour.html(n),min_hour.find("option[value="+o+"]").prop("selected",!0),max_hour.find("option[value="+s+"]").prop("selected",!0)})},dateSettingToggler:function(e,t){"picker"==t?(v("#everest-forms-field-option-row-"+e+"-placeholder").show(),v("#everest-forms-field-option-"+e+"-disable_dates").show(),v("label[for=everest-forms-field-option-"+e+"-disable_dates]").show(),v("#everest-forms-field-option-"+e+"-date_mode-range").parents().find("everest-forms-checklist").show(),v(".everest-forms-field-option-row-date_format .time_interval").show(),v("#everest-forms-field-option-"+e+"-date_localization").show(),v("label[for=everest-forms-field-option-"+e+"-date_localization]").show(),v("#everest-forms-field-option-"+e+"-date_default").parent().show(),v("#everest-forms-field-option-"+e+"-enable_min_max").parent().show(),v("#everest-forms-field-option-"+e+"-enable_min_max").prop("checked")&&v("#everest-forms-field-option-row-"+e+"-date_format .everest-forms-min-max-date-option").removeClass("everest-forms-hidden"),v("#everest-forms-field-option-"+e+"-time_interval").show(),v("#everest-forms-field-option-"+e+"-enable_min_max_time").hide(),v("label[for=everest-forms-field-option-"+e+"-enable_min_max_time]").hide(),v("label[for=everest-forms-field-option-"+e+"-select_min_time]").hide(),v("label[for=everest-forms-field-option-"+e+"-select_max_time]").hide(),v("#everest-forms-field-option-"+e+"-min_time_hour").parent().hide(),v("#everest-forms-field-option-"+e+"-max_time_hour").parent().hide()):(v("#everest-forms-field-option-"+e+"-date_mode-range").parents().find("everest-forms-checklist").hide(),v("#everest-forms-field-option-"+e+"-date_default").parent().hide(),v("#everest-forms-field-option-row-"+e+"-placeholder").hide(),v("#everest-forms-field-option-"+e+"-enable_min_max").parent().hide(),v("#everest-forms-field-option-row-"+e+"-date_format .everest-forms-min-max-date-option").addClass("everest-forms-hidden"),v("#everest-forms-field-option-"+e+"-disable_dates").hide(),v("label[for=everest-forms-field-option-"+e+"-disable_dates]").hide(),v(".everest-forms-field-option-row-date_format .everest-forms-checklist").hide(),v(".everest-forms-field-option-row-date_format .time_interval").hide(),v("#everest-forms-field-option-"+e+"-date_localization").hide(),v("label[for=everest-forms-field-option-"+e+"-date_localization]").hide(),v("#everest-forms-field-option-"+e+"-time_interval").hide(),v("#everest-forms-field-option-"+e+"-enable_min_max_time").show(),v("label[for=everest-forms-field-option-"+e+"-enable_min_max_time]").show(),v("#everest-forms-field-option-"+e+"-enable_min_max_time").prop("checked")&&(v("label[for=everest-forms-field-option-"+e+"-select_min_time]").show(),v("label[for=everest-forms-field-option-"+e+"-select_max_time]").show(),v("#everest-forms-field-option-"+e+"-min_time_hour").parent().show(),v("#everest-forms-field-option-"+e+"-max_time_hour").parent().show()))},choicesInit:function(e){v(e=e||".everest-forms-field-option-row-choices ul").sortable({items:"li",axis:"y",handle:".sort",scrollSensitivity:40,stop:function(e){var t=v(e.target).attr("data-field-id"),e=v("#everest-forms-field-option-"+t).find(".everest-forms-field-option-hidden-type").val();m.choiceUpdate(e,t)}})},choiceAdd:function(e,t,i){e&&e.preventDefault&&e.preventDefault();var o=v(t),s=o.parent(),n=s.find("input.default").is(":checked"),r=o.closest(".everest-forms-field-option-row-choices").data("field-id"),e=s.parent().attr("data-next-id"),t=s.parent().data("field-type"),o=s.clone().insertAfter(s);o.attr("data-key",e),o.find("input.label").val(i).attr("name","form_fields["+r+"][choices]["+e+"][label]"),o.find("input.value").val(i).attr("name","form_fields["+r+"][choices]["+e+"][value]"),o.find("input.source").val("").attr("name","form_fields["+r+"][choices]["+e+"][image]"),o.find("input.default").attr("name","form_fields["+r+"][choices]["+e+"][default]").prop("checked",!1),o.find(".attachment-thumb").remove(),o.find(".button-add-media").show(),!0===n&&s.find("input.default").prop("checked",!0),e++,s.parent().attr("data-next-id",e),a.trigger("everestFormsChoiceAdd"),m.choiceUpdate(t,r)},choiceDelete:function(e,t){e.preventDefault();e=v(t),t=e.parent().parent();t.find("li").length<2?v.alert({title:!1,content:c.i18n_field_error_choice,icon:"dashicons dashicons-info",type:"blue",buttons:{ok:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"]}}}):(e.parent().remove(),m.choiceUpdate(t.data("field-type"),t.data("field-id")),a.trigger("everestFormsChoiceDelete"))},choiceUpdate:function(s,n){var r,e=v("#everest-forms-field-option-"+n);if($primary=v("#everest-forms-field-"+n+" .primary-input"),"radio"===s||"checkbox"===s||"payment-multiple"===s||"payment-checkbox"===s){var t=[],i=m.formObject(e).form_fields[n];v("#everest-forms-field-option-"+n).find(".evf-choices-list li").each(function(){t.push(v(this).data("key"))});e=wp.template("everest-forms-field-preview-choices");return data={type:s="checkbox"===s||"payment-checkbox"===s?"checkbox":"radio",order:t,settings:i,amountFilter:m.amountFilter},void v("#everest-forms-field-"+n).find("ul.primary-input").replaceWith(e(data))}"select"===s&&(r="<option>{label}</option>",$primary.find("option").not(".placeholder").remove()),v("#everest-forms-field-option-row-"+n+"-choices .evf-choices-list li").each(function(e){var t=v(this),i=t.find("input.label").val(),t=t.find("input.default").is(":checked"),o=v(r.replace("{label}",i));if(v("#everest-forms-field-"+n+" .primary-input").append(o),i&&!0===t)switch(s){case"select":o.prop("selected",!0);break;case"radio":case"checkbox":o.find("input").prop("checked",!0)}})},amountFilter:function(e,t){return"right"===e.currency_symbol_pos?t+" "+e.currency_symbol:e.currency_symbol+" "+t},bindFormSettings:function(){v("body").on("click",".evf-setting-panel",function(e){var t=v(this).attr("data-section");v(".evf-setting-panel").removeClass("active"),v(".everest-forms-active-email").removeClass("active"),v(".evf-content-section").removeClass("active"),v(this).addClass("active"),v(".evf-content-"+t+"-settings").addClass("active"),e.preventDefault()}),v(".evf-setting-panel").eq(0).trigger("click")},bindFormEmail:function(){v("body").on("click",".everest-forms-panel-sidebar-section-email",function(e){v(this).siblings(".everest-forms-active-email").removeClass("active"),v(this).next(".everest-forms-active-email").addClass("active");var t=v(this).siblings(".everest-forms-active-email.active").find(".everest-forms-active-email-connections-list li");t.length&&t.children(".user-nickname").first().trigger("click"),e.preventDefault()})},bindFormIntegrations:function(){v("body").on("click",".evf-integrations-panel",function(e){var t=v(this).attr("data-section");v(".evf-integrations-panel").removeClass("active"),v("#everest-forms-panel-integrations").find(".evf-panel-content-section").removeClass("active"),v(this).addClass("active"),v(this).parent().find(".everest-forms-active-connections").removeClass("active"),v(this).next(".everest-forms-active-connections").addClass("active");var i=v(this).siblings(".everest-forms-active-connections.active").find(".everest-forms-active-connections-list li");i.length&&i.children(".user-nickname").first().trigger("click"),v(".evf-panel-content-section-"+t).addClass("active"),e.preventDefault()}),v(".evf-setting-panel").eq(0).trigger("click")},bindFormPayment:function(){v("body").on("click",".evf-payments-panel",function(e){var t=v(this).attr("data-section");v(".evf-payments-panel").removeClass("active"),v(this).siblings().removeClass("icon active"),v(this).addClass("active"),v(this).parents("#everest-forms-panel-payments").find(".evf-payment-setting-content").removeClass("active").hide(),v(".evf-content-"+t+"-settings").addClass("active").show(),e.preventDefault()}),v(".evf-setting-panel").eq(0).trigger("click")},removeRow:function(e){v.each(e.find(".everest-forms-field"),function(){var e=v(this).attr("data-field-id"),e=v("#everest-forms-field-option-"+e);v(this).remove(),e.remove()}),e.remove()},bindRemoveRow:function(){v("body").on("click",".evf-delete-row",function(){var e=v(this),t=v(".evf-admin-row").length,i=e.closest(".evf-admin-row"),o=e.parents(".evf-admin-field-container").attr("data-current-part"),e=v("#everest-forms-builder").hasClass("multi-part-activated");(t=o&&e?v("#part_"+o).find(".evf-admin-row").length:t)<2?v.alert({title:c.i18n_row_locked,content:c.i18n_row_locked_msg,icon:"dashicons dashicons-info",type:"blue",buttons:{confirm:{text:c.i18n_close,btnClass:"btn-confirm",keys:["enter"]}}}):v.confirm({title:!1,content:c.i18n_delete_row_confirm,type:"red",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{confirm:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"],action:function(){m.removeRow(i),v(".everest-forms-fields-tab").find("a").removeClass("active"),v(".everest-forms-fields-tab").find("a").first().addClass("active"),v(".everest-forms-add-fields").show()}},cancel:{text:c.i18n_cancel}}})})},bindAddNewRow:function(){v("body").on("click",".evf-add-row span",function(){var e=v(this),t=v(".evf-admin-field-wrapper"),i=v(".evf-admin-row").map(function(){return v(this).data("row-id")}).get(),o=Math.max.apply(Math,i),s=v(".evf-admin-row").eq(0).clone(),n=e.parent().attr("data-total-rows"),i=e.parents(".evf-admin-field-container").attr("data-current-part");o++,n++,i&&(t=v(".evf-admin-field-wrapper").find("#part_"+i)),s.find(".evf-admin-grid").html(""),s.attr("data-row-id",o),e.parent().attr("data-total-rows",n),e.parent().attr("data-next-row-id",o),t.append(s),m.bindFields(),m.checkEmptyGrid(),e.trigger("everest-forms-after-add-row",s)})},bindCloneField:function(){v("body").on("click",".everest-forms-preview .everest-forms-field .everest-forms-field-duplicate",function(){var e=v(this).closest(".everest-forms-field");e.hasClass("no-duplicate")?v.alert({title:c.i18n_field_locked,content:c.i18n_field_locked_msg,icon:"dashicons dashicons-info",type:"blue",buttons:{confirm:{text:c.i18n_close,btnClass:"btn-confirm",keys:["enter"]}}}):v.confirm({title:!1,content:c.i18n_duplicate_field_confirm,type:"orange",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{confirm:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"],action:function(){m.cloneFieldAction(e)}},cancel:{text:c.i18n_cancel}}})}),v("body").on("click",".evf-admin-row .evf-duplicate-row",function(){var e=v(this).closest(".evf-admin-row");e.find(".everest-forms-field").hasClass("no-duplicate")?v.alert({title:c.i18n_field_locked,content:c.i18n_row_locked_msg,icon:"dashicons dashicons-info",type:"blue",buttons:{confirm:{text:c.i18n_close,btnClass:"btn-confirm",keys:["enter"]}}}):v.confirm({title:!1,content:c.i18n_duplicate_row_confirm,type:"orange",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{confirm:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"],action:function(){m.cloneRowAction(e)}},cancel:{text:c.i18n_cancel}}})})},cloneRowAction:function(t){row_ids=v(".evf-admin-row").map(function(){return v(this).data("row-id")}).get(),max_row_id=Math.max.apply(Math,row_ids),row_clone=t.clone(),total_rows=v(".evf-add-row").attr("data-total-rows"),max_row_id++,total_rows++,row_clone.attr("data-row-id",max_row_id),v(".evf-add-row").attr("data-total-rows",total_rows),v(".evf-add-row").attr("data-next-row-id",max_row_id);var e={action:"everest_forms_get_next_id",security:c.evf_get_next_id,form_id:c.form_id,fields:row_clone.find(".everest-forms-field").length};v.ajax({url:c.ajax_url,data:e,type:"POST",beforeSend:function(){v(document.body).trigger("init_field_options_toggle")},success:function(e){"boolean"==typeof e.success&&!0===e.success&&(t.after(row_clone),v.each(e.data,function(e,t){var i=t.field_id,t=t.field_key;v("#everest-forms-field-id").val(i),field=row_clone.find(".everest-forms-field").eq(e);e=field.attr("data-field-id");m.render_node(field,e,t),field.remove(),v(document.body).trigger("init_field_options_toggle")}),m.bindFields())}})},cloneFieldAction:function(i){var o=i.attr("data-field-id"),e=c.form_id,e={action:"everest_forms_get_next_id",security:c.evf_get_next_id,form_id:e};v.ajax({url:c.ajax_url,data:e,type:"POST",beforeSend:function(){v(document.body).trigger("init_field_options_toggle")},success:function(e){var t;"boolean"==typeof e.success&&!0===e.success&&(t=e.data.field_id,e=e.data.field_key,v("#everest-forms-field-id").val(t),m.render_node(i,o,e),v(document.body).trigger("init_field_options_toggle"))}})},render_node:function(e,o,s){var t=v(".everest-forms-field-options #everest-forms-field-option-"+o),i=v("#everest-forms-field-option-"+o+"-label").val(),n=v("#everest-forms-field-option-"+o+"-meta-key").length?v("#everest-forms-field-option-"+o+"-meta-key").val():"",r=e.attr("data-field-type"),a=t.html(),d=i+" "+c.i18n_copy,i="html"!==r?n.replace(/\(|\)/g,"").toLowerCase().substring(0,n.lastIndexOf("_"))+"_"+Math.floor(1e3+9e3*Math.random()):"",n=e.clone(),l=new RegExp(o,"g"),a=a.replace(l,s),f=v('<div class="everest-forms-field-option everest-forms-field-option-'+r+'" id="everest-forms-field-option-'+s+'" data-field-id="'+s+'" />');f.append(a),v.each(t.find(":input"),function(){var e,t=v(this).attr("type"),i=(v(this).attr("name")?v(this).attr("name"):"").replace(l,s);"text"===t||"hidden"===t?(e=v(this).val(),f.find('input[name="'+i+'"]').val(e),f.find('input[value="'+o+'"]').val(s)):"checkbox"===t||"radio"===t?v(this).is(":checked")?f.find('input[name="'+i+'"]').prop("checked",!0).attr("checked","checked"):f.find('[name="'+i+'"]').prop("checked",!1).attr("checked",!1):v(this).is("select")?v(this).find("option:selected").length&&(t=v(this).find("option:selected").val(),f.find('[name="'+i+'"]').find('[value="'+t+'"]').prop("selected",!0)):""!==v(this).val()&&f.find('[name="'+i+'"]').val(v(this).val())}),v(".everest-forms-field-options").append(f),v("#everest-forms-field-option-"+s+"-label").val(d),v("#everest-forms-field-option-"+s+"-meta-key").val(i),n.attr("class",e.attr("class")),n.attr("id","everest-forms-field-"+s),n.attr("data-field-id",s),n.attr("data-field-type",r),n.find(".label-title .text").text(d),e.closest(".evf-admin-grid").find('[data-field-id="'+o+'"]').after(n),v(document).trigger("everest-form-cloned",[s,r]),m.switchToFieldOptionPanel(s),v(document.body).trigger("evf_render_node_complete",[r,s,n,f])},bindFieldDelete:function(){v("body").on("click",".everest-forms-preview .everest-forms-field .everest-forms-field-delete",function(){var t=v(this).closest(".everest-forms-field"),e=t.attr("data-field-id"),i=v("#everest-forms-field-option-"+e);v(this).closest(".evf-admin-grid");t.hasClass("no-delete")?v.alert({title:c.i18n_field_locked,content:c.i18n_field_locked_msg,icon:"dashicons dashicons-info",type:"blue",buttons:{confirm:{text:c.i18n_close,btnClass:"btn-confirm",keys:["enter"]}}}):v.confirm({title:!1,content:c.i18n_delete_field_confirm,type:"red",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{confirm:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"],action:function(){v(".evf-panel-fields-button").trigger("click"),t.fadeOut("slow",function(){var e=t.attr("data-field-id");v(document.body).trigger("evf_before_field_deleted",[e]),t.remove(),i.remove(),m.checkEmptyGrid(),v(".everest-forms-fields-tab").find("a").removeClass("active"),v(".everest-forms-fields-tab").find("a").first().addClass("active"),v(".everest-forms-add-fields").show(),m.conditionalLogicRemoveField(e),m.conditionalLogicRemoveFieldIntegration(e),m.paymentFieldRemoveFromQuantity(e)})}},cancel:{text:c.i18n_cancel}}})})},bindFieldDeleteWithKeyEvent:function(){v("body").on("keyup",function(e){var t,i=v(".everest-forms-preview .everest-forms-field.active");46===e.which&&!0===i.hasClass("active")&&!1===i.hasClass("evf-delete-event-active")&&0!=v(".evf-admin-row").hasClass("evf-hover")&&(i.addClass("evf-delete-event-active"),e=i.attr("data-field-id"),t=v("#everest-forms-field-option-"+e),i.hasClass("no-delete")?v.alert({title:c.i18n_field_locked,content:c.i18n_field_locked_msg,icon:"dashicons dashicons-info",type:"blue",buttons:{confirm:{text:c.i18n_close,btnClass:"btn-confirm",keys:["enter"],action:function(){i.removeClass("evf-delete-event-active")}}}}):v.confirm({title:!1,content:c.i18n_delete_field_confirm,type:"red",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{confirm:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"],action:function(){v(".evf-panel-fields-button").trigger("click"),i.fadeOut("slow",function(){var e=i.attr("data-field-id");v(document.body).trigger("evf_before_field_deleted",[e]),i.remove(),t.remove(),m.checkEmptyGrid(),v(".everest-forms-fields-tab").find("a").removeClass("active"),v(".everest-forms-fields-tab").find("a").first().addClass("active"),v(".everest-forms-add-fields").show(),m.conditionalLogicRemoveField(e),m.conditionalLogicRemoveFieldIntegration(e),m.paymentFieldRemoveFromQuantity(e)}),i.removeClass("evf-delete-event-active")}},cancel:{text:c.i18n_cancel,action:function(){i.removeClass("evf-delete-event-active")}}}}))})},bindSaveOption:function(){v("body").on("click",".everest-forms-save-button",function(){var t=v(this),e=v("form#everest-forms-builder-form"),i=m.getStructure(),o=e.serializeArray();if(""!==v("#evf-edit-form-name").val().trim()){e.triggerHandler("everest_forms_process_ajax_data",[t,o])&&(o=e.triggerHandler("everest_forms_process_ajax_data",[t,o])),v(".everest-forms-panel-content-wrap").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var s=[];v(".everest-forms-field[data-field-id]").each(function(){s.push(v(this).attr("data-field-id"))});for(var n,r=o.length;r--;)o[r].name.startsWith("form_fields")&&(n=!1,s.forEach(function(e){o[r].name.startsWith("form_fields["+e+"]")&&(n=!0)}),-1<r&&!1===n&&o.splice(r,1));i=o.concat(i),i={action:"everest_forms_save_form",security:c.evf_save_form,form_data:JSON.stringify(i)};v.ajax({url:c.ajax_url,data:i,type:"POST",beforeSend:function(){t.addClass("processing"),t.find(".loading-dot").remove(),t.append('<span class="loading-dot"></span>')},success:function(e){t.removeClass("processing"),t.find(".loading-dot").remove(),e.success||v.alert({title:e.data.errorTitle,content:e.data.errorMessage,icon:"dashicons dashicons-warning",type:"red",buttons:{ok:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"]}}}),v(".everest-forms-panel-content-wrap").unblock()}})}else v.alert({title:c.i18n_field_title_empty,content:c.i18n_field_title_payload,icon:"dashicons dashicons-warning",type:"red",buttons:{ok:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"]}}})})},getStructure:function(){var e=v(".evf-admin-field-wrapper"),n=[];return v.each(e.find(".evf-admin-row"),function(){var e=v(this),s=e.attr("data-row-id");v.each(e.find(".evf-admin-grid"),function(){var e=v(this),i=e.attr("data-grid-id"),o=0;v.each(e.find(".everest-forms-field"),function(){var e={name:"",value:""},t=v(this).attr("data-field-id");e.name="structure[row_"+s+"][grid_"+i+"]["+o+"]",o++,e.value=t,n.push(e)}),e.find(".everest-forms-field").length<1&&n.push({name:"structure[row_"+s+"][grid_"+i+"]",value:""})})}),n},getFieldArray:function(e){var t=[];return v.each(e.find(".everest-forms-field"),function(){var e=v(this).attr("data-field-id");t.push(e)}),t},checkEmptyGrid:function(e){v.each(v(".evf-admin-grid"),function(){v(this).find(".everest-forms-field, .evf-registered-item:not(.ui-draggable-dragging)").not(".ui-sortable-helper").length<1?v(this).addClass("evf-empty-grid"):v(this).removeClass("evf-empty-grid")}),m.choicesInit()},bindDefaultTabs:function(){v(document).on("click",".evf-nav-tab-wrapper a",function(e){e.preventDefault(),m.switchTab(v(this).data("panel"))})},switchTab:function(e){var t=v("#everest-forms-panel-"+e),i=v(".evf-panel-"+e+"-button");v(".evf-nav-tab-wrapper").find("a").removeClass("nav-tab-active"),i.addClass("nav-tab-active"),t.closest(".evf-tab-content").find(".everest-forms-panel").removeClass("active"),t.addClass("active"),"integrations"!==e&&"payments"!==e||(t.find(".everest-forms-panel-sidebar a").hasClass("active")||t.find(".everest-forms-panel-sidebar a").first().addClass("active"),v(".everest-forms-panel-content").find(".evf-panel-content-section").hasClass("active")||v(".everest-forms-panel-content").find(".evf-panel-content-section").first().addClass("active")),history.replaceState({},null,m.updateQueryString("tab",e)),m.switchPanel(e)},updateQueryString:function(e,t,i){i=i||window.location.href;var o=new RegExp("([?&])"+e+"=.*?(&|#|$)(.*)","gi");if(o.test(i))return null!=t?i.replace(o,"$1"+e+"="+t+"$2$3"):(i=(s=i.split("#"))[0].replace(o,"$1$3").replace(/(&|\?)$/,""),"undefined"!=typeof s[1]&&null!==s[1]&&(i+="#"+s[1]),i);if(null==t)return i;var s,o=-1!==i.indexOf("?")?"&":"?";return i=(s=i.split("#"))[0]+o+e+"="+t,"undefined"!=typeof s[1]&&null!==s[1]&&(i+="#"+s[1]),i},switchPanel:function(e){"field-options"===e&&m.switchToFieldOptionPanel()},switchToFieldOptionPanel:function(e){v(".everest-forms-field-options").find(".no-fields").hide(),v(".evf-admin-field-wrapper .everest-forms-field").removeClass("active"),v("#everest-forms-panel-fields").addClass("active"),v(".everest-forms-fields-tab").find("a").removeClass("active"),v(".everest-forms-fields-tab").find("a").last().addClass("active"),v(".everest-forms-add-fields").hide(),v(".everest-forms-field-options").show(),v(".everest-forms-field-options").find(".everest-forms-field-option").hide(),v(".evf-tab-lists").find("li a").removeClass("active"),v(".evf-tab-lists").find("li.evf-panel-field-options-button a").addClass("active"),v(document.body).trigger("evf-init-switch-field-options"),void 0!==e?(v("#everest-forms-field-option-"+e).show(),v("#everest-forms-field-"+e).addClass("active")):0<v(".evf-admin-field-wrapper .everest-forms-field").length?(v(".evf-admin-field-wrapper .everest-forms-field").eq(0).addClass("active"),v("#everest-forms-field-option-"+v(".evf-admin-field-wrapper .everest-forms-field").eq(0).attr("data-field-id")).show()):v(".everest-forms-field-options").find(".no-fields").show()},bindFields:function(){v(".evf-admin-field-wrapper").sortable({items:".evf-admin-row",axis:"y",cursor:"move",opacity:.65,scrollSensitivity:40,forcePlaceholderSize:!0,placeholder:"evf-sortable-placeholder",containment:".everest-forms-panel-content",start:function(e,t){t.item.css({backgroundColor:"#f7fafc",border:"1px dashed #5d96ee"})},stop:function(e,t){t.item.removeAttr("style")}}).disableSelection(),v(".evf-admin-grid").sortable({items:'> .everest-forms-field[data-field-type!="repeater-fields"]',delay:100,opacity:.65,cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,connectWith:".evf-admin-grid",containment:".everest-forms-field-wrap",out:function(e){v(".evf-admin-grid").removeClass("evf-hover"),v(e.target).removeClass("evf-item-hover"),v(e.target).closest(".evf-admin-row").removeClass("evf-hover"),m.checkEmptyGrid()},over:function(e,t){v(".evf-admin-grid").addClass("evf-hover"),v(e.target).addClass("evf-item-hover"),v(e.target).closest(".evf-admin-row").addClass("evf-hover"),m.checkEmptyGrid()},receive:function(e,t){t.sender.is("button")&&m.fieldDrop(t.helper)},update:function(e,t){v(document).trigger("evf_sort_update_complete",{event:e,ui:t})},stop:function(e,t){t.item.removeAttr("style"),m.checkEmptyGrid()}}).disableSelection(),v(".evf-registered-buttons button.evf-registered-item").draggable({delay:200,cancel:!1,scroll:!1,revert:"invalid",scrollSensitivity:40,forcePlaceholderSize:!0,helper:function(){return v(this).clone().insertAfter(v(this).closest(".everest-forms-tab-content").siblings(".everest-forms-fields-tab"))},opacity:.75,containment:"#everest-forms-builder",connectToSortable:".evf-admin-grid"}).disableSelection(),v(".evf-registered-item.evf-repeater-field").draggable("option","connectToSortable",".evf-repeatable-grid"),v(".evf-admin-row").on("mouseenter mouseleave",function(e){e.buttons<1&&("mouseenter"===e.type?v(this).addClass("evf-hover"):v(".evf-admin-row").removeClass("evf-hover"))}),v(".everest-forms-panel-content").on("scroll",function(){v(".evf-admin-grid").sortable("refreshPositions"),v(".evf-admin-field-wrapper").sortable("refreshPositions")})},fieldTabChoice:function(e){v(".everest-forms-tab-content").scrollTop(0),v(".everest-forms-fields-tab a").removeClass("active"),v(".everest-forms-field, .everest-forms-title-desc").removeClass("active"),v("#"+e).addClass("active"),"add-fields"===e?(v(".everest-forms-add-fields").show(),v(".everest-forms-field-options").hide()):("field-options"===e?(e=v(".everest-forms-field").first().data("field-id"),v(".everest-forms-field-options").show(),v(".everest-forms-field").first().addClass("active")):v("#everest-forms-field-"+e).addClass("active"),v(".everest-forms-field-option").hide(),v("#everest-forms-field-option-"+e).show(),v(".everest-forms-add-fields").hide())},bindFormPreview:function(){},bindGridSwitcher:function(){v("body").on("click",".evf-show-grid",function(e){e.stopPropagation(),m.checkEmptyGrid(),v(this).closest(".evf-toggle-row").find(".evf-toggle-row-content").stop(!0).slideToggle(200)}),v(document).on("click",function(){m.checkEmptyGrid(),v(".evf-show-grid").closest(".evf-toggle-row").find(".evf-toggle-row-content").stop(!0).slideUp(200)});v("body").on("click",".evf-grid-selector",function(){var e=v(this).closest(".evf-admin-row");if(!v(this).hasClass("active")){var t=parseInt(v(this).attr("data-evf-grid"),10);if(!(2<t)){var i=v('<div class="evf-admin-grid evf-grid-'+t+' ui-sortable evf-empty-grid" />'),o=v("<div/>");v.each(e.find(".evf-admin-grid"),function(){v(this).children("*").each(function(){o.append(v(this).clone())})}),e.find(".evf-admin-grid").remove(),e.find(".evf-clear ").remove(),e.append('<div class="clear evf-clear"></div>');for(var s=1;s<=t;s++)i.attr("data-grid-id",s),e.append(i.clone());e.append('<div class="clear evf-clear"></div>'),e.find(".evf-admin-grid").eq(0).append(o.html()),e.find(".evf-grid-selector").removeClass("active"),v(this).addClass("active"),m.bindFields()}}})},fieldDrop:function(r){var e=r.attr("data-field-type");if(["file-upload","payment-total","image-upload","signature"].includes(e)&&r.closest(".evf-admin-row").hasClass("evf-repeater-fields"))return v.confirm({title:!1,content:"This field cannot be added to Repeater Fields",type:"red",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{cancel:{text:c.i18n_close,btnClass:"btn-default"}}}),r.remove(),!1;r.css({left:"0",width:"100%"}).append('<i class="spinner is-active"></i>'),v.ajax({url:c.ajax_url,type:"POST",data:{action:"everest_forms_new_field_"+e,security:c.evf_field_drop_nonce,field_type:e,form_id:c.form_id},beforeSend:function(){v(document.body).trigger("init_field_options_toggle")},success:function(e){var t=e.data.preview,i=e.data.options,o=e.data.form_field_id,s=e.data.field.type,n=v(t).attr("id"),e=v(t).attr("data-field-id");v("#everest-forms-field-id").val(o),v(".everest-forms-field-options").find(".no-fields").hide(),v(".everest-forms-field-options").append(i),v(".everest-forms-field-option-row-icon_color input.colorpicker").wpColorPicker({change:function(e){var t=v(this),i=t.val(),t=t.closest(".everest-forms-field-option-row").data("field-id");v("#everest-forms-field-"+t+" .rating-icon svg").css("fill",i)}}),r.after(t),null!==v("#everest-forms-panel-field-settings-enable_survey")&&v("#everest-forms-panel-field-settings-enable_survey").prop("checked")&&v("#everest-forms-field-option-"+e+"-survey_status").prop("checked",!0),null!==v("#everest-forms-panel-field-settings-enable_quiz")&&v("#everest-forms-panel-field-settings-enable_quiz").prop("checked")&&(v("#everest-forms-field-option-"+e+"-quiz_status").prop("checked",!0),v("#everest-forms-field-option-"+e+"-quiz_status").closest(".everest-forms-field-option-row-quiz_status").siblings(".everst-forms-field-quiz-settings").removeClass("everest-forms-hidden").addClass("everest-forms-show")),r.remove(),v(document.body).trigger("init_tooltips"),v(document.body).trigger("init_field_options_toggle"),v(document.body).trigger("evf_after_field_append",[n]),m.conditionalLogicAppendField(n),m.conditionalLogicAppendFieldIntegration(n),m.paymentFieldAppendToQuantity(n),m.paymentFieldAppendToDropdown(e,s),m.init_datepickers(),v("#everest-forms-field-option-"+e+"-enable_min_max_time").hide(),v("label[for=everest-forms-field-option-"+e+"-enable_min_max_time]").hide(),v("label[for=everest-forms-field-option-"+e+"-select_min_time]").hide(),v("label[for=everest-forms-field-option-"+e+"-select_max_time]").hide(),v("#everest-forms-field-option-"+e+"-min_time_hour").parent().hide(),v("#everest-forms-field-option-"+e+"-max_time_hour").parent().hide(),v(document.body).trigger("evf_field_drop_complete",[s,e,t,i]),m.checkEmptyGrid()}})},conditionalLogicAppendField:function(s){var e=v("#"+s),n=e.index(),r=v(".evf-field-conditional-field-select"),a=e.attr("data-field-type"),d=e.attr("data-field-id"),l=e.find(".label-title .text ").text();v.fn.insertAt=function(e,t,i){var o=v.makeArray(this.children().clone(!0));o.splice(t,0,e),v.each(o,function(e,t){i===v(t)[0].value&&(v(t)[0].selected=!0,o[e]=t)}),this.empty().append(o)};var f=d;r.each(function(o,e){var t=v(e).val(),i=s.replace("everest-forms-field-",""),e=v(e).attr("name");i===e.substring(e.indexOf("[")+1,e.indexOf("]"))?v(".evf-admin-row .evf-admin-grid .everest-forms-field").each(function(){var e=v(this).data("field-type"),t=v(this).data("field-id"),i=v(this).find(".label-title span").first().text();field_to_be_restricted=[],field_to_be_restricted=["html","title","address","image-upload","file-upload","date-time","hidden","scale-rating","likert"],-1===v.inArray(e,field_to_be_restricted)&&f!==t&&r.eq(o).append('<option class="evf-conditional-fields" data-field_type="'+e+'" data-field_id="'+t+'" value="'+t+'">'+i+"</option>")}):(e='<option class="evf-conditional-fields" data-field_type="'+a+'" data-field_id="'+d+'" value="'+d+'">'+l+"</option>","html"!==a&&"title"!==a&&"address"!==a&&"image-upload"!==a&&"file-upload"!==a&&"date-time"!==a&&"hidden"!==a&&"likert"!==a&&"scale-rating"!==a&&r.eq(o).insertAt(e,n,t))})},paymentFieldAppendToQuantity:function(e){var t=v("#"+e),i=v(".everest-forms-field-option-row-map_field select"),o=t.attr("data-field-type"),e=t.attr("data-field-id"),t=t.find(".label-title .text ").text();"payment-single"!==o&&"payment-multiple"!==o&&"payment-checkbox"!==o||i.append('<option value="'+e+'">'+t+"</option>")},paymentFieldAppendToDropdown:function(e,t){var i;"payment-quantity"===t&&(i=v("#everest-forms-field-option-"+e+"-map_field"),["payment-checkbox","payment-multiple","payment-single"].forEach(function(e){v(".everest-forms-field-"+e).each(function(){var e=v(this).attr("data-field-id"),t=v(this).find(".label-title .text").text();i.append('<option value="'+e+'">'+t+"</option>")})}))},conditionalLogicAppendFieldIntegration:function(i){var s=v("#"+i),n=s.index(),r=v(".evf-provider-conditional").find(".evf-conditional-field-select"),a=s.attr("data-field-type"),d=s.attr("data-field-id"),l=s.find(".label-title .text ").text();v.fn.insertAt=function(e,t){var i=v.makeArray(this.children().clone(!0));i.splice(t,0,e),this.empty().append(i)},r.each(function(o,e){var t=i.replace("everest-forms-field-",""),e=v(e).attr("name");t===e.substring(e.indexOf("[")+1,e.indexOf("]"))?v(".evf-admin-row .evf-admin-grid .everest-forms-field").each(function(){var e=v(this).data("field-type"),t=v(this).data("field-id"),i=v(this).find(".label-title span").first().text();field_to_be_restricted=[],field_to_be_restricted=["html","title","address","image-upload","file-upload","date-time","hidden","scale-rating","likert",s.attr("data-field-type")],-1===v.inArray(e,field_to_be_restricted)&&r.eq(o).append('<option class="evf-conditional-fields" data-field_type="'+e+'" data-field_id="'+t+'" value="'+t+'">'+i+"</option>")}):(e='<option class="evf-conditional-fields" data-field_type="'+a+'" data-field_id="'+d+'" value="'+d+'">'+l+"</option>","html"!==a&&"title"!==a&&"address"!==a&&"image-upload"!==a&&"file-upload"!==a&&"date-time"!==a&&"hidden"!==a&&"likert"!==a&&"scale-rating"!==a&&r.eq(o).insertAt(e,n))})},conditionalLogicRemoveField:function(e){v(".evf-field-conditional-field-select option[value = "+e+" ]").remove()},conditionalLogicRemoveFieldIntegration:function(e){v(".evf-provider-conditional .evf-conditional-field-select option[value = "+e+" ]").remove()},paymentFieldRemoveFromQuantity:function(e){v(".everest-forms-field-option-row-map_field select option[value = "+e+" ]").remove()},bindFieldSettings:function(){v("body").on("click",".everest-forms-preview .everest-forms-field, .everest-forms-preview .everest-forms-field .everest-forms-field-setting",function(e){e.preventDefault();e=v(this).closest(".everest-forms-field").attr("data-field-id");v(".everest-forms-tab-content").scrollTop(0),m.switchToFieldOptionPanel(e)})},toggleLabelEdit:function(e,t){v(e).toggleClass("everest-forms-hidden"),v(t).toggleClass("everest-forms-hidden"),v(t).is(":visible")&&v(t).focus()},bindToggleHandleActions:function(){v("body").on("click",".toggle-handle",function(e){var t=v(this).data("label"),i=v(this).data("input");v(i).is(":visible")||m.toggleLabelEdit(t,i)})},bindLabelEditInputActions:function(){v("body").on("focusout",".label-edit-input",function(e){var t=v(this).data("label");m.toggleLabelEdit(t,this)})},bindSyncedInputActions:function(){v("body").on("input",".sync-input",function(e){var t=v(this).val(),i=v(this).data("sync-targets");t&&i&&v(i).text(t)})}};m.init()}(jQuery,window.evf_data),jQuery(function(){"checked"!=jQuery("#everest-forms-panel-field-settingsemail-evf_send_confirmation_email").attr("checked")&&jQuery("#everest-forms-panel-field-settingsemail-evf_send_confirmation_email-wrap").nextAll().hide(),jQuery("#everest-forms-panel-field-settingsemail-evf_send_confirmation_email").on("change",function(){"checked"!=jQuery(this).attr("checked")?jQuery("#everest-forms-panel-field-settingsemail-evf_send_confirmation_email-wrap").nextAll().hide():jQuery("#everest-forms-panel-field-settingsemail-evf_send_confirmation_email-wrap").nextAll().show()});var e=jQuery("#everest-forms-panel-field-settings-redirect_to option:selected").val();"same"==e?(jQuery("#everest-forms-panel-field-settings-custom_page-wrap").hide(),jQuery("#everest-forms-panel-field-settings-external_url-wrap").hide()):"custom_page"==e?(jQuery("#everest-forms-panel-field-settings-custom_page-wrap").show(),jQuery("#everest-forms-panel-field-settings-external_url-wrap").hide()):"external_url"==e&&(jQuery("#everest-forms-panel-field-settings-external_url-wrap").show(),jQuery("#everest-forms-panel-field-settings-custom_page-wrap").hide()),jQuery("#everest-forms-panel-field-settings-redirect_to").on("change",function(){"same"==this.value?(jQuery("#everest-forms-panel-field-settings-custom_page-wrap").hide(),jQuery("#everest-forms-panel-field-settings-external_url-wrap").hide()):"custom_page"==this.value?(jQuery("#everest-forms-panel-field-settings-custom_page-wrap").show(),jQuery("#everest-forms-panel-field-settings-external_url-wrap").hide()):"external_url"==this.value&&(jQuery("#everest-forms-panel-field-settings-custom_page-wrap").hide(),jQuery("#everest-forms-panel-field-settings-external_url-wrap").show())}),jQuery(".evf-panel-field-options-button.evf-disabled-tab").hide();e=jQuery("#everest-forms-conditional-field-settings-redirect_to option:selected").val();"custom_page"==e?(jQuery("#everest-forms-conditional-field-settings-custom_page").show(),jQuery("#everest-forms-conditional-field-settings-external_url").hide()):"external_url"==e?(jQuery("#everest-forms-conditional-field-settings-custom_page").hide(),jQuery("#everest-forms-conditional-field-settings-external_url").show()):(jQuery("#everest-forms-conditional-field-settings-custom_page").hide(),jQuery("#everest-forms-conditional-field-settings-external_url").hide()),jQuery("#everest-forms-conditional-field-settings-redirect_to").on("change",function(){"custom_page"==this.value?(jQuery("#everest-forms-conditional-field-settings-custom_page").show(),jQuery("#everest-forms-conditional-field-settings-external_url").hide()):"external_url"==this.value?(jQuery("#everest-forms-conditional-field-settings-custom_page").hide(),jQuery("#everest-forms-conditional-field-settings-external_url").show()):(jQuery("#everest-forms-conditional-field-settings-custom_page").hide(),jQuery("#everest-forms-conditional-field-settings-external_url").hide())})}),jQuery(function(l){l(document.body).on("init_add_fields_toogle",function(){l(".everest-forms-add-fields").on("click",".everest-forms-add-fields-group > a",function(e){e.preventDefault(),l(this).parent(".everest-forms-add-fields-group").toggleClass("closed").toggleClass("open")}),l(".everest-forms-add-fields").on("click",".everest-forms-add-fields-group a",function(){l(this).next(".evf-registered-buttons").stop().slideToggle()}),l(".everest-forms-add-fields-group.closed").each(function(){l(this).find(".evf-registered-buttons").hide()})}).trigger("init_add_fields_toogle"),l(document.body).on("click",".everest-forms-field-option .everest-forms-field-option-group > a",function(e){e.preventDefault(),l(this).parent(".everest-forms-field-option-group").toggleClass("closed").toggleClass("open")}),l(document.body).on("click",".everest-forms-field-option .everest-forms-field-option-group a",function(e){l(e.target).filter(":input, option, .sort").length||l(this).next(".everest-forms-field-option-group-inner").stop().slideToggle()}),l(document.body).on("init_field_options_toggle",function(){l(".everest-forms-field-option-group.closed").each(function(){l(this).find(".everest-forms-field-option-group-inner").hide()})}).trigger("init_field_options_toggle"),l(document).on("click",function(){l(".evf-smart-tag-lists").hide()}),l(document.body).on("click",".evf-toggle-smart-tag-display",function(e){e.stopPropagation(),l(".evf-smart-tag-lists").hide(),l(".evf-smart-tag-lists ul").empty(),l(this).parent().find(".evf-smart-tag-lists").toggle("show");e=l(this).data("type");!function(o,e,t){var s=[],n=[],r=[];if(l(".evf-admin-row .evf-admin-grid .everest-forms-field").each(function(){var e,t=l(this).data("field-type"),i=l(this).data("field-id");o===t?(e=l(this).find(".label-title span").first().text(),r[i]=e):(e=l(this).find(".label-title span").first().text(),s[i]=e),n[i]=l(this).find(".label-title span").first().text()}),"other"===e||"all"===e){var i=evf_data.smart_tags_other;for(a in i)l(t).parent().find(".evf-smart-tag-lists .evf-others").append('<li class = "smart-tag-field" data-type="other" data-field_id="'+a+'">'+i[a]+"</li>")}if("fields"===e||"all"===e)if("email"===o)for(var a in Object.keys(r).length<1?l(t).parent().find('.evf-smart-tag-lists .smart-tag-title:not(".other-tag-title")').addClass("everest-forms-hidden"):l(t).parent().find('.evf-smart-tag-lists .smart-tag-title:not(".other-tag-title")').removeClass("everest-forms-hidden"),l(t).parent().find(".evf-smart-tag-lists .other-tag-title").remove(),l(t).parent().find(".evf-smart-tag-lists .evf-others").remove(),l(t).parent().find(".evf-smart-tag-lists").append('<div class="smart-tag-title other-tag-title">Others</div><ul class="evf-others"></ul>'),l(t).parent().find(".evf-smart-tag-lists .evf-others").append('<li class="smart-tag-field" data-type="other" data-field_id="admin_email">Site Admin Email</li><li class="smart-tag-field" data-type="other" data-field_id="user_email">User Email</li>'),r)l(t).parent().find(".evf-smart-tag-lists .evf-fields").append('<li class = "smart-tag-field" data-type="field" data-field_id="'+a+'">'+r[a]+"</li>");else for(var d in Object.keys(n).length<1?l(t).parent().find('.evf-smart-tag-lists .smart-tag-title:not(".other-tag-title")').addClass("everest-forms-hidden"):l(t).parent().find('.evf-smart-tag-lists .smart-tag-title:not(".other-tag-title")').removeClass("everest-forms-hidden"),n)l(t).parent().find(".evf-smart-tag-lists .evf-fields").append('<li class = "smart-tag-field" data-type="field" data-field_id="'+d+'">'+n[d]+"</li>")}(l(this).data("fields"),e,l(this))}),l(document.body).on("click",".smart-tag-field",function(e){var t=l(this).data("field_id"),i=l(this).text(),o=l(this).data("type"),s=l(this).parent().parent().parent(),n=s.find("input[type=text]"),s=s.find("textarea");if("fullname"!==t&&"email"!==t&&"subject"!==t&&"message"!==t&&"other"!==o){for(var i=i.split(/[\s-_]/),r=0;r<i.length;r++)i[r]=0===r?i[r].charAt(0).toLowerCase()+i[r].substr(1):i[r].charAt(0).toUpperCase()+i[r].substr(1);t=(i=i.join(""))+"_"+t}"field"===o?(n.val(n.val()+'{field_id="'+t+'"}'),s.val(s.val()+'{field_id="'+t+'"}')):"other"===o&&(n.val(n.val()+"{"+t+"}"),s.val(s.val()+"{"+t+"}"))}),l(document).on("change",".wp-list-table .everest-forms-toggle-form input",function(e){e.stopPropagation(),l.post(evf_data.ajax_url,{action:"everest_forms_enabled_form",security:evf_data.evf_enabled_form,form_id:l(this).data("form_id"),enabled:l(this).prop("checked")?1:0})}),l(document).on("change",".evf-content-email-settings .evf-toggle-switch input",function(e){var t=l(this),i=t.prop("checked");!1===i?(t.val(""),t.closest(".evf-content-email-settings").find(".email-disable-message").remove(),t.closest(".evf-content-section-title").siblings(".evf-content-email-settings-inner").addClass("everest-forms-hidden"),l('<p class="email-disable-message everest-forms-notice everest-forms-notice-info">'+evf_data.i18n_email_disable_message+"</p>").insertAfter(t.closest(".evf-content-section-title"))):!0===i&&(t.val("1"),t.closest(".evf-content-section-title").siblings(".evf-content-email-settings-inner").removeClass("everest-forms-hidden"),t.closest(".evf-content-email-settings").find(".email-disable-message").remove())}),l(document).on("click",".everest-forms-min-max-date-format input",function(){l(this).is(":checked")?l(".everest-forms-min-max-date-option").removeClass("everest-forms-hidden"):l(".everest-forms-min-max-date-option").addClass("everest-forms-hidden")})});
1
+ !function(p,c){var a,m={init:function(){p(document).ready(function(e){e("evf-panel-integrations-button a").hasClass("active")||(e("#everest-forms-panel-integrations").find(".everest-forms-panel-sidebar a").first().addClass("active"),e("#everest-forms-panel-integrations").find(".everest-forms-panel-sidebar a").hasClass("active")&&e("#everest-forms-panel-integrations").find(".everest-forms-panel-sidebar a").next(".everest-forms-active-connections").first().addClass("active"),e(".everest-forms-panel-content").find(".evf-panel-content-section").first().addClass("active"))}),p(document).ready(function(o){"1"===o(".everest-forms-min-max-date-format input").val()&&(o(".everest-forms-min-date").addClass("flatpickr-field").flatpickr({disableMobile:!0,onChange:function(e,t,i){o(".everest-forms-min-date").val(t)},onOpen:function(e,t,i){i.set("maxDate",o(".everest-forms-max-date").val())}}),o(".everest-forms-max-date").addClass("flatpickr-field").flatpickr({disableMobile:!0,onChange:function(e,t,i){o(".everest-forms-max-date").val(t)},onOpen:function(e,t,i){i.set("minDate",o(".everest-forms-min-date").val())}}))}),p("evf-panel-payments-button a").hasClass("active")||(p("#everest-forms-panel-payments").find(".everest-forms-panel-sidebar a").first().addClass("active"),p(".everest-forms-panel-content").find(".evf-payment-setting-content").first().addClass("active")),p(document.body).find("#copy-shortcode").on("click",this.copyShortcode).on("aftercopy",this.copySuccess).on("aftercopyfailure",this.copyFail),p(document.body).find(".evf-copy-shortcode").each(function(){p(this).on("click",m.copyShortcode).on("aftercopy",m.copySuccess).on("aftercopyfailure",m.copyFail)}),p(document).ready(m.ready),p(window).on("load",m.load),p(document.body).on("evf-init-builder-fields",function(){m.bindFields()}).trigger("evf-init-builder-fields"),p(document.body).on("adjust_builder_width",function(){var e=p("#adminmenuwrap").width();p("#everest-forms-builder-form").css({width:"calc(100% - "+e+"px)"})}).trigger("adjust_builder_width"),p(document.body).on("click","#collapse-button",function(){p("#everest-forms-builder-form").width(""),p(document.body).trigger("adjust_builder_width")}),p(window).on("resize orientationchange",function(){clearTimeout(void 0),setTimeout(function(){p("#everest-forms-builder").width(""),p(document.body).trigger("adjust_builder_width")},250)}).trigger("resize")},copyShortcode:function(e){evfClearClipboard(),evfSetClipboard(p(this).closest(".evf-shortcode-field").find("input").val(),p(this)),e.preventDefault()},copySuccess:function(){p(this).tooltipster("content",p(this).attr("data-copied")).trigger("mouseenter").on("mouseleave",function(){var e=p(this);setTimeout(function(){e.tooltipster("content",e.attr("data-tip"))},1e3)})},copyFail:function(){p(this).closest(".evf-shortcode-field").find("input").focus().select()},load:function(){p(".everest-forms-overlay").fadeOut()},ready:function(){var e,t;a=p("#everest-forms-builder"),m.bindUIActions(),m.bindEditActions(),jconfirm.defaults={closeIcon:!0,backgroundDismiss:!0,escapeKey:!0,animationBounce:1,useBootstrap:!1,theme:"modern",boxWidth:"400px",columnClass:"evf-responsive-class"},"undefined"!=typeof PerfectScrollbar&&(e=p(".everest-forms-tab-content"),t=p(".everest-forms-panel"),1<=e.length&&(window.evf_tab_scroller=new PerfectScrollbar(".everest-forms-tab-content",{suppressScrollX:!0})),t.each(function(){var e=p(this),t=e.attr("id");1<=e.find(".everest-forms-panel-sidebar").length&&(window.evf_setting_scroller=new PerfectScrollbar("#"+t+" .everest-forms-panel-sidebar"))})),a.on("change",".everest-forms-field-option-row-limit_enabled input",function(e){m.updateTextFieldsLimitControls(p(e.target).parents(".everest-forms-field-option-row-limit_enabled").data().fieldId,e.target.checked)}),a.on("change",".everest-forms-field-option-select .everest-forms-field-option-row-enhanced_select input",function(e){m.enhancedSelectFieldStyle(p(e.target).parents(".everest-forms-field-option-row-enhanced_select").data().fieldId,e.target.checked)}),a.on("click",".everest-forms-field-option-row-choices .everest-forms-btn-group span",function(e){p(this).hasClass("upgrade-modal")&&"checkbox"===p(this).data("type")?(p(this).parent().find("span").addClass("is-active"),p(this).removeClass("is-active"),m.updateEnhandedSelectField(p(e.target).parents(".everest-forms-field-option-row-choices").data().fieldId,!1)):(p(this).parent().find("span").removeClass("is-active"),p(this).addClass("is-active"),m.updateEnhandedSelectField(p(e.target).parents(".everest-forms-field-option-row-choices").data().fieldId,"multiple"===p(this).data("selection")))}),a.on("keyup",".everest-forms-search-fields",function(){var t=p(this).val().toLowerCase();p(".evf-registered-item").each(function(){var e=p(this);field_type=e.data("field-type"),field_label=e.text().toLowerCase(),-1<field_type.search(t)||-1<field_label.search(t)?(e.addClass("evf-searched-item"),e.show()):(e.removeClass("evf-searched-item"),e.hide())}),p(".everest-forms-add-fields-group").each(function(){p(this).find(".evf-registered-item.evf-searched-item").length<=0?p(this).hide():p(this).show()}),p(".evf-registered-item.evf-searched-item").length?p(".everest-forms-fields-not-found").addClass("hidden"):p(".everest-forms-fields-not-found").removeClass("hidden")}),p(document).trigger("everest_forms_ready")},updateTextFieldsLimitControls:function(e,t){t?p("#everest-forms-field-option-row-"+e+"-limit_controls").removeClass("everest-forms-hidden"):p("#everest-forms-field-option-row-"+e+"-limit_controls").addClass("everest-forms-hidden")},enhancedSelectFieldStyle:function(e,t){var i=p("#everest-forms-field-"+e+" .primary-input"),e=p("#everest-forms-field-option-"+e+"-enhanced_select").is(":checked");t&&e&&i.prop("multiple")?(i.addClass("evf-enhanced-select"),p(document.body).trigger("evf-enhanced-select-init")):(i.removeClass("evf-enhanced-select enhanced"),i.filter(".select2-hidden-accessible").selectWoo("destroy"))},updateEnhandedSelectField:function(e,t){var i=p("#everest-forms-field-"+e+" .primary-input"),o=i.find(".placeholder"),s=p("#everest-forms-field-option-"+e+"-multiple_choices"),n=p("#everest-forms-field-option-row-"+e+"-choices input.default"),r=n.filter(":checked");s.val(t?1:0),i.prop("multiple",t),n.prop("type",t?"checkbox":"radio"),!t&&r.length&&(n.prop("checked",!1),p(r.get(0)).prop("checked",!0)),o.length&&t&&o.prop("selected",!t),m.enhancedSelectFieldStyle(e,t)},bindUIActions:function(){m.bindDefaultTabs(),m.checkEmptyGrid(),m.bindFields(),m.bindFormPreview(),m.bindGridSwitcher(),m.bindFieldSettings(),m.bindFieldDelete(),m.bindFieldDeleteWithKeyEvent(),m.bindCloneField(),m.bindSaveOption(),m.bindAddNewRow(),m.bindRemoveRow(),m.bindFormSettings(),m.bindFormEmail(),m.bindFormIntegrations(),m.bindFormPayment(),m.choicesInit(),m.bindToggleHandleActions(),m.bindLabelEditInputActions(),m.bindSyncedInputActions(),m.init_datepickers(),m.bindBulkOptionActions(),m.bindUIActionsFields(),"field-options"===c.tab&&p(".evf-panel-field-options-button").trigger("click"),p(document.body).on("everest-forms-field-drop",".evf-registered-buttons .evf-registered-item",function(){m.fieldDrop(p(this).clone())})},bindBulkOptionActions:function(){p(document.body).on("click",".evf-toggle-bulk-options",function(e){p(this).closest(".everest-forms-field-option").find(".everest-forms-field-option-row-add_bulk_options").slideToggle()}),p(document.body).on("click",".evf-toggle-presets-list",function(e){p(this).closest(".everest-forms-field-option").find(".everest-forms-field-option-row .evf-options-presets").slideToggle()}),p(document.body).on("click",".evf-add-bulk-options",function(e){var t,i=p(this).closest(".everest-forms-field-option-row"),o=i.data("field-id");i.length&&(t=i.closest(".everest-forms-field-option").find(".everest-forms-field-option-row-choices .evf-choices-list"),o=(i=i.find("textarea#everest-forms-field-option-"+o+"-add_bulk_options")).val().split("\n"),m.addBulkOptions(o,t),i.val(""))}),p(document.body).on("click",".evf-options-preset-label",function(e){var t,i=p(this).closest(".everest-forms-field-option-row"),o=i.data("field-id");i.length&&(t=p(this).closest(".evf-options-preset").find(".evf-options-preset-value").val(),i.find("textarea#everest-forms-field-option-"+o+"-add_bulk_options").val(t),p(this).closest(".evf-options-presets").slideUp())}),p(document.body).on("click",".everest-forms-field-option-row-password_strength",function(){p(this).find('[type="checkbox"]:first').prop("checked")&&p(this).next().find('[type="checkbox"]:first').prop("checked",!1)}),p(document.body).on("click",".everest-forms-field-option-row-password_validation",function(){p(this).find('[type="checkbox"]:first').prop("checked")&&(p(this).prev().find('[type="checkbox"]:first').prop("checked",!1),p(this).prev().find(".everest-forms-inner-options").addClass("everest-forms-hidden"))})},addBulkOptions:function(e,i){e.forEach(function(e){var t;""!==e&&(t=i.find("li").last().find("a.add"),m.choiceAdd(null,t,e.trim()))})},init_datepickers:function(){var e=p(".everest-forms-disable-dates").data("date-format");p(".everest-forms-disable-dates").each(function(){p(this).get(0)._flatpickr||p(this).flatpickr({dateFormat:e,mode:"multiple"})}),p(document.body).on("change",".evf-date-format",function(e){var t=p(".everest-forms-field-option:visible .everest-forms-disable-dates"),i=t.get(0)._flatpickr,o=i.selectedDates,s=p(this).val(),n=[];o.forEach(function(e){n.push(flatpickr.formatDate(e,s))}),i.set("dateFormat",s),t.val(n.join(", "))}),p(document.body).on("click",".evf-clear-disabled-dates",function(){p(".everest-forms-field-option:visible .everest-forms-disable-dates").get(0)._flatpickr.clear()}),p(".everest-forms-field-date-time").each(function(){var e=p(this).attr("data-field-id");m.dateSettingToggler(e,p("#everest-forms-field-option-"+e+"-datetime_style").val())})},bindEditActions:function(){p("#edit-form-name").on("click",function(e){e.stopPropagation(),""!==p("#evf-edit-form-name").val().trim()&&m.toggleEditTitle(e)}),p("#evf-edit-form-name").on("change keypress",function(e){var t=p(this);e.stopPropagation(),13===e.which&&""!==p(this).val().trim()&&m.toggleEditTitle(e),""!==t.val().trim()&&p("#everest-forms-panel-field-settings-form_title").val(t.val().trim())}).on("click",function(e){e.stopPropagation()}),p(document).not(p(".everest-forms-title-desc")).on("click",function(e){var t=p("#evf-edit-form-name");e.stopPropagation(),!t.prop("disabled")&&t.val()&&""!==t.val().trim()&&m.toggleEditTitle(e)})},toggleEditTitle:function(e){var t=p("#edit-form-name").siblings("#evf-edit-form-name");e.preventDefault(),t.prop("disabled",function(e,t){return!t}),t.hasClass("everst-forms-name-editing")||t.focus(),t.toggleClass("everst-forms-name-editing")},formObject:function(e){for(var t=jQuery(e).find("[name]"),i={},o={},s=0;s<t.length;s++){var n=jQuery(t[s]),r=n.prop("name").replace(/\]/gi,"").split("["),a=n.val(),d={};if(!n.is(":radio")&&!n.is(":checkbox")||n.is(":checked")){for(var l=r.length-1;0<=l;l--){var f=r[l];if(0===(f=void 0===f?"":f).length&&(d=[],"undefined"==typeof o[r[l-1]]?o[r[l-1]]=0:o[r[l-1]]+=1,f=o[r[l-1]]),l===r.length-1){if(a)if("true"===a)a=!0;else if("false"===a)a=!1;else if(isNaN(parseFloat(a))||parseFloat(a).toString()!==a)if("string"!=typeof a||"{"!==a.substr(0,1)&&"["!==a.substr(0,1)){if("object"==typeof a&&a.length&&n.is("select")){for(var c={},l=0;l<a.length;l++)c["n"+l]=a[l];a=c}}else try{a=JSON.parse(a)}catch(v){}else a=parseFloat(a);d[f]=a}else{var m=d;(d={})[f]=m}}p.extend(!0,i,d)}}return i},bindUIActionsFields:function(){a.on("click",".everest-forms-field-option-row-choices .add",function(e){m.choiceAdd(e,p(this))}),a.on("click",".everest-forms-field-option-row-choices .remove",function(e){m.choiceDelete(e,p(this))}),a.on("mousedown",".everest-forms-field-option-row-choices input[type=radio]",function(){var e=p(this);e.is(":checked")?e.attr("data-checked","1"):e.attr("data-checked","0")}),a.on("click",".everest-forms-field-option-row-choices input[type=radio]",function(){var e=p(this),t=e.parent().parent();e.parent().parent().find("input[type=radio]").not(this).prop("checked",!1),"1"===e.attr("data-checked")&&(e.prop("checked",!1),e.attr("data-checked","0")),m.choiceUpdate(t.data("field-type"),t.data("field-id"))}),a.on("change",".everest-forms-field-option-row-choices input[type=checkbox]",function(e){var t=p(this).parent().parent();m.choiceUpdate(t.data("field-type"),t.data("field-id"))}),a.on("keyup paste focusout",".everest-forms-field-option-row-choices input.label, .everest-forms-field-option-row-choices input.value",function(e){var t=p(this).parent().parent().parent();m.choiceUpdate(t.data("field-type"),t.data("field-id"))}),a.on("change",".everest-forms-field-option-row-show_values input",function(e){p(this).closest(".everest-forms-field-option").find(".everest-forms-field-option-row-choices ul").toggleClass("show-values")}),a.on("change",".everest-forms-field-option-row-choices_images input",function(){var e=p(this),t=e.parent().data("field-id"),i=p("#everest-forms-field-option-"+t),o=p("#everest-forms-field-option-"+t+"-input_columns"),s=p("#everest-forms-field-option-"+t).find(".everest-forms-field-option-hidden-type").val();e.parent().find(".notice").toggleClass("hidden"),i.find(".everest-forms-field-option-row-choices ul").toggleClass("show-images"),(e.is(":checked")?o.val("inline"):o.val("")).trigger("change"),m.choiceUpdate(s,t)}),a.on("click",".everest-forms-attachment-media-view .upload-button",function(e){var t,i,o=p(this);e.preventDefault(),i||(i=wp.media.frames.everestforms_media_frame=wp.media({title:c.i18n_upload_image_title,className:"media-frame everest-forms-media-frame",frame:"select",multiple:!1,library:{type:"image"},button:{text:c.i18n_upload_image_button}})).on("select",function(){var e=i.state().get("selection").first().toJSON();(t=o.hasClass("button-add-media")?(o.hide(),o.parent()):o.parent().parent().parent()).find(".source").val(e.url),t.find(".attachment-thumb").remove(),t.find(".thumbnail-image").prepend('<img class="attachment-thumb" src="'+e.url+'">'),t.find(".actions").show(),a.trigger("everestFormsImageUploadAdd",[o,t])}),i.open()}),a.on("click",".everest-forms-attachment-media-view .remove-button",function(e){e.preventDefault();e=p(this).parent().parent();e.find(".attachment-thumb").remove(),e.parent().find(".source").val(""),e.parent().find(".button-add-media").show(),a.trigger("everestFormsImageUploadRemove",[p(this),e])}),a.on("everestFormsImageUploadAdd everestFormsImageUploadRemove",function(e,t,i){var o=i.closest(".evf-choices-list"),i=o.data("field-type"),o=o.data("field-id");m.choiceUpdate(i,o)}),a.on("change",".everest-forms-field-option-row-input_columns select",function(){var e=p(this),t=e.val(),i=e.parent().data("field-id"),e="";"inline"===t?e="everest-forms-list-inline":""!==t&&(e="everest-forms-list-"+t+"-columns"),p("#everest-forms-field-"+i).removeClass("everest-forms-list-inline everest-forms-list-2-columns everest-forms-list-3-columns").addClass(e)}),a.on("click",".everest-forms-fields-tab a",function(e){e.preventDefault(),m.fieldTabChoice(p(this).attr("id"))}),a.on("change",".everest-forms-field-option-address input.hide",function(){var e=p(this),t=e.parent().parent().data("field-id"),e=e.parent().parent().data("subfield");p("#everest-forms-field-"+t).find(".everest-forms-"+e).toggleClass("hidden")}),a.on("input",".everest-forms-field-option-row-label input",function(){var e=p(this),t=e.val(),e=e.parent().data("field-id");$label=p("#everest-forms-field-"+e).find(".label-title .text"),$label.hasClass("nl2br")?$label.html(t.replace(/\n/g,"<br>")):$label.html(t)}),a.on("input",".everest-forms-field-option-row-description textarea",function(){var e=p(this),t=e.val(),e=e.parent().data("field-id"),e=p("#everest-forms-field-"+e).find(".description");e.hasClass("nl2br")?e.html(t.replace(/\n/g,"<br>")):e.html(t)}),a.on("change",".everest-forms-field-option-row-required input",function(e){var t=p(this).parent().data("field-id");p("#everest-forms-field-"+t).toggleClass("required"),p(e.target).is(":checked")?p("#everest-forms-field-option-row-"+t+"-required-field-message").show():p("#everest-forms-field-option-row-"+t+"-required-field-message").hide()}),a.on("change",".everest-forms-field-option-row-confirmation input",function(e){var t=p(this).parent().data("field-id");p(e.target).is(":checked")?(p("#everest-forms-field-"+t).find(".everest-forms-confirm").removeClass("everest-forms-confirm-disabled").addClass("everest-forms-confirm-enabled"),p("#everest-forms-field-option-"+t).removeClass("everest-forms-confirm-disabled").addClass("everest-forms-confirm-enabled")):(p("#everest-forms-field-"+t).find(".everest-forms-confirm").removeClass("everest-forms-confirm-enabled").addClass("everest-forms-confirm-disabled"),p("#everest-forms-field-option-"+t).removeClass("everest-forms-confirm-enabled").addClass("everest-forms-confirm-disabled"))}),a.on("input",".everest-forms-field-option-row-placeholder input",function(e){var t=p(this),i=t.val(),t=t.parent().data("field-id"),t=p("#everest-forms-field-"+t).find(".widefat:not(.secondary-input)");t.is("select")?i.length?(t.find(".placeholder").length?t.find(".placeholder").text(i):t.prepend('<option class="placeholder" selected>'+i+"</option>"),t.data("placeholder",i),t.hasClass("enhanced")&&t.parent().find(".select2-search__field").prop("placeholder",i)):t.find(".placeholder").remove():t.attr("placeholder",i)}),a.on("input",".everest-forms-field-option-address input.placeholder",function(e){var t=p(this),i=t.val(),o=t.parent().parent().data("field-id"),t=t.parent().parent().data("subfield");p("#everest-forms-field-"+o).find(".everest-forms-"+t+" input").attr("placeholder",i)}),a.on("input",".everest-forms-field-option-row-confirmation_placeholder input",function(){var e=p(this),t=e.val(),e=e.parent().data("field-id");p("#everest-forms-field-"+e).find(".secondary-input").attr("placeholder",t)}),a.on("change",".everest-forms-field-option-row-label_hide input",function(){var e=p(this).parent().data("field-id");p("#everest-forms-field-"+e).toggleClass("label_hide")}),a.on("change",".everest-forms-field-option-row-sublabel_hide input",function(){var e=p(this).parent().data("field-id");p("#everest-forms-field-"+e).toggleClass("sublabel_hide")}),a.on("change",".everest-forms-field-option-row-datetime_format select, .everest-forms-field-option-row-phone_format select, .everest-forms-field-option-row-item_price select, .everest-forms-field-option-row-format select",function(e){var t=p(this),i=t.val(),t=t.parent().data("field-id");p("#everest-forms-field-"+t).find(".format-selected").removeClass().addClass("format-selected format-selected-"+i),p("#everest-forms-field-option-"+t).find(".format-selected").removeClass().addClass("format-selected format-selected-"+i)}),a.on("change",".everest-forms-field-option-row-datetime_style select",function(){m.dateSettingToggler(p(this).parent().attr("data-field-id"),p(this).val())}),p(".everest-forms-field-option-row-time_interval_format [id*=enable_min_max_time]").each(function(){p(this).prop("checked")?(p(this).parent().parent().find(".input-group-col-2").has(" [id*=min_time_hour]").show(),p(this).parent().parent().find(".input-group-col-2").has(" [id*=max_time_hour]").show(),p(this).parent().parent().find(".input-group-col-2").has(" [for*=select_min_time]").show(),p(this).parent().parent().find(".input-group-col-2").has("[for*=select_max_time]").show()):(p(this).parent().parent().find(".input-group-col-2").has("[id*=min_time_hour]").hide(),p(this).parent().parent().find(".input-group-col-2").has("[id*=max_time_hour]").hide(),p(this).parent().parent().find("[for*=select_min_time]").hide(),p(this).parent().parent().find("[for*=select_max_time]").hide())}),a.on("click",".everest-forms-field-option-row-time_interval_format [id*=enable_min_max_time]",function(){p(this).prop("checked")?(p(this).parent().parent().find(".input-group-col-2").has(" [id*=min_time_hour]").show(),p(this).parent().parent().find(".input-group-col-2").has(" [id*=max_time_hour]").show(),p(this).parent().parent().find("[for*=select_min_time]").show(),p(this).parent().parent().find("[for*=select_max_time]").show()):(p(this).parent().parent().find(".input-group-col-2").has("[id*=min_time_hour]").hide(),p(this).parent().parent().find(".input-group-col-2").has("[id*=max_time_hour]").hide(),p(this).parent().parent().find("[for*=select_min_time]").hide(),p(this).parent().parent().find("[for*=select_max_time]").hide())}),a.on("change",".everest-forms-field-option-row-time_interval_format select[id*=time_format]",function(){min_hour=p(this).parent().siblings(".input-group-col-2").find("[id*=min_time_hour]"),max_hour=p(this).parent().siblings(".input-group-col-2").find("[id*=max_time_hour]");var e,t,o=min_hour.find("option:selected").val(),s=max_hour.find("option:selected").val(),n="";for(i=0;i<=23;i++)"H:i"===p(this).val()?n+='<option value = "'+i+'">'+(i<10?"0"+i:i)+"</option>":(e=" PM",0==(t=i<12?(e=" AM",i):i-12)&&(t=12),n+='<option value = "'+i+'">'+t+e+"</option>");min_hour.html(n),max_hour.html(n),min_hour.find("option[value="+o+"]").prop("selected",!0),max_hour.find("option[value="+s+"]").prop("selected",!0)})},dateSettingToggler:function(e,t){"picker"==t?(p("#everest-forms-field-option-row-"+e+"-placeholder").show(),p("#everest-forms-field-option-"+e+"-disable_dates").show(),p("label[for=everest-forms-field-option-"+e+"-disable_dates]").show(),p("#everest-forms-field-option-"+e+"-date_mode-range").parents().find("everest-forms-checklist").show(),p(".everest-forms-field-option-row-date_format .time_interval").show(),p("#everest-forms-field-option-"+e+"-date_localization").show(),p("label[for=everest-forms-field-option-"+e+"-date_localization]").show(),p("#everest-forms-field-option-"+e+"-date_default").parent().show(),p("#everest-forms-field-option-"+e+"-enable_min_max").parent().show(),p("#everest-forms-field-option-"+e+"-enable_min_max").prop("checked")&&p("#everest-forms-field-option-row-"+e+"-date_format .everest-forms-min-max-date-option").removeClass("everest-forms-hidden"),p("#everest-forms-field-option-"+e+"-time_interval").show(),p("#everest-forms-field-option-"+e+"-enable_min_max_time").hide(),p("label[for=everest-forms-field-option-"+e+"-enable_min_max_time]").hide(),p("label[for=everest-forms-field-option-"+e+"-select_min_time]").hide(),p("label[for=everest-forms-field-option-"+e+"-select_max_time]").hide(),p("#everest-forms-field-option-"+e+"-min_time_hour").parent().hide(),p("#everest-forms-field-option-"+e+"-max_time_hour").parent().hide()):(p("#everest-forms-field-option-"+e+"-date_mode-range").parents().find("everest-forms-checklist").hide(),p("#everest-forms-field-option-"+e+"-date_default").parent().hide(),p("#everest-forms-field-option-row-"+e+"-placeholder").hide(),p("#everest-forms-field-option-"+e+"-enable_min_max").parent().hide(),p("#everest-forms-field-option-row-"+e+"-date_format .everest-forms-min-max-date-option").addClass("everest-forms-hidden"),p("#everest-forms-field-option-"+e+"-disable_dates").hide(),p("label[for=everest-forms-field-option-"+e+"-disable_dates]").hide(),p(".everest-forms-field-option-row-date_format .everest-forms-checklist").hide(),p(".everest-forms-field-option-row-date_format .time_interval").hide(),p("#everest-forms-field-option-"+e+"-date_localization").hide(),p("label[for=everest-forms-field-option-"+e+"-date_localization]").hide(),p("#everest-forms-field-option-"+e+"-time_interval").hide(),p("#everest-forms-field-option-"+e+"-enable_min_max_time").show(),p("label[for=everest-forms-field-option-"+e+"-enable_min_max_time]").show(),p("#everest-forms-field-option-"+e+"-enable_min_max_time").prop("checked")&&(p("label[for=everest-forms-field-option-"+e+"-select_min_time]").show(),p("label[for=everest-forms-field-option-"+e+"-select_max_time]").show(),p("#everest-forms-field-option-"+e+"-min_time_hour").parent().show(),p("#everest-forms-field-option-"+e+"-max_time_hour").parent().show()))},choicesInit:function(e){p(e=e||".everest-forms-field-option-row-choices ul").sortable({items:"li",axis:"y",handle:".sort",scrollSensitivity:40,stop:function(e){var t=p(e.target).attr("data-field-id"),e=p("#everest-forms-field-option-"+t).find(".everest-forms-field-option-hidden-type").val();m.choiceUpdate(e,t)}})},choiceAdd:function(e,t,i){e&&e.preventDefault&&e.preventDefault();var o=p(t),s=o.parent(),n=s.find("input.default").is(":checked"),r=o.closest(".everest-forms-field-option-row-choices").data("field-id"),e=s.parent().attr("data-next-id"),t=s.parent().data("field-type"),o=s.clone().insertAfter(s);o.attr("data-key",e),o.find("input.label").val(i).attr("name","form_fields["+r+"][choices]["+e+"][label]"),o.find("input.value").val(i).attr("name","form_fields["+r+"][choices]["+e+"][value]"),o.find("input.source").val("").attr("name","form_fields["+r+"][choices]["+e+"][image]"),o.find("input.default").attr("name","form_fields["+r+"][choices]["+e+"][default]").prop("checked",!1),o.find(".attachment-thumb").remove(),o.find(".button-add-media").show(),!0===n&&s.find("input.default").prop("checked",!0),e++,s.parent().attr("data-next-id",e),a.trigger("everestFormsChoiceAdd"),m.choiceUpdate(t,r)},choiceDelete:function(e,t){e.preventDefault();e=p(t),t=e.parent().parent();t.find("li").length<2?p.alert({title:!1,content:c.i18n_field_error_choice,icon:"dashicons dashicons-info",type:"blue",buttons:{ok:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"]}}}):(e.parent().remove(),m.choiceUpdate(t.data("field-type"),t.data("field-id")),a.trigger("everestFormsChoiceDelete"))},choiceUpdate:function(s,n){var r,e=p("#everest-forms-field-option-"+n);if($primary=p("#everest-forms-field-"+n+" .primary-input"),"radio"===s||"checkbox"===s||"payment-multiple"===s||"payment-checkbox"===s){var t=[],i=m.formObject(e).form_fields[n];p("#everest-forms-field-option-"+n).find(".evf-choices-list li").each(function(){t.push(p(this).data("key"))});e=wp.template("everest-forms-field-preview-choices");return data={type:s="checkbox"===s||"payment-checkbox"===s?"checkbox":"radio",order:t,settings:i,amountFilter:m.amountFilter},void p("#everest-forms-field-"+n).find("ul.primary-input").replaceWith(e(data))}"select"===s&&(r="<option>{label}</option>",$primary.find("option").not(".placeholder").remove()),p("#everest-forms-field-option-row-"+n+"-choices .evf-choices-list li").each(function(e){var t=p(this),i=t.find("input.label").val(),t=t.find("input.default").is(":checked"),o=p(r.replace("{label}",i));if(p("#everest-forms-field-"+n+" .primary-input").append(o),i&&!0===t)switch(s){case"select":o.prop("selected",!0);break;case"radio":case"checkbox":o.find("input").prop("checked",!0)}})},amountFilter:function(e,t){return"right"===e.currency_symbol_pos?t+" "+e.currency_symbol:e.currency_symbol+" "+t},bindFormSettings:function(){p("body").on("click",".evf-setting-panel",function(e){var t=p(this).attr("data-section");p(".evf-setting-panel").removeClass("active"),p(".everest-forms-active-email").removeClass("active"),p(".evf-content-section").removeClass("active"),p(this).addClass("active"),p(".evf-content-"+t+"-settings").addClass("active"),e.preventDefault()}),p(".evf-setting-panel").eq(0).trigger("click")},bindFormEmail:function(){p("body").on("click",".everest-forms-panel-sidebar-section-email",function(e){p(this).siblings(".everest-forms-active-email").removeClass("active"),p(this).next(".everest-forms-active-email").addClass("active");var t=p(this).siblings(".everest-forms-active-email.active").find(".everest-forms-active-email-connections-list li");t.length&&t.children(".user-nickname").first().trigger("click"),e.preventDefault()})},bindFormIntegrations:function(){p("body").on("click",".evf-integrations-panel",function(e){var t=p(this).attr("data-section");p(".evf-integrations-panel").removeClass("active"),p("#everest-forms-panel-integrations").find(".evf-panel-content-section").removeClass("active"),p(this).addClass("active"),p(this).parent().find(".everest-forms-active-connections").removeClass("active"),p(this).next(".everest-forms-active-connections").addClass("active");var i=p(this).siblings(".everest-forms-active-connections.active").find(".everest-forms-active-connections-list li");i.length&&i.children(".user-nickname").first().trigger("click"),p(".evf-panel-content-section-"+t).addClass("active"),e.preventDefault()}),p(".evf-setting-panel").eq(0).trigger("click")},bindFormPayment:function(){p("body").on("click",".evf-payments-panel",function(e){var t=p(this).attr("data-section");p(".evf-payments-panel").removeClass("active"),p(this).siblings().removeClass("icon active"),p(this).addClass("active"),p(this).parents("#everest-forms-panel-payments").find(".evf-payment-setting-content").removeClass("active").hide(),p(".evf-content-"+t+"-settings").addClass("active").show(),e.preventDefault()}),p(".evf-setting-panel").eq(0).trigger("click")},removeRow:function(e){p.each(e.find(".everest-forms-field"),function(){var e=p(this).attr("data-field-id"),e=p("#everest-forms-field-option-"+e);p(this).remove(),e.remove()}),e.remove()},bindRemoveRow:function(){p("body").on("click",".evf-delete-row",function(){var e=p(this),t=p(".evf-admin-row").length,i=e.closest(".evf-admin-row"),o=e.parents(".evf-admin-field-container").attr("data-current-part"),e=p("#everest-forms-builder").hasClass("multi-part-activated");(t=o&&e?p("#part_"+o).find(".evf-admin-row").length:t)<2?p.alert({title:c.i18n_row_locked,content:c.i18n_row_locked_msg,icon:"dashicons dashicons-info",type:"blue",buttons:{confirm:{text:c.i18n_close,btnClass:"btn-confirm",keys:["enter"]}}}):p.confirm({title:!1,content:c.i18n_delete_row_confirm,type:"red",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{confirm:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"],action:function(){m.removeRow(i),p(".everest-forms-fields-tab").find("a").removeClass("active"),p(".everest-forms-fields-tab").find("a").first().addClass("active"),p(".everest-forms-add-fields").show()}},cancel:{text:c.i18n_cancel}}})})},bindAddNewRow:function(){p("body").on("click",".evf-add-row span",function(){var e=p(this),t=p(".evf-admin-field-wrapper"),i=p(".evf-admin-row").map(function(){return p(this).data("row-id")}).get(),o=Math.max.apply(Math,i),s=p(".evf-admin-row").eq(0).clone(),n=e.parent().attr("data-total-rows"),i=e.parents(".evf-admin-field-container").attr("data-current-part");o++,n++,i&&(t=p(".evf-admin-field-wrapper").find("#part_"+i)),s.find(".evf-admin-grid").html(""),s.attr("data-row-id",o),e.parent().attr("data-total-rows",n),e.parent().attr("data-next-row-id",o),t.append(s),m.bindFields(),m.checkEmptyGrid(),e.trigger("everest-forms-after-add-row",s)})},bindCloneField:function(){p("body").on("click",".everest-forms-preview .everest-forms-field .everest-forms-field-duplicate",function(){var e=p(this).closest(".everest-forms-field");e.hasClass("no-duplicate")?p.alert({title:c.i18n_field_locked,content:c.i18n_field_locked_msg,icon:"dashicons dashicons-info",type:"blue",buttons:{confirm:{text:c.i18n_close,btnClass:"btn-confirm",keys:["enter"]}}}):p.confirm({title:!1,content:c.i18n_duplicate_field_confirm,type:"orange",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{confirm:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"],action:function(){m.cloneFieldAction(e)}},cancel:{text:c.i18n_cancel}}})}),p("body").on("click",".evf-admin-row .evf-duplicate-row",function(){var e=p(this).closest(".evf-admin-row");e.find(".everest-forms-field").hasClass("no-duplicate")?p.alert({title:c.i18n_field_locked,content:c.i18n_row_locked_msg,icon:"dashicons dashicons-info",type:"blue",buttons:{confirm:{text:c.i18n_close,btnClass:"btn-confirm",keys:["enter"]}}}):p.confirm({title:!1,content:c.i18n_duplicate_row_confirm,type:"orange",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{confirm:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"],action:function(){m.cloneRowAction(e)}},cancel:{text:c.i18n_cancel}}})})},cloneRowAction:function(t){row_ids=p(".evf-admin-row").map(function(){return p(this).data("row-id")}).get(),max_row_id=Math.max.apply(Math,row_ids),row_clone=t.clone(),total_rows=p(".evf-add-row").attr("data-total-rows"),max_row_id++,total_rows++,row_clone.attr("data-row-id",max_row_id),p(".evf-add-row").attr("data-total-rows",total_rows),p(".evf-add-row").attr("data-next-row-id",max_row_id);var e={action:"everest_forms_get_next_id",security:c.evf_get_next_id,form_id:c.form_id,fields:row_clone.find(".everest-forms-field").length};p.ajax({url:c.ajax_url,data:e,type:"POST",beforeSend:function(){p(document.body).trigger("init_field_options_toggle")},success:function(e){"boolean"==typeof e.success&&!0===e.success&&(t.after(row_clone),p.each(e.data,function(e,t){var i=t.field_id,t=t.field_key;p("#everest-forms-field-id").val(i),field=row_clone.find(".everest-forms-field").eq(e);e=field.attr("data-field-id");m.render_node(field,e,t),field.remove(),p(document.body).trigger("init_field_options_toggle")}),m.bindFields())}})},cloneFieldAction:function(i){var o=i.attr("data-field-id"),e=c.form_id,e={action:"everest_forms_get_next_id",security:c.evf_get_next_id,form_id:e};p.ajax({url:c.ajax_url,data:e,type:"POST",beforeSend:function(){p(document.body).trigger("init_field_options_toggle")},success:function(e){var t;"boolean"==typeof e.success&&!0===e.success&&(t=e.data.field_id,e=e.data.field_key,p("#everest-forms-field-id").val(t),m.render_node(i,o,e),p(document.body).trigger("init_field_options_toggle"))}})},render_node:function(e,o,s){var t=p(".everest-forms-field-options #everest-forms-field-option-"+o),i=p("#everest-forms-field-option-"+o+"-label").val(),n=p("#everest-forms-field-option-"+o+"-meta-key").length?p("#everest-forms-field-option-"+o+"-meta-key").val():"",r=e.attr("data-field-type"),a=t.html(),d=i+" "+c.i18n_copy,i="html"!==r?n.replace(/\(|\)/g,"").toLowerCase().substring(0,n.lastIndexOf("_"))+"_"+Math.floor(1e3+9e3*Math.random()):"",n=e.clone(),l=new RegExp(o,"g"),a=a.replace(l,s),f=p('<div class="everest-forms-field-option everest-forms-field-option-'+r+'" id="everest-forms-field-option-'+s+'" data-field-id="'+s+'" />');f.append(a),p.each(t.find(":input"),function(){var e,t=p(this).attr("type"),i=(p(this).attr("name")?p(this).attr("name"):"").replace(l,s);"text"===t||"hidden"===t?(e=p(this).val(),f.find('input[name="'+i+'"]').val(e),f.find('input[value="'+o+'"]').val(s)):"checkbox"===t||"radio"===t?p(this).is(":checked")?f.find('input[name="'+i+'"]').prop("checked",!0).attr("checked","checked"):f.find('[name="'+i+'"]').prop("checked",!1).attr("checked",!1):p(this).is("select")?p(this).find("option:selected").length&&(t=p(this).find("option:selected").val(),f.find('[name="'+i+'"]').find('[value="'+t+'"]').prop("selected",!0)):""!==p(this).val()&&f.find('[name="'+i+'"]').val(p(this).val())}),p(".everest-forms-field-options").append(f),p("#everest-forms-field-option-"+s+"-label").val(d),p("#everest-forms-field-option-"+s+"-meta-key").val(i),n.attr("class",e.attr("class")),n.attr("id","everest-forms-field-"+s),n.attr("data-field-id",s),n.attr("data-field-type",r),n.find(".label-title .text").text(d),e.closest(".evf-admin-grid").find('[data-field-id="'+o+'"]').after(n),p(document).trigger("everest-form-cloned",[s,r]),m.switchToFieldOptionPanel(s),p(document.body).trigger("evf_render_node_complete",[r,s,n,f])},bindFieldDelete:function(){p("body").on("click",".everest-forms-preview .everest-forms-field .everest-forms-field-delete",function(){var t=p(this).closest(".everest-forms-field"),e=t.attr("data-field-id"),i=p("#everest-forms-field-option-"+e);p(this).closest(".evf-admin-grid");t.hasClass("no-delete")?p.alert({title:c.i18n_field_locked,content:c.i18n_field_locked_msg,icon:"dashicons dashicons-info",type:"blue",buttons:{confirm:{text:c.i18n_close,btnClass:"btn-confirm",keys:["enter"]}}}):p.confirm({title:!1,content:c.i18n_delete_field_confirm,type:"red",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{confirm:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"],action:function(){p(".evf-panel-fields-button").trigger("click"),t.fadeOut("slow",function(){var e=t.attr("data-field-id");p(document.body).trigger("evf_before_field_deleted",[e]),t.remove(),i.remove(),m.checkEmptyGrid(),p(".everest-forms-fields-tab").find("a").removeClass("active"),p(".everest-forms-fields-tab").find("a").first().addClass("active"),p(".everest-forms-add-fields").show(),m.conditionalLogicRemoveField(e),m.conditionalLogicRemoveFieldIntegration(e),m.paymentFieldRemoveFromQuantity(e)})}},cancel:{text:c.i18n_cancel}}})})},bindFieldDeleteWithKeyEvent:function(){p("body").on("keyup",function(e){var t,i=p(".everest-forms-preview .everest-forms-field.active");46===e.which&&!0===i.hasClass("active")&&!1===i.hasClass("evf-delete-event-active")&&0!=p(".evf-admin-row").hasClass("evf-hover")&&(i.addClass("evf-delete-event-active"),e=i.attr("data-field-id"),t=p("#everest-forms-field-option-"+e),i.hasClass("no-delete")?p.alert({title:c.i18n_field_locked,content:c.i18n_field_locked_msg,icon:"dashicons dashicons-info",type:"blue",buttons:{confirm:{text:c.i18n_close,btnClass:"btn-confirm",keys:["enter"],action:function(){i.removeClass("evf-delete-event-active")}}}}):p.confirm({title:!1,content:c.i18n_delete_field_confirm,type:"red",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{confirm:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"],action:function(){p(".evf-panel-fields-button").trigger("click"),i.fadeOut("slow",function(){var e=i.attr("data-field-id");p(document.body).trigger("evf_before_field_deleted",[e]),i.remove(),t.remove(),m.checkEmptyGrid(),p(".everest-forms-fields-tab").find("a").removeClass("active"),p(".everest-forms-fields-tab").find("a").first().addClass("active"),p(".everest-forms-add-fields").show(),m.conditionalLogicRemoveField(e),m.conditionalLogicRemoveFieldIntegration(e),m.paymentFieldRemoveFromQuantity(e)}),i.removeClass("evf-delete-event-active")}},cancel:{text:c.i18n_cancel,action:function(){i.removeClass("evf-delete-event-active")}}}}))})},bindSaveOption:function(){p("body").on("click",".everest-forms-save-button",function(){var t=p(this),e=p("form#everest-forms-builder-form"),i=m.getStructure(),o=e.serializeArray();if(""!==p("#evf-edit-form-name").val().trim()){e.triggerHandler("everest_forms_process_ajax_data",[t,o])&&(o=e.triggerHandler("everest_forms_process_ajax_data",[t,o])),p(".everest-forms-panel-content-wrap").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});var s=[];p(".everest-forms-field[data-field-id]").each(function(){s.push(p(this).attr("data-field-id"))});for(var n,r=o.length;r--;)o[r].name.startsWith("form_fields")&&(n=!1,s.forEach(function(e){o[r].name.startsWith("form_fields["+e+"]")&&(n=!0)}),-1<r&&!1===n&&o.splice(r,1));i=o.concat(i),i={action:"everest_forms_save_form",security:c.evf_save_form,form_data:JSON.stringify(i)};p.ajax({url:c.ajax_url,data:i,type:"POST",beforeSend:function(){t.addClass("processing"),t.find(".loading-dot").remove(),t.append('<span class="loading-dot"></span>')},success:function(e){t.removeClass("processing"),t.find(".loading-dot").remove(),e.success||p.alert({title:e.data.errorTitle,content:e.data.errorMessage,icon:"dashicons dashicons-warning",type:"red",buttons:{ok:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"]}}}),p(".everest-forms-panel-content-wrap").unblock()}})}else p.alert({title:c.i18n_field_title_empty,content:c.i18n_field_title_payload,icon:"dashicons dashicons-warning",type:"red",buttons:{ok:{text:c.i18n_ok,btnClass:"btn-confirm",keys:["enter"]}}})})},getStructure:function(){var e=p(".evf-admin-field-wrapper"),n=[];return p.each(e.find(".evf-admin-row"),function(){var e=p(this),s=e.attr("data-row-id");p.each(e.find(".evf-admin-grid"),function(){var e=p(this),i=e.attr("data-grid-id"),o=0;p.each(e.find(".everest-forms-field"),function(){var e={name:"",value:""},t=p(this).attr("data-field-id");e.name="structure[row_"+s+"][grid_"+i+"]["+o+"]",o++,e.value=t,n.push(e)}),e.find(".everest-forms-field").length<1&&n.push({name:"structure[row_"+s+"][grid_"+i+"]",value:""})})}),n},getFieldArray:function(e){var t=[];return p.each(e.find(".everest-forms-field"),function(){var e=p(this).attr("data-field-id");t.push(e)}),t},checkEmptyGrid:function(e){p.each(p(".evf-admin-grid"),function(){p(this).find(".everest-forms-field, .evf-registered-item:not(.ui-draggable-dragging)").not(".ui-sortable-helper").length<1?p(this).addClass("evf-empty-grid"):p(this).removeClass("evf-empty-grid")}),m.choicesInit()},bindDefaultTabs:function(){p(document).on("click",".evf-nav-tab-wrapper a",function(e){e.preventDefault(),m.switchTab(p(this).data("panel"))})},switchTab:function(e){var t=p("#everest-forms-panel-"+e),i=p(".evf-panel-"+e+"-button");p(".evf-nav-tab-wrapper").find("a").removeClass("nav-tab-active"),i.addClass("nav-tab-active"),t.closest(".evf-tab-content").find(".everest-forms-panel").removeClass("active"),t.addClass("active"),"integrations"!==e&&"payments"!==e||(t.find(".everest-forms-panel-sidebar a").hasClass("active")||t.find(".everest-forms-panel-sidebar a").first().addClass("active"),p(".everest-forms-panel-content").find(".evf-panel-content-section").hasClass("active")||p(".everest-forms-panel-content").find(".evf-panel-content-section").first().addClass("active")),history.replaceState({},null,m.updateQueryString("tab",e)),m.switchPanel(e)},updateQueryString:function(e,t,i){i=i||window.location.href;var o=new RegExp("([?&])"+e+"=.*?(&|#|$)(.*)","gi");if(o.test(i))return null!=t?i.replace(o,"$1"+e+"="+t+"$2$3"):(i=(s=i.split("#"))[0].replace(o,"$1$3").replace(/(&|\?)$/,""),"undefined"!=typeof s[1]&&null!==s[1]&&(i+="#"+s[1]),i);if(null==t)return i;var s,o=-1!==i.indexOf("?")?"&":"?";return i=(s=i.split("#"))[0]+o+e+"="+t,"undefined"!=typeof s[1]&&null!==s[1]&&(i+="#"+s[1]),i},switchPanel:function(e){"field-options"===e&&m.switchToFieldOptionPanel()},switchToFieldOptionPanel:function(e){p(".everest-forms-field-options").find(".no-fields").hide(),p(".evf-admin-field-wrapper .everest-forms-field").removeClass("active"),p("#everest-forms-panel-fields").addClass("active"),p(".everest-forms-fields-tab").find("a").removeClass("active"),p(".everest-forms-fields-tab").find("a").last().addClass("active"),p(".everest-forms-add-fields").hide(),p(".everest-forms-field-options").show(),p(".everest-forms-field-options").find(".everest-forms-field-option").hide(),p(".evf-tab-lists").find("li a").removeClass("active"),p(".evf-tab-lists").find("li.evf-panel-field-options-button a").addClass("active"),p(document.body).trigger("evf-init-switch-field-options"),void 0!==e?(p("#everest-forms-field-option-"+e).show(),p("#everest-forms-field-"+e).addClass("active")):0<p(".evf-admin-field-wrapper .everest-forms-field").length?(p(".evf-admin-field-wrapper .everest-forms-field").eq(0).addClass("active"),p("#everest-forms-field-option-"+p(".evf-admin-field-wrapper .everest-forms-field").eq(0).attr("data-field-id")).show()):p(".everest-forms-field-options").find(".no-fields").show()},bindFields:function(){p(".evf-admin-field-wrapper").sortable({items:".evf-admin-row",axis:"y",cursor:"move",opacity:.65,scrollSensitivity:40,forcePlaceholderSize:!0,placeholder:"evf-sortable-placeholder",containment:".everest-forms-panel-content",start:function(e,t){t.item.css({backgroundColor:"#f7fafc",border:"1px dashed #5d96ee"})},stop:function(e,t){t.item.removeAttr("style")}}).disableSelection(),p(".evf-admin-grid").sortable({items:'> .everest-forms-field[data-field-type!="repeater-fields"]',delay:100,opacity:.65,cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,connectWith:".evf-admin-grid",containment:".everest-forms-field-wrap",out:function(e){p(".evf-admin-grid").removeClass("evf-hover"),p(e.target).removeClass("evf-item-hover"),p(e.target).closest(".evf-admin-row").removeClass("evf-hover"),m.checkEmptyGrid()},over:function(e,t){p(".evf-admin-grid").addClass("evf-hover"),p(e.target).addClass("evf-item-hover"),p(e.target).closest(".evf-admin-row").addClass("evf-hover"),m.checkEmptyGrid()},receive:function(e,t){t.sender.is("button")&&m.fieldDrop(t.helper)},update:function(e,t){p(document).trigger("evf_sort_update_complete",{event:e,ui:t})},stop:function(e,t){t.item.removeAttr("style"),m.checkEmptyGrid()}}).disableSelection(),p(".evf-registered-buttons button.evf-registered-item").draggable({delay:200,cancel:!1,scroll:!1,revert:"invalid",scrollSensitivity:40,forcePlaceholderSize:!0,helper:function(){return p(this).clone().insertAfter(p(this).closest(".everest-forms-tab-content").siblings(".everest-forms-fields-tab"))},opacity:.75,containment:"#everest-forms-builder",connectToSortable:".evf-admin-grid"}).disableSelection(),p(".evf-registered-item.evf-repeater-field").draggable("option","connectToSortable",".evf-repeatable-grid"),p(".evf-admin-row").on("mouseenter mouseleave",function(e){e.buttons<1&&("mouseenter"===e.type?p(this).addClass("evf-hover"):p(".evf-admin-row").removeClass("evf-hover"))}),p(".everest-forms-panel-content").on("scroll",function(){p(".evf-admin-grid").sortable("refreshPositions"),p(".evf-admin-field-wrapper").sortable("refreshPositions")})},fieldTabChoice:function(e){p(".everest-forms-tab-content").scrollTop(0),p(".everest-forms-fields-tab a").removeClass("active"),p(".everest-forms-field, .everest-forms-title-desc").removeClass("active"),p("#"+e).addClass("active"),"add-fields"===e?(p(".everest-forms-add-fields").show(),p(".everest-forms-field-options").hide()):("field-options"===e?(e=p(".everest-forms-field").first().data("field-id"),p(".everest-forms-field-options").show(),p(".everest-forms-field").first().addClass("active")):p("#everest-forms-field-"+e).addClass("active"),p(".everest-forms-field-option").hide(),p("#everest-forms-field-option-"+e).show(),p(".everest-forms-add-fields").hide())},bindFormPreview:function(){},bindGridSwitcher:function(){p("body").on("click",".evf-show-grid",function(e){e.stopPropagation(),m.checkEmptyGrid(),p(this).closest(".evf-toggle-row").find(".evf-toggle-row-content").stop(!0).slideToggle(200)}),p(document).on("click",function(){m.checkEmptyGrid(),p(".evf-show-grid").closest(".evf-toggle-row").find(".evf-toggle-row-content").stop(!0).slideUp(200)});p("body").on("click",".evf-grid-selector",function(){var e=p(this).closest(".evf-admin-row");if(!p(this).hasClass("active")){var t=parseInt(p(this).attr("data-evf-grid"),10);if(!(2<t)){var i=p('<div class="evf-admin-grid evf-grid-'+t+' ui-sortable evf-empty-grid" />'),o=p("<div/>");p.each(e.find(".evf-admin-grid"),function(){p(this).children("*").each(function(){o.append(p(this).clone())})}),e.find(".evf-admin-grid").remove(),e.find(".evf-clear ").remove(),e.append('<div class="clear evf-clear"></div>');for(var s=1;s<=t;s++)i.attr("data-grid-id",s),e.append(i.clone());e.append('<div class="clear evf-clear"></div>'),e.find(".evf-admin-grid").eq(0).append(o.html()),e.find(".evf-grid-selector").removeClass("active"),p(this).addClass("active"),m.bindFields()}}})},fieldDrop:function(r){var e=r.attr("data-field-type");if(["file-upload","payment-total","image-upload","signature"].includes(e)&&r.closest(".evf-admin-row").hasClass("evf-repeater-fields"))return p.confirm({title:!1,content:"This field cannot be added to Repeater Fields",type:"red",closeIcon:!1,backgroundDismiss:!1,icon:"dashicons dashicons-warning",buttons:{cancel:{text:c.i18n_close,btnClass:"btn-default"}}}),r.remove(),!1;r.css({left:"0",width:"100%"}).append('<i class="spinner is-active"></i>'),p.ajax({url:c.ajax_url,type:"POST",data:{action:"everest_forms_new_field_"+e,security:c.evf_field_drop_nonce,field_type:e,form_id:c.form_id},beforeSend:function(){p(document.body).trigger("init_field_options_toggle")},success:function(e){var t=e.data.preview,i=e.data.options,o=e.data.form_field_id,s=e.data.field.type,n=p(t).attr("id"),e=p(t).attr("data-field-id");p("#everest-forms-field-id").val(o),p(".everest-forms-field-options").find(".no-fields").hide(),p(".everest-forms-field-options").append(i),p(".everest-forms-field-option-row-icon_color input.colorpicker").wpColorPicker({change:function(e){var t=p(this),i=t.val(),t=t.closest(".everest-forms-field-option-row").data("field-id");p("#everest-forms-field-"+t+" .rating-icon svg").css("fill",i)}}),r.after(t),null!==p("#everest-forms-panel-field-settings-enable_survey")&&p("#everest-forms-panel-field-settings-enable_survey").prop("checked")&&p("#everest-forms-field-option-"+e+"-survey_status").prop("checked",!0),null!==p("#everest-forms-panel-field-settings-enable_quiz")&&p("#everest-forms-panel-field-settings-enable_quiz").prop("checked")&&(p("#everest-forms-field-option-"+e+"-quiz_status").prop("checked",!0),p("#everest-forms-field-option-"+e+"-quiz_status").closest(".everest-forms-field-option-row-quiz_status").siblings(".everst-forms-field-quiz-settings").removeClass("everest-forms-hidden").addClass("everest-forms-show")),r.remove(),p(document.body).trigger("init_tooltips"),p(document.body).trigger("init_field_options_toggle"),p(document.body).trigger("evf_after_field_append",[n]),m.conditionalLogicAppendField(n),m.conditionalLogicAppendFieldIntegration(n),m.paymentFieldAppendToQuantity(n),m.paymentFieldAppendToDropdown(e,s),m.init_datepickers(),p("#everest-forms-field-option-"+e+"-enable_min_max_time").hide(),p("label[for=everest-forms-field-option-"+e+"-enable_min_max_time]").hide(),p("label[for=everest-forms-field-option-"+e+"-select_min_time]").hide(),p("label[for=everest-forms-field-option-"+e+"-select_max_time]").hide(),p("#everest-forms-field-option-"+e+"-min_time_hour").parent().hide(),p("#everest-forms-field-option-"+e+"-max_time_hour").parent().hide(),p(document.body).trigger("evf_field_drop_complete",[s,e,t,i]),m.checkEmptyGrid()}})},conditionalLogicAppendField:function(s){var e=p("#"+s),n=e.index(),r=p(".evf-field-conditional-field-select"),a=e.attr("data-field-type"),d=e.attr("data-field-id"),l=e.find(".label-title .text ").text();p.fn.insertAt=function(e,t,i){var o=p.makeArray(this.children().clone(!0));o.splice(t,0,e),p.each(o,function(e,t){i===p(t)[0].value&&(p(t)[0].selected=!0,o[e]=t)}),this.empty().append(o)};var f=d;r.each(function(o,e){var t=p(e).val(),i=s.replace("everest-forms-field-",""),e=p(e).attr("name");i===e.substring(e.indexOf("[")+1,e.indexOf("]"))?p(".evf-admin-row .evf-admin-grid .everest-forms-field").each(function(){var e=p(this).data("field-type"),t=p(this).data("field-id"),i=p(this).find(".label-title span").first().text();field_to_be_restricted=[],field_to_be_restricted=["html","title","address","image-upload","file-upload","date-time","hidden","scale-rating","likert"],-1===p.inArray(e,field_to_be_restricted)&&f!==t&&r.eq(o).append('<option class="evf-conditional-fields" data-field_type="'+e+'" data-field_id="'+t+'" value="'+t+'">'+i+"</option>")}):(e='<option class="evf-conditional-fields" data-field_type="'+a+'" data-field_id="'+d+'" value="'+d+'">'+l+"</option>","html"!==a&&"title"!==a&&"address"!==a&&"image-upload"!==a&&"file-upload"!==a&&"date-time"!==a&&"hidden"!==a&&"likert"!==a&&"scale-rating"!==a&&r.eq(o).insertAt(e,n,t))})},paymentFieldAppendToQuantity:function(e){var t=p("#"+e),i=p(".everest-forms-field-option-row-map_field select"),o=t.attr("data-field-type"),e=t.attr("data-field-id"),t=t.find(".label-title .text ").text();"payment-single"!==o&&"payment-multiple"!==o&&"payment-checkbox"!==o||i.append('<option value="'+e+'">'+t+"</option>")},paymentFieldAppendToDropdown:function(e,t){var i;"payment-quantity"===t&&(i=p("#everest-forms-field-option-"+e+"-map_field"),["payment-checkbox","payment-multiple","payment-single"].forEach(function(e){p(".everest-forms-field-"+e).each(function(){var e=p(this).attr("data-field-id"),t=p(this).find(".label-title .text").text();i.append('<option value="'+e+'">'+t+"</option>")})}))},conditionalLogicAppendFieldIntegration:function(i){var s=p("#"+i),n=s.index(),r=p(".evf-provider-conditional").find(".evf-conditional-field-select"),a=s.attr("data-field-type"),d=s.attr("data-field-id"),l=s.find(".label-title .text ").text();p.fn.insertAt=function(e,t){var i=p.makeArray(this.children().clone(!0));i.splice(t,0,e),this.empty().append(i)},r.each(function(o,e){var t=i.replace("everest-forms-field-",""),e=p(e).attr("name");t===e.substring(e.indexOf("[")+1,e.indexOf("]"))?p(".evf-admin-row .evf-admin-grid .everest-forms-field").each(function(){var e=p(this).data("field-type"),t=p(this).data("field-id"),i=p(this).find(".label-title span").first().text();field_to_be_restricted=[],field_to_be_restricted=["html","title","address","image-upload","file-upload","date-time","hidden","scale-rating","likert",s.attr("data-field-type")],-1===p.inArray(e,field_to_be_restricted)&&r.eq(o).append('<option class="evf-conditional-fields" data-field_type="'+e+'" data-field_id="'+t+'" value="'+t+'">'+i+"</option>")}):(e='<option class="evf-conditional-fields" data-field_type="'+a+'" data-field_id="'+d+'" value="'+d+'">'+l+"</option>","html"!==a&&"title"!==a&&"address"!==a&&"image-upload"!==a&&"file-upload"!==a&&"date-time"!==a&&"hidden"!==a&&"likert"!==a&&"scale-rating"!==a&&r.eq(o).insertAt(e,n))})},conditionalLogicRemoveField:function(e){p(".evf-field-conditional-field-select option[value = "+e+" ]").remove()},conditionalLogicRemoveFieldIntegration:function(e){p(".evf-provider-conditional .evf-conditional-field-select option[value = "+e+" ]").remove()},paymentFieldRemoveFromQuantity:function(e){p(".everest-forms-field-option-row-map_field select option[value = "+e+" ]").remove()},bindFieldSettings:function(){p("body").on("click",".everest-forms-preview .everest-forms-field, .everest-forms-preview .everest-forms-field .everest-forms-field-setting",function(e){e.preventDefault();e=p(this).closest(".everest-forms-field").attr("data-field-id");p(".everest-forms-tab-content").scrollTop(0),m.switchToFieldOptionPanel(e)})},toggleLabelEdit:function(e,t){p(e).toggleClass("everest-forms-hidden"),p(t).toggleClass("everest-forms-hidden"),p(t).is(":visible")&&p(t).focus()},bindToggleHandleActions:function(){p("body").on("click",".toggle-handle",function(e){var t=p(this).data("label"),i=p(this).data("input");p(i).is(":visible")||m.toggleLabelEdit(t,i)})},bindLabelEditInputActions:function(){p("body").on("focusout",".label-edit-input",function(e){var t=p(this).data("label");m.toggleLabelEdit(t,this)})},bindSyncedInputActions:function(){p("body").on("input",".sync-input",function(e){var t=p(this).val(),i=p(this).data("sync-targets");t&&i&&p(i).text(t)})}};m.init()}(jQuery,window.evf_data),jQuery(function(){"checked"!=jQuery("#everest-forms-panel-field-settingsemail-evf_send_confirmation_email").attr("checked")&&jQuery("#everest-forms-panel-field-settingsemail-evf_send_confirmation_email-wrap").nextAll().hide(),jQuery("#everest-forms-panel-field-settingsemail-evf_send_confirmation_email").on("change",function(){"checked"!=jQuery(this).attr("checked")?jQuery("#everest-forms-panel-field-settingsemail-evf_send_confirmation_email-wrap").nextAll().hide():jQuery("#everest-forms-panel-field-settingsemail-evf_send_confirmation_email-wrap").nextAll().show()});var e=jQuery("#everest-forms-panel-field-settings-redirect_to option:selected").val();"same"==e?(jQuery("#everest-forms-panel-field-settings-custom_page-wrap").hide(),jQuery("#everest-forms-panel-field-settings-external_url-wrap").hide()):"custom_page"==e?(jQuery("#everest-forms-panel-field-settings-custom_page-wrap").show(),jQuery("#everest-forms-panel-field-settings-external_url-wrap").hide()):"external_url"==e&&(jQuery("#everest-forms-panel-field-settings-external_url-wrap").show(),jQuery("#everest-forms-panel-field-settings-custom_page-wrap").hide()),jQuery("#everest-forms-panel-field-settings-redirect_to").on("change",function(){"same"==this.value?(jQuery("#everest-forms-panel-field-settings-custom_page-wrap").hide(),jQuery("#everest-forms-panel-field-settings-external_url-wrap").hide()):"custom_page"==this.value?(jQuery("#everest-forms-panel-field-settings-custom_page-wrap").show(),jQuery("#everest-forms-panel-field-settings-external_url-wrap").hide()):"external_url"==this.value&&(jQuery("#everest-forms-panel-field-settings-custom_page-wrap").hide(),jQuery("#everest-forms-panel-field-settings-external_url-wrap").show())}),jQuery(".evf-panel-field-options-button.evf-disabled-tab").hide();e=jQuery("#everest-forms-conditional-field-settings-redirect_to option:selected").val();"custom_page"==e?(jQuery("#everest-forms-conditional-field-settings-custom_page").show(),jQuery("#everest-forms-conditional-field-settings-external_url").hide()):"external_url"==e?(jQuery("#everest-forms-conditional-field-settings-custom_page").hide(),jQuery("#everest-forms-conditional-field-settings-external_url").show()):(jQuery("#everest-forms-conditional-field-settings-custom_page").hide(),jQuery("#everest-forms-conditional-field-settings-external_url").hide()),jQuery("#everest-forms-conditional-field-settings-redirect_to").on("change",function(){"custom_page"==this.value?(jQuery("#everest-forms-conditional-field-settings-custom_page").show(),jQuery("#everest-forms-conditional-field-settings-external_url").hide()):"external_url"==this.value?(jQuery("#everest-forms-conditional-field-settings-custom_page").hide(),jQuery("#everest-forms-conditional-field-settings-external_url").show()):(jQuery("#everest-forms-conditional-field-settings-custom_page").hide(),jQuery("#everest-forms-conditional-field-settings-external_url").hide())})}),jQuery(function(l){l(document.body).on("init_add_fields_toogle",function(){l(".everest-forms-add-fields").on("click",".everest-forms-add-fields-group > a",function(e){e.preventDefault(),l(this).parent(".everest-forms-add-fields-group").toggleClass("closed").toggleClass("open")}),l(".everest-forms-add-fields").on("click",".everest-forms-add-fields-group a",function(){l(this).next(".evf-registered-buttons").stop().slideToggle()}),l(".everest-forms-add-fields-group.closed").each(function(){l(this).find(".evf-registered-buttons").hide()})}).trigger("init_add_fields_toogle"),l(document.body).on("click",".everest-forms-field-option .everest-forms-field-option-group > a",function(e){e.preventDefault(),l(this).parent(".everest-forms-field-option-group").toggleClass("closed").toggleClass("open")}),l(document.body).on("click",".everest-forms-field-option .everest-forms-field-option-group a",function(e){l(e.target).filter(":input, option, .sort").length||l(this).next(".everest-forms-field-option-group-inner").stop().slideToggle()}),l(document.body).on("init_field_options_toggle",function(){l(".everest-forms-field-option-group.closed").each(function(){l(this).find(".everest-forms-field-option-group-inner").hide()})}).trigger("init_field_options_toggle"),l(document).on("click",function(){l(".evf-smart-tag-lists").hide()}),l(document.body).on("click",".evf-toggle-smart-tag-display",function(e){e.stopPropagation(),l(".evf-smart-tag-lists").hide(),l(".evf-smart-tag-lists ul").empty(),l(this).parent().find(".evf-smart-tag-lists").toggle("show");e=l(this).data("type");!function(o,e,t){var s=[],n=[],r=[];if(l(".evf-admin-row .evf-admin-grid .everest-forms-field").each(function(){var e,t=l(this).data("field-type"),i=l(this).data("field-id");o===t?(e=l(this).find(".label-title span").first().text(),r[i]=e):(e=l(this).find(".label-title span").first().text(),s[i]=e),n[i]=l(this).find(".label-title span").first().text()}),"other"===e||"all"===e){var i=evf_data.smart_tags_other;for(a in i)l(t).parent().find(".evf-smart-tag-lists .evf-others").append('<li class = "smart-tag-field" data-type="other" data-field_id="'+a+'">'+i[a]+"</li>")}if("fields"===e||"all"===e)if("email"===o)for(var a in Object.keys(r).length<1?l(t).parent().find('.evf-smart-tag-lists .smart-tag-title:not(".other-tag-title")').addClass("everest-forms-hidden"):l(t).parent().find('.evf-smart-tag-lists .smart-tag-title:not(".other-tag-title")').removeClass("everest-forms-hidden"),l(t).parent().find(".evf-smart-tag-lists .other-tag-title").remove(),l(t).parent().find(".evf-smart-tag-lists .evf-others").remove(),l(t).parent().find(".evf-smart-tag-lists").append('<div class="smart-tag-title other-tag-title">Others</div><ul class="evf-others"></ul>'),l(t).parent().find(".evf-smart-tag-lists .evf-others").append('<li class="smart-tag-field" data-type="other" data-field_id="admin_email">Site Admin Email</li><li class="smart-tag-field" data-type="other" data-field_id="user_email">User Email</li>'),r)l(t).parent().find(".evf-smart-tag-lists .evf-fields").append('<li class = "smart-tag-field" data-type="field" data-field_id="'+a+'">'+r[a]+"</li>");else for(var d in Object.keys(n).length<1?l(t).parent().find('.evf-smart-tag-lists .smart-tag-title:not(".other-tag-title")').addClass("everest-forms-hidden"):l(t).parent().find('.evf-smart-tag-lists .smart-tag-title:not(".other-tag-title")').removeClass("everest-forms-hidden"),n)l(t).parent().find(".evf-smart-tag-lists .evf-fields").append('<li class = "smart-tag-field" data-type="field" data-field_id="'+d+'">'+n[d]+"</li>")}(l(this).data("fields"),e,l(this))}),l(document.body).on("click",".smart-tag-field",function(e){var t=l(this).data("field_id"),i=l(this).text(),o=l(this).data("type"),s=l(this).parent().parent().parent(),n=s.find("input[type=text]"),s=s.find("textarea");if("fullname"!==t&&"email"!==t&&"subject"!==t&&"message"!==t&&"other"!==o){for(var i=i.split(/[\s-_]/),r=0;r<i.length;r++)i[r]=0===r?i[r].charAt(0).toLowerCase()+i[r].substr(1):i[r].charAt(0).toUpperCase()+i[r].substr(1);t=(i=i.join(""))+"_"+t}"field"===o?(n.val(n.val()+'{field_id="'+t+'"}'),s.val(s.val()+'{field_id="'+t+'"}')):"other"===o&&(n.val(n.val()+"{"+t+"}"),s.val(s.val()+"{"+t+"}"))}),l(document).on("change",".wp-list-table .everest-forms-toggle-form input",function(e){e.stopPropagation(),l.post(evf_data.ajax_url,{action:"everest_forms_enabled_form",security:evf_data.evf_enabled_form,form_id:l(this).data("form_id"),enabled:l(this).prop("checked")?1:0})}),l(document).on("change",".evf-content-email-settings .evf-toggle-switch input",function(e){var t=l(this),i=t.prop("checked");!1===i?(t.val(""),t.closest(".evf-content-email-settings").find(".email-disable-message").remove(),t.closest(".evf-content-section-title").siblings(".evf-content-email-settings-inner").addClass("everest-forms-hidden"),l('<p class="email-disable-message everest-forms-notice everest-forms-notice-info">'+evf_data.i18n_email_disable_message+"</p>").insertAfter(t.closest(".evf-content-section-title"))):!0===i&&(t.val("1"),t.closest(".evf-content-section-title").siblings(".evf-content-email-settings-inner").removeClass("everest-forms-hidden"),t.closest(".evf-content-email-settings").find(".email-disable-message").remove())}),l(document).on("click",".everest-forms-min-max-date-format input",function(){var e=l(this).closest(".everest-forms-date").find(".everest-forms-min-date").val(),t=l(this).closest(".everest-forms-date").find(".everest-forms-min-date").val();l(this).is(":checked")?(l(".everest-forms-min-max-date-option").removeClass("everest-forms-hidden"),""===e&&l(".everest-forms-min-date").addClass("flatpickr-field").flatpickr({disableMobile:!0,onChange:function(e,t,i){l(".everest-forms-min-date").val(t)},onOpen:function(e,t,i){i.set("maxDate",l(".everest-forms-max-date").val())}}),""===t&&l(".everest-forms-max-date").addClass("flatpickr-field").flatpickr({disableMobile:!0,onChange:function(e,t,i){l(".everest-forms-max-date").val(t)},onOpen:function(e,t,i){i.set("minDate",l(".everest-forms-min-date").val())}})):l(".everest-forms-min-max-date-option").addClass("everest-forms-hidden")})});
everest-forms.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Everest Forms
4
  * Plugin URI: https://wpeverest.com/wordpress-plugins/everest-forms/
5
  * Description: Drag and Drop contact form builder to easily create simple to complex forms for any purpose. Lightweight, Beautiful design, responsive and more.
6
- * Version: 1.7.8
7
  * Author: WPEverest
8
  * Author URI: https://wpeverest.com
9
  * Text Domain: everest-forms
3
  * Plugin Name: Everest Forms
4
  * Plugin URI: https://wpeverest.com/wordpress-plugins/everest-forms/
5
  * Description: Drag and Drop contact form builder to easily create simple to complex forms for any purpose. Lightweight, Beautiful design, responsive and more.
6
+ * Version: 1.7.9
7
  * Author: WPEverest
8
  * Author URI: https://wpeverest.com
9
  * Text Domain: everest-forms
includes/admin/builder/class-evf-builder-fields.php CHANGED
@@ -248,7 +248,7 @@ class EVF_Builder_Fields extends EVF_Builder_Page {
248
  */
249
  do_action( 'everest_forms_display_builder_row_before', $row_id, $form_data, $form_id );
250
 
251
- $repeater_field = apply_filters( 'everest_forms_display_repeater_fields', $row_grid, $fields );
252
 
253
  echo '<div class="evf-admin-row" data-row-id="' . absint( $row ) . '"' . ( ! is_array( $repeater_field ) ? $repeater_field : '' ) . '>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
254
  echo '<div class="evf-toggle-row">';
248
  */
249
  do_action( 'everest_forms_display_builder_row_before', $row_id, $form_data, $form_id );
250
 
251
+ $repeater_field = apply_filters( 'everest_forms_display_repeater_fields', false, $row_grid, $fields );
252
 
253
  echo '<div class="evf-admin-row" data-row-id="' . absint( $row ) . '"' . ( ! is_array( $repeater_field ) ? $repeater_field : '' ) . '>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
254
  echo '<div class="evf-toggle-row">';
includes/class-everest-forms.php CHANGED
@@ -21,7 +21,7 @@ final class EverestForms {
21
  *
22
  * @var string
23
  */
24
- public $version = '1.7.8';
25
 
26
  /**
27
  * The single instance of the class.
21
  *
22
  * @var string
23
  */
24
+ public $version = '1.7.9';
25
 
26
  /**
27
  * The single instance of the class.
includes/shortcodes/class-evf-shortcode-form.php CHANGED
@@ -307,7 +307,7 @@ class EVF_Shortcode_Form {
307
  *
308
  * @hooked EVF_Repeater_Fields->display_repeater_fields() Display Repeater Fields.
309
  */
310
- $is_repeater = ( ! is_array( apply_filters( 'everest_forms_display_repeater_fields', $row, $form_data, true ) ) ) ? apply_filters( 'everest_forms_display_repeater_fields', $row, $form_data, true ) : '';
311
 
312
  /**
313
  * Hook: everest_forms_display_row_before.
307
  *
308
  * @hooked EVF_Repeater_Fields->display_repeater_fields() Display Repeater Fields.
309
  */
310
+ $is_repeater = apply_filters( 'everest_forms_display_repeater_fields', false, $row, $form_data, true );
311
 
312
  /**
313
  * Hook: everest_forms_display_row_before.
languages/everest-forms.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Everest Forms plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Everest Forms 1.7.8\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/everest-forms\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2021-10-26T09:02:25+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: everest-forms\n"
2
  # This file is distributed under the same license as the Everest Forms plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Everest Forms 1.7.9\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/everest-forms\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-11-12T09:28:45+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: everest-forms\n"
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: contact form, forms, form builder, contact, custom form
4
  Requires at least: 5.0
5
  Tested up to: 5.8
6
  Requires PHP: 5.4
7
- Stable tag: 1.7.8
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -302,6 +302,10 @@ Yes you can! Join in on our [GitHub repository](https://github.com/wpeverest/eve
302
 
303
  == Changelog ==
304
 
 
 
 
 
305
  = 1.7.8 - 26-10-2021 =
306
  * Enhancement - Conditional logic for for submission redirection.
307
  * Feature - Repeater Fields.
4
  Requires at least: 5.0
5
  Tested up to: 5.8
6
  Requires PHP: 5.4
7
+ Stable tag: 1.7.9
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
302
 
303
  == Changelog ==
304
 
305
+ = 1.7.9 - 12-11-2021 =
306
+ * fix - Row setting hidden issue.
307
+ * Enhancement - Datepicker glitches in builder page.
308
+
309
  = 1.7.8 - 26-10-2021 =
310
  * Enhancement - Conditional logic for for submission redirection.
311
  * Feature - Repeater Fields.