!function(e){formintorjs.define(["admin/builder/sidebar/advanced-settings"],function(e){return Backbone.View.extend({className:"wpmudev-options--wrap",tab:!1,field:!1,field_settings:!1,nested_settings:["ToggleContainer","RadioContainer","Accordion","MultiName","Product","ProductVar","ColDouble"],initialize:function(e){return this.tab=e.tab,this.field=e.field,this.field_settings=e.field_settings,this.render()},render:function(){var t=this;if(this.$el.html(""),"Advanced"===this.tab){var i=new e({model:this.model,field:this.field,field_settings:this.field_settings});t.$el.append(i.$el)}if(void 0!==this.field_settings.settings){var n="Advanced"===this.tab?this.field_settings.advanced_settings:this.field_settings.settings;0!==_.size(n)&&_.each(n,function(e){if(!_.isFunction(Forminator.Settings[e.type]))return void console.log("Field setting doesnt exist");var i=t.add_setting(e,t.field);_.contains(t.nested_settings,e.type)&&_.each(e.fields,function(n,a){var s=t.add_setting(n,t.field);_.contains(t.nested_settings,n.type)&&_.each(n.fields,function(e,i){var a=t.add_setting(e,t.field);s.$el.find(t.get_setting_class(n.type,e.tab?e.tab:"")).append(a.$el)}),i.$el.find(t.get_setting_class(e.type,n.tab?n.tab:"")).append(s.$el)}),t.$el.append(i.$el)})}},add_setting:function(e,t){var i=this;return new Forminator.Settings[e.type]({model:t,layout:i.model,id:e.id,name:e.name,label:e.label||"",show_title:e.show_title||!1,hide_label:e.hide_label||!1,dateFormat:e.dateFormat||"",containerClass:e.containerClass||"",has_content:e.has_content||!1,default_value:e.default_value||"",previewOnly:e.previewOnly||!1,hasPreview:e.hasPreview||!1,hasOpposite:e.hasOpposite||!1,setting_to_check:e.setting_to_check||"",value_to_show:e.value_to_show||"",ajax:e.ajax||!1,min:e.min||"",max:e.max||"",ajax_action:e.ajax_action||!1,values:e.values,on_change:function(e){i.render_fields()}})},get_setting_class:function(e,t){var i;switch(e){case"Product":i=".wpmudev-product";break;case"ProductVar":i=".wpmudev-product--var";break;case"ColDouble":i=".wpmudev-option--half";break;case"MultiName":i=".wpmudev-multiname--content";break;case"RadioContainer":i=".wpmudev-radio-tab-"+t;break;case"Accordion":i=".wpmudev-accordion--section";break;case"MultiName":i=".wpmudev-field--content";break;default:i=".wpmudev-option--switch_content"}return i},render_fields:function(){Forminator.Events.trigger("sidebar:settings:updated",this.field)}})})}(jQuery);