!function(t){formintorjs.define(["admin/models","admin/views","admin/settings","text!admin/templates/builder.html","text!admin/templates/appearance.html","text!admin/templates/polls.html","text!admin/templates/quizzes.html"],function(e,i,a,r,l,n,o){return _.extend(Forminator,e),_.extend(Forminator,i),_.extend(Forminator,a),new(Backbone.Router.extend({app:!1,data:!1,layout:!1,routes:{"":"run",appearance:"run_appearance","*path":"run"},events:{},init:function(){if(!this.data)if(this.app=Forminator.Data.application||!1,this.data=t.extend(!0,{},Forminator.Data.currentForm)||{},"builder"===this.app)this.model=new Forminator.Models.Builder(this.data);else if("poll"===this.app)this.model=new Forminator.Models.Poll(this.data);else{if("knowledge"!==this.app&&"nowrong"!==this.app)return!1;this.model=new Forminator.Models.Quiz(this.data)}},run:function(){this.init(),"builder"===this.app?this.start_builder():"poll"===this.app?this.start_poll():"knowledge"!==this.app&&"nowrong"!==this.app||this.start_quiz()},run_appearance:function(t){this.app&&"builder"===this.app||this.navigate("",{trigger:!0}),this.init(),this.start_appearance()},start_builder:function(){t(".wpmudev-form-wizard").empty().html(Forminator.Utils.template(t(r).find("#builder-layout-tpl").html())),this.builder&&(this.builder.fields_panel&&(this.builder.fields_panel.off(),this.builder.fields_panel.remove()),this.builder.off(),this.builder.remove()),this.builder=new Forminator.Views.Builder.Builder({model:this.model,el:".wpmudev-form-builder"}),this.update_builder_width()},start_appearance:function(){t(".wpmudev-form-wizard").empty().html(Forminator.Utils.template(t(l).find("#appearance-layout-tpl").html())),this.appearance&&this.appearance.remove(),this.appearance=new Forminator.Views.Builder.Appearance({model:this.model,el:".forminator-appearance-content"}),this.update_builder_width()},start_poll:function(){t(".wpmudev-poll-wizard").empty().html(Forminator.Utils.template(t(n).find("#polls-layout-tpl").html())),this.poll&&this.poll.remove(),this.poll=new Forminator.Views.Polls({model:this.model,el:".forminator-polls-content"})},start_quiz:function(){t(".wpmudev-quiz-wizard").empty().html(Forminator.Utils.template(t(o).find("#quiz-layout-tpl").html())),this.quiz&&this.quiz.remove(),this.quiz=new Forminator.Views.Quizzes({model:this.model,el:".forminator-quizzes-content"})},update_builder_width:function(){var e=t(".wpmudev-form-wizard"),i=t("#forminator-wizard-name"),a=t("#wpmudev-sidebar");e.css({width:"100%"});var r=a.width(),l=e.width();e.width(l-r+20),i.width(l-r+20)}}))})}(jQuery);