!function(l){"use strict";var m,p={settings:{iconActivate:'',iconDeactivate:'',iconInstall:'',iconSpinner:'',mediaFrame:!1},init:function(){m=this.settings,l(p.ready),p.initEntriesSingle(),p.initEntriesList(),p.initWelcome(),l(document).on("wpformsReady",p.initAddons),p.initSettings(),p.initTools(),p.initUpgrades(),p.initScrollableMenu()},ready:function(){l.ajaxSetup({data:{_wp_http_referer:wpf.updateQueryString("_wp_http_referer",null)}}),p.scrollToIntegration(),l(".notice").show(),l("#screen-meta-links, #screen-meta").prependTo("#wpforms-header-temp").show(),p.initChoicesJS(),l(document).on("htmx:afterSwap",p.initChoicesJS),p.initCheckboxMultiselectColumns(),l(".wpforms-color-picker").each(function(){var e=l(this);e.minicolors({defaultValue:e.data("fallback-color")||""})}),l(".wpforms-file-upload").each(function(){var e=l(this).find("input[type=file]"),n=l(this).find("label"),o=n.html();e.on("change",function(e){var t="";this.files&&1 ${"addon"===t?wpforms_admin.addon_error:wpforms_admin.plugin_error} '+wpforms_admin.addon_error+" '+wpforms_admin.plugin_error+" '+e.data+" '),(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")}}))})},initEntriesSingle:function(){"wpforms-entries"===p.getQueryString("page")&&"details"===p.getQueryString("view")&&p.entryHotkeys(),l(document).on("click","#wpforms-entries-single .wpforms-entry-delete a",function(e){e.preventDefault();const t=l(this).attr("href");l.confirm({title:wpforms_admin.heads_up,content:wpforms_admin.entry_delete_confirm,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"]}}})}),l(document).on("click","#wpforms-entries-single .trash",function(e){e.preventDefault();const t=l(this).attr("href");l.confirm({title:wpforms_admin.heads_up,content:wpforms_admin.entry_trash_confirm,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"],action:()=>{window.location=t}},cancel:{text:wpforms_admin.cancel,keys:["esc"]}}})}),l(document).on("click","#wpforms-entries-single .wpforms-entry-print a",function(e){e.preventDefault(),window.open(l(this).attr("href"))}),l(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"),l(this).text(wpforms_admin.entry_empty_fields_hide)):(wpCookies.set("wpforms_entry_hide_empty","true",2592e3),l(this).text(wpforms_admin.entry_empty_fields_show)),l(".wpforms-entry-field.empty, .wpforms-edit-entry-field.empty").toggle()}),l(document).on("click","#wpforms-entries-single .wpforms-entry-notes-new .add",function(e){e.preventDefault(),l(this).hide().next("form").stop().slideToggle()}),l(document).on("click","#wpforms-entries-single .wpforms-entry-notes-new .cancel",function(e){e.preventDefault(),l(this).closest("form").stop().slideToggle(),l(".wpforms-entry-notes-new .add").show()}),l(document).on("click","#wpforms-entries-single .wpforms-entry-notes-byline .note-delete",function(e){e.preventDefault();var t=l(this).attr("href");l.confirm({title:wpforms_admin.heads_up,content:wpforms_admin.entry_note_delete_confirm,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(){l(document).on("keydown",function(e){74!==e.keyCode||e.metaKey||p.isFormTypeNode(e.target.nodeName)?75!==e.keyCode||e.metaKey||p.isFormTypeNode(e.target.nodeName)||"#"!==(e=l("#wpforms-admin-single-navigation-next-link").attr("href"))&&(window.location.href=e):"#"!==(e=l("#wpforms-admin-single-navigation-prev-link").attr("href"))&&(window.location.href=e)})},initWelcome:function(){l(document).on("click","#wpforms-welcome .play-video",function(e){e.preventDefault();l.dialog({title:!1,content:'',closeIcon:!0,boxWidth:"70%"})})},initAddons:function(){if(l("#wpforms-admin-addons").length){var n=l("#wpforms-addons-list-section-all"),o=l("#wpforms-addons-list-section-installed");if(n.length||o.length){let e,t;o.length&&(e=new List("wpforms-addons-list-section-installed",{valueNames:["addon-link"]})),n.length&&(t=new List("wpforms-addons-list-section-all",{valueNames:["addon-link"]})),l("#wpforms-addons-search").on("keyup search",function(){p.updateAddonSearchResult(this,t,e)})}l(document).on("change",".wpforms-addons-list-item .wpforms-toggle-control input",function(e){if(e.preventDefault(),l(this).hasClass("disabled"))return!1;p.addonToggleNew(l(this))}),l(document).on("click",".wpforms-addons-list-item button",function(e){if(e.preventDefault(),l(this).hasClass("disabled"))return!1;p.addonToggleNew(l(this))}),l(document).on("click","#wpforms-admin-addons .addon-item button",function(e){if(e.preventDefault(),l(this).hasClass("disabled"))return!1;p.addonToggle(l(this))})}},updateAddonSearchResult(e,t,n){let o=l(e).val();o=o.replace(/[.,]/g," ");var e=l("#wpforms-addons-no-results"),i=l("#wpforms-addons-list-section-all"),s=l("#wpforms-addons-list-section-installed"),t=t?t.search(o):[],n=n?n.search(o):[];e.toggle(0===t.length&&0===n.length),i.toggle(0
"+e.data.error_msg),p.integrationError(s))}).fail(function(){p.integrationError(s)}).always(function(){t.html(n).css("width","auto").prop("disabled",!1)})},integrationDisconnect:function(e){var n=l(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;l.confirm({title:wpforms_admin.heads_up,content:wpforms_admin.provider_delete_confirm,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){l.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"),l(document).trigger("wpformsProviderRemoved",[o,e])):(Object.prototype.hasOwnProperty.call(e,"data")&&Object.prototype.hasOwnProperty.call(e.data,"error_msg")&&(i+="
"+e.data.error_msg),p.integrationError(i))}).fail(function(){p.integrationError(i)})}},cancel:{text:wpforms_admin.cancel,keys:["esc"]}}})},integrationError:function(e){l.alert({title:wpforms_admin.something_went_wrong,content:e,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}})},initTools(){l(document).on("change","#wpforms-tools-form-import, #wpforms-tools-form-other-import, #wpforms-tools-form-export, #wpforms-tools-form-template",function(){var e=l(this);e.parents("form").find("button").attr("aria-disabled",0===e.val().length)}),l(document).on("click","#wpforms-system-information-copy",function(e){e.preventDefault(),p.copySystemInformation()}),l(document).on("click","#wpforms-ssl-verify",function(e){e.preventDefault(),p.verifySSLConnection()}),l(document).on("click","#wpforms-recreate-tables",function(e){e.preventDefault(),p.recreateTables()}),l(document).on("click","#wpforms-importer-forms-submit",function(e){if(e.preventDefault(),l("#wpforms-importer-forms input:checked").length){const t=[];l("#wpforms-importer-forms input:checked").each(function(e){t[e]=l(this).val()}),wpforms_admin.isPro?p.importForms(t):p.analyzeForms(t)}else l.alert({title:wpforms_admin.heads_up,content:wpforms_admin.importer_forms_required,icon:"fa fa-info-circle",type:"blue",buttons:{confirm:{text:wpforms_admin.ok,btnClass:"btn-confirm",keys:["enter"]}}})}),l(document).on("click","#wpforms-importer-continue-submit",function(e){e.preventDefault(),p.importForms(m.formIDs)})},copySystemInformation(){l("#wpforms-system-information").select(),document.execCommand("copy")},verifySSLConnection(){const t=l("#wpforms-ssl-verify"),n=t.text(),o=t.outerWidth(),i=t.parent();t.css("width",o).prop("disabled",!0).text(wpforms_admin.testing);var e={action:"wpforms_verify_ssl",nonce:wpforms_admin.nonce};l.post(wpforms_admin.ajax_url,e,function(e){p.debug(e),i.find(".wpforms-notice").remove(),e.success&&t.before('