function maxTabs(){}maxTabs.prototype.init=function(){this.tabs(),this.previewTab()},maxTabs.prototype.tabs=function(){var a=".mb_tab";if(0!==$(a).length){var t=$("#maxbuttons").data("view");if(void 0===t&&(t="list"),"list"!=t){$("#maxbuttons").addClass("mb_tabs_active"),0===$(".sub-tabs").length?($tabslocation=$('<h2 class="nav-tab-wrapper sub-tabs"></h2>'),$tabslocation.insertBefore($(a).first()),$tabslocation=$(".sub-tabs")):$tabslocation=$(".sub-tabs"),$(a).hide(),$.each($(a),function(){var a=$(this).children("div.title").first(),t=a.clone(),e=t.children("span:first").clone().wrap("<p>").parent().html(),i=t.children("span.title").text();$(t).children("span").remove(),$(t).children("input,button").remove(),a.children("span:first").remove(),a.children(".title").remove(),tab_title=void 0!==e?e+i:i;var s=$('<a class="nav-tab" href="javascript:void(0);">'+tab_title+"</a>");i=(i=i.trim()).replace(/ /g,"-"),$(s).attr("data-tab",i.toLowerCase()),$(".sub-tabs").append(s),$(this).attr("data-tab",i.toLowerCase())});var e=$('input[name="tab"]').val();void 0===e&&(e=""),""==e?($tabslocation.children(".nav-tab").first().addClass("nav-tab-active"),$(a).first().show()):($tabslocation.children('[data-tab="'+e+'"]').addClass("nav-tab-active"),$(a+'[data-tab="'+e+'"]').show()),$tabslocation.children("a").on("click",this.toggleTabs),this.addSaveTab($tabslocation)}}},maxTabs.prototype.addSaveTab=function(a){a.append('<div class="save-indicator dashicons dashicons-warning"></div>')},maxTabs.prototype.toggleTabs=function(a){a.preventDefault();$(".sub-tabs").children("a").removeClass("nav-tab-active"),$(this).addClass("nav-tab-active"),$(".mb_tab").hide();var t=$(this).data("tab");$('.mb_tab[data-tab="'+t+'"]').show(),$('input[name="tab"]').val(t),$(document).trigger("maxTabChange",[t])},maxTabs.prototype.previewTab=function(){$(".mb-preview-window").is(":visible");var a='.sub-tabs a[data-tab="preview"]';this.togglePreview(),$(a).off("click"),$(document).on("click",a,$.proxy(function(a){a.preventDefault(),a.stopPropagation();return $(".mb-preview-window").is(":visible")?this.togglePreview(!1):this.togglePreview(!0),$(document).trigger("updatePreviewWindow"),!1},this)),$(".mb-preview-window .close").on("click",{tab:a},function(a){$(a.data.tab).trigger("click")})},maxTabs.prototype.togglePreview=function(a){var t='.sub-tabs a[data-tab="preview"]';if(void 0===a)if(localStorage.getItem("mb-col-preview")){var e=localStorage.getItem("mb-col-preview");"string"==typeof e&&(e="true"==e),"boolean"==typeof e&&this.togglePreview(e)}else this.togglePreview(!0);else a?($(".mb-preview-window").show(),$(t).addClass(" preview-on"),$(t+" .dashicons").addClass("dashicons-yes").removeClass("dashicons-no"),$(t).removeClass("preview-off"),localStorage.setItem("mb-col-preview",!0)):($(".mb-preview-window").hide(),$(t).removeClass("preview-on"),$(t+" .dashicons").removeClass("dashicons-yes").addClass("dashicons-no"),$(t).addClass("preview-off"),localStorage.setItem("mb-col-preview",!1))};