!function(e){formintorjs.define(["admin/popup/templates","admin/popup/login","admin/popup/quizzes","admin/popup/schedule","admin/popup/new-form","admin/popup/ajax","admin/popup/delete"],function(o,n,p,t,i,a,r){var s=Backbone.View.extend({el:"#wpmudev-main",events:{"click .wpmudev-open-modal":"open_modal","click .wpmudev-button-open-modal":"open_modal"},initialize:function(){var e=Forminator.Utils.get_url_param("new"),o=Forminator.Utils.get_url_param("title");if(e){var n=new i({title:o});n.render(),this.open_popup(n,Forminator.l10n.popup.congratulations)}return this.render()},render:function(){return this},open_modal:function(o){o.preventDefault();var n=e(o.target);e(o.target).closest(".wpmudev-split--item");n.hasClass("wpmudev-open-modal")||n.hasClass("wpmudev-button-open-modal")||(n=n.closest(".wpmudev-open-modal"));var p=n.data("modal"),t=n.data("nonce"),i=n.data("form-id"),a=n.data("modal-title");switch(p){case"custom_forms":this.open_cform_popup();break;case"login_registration_forms":this.open_login_popup();break;case"polls":this.open_polls_popup();break;case"quizzes":this.open_quizzes_popup();break;case"exports":this.open_settings_modal(p,t,i,Forminator.l10n.popup.your_exports);break;case"exports-schedule":this.open_exports_schedule_popup();break;case"delete-module":this.open_delete_popup(i,t);break;case"paypal":this.open_settings_modal(p,t,i,Forminator.l10n.popup.paypal_settings);break;case"preview_cforms":_.isUndefined(a)&&(a=Forminator.l10n.popup.preview_cforms),this.open_settings_modal(p,t,i,a);break;case"preview_polls":_.isUndefined(a)&&(a=Forminator.l10n.popup.preview_polls),this.open_settings_modal(p,t,i,a);break;case"preview_quizzes":_.isUndefined(a)&&(a=Forminator.l10n.popup.preview_quizzes),this.open_settings_modal(p,t,i,a);break;case"captcha":this.open_settings_modal(p,t,i,Forminator.l10n.popup.captcha_settings);break;case"currency":this.open_settings_modal(p,t,i,Forminator.l10n.popup.currency_settings);break;case"pagination_entries":this.open_settings_modal(p,t,i,Forminator.l10n.popup.pagination_entries);break;case"pagination_listings":this.open_settings_modal(p,t,i,Forminator.l10n.popup.pagination_listings);break;case"uninstall_settings":this.open_settings_modal(p,t,i,Forminator.l10n.popup.uninstall_settings)}},open_popup:function(o,n){_.isUndefined(n)&&(n=Forminator.l10n.custom_form.popup_label),Forminator.Popup.open(function(){_.isUndefined(o.el)?e(this).append(o):e(this).append(o.el)},{title:n})},open_ajax_popup:function(o,n,p,t){_.isUndefined(t)&&(t=Forminator.l10n.custom_form.popup_label);var i=new a({action:o,nonce:n,id:p});Forminator.Popup.open(function(){e(this).append(i.el)},{title:t})},open_cform_popup:function(){var e=Forminator.Data.modules.custom_form.new_form_url;window.location.href=e},open_delete_popup:function(e,o){var n=new r({id:e,nonce:o,referrer:window.location.pathname+window.location.search});n.render(),this.open_popup(n,Forminator.l10n.popup.are_you_sure)},open_login_popup:function(){var e=new n;e.render(),this.open_popup(e,Forminator.l10n.popup.edit_login_form)},open_polls_popup:function(){var e=Forminator.Data.modules.polls.new_form_url;window.location.href=e},open_quizzes_popup:function(){var e=new p;e.render(),this.open_popup(e,Forminator.l10n.popup.quiz_type)},open_exports_schedule_popup:function(){var e=new t;e.render(),this.open_popup(e,Forminator.l10n.popup.edit_scheduled_export)},open_settings_modal:function(e,o,n,p){this.open_ajax_popup(e,o,n,p)}});jQuery(document).ready(function(){new s})})}(jQuery);