PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Dir : /home/trave494/v1world.us/wp-content/plugins/wpforms-lite/assets/js/ |
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 IP: 209.182.202.254 |
Dir : //home/trave494/v1world.us/wp-content/plugins/wpforms-lite/assets/js/admin.min.js |
!function(m){"use strict";var l,p={settings:{iconActivate:'<i class="fa fa-toggle-on fa-flip-horizontal" aria-hidden="true"></i>',iconDeactivate:'<i class="fa fa-toggle-on" aria-hidden="true"></i>',iconInstall:'<i class="fa fa-cloud-download" aria-hidden="true"></i>',iconSpinner:'<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>',mediaFrame:!1},init:function(){l=this.settings,m(p.ready),p.initFormOverview(),p.initEntriesSingle(),p.initEntriesList(),p.initWelcome(),m(document).on("wpformsReady",p.initAddons),p.initSettings(),p.initTools(),p.initUpgrades()},ready:function(){m(".notice").show(),m("#screen-meta-links, #screen-meta").prependTo("#wpforms-header-temp").show(),p.initChoicesJS(),p.initCheckboxMultiselectColumns(),m(".wpforms-color-picker").minicolors(),m(".wpforms-file-upload").each(function(){var e=m(this).find("input[type=file]"),n=m(this).find("label"),o=n.html();e.on("change",function(e){var t="";this.files&&1<this.files.length?t=(this.getAttribute("data-multiple-caption")||"").replace("{count}",this.files.length):e.target.value&&(t=e.target.value.split("\\").pop()),t?n.find(".fld").html(t):n.html(o)}),e.on("focus",function(){e.addClass("has-focus")}).on("blur",function(){e.removeClass("has-focus")})}),jconfirm.defaults={closeIcon:!0,backgroundDismiss:!0,escapeKey:!0,animationBounce:1,useBootstrap:!1,theme:"modern",boxWidth:"400px",animateFromElement:!1},m(document).on("click",".wpforms-upgrade-modal",function(){m.alert({title:!1,content:wpforms_admin.upgrade_modal,icon:"fa fa-info-circle",type:"blue",boxWidth:"565px",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}})}),p.initLity(),p.initFlyoutMenu(),m(document).trigger("wpformsReady")},initChoicesJS:function(){m(".choicesjs-select").each(function(){var e=m(this),t={searchEnabled:!1};e.attr("multiple")&&(t.searchEnabled=!0,t.removeItemButton=!0),"off"===e.data("sorting")&&(t.shouldSort=!1),e.data("search")&&(t.searchEnabled=!0),t.loadingText=wpforms_admin.choicesjs_loading,t.noResultsText=wpforms_admin.choicesjs_no_results,t.noChoicesText=wpforms_admin.choicesjs_no_choices,t.itemSelectText=wpforms_admin.choicesjs_item_select,t.callbackOnInit=function(){var e=this,t=m(e.passedElement.element),n=m(e.input.element),o=t.data("size-class");o&&m(e.containerOuter.element).addClass(o),t.prop("multiple")&&(e.getValue(!0).length&&n.addClass(e.config.classNames.input+"--hidden"),t.on("change",function(){e.getValue(!0).length?n.addClass(e.config.classNames.input+"--hidden"):n.removeClass(e.config.classNames.input+"--hidden")}))},e.data("choicesjs",new Choices(e[0],t))})},initCheckboxMultiselectColumns:function(){m(document).on("change",".checkbox-multiselect-columns input",function(){var e=m(this),t=e.parent(),n=e.closest(".checkbox-multiselect-columns"),o=t.text(),i="check-item-"+e.val(),t=n.find("#"+i);e.prop("checked")?(e.parent().addClass("checked"),t.length||n.find(".second-column ul").append('<li id="'+i+'">'+o+"</li>")):(e.parent().removeClass("checked"),n.find("#"+i).remove())}),m(document).on("click",".checkbox-multiselect-columns .all",function(e){e.preventDefault(),m(this).closest(".checkbox-multiselect-columns").find("input[type=checkbox]").prop("checked",!0).trigger("change"),m(this).remove()})},initFormOverview:function(){m(document).on("click","#wpforms-overview .wp-list-table .delete a, #wpforms-overview .wp-list-table .duplicate a",function(e){e.preventDefault();var t=m(this).attr("href"),e=m(this).parent().hasClass("delete")?wpforms_admin.form_delete_confirm:wpforms_admin.form_duplicate_confirm;m.confirm({title:!1,content:e,backgroundDismiss:!1,closeIcon:!1,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){window.location=t}},cancel:{text:wpforms_admin.cancel,keys:["esc"]}}})})},initEntriesSingle:function(){"wpforms-entries"===p.getQueryString("page")&&"details"===p.getQueryString("view")&&p.entryHotkeys(),m(document).on("click","#wpforms-entries-single .submitdelete",function(e){e.preventDefault();var t=m(this).attr("href");m.confirm({title:!1,content:wpforms_admin.entry_delete_confirm,backgroundDismiss:!1,closeIcon:!1,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){window.location=t}},cancel:{text:wpforms_admin.cancel,keys:["esc"]}}})}),m(document).on("click","#wpforms-entries-single .wpforms-entry-print a",function(e){e.preventDefault(),window.open(m(this).attr("href"))}),m(document).on("click","#wpforms-entries-single .wpforms-empty-field-toggle",function(e){e.preventDefault(),"true"===wpCookies.get("wpforms_entry_hide_empty")?(wpCookies.remove("wpforms_entry_hide_empty"),m(this).text(wpforms_admin.entry_empty_fields_hide)):(wpCookies.set("wpforms_entry_hide_empty","true",2592e3),m(this).text(wpforms_admin.entry_empty_fields_show)),m(".wpforms-entry-field.empty, .wpforms-edit-entry-field.empty").toggle()}),m(document).on("click","#wpforms-entries-single .wpforms-entry-notes-new .add",function(e){e.preventDefault(),m(this).hide().next("form").stop().slideToggle()}),m(document).on("click","#wpforms-entries-single .wpforms-entry-notes-new .cancel",function(e){e.preventDefault(),m(this).closest("form").stop().slideToggle(),m(".wpforms-entry-notes-new .add").show()}),m(document).on("click","#wpforms-entries-single .wpforms-entry-notes-byline .note-delete",function(e){e.preventDefault();var t=m(this).attr("href");m.confirm({title:!1,content:wpforms_admin.entry_note_delete_confirm,backgroundDismiss:!1,closeIcon:!1,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){window.location=t}},cancel:{text:wpforms_admin.cancel,keys:["esc"]}}})})},entryHotkeys:function(){m(document).keydown(function(e){var t;74!==e.keyCode||p.isFormTypeNode(e.target.nodeName)?75!==e.keyCode||p.isFormTypeNode(e.target.nodeName)||"#"!==(t=m("#wpforms-entry-next-link").attr("href"))&&(window.location.href=t):"#"!==(t=m("#wpforms-entry-prev-link").attr("href"))&&(window.location.href=t)})},initEntriesList:function(){m(document).on("click","#wpforms-entries-table-edit-columns",function(e){e.preventDefault(),p.entriesListFieldColumn()}),m(document).on("click","#wpforms-entries-list .form-selector .toggle",function(e){e.preventDefault(),m(this).toggleClass("active").next(".form-list").toggle()}),m(document).on("click","#wpforms-entries-table #doaction",function(e){var t=m(this).closest("form"),n=t.find("table"),o=t.find("select[name=action]"),n=n.find("input[name^=entry_id]:checked");"delete"===o.val()&&n.length&&(e.preventDefault(),m.confirm({title:!1,content:wpforms_admin.entry_delete_n_confirm.replace("{entry_count}",n.length),backgroundDismiss:!1,closeIcon:!1,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){t.submit()}},cancel:{text:wpforms_admin.cancel,keys:["esc"]}}}))}),m(document).on("click","#wpforms-entries-list .wp-list-table .delete",function(e){e.preventDefault();var t=m(this).attr("href");m.confirm({title:!1,content:wpforms_admin.entry_delete_confirm,backgroundDismiss:!1,closeIcon:!1,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){window.location=t}},cancel:{text:wpforms_admin.cancel,keys:["esc"]}}})}),m(document).on("click","#wpforms-entries-list .wp-list-table .indicator-star",function(e){e.preventDefault();var t=m(this),n="",o=Number(m("#wpforms-entries-list .starred-num").text()),i=t.data("id"),e=t.data("form-id");t.hasClass("star")?(n="star",o++,t.attr("title",wpforms_admin.entry_unstar)):(n="unstar",o--,t.attr("title",wpforms_admin.entry_star)),t.toggleClass("star unstar"),m("#wpforms-entries-list .starred-num").text(o);e={task:n,action:"wpforms_entry_list_star",nonce:wpforms_admin.nonce,entryId:i,formId:e};m.post(wpforms_admin.ajax_url,e)}),m(document).on("click","#wpforms-entries-list .wp-list-table .indicator-read",function(e){e.preventDefault();var t=m(this),n="",o=Number(m("#wpforms-entries-list .unread-num").text()),e=t.data("id");t.hasClass("read")?(n="read",o--,t.attr("title",wpforms_admin.entry_unread)):(n="unread",o++,t.attr("title",wpforms_admin.entry_read)),t.toggleClass("read unread"),m("#wpforms-entries-list .unread-num").text(o);t={task:n,action:"wpforms_entry_list_read",nonce:wpforms_admin.nonce,entryId:e,formId:t.data("form-id")};m.post(wpforms_admin.ajax_url,t)}),m(document).on("click","#wpforms-entries-list .form-details-actions-deleteall",function(e){e.preventDefault();var t=m(this).attr("href"),n=m("#wpforms-entries-table"),e=n.data("filtered-count")?parseInt(n.data("filtered-count"),10):0,o={action:"wpforms_entry_list_process_delete_all",form_id:n.find('input[name="form_id"]').val(),date:n.find('input[name="date"]').val(),search:{field:n.find('select[name="search[field]"]').val(),comparison:n.find('select[name="search[comparison]"]').val(),term:n.find('input[name="search[term]"]').val()},nonce:wpforms_admin.nonce,url:t};m.confirm({title:wpforms_admin.heads_up,content:e&&m("#wpforms-reset-filter").length?wpforms_admin.entry_delete_n_confirm.replace("{entry_count}",e):wpforms_admin.entry_delete_all_confirm,backgroundDismiss:!1,closeIcon:!1,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){m.get(wpforms_admin.ajax_url,o).done(function(e){e.success?window.location=_.isEmpty(e.data)?t:e.data:_.isEmpty(e.data)||console.error(e.data)})}},cancel:{text:wpforms_admin.cancel,keys:["esc"]}}})}),m(document).on("heartbeat-send",function(e,t){var n,o=m("#wpforms-entries-list");!o.length||o.find(".wpforms-dash-widget").length||void 0!==(n=o.find("#wpforms-entries-table").data("last-entry-id"))&&(t.wpforms_new_entries_entry_id=n,t.wpforms_new_entries_form_id=o.find("input[name=form_id]").val())}),m(document).on("heartbeat-tick",function(e,t){var n,o,i=m("#wpforms-entries-list");i.length&&t.wpforms_new_entries_notification&&(n=i.find(".wp-list-table thead tr").first().children().length,i.find(".new-entries-notification").length||i.find(".wp-list-table thead").append('<tr class="new-entries-notification"><td colspan="'+n+'"><a href=""></a></td></tr>'),(o=i.find(".new-entries-notification a")).text(t.wpforms_new_entries_notification).slideDown({start:function(){o.css("display","block")},always:function(){o.css("display","block")}}))})},entriesListFieldColumn:function(){m.alert({title:wpforms_admin.entry_field_columns,boxWidth:"500px",content:l.iconSpinner+m("#wpforms-field-column-select").html(),onContentReady:function(){var e=this.$content,t=e.find("select"),n=new Choices(t[0],{shouldSort:!1,removeItemButton:!0,loadingText:wpforms_admin.choicesjs_loading,noResultsText:wpforms_admin.choicesjs_no_results,noChoicesText:wpforms_admin.choicesjs_no_choices,itemSelectText:wpforms_admin.choicesjs_item_select,callbackOnInit:function(){e.find(".fa").remove(),e.find("form").show()}});m(".jconfirm-content-pane, .jconfirm-box").css("overflow","visible"),n.passedElement.element.addEventListener("change",function(){n.hideDropdown(!0)},!1)},buttons:{confirm:{text:wpforms_admin.save_refresh,btnClass:"btn-confirm",keys:["enter"],action:function(){this.$content.find("form").submit()}},cancel:{text:wpforms_admin.cancel,keys:["esc"]}}})},initWelcome:function(){m(document).on("click","#wpforms-welcome .play-video",function(e){e.preventDefault();m.dialog({title:!1,content:'<div class="video-container"><iframe width="1280" height="720" src="https://www.youtube-nocookie.com/embed/o2nE1P74WxQ?rel=0&showinfo=0&autoplay=1" frameborder="0" allowfullscreen></iframe></div>',closeIcon:!0,boxWidth:"70%"})})},initAddons:function(){var n;m("#wpforms-admin-addons").length&&(p.matchHeightAddonBlocks(),m("#wpforms-admin-addons-list").length&&(n=new List("wpforms-admin-addons-list",{valueNames:["addon-name"]}),m("#wpforms-admin-addons-search").on("keyup",function(){var e=m(this).val(),t=m("#addons-heading");e?t.text(wpforms_admin.addon_search):t.text(t.data("text")),n.search(e)})),m(window).on("resize",p.matchHeightAddonBlocks),m(document).on("click","#wpforms-admin-addons .addon-item button",function(e){return e.preventDefault(),!m(this).hasClass("disabled")&&void p.addonToggle(m(this))}))},setAddonState:function(e,t,n,o){t={activate:"wpforms_activate_addon",install:"wpforms_install_addon",deactivate:"wpforms_deactivate_addon"}[t];t&&(n={action:t,nonce:wpforms_admin.nonce,plugin:e,type:n},m.post(wpforms_admin.ajax_url,n,function(e){o(e)}).fail(function(e){console.log(e.responseText)}))},addonToggle:function(t){var n,o,i,s,a,r,c=t.closest(".addon-item"),e=t.attr("data-plugin"),d=t.attr("data-type");if(t.hasClass("status-go-to-url"))window.open(t.attr("data-plugin"),"_blank");else{if(t.prop("disabled",!0).addClass("loading"),t.html(l.iconSpinner),t.hasClass("status-active"))n="deactivate",o="status-installed","plugin"===d&&(o+=" button button-secondary"),i=wpforms_admin.addon_inactive,s=wpforms_admin.addon_activate,a=wpforms_admin.addon_deactivate,"addon"===d&&(s=l.iconActivate+s,a=l.iconDeactivate+a);else if(t.hasClass("status-installed"))n="activate",o="status-active","plugin"===d&&(o+=" button button-secondary disabled"),i=wpforms_admin.addon_active,s=wpforms_admin.addon_deactivate,"addon"===d?(s=l.iconDeactivate+s,a=l.iconActivate+wpforms_admin.addon_activate):"plugin"===d&&(s=wpforms_admin.addon_activated,a=wpforms_admin.addon_activate);else{if(!t.hasClass("status-missing"))return;n="install",o="status-active","plugin"===d&&(o+=" button disabled"),i=wpforms_admin.addon_active,s=wpforms_admin.addon_activated,a=l.iconInstall,"addon"===d&&(s=l.iconActivate+wpforms_admin.addon_deactivate,a+=wpforms_admin.addon_install)}p.setAddonState(e,n,d,function(e){e.success?("install"===n?(t.attr("data-plugin",e.data.basename),r=e.data.msg,e.data.is_activated||(i=wpforms_admin.addon_inactive,s="plugin"===d?wpforms_admin.addon_activate:l.iconActivate+wpforms_admin.addon_activate,o="plugin"===d?"status-installed button button-secondary":"status-installed")):r=e.data,c.find(".actions").append('<div class="msg success">'+r+"</div>"),c.find("span.status-label").removeClass("status-active status-installed status-missing").addClass(o).removeClass("button button-primary button-secondary disabled").text(i),t.removeClass("status-active status-installed status-missing").removeClass("button button-primary button-secondary disabled").addClass(o).html(s)):("object"==typeof e.data?"addon"===d?c.find(".actions").append('<div class="msg error">'+wpforms_admin.addon_error+"</div>"):c.find(".actions").append('<div class="msg error">'+wpforms_admin.plugin_error+"</div>"):c.find(".actions").append('<div class="msg error">'+e.data+"</div>"),"install"===n&&"plugin"===d&&t.addClass("status-go-to-url").removeClass("status-missing"),t.html(a)),t.prop("disabled",!1).removeClass("loading"),setTimeout(function(){m(".addon-item .msg").remove()},3e3)})}},matchHeightAddonBlocks:function(){m(".addon-item .details").matchHeight({byrow:!1,property:"height"})},initSettings:function(){m(document).on("wpformsReady",function(){var e,t;m("#wpforms-settings").length&&(e=p.getQueryString("wpforms-integration"),t=p.getQueryString("jump"),e?m("body").animate({scrollTop:m("#wpforms-integration-"+e).offset().top},1e3):t&&m("body").animate({scrollTop:m("#"+t).offset().top},1e3),m(".wpforms-admin-settings-form").conditions([{conditions:{element:"#wpforms-setting-gdpr",type:"checked",operator:"is"},actions:{if:{element:"#wpforms-setting-row-gdpr-disable-uuid,#wpforms-setting-row-gdpr-disable-details",action:"show"},else:{element:"#wpforms-setting-row-gdpr-disable-uuid,#wpforms-setting-row-gdpr-disable-details",action:"hide"}},effect:"appear"},{conditions:{element:"input[name=captcha-provider]:checked",type:"value",operator:"=",condition:"hcaptcha"},actions:{if:[{element:".wpforms-setting-row",action:"show"},{element:".wpforms-setting-recaptcha, #wpforms-setting-row-captcha-provider .desc, #wpforms-setting-row-recaptcha-site-key, #wpforms-setting-row-recaptcha-secret-key, #wpforms-setting-row-recaptcha-fail-msg",action:"hide"}]},effect:"appear"},{conditions:{element:"input[name=captcha-provider]:checked",type:"value",operator:"=",condition:"recaptcha"},actions:{if:[{element:".wpforms-setting-row",action:"show"},{element:"#wpforms-setting-row-captcha-provider .desc, #wpforms-setting-row-hcaptcha-heading, #wpforms-setting-row-hcaptcha-site-key, #wpforms-setting-row-hcaptcha-secret-key, #wpforms-setting-row-hcaptcha-fail-msg",action:"hide"}]},effect:"appear"},{conditions:{element:"input[name=captcha-provider]:checked",type:"value",operator:"=",condition:"none"},actions:{if:[{element:".wpforms-setting-row",action:"hide"},{element:".wpforms-setting-captcha-heading, #wpforms-setting-row-captcha-provider, #wpforms-setting-row-captcha-provider .desc",action:"show"}]},effect:"appear"}]))}),m(document).on("change","#wpforms-setting-disable-css",function(){p.settingsFormStylesAlert(m(this).val())}),m(document).on("click",".wpforms-setting-row-image button",function(e){e.preventDefault(),p.imageUploadModal(m(this))}),m(document).on("click","#wpforms-setting-license-key-verify",function(e){e.preventDefault(),p.licenseVerify(m(this))}),m(document).on("click",".wpforms-setting-license-wrapper",function(e){e.preventDefault();e=m("#wpforms-setting-license-key");e.length&&e.prop("disabled")&&p.licenseEditMessage()}),m(document).on("click","#wpforms-setting-license-key-deactivate",function(e){e.preventDefault(),p.licenseDeactivate(m(this))}),m(document).on("click","#wpforms-setting-license-key-refresh",function(e){e.preventDefault(),p.licenseRefresh(m(this))}),m(document).on("click",".wpforms-settings-provider-connect",function(e){e.preventDefault();e=m(this);p.integrationConnect(e)}),m(document).on("click",".wpforms-settings-provider-accounts-list a",function(e){e.preventDefault(),p.integrationDisconnect(m(this))}),m(document).on("click",".wpforms-settings-provider:not(.focus-out) .wpforms-settings-provider-header",function(e){e.preventDefault();var t=m(this);t.parent().find(".wpforms-settings-provider-accounts").stop().slideToggle("",function(){t.parent().find(".wpforms-settings-provider-logo i").toggleClass("fa-chevron-right fa-chevron-down")})}),m(document).on("click",".wpforms-settings-provider-accounts-toggle a",function(e){e.preventDefault();e=m(this).parent().next(".wpforms-settings-provider-accounts-connect");e.find("input[type=text], input[type=password]").val(""),e.stop().slideToggle()}),m(document).on("change","#wpforms-setting-row-captcha-provider input",function(){var e=m("#wpforms-setting-row-captcha-preview");"hcaptcha"===this.value?e.removeClass("wpforms-hidden"):"none"===this.value?e.addClass("wpforms-hidden"):m("#wpforms-setting-row-recaptcha-type input:checked").trigger("change"),e.find(".wpforms-captcha-preview").length&&(e.find(".wpforms-captcha-preview").empty(),e.find(".wpforms-captcha-placeholder").removeClass("wpforms-hidden"))}),m(document).on("change","#wpforms-setting-row-recaptcha-type input",function(){m("#wpforms-setting-row-captcha-preview").toggleClass("wpforms-hidden","v2"!==this.value),m("#wpforms-setting-row-recaptcha-v3-threshold").toggleClass("wpforms-hidden","v3"!==this.value)})},settingsFormStylesAlert:function(e){if("2"===e)var t=wpforms_admin.settings_form_style_base;else{if("3"!==e)return;t=wpforms_admin.settings_form_style_none}m.alert({title:wpforms_admin.heads_up,content:t,backgroundDismiss:!1,closeIcon:!1,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}})},imageUploadModal:function(e){var t;l.media_frame||(t=m(e).closest(".wpforms-setting-field"),l.media_frame=wp.media.frames.wpforms_media_frame=wp.media({className:"media-frame wpforms-media-frame",frame:"select",multiple:!1,title:wpforms_admin.upload_image_title,library:{type:"image"},button:{text:wpforms_admin.upload_image_button}}),l.media_frame.on("select",function(){var e=l.media_frame.state().get("selection").first().toJSON();t.find("input[type=text]").val(e.url),t.find("img").remove(),t.prepend('<img src="'+e.url+'">')})),l.media_frame.open()},licenseVerify:function(i){var s=i.closest(".wpforms-setting-row"),a=m("#wpforms-setting-license-key"),e=i.outerWidth(),r=i.text(),t={action:"wpforms_verify_license",nonce:wpforms_admin.nonce,license:a.val()};i.html(l.iconSpinner).css("width",e).prop("disabled",!0),m.post(wpforms_admin.ajax_url,t,function(e){var t,n="fa fa-check-circle",o="green";e.success?(t=e.data.msg,s.find(".type, .desc, #wpforms-setting-license-key-deactivate").show(),s.find(".type strong").text(e.data.type),m(".wpforms-license-notice").remove(),a.prop("disabled",!0)):(n="fa fa-exclamation-circle",o="orange",t=e.data,s.find(".type, .desc, #wpforms-setting-license-key-deactivate").hide(),a.prop("disabled",!1)),m.alert({title:!1,content:t,icon:n,type:o,buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}}),i.html(r).css("width","auto").prop("disabled",!1)}).fail(function(e){a.prop("disabled",!1),console.log(e.responseText)})},licenseEditMessage:function(){m.alert({title:wpforms_admin.heads_up,content:wpforms_admin.edit_license,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}})},licenseDeactivate:function(e){var i=m(e),s=i.closest(".wpforms-setting-row"),t=i.outerWidth(),a=i.text(),e={action:"wpforms_deactivate_license",nonce:wpforms_admin.nonce};i.html(l.iconSpinner).css("width",t).prop("disabled",!0),m.post(wpforms_admin.ajax_url,e,function(e){var t="fa fa-info-circle",n="blue",o=e.data;e.success?(s.find("#wpforms-setting-license-key").val("").prop("disabled",!1),s.find(".type, .desc, #wpforms-setting-license-key-deactivate").hide()):(t="fa fa-exclamation-circle",n="orange"),m.alert({title:!1,content:o,icon:t,type:n,buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}}),i.html(a).css("width","auto").prop("disabled",!1)}).fail(function(e){console.log(e.responseText)})},licenseRefresh:function(e){var i=m(e).closest(".wpforms-setting-row"),e={action:"wpforms_refresh_license",nonce:wpforms_admin.nonce,license:m("#wpforms-setting-license-key").val()};m.post(wpforms_admin.ajax_url,e,function(e){var t,n="fa fa-check-circle",o="green";e.success?(t=e.data.msg,i.find(".type strong").text(e.data.type)):(n="fa fa-exclamation-circle",o="orange",t=e.data,i.find(".type, .desc, #wpforms-setting-license-key-deactivate").hide()),m.alert({title:!1,content:t,icon:n,type:o,buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}})}).fail(function(e){console.log(e.responseText)})},integrationConnect:function(t){var e=t.outerWidth(),n=t.text(),o=t.closest(".wpforms-settings-provider"),i={action:"wpforms_settings_provider_add_"+t.data("provider"),data:t.closest("form").serialize(),provider:t.data("provider"),nonce:wpforms_admin.nonce},s=wpforms_admin.provider_auth_error;t.html("Connecting...").css("width",e).prop("disabled",!0),m.post(wpforms_admin.ajax_url,i,function(e){e.success?(o.find(".wpforms-settings-provider-accounts-list ul").append(e.data.html),o.addClass("connected"),t.closest(".wpforms-settings-provider-accounts-connect").stop().slideToggle()):(Object.prototype.hasOwnProperty.call(e,"data")&&Object.prototype.hasOwnProperty.call(e.data,"error_msg")&&(s+="<br>"+e.data.error_msg),p.integrationError(s))}).fail(function(){p.integrationError(s)}).complete(function(){t.html(n).css("width","auto").prop("disabled",!1)})},integrationDisconnect:function(e){var n=m(e),o=n.parents(".wpforms-settings-provider"),t={action:"wpforms_settings_provider_disconnect_"+n.data("provider"),provider:n.data("provider"),key:n.data("key"),nonce:wpforms_admin.nonce},i=wpforms_admin.provider_delete_error;m.confirm({title:wpforms_admin.heads_up,content:wpforms_admin.provider_delete_confirm,backgroundDismiss:!1,closeIcon:!1,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){m.post(wpforms_admin.ajax_url,t,function(e){var t;e.success?(n.parent().parent().remove(),void 0!==(t=o.find(".wpforms-settings-provider-accounts-list li").length)&&0!==t||o.removeClass("connected")):(Object.prototype.hasOwnProperty.call(e,"data")&&Object.prototype.hasOwnProperty.call(e.data,"error_msg")&&(i+="<br>"+e.data.error_msg),p.integrationError(i))}).fail(function(){p.integrationError(i)})}},cancel:{text:wpforms_admin.cancel,keys:["esc"]}}})},integrationError:function(e){m.alert({title:!1,content:e,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}})},initTools:function(){m(document).on("click","#wpforms-ssl-verify",function(e){e.preventDefault(),p.verifySSLConnection()}),m(document).on("click","#wpforms-importer-forms-submit",function(e){var t;e.preventDefault(),m("#wpforms-importer-forms input:checked").length?(t=[],m("#wpforms-importer-forms input:checked").each(function(e){t[e]=m(this).val()}),wpforms_admin.isPro?p.importForms(t):p.analyzeForms(t)):m.alert({title:!1,content:wpforms_admin.importer_forms_required,icon:"fa fa-info-circle",type:"blue",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}})}),m(document).on("click","#wpforms-importer-continue-submit",function(e){e.preventDefault(),p.importForms(l.formIDs)})},verifySSLConnection:function(){var t=m("#wpforms-ssl-verify"),n=t.text(),o=t.outerWidth(),i=t.parent(),e={action:"wpforms_verify_ssl",nonce:wpforms_admin.nonce};t.css("width",o).prop("disabled",!0).text(wpforms_admin.testing),m.post(wpforms_admin.ajax_url,e,function(e){console.log(e),i.find(".wpforms-alert, .wpforms-ssl-error").remove(),e.success&&t.before('<div class="wpforms-alert wpforms-alert-success">'+e.data.msg+"</div>"),!e.success&&e.data.msg&&t.before('<div class="wpforms-alert wpforms-alert-danger">'+e.data.msg+"</div>"),!e.success&&e.data.debug&&t.before('<div class="wpforms-ssl-error pre-error">'+e.data.debug+"</div>"),t.css("width",o).prop("disabled",!1).text(n)})},analyzeForms:function(e){var t=m("#wpforms-importer-analyze");t.find(".form-total").text(e.length),t.find(".form-current").text("1"),m("#wpforms-importer-forms").hide(),t.show(),l.analyzeQueue=e,l.analyzed=0,l.analyzeUpgrade=[],l.formIDs=e,p.analyzeForm()},analyzeForm:function(){var t=m("#wpforms-importer-analyze"),n=_.first(l.analyzeQueue),e={action:"wpforms_import_form_"+p.getQueryString("provider"),analyze:1,form_id:n,nonce:wpforms_admin.nonce};m.post(wpforms_admin.ajax_url,e,function(e){e.success&&(_.isEmpty(e.data.upgrade_plain)&&_.isEmpty(e.data.upgrade_omit)||l.analyzeUpgrade.push({name:e.data.name,fields:_.union(e.data.upgrade_omit,e.data.upgrade_plain)}),l.analyzeQueue=_.without(l.analyzeQueue,n),l.analyzed++,_.isEmpty(l.analyzeQueue)?_.isEmpty(l.analyzeUpgrade)?p.importForms(l.formIDs):(e=wp.template("wpforms-importer-upgrade"),t.find(".upgrade").append(e(l.analyzeUpgrade)),t.find(".upgrade").show(),t.find(".process-analyze").hide()):(t.find(".form-current").text(l.analyzed+1),p.analyzeForm()))})},importForms:function(e){var t=m("#wpforms-importer-process");t.find(".form-total").text(e.length),t.find(".form-current").text("1"),m("#wpforms-importer-forms, #wpforms-importer-analyze").hide(),t.show(),l.importQueue=e,l.imported=0,p.importForm()},importForm:function(){var n=m("#wpforms-importer-process"),o=_.first(l.importQueue),e={action:"wpforms_import_form_"+p.getQueryString("provider"),form_id:o,nonce:wpforms_admin.nonce};m.post(wpforms_admin.ajax_url,e,function(e){var t;e.success&&(t=e.data.error?wp.template("wpforms-importer-status-error"):wp.template("wpforms-importer-status-update"),n.find(".status").prepend(t(e.data)),n.find(".status").show(),l.importQueue=_.without(l.importQueue,o),l.imported++,_.isEmpty(l.importQueue)?(n.find(".process-count").hide(),n.find(".forms-completed").text(l.imported),n.find(".process-completed").show()):(n.find(".form-current").text(l.imported+1),p.importForm()))})},initUpgrades:function(){m(document).on("click","#wpforms-upgrade-143 button",function(e){e.preventDefault();var t=m(this),n=t.outerWidth(),o=m("#wpforms-upgrade-143 .status"),e={action:"wpforms_upgrade_143",nonce:wpforms_admin.nonce,init:!0,incomplete:t.data("incomplete")};t.html(l.iconSpinner).css("width",n).prop("disabled",!0),m.post(wpforms_admin.ajax_url,e,function(e){e.success&&(l.upgraded=Number(e.data.upgraded),l.upgradeTotal=Number(e.data.total),e=Math.round(Number(l.upgraded)/Number(l.upgradeTotal)*100),t.remove(),o.find(".bar").css("width",e+"%"),o.show().find(".total").text(l.upgradeTotal),o.find(".current").text(l.upgraded),o.find(".percent").text(e+"%"),p.upgrade143())})})},upgrade143:function(){var n=m("#wpforms-upgrade-143 .status"),e={action:"wpforms_upgrade_143",nonce:wpforms_admin.nonce,upgraded:l.upgraded};m.post(wpforms_admin.ajax_url,e,function(e){var t;e.success&&(l.upgraded=Number(l.upgraded)+Number(e.data.count),t=Math.round(Number(l.upgraded)/Number(l.upgradeTotal)*100),n.find(".bar").css("width",t+"%"),Number(e.data.count)<10?(n.find(".progress-bar").addClass("complete"),n.find(".msg").text(wpforms_admin.upgrade_completed)):(n.find(".current").text(l.upgraded),n.find(".percent").text(t+"%"),p.upgrade143()))})},initFlyoutMenu:function(){var t,n,e,o,i,s,a,r=m("#wpforms-flyout");0!==r.length&&(o=r.find(".wpforms-flyout-head"),t=o.find("img"),n={state:"inactive",srcInactive:t.attr("src"),srcActive:t.data("active")},o.on("click",function(e){e.preventDefault(),"active"===n.state?(r.removeClass("opened"),t.attr("src",n.srcInactive),n.state="inactive"):(r.addClass("opened"),t.attr("src",n.srcActive),n.state="active")}),0!==(e=m("#wpfooter")).length&&(o=m("#wpforms-overview, #wpforms-entries-list, #wpforms-tools.wpforms-tools-tab-action-scheduler"),i=e.offset().top,s=i+e.height(),a=0<o.length?o.offset().top+o.height()+85:0,m(window).on("resize scroll",_.debounce(function(e){var t=m(window).scrollTop(),n=t+m(window).height();s<=n&&t<=i&&n<a?r.addClass("out"):r.removeClass("out")},50)),m(window).trigger("scroll")))},initLity:function(){m(document).on("lity:ready",function(e,t){var n=t.element(),t=t.opener(),t=void 0!==t?t.data("lity-srcset"):"";void 0!==t&&""!==t&&n.find(".lity-content img").attr("srcset",t)})},isFormTypeNode:function(e){return"TEXTAREA"===(e=e||!1)||"INPUT"===e||"SELECT"===e},getQueryString:function(e){e=new RegExp("[?&]"+e+"=([^&]*)").exec(window.location.search);return e&&decodeURIComponent(e[1].replace(/\+/g," "))},debug:function(e){p.isDebug()&&("object"==typeof e||e.constructor===Array?(console.log("WPForms Debug:"),console.log(e)):console.log("WPForms Debug: "+e))},isDebug:function(){return window.location.hash&&"#wpformsdebug"===window.location.hash}};p.init(),window.WPFormsAdmin=p}(jQuery);