!function(t){formintorjs.define(["text!tpl/dashboard.html"],function(a){return Backbone.View.extend({className:"wpmudev-section--popup",events:{"click .wpmudev-action-done":"save","click .wpmudev-button-clear-exports":"clear_exports","click .forminator-radio--field":"show_poll_custom_input"},initialize:function(t){return this.action=t.action,this.nonce=t.nonce,this.data=t.data,this.id=t.id,this.render()},render:function(){var a=this,i={};i.action="forminator_load_"+this.action+"_popup",i._ajax_nonce=this.nonce,i.data=this.data,this.id&&(i.id=this.id),a.$el.html('<div class="preloader"><div class="wpmudev-loading"></div></div>'),a.$el.find(".preloader .wpmudev-loading").css({width:"32px",height:"32px"}),t.post(Forminator.Data.ajaxUrl,i).done(function(t){if(t&&t.success){a.$el.html(t.data),a.$el.find(".wpmudev-hidden-popup").show(400),Forminator.Utils.init_select2();var i=a.$el.find(".forminator-custom-form");i.length>0&&Forminator.Pagination.init(i),a.delegateEvents()}}).always(function(){a.$el.find(".preloader").remove()})},save:function(a){a.preventDefault();var i={},n=t(a.target).data("nonce");i.action="forminator_save_"+this.action+"_popup",i._ajax_nonce=n,t(".wpmudev-popup-form input, .wpmudev-popup-form select").each(function(){var a=t(this);i[a.attr("name")]=a.val()}),t.ajax({url:Forminator.Data.ajaxUrl,type:"POST",data:i,success:function(t){Forminator.Popup.close(!1,function(){window.location.reload()})}})},clear_exports:function(a){a.preventDefault();var i={},n=this,e=t(a.target).data("nonce"),o=t(a.target).data("form-id");i.action="forminator_clear_"+this.action+"_popup",i._ajax_nonce=e,i.id=o,t.ajax({url:Forminator.Data.ajaxUrl,type:"POST",data:i,success:function(){n.render()}})},show_poll_custom_input:function(a){var i=this,n=this.$el.find(".forminator-input"),e=a.target.checked,o=t(a.target).attr("id");if(n.hide(),i.$el.find(".forminator-input#"+o+"-extra").length){var r=i.$el.find(".forminator-input#"+o+"-extra");e?r.show():r.hide()}}})})}(jQuery);