/*!
 * bootstrap-tabs-x v1.3.6
 * http://plugins.krajee.com/tabs-x
 *
 * Krajee jQuery plugin for bootstrap-tabs-x.
 *
 * Author: Kartik Visweswaran
 * Copyright: 2014 - 2021, Kartik Visweswaran, Krajee.com
 *
 * Licensed under the BSD 3-Clause
 * https://github.com/kartik-v/bootstrap-tabs-x/blob/master/LICENSE.md
 */
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof module&&"object"==typeof module.exports?require("jquery"):window.jQuery)}(function(t){"use strict";t.fn.tabsXBsVersion||(t.fn.tabsXBsVersion=window.bootstrap&&window.bootstrap.Tab&&bootstrap.Tab.VERSION||window.Tab&&window.Tab.VERSION||"3.x.x");var e,a;e={isEmpty:function(e,a){return null===e||void 0===e||0===e.length||a&&""===t.trim(e)},isBs:function(e){var a=t.trim((t.fn.tabsXBsVersion||"")+"");return e=parseInt(e,10),a?e===parseInt(a.charAt(0),10):4===e},getDataAttr:function(t){return"data-"+(e.isBs(5)?"bs-":"")+t}},a=function(e,a){var n=this;n.$element=t(e),n.init(a),n.listen()},a.prototype={constructor:a,init:function(a){var n=this,i=n.$element;t.each(a,function(t,e){n[t]=e}),n.initCache(),n.enableCache=!!n.enableCache,e.isEmpty(n.addCss)||i.hasClass(n.addCss)||i.addClass(n.addCss),n.$pane=i.find(".tab-pane.active"),n.$content=i.find(".tab-content"),n.$tabs=i.find(".nav-tabs"),n.isVertical=i.hasClass("tabs-left")||i.hasClass("tabs-right"),n.isVerticalSide=n.isVertical&&i.hasClass("tab-sideways"),n.initVertical()},initVertical:function(){var t=this;t.isVertical&&t.$content.css("min-height",t.$tabs.outerHeight()+1+"px")},setTitle:function(a){var n=this,i=t.trim(a.text()),s=n.isVertical,c=e.isEmpty(a.data("maxTitleLength"))?n.maxTitleLength:a.data("maxTitleLength");s&&i.length>c-2&&e.isEmpty(a.attr("title"))&&a.attr("title",i)},listen:function(){var a=this,n=a.$element,i=e.getDataAttr("toggle");console.log("KV SAYS",i),n.find(".nav-tabs li.disabled").each(function(){t(this).find("["+i+'="tab"]').removeAttr(i)}),n.find(".nav-tabs li ["+i+'="dropdown"]').each(function(){a.setTitle(t(this))}),n.find(".nav-tabs li").on("click",function(){setTimeout(function(){a.initVertical()},1e3)}),n.find(".nav-tabs li ["+i+'="tab"]').each(function(){var n=t(this),s=n.closest("li");s.removeAttr(i),a.setTitle(n),n.on("click",function(i){if(s.hasClass("disabled"))return void i.preventDefault();var c,r=t(this).attr("data-url"),o=this.hash,l=r+o;if(e.isEmpty(r)||a.enableCache&&a.cache.exist(l))return void n.trigger("tabsX:click");i.preventDefault();var u=t(o),f=t(this),d=f,h=t(this).attr("data-loading-class")||"kv-tab-loading",b=f.closest(".dropdown"),p=a.successCallback[o]||null,g=a.errorCallback[o]||null;e.isEmpty(b.attr("class"))||(d=b.find(".dropdown-toggle")),c=t.extend(!0,{},{type:"post",dataType:"json",url:r,beforeSend:function(t,e){u.html("<br><br><br>"),d.removeClass(h).addClass(h),n.trigger("tabsX:beforeSend",[t,e])},success:function(t,e,i){setTimeout(function(){u.html(t),f.tab("show"),d.removeClass(h),a.enableCache&&a.cache.set(l),p&&"function"==typeof p&&p(t,e,i),n.trigger("tabsX:success",[t,e,i])},300)},error:function(t,e,a){g&&"function"==typeof g&&g(t,e,a),n.trigger("tabsX:error",[t,e,a])},complete:function(t,e){n.trigger("tabsX:click",[t,e])}},a.ajaxSettings),t.ajax(c)})})},initCache:function(){var t=this,e=parseFloat(t.cacheTimeout);isNaN(e)&&(e=0),t.cache={data:{},create:function(){return(new Date).getTime()},exist:function(a){return!!t.cache.data[a]&&t.cache.create()-t.cache.data[a]<e},set:function(e){t.cache.data[e]=t.cache.create()}}},flushCache:function(t){var a=this;"string"==typeof t&&(t=[t]),"object"!=typeof t||e.isEmpty(t)?a.cache.data={}:Object.values(t).forEach(function(t){Object.keys(a.cache.data).forEach(function(e){e.endsWith(t)&&delete a.cache.data[e]})})}},t.fn.tabsX=function(e){var n=Array.apply(null,arguments),i=[];switch(n.shift(),this.each(function(){var s=t(this),c=s.data("tabsX"),r="object"==typeof e&&e;c||(c=new a(this,t.extend(!0,{},t.fn.tabsX.defaults,r,t(this).data())),s.data("tabsX",c)),"string"==typeof e&&i.push(c[e].apply(c,n))}),i.length){case 0:return this;case 1:return i[0];default:return i}},t.fn.tabsX.defaults={enableCache:!0,cacheTimeout:3e5,maxTitleLength:9,ajaxSettings:{},successCallback:{},errorCallback:{},addCss:"tabs-krajee"},t.fn.tabsX.Constructor=a,t(document).ready(function(){t(".tabs-x").tabsX({})})});