text: /*! Widget: grouping - updated 3/5/2015 (v2.21.0) */
  ;(function(b){var a=b.tablesorter;a.grouping={types:{number:function(j,i,d,e,h){var f,g;if(e>1&&d!==""){if(i.hasClass(a.css.sortAsc)){f=Math.floor(parseFloat(d)/e)*e;return f>parseFloat(h||0)?f:parseFloat(h||0)}else{f=Math.ceil(parseFloat(d)/e)*e;return f<parseFloat(h||e)-f?parseFloat(h||e)-f:f}}else{g=(d+"").match(/\d+/g);return g&&g.length>=e?g[e-1]:d||""}},separator:function(h,g,d,e){var f=(d+"").split(h.widgetOptions.group_separator);return b.trim(f&&e>0&&f.length>=e?f[(e||1)-1]:"")},word:function(h,g,d,e){var f=(d+" ").match(/\w+/g);return f&&f.length>=e?f[e-1]:d||""},letter:function(g,f,d,e){return d?(d+" ").substring(0,e):""},date:function(k,j,d,f,i){var g=k.widgetOptions,h=new Date(d||""),e=h.getHours();return f==="year"?h.getFullYear():f==="month"?g.group_months[h.getMonth()]:f==="monthyear"?g.group_months[h.getMonth()]+" "+h.getFullYear():f==="day"?g.group_months[h.getMonth()]+" "+h.getDate():f==="week"?g.group_week[h.getDay()]:f==="time"?("00"+(e>12?e-12:e===0?e+12:e)).slice(-2)+":"+("00"+h.getMinutes()).slice(-2)+" "+("00"+g.group_time[e>=12?1:0]).slice(-2):g.group_dateString(h)}},update:function(s,i,n){if(b.isEmptyObject(i.cache)){return}var j,k,q,p,h,f,m,r,l,e=n.grouping_language,o="",d=false,g=i.sortList[0]?i.sortList[0][0]:-1;i.$table.find("tr.group-hidden").removeClass("group-hidden").end().find("tr.group-header").remove();if(n.group_collapsible){i.$table.data("pagerSavedHeight",0)}if(g>=0&&!i.$headerIndexed[g].hasClass("group-false")){n.group_currentGroup="";n.group_currentGroups={};h=(i.$headerIndexed[g].attr("class")||"").match(/(group-\w+(-\w+)?)/g);f=h?h[0].split("-"):["group","letter",1];if(n.group_collapsible&&n.group_saveGroups&&a.storage){n.group_currentGroups=a.storage(s,"tablesorter-groups")||{};l=(f[1]==="number"&&f[2]>1)?"dir"+i.sortList[0][1]:"";r=n.group_currentGroup=""+g+l+f.join("");if(!n.group_currentGroups[r]){n.group_currentGroups[r]=[]}else{d=true}}for(k=0;k<i.$tbodies.length;k++){m=i.cache[k].normalized;o="";p=i.$tbodies.eq(k).children("tr").not("."+i.cssChildRow);for(j=0;j<p.length;j++){if(p.eq(j).is(":visible")){if(a.grouping.types[f[1]]){q=m[j]?a.grouping.types[f[1]](i,i.$headerIndexed[g],m[j][g],/date/.test(h)?f[2]:parseInt(f[2]||1,10)||1,o,e):q;if(o!==q){o=q;if(f[1]==="number"&&f[2]>1&&q!==""){q+=" - "+(parseInt(q,10)+((parseInt(f[2],10)-1)*(i.$headerIndexed[g].hasClass(a.css.sortAsc)?1:-1)))}if(b.isFunction(n.group_formatter)){q=n.group_formatter((q||"").toString(),g,s,i,n)||q}p.eq(j).before('<tr class="group-header '+i.selectorRemove.slice(1)+'" unselectable="on"><td colspan="'+i.columns+'">'+(n.group_collapsible?"<i/>":"")+'<span class="group-name">'+q+'</span><span class="group-count"></span></td></tr>');if(n.group_saveGroups&&!d&&n.group_collapsed&&n.group_collapsible){n.group_currentGroups[n.group_currentGroup].push(q)}}}}}}i.$table.find("tr.group-header").bind("selectstart",false).each(function(){var w,t,v,c=b(this),u=c.nextUntil("tr.group-header").filter(":visible");if(n.group_count||b.isFunction(n.group_callback)){t=c.find(".group-count");if(t.length){if(n.group_count){t.html(n.group_count.replace(/\{num\}/g,u.length))}if(b.isFunction(n.group_callback)){n.group_callback(c.find("td"),u,g,s)}}}if(n.group_saveGroups&&n.group_currentGroups.length&&n.group_currentGroups[n.group_currentGroup].length){v=c.find(".group-name").text().toLowerCase();w=b.inArray(v,n.group_currentGroups[n.group_currentGroup])>-1;c.toggleClass("collapsed",w);u.toggleClass("group-hidden",w)}else{if(n.group_collapsed&&n.group_collapsible){c.addClass("collapsed");u.addClass("group-hidden")}}});i.$table.trigger(n.group_complete)}},bindEvents:function(e,f,d){if(d.group_collapsible){d.group_currentGroups=[];f.$table.on("click toggleGroup","tr.group-header",function(j){j.stopPropagation();var c,h,i,k=b(this),g=k.find(".group-name").text().toLowerCase();if(j.type==="click"&&j.shiftKey){k.siblings(".group-header").trigger("toggleGroup")}k.toggleClass("collapsed");k.nextUntil("tr.group-header").toggleClass("group-hidden",k.hasClass("collapsed"));if(d.group_saveGroups&&a.storage){h=f.$table.find(".group-header");c=k.hasClass("collapsed");if(!d.group_currentGroups[d.group_currentGroup]){d.group_currentGroups[d.group_currentGroup]=[]}if(c&&d.group_currentGroup){d.group_currentGroups[d.group_currentGroup].push(g)}else{if(d.group_currentGroup){i=b.inArray(g,d.group_currentGroups[d.group_currentGroup]);if(i>-1){d.group_currentGroups[d.group_currentGroup].splice(i,1)}}}a.storage(e,"tablesorter-groups",d.group_currentGroups)}})}b(d.group_saveReset).on("click",function(){a.grouping.clearSavedGroups(e)});f.$table.on("pagerChange.tsgrouping",function(){a.grouping.update(e,f,d)})},clearSavedGroups:function(c){if(c&&a.storage){a.storage(c,"tablesorter-groups","");a.grouping.update(c,c.config,c.config.widgetOptions)}}};a.addWidget({id:"group",priority:100,options:{group_collapsible:true,group_collapsed:false,group_saveGroups:true,group_saveReset:null,group_count:" ({num})",group_separator:"-",group_formatter:null,group_callback:null,group_complete:"groupingComplete",group_checkbox:["checked","unchecked"],group_months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],group_week:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],group_time:["AM","PM"],group_dateString:function(c){return c.toLocaleString()}},init:function(f,e,g,d){a.grouping.bindEvents(f,g,d)},format:function(e,f,d){a.grouping.update(e,f,d)},remove:function(e,f,d){f.$table.off("click","tr.group-header").off("pagerChange.tsgrouping").find(".group-hidden").removeClass("group-hidden").end().find("tr.group-header").remove()}})})(jQuery);