summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jquery-latest.js10
-rw-r--r--jquery.tablesorter.js2902
-rw-r--r--jquery.tablesorter.widgets.js3182
-rw-r--r--parsers/parser-network.js50
-rw-r--r--tablesorter/first.pngbin720 -> 642 bytes
-rw-r--r--tablesorter/jquery.tablesorter.pager.css2
-rw-r--r--tablesorter/last.pngbin737 -> 661 bytes
-rw-r--r--tablesorter/next.pngbin736 -> 658 bytes
-rw-r--r--tablesorter/prev.pngbin745 -> 663 bytes
-rw-r--r--tablesorter/theme.black-ice.css2
-rw-r--r--tablesorter/theme.blue.css2
-rw-r--r--tablesorter/theme.bootstrap.css55
-rw-r--r--tablesorter/theme.bootstrap_2.css49
-rw-r--r--tablesorter/theme.dark.css2
-rw-r--r--tablesorter/theme.default.css2
-rw-r--r--tablesorter/theme.dropbox.css8
-rw-r--r--tablesorter/theme.green.css2
-rw-r--r--tablesorter/theme.grey.css5
-rw-r--r--tablesorter/theme.ice.css2
-rw-r--r--tablesorter/theme.jui.css2
-rw-r--r--widgets/widget-pager.js1373
21 files changed, 7576 insertions, 74 deletions
diff --git a/jquery-latest.js b/jquery-latest.js
index 0f60b7b..e836475 100644
--- a/jquery-latest.js
+++ b/jquery-latest.js
@@ -1,5 +1,5 @@
-/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
-
-return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ca()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ca()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?aa:ba):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=aa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=aa,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=aa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=ba;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ba),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function da(a){var b=ea.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var ea="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fa=/ jQuery\d+="(?:null|\d+)"/g,ga=new RegExp("<(?:"+ea+")[\\s/>]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/<tbody/i,la=/<|&#?\w+;/,ma=/<(?:script|style|link)/i,na=/checked\s*(?:[^=]|=\s*.checked.)/i,oa=/^$|\/(?:java|ecma)script/i,pa=/^true\/(.*)/,qa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ra={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?"<table>"!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\([^)]*\)/i,Na=/opacity\s*=\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp("^("+S+")(.*)$","i"),Qa=new RegExp("^([+-])=("+S+")","i"),Ra={position:"absolute",visibility:"hidden",display:"block"},Sa={letterSpacing:"0",fontWeight:"400"},Ta=["Webkit","O","Moz","ms"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fa(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),"normal"===f&&b in Sa&&(f=Sa[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Ma,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+" "+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Ja,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){
-return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$a=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_a||(_a=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_a),_a=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lb=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lb,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var ub=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vb=m.now(),wb=/\?/,xb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\/\//,Gb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hb={},Ib={},Jb="*/".concat("*");try{zb=location.href}catch(Kb){zb=y.createElement("a"),zb.href="",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:"GET",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+"").replace(Ab,"").replace(Fb,yb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yb[3]||("http:"===yb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,"$1_="+vb++):e+(wb.test(e)?"&":"?")+"_="+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jb+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\[\]$/,Sb=/\r?\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vb(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join("&").replace(Qb,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,"\r\n")}}):{name:b.name,value:c.replace(Sb,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&"withCredentials"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _b=[],ac=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_b.pop()||m.expando+"_"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ac.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,"$1"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
+/*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0;
+}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",j.childNodes[0].style.borderCollapse="separate",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ra(a),g=l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Sa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Oa.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+eb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{
+marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g,sb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(sb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>-1)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var tb,ub,vb=n.expr.attrHandle,wb=/^(?:checked|selected)$/i,xb=l.getSetAttribute,yb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ub:tb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?yb&&xb||!wb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(xb?c:d)}}),ub={set:function(a,b,c){return b===!1?n.removeAttr(a,c):yb&&xb||!wb.test(c)?a.setAttribute(!xb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=vb[b]||n.find.attr;yb&&xb||!wb.test(b)?vb[b]=function(a,b,d){var e,f;return d||(f=vb[b],vb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,vb[b]=f),e}:vb[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),yb&&xb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):tb&&tb.set(a,b,c)}}),xb||(tb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},vb.id=vb.name=vb.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:tb.set},n.attrHooks.contenteditable={set:function(a,b,c){tb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var zb=/^(?:input|select|textarea|button|object)$/i,Ab=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):zb.test(a.nodeName)||Ab.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Bb=/[\t\r\n\f]/g;function Cb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Cb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Cb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Cb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=Cb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Cb(c)+" ").replace(Bb," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Db=a.location,Eb=n.now(),Fb=/\?/,Gb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Gb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Hb=/#.*$/,Ib=/([?&])_=[^&]*/,Jb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Kb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Lb=/^(?:GET|HEAD)$/,Mb=/^\/\//,Nb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ob={},Pb={},Qb="*/".concat("*"),Rb=Db.href,Sb=Nb.exec(Rb.toLowerCase())||[];function Tb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Ub(a,b,c,d){var e={},f=a===Pb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Vb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Wb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Xb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Rb,type:"GET",isLocal:Kb.test(Sb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Qb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Vb(Vb(a,n.ajaxSettings),b):Vb(n.ajaxSettings,a)},ajaxPrefilter:Tb(Ob),ajaxTransport:Tb(Pb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Jb.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Rb)+"").replace(Hb,"").replace(Mb,Sb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Nb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Sb[1]&&d[2]===Sb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Sb[3]||("http:"===Sb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Ub(Ob,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Lb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Fb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Ib.test(f)?f.replace(Ib,"$1_="+Eb++):f+(Fb.test(f)?"&":"?")+"_="+Eb++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Qb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Ub(Pb,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Wb(l,w,d)),v=Xb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Yb(a){return a.style&&a.style.display||n.css(a,"display")}function Zb(a){if(!n.contains(a.ownerDocument||d,a))return!0;while(a&&1===a.nodeType){if("none"===Yb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Zb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var $b=/%20/g,_b=/\[\]$/,ac=/\r?\n/g,bc=/^(?:submit|button|image|reset|file)$/i,cc=/^(?:input|select|textarea|keygen)/i;function dc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||_b.test(a)?d(a,e):dc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)dc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)dc(c,a[c],b,e);return d.join("&").replace($b,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&cc.test(this.nodeName)&&!bc.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(ac,"\r\n")}}):{name:b.name,value:c.replace(ac,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?ic():d.documentMode>8?hc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&hc()||ic()}:hc;var ec=0,fc={},gc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in fc)fc[a](void 0,!0)}),l.cors=!!gc&&"withCredentials"in gc,gc=l.ajax=!!gc,gc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++ec;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete fc[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=fc[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function hc(){try{return new a.XMLHttpRequest}catch(b){}}function ic(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var jc=[],kc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=jc.pop()||n.expando+"_"+Eb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(kc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&kc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(kc,"$1"+e):b.jsonp!==!1&&(b.url+=(Fb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,jc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var lc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&lc)return lc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function mc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=mc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=mc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({
+padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var nc=a.jQuery,oc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=oc),b&&a.jQuery===n&&(a.jQuery=nc),n},b||(a.jQuery=a.$=n),n});
diff --git a/jquery.tablesorter.js b/jquery.tablesorter.js
index 9b6c90f..e072473 100644
--- a/jquery.tablesorter.js
+++ b/jquery.tablesorter.js
@@ -1,11 +1,11 @@
-/*! TableSorter (FORK) v2.22.1 *//*
+/*! TableSorter (FORK) v2.31.1 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
* Copyright (c) 2007 Christian Bach
* fork maintained by Rob Garrison
*
-* Examples and docs at: http://tablesorter.com
+* Examples and original docs at: http://tablesorter.com
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
@@ -15,8 +15,2900 @@
* @cat Plugins/Tablesorter
* @author Christian Bach - christian.bach@polyester.se
* @contributor Rob Garrison - https://github.com/Mottie/tablesorter
+* @docs (fork) - https://mottie.github.io/tablesorter/docs/
*/
/*jshint browser:true, jquery:true, unused:false, expr: true */
-/*global console:false, alert:false, require:false, define:false, module:false */
-!function(e){"use strict";e.extend({tablesorter:new function(){function t(){var e=arguments[0],t=arguments.length>1?Array.prototype.slice.call(arguments):e;"undefined"!=typeof console&&"undefined"!=typeof console.log?console[/error/i.test(e)?"error":/warn/i.test(e)?"warn":"log"](t):alert(t)}function r(e,r){t(e+" ("+((new Date).getTime()-r.getTime())+"ms)")}function s(e){for(var t in e)return!1;return!0}function a(r,s,a,n){for(var o,i,d=r.config,c=x.parsers.length,l=!1,p="",u=!0;""===p&&u;)a++,s[a]?(l=s[a].cells[n],p=x.getElementText(d,l,n),i=e(l),r.config.debug&&t("Checking if value was empty on row "+a+", column: "+n+': "'+p+'"')):u=!1;for(;--c>=0;)if(o=x.parsers[c],o&&"text"!==o.id&&o.is&&o.is(p,r,l,i))return o;return x.getParserById("text")}function n(e,t,r,s){"undefined"==typeof s&&(s=x.getElementText(e,t,r));var a=""+s,n=e.parsers[r],o=e.extractors[r];return n&&(o&&"function"==typeof o.format&&(s=o.format(s,e.table,t,r)),a="no-parser"===n.id?"":n.format(""+s,e.table,t,r),e.ignoreCase&&"string"==typeof a&&(a=a.toLowerCase())),a}function o(e){var s,n,o,i,d,c,l,p,u,g,f=e.config,h=f.$tbodies=f.$table.children("tbody:not(."+f.cssInfoBlock+")"),m=0,b="",y=h.length;if(0===y)return f.debug?t("Warning: *Empty table!* Not building a parser cache"):"";for(f.debug&&(g=new Date,t("Detecting parsers for each column")),n={extractors:[],parsers:[]};y>m;){if(s=h[m].rows,s.length)for(o=f.columns,i=0;o>i;i++)d=f.$headerIndexed[i],c=x.getColumnData(e,f.headers,i),u=x.getParserById(x.getData(d,c,"extractor")),p=x.getParserById(x.getData(d,c,"sorter")),l="false"===x.getData(d,c,"parser"),f.empties[i]=(x.getData(d,c,"empty")||f.emptyTo||(f.emptyToBottom?"bottom":"top")).toLowerCase(),f.strings[i]=(x.getData(d,c,"string")||f.stringTo||"max").toLowerCase(),l&&(p=x.getParserById("no-parser")),u||(u=!1),p||(p=a(e,s,-1,i)),f.debug&&(b+="column:"+i+"; extractor:"+u.id+"; parser:"+p.id+"; string:"+f.strings[i]+"; empty: "+f.empties[i]+"\n"),n.parsers[i]=p,n.extractors[i]=u;m+=n.parsers.length?y:1}f.debug&&(t(b?b:"No parsers detected"),r("Completed detecting parsers",g)),f.parsers=n.parsers,f.extractors=n.extractors}function i(s){var a,o,i,d,c,l,p,u,g,f,h,m,b,y=s.config,w=y.$tbodies,v=y.parsers;if(y.cache={},y.totalRows=0,!v)return y.debug?t("Warning: *Empty table!* Not building a cache"):"";for(y.debug&&(g=new Date),y.showProcessing&&x.isProcessing(s,!0),l=0;l<w.length;l++){for(b=[],a=y.cache[l]={normalized:[]},f=w[l]&&w[l].rows.length||0,d=0;f>d;++d)if(h={child:[],raw:[]},p=e(w[l].rows[d]),u=[],p.hasClass(y.cssChildRow)&&0!==d)for(o=a.normalized.length-1,m=a.normalized[o][y.columns],m.$row=m.$row.add(p),p.prev().hasClass(y.cssChildRow)||p.prev().addClass(x.css.cssHasChild),i=p.children("th, td"),o=m.child.length,m.child[o]=[],c=0;c<y.columns;c++)m.child[o][c]=n(y,i[c],c);else{for(h.$row=p,h.order=d,c=0;c<y.columns;++c)"undefined"!=typeof v[c]?(o=x.getElementText(y,p[0].cells[c],c),h.raw.push(o),i=n(y,p[0].cells[c],c,o),u.push(i),"numeric"===(v[c].type||"").toLowerCase()&&(b[c]=Math.max(Math.abs(i)||0,b[c]||0))):y.debug&&t("No parser found for cell:",p[0].cells[c],"does it have a header?");u[y.columns]=h,a.normalized.push(u)}a.colMax=b,y.totalRows+=a.normalized.length}y.showProcessing&&x.isProcessing(s),y.debug&&r("Building cache for "+f+" rows",g)}function d(e,t){var a,n,o,i,d,c,l,p=e.config,u=p.widgetOptions,g=p.$tbodies,f=[],h=p.cache;if(s(h))return p.appender?p.appender(e,f):e.isUpdating?p.$table.trigger("updateComplete",e):"";for(p.debug&&(l=new Date),c=0;c<g.length;c++)if(o=g.eq(c),o.length){for(i=x.processTbody(e,o,!0),a=h[c].normalized,n=a.length,d=0;n>d;d++)f.push(a[d][p.columns].$row),p.appender&&(!p.pager||p.pager.removeRows&&u.pager_removeRows||p.pager.ajax)||i.append(a[d][p.columns].$row);x.processTbody(e,i,!1)}p.appender&&p.appender(e,f),p.debug&&r("Rebuilt table",l),t||p.appender||x.applyWidget(e),e.isUpdating&&p.$table.trigger("updateComplete",e)}function c(e){return/^d/i.test(e)||1===e}function l(s){var a,n,o,i,d,l,p,g,f=s.config;for(f.headerList=[],f.headerContent=[],f.debug&&(p=new Date),f.columns=x.computeColumnIndex(f.$table.children("thead, tfoot").children("tr")),i=f.cssIcon?'<i class="'+(f.cssIcon===x.css.icon?x.css.icon:f.cssIcon+" "+x.css.icon)+'"></i>':"",f.$headers=e(e.map(e(s).find(f.selectorHeaders),function(t,r){return n=e(t),n.parent().hasClass(f.cssIgnoreRow)?void 0:(a=x.getColumnData(s,f.headers,r,!0),f.headerContent[r]=n.html(),""===f.headerTemplate||n.find("."+x.css.headerIn).length||(d=f.headerTemplate.replace(/\{content\}/g,n.html()).replace(/\{icon\}/g,n.find("."+x.css.icon).length?"":i),f.onRenderTemplate&&(o=f.onRenderTemplate.apply(n,[r,d]),o&&"string"==typeof o&&(d=o)),n.html('<div class="'+x.css.headerIn+'">'+d+"</div>")),f.onRenderHeader&&f.onRenderHeader.apply(n,[r,f,f.$table]),t.column=parseInt(n.attr("data-column"),10),t.order=c(x.getData(n,a,"sortInitialOrder")||f.sortInitialOrder)?[1,0,2]:[0,1,2],t.count=-1,t.lockedOrder=!1,l=x.getData(n,a,"lockedOrder")||!1,"undefined"!=typeof l&&l!==!1&&(t.order=t.lockedOrder=c(l)?[1,1,1]:[0,0,0]),n.addClass(x.css.header+" "+f.cssHeader),f.headerList[r]=t,n.parent().addClass(x.css.headerRow+" "+f.cssHeaderRow).attr("role","row"),f.tabIndex&&n.attr("tabindex",0),t)})),f.$headerIndexed=[],g=0;g<f.columns;g++)n=f.$headers.filter('[data-column="'+g+'"]'),f.$headerIndexed[g]=n.not(".sorter-false").length?n.not(".sorter-false").filter(":last"):n.filter(":last");e(s).find(f.selectorHeaders).attr({scope:"col",role:"columnheader"}),u(s),f.debug&&(r("Built headers:",p),t(f.$headers))}function p(e,t,r){var s=e.config;s.$table.find(s.selectorRemove).remove(),o(e),i(e),w(s,t,r)}function u(e){var t,r,s,a,n=e.config,o=n.$headers.length;for(t=0;o>t;t++)s=n.$headers.eq(t),a=x.getColumnData(e,n.headers,t,!0),r="false"===x.getData(s,a,"sorter")||"false"===x.getData(s,a,"parser"),s[0].sortDisabled=r,s[r?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+r),e.id&&(r?s.removeAttr("aria-controls"):s.attr("aria-controls",e.id))}function g(t){var r,s,a,n,o,i,d,c,l=t.config,p=l.sortList,u=p.length,g=x.css.sortNone+" "+l.cssNone,f=[x.css.sortAsc+" "+l.cssAsc,x.css.sortDesc+" "+l.cssDesc],h=[l.cssIconAsc,l.cssIconDesc,l.cssIconNone],m=["ascending","descending"],b=e(t).find("tfoot tr").children().add(e(l.namespace+"_extra_headers")).removeClass(f.join(" "));for(l.$headers.removeClass(f.join(" ")).addClass(g).attr("aria-sort","none").find("."+x.css.icon).removeClass(h.join(" ")).addClass(h[2]),a=0;u>a;a++)if(2!==p[a][1]&&(r=l.$headers.not(".sorter-false").filter('[data-column="'+p[a][0]+'"]'+(1===u?":last":"")),r.length)){for(n=0;n<r.length;n++)r[n].sortDisabled||r.eq(n).removeClass(g).addClass(f[p[a][1]]).attr("aria-sort",m[p[a][1]]).find("."+x.css.icon).removeClass(h[2]).addClass(h[p[a][1]]);b.length&&b.filter('[data-column="'+p[a][0]+'"]').removeClass(g).addClass(f[p[a][1]])}for(u=l.$headers.length,o=l.$headers.not(".sorter-false"),a=0;u>a;a++)i=o.eq(a),i.length&&(s=o[a],d=s.order[(s.count+1)%(l.sortReset?3:2)],c=e.trim(i.text())+": "+x.language[i.hasClass(x.css.sortAsc)?"sortAsc":i.hasClass(x.css.sortDesc)?"sortDesc":"sortNone"]+x.language[0===d?"nextAsc":1===d?"nextDesc":"nextNone"],i.attr("aria-label",c))}function f(t,r){var s,a,n,o,i,d,c,l,p=t.config,u=r||p.sortList,g=u.length;for(p.sortList=[],i=0;g>i;i++)if(l=u[i],s=parseInt(l[0],10),s<p.columns&&p.$headerIndexed[s]){switch(o=p.$headerIndexed[s][0],a=(""+l[1]).match(/^(1|d|s|o|n)/),a=a?a[0]:""){case"1":case"d":a=1;break;case"s":a=d||0;break;case"o":c=o.order[(d||0)%(p.sortReset?3:2)],a=0===c?1:1===c?0:2;break;case"n":o.count=o.count+1,a=o.order[o.count%(p.sortReset?3:2)];break;default:a=0}d=0===i?a:d,n=[s,parseInt(a,10)||0],p.sortList.push(n),a=e.inArray(n[1],o.order),o.count=a>=0?a:n[1]%(p.sortReset?3:2)}}function h(e,t){return e&&e[t]?e[t].type||"":""}function m(t,r,s){if(t.isUpdating)return setTimeout(function(){m(t,r,s)},50);var a,n,o,i,c,l,p,u=t.config,f=!s[u.sortMultiSortKey],h=u.$table,y=u.$headers.length;if(h.trigger("sortStart",t),r.count=s[u.sortResetKey]?2:(r.count+1)%(u.sortReset?3:2),u.sortRestart)for(n=r,o=0;y>o;o++)p=u.$headers.eq(o),p[0]===n||!f&&p.is("."+x.css.sortDesc+",."+x.css.sortAsc)||(p[0].count=-1);if(n=parseInt(e(r).attr("data-column"),10),f){if(u.sortList=[],null!==u.sortForce)for(a=u.sortForce,i=0;i<a.length;i++)a[i][0]!==n&&u.sortList.push(a[i]);if(c=r.order[r.count],2>c&&(u.sortList.push([n,c]),r.colSpan>1))for(i=1;i<r.colSpan;i++)u.sortList.push([n+i,c])}else{if(u.sortAppend&&u.sortList.length>1)for(i=0;i<u.sortAppend.length;i++)l=x.isValueInArray(u.sortAppend[i][0],u.sortList),l>=0&&u.sortList.splice(l,1);if(x.isValueInArray(n,u.sortList)>=0)for(i=0;i<u.sortList.length;i++)l=u.sortList[i],c=u.$headerIndexed[l[0]][0],l[0]===n&&(l[1]=c.order[r.count],2===l[1]&&(u.sortList.splice(i,1),c.count=-1));else if(c=r.order[r.count],2>c&&(u.sortList.push([n,c]),r.colSpan>1))for(i=1;i<r.colSpan;i++)u.sortList.push([n+i,c])}if(null!==u.sortAppend)for(a=u.sortAppend,i=0;i<a.length;i++)a[i][0]!==n&&u.sortList.push(a[i]);h.trigger("sortBegin",t),setTimeout(function(){g(t),b(t),d(t),h.trigger("sortEnd",t)},1)}function b(e){var t,a,n,o,i,d,c,l,p,u,g,f=0,m=e.config,b=m.textSorter||"",y=m.sortList,w=y.length,v=m.$tbodies.length;if(!m.serverSideSorting&&!s(m.cache)){for(m.debug&&(i=new Date),a=0;v>a;a++)d=m.cache[a].colMax,c=m.cache[a].normalized,c.sort(function(r,s){for(t=0;w>t;t++){if(o=y[t][0],l=y[t][1],f=0===l,m.sortStable&&r[o]===s[o]&&1===w)return r[m.columns].order-s[m.columns].order;if(n=/n/i.test(h(m.parsers,o)),n&&m.strings[o]?(n="boolean"==typeof m.string[m.strings[o]]?(f?1:-1)*(m.string[m.strings[o]]?-1:1):m.strings[o]?m.string[m.strings[o]]||0:0,p=m.numberSorter?m.numberSorter(r[o],s[o],f,d[o],e):x["sortNumeric"+(f?"Asc":"Desc")](r[o],s[o],n,d[o],o,e)):(u=f?r:s,g=f?s:r,p="function"==typeof b?b(u[o],g[o],f,o,e):"object"==typeof b&&b.hasOwnProperty(o)?b[o](u[o],g[o],f,o,e):x["sortNatural"+(f?"Asc":"Desc")](r[o],s[o],o,e,m)),p)return p}return r[m.columns].order-s[m.columns].order});m.debug&&r("Sorting on "+y.toString()+" and dir "+l+" time",i)}}function y(t,r){t.table.isUpdating&&t.$table.trigger("updateComplete",t.table),e.isFunction(r)&&r(t.table)}function w(t,r,s){var a=e.isArray(r)?r:t.sortList,n="undefined"==typeof r?t.resort:r;n===!1||t.serverSideSorting||t.table.isProcessing?(y(t,s),x.applyWidget(t.table,!1)):a.length?t.$table.trigger("sorton",[a,function(){y(t,s)},!0]):t.$table.trigger("sortReset",[function(){y(t,s),x.applyWidget(t.table,!1)}])}function v(t){var r=t.config,a=r.$table,c="sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(r.namespace+" ");a.unbind(c.replace(/\s+/g," ")).bind("sortReset"+r.namespace,function(s,a){s.stopPropagation(),r.sortList=[],g(t),b(t),d(t),e.isFunction(a)&&a(t)}).bind("updateAll"+r.namespace,function(e,s,a){e.stopPropagation(),t.isUpdating=!0,x.refreshWidgets(t,!0,!0),l(t),x.bindEvents(t,r.$headers,!0),v(t),p(t,s,a)}).bind("update"+r.namespace+" updateRows"+r.namespace,function(e,r,s){e.stopPropagation(),t.isUpdating=!0,u(t),p(t,r,s)}).bind("updateCell"+r.namespace,function(s,o,i,d){s.stopPropagation(),t.isUpdating=!0,a.find(r.selectorRemove).remove();var c,l,p,u,g=r.$tbodies,f=e(o),h=g.index(e.fn.closest?f.closest("tbody"):f.parents("tbody").filter(":first")),m=r.cache[h],b=e.fn.closest?f.closest("tr"):f.parents("tr").filter(":first");o=f[0],g.length&&h>=0&&(l=g.eq(h).find("tr").index(b),u=m.normalized[l],p=f.index(),c=n(r,o,p),u[p]=c,u[r.columns].$row=b,"numeric"===(r.parsers[p].type||"").toLowerCase()&&(m.colMax[p]=Math.max(Math.abs(c)||0,m.colMax[p]||0)),c="undefined"!==i?i:r.resort,c!==!1?w(r,c,d):(e.isFunction(d)&&d(t),r.$table.trigger("updateComplete",r.table)))}).bind("addRows"+r.namespace,function(a,i,d,c){if(a.stopPropagation(),t.isUpdating=!0,s(r.cache))u(t),p(t,d,c);else{i=e(i).attr("role","row");var l,g,f,h,m,b=i.filter("tr").length,y=r.$tbodies.index(i.parents("tbody").filter(":first"));for(r.parsers&&r.parsers.length||o(t),l=0;b>l;l++){for(f=i[l].cells.length,m=[],h={child:[],$row:i.eq(l),order:r.cache[y].normalized.length},g=0;f>g;g++)m[g]=n(r,i[l].cells[g],g),"numeric"===(r.parsers[g].type||"").toLowerCase()&&(r.cache[y].colMax[g]=Math.max(Math.abs(m[g])||0,r.cache[y].colMax[g]||0));m.push(h),r.cache[y].normalized.push(m)}w(r,d,c)}}).bind("updateComplete"+r.namespace,function(){t.isUpdating=!1}).bind("sorton"+r.namespace,function(r,n,o,c){var l=t.config;r.stopPropagation(),a.trigger("sortStart",this),f(t,n),g(t),l.delayInit&&s(l.cache)&&i(t),a.trigger("sortBegin",this),b(t),d(t,c),a.trigger("sortEnd",this),x.applyWidget(t),e.isFunction(o)&&o(t)}).bind("appendCache"+r.namespace,function(r,s,a){r.stopPropagation(),d(t,a),e.isFunction(s)&&s(t)}).bind("updateCache"+r.namespace,function(s,a){r.parsers&&r.parsers.length||o(t),i(t),e.isFunction(a)&&a(t)}).bind("applyWidgetId"+r.namespace,function(e,s){e.stopPropagation(),x.getWidgetById(s).format(t,r,r.widgetOptions)}).bind("applyWidgets"+r.namespace,function(e,r){e.stopPropagation(),x.applyWidget(t,r)}).bind("refreshWidgets"+r.namespace,function(e,r,s){e.stopPropagation(),x.refreshWidgets(t,r,s)}).bind("destroy"+r.namespace,function(e,r,s){e.stopPropagation(),x.destroy(t,r,s)}).bind("resetToLoadState"+r.namespace,function(){x.removeWidget(t,!0,!1),r=e.extend(!0,x.defaults,r.originalSettings),t.hasInitialized=!1,x.setup(t,r)})}var x=this;x.version="2.22.1",x.parsers=[],x.widgets=[],x.defaults={theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:!0,widgetClass:"widget-{name}",initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},x.css={table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},x.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},x.instanceMethods={},x.log=t,x.benchmark=r,x.getElementText=function(t,r,s){if(!r)return"";var a,n=t.textExtraction||"",o=r.jquery?r:e(r);return e.trim("string"==typeof n?("basic"===n?o.attr(t.textAttribute)||r.textContent:r.textContent)||o.text():"function"==typeof n?n(o[0],t.table,s):"function"==typeof(a=x.getColumnData(t.table,n,s))?a(o[0],t.table,s):o[0].textContent||o.text())},x.construct=function(t){return this.each(function(){var r=this,s=e.extend(!0,{},x.defaults,t,x.instanceMethods);s.originalSettings=t,!r.hasInitialized&&x.buildTable&&"TABLE"!==this.nodeName?x.buildTable(r,s):x.setup(r,s)})},x.setup=function(r,s){if(!r||!r.tHead||0===r.tBodies.length||r.hasInitialized===!0)return s.debug?t("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var a="",n=e(r),d=e.metadata;r.hasInitialized=!1,r.isProcessing=!0,r.config=s,e.data(r,"tablesorter",s),s.debug&&e.data(r,"startoveralltimer",new Date),s.supportsDataObject=function(e){return e[0]=parseInt(e[0],10),e[0]>1||1===e[0]&&parseInt(e[1],10)>=4}(e.fn.jquery.split(".")),s.string={max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},s.emptyTo=s.emptyTo.toLowerCase(),s.stringTo=s.stringTo.toLowerCase(),/tablesorter\-/.test(n.attr("class"))||(a=""!==s.theme?" tablesorter-"+s.theme:""),s.table=r,s.$table=n.addClass(x.css.table+" "+s.tableClass+a).attr("role","grid"),s.$headers=n.find(s.selectorHeaders),s.namespace=s.namespace?"."+s.namespace.replace(/\W/g,""):".tablesorter"+Math.random().toString(16).slice(2),s.$table.children().children("tr").attr("role","row"),s.$tbodies=n.children("tbody:not(."+s.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),s.$table.children("caption").length&&(a=s.$table.children("caption")[0],a.id||(a.id=s.namespace.slice(1)+"caption"),s.$table.attr("aria-labelledby",a.id)),s.widgetInit={},s.textExtraction=s.$table.attr("data-text-extraction")||s.textExtraction||"basic",l(r),x.fixColumnWidth(r),x.applyWidgetOptions(r,s),o(r),s.totalRows=0,s.delayInit||i(r),x.bindEvents(r,s.$headers,!0),v(r),s.supportsDataObject&&"undefined"!=typeof n.data().sortlist?s.sortList=n.data().sortlist:d&&n.metadata()&&n.metadata().sortlist&&(s.sortList=n.metadata().sortlist),x.applyWidget(r,!0),s.sortList.length>0?n.trigger("sorton",[s.sortList,{},!s.initWidgets,!0]):(g(r),s.initWidgets&&x.applyWidget(r,!1)),s.showProcessing&&n.unbind("sortBegin"+s.namespace+" sortEnd"+s.namespace).bind("sortBegin"+s.namespace+" sortEnd"+s.namespace,function(e){clearTimeout(s.processTimer),x.isProcessing(r),"sortBegin"===e.type&&(s.processTimer=setTimeout(function(){x.isProcessing(r,!0)},500))}),r.hasInitialized=!0,r.isProcessing=!1,s.debug&&x.benchmark("Overall initialization time",e.data(r,"startoveralltimer")),n.trigger("tablesorter-initialized",r),"function"==typeof s.initialized&&s.initialized(r)},x.fixColumnWidth=function(t){t=e(t)[0];var r,s,a,n,o,i=t.config,d=i.$table.children("colgroup");if(d.length&&d.hasClass(x.css.colgroup)&&d.remove(),i.widthFixed&&0===i.$table.children("colgroup").length){for(d=e('<colgroup class="'+x.css.colgroup+'">'),r=i.$table.width(),a=i.$tbodies.find("tr:first").children(":visible"),n=a.length,o=0;n>o;o++)s=parseInt(a.eq(o).width()/r*1e3,10)/10+"%",d.append(e("<col>").css("width",s));i.$table.prepend(d)}},x.getColumnData=function(t,r,s,a,n){if("undefined"!=typeof r&&null!==r){t=e(t)[0];var o,i,d=t.config,c=n||d.$headers,l=d.$headerIndexed&&d.$headerIndexed[s]||c.filter('[data-column="'+s+'"]:last');if(r[s])return a?r[s]:r[c.index(l)];for(i in r)if("string"==typeof i&&(o=l.filter(i).add(l.find(i)),o.length))return r[i]}},x.computeColumnIndex=function(t){var r,s,a,n,o,i,d,c,l,p,u,g,f=[],h=[],m={};for(r=0;r<t.length;r++)for(d=t[r].cells,s=0;s<d.length;s++){for(i=d[s],o=e(i),c=i.parentNode.rowIndex,l=c+"-"+o.index(),p=i.rowSpan||1,u=i.colSpan||1,"undefined"==typeof f[c]&&(f[c]=[]),a=0;a<f[c].length+1;a++)if("undefined"==typeof f[c][a]){g=a;break}for(m[l]=g,o.attr({"data-column":g}),a=c;c+p>a;a++)for("undefined"==typeof f[a]&&(f[a]=[]),h=f[a],n=g;g+u>n;n++)h[n]="x"}return h.length},x.isProcessing=function(t,r,s){t=e(t);var a=t[0].config,n=s||t.find("."+x.css.header);r?("undefined"!=typeof s&&a.sortList.length>0&&(n=n.filter(function(){return this.sortDisabled?!1:x.isValueInArray(parseFloat(e(this).attr("data-column")),a.sortList)>=0})),t.add(n).addClass(x.css.processing+" "+a.cssProcessing)):t.add(n).removeClass(x.css.processing+" "+a.cssProcessing)},x.processTbody=function(t,r,s){t=e(t)[0];var a;return s?(t.isProcessing=!0,r.before('<span class="tablesorter-savemyplace"/>'),a=e.fn.detach?r.detach():r.remove()):(a=e(t).find("span.tablesorter-savemyplace"),r.insertAfter(a),a.remove(),void(t.isProcessing=!1))},x.clearTableBody=function(t){e(t)[0].config.$tbodies.children().detach()},x.bindEvents=function(t,r,a){t=e(t)[0];var n,o=null,d=t.config;a!==!0&&(r.addClass(d.namespace.slice(1)+"_extra_headers"),n=e.fn.closest?r.closest("table")[0]:r.parents("table")[0],n&&"TABLE"===n.nodeName&&n!==t&&e(n).addClass(d.namespace.slice(1)+"_extra_table")),n=(d.pointerDown+" "+d.pointerUp+" "+d.pointerClick+" sort keyup ").replace(/\s+/g," ").split(" ").join(d.namespace+" "),r.find(d.selectorSort).add(r.filter(d.selectorSort)).unbind(n).bind(n,function(a,n){var c,l=e(a.target),p=" "+a.type+" ";if(!(1!==(a.which||a.button)&&!p.match(" "+d.pointerClick+" | sort | keyup ")||" keyup "===p&&13!==a.which||p.match(" "+d.pointerClick+" ")&&"undefined"!=typeof a.which||p.match(" "+d.pointerUp+" ")&&o!==a.target&&n!==!0)){if(p.match(" "+d.pointerDown+" "))return o=a.target,void a.preventDefault();if(o=null,/(input|select|button|textarea)/i.test(a.target.nodeName)||l.hasClass(d.cssNoSort)||l.parents("."+d.cssNoSort).length>0||l.parents("button").length>0)return!d.cancelSelection;d.delayInit&&s(d.cache)&&i(t),c=e.fn.closest?e(this).closest("th, td")[0]:/TH|TD/.test(this.nodeName)?this:e(this).parents("th, td")[0],c=d.$headers[r.index(c)],c.sortDisabled||m(t,c,a)}}),d.cancelSelection&&r.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},x.restoreHeaders=function(t){var r,s,a=e(t)[0].config,n=a.$table.find(a.selectorHeaders),o=n.length;for(r=0;o>r;r++)s=n.eq(r),s.find("."+x.css.headerIn).length&&s.html(a.headerContent[r])},x.destroy=function(t,r,s){if(t=e(t)[0],t.hasInitialized){x.removeWidget(t,!0,!1);var a,n=e(t),o=t.config,i=n.find("thead:first"),d=i.find("tr."+x.css.headerRow).removeClass(x.css.headerRow+" "+o.cssHeaderRow),c=n.find("tfoot:first > tr").children("th, td");r===!1&&e.inArray("uitheme",o.widgets)>=0&&(n.trigger("applyWidgetId",["uitheme"]),n.trigger("applyWidgetId",["zebra"])),i.find("tr").not(d).remove(),a="sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache "+"applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(o.namespace+" "),n.removeData("tablesorter").unbind(a.replace(/\s+/g," ")),o.$headers.add(c).removeClass([x.css.header,o.cssHeader,o.cssAsc,o.cssDesc,x.css.sortAsc,x.css.sortDesc,x.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),d.find(o.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(o.namespace+" ").replace(/\s+/g," ")),x.restoreHeaders(t),n.toggleClass(x.css.table+" "+o.tableClass+" tablesorter-"+o.theme,r===!1),t.hasInitialized=!1,delete t.config.cache,"function"==typeof s&&s(t)}},x.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i},x.sortNatural=function(e,t){if(e===t)return 0;var r,s,a,n,o,i,d,c,l=x.regex;if(l.hex.test(t)){if(s=parseInt(e.match(l.hex),16),n=parseInt(t.match(l.hex),16),n>s)return-1;if(s>n)return 1}for(r=e.replace(l.chunk,"\\0$1\\0").replace(l.chunks,"").split("\\0"),a=t.replace(l.chunk,"\\0$1\\0").replace(l.chunks,"").split("\\0"),c=Math.max(r.length,a.length),d=0;c>d;d++){if(o=isNaN(r[d])?r[d]||0:parseFloat(r[d])||0,i=isNaN(a[d])?a[d]||0:parseFloat(a[d])||0,isNaN(o)!==isNaN(i))return isNaN(o)?1:-1;if(typeof o!=typeof i&&(o+="",i+=""),i>o)return-1;if(o>i)return 1}return 0},x.sortNaturalAsc=function(e,t,r,s,a){if(e===t)return 0;var n=a.string[a.empties[r]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:-n||-1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:n||1:x.sortNatural(e,t)},x.sortNaturalDesc=function(e,t,r,s,a){if(e===t)return 0;var n=a.string[a.empties[r]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:n||1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:-n||-1:x.sortNatural(t,e)},x.sortText=function(e,t){return e>t?1:t>e?-1:0},x.getTextValue=function(e,t,r){if(r){var s,a=e?e.length:0,n=r+t;for(s=0;a>s;s++)n+=e.charCodeAt(s);return t*n}return 0},x.sortNumericAsc=function(e,t,r,s,a,n){if(e===t)return 0;var o=n.config,i=o.string[o.empties[a]||o.emptyTo];return""===e&&0!==i?"boolean"==typeof i?i?-1:1:-i||-1:""===t&&0!==i?"boolean"==typeof i?i?1:-1:i||1:(isNaN(e)&&(e=x.getTextValue(e,r,s)),isNaN(t)&&(t=x.getTextValue(t,r,s)),e-t)},x.sortNumericDesc=function(e,t,r,s,a,n){if(e===t)return 0;var o=n.config,i=o.string[o.empties[a]||o.emptyTo];return""===e&&0!==i?"boolean"==typeof i?i?-1:1:i||1:""===t&&0!==i?"boolean"==typeof i?i?1:-1:-i||-1:(isNaN(e)&&(e=x.getTextValue(e,r,s)),isNaN(t)&&(t=x.getTextValue(t,r,s)),t-e)},x.sortNumeric=function(e,t){return e-t},x.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},x.replaceAccents=function(e){var t,r="[",s=x.characterEquivalents;if(!x.characterRegex){x.characterRegexArray={};for(t in s)"string"==typeof t&&(r+=s[t],x.characterRegexArray[t]=new RegExp("["+s[t]+"]","g"));x.characterRegex=new RegExp(r+"]")}if(x.characterRegex.test(e))for(t in s)"string"==typeof t&&(e=e.replace(x.characterRegexArray[t],t));return e},x.isValueInArray=function(e,t){var r,s=t.length;for(r=0;s>r;r++)if(t[r][0]===e)return r;return-1},x.addParser=function(e){var t,r=x.parsers.length,s=!0;for(t=0;r>t;t++)x.parsers[t].id.toLowerCase()===e.id.toLowerCase()&&(s=!1);s&&x.parsers.push(e)},x.addInstanceMethods=function(t){e.extend(x.instanceMethods,t)},x.getParserById=function(e){if("false"==e)return!1;var t,r=x.parsers.length;for(t=0;r>t;t++)if(x.parsers[t].id.toLowerCase()===e.toString().toLowerCase())return x.parsers[t];return!1},x.addWidget=function(e){x.widgets.push(e)},x.hasWidget=function(t,r){return t=e(t),t.length&&t[0].config&&t[0].config.widgetInit[r]||!1},x.getWidgetById=function(e){var t,r,s=x.widgets.length;for(t=0;s>t;t++)if(r=x.widgets[t],r&&r.hasOwnProperty("id")&&r.id.toLowerCase()===e.toLowerCase())return r},x.applyWidgetOptions=function(t,r){var s,a,n=r.widgets.length,o=r.widgetOptions;if(n)for(s=0;n>s;s++)a=x.getWidgetById(r.widgets[s]),a&&"options"in a&&(o=t.config.widgetOptions=e.extend(!0,{},a.options,o))},x.applyWidget=function(t,s,a){t=e(t)[0];var n,o,i,d,c,l,p,u=t.config,g=u.widgetOptions,f=" "+u.table.className+" ",h=[];if(s===!1||!t.hasInitialized||!t.isApplyingWidgets&&!t.isUpdating){if(u.debug&&(d=new Date),p=new RegExp("\\s"+u.widgetClass.replace(/\{name\}/i,"([\\w-]+)")+"\\s","g"),f.match(p)&&(l=f.match(p)))for(o=l.length,n=0;o>n;n++)u.widgets.push(l[n].replace(p,"$1"));if(u.widgets.length){for(t.isApplyingWidgets=!0,u.widgets=e.grep(u.widgets,function(t,r){return e.inArray(t,u.widgets)===r}),i=u.widgets||[],o=i.length,n=0;o>n;n++)p=x.getWidgetById(i[n]),p&&p.id&&(p.priority||(p.priority=10),h[n]=p);for(h.sort(function(e,t){return e.priority<t.priority?-1:e.priority===t.priority?0:1}),o=h.length,n=0;o>n;n++)h[n]&&((s||!u.widgetInit[h[n].id])&&(u.widgetInit[h[n].id]=!0,t.hasInitialized&&x.applyWidgetOptions(t,u),"init"in h[n]&&(u.debug&&(c=new Date),h[n].init(t,h[n],u,g),u.debug&&x.benchmark("Initializing "+h[n].id+" widget",c))),!s&&"format"in h[n]&&(u.debug&&(c=new Date),h[n].format(t,u,g,!1),u.debug&&x.benchmark((s?"Initializing ":"Applying ")+h[n].id+" widget",c)));s||"function"!=typeof a||a(t)}setTimeout(function(){t.isApplyingWidgets=!1,e.data(t,"lastWidgetApplication",new Date)},0),u.debug&&(l=u.widgets.length,r("Completed "+(s===!0?"initializing ":"applying ")+l+" widget"+(1!==l?"s":""),d))}},x.removeWidget=function(r,s,a){r=e(r)[0];var n,o,i,d,c=r.config;if(s===!0)for(s=[],d=x.widgets.length,i=0;d>i;i++)o=x.widgets[i],o&&o.id&&s.push(o.id);else s=(e.isArray(s)?s.join(","):s||"").toLowerCase().split(/[\s,]+/);for(d=s.length,n=0;d>n;n++)o=x.getWidgetById(s[n]),i=e.inArray(s[n],c.widgets),o&&"remove"in o&&(c.debug&&i>=0&&t('Removing "'+s[n]+'" widget'),o.remove(r,c,c.widgetOptions,a),c.widgetInit[s[n]]=!1),i>=0&&a!==!0&&c.widgets.splice(i,1)},x.refreshWidgets=function(t,r,s){t=e(t)[0];var a,n=t.config,o=n.widgets,i=x.widgets,d=i.length,c=[],l=function(t){e(t).trigger("refreshComplete")};for(a=0;d>a;a++)i[a]&&i[a].id&&(r||e.inArray(i[a].id,o)<0)&&c.push(i[a].id);x.removeWidget(t,c.join(","),!0),s!==!0?(x.applyWidget(t,r||!1,l),r&&x.applyWidget(t,!1,l)):l(t)},x.getColumnText=function(t,r,a){t=e(t)[0];var n,o,i,d,c,l,p,u,g,f,h="function"==typeof a,m="all"===r,b={raw:[],parsed:[],$cell:[]},y=t.config;if(!s(y)){for(c=y.$tbodies.length,n=0;c>n;n++)for(i=y.cache[n].normalized,l=i.length,o=0;l>o;o++)f=!0,d=i[o],u=m?d.slice(0,y.columns):d[r],d=d[y.columns],p=m?d.raw:d.raw[r],g=m?d.$row.children():d.$row.children().eq(r),h&&(f=a({tbodyIndex:n,rowIndex:o,parsed:u,raw:p,$row:d.$row,$cell:g})),f!==!1&&(b.parsed.push(u),b.raw.push(p),b.$cell.push(g));return b}},x.getData=function(t,r,s){var a,n,o="",i=e(t);return i.length?(a=e.metadata?i.metadata():!1,n=" "+(i.attr("class")||""),"undefined"!=typeof i.data(s)||"undefined"!=typeof i.data(s.toLowerCase())?o+=i.data(s)||i.data(s.toLowerCase()):a&&"undefined"!=typeof a[s]?o+=a[s]:r&&"undefined"!=typeof r[s]?o+=r[s]:" "!==n&&n.match(" "+s+"-")&&(o=n.match(new RegExp("\\s"+s+"-([\\w-]+)"))[1]||""),e.trim(o)):""},x.formatFloat=function(t,r){if("string"!=typeof t||""===t)return t;var s,a=r&&r.config?r.config.usNumberFormat!==!1:"undefined"!=typeof r?r:!0;return t=a?t.replace(/,/g,""):t.replace(/[\s|\.]/g,"").replace(/,/g,"."),/^\s*\([.\d]+\)/.test(t)&&(t=t.replace(/^\s*\(([.\d]+)\)/,"-$1")),s=parseFloat(t),isNaN(s)?e.trim(t):s},x.isDigit=function(e){return isNaN(e)?/^[\-+(]?\d+[)]?$/.test(e.toString().replace(/[,.'"\s]/g,"")):""!==e}}});var t=e.tablesorter;e.fn.extend({tablesorter:t.construct}),t.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),t.addParser({id:"text",is:function(){return!0},format:function(r,s){var a=s.config;return r&&(r=e.trim(a.ignoreCase?r.toLocaleLowerCase():r),r=a.sortLocaleCompare?t.replaceAccents(r):r),r},type:"text"}),t.addParser({id:"digit",is:function(e){return t.isDigit(e)},format:function(r,s){var a=t.formatFloat((r||"").replace(/[^\w,. \-()]/g,""),s);return r&&"number"==typeof a?a:r?e.trim(r&&s.config.ignoreCase?r.toLocaleLowerCase():r):r},type:"numeric"}),t.addParser({id:"currency",is:function(e){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((e||"").replace(/[+\-,. ]/g,""))},format:function(r,s){var a=t.formatFloat((r||"").replace(/[^\w,. \-()]/g,""),s);return r&&"number"==typeof a?a:r?e.trim(r&&s.config.ignoreCase?r.toLocaleLowerCase():r):r},type:"numeric"}),t.addParser({id:"url",is:function(e){return/^(https?|ftp|file):\/\//.test(e)},format:function(t){return t?e.trim(t.replace(/(https?|ftp|file):\/\//,"")):t},parsed:!0,type:"text"}),t.addParser({id:"isoDate",is:function(e){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(e)},format:function(e){var t=e?new Date(e.replace(/-/g,"/")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),t.addParser({id:"percent",is:function(e){return/(\d\s*?%|%\s*?\d)/.test(e)&&e.length<15},format:function(e,r){return e?t.formatFloat(e.replace(/%/g,""),r):e},type:"numeric"}),t.addParser({id:"image",is:function(e,t,r,s){return s.find("img").length>0},format:function(t,r,s){return e(s).find("img").attr(r.config.imgAttr||"alt")||t},parsed:!0,type:"text"}),t.addParser({id:"usLongDate",is:function(e){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(e)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(e)},format:function(e){var t=e?new Date(e.replace(/(\S)([AP]M)$/i,"$1 $2")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),t.addParser({id:"shortDate",is:function(e){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((e||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(e,r,s,a){if(e){var n,o,i=r.config,d=i.$headerIndexed[a],c=d.length&&d[0].dateFormat||t.getData(d,t.getColumnData(r,i.headers,a),"dateFormat")||i.dateFormat;
-return o=e.replace(/\s+/g," ").replace(/[\-.,]/g,"/"),"mmddyyyy"===c?o=o.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===c?o=o.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===c&&(o=o.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3")),n=new Date(o),n instanceof Date&&isFinite(n)?n.getTime():e}return e},type:"numeric"}),t.addParser({id:"time",is:function(e){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(e)},format:function(e){var t=e?new Date("2000/01/01 "+e.replace(/(\S)([AP]M)$/i,"$1 $2")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),t.addParser({id:"metadata",is:function(){return!1},format:function(t,r,s){var a=r.config,n=a.parserMetadataName?a.parserMetadataName:"sortValue";return e(s).metadata()[n]},type:"numeric"}),t.addWidget({id:"zebra",priority:90,format:function(t,r,s){var a,n,o,i,d,c,l,p,u=new RegExp(r.cssChildRow,"i"),g=r.$tbodies.add(e(r.namespace+"_extra_table").children("tbody"));for(r.debug&&(d=new Date),c=0;c<g.length;c++)for(o=0,a=g.eq(c).children("tr:visible").not(r.selectorRemove),p=a.length,l=0;p>l;l++)n=a.eq(l),u.test(n[0].className)||o++,i=o%2===0,n.removeClass(s.zebra[i?1:0]).addClass(s.zebra[i?0:1])},remove:function(e,r,s,a){if(!a){var n,o,i=r.$tbodies,d=(s.zebra||["even","odd"]).join(" ");for(n=0;n<i.length;n++)o=t.processTbody(e,i.eq(n),!0),o.children().removeClass(d),t.processTbody(e,o,!1)}}})}(jQuery);
+;( function( $ ) {
+ 'use strict';
+ var ts = $.tablesorter = {
+
+ version : '2.31.1',
+
+ parsers : [],
+ widgets : [],
+ defaults : {
+
+ // *** appearance
+ theme : 'default', // adds tablesorter-{theme} to the table for styling
+ widthFixed : false, // adds colgroup to fix widths of columns
+ showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered.
+
+ headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> // class from cssIcon
+ onRenderTemplate : null, // function( index, template ) { return template; }, // template is a string
+ onRenderHeader : null, // function( index ) {}, // nothing to return
+
+ // *** functionality
+ cancelSelection : true, // prevent text selection in the header
+ tabIndex : true, // add tabindex to header for keyboard accessibility
+ dateFormat : 'mmddyyyy', // other options: 'ddmmyyy' or 'yyyymmdd'
+ sortMultiSortKey : 'shiftKey', // key used to select additional columns
+ sortResetKey : 'ctrlKey', // key used to remove sorting on a column
+ usNumberFormat : true, // false for German '1.234.567,89' or French '1 234 567,89'
+ delayInit : false, // if false, the parsed table contents will not update until the first sort
+ serverSideSorting: false, // if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used.
+ resort : true, // default setting to trigger a resort after an 'update', 'addRows', 'updateCell', etc has completed
+
+ // *** sort options
+ headers : {}, // set sorter, string, empty, locked order, sortInitialOrder, filter, etc.
+ ignoreCase : true, // ignore case while sorting
+ sortForce : null, // column(s) first sorted; always applied
+ sortList : [], // Initial sort order; applied initially; updated when manually sorted
+ sortAppend : null, // column(s) sorted last; always applied
+ sortStable : false, // when sorting two rows with exactly the same content, the original sort order is maintained
+
+ sortInitialOrder : 'asc', // sort direction on first click
+ sortLocaleCompare: false, // replace equivalent character (accented characters)
+ sortReset : false, // third click on the header will reset column to default - unsorted
+ sortRestart : false, // restart sort to 'sortInitialOrder' when clicking on previously unsorted columns
+
+ emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin
+ stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
+ duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column
+ textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ) {}
+ textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function)
+ textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText]
+ numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue )
+
+ // *** widget options
+ initWidgets : true, // apply widgets on tablesorter initialization
+ widgetClass : 'widget-{name}', // table class name template to match to include a widget
+ widgets : [], // method to add widgets, e.g. widgets: ['zebra']
+ widgetOptions : {
+ zebra : [ 'even', 'odd' ] // zebra widget alternating row class names
+ },
+
+ // *** callbacks
+ initialized : null, // function( table ) {},
+
+ // *** extra css class names
+ tableClass : '',
+ cssAsc : '',
+ cssDesc : '',
+ cssNone : '',
+ cssHeader : '',
+ cssHeaderRow : '',
+ cssProcessing : '', // processing icon applied to header during sort/filter
+
+ cssChildRow : 'tablesorter-childRow', // class name indiciating that a row is to be attached to its parent
+ cssInfoBlock : 'tablesorter-infoOnly', // don't sort tbody with this class name (only one class name allowed here!)
+ cssNoSort : 'tablesorter-noSort', // class name added to element inside header; clicking on it won't cause a sort
+ cssIgnoreRow : 'tablesorter-ignoreRow',// header row to ignore; cells within this row will not be added to c.$headers
+
+ cssIcon : 'tablesorter-icon', // if this class does not exist, the {icon} will not be added from the headerTemplate
+ cssIconNone : '', // class name added to the icon when there is no column sort
+ cssIconAsc : '', // class name added to the icon when the column has an ascending sort
+ cssIconDesc : '', // class name added to the icon when the column has a descending sort
+ cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
+
+ // *** events
+ pointerClick : 'click',
+ pointerDown : 'mousedown',
+ pointerUp : 'mouseup',
+
+ // *** selectors
+ selectorHeaders : '> thead th, > thead td',
+ selectorSort : 'th, td', // jQuery selector of content within selectorHeaders that is clickable to trigger a sort
+ selectorRemove : '.remove-me',
+
+ // *** advanced
+ debug : false,
+
+ // *** Internal variables
+ headerList: [],
+ empties: {},
+ strings: {},
+ parsers: [],
+
+ // *** parser options for validator; values must be falsy!
+ globalize: 0,
+ imgAttr: 0
+
+ // removed: widgetZebra: { css: ['even', 'odd'] }
+
+ },
+
+ // internal css classes - these will ALWAYS be added to
+ // the table and MUST only contain one class name - fixes #381
+ css : {
+ table : 'tablesorter',
+ cssHasChild: 'tablesorter-hasChildRow',
+ childRow : 'tablesorter-childRow',
+ colgroup : 'tablesorter-colgroup',
+ header : 'tablesorter-header',
+ headerRow : 'tablesorter-headerRow',
+ headerIn : 'tablesorter-header-inner',
+ icon : 'tablesorter-icon',
+ processing : 'tablesorter-processing',
+ sortAsc : 'tablesorter-headerAsc',
+ sortDesc : 'tablesorter-headerDesc',
+ sortNone : 'tablesorter-headerUnSorted'
+ },
+
+ // labels applied to sortable headers for accessibility (aria) support
+ language : {
+ sortAsc : 'Ascending sort applied, ',
+ sortDesc : 'Descending sort applied, ',
+ sortNone : 'No sort applied, ',
+ sortDisabled : 'sorting is disabled',
+ nextAsc : 'activate to apply an ascending sort',
+ nextDesc : 'activate to apply a descending sort',
+ nextNone : 'activate to remove the sort'
+ },
+
+ regex : {
+ templateContent : /\{content\}/g,
+ templateIcon : /\{icon\}/g,
+ templateName : /\{name\}/i,
+ spaces : /\s+/g,
+ nonWord : /\W/g,
+ formElements : /(input|select|button|textarea)/i,
+
+ // *** sort functions ***
+ // regex used in natural sort
+ // chunk/tokenize numbers & letters
+ chunk : /(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,
+ // replace chunks @ ends
+ chunks : /(^\\0|\\0$)/,
+ hex : /^0x[0-9a-f]+$/i,
+
+ // *** formatFloat ***
+ comma : /,/g,
+ digitNonUS : /[\s|\.]/g,
+ digitNegativeTest : /^\s*\([.\d]+\)/,
+ digitNegativeReplace : /^\s*\(([.\d]+)\)/,
+
+ // *** isDigit ***
+ digitTest : /^[\-+(]?\d+[)]?$/,
+ digitReplace : /[,.'"\s]/g
+
+ },
+
+ // digit sort, text location
+ string : {
+ max : 1,
+ min : -1,
+ emptymin : 1,
+ emptymax : -1,
+ zero : 0,
+ none : 0,
+ 'null' : 0,
+ top : true,
+ bottom : false
+ },
+
+ keyCodes : {
+ enter : 13
+ },
+
+ // placeholder date parser data (globalize)
+ dates : {},
+
+ // These methods can be applied on table.config instance
+ instanceMethods : {},
+
+ /*
+ ▄█████ ██████ ██████ ██ ██ █████▄
+ ▀█▄ ██▄▄ ██ ██ ██ ██▄▄██
+ ▀█▄ ██▀▀ ██ ██ ██ ██▀▀▀
+ █████▀ ██████ ██ ▀████▀ ██
+ */
+
+ setup : function( table, c ) {
+ // if no thead or tbody, or tablesorter is already present, quit
+ if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) {
+ if ( ts.debug(c, 'core') ) {
+ if ( table.hasInitialized ) {
+ console.warn( 'Stopping initialization. Tablesorter has already been initialized' );
+ } else {
+ console.error( 'Stopping initialization! No table, thead or tbody', table );
+ }
+ }
+ return;
+ }
+
+ var tmp = '',
+ $table = $( table ),
+ meta = $.metadata;
+ // initialization flag
+ table.hasInitialized = false;
+ // table is being processed flag
+ table.isProcessing = true;
+ // make sure to store the config object
+ table.config = c;
+ // save the settings where they read
+ $.data( table, 'tablesorter', c );
+ if ( ts.debug(c, 'core') ) {
+ console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
+ $.data( table, 'startoveralltimer', new Date() );
+ }
+
+ // removing this in version 3 (only supports jQuery 1.7+)
+ c.supportsDataObject = ( function( version ) {
+ version[ 0 ] = parseInt( version[ 0 ], 10 );
+ return ( version[ 0 ] > 1 ) || ( version[ 0 ] === 1 && parseInt( version[ 1 ], 10 ) >= 4 );
+ })( $.fn.jquery.split( '.' ) );
+ // ensure case insensitivity
+ c.emptyTo = c.emptyTo.toLowerCase();
+ c.stringTo = c.stringTo.toLowerCase();
+ c.last = { sortList : [], clickedIndex : -1 };
+ // add table theme class only if there isn't already one there
+ if ( !/tablesorter\-/.test( $table.attr( 'class' ) ) ) {
+ tmp = ( c.theme !== '' ? ' tablesorter-' + c.theme : '' );
+ }
+
+ // give the table a unique id, which will be used in namespace binding
+ if ( !c.namespace ) {
+ c.namespace = '.tablesorter' + Math.random().toString( 16 ).slice( 2 );
+ } else {
+ // make sure namespace starts with a period & doesn't have weird characters
+ c.namespace = '.' + c.namespace.replace( ts.regex.nonWord, '' );
+ }
+
+ c.table = table;
+ c.$table = $table
+ // add namespace to table to allow bindings on extra elements to target
+ // the parent table (e.g. parser-input-select)
+ .addClass( ts.css.table + ' ' + c.tableClass + tmp + ' ' + c.namespace.slice(1) )
+ .attr( 'role', 'grid' );
+ c.$headers = $table.find( c.selectorHeaders );
+
+ c.$table.children().children( 'tr' ).attr( 'role', 'row' );
+ c.$tbodies = $table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ).attr({
+ 'aria-live' : 'polite',
+ 'aria-relevant' : 'all'
+ });
+ if ( c.$table.children( 'caption' ).length ) {
+ tmp = c.$table.children( 'caption' )[ 0 ];
+ if ( !tmp.id ) { tmp.id = c.namespace.slice( 1 ) + 'caption'; }
+ c.$table.attr( 'aria-labelledby', tmp.id );
+ }
+ c.widgetInit = {}; // keep a list of initialized widgets
+ // change textExtraction via data-attribute
+ c.textExtraction = c.$table.attr( 'data-text-extraction' ) || c.textExtraction || 'basic';
+ // build headers
+ ts.buildHeaders( c );
+ // fixate columns if the users supplies the fixedWidth option
+ // do this after theme has been applied
+ ts.fixColumnWidth( table );
+ // add widgets from class name
+ ts.addWidgetFromClass( table );
+ // add widget options before parsing (e.g. grouping widget has parser settings)
+ ts.applyWidgetOptions( table );
+ // try to auto detect column type, and store in tables config
+ ts.setupParsers( c );
+ // start total row count at zero
+ c.totalRows = 0;
+ // only validate options while debugging. See #1528
+ if (c.debug) {
+ ts.validateOptions( c );
+ }
+ // build the cache for the tbody cells
+ // delayInit will delay building the cache until the user starts a sort
+ if ( !c.delayInit ) { ts.buildCache( c ); }
+ // bind all header events and methods
+ ts.bindEvents( table, c.$headers, true );
+ ts.bindMethods( c );
+ // get sort list from jQuery data or metadata
+ // in jQuery < 1.4, an error occurs when calling $table.data()
+ if ( c.supportsDataObject && typeof $table.data().sortlist !== 'undefined' ) {
+ c.sortList = $table.data().sortlist;
+ } else if ( meta && ( $table.metadata() && $table.metadata().sortlist ) ) {
+ c.sortList = $table.metadata().sortlist;
+ }
+ // apply widget init code
+ ts.applyWidget( table, true );
+ // if user has supplied a sort list to constructor
+ if ( c.sortList.length > 0 ) {
+ // save sortList before any sortAppend is added
+ c.last.sortList = c.sortList;
+ ts.sortOn( c, c.sortList, {}, !c.initWidgets );
+ } else {
+ ts.setHeadersCss( c );
+ if ( c.initWidgets ) {
+ // apply widget format
+ ts.applyWidget( table, false );
+ }
+ }
+
+ // show processesing icon
+ if ( c.showProcessing ) {
+ $table
+ .unbind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace )
+ .bind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace, function( e ) {
+ clearTimeout( c.timerProcessing );
+ ts.isProcessing( table );
+ if ( e.type === 'sortBegin' ) {
+ c.timerProcessing = setTimeout( function() {
+ ts.isProcessing( table, true );
+ }, 500 );
+ }
+ });
+ }
+
+ // initialized
+ table.hasInitialized = true;
+ table.isProcessing = false;
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
+ if ( ts.debug(c, 'core') && console.groupEnd ) { console.groupEnd(); }
+ }
+ $table.triggerHandler( 'tablesorter-initialized', table );
+ if ( typeof c.initialized === 'function' ) {
+ c.initialized( table );
+ }
+ },
+
+ bindMethods : function( c ) {
+ var $table = c.$table,
+ namespace = c.namespace,
+ events = ( 'sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete ' +
+ 'sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup ' +
+ 'mouseleave ' ).split( ' ' )
+ .join( namespace + ' ' );
+ // apply easy methods that trigger bound events
+ $table
+ .unbind( events.replace( ts.regex.spaces, ' ' ) )
+ .bind( 'sortReset' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ // using this.config to ensure functions are getting a non-cached version of the config
+ ts.sortReset( this.config, function( table ) {
+ if (table.isApplyingWidgets) {
+ // multiple triggers in a row... filterReset, then sortReset - see #1361
+ // wait to update widgets
+ setTimeout( function() {
+ ts.applyWidget( table, '', callback );
+ }, 100 );
+ } else {
+ ts.applyWidget( table, '', callback );
+ }
+ });
+ })
+ .bind( 'updateAll' + namespace, function( e, resort, callback ) {
+ e.stopPropagation();
+ ts.updateAll( this.config, resort, callback );
+ })
+ .bind( 'update' + namespace + ' updateRows' + namespace, function( e, resort, callback ) {
+ e.stopPropagation();
+ ts.update( this.config, resort, callback );
+ })
+ .bind( 'updateHeaders' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ ts.updateHeaders( this.config, callback );
+ })
+ .bind( 'updateCell' + namespace, function( e, cell, resort, callback ) {
+ e.stopPropagation();
+ ts.updateCell( this.config, cell, resort, callback );
+ })
+ .bind( 'addRows' + namespace, function( e, $row, resort, callback ) {
+ e.stopPropagation();
+ ts.addRows( this.config, $row, resort, callback );
+ })
+ .bind( 'updateComplete' + namespace, function() {
+ this.isUpdating = false;
+ })
+ .bind( 'sorton' + namespace, function( e, list, callback, init ) {
+ e.stopPropagation();
+ ts.sortOn( this.config, list, callback, init );
+ })
+ .bind( 'appendCache' + namespace, function( e, callback, init ) {
+ e.stopPropagation();
+ ts.appendCache( this.config, init );
+ if ( $.isFunction( callback ) ) {
+ callback( this );
+ }
+ })
+ // $tbodies variable is used by the tbody sorting widget
+ .bind( 'updateCache' + namespace, function( e, callback, $tbodies ) {
+ e.stopPropagation();
+ ts.updateCache( this.config, callback, $tbodies );
+ })
+ .bind( 'applyWidgetId' + namespace, function( e, id ) {
+ e.stopPropagation();
+ ts.applyWidgetId( this, id );
+ })
+ .bind( 'applyWidgets' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ // apply widgets (false = not initializing)
+ ts.applyWidget( this, false, callback );
+ })
+ .bind( 'refreshWidgets' + namespace, function( e, all, dontapply ) {
+ e.stopPropagation();
+ ts.refreshWidgets( this, all, dontapply );
+ })
+ .bind( 'removeWidget' + namespace, function( e, name, refreshing ) {
+ e.stopPropagation();
+ ts.removeWidget( this, name, refreshing );
+ })
+ .bind( 'destroy' + namespace, function( e, removeClasses, callback ) {
+ e.stopPropagation();
+ ts.destroy( this, removeClasses, callback );
+ })
+ .bind( 'resetToLoadState' + namespace, function( e ) {
+ e.stopPropagation();
+ // remove all widgets
+ ts.removeWidget( this, true, false );
+ var tmp = $.extend( true, {}, c.originalSettings );
+ // restore original settings; this clears out current settings, but does not clear
+ // values saved to storage.
+ c = $.extend( true, {}, ts.defaults, tmp );
+ c.originalSettings = tmp;
+ this.hasInitialized = false;
+ // setup the entire table again
+ ts.setup( this, c );
+ });
+ },
+
+ bindEvents : function( table, $headers, core ) {
+ table = $( table )[ 0 ];
+ var tmp,
+ c = table.config,
+ namespace = c.namespace,
+ downTarget = null;
+ if ( core !== true ) {
+ $headers.addClass( namespace.slice( 1 ) + '_extra_headers' );
+ tmp = ts.getClosest( $headers, 'table' );
+ if ( tmp.length && tmp[ 0 ].nodeName === 'TABLE' && tmp[ 0 ] !== table ) {
+ $( tmp[ 0 ] ).addClass( namespace.slice( 1 ) + '_extra_table' );
+ }
+ }
+ tmp = ( c.pointerDown + ' ' + c.pointerUp + ' ' + c.pointerClick + ' sort keyup ' )
+ .replace( ts.regex.spaces, ' ' )
+ .split( ' ' )
+ .join( namespace + ' ' );
+ // apply event handling to headers and/or additional headers (stickyheaders, scroller, etc)
+ $headers
+ // http://stackoverflow.com/questions/5312849/jquery-find-self;
+ .find( c.selectorSort )
+ .add( $headers.filter( c.selectorSort ) )
+ .unbind( tmp )
+ .bind( tmp, function( e, external ) {
+ var $cell, cell, temp,
+ $target = $( e.target ),
+ // wrap event type in spaces, so the match doesn't trigger on inner words
+ type = ' ' + e.type + ' ';
+ // only recognize left clicks
+ if ( ( ( e.which || e.button ) !== 1 && !type.match( ' ' + c.pointerClick + ' | sort | keyup ' ) ) ||
+ // allow pressing enter
+ ( type === ' keyup ' && e.which !== ts.keyCodes.enter ) ||
+ // allow triggering a click event (e.which is undefined) & ignore physical clicks
+ ( type.match( ' ' + c.pointerClick + ' ' ) && typeof e.which !== 'undefined' ) ) {
+ return;
+ }
+ // ignore mouseup if mousedown wasn't on the same target
+ if ( type.match( ' ' + c.pointerUp + ' ' ) && downTarget !== e.target && external !== true ) {
+ return;
+ }
+ // set target on mousedown
+ if ( type.match( ' ' + c.pointerDown + ' ' ) ) {
+ downTarget = e.target;
+ // preventDefault needed or jQuery v1.3.2 and older throws an
+ // "Uncaught TypeError: handler.apply is not a function" error
+ temp = $target.jquery.split( '.' );
+ if ( temp[ 0 ] === '1' && temp[ 1 ] < 4 ) { e.preventDefault(); }
+ return;
+ }
+ downTarget = null;
+ $cell = ts.getClosest( $( this ), '.' + ts.css.header );
+ // prevent sort being triggered on form elements
+ if ( ts.regex.formElements.test( e.target.nodeName ) ||
+ // nosort class name, or elements within a nosort container
+ $target.hasClass( c.cssNoSort ) || $target.parents( '.' + c.cssNoSort ).length > 0 ||
+ // disabled cell directly clicked
+ $cell.hasClass( 'sorter-false' ) ||
+ // elements within a button
+ $target.parents( 'button' ).length > 0 ) {
+ return !c.cancelSelection;
+ }
+ if ( c.delayInit && ts.isEmptyObject( c.cache ) ) {
+ ts.buildCache( c );
+ }
+ // use column index from data-attribute or index of current row; fixes #1116
+ c.last.clickedIndex = $cell.attr( 'data-column' ) || $cell.index();
+ cell = c.$headerIndexed[ c.last.clickedIndex ][0];
+ if ( cell && !cell.sortDisabled ) {
+ ts.initSort( c, cell, e );
+ }
+ });
+ if ( c.cancelSelection ) {
+ // cancel selection
+ $headers
+ .attr( 'unselectable', 'on' )
+ .bind( 'selectstart', false )
+ .css({
+ 'user-select' : 'none',
+ 'MozUserSelect' : 'none' // not needed for jQuery 1.8+
+ });
+ }
+ },
+
+ buildHeaders : function( c ) {
+ var $temp, icon, timer, indx;
+ c.headerList = [];
+ c.headerContent = [];
+ c.sortVars = [];
+ if ( ts.debug(c, 'core') ) {
+ timer = new Date();
+ }
+ // children tr in tfoot - see issue #196 & #547
+ // don't pass table.config to computeColumnIndex here - widgets (math) pass it to "quickly" index tbody cells
+ c.columns = ts.computeColumnIndex( c.$table.children( 'thead, tfoot' ).children( 'tr' ) );
+ // add icon if cssIcon option exists
+ icon = c.cssIcon ?
+ '<i class="' + ( c.cssIcon === ts.css.icon ? ts.css.icon : c.cssIcon + ' ' + ts.css.icon ) + '"></i>' :
+ '';
+ // redefine c.$headers here in case of an updateAll that replaces or adds an entire header cell - see #683
+ c.$headers = $( $.map( c.$table.find( c.selectorHeaders ), function( elem, index ) {
+ var configHeaders, header, column, template, tmp,
+ $elem = $( elem );
+ // ignore cell (don't add it to c.$headers) if row has ignoreRow class
+ if ( ts.getClosest( $elem, 'tr' ).hasClass( c.cssIgnoreRow ) ) { return; }
+ // transfer data-column to element if not th/td - #1459
+ if ( !/(th|td)/i.test( elem.nodeName ) ) {
+ tmp = ts.getClosest( $elem, 'th, td' );
+ $elem.attr( 'data-column', tmp.attr( 'data-column' ) );
+ }
+ // make sure to get header cell & not column indexed cell
+ configHeaders = ts.getColumnData( c.table, c.headers, index, true );
+ // save original header content
+ c.headerContent[ index ] = $elem.html();
+ // if headerTemplate is empty, don't reformat the header cell
+ if ( c.headerTemplate !== '' && !$elem.find( '.' + ts.css.headerIn ).length ) {
+ // set up header template
+ template = c.headerTemplate
+ .replace( ts.regex.templateContent, $elem.html() )
+ .replace( ts.regex.templateIcon, $elem.find( '.' + ts.css.icon ).length ? '' : icon );
+ if ( c.onRenderTemplate ) {
+ header = c.onRenderTemplate.apply( $elem, [ index, template ] );
+ // only change t if something is returned
+ if ( header && typeof header === 'string' ) {
+ template = header;
+ }
+ }
+ $elem.html( '<div class="' + ts.css.headerIn + '">' + template + '</div>' ); // faster than wrapInner
+ }
+ if ( c.onRenderHeader ) {
+ c.onRenderHeader.apply( $elem, [ index, c, c.$table ] );
+ }
+ column = parseInt( $elem.attr( 'data-column' ), 10 );
+ elem.column = column;
+ tmp = ts.getOrder( ts.getData( $elem, configHeaders, 'sortInitialOrder' ) || c.sortInitialOrder );
+ // this may get updated numerous times if there are multiple rows
+ c.sortVars[ column ] = {
+ count : -1, // set to -1 because clicking on the header automatically adds one
+ order : tmp ?
+ ( c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ] ) : // desc, asc, unsorted
+ ( c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ] ), // asc, desc, unsorted
+ lockedOrder : false,
+ sortedBy : ''
+ };
+ tmp = ts.getData( $elem, configHeaders, 'lockedOrder' ) || false;
+ if ( typeof tmp !== 'undefined' && tmp !== false ) {
+ c.sortVars[ column ].lockedOrder = true;
+ c.sortVars[ column ].order = ts.getOrder( tmp ) ? [ 1, 1 ] : [ 0, 0 ];
+ }
+ // add cell to headerList
+ c.headerList[ index ] = elem;
+ $elem.addClass( ts.css.header + ' ' + c.cssHeader );
+ // add to parent in case there are multiple rows
+ ts.getClosest( $elem, 'tr' )
+ .addClass( ts.css.headerRow + ' ' + c.cssHeaderRow )
+ .attr( 'role', 'row' );
+ // allow keyboard cursor to focus on element
+ if ( c.tabIndex ) {
+ $elem.attr( 'tabindex', 0 );
+ }
+ return elem;
+ }) );
+ // cache headers per column
+ c.$headerIndexed = [];
+ for ( indx = 0; indx < c.columns; indx++ ) {
+ // colspan in header making a column undefined
+ if ( ts.isEmptyObject( c.sortVars[ indx ] ) ) {
+ c.sortVars[ indx ] = {};
+ }
+ // Use c.$headers.parent() in case selectorHeaders doesn't point to the th/td
+ $temp = c.$headers.filter( '[data-column="' + indx + '"]' );
+ // target sortable column cells, unless there are none, then use non-sortable cells
+ // .last() added in jQuery 1.4; use .filter(':last') to maintain compatibility with jQuery v1.2.6
+ c.$headerIndexed[ indx ] = $temp.length ?
+ $temp.not( '.sorter-false' ).length ?
+ $temp.not( '.sorter-false' ).filter( ':last' ) :
+ $temp.filter( ':last' ) :
+ $();
+ }
+ c.$table.find( c.selectorHeaders ).attr({
+ scope: 'col',
+ role : 'columnheader'
+ });
+ // enable/disable sorting
+ ts.updateHeader( c );
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Built headers:' + ts.benchmark( timer ) );
+ console.log( c.$headers );
+ }
+ },
+
+ // Use it to add a set of methods to table.config which will be available for all tables.
+ // This should be done before table initialization
+ addInstanceMethods : function( methods ) {
+ $.extend( ts.instanceMethods, methods );
+ },
+
+ /*
+ █████▄ ▄████▄ █████▄ ▄█████ ██████ █████▄ ▄█████
+ ██▄▄██ ██▄▄██ ██▄▄██ ▀█▄ ██▄▄ ██▄▄██ ▀█▄
+ ██▀▀▀ ██▀▀██ ██▀██ ▀█▄ ██▀▀ ██▀██ ▀█▄
+ ██ ██ ██ ██ ██ █████▀ ██████ ██ ██ █████▀
+ */
+ setupParsers : function( c, $tbodies ) {
+ var rows, list, span, max, colIndex, indx, header, configHeaders,
+ noParser, parser, extractor, time, tbody, len,
+ table = c.table,
+ tbodyIndex = 0,
+ debug = ts.debug(c, 'core'),
+ debugOutput = {};
+ // update table bodies in case we start with an empty table
+ c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
+ tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies;
+ len = tbody.length;
+ if ( len === 0 ) {
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : '';
+ } else if ( debug ) {
+ time = new Date();
+ console[ console.group ? 'group' : 'log' ]( 'Detecting parsers for each column' );
+ }
+ list = {
+ extractors: [],
+ parsers: []
+ };
+ while ( tbodyIndex < len ) {
+ rows = tbody[ tbodyIndex ].rows;
+ if ( rows.length ) {
+ colIndex = 0;
+ max = c.columns;
+ for ( indx = 0; indx < max; indx++ ) {
+ header = c.$headerIndexed[ colIndex ];
+ if ( header && header.length ) {
+ // get column indexed table cell; adding true parameter fixes #1362 but
+ // it would break backwards compatibility...
+ configHeaders = ts.getColumnData( table, c.headers, colIndex ); // , true );
+ // get column parser/extractor
+ extractor = ts.getParserById( ts.getData( header, configHeaders, 'extractor' ) );
+ parser = ts.getParserById( ts.getData( header, configHeaders, 'sorter' ) );
+ noParser = ts.getData( header, configHeaders, 'parser' ) === 'false';
+ // empty cells behaviour - keeping emptyToBottom for backwards compatibility
+ c.empties[colIndex] = (
+ ts.getData( header, configHeaders, 'empty' ) ||
+ c.emptyTo || ( c.emptyToBottom ? 'bottom' : 'top' ) ).toLowerCase();
+ // text strings behaviour in numerical sorts
+ c.strings[colIndex] = (
+ ts.getData( header, configHeaders, 'string' ) ||
+ c.stringTo ||
+ 'max' ).toLowerCase();
+ if ( noParser ) {
+ parser = ts.getParserById( 'no-parser' );
+ }
+ if ( !extractor ) {
+ // For now, maybe detect someday
+ extractor = false;
+ }
+ if ( !parser ) {
+ parser = ts.detectParserForColumn( c, rows, -1, colIndex );
+ }
+ if ( debug ) {
+ debugOutput[ '(' + colIndex + ') ' + header.text() ] = {
+ parser : parser.id,
+ extractor : extractor ? extractor.id : 'none',
+ string : c.strings[ colIndex ],
+ empty : c.empties[ colIndex ]
+ };
+ }
+ list.parsers[ colIndex ] = parser;
+ list.extractors[ colIndex ] = extractor;
+ span = header[ 0 ].colSpan - 1;
+ if ( span > 0 ) {
+ colIndex += span;
+ max += span;
+ while ( span + 1 > 0 ) {
+ // set colspan columns to use the same parsers & extractors
+ list.parsers[ colIndex - span ] = parser;
+ list.extractors[ colIndex - span ] = extractor;
+ span--;
+ }
+ }
+ }
+ colIndex++;
+ }
+ }
+ tbodyIndex += ( list.parsers.length ) ? len : 1;
+ }
+ if ( debug ) {
+ if ( !ts.isEmptyObject( debugOutput ) ) {
+ console[ console.table ? 'table' : 'log' ]( debugOutput );
+ } else {
+ console.warn( ' No parsers detected!' );
+ }
+ console.log( 'Completed detecting parsers' + ts.benchmark( time ) );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ c.parsers = list.parsers;
+ c.extractors = list.extractors;
+ },
+
+ addParser : function( parser ) {
+ var indx,
+ len = ts.parsers.length,
+ add = true;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( ts.parsers[ indx ].id.toLowerCase() === parser.id.toLowerCase() ) {
+ add = false;
+ }
+ }
+ if ( add ) {
+ ts.parsers[ ts.parsers.length ] = parser;
+ }
+ },
+
+ getParserById : function( name ) {
+ /*jshint eqeqeq:false */ // eslint-disable-next-line eqeqeq
+ if ( name == 'false' ) { return false; }
+ var indx,
+ len = ts.parsers.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( ts.parsers[ indx ].id.toLowerCase() === ( name.toString() ).toLowerCase() ) {
+ return ts.parsers[ indx ];
+ }
+ }
+ return false;
+ },
+
+ detectParserForColumn : function( c, rows, rowIndex, cellIndex ) {
+ var cur, $node, row,
+ indx = ts.parsers.length,
+ node = false,
+ nodeValue = '',
+ debug = ts.debug(c, 'core'),
+ keepLooking = true;
+ while ( nodeValue === '' && keepLooking ) {
+ rowIndex++;
+ row = rows[ rowIndex ];
+ // stop looking after 50 empty rows
+ if ( row && rowIndex < 50 ) {
+ if ( row.className.indexOf( ts.cssIgnoreRow ) < 0 ) {
+ node = rows[ rowIndex ].cells[ cellIndex ];
+ nodeValue = ts.getElementText( c, node, cellIndex );
+ $node = $( node );
+ if ( debug ) {
+ console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
+ cellIndex + ': "' + nodeValue + '"' );
+ }
+ }
+ } else {
+ keepLooking = false;
+ }
+ }
+ while ( --indx >= 0 ) {
+ cur = ts.parsers[ indx ];
+ // ignore the default text parser because it will always be true
+ if ( cur && cur.id !== 'text' && cur.is && cur.is( nodeValue, c.table, node, $node ) ) {
+ return cur;
+ }
+ }
+ // nothing found, return the generic parser (text)
+ return ts.getParserById( 'text' );
+ },
+
+ getElementText : function( c, node, cellIndex ) {
+ if ( !node ) { return ''; }
+ var tmp,
+ extract = c.textExtraction || '',
+ // node could be a jquery object
+ // http://jsperf.com/jquery-vs-instanceof-jquery/2
+ $node = node.jquery ? node : $( node );
+ if ( typeof extract === 'string' ) {
+ // check data-attribute first when set to 'basic'; don't use node.innerText - it's really slow!
+ // http://www.kellegous.com/j/2013/02/27/innertext-vs-textcontent/
+ if ( extract === 'basic' && typeof ( tmp = $node.attr( c.textAttribute ) ) !== 'undefined' ) {
+ return $.trim( tmp );
+ }
+ return $.trim( node.textContent || $node.text() );
+ } else {
+ if ( typeof extract === 'function' ) {
+ return $.trim( extract( $node[ 0 ], c.table, cellIndex ) );
+ } else if ( typeof ( tmp = ts.getColumnData( c.table, extract, cellIndex ) ) === 'function' ) {
+ return $.trim( tmp( $node[ 0 ], c.table, cellIndex ) );
+ }
+ }
+ // fallback
+ return $.trim( $node[ 0 ].textContent || $node.text() );
+ },
+
+ // centralized function to extract/parse cell contents
+ getParsedText : function( c, cell, colIndex, txt ) {
+ if ( typeof txt === 'undefined' ) {
+ txt = ts.getElementText( c, cell, colIndex );
+ }
+ // if no parser, make sure to return the txt
+ var val = '' + txt,
+ parser = c.parsers[ colIndex ],
+ extractor = c.extractors[ colIndex ];
+ if ( parser ) {
+ // do extract before parsing, if there is one
+ if ( extractor && typeof extractor.format === 'function' ) {
+ txt = extractor.format( txt, c.table, cell, colIndex );
+ }
+ // allow parsing if the string is empty, previously parsing would change it to zero,
+ // in case the parser needs to extract data from the table cell attributes
+ val = parser.id === 'no-parser' ? '' :
+ // make sure txt is a string (extractor may have converted it)
+ parser.format( '' + txt, c.table, cell, colIndex );
+ if ( c.ignoreCase && typeof val === 'string' ) {
+ val = val.toLowerCase();
+ }
+ }
+ return val;
+ },
+
+ /*
+ ▄████▄ ▄████▄ ▄████▄ ██ ██ ██████
+ ██ ▀▀ ██▄▄██ ██ ▀▀ ██▄▄██ ██▄▄
+ ██ ▄▄ ██▀▀██ ██ ▄▄ ██▀▀██ ██▀▀
+ ▀████▀ ██ ██ ▀████▀ ██ ██ ██████
+ */
+ buildCache : function( c, callback, $tbodies ) {
+ var cache, val, txt, rowIndex, colIndex, tbodyIndex, $tbody, $row,
+ cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
+ colMax, span, cacheIndex, hasParser, max, len, index,
+ table = c.table,
+ parsers = c.parsers,
+ debug = ts.debug(c, 'core');
+ // update tbody variable
+ c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
+ $tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies,
+ c.cache = {};
+ c.totalRows = 0;
+ // if no parsers found, return - it's an empty table.
+ if ( !parsers ) {
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : '';
+ }
+ if ( debug ) {
+ cacheTime = new Date();
+ }
+ // processing icon
+ if ( c.showProcessing ) {
+ ts.isProcessing( table, true );
+ }
+ for ( tbodyIndex = 0; tbodyIndex < $tbody.length; tbodyIndex++ ) {
+ colMax = []; // column max value per tbody
+ cache = c.cache[ tbodyIndex ] = {
+ normalized: [] // array of normalized row data; last entry contains 'rowData' above
+ // colMax: # // added at the end
+ };
+
+ totalRows = ( $tbody[ tbodyIndex ] && $tbody[ tbodyIndex ].rows.length ) || 0;
+ for ( rowIndex = 0; rowIndex < totalRows; ++rowIndex ) {
+ rowData = {
+ // order: original row order #
+ // $row : jQuery Object[]
+ child: [], // child row text (filter widget)
+ raw: [] // original row text
+ };
+ /** Add the table data to main data array */
+ $row = $( $tbody[ tbodyIndex ].rows[ rowIndex ] );
+ cols = [];
+ // ignore "remove-me" rows
+ if ( $row.hasClass( c.selectorRemove.slice(1) ) ) {
+ continue;
+ }
+ // if this is a child row, add it to the last row's children and continue to the next row
+ // ignore child row class, if it is the first row
+ if ( $row.hasClass( c.cssChildRow ) && rowIndex !== 0 ) {
+ len = cache.normalized.length - 1;
+ prevRowData = cache.normalized[ len ][ c.columns ];
+ prevRowData.$row = prevRowData.$row.add( $row );
+ // add 'hasChild' class name to parent row
+ if ( !$row.prev().hasClass( c.cssChildRow ) ) {
+ $row.prev().addClass( ts.css.cssHasChild );
+ }
+ // save child row content (un-parsed!)
+ $cells = $row.children( 'th, td' );
+ len = prevRowData.child.length;
+ prevRowData.child[ len ] = [];
+ // child row content does not account for colspans/rowspans; so indexing may be off
+ cacheIndex = 0;
+ max = c.columns;
+ for ( colIndex = 0; colIndex < max; colIndex++ ) {
+ cell = $cells[ colIndex ];
+ if ( cell ) {
+ prevRowData.child[ len ][ colIndex ] = ts.getParsedText( c, cell, colIndex );
+ span = $cells[ colIndex ].colSpan - 1;
+ if ( span > 0 ) {
+ cacheIndex += span;
+ max += span;
+ }
+ }
+ cacheIndex++;
+ }
+ // go to the next for loop
+ continue;
+ }
+ rowData.$row = $row;
+ rowData.order = rowIndex; // add original row position to rowCache
+ cacheIndex = 0;
+ max = c.columns;
+ for ( colIndex = 0; colIndex < max; ++colIndex ) {
+ cell = $row[ 0 ].cells[ colIndex ];
+ if ( cell && cacheIndex < c.columns ) {
+ hasParser = typeof parsers[ cacheIndex ] !== 'undefined';
+ if ( !hasParser && debug ) {
+ console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex +
+ '; cell containing: "' + $(cell).text() + '"; does it have a header?' );
+ }
+ val = ts.getElementText( c, cell, cacheIndex );
+ rowData.raw[ cacheIndex ] = val; // save original row text
+ // save raw column text even if there is no parser set
+ txt = ts.getParsedText( c, cell, cacheIndex, val );
+ cols[ cacheIndex ] = txt;
+ if ( hasParser && ( parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
+ // determine column max value (ignore sign)
+ colMax[ cacheIndex ] = Math.max( Math.abs( txt ) || 0, colMax[ cacheIndex ] || 0 );
+ }
+ // allow colSpan in tbody
+ span = cell.colSpan - 1;
+ if ( span > 0 ) {
+ index = 0;
+ while ( index <= span ) {
+ // duplicate text (or not) to spanned columns
+ // instead of setting duplicate span to empty string, use textExtraction to try to get a value
+ // see http://stackoverflow.com/q/36449711/145346
+ txt = c.duplicateSpan || index === 0 ?
+ val :
+ typeof c.textExtraction !== 'string' ?
+ ts.getElementText( c, cell, cacheIndex + index ) || '' :
+ '';
+ rowData.raw[ cacheIndex + index ] = txt;
+ cols[ cacheIndex + index ] = txt;
+ index++;
+ }
+ cacheIndex += span;
+ max += span;
+ }
+ }
+ cacheIndex++;
+ }
+ // ensure rowData is always in the same location (after the last column)
+ cols[ c.columns ] = rowData;
+ cache.normalized[ cache.normalized.length ] = cols;
+ }
+ cache.colMax = colMax;
+ // total up rows, not including child rows
+ c.totalRows += cache.normalized.length;
+
+ }
+ if ( c.showProcessing ) {
+ ts.isProcessing( table ); // remove processing icon
+ }
+ if ( debug ) {
+ len = Math.min( 5, c.cache[ 0 ].normalized.length );
+ console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows +
+ ' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' +
+ ts.benchmark( cacheTime ) );
+ val = {};
+ for ( colIndex = 0; colIndex < c.columns; colIndex++ ) {
+ for ( cacheIndex = 0; cacheIndex < len; cacheIndex++ ) {
+ if ( !val[ 'row: ' + cacheIndex ] ) {
+ val[ 'row: ' + cacheIndex ] = {};
+ }
+ val[ 'row: ' + cacheIndex ][ c.$headerIndexed[ colIndex ].text() ] =
+ c.cache[ 0 ].normalized[ cacheIndex ][ colIndex ];
+ }
+ }
+ console[ console.table ? 'table' : 'log' ]( val );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ if ( $.isFunction( callback ) ) {
+ callback( table );
+ }
+ },
+
+ getColumnText : function( table, column, callback, rowFilter ) {
+ table = $( table )[0];
+ var tbodyIndex, rowIndex, cache, row, tbodyLen, rowLen, raw, parsed, $cell, result,
+ hasCallback = typeof callback === 'function',
+ allColumns = column === 'all',
+ data = { raw : [], parsed: [], $cell: [] },
+ c = table.config;
+ if ( ts.isEmptyObject( c ) ) {
+ if ( ts.debug(c, 'core') ) {
+ console.warn( 'No cache found - aborting getColumnText function!' );
+ }
+ } else {
+ tbodyLen = c.$tbodies.length;
+ for ( tbodyIndex = 0; tbodyIndex < tbodyLen; tbodyIndex++ ) {
+ cache = c.cache[ tbodyIndex ].normalized;
+ rowLen = cache.length;
+ for ( rowIndex = 0; rowIndex < rowLen; rowIndex++ ) {
+ row = cache[ rowIndex ];
+ if ( rowFilter && !row[ c.columns ].$row.is( rowFilter ) ) {
+ continue;
+ }
+ result = true;
+ parsed = ( allColumns ) ? row.slice( 0, c.columns ) : row[ column ];
+ row = row[ c.columns ];
+ raw = ( allColumns ) ? row.raw : row.raw[ column ];
+ $cell = ( allColumns ) ? row.$row.children() : row.$row.children().eq( column );
+ if ( hasCallback ) {
+ result = callback({
+ tbodyIndex : tbodyIndex,
+ rowIndex : rowIndex,
+ parsed : parsed,
+ raw : raw,
+ $row : row.$row,
+ $cell : $cell
+ });
+ }
+ if ( result !== false ) {
+ data.parsed[ data.parsed.length ] = parsed;
+ data.raw[ data.raw.length ] = raw;
+ data.$cell[ data.$cell.length ] = $cell;
+ }
+ }
+ }
+ // return everything
+ return data;
+ }
+ },
+
+ /*
+ ██ ██ █████▄ █████▄ ▄████▄ ██████ ██████
+ ██ ██ ██▄▄██ ██ ██ ██▄▄██ ██ ██▄▄
+ ██ ██ ██▀▀▀ ██ ██ ██▀▀██ ██ ██▀▀
+ ▀████▀ ██ █████▀ ██ ██ ██ ██████
+ */
+ setHeadersCss : function( c ) {
+ var indx, column,
+ list = c.sortList,
+ len = list.length,
+ none = ts.css.sortNone + ' ' + c.cssNone,
+ css = [ ts.css.sortAsc + ' ' + c.cssAsc, ts.css.sortDesc + ' ' + c.cssDesc ],
+ cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ],
+ aria = [ 'ascending', 'descending' ],
+ updateColumnSort = function($el, index) {
+ $el
+ .removeClass( none )
+ .addClass( css[ index ] )
+ .attr( 'aria-sort', aria[ index ] )
+ .find( '.' + ts.css.icon )
+ .removeClass( cssIcon[ 2 ] )
+ .addClass( cssIcon[ index ] );
+ },
+ // find the footer
+ $extras = c.$table
+ .find( 'tfoot tr' )
+ .children( 'td, th' )
+ .add( $( c.namespace + '_extra_headers' ) )
+ .removeClass( css.join( ' ' ) ),
+ // remove all header information
+ $sorted = c.$headers
+ .add( $( 'thead ' + c.namespace + '_extra_headers' ) )
+ .removeClass( css.join( ' ' ) )
+ .addClass( none )
+ .attr( 'aria-sort', 'none' )
+ .find( '.' + ts.css.icon )
+ .removeClass( cssIcon.join( ' ' ) )
+ .end();
+ // add css none to all sortable headers
+ $sorted
+ .not( '.sorter-false' )
+ .find( '.' + ts.css.icon )
+ .addClass( cssIcon[ 2 ] );
+ // add disabled css icon class
+ if ( c.cssIconDisabled ) {
+ $sorted
+ .filter( '.sorter-false' )
+ .find( '.' + ts.css.icon )
+ .addClass( c.cssIconDisabled );
+ }
+ for ( indx = 0; indx < len; indx++ ) {
+ // direction = 2 means reset!
+ if ( list[ indx ][ 1 ] !== 2 ) {
+ // multicolumn sorting updating - see #1005
+ // .not(function() {}) needs jQuery 1.4
+ // filter(function(i, el) {}) <- el is undefined in jQuery v1.2.6
+ $sorted = c.$headers.filter( function( i ) {
+ // only include headers that are in the sortList (this includes colspans)
+ var include = true,
+ $el = c.$headers.eq( i ),
+ col = parseInt( $el.attr( 'data-column' ), 10 ),
+ end = col + ts.getClosest( $el, 'th, td' )[0].colSpan;
+ for ( ; col < end; col++ ) {
+ include = include ? include || ts.isValueInArray( col, c.sortList ) > -1 : false;
+ }
+ return include;
+ });
+
+ // choose the :last in case there are nested columns
+ $sorted = $sorted
+ .not( '.sorter-false' )
+ .filter( '[data-column="' + list[ indx ][ 0 ] + '"]' + ( len === 1 ? ':last' : '' ) );
+ if ( $sorted.length ) {
+ for ( column = 0; column < $sorted.length; column++ ) {
+ if ( !$sorted[ column ].sortDisabled ) {
+ updateColumnSort( $sorted.eq( column ), list[ indx ][ 1 ] );
+ }
+ }
+ }
+ // add sorted class to footer & extra headers, if they exist
+ if ( $extras.length ) {
+ updateColumnSort( $extras.filter( '[data-column="' + list[ indx ][ 0 ] + '"]' ), list[ indx ][ 1 ] );
+ }
+ }
+ }
+ // add verbose aria labels
+ len = c.$headers.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ ts.setColumnAriaLabel( c, c.$headers.eq( indx ) );
+ }
+ },
+
+ getClosest : function( $el, selector ) {
+ // jQuery v1.2.6 doesn't have closest()
+ if ( $.fn.closest ) {
+ return $el.closest( selector );
+ }
+ return $el.is( selector ) ?
+ $el :
+ $el.parents( selector ).filter( ':first' );
+ },
+
+ // nextSort (optional), lets you disable next sort text
+ setColumnAriaLabel : function( c, $header, nextSort ) {
+ if ( $header.length ) {
+ var column = parseInt( $header.attr( 'data-column' ), 10 ),
+ vars = c.sortVars[ column ],
+ tmp = $header.hasClass( ts.css.sortAsc ) ?
+ 'sortAsc' :
+ $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone',
+ txt = $.trim( $header.text() ) + ': ' + ts.language[ tmp ];
+ if ( $header.hasClass( 'sorter-false' ) || nextSort === false ) {
+ txt += ts.language.sortDisabled;
+ } else {
+ tmp = ( vars.count + 1 ) % vars.order.length;
+ nextSort = vars.order[ tmp ];
+ // if nextSort
+ txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ];
+ }
+ $header.attr( 'aria-label', txt );
+ if (vars.sortedBy) {
+ $header.attr( 'data-sortedBy', vars.sortedBy );
+ } else {
+ $header.removeAttr('data-sortedBy');
+ }
+ }
+ },
+
+ updateHeader : function( c ) {
+ var index, isDisabled, $header, col,
+ table = c.table,
+ len = c.$headers.length;
+ for ( index = 0; index < len; index++ ) {
+ $header = c.$headers.eq( index );
+ col = ts.getColumnData( table, c.headers, index, true );
+ // add 'sorter-false' class if 'parser-false' is set
+ isDisabled = ts.getData( $header, col, 'sorter' ) === 'false' || ts.getData( $header, col, 'parser' ) === 'false';
+ ts.setColumnSort( c, $header, isDisabled );
+ }
+ },
+
+ setColumnSort : function( c, $header, isDisabled ) {
+ var id = c.table.id;
+ $header[ 0 ].sortDisabled = isDisabled;
+ $header[ isDisabled ? 'addClass' : 'removeClass' ]( 'sorter-false' )
+ .attr( 'aria-disabled', '' + isDisabled );
+ // disable tab index on disabled cells
+ if ( c.tabIndex ) {
+ if ( isDisabled ) {
+ $header.removeAttr( 'tabindex' );
+ } else {
+ $header.attr( 'tabindex', '0' );
+ }
+ }
+ // aria-controls - requires table ID
+ if ( id ) {
+ if ( isDisabled ) {
+ $header.removeAttr( 'aria-controls' );
+ } else {
+ $header.attr( 'aria-controls', id );
+ }
+ }
+ },
+
+ updateHeaderSortCount : function( c, list ) {
+ var col, dir, group, indx, primary, temp, val, order,
+ sortList = list || c.sortList,
+ len = sortList.length;
+ c.sortList = [];
+ for ( indx = 0; indx < len; indx++ ) {
+ val = sortList[ indx ];
+ // ensure all sortList values are numeric - fixes #127
+ col = parseInt( val[ 0 ], 10 );
+ // prevents error if sorton array is wrong
+ if ( col < c.columns ) {
+
+ // set order if not already defined - due to colspan header without associated header cell
+ // adding this check prevents a javascript error
+ if ( !c.sortVars[ col ].order ) {
+ if ( ts.getOrder( c.sortInitialOrder ) ) {
+ order = c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ];
+ } else {
+ order = c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ];
+ }
+ c.sortVars[ col ].order = order;
+ c.sortVars[ col ].count = 0;
+ }
+
+ order = c.sortVars[ col ].order;
+ dir = ( '' + val[ 1 ] ).match( /^(1|d|s|o|n)/ );
+ dir = dir ? dir[ 0 ] : '';
+ // 0/(a)sc (default), 1/(d)esc, (s)ame, (o)pposite, (n)ext
+ switch ( dir ) {
+ case '1' : case 'd' : // descending
+ dir = 1;
+ break;
+ case 's' : // same direction (as primary column)
+ // if primary sort is set to 's', make it ascending
+ dir = primary || 0;
+ break;
+ case 'o' :
+ temp = order[ ( primary || 0 ) % order.length ];
+ // opposite of primary column; but resets if primary resets
+ dir = temp === 0 ? 1 : temp === 1 ? 0 : 2;
+ break;
+ case 'n' :
+ dir = order[ ( ++c.sortVars[ col ].count ) % order.length ];
+ break;
+ default : // ascending
+ dir = 0;
+ break;
+ }
+ primary = indx === 0 ? dir : primary;
+ group = [ col, parseInt( dir, 10 ) || 0 ];
+ c.sortList[ c.sortList.length ] = group;
+ dir = $.inArray( group[ 1 ], order ); // fixes issue #167
+ c.sortVars[ col ].count = dir >= 0 ? dir : group[ 1 ] % order.length;
+ }
+ }
+ },
+
+ updateAll : function( c, resort, callback ) {
+ var table = c.table;
+ table.isUpdating = true;
+ ts.refreshWidgets( table, true, true );
+ ts.buildHeaders( c );
+ ts.bindEvents( table, c.$headers, true );
+ ts.bindMethods( c );
+ ts.commonUpdate( c, resort, callback );
+ },
+
+ update : function( c, resort, callback ) {
+ var table = c.table;
+ table.isUpdating = true;
+ // update sorting (if enabled/disabled)
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ },
+
+ // simple header update - see #989
+ updateHeaders : function( c, callback ) {
+ c.table.isUpdating = true;
+ ts.buildHeaders( c );
+ ts.bindEvents( c.table, c.$headers, true );
+ ts.resortComplete( c, callback );
+ },
+
+ updateCell : function( c, cell, resort, callback ) {
+ // updateCell for child rows is a mess - we'll ignore them for now
+ // eventually I'll break out the "update" row cache code to make everything consistent
+ if ( $( cell ).closest( 'tr' ).hasClass( c.cssChildRow ) ) {
+ console.warn('Tablesorter Warning! "updateCell" for child row content has been disabled, use "update" instead');
+ return;
+ }
+ if ( ts.isEmptyObject( c.cache ) ) {
+ // empty table, do an update instead - fixes #1099
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ return;
+ }
+ c.table.isUpdating = true;
+ c.$table.find( c.selectorRemove ).remove();
+ // get position from the dom
+ var tmp, indx, row, icell, cache, len,
+ $tbodies = c.$tbodies,
+ $cell = $( cell ),
+ // update cache - format: function( s, table, cell, cellIndex )
+ // no closest in jQuery v1.2.6
+ tbodyIndex = $tbodies.index( ts.getClosest( $cell, 'tbody' ) ),
+ tbcache = c.cache[ tbodyIndex ],
+ $row = ts.getClosest( $cell, 'tr' );
+ cell = $cell[ 0 ]; // in case cell is a jQuery object
+ // tbody may not exist if update is initialized while tbody is removed for processing
+ if ( $tbodies.length && tbodyIndex >= 0 ) {
+ row = $tbodies.eq( tbodyIndex ).find( 'tr' ).not( '.' + c.cssChildRow ).index( $row );
+ cache = tbcache.normalized[ row ];
+ len = $row[ 0 ].cells.length;
+ if ( len !== c.columns ) {
+ // colspan in here somewhere!
+ icell = 0;
+ tmp = false;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( !tmp && $row[ 0 ].cells[ indx ] !== cell ) {
+ icell += $row[ 0 ].cells[ indx ].colSpan;
+ } else {
+ tmp = true;
+ }
+ }
+ } else {
+ icell = $cell.index();
+ }
+ tmp = ts.getElementText( c, cell, icell ); // raw
+ cache[ c.columns ].raw[ icell ] = tmp;
+ tmp = ts.getParsedText( c, cell, icell, tmp );
+ cache[ icell ] = tmp; // parsed
+ if ( ( c.parsers[ icell ].type || '' ).toLowerCase() === 'numeric' ) {
+ // update column max value (ignore sign)
+ tbcache.colMax[ icell ] = Math.max( Math.abs( tmp ) || 0, tbcache.colMax[ icell ] || 0 );
+ }
+ tmp = resort !== 'undefined' ? resort : c.resort;
+ if ( tmp !== false ) {
+ // widgets will be reapplied
+ ts.checkResort( c, tmp, callback );
+ } else {
+ // don't reapply widgets is resort is false, just in case it causes
+ // problems with element focus
+ ts.resortComplete( c, callback );
+ }
+ } else {
+ if ( ts.debug(c, 'core') ) {
+ console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
+ }
+ c.table.isUpdating = false;
+ }
+ },
+
+ addRows : function( c, $row, resort, callback ) {
+ var txt, val, tbodyIndex, rowIndex, rows, cellIndex, len, order,
+ cacheIndex, rowData, cells, cell, span,
+ // allow passing a row string if only one non-info tbody exists in the table
+ valid = typeof $row === 'string' && c.$tbodies.length === 1 && /<tr/.test( $row || '' ),
+ table = c.table;
+ if ( valid ) {
+ $row = $( $row );
+ c.$tbodies.append( $row );
+ } else if (
+ !$row ||
+ // row is a jQuery object?
+ !( $row instanceof $ ) ||
+ // row contained in the table?
+ ( ts.getClosest( $row, 'table' )[ 0 ] !== c.table )
+ ) {
+ if ( ts.debug(c, 'core') ) {
+ console.error( 'addRows method requires (1) a jQuery selector reference to rows that have already ' +
+ 'been added to the table, or (2) row HTML string to be added to a table with only one tbody' );
+ }
+ return false;
+ }
+ table.isUpdating = true;
+ if ( ts.isEmptyObject( c.cache ) ) {
+ // empty table, do an update instead - fixes #450
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ } else {
+ rows = $row.filter( 'tr' ).attr( 'role', 'row' ).length;
+ tbodyIndex = c.$tbodies.index( $row.parents( 'tbody' ).filter( ':first' ) );
+ // fixes adding rows to an empty table - see issue #179
+ if ( !( c.parsers && c.parsers.length ) ) {
+ ts.setupParsers( c );
+ }
+ // add each row
+ for ( rowIndex = 0; rowIndex < rows; rowIndex++ ) {
+ cacheIndex = 0;
+ len = $row[ rowIndex ].cells.length;
+ order = c.cache[ tbodyIndex ].normalized.length;
+ cells = [];
+ rowData = {
+ child : [],
+ raw : [],
+ $row : $row.eq( rowIndex ),
+ order : order
+ };
+ // add each cell
+ for ( cellIndex = 0; cellIndex < len; cellIndex++ ) {
+ cell = $row[ rowIndex ].cells[ cellIndex ];
+ txt = ts.getElementText( c, cell, cacheIndex );
+ rowData.raw[ cacheIndex ] = txt;
+ val = ts.getParsedText( c, cell, cacheIndex, txt );
+ cells[ cacheIndex ] = val;
+ if ( ( c.parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
+ // update column max value (ignore sign)
+ c.cache[ tbodyIndex ].colMax[ cacheIndex ] =
+ Math.max( Math.abs( val ) || 0, c.cache[ tbodyIndex ].colMax[ cacheIndex ] || 0 );
+ }
+ span = cell.colSpan - 1;
+ if ( span > 0 ) {
+ cacheIndex += span;
+ }
+ cacheIndex++;
+ }
+ // add the row data to the end
+ cells[ c.columns ] = rowData;
+ // update cache
+ c.cache[ tbodyIndex ].normalized[ order ] = cells;
+ }
+ // resort using current settings
+ ts.checkResort( c, resort, callback );
+ }
+ },
+
+ updateCache : function( c, callback, $tbodies ) {
+ // rebuild parsers
+ if ( !( c.parsers && c.parsers.length ) ) {
+ ts.setupParsers( c, $tbodies );
+ }
+ // rebuild the cache map
+ ts.buildCache( c, callback, $tbodies );
+ },
+
+ // init flag (true) used by pager plugin to prevent widget application
+ // renamed from appendToTable
+ appendCache : function( c, init ) {
+ var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime,
+ table = c.table,
+ $tbodies = c.$tbodies,
+ rows = [],
+ cache = c.cache;
+ // empty table - fixes #206/#346
+ if ( ts.isEmptyObject( cache ) ) {
+ // run pager appender in case the table was just emptied
+ return c.appender ? c.appender( table, rows ) :
+ table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532
+ }
+ if ( ts.debug(c, 'core') ) {
+ appendTime = new Date();
+ }
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = $tbodies.eq( tbodyIndex );
+ if ( $tbody.length ) {
+ // detach tbody for manipulation
+ $curTbody = ts.processTbody( table, $tbody, true );
+ parsed = cache[ tbodyIndex ].normalized;
+ totalRows = parsed.length;
+ for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) {
+ rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row;
+ // removeRows used by the pager plugin; don't render if using ajax - fixes #411
+ if ( !c.appender || ( c.pager && !c.pager.removeRows && !c.pager.ajax ) ) {
+ $curTbody.append( parsed[ rowIndex ][ c.columns ].$row );
+ }
+ }
+ // restore tbody
+ ts.processTbody( table, $curTbody, false );
+ }
+ }
+ if ( c.appender ) {
+ c.appender( table, rows );
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Rebuilt table' + ts.benchmark( appendTime ) );
+ }
+ // apply table widgets; but not before ajax completes
+ if ( !init && !c.appender ) {
+ ts.applyWidget( table );
+ }
+ if ( table.isUpdating ) {
+ c.$table.triggerHandler( 'updateComplete', table );
+ }
+ },
+
+ commonUpdate : function( c, resort, callback ) {
+ // remove rows/elements before update
+ c.$table.find( c.selectorRemove ).remove();
+ // rebuild parsers
+ ts.setupParsers( c );
+ // rebuild the cache map
+ ts.buildCache( c );
+ ts.checkResort( c, resort, callback );
+ },
+
+ /*
+ ▄█████ ▄████▄ █████▄ ██████ ██ █████▄ ▄████▄
+ ▀█▄ ██ ██ ██▄▄██ ██ ██ ██ ██ ██ ▄▄▄
+ ▀█▄ ██ ██ ██▀██ ██ ██ ██ ██ ██ ▀██
+ █████▀ ▀████▀ ██ ██ ██ ██ ██ ██ ▀████▀
+ */
+ initSort : function( c, cell, event ) {
+ if ( c.table.isUpdating ) {
+ // let any updates complete before initializing a sort
+ return setTimeout( function() {
+ ts.initSort( c, cell, event );
+ }, 50 );
+ }
+
+ var arry, indx, headerIndx, dir, temp, tmp, $header,
+ notMultiSort = !event[ c.sortMultiSortKey ],
+ table = c.table,
+ len = c.$headers.length,
+ th = ts.getClosest( $( cell ), 'th, td' ),
+ col = parseInt( th.attr( 'data-column' ), 10 ),
+ sortedBy = event.type === 'mouseup' ? 'user' : event.type,
+ order = c.sortVars[ col ].order;
+ th = th[0];
+ // Only call sortStart if sorting is enabled
+ c.$table.triggerHandler( 'sortStart', table );
+ // get current column sort order
+ tmp = ( c.sortVars[ col ].count + 1 ) % order.length;
+ c.sortVars[ col ].count = event[ c.sortResetKey ] ? 2 : tmp;
+ // reset all sorts on non-current column - issue #30
+ if ( c.sortRestart ) {
+ for ( headerIndx = 0; headerIndx < len; headerIndx++ ) {
+ $header = c.$headers.eq( headerIndx );
+ tmp = parseInt( $header.attr( 'data-column' ), 10 );
+ // only reset counts on columns that weren't just clicked on and if not included in a multisort
+ if ( col !== tmp && ( notMultiSort || $header.hasClass( ts.css.sortNone ) ) ) {
+ c.sortVars[ tmp ].count = -1;
+ }
+ }
+ }
+ // user only wants to sort on one column
+ if ( notMultiSort ) {
+ $.each( c.sortVars, function( i ) {
+ c.sortVars[ i ].sortedBy = '';
+ });
+ // flush the sort list
+ c.sortList = [];
+ c.last.sortList = [];
+ if ( c.sortForce !== null ) {
+ arry = c.sortForce;
+ for ( indx = 0; indx < arry.length; indx++ ) {
+ if ( arry[ indx ][ 0 ] !== col ) {
+ c.sortList[ c.sortList.length ] = arry[ indx ];
+ c.sortVars[ arry[ indx ][ 0 ] ].sortedBy = 'sortForce';
+ }
+ }
+ }
+ // add column to sort list
+ dir = order[ c.sortVars[ col ].count ];
+ if ( dir < 2 ) {
+ c.sortList[ c.sortList.length ] = [ col, dir ];
+ c.sortVars[ col ].sortedBy = sortedBy;
+ // add other columns if header spans across multiple
+ if ( th.colSpan > 1 ) {
+ for ( indx = 1; indx < th.colSpan; indx++ ) {
+ c.sortList[ c.sortList.length ] = [ col + indx, dir ];
+ // update count on columns in colSpan
+ c.sortVars[ col + indx ].count = $.inArray( dir, order );
+ c.sortVars[ col + indx ].sortedBy = sortedBy;
+ }
+ }
+ }
+ // multi column sorting
+ } else {
+ // get rid of the sortAppend before adding more - fixes issue #115 & #523
+ c.sortList = $.extend( [], c.last.sortList );
+
+ // the user has clicked on an already sorted column
+ if ( ts.isValueInArray( col, c.sortList ) >= 0 ) {
+ // reverse the sorting direction
+ c.sortVars[ col ].sortedBy = sortedBy;
+ for ( indx = 0; indx < c.sortList.length; indx++ ) {
+ tmp = c.sortList[ indx ];
+ if ( tmp[ 0 ] === col ) {
+ // order.count seems to be incorrect when compared to cell.count
+ tmp[ 1 ] = order[ c.sortVars[ col ].count ];
+ if ( tmp[1] === 2 ) {
+ c.sortList.splice( indx, 1 );
+ c.sortVars[ col ].count = -1;
+ }
+ }
+ }
+ } else {
+ // add column to sort list array
+ dir = order[ c.sortVars[ col ].count ];
+ c.sortVars[ col ].sortedBy = sortedBy;
+ if ( dir < 2 ) {
+ c.sortList[ c.sortList.length ] = [ col, dir ];
+ // add other columns if header spans across multiple
+ if ( th.colSpan > 1 ) {
+ for ( indx = 1; indx < th.colSpan; indx++ ) {
+ c.sortList[ c.sortList.length ] = [ col + indx, dir ];
+ // update count on columns in colSpan
+ c.sortVars[ col + indx ].count = $.inArray( dir, order );
+ c.sortVars[ col + indx ].sortedBy = sortedBy;
+ }
+ }
+ }
+ }
+ }
+ // save sort before applying sortAppend
+ c.last.sortList = $.extend( [], c.sortList );
+ if ( c.sortList.length && c.sortAppend ) {
+ arry = $.isArray( c.sortAppend ) ? c.sortAppend : c.sortAppend[ c.sortList[ 0 ][ 0 ] ];
+ if ( !ts.isEmptyObject( arry ) ) {
+ for ( indx = 0; indx < arry.length; indx++ ) {
+ if ( arry[ indx ][ 0 ] !== col && ts.isValueInArray( arry[ indx ][ 0 ], c.sortList ) < 0 ) {
+ dir = arry[ indx ][ 1 ];
+ temp = ( '' + dir ).match( /^(a|d|s|o|n)/ );
+ if ( temp ) {
+ tmp = c.sortList[ 0 ][ 1 ];
+ switch ( temp[ 0 ] ) {
+ case 'd' :
+ dir = 1;
+ break;
+ case 's' :
+ dir = tmp;
+ break;
+ case 'o' :
+ dir = tmp === 0 ? 1 : 0;
+ break;
+ case 'n' :
+ dir = ( tmp + 1 ) % order.length;
+ break;
+ default:
+ dir = 0;
+ break;
+ }
+ }
+ c.sortList[ c.sortList.length ] = [ arry[ indx ][ 0 ], dir ];
+ c.sortVars[ arry[ indx ][ 0 ] ].sortedBy = 'sortAppend';
+ }
+ }
+ }
+ }
+ // sortBegin event triggered immediately before the sort
+ c.$table.triggerHandler( 'sortBegin', table );
+ // setTimeout needed so the processing icon shows up
+ setTimeout( function() {
+ // set css for headers
+ ts.setHeadersCss( c );
+ ts.multisort( c );
+ ts.appendCache( c );
+ c.$table.triggerHandler( 'sortBeforeEnd', table );
+ c.$table.triggerHandler( 'sortEnd', table );
+ }, 1 );
+ },
+
+ // sort multiple columns
+ multisort : function( c ) { /*jshint loopfunc:true */
+ var tbodyIndex, sortTime, colMax, rows, tmp,
+ table = c.table,
+ sorter = [],
+ dir = 0,
+ textSorter = c.textSorter || '',
+ sortList = c.sortList,
+ sortLen = sortList.length,
+ len = c.$tbodies.length;
+ if ( c.serverSideSorting || ts.isEmptyObject( c.cache ) ) {
+ // empty table - fixes #206/#346
+ return;
+ }
+ if ( ts.debug(c, 'core') ) { sortTime = new Date(); }
+ // cache textSorter to optimize speed
+ if ( typeof textSorter === 'object' ) {
+ colMax = c.columns;
+ while ( colMax-- ) {
+ tmp = ts.getColumnData( table, textSorter, colMax );
+ if ( typeof tmp === 'function' ) {
+ sorter[ colMax ] = tmp;
+ }
+ }
+ }
+ for ( tbodyIndex = 0; tbodyIndex < len; tbodyIndex++ ) {
+ colMax = c.cache[ tbodyIndex ].colMax;
+ rows = c.cache[ tbodyIndex ].normalized;
+
+ rows.sort( function( a, b ) {
+ var sortIndex, num, col, order, sort, x, y;
+ // rows is undefined here in IE, so don't use it!
+ for ( sortIndex = 0; sortIndex < sortLen; sortIndex++ ) {
+ col = sortList[ sortIndex ][ 0 ];
+ order = sortList[ sortIndex ][ 1 ];
+ // sort direction, true = asc, false = desc
+ dir = order === 0;
+
+ if ( c.sortStable && a[ col ] === b[ col ] && sortLen === 1 ) {
+ return a[ c.columns ].order - b[ c.columns ].order;
+ }
+
+ // fallback to natural sort since it is more robust
+ num = /n/i.test( ts.getSortType( c.parsers, col ) );
+ if ( num && c.strings[ col ] ) {
+ // sort strings in numerical columns
+ if ( typeof ( ts.string[ c.strings[ col ] ] ) === 'boolean' ) {
+ num = ( dir ? 1 : -1 ) * ( ts.string[ c.strings[ col ] ] ? -1 : 1 );
+ } else {
+ num = ( c.strings[ col ] ) ? ts.string[ c.strings[ col ] ] || 0 : 0;
+ }
+ // fall back to built-in numeric sort
+ // var sort = $.tablesorter['sort' + s]( a[col], b[col], dir, colMax[col], table );
+ sort = c.numberSorter ? c.numberSorter( a[ col ], b[ col ], dir, colMax[ col ], table ) :
+ ts[ 'sortNumeric' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ], b[ col ], num, colMax[ col ], col, c );
+ } else {
+ // set a & b depending on sort direction
+ x = dir ? a : b;
+ y = dir ? b : a;
+ // text sort function
+ if ( typeof textSorter === 'function' ) {
+ // custom OVERALL text sorter
+ sort = textSorter( x[ col ], y[ col ], dir, col, table );
+ } else if ( typeof sorter[ col ] === 'function' ) {
+ // custom text sorter for a SPECIFIC COLUMN
+ sort = sorter[ col ]( x[ col ], y[ col ], dir, col, table );
+ } else {
+ // fall back to natural sort
+ sort = ts[ 'sortNatural' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ] || '', b[ col ] || '', col, c );
+ }
+ }
+ if ( sort ) { return sort; }
+ }
+ return a[ c.columns ].order - b[ c.columns ].order;
+ });
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Applying sort ' + sortList.toString() + ts.benchmark( sortTime ) );
+ }
+ },
+
+ resortComplete : function( c, callback ) {
+ if ( c.table.isUpdating ) {
+ c.$table.triggerHandler( 'updateComplete', c.table );
+ }
+ if ( $.isFunction( callback ) ) {
+ callback( c.table );
+ }
+ },
+
+ checkResort : function( c, resort, callback ) {
+ var sortList = $.isArray( resort ) ? resort : c.sortList,
+ // if no resort parameter is passed, fallback to config.resort (true by default)
+ resrt = typeof resort === 'undefined' ? c.resort : resort;
+ // don't try to resort if the table is still processing
+ // this will catch spamming of the updateCell method
+ if ( resrt !== false && !c.serverSideSorting && !c.table.isProcessing ) {
+ if ( sortList.length ) {
+ ts.sortOn( c, sortList, function() {
+ ts.resortComplete( c, callback );
+ }, true );
+ } else {
+ ts.sortReset( c, function() {
+ ts.resortComplete( c, callback );
+ ts.applyWidget( c.table, false );
+ } );
+ }
+ } else {
+ ts.resortComplete( c, callback );
+ ts.applyWidget( c.table, false );
+ }
+ },
+
+ sortOn : function( c, list, callback, init ) {
+ var indx,
+ table = c.table;
+ c.$table.triggerHandler( 'sortStart', table );
+ for (indx = 0; indx < c.columns; indx++) {
+ c.sortVars[ indx ].sortedBy = ts.isValueInArray( indx, list ) > -1 ? 'sorton' : '';
+ }
+ // update header count index
+ ts.updateHeaderSortCount( c, list );
+ // set css for headers
+ ts.setHeadersCss( c );
+ // fixes #346
+ if ( c.delayInit && ts.isEmptyObject( c.cache ) ) {
+ ts.buildCache( c );
+ }
+ c.$table.triggerHandler( 'sortBegin', table );
+ // sort the table and append it to the dom
+ ts.multisort( c );
+ ts.appendCache( c, init );
+ c.$table.triggerHandler( 'sortBeforeEnd', table );
+ c.$table.triggerHandler( 'sortEnd', table );
+ ts.applyWidget( table );
+ if ( $.isFunction( callback ) ) {
+ callback( table );
+ }
+ },
+
+ sortReset : function( c, callback ) {
+ c.sortList = [];
+ var indx;
+ for (indx = 0; indx < c.columns; indx++) {
+ c.sortVars[ indx ].count = -1;
+ c.sortVars[ indx ].sortedBy = '';
+ }
+ ts.setHeadersCss( c );
+ ts.multisort( c );
+ ts.appendCache( c );
+ if ( $.isFunction( callback ) ) {
+ callback( c.table );
+ }
+ },
+
+ getSortType : function( parsers, column ) {
+ return ( parsers && parsers[ column ] ) ? parsers[ column ].type || '' : '';
+ },
+
+ getOrder : function( val ) {
+ // look for 'd' in 'desc' order; return true
+ return ( /^d/i.test( val ) || val === 1 );
+ },
+
+ // Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
+ sortNatural : function( a, b ) {
+ if ( a === b ) { return 0; }
+ a = ( a || '' ).toString();
+ b = ( b || '' ).toString();
+ var aNum, bNum, aFloat, bFloat, indx, max,
+ regex = ts.regex;
+ // first try and sort Hex codes
+ if ( regex.hex.test( b ) ) {
+ aNum = parseInt( a.match( regex.hex ), 16 );
+ bNum = parseInt( b.match( regex.hex ), 16 );
+ if ( aNum < bNum ) { return -1; }
+ if ( aNum > bNum ) { return 1; }
+ }
+ // chunk/tokenize
+ aNum = a.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
+ bNum = b.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
+ max = Math.max( aNum.length, bNum.length );
+ // natural sorting through split numeric strings and default strings
+ for ( indx = 0; indx < max; indx++ ) {
+ // find floats not starting with '0', string or 0 if not defined
+ aFloat = isNaN( aNum[ indx ] ) ? aNum[ indx ] || 0 : parseFloat( aNum[ indx ] ) || 0;
+ bFloat = isNaN( bNum[ indx ] ) ? bNum[ indx ] || 0 : parseFloat( bNum[ indx ] ) || 0;
+ // handle numeric vs string comparison - number < string - (Kyle Adams)
+ if ( isNaN( aFloat ) !== isNaN( bFloat ) ) { return isNaN( aFloat ) ? 1 : -1; }
+ // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'
+ if ( typeof aFloat !== typeof bFloat ) {
+ aFloat += '';
+ bFloat += '';
+ }
+ if ( aFloat < bFloat ) { return -1; }
+ if ( aFloat > bFloat ) { return 1; }
+ }
+ return 0;
+ },
+
+ sortNaturalAsc : function( a, b, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : -empty || -1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : empty || 1; }
+ return ts.sortNatural( a, b );
+ },
+
+ sortNaturalDesc : function( a, b, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : empty || 1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : -empty || -1; }
+ return ts.sortNatural( b, a );
+ },
+
+ // basic alphabetical sort
+ sortText : function( a, b ) {
+ return a > b ? 1 : ( a < b ? -1 : 0 );
+ },
+
+ // return text string value by adding up ascii value
+ // so the text is somewhat sorted when using a digital sort
+ // this is NOT an alphanumeric sort
+ getTextValue : function( val, num, max ) {
+ if ( max ) {
+ // make sure the text value is greater than the max numerical value (max)
+ var indx,
+ len = val ? val.length : 0,
+ n = max + num;
+ for ( indx = 0; indx < len; indx++ ) {
+ n += val.charCodeAt( indx );
+ }
+ return num * n;
+ }
+ return 0;
+ },
+
+ sortNumericAsc : function( a, b, num, max, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : -empty || -1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : empty || 1; }
+ if ( isNaN( a ) ) { a = ts.getTextValue( a, num, max ); }
+ if ( isNaN( b ) ) { b = ts.getTextValue( b, num, max ); }
+ return a - b;
+ },
+
+ sortNumericDesc : function( a, b, num, max, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : empty || 1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : -empty || -1; }
+ if ( isNaN( a ) ) { a = ts.getTextValue( a, num, max ); }
+ if ( isNaN( b ) ) { b = ts.getTextValue( b, num, max ); }
+ return b - a;
+ },
+
+ sortNumeric : function( a, b ) {
+ return a - b;
+ },
+
+ /*
+ ██ ██ ██ ██ █████▄ ▄████▄ ██████ ██████ ▄█████
+ ██ ██ ██ ██ ██ ██ ██ ▄▄▄ ██▄▄ ██ ▀█▄
+ ██ ██ ██ ██ ██ ██ ██ ▀██ ██▀▀ ██ ▀█▄
+ ███████▀ ██ █████▀ ▀████▀ ██████ ██ █████▀
+ */
+ addWidget : function( widget ) {
+ if ( widget.id && !ts.isEmptyObject( ts.getWidgetById( widget.id ) ) ) {
+ console.warn( '"' + widget.id + '" widget was loaded more than once!' );
+ }
+ ts.widgets[ ts.widgets.length ] = widget;
+ },
+
+ hasWidget : function( $table, name ) {
+ $table = $( $table );
+ return $table.length && $table[ 0 ].config && $table[ 0 ].config.widgetInit[ name ] || false;
+ },
+
+ getWidgetById : function( name ) {
+ var indx, widget,
+ len = ts.widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.widgets[ indx ];
+ if ( widget && widget.id && widget.id.toLowerCase() === name.toLowerCase() ) {
+ return widget;
+ }
+ }
+ },
+
+ applyWidgetOptions : function( table ) {
+ var indx, widget, wo,
+ c = table.config,
+ len = c.widgets.length;
+ if ( len ) {
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.getWidgetById( c.widgets[ indx ] );
+ if ( widget && widget.options ) {
+ wo = $.extend( true, {}, widget.options );
+ c.widgetOptions = $.extend( true, wo, c.widgetOptions );
+ // add widgetOptions to defaults for option validator
+ $.extend( true, ts.defaults.widgetOptions, widget.options );
+ }
+ }
+ }
+ },
+
+ addWidgetFromClass : function( table ) {
+ var len, indx,
+ c = table.config,
+ // look for widgets to apply from table class
+ // don't match from 'ui-widget-content'; use \S instead of \w to include widgets
+ // with dashes in the name, e.g. "widget-test-2" extracts out "test-2"
+ regex = '^' + c.widgetClass.replace( ts.regex.templateName, '(\\S+)+' ) + '$',
+ widgetClass = new RegExp( regex, 'g' ),
+ // split up table class (widget id's can include dashes) - stop using match
+ // otherwise only one widget gets extracted, see #1109
+ widgets = ( table.className || '' ).split( ts.regex.spaces );
+ if ( widgets.length ) {
+ len = widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( widgets[ indx ].match( widgetClass ) ) {
+ c.widgets[ c.widgets.length ] = widgets[ indx ].replace( widgetClass, '$1' );
+ }
+ }
+ }
+ },
+
+ applyWidgetId : function( table, id, init ) {
+ table = $(table)[0];
+ var applied, time, name,
+ c = table.config,
+ wo = c.widgetOptions,
+ debug = ts.debug(c, 'core'),
+ widget = ts.getWidgetById( id );
+ if ( widget ) {
+ name = widget.id;
+ applied = false;
+ // add widget name to option list so it gets reapplied after sorting, filtering, etc
+ if ( $.inArray( name, c.widgets ) < 0 ) {
+ c.widgets[ c.widgets.length ] = name;
+ }
+ if ( debug ) { time = new Date(); }
+
+ if ( init || !( c.widgetInit[ name ] ) ) {
+ // set init flag first to prevent calling init more than once (e.g. pager)
+ c.widgetInit[ name ] = true;
+ if ( table.hasInitialized ) {
+ // don't reapply widget options on tablesorter init
+ ts.applyWidgetOptions( table );
+ }
+ if ( typeof widget.init === 'function' ) {
+ applied = true;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' );
+ }
+ widget.init( table, widget, c, wo );
+ }
+ }
+ if ( !init && typeof widget.format === 'function' ) {
+ applied = true;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' );
+ }
+ widget.format( table, c, wo, false );
+ }
+ if ( debug ) {
+ if ( applied ) {
+ console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ }
+ }
+ },
+
+ applyWidget : function( table, init, callback ) {
+ table = $( table )[ 0 ]; // in case this is called externally
+ var indx, len, names, widget, time,
+ c = table.config,
+ debug = ts.debug(c, 'core'),
+ widgets = [];
+ // prevent numerous consecutive widget applications
+ if ( init !== false && table.hasInitialized && ( table.isApplyingWidgets || table.isUpdating ) ) {
+ return;
+ }
+ if ( debug ) { time = new Date(); }
+ ts.addWidgetFromClass( table );
+ // prevent "tablesorter-ready" from firing multiple times in a row
+ clearTimeout( c.timerReady );
+ if ( c.widgets.length ) {
+ table.isApplyingWidgets = true;
+ // ensure unique widget ids
+ c.widgets = $.grep( c.widgets, function( val, index ) {
+ return $.inArray( val, c.widgets ) === index;
+ });
+ names = c.widgets || [];
+ len = names.length;
+ // build widget array & add priority as needed
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.getWidgetById( names[ indx ] );
+ if ( widget && widget.id ) {
+ // set priority to 10 if not defined
+ if ( !widget.priority ) { widget.priority = 10; }
+ widgets[ indx ] = widget;
+ } else if ( debug ) {
+ console.warn( '"' + names[ indx ] + '" was enabled, but the widget code has not been loaded!' );
+ }
+ }
+ // sort widgets by priority
+ widgets.sort( function( a, b ) {
+ return a.priority < b.priority ? -1 : a.priority === b.priority ? 0 : 1;
+ });
+ // add/update selected widgets
+ len = widgets.length;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Start ' + ( init ? 'initializing' : 'applying' ) + ' widgets' );
+ }
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = widgets[ indx ];
+ if ( widget && widget.id ) {
+ ts.applyWidgetId( table, widget.id, init );
+ }
+ }
+ if ( debug && console.groupEnd ) { console.groupEnd(); }
+ }
+ c.timerReady = setTimeout( function() {
+ table.isApplyingWidgets = false;
+ $.data( table, 'lastWidgetApplication', new Date() );
+ c.$table.triggerHandler( 'tablesorter-ready' );
+ // callback executed on init only
+ if ( !init && typeof callback === 'function' ) {
+ callback( table );
+ }
+ if ( debug ) {
+ widget = c.widgets.length;
+ console.log( 'Completed ' +
+ ( init === true ? 'initializing ' : 'applying ' ) + widget +
+ ' widget' + ( widget !== 1 ? 's' : '' ) + ts.benchmark( time ) );
+ }
+ }, 10 );
+ },
+
+ removeWidget : function( table, name, refreshing ) {
+ table = $( table )[ 0 ];
+ var index, widget, indx, len,
+ c = table.config;
+ // if name === true, add all widgets from $.tablesorter.widgets
+ if ( name === true ) {
+ name = [];
+ len = ts.widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.widgets[ indx ];
+ if ( widget && widget.id ) {
+ name[ name.length ] = widget.id;
+ }
+ }
+ } else {
+ // name can be either an array of widgets names,
+ // or a space/comma separated list of widget names
+ name = ( $.isArray( name ) ? name.join( ',' ) : name || '' ).toLowerCase().split( /[\s,]+/ );
+ }
+ len = name.length;
+ for ( index = 0; index < len; index++ ) {
+ widget = ts.getWidgetById( name[ index ] );
+ indx = $.inArray( name[ index ], c.widgets );
+ // don't remove the widget from config.widget if refreshing
+ if ( indx >= 0 && refreshing !== true ) {
+ c.widgets.splice( indx, 1 );
+ }
+ if ( widget && widget.remove ) {
+ if ( ts.debug(c, 'core') ) {
+ console.log( ( refreshing ? 'Refreshing' : 'Removing' ) + ' "' + name[ index ] + '" widget' );
+ }
+ widget.remove( table, c, c.widgetOptions, refreshing );
+ c.widgetInit[ name[ index ] ] = false;
+ }
+ }
+ c.$table.triggerHandler( 'widgetRemoveEnd', table );
+ },
+
+ refreshWidgets : function( table, doAll, dontapply ) {
+ table = $( table )[ 0 ]; // see issue #243
+ var indx, widget,
+ c = table.config,
+ curWidgets = c.widgets,
+ widgets = ts.widgets,
+ len = widgets.length,
+ list = [],
+ callback = function( table ) {
+ $( table ).triggerHandler( 'refreshComplete' );
+ };
+ // remove widgets not defined in config.widgets, unless doAll is true
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = widgets[ indx ];
+ if ( widget && widget.id && ( doAll || $.inArray( widget.id, curWidgets ) < 0 ) ) {
+ list[ list.length ] = widget.id;
+ }
+ }
+ ts.removeWidget( table, list.join( ',' ), true );
+ if ( dontapply !== true ) {
+ // call widget init if
+ ts.applyWidget( table, doAll || false, callback );
+ if ( doAll ) {
+ // apply widget format
+ ts.applyWidget( table, false, callback );
+ }
+ } else {
+ callback( table );
+ }
+ },
+
+ /*
+ ██ ██ ██████ ██ ██ ██ ██████ ██ ██████ ▄█████
+ ██ ██ ██ ██ ██ ██ ██ ██ ██▄▄ ▀█▄
+ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀█▄
+ ▀████▀ ██ ██ ██████ ██ ██ ██ ██████ █████▀
+ */
+ benchmark : function( diff ) {
+ return ( ' (' + ( new Date().getTime() - diff.getTime() ) + ' ms)' );
+ },
+ // deprecated ts.log
+ log : function() {
+ console.log( arguments );
+ },
+ debug : function(c, name) {
+ return c && (
+ c.debug === true ||
+ typeof c.debug === 'string' && c.debug.indexOf(name) > -1
+ );
+ },
+
+ // $.isEmptyObject from jQuery v1.4
+ isEmptyObject : function( obj ) {
+ /*jshint forin: false */
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ isValueInArray : function( column, arry ) {
+ var indx,
+ len = arry && arry.length || 0;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( arry[ indx ][ 0 ] === column ) {
+ return indx;
+ }
+ }
+ return -1;
+ },
+
+ formatFloat : function( str, table ) {
+ if ( typeof str !== 'string' || str === '' ) { return str; }
+ // allow using formatFloat without a table; defaults to US number format
+ var num,
+ usFormat = table && table.config ? table.config.usNumberFormat !== false :
+ typeof table !== 'undefined' ? table : true;
+ if ( usFormat ) {
+ // US Format - 1,234,567.89 -> 1234567.89
+ str = str.replace( ts.regex.comma, '' );
+ } else {
+ // German Format = 1.234.567,89 -> 1234567.89
+ // French Format = 1 234 567,89 -> 1234567.89
+ str = str.replace( ts.regex.digitNonUS, '' ).replace( ts.regex.comma, '.' );
+ }
+ if ( ts.regex.digitNegativeTest.test( str ) ) {
+ // make (#) into a negative number -> (10) = -10
+ str = str.replace( ts.regex.digitNegativeReplace, '-$1' );
+ }
+ num = parseFloat( str );
+ // return the text instead of zero
+ return isNaN( num ) ? $.trim( str ) : num;
+ },
+
+ isDigit : function( str ) {
+ // replace all unwanted chars and match
+ return isNaN( str ) ?
+ ts.regex.digitTest.test( str.toString().replace( ts.regex.digitReplace, '' ) ) :
+ str !== '';
+ },
+
+ // computeTableHeaderCellIndexes from:
+ // http://www.javascripttoolbox.com/lib/table/examples.php
+ // http://www.javascripttoolbox.com/temp/table_cellindex.html
+ computeColumnIndex : function( $rows, c ) {
+ var i, j, k, l, cell, cells, rowIndex, rowSpan, colSpan, firstAvailCol,
+ // total columns has been calculated, use it to set the matrixrow
+ columns = c && c.columns || 0,
+ matrix = [],
+ matrixrow = new Array( columns );
+ for ( i = 0; i < $rows.length; i++ ) {
+ cells = $rows[ i ].cells;
+ for ( j = 0; j < cells.length; j++ ) {
+ cell = cells[ j ];
+ rowIndex = i;
+ rowSpan = cell.rowSpan || 1;
+ colSpan = cell.colSpan || 1;
+ if ( typeof matrix[ rowIndex ] === 'undefined' ) {
+ matrix[ rowIndex ] = [];
+ }
+ // Find first available column in the first row
+ for ( k = 0; k < matrix[ rowIndex ].length + 1; k++ ) {
+ if ( typeof matrix[ rowIndex ][ k ] === 'undefined' ) {
+ firstAvailCol = k;
+ break;
+ }
+ }
+ // jscs:disable disallowEmptyBlocks
+ if ( columns && cell.cellIndex === firstAvailCol ) {
+ // don't to anything
+ } else if ( cell.setAttribute ) {
+ // jscs:enable disallowEmptyBlocks
+ // add data-column (setAttribute = IE8+)
+ cell.setAttribute( 'data-column', firstAvailCol );
+ } else {
+ // remove once we drop support for IE7 - 1/12/2016
+ $( cell ).attr( 'data-column', firstAvailCol );
+ }
+ for ( k = rowIndex; k < rowIndex + rowSpan; k++ ) {
+ if ( typeof matrix[ k ] === 'undefined' ) {
+ matrix[ k ] = [];
+ }
+ matrixrow = matrix[ k ];
+ for ( l = firstAvailCol; l < firstAvailCol + colSpan; l++ ) {
+ matrixrow[ l ] = 'x';
+ }
+ }
+ }
+ }
+ ts.checkColumnCount($rows, matrix, matrixrow.length);
+ return matrixrow.length;
+ },
+
+ checkColumnCount : function($rows, matrix, columns) {
+ // this DOES NOT report any tbody column issues, except for the math and
+ // and column selector widgets
+ var i, len,
+ valid = true,
+ cells = [];
+ for ( i = 0; i < matrix.length; i++ ) {
+ // some matrix entries are undefined when testing the footer because
+ // it is using the rowIndex property
+ if ( matrix[i] ) {
+ len = matrix[i].length;
+ if ( matrix[i].length !== columns ) {
+ valid = false;
+ break;
+ }
+ }
+ }
+ if ( !valid ) {
+ $rows.each( function( indx, el ) {
+ var cell = el.parentElement.nodeName;
+ if ( cells.indexOf( cell ) < 0 ) {
+ cells.push( cell );
+ }
+ });
+ console.error(
+ 'Invalid or incorrect number of columns in the ' +
+ cells.join( ' or ' ) + '; expected ' + columns +
+ ', but found ' + len + ' columns'
+ );
+ }
+ },
+
+ // automatically add a colgroup with col elements set to a percentage width
+ fixColumnWidth : function( table ) {
+ table = $( table )[ 0 ];
+ var overallWidth, percent, $tbodies, len, index,
+ c = table.config,
+ $colgroup = c.$table.children( 'colgroup' );
+ // remove plugin-added colgroup, in case we need to refresh the widths
+ if ( $colgroup.length && $colgroup.hasClass( ts.css.colgroup ) ) {
+ $colgroup.remove();
+ }
+ if ( c.widthFixed && c.$table.children( 'colgroup' ).length === 0 ) {
+ $colgroup = $( '<colgroup class="' + ts.css.colgroup + '">' );
+ overallWidth = c.$table.width();
+ // only add col for visible columns - fixes #371
+ $tbodies = c.$tbodies.find( 'tr:first' ).children( ':visible' );
+ len = $tbodies.length;
+ for ( index = 0; index < len; index++ ) {
+ percent = parseInt( ( $tbodies.eq( index ).width() / overallWidth ) * 1000, 10 ) / 10 + '%';
+ $colgroup.append( $( '<col>' ).css( 'width', percent ) );
+ }
+ c.$table.prepend( $colgroup );
+ }
+ },
+
+ // get sorter, string, empty, etc options for each column from
+ // jQuery data, metadata, header option or header class name ('sorter-false')
+ // priority = jQuery data > meta > headers option > header class name
+ getData : function( header, configHeader, key ) {
+ var meta, cl4ss,
+ val = '',
+ $header = $( header );
+ if ( !$header.length ) { return ''; }
+ meta = $.metadata ? $header.metadata() : false;
+ cl4ss = ' ' + ( $header.attr( 'class' ) || '' );
+ if ( typeof $header.data( key ) !== 'undefined' ||
+ typeof $header.data( key.toLowerCase() ) !== 'undefined' ) {
+ // 'data-lockedOrder' is assigned to 'lockedorder'; but 'data-locked-order' is assigned to 'lockedOrder'
+ // 'data-sort-initial-order' is assigned to 'sortInitialOrder'
+ val += $header.data( key ) || $header.data( key.toLowerCase() );
+ } else if ( meta && typeof meta[ key ] !== 'undefined' ) {
+ val += meta[ key ];
+ } else if ( configHeader && typeof configHeader[ key ] !== 'undefined' ) {
+ val += configHeader[ key ];
+ } else if ( cl4ss !== ' ' && cl4ss.match( ' ' + key + '-' ) ) {
+ // include sorter class name 'sorter-text', etc; now works with 'sorter-my-custom-parser'
+ val = cl4ss.match( new RegExp( '\\s' + key + '-([\\w-]+)' ) )[ 1 ] || '';
+ }
+ return $.trim( val );
+ },
+
+ getColumnData : function( table, obj, indx, getCell, $headers ) {
+ if ( typeof obj !== 'object' || obj === null ) {
+ return obj;
+ }
+ table = $( table )[ 0 ];
+ var $header, key,
+ c = table.config,
+ $cells = ( $headers || c.$headers ),
+ // c.$headerIndexed is not defined initially
+ $cell = c.$headerIndexed && c.$headerIndexed[ indx ] ||
+ $cells.find( '[data-column="' + indx + '"]:last' );
+ if ( typeof obj[ indx ] !== 'undefined' ) {
+ return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ];
+ }
+ for ( key in obj ) {
+ if ( typeof key === 'string' ) {
+ $header = $cell
+ // header cell with class/id
+ .filter( key )
+ // find elements within the header cell with cell/id
+ .add( $cell.find( key ) );
+ if ( $header.length ) {
+ return obj[ key ];
+ }
+ }
+ }
+ return;
+ },
+
+ // *** Process table ***
+ // add processing indicator
+ isProcessing : function( $table, toggle, $headers ) {
+ $table = $( $table );
+ var c = $table[ 0 ].config,
+ // default to all headers
+ $header = $headers || $table.find( '.' + ts.css.header );
+ if ( toggle ) {
+ // don't use sortList if custom $headers used
+ if ( typeof $headers !== 'undefined' && c.sortList.length > 0 ) {
+ // get headers from the sortList
+ $header = $header.filter( function() {
+ // get data-column from attr to keep compatibility with jQuery 1.2.6
+ return this.sortDisabled ?
+ false :
+ ts.isValueInArray( parseFloat( $( this ).attr( 'data-column' ) ), c.sortList ) >= 0;
+ });
+ }
+ $table.add( $header ).addClass( ts.css.processing + ' ' + c.cssProcessing );
+ } else {
+ $table.add( $header ).removeClass( ts.css.processing + ' ' + c.cssProcessing );
+ }
+ },
+
+ // detach tbody but save the position
+ // don't use tbody because there are portions that look for a tbody index (updateCell)
+ processTbody : function( table, $tb, getIt ) {
+ table = $( table )[ 0 ];
+ if ( getIt ) {
+ table.isProcessing = true;
+ $tb.before( '<colgroup class="tablesorter-savemyplace"/>' );
+ return $.fn.detach ? $tb.detach() : $tb.remove();
+ }
+ var holdr = $( table ).find( 'colgroup.tablesorter-savemyplace' );
+ $tb.insertAfter( holdr );
+ holdr.remove();
+ table.isProcessing = false;
+ },
+
+ clearTableBody : function( table ) {
+ $( table )[ 0 ].config.$tbodies.children().detach();
+ },
+
+ // used when replacing accented characters during sorting
+ characterEquivalents : {
+ 'a' : '\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5', // áàâãäąå
+ 'A' : '\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5', // ÁÀÂÃÄĄÅ
+ 'c' : '\u00e7\u0107\u010d', // çćč
+ 'C' : '\u00c7\u0106\u010c', // ÇĆČ
+ 'e' : '\u00e9\u00e8\u00ea\u00eb\u011b\u0119', // éèêëěę
+ 'E' : '\u00c9\u00c8\u00ca\u00cb\u011a\u0118', // ÉÈÊËĚĘ
+ 'i' : '\u00ed\u00ec\u0130\u00ee\u00ef\u0131', // íìİîïı
+ 'I' : '\u00cd\u00cc\u0130\u00ce\u00cf', // ÍÌİÎÏ
+ 'o' : '\u00f3\u00f2\u00f4\u00f5\u00f6\u014d', // óòôõöō
+ 'O' : '\u00d3\u00d2\u00d4\u00d5\u00d6\u014c', // ÓÒÔÕÖŌ
+ 'ss': '\u00df', // ß (s sharp)
+ 'SS': '\u1e9e', // ẞ (Capital sharp s)
+ 'u' : '\u00fa\u00f9\u00fb\u00fc\u016f', // úùûüů
+ 'U' : '\u00da\u00d9\u00db\u00dc\u016e' // ÚÙÛÜŮ
+ },
+
+ replaceAccents : function( str ) {
+ var chr,
+ acc = '[',
+ eq = ts.characterEquivalents;
+ if ( !ts.characterRegex ) {
+ ts.characterRegexArray = {};
+ for ( chr in eq ) {
+ if ( typeof chr === 'string' ) {
+ acc += eq[ chr ];
+ ts.characterRegexArray[ chr ] = new RegExp( '[' + eq[ chr ] + ']', 'g' );
+ }
+ }
+ ts.characterRegex = new RegExp( acc + ']' );
+ }
+ if ( ts.characterRegex.test( str ) ) {
+ for ( chr in eq ) {
+ if ( typeof chr === 'string' ) {
+ str = str.replace( ts.characterRegexArray[ chr ], chr );
+ }
+ }
+ }
+ return str;
+ },
+
+ validateOptions : function( c ) {
+ var setting, setting2, typ, timer,
+ // ignore options containing an array
+ ignore = 'headers sortForce sortList sortAppend widgets'.split( ' ' ),
+ orig = c.originalSettings;
+ if ( orig ) {
+ if ( ts.debug(c, 'core') ) {
+ timer = new Date();
+ }
+ for ( setting in orig ) {
+ typ = typeof ts.defaults[setting];
+ if ( typ === 'undefined' ) {
+ console.warn( 'Tablesorter Warning! "table.config.' + setting + '" option not recognized' );
+ } else if ( typ === 'object' ) {
+ for ( setting2 in orig[setting] ) {
+ typ = ts.defaults[setting] && typeof ts.defaults[setting][setting2];
+ if ( $.inArray( setting, ignore ) < 0 && typ === 'undefined' ) {
+ console.warn( 'Tablesorter Warning! "table.config.' + setting + '.' + setting2 + '" option not recognized' );
+ }
+ }
+ }
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'validate options time:' + ts.benchmark( timer ) );
+ }
+ }
+ },
+
+ // restore headers
+ restoreHeaders : function( table ) {
+ var index, $cell,
+ c = $( table )[ 0 ].config,
+ $headers = c.$table.find( c.selectorHeaders ),
+ len = $headers.length;
+ // don't use c.$headers here in case header cells were swapped
+ for ( index = 0; index < len; index++ ) {
+ $cell = $headers.eq( index );
+ // only restore header cells if it is wrapped
+ // because this is also used by the updateAll method
+ if ( $cell.find( '.' + ts.css.headerIn ).length ) {
+ $cell.html( c.headerContent[ index ] );
+ }
+ }
+ },
+
+ destroy : function( table, removeClasses, callback ) {
+ table = $( table )[ 0 ];
+ if ( !table.hasInitialized ) { return; }
+ // remove all widgets
+ ts.removeWidget( table, true, false );
+ var events,
+ $t = $( table ),
+ c = table.config,
+ $h = $t.find( 'thead:first' ),
+ $r = $h.find( 'tr.' + ts.css.headerRow ).removeClass( ts.css.headerRow + ' ' + c.cssHeaderRow ),
+ $f = $t.find( 'tfoot:first > tr' ).children( 'th, td' );
+ if ( removeClasses === false && $.inArray( 'uitheme', c.widgets ) >= 0 ) {
+ // reapply uitheme classes, in case we want to maintain appearance
+ $t.triggerHandler( 'applyWidgetId', [ 'uitheme' ] );
+ $t.triggerHandler( 'applyWidgetId', [ 'zebra' ] );
+ }
+ // remove widget added rows, just in case
+ $h.find( 'tr' ).not( $r ).remove();
+ // disable tablesorter - not using .unbind( namespace ) because namespacing was
+ // added in jQuery v1.4.3 - see http://api.jquery.com/event.namespace/
+ events = 'sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton ' +
+ 'appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave ' +
+ 'keypress sortBegin sortEnd resetToLoadState '.split( ' ' )
+ .join( c.namespace + ' ' );
+ $t
+ .removeData( 'tablesorter' )
+ .unbind( events.replace( ts.regex.spaces, ' ' ) );
+ c.$headers
+ .add( $f )
+ .removeClass( [ ts.css.header, c.cssHeader, c.cssAsc, c.cssDesc, ts.css.sortAsc, ts.css.sortDesc, ts.css.sortNone ].join( ' ' ) )
+ .removeAttr( 'data-column' )
+ .removeAttr( 'aria-label' )
+ .attr( 'aria-disabled', 'true' );
+ $r
+ .find( c.selectorSort )
+ .unbind( ( 'mousedown mouseup keypress '.split( ' ' ).join( c.namespace + ' ' ) ).replace( ts.regex.spaces, ' ' ) );
+ ts.restoreHeaders( table );
+ $t.toggleClass( ts.css.table + ' ' + c.tableClass + ' tablesorter-' + c.theme, removeClasses === false );
+ $t.removeClass(c.namespace.slice(1));
+ // clear flag in case the plugin is initialized again
+ table.hasInitialized = false;
+ delete table.config.cache;
+ if ( typeof callback === 'function' ) {
+ callback( table );
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'tablesorter has been removed' );
+ }
+ }
+
+ };
+
+ $.fn.tablesorter = function( settings ) {
+ return this.each( function() {
+ var table = this,
+ // merge & extend config options
+ c = $.extend( true, {}, ts.defaults, settings, ts.instanceMethods );
+ // save initial settings
+ c.originalSettings = settings;
+ // create a table from data (build table widget)
+ if ( !table.hasInitialized && ts.buildTable && this.nodeName !== 'TABLE' ) {
+ // return the table (in case the original target is the table's container)
+ ts.buildTable( table, c );
+ } else {
+ ts.setup( table, c );
+ }
+ });
+ };
+
+ // set up debug logs
+ if ( !( window.console && window.console.log ) ) {
+ // access $.tablesorter.logs for browsers that don't have a console...
+ ts.logs = [];
+ /*jshint -W020 */
+ console = {};
+ console.log = console.warn = console.error = console.table = function() {
+ var arg = arguments.length > 1 ? arguments : arguments[0];
+ ts.logs[ ts.logs.length ] = { date: Date.now(), log: arg };
+ };
+ }
+
+ // add default parsers
+ ts.addParser({
+ id : 'no-parser',
+ is : function() {
+ return false;
+ },
+ format : function() {
+ return '';
+ },
+ type : 'text'
+ });
+
+ ts.addParser({
+ id : 'text',
+ is : function() {
+ return true;
+ },
+ format : function( str, table ) {
+ var c = table.config;
+ if ( str ) {
+ str = $.trim( c.ignoreCase ? str.toLocaleLowerCase() : str );
+ str = c.sortLocaleCompare ? ts.replaceAccents( str ) : str;
+ }
+ return str;
+ },
+ type : 'text'
+ });
+
+ ts.regex.nondigit = /[^\w,. \-()]/g;
+ ts.addParser({
+ id : 'digit',
+ is : function( str ) {
+ return ts.isDigit( str );
+ },
+ format : function( str, table ) {
+ var num = ts.formatFloat( ( str || '' ).replace( ts.regex.nondigit, '' ), table );
+ return str && typeof num === 'number' ? num :
+ str ? $.trim( str && table.config.ignoreCase ? str.toLocaleLowerCase() : str ) : str;
+ },
+ type : 'numeric'
+ });
+
+ ts.regex.currencyReplace = /[+\-,. ]/g;
+ ts.regex.currencyTest = /^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/;
+ ts.addParser({
+ id : 'currency',
+ is : function( str ) {
+ str = ( str || '' ).replace( ts.regex.currencyReplace, '' );
+ // test for £$€¤¥¢
+ return ts.regex.currencyTest.test( str );
+ },
+ format : function( str, table ) {
+ var num = ts.formatFloat( ( str || '' ).replace( ts.regex.nondigit, '' ), table );
+ return str && typeof num === 'number' ? num :
+ str ? $.trim( str && table.config.ignoreCase ? str.toLocaleLowerCase() : str ) : str;
+ },
+ type : 'numeric'
+ });
+
+ // too many protocols to add them all https://en.wikipedia.org/wiki/URI_scheme
+ // now, this regex can be updated before initialization
+ ts.regex.urlProtocolTest = /^(https?|ftp|file):\/\//;
+ ts.regex.urlProtocolReplace = /(https?|ftp|file):\/\/(www\.)?/;
+ ts.addParser({
+ id : 'url',
+ is : function( str ) {
+ return ts.regex.urlProtocolTest.test( str );
+ },
+ format : function( str ) {
+ return str ? $.trim( str.replace( ts.regex.urlProtocolReplace, '' ) ) : str;
+ },
+ type : 'text'
+ });
+
+ ts.regex.dash = /-/g;
+ ts.regex.isoDate = /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/;
+ ts.addParser({
+ id : 'isoDate',
+ is : function( str ) {
+ return ts.regex.isoDate.test( str );
+ },
+ format : function( str ) {
+ var date = str ? new Date( str.replace( ts.regex.dash, '/' ) ) : str;
+ return date instanceof Date && isFinite( date ) ? date.getTime() : str;
+ },
+ type : 'numeric'
+ });
+
+ ts.regex.percent = /%/g;
+ ts.regex.percentTest = /(\d\s*?%|%\s*?\d)/;
+ ts.addParser({
+ id : 'percent',
+ is : function( str ) {
+ return ts.regex.percentTest.test( str ) && str.length < 15;
+ },
+ format : function( str, table ) {
+ return str ? ts.formatFloat( str.replace( ts.regex.percent, '' ), table ) : str;
+ },
+ type : 'numeric'
+ });
+
+ // added image parser to core v2.17.9
+ ts.addParser({
+ id : 'image',
+ is : function( str, table, node, $node ) {
+ return $node.find( 'img' ).length > 0;
+ },
+ format : function( str, table, cell ) {
+ return $( cell ).find( 'img' ).attr( table.config.imgAttr || 'alt' ) || str;
+ },
+ parsed : true, // filter widget flag
+ type : 'text'
+ });
+
+ ts.regex.dateReplace = /(\S)([AP]M)$/i; // used by usLongDate & time parser
+ ts.regex.usLongDateTest1 = /^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i;
+ ts.regex.usLongDateTest2 = /^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i;
+ ts.addParser({
+ id : 'usLongDate',
+ is : function( str ) {
+ // two digit years are not allowed cross-browser
+ // Jan 01, 2013 12:34:56 PM or 01 Jan 2013
+ return ts.regex.usLongDateTest1.test( str ) || ts.regex.usLongDateTest2.test( str );
+ },
+ format : function( str ) {
+ var date = str ? new Date( str.replace( ts.regex.dateReplace, '$1 $2' ) ) : str;
+ return date instanceof Date && isFinite( date ) ? date.getTime() : str;
+ },
+ type : 'numeric'
+ });
+
+ // testing for ##-##-#### or ####-##-##, so it's not perfect; time can be included
+ ts.regex.shortDateTest = /(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/;
+ // escaped "-" because JSHint in Firefox was showing it as an error
+ ts.regex.shortDateReplace = /[\-.,]/g;
+ // XXY covers MDY & DMY formats
+ ts.regex.shortDateXXY = /(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/;
+ ts.regex.shortDateYMD = /(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/;
+ ts.convertFormat = function( dateString, format ) {
+ dateString = ( dateString || '' )
+ .replace( ts.regex.spaces, ' ' )
+ .replace( ts.regex.shortDateReplace, '/' );
+ if ( format === 'mmddyyyy' ) {
+ dateString = dateString.replace( ts.regex.shortDateXXY, '$3/$1/$2' );
+ } else if ( format === 'ddmmyyyy' ) {
+ dateString = dateString.replace( ts.regex.shortDateXXY, '$3/$2/$1' );
+ } else if ( format === 'yyyymmdd' ) {
+ dateString = dateString.replace( ts.regex.shortDateYMD, '$1/$2/$3' );
+ }
+ var date = new Date( dateString );
+ return date instanceof Date && isFinite( date ) ? date.getTime() : '';
+ };
+
+ ts.addParser({
+ id : 'shortDate', // 'mmddyyyy', 'ddmmyyyy' or 'yyyymmdd'
+ is : function( str ) {
+ str = ( str || '' ).replace( ts.regex.spaces, ' ' ).replace( ts.regex.shortDateReplace, '/' );
+ return ts.regex.shortDateTest.test( str );
+ },
+ format : function( str, table, cell, cellIndex ) {
+ if ( str ) {
+ var c = table.config,
+ $header = c.$headerIndexed[ cellIndex ],
+ format = $header.length && $header.data( 'dateFormat' ) ||
+ ts.getData( $header, ts.getColumnData( table, c.headers, cellIndex ), 'dateFormat' ) ||
+ c.dateFormat;
+ // save format because getData can be slow...
+ if ( $header.length ) {
+ $header.data( 'dateFormat', format );
+ }
+ return ts.convertFormat( str, format ) || str;
+ }
+ return str;
+ },
+ type : 'numeric'
+ });
+
+ // match 24 hour time & 12 hours time + am/pm - see http://regexr.com/3c3tk
+ ts.regex.timeTest = /^(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)$|^((?:[01]\d|[2][0-4]):[0-5]\d)$/i;
+ ts.regex.timeMatch = /(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i;
+ ts.addParser({
+ id : 'time',
+ is : function( str ) {
+ return ts.regex.timeTest.test( str );
+ },
+ format : function( str ) {
+ // isolate time... ignore month, day and year
+ var temp,
+ timePart = ( str || '' ).match( ts.regex.timeMatch ),
+ orig = new Date( str ),
+ // no time component? default to 00:00 by leaving it out, but only if str is defined
+ time = str && ( timePart !== null ? timePart[ 0 ] : '00:00 AM' ),
+ date = time ? new Date( '2000/01/01 ' + time.replace( ts.regex.dateReplace, '$1 $2' ) ) : time;
+ if ( date instanceof Date && isFinite( date ) ) {
+ temp = orig instanceof Date && isFinite( orig ) ? orig.getTime() : 0;
+ // if original string was a valid date, add it to the decimal so the column sorts in some kind of order
+ // luckily new Date() ignores the decimals
+ return temp ? parseFloat( date.getTime() + '.' + orig.getTime() ) : date.getTime();
+ }
+ return str;
+ },
+ type : 'numeric'
+ });
+
+ ts.addParser({
+ id : 'metadata',
+ is : function() {
+ return false;
+ },
+ format : function( str, table, cell ) {
+ var c = table.config,
+ p = ( !c.parserMetadataName ) ? 'sortValue' : c.parserMetadataName;
+ return $( cell ).metadata()[ p ];
+ },
+ type : 'numeric'
+ });
+
+ /*
+ ██████ ██████ █████▄ █████▄ ▄████▄
+ ▄█▀ ██▄▄ ██▄▄██ ██▄▄██ ██▄▄██
+ ▄█▀ ██▀▀ ██▀▀██ ██▀▀█ ██▀▀██
+ ██████ ██████ █████▀ ██ ██ ██ ██
+ */
+ // add default widgets
+ ts.addWidget({
+ id : 'zebra',
+ priority : 90,
+ format : function( table, c, wo ) {
+ var $visibleRows, $row, count, isEven, tbodyIndex, rowIndex, len,
+ child = new RegExp( c.cssChildRow, 'i' ),
+ $tbodies = c.$tbodies.add( $( c.namespace + '_extra_table' ).children( 'tbody:not(.' + c.cssInfoBlock + ')' ) );
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ // loop through the visible rows
+ count = 0;
+ $visibleRows = $tbodies.eq( tbodyIndex ).children( 'tr:visible' ).not( c.selectorRemove );
+ len = $visibleRows.length;
+ for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
+ $row = $visibleRows.eq( rowIndex );
+ // style child rows the same way the parent row was styled
+ if ( !child.test( $row[ 0 ].className ) ) { count++; }
+ isEven = ( count % 2 === 0 );
+ $row
+ .removeClass( wo.zebra[ isEven ? 1 : 0 ] )
+ .addClass( wo.zebra[ isEven ? 0 : 1 ] );
+ }
+ }
+ },
+ remove : function( table, c, wo, refreshing ) {
+ if ( refreshing ) { return; }
+ var tbodyIndex, $tbody,
+ $tbodies = c.$tbodies,
+ toRemove = ( wo.zebra || [ 'even', 'odd' ] ).join( ' ' );
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody
+ $tbody.children().removeClass( toRemove );
+ ts.processTbody( table, $tbody, false ); // restore tbody
+ }
+ }
+ });
+
+})( jQuery );
diff --git a/jquery.tablesorter.widgets.js b/jquery.tablesorter.widgets.js
index 85477a2..5955f8c 100644
--- a/jquery.tablesorter.widgets.js
+++ b/jquery.tablesorter.widgets.js
@@ -1,10 +1,3182 @@
/*** This file is dynamically generated ***
█████▄ ▄████▄ █████▄ ▄████▄ ██████ ███████▄ ▄████▄ █████▄ ██ ██████ ██ ██
-██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
-██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀▀██
+██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▄▄ ██▄▄██
+██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
*/
-/*! tablesorter (FORK) - updated 05-17-2015 (v2.22.1)*/
+/*! tablesorter (FORK) - updated 2018-11-20 (v2.31.1)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
-!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(e,t,r){"use strict";var i=e.tablesorter||{};i.storage=function(a,l,s,n){a=e(a)[0];var o,c,d,f=!1,h={},u=a.config,p=u&&u.widgetOptions,g=n&&n.useSessionStorage||p&&p.storage_useSessionStorage?"sessionStorage":"localStorage",m=e(a),b=n&&n.id||m.attr(n&&n.group||p&&p.storage_group||"data-table-group")||p&&p.storage_tableId||a.id||e(".tablesorter").index(m),y=n&&n.url||m.attr(n&&n.page||p&&p.storage_page||"data-table-page")||p&&p.storage_fixedUrl||u&&u.fixedUrl||t.location.pathname;if(g in t)try{t[g].setItem("_tmptest","temp"),f=!0,t[g].removeItem("_tmptest")}catch(_){u&&u.debug&&i.log(g+" is not supported in this browser")}return e.parseJSON&&(f?h=e.parseJSON(t[g][l]||"null")||{}:(c=r.cookie.split(/[;\s|=]/),o=e.inArray(l,c)+1,h=0!==o?e.parseJSON(c[o]||"null")||{}:{})),(s||""===s)&&t.JSON&&JSON.hasOwnProperty("stringify")?(h[y]||(h[y]={}),h[y][b]=s,f?t[g][l]=JSON.stringify(h):(d=new Date,d.setTime(d.getTime()+31536e6),r.cookie=l+"="+JSON.stringify(h).replace(/\"/g,'"')+"; expires="+d.toGMTString()+"; path=/"),void 0):h&&h[y]?h[y][b]:""}}(jQuery,window,document),function(e){"use strict";var t=e.tablesorter||{};t.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",iconSortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s",iconSortAsc:"ui-icon-carat-1-n",iconSortDesc:"ui-icon-carat-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},e.extend(t.css,{wrapper:"tablesorter-wrapper"}),t.addWidget({id:"uitheme",priority:10,format:function(r,i,a){var l,s,n,o,c,d,f,h,u,p,g,m,b=t.themes,y=i.$table.add(e(i.namespace+"_extra_table")),_=i.$headers.add(e(i.namespace+"_extra_headers")),v=i.theme||"jui",w=b[v]||{},x=e.trim([w.sortNone,w.sortDesc,w.sortAsc,w.active].join(" ")),C=e.trim([w.iconSortNone,w.iconSortDesc,w.iconSortAsc].join(" "));for(i.debug&&(o=new Date),y.hasClass("tablesorter-"+v)&&i.theme===i.appliedTheme&&a.uitheme_applied||(a.uitheme_applied=!0,u=b[i.appliedTheme]||{},m=!e.isEmptyObject(u),p=m?[u.sortNone,u.sortDesc,u.sortAsc,u.active].join(" "):"",g=m?[u.iconSortNone,u.iconSortDesc,u.iconSortAsc].join(" "):"",m&&(a.zebra[0]=e.trim(" "+a.zebra[0].replace(" "+u.even,"")),a.zebra[1]=e.trim(" "+a.zebra[1].replace(" "+u.odd,"")),i.$tbodies.children().removeClass([u.even,u.odd].join(" "))),w.even&&(a.zebra[0]+=" "+w.even),w.odd&&(a.zebra[1]+=" "+w.odd),y.children("caption").removeClass(u.caption||"").addClass(w.caption),f=y.removeClass((i.appliedTheme?"tablesorter-"+(i.appliedTheme||""):"")+" "+(u.table||"")).addClass("tablesorter-"+v+" "+(w.table||"")).children("tfoot"),i.appliedTheme=i.theme,f.length&&f.children("tr").removeClass(u.footerRow||"").addClass(w.footerRow).children("th, td").removeClass(u.footerCells||"").addClass(w.footerCells),_.removeClass((m?[u.header,u.hover,p].join(" "):"")||"").addClass(w.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(t){e(this)["mouseenter"===t.type?"addClass":"removeClass"](w.hover||"")}),_.each(function(){var r=e(this);r.find("."+t.css.wrapper).length||r.wrapInner('<div class="'+t.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),i.cssIcon&&_.find("."+t.css.icon).removeClass(m?[u.icons,g].join(" "):"").addClass(w.icons||""),y.hasClass("hasFilters")&&y.children("thead").children("."+t.css.filterRow).removeClass(m?u.filterRow||"":"").addClass(w.filterRow||"")),l=0;l<i.columns;l++)c=i.$headers.add(e(i.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+l+'"]'),d=t.css.icon?c.find("."+t.css.icon):e(),h=_.not(".sorter-false").filter('[data-column="'+l+'"]:last'),h.length&&(c.removeClass(x),d.removeClass(C),h[0].sortDisabled?d.removeClass(w.icons||""):(s=w.sortNone,n=w.iconSortNone,h.hasClass(t.css.sortAsc)?(s=[w.sortAsc,w.active].join(" "),n=w.iconSortAsc):h.hasClass(t.css.sortDesc)&&(s=[w.sortDesc,w.active].join(" "),n=w.iconSortDesc),c.addClass(s),d.addClass(n||"")));i.debug&&t.benchmark("Applying "+v+" theme",o)},remove:function(e,r,i,a){if(i.uitheme_applied){var l=r.$table,s=r.appliedTheme||"jui",n=t.themes[s]||t.themes.jui,o=l.children("thead").children(),c=n.sortNone+" "+n.sortDesc+" "+n.sortAsc,d=n.iconSortNone+" "+n.iconSortDesc+" "+n.iconSortAsc;l.removeClass("tablesorter-"+s+" "+n.table),i.uitheme_applied=!1,a||(l.find(t.css.header).removeClass(n.header),o.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(n.hover+" "+c+" "+n.active).filter("."+t.css.filterRow).removeClass(n.filterRow),o.find("."+t.css.icon).removeClass(n.icons+" "+d))}}})}(jQuery),function(e){"use strict";var t=e.tablesorter||{};t.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(r,i,a){var l,s,n,o,c,d,f,h,u=i.$table,p=i.$tbodies,g=i.sortList,m=g.length,b=a&&a.columns||["primary","secondary","tertiary"],y=b.length-1;for(f=b.join(" "),s=0;s<p.length;s++)l=t.processTbody(r,p.eq(s),!0),n=l.children("tr"),n.each(function(){if(c=e(this),"none"!==this.style.display&&(d=c.children().removeClass(f),g&&g[0]&&(d.eq(g[0][0]).addClass(b[0]),m>1)))for(h=1;m>h;h++)d.eq(g[h][0]).addClass(b[h]||b[y])}),t.processTbody(r,l,!1);if(o=a.columns_thead!==!1?["thead tr"]:[],a.columns_tfoot!==!1&&o.push("tfoot tr"),o.length&&(n=u.find(o.join(",")).children().removeClass(f),m))for(h=0;m>h;h++)n.filter('[data-column="'+g[h][0]+'"]').addClass(b[h]||b[y])},remove:function(r,i,a){var l,s,n=i.$tbodies,o=(a.columns||["primary","secondary","tertiary"]).join(" ");for(i.$headers.removeClass(o),i.$table.children("tfoot").children("tr").children("th, td").removeClass(o),l=0;l<n.length;l++)s=t.processTbody(r,n.eq(l),!0),s.children("tr").each(function(){e(this).children().removeClass(o)}),t.processTbody(r,s,!1)}})}(jQuery),function(e){"use strict";var t=e.tablesorter||{},r=t.css;e.extend(r,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"}),t.addWidget({id:"filter",priority:50,options:{filter_childRows:!1,filter_childByColumn:!1,filter_columnFilters:!0,filter_columnAnyMatch:!0,filter_cellFilter:"",filter_cssFilter:"",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_startsWith:!1,filter_useParsedData:!1,filter_serversideFiltering:!1,filter_defaultAttrib:"data-value",filter_selectSourceSeparator:"|"},format:function(e,r,i){r.$table.hasClass("hasFilters")||t.filter.init(e,r,i)},remove:function(i,a,l,s){var n,o,c=a.$table,d=a.$tbodies,f="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(a.namespace+"filter ");if(c.removeClass("hasFilters").unbind(f.replace(/\s+/g," ")).find("."+r.filterRow).remove(),!s){for(n=0;n<d.length;n++)o=t.processTbody(i,d.eq(n),!0),o.children().removeClass(l.filter_filteredRow).show(),t.processTbody(i,o,!1);l.filter_reset&&e(document).undelegate(l.filter_reset,"click.tsfilter")}}}),t.filter={regex:{regex:/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/,child:/tablesorter-childRow/,filtered:/filtered/,type:/undefined|number/,exact:/(^[\"\'=]+)|([\"\'=]+$)/g,nondigit:/[^\w,. \-()]/g,operators:/[<>=]/g,query:"(q|query)"},types:{regex:function(e,r){if(t.filter.regex.regex.test(r.filter)){var i,a=r.filter_regexCache[r.index]||t.filter.regex.regex.exec(r.filter),l=a instanceof RegExp;try{l||(r.filter_regexCache[r.index]=a=new RegExp(a[1],a[2])),i=a.test(r.exact)}catch(s){i=!1}return i}return null},operators:function(r,i){if(/^[<>]=?/.test(i.iFilter)&&""!==i.iExact){var a,l,s,n=r.table,o=i.index,c=i.parsed[o],d=t.formatFloat(i.iFilter.replace(t.filter.regex.operators,""),n),f=r.parsers[o],h=d;return(c||"numeric"===f.type)&&(s=e.trim(""+i.iFilter.replace(t.filter.regex.operators,"")),l=t.filter.parseFilter(r,s,o,!0),d="number"!=typeof l||""===l||isNaN(l)?d:l),!c&&"numeric"!==f.type||isNaN(d)||"undefined"==typeof i.cache?(s=isNaN(i.iExact)?i.iExact.replace(t.filter.regex.nondigit,""):i.iExact,a=t.formatFloat(s,n)):a=i.cache,/>/.test(i.iFilter)?l=/>=/.test(i.iFilter)?a>=d:a>d:/</.test(i.iFilter)&&(l=/<=/.test(i.iFilter)?d>=a:d>a),l||""!==h||(l=!0),l}return null},notMatch:function(r,i){if(/^\!/.test(i.iFilter)){var a,l=i.iFilter.replace("!",""),s=t.filter.parseFilter(r,l,i.index,i.parsed[i.index])||"";return t.filter.regex.exact.test(s)?(s=s.replace(t.filter.regex.exact,""),""===s?!0:e.trim(s)!==i.iExact):(a=i.iExact.search(e.trim(s)),""===s?!0:!(r.widgetOptions.filter_startsWith?0===a:a>=0))}return null},exact:function(r,i){if(t.filter.regex.exact.test(i.iFilter)){var a=i.iFilter.replace(t.filter.regex.exact,""),l=t.filter.parseFilter(r,a,i.index,i.parsed[i.index])||"";return i.anyMatch?e.inArray(l,i.rowArray)>=0:l==i.iExact}return null},and:function(r,i){if(t.filter.regex.andTest.test(i.filter)){for(var a=i.index,l=i.parsed[a],s=i.iFilter.split(t.filter.regex.andSplit),n=i.iExact.search(e.trim(t.filter.parseFilter(r,s[0],a,l)))>=0,o=s.length-1;n&&o;)n=n&&i.iExact.search(e.trim(t.filter.parseFilter(r,s[o],a,l)))>=0,o--;return n}return null},range:function(e,r){if(t.filter.regex.toTest.test(r.iFilter)){var i,a,l,s,n=e.table,o=r.index,c=r.parsed[o],d=r.iFilter.split(t.filter.regex.toSplit);return a=d[0].replace(t.filter.regex.nondigit,"")||"",l=t.formatFloat(t.filter.parseFilter(e,a,o,c),n),a=d[1].replace(t.filter.regex.nondigit,"")||"",s=t.formatFloat(t.filter.parseFilter(e,a,o,c),n),(c||"numeric"===e.parsers[o].type)&&(i=e.parsers[o].format(""+d[0],n,e.$headers.eq(o),o),l=""===i||isNaN(i)?l:i,i=e.parsers[o].format(""+d[1],n,e.$headers.eq(o),o),s=""===i||isNaN(i)?s:i),!c&&"numeric"!==e.parsers[o].type||isNaN(l)||isNaN(s)?(a=isNaN(r.iExact)?r.iExact.replace(t.filter.regex.nondigit,""):r.iExact,i=t.formatFloat(a,n)):i=r.cache,l>s&&(a=l,l=s,s=a),i>=l&&s>=i||""===l||""===s}return null},wild:function(r,i){if(/[\?\*\|]/.test(i.iFilter)||t.filter.regex.orReplace.test(i.filter)){var a=i.index,l=i.parsed[a],s=i.iFilter.replace(t.filter.regex.orReplace,"|"),n=""+(t.filter.parseFilter(r,s,a,l)||"");return!r.$headerIndexed[a].hasClass("filter-match")&&/\|/.test(n)&&("|"===n[n.length-1]&&(n+="*"),n=i.anyMatch&&e.isArray(i.rowArray)?"("+n+")":"^("+n+")$"),new RegExp(n.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(i.iExact)}return null},fuzzy:function(e,r){if(/^~/.test(r.iFilter)){var i,a=0,l=r.iExact.length,s=r.iFilter.slice(1),n=t.filter.parseFilter(e,s,r.index,r.parsed[r.index])||"";for(i=0;l>i;i++)r.iExact[i]===n[a]&&(a+=1);return a===n.length?!0:!1}return null}},init:function(i,a,l){t.language=e.extend(!0,{},{to:"to",or:"or",and:"and"},t.language);var s,n,o,c,d,f,h,u,p,g=t.filter.regex;if(a.$table.addClass("hasFilters"),l.searchTimer=null,l.filter_initTimer=null,l.filter_formatterCount=0,l.filter_formatterInit=[],l.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',l.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',h="\\{"+t.filter.regex.query+"\\}",e.extend(g,{child:new RegExp(a.cssChildRow),filtered:new RegExp(l.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+t.language.or+"|-|"+t.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+t.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+t.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+t.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+t.language.and+"|&&)\\s+)","gi"),orReplace:new RegExp("\\s+("+t.language.or+")\\s+","gi"),iQuery:new RegExp(h,"i"),igQuery:new RegExp(h,"ig")}),h=a.$headers.filter(".filter-false, .parser-false").length,l.filter_columnFilters!==!1&&h!==a.$headers.length&&t.filter.buildRow(i,a,l),o="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(a.namespace+"filter "),a.$table.bind(o,function(s,n){return h=l.filter_hideEmpty&&e.isEmptyObject(a.cache)&&!(a.delayInit&&"appendCache"===s.type),a.$table.find("."+r.filterRow).toggleClass(l.filter_filteredRow,h),/(search|filter)/.test(s.type)||(s.stopPropagation(),t.filter.buildDefault(i,!0)),"filterReset"===s.type?(a.$table.find("."+r.filter).add(l.filter_$externalFilters).val(""),t.filter.searching(i,[])):"filterEnd"===s.type?t.filter.buildDefault(i,!0):(n="search"===s.type?n:"updateComplete"===s.type?a.$table.data("lastSearch"):"",/(update|add)/.test(s.type)&&"updateComplete"!==s.type&&(a.lastCombinedFilter=null,a.lastSearch=[]),t.filter.searching(i,n,!0)),!1}),l.filter_reset&&(l.filter_reset instanceof e?l.filter_reset.click(function(){a.$table.trigger("filterReset")}):e(l.filter_reset).length&&e(document).undelegate(l.filter_reset,"click.tsfilter").delegate(l.filter_reset,"click.tsfilter",function(){a.$table.trigger("filterReset")})),l.filter_functions)for(d=0;d<a.columns;d++)if(u=t.getColumnData(i,l.filter_functions,d))if(c=a.$headerIndexed[d].removeClass("filter-select"),p=!(c.hasClass("filter-false")||c.hasClass("parser-false")),s="",u===!0&&p)t.filter.buildSelect(i,d);else if("object"==typeof u&&p){for(n in u)"string"==typeof n&&(s+=""===s?'<option value="">'+(c.data("placeholder")||c.attr("data-placeholder")||l.filter_placeholder.select||"")+"</option>":"",h=n,o=n,n.indexOf(l.filter_selectSourceSeparator)>=0&&(h=n.split(l.filter_selectSourceSeparator),o=h[1],h=h[0]),s+="<option "+(o===h?"":'data-function-name="'+n+'" ')+'value="'+h+'">'+o+"</option>");a.$table.find("thead").find("select."+r.filter+'[data-column="'+d+'"]').append(s),o=l.filter_selectSource,u=e.isFunction(o)?!0:t.getColumnData(i,o,d),u&&t.filter.buildSelect(a.table,d,"",!0,c.hasClass(l.filter_onlyAvail))}t.filter.buildDefault(i,!0),t.filter.bindSearch(i,a.$table.find("."+r.filter),!0),l.filter_external&&t.filter.bindSearch(i,l.filter_external),l.filter_hideFilters&&t.filter.hideFilters(i,a),a.showProcessing&&(o="filterStart filterEnd ".split(" ").join(a.namespace+"filter "),a.$table.unbind(o.replace(/\s+/g," ")).bind(o,function(l,s){c=s?a.$table.find("."+r.header).filter("[data-column]").filter(function(){return""!==s[e(this).data("column")]}):"",t.isProcessing(i,"filterStart"===l.type,s?c:"")})),a.filteredRows=a.totalRows,o="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(a.namespace+"filter "),a.$table.unbind(o.replace(/\s+/g," ")).bind(o,function(){var e=this.config.widgetOptions;f=t.filter.setDefaults(i,a,e)||[],f.length&&(a.delayInit&&""===f.join("")||t.setFilters(i,f,!0)),a.$table.trigger("filterFomatterUpdate"),setTimeout(function(){e.filter_initialized||t.filter.filterInitComplete(a)},100)}),a.pager&&a.pager.initialized&&!l.filter_initialized&&(a.$table.trigger("filterFomatterUpdate"),setTimeout(function(){t.filter.filterInitComplete(a)},100))},formatterUpdated:function(e,t){var r=e.closest("table")[0].config.widgetOptions;r.filter_initialized||(r.filter_formatterInit[t]=1)},filterInitComplete:function(r){var i,a,l=r.widgetOptions,s=0,n=function(){l.filter_initialized=!0,r.$table.trigger("filterInit",r),t.filter.findRows(r.table,r.$table.data("lastSearch")||[])};if(e.isEmptyObject(l.filter_formatter))n();else{for(a=l.filter_formatterInit.length,i=0;a>i;i++)1===l.filter_formatterInit[i]&&s++;clearTimeout(l.filter_initTimer),l.filter_initialized||s!==l.filter_formatterCount?l.filter_initialized||(l.filter_initTimer=setTimeout(function(){n()},500)):n()}},setDefaults:function(r,i,a){var l,s,n,o,c,d=t.getFilters(r)||[];if(a.filter_saveFilters&&t.storage&&(s=t.storage(r,"tablesorter-filters")||[],l=e.isArray(s),l&&""===s.join("")||!l||(d=s)),""===d.join(""))for(c=i.$headers.add(a.filter_$externalFilters).filter("["+a.filter_defaultAttrib+"]"),n=0;n<=i.columns;n++)o=n===i.columns?"all":n,d[n]=c.filter('[data-column="'+o+'"]').attr(a.filter_defaultAttrib)||d[n]||"";return i.$table.data("lastSearch",d),d},parseFilter:function(e,t,r,i){return i?e.parsers[r].format(t,e.table,[],r):t},buildRow:function(i,a,l){var s,n,o,c,d,f,h,u,p=l.filter_cellFilter,g=a.columns,m=e.isArray(p),b='<tr role="row" class="'+r.filterRow+" "+a.cssIgnoreRow+'">';for(n=0;g>n;n++)b+="<td",b+=m?p[n]?' class="'+p[n]+'"':"":""!==p?' class="'+p+'"':"",b+="></td>";for(a.$filters=e(b+="</tr>").appendTo(a.$table.children("thead").eq(0)).find("td"),n=0;g>n;n++)d=!1,o=a.$headerIndexed[n],h=t.getColumnData(i,l.filter_functions,n),c=l.filter_functions&&h&&"function"!=typeof h||o.hasClass("filter-select"),s=t.getColumnData(i,a.headers,n),d="false"===t.getData(o[0],s,"filter")||"false"===t.getData(o[0],s,"parser"),c?b=e("<select>").appendTo(a.$filters.eq(n)):(h=t.getColumnData(i,l.filter_formatter,n),h?(l.filter_formatterCount++,b=h(a.$filters.eq(n),n),b&&0===b.length&&(b=a.$filters.eq(n).children("input")),b&&(0===b.parent().length||b.parent().length&&b.parent()[0]!==a.$filters[n])&&a.$filters.eq(n).append(b)):b=e('<input type="search">').appendTo(a.$filters.eq(n)),b&&(u=o.data("placeholder")||o.attr("data-placeholder")||l.filter_placeholder.search||"",b.attr("placeholder",u))),b&&(f=(e.isArray(l.filter_cssFilter)?"undefined"!=typeof l.filter_cssFilter[n]?l.filter_cssFilter[n]||"":"":l.filter_cssFilter)||"",b.addClass(r.filter+" "+f).attr("data-column",n),d&&(b.attr("placeholder","").addClass(r.filterDisabled)[0].disabled=!0))},bindSearch:function(r,i,a){if(r=e(r)[0],i=e(i),i.length){var l,s=r.config,n=s.widgetOptions,o=s.namespace+"filter",c=n.filter_$externalFilters;a!==!0&&(l=n.filter_anyColumnSelector+","+n.filter_multipleColumnSelector,n.filter_$anyMatch=i.filter(l),n.filter_$externalFilters=c&&c.length?n.filter_$externalFilters.add(i):i,t.setFilters(r,s.$table.data("lastSearch")||[],a===!1)),l="keypress keyup search change ".split(" ").join(o+" "),i.attr("data-lastSearchTime",(new Date).getTime()).unbind(l.replace(/\s+/g," ")).bind("keyup"+o,function(i){if(e(this).attr("data-lastSearchTime",(new Date).getTime()),27===i.which)this.value="";else{if(n.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof n.filter_liveSearch&&this.value.length<n.filter_liveSearch||13!==i.which&&8!==i.which&&(i.which<32||i.which>=37&&i.which<=40)))return}t.filter.searching(r,!0,!0)}).bind("search change keypress ".split(" ").join(o+" "),function(i){var a=e(this).data("column");(13===i.which||"search"===i.type||"change"===i.type&&this.value!==s.lastSearch[a])&&(i.preventDefault(),e(this).attr("data-lastSearchTime",(new Date).getTime()),t.filter.searching(r,!1,!0))})}},searching:function(e,r,i){var a=e.config.widgetOptions;clearTimeout(a.searchTimer),"undefined"==typeof r||r===!0?a.searchTimer=setTimeout(function(){t.filter.checkFilters(e,r,i)},a.filter_liveSearch?a.filter_searchDelay:10):t.filter.checkFilters(e,r,i)},checkFilters:function(i,a,l){var s=i.config,n=s.widgetOptions,o=e.isArray(a),c=o?a:t.getFilters(i,!0),d=(c||[]).join("");return e.isEmptyObject(s.cache)?void(s.delayInit&&s.pager&&s.pager.initialized&&s.$table.trigger("updateCache",[function(){t.filter.checkFilters(i,!1,l)}])):(o&&(t.setFilters(i,c,!1,l!==!0),n.filter_initialized||(s.lastCombinedFilter="")),n.filter_hideFilters&&s.$table.find("."+r.filterRow).trigger(""===d?"mouseleave":"mouseenter"),s.lastCombinedFilter!==d||a===!1?(a===!1&&(s.lastCombinedFilter=null,s.lastSearch=[]),n.filter_initialized&&s.$table.trigger("filterStart",[c]),s.showProcessing?void setTimeout(function(){return t.filter.findRows(i,c,d),!1},30):(t.filter.findRows(i,c,d),!1)):void 0)},hideFilters:function(i,a){var l,s,n;e(i).find("."+r.filterRow).addClass(r.filterRowHide).bind("mouseenter mouseleave",function(t){var i=t;l=e(this),clearTimeout(n),n=setTimeout(function(){/enter|over/.test(i.type)?l.removeClass(r.filterRowHide):e(document.activeElement).closest("tr")[0]!==l[0]&&""===a.lastCombinedFilter&&l.addClass(r.filterRowHide)},200)}).find("input, select").bind("focus blur",function(i){s=e(this).closest("tr"),clearTimeout(n);var l=i;n=setTimeout(function(){""===t.getFilters(a.$table).join("")&&s.toggleClass(r.filterRowHide,"focus"===l.type)},200)})},defaultFilter:function(r,i){if(""===r)return r;var a=t.filter.regex.iQuery,l=i.match(t.filter.regex.igQuery).length,s=l>1?e.trim(r).split(/\s/):[e.trim(r)],n=s.length-1,o=0,c=i;for(1>n&&l>1&&(s[1]=s[0]);a.test(c);)c=c.replace(a,s[o++]||""),a.test(c)&&n>o&&""!==(s[o]||"")&&(c=i.replace(a,c));return c},getLatestSearch:function(t){return t?t.sort(function(t,r){return e(r).attr("data-lastSearchTime")-e(t).attr("data-lastSearchTime")}):e()},multipleColumns:function(r,i){var a,l,s,n,o,c,d,f,h,u=r.widgetOptions,p=u.filter_initialized||!i.filter(u.filter_anyColumnSelector).length,g=[],m=e.trim(t.filter.getLatestSearch(i).attr("data-column")||"");if(p&&/-/.test(m))for(l=m.match(/(\d+)\s*-\s*(\d+)/g),h=l.length,f=0;h>f;f++){for(s=l[f].split(/\s*-\s*/),n=parseInt(s[0],10)||0,o=parseInt(s[1],10)||r.columns-1,n>o&&(a=n,n=o,o=a),o>=r.columns&&(o=r.columns-1);o>=n;n++)g.push(n);m=m.replace(l[f],"")}if(p&&/,/.test(m))for(c=m.split(/\s*,\s*/),h=c.length,d=0;h>d;d++)""!==c[d]&&(f=parseInt(c[d],10),f<r.columns&&g.push(f));if(!g.length)for(f=0;f<r.columns;f++)g.push(f);return g},processRow:function(r,i,a){var l,s,n,o,c,d,f,h,u,p,g,m=t.filter.regex,b=r.widgetOptions,y=!0;if(i.$cells=i.$row.children(),i.anyMatchFlag){s=t.filter.multipleColumns(r,b.filter_$anyMatch),i.anyMatch=!0,i.rowArray=i.$cells.map(function(a){return e.inArray(a,s)>-1?(i.parsed[a]?g=i.cacheArray[a]:(g=i.rawArray[a],g=e.trim(b.filter_ignoreCase?g.toLowerCase():g),r.sortLocaleCompare&&(g=t.replaceAccents(g))),g):void 0}).get(),i.filter=i.anyMatchFilter,i.iFilter=i.iAnyMatchFilter,i.exact=i.rowArray.join(" "),i.iExact=b.filter_ignoreCase?i.exact.toLowerCase():i.exact,i.cache=i.cacheArray.slice(0,-1).join(" "),f=null,o=null;for(p in t.filter.types)e.inArray(p,a.noAnyMatch)<0&&null===o&&(o=t.filter.types[p](r,i),null!==o&&(f=o));if(null!==f)y=f;else if(b.filter_startsWith)for(y=!1,s=r.columns;!y&&s>0;)s--,y=y||0===i.rowArray[s].indexOf(i.iFilter);else y=(i.iExact+i.childRowText).indexOf(i.iFilter)>=0;if(i.anyMatch=!1,i.filters.join("")===i.filter)return y}for(s=0;s<r.columns;s++)if(i.filter=i.filters[s],i.index=s,h=a.excludeFilter[s],i.filter){if(i.cache=i.cacheArray[s],b.filter_useParsedData||i.parsed[s]?i.exact=i.cache:(c=i.rawArray[s]||"",i.exact=r.sortLocaleCompare?t.replaceAccents(c):c),i.iExact=!m.type.test(typeof i.exact)&&b.filter_ignoreCase?i.exact.toLowerCase():i.exact,c=y,p=b.filter_columnFilters?r.$filters.add(r.$externalFilters).filter('[data-column="'+s+'"]').find("select option:selected").attr("data-function-name")||"":"",r.sortLocaleCompare&&(i.filter=t.replaceAccents(i.filter)),d=!0,b.filter_defaultFilter&&m.iQuery.test(a.defaultColFilter[s])&&(i.filter=t.filter.defaultFilter(i.filter,a.defaultColFilter[s]),d=!1),i.iFilter=b.filter_ignoreCase?(i.filter||"").toLowerCase():i.filter,u=a.functions[s],l=r.$headerIndexed[s],n=l.hasClass("filter-select"),f=null,(u||n&&d)&&(u===!0||n?f=l.hasClass("filter-match")?i.iExact.search(i.iFilter)>=0:i.filter===i.exact:"function"==typeof u?f=u(i.exact,i.cache,i.filter,s,i.$row,r,i):"function"==typeof u[p||i.filter]&&(g=p||i.filter,f=u[g](i.exact,i.cache,i.filter,s,i.$row,r,i))),null===f){o=null;for(p in t.filter.types)e.inArray(p,h)<0&&null===o&&(o=t.filter.types[p](r,i),null!==o&&(f=o));null!==f?c=f:(g=(i.iExact+i.childRowText).indexOf(t.filter.parseFilter(r,i.iFilter,s,i.parsed[s])),c=!b.filter_startsWith&&g>=0||b.filter_startsWith&&0===g)}else c=f;y=c?y:!1}return y},findRows:function(r,i,a){if(r.config.lastCombinedFilter!==a&&r.config.widgetOptions.filter_initialized){var l,s,n,o,c,d,f,h,u,p,g,m,b,y,_,v,w,x,C,$,z,S,F=e.extend([],i),R=t.filter.regex,k=r.config,T=k.widgetOptions,A={anyMatch:!1,filters:i,filter_regexCache:[]},H={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:t.getColumnData(r,T.filter_defaultFilter,k.columns,!0)||""};for(A.parsed=k.$headers.map(function(i){return k.parsers&&k.parsers[i]&&k.parsers[i].parsed||t.getData&&"parsed"===t.getData(k.$headerIndexed[i],t.getColumnData(r,k.headers,i),"filter")||e(this).hasClass("filter-parsed")}).get(),h=0;h<k.columns;h++)H.functions[h]=t.getColumnData(r,T.filter_functions,h),H.defaultColFilter[h]=t.getColumnData(r,T.filter_defaultFilter,h)||"",H.excludeFilter[h]=(t.getColumnData(r,T.filter_excludeFilter,h,!0)||"").split(/\s+/);for(k.debug&&(t.log("Filter: Starting filter widget search",i),b=new Date),k.filteredRows=0,k.totalRows=0,a=(F||[]).join(""),d=0;d<k.$tbodies.length;d++){if(f=t.processTbody(r,k.$tbodies.eq(d),!0),h=k.columns,s=k.cache[d].normalized,o=e(e.map(s,function(e){return e[h].$row.get()})),""===a||T.filter_serversideFiltering)o.removeClass(T.filter_filteredRow).not("."+k.cssChildRow).css("display","");else{if(o=o.not("."+k.cssChildRow),l=o.length,(T.filter_$anyMatch&&T.filter_$anyMatch.length||"undefined"!=typeof i[k.columns])&&(A.anyMatchFlag=!0,A.anyMatchFilter=""+(i[k.columns]||T.filter_$anyMatch&&t.filter.getLatestSearch(T.filter_$anyMatch).val()||""),T.filter_columnAnyMatch)){for(x=A.anyMatchFilter.split(R.andSplit),C=!1,_=0;_<x.length;_++)$=x[_].split(":"),$.length>1&&(z=parseInt($[0],10)-1,z>=0&&z<k.columns&&(i[z]=$[1],x.splice(_,1),_--,C=!0));C&&(A.anyMatchFilter=x.join(" && "))}if(w=T.filter_searchFiltered,g=k.lastSearch||k.$table.data("lastSearch")||[],w)for(_=0;h+1>_;_++)y=i[_]||"",w||(_=h),w=!(!w||!g.length||0!==y.indexOf(g[_]||"")||R.alreadyFiltered.test(y)||/[=\"\|!]/.test(y)||/(>=?\s*-\d)/.test(y)||/(<=?\s*\d)/.test(y)||""!==y&&k.$filters&&k.$filters.eq(_).find("select").length&&!k.$headerIndexed[_].hasClass("filter-match"));for(v=o.not("."+T.filter_filteredRow).length,w&&0===v&&(w=!1),k.debug&&t.log("Filter: Searching through "+(w&&l>v?v:"all")+" rows"),A.anyMatchFlag&&(k.sortLocaleCompare&&(A.anyMatchFilter=t.replaceAccents(A.anyMatchFilter)),T.filter_defaultFilter&&R.iQuery.test(H.defaultAnyFilter)&&(A.anyMatchFilter=t.filter.defaultFilter(A.anyMatchFilter,H.defaultAnyFilter),w=!1),A.iAnyMatchFilter=T.filter_ignoreCase&&k.ignoreCase?A.anyMatchFilter.toLowerCase():A.anyMatchFilter),c=0;l>c;c++)if(S=o[c].className,u=c&&R.child.test(S),!(u||w&&R.filtered.test(S))){if(A.$row=o.eq(c),A.cacheArray=s[c],n=A.cacheArray[k.columns],A.rawArray=n.raw,A.childRowText="",!T.filter_childByColumn){for(S="",p=n.child,_=0;_<p.length;_++)S+=" "+p[_].join("")||"";A.childRowText=T.filter_childRows?T.filter_ignoreCase?S.toLowerCase():S:""}if(m=t.filter.processRow(k,A,H),p=n.$row.filter(":gt( 0 )"),T.filter_childRows&&p.length){if(T.filter_childByColumn)for(_=0;_<p.length;_++)A.$row=p.eq(_),A.cacheArray=n.child[_],A.rawArray=A.cacheArray,m=m||t.filter.processRow(k,A,H);p.toggleClass(T.filter_filteredRow,!m)}n.$row.toggleClass(T.filter_filteredRow,!m)[0].display=m?"":"none"}}k.filteredRows+=o.not("."+T.filter_filteredRow).length,k.totalRows+=o.length,t.processTbody(r,f,!1)}k.lastCombinedFilter=a,k.lastSearch=F,k.$table.data("lastSearch",F),T.filter_saveFilters&&t.storage&&t.storage(r,"tablesorter-filters",F),k.debug&&t.benchmark("Completed filter widget search",b),T.filter_initialized&&k.$table.trigger("filterEnd",k),setTimeout(function(){k.$table.trigger("applyWidgets")},0)}},getOptionSource:function(r,i,a){r=e(r)[0];var l,s,n,o=r.config,c=o.widgetOptions,d=[],f=!1,h=c.filter_selectSource,u=o.$table.data("lastSearch")||[],p=e.isFunction(h)?!0:t.getColumnData(r,h,i);if(a&&""!==u[i]&&(a=!1),p===!0)f=h(r,i,a);else{if(p instanceof e||"string"===e.type(p)&&p.indexOf("</option>")>=0)return p;e.isArray(p)?f=p:"object"===e.type(h)&&p&&(f=p(r,i,a))}if(f===!1&&(f=t.filter.getOptions(r,i,a)),f=e.grep(f,function(t,r){return e.inArray(t,f)===r}),o.$headerIndexed[i].hasClass("filter-select-nosort"))return f;for(n=f.length,s=0;n>s;s++)d.push({t:f[s],p:o.parsers&&o.parsers[i].format(f[s],r,[],i)});for(l=o.textSorter||"",d.sort(function(a,s){var n=a.p.toString(),o=s.p.toString();return e.isFunction(l)?l(n,o,!0,i,r):"object"==typeof l&&l.hasOwnProperty(i)?l[i](n,o,!0,i,r):t.sortNatural?t.sortNatural(n,o):!0}),f=[],n=d.length,s=0;n>s;s++)f.push(d[s].t);return f},getOptions:function(t,r,i){t=e(t)[0];var a,l,s,n,o,c=t.config,d=c.widgetOptions,f=[];for(l=0;l<c.$tbodies.length;l++)for(o=c.cache[l],s=c.cache[l].normalized.length,a=0;s>a;a++)n=o.row?o.row[a]:o.normalized[a][c.columns].$row[0],i&&n.className.match(d.filter_filteredRow)||f.push(d.filter_useParsedData||c.parsers[r].parsed||c.$headerIndexed[r].hasClass("filter-parsed")?""+o.normalized[a][r]:o.normalized[a][c.columns].raw[r]);return f},buildSelect:function(i,a,l,s,n){if(i=e(i)[0],a=parseInt(a,10),i.config.cache&&!e.isEmptyObject(i.config.cache)){var o,c,d,f,h,u,p=i.config,g=p.widgetOptions,m=p.$headerIndexed[a],b='<option value="">'+(m.data("placeholder")||m.attr("data-placeholder")||g.filter_placeholder.select||"")+"</option>",y=p.$table.find("thead").find("select."+r.filter+'[data-column="'+a+'"]').val();if(("undefined"==typeof l||""===l)&&(l=t.filter.getOptionSource(i,a,n)),e.isArray(l)){for(o=0;o<l.length;o++)d=l[o]=(""+l[o]).replace(/\"/g,"&quot;"),c=d,d.indexOf(g.filter_selectSourceSeparator)>=0&&(f=d.split(g.filter_selectSourceSeparator),c=f[0],d=f[1]),b+=""!==l[o]?"<option "+(c===d?"":'data-function-name="'+l[o]+'" ')+'value="'+c+'">'+d+"</option>":"";l=[]}h=(p.$filters?p.$filters:p.$table.children("thead")).find("."+r.filter),g.filter_$externalFilters&&(h=h&&h.length?h.add(g.filter_$externalFilters):g.filter_$externalFilters),u=h.filter('select[data-column="'+a+'"]'),u.length&&(u[s?"html":"append"](b),e.isArray(l)||u.append(l).val(y),u.val(y))}},buildDefault:function(e,r){var i,a,l,s=e.config,n=s.widgetOptions,o=s.columns;for(i=0;o>i;i++)a=s.$headerIndexed[i],l=!(a.hasClass("filter-false")||a.hasClass("parser-false")),(a.hasClass("filter-select")||t.getColumnData(e,n.filter_functions,i)===!0)&&l&&t.filter.buildSelect(e,i,"",r,a.hasClass(n.filter_onlyAvail))}},t.getFilters=function(i,a,l,s){var n,o,c,d,f=!1,h=i?e(i)[0].config:"",u=h?h.widgetOptions:"";if(a!==!0&&u&&!u.filter_columnFilters||e.isArray(l)&&l.join("")===h.lastCombinedFilter)return e(i).data("lastSearch");if(h&&(h.$filters&&(o=h.$filters.find("."+r.filter)),u.filter_$externalFilters&&(o=o&&o.length?o.add(u.filter_$externalFilters):u.filter_$externalFilters),o&&o.length))for(f=l||[],n=0;n<h.columns+1;n++)d=n===h.columns?u.filter_anyColumnSelector+","+u.filter_multipleColumnSelector:'[data-column="'+n+'"]',c=o.filter(d),c.length&&(c=t.filter.getLatestSearch(c),e.isArray(l)?(s&&c.slice(1),n===h.columns&&(d=c.filter(u.filter_anyColumnSelector),c=d.length?d:c),c.val(l[n]).trigger("change.tsfilter")):(f[n]=c.val()||"",n===h.columns?c.slice(1).filter('[data-column*="'+c.attr("data-column")+'"]').val(f[n]):c.slice(1).val(f[n])),n===h.columns&&c.length&&(u.filter_$anyMatch=c));return 0===f.length&&(f=!1),f},t.setFilters=function(r,i,a,l){var s=r?e(r)[0].config:"",n=t.getFilters(r,!0,i,l);return s&&a&&(s.lastCombinedFilter=null,s.lastSearch=[],t.filter.searching(s.table,i,l),s.$table.trigger("filterFomatterUpdate")),!!n}}(jQuery),function(e,t){"use strict";var r=e.tablesorter||{};e.extend(r.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),r.addHeaderResizeEvent=function(t,r,i){t=e(t)[0];
-var a,l={timer:250},s=e.extend({},l,i),n=t.config,o=n.widgetOptions,c=function(t){o.resize_flag=!0,a=[],n.$headers.each(function(){var t=e(this),r=t.data("savedSizes")||[0,0],i=this.offsetWidth,l=this.offsetHeight;(i!==r[0]||l!==r[1])&&(t.data("savedSizes",[i,l]),a.push(this))}),a.length&&t!==!1&&n.$table.trigger("resize",[a]),o.resize_flag=!1};return c(!1),clearInterval(o.resize_timer),r?(o.resize_flag=!1,!1):void(o.resize_timer=setInterval(function(){o.resize_flag||c()},s.timer))},r.addWidget({id:"stickyHeaders",priority:60,options:{stickyHeaders:"",stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(i,a,l){if(!(a.$table.hasClass("hasStickyHeaders")||e.inArray("filter",a.widgets)>=0&&!a.$table.hasClass("hasFilters"))){var s,n=a.$table,o=e(l.stickyHeaders_attachTo),c=a.namespace+"stickyheaders ",d=e(l.stickyHeaders_yScroll||l.stickyHeaders_attachTo||t),f=e(l.stickyHeaders_xScroll||l.stickyHeaders_attachTo||t),h=n.children("thead:first"),u=h.children("tr").not(".sticky-false").children(),p=n.children("tfoot"),g=isNaN(l.stickyHeaders_offset)?e(l.stickyHeaders_offset):"",m=g.length?g.height()||0:parseInt(l.stickyHeaders_offset,10)||0,b=n.parent().closest("."+r.css.table).hasClass("hasStickyHeaders")?n.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],y=b.length?b.height():0,_=l.$sticky=n.clone().addClass("containsStickyHeaders "+r.css.sticky+" "+l.stickyHeaders+" "+a.namespace.slice(1)+"_extra_table").wrap('<div class="'+r.css.stickyWrap+'">'),v=_.parent().addClass(r.css.stickyHide).css({position:o.length?"absolute":"fixed",padding:parseInt(_.parent().parent().css("padding-left"),10),top:m+y,left:0,visibility:"hidden",zIndex:l.stickyHeaders_zIndex||2}),w=_.children("thead:first"),x="",C=0,$=function(r,i){r.filter(":visible").each(function(r){var a,l,s=i.filter(":visible").eq(r),n=e(this);"border-box"===n.css("box-sizing")?a=n.outerWidth():"collapse"===s.css("border-collapse")?t.getComputedStyle?a=parseFloat(t.getComputedStyle(this,null).width):(l=parseFloat(n.css("border-width")),a=n.outerWidth()-parseFloat(n.css("padding-left"))-parseFloat(n.css("padding-right"))-l):a=n.width(),s.css({"min-width":a,"max-width":a})})},z=function(){m=g.length?g.height()||0:parseInt(l.stickyHeaders_offset,10)||0,C=0,v.css({left:o.length?parseInt(o.css("padding-left"),10)||0:n.offset().left-parseInt(n.css("margin-left"),10)-f.scrollLeft()-C,width:n.outerWidth()}),$(n,_),$(u,s)};o.length&&!o.css("position")&&o.css("position","relative"),_.attr("id")&&(_[0].id+=l.stickyHeaders_cloneId),_.find("thead:gt(0), tr.sticky-false").hide(),_.find("tbody, tfoot").remove(),_.find("caption").toggle(l.stickyHeaders_includeCaption),s=w.children().children(),_.css({height:0,width:0,margin:0}),s.find("."+r.css.resizer).remove(),n.addClass("hasStickyHeaders").bind("pagerComplete"+c,function(){z()}),r.bindEvents(i,w.children().children("."+r.css.header)),n.after(v),a.onRenderHeader&&w.children("tr").children().each(function(t){a.onRenderHeader.apply(e(this),[t,a,_])}),f.add(d).unbind("scroll resize ".split(" ").join(c).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(c),function(t){if(n.is(":visible")){y=b.length?b.offset().top-d.scrollTop()+b.height():0;var i=n.offset(),a=e.isWindow(d[0]),l=e.isWindow(f[0]),s=(o.length?a?d.scrollTop():d.offset().top:d.scrollTop())+m+y,c=n.height()-(v.height()+(p.height()||0)),h=s>i.top&&s<i.top+c?"visible":"hidden",u={visibility:h};o.length&&(u.top=a?s-o.offset().top:o.scrollTop()),l&&(u.left=n.offset().left-parseInt(n.css("margin-left"),10)-f.scrollLeft()-C),b.length&&(u.top=(u.top||0)+m+y),v.removeClass(r.css.stickyVis+" "+r.css.stickyHide).addClass("visible"===h?r.css.stickyVis:r.css.stickyHide).css(u),(h!==x||"resize"===t.type)&&(z(),x=h)}}),l.stickyHeaders_addResizeEvent&&r.addHeaderResizeEvent(i),n.hasClass("hasFilters")&&l.filter_columnFilters&&(n.bind("filterEnd"+c,function(){var i=e(document.activeElement).closest("td"),s=i.parent().children().index(i);v.hasClass(r.css.stickyVis)&&l.stickyHeaders_filteredToTop&&(t.scrollTo(0,n.position().top),s>=0&&a.$filters&&a.$filters.eq(s).find("a, select, input").filter(":visible").focus())}),r.filter.bindSearch(n,s.find("."+r.css.filter)),l.filter_hideFilters&&r.filter.hideFilters(_,a)),n.trigger("stickyHeadersInit")}},remove:function(i,a,l){var s=a.namespace+"stickyheaders ";a.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd ".split(" ").join(s).replace(/\s+/g," ")).next("."+r.css.stickyWrap).remove(),l.$sticky&&l.$sticky.length&&l.$sticky.remove(),e(t).add(l.stickyHeaders_xScroll).add(l.stickyHeaders_yScroll).add(l.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(s).replace(/\s+/g," ")),r.addHeaderResizeEvent(i,!1)}})}(jQuery,window),function(e,t){"use strict";var r=e.tablesorter||{};e.extend(r.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),e(function(){var t="<style>body."+r.css.resizableNoSelect+" { -ms-user-select: none; -moz-user-select: -moz-none;-khtml-user-select: none; -webkit-user-select: none; user-select: none; }."+r.css.resizableContainer+" { position: relative; height: 1px; }."+r.css.resizableHandle+" { position: absolute; display: inline-block; width: 8px; top: 1px;cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }</style>";e(t).appendTo("body")}),r.resizable={init:function(t,i){if(!t.$table.hasClass("hasResizable")){t.$table.addClass("hasResizable"),r.resizableReset(t.table,!0),i.resizable_={$wrap:t.$table.parent(),mouseXPosition:0,$target:null,$next:null,overflow:"auto"===t.$table.parent().css("overflow"),fullWidth:Math.abs(t.$table.parent().width()-t.$table.width())<20,storedSizes:[]};var a,l,s,n,o=parseInt(t.$table.css("margin-top"),10);for(i.resizable_.storedSizes=n=(r.storage&&i.resizable!==!1?r.storage(t.table,r.css.resizableStorage):[])||[],r.resizable.setWidths(t,i,n),i.$resizable_container=e('<div class="'+r.css.resizableContainer+'">').css({top:o}).insertBefore(t.$table),s=0;s<t.columns;s++)l=t.$headerIndexed[s],a="false"===r.getData(l,r.getColumnData(t.table,t.headers,s),"resizable"),a||e('<div class="'+r.css.resizableHandle+'">').appendTo(i.$resizable_container).attr({"data-column":s,unselectable:"on"}).data("header",l).bind("selectstart",!1);t.$table.one("tablesorter-initialized",function(){r.resizable.setHandlePosition(t,i),r.resizable.bindings(this.config,this.config.widgetOptions)})}},setWidth:function(e,t){e.css({width:t,"min-width":"","max-width":""})},setWidths:function(t,i,a){var l,s=e(t.namespace+"_extra_headers"),n=t.$table.children("colgroup").children("col");if(a=a||i.resizable_.storedSizes||[],a.length){for(l=0;l<t.columns;l++)t.$headerIndexed[l].width(a[l]),s.length&&r.resizable.setWidth(s.eq(l).add(n.eq(l)),a[l]);e(t.namespace+"_extra_table").length&&!r.hasWidget(t.table,"scroller")&&r.resizable.setWidth(e(t.namespace+"_extra_table"),t.$table.outerWidth())}},setHandlePosition:function(t,i){var a,l=r.hasWidget(t.table,"scroller"),s=t.$table.height(),n=i.$resizable_container.children(),o=Math.floor(n.width()/2);l&&(s=0,t.$table.closest("."+r.css.scrollerWrap).children().each(function(){var t=e(this);s+=t.filter('[style*="height"]').length?t.height():t.children("table").height()})),a=t.$table.position().left,n.each(function(){var r=e(this),l=parseInt(r.attr("data-column"),10),n=t.columns-1,c=r.data("header");c&&(c.is(":visible")?(n>l||l===n&&i.resizable_addLastColumn)&&r.css({display:"inline-block",height:s,left:c.position().left-a+c.outerWidth()-o}):r.hide())})},toggleTextSelection:function(t,i){var a=t.namespace+"tsresize";t.widgetOptions.resizable_.disabled=i,e("body").toggleClass(r.css.resizableNoSelect,i),i?e("body").attr("unselectable","on").bind("selectstart"+a,!1):e("body").removeAttr("unselectable").unbind("selectstart"+a)},bindings:function(i,a){var l=i.namespace+"tsresize";a.$resizable_container.children().bind("mousedown",function(t){var l,s,n=a.resizable_,o=e(i.namespace+"_extra_headers"),c=e(t.target).data("header");for(l=parseInt(c.attr("data-column"),10),n.$target=c=c.add(o.filter('[data-column="'+l+'"]')),n.target=l,n.$next=t.shiftKey||a.resizable_targetLast?c.parent().children().not(".resizable-false").filter(":last"):c.nextAll(":not(.resizable-false)").eq(0),l=parseInt(n.$next.attr("data-column"),10),n.$next=n.$next.add(o.filter('[data-column="'+l+'"]')),n.next=l,n.mouseXPosition=t.pageX,n.storedSizes=[],l=0;l<i.columns;l++)s=i.$headerIndexed[l],n.storedSizes[l]=s.is(":visible")?s.width():0;r.resizable.toggleTextSelection(i,!0)}),e(document).bind("mousemove"+l,function(e){var t=a.resizable_;t.disabled&&0!==t.mouseXPosition&&t.$target&&(a.resizable_throttle?(clearTimeout(t.timer),t.timer=setTimeout(function(){r.resizable.mouseMove(i,a,e)},isNaN(a.resizable_throttle)?5:a.resizable_throttle)):r.resizable.mouseMove(i,a,e))}).bind("mouseup"+l,function(){a.resizable_.disabled&&(r.resizable.toggleTextSelection(i,!1),r.resizable.stopResize(i,a),r.resizable.setHandlePosition(i,a))}),e(t).bind("resize"+l+" resizeEnd"+l,function(){r.resizable.setHandlePosition(i,a)}),i.$table.bind("columnUpdate"+l,function(){r.resizable.setHandlePosition(i,a)}).find("thead:first").add(e(i.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+l,function(){var e=0===a.resizable_.storedSizes.length;return r.resizableReset(i.table),r.resizable.setHandlePosition(i,a),a.resizable_.storedSizes=[],e})},mouseMove:function(t,i,a){if(0!==i.resizable_.mouseXPosition&&i.resizable_.$target){var l=i.resizable_,s=l.$next,n=a.pageX-l.mouseXPosition;l.fullWidth?(l.storedSizes[l.target]+=n,l.storedSizes[l.next]-=n,r.resizable.setWidths(t,i)):l.overflow?(t.$table.add(e(t.namespace+"_extra_table")).width(function(e,t){return t+n}),s.length||(l.$wrap[0].scrollLeft=t.$table.width())):(l.storedSizes[l.target]+=n,r.resizable.setWidths(t,i)),l.mouseXPosition=a.pageX}},stopResize:function(i,a){var l,s,n=a.resizable_;if(n.storedSizes=[],r.storage){for(n.storedSizes=[],s=0;s<i.columns;s++)l=i.$headerIndexed[s],n.storedSizes[s]=l.is(":visible")?l.width():0;a.resizable!==!1&&r.storage(i.table,r.css.resizableStorage,n.storedSizes)}n.mouseXPosition=0,n.$target=n.$next=null,e(t).trigger("resize")}},r.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_widths:[],resizable_throttle:!1,resizable_targetLast:!1},init:function(e,t,i,a){r.resizable.init(i,a)},remove:function(t,i,a,l){if(a.$resizable_container){var s=i.namespace+"tsresize";i.$table.add(e(i.namespace+"_extra_table")).removeClass("hasResizable").children("thead").unbind("contextmenu"+s),a.$resizable_container.remove(),r.resizable.toggleTextSelection(i,!1),r.resizableReset(t,l),e(document).unbind("mousemove"+s+" mouseup"+s)}}}),r.resizableReset=function(i,a){e(i).each(function(){var l,s,n=this.config,o=n&&n.widgetOptions;if(i&&n&&n.$headerIndexed.length){for(l=0;l<n.columns;l++)s=n.$headerIndexed[l],o.resizable_widths&&o.resizable_widths[l]?s.css("width",o.resizable_widths[l]):s.hasClass("resizable-false")||s.css("width","");e(t).trigger("resize"),r.storage&&!a&&r.storage(this,r.css.resizableStorage,{})}})}}(jQuery,window),function(e){"use strict";var t=e.tablesorter||{};t.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(e,t,r,i){t.format(e,r,i,!0)},format:function(r,i,a,l){var s,n,o=i.$table,c=a.saveSort!==!1,d={sortList:i.sortList};i.debug&&(n=new Date),o.hasClass("hasSaveSort")?c&&r.hasInitialized&&t.storage&&(t.storage(r,"tablesorter-savesort",d),i.debug&&t.benchmark("saveSort widget: Saving last sort: "+i.sortList,n)):(o.addClass("hasSaveSort"),d="",t.storage&&(s=t.storage(r,"tablesorter-savesort"),d=s&&s.hasOwnProperty("sortList")&&e.isArray(s.sortList)?s.sortList:"",i.debug&&t.benchmark('saveSort: Last sort loaded: "'+d+'"',n),o.bind("saveSortReset",function(e){e.stopPropagation(),t.storage(r,"tablesorter-savesort","")})),l&&d&&d.length>0?i.sortList=d:r.hasInitialized&&d&&d.length>0&&o.trigger("sorton",[d]))},remove:function(e,r){r.$table.removeClass("hasSaveSort"),t.storage&&t.storage(e,"tablesorter-savesort","")}})}(jQuery),e.tablesorter});
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery) {
+/*! Widget: storage - updated 2018-03-18 (v2.30.0) */
+/*global JSON:false */
+;(function ($, window, document) {
+ 'use strict';
+
+ var ts = $.tablesorter || {};
+
+ // update defaults for validator; these values must be falsy!
+ $.extend(true, ts.defaults, {
+ fixedUrl: '',
+ widgetOptions: {
+ storage_fixedUrl: '',
+ storage_group: '',
+ storage_page: '',
+ storage_storageType: '',
+ storage_tableId: '',
+ storage_useSessionStorage: ''
+ }
+ });
+
+ // *** Store data in local storage, with a cookie fallback ***
+ /* IE7 needs JSON library for JSON.stringify - (http://caniuse.com/#search=json)
+ if you need it, then include https://github.com/douglascrockford/JSON-js
+
+ $.parseJSON is not available is jQuery versions older than 1.4.1, using older
+ versions will only allow storing information for one page at a time
+
+ // *** Save data (JSON format only) ***
+ // val must be valid JSON... use http://jsonlint.com/ to ensure it is valid
+ var val = { "mywidget" : "data1" }; // valid JSON uses double quotes
+ // $.tablesorter.storage(table, key, val);
+ $.tablesorter.storage(table, 'tablesorter-mywidget', val);
+
+ // *** Get data: $.tablesorter.storage(table, key); ***
+ v = $.tablesorter.storage(table, 'tablesorter-mywidget');
+ // val may be empty, so also check for your data
+ val = (v && v.hasOwnProperty('mywidget')) ? v.mywidget : '';
+ alert(val); // 'data1' if saved, or '' if not
+ */
+ ts.storage = function(table, key, value, options) {
+ table = $(table)[0];
+ var cookieIndex, cookies, date,
+ hasStorage = false,
+ values = {},
+ c = table.config,
+ wo = c && c.widgetOptions,
+ debug = ts.debug(c, 'storage'),
+ storageType = (
+ ( options && options.storageType ) || ( wo && wo.storage_storageType )
+ ).toString().charAt(0).toLowerCase(),
+ // deprecating "useSessionStorage"; any storageType setting overrides it
+ session = storageType ? '' :
+ ( options && options.useSessionStorage ) || ( wo && wo.storage_useSessionStorage ),
+ $table = $(table),
+ // id from (1) options ID, (2) table 'data-table-group' attribute, (3) widgetOptions.storage_tableId,
+ // (4) table ID, then (5) table index
+ id = options && options.id ||
+ $table.attr( options && options.group || wo && wo.storage_group || 'data-table-group') ||
+ wo && wo.storage_tableId || table.id || $('.tablesorter').index( $table ),
+ // url from (1) options url, (2) table 'data-table-page' attribute, (3) widgetOptions.storage_fixedUrl,
+ // (4) table.config.fixedUrl (deprecated), then (5) window location path
+ url = options && options.url ||
+ $table.attr(options && options.page || wo && wo.storage_page || 'data-table-page') ||
+ wo && wo.storage_fixedUrl || c && c.fixedUrl || window.location.pathname;
+
+ // skip if using cookies
+ if (storageType !== 'c') {
+ storageType = (storageType === 's' || session) ? 'sessionStorage' : 'localStorage';
+ // https://gist.github.com/paulirish/5558557
+ if (storageType in window) {
+ try {
+ window[storageType].setItem('_tmptest', 'temp');
+ hasStorage = true;
+ window[storageType].removeItem('_tmptest');
+ } catch (error) {
+ console.warn( storageType + ' is not supported in this browser' );
+ }
+ }
+ }
+ if (debug) {
+ console.log('Storage >> Using', hasStorage ? storageType : 'cookies');
+ }
+ // *** get value ***
+ if ($.parseJSON) {
+ if (hasStorage) {
+ values = $.parseJSON( window[storageType][key] || 'null' ) || {};
+ } else {
+ // old browser, using cookies
+ cookies = document.cookie.split(/[;\s|=]/);
+ // add one to get from the key to the value
+ cookieIndex = $.inArray(key, cookies) + 1;
+ values = (cookieIndex !== 0) ? $.parseJSON(cookies[cookieIndex] || 'null') || {} : {};
+ }
+ }
+ // allow value to be an empty string too
+ if (typeof value !== 'undefined' && window.JSON && JSON.hasOwnProperty('stringify')) {
+ // add unique identifiers = url pathname > table ID/index on page > data
+ if (!values[url]) {
+ values[url] = {};
+ }
+ values[url][id] = value;
+ // *** set value ***
+ if (hasStorage) {
+ window[storageType][key] = JSON.stringify(values);
+ } else {
+ date = new Date();
+ date.setTime(date.getTime() + (31536e+6)); // 365 days
+ document.cookie = key + '=' + (JSON.stringify(values)).replace(/\"/g, '\"') + '; expires=' + date.toGMTString() + '; path=/';
+ }
+ } else {
+ return values && values[url] ? values[url][id] : '';
+ }
+ };
+
+})(jQuery, window, document);
+
+/*! Widget: uitheme - updated 2018-03-18 (v2.30.0) */
+;(function ($) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ ts.themes = {
+ 'bootstrap' : {
+ table : 'table table-bordered table-striped',
+ caption : 'caption',
+ // header class names
+ header : 'bootstrap-header', // give the header a gradient background (theme.bootstrap_2.css)
+ sortNone : '',
+ sortAsc : '',
+ sortDesc : '',
+ active : '', // applied when column is sorted
+ hover : '', // custom css required - a defined bootstrap style may not override other classes
+ // icon class names
+ icons : '', // add 'bootstrap-icon-white' to make them white; this icon class is added to the <i> in the header
+ iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted
+ iconSortAsc : 'glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort
+ iconSortDesc : 'glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort
+ filterRow : '', // filter row class
+ footerRow : '',
+ footerCells : '',
+ even : '', // even row zebra striping
+ odd : '' // odd row zebra striping
+ },
+ 'jui' : {
+ table : 'ui-widget ui-widget-content ui-corner-all', // table classes
+ caption : 'ui-widget-content',
+ // header class names
+ header : 'ui-widget-header ui-corner-all ui-state-default', // header classes
+ sortNone : '',
+ sortAsc : '',
+ sortDesc : '',
+ active : 'ui-state-active', // applied when column is sorted
+ hover : 'ui-state-hover', // hover class
+ // icon class names
+ icons : 'ui-icon', // icon class added to the <i> in the header
+ iconSortNone : 'ui-icon-carat-2-n-s ui-icon-caret-2-n-s', // class name added to icon when column is not sorted
+ iconSortAsc : 'ui-icon-carat-1-n ui-icon-caret-1-n', // class name added to icon when column has ascending sort
+ iconSortDesc : 'ui-icon-carat-1-s ui-icon-caret-1-s', // class name added to icon when column has descending sort
+ filterRow : '',
+ footerRow : '',
+ footerCells : '',
+ even : 'ui-widget-content', // even row zebra striping
+ odd : 'ui-state-default' // odd row zebra striping
+ }
+ };
+
+ $.extend(ts.css, {
+ wrapper : 'tablesorter-wrapper' // ui theme & resizable
+ });
+
+ ts.addWidget({
+ id: 'uitheme',
+ priority: 10,
+ format: function(table, c, wo) {
+ var i, tmp, hdr, icon, time, $header, $icon, $tfoot, $h, oldtheme, oldremove, oldIconRmv, hasOldTheme,
+ themesAll = ts.themes,
+ $table = c.$table.add( $( c.namespace + '_extra_table' ) ),
+ $headers = c.$headers.add( $( c.namespace + '_extra_headers' ) ),
+ theme = c.theme || 'jui',
+ themes = themesAll[theme] || {},
+ remove = $.trim( [ themes.sortNone, themes.sortDesc, themes.sortAsc, themes.active ].join( ' ' ) ),
+ iconRmv = $.trim( [ themes.iconSortNone, themes.iconSortDesc, themes.iconSortAsc ].join( ' ' ) ),
+ debug = ts.debug(c, 'uitheme');
+ if (debug) { time = new Date(); }
+ // initialization code - run once
+ if (!$table.hasClass('tablesorter-' + theme) || c.theme !== c.appliedTheme || !wo.uitheme_applied) {
+ wo.uitheme_applied = true;
+ oldtheme = themesAll[c.appliedTheme] || {};
+ hasOldTheme = !$.isEmptyObject(oldtheme);
+ oldremove = hasOldTheme ? [ oldtheme.sortNone, oldtheme.sortDesc, oldtheme.sortAsc, oldtheme.active ].join( ' ' ) : '';
+ oldIconRmv = hasOldTheme ? [ oldtheme.iconSortNone, oldtheme.iconSortDesc, oldtheme.iconSortAsc ].join( ' ' ) : '';
+ if (hasOldTheme) {
+ wo.zebra[0] = $.trim( ' ' + wo.zebra[0].replace(' ' + oldtheme.even, '') );
+ wo.zebra[1] = $.trim( ' ' + wo.zebra[1].replace(' ' + oldtheme.odd, '') );
+ c.$tbodies.children().removeClass( [ oldtheme.even, oldtheme.odd ].join(' ') );
+ }
+ // update zebra stripes
+ if (themes.even) { wo.zebra[0] += ' ' + themes.even; }
+ if (themes.odd) { wo.zebra[1] += ' ' + themes.odd; }
+ // add caption style
+ $table.children('caption')
+ .removeClass(oldtheme.caption || '')
+ .addClass(themes.caption);
+ // add table/footer class names
+ $tfoot = $table
+ // remove other selected themes
+ .removeClass( (c.appliedTheme ? 'tablesorter-' + (c.appliedTheme || '') : '') + ' ' + (oldtheme.table || '') )
+ .addClass('tablesorter-' + theme + ' ' + (themes.table || '')) // add theme widget class name
+ .children('tfoot');
+ c.appliedTheme = c.theme;
+
+ if ($tfoot.length) {
+ $tfoot
+ // if oldtheme.footerRow or oldtheme.footerCells are undefined, all class names are removed
+ .children('tr').removeClass(oldtheme.footerRow || '').addClass(themes.footerRow)
+ .children('th, td').removeClass(oldtheme.footerCells || '').addClass(themes.footerCells);
+ }
+ // update header classes
+ $headers
+ .removeClass( (hasOldTheme ? [ oldtheme.header, oldtheme.hover, oldremove ].join(' ') : '') || '' )
+ .addClass(themes.header)
+ .not('.sorter-false')
+ .unbind('mouseenter.tsuitheme mouseleave.tsuitheme')
+ .bind('mouseenter.tsuitheme mouseleave.tsuitheme', function(event) {
+ // toggleClass with switch added in jQuery 1.3
+ $(this)[ event.type === 'mouseenter' ? 'addClass' : 'removeClass' ](themes.hover || '');
+ });
+
+ $headers.each(function() {
+ var $this = $(this);
+ if (!$this.find('.' + ts.css.wrapper).length) {
+ // Firefox needs this inner div to position the icon & resizer correctly
+ $this.wrapInner('<div class="' + ts.css.wrapper + '" style="position:relative;height:100%;width:100%"></div>');
+ }
+ });
+ if (c.cssIcon) {
+ // if c.cssIcon is '', then no <i> is added to the header
+ $headers
+ .find('.' + ts.css.icon)
+ .removeClass(hasOldTheme ? [ oldtheme.icons, oldIconRmv ].join(' ') : '')
+ .addClass(themes.icons || '');
+ }
+ // filter widget initializes after uitheme
+ if (ts.hasWidget( c.table, 'filter' )) {
+ tmp = function() {
+ $table.children('thead').children('.' + ts.css.filterRow)
+ .removeClass(hasOldTheme ? oldtheme.filterRow || '' : '')
+ .addClass(themes.filterRow || '');
+ };
+ if (wo.filter_initialized) {
+ tmp();
+ } else {
+ $table.one('filterInit', function() {
+ tmp();
+ });
+ }
+ }
+ }
+ for (i = 0; i < c.columns; i++) {
+ $header = c.$headers
+ .add($(c.namespace + '_extra_headers'))
+ .not('.sorter-false')
+ .filter('[data-column="' + i + '"]');
+ $icon = (ts.css.icon) ? $header.find('.' + ts.css.icon) : $();
+ $h = $headers.not('.sorter-false').filter('[data-column="' + i + '"]:last');
+ if ($h.length) {
+ $header.removeClass(remove);
+ $icon.removeClass(iconRmv);
+ if ($h[0].sortDisabled) {
+ // no sort arrows for disabled columns!
+ $icon.removeClass(themes.icons || '');
+ } else {
+ hdr = themes.sortNone;
+ icon = themes.iconSortNone;
+ if ($h.hasClass(ts.css.sortAsc)) {
+ hdr = [ themes.sortAsc, themes.active ].join(' ');
+ icon = themes.iconSortAsc;
+ } else if ($h.hasClass(ts.css.sortDesc)) {
+ hdr = [ themes.sortDesc, themes.active ].join(' ');
+ icon = themes.iconSortDesc;
+ }
+ $header.addClass(hdr);
+ $icon.addClass(icon || '');
+ }
+ }
+ }
+ if (debug) {
+ console.log('uitheme >> Applied ' + theme + ' theme' + ts.benchmark(time));
+ }
+ },
+ remove: function(table, c, wo, refreshing) {
+ if (!wo.uitheme_applied) { return; }
+ var $table = c.$table,
+ theme = c.appliedTheme || 'jui',
+ themes = ts.themes[ theme ] || ts.themes.jui,
+ $headers = $table.children('thead').children(),
+ remove = themes.sortNone + ' ' + themes.sortDesc + ' ' + themes.sortAsc,
+ iconRmv = themes.iconSortNone + ' ' + themes.iconSortDesc + ' ' + themes.iconSortAsc;
+ $table.removeClass('tablesorter-' + theme + ' ' + themes.table);
+ wo.uitheme_applied = false;
+ if (refreshing) { return; }
+ $table.find(ts.css.header).removeClass(themes.header);
+ $headers
+ .unbind('mouseenter.tsuitheme mouseleave.tsuitheme') // remove hover
+ .removeClass(themes.hover + ' ' + remove + ' ' + themes.active)
+ .filter('.' + ts.css.filterRow)
+ .removeClass(themes.filterRow);
+ $headers.find('.' + ts.css.icon).removeClass(themes.icons + ' ' + iconRmv);
+ }
+ });
+
+})(jQuery);
+
+/*! Widget: columns - updated 5/24/2017 (v2.28.11) */
+;(function ($) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ ts.addWidget({
+ id: 'columns',
+ priority: 65,
+ options : {
+ columns : [ 'primary', 'secondary', 'tertiary' ]
+ },
+ format: function(table, c, wo) {
+ var $tbody, tbodyIndex, $rows, rows, $row, $cells, remove, indx,
+ $table = c.$table,
+ $tbodies = c.$tbodies,
+ sortList = c.sortList,
+ len = sortList.length,
+ // removed c.widgetColumns support
+ css = wo && wo.columns || [ 'primary', 'secondary', 'tertiary' ],
+ last = css.length - 1;
+ remove = css.join(' ');
+ // check if there is a sort (on initialization there may not be one)
+ for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // detach tbody
+ $rows = $tbody.children('tr');
+ // loop through the visible rows
+ $rows.each(function() {
+ $row = $(this);
+ if (this.style.display !== 'none') {
+ // remove all columns class names
+ $cells = $row.children().removeClass(remove);
+ // add appropriate column class names
+ if (sortList && sortList[0]) {
+ // primary sort column class
+ $cells.eq(sortList[0][0]).addClass(css[0]);
+ if (len > 1) {
+ for (indx = 1; indx < len; indx++) {
+ // secondary, tertiary, etc sort column classes
+ $cells.eq(sortList[indx][0]).addClass( css[indx] || css[last] );
+ }
+ }
+ }
+ }
+ });
+ ts.processTbody(table, $tbody, false);
+ }
+ // add classes to thead and tfoot
+ rows = wo.columns_thead !== false ? [ 'thead tr' ] : [];
+ if (wo.columns_tfoot !== false) {
+ rows.push('tfoot tr');
+ }
+ if (rows.length) {
+ $rows = $table.find( rows.join(',') ).children().removeClass(remove);
+ if (len) {
+ for (indx = 0; indx < len; indx++) {
+ // add primary. secondary, tertiary, etc sort column classes
+ $rows.filter('[data-column="' + sortList[indx][0] + '"]').addClass(css[indx] || css[last]);
+ }
+ }
+ }
+ },
+ remove: function(table, c, wo) {
+ var tbodyIndex, $tbody,
+ $tbodies = c.$tbodies,
+ remove = (wo.columns || [ 'primary', 'secondary', 'tertiary' ]).join(' ');
+ c.$headers.removeClass(remove);
+ c.$table.children('tfoot').children('tr').children('th, td').removeClass(remove);
+ for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // remove tbody
+ $tbody.children('tr').each(function() {
+ $(this).children().removeClass(remove);
+ });
+ ts.processTbody(table, $tbody, false); // restore tbody
+ }
+ }
+ });
+
+})(jQuery);
+
+/*! Widget: filter - updated 2018-03-18 (v2.30.0) *//*
+ * Requires tablesorter v2.8+ and jQuery 1.7+
+ * by Rob Garrison
+ */
+;( function ( $ ) {
+ 'use strict';
+ var tsf, tsfRegex,
+ ts = $.tablesorter || {},
+ tscss = ts.css,
+ tskeyCodes = ts.keyCodes;
+
+ $.extend( tscss, {
+ filterRow : 'tablesorter-filter-row',
+ filter : 'tablesorter-filter',
+ filterDisabled : 'disabled',
+ filterRowHide : 'hideme'
+ });
+
+ $.extend( tskeyCodes, {
+ backSpace : 8,
+ escape : 27,
+ space : 32,
+ left : 37,
+ down : 40
+ });
+
+ ts.addWidget({
+ id: 'filter',
+ priority: 50,
+ options : {
+ filter_cellFilter : '', // css class name added to the filter cell ( string or array )
+ filter_childRows : false, // if true, filter includes child row content in the search
+ filter_childByColumn : false, // ( filter_childRows must be true ) if true = search child rows by column; false = search all child row text grouped
+ filter_childWithSibs : true, // if true, include matching child row siblings
+ filter_columnAnyMatch: true, // if true, allows using '#:{query}' in AnyMatch searches ( column:query )
+ filter_columnFilters : true, // if true, a filter will be added to the top of each table column
+ filter_cssFilter : '', // css class name added to the filter row & each input in the row ( tablesorter-filter is ALWAYS added )
+ filter_defaultAttrib : 'data-value', // data attribute in the header cell that contains the default filter value
+ filter_defaultFilter : {}, // add a default column filter type '~{query}' to make fuzzy searches default; '{q1} AND {q2}' to make all searches use a logical AND.
+ filter_excludeFilter : {}, // filters to exclude, per column
+ filter_external : '', // jQuery selector string ( or jQuery object ) of external filters
+ filter_filteredRow : 'filtered', // class added to filtered rows; define in css with "display:none" to hide the filtered-out rows
+ filter_filterLabel : 'Filter "{{label}}" column by...', // Aria-label added to filter input/select; see #1495
+ filter_formatter : null, // add custom filter elements to the filter row
+ filter_functions : null, // add custom filter functions using this option
+ filter_hideEmpty : true, // hide filter row when table is empty
+ filter_hideFilters : false, // collapse filter row when mouse leaves the area
+ filter_ignoreCase : true, // if true, make all searches case-insensitive
+ filter_liveSearch : true, // if true, search column content while the user types ( with a delay )
+ filter_matchType : { 'input': 'exact', 'select': 'exact' }, // global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class
+ filter_onlyAvail : 'filter-onlyAvail', // a header with a select dropdown & this class name will only show available ( visible ) options within the drop down
+ filter_placeholder : { search : '', select : '' }, // default placeholder text ( overridden by any header 'data-placeholder' setting )
+ filter_reset : null, // jQuery selector string of an element used to reset the filters
+ filter_resetOnEsc : true, // Reset filter input when the user presses escape - normalized across browsers
+ filter_saveFilters : false, // Use the $.tablesorter.storage utility to save the most recent filters
+ filter_searchDelay : 300, // typing delay in milliseconds before starting a search
+ filter_searchFiltered: true, // allow searching through already filtered rows in special circumstances; will speed up searching in large tables if true
+ filter_selectSource : null, // include a function to return an array of values to be added to the column filter select
+ filter_selectSourceSeparator : '|', // filter_selectSource array text left of the separator is added to the option value, right into the option text
+ filter_serversideFiltering : false, // if true, must perform server-side filtering b/c client-side filtering is disabled, but the ui and events will still be used.
+ filter_startsWith : false, // if true, filter start from the beginning of the cell contents
+ filter_useParsedData : false // filter all data using parsed content
+ },
+ format: function( table, c, wo ) {
+ if ( !c.$table.hasClass( 'hasFilters' ) ) {
+ tsf.init( table, c, wo );
+ }
+ },
+ remove: function( table, c, wo, refreshing ) {
+ var tbodyIndex, $tbody,
+ $table = c.$table,
+ $tbodies = c.$tbodies,
+ events = (
+ 'addRows updateCell update updateRows updateComplete appendCache filterReset ' +
+ 'filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit '
+ ).split( ' ' ).join( c.namespace + 'filter ' );
+ $table
+ .removeClass( 'hasFilters' )
+ // add filter namespace to all BUT search
+ .unbind( events.replace( ts.regex.spaces, ' ' ) )
+ // remove the filter row even if refreshing, because the column might have been moved
+ .find( '.' + tscss.filterRow ).remove();
+ wo.filter_initialized = false;
+ if ( refreshing ) { return; }
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody
+ $tbody.children().removeClass( wo.filter_filteredRow ).show();
+ ts.processTbody( table, $tbody, false ); // restore tbody
+ }
+ if ( wo.filter_reset ) {
+ $( document ).undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' );
+ }
+ }
+ });
+
+ tsf = ts.filter = {
+
+ // regex used in filter 'check' functions - not for general use and not documented
+ regex: {
+ regex : /^\/((?:\\\/|[^\/])+)\/([migyu]{0,5})?$/, // regex to test for regex
+ child : /tablesorter-childRow/, // child row class name; this gets updated in the script
+ filtered : /filtered/, // filtered (hidden) row class name; updated in the script
+ type : /undefined|number/, // check type
+ exact : /(^[\"\'=]+)|([\"\'=]+$)/g, // exact match (allow '==')
+ operators : /[<>=]/g, // replace operators
+ query : '(q|query)', // replace filter queries
+ wild01 : /\?/g, // wild card match 0 or 1
+ wild0More : /\*/g, // wild care match 0 or more
+ quote : /\"/g,
+ isNeg1 : /(>=?\s*-\d)/,
+ isNeg2 : /(<=?\s*\d)/
+ },
+ // function( c, data ) { }
+ // c = table.config
+ // data.$row = jQuery object of the row currently being processed
+ // data.$cells = jQuery object of all cells within the current row
+ // data.filters = array of filters for all columns ( some may be undefined )
+ // data.filter = filter for the current column
+ // data.iFilter = same as data.filter, except lowercase ( if wo.filter_ignoreCase is true )
+ // data.exact = table cell text ( or parsed data if column parser enabled; may be a number & not a string )
+ // data.iExact = same as data.exact, except lowercase ( if wo.filter_ignoreCase is true; may be a number & not a string )
+ // data.cache = table cell text from cache, so it has been parsed ( & in all lower case if c.ignoreCase is true )
+ // data.cacheArray = An array of parsed content from each table cell in the row being processed
+ // data.index = column index; table = table element ( DOM )
+ // data.parsed = array ( by column ) of boolean values ( from filter_useParsedData or 'filter-parsed' class )
+ types: {
+ or : function( c, data, vars ) {
+ // look for "|", but not if it is inside of a regular expression
+ if ( ( tsfRegex.orTest.test( data.iFilter ) || tsfRegex.orSplit.test( data.filter ) ) &&
+ // this test for regex has potential to slow down the overall search
+ !tsfRegex.regex.test( data.filter ) ) {
+ var indx, filterMatched, query, regex,
+ // duplicate data but split filter
+ data2 = $.extend( {}, data ),
+ filter = data.filter.split( tsfRegex.orSplit ),
+ iFilter = data.iFilter.split( tsfRegex.orSplit ),
+ len = filter.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ data2.nestedFilters = true;
+ data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' );
+ data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' );
+ query = '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')';
+ try {
+ // use try/catch, because query may not be a valid regex if "|" is contained within a partial regex search,
+ // e.g "/(Alex|Aar" -> Uncaught SyntaxError: Invalid regular expression: /(/(Alex)/: Unterminated group
+ regex = new RegExp( data.isMatch ? query : '^' + query + '$', c.widgetOptions.filter_ignoreCase ? 'i' : '' );
+ // filterMatched = data2.filter === '' && indx > 0 ? true
+ // look for an exact match with the 'or' unless the 'filter-match' class is found
+ filterMatched = regex.test( data2.exact ) || tsf.processTypes( c, data2, vars );
+ if ( filterMatched ) {
+ return filterMatched;
+ }
+ } catch ( error ) {
+ return null;
+ }
+ }
+ // may be null from processing types
+ return filterMatched || false;
+ }
+ return null;
+ },
+ // Look for an AND or && operator ( logical and )
+ and : function( c, data, vars ) {
+ if ( tsfRegex.andTest.test( data.filter ) ) {
+ var indx, filterMatched, result, query, regex,
+ // duplicate data but split filter
+ data2 = $.extend( {}, data ),
+ filter = data.filter.split( tsfRegex.andSplit ),
+ iFilter = data.iFilter.split( tsfRegex.andSplit ),
+ len = filter.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ data2.nestedFilters = true;
+ data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' );
+ data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' );
+ query = ( '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')' )
+ // replace wild cards since /(a*)/i will match anything
+ .replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' );
+ try {
+ // use try/catch just in case RegExp is invalid
+ regex = new RegExp( data.isMatch ? query : '^' + query + '$', c.widgetOptions.filter_ignoreCase ? 'i' : '' );
+ // look for an exact match with the 'and' unless the 'filter-match' class is found
+ result = ( regex.test( data2.exact ) || tsf.processTypes( c, data2, vars ) );
+ if ( indx === 0 ) {
+ filterMatched = result;
+ } else {
+ filterMatched = filterMatched && result;
+ }
+ } catch ( error ) {
+ return null;
+ }
+ }
+ // may be null from processing types
+ return filterMatched || false;
+ }
+ return null;
+ },
+ // Look for regex
+ regex: function( c, data ) {
+ if ( tsfRegex.regex.test( data.filter ) ) {
+ var matches,
+ // cache regex per column for optimal speed
+ regex = data.filter_regexCache[ data.index ] || tsfRegex.regex.exec( data.filter ),
+ isRegex = regex instanceof RegExp;
+ try {
+ if ( !isRegex ) {
+ // force case insensitive search if ignoreCase option set?
+ // if ( c.ignoreCase && !regex[2] ) { regex[2] = 'i'; }
+ data.filter_regexCache[ data.index ] = regex = new RegExp( regex[1], regex[2] );
+ }
+ matches = regex.test( data.exact );
+ } catch ( error ) {
+ matches = false;
+ }
+ return matches;
+ }
+ return null;
+ },
+ // Look for operators >, >=, < or <=
+ operators: function( c, data ) {
+ // ignore empty strings... because '' < 10 is true
+ if ( tsfRegex.operTest.test( data.iFilter ) && data.iExact !== '' ) {
+ var cachedValue, result, txt,
+ table = c.table,
+ parsed = data.parsed[ data.index ],
+ query = ts.formatFloat( data.iFilter.replace( tsfRegex.operators, '' ), table ),
+ parser = c.parsers[ data.index ] || {},
+ savedSearch = query;
+ // parse filter value in case we're comparing numbers ( dates )
+ if ( parsed || parser.type === 'numeric' ) {
+ txt = $.trim( '' + data.iFilter.replace( tsfRegex.operators, '' ) );
+ result = tsf.parseFilter( c, txt, data, true );
+ query = ( typeof result === 'number' && result !== '' && !isNaN( result ) ) ? result : query;
+ }
+ // iExact may be numeric - see issue #149;
+ // check if cached is defined, because sometimes j goes out of range? ( numeric columns )
+ if ( ( parsed || parser.type === 'numeric' ) && !isNaN( query ) &&
+ typeof data.cache !== 'undefined' ) {
+ cachedValue = data.cache;
+ } else {
+ txt = isNaN( data.iExact ) ? data.iExact.replace( ts.regex.nondigit, '' ) : data.iExact;
+ cachedValue = ts.formatFloat( txt, table );
+ }
+ if ( tsfRegex.gtTest.test( data.iFilter ) ) {
+ result = tsfRegex.gteTest.test( data.iFilter ) ? cachedValue >= query : cachedValue > query;
+ } else if ( tsfRegex.ltTest.test( data.iFilter ) ) {
+ result = tsfRegex.lteTest.test( data.iFilter ) ? cachedValue <= query : cachedValue < query;
+ }
+ // keep showing all rows if nothing follows the operator
+ if ( !result && savedSearch === '' ) {
+ result = true;
+ }
+ return result;
+ }
+ return null;
+ },
+ // Look for a not match
+ notMatch: function( c, data ) {
+ if ( tsfRegex.notTest.test( data.iFilter ) ) {
+ var indx,
+ txt = data.iFilter.replace( '!', '' ),
+ filter = tsf.parseFilter( c, txt, data ) || '';
+ if ( tsfRegex.exact.test( filter ) ) {
+ // look for exact not matches - see #628
+ filter = filter.replace( tsfRegex.exact, '' );
+ return filter === '' ? true : $.trim( filter ) !== data.iExact;
+ } else {
+ indx = data.iExact.search( $.trim( filter ) );
+ return filter === '' ? true :
+ // return true if not found
+ data.anyMatch ? indx < 0 :
+ // return false if found
+ !( c.widgetOptions.filter_startsWith ? indx === 0 : indx >= 0 );
+ }
+ }
+ return null;
+ },
+ // Look for quotes or equals to get an exact match; ignore type since iExact could be numeric
+ exact: function( c, data ) {
+ /*jshint eqeqeq:false */
+ if ( tsfRegex.exact.test( data.iFilter ) ) {
+ var txt = data.iFilter.replace( tsfRegex.exact, '' ),
+ filter = tsf.parseFilter( c, txt, data ) || '';
+ // eslint-disable-next-line eqeqeq
+ return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact;
+ }
+ return null;
+ },
+ // Look for a range ( using ' to ' or ' - ' ) - see issue #166; thanks matzhu!
+ range : function( c, data ) {
+ if ( tsfRegex.toTest.test( data.iFilter ) ) {
+ var result, tmp, range1, range2,
+ table = c.table,
+ index = data.index,
+ parsed = data.parsed[index],
+ // make sure the dash is for a range and not indicating a negative number
+ query = data.iFilter.split( tsfRegex.toSplit );
+
+ tmp = query[0].replace( ts.regex.nondigit, '' ) || '';
+ range1 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table );
+ tmp = query[1].replace( ts.regex.nondigit, '' ) || '';
+ range2 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table );
+ // parse filter value in case we're comparing numbers ( dates )
+ if ( parsed || c.parsers[ index ].type === 'numeric' ) {
+ result = c.parsers[ index ].format( '' + query[0], table, c.$headers.eq( index ), index );
+ range1 = ( result !== '' && !isNaN( result ) ) ? result : range1;
+ result = c.parsers[ index ].format( '' + query[1], table, c.$headers.eq( index ), index );
+ range2 = ( result !== '' && !isNaN( result ) ) ? result : range2;
+ }
+ if ( ( parsed || c.parsers[ index ].type === 'numeric' ) && !isNaN( range1 ) && !isNaN( range2 ) ) {
+ result = data.cache;
+ } else {
+ tmp = isNaN( data.iExact ) ? data.iExact.replace( ts.regex.nondigit, '' ) : data.iExact;
+ result = ts.formatFloat( tmp, table );
+ }
+ if ( range1 > range2 ) {
+ tmp = range1; range1 = range2; range2 = tmp; // swap
+ }
+ return ( result >= range1 && result <= range2 ) || ( range1 === '' || range2 === '' );
+ }
+ return null;
+ },
+ // Look for wild card: ? = single, * = multiple, or | = logical OR
+ wild : function( c, data ) {
+ if ( tsfRegex.wildOrTest.test( data.iFilter ) ) {
+ var query = '' + ( tsf.parseFilter( c, data.iFilter, data ) || '' );
+ // look for an exact match with the 'or' unless the 'filter-match' class is found
+ if ( !tsfRegex.wildTest.test( query ) && data.nestedFilters ) {
+ query = data.isMatch ? query : '^(' + query + ')$';
+ }
+ // parsing the filter may not work properly when using wildcards =/
+ try {
+ return new RegExp(
+ query.replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' ),
+ c.widgetOptions.filter_ignoreCase ? 'i' : ''
+ )
+ .test( data.exact );
+ } catch ( error ) {
+ return null;
+ }
+ }
+ return null;
+ },
+ // fuzzy text search; modified from https://github.com/mattyork/fuzzy ( MIT license )
+ fuzzy: function( c, data ) {
+ if ( tsfRegex.fuzzyTest.test( data.iFilter ) ) {
+ var indx,
+ patternIndx = 0,
+ len = data.iExact.length,
+ txt = data.iFilter.slice( 1 ),
+ pattern = tsf.parseFilter( c, txt, data ) || '';
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( data.iExact[ indx ] === pattern[ patternIndx ] ) {
+ patternIndx += 1;
+ }
+ }
+ return patternIndx === pattern.length;
+ }
+ return null;
+ }
+ },
+ init: function( table ) {
+ // filter language options
+ ts.language = $.extend( true, {}, {
+ to : 'to',
+ or : 'or',
+ and : 'and'
+ }, ts.language );
+
+ var options, string, txt, $header, column, val, fxn, noSelect,
+ c = table.config,
+ wo = c.widgetOptions,
+ processStr = function(prefix, str, suffix) {
+ str = str.trim();
+ // don't include prefix/suffix if str is empty
+ return str === '' ? '' : (prefix || '') + str + (suffix || '');
+ };
+ c.$table.addClass( 'hasFilters' );
+ c.lastSearch = [];
+
+ // define timers so using clearTimeout won't cause an undefined error
+ wo.filter_searchTimer = null;
+ wo.filter_initTimer = null;
+ wo.filter_formatterCount = 0;
+ wo.filter_formatterInit = [];
+ wo.filter_anyColumnSelector = '[data-column="all"],[data-column="any"]';
+ wo.filter_multipleColumnSelector = '[data-column*="-"],[data-column*=","]';
+
+ val = '\\{' + tsfRegex.query + '\\}';
+ $.extend( tsfRegex, {
+ child : new RegExp( c.cssChildRow ),
+ filtered : new RegExp( wo.filter_filteredRow ),
+ alreadyFiltered : new RegExp( '(\\s+(-' + processStr('|', ts.language.or) + processStr('|', ts.language.to) + ')\\s+)', 'i' ),
+ toTest : new RegExp( '\\s+(-' + processStr('|', ts.language.to) + ')\\s+', 'i' ),
+ toSplit : new RegExp( '(?:\\s+(?:-' + processStr('|', ts.language.to) + ')\\s+)', 'gi' ),
+ andTest : new RegExp( '\\s+(' + processStr('', ts.language.and, '|') + '&&)\\s+', 'i' ),
+ andSplit : new RegExp( '(?:\\s+(?:' + processStr('', ts.language.and, '|') + '&&)\\s+)', 'gi' ),
+ orTest : new RegExp( '(\\|' + processStr('|\\s+', ts.language.or, '\\s+') + ')', 'i' ),
+ orSplit : new RegExp( '(?:\\|' + processStr('|\\s+(?:', ts.language.or, ')\\s+') + ')', 'gi' ),
+ iQuery : new RegExp( val, 'i' ),
+ igQuery : new RegExp( val, 'ig' ),
+ operTest : /^[<>]=?/,
+ gtTest : />/,
+ gteTest : />=/,
+ ltTest : /</,
+ lteTest : /<=/,
+ notTest : /^\!/,
+ wildOrTest : /[\?\*\|]/,
+ wildTest : /\?\*/,
+ fuzzyTest : /^~/,
+ exactTest : /[=\"\|!]/
+ });
+
+ // don't build filter row if columnFilters is false or all columns are set to 'filter-false'
+ // see issue #156
+ val = c.$headers.filter( '.filter-false, .parser-false' ).length;
+ if ( wo.filter_columnFilters !== false && val !== c.$headers.length ) {
+ // build filter row
+ tsf.buildRow( table, c, wo );
+ }
+
+ txt = 'addRows updateCell update updateRows updateComplete appendCache filterReset ' +
+ 'filterAndSortReset filterResetSaved filterEnd search '.split( ' ' ).join( c.namespace + 'filter ' );
+ c.$table.bind( txt, function( event, filter ) {
+ val = wo.filter_hideEmpty &&
+ $.isEmptyObject( c.cache ) &&
+ !( c.delayInit && event.type === 'appendCache' );
+ // hide filter row using the 'filtered' class name
+ c.$table.find( '.' + tscss.filterRow ).toggleClass( wo.filter_filteredRow, val ); // fixes #450
+ if ( !/(search|filter)/.test( event.type ) ) {
+ event.stopPropagation();
+ tsf.buildDefault( table, true );
+ }
+ // Add filterAndSortReset - see #1361
+ if ( event.type === 'filterReset' || event.type === 'filterAndSortReset' ) {
+ c.$table.find( '.' + tscss.filter ).add( wo.filter_$externalFilters ).val( '' );
+ if ( event.type === 'filterAndSortReset' ) {
+ ts.sortReset( this.config, function() {
+ tsf.searching( table, [] );
+ });
+ } else {
+ tsf.searching( table, [] );
+ }
+ } else if ( event.type === 'filterResetSaved' ) {
+ ts.storage( table, 'tablesorter-filters', '' );
+ } else if ( event.type === 'filterEnd' ) {
+ tsf.buildDefault( table, true );
+ } else {
+ // send false argument to force a new search; otherwise if the filter hasn't changed,
+ // it will return
+ filter = event.type === 'search' ? filter :
+ event.type === 'updateComplete' ? c.$table.data( 'lastSearch' ) : '';
+ if ( /(update|add)/.test( event.type ) && event.type !== 'updateComplete' ) {
+ // force a new search since content has changed
+ c.lastCombinedFilter = null;
+ c.lastSearch = [];
+ // update filterFormatters after update (& small delay) - Fixes #1237
+ setTimeout(function() {
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ }, 100);
+ }
+ // pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first
+ // input ensures all inputs are updated when a search is triggered on the table
+ // $( 'table' ).trigger( 'search', [...] );
+ tsf.searching( table, filter, true );
+ }
+ return false;
+ });
+
+ // reset button/link
+ if ( wo.filter_reset ) {
+ if ( wo.filter_reset instanceof $ ) {
+ // reset contains a jQuery object, bind to it
+ wo.filter_reset.click( function() {
+ c.$table.triggerHandler( 'filterReset' );
+ });
+ } else if ( $( wo.filter_reset ).length ) {
+ // reset is a jQuery selector, use event delegation
+ $( document )
+ .undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' )
+ .delegate( wo.filter_reset, 'click' + c.namespace + 'filter', function() {
+ // trigger a reset event, so other functions ( filter_formatter ) know when to reset
+ c.$table.triggerHandler( 'filterReset' );
+ });
+ }
+ }
+ if ( wo.filter_functions ) {
+ for ( column = 0; column < c.columns; column++ ) {
+ fxn = ts.getColumnData( table, wo.filter_functions, column );
+ if ( fxn ) {
+ // remove 'filter-select' from header otherwise the options added here are replaced with
+ // all options
+ $header = c.$headerIndexed[ column ].removeClass( 'filter-select' );
+ // don't build select if 'filter-false' or 'parser-false' set
+ noSelect = !( $header.hasClass( 'filter-false' ) || $header.hasClass( 'parser-false' ) );
+ options = '';
+ if ( fxn === true && noSelect ) {
+ tsf.buildSelect( table, column );
+ } else if ( typeof fxn === 'object' && noSelect ) {
+ // add custom drop down list
+ for ( string in fxn ) {
+ if ( typeof string === 'string' ) {
+ options += options === '' ?
+ '<option value="">' +
+ ( $header.data( 'placeholder' ) ||
+ $header.attr( 'data-placeholder' ) ||
+ wo.filter_placeholder.select ||
+ ''
+ ) +
+ '</option>' : '';
+ val = string;
+ txt = string;
+ if ( string.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) {
+ val = string.split( wo.filter_selectSourceSeparator );
+ txt = val[1];
+ val = val[0];
+ }
+ options += '<option ' +
+ ( txt === val ? '' : 'data-function-name="' + string + '" ' ) +
+ 'value="' + val + '">' + txt + '</option>';
+ }
+ }
+ c.$table
+ .find( 'thead' )
+ .find( 'select.' + tscss.filter + '[data-column="' + column + '"]' )
+ .append( options );
+ txt = wo.filter_selectSource;
+ fxn = typeof txt === 'function' ? true : ts.getColumnData( table, txt, column );
+ if ( fxn ) {
+ // updating so the extra options are appended
+ tsf.buildSelect( c.table, column, '', true, $header.hasClass( wo.filter_onlyAvail ) );
+ }
+ }
+ }
+ }
+ }
+ // not really updating, but if the column has both the 'filter-select' class &
+ // filter_functions set to true, it would append the same options twice.
+ tsf.buildDefault( table, true );
+
+ tsf.bindSearch( table, c.$table.find( '.' + tscss.filter ), true );
+ if ( wo.filter_external ) {
+ tsf.bindSearch( table, wo.filter_external );
+ }
+
+ if ( wo.filter_hideFilters ) {
+ tsf.hideFilters( c );
+ }
+
+ // show processing icon
+ if ( c.showProcessing ) {
+ txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter-sp ' );
+ c.$table
+ .unbind( txt.replace( ts.regex.spaces, ' ' ) )
+ .bind( txt, function( event, columns ) {
+ // only add processing to certain columns to all columns
+ $header = ( columns ) ?
+ c.$table
+ .find( '.' + tscss.header )
+ .filter( '[data-column]' )
+ .filter( function() {
+ return columns[ $( this ).data( 'column' ) ] !== '';
+ }) : '';
+ ts.isProcessing( table, event.type === 'filterStart', columns ? $header : '' );
+ });
+ }
+
+ // set filtered rows count ( intially unfiltered )
+ c.filteredRows = c.totalRows;
+
+ // add default values
+ txt = 'tablesorter-initialized pagerBeforeInitialized '.split( ' ' ).join( c.namespace + 'filter ' );
+ c.$table
+ .unbind( txt.replace( ts.regex.spaces, ' ' ) )
+ .bind( txt, function() {
+ tsf.completeInit( this );
+ });
+ // if filter widget is added after pager has initialized; then set filter init flag
+ if ( c.pager && c.pager.initialized && !wo.filter_initialized ) {
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ setTimeout( function() {
+ tsf.filterInitComplete( c );
+ }, 100 );
+ } else if ( !wo.filter_initialized ) {
+ tsf.completeInit( table );
+ }
+ },
+ completeInit: function( table ) {
+ // redefine 'c' & 'wo' so they update properly inside this callback
+ var c = table.config,
+ wo = c.widgetOptions,
+ filters = tsf.setDefaults( table, c, wo ) || [];
+ if ( filters.length ) {
+ // prevent delayInit from triggering a cache build if filters are empty
+ if ( !( c.delayInit && filters.join( '' ) === '' ) ) {
+ ts.setFilters( table, filters, true );
+ }
+ }
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ // trigger init after setTimeout to prevent multiple filterStart/End/Init triggers
+ setTimeout( function() {
+ if ( !wo.filter_initialized ) {
+ tsf.filterInitComplete( c );
+ }
+ }, 100 );
+ },
+
+ // $cell parameter, but not the config, is passed to the filter_formatters,
+ // so we have to work with it instead
+ formatterUpdated: function( $cell, column ) {
+ // prevent error if $cell is undefined - see #1056
+ var $table = $cell && $cell.closest( 'table' );
+ var config = $table.length && $table[0].config,
+ wo = config && config.widgetOptions;
+ if ( wo && !wo.filter_initialized ) {
+ // add updates by column since this function
+ // may be called numerous times before initialization
+ wo.filter_formatterInit[ column ] = 1;
+ }
+ },
+ filterInitComplete: function( c ) {
+ var indx, len,
+ wo = c.widgetOptions,
+ count = 0,
+ completed = function() {
+ wo.filter_initialized = true;
+ // update lastSearch - it gets cleared often
+ c.lastSearch = c.$table.data( 'lastSearch' );
+ c.$table.triggerHandler( 'filterInit', c );
+ tsf.findRows( c.table, c.lastSearch || [] );
+ if (ts.debug(c, 'filter')) {
+ console.log('Filter >> Widget initialized');
+ }
+ };
+ if ( $.isEmptyObject( wo.filter_formatter ) ) {
+ completed();
+ } else {
+ len = wo.filter_formatterInit.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( wo.filter_formatterInit[ indx ] === 1 ) {
+ count++;
+ }
+ }
+ clearTimeout( wo.filter_initTimer );
+ if ( !wo.filter_initialized && count === wo.filter_formatterCount ) {
+ // filter widget initialized
+ completed();
+ } else if ( !wo.filter_initialized ) {
+ // fall back in case a filter_formatter doesn't call
+ // $.tablesorter.filter.formatterUpdated( $cell, column ), and the count is off
+ wo.filter_initTimer = setTimeout( function() {
+ completed();
+ }, 500 );
+ }
+ }
+ },
+ // encode or decode filters for storage; see #1026
+ processFilters: function( filters, encode ) {
+ var indx,
+ // fixes #1237; previously returning an encoded "filters" value
+ result = [],
+ mode = encode ? encodeURIComponent : decodeURIComponent,
+ len = filters.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( filters[ indx ] ) {
+ result[ indx ] = mode( filters[ indx ] );
+ }
+ }
+ return result;
+ },
+ setDefaults: function( table, c, wo ) {
+ var isArray, saved, indx, col, $filters,
+ // get current ( default ) filters
+ filters = ts.getFilters( table ) || [];
+ if ( wo.filter_saveFilters && ts.storage ) {
+ saved = ts.storage( table, 'tablesorter-filters' ) || [];
+ isArray = $.isArray( saved );
+ // make sure we're not just getting an empty array
+ if ( !( isArray && saved.join( '' ) === '' || !isArray ) ) {
+ filters = tsf.processFilters( saved );
+ }
+ }
+ // if no filters saved, then check default settings
+ if ( filters.join( '' ) === '' ) {
+ // allow adding default setting to external filters
+ $filters = c.$headers.add( wo.filter_$externalFilters )
+ .filter( '[' + wo.filter_defaultAttrib + ']' );
+ for ( indx = 0; indx <= c.columns; indx++ ) {
+ // include data-column='all' external filters
+ col = indx === c.columns ? 'all' : indx;
+ filters[ indx ] = $filters
+ .filter( '[data-column="' + col + '"]' )
+ .attr( wo.filter_defaultAttrib ) || filters[indx] || '';
+ }
+ }
+ c.$table.data( 'lastSearch', filters );
+ return filters;
+ },
+ parseFilter: function( c, filter, data, parsed ) {
+ return parsed || data.parsed[ data.index ] ?
+ c.parsers[ data.index ].format( filter, c.table, [], data.index ) :
+ filter;
+ },
+ buildRow: function( table, c, wo ) {
+ var $filter, col, column, $header, makeSelect, disabled, name, ffxn, tmp,
+ // c.columns defined in computeThIndexes()
+ cellFilter = wo.filter_cellFilter,
+ columns = c.columns,
+ arry = $.isArray( cellFilter ),
+ buildFilter = '<tr role="search" class="' + tscss.filterRow + ' ' + c.cssIgnoreRow + '">';
+ for ( column = 0; column < columns; column++ ) {
+ if ( c.$headerIndexed[ column ].length ) {
+ // account for entire column set with colspan. See #1047
+ tmp = c.$headerIndexed[ column ] && c.$headerIndexed[ column ][0].colSpan || 0;
+ if ( tmp > 1 ) {
+ buildFilter += '<td data-column="' + column + '-' + ( column + tmp - 1 ) + '" colspan="' + tmp + '"';
+ } else {
+ buildFilter += '<td data-column="' + column + '"';
+ }
+ if ( arry ) {
+ buildFilter += ( cellFilter[ column ] ? ' class="' + cellFilter[ column ] + '"' : '' );
+ } else {
+ buildFilter += ( cellFilter !== '' ? ' class="' + cellFilter + '"' : '' );
+ }
+ buildFilter += '></td>';
+ }
+ }
+ c.$filters = $( buildFilter += '</tr>' )
+ .appendTo( c.$table.children( 'thead' ).eq( 0 ) )
+ .children( 'td' );
+ // build each filter input
+ for ( column = 0; column < columns; column++ ) {
+ disabled = false;
+ // assuming last cell of a column is the main column
+ $header = c.$headerIndexed[ column ];
+ if ( $header && $header.length ) {
+ // $filter = c.$filters.filter( '[data-column="' + column + '"]' );
+ $filter = tsf.getColumnElm( c, c.$filters, column );
+ ffxn = ts.getColumnData( table, wo.filter_functions, column );
+ makeSelect = ( wo.filter_functions && ffxn && typeof ffxn !== 'function' ) ||
+ $header.hasClass( 'filter-select' );
+ // get data from jQuery data, metadata, headers option or header class name
+ col = ts.getColumnData( table, c.headers, column );
+ disabled = ts.getData( $header[0], col, 'filter' ) === 'false' ||
+ ts.getData( $header[0], col, 'parser' ) === 'false';
+
+ if ( makeSelect ) {
+ buildFilter = $( '<select>' ).appendTo( $filter );
+ } else {
+ ffxn = ts.getColumnData( table, wo.filter_formatter, column );
+ if ( ffxn ) {
+ wo.filter_formatterCount++;
+ buildFilter = ffxn( $filter, column );
+ // no element returned, so lets go find it
+ if ( buildFilter && buildFilter.length === 0 ) {
+ buildFilter = $filter.children( 'input' );
+ }
+ // element not in DOM, so lets attach it
+ if ( buildFilter && ( buildFilter.parent().length === 0 ||
+ ( buildFilter.parent().length && buildFilter.parent()[0] !== $filter[0] ) ) ) {
+ $filter.append( buildFilter );
+ }
+ } else {
+ buildFilter = $( '<input type="search">' ).appendTo( $filter );
+ }
+ if ( buildFilter ) {
+ tmp = $header.data( 'placeholder' ) ||
+ $header.attr( 'data-placeholder' ) ||
+ wo.filter_placeholder.search || '';
+ buildFilter.attr( 'placeholder', tmp );
+ }
+ }
+ if ( buildFilter ) {
+ // add filter class name
+ name = ( $.isArray( wo.filter_cssFilter ) ?
+ ( typeof wo.filter_cssFilter[column] !== 'undefined' ? wo.filter_cssFilter[column] || '' : '' ) :
+ wo.filter_cssFilter ) || '';
+ // copy data-column from table cell (it will include colspan)
+ buildFilter.addClass( tscss.filter + ' ' + name );
+ name = wo.filter_filterLabel;
+ tmp = name.match(/{{([^}]+?)}}/g);
+ if (!tmp) {
+ tmp = [ '{{label}}' ];
+ }
+ $.each(tmp, function(indx, attr) {
+ var regex = new RegExp(attr, 'g'),
+ data = $header.attr('data-' + attr.replace(/{{|}}/g, '')),
+ text = typeof data === 'undefined' ? $header.text() : data;
+ name = name.replace( regex, $.trim( text ) );
+ });
+ buildFilter.attr({
+ 'data-column': $filter.attr( 'data-column' ),
+ 'aria-label': name
+ });
+ if ( disabled ) {
+ buildFilter.attr( 'placeholder', '' ).addClass( tscss.filterDisabled )[0].disabled = true;
+ }
+ }
+ }
+ }
+ },
+ bindSearch: function( table, $el, internal ) {
+ table = $( table )[0];
+ $el = $( $el ); // allow passing a selector string
+ if ( !$el.length ) { return; }
+ var tmp,
+ c = table.config,
+ wo = c.widgetOptions,
+ namespace = c.namespace + 'filter',
+ $ext = wo.filter_$externalFilters;
+ if ( internal !== true ) {
+ // save anyMatch element
+ tmp = wo.filter_anyColumnSelector + ',' + wo.filter_multipleColumnSelector;
+ wo.filter_$anyMatch = $el.filter( tmp );
+ if ( $ext && $ext.length ) {
+ wo.filter_$externalFilters = wo.filter_$externalFilters.add( $el );
+ } else {
+ wo.filter_$externalFilters = $el;
+ }
+ // update values ( external filters added after table initialization )
+ ts.setFilters( table, c.$table.data( 'lastSearch' ) || [], internal === false );
+ }
+ // unbind events
+ tmp = ( 'keypress keyup keydown search change input '.split( ' ' ).join( namespace + ' ' ) );
+ $el
+ // use data attribute instead of jQuery data since the head is cloned without including
+ // the data/binding
+ .attr( 'data-lastSearchTime', new Date().getTime() )
+ .unbind( tmp.replace( ts.regex.spaces, ' ' ) )
+ .bind( 'keydown' + namespace, function( event ) {
+ if ( event.which === tskeyCodes.escape && !table.config.widgetOptions.filter_resetOnEsc ) {
+ // prevent keypress event
+ return false;
+ }
+ })
+ .bind( 'keyup' + namespace, function( event ) {
+ wo = table.config.widgetOptions; // make sure "wo" isn't cached
+ var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
+ liveSearch = typeof wo.filter_liveSearch === 'boolean' ? wo.filter_liveSearch :
+ ts.getColumnData( table, wo.filter_liveSearch, column );
+ if ( typeof liveSearch === 'undefined' ) {
+ liveSearch = wo.filter_liveSearch.fallback || false;
+ }
+ $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
+ // emulate what webkit does.... escape clears the filter
+ if ( event.which === tskeyCodes.escape ) {
+ // make sure to restore the last value on escape
+ this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column];
+ // don't return if the search value is empty ( all rows need to be revealed )
+ } else if ( this.value !== '' && (
+ // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
+ ( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
+ // let return & backspace continue on, but ignore arrows & non-valid characters
+ ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
+ ( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) {
+ return;
+ // live search
+ } else if ( liveSearch === false ) {
+ if ( this.value !== '' && event.which !== tskeyCodes.enter ) {
+ return;
+ }
+ }
+ // change event = no delay; last true flag tells getFilters to skip newest timed input
+ tsf.searching( table, true, true, column );
+ })
+ // include change for select - fixes #473
+ .bind( 'search change keypress input blur '.split( ' ' ).join( namespace + ' ' ), function( event ) {
+ // don't get cached data, in case data-column changes dynamically
+ var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
+ eventType = event.type,
+ liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
+ wo.filter_liveSearch :
+ ts.getColumnData( table, wo.filter_liveSearch, column );
+ if ( table.config.widgetOptions.filter_initialized &&
+ // immediate search if user presses enter
+ ( event.which === tskeyCodes.enter ||
+ // immediate search if a "search" or "blur" is triggered on the input
+ ( eventType === 'search' || eventType === 'blur' ) ||
+ // change & input events must be ignored if liveSearch !== true
+ ( eventType === 'change' || eventType === 'input' ) &&
+ // prevent search if liveSearch is a number
+ ( liveSearch === true || liveSearch !== true && event.target.nodeName !== 'INPUT' ) &&
+ // don't allow 'change' or 'input' event to process if the input value
+ // is the same - fixes #685
+ this.value !== c.lastSearch[column]
+ )
+ ) {
+ event.preventDefault();
+ // init search with no delay
+ $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
+ tsf.searching( table, eventType !== 'keypress', true, column );
+ }
+ });
+ },
+ searching: function( table, filter, skipFirst, column ) {
+ var liveSearch,
+ wo = table.config.widgetOptions;
+ if (typeof column === 'undefined') {
+ // no delay
+ liveSearch = false;
+ } else {
+ liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
+ wo.filter_liveSearch :
+ // get column setting, or set to fallback value, or default to false
+ ts.getColumnData( table, wo.filter_liveSearch, column );
+ if ( typeof liveSearch === 'undefined' ) {
+ liveSearch = wo.filter_liveSearch.fallback || false;
+ }
+ }
+ clearTimeout( wo.filter_searchTimer );
+ if ( typeof filter === 'undefined' || filter === true ) {
+ // delay filtering
+ wo.filter_searchTimer = setTimeout( function() {
+ tsf.checkFilters( table, filter, skipFirst );
+ }, liveSearch ? wo.filter_searchDelay : 10 );
+ } else {
+ // skip delay
+ tsf.checkFilters( table, filter, skipFirst );
+ }
+ },
+ equalFilters: function (c, filter1, filter2) {
+ var indx,
+ f1 = [],
+ f2 = [],
+ len = c.columns + 1; // add one to include anyMatch filter
+ filter1 = $.isArray(filter1) ? filter1 : [];
+ filter2 = $.isArray(filter2) ? filter2 : [];
+ for (indx = 0; indx < len; indx++) {
+ f1[indx] = filter1[indx] || '';
+ f2[indx] = filter2[indx] || '';
+ }
+ return f1.join(',') === f2.join(',');
+ },
+ checkFilters: function( table, filter, skipFirst ) {
+ var c = table.config,
+ wo = c.widgetOptions,
+ filterArray = $.isArray( filter ),
+ filters = ( filterArray ) ? filter : ts.getFilters( table, true ),
+ currentFilters = filters || []; // current filter values
+ // prevent errors if delay init is set
+ if ( $.isEmptyObject( c.cache ) ) {
+ // update cache if delayInit set & pager has initialized ( after user initiates a search )
+ if ( c.delayInit && ( !c.pager || c.pager && c.pager.initialized ) ) {
+ ts.updateCache( c, function() {
+ tsf.checkFilters( table, false, skipFirst );
+ });
+ }
+ return;
+ }
+ // add filter array back into inputs
+ if ( filterArray ) {
+ ts.setFilters( table, filters, false, skipFirst !== true );
+ if ( !wo.filter_initialized ) {
+ c.lastSearch = [];
+ c.lastCombinedFilter = '';
+ }
+ }
+ if ( wo.filter_hideFilters ) {
+ // show/hide filter row as needed
+ c.$table
+ .find( '.' + tscss.filterRow )
+ .triggerHandler( tsf.hideFiltersCheck( c ) ? 'mouseleave' : 'mouseenter' );
+ }
+ // return if the last search is the same; but filter === false when updating the search
+ // see example-widget-filter.html filter toggle buttons
+ if ( tsf.equalFilters(c, c.lastSearch, currentFilters) && filter !== false ) {
+ return;
+ } else if ( filter === false ) {
+ // force filter refresh
+ c.lastCombinedFilter = '';
+ c.lastSearch = [];
+ }
+ // define filter inside it is false
+ filters = filters || [];
+ // convert filters to strings - see #1070
+ filters = Array.prototype.map ?
+ filters.map( String ) :
+ // for IE8 & older browsers - maybe not the best method
+ filters.join( '\ufffd' ).split( '\ufffd' );
+
+ if ( wo.filter_initialized ) {
+ c.$table.triggerHandler( 'filterStart', [ filters ] );
+ }
+ if ( c.showProcessing ) {
+ // give it time for the processing icon to kick in
+ setTimeout( function() {
+ tsf.findRows( table, filters, currentFilters );
+ return false;
+ }, 30 );
+ } else {
+ tsf.findRows( table, filters, currentFilters );
+ return false;
+ }
+ },
+ hideFiltersCheck: function( c ) {
+ if (typeof c.widgetOptions.filter_hideFilters === 'function') {
+ var val = c.widgetOptions.filter_hideFilters( c );
+ if (typeof val === 'boolean') {
+ return val;
+ }
+ }
+ return ts.getFilters( c.$table ).join( '' ) === '';
+ },
+ hideFilters: function( c, $table ) {
+ var timer;
+ ( $table || c.$table )
+ .find( '.' + tscss.filterRow )
+ .addClass( tscss.filterRowHide )
+ .bind( 'mouseenter mouseleave', function( e ) {
+ // save event object - http://bugs.jquery.com/ticket/12140
+ var event = e,
+ $row = $( this );
+ clearTimeout( timer );
+ timer = setTimeout( function() {
+ if ( /enter|over/.test( event.type ) ) {
+ $row.removeClass( tscss.filterRowHide );
+ } else {
+ // don't hide if input has focus
+ // $( ':focus' ) needs jQuery 1.6+
+ if ( $( document.activeElement ).closest( 'tr' )[0] !== $row[0] ) {
+ // don't hide row if any filter has a value
+ $row.toggleClass( tscss.filterRowHide, tsf.hideFiltersCheck( c ) );
+ }
+ }
+ }, 200 );
+ })
+ .find( 'input, select' ).bind( 'focus blur', function( e ) {
+ var event = e,
+ $row = $( this ).closest( 'tr' );
+ clearTimeout( timer );
+ timer = setTimeout( function() {
+ clearTimeout( timer );
+ // don't hide row if any filter has a value
+ $row.toggleClass( tscss.filterRowHide, tsf.hideFiltersCheck( c ) && event.type !== 'focus' );
+ }, 200 );
+ });
+ },
+ defaultFilter: function( filter, mask ) {
+ if ( filter === '' ) { return filter; }
+ var regex = tsfRegex.iQuery,
+ maskLen = mask.match( tsfRegex.igQuery ).length,
+ query = maskLen > 1 ? $.trim( filter ).split( /\s/ ) : [ $.trim( filter ) ],
+ len = query.length - 1,
+ indx = 0,
+ val = mask;
+ if ( len < 1 && maskLen > 1 ) {
+ // only one 'word' in query but mask has >1 slots
+ query[1] = query[0];
+ }
+ // replace all {query} with query words...
+ // if query = 'Bob', then convert mask from '!{query}' to '!Bob'
+ // if query = 'Bob Joe Frank', then convert mask '{q} OR {q}' to 'Bob OR Joe OR Frank'
+ while ( regex.test( val ) ) {
+ val = val.replace( regex, query[indx++] || '' );
+ if ( regex.test( val ) && indx < len && ( query[indx] || '' ) !== '' ) {
+ val = mask.replace( regex, val );
+ }
+ }
+ return val;
+ },
+ getLatestSearch: function( $input ) {
+ if ( $input ) {
+ return $input.sort( function( a, b ) {
+ return $( b ).attr( 'data-lastSearchTime' ) - $( a ).attr( 'data-lastSearchTime' );
+ });
+ }
+ return $input || $();
+ },
+ findRange: function( c, val, ignoreRanges ) {
+ // look for multiple columns '1-3,4-6,8' in data-column
+ var temp, ranges, range, start, end, singles, i, indx, len,
+ columns = [];
+ if ( /^[0-9]+$/.test( val ) ) {
+ // always return an array
+ return [ parseInt( val, 10 ) ];
+ }
+ // process column range
+ if ( !ignoreRanges && /-/.test( val ) ) {
+ ranges = val.match( /(\d+)\s*-\s*(\d+)/g );
+ len = ranges ? ranges.length : 0;
+ for ( indx = 0; indx < len; indx++ ) {
+ range = ranges[indx].split( /\s*-\s*/ );
+ start = parseInt( range[0], 10 ) || 0;
+ end = parseInt( range[1], 10 ) || ( c.columns - 1 );
+ if ( start > end ) {
+ temp = start; start = end; end = temp; // swap
+ }
+ if ( end >= c.columns ) {
+ end = c.columns - 1;
+ }
+ for ( ; start <= end; start++ ) {
+ columns[ columns.length ] = start;
+ }
+ // remove processed range from val
+ val = val.replace( ranges[ indx ], '' );
+ }
+ }
+ // process single columns
+ if ( !ignoreRanges && /,/.test( val ) ) {
+ singles = val.split( /\s*,\s*/ );
+ len = singles.length;
+ for ( i = 0; i < len; i++ ) {
+ if ( singles[ i ] !== '' ) {
+ indx = parseInt( singles[ i ], 10 );
+ if ( indx < c.columns ) {
+ columns[ columns.length ] = indx;
+ }
+ }
+ }
+ }
+ // return all columns
+ if ( !columns.length ) {
+ for ( indx = 0; indx < c.columns; indx++ ) {
+ columns[ columns.length ] = indx;
+ }
+ }
+ return columns;
+ },
+ getColumnElm: function( c, $elements, column ) {
+ // data-column may contain multiple columns '1-3,5-6,8'
+ // replaces: c.$filters.filter( '[data-column="' + column + '"]' );
+ return $elements.filter( function() {
+ var cols = tsf.findRange( c, $( this ).attr( 'data-column' ) );
+ return $.inArray( column, cols ) > -1;
+ });
+ },
+ multipleColumns: function( c, $input ) {
+ // look for multiple columns '1-3,4-6,8' in data-column
+ var wo = c.widgetOptions,
+ // only target 'all' column inputs on initialization
+ // & don't target 'all' column inputs if they don't exist
+ targets = wo.filter_initialized || !$input.filter( wo.filter_anyColumnSelector ).length,
+ val = $.trim( tsf.getLatestSearch( $input ).attr( 'data-column' ) || '' );
+ return tsf.findRange( c, val, !targets );
+ },
+ processTypes: function( c, data, vars ) {
+ var ffxn,
+ filterMatched = null,
+ matches = null;
+ for ( ffxn in tsf.types ) {
+ if ( $.inArray( ffxn, vars.excludeMatch ) < 0 && matches === null ) {
+ matches = tsf.types[ffxn]( c, data, vars );
+ if ( matches !== null ) {
+ data.matchedOn = ffxn;
+ filterMatched = matches;
+ }
+ }
+ }
+ return filterMatched;
+ },
+ matchType: function( c, columnIndex ) {
+ var isMatch,
+ wo = c.widgetOptions,
+ $el = c.$headerIndexed[ columnIndex ];
+ // filter-exact > filter-match > filter_matchType for type
+ if ( $el.hasClass( 'filter-exact' ) ) {
+ isMatch = false;
+ } else if ( $el.hasClass( 'filter-match' ) ) {
+ isMatch = true;
+ } else {
+ // filter-select is not applied when filter_functions are used, so look for a select
+ if ( wo.filter_columnFilters ) {
+ $el = c.$filters
+ .find( '.' + tscss.filter )
+ .add( wo.filter_$externalFilters )
+ .filter( '[data-column="' + columnIndex + '"]' );
+ } else if ( wo.filter_$externalFilters ) {
+ $el = wo.filter_$externalFilters.filter( '[data-column="' + columnIndex + '"]' );
+ }
+ isMatch = $el.length ?
+ c.widgetOptions.filter_matchType[ ( $el[ 0 ].nodeName || '' ).toLowerCase() ] === 'match' :
+ // default to exact, if no inputs found
+ false;
+ }
+ return isMatch;
+ },
+ processRow: function( c, data, vars ) {
+ var result, filterMatched,
+ fxn, ffxn, txt,
+ wo = c.widgetOptions,
+ showRow = true,
+ hasAnyMatchInput = wo.filter_$anyMatch && wo.filter_$anyMatch.length,
+
+ // if wo.filter_$anyMatch data-column attribute is changed dynamically
+ // we don't want to do an "anyMatch" search on one column using data
+ // for the entire row - see #998
+ columnIndex = wo.filter_$anyMatch && wo.filter_$anyMatch.length ?
+ // look for multiple columns '1-3,4-6,8'
+ tsf.multipleColumns( c, wo.filter_$anyMatch ) :
+ [];
+ data.$cells = data.$row.children();
+ data.matchedOn = null;
+ if ( data.anyMatchFlag && columnIndex.length > 1 || ( data.anyMatchFilter && !hasAnyMatchInput ) ) {
+ data.anyMatch = true;
+ data.isMatch = true;
+ data.rowArray = data.$cells.map( function( i ) {
+ if ( $.inArray( i, columnIndex ) > -1 || ( data.anyMatchFilter && !hasAnyMatchInput ) ) {
+ if ( data.parsed[ i ] ) {
+ txt = data.cacheArray[ i ];
+ } else {
+ txt = data.rawArray[ i ];
+ txt = $.trim( wo.filter_ignoreCase ? txt.toLowerCase() : txt );
+ if ( c.sortLocaleCompare ) {
+ txt = ts.replaceAccents( txt );
+ }
+ }
+ return txt;
+ }
+ }).get();
+ data.filter = data.anyMatchFilter;
+ data.iFilter = data.iAnyMatchFilter;
+ data.exact = data.rowArray.join( ' ' );
+ data.iExact = wo.filter_ignoreCase ? data.exact.toLowerCase() : data.exact;
+ data.cache = data.cacheArray.slice( 0, -1 ).join( ' ' );
+ vars.excludeMatch = vars.noAnyMatch;
+ filterMatched = tsf.processTypes( c, data, vars );
+ if ( filterMatched !== null ) {
+ showRow = filterMatched;
+ } else {
+ if ( wo.filter_startsWith ) {
+ showRow = false;
+ // data.rowArray may not contain all columns
+ columnIndex = Math.min( c.columns, data.rowArray.length );
+ while ( !showRow && columnIndex > 0 ) {
+ columnIndex--;
+ showRow = showRow || data.rowArray[ columnIndex ].indexOf( data.iFilter ) === 0;
+ }
+ } else {
+ showRow = ( data.iExact + data.childRowText ).indexOf( data.iFilter ) >= 0;
+ }
+ }
+ data.anyMatch = false;
+ // no other filters to process
+ if ( data.filters.join( '' ) === data.filter ) {
+ return showRow;
+ }
+ }
+
+ for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
+ data.filter = data.filters[ columnIndex ];
+ data.index = columnIndex;
+
+ // filter types to exclude, per column
+ vars.excludeMatch = vars.excludeFilter[ columnIndex ];
+
+ // ignore if filter is empty or disabled
+ if ( data.filter ) {
+ data.cache = data.cacheArray[ columnIndex ];
+ result = data.parsed[ columnIndex ] ? data.cache : data.rawArray[ columnIndex ] || '';
+ data.exact = c.sortLocaleCompare ? ts.replaceAccents( result ) : result; // issue #405
+ data.iExact = !tsfRegex.type.test( typeof data.exact ) && wo.filter_ignoreCase ?
+ data.exact.toLowerCase() : data.exact;
+ data.isMatch = tsf.matchType( c, columnIndex );
+
+ result = showRow; // if showRow is true, show that row
+
+ // in case select filter option has a different value vs text 'a - z|A through Z'
+ ffxn = wo.filter_columnFilters ?
+ c.$filters.add( wo.filter_$externalFilters )
+ .filter( '[data-column="' + columnIndex + '"]' )
+ .find( 'select option:selected' )
+ .attr( 'data-function-name' ) || '' : '';
+ // replace accents - see #357
+ if ( c.sortLocaleCompare ) {
+ data.filter = ts.replaceAccents( data.filter );
+ }
+
+ // replace column specific default filters - see #1088
+ if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) {
+ data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] );
+ }
+
+ // data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ),
+ // data.filter = case sensitive
+ data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter;
+ fxn = vars.functions[ columnIndex ];
+ filterMatched = null;
+ if ( fxn ) {
+ if ( typeof fxn === 'function' ) {
+ // filter callback( exact cell content, parser normalized content,
+ // filter input value, column index, jQuery row object )
+ filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
+ } else if ( typeof fxn[ ffxn || data.filter ] === 'function' ) {
+ // selector option function
+ txt = ffxn || data.filter;
+ filterMatched =
+ fxn[ txt ]( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
+ }
+ }
+ if ( filterMatched === null ) {
+ // cycle through the different filters
+ // filters return a boolean or null if nothing matches
+ filterMatched = tsf.processTypes( c, data, vars );
+ // select with exact match; ignore "and" or "or" within the text; fixes #1486
+ txt = fxn === true && (data.matchedOn === 'and' || data.matchedOn === 'or');
+ if ( filterMatched !== null && !txt) {
+ result = filterMatched;
+ // Look for match, and add child row data for matching
+ } else {
+ // check fxn (filter-select in header) after filter types are checked
+ // without this, the filter + jQuery UI selectmenu demo was breaking
+ if ( fxn === true ) {
+ // default selector uses exact match unless 'filter-match' class is found
+ result = data.isMatch ?
+ // data.iExact may be a number
+ ( '' + data.iExact ).search( data.iFilter ) >= 0 :
+ data.filter === data.exact;
+ } else {
+ txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
+ result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
+ }
+ }
+ } else {
+ result = filterMatched;
+ }
+ showRow = ( result ) ? showRow : false;
+ }
+ }
+ return showRow;
+ },
+ findRows: function( table, filters, currentFilters ) {
+ if (
+ tsf.equalFilters(table.config, table.config.lastSearch, currentFilters) ||
+ !table.config.widgetOptions.filter_initialized
+ ) {
+ return;
+ }
+ var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex,
+ isChild, childRow, lastSearch, showRow, showParent, time, val, indx,
+ notFiltered, searchFiltered, query, injected, res, id, txt,
+ storedFilters = $.extend( [], filters ),
+ c = table.config,
+ wo = c.widgetOptions,
+ debug = ts.debug(c, 'filter'),
+ // data object passed to filters; anyMatch is a flag for the filters
+ data = {
+ anyMatch: false,
+ filters: filters,
+ // regex filter type cache
+ filter_regexCache : []
+ },
+ vars = {
+ // anyMatch really screws up with these types of filters
+ noAnyMatch: [ 'range', 'operators' ],
+ // cache filter variables that use ts.getColumnData in the main loop
+ functions : [],
+ excludeFilter : [],
+ defaultColFilter : [],
+ defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || ''
+ };
+ // parse columns after formatter, in case the class is added at that point
+ data.parsed = [];
+ for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
+ data.parsed[ columnIndex ] = wo.filter_useParsedData ||
+ // parser has a "parsed" parameter
+ ( c.parsers && c.parsers[ columnIndex ] && c.parsers[ columnIndex ].parsed ||
+ // getData may not return 'parsed' if other 'filter-' class names exist
+ // ( e.g. <th class="filter-select filter-parsed"> )
+ ts.getData && ts.getData( c.$headerIndexed[ columnIndex ],
+ ts.getColumnData( table, c.headers, columnIndex ), 'filter' ) === 'parsed' ||
+ c.$headerIndexed[ columnIndex ].hasClass( 'filter-parsed' ) );
+
+ vars.functions[ columnIndex ] =
+ ts.getColumnData( table, wo.filter_functions, columnIndex ) ||
+ c.$headerIndexed[ columnIndex ].hasClass( 'filter-select' );
+ vars.defaultColFilter[ columnIndex ] =
+ ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '';
+ vars.excludeFilter[ columnIndex ] =
+ ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split( /\s+/ );
+ }
+
+ if ( debug ) {
+ console.log( 'Filter >> Starting filter widget search', filters );
+ time = new Date();
+ }
+ // filtered rows count
+ c.filteredRows = 0;
+ c.totalRows = 0;
+ currentFilters = ( storedFilters || [] );
+
+ for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody( table, c.$tbodies.eq( tbodyIndex ), true );
+ // skip child rows & widget added ( removable ) rows - fixes #448 thanks to @hempel!
+ // $rows = $tbody.children( 'tr' ).not( c.selectorRemove );
+ columnIndex = c.columns;
+ // convert stored rows into a jQuery object
+ norm_rows = c.cache[ tbodyIndex ].normalized;
+ $rows = $( $.map( norm_rows, function( el ) {
+ return el[ columnIndex ].$row.get();
+ }) );
+
+ if ( currentFilters.join('') === '' || wo.filter_serversideFiltering ) {
+ $rows
+ .removeClass( wo.filter_filteredRow )
+ .not( '.' + c.cssChildRow )
+ .css( 'display', '' );
+ } else {
+ // filter out child rows
+ $rows = $rows.not( '.' + c.cssChildRow );
+ len = $rows.length;
+
+ if ( ( wo.filter_$anyMatch && wo.filter_$anyMatch.length ) ||
+ typeof filters[c.columns] !== 'undefined' ) {
+ data.anyMatchFlag = true;
+ data.anyMatchFilter = '' + (
+ filters[ c.columns ] ||
+ wo.filter_$anyMatch && tsf.getLatestSearch( wo.filter_$anyMatch ).val() ||
+ ''
+ );
+ if ( wo.filter_columnAnyMatch ) {
+ // specific columns search
+ query = data.anyMatchFilter.split( tsfRegex.andSplit );
+ injected = false;
+ for ( indx = 0; indx < query.length; indx++ ) {
+ res = query[ indx ].split( ':' );
+ if ( res.length > 1 ) {
+ // make the column a one-based index ( non-developers start counting from one :P )
+ if ( isNaN( res[0] ) ) {
+ $.each( c.headerContent, function( i, txt ) {
+ // multiple matches are possible
+ if ( txt.toLowerCase().indexOf( res[0] ) > -1 ) {
+ id = i;
+ filters[ id ] = res[1];
+ }
+ });
+ } else {
+ id = parseInt( res[0], 10 ) - 1;
+ }
+ if ( id >= 0 && id < c.columns ) { // if id is an integer
+ filters[ id ] = res[1];
+ query.splice( indx, 1 );
+ indx--;
+ injected = true;
+ }
+ }
+ }
+ if ( injected ) {
+ data.anyMatchFilter = query.join( ' && ' );
+ }
+ }
+ }
+
+ // optimize searching only through already filtered rows - see #313
+ searchFiltered = wo.filter_searchFiltered;
+ lastSearch = c.lastSearch || c.$table.data( 'lastSearch' ) || [];
+ if ( searchFiltered ) {
+ // cycle through all filters; include last ( columnIndex + 1 = match any column ). Fixes #669
+ for ( indx = 0; indx < columnIndex + 1; indx++ ) {
+ val = filters[indx] || '';
+ // break out of loop if we've already determined not to search filtered rows
+ if ( !searchFiltered ) { indx = columnIndex; }
+ // search already filtered rows if...
+ searchFiltered = searchFiltered && lastSearch.length &&
+ // there are no changes from beginning of filter
+ val.indexOf( lastSearch[indx] || '' ) === 0 &&
+ // if there is NOT a logical 'or', or range ( 'to' or '-' ) in the string
+ !tsfRegex.alreadyFiltered.test( val ) &&
+ // if we are not doing exact matches, using '|' ( logical or ) or not '!'
+ !tsfRegex.exactTest.test( val ) &&
+ // don't search only filtered if the value is negative
+ // ( '> -10' => '> -100' will ignore hidden rows )
+ !( tsfRegex.isNeg1.test( val ) || tsfRegex.isNeg2.test( val ) ) &&
+ // if filtering using a select without a 'filter-match' class ( exact match ) - fixes #593
+ !( val !== '' && c.$filters && c.$filters.filter( '[data-column="' + indx + '"]' ).find( 'select' ).length &&
+ !tsf.matchType( c, indx ) );
+ }
+ }
+ notFiltered = $rows.not( '.' + wo.filter_filteredRow ).length;
+ // can't search when all rows are hidden - this happens when looking for exact matches
+ if ( searchFiltered && notFiltered === 0 ) { searchFiltered = false; }
+ if ( debug ) {
+ console.log( 'Filter >> Searching through ' +
+ ( searchFiltered && notFiltered < len ? notFiltered : 'all' ) + ' rows' );
+ }
+ if ( data.anyMatchFlag ) {
+ if ( c.sortLocaleCompare ) {
+ // replace accents
+ data.anyMatchFilter = ts.replaceAccents( data.anyMatchFilter );
+ }
+ if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultAnyFilter ) ) {
+ data.anyMatchFilter = tsf.defaultFilter( data.anyMatchFilter, vars.defaultAnyFilter );
+ // clear search filtered flag because default filters are not saved to the last search
+ searchFiltered = false;
+ }
+ // make iAnyMatchFilter lowercase unless both filter widget & core ignoreCase options are true
+ // when c.ignoreCase is true, the cache contains all lower case data
+ data.iAnyMatchFilter = !( wo.filter_ignoreCase && c.ignoreCase ) ?
+ data.anyMatchFilter :
+ data.anyMatchFilter.toLowerCase();
+ }
+
+ // loop through the rows
+ for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
+
+ txt = $rows[ rowIndex ].className;
+ // the first row can never be a child row
+ isChild = rowIndex && tsfRegex.child.test( txt );
+ // skip child rows & already filtered rows
+ if ( isChild || ( searchFiltered && tsfRegex.filtered.test( txt ) ) ) {
+ continue;
+ }
+
+ data.$row = $rows.eq( rowIndex );
+ data.rowIndex = rowIndex;
+ data.cacheArray = norm_rows[ rowIndex ];
+ rowData = data.cacheArray[ c.columns ];
+ data.rawArray = rowData.raw;
+ data.childRowText = '';
+
+ if ( !wo.filter_childByColumn ) {
+ txt = '';
+ // child row cached text
+ childRow = rowData.child;
+ // so, if 'table.config.widgetOptions.filter_childRows' is true and there is
+ // a match anywhere in the child row, then it will make the row visible
+ // checked here so the option can be changed dynamically
+ for ( indx = 0; indx < childRow.length; indx++ ) {
+ txt += ' ' + childRow[indx].join( ' ' ) || '';
+ }
+ data.childRowText = wo.filter_childRows ?
+ ( wo.filter_ignoreCase ? txt.toLowerCase() : txt ) :
+ '';
+ }
+
+ showRow = false;
+ showParent = tsf.processRow( c, data, vars );
+ $row = rowData.$row;
+
+ // don't pass reference to val
+ val = showParent ? true : false;
+ childRow = rowData.$row.filter( ':gt(0)' );
+ if ( wo.filter_childRows && childRow.length ) {
+ if ( wo.filter_childByColumn ) {
+ if ( !wo.filter_childWithSibs ) {
+ // hide all child rows
+ childRow.addClass( wo.filter_filteredRow );
+ // if only showing resulting child row, only include parent
+ $row = $row.eq( 0 );
+ }
+ // cycle through each child row
+ for ( indx = 0; indx < childRow.length; indx++ ) {
+ data.$row = childRow.eq( indx );
+ data.cacheArray = rowData.child[ indx ];
+ data.rawArray = data.cacheArray;
+ val = tsf.processRow( c, data, vars );
+ // use OR comparison on child rows
+ showRow = showRow || val;
+ if ( !wo.filter_childWithSibs && val ) {
+ childRow.eq( indx ).removeClass( wo.filter_filteredRow );
+ }
+ }
+ }
+ // keep parent row match even if no child matches... see #1020
+ showRow = showRow || showParent;
+ } else {
+ showRow = val;
+ }
+ $row
+ .toggleClass( wo.filter_filteredRow, !showRow )[0]
+ .display = showRow ? '' : 'none';
+ }
+ }
+ c.filteredRows += $rows.not( '.' + wo.filter_filteredRow ).length;
+ c.totalRows += $rows.length;
+ ts.processTbody( table, $tbody, false );
+ }
+ // lastCombinedFilter is no longer used internally
+ c.lastCombinedFilter = storedFilters.join(''); // save last search
+ // don't save 'filters' directly since it may have altered ( AnyMatch column searches )
+ c.lastSearch = storedFilters;
+ c.$table.data( 'lastSearch', storedFilters );
+ if ( wo.filter_saveFilters && ts.storage ) {
+ ts.storage( table, 'tablesorter-filters', tsf.processFilters( storedFilters, true ) );
+ }
+ if ( debug ) {
+ console.log( 'Filter >> Completed search' + ts.benchmark(time) );
+ }
+ if ( wo.filter_initialized ) {
+ c.$table.triggerHandler( 'filterBeforeEnd', c );
+ c.$table.triggerHandler( 'filterEnd', c );
+ }
+ setTimeout( function() {
+ ts.applyWidget( c.table ); // make sure zebra widget is applied
+ }, 0 );
+ },
+ getOptionSource: function( table, column, onlyAvail ) {
+ table = $( table )[0];
+ var c = table.config,
+ wo = c.widgetOptions,
+ arry = false,
+ source = wo.filter_selectSource,
+ last = c.$table.data( 'lastSearch' ) || [],
+ fxn = typeof source === 'function' ? true : ts.getColumnData( table, source, column );
+
+ if ( onlyAvail && last[column] !== '' ) {
+ onlyAvail = false;
+ }
+
+ // filter select source option
+ if ( fxn === true ) {
+ // OVERALL source
+ arry = source( table, column, onlyAvail );
+ } else if ( fxn instanceof $ || ( $.type( fxn ) === 'string' && fxn.indexOf( '</option>' ) >= 0 ) ) {
+ // selectSource is a jQuery object or string of options
+ return fxn;
+ } else if ( $.isArray( fxn ) ) {
+ arry = fxn;
+ } else if ( $.type( source ) === 'object' && fxn ) {
+ // custom select source function for a SPECIFIC COLUMN
+ arry = fxn( table, column, onlyAvail );
+ // abort - updating the selects from an external method
+ if (arry === null) {
+ return null;
+ }
+ }
+ if ( arry === false ) {
+ // fall back to original method
+ arry = tsf.getOptions( table, column, onlyAvail );
+ }
+
+ return tsf.processOptions( table, column, arry );
+
+ },
+ processOptions: function( table, column, arry ) {
+ if ( !$.isArray( arry ) ) {
+ return false;
+ }
+ table = $( table )[0];
+ var cts, txt, indx, len, parsedTxt, str,
+ c = table.config,
+ validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
+ direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
+ parsed = [];
+ // get unique elements and sort the list
+ // if $.tablesorter.sortText exists ( not in the original tablesorter ),
+ // then natural sort the list otherwise use a basic sort
+ arry = $.grep( arry, function( value, indx ) {
+ if ( value.text ) {
+ return true;
+ }
+ return $.inArray( value, arry ) === indx;
+ });
+ if ( validColumn && c.$headerIndexed[ column ].hasClass( 'filter-select-nosort' ) ) {
+ // unsorted select options
+ return arry;
+ } else {
+ len = arry.length;
+ // parse select option values
+ for ( indx = 0; indx < len; indx++ ) {
+ txt = arry[ indx ];
+ // check for object
+ str = txt.text ? txt.text : txt;
+ // sortNatural breaks if you don't pass it strings
+ parsedTxt = ( validColumn && c.parsers && c.parsers.length &&
+ c.parsers[ column ].format( str, table, [], column ) || str ).toString();
+ parsedTxt = c.widgetOptions.filter_ignoreCase ? parsedTxt.toLowerCase() : parsedTxt;
+ // parse array data using set column parser; this DOES NOT pass the original
+ // table cell to the parser format function
+ if ( txt.text ) {
+ txt.parsed = parsedTxt;
+ parsed[ parsed.length ] = txt;
+ } else {
+ parsed[ parsed.length ] = {
+ text : txt,
+ // check parser length - fixes #934
+ parsed : parsedTxt
+ };
+ }
+ }
+ // sort parsed select options
+ cts = c.textSorter || '';
+ parsed.sort( function( a, b ) {
+ var x = direction ? b.parsed : a.parsed,
+ y = direction ? a.parsed : b.parsed;
+ if ( validColumn && typeof cts === 'function' ) {
+ // custom OVERALL text sorter
+ return cts( x, y, true, column, table );
+ } else if ( validColumn && typeof cts === 'object' && cts.hasOwnProperty( column ) ) {
+ // custom text sorter for a SPECIFIC COLUMN
+ return cts[column]( x, y, true, column, table );
+ } else if ( ts.sortNatural ) {
+ // fall back to natural sort
+ return ts.sortNatural( x, y );
+ }
+ // using an older version! do a basic sort
+ return true;
+ });
+ // rebuild arry from sorted parsed data
+ arry = [];
+ len = parsed.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ arry[ arry.length ] = parsed[indx];
+ }
+ return arry;
+ }
+ },
+ getOptions: function( table, column, onlyAvail ) {
+ table = $( table )[0];
+ var rowIndex, tbodyIndex, len, row, cache, indx, child, childLen,
+ c = table.config,
+ wo = c.widgetOptions,
+ arry = [];
+ for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) {
+ cache = c.cache[tbodyIndex];
+ len = c.cache[tbodyIndex].normalized.length;
+ // loop through the rows
+ for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
+ // get cached row from cache.row ( old ) or row data object
+ // ( new; last item in normalized array )
+ row = cache.row ?
+ cache.row[ rowIndex ] :
+ cache.normalized[ rowIndex ][ c.columns ].$row[0];
+ // check if has class filtered
+ if ( onlyAvail && row.className.match( wo.filter_filteredRow ) ) {
+ continue;
+ }
+ // get non-normalized cell content
+ if ( wo.filter_useParsedData ||
+ c.parsers[column].parsed ||
+ c.$headerIndexed[column].hasClass( 'filter-parsed' ) ) {
+ arry[ arry.length ] = '' + cache.normalized[ rowIndex ][ column ];
+ // child row parsed data
+ if ( wo.filter_childRows && wo.filter_childByColumn ) {
+ childLen = cache.normalized[ rowIndex ][ c.columns ].$row.length - 1;
+ for ( indx = 0; indx < childLen; indx++ ) {
+ arry[ arry.length ] = '' + cache.normalized[ rowIndex ][ c.columns ].child[ indx ][ column ];
+ }
+ }
+ } else {
+ // get raw cached data instead of content directly from the cells
+ arry[ arry.length ] = cache.normalized[ rowIndex ][ c.columns ].raw[ column ];
+ // child row unparsed data
+ if ( wo.filter_childRows && wo.filter_childByColumn ) {
+ childLen = cache.normalized[ rowIndex ][ c.columns ].$row.length;
+ for ( indx = 1; indx < childLen; indx++ ) {
+ child = cache.normalized[ rowIndex ][ c.columns ].$row.eq( indx ).children().eq( column );
+ arry[ arry.length ] = '' + ts.getElementText( c, child, column );
+ }
+ }
+ }
+ }
+ }
+ return arry;
+ },
+ buildSelect: function( table, column, arry, updating, onlyAvail ) {
+ table = $( table )[0];
+ column = parseInt( column, 10 );
+ if ( !table.config.cache || $.isEmptyObject( table.config.cache ) ) {
+ return;
+ }
+
+ var indx, val, txt, t, $filters, $filter, option,
+ c = table.config,
+ wo = c.widgetOptions,
+ node = c.$headerIndexed[ column ],
+ // t.data( 'placeholder' ) won't work in jQuery older than 1.4.3
+ options = '<option value="">' +
+ ( node.data( 'placeholder' ) ||
+ node.attr( 'data-placeholder' ) ||
+ wo.filter_placeholder.select || ''
+ ) + '</option>',
+ // Get curent filter value
+ currentValue = c.$table
+ .find( 'thead' )
+ .find( 'select.' + tscss.filter + '[data-column="' + column + '"]' )
+ .val();
+
+ // nothing included in arry ( external source ), so get the options from
+ // filter_selectSource or column data
+ if ( typeof arry === 'undefined' || arry === '' ) {
+ arry = tsf.getOptionSource( table, column, onlyAvail );
+ // abort, selects are updated by an external method
+ if (arry === null) {
+ return;
+ }
+ }
+
+ if ( $.isArray( arry ) ) {
+ // build option list
+ for ( indx = 0; indx < arry.length; indx++ ) {
+ option = arry[ indx ];
+ if ( option.text ) {
+ // OBJECT!! add data-function-name in case the value is set in filter_functions
+ option['data-function-name'] = typeof option.value === 'undefined' ? option.text : option.value;
+
+ // support jQuery < v1.8, otherwise the below code could be shortened to
+ // options += $( '<option>', option )[ 0 ].outerHTML;
+ options += '<option';
+ for ( val in option ) {
+ if ( option.hasOwnProperty( val ) && val !== 'text' ) {
+ options += ' ' + val + '="' + option[ val ].replace( tsfRegex.quote, '&quot;' ) + '"';
+ }
+ }
+ if ( !option.value ) {
+ options += ' value="' + option.text.replace( tsfRegex.quote, '&quot;' ) + '"';
+ }
+ options += '>' + option.text.replace( tsfRegex.quote, '&quot;' ) + '</option>';
+ // above code is needed in jQuery < v1.8
+
+ // make sure we don't turn an object into a string (objects without a "text" property)
+ } else if ( '' + option !== '[object Object]' ) {
+ txt = option = ( '' + option ).replace( tsfRegex.quote, '&quot;' );
+ val = txt;
+ // allow including a symbol in the selectSource array
+ // 'a-z|A through Z' so that 'a-z' becomes the option value
+ // and 'A through Z' becomes the option text
+ if ( txt.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) {
+ t = txt.split( wo.filter_selectSourceSeparator );
+ val = t[0];
+ txt = t[1];
+ }
+ // replace quotes - fixes #242 & ignore empty strings
+ // see http://stackoverflow.com/q/14990971/145346
+ options += option !== '' ?
+ '<option ' +
+ ( val === txt ? '' : 'data-function-name="' + option + '" ' ) +
+ 'value="' + val + '">' + txt +
+ '</option>' : '';
+ }
+ }
+ // clear arry so it doesn't get appended twice
+ arry = [];
+ }
+
+ // update all selects in the same column ( clone thead in sticky headers &
+ // any external selects ) - fixes 473
+ $filters = ( c.$filters ? c.$filters : c.$table.children( 'thead' ) )
+ .find( '.' + tscss.filter );
+ if ( wo.filter_$externalFilters ) {
+ $filters = $filters && $filters.length ?
+ $filters.add( wo.filter_$externalFilters ) :
+ wo.filter_$externalFilters;
+ }
+ $filter = $filters.filter( 'select[data-column="' + column + '"]' );
+
+ // make sure there is a select there!
+ if ( $filter.length ) {
+ $filter[ updating ? 'html' : 'append' ]( options );
+ if ( !$.isArray( arry ) ) {
+ // append options if arry is provided externally as a string or jQuery object
+ // options ( default value ) was already added
+ $filter.append( arry ).val( currentValue );
+ }
+ $filter.val( currentValue );
+ }
+ },
+ buildDefault: function( table, updating ) {
+ var columnIndex, $header, noSelect,
+ c = table.config,
+ wo = c.widgetOptions,
+ columns = c.columns;
+ // build default select dropdown
+ for ( columnIndex = 0; columnIndex < columns; columnIndex++ ) {
+ $header = c.$headerIndexed[columnIndex];
+ noSelect = !( $header.hasClass( 'filter-false' ) || $header.hasClass( 'parser-false' ) );
+ // look for the filter-select class; build/update it if found
+ if ( ( $header.hasClass( 'filter-select' ) ||
+ ts.getColumnData( table, wo.filter_functions, columnIndex ) === true ) && noSelect ) {
+ tsf.buildSelect( table, columnIndex, '', updating, $header.hasClass( wo.filter_onlyAvail ) );
+ }
+ }
+ }
+ };
+
+ // filter regex variable
+ tsfRegex = tsf.regex;
+
+ ts.getFilters = function( table, getRaw, setFilters, skipFirst ) {
+ var i, $filters, $column, cols,
+ filters = [],
+ c = table ? $( table )[0].config : '',
+ wo = c ? c.widgetOptions : '';
+ if ( ( getRaw !== true && wo && !wo.filter_columnFilters ) ||
+ // setFilters called, but last search is exactly the same as the current
+ // fixes issue #733 & #903 where calling update causes the input values to reset
+ ( $.isArray(setFilters) && tsf.equalFilters(c, setFilters, c.lastSearch) )
+ ) {
+ return $( table ).data( 'lastSearch' ) || [];
+ }
+ if ( c ) {
+ if ( c.$filters ) {
+ $filters = c.$filters.find( '.' + tscss.filter );
+ }
+ if ( wo.filter_$externalFilters ) {
+ $filters = $filters && $filters.length ?
+ $filters.add( wo.filter_$externalFilters ) :
+ wo.filter_$externalFilters;
+ }
+ if ( $filters && $filters.length ) {
+ filters = setFilters || [];
+ for ( i = 0; i < c.columns + 1; i++ ) {
+ cols = ( i === c.columns ?
+ // 'all' columns can now include a range or set of columms ( data-column='0-2,4,6-7' )
+ wo.filter_anyColumnSelector + ',' + wo.filter_multipleColumnSelector :
+ '[data-column="' + i + '"]' );
+ $column = $filters.filter( cols );
+ if ( $column.length ) {
+ // move the latest search to the first slot in the array
+ $column = tsf.getLatestSearch( $column );
+ if ( $.isArray( setFilters ) ) {
+ // skip first ( latest input ) to maintain cursor position while typing
+ if ( skipFirst && $column.length > 1 ) {
+ $column = $column.slice( 1 );
+ }
+ if ( i === c.columns ) {
+ // prevent data-column='all' from filling data-column='0,1' ( etc )
+ cols = $column.filter( wo.filter_anyColumnSelector );
+ $column = cols.length ? cols : $column;
+ }
+ $column
+ .val( setFilters[ i ] )
+ // must include a namespace here; but not c.namespace + 'filter'?
+ .trigger( 'change' + c.namespace );
+ } else {
+ filters[i] = $column.val() || '';
+ // don't change the first... it will move the cursor
+ if ( i === c.columns ) {
+ // don't update range columns from 'all' setting
+ $column
+ .slice( 1 )
+ .filter( '[data-column*="' + $column.attr( 'data-column' ) + '"]' )
+ .val( filters[ i ] );
+ } else {
+ $column
+ .slice( 1 )
+ .val( filters[ i ] );
+ }
+ }
+ // save any match input dynamically
+ if ( i === c.columns && $column.length ) {
+ wo.filter_$anyMatch = $column;
+ }
+ }
+ }
+ }
+ }
+ return filters;
+ };
+
+ ts.setFilters = function( table, filter, apply, skipFirst ) {
+ var c = table ? $( table )[0].config : '',
+ valid = ts.getFilters( table, true, filter, skipFirst );
+ // default apply to "true"
+ if ( typeof apply === 'undefined' ) {
+ apply = true;
+ }
+ if ( c && apply ) {
+ // ensure new set filters are applied, even if the search is the same
+ c.lastCombinedFilter = null;
+ c.lastSearch = [];
+ tsf.searching( c.table, filter, skipFirst );
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ }
+ return valid.length !== 0;
+ };
+
+})( jQuery );
+
+/*! Widget: stickyHeaders - updated 9/27/2017 (v2.29.0) *//*
+ * Requires tablesorter v2.8+ and jQuery 1.4.3+
+ * by Rob Garrison
+ */
+;(function ($, window) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ $.extend(ts.css, {
+ sticky : 'tablesorter-stickyHeader', // stickyHeader
+ stickyVis : 'tablesorter-sticky-visible',
+ stickyHide: 'tablesorter-sticky-hidden',
+ stickyWrap: 'tablesorter-sticky-wrapper'
+ });
+
+ // Add a resize event to table headers
+ ts.addHeaderResizeEvent = function(table, disable, settings) {
+ table = $(table)[0]; // make sure we're using a dom element
+ if ( !table.config ) { return; }
+ var defaults = {
+ timer : 250
+ },
+ options = $.extend({}, defaults, settings),
+ c = table.config,
+ wo = c.widgetOptions,
+ checkSizes = function( triggerEvent ) {
+ var index, headers, $header, sizes, width, height,
+ len = c.$headers.length;
+ wo.resize_flag = true;
+ headers = [];
+ for ( index = 0; index < len; index++ ) {
+ $header = c.$headers.eq( index );
+ sizes = $header.data( 'savedSizes' ) || [ 0, 0 ]; // fixes #394
+ width = $header[0].offsetWidth;
+ height = $header[0].offsetHeight;
+ if ( width !== sizes[0] || height !== sizes[1] ) {
+ $header.data( 'savedSizes', [ width, height ] );
+ headers.push( $header[0] );
+ }
+ }
+ if ( headers.length && triggerEvent !== false ) {
+ c.$table.triggerHandler( 'resize', [ headers ] );
+ }
+ wo.resize_flag = false;
+ };
+ clearInterval(wo.resize_timer);
+ if (disable) {
+ wo.resize_flag = false;
+ return false;
+ }
+ checkSizes( false );
+ wo.resize_timer = setInterval(function() {
+ if (wo.resize_flag) { return; }
+ checkSizes();
+ }, options.timer);
+ };
+
+ function getStickyOffset(c, wo) {
+ var $el = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : [];
+ return $el.length ?
+ $el.height() || 0 :
+ parseInt(wo.stickyHeaders_offset, 10) || 0;
+ }
+
+ // Sticky headers based on this awesome article:
+ // http://css-tricks.com/13465-persistent-headers/
+ // and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
+ // **************************
+ ts.addWidget({
+ id: 'stickyHeaders',
+ priority: 54, // sticky widget must be initialized after the filter & before pager widget!
+ options: {
+ stickyHeaders : '', // extra class name added to the sticky header row
+ stickyHeaders_appendTo : null, // jQuery selector or object to phycially attach the sticky headers
+ stickyHeaders_attachTo : null, // jQuery selector or object to attach scroll listener to (overridden by xScroll & yScroll settings)
+ stickyHeaders_xScroll : null, // jQuery selector or object to monitor horizontal scroll position (defaults: xScroll > attachTo > window)
+ stickyHeaders_yScroll : null, // jQuery selector or object to monitor vertical scroll position (defaults: yScroll > attachTo > window)
+ stickyHeaders_offset : 0, // number or jquery selector targeting the position:fixed element
+ stickyHeaders_filteredToTop: true, // scroll table top into view after filtering
+ stickyHeaders_cloneId : '-sticky', // added to table ID, if it exists
+ stickyHeaders_addResizeEvent : true, // trigger 'resize' event on headers
+ stickyHeaders_includeCaption : true, // if false and a caption exist, it won't be included in the sticky header
+ stickyHeaders_zIndex : 2 // The zIndex of the stickyHeaders, allows the user to adjust this to their needs
+ },
+ format: function(table, c, wo) {
+ // filter widget doesn't initialize on an empty table. Fixes #449
+ if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
+ return;
+ }
+ var index, len, $t,
+ $table = c.$table,
+ // add position: relative to attach element, hopefully it won't cause trouble.
+ $attach = $(wo.stickyHeaders_attachTo || wo.stickyHeaders_appendTo),
+ namespace = c.namespace + 'stickyheaders ',
+ // element to watch for the scroll event
+ $yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window),
+ $xScroll = $(wo.stickyHeaders_xScroll || wo.stickyHeaders_attachTo || window),
+ $thead = $table.children('thead:first'),
+ $header = $thead.children('tr').not('.sticky-false').children(),
+ $tfoot = $table.children('tfoot'),
+ stickyOffset = getStickyOffset(c, wo),
+ // is this table nested? If so, find parent sticky header wrapper (div, not table)
+ $nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ?
+ $table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [],
+ nestedStickyTop = $nestedSticky.length ? $nestedSticky.height() : 0,
+ // clone table, then wrap to make sticky header
+ $stickyTable = wo.$sticky = $table.clone()
+ .addClass('containsStickyHeaders ' + ts.css.sticky + ' ' + wo.stickyHeaders + ' ' + c.namespace.slice(1) + '_extra_table' )
+ .wrap('<div class="' + ts.css.stickyWrap + '">'),
+ $stickyWrap = $stickyTable.parent()
+ .addClass(ts.css.stickyHide)
+ .css({
+ position : $attach.length ? 'absolute' : 'fixed',
+ padding : parseInt( $stickyTable.parent().parent().css('padding-left'), 10 ),
+ top : stickyOffset + nestedStickyTop,
+ left : 0,
+ visibility : 'hidden',
+ zIndex : wo.stickyHeaders_zIndex || 2
+ }),
+ $stickyThead = $stickyTable.children('thead:first'),
+ $stickyCells,
+ laststate = '',
+ setWidth = function($orig, $clone) {
+ var index, width, border, $cell, $this,
+ $cells = $orig.filter(':visible'),
+ len = $cells.length;
+ for ( index = 0; index < len; index++ ) {
+ $cell = $clone.filter(':visible').eq(index);
+ $this = $cells.eq(index);
+ // code from https://github.com/jmosbech/StickyTableHeaders
+ if ($this.css('box-sizing') === 'border-box') {
+ width = $this.outerWidth();
+ } else {
+ if ($cell.css('border-collapse') === 'collapse') {
+ if (window.getComputedStyle) {
+ width = parseFloat( window.getComputedStyle($this[0], null).width );
+ } else {
+ // ie8 only
+ border = parseFloat( $this.css('border-width') );
+ width = $this.outerWidth() - parseFloat( $this.css('padding-left') ) - parseFloat( $this.css('padding-right') ) - border;
+ }
+ } else {
+ width = $this.width();
+ }
+ }
+ $cell.css({
+ 'width': width,
+ 'min-width': width,
+ 'max-width': width
+ });
+ }
+ },
+ getLeftPosition = function(yWindow) {
+ if (yWindow === false && $nestedSticky.length) {
+ return $table.position().left;
+ }
+ return $attach.length ?
+ parseInt($attach.css('padding-left'), 10) || 0 :
+ $table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft();
+ },
+ resizeHeader = function() {
+ $stickyWrap.css({
+ left : getLeftPosition(),
+ width: $table.outerWidth()
+ });
+ setWidth( $table, $stickyTable );
+ setWidth( $header, $stickyCells );
+ },
+ scrollSticky = function( resizing ) {
+ if (!$table.is(':visible')) { return; } // fixes #278
+ // Detect nested tables - fixes #724
+ nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
+ var tmp,
+ offset = $table.offset(),
+ stickyOffset = getStickyOffset(c, wo),
+ yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
+ yScroll = yWindow ?
+ $yScroll.scrollTop() :
+ // use parent sticky position if nested AND inside of a scrollable element - see #1512
+ $nestedSticky.length ? parseInt($nestedSticky[0].style.top, 10) : $yScroll.offset().top,
+ attachTop = $attach.length ? yScroll : $yScroll.scrollTop(),
+ captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0,
+ scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight,
+ tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight,
+ isVisible = ( scrollTop > offset.top ) && ( scrollTop < offset.top + tableHeight ) ? 'visible' : 'hidden',
+ state = isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide,
+ needsUpdating = !$stickyWrap.hasClass( state ),
+ cssSettings = { visibility : isVisible };
+ if ($attach.length) {
+ // attached sticky headers always need updating
+ needsUpdating = true;
+ cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
+ }
+ // adjust when scrolling horizontally - fixes issue #143
+ tmp = getLeftPosition(yWindow);
+ if (tmp !== parseInt($stickyWrap.css('left'), 10)) {
+ needsUpdating = true;
+ cssSettings.left = tmp;
+ }
+ cssSettings.top = ( cssSettings.top || 0 ) +
+ // If nested AND inside of a scrollable element, only add parent sticky height
+ (!yWindow && $nestedSticky.length ? $nestedSticky.height() : stickyOffset + nestedStickyTop);
+ if (needsUpdating) {
+ $stickyWrap
+ .removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
+ .addClass( state )
+ .css(cssSettings);
+ }
+ if (isVisible !== laststate || resizing) {
+ // make sure the column widths match
+ resizeHeader();
+ laststate = isVisible;
+ }
+ };
+ // only add a position relative if a position isn't already defined
+ if ($attach.length && !$attach.css('position')) {
+ $attach.css('position', 'relative');
+ }
+ // fix clone ID, if it exists - fixes #271
+ if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; }
+ // clear out cloned table, except for sticky header
+ // include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing
+ $stickyTable.find('> thead:gt(0), tr.sticky-false').hide();
+ $stickyTable.find('> tbody, > tfoot').remove();
+ $stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption);
+ // issue #172 - find td/th in sticky header
+ $stickyCells = $stickyThead.children().children();
+ $stickyTable.css({ height:0, width:0, margin: 0 });
+ // remove resizable block
+ $stickyCells.find('.' + ts.css.resizer).remove();
+ // update sticky header class names to match real header after sorting
+ $table
+ .addClass('hasStickyHeaders')
+ .bind('pagerComplete' + namespace, function() {
+ resizeHeader();
+ });
+
+ ts.bindEvents(table, $stickyThead.children().children('.' + ts.css.header));
+
+ if (wo.stickyHeaders_appendTo) {
+ $(wo.stickyHeaders_appendTo).append( $stickyWrap );
+ } else {
+ // add stickyheaders AFTER the table. If the table is selected by ID, the original one (first) will be returned.
+ $table.after( $stickyWrap );
+ }
+
+ // onRenderHeader is defined, we need to do something about it (fixes #641)
+ if (c.onRenderHeader) {
+ $t = $stickyThead.children('tr').children();
+ len = $t.length;
+ for ( index = 0; index < len; index++ ) {
+ // send second parameter
+ c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] );
+ }
+ }
+ // make it sticky!
+ $xScroll.add($yScroll)
+ .unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') )
+ .bind('scroll resize '.split(' ').join( namespace ), function( event ) {
+ scrollSticky( event.type === 'resize' );
+ });
+ c.$table
+ .unbind('stickyHeadersUpdate' + namespace)
+ .bind('stickyHeadersUpdate' + namespace, function() {
+ scrollSticky( true );
+ });
+
+ if (wo.stickyHeaders_addResizeEvent) {
+ ts.addHeaderResizeEvent(table);
+ }
+
+ // look for filter widget
+ if ($table.hasClass('hasFilters') && wo.filter_columnFilters) {
+ // scroll table into view after filtering, if sticky header is active - #482
+ $table.bind('filterEnd' + namespace, function() {
+ // $(':focus') needs jQuery 1.6+
+ var $td = $(document.activeElement).closest('td'),
+ column = $td.parent().children().index($td);
+ // only scroll if sticky header is active
+ if ($stickyWrap.hasClass(ts.css.stickyVis) && wo.stickyHeaders_filteredToTop) {
+ // scroll to original table (not sticky clone)
+ window.scrollTo(0, $table.position().top);
+ // give same input/select focus; check if c.$filters exists; fixes #594
+ if (column >= 0 && c.$filters) {
+ c.$filters.eq(column).find('a, select, input').filter(':visible').focus();
+ }
+ }
+ });
+ ts.filter.bindSearch( $table, $stickyCells.find('.' + ts.css.filter) );
+ // support hideFilters
+ if (wo.filter_hideFilters) {
+ ts.filter.hideFilters(c, $stickyTable);
+ }
+ }
+
+ // resize table (Firefox)
+ if (wo.stickyHeaders_addResizeEvent) {
+ $table.bind('resize' + c.namespace + 'stickyheaders', function() {
+ resizeHeader();
+ });
+ }
+
+ // make sure sticky is visible if page is partially scrolled
+ scrollSticky( true );
+ $table.triggerHandler('stickyHeadersInit');
+
+ },
+ remove: function(table, c, wo) {
+ var namespace = c.namespace + 'stickyheaders ';
+ c.$table
+ .removeClass('hasStickyHeaders')
+ .unbind( ('pagerComplete resize filterEnd stickyHeadersUpdate '.split(' ').join(namespace)).replace(/\s+/g, ' ') )
+ .next('.' + ts.css.stickyWrap).remove();
+ if (wo.$sticky && wo.$sticky.length) { wo.$sticky.remove(); } // remove cloned table
+ $(window)
+ .add(wo.stickyHeaders_xScroll)
+ .add(wo.stickyHeaders_yScroll)
+ .add(wo.stickyHeaders_attachTo)
+ .unbind( ('scroll resize '.split(' ').join(namespace)).replace(/\s+/g, ' ') );
+ ts.addHeaderResizeEvent(table, true);
+ }
+ });
+
+})(jQuery, window);
+
+/*! Widget: resizable - updated 2018-03-26 (v2.30.2) */
+/*jshint browser:true, jquery:true, unused:false */
+;(function ($, window) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ $.extend(ts.css, {
+ resizableContainer : 'tablesorter-resizable-container',
+ resizableHandle : 'tablesorter-resizable-handle',
+ resizableNoSelect : 'tablesorter-disableSelection',
+ resizableStorage : 'tablesorter-resizable'
+ });
+
+ // Add extra scroller css
+ $(function() {
+ var s = '<style>' +
+ 'body.' + ts.css.resizableNoSelect + ' { -ms-user-select: none; -moz-user-select: -moz-none;' +
+ '-khtml-user-select: none; -webkit-user-select: none; user-select: none; }' +
+ '.' + ts.css.resizableContainer + ' { position: relative; height: 1px; }' +
+ // make handle z-index > than stickyHeader z-index, so the handle stays above sticky header
+ '.' + ts.css.resizableHandle + ' { position: absolute; display: inline-block; width: 8px;' +
+ 'top: 1px; cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }' +
+ '</style>';
+ $('head').append(s);
+ });
+
+ ts.resizable = {
+ init : function( c, wo ) {
+ if ( c.$table.hasClass( 'hasResizable' ) ) { return; }
+ c.$table.addClass( 'hasResizable' );
+
+ var noResize, $header, column, storedSizes, tmp,
+ $table = c.$table,
+ $parent = $table.parent(),
+ marginTop = parseInt( $table.css( 'margin-top' ), 10 ),
+
+ // internal variables
+ vars = wo.resizable_vars = {
+ useStorage : ts.storage && wo.resizable !== false,
+ $wrap : $parent,
+ mouseXPosition : 0,
+ $target : null,
+ $next : null,
+ overflow : $parent.css('overflow') === 'auto' ||
+ $parent.css('overflow') === 'scroll' ||
+ $parent.css('overflow-x') === 'auto' ||
+ $parent.css('overflow-x') === 'scroll',
+ storedSizes : []
+ };
+
+ // set default widths
+ ts.resizableReset( c.table, true );
+
+ // now get measurements!
+ vars.tableWidth = $table.width();
+ // attempt to autodetect
+ vars.fullWidth = Math.abs( $parent.width() - vars.tableWidth ) < 20;
+
+ /*
+ // Hacky method to determine if table width is set to 'auto'
+ // http://stackoverflow.com/a/20892048/145346
+ if ( !vars.fullWidth ) {
+ tmp = $table.width();
+ $header = $table.wrap('<span>').parent(); // temp variable
+ storedSizes = parseInt( $table.css( 'margin-left' ), 10 ) || 0;
+ $table.css( 'margin-left', storedSizes + 50 );
+ vars.tableWidth = $header.width() > tmp ? 'auto' : tmp;
+ $table.css( 'margin-left', storedSizes ? storedSizes : '' );
+ $header = null;
+ $table.unwrap('<span>');
+ }
+ */
+
+ if ( vars.useStorage && vars.overflow ) {
+ // save table width
+ ts.storage( c.table, 'tablesorter-table-original-css-width', vars.tableWidth );
+ tmp = ts.storage( c.table, 'tablesorter-table-resized-width' ) || 'auto';
+ ts.resizable.setWidth( $table, tmp, true );
+ }
+ wo.resizable_vars.storedSizes = storedSizes = ( vars.useStorage ?
+ ts.storage( c.table, ts.css.resizableStorage ) :
+ [] ) || [];
+ ts.resizable.setWidths( c, wo, storedSizes );
+ ts.resizable.updateStoredSizes( c, wo );
+
+ wo.$resizable_container = $( '<div class="' + ts.css.resizableContainer + '">' )
+ .css({ top : marginTop })
+ .insertBefore( $table );
+ // add container
+ for ( column = 0; column < c.columns; column++ ) {
+ $header = c.$headerIndexed[ column ];
+ tmp = ts.getColumnData( c.table, c.headers, column );
+ noResize = ts.getData( $header, tmp, 'resizable' ) === 'false';
+ if ( !noResize ) {
+ $( '<div class="' + ts.css.resizableHandle + '">' )
+ .appendTo( wo.$resizable_container )
+ .attr({
+ 'data-column' : column,
+ 'unselectable' : 'on'
+ })
+ .data( 'header', $header )
+ .bind( 'selectstart', false );
+ }
+ }
+ ts.resizable.bindings( c, wo );
+ },
+
+ updateStoredSizes : function( c, wo ) {
+ var column, $header,
+ len = c.columns,
+ vars = wo.resizable_vars;
+ vars.storedSizes = [];
+ for ( column = 0; column < len; column++ ) {
+ $header = c.$headerIndexed[ column ];
+ vars.storedSizes[ column ] = $header.is(':visible') ? $header.width() : 0;
+ }
+ },
+
+ setWidth : function( $el, width, overflow ) {
+ // overflow tables need min & max width set as well
+ $el.css({
+ 'width' : width,
+ 'min-width' : overflow ? width : '',
+ 'max-width' : overflow ? width : ''
+ });
+ },
+
+ setWidths : function( c, wo, storedSizes ) {
+ var column, $temp,
+ vars = wo.resizable_vars,
+ $extra = $( c.namespace + '_extra_headers' ),
+ $col = c.$table.children( 'colgroup' ).children( 'col' );
+ storedSizes = storedSizes || vars.storedSizes || [];
+ // process only if table ID or url match
+ if ( storedSizes.length ) {
+ for ( column = 0; column < c.columns; column++ ) {
+ // set saved resizable widths
+ ts.resizable.setWidth( c.$headerIndexed[ column ], storedSizes[ column ], vars.overflow );
+ if ( $extra.length ) {
+ // stickyHeaders needs to modify min & max width as well
+ $temp = $extra.eq( column ).add( $col.eq( column ) );
+ ts.resizable.setWidth( $temp, storedSizes[ column ], vars.overflow );
+ }
+ }
+ $temp = $( c.namespace + '_extra_table' );
+ if ( $temp.length && !ts.hasWidget( c.table, 'scroller' ) ) {
+ ts.resizable.setWidth( $temp, c.$table.outerWidth(), vars.overflow );
+ }
+ }
+ },
+
+ setHandlePosition : function( c, wo ) {
+ var startPosition,
+ tableHeight = c.$table.height(),
+ $handles = wo.$resizable_container.children(),
+ handleCenter = Math.floor( $handles.width() / 2 );
+
+ if ( ts.hasWidget( c.table, 'scroller' ) ) {
+ tableHeight = 0;
+ c.$table.closest( '.' + ts.css.scrollerWrap ).children().each(function() {
+ var $this = $(this);
+ // center table has a max-height set
+ tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
+ });
+ }
+
+ if ( !wo.resizable_includeFooter && c.$table.children('tfoot').length ) {
+ tableHeight -= c.$table.children('tfoot').height();
+ }
+ // subtract out table left position from resizable handles. Fixes #864
+ // jQuery v3.3.0+ appears to include the start position with the $header.position().left; see #1544
+ startPosition = parseFloat($.fn.jquery) >= 3.3 ? 0 : c.$table.position().left;
+ $handles.each( function() {
+ var $this = $(this),
+ column = parseInt( $this.attr( 'data-column' ), 10 ),
+ columns = c.columns - 1,
+ $header = $this.data( 'header' );
+ if ( !$header ) { return; } // see #859
+ if (
+ !$header.is(':visible') ||
+ ( !wo.resizable_addLastColumn && ts.resizable.checkVisibleColumns(c, column) )
+ ) {
+ $this.hide();
+ } else if ( column < columns || column === columns && wo.resizable_addLastColumn ) {
+ $this.css({
+ display: 'inline-block',
+ height : tableHeight,
+ left : $header.position().left - startPosition + $header.outerWidth() - handleCenter
+ });
+ }
+ });
+ },
+
+ // Fixes #1485
+ checkVisibleColumns: function( c, column ) {
+ var i,
+ len = 0;
+ for ( i = column + 1; i < c.columns; i++ ) {
+ len += c.$headerIndexed[i].is( ':visible' ) ? 1 : 0;
+ }
+ return len === 0;
+ },
+
+ // prevent text selection while dragging resize bar
+ toggleTextSelection : function( c, wo, toggle ) {
+ var namespace = c.namespace + 'tsresize';
+ wo.resizable_vars.disabled = toggle;
+ $( 'body' ).toggleClass( ts.css.resizableNoSelect, toggle );
+ if ( toggle ) {
+ $( 'body' )
+ .attr( 'unselectable', 'on' )
+ .bind( 'selectstart' + namespace, false );
+ } else {
+ $( 'body' )
+ .removeAttr( 'unselectable' )
+ .unbind( 'selectstart' + namespace );
+ }
+ },
+
+ bindings : function( c, wo ) {
+ var namespace = c.namespace + 'tsresize';
+ wo.$resizable_container.children().bind( 'mousedown', function( event ) {
+ // save header cell and mouse position
+ var column,
+ vars = wo.resizable_vars,
+ $extras = $( c.namespace + '_extra_headers' ),
+ $header = $( event.target ).data( 'header' );
+
+ column = parseInt( $header.attr( 'data-column' ), 10 );
+ vars.$target = $header = $header.add( $extras.filter('[data-column="' + column + '"]') );
+ vars.target = column;
+
+ // if table is not as wide as it's parent, then resize the table
+ vars.$next = event.shiftKey || wo.resizable_targetLast ?
+ $header.parent().children().not( '.resizable-false' ).filter( ':last' ) :
+ $header.nextAll( ':not(.resizable-false)' ).eq( 0 );
+
+ column = parseInt( vars.$next.attr( 'data-column' ), 10 );
+ vars.$next = vars.$next.add( $extras.filter('[data-column="' + column + '"]') );
+ vars.next = column;
+
+ vars.mouseXPosition = event.pageX;
+ ts.resizable.updateStoredSizes( c, wo );
+ ts.resizable.toggleTextSelection(c, wo, true );
+ });
+
+ $( document )
+ .bind( 'mousemove' + namespace, function( event ) {
+ var vars = wo.resizable_vars;
+ // ignore mousemove if no mousedown
+ if ( !vars.disabled || vars.mouseXPosition === 0 || !vars.$target ) { return; }
+ if ( wo.resizable_throttle ) {
+ clearTimeout( vars.timer );
+ vars.timer = setTimeout( function() {
+ ts.resizable.mouseMove( c, wo, event );
+ }, isNaN( wo.resizable_throttle ) ? 5 : wo.resizable_throttle );
+ } else {
+ ts.resizable.mouseMove( c, wo, event );
+ }
+ })
+ .bind( 'mouseup' + namespace, function() {
+ if (!wo.resizable_vars.disabled) { return; }
+ ts.resizable.toggleTextSelection( c, wo, false );
+ ts.resizable.stopResize( c, wo );
+ ts.resizable.setHandlePosition( c, wo );
+ });
+
+ // resizeEnd event triggered by scroller widget
+ $( window ).bind( 'resize' + namespace + ' resizeEnd' + namespace, function() {
+ ts.resizable.setHandlePosition( c, wo );
+ });
+
+ // right click to reset columns to default widths
+ c.$table
+ .bind( 'columnUpdate pagerComplete resizableUpdate '.split( ' ' ).join( namespace + ' ' ), function() {
+ ts.resizable.setHandlePosition( c, wo );
+ })
+ .bind( 'resizableReset' + namespace, function() {
+ ts.resizableReset( c.table );
+ })
+ .find( 'thead:first' )
+ .add( $( c.namespace + '_extra_table' ).find( 'thead:first' ) )
+ .bind( 'contextmenu' + namespace, function() {
+ // $.isEmptyObject() needs jQuery 1.4+; allow right click if already reset
+ var allowClick = wo.resizable_vars.storedSizes.length === 0;
+ ts.resizableReset( c.table );
+ ts.resizable.setHandlePosition( c, wo );
+ wo.resizable_vars.storedSizes = [];
+ return allowClick;
+ });
+
+ },
+
+ mouseMove : function( c, wo, event ) {
+ if ( wo.resizable_vars.mouseXPosition === 0 || !wo.resizable_vars.$target ) { return; }
+ // resize columns
+ var column,
+ total = 0,
+ vars = wo.resizable_vars,
+ $next = vars.$next,
+ tar = vars.storedSizes[ vars.target ],
+ leftEdge = event.pageX - vars.mouseXPosition;
+ if ( vars.overflow ) {
+ if ( tar + leftEdge > 0 ) {
+ vars.storedSizes[ vars.target ] += leftEdge;
+ ts.resizable.setWidth( vars.$target, vars.storedSizes[ vars.target ], true );
+ // update the entire table width
+ for ( column = 0; column < c.columns; column++ ) {
+ total += vars.storedSizes[ column ];
+ }
+ ts.resizable.setWidth( c.$table.add( $( c.namespace + '_extra_table' ) ), total );
+ }
+ if ( !$next.length ) {
+ // if expanding right-most column, scroll the wrapper
+ vars.$wrap[0].scrollLeft = c.$table.width();
+ }
+ } else if ( vars.fullWidth ) {
+ vars.storedSizes[ vars.target ] += leftEdge;
+ vars.storedSizes[ vars.next ] -= leftEdge;
+ ts.resizable.setWidths( c, wo );
+ } else {
+ vars.storedSizes[ vars.target ] += leftEdge;
+ ts.resizable.setWidths( c, wo );
+ }
+ vars.mouseXPosition = event.pageX;
+ // dynamically update sticky header widths
+ c.$table.triggerHandler('stickyHeadersUpdate');
+ },
+
+ stopResize : function( c, wo ) {
+ var vars = wo.resizable_vars;
+ ts.resizable.updateStoredSizes( c, wo );
+ if ( vars.useStorage ) {
+ // save all column widths
+ ts.storage( c.table, ts.css.resizableStorage, vars.storedSizes );
+ ts.storage( c.table, 'tablesorter-table-resized-width', c.$table.width() );
+ }
+ vars.mouseXPosition = 0;
+ vars.$target = vars.$next = null;
+ // will update stickyHeaders, just in case, see #912
+ c.$table.triggerHandler('stickyHeadersUpdate');
+ c.$table.triggerHandler('resizableComplete');
+ }
+ };
+
+ // this widget saves the column widths if
+ // $.tablesorter.storage function is included
+ // **************************
+ ts.addWidget({
+ id: 'resizable',
+ priority: 40,
+ options: {
+ resizable : true, // save column widths to storage
+ resizable_addLastColumn : false,
+ resizable_includeFooter: true,
+ resizable_widths : [],
+ resizable_throttle : false, // set to true (5ms) or any number 0-10 range
+ resizable_targetLast : false
+ },
+ init: function(table, thisWidget, c, wo) {
+ ts.resizable.init( c, wo );
+ },
+ format: function( table, c, wo ) {
+ ts.resizable.setHandlePosition( c, wo );
+ },
+ remove: function( table, c, wo, refreshing ) {
+ if (wo.$resizable_container) {
+ var namespace = c.namespace + 'tsresize';
+ c.$table.add( $( c.namespace + '_extra_table' ) )
+ .removeClass('hasResizable')
+ .children( 'thead' )
+ .unbind( 'contextmenu' + namespace );
+
+ wo.$resizable_container.remove();
+ ts.resizable.toggleTextSelection( c, wo, false );
+ ts.resizableReset( table, refreshing );
+ $( document ).unbind( 'mousemove' + namespace + ' mouseup' + namespace );
+ }
+ }
+ });
+
+ ts.resizableReset = function( table, refreshing ) {
+ $( table ).each(function() {
+ var index, $t,
+ c = this.config,
+ wo = c && c.widgetOptions,
+ vars = wo.resizable_vars;
+ if ( table && c && c.$headerIndexed.length ) {
+ // restore the initial table width
+ if ( vars.overflow && vars.tableWidth ) {
+ ts.resizable.setWidth( c.$table, vars.tableWidth, true );
+ if ( vars.useStorage ) {
+ ts.storage( table, 'tablesorter-table-resized-width', vars.tableWidth );
+ }
+ }
+ for ( index = 0; index < c.columns; index++ ) {
+ $t = c.$headerIndexed[ index ];
+ if ( wo.resizable_widths && wo.resizable_widths[ index ] ) {
+ ts.resizable.setWidth( $t, wo.resizable_widths[ index ], vars.overflow );
+ } else if ( !$t.hasClass( 'resizable-false' ) ) {
+ // don't clear the width of any column that is not resizable
+ ts.resizable.setWidth( $t, '', vars.overflow );
+ }
+ }
+
+ // reset stickyHeader widths
+ c.$table.triggerHandler( 'stickyHeadersUpdate' );
+ if ( ts.storage && !refreshing ) {
+ ts.storage( this, ts.css.resizableStorage, [] );
+ }
+ }
+ });
+ };
+
+})( jQuery, window );
+
+/*! Widget: saveSort - updated 2018-03-19 (v2.30.1) *//*
+* Requires tablesorter v2.16+
+* by Rob Garrison
+*/
+;(function ($) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ function getStoredSortList(c) {
+ var stored = ts.storage( c.table, 'tablesorter-savesort' );
+ return (stored && stored.hasOwnProperty('sortList') && $.isArray(stored.sortList)) ? stored.sortList : [];
+ }
+
+ function sortListChanged(c, sortList) {
+ return (sortList || getStoredSortList(c)).join(',') !== c.sortList.join(',');
+ }
+
+ // this widget saves the last sort only if the
+ // saveSort widget option is true AND the
+ // $.tablesorter.storage function is included
+ // **************************
+ ts.addWidget({
+ id: 'saveSort',
+ priority: 20,
+ options: {
+ saveSort : true
+ },
+ init: function(table, thisWidget, c, wo) {
+ // run widget format before all other widgets are applied to the table
+ thisWidget.format(table, c, wo, true);
+ },
+ format: function(table, c, wo, init) {
+ var time,
+ $table = c.$table,
+ saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true
+ sortList = { 'sortList' : c.sortList },
+ debug = ts.debug(c, 'saveSort');
+ if (debug) {
+ time = new Date();
+ }
+ if ($table.hasClass('hasSaveSort')) {
+ if (saveSort && table.hasInitialized && ts.storage && sortListChanged(c)) {
+ ts.storage( table, 'tablesorter-savesort', sortList );
+ if (debug) {
+ console.log('saveSort >> Saving last sort: ' + c.sortList + ts.benchmark(time));
+ }
+ }
+ } else {
+ // set table sort on initial run of the widget
+ $table.addClass('hasSaveSort');
+ sortList = '';
+ // get data
+ if (ts.storage) {
+ sortList = getStoredSortList(c);
+ if (debug) {
+ console.log('saveSort >> Last sort loaded: "' + sortList + '"' + ts.benchmark(time));
+ }
+ $table.bind('saveSortReset', function(event) {
+ event.stopPropagation();
+ ts.storage( table, 'tablesorter-savesort', '' );
+ });
+ }
+ // init is true when widget init is run, this will run this widget before all other widgets have initialized
+ // this method allows using this widget in the original tablesorter plugin; but then it will run all widgets twice.
+ if (init && sortList && sortList.length > 0) {
+ c.sortList = sortList;
+ } else if (table.hasInitialized && sortList && sortList.length > 0) {
+ // update sort change
+ if (sortListChanged(c, sortList)) {
+ ts.sortOn(c, sortList);
+ }
+ }
+ }
+ },
+ remove: function(table, c) {
+ c.$table.removeClass('hasSaveSort');
+ // clear storage
+ if (ts.storage) { ts.storage( table, 'tablesorter-savesort', '' ); }
+ }
+ });
+
+})(jQuery);
+return jQuery.tablesorter;}));
diff --git a/parsers/parser-network.js b/parsers/parser-network.js
index 7175578..148f53a 100644
--- a/parsers/parser-network.js
+++ b/parsers/parser-network.js
@@ -1,7 +1,7 @@
-/*! Parser: network - updated 5/17/2015 (v2.22.0) */
+/*! Parser: network - updated 2018-01-10 (v2.29.3) */
/* IPv4, IPv6 and MAC Addresses */
/*global jQuery: false */
-;(function($){
+;(function($) {
'use strict';
var ts = $.tablesorter,
@@ -23,32 +23,37 @@
ipv6Validate : /^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/i
});
+ // used for internal testing; it's not useful to set this to true because the natural sort algorithm
+ // is set up to only sort solitary hex values ("ffff") vs separated hex values ("ffff.ffff")
+ ts.defaults.ipv6HexFormat = false;
+
ts.addParser({
id: 'ipv6Address',
is: function(s) {
return ts.regex.ipv6Validate.test(s);
},
format: function(address, table) {
- // code modified from http://forrst.com/posts/JS_Expand_Abbreviated_IPv6_Addresses-1OR
+ // code modified from http://zurb.com/forrst/posts/JS_Expand_Abbreviated_IPv6_Addresses-1OR
+ // Saved to https://gist.github.com/Mottie/7018157
var i, t, sides, groups, groupsPresent,
hex = table ? (typeof table === 'boolean' ? table : table && table.config.ipv6HexFormat || false) : false,
fullAddress = '',
expandedAddress = '',
- validGroupCount = 8,
- validGroupSize = 4;
+ validGroupCount = 8;
+ // validGroupSize = 4; <- removed while loop
// remove any extra spaces
address = address.replace(/\s*/g, '');
// look for embedded ipv4
if (ts.regex.ipv4Validate.test(address)) {
groups = address.match(ts.regex.ipv4Extract);
t = '';
- for (i = 1; i < groups.length; i++){
+ for (i = 1; i < groups.length; i++) {
t += ('00' + (parseInt(groups[i], 10).toString(16)) ).slice(-2) + ( i === 2 ? ':' : '' );
}
address = address.replace( ts.regex.ipv4Extract, t );
}
- if (address.indexOf('::') == -1) {
+ if (address.indexOf('::') === -1) {
// All eight groups are present
fullAddress = address;
} else {
@@ -69,12 +74,12 @@
// it's fastest & easiest for tablesorter to sort decimal values (vs hex)
groups[i] = hex ? ('0000' + groups[i]).slice(-4) :
('00000' + (parseInt(groups[i], 16) || 0)).slice(-5);
- expandedAddress += ( i != validGroupCount-1) ? groups[i] + ':' : groups[i];
+ expandedAddress += ( i !== validGroupCount - 1) ? groups[i] + ':' : groups[i];
}
- return hex ? expandedAddress : expandedAddress.replace(/:/g, '');
+ return expandedAddress;
},
// uses natural sort hex compare
- type: 'numeric'
+ type: 'text'
});
// ipv4 address
@@ -82,14 +87,15 @@
ipv4Is = function(s) {
return (/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/).test(s);
};
- ipv4Format = function(s, table) {
- var i, a = s ? s.split('.') : '',
- r = '',
+ ipv4Format = function(s) {
+ var i,
+ a = s ? s.split('.') : '',
+ r = [],
l = a.length;
for (i = 0; i < l; i++) {
- r += ('000' + a[i]).slice(-3);
+ r.push(('000' + a[i]).slice(-3));
}
- return s ? ts.formatFloat(r, table) : s;
+ return s ? r.join('.') : s;
};
/*! Parser: ipv4Address (a.k.a. ipAddress) */
@@ -98,13 +104,13 @@
id: 'ipAddress',
is: ipv4Is,
format: ipv4Format,
- type: 'numeric'
+ type: 'text'
});
ts.addParser({
id: 'ipv4Address',
is: ipv4Is,
format: ipv4Format,
- type: 'numeric'
+ type: 'text'
});
/*! Parser: MAC address */
@@ -112,26 +118,26 @@
*/
ts.addParser({
id : 'MAC',
- is : function( str ) {
+ is : function() {
return false;
},
format : function( str ) {
var indx, len,
- mac = '',
+ mac = [],
val = ( str || '' ).replace( /[:.-]/g, '' ).match( /\w{2}/g );
if ( val ) {
// not assuming all mac addresses in the column will end up with six
// groups of two to process, so it's not actually validating the address
len = val.length;
for ( indx = 0; indx < len; indx++ ) {
- mac += ( '000' + parseInt( val[ indx ], 16 ) ).slice( -3 );
+ mac.push(( '000' + parseInt( val[ indx ], 16 ) ).slice( -3 ));
}
- return mac;
+ return mac.join('.');
}
return str;
},
// uses natural sort hex compare
- type : 'numeric'
+ type : 'text'
});
})( jQuery );
diff --git a/tablesorter/first.png b/tablesorter/first.png
index 6f11fcb..7e505d6 100644
--- a/tablesorter/first.png
+++ b/tablesorter/first.png
Binary files differ
diff --git a/tablesorter/jquery.tablesorter.pager.css b/tablesorter/jquery.tablesorter.pager.css
index e77cd88..da4f2cc 100644
--- a/tablesorter/jquery.tablesorter.pager.css
+++ b/tablesorter/jquery.tablesorter.pager.css
@@ -39,4 +39,4 @@ td.tablesorter-pager {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default;
-} \ No newline at end of file
+}
diff --git a/tablesorter/last.png b/tablesorter/last.png
index 7207935..41e248c 100644
--- a/tablesorter/last.png
+++ b/tablesorter/last.png
Binary files differ
diff --git a/tablesorter/next.png b/tablesorter/next.png
index 4a2f9d4..aebf14d 100644
--- a/tablesorter/next.png
+++ b/tablesorter/next.png
Binary files differ
diff --git a/tablesorter/prev.png b/tablesorter/prev.png
index 15d1584..7d1d049 100644
--- a/tablesorter/prev.png
+++ b/tablesorter/prev.png
Binary files differ
diff --git a/tablesorter/theme.black-ice.css b/tablesorter/theme.black-ice.css
index 1bf253d..51cde9f 100644
--- a/tablesorter/theme.black-ice.css
+++ b/tablesorter/theme.black-ice.css
@@ -117,7 +117,7 @@
}
/* caption */
-caption {
+.tablesorter-blackice > caption {
background-color: #fff;
}
diff --git a/tablesorter/theme.blue.css b/tablesorter/theme.blue.css
index 66d6e58..da90a81 100644
--- a/tablesorter/theme.blue.css
+++ b/tablesorter/theme.blue.css
@@ -154,7 +154,7 @@
}
/* caption */
-caption {
+.tablesorter-blue > caption {
background-color: #fff;
}
diff --git a/tablesorter/theme.bootstrap.css b/tablesorter/theme.bootstrap.css
index 11a3ea7..60cc60c 100644
--- a/tablesorter/theme.bootstrap.css
+++ b/tablesorter/theme.bootstrap.css
@@ -1,7 +1,9 @@
-/*************
- Bootstrap theme
- *************/
-/* jQuery Bootstrap Theme */
+/**
+ * Bootstrap theme v3.x
+ *
+ * WARNING!... once a stable Bootstrap v4.x is released,
+ * this file will be removed; use theme.bootstrap_3.css
+ */
.tablesorter-bootstrap {
width: 100%;
}
@@ -19,11 +21,21 @@
.tablesorter-bootstrap .tablesorter-header {
cursor: pointer;
}
+.tablesorter-bootstrap .sorter-false {
+ cursor: default;
+}
+
+.tablesorter-bootstrap .tablesorter-header.sorter-false i.tablesorter-icon {
+ display: none;
+}
.tablesorter-bootstrap .tablesorter-header-inner {
position: relative;
padding: 4px 18px 4px 4px;
}
+.tablesorter-bootstrap .sorter-false .tablesorter-header-inner {
+ padding: 4px;
+}
/* bootstrap uses <i> for icons */
.tablesorter-bootstrap .tablesorter-header i.tablesorter-icon {
@@ -41,12 +53,12 @@
/* black unsorted icon */
.tablesorter-bootstrap .bootstrap-icon-unsorted {
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAMAAADOvxanAAAAVFBMVEUAAABCQkJZWVkZGRnJyckgICAZGRkZGRn8/PweHh4dHR0aGhoaGhpUVFQbGxvQ0NDc3NxMTExSUlIbGxvr6+s4ODhKSkogICAtLS00NDQzMzMnJydSEPrQAAAAGHRSTlMA1ssZRLgdAQbDyisqsZo8QdXUq0r9xPepSRwiAAAAX0lEQVQI13XHSQKAIAwEwQAKxn13Ev7/T2Pu9qmarJKPXIicI4PH4hxaKNrhm2S8bJK5h4YzKHrzJNtK6yYT/TdXzpS5zuYg4MSQYF6i4IHExdw1UVRi05HPrrvT53a+qyMFC9t04gcAAAAASUVORK5CYII=);
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAAA20lEQVR4AWJABpKSkoxALCstLb0aUAsZaCAMhVEY6B0amx8YZWDDEDSBa2AGe7XeIiAAClYwVGBvsAcIllsf/mvcC9DgOOd8h90fxWvngVEUbZIkuWRZZlE8eQjcisgZMM9zi+LJ6ZfwegmWZflZDugdHMfxTcGqql7TNBlUB/QObtv2VBSFrev6OY7jngzFk9OT/fn73fWYpqnlXNyXDMWT0zuYx/Bvel9ej+LJ6R08DMOu67q7DkTkrSA5vYPneV71fX/QASdTkJwezhs0TfMARn0wMDDGXEPgF4oijqwM5YjNAAAAAElFTkSuQmCC);
}
-/* white unsorted icon */
-.tablesorter-bootstrap .icon-white.bootstrap-icon-unsorted {
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOBAMAAAALT/umAAAAKlBMVEUAAAD///////////////////////////////////////////////////+Gu8ovAAAADXRSTlMA4EXKBtQqvR0+sxmalc142gAAAFdJREFUCNdjYGDoamAAAjZbMxCVfvd6AgMDd+3du9UMDKx3hWSvMjBwXZww8RYDGuC53NB8h4GB8a617UUGBs7Yu3cjGRhYVO9eVQFKOskKOQApFmUgBwBZ+xXRTttNdAAAAABJRU5ErkJggg==);
+/* white unsorted icon; updated to use bootstrap-icon-white - see #1432 */
+.tablesorter-bootstrap .bootstrap-icon-white.bootstrap-icon-unsorted {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAAAe0lEQVR4AbXQoRWDMBiF0Sh2QLAAQ8SxJGugWSA6A2STW1PxTsnB9cnkfuYvv8OGC1t5G3Y0QMP+Bm857keAdQIzWBP3+Bw4MADQE18B6/etRnCV/w9nnGuLezfAmXhABGtAGIkruvk6auIFRwQJDywllsEAjCecB20GP59BQQ+gtlRLAAAAAElFTkSuQmCC);
}
/* since bootstrap (table-striped) uses nth-child(), we just use this to add a zebra stripe color */
@@ -73,8 +85,31 @@
background-repeat: no-repeat !important;
}
+/* Column Widget - column sort colors */
+.tablesorter-bootstrap > tbody > tr.odd td.primary {
+ background-color: #bfbfbf;
+}
+.tablesorter-bootstrap > tbody > tr td.primary,
+.tablesorter-bootstrap > tbody > tr.even td.primary {
+ background-color: #d9d9d9;
+}
+.tablesorter-bootstrap > tbody > tr.odd td.secondary {
+ background-color: #d9d9d9;
+}
+.tablesorter-bootstrap > tbody > tr td.secondary,
+.tablesorter-bootstrap > tbody > tr.even td.secondary {
+ background-color: #e6e6e6;
+}
+.tablesorter-bootstrap > tbody > tr.odd td.tertiary {
+ background-color: #e6e6e6;
+}
+.tablesorter-bootstrap > tbody > tr td.tertiary,
+.tablesorter-bootstrap > tbody > tr.even td.tertiary {
+ background-color: #f2f2f2;
+}
+
/* caption */
-.caption {
+.tablesorter-bootstrap > .caption {
background-color: #fff;
}
@@ -133,7 +168,7 @@
opacity: 0;
filter: alpha(opacity=0);
}
-/* rows hidden by filtering (needed for child rows) */
+/* rows hidden by filtering */
.tablesorter .filtered {
display: none;
}
diff --git a/tablesorter/theme.bootstrap_2.css b/tablesorter/theme.bootstrap_2.css
index fe0665b..2d49ba4 100644
--- a/tablesorter/theme.bootstrap_2.css
+++ b/tablesorter/theme.bootstrap_2.css
@@ -1,7 +1,6 @@
-/*************
- Bootstrap 2 Theme
- *************/
-/* jQuery Bootstrap 2 Theme */
+/**
+ * Bootstrap theme v2.x
+ */
.tablesorter-bootstrap {
width: 100%;
}
@@ -31,11 +30,20 @@
.tablesorter-bootstrap .tablesorter-header {
cursor: pointer;
}
+.tablesorter-bootstrap .sorter-false {
+ cursor: default;
+}
+.tablesorter-bootstrap .tablesorter-header.sorter-false i.tablesorter-icon {
+ display: none;
+}
.tablesorter-bootstrap .tablesorter-header-inner {
position: relative;
padding: 4px 18px 4px 4px;
}
+.tablesorter-bootstrap .sorter-false .tablesorter-header-inner {
+ padding: 4px;
+}
/* bootstrap uses <i> for icons */
.tablesorter-bootstrap .tablesorter-header i.tablesorter-icon {
@@ -52,12 +60,12 @@
/* black unsorted icon */
.tablesorter-bootstrap .bootstrap-icon-unsorted {
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWVJREFUeNqUUL9Lw2AUTGP8mqGlpBQkNeCSRcckEBcHq1jImMElToKuDvpHFMGhU0BQcHBwLji6CE1B4uB/INQsDi4d2jQ/fPeZxo764OV6915f7lLJ81xot9tCURXqdVEUr7IsO6ffH9Q5BlEUCaLwWxWqTcbYnaIoh0Dw4gAvcWlxq1qt9hqNxg6hUGAP+uIPUrGs0qXLer2+v/pTX6QpxLtkc2U2m53ACb8sSdIDXerSEms2m6+DweAICA4d89KGbduf9MpEVdXQ9/2LVqv1CASHjjn3iq/x1xKFfxQPqGnada1W86bT6SiO42OS3qk3KPStLMvbk8nkfjwen/LLuq6blFymMB0KdUPSGhAcOualjX6/f0bCiC7NaWGPQr0BwaFjzn0gYJqmLAiCA8/zni3LmhuGkQPBoWPOPwQeaPIqD4fDruu6L6Zp5kBw6IudchmdJAkLw3DXcZwnIPjy/FuAAQCiqqWWCAFKcwAAAABJRU5ErkJggg==);
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAABGUlEQVR4AZWQAUfEYBzGC07fILfrbnfgqG1jmxliDitmYIaxb9Y3CEIEVHDaUGMfYF8gIyBqbd7eH7wWofB6/J7nN+x/IIRQbz6fH8p3slgsrkl4uv8QNU071XX9wTAMQcLTD6bi2WazubUsq3ddV5AwPftU1tbr9Z0UPhGDIHgjYXp2JS+Xy71t2wNCFEV113UxCdOzKznLshvf9z+SJHlp23ZHR8L07Er+6/u/LO96td1u3zmX/BmdjoTp2ZUchmHted4o/16sVqt7KR6TMD27kpumOc/z/EkOvWmaQp7rlYTp2ZU8juOsqqqLoij2UvhyHEeQMD27knl93x+VZXmZpukz9yVh+l+vMQzDrK7rXRzHjyQ83b8BlglBGLw1Kb4AAAAASUVORK5CYII=);
}
/* white unsorted icon */
.tablesorter-bootstrap .icon-white.bootstrap-icon-unsorted {
- background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOBAMAAAALT/umAAAAKlBMVEUAAAD///////////////////////////////////////////////////+Gu8ovAAAADXRSTlMA4EXKBtQqvR0+sxmalc142gAAAFdJREFUCNdjYGDoamAAAjZbMxCVfvd6AgMDd+3du9UMDKx3hWSvMjBwXZww8RYDGuC53NB8h4GB8a617UUGBs7Yu3cjGRhYVO9eVQFKOskKOQApFmUgBwBZ+xXRTttNdAAAAABJRU5ErkJggg==);
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAAAe0lEQVR4AbXQoRWDMBiF0Sh2QLAAQ8SxJGugWSA6A2STW1PxTsnB9cnkfuYvv8OGC1t5G3Y0QMP+Bm857keAdQIzWBP3+Bw4MADQE18B6/etRnCV/w9nnGuLezfAmXhABGtAGIkruvk6auIFRwQJDywllsEAjCecB20GP59BQQ+gtlRLAAAAAElFTkSuQmCC);
}
/* since bootstrap (table-striped) uses nth-child(), we just use this to add a zebra stripe color */
@@ -80,8 +88,31 @@
z-index: 1000;
}
+/* Column Widget - column sort colors */
+.tablesorter-bootstrap > tbody > tr.odd td.primary {
+ background-color: #bfbfbf;
+}
+.tablesorter-bootstrap > tbody > tr td.primary,
+.tablesorter-bootstrap > tbody > tr.even td.primary {
+ background-color: #d9d9d9;
+}
+.tablesorter-bootstrap > tbody > tr.odd td.secondary {
+ background-color: #d9d9d9;
+}
+.tablesorter-bootstrap > tbody > tr td.secondary,
+.tablesorter-bootstrap > tbody > tr.even td.secondary {
+ background-color: #e6e6e6;
+}
+.tablesorter-bootstrap > tbody > tr.odd td.tertiary {
+ background-color: #e6e6e6;
+}
+.tablesorter-bootstrap > tbody > tr td.tertiary,
+.tablesorter-bootstrap > tbody > tr.even td.tertiary {
+ background-color: #f2f2f2;
+}
+
/* caption */
-caption {
+.tablesorter-bootstrap > caption {
background-color: #fff;
}
@@ -136,7 +167,7 @@ caption {
opacity: 0;
filter: alpha(opacity=0);
}
-/* rows hidden by filtering (needed for child rows) */
+/* rows hidden by filtering */
.tablesorter .filtered {
display: none;
}
@@ -154,4 +185,4 @@ caption {
text-align: center;
cursor: pointer;
background-color: #e6bf99;
-} \ No newline at end of file
+}
diff --git a/tablesorter/theme.dark.css b/tablesorter/theme.dark.css
index 3ddbf61..91c0660 100644
--- a/tablesorter/theme.dark.css
+++ b/tablesorter/theme.dark.css
@@ -116,7 +116,7 @@
}
/* caption */
-caption {
+.tablesorter-dark > caption {
background-color: #202020;
}
diff --git a/tablesorter/theme.default.css b/tablesorter/theme.default.css
index 6c2a346..f3d271d 100644
--- a/tablesorter/theme.default.css
+++ b/tablesorter/theme.default.css
@@ -118,7 +118,7 @@ Default Theme
}
/* caption */
-caption {
+.tablesorter-default > caption {
background-color: #fff;
}
diff --git a/tablesorter/theme.dropbox.css b/tablesorter/theme.dropbox.css
index c173032..300db96 100644
--- a/tablesorter/theme.dropbox.css
+++ b/tablesorter/theme.dropbox.css
@@ -79,10 +79,8 @@
cursor: default;
}
-.tablesorter-dropbox thead .sorter-false i.tablesorter-icon,
-.tablesorter-dropbox thead .sorter-false:hover i.tablesorter-icon {
- background-image: none;
- padding: 4px;
+.tablesorter-dropbox thead .sorter-false i.tablesorter-icon {
+ display: none;
}
/* tbody */
@@ -140,7 +138,7 @@
}
/* caption */
-caption {
+.tablesorter-dropbox > caption {
background-color: #fff;
}
diff --git a/tablesorter/theme.green.css b/tablesorter/theme.green.css
index 32a0f3c..f6f1f4c 100644
--- a/tablesorter/theme.green.css
+++ b/tablesorter/theme.green.css
@@ -137,7 +137,7 @@
}
/* caption */
-caption {
+.tablesorter-green > caption {
background-color: #fff;
}
diff --git a/tablesorter/theme.grey.css b/tablesorter/theme.grey.css
index fdb3d9b..a0baaee 100644
--- a/tablesorter/theme.grey.css
+++ b/tablesorter/theme.grey.css
@@ -85,8 +85,7 @@
cursor: default;
}
.tablesorter-grey thead .sorter-false i.tablesorter-icon {
- background-image: none;
- padding: 4px;
+ display: none;
}
/* tfoot */
@@ -177,7 +176,7 @@
}
/* caption */
-caption {
+.tablesorter-grey > caption {
background-color: #fff;
}
diff --git a/tablesorter/theme.ice.css b/tablesorter/theme.ice.css
index 0b406de..bffa0ac 100644
--- a/tablesorter/theme.ice.css
+++ b/tablesorter/theme.ice.css
@@ -137,7 +137,7 @@
}
/* caption */
-caption {
+.tablesorter-ice > caption {
background-color: #fff;
}
diff --git a/tablesorter/theme.jui.css b/tablesorter/theme.jui.css
index aa1309b..6dd9bac 100644
--- a/tablesorter/theme.jui.css
+++ b/tablesorter/theme.jui.css
@@ -89,7 +89,7 @@
}
/* caption */
-.tablesorter-jui caption {
+.tablesorter-jui > caption {
border: 0;
}
diff --git a/widgets/widget-pager.js b/widgets/widget-pager.js
index efd5bb2..362e77b 100644
--- a/widgets/widget-pager.js
+++ b/widgets/widget-pager.js
@@ -1,6 +1,1375 @@
-/*! Widget: Pager - updated 5/17/2015 (v2.22.0) */
+/*! Widget: Pager - updated 2018-08-27 (v2.31.0) */
/* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
/*jshint browser:true, jquery:true, unused:false */
-!function(e){"use strict";var a,t=e.tablesorter;t.addWidget({id:"pager",priority:55,options:{pager_output:"{startRow} to {endRow} of {totalRows} rows",pager_updateArrows:!0,pager_startPage:0,pager_pageReset:0,pager_size:10,pager_maxOptionSize:20,pager_savePages:!0,pager_storageKey:"tablesorter-pager",pager_fixedHeight:!1,pager_countChildRows:!1,pager_removeRows:!1,pager_ajaxUrl:null,pager_customAjaxUrl:function(e,a){return a},pager_ajaxObject:{dataType:"json"},pager_processAjaxOnInit:!0,pager_ajaxProcessing:function(){return[0,[],null]},pager_css:{container:"tablesorter-pager",errorRow:"tablesorter-errorRow",disabled:"disabled"},pager_selectors:{container:".pager",first:".first",prev:".prev",next:".next",last:".last",gotoPage:".gotoPage",pageDisplay:".pagedisplay",pageSize:".pagesize"}},init:function(e){a.init(e)},format:function(e,t){return t.pager&&t.pager.initialized?void a.moveToPage(e,t.pager,!1):a.initComplete(e,t)},remove:function(e,t,i,r){a.destroyPager(e,t,r)}}),a=t.pager={init:function(i){if(!i.hasInitialized||!i.config.pager.initialized){var r,s=i.config,o=s.widgetOptions,g=o.pager_selectors,n=s.pager=e.extend({totalPages:0,filteredRows:0,filteredPages:0,currentFilters:[],page:o.pager_startPage,startRow:0,endRow:0,ajaxCounter:0,$size:null,last:{},setSize:o.pager_size,setPage:o.pager_startPage,events:"filterInit filterStart filterEnd sortEnd disable enable destroy updateComplete pageSize pageSet pageAndSize pagerUpdate refreshComplete "},s.pager);n.isInitializing||(n.isInitializing=!0,s.debug&&t.log("Pager: Initializing"),n.size=e.data(i,"pagerLastSize")||o.pager_size,n.$container=e(g.container).addClass(o.pager_css.container).show(),n.$goto=n.$container.find(g.gotoPage),n.$size=n.$container.find(g.pageSize),n.totalRows=s.$tbodies.eq(0).children("tr").not(o.pager_countChildRows?"":"."+s.cssChildRow).length,n.oldAjaxSuccess=n.oldAjaxSuccess||o.pager_ajaxObject.success,s.appender=a.appender,n.initializing=!0,o.pager_savePages&&t.storage&&(r=t.storage(i,o.pager_storageKey)||{},n.page=(isNaN(r.page)?n.page:r.page)||n.setPage||0,n.size=(isNaN(r.size)?n.size:r.size)||n.setSize||10,e.data(i,"pagerLastSize",n.size)),n.regexRows=new RegExp("("+(o.filter_filteredRow||"filtered")+"|"+s.selectorRemove.slice(1)+"|"+s.cssChildRow+")"),n.initialized=!1,s.$table.trigger("pagerBeforeInitialized",s),a.enablePager(i,s,!1),n.ajaxObject=o.pager_ajaxObject,n.ajaxObject.url=o.pager_ajaxUrl,"string"==typeof o.pager_ajaxUrl?(n.ajax=!0,o.filter_serversideFiltering=!0,s.serverSideSorting=!0,a.moveToPage(i,n)):(n.ajax=!1,s.$table.trigger("appendCache",[{},!0])))}},initComplete:function(e,i){var r=i.pager;a.bindEvents(e,i),a.setPageSize(e,0,i),r.ajax||a.hideRowsSetup(e,i),r.initialized=!0,r.initializing=!1,r.isInitializing=!1,i.debug&&t.log("Pager: Triggering pagerInitialized"),i.$table.trigger("pagerInitialized",i),i.widgetOptions.filter_initialized&&t.hasWidget(e,"filter")||a.updatePageDisplay(e,i,!r.ajax)},bindEvents:function(i,r){var s,o,g=r.pager,n=r.widgetOptions,l=n.pager_selectors;r.$table.off(e.trim(g.events.split(" ").join(".pager "))).on("filterInit.pager filterStart.pager",function(a,t){g.currentFilters=e.isArray(t)?t:r.$table.data("lastSearch"),"filterStart"===a.type&&n.pager_pageReset!==!1&&(r.lastCombinedFilter||"")!==(g.currentFilters||[]).join("")&&(g.page=n.pager_pageReset)}).on("filterEnd.pager sortEnd.pager",function(){g.currentFilters=r.$table.data("lastSearch"),(g.initialized||g.initializing)&&(r.delayInit&&r.rowsCopy&&0===r.rowsCopy.length&&a.updateCache(i),a.updatePageDisplay(i,r,!1),r.$table.trigger("applyWidgets"))}).on("disable.pager",function(e){e.stopPropagation(),a.showAllRows(i,r)}).on("enable.pager",function(e){e.stopPropagation(),a.enablePager(i,r,!0)}).on("destroy.pager",function(e,t){e.stopPropagation(),a.destroyPager(i,r,t)}).on("updateComplete.pager",function(e,t,i){if(e.stopPropagation(),t&&!i&&!g.ajax){var s=r.$tbodies.eq(0).children("tr").not(r.selectorRemove);g.totalRows=s.length-(n.pager_countChildRows?0:s.filter("."+r.cssChildRow).length),g.totalPages=Math.ceil(g.totalRows/g.size),s.length&&r.rowsCopy&&0===r.rowsCopy.length&&a.updateCache(t),g.page>=g.totalPages&&a.moveToLastPage(t,g),a.hideRows(t,r),a.changeHeight(t,r),a.updatePageDisplay(t,r,!1),r.$table.trigger("applyWidgets"),a.updatePageDisplay(t,r)}}).on("pageSize.pager refreshComplete.pager",function(e,t){e.stopPropagation(),a.setPageSize(i,parseInt(t,10)||g.setSize||10,r),a.hideRows(i,r),a.updatePageDisplay(i,r,!1)}).on("pageSet.pager pagerUpdate.pager",function(e,t){e.stopPropagation(),"pagerUpdate"===e.type&&(t="undefined"==typeof t?g.page+1:t,g.last.page=!0),g.page=(parseInt(t,10)||1)-1,a.moveToPage(i,g,!0),a.updatePageDisplay(i,r,!1)}).on("pageAndSize.pager",function(e,t,s){e.stopPropagation(),g.page=(parseInt(t,10)||1)-1,a.setPageSize(i,parseInt(s,10)||g.setSize||10,r),a.moveToPage(i,g,!0),a.hideRows(i,r),a.updatePageDisplay(i,r,!1)}),s=[l.first,l.prev,l.next,l.last],o=["moveToFirstPage","moveToPrevPage","moveToNextPage","moveToLastPage"],r.debug&&!g.$container.length&&t.log("Pager: >> Container not found"),g.$container.find(s.join(",")).attr("tabindex",0).off("click.pager").on("click.pager",function(t){t.stopPropagation();var r,l=e(this),p=s.length;if(!l.hasClass(n.pager_css.disabled))for(r=0;p>r;r++)if(l.is(s[r])){a[o[r]](i,g);break}}),g.$goto.length?g.$goto.off("change.pager").on("change.pager",function(){g.page=e(this).val()-1,a.moveToPage(i,g,!0),a.updatePageDisplay(i,r,!1)}):r.debug&&t.log("Pager: >> Goto selector not found"),g.$size.length?(g.$size.find("option").removeAttr("selected"),g.$size.off("change.pager").on("change.pager",function(){return g.$size.val(e(this).val()),e(this).hasClass(n.pager_css.disabled)||(a.setPageSize(i,parseInt(e(this).val(),10),r),a.changeHeight(i,r)),!1})):r.debug&&t.log("Pager: >> Size selector not found")},pagerArrows:function(e,a){var t=e.pager,i=!!a,r=i||0===t.page,s=Math.min(t.totalPages,t.filteredPages),o=i||t.page===s-1||0===s,g=e.widgetOptions,n=g.pager_selectors;g.pager_updateArrows&&(t.$container.find(n.first+","+n.prev).toggleClass(g.pager_css.disabled,r).attr("aria-disabled",r),t.$container.find(n.next+","+n.last).toggleClass(g.pager_css.disabled,o).attr("aria-disabled",o))},calcFilters:function(a,t){var i,r,s,o=t.widgetOptions,g=t.pager,n=t.$table.hasClass("hasFilters");if(n&&!o.pager_ajaxUrl)if(e.isEmptyObject(t.cache))g.filteredRows=g.totalRows=t.$tbodies.eq(0).children("tr").not(o.pager_countChildRows?"":"."+t.cssChildRow).length;else for(g.filteredRows=0,i=t.cache[0].normalized,s=i.length,r=0;s>r;r++)g.filteredRows+=g.regexRows.test(i[r][t.columns].$row[0].className)?0:1;else n||(g.filteredRows=g.totalRows)},updatePageDisplay:function(i,r,s){if(!r.pager.initializing){var o,g,n,l,p,d,c=r.widgetOptions,f=r.pager,h=f.size||f.setSize||10;if(c.pager_countChildRows&&g.push(r.cssChildRow),f.$size.add(f.$goto).removeClass(c.pager_css.disabled).removeAttr("disabled").attr("aria-disabled","false"),f.totalPages=Math.ceil(f.totalRows/h),r.totalRows=f.totalRows,a.calcFilters(i,r),r.filteredRows=f.filteredRows,f.filteredPages=Math.ceil(f.filteredRows/h)||0,Math.min(f.totalPages,f.filteredPages)>=0){if(g=f.size*f.page>f.filteredRows&&s,f.page=g?c.pager_pageReset||0:f.page,f.startRow=g?f.size*f.page+1:0===f.filteredRows?0:f.size*f.page+1,f.endRow=Math.min(f.filteredRows,f.totalRows,f.size*(f.page+1)),n=f.$container.find(c.pager_selectors.pageDisplay),o=(f.ajaxData&&f.ajaxData.output?f.ajaxData.output||c.pager_output:c.pager_output).replace(/\{page([\-+]\d+)?\}/gi,function(e,a){return f.totalPages?f.page+(a?parseInt(a,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(e){var a,t,i=e.replace(/[{}\s]/g,""),r=i.split(":"),s=f.ajaxData,o=/(rows?|pages?)$/i.test(i)?0:"";return/(startRow|page)/.test(r[0])&&"input"===r[1]?(a=(""+("page"===r[0]?f.totalPages:f.totalRows)).length,t="page"===r[0]?f.page+1:f.startRow,'<input type="text" class="ts-'+r[0]+'" style="max-width:'+a+'em" value="'+t+'"/>'):r.length>1&&s&&s[r[0]]?s[r[0]][r[1]]:f[i]||(s?s[i]:o)||o}),f.$goto.length){for(g="",l=a.buildPageSelect(f,r),d=l.length,p=0;d>p;p++)g+='<option value="'+l[p]+'">'+l[p]+"</option>";f.$goto.html(g).val(f.page+1)}n.length&&(n["INPUT"===n[0].nodeName?"val":"html"](o),n.find(".ts-startRow, .ts-page").off("change.pager").on("change.pager",function(){var a=e(this).val(),t=e(this).hasClass("ts-startRow")?Math.floor(a/f.size)+1:a;r.$table.trigger("pageSet.pager",[t])}))}a.pagerArrows(r),a.fixHeight(i,r),f.initialized&&s!==!1&&(r.debug&&t.log("Pager: Triggering pagerComplete"),r.$table.trigger("pagerComplete",r),c.pager_savePages&&t.storage&&t.storage(i,c.pager_storageKey,{page:f.page,size:f.size}))}},buildPageSelect:function(a,t){var i,r,s,o,g,n,l=t.widgetOptions,p=Math.min(a.totalPages,a.filteredPages)||1,d=5*Math.ceil(p/l.pager_maxOptionSize/5),c=p>l.pager_maxOptionSize,f=a.page+1,h=d,u=p-d,w=[1],z=c?d:1;for(i=z;p>=i;)w.push(i),i+=c?d:1;if(w.push(p),c){for(s=[],r=Math.max(Math.floor(l.pager_maxOptionSize/d)-1,5),h=f-r,1>h&&(h=1),u=f+r,u>p&&(u=p),i=h;u>=i;i++)s.push(i);w=e.grep(w,function(a,t){return e.inArray(a,w)===t}),g=w.length,n=s.length,g-n>d/2&&g+n>l.pager_maxOptionSize&&(o=Math.floor(g/2)-Math.floor(n/2),Array.prototype.splice.apply(w,[o,n])),w=w.concat(s)}return w=e.grep(w,function(a,t){return e.inArray(a,w)===t}).sort(function(e,a){return e-a})},fixHeight:function(a,t){var i,r,s=t.pager,o=t.widgetOptions,g=t.$tbodies.eq(0);g.find("tr.pagerSavedHeightSpacer").remove(),o.pager_fixedHeight&&!s.isDisabled&&(r=e.data(a,"pagerSavedHeight"),r&&(i=r-g.height(),i>5&&e.data(a,"pagerLastSize")===s.size&&g.children("tr:visible").length<s.size&&g.append('<tr class="pagerSavedHeightSpacer '+t.selectorRemove.slice(1)+'" style="height:'+i+'px;"></tr>')))},changeHeight:function(t,i){var r,s=i.$tbodies.eq(0);s.find("tr.pagerSavedHeightSpacer").remove(),s.children("tr:visible").length||s.append('<tr class="pagerSavedHeightSpacer '+i.selectorRemove.slice(1)+'"><td>&nbsp</td></tr>'),r=s.children("tr").eq(0).height()*i.pager.size,e.data(t,"pagerSavedHeight",r),a.fixHeight(t,i),e.data(t,"pagerLastSize",i.pager.size)},hideRows:function(e,a){if(!a.widgetOptions.pager_ajaxUrl){var i,r=0,s=a.pager,o=a.widgetOptions,g=a.$tbodies.eq(0).children("tr"),n=g.length,l=s.page*s.size,p=l+s.size,d=o&&o.filter_filteredRow||"filtered",c=0,f=0;for(s.cacheIndex=[],i=0;n>i;i++)g[i].className.match(d)||(f===l&&g[i].className.match(a.cssChildRow)?g[i].style.display="none":(g[i].style.display=f>=l&&p>f?"":"none",c!==f&&f>=l&&p>f&&(s.cacheIndex.push(i),c=f),f+=g[i].className.match(a.cssChildRow+"|"+a.selectorRemove.slice(1))&&!o.pager_countChildRows?0:1,f===p&&"none"!==g[i].style.display&&g[i].className.match(t.css.cssHasChild)&&(r=i)));if(r>0&&g[r].className.match(t.css.cssHasChild))for(;++r<n&&g[r].className.match(a.cssChildRow);)g[r].style.display=""}},hideRowsSetup:function(t,i){var r=i.pager;r.size=parseInt(r.$size.val(),10)||r.size||r.setSize||10,e.data(t,"pagerLastSize",r.size),a.pagerArrows(i),i.widgetOptions.pager_removeRows||(a.hideRows(t,i),i.$table.on("sortEnd.pager filterEnd.pager",function(){a.hideRows(t,i)}))},renderAjax:function(i,r,s,o,g){var n=s.pager,l=s.widgetOptions;if(e.isFunction(l.pager_ajaxProcessing)){var p,d,c,f,h,u,w,z,P,b,m,v,R,j,x=s.$table,_="",y=l.pager_ajaxProcessing(i,r,o)||[0,[]],$=x.find("thead th").length;if(t.showError(r),g)s.debug&&t.log("Pager: >> Ajax Error",o,g),t.showError(r,g.message+" ("+o.status+")"),s.$tbodies.eq(0).children("tr").detach(),n.totalRows=0;else{if(e.isArray(y)?(c=isNaN(y[0])&&!isNaN(y[1]),R=y[c?1:0],n.totalRows=isNaN(R)?n.totalRows||0:R,s.totalRows=s.filteredRows=n.filteredRows=n.totalRows,m=0===n.totalRows?[""]:y[c?0:1]||[],b=y[2]):(n.ajaxData=y,s.totalRows=n.totalRows=y.total,s.filteredRows=n.filteredRows="undefined"!=typeof y.filteredRows?y.filteredRows:y.total,b=y.headers,m=y.rows),v=m&&m.length,m instanceof jQuery)l.pager_processAjaxOnInit&&(s.$tbodies.eq(0).children("tr").detach(),s.$tbodies.eq(0).append(m));else if(v){for(p=0;v>p;p++){for(_+="<tr>",d=0;d<m[p].length;d++)_+=/^\s*<td/.test(m[p][d])?e.trim(m[p][d]):"<td>"+m[p][d]+"</td>";_+="</tr>"}l.pager_processAjaxOnInit&&s.$tbodies.eq(0).html(_)}if(l.pager_processAjaxOnInit=!0,b&&b.length===$)for(f=x.hasClass("hasStickyHeaders"),u=f?l.$sticky.children("thead:first").children("tr").children():"",h=x.find("tfoot tr:first").children(),w=s.$headers.filter("th "),j=w.length,d=0;j>d;d++)z=w.eq(d),z.find("."+t.css.icon).length?(P=z.find("."+t.css.icon).clone(!0),z.find(".tablesorter-header-inner").html(b[d]).append(P),f&&u.length&&(P=u.eq(d).find("."+t.css.icon).clone(!0),u.eq(d).find(".tablesorter-header-inner").html(b[d]).append(P))):(z.find(".tablesorter-header-inner").html(b[d]),f&&u.length&&u.eq(d).find(".tablesorter-header-inner").html(b[d])),h.eq(d).html(b[d])}s.showProcessing&&t.isProcessing(r),n.totalPages=Math.ceil(n.totalRows/(n.size||n.setSize||10)),n.last.totalRows=n.totalRows,n.last.currentFilters=n.currentFilters,n.last.sortList=(s.sortList||[]).join(","),n.initializing=!1,a.updatePageDisplay(r,s,!1),x.trigger("updateCache",[function(){n.initialized&&setTimeout(function(){s.debug&&t.log("Pager: Triggering pagerChange"),x.trigger("applyWidgets").trigger("pagerChange",n),a.updatePageDisplay(r,s)},0)}])}n.initialized||s.$table.trigger("applyWidgets")},getAjax:function(i,r){var s,o=a.getAjaxUrl(i,r),g=e(document),n=r.pager;""!==o&&(r.showProcessing&&t.isProcessing(i,!0),g.on("ajaxError.pager",function(e,t,s,o){a.renderAjax(null,i,r,t,o),g.off("ajaxError.pager")}),s=++n.ajaxCounter,n.last.ajaxUrl=o,n.ajaxObject.url=o,n.ajaxObject.success=function(e,t,o){s<n.ajaxCounter||(a.renderAjax(e,i,r,o),g.off("ajaxError.pager"),"function"==typeof n.oldAjaxSuccess&&n.oldAjaxSuccess(e))},r.debug&&t.log("Pager: Ajax initialized",n.ajaxObject),e.ajax(n.ajaxObject))},getAjaxUrl:function(a,i){var r,s,o=i.pager,g=i.widgetOptions,n=g.pager_ajaxUrl?g.pager_ajaxUrl.replace(/\{page([\-+]\d+)?\}/,function(e,a){return o.page+(a?parseInt(a,10):0)}).replace(/\{size\}/g,o.size):"",l=i.sortList,p=o.currentFilters||e(a).data("lastSearch")||[],d=n.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),c=n.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/),f=[];if(d){for(d=d[1],s=l.length,r=0;s>r;r++)f.push(d+"["+l[r][0]+"]="+l[r][1]);n=n.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,f.length?f.join("&"):d),f=[]}if(c){for(c=c[1],s=p.length,r=0;s>r;r++)p[r]&&f.push(c+"["+r+"]="+encodeURIComponent(p[r]));n=n.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,f.length?f.join("&"):c),o.currentFilters=p}return e.isFunction(g.pager_customAjaxUrl)&&(n=g.pager_customAjaxUrl(a,n)),i.debug&&t.log("Pager: Ajax url = "+n),n},renderTable:function(e,i){var r,s,o,g,n=e.config,l=n.pager,p=n.widgetOptions,d=n.$table.hasClass("hasFilters"),c=i&&i.length||0,f=l.page*l.size,h=l.size;if(1>c)return void(n.debug&&t.log("Pager: >> No rows for pager to render"));if(l.page>=l.totalPages)return a.moveToLastPage(e,l);if(l.cacheIndex=[],l.isDisabled=!1,l.initialized&&(n.debug&&t.log("Pager: Triggering pagerChange"),n.$table.trigger("pagerChange",n)),p.pager_removeRows){for(t.clearTableBody(e),r=t.processTbody(e,n.$tbodies.eq(0),!0),s=d?0:f,o=d?0:f,g=0;h>g&&s<i.length;)d&&/filtered/.test(i[s][0].className)||(o++,o>f&&h>=g&&(g++,l.cacheIndex.push(s),r.append(i[s]))),s++;t.processTbody(e,r,!1)}else a.hideRows(e,n);a.updatePageDisplay(e,n),p.pager_startPage=l.page,p.pager_size=l.size,e.isUpdating&&(n.debug&&t.log("Pager: Triggering updateComplete"),n.$table.trigger("updateComplete",[e,!0]))},showAllRows:function(i,r){var s,o,g,n=r.pager,l=r.widgetOptions;for(n.ajax?a.pagerArrows(r,!0):(n.isDisabled=!0,e.data(i,"pagerLastPage",n.page),e.data(i,"pagerLastSize",n.size),n.page=0,n.size=n.totalRows,n.totalPages=1,r.$table.addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),a.renderTable(i,r.rowsCopy),r.$table.trigger("applyWidgets"),r.debug&&t.log("Pager: Disabled")),o=n.$size.add(n.$goto).add(n.$container.find(".ts-startRow, .ts-page ")),g=o.length,s=0;g>s;s++)o.eq(s).attr("aria-disabled","true").addClass(l.pager_css.disabled)[0].disabled=!0},updateCache:function(t){var i=t.config,r=i.pager;i.$table.trigger("updateCache",[function(){if(!e.isEmptyObject(t.config.cache)){var s,o=[],g=t.config.cache[0].normalized;for(r.totalRows=g.length,s=0;s<r.totalRows;s++)o.push(g[s][i.columns].$row);i.rowsCopy=o,a.moveToPage(t,r,!0),r.last.currentFilters=[" "]}}])},moveToPage:function(i,r,s){if(!r.isDisabled){if(s!==!1&&r.initialized&&e.isEmptyObject(i.config.cache))return a.updateCache(i);var o,g=i.config,n=g.widgetOptions,l=r.last;r.ajax&&!n.filter_initialized&&t.hasWidget(i,"filter")||(a.calcFilters(i,g),o=Math.min(r.totalPages,r.filteredPages),r.page<0&&(r.page=0),r.page>o-1&&0!==o&&(r.page=o-1),l.currentFilters=""===(l.currentFilters||[]).join("")?[]:l.currentFilters,r.currentFilters=""===(r.currentFilters||[]).join("")?[]:r.currentFilters,(l.page!==r.page||l.size!==r.size||l.totalRows!==r.totalRows||(l.currentFilters||[]).join(",")!==(r.currentFilters||[]).join(",")||(l.ajaxUrl||"")!==(r.ajaxObject.url||"")||(l.optAjaxUrl||"")!==(n.pager_ajaxUrl||"")||l.sortList!==(g.sortList||[]).join(","))&&(g.debug&&t.log("Pager: Changing to page "+r.page),r.last={page:r.page,size:r.size,sortList:(g.sortList||[]).join(","),totalRows:r.totalRows,currentFilters:r.currentFilters||[],ajaxUrl:r.ajaxObject.url||"",optAjaxUrl:n.pager_ajaxUrl},r.ajax?a.getAjax(i,g):r.ajax||a.renderTable(i,g.rowsCopy),e.data(i,"pagerLastPage",r.page),r.initialized&&s!==!1&&(g.debug&&t.log("Pager: Triggering pageMoved"),g.$table.trigger("pageMoved",g).trigger("applyWidgets"),!r.ajax&&i.isUpdating&&(g.debug&&t.log("Pager: Triggering updateComplete"),g.$table.trigger("updateComplete",[i,!0])))))}},setPageSize:function(t,i,r){var s=r.pager;s.size=i||s.size||s.setSize||10,s.$size.val(s.size),e.data(t,"pagerLastPage",s.page),e.data(t,"pagerLastSize",s.size),s.totalPages=Math.ceil(s.totalRows/s.size),s.filteredPages=Math.ceil(s.filteredRows/s.size),a.moveToPage(t,s,!0)},moveToFirstPage:function(e,t){t.page=0,a.moveToPage(e,t,!0)},moveToLastPage:function(e,t){t.page=Math.min(t.totalPages,t.filteredPages)-1,a.moveToPage(e,t,!0)},moveToNextPage:function(e,t){t.page++,t.page>=Math.min(t.totalPages,t.filteredPages)-1&&(t.page=Math.min(t.totalPages,t.filteredPages)-1),a.moveToPage(e,t,!0)},moveToPrevPage:function(e,t){t.page--,t.page<=0&&(t.page=0),a.moveToPage(e,t,!0)},destroyPager:function(i,r,s){var o=r.pager;o.initialized=!1,r.$table.off(e.trim(o.events.split(" ").join(".pager "))),s||(a.showAllRows(i,r),o.$container.hide(),r.appender=null,delete i.config.rowsCopy,t.storage&&t.storage(i,r.widgetOptions.pager_storageKey,""))},enablePager:function(i,r,s){var o,g=r.pager;g.isDisabled=!1,g.page=e.data(i,"pagerLastPage")||g.page||0,g.size=e.data(i,"pagerLastSize")||parseInt(g.$size.find("option[selected]").val(),10)||g.size||g.setSize||10,g.$size.val(g.size),g.totalPages=Math.ceil(Math.min(g.totalRows,g.filteredRows)/g.size),r.$table.removeClass("pagerDisabled"),i.id&&(o=i.id+"_pager_info",g.$container.find(r.widgetOptions.pager_selectors.pageDisplay).attr("id",o),r.$table.attr("aria-describedby",o)),a.changeHeight(i,r),s&&(r.$table.trigger("updateRows"),a.setPageSize(i,g.size,r),a.hideRowsSetup(i,r),r.debug&&t.log("Pager: Enabled"))},appender:function(t,i){var r=t.config,s=r.widgetOptions,o=r.pager;o.ajax?a.moveToPage(t,o,!0):(r.rowsCopy=i,o.totalRows=s.pager_countChildRows?r.$tbodies.eq(0).children("tr").length:i.length,o.size=e.data(t,"pagerLastSize")||o.size||s.pager_size||o.setSize||10,o.totalPages=Math.ceil(o.totalRows/o.size),a.moveToPage(t,o),a.updatePageDisplay(t,r,!1))}},t.showError=function(a,t){var i,r,s,o,g,n=e(a),l=n.length;for(i=0;l>i;i++)s=n[i].config,s&&(o=s.widgetOptions,g=s.pager&&s.pager.cssErrorRow||o.pager_css&&o.pager_css.errorRow||"tablesorter-errorRow","undefined"==typeof t?s.$table.find("thead").find(s.selectorRemove).remove():r=e(/tr\>/.test(t)?t:'<tr><td colspan="'+s.columns+'">'+t+"</td></tr>").click(function(){e(this).remove()}).appendTo(s.$table.find("thead:first")).addClass(g+" "+s.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"}))}}(jQuery);
+;(function($) {
+ 'use strict';
+ var tsp,
+ ts = $.tablesorter;
+
+ ts.addWidget({
+ id: 'pager',
+ priority: 55, // load pager after filter widget
+ options: {
+ // output default: '{page}/{totalPages}'
+ // possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow},
+ // {endRow}, {filteredRows} and {totalRows}
+ pager_output: '{startRow} to {endRow} of {totalRows} rows', // '{page}/{totalPages}'
+
+ // apply disabled classname to the pager arrows when the rows at either extreme is visible
+ pager_updateArrows: true,
+
+ // starting page of the pager (zero based index)
+ pager_startPage: 0,
+
+ // reset pager after filtering; set to desired page #
+ // set to false to not change page at filter start
+ pager_pageReset: 0,
+
+ // Number of visible rows
+ pager_size: 10,
+
+ // Number of options to include in the pager number selector
+ pager_maxOptionSize: 20,
+
+ // Save pager page & size if the storage script is loaded (requires $.tablesorter.storage
+ // in jquery.tablesorter.widgets.js)
+ pager_savePages: true,
+
+ // defines custom storage key
+ pager_storageKey: 'tablesorter-pager',
+
+ // if true, the table will remain the same height no matter how many records are displayed.
+ // The space is made up by an empty table row set to a height to compensate; default is false
+ pager_fixedHeight: false,
+
+ // count child rows towards the set page size? (set true if it is a visible table row within the pager)
+ // if true, child row(s) may not appear to be attached to its parent row, may be split across pages or
+ // may distort the table if rowspan or cellspans are included.
+ pager_countChildRows: false,
+
+ // remove rows from the table to speed up the sort of large tables.
+ // setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with
+ // the pager enabled.
+ pager_removeRows: false, // removing rows in larger tables speeds up the sort
+
+ // use this format: 'http://mydatabase.com?page={page}&size={size}&{sortList:col}&{filterList:fcol}'
+ // where {page} is replaced by the page number, {size} is replaced by the number of records to show,
+ // {sortList:col} adds the sortList to the url into a 'col' array, and {filterList:fcol} adds
+ // the filterList to the url into an 'fcol' array.
+ // So a sortList = [[2,0],[3,0]] becomes '&col[2]=0&col[3]=0' in the url
+ // and a filterList = [[2,Blue],[3,13]] becomes '&fcol[2]=Blue&fcol[3]=13' in the url
+ pager_ajaxUrl: null,
+
+ // modify the url after all processing has been applied
+ pager_customAjaxUrl: function( table, url ) { return url; },
+
+ // ajax error callback from $.tablesorter.showError function
+ // pager_ajaxError: function( config, xhr, settings, exception ) { return exception; };
+ // returning false will abort the error message
+ pager_ajaxError: null,
+
+ // modify the $.ajax object to allow complete control over your ajax requests
+ pager_ajaxObject: {
+ dataType: 'json'
+ },
+
+ // set this to false if you want to block ajax loading on init
+ pager_processAjaxOnInit: true,
+
+ // process ajax so that the following information is returned:
+ // [ total_rows (number), rows (array of arrays), headers (array; optional) ]
+ // example:
+ // [
+ // 100, // total rows
+ // [
+ // [ "row1cell1", "row1cell2", ... "row1cellN" ],
+ // [ "row2cell1", "row2cell2", ... "row2cellN" ],
+ // ...
+ // [ "rowNcell1", "rowNcell2", ... "rowNcellN" ]
+ // ],
+ // [ "header1", "header2", ... "headerN" ] // optional
+ // ]
+ pager_ajaxProcessing: function( data ) { return data; },
+
+ // css class names of pager arrows
+ pager_css: {
+ container : 'tablesorter-pager',
+ // error information row (don't include period at beginning)
+ errorRow : 'tablesorter-errorRow',
+ // class added to arrows @ extremes (i.e. prev/first arrows 'disabled' on first page)
+ disabled : 'disabled'
+ },
+
+ // jQuery selectors
+ pager_selectors: {
+ container : '.pager', // target the pager markup
+ first : '.first', // go to first page arrow
+ prev : '.prev', // previous page arrow
+ next : '.next', // next page arrow
+ last : '.last', // go to last page arrow
+ // goto is a reserved word #657
+ gotoPage : '.gotoPage', // go to page selector - select dropdown that sets the current page
+ pageDisplay : '.pagedisplay', // location of where the 'output' is displayed
+ pageSize : '.pagesize' // page size selector - select dropdown that sets the 'size' option
+ }
+ },
+ init: function( table ) {
+ tsp.init( table );
+ },
+ // only update to complete sorter initialization
+ format: function( table, c ) {
+ if ( !( c.pager && c.pager.initialized ) ) {
+ return tsp.initComplete( c );
+ }
+ tsp.moveToPage( c, c.pager, false );
+ },
+ remove: function( table, c, wo, refreshing ) {
+ tsp.destroyPager( c, refreshing );
+ }
+ });
+
+ /* pager widget functions */
+ tsp = ts.pager = {
+
+ init: function( table ) {
+ // check if tablesorter has initialized
+ if ( table.hasInitialized && table.config.pager && table.config.pager.initialized ) { return; }
+ var t,
+ c = table.config,
+ wo = c.widgetOptions,
+ s = wo.pager_selectors,
+
+ // save pager variables
+ p = c.pager = $.extend({
+ totalPages: 0,
+ filteredRows: 0,
+ filteredPages: 0,
+ currentFilters: [],
+ page: wo.pager_startPage,
+ startRow: 0,
+ endRow: 0,
+ ajaxCounter: 0,
+ $size: null,
+ last: {},
+ // save original pager size
+ setSize: wo.pager_size,
+ setPage: wo.pager_startPage
+ }, c.pager );
+
+ // Used by core appendCache; !undefined is always true
+ p.removeRows = wo.pager_removeRows;
+
+ // pager initializes multiple times before table has completed initialization
+ if ( p.isInitializing ) { return; }
+
+ p.isInitializing = true;
+ if ( ts.debug(c, 'pager') ) {
+ console.log( 'Pager >> Initializing' );
+ }
+
+ p.size = $.data( table, 'pagerLastSize' ) || wo.pager_size;
+ // added in case the pager is reinitialized after being destroyed.
+ p.$container = $( s.container ).addClass( wo.pager_css.container ).show();
+ p.totalRows = c.$tbodies.eq( 0 )
+ .children( 'tr' )
+ .not( wo.pager_countChildRows ? '' : '.' + c.cssChildRow )
+ .length;
+ p.oldAjaxSuccess = p.oldAjaxSuccess || wo.pager_ajaxObject.success;
+ c.appender = tsp.appender;
+ p.initializing = true;
+ if ( wo.pager_savePages && ts.storage ) {
+ t = ts.storage( table, wo.pager_storageKey ) || {}; // fixes #387
+ p.page = ( isNaN( t.page ) ? p.page : t.page ) || p.setPage || 0;
+ p.size = t.size === 'all' ? t.size : ( isNaN( t.size ) ? p.size : t.size ) || p.setSize || 10;
+ tsp.setPageSize( c, p.size );
+ }
+
+ // skipped rows
+ p.regexRows = new RegExp( '(' + ( wo.filter_filteredRow || 'filtered' ) + '|' +
+ c.selectorRemove.slice( 1 ) + '|' + c.cssChildRow + ')' );
+ p.regexFiltered = new RegExp( wo.filter_filteredRow || 'filtered' );
+
+ // clear initialized flag
+ p.initialized = false;
+ // before initialization event
+ c.$table.triggerHandler( 'pagerBeforeInitialized', c );
+
+ tsp.enablePager( c, false );
+
+ // p must have ajaxObject
+ p.ajaxObject = wo.pager_ajaxObject;
+ p.ajaxObject.url = wo.pager_ajaxUrl;
+
+ if ( typeof wo.pager_ajaxUrl === 'string' ) {
+ // ajax pager; interact with database
+ p.ajax = true;
+ // When filtering with ajax, allow only custom filtering function, disable default filtering
+ // since it will be done server side.
+ wo.filter_serversideFiltering = true;
+ c.serverSideSorting = true;
+ tsp.moveToPage( c, p );
+ } else {
+ p.ajax = false;
+ // Regular pager; all rows stored in memory
+ ts.appendCache( c, true ); // true = don't apply widgets
+ }
+
+ },
+
+ initComplete: function( c ) {
+ var p = c.pager;
+ tsp.bindEvents( c );
+ if ( !p.ajax ) {
+ tsp.hideRowsSetup( c );
+ }
+
+ // pager initialized
+ p.initialized = true;
+ p.initializing = false;
+ p.isInitializing = false;
+ tsp.setPageSize( c, p.size ); // page size 0 is ignored
+ if ( ts.debug(c, 'pager') ) {
+ console.log( 'Pager >> Triggering pagerInitialized' );
+ }
+ c.$table.triggerHandler( 'pagerInitialized', c );
+ // filter widget not initialized; it will update the output display & fire off the pagerComplete event
+ if ( !( c.widgetOptions.filter_initialized && ts.hasWidget( c.table, 'filter' ) ) ) {
+ // if ajax, then don't fire off pagerComplete
+ tsp.updatePageDisplay( c, !p.ajax );
+ }
+ },
+
+ bindEvents: function( c ) {
+ var ctrls, fxn, tmp,
+ p = c.pager,
+ wo = c.widgetOptions,
+ namespace = c.namespace + 'pager',
+ s = wo.pager_selectors,
+ debug = ts.debug(c, 'pager');
+ c.$table
+ .off( namespace )
+ .on( 'filterInit filterStart '.split( ' ' ).join( namespace + ' ' ), function( e, filters ) {
+ p.currentFilters = $.isArray( filters ) ? filters : c.$table.data( 'lastSearch' );
+ var filtersEqual;
+ if (p.ajax && e.type === 'filterInit') {
+ // ensure pager ajax is called after filter widget has initialized
+ return tsp.moveToPage( c, p, false );
+ }
+ if (ts.filter.equalFilters) {
+ filtersEqual = ts.filter.equalFilters(c, c.lastSearch, p.currentFilters);
+ } else {
+ // will miss filter changes of the same value in a different column, see #1363
+ filtersEqual = ( c.lastSearch || [] ).join( '' ) !== ( p.currentFilters || [] ).join( '' );
+ }
+ // don't change page if filters are the same (pager updating, etc)
+ if ( e.type === 'filterStart' && wo.pager_pageReset !== false && !filtersEqual ) {
+ p.page = wo.pager_pageReset; // fixes #456 & #565
+ }
+ })
+ // update pager after filter widget completes
+ .on( 'filterEnd sortEnd '.split( ' ' ).join( namespace + ' ' ), function() {
+ p.currentFilters = c.$table.data( 'lastSearch' );
+ if ( p.initialized || p.initializing ) {
+ if ( c.delayInit && c.rowsCopy && c.rowsCopy.length === 0 ) {
+ // make sure we have a copy of all table rows once the cache has been built
+ tsp.updateCache( c );
+ }
+ tsp.updatePageDisplay( c, false );
+ ts.applyWidget( c.table );
+ }
+ })
+ .on( 'disablePager' + namespace, function( e ) {
+ e.stopPropagation();
+ tsp.showAllRows( c );
+ })
+ .on( 'enablePager' + namespace, function( e ) {
+ e.stopPropagation();
+ tsp.enablePager( c, true );
+ })
+ .on( 'destroyPager' + namespace, function( e ) {
+ e.stopPropagation();
+ // call removeWidget to make sure internal flags are modified.
+ ts.removeWidget( c.table, 'pager', false );
+ })
+ .on( 'updateComplete' + namespace, function( e, table, triggered ) {
+ e.stopPropagation();
+ // table can be unintentionally undefined in tablesorter v2.17.7 and earlier
+ // don't recalculate total rows/pages if using ajax
+ if ( !table || triggered || p.ajax ) { return; }
+ var $rows = c.$tbodies.eq( 0 ).children( 'tr' ).not( c.selectorRemove );
+ p.totalRows = $rows.length -
+ ( wo.pager_countChildRows ? 0 : $rows.filter( '.' + c.cssChildRow ).length );
+ p.totalPages = p.size === 'all' ? 1 : Math.ceil( p.totalRows / p.size );
+ if ( $rows.length && c.rowsCopy && c.rowsCopy.length === 0 ) {
+ // make a copy of all table rows once the cache has been built
+ tsp.updateCache( c );
+ }
+ if ( p.page >= p.totalPages ) {
+ tsp.moveToLastPage( c, p );
+ }
+ tsp.hideRows( c );
+ tsp.changeHeight( c );
+ // update without triggering pagerComplete
+ tsp.updatePageDisplay( c, false );
+ // make sure widgets are applied - fixes #450
+ ts.applyWidget( table );
+ tsp.updatePageDisplay( c );
+ })
+ .on( 'pageSize refreshComplete '.split( ' ' ).join( namespace + ' ' ), function( e, size ) {
+ e.stopPropagation();
+ tsp.setPageSize( c, tsp.parsePageSize( c, size, 'get' ) );
+ tsp.moveToPage( c, p, true );
+ tsp.hideRows( c );
+ tsp.updatePageDisplay( c, false );
+ })
+ .on( 'pageSet pagerUpdate '.split( ' ' ).join( namespace + ' ' ), function( e, num ) {
+ e.stopPropagation();
+ // force pager refresh
+ if ( e.type === 'pagerUpdate' ) {
+ num = typeof num === 'undefined' ? p.page + 1 : num;
+ p.last.page = true;
+ }
+ p.page = ( parseInt( num, 10 ) || 1 ) - 1;
+ tsp.moveToPage( c, p, true );
+ tsp.updatePageDisplay( c, false );
+ })
+ .on( 'pageAndSize' + namespace, function( e, page, size ) {
+ e.stopPropagation();
+ p.page = ( parseInt(page, 10) || 1 ) - 1;
+ tsp.setPageSize( c, tsp.parsePageSize( c, size, 'get' ) );
+ tsp.moveToPage( c, p, true );
+ tsp.hideRows( c );
+ tsp.updatePageDisplay( c, false );
+ });
+
+ // clicked controls
+ ctrls = [ s.first, s.prev, s.next, s.last ];
+ fxn = [ 'moveToFirstPage', 'moveToPrevPage', 'moveToNextPage', 'moveToLastPage' ];
+ if ( debug && !p.$container.length ) {
+ console.warn( 'Pager >> "container" not found' );
+ }
+ p.$container.find( ctrls.join( ',' ) )
+ .attr( 'tabindex', 0 )
+ .off( 'click' + namespace )
+ .on( 'click' + namespace, function( e ) {
+ e.stopPropagation();
+ var i,
+ $c = $( this ),
+ l = ctrls.length;
+ if ( !$c.hasClass( wo.pager_css.disabled ) ) {
+ for ( i = 0; i < l; i++ ) {
+ if ( $c.is( ctrls[ i ] ) ) {
+ tsp[ fxn[ i ] ]( c, p );
+ break;
+ }
+ }
+ }
+ });
+
+ tmp = p.$container.find( wo.pager_selectors.gotoPage );
+ if ( tmp.length ) {
+ tmp
+ .off( 'change' + namespace )
+ .on( 'change' + namespace, function() {
+ p.page = $( this ).val() - 1;
+ tsp.moveToPage( c, p, true );
+ tsp.updatePageDisplay( c, false );
+ });
+ } else if ( debug ) {
+ console.warn( 'Pager >> "goto" selector not found' );
+ }
+
+ tmp = p.$container.find( wo.pager_selectors.pageSize );
+ if ( tmp.length ) {
+ // setting an option as selected appears to cause issues with initial page size
+ tmp.find( 'option' ).removeAttr( 'selected' );
+ tmp
+ .off( 'change' + namespace )
+ .on( 'change' + namespace, function() {
+ if ( !$( this ).hasClass( wo.pager_css.disabled ) ) {
+ var size = $( this ).val();
+ // in case there are more than one pager
+ p.$container.find( wo.pager_selectors.pageSize ).val( size );
+ tsp.setPageSize( c, size );
+ tsp.moveToPage( c, p, true );
+ tsp.changeHeight( c );
+ }
+ return false;
+ });
+ } else if ( debug ) {
+ console.warn('Pager >> "size" selector not found');
+ }
+
+ },
+
+ // hide arrows at extremes
+ pagerArrows: function( c, disable ) {
+ var p = c.pager,
+ dis = !!disable,
+ first = dis || p.page === 0,
+ tp = tsp.getTotalPages( c, p ),
+ last = dis || p.page === tp - 1 || tp === 0,
+ wo = c.widgetOptions,
+ s = wo.pager_selectors;
+ if ( wo.pager_updateArrows ) {
+ p.$container
+ .find( s.first + ',' + s.prev )
+ .toggleClass( wo.pager_css.disabled, first )
+ .prop( 'aria-disabled', first );
+ p.$container
+ .find( s.next + ',' + s.last )
+ .toggleClass( wo.pager_css.disabled, last )
+ .prop( 'aria-disabled', last );
+ }
+ },
+
+ calcFilters: function( c ) {
+ var normalized, indx, len,
+ wo = c.widgetOptions,
+ p = c.pager,
+ hasFilters = c.$table.hasClass( 'hasFilters' );
+ if ( hasFilters && !p.ajax ) {
+ if ( $.isEmptyObject( c.cache ) ) {
+ // delayInit: true so nothing is in the cache
+ p.filteredRows = p.totalRows = c.$tbodies.eq( 0 )
+ .children( 'tr' )
+ .not( wo.pager_countChildRows ? '' : '.' + c.cssChildRow )
+ .length;
+ } else {
+ p.filteredRows = 0;
+ normalized = c.cache[ 0 ].normalized;
+ len = normalized.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ p.filteredRows += p.regexRows.test( normalized[ indx ][ c.columns ].$row[ 0 ].className ) ? 0 : 1;
+ }
+ }
+ } else if ( !hasFilters ) {
+ p.filteredRows = p.totalRows;
+ }
+ },
+
+ updatePageDisplay: function( c, completed ) {
+ if ( c.pager && c.pager.initializing ) { return; }
+ var s, t, $out, options, indx, len, output,
+ table = c.table,
+ wo = c.widgetOptions,
+ p = c.pager,
+ namespace = c.namespace + 'pager',
+ sz = tsp.parsePageSize( c, p.size, 'get' ); // don't allow dividing by zero
+ if ( sz === 'all' ) { sz = p.totalRows; }
+ if ( wo.pager_countChildRows ) { t[ t.length ] = c.cssChildRow; }
+ p.$container.find( wo.pager_selectors.pageSize + ',' + wo.pager_selectors.gotoPage )
+ .removeClass( wo.pager_css.disabled )
+ .removeAttr( 'disabled' )
+ .prop( 'aria-disabled', 'false' );
+ p.totalPages = Math.ceil( p.totalRows / sz ); // needed for 'pageSize' method
+ c.totalRows = p.totalRows;
+ tsp.parsePageNumber( c, p );
+ tsp.calcFilters( c );
+ c.filteredRows = p.filteredRows;
+ p.filteredPages = Math.ceil( p.filteredRows / sz ) || 0;
+ if ( tsp.getTotalPages( c, p ) >= 0 ) {
+ t = ( sz * p.page > p.filteredRows ) && completed;
+ p.page = t ? wo.pager_pageReset || 0 : p.page;
+ p.startRow = t ? sz * p.page + 1 : ( p.filteredRows === 0 ? 0 : sz * p.page + 1 );
+ p.endRow = Math.min( p.filteredRows, p.totalRows, sz * ( p.page + 1 ) );
+ $out = p.$container.find( wo.pager_selectors.pageDisplay );
+
+ // Output param can be callback for custom rendering or string
+ if ( typeof wo.pager_output === 'function' ) {
+ s = wo.pager_output( table, p );
+ } else {
+ output = $out
+ // get output template from data-pager-output or data-pager-output-filtered
+ .attr('data-pager-output' + (p.filteredRows < p.totalRows ? '-filtered' : '')) ||
+ wo.pager_output;
+ // form the output string (can now get a new output string from the server)
+ s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || output : output )
+ // {page} = one-based index; {page+#} = zero based index +/- value
+ .replace( /\{page([\-+]\d+)?\}/gi, function( m, n ) {
+ return p.totalPages ? p.page + ( n ? parseInt( n, 10 ) : 1 ) : 0;
+ })
+ // {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
+ .replace( /\{\w+(\s*:\s*\w+)?\}/gi, function( m ) {
+ var len, indx,
+ str = m.replace( /[{}\s]/g, '' ),
+ extra = str.split( ':' ),
+ data = p.ajaxData,
+ // return zero for default page/row numbers
+ deflt = /(rows?|pages?)$/i.test( str ) ? 0 : '';
+ if ( /(startRow|page)/.test( extra[ 0 ] ) && extra[ 1 ] === 'input' ) {
+ len = ( '' + ( extra[ 0 ] === 'page' ? p.totalPages : p.totalRows ) ).length;
+ indx = extra[ 0 ] === 'page' ? p.page + 1 : p.startRow;
+ return '<input type="text" class="ts-' + extra[ 0 ] +
+ '" style="max-width:' + len + 'em" value="' + indx + '"/>';
+ }
+ return extra.length > 1 && data && data[ extra[ 0 ] ] ?
+ data[ extra[ 0 ] ][ extra[ 1 ] ] :
+ p[ str ] || ( data ? data[ str ] : deflt ) || deflt;
+ });
+ }
+ if ( p.$container.find( wo.pager_selectors.gotoPage ).length ) {
+ t = '';
+ options = tsp.buildPageSelect( c, p );
+ len = options.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ t += '<option value="' + options[ indx ] + '">' + options[ indx ] + '</option>';
+ }
+ // innerHTML doesn't work in IE9 - http://support2.microsoft.com/kb/276228
+ p.$container.find( wo.pager_selectors.gotoPage ).html( t ).val( p.page + 1 );
+ }
+ if ( $out.length ) {
+ $out[ ($out[ 0 ].nodeName === 'INPUT' ) ? 'val' : 'html' ]( s );
+ // rebind startRow/page inputs
+ $out
+ .find( '.ts-startRow, .ts-page' )
+ .off( 'change' + namespace )
+ .on( 'change' + namespace, function() {
+ var v = $( this ).val(),
+ pg = $( this ).hasClass( 'ts-startRow' ) ? Math.floor( v / sz ) + 1 : v;
+ c.$table.triggerHandler( 'pageSet' + namespace, [ pg ] );
+ });
+ }
+ }
+ tsp.pagerArrows( c );
+ tsp.fixHeight( c );
+ if ( p.initialized && completed !== false ) {
+ if ( ts.debug(c, 'pager') ) {
+ console.log( 'Pager >> Triggering pagerComplete' );
+ }
+ c.$table.triggerHandler( 'pagerComplete', c );
+ // save pager info to storage
+ if ( wo.pager_savePages && ts.storage ) {
+ ts.storage( table, wo.pager_storageKey, {
+ page : p.page,
+ size : sz === p.totalRows ? 'all' : sz
+ });
+ }
+ }
+ },
+
+ buildPageSelect: function( c, p ) {
+ // Filter the options page number link array if it's larger than 'pager_maxOptionSize'
+ // as large page set links will slow the browser on large dom inserts
+ var i, centralFocusSize, focusOptionPages, insertIndex, optionLength, focusLength,
+ wo = c.widgetOptions,
+ pg = tsp.getTotalPages( c, p ) || 1,
+ // make skip set size multiples of 5
+ skipSetSize = Math.ceil( ( pg / wo.pager_maxOptionSize ) / 5 ) * 5,
+ largeCollection = pg > wo.pager_maxOptionSize,
+ currentPage = p.page + 1,
+ startPage = skipSetSize,
+ endPage = pg - skipSetSize,
+ optionPages = [ 1 ],
+ // construct default options pages array
+ optionPagesStartPage = largeCollection ? skipSetSize : 1;
+
+ for ( i = optionPagesStartPage; i <= pg; ) {
+ optionPages[ optionPages.length ] = i;
+ i = i + ( largeCollection ? skipSetSize : 1 );
+ }
+ optionPages[ optionPages.length ] = pg;
+
+ if ( largeCollection ) {
+ focusOptionPages = [];
+ // don't allow central focus size to be > 5 on either side of current page
+ centralFocusSize = Math.max( Math.floor( wo.pager_maxOptionSize / skipSetSize ) - 1, 5 );
+
+ startPage = currentPage - centralFocusSize;
+ if ( startPage < 1 ) { startPage = 1; }
+ endPage = currentPage + centralFocusSize;
+ if ( endPage > pg ) { endPage = pg; }
+ // construct an array to get a focus set around the current page
+ for ( i = startPage; i <= endPage ; i++ ) {
+ focusOptionPages[ focusOptionPages.length ] = i;
+ }
+
+ // keep unique values
+ optionPages = $.grep( optionPages, function( value, indx ) {
+ return $.inArray( value, optionPages ) === indx;
+ });
+
+ optionLength = optionPages.length;
+ focusLength = focusOptionPages.length;
+
+ // make sure at all optionPages aren't replaced
+ if ( optionLength - focusLength > skipSetSize / 2 && optionLength + focusLength > wo.pager_maxOptionSize ) {
+ insertIndex = Math.floor( optionLength / 2 ) - Math.floor( focusLength / 2 );
+ Array.prototype.splice.apply( optionPages, [ insertIndex, focusLength ] );
+ }
+ optionPages = optionPages.concat( focusOptionPages );
+
+ }
+
+ // keep unique values again
+ optionPages = $.grep( optionPages, function( value, indx ) {
+ return $.inArray( value, optionPages ) === indx;
+ })
+ .sort( function( a, b ) {
+ return a - b;
+ });
+
+ return optionPages;
+ },
+
+ fixHeight: function( c ) {
+ var d, h, bs,
+ table = c.table,
+ p = c.pager,
+ wo = c.widgetOptions,
+ $b = c.$tbodies.eq( 0 );
+ $b.find( 'tr.pagerSavedHeightSpacer' ).remove();
+ if ( wo.pager_fixedHeight && !p.isDisabled ) {
+ h = $.data( table, 'pagerSavedHeight' );
+ if ( h ) {
+ bs = 0;
+ if ( $(table).css('border-spacing').split(' ').length > 1 ) {
+ bs = $(table).css('border-spacing').split(' ')[1].replace( /[^-\d\.]/g, '' );
+ }
+ d = h - $b.height() + (bs * p.size) - bs;
+ if (
+ d > 5 && $.data( table, 'pagerLastSize' ) === p.size &&
+ $b.children( 'tr:visible' ).length < ( p.size === 'all' ? p.totalRows : p.size )
+ ) {
+ $b.append( '<tr class="pagerSavedHeightSpacer ' + c.selectorRemove.slice( 1 ) +
+ '" style="height:' + d + 'px;"></tr>' );
+ }
+ }
+ }
+ },
+
+ changeHeight: function( c ) {
+ var h,
+ table = c.table,
+ p = c.pager,
+ sz = p.size === 'all' ? p.totalRows : p.size,
+ $b = c.$tbodies.eq( 0 );
+ $b.find( 'tr.pagerSavedHeightSpacer' ).remove();
+ if ( !$b.children( 'tr:visible' ).length ) {
+ $b.append( '<tr class="pagerSavedHeightSpacer ' + c.selectorRemove.slice( 1 ) + '"><td>&nbsp</td></tr>' );
+ }
+ h = $b.children( 'tr' ).eq( 0 ).height() * sz;
+ $.data( table, 'pagerSavedHeight', h );
+ tsp.fixHeight( c );
+ $.data( table, 'pagerLastSize', p.size );
+ },
+
+ hideRows: function( c ) {
+ if ( !c.widgetOptions.pager_ajaxUrl ) {
+ var tbodyIndex, rowIndex, $rows, len, lastIndex,
+ p = c.pager,
+ wo = c.widgetOptions,
+ tbodyLen = c.$tbodies.length,
+ sz = p.size === 'all' ? p.totalRows : p.size,
+ start = ( p.page * sz ),
+ end = start + sz,
+ last = 0, // for cache indexing
+ size = 0; // size counter
+ p.cacheIndex = [];
+ for ( tbodyIndex = 0; tbodyIndex < tbodyLen; tbodyIndex++ ) {
+ $rows = c.$tbodies.eq( tbodyIndex ).children( 'tr' );
+ len = $rows.length;
+ lastIndex = 0;
+ last = 0; // for cache indexing
+ size = 0; // size counter
+ for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
+ if ( !p.regexFiltered.test( $rows[ rowIndex ].className ) ) {
+ if ( size === start && $rows[ rowIndex ].className.match( c.cssChildRow ) ) {
+ // hide child rows @ start of pager (if already visible)
+ $rows[ rowIndex ].style.display = 'none';
+ } else {
+ $rows[ rowIndex ].style.display = ( size >= start && size < end ) ? '' : 'none';
+ if ( last !== size && size >= start && size < end ) {
+ p.cacheIndex[ p.cacheIndex.length ] = rowIndex;
+ last = size;
+ }
+ // don't count child rows
+ size += $rows[ rowIndex ].className
+ .match( c.cssChildRow + '|' + c.selectorRemove.slice( 1 ) ) && !wo.pager_countChildRows ? 0 : 1;
+ if ( size === end && $rows[ rowIndex ].style.display !== 'none' &&
+ $rows[ rowIndex ].className.match( ts.css.cssHasChild ) ) {
+ lastIndex = rowIndex;
+ }
+ }
+ }
+ }
+ // add any attached child rows to last row of pager. Fixes part of issue #396
+ if ( lastIndex > 0 && $rows[ lastIndex ].className.match( ts.css.cssHasChild ) ) {
+ while ( ++lastIndex < len && $rows[ lastIndex ].className.match( c.cssChildRow ) ) {
+ $rows[ lastIndex ].style.display = '';
+ }
+ }
+ }
+ }
+ },
+
+ hideRowsSetup: function( c ) {
+ var p = c.pager,
+ namespace = c.namespace + 'pager',
+ $el = p.$container.find( c.widgetOptions.pager_selectors.pageSize ),
+ size = $el.val();
+ p.size = tsp.parsePageSize( c, size, 'get' );
+ tsp.setPageSize( c, p.size );
+ tsp.pagerArrows( c );
+ if ( !c.widgetOptions.pager_removeRows ) {
+ tsp.hideRows( c );
+ c.$table.on( 'sortEnd filterEnd '.split( ' ' ).join( namespace + ' ' ), function() {
+ tsp.hideRows( c );
+ });
+ }
+ },
+
+ renderAjax: function( data, c, xhr, settings, exception ) {
+ var table = c.table,
+ p = c.pager,
+ wo = c.widgetOptions,
+ debug = ts.debug(c, 'pager');
+ // process data
+ if ( $.isFunction( wo.pager_ajaxProcessing ) ) {
+
+ // in case nothing is returned by ajax, empty out the table; see #1032
+ // but do it before calling pager_ajaxProcessing because that function may add content
+ // directly to the table
+ c.$tbodies.eq( 0 ).empty();
+
+ // ajaxProcessing result: [ total, rows, headers ]
+ var i, j, t, hsh, $f, $sh, $headers, $h, icon, th, d, l, rr_count, len, sz,
+ $table = c.$table,
+ tds = '',
+ result = wo.pager_ajaxProcessing( data, table, xhr ) || [ 0, [] ];
+
+ // Clean up any previous error.
+ ts.showError( table );
+
+ if ( exception ) {
+ if ( debug ) {
+ console.error( 'Pager >> Ajax Error', xhr, settings, exception );
+ }
+ ts.showError( table, xhr, settings, exception );
+ c.$tbodies.eq( 0 ).children( 'tr' ).detach();
+ p.totalRows = 0;
+ } else {
+ // process ajax object
+ if ( !$.isArray( result ) ) {
+ p.ajaxData = result;
+ c.totalRows = p.totalRows = result.total;
+ c.filteredRows = p.filteredRows = typeof result.filteredRows !== 'undefined' ?
+ result.filteredRows :
+ result.total;
+ th = result.headers;
+ d = result.rows || [];
+ } else {
+ // allow [ total, rows, headers ] or [ rows, total, headers ]
+ t = isNaN( result[ 0 ] ) && !isNaN( result[ 1 ] );
+ // ensure a zero returned row count doesn't fail the logical ||
+ rr_count = result[ t ? 1 : 0 ];
+ p.totalRows = isNaN( rr_count ) ? p.totalRows || 0 : rr_count;
+ // can't set filtered rows when returning an array
+ c.totalRows = c.filteredRows = p.filteredRows = p.totalRows;
+ // set row data to empty array if nothing found - see http://stackoverflow.com/q/30875583/145346
+ d = p.totalRows === 0 ? [] : result[ t ? 0 : 1 ] || []; // row data
+ th = result[ 2 ]; // headers
+ }
+ l = d && d.length;
+ if ( d instanceof $ ) {
+ if ( wo.pager_processAjaxOnInit ) {
+ // append jQuery object
+ c.$tbodies.eq( 0 ).empty();
+ c.$tbodies.eq( 0 ).append( d );
+ }
+ } else if ( l ) {
+ // build table from array
+ for ( i = 0; i < l; i++ ) {
+ tds += '<tr>';
+ for ( j = 0; j < d[i].length; j++ ) {
+ // build tbody cells; watch for data containing HTML markup - see #434
+ tds += /^\s*<td/.test( d[ i ][ j ] ) ? $.trim( d[ i ][ j ] ) : '<td>' + d[ i ][ j ] + '</td>';
+ }
+ tds += '</tr>';
+ }
+ // add rows to first tbody
+ if ( wo.pager_processAjaxOnInit ) {
+ c.$tbodies.eq( 0 ).html( tds );
+ }
+ }
+ wo.pager_processAjaxOnInit = true;
+ // update new header text
+ if ( th ) {
+ hsh = $table.hasClass( 'hasStickyHeaders' );
+ $sh = hsh ?
+ wo.$sticky.children( 'thead:first' ).children( 'tr:not(.' + c.cssIgnoreRow + ')' ).children() :
+ '';
+ $f = $table.find( 'tfoot tr:first' ).children();
+ // don't change td headers (may contain pager)
+ $headers = c.$headers.filter( 'th' );
+ len = $headers.length;
+ for ( j = 0; j < len; j++ ) {
+ $h = $headers.eq( j );
+ // add new test within the first span it finds, or just in the header
+ if ( $h.find( '.' + ts.css.icon ).length ) {
+ icon = $h.find( '.' + ts.css.icon ).clone( true );
+ $h.find( '.' + ts.css.headerIn ).html( th[ j ] ).append( icon );
+ if ( hsh && $sh.length ) {
+ icon = $sh.eq( j ).find( '.' + ts.css.icon ).clone( true );
+ $sh.eq( j ).find( '.' + ts.css.headerIn ).html( th[ j ] ).append( icon );
+ }
+ } else {
+ $h.find( '.' + ts.css.headerIn ).html( th[ j ] );
+ if ( hsh && $sh.length ) {
+ // add sticky header to container just in case it contains pager controls
+ p.$container = p.$container.add( wo.$sticky );
+ $sh.eq( j ).find( '.' + ts.css.headerIn ).html( th[ j ] );
+ }
+ }
+ $f.eq( j ).html( th[ j ] );
+ }
+ if ( hsh ) {
+ tsp.bindEvents( c );
+ }
+ }
+ }
+ if ( c.showProcessing ) {
+ ts.isProcessing( table ); // remove loading icon
+ }
+ sz = tsp.parsePageSize( c, p.size, 'get' );
+ // make sure last pager settings are saved, prevents multiple server side calls with
+ // the same parameters
+ p.totalPages = sz === 'all' ? 1 : Math.ceil( p.totalRows / sz );
+ p.last.totalRows = p.totalRows;
+ p.last.currentFilters = p.currentFilters;
+ p.last.sortList = ( c.sortList || [] ).join( ',' );
+ p.initializing = false;
+ // update display without triggering pager complete... before updating cache
+ tsp.updatePageDisplay( c, false );
+ // tablesorter core updateCache (not pager)
+ ts.updateCache( c, function() {
+ if ( p.initialized ) {
+ // apply widgets after table has rendered & after a delay to prevent
+ // multiple applyWidget blocking code from blocking this trigger
+ setTimeout( function() {
+ if ( debug ) {
+ console.log( 'Pager >> Triggering pagerChange' );
+ }
+ $table.triggerHandler( 'pagerChange', p );
+ ts.applyWidget( table );
+ tsp.updatePageDisplay( c );
+ }, 0 );
+ }
+ });
+ }
+ if ( !p.initialized ) {
+ ts.applyWidget( table );
+ }
+ },
+
+ getAjax: function( c ) {
+ var counter,
+ url = tsp.getAjaxUrl( c ),
+ $doc = $( document ),
+ namespace = c.namespace + 'pager',
+ p = c.pager;
+ if ( url !== '' ) {
+ if ( c.showProcessing ) {
+ ts.isProcessing( c.table, true ); // show loading icon
+ }
+ $doc.on( 'ajaxError' + namespace, function( e, xhr, settings, exception ) {
+ tsp.renderAjax( null, c, xhr, settings, exception );
+ $doc.off( 'ajaxError' + namespace );
+ });
+ counter = ++p.ajaxCounter;
+ p.last.ajaxUrl = url; // remember processed url
+ p.ajaxObject.url = url; // from the ajaxUrl option and modified by customAjaxUrl
+ p.ajaxObject.success = function( data, status, jqxhr ) {
+ // Refuse to process old ajax commands that were overwritten by new ones - see #443
+ if ( counter < p.ajaxCounter ) {
+ return;
+ }
+ tsp.renderAjax( data, c, jqxhr );
+ $doc.off( 'ajaxError' + namespace );
+ if ( typeof p.oldAjaxSuccess === 'function' ) {
+ p.oldAjaxSuccess( data );
+ }
+ };
+ if ( ts.debug(c, 'pager') ) {
+ console.log( 'Pager >> Ajax initialized', p.ajaxObject );
+ }
+ $.ajax( p.ajaxObject );
+ }
+ },
+
+ getAjaxUrl: function( c ) {
+ var indx, len,
+ p = c.pager,
+ wo = c.widgetOptions,
+ url = wo.pager_ajaxUrl ? wo.pager_ajaxUrl
+ // allow using '{page+1}' in the url string to switch to a non-zero based index
+ .replace( /\{page([\-+]\d+)?\}/, function( s, n ) { return p.page + ( n ? parseInt( n, 10 ) : 0 ); })
+ // this will pass "all" to server when size is set to "all"
+ .replace( /\{size\}/g, p.size ) : '',
+ sortList = c.sortList,
+ filterList = p.currentFilters || c.$table.data( 'lastSearch' ) || [],
+ sortCol = url.match( /\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/ ),
+ filterCol = url.match( /\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/ ),
+ arry = [];
+ if ( sortCol ) {
+ sortCol = sortCol[ 1 ];
+ len = sortList.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ arry[ arry.length ] = sortCol + '[' + sortList[ indx ][ 0 ] + ']=' + sortList[ indx ][ 1 ];
+ }
+ // if the arry is empty, just add the col parameter... '&{sortList:col}' becomes '&col'
+ url = url.replace( /\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g, arry.length ? arry.join( '&' ) : sortCol );
+ arry = [];
+ }
+ if ( filterCol ) {
+ filterCol = filterCol[ 1 ];
+ len = filterList.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( filterList[ indx ] ) {
+ arry[ arry.length ] = filterCol + '[' + indx + ']=' + encodeURIComponent( filterList[ indx ] );
+ }
+ }
+ // if the arry is empty, just add the fcol parameter... '&{filterList:fcol}' becomes '&fcol'
+ url = url.replace( /\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g, arry.length ? arry.join( '&' ) : filterCol );
+ p.currentFilters = filterList;
+ }
+ if ( $.isFunction( wo.pager_customAjaxUrl ) ) {
+ url = wo.pager_customAjaxUrl( c.table, url );
+ }
+ if ( ts.debug(c, 'pager') ) {
+ console.log( 'Pager >> Ajax url = ' + url );
+ }
+ return url;
+ },
+
+ renderTable: function( c, rows ) {
+ var $tb, index, count, added,
+ table = c.table,
+ p = c.pager,
+ wo = c.widgetOptions,
+ debug = ts.debug(c, 'pager'),
+ f = c.$table.hasClass('hasFilters'),
+ l = rows && rows.length || 0, // rows may be undefined
+ e = p.size === 'all' ? p.totalRows : p.size,
+ s = ( p.page * e );
+ if ( l < 1 ) {
+ if ( debug ) {
+ console.warn( 'Pager >> No rows for pager to render' );
+ }
+ // empty table, abort!
+ return;
+ }
+ if ( p.page >= p.totalPages ) {
+ // lets not render the table more than once
+ return tsp.moveToLastPage( c, p );
+ }
+ p.cacheIndex = [];
+ p.isDisabled = false; // needed because sorting will change the page and re-enable the pager
+ if ( p.initialized ) {
+ if ( debug ) {
+ console.log( 'Pager >> Triggering pagerChange' );
+ }
+ c.$table.triggerHandler( 'pagerChange', c );
+ }
+ if ( !wo.pager_removeRows ) {
+ tsp.hideRows( c );
+ } else {
+ ts.clearTableBody( table );
+ $tb = ts.processTbody( table, c.$tbodies.eq(0), true );
+ // not filtered, start from the calculated starting point (s)
+ // if filtered, start from zero
+ index = f ? 0 : s;
+ count = f ? 0 : s;
+ added = 0;
+ while ( added < e && index < rows.length ) {
+ if ( !f || !p.regexFiltered.test( rows[ index ][ 0 ].className ) ) {
+ count++;
+ if ( count > s && added <= e ) {
+ added++;
+ p.cacheIndex[ p.cacheIndex.length ] = index;
+ $tb.append( rows[ index ] );
+ }
+ }
+ index++;
+ }
+ ts.processTbody( table, $tb, false );
+ }
+ tsp.updatePageDisplay( c );
+
+ wo.pager_startPage = p.page;
+ wo.pager_size = p.size;
+ if ( table.isUpdating ) {
+ if ( debug ) {
+ console.log( 'Pager >> Triggering updateComplete' );
+ }
+ c.$table.triggerHandler( 'updateComplete', [ table, true ] );
+ }
+
+ },
+
+ showAllRows: function( c ) {
+ var index, $controls, len,
+ table = c.table,
+ p = c.pager,
+ wo = c.widgetOptions;
+ if ( p.ajax ) {
+ tsp.pagerArrows( c, true );
+ } else {
+ $.data( table, 'pagerLastPage', p.page );
+ $.data( table, 'pagerLastSize', p.size );
+ p.page = 0;
+ p.size = p.totalRows;
+ p.totalPages = 1;
+ c.$table
+ .addClass( 'pagerDisabled' )
+ .removeAttr( 'aria-describedby' )
+ .find( 'tr.pagerSavedHeightSpacer' )
+ .remove();
+ tsp.renderTable( c, c.rowsCopy );
+ p.isDisabled = true;
+ ts.applyWidget( table );
+ if ( ts.debug(c, 'pager') ) {
+ console.log( 'Pager >> Disabled' );
+ }
+ }
+ // disable size selector
+ $controls = p.$container.find(
+ wo.pager_selectors.pageSize + ',' +
+ wo.pager_selectors.gotoPage + ',' +
+ '.ts-startRow, .ts-page'
+ );
+ len = $controls.length;
+ for ( index = 0; index < len; index++ ) {
+ $controls.eq( index )
+ .prop( 'aria-disabled', 'true' )
+ .addClass( wo.pager_css.disabled )[ 0 ].disabled = true;
+ }
+ },
+
+ // updateCache if delayInit: true
+ // this is normally done by 'appendToTable' function in the tablesorter core AFTER a sort
+ updateCache: function( c ) {
+ var p = c.pager;
+ // tablesorter core updateCache (not pager)
+ ts.updateCache( c, function() {
+ if ( !$.isEmptyObject( c.cache ) ) {
+ var index,
+ rows = [],
+ normalized = c.cache[ 0 ].normalized;
+ p.totalRows = normalized.length;
+ for ( index = 0; index < p.totalRows; index++ ) {
+ rows[ rows.length ] = normalized[ index ][ c.columns ].$row;
+ }
+ c.rowsCopy = rows;
+ tsp.moveToPage( c, p, true );
+ // clear out last search to force an update
+ p.last.currentFilters = [ ' ' ];
+ }
+ });
+ },
+
+ moveToPage: function( c, p, pageMoved ) {
+ if ( p.isDisabled ) { return; }
+ if ( pageMoved !== false && p.initialized && $.isEmptyObject( c.cache ) ) {
+ return tsp.updateCache( c );
+ }
+ var tmp,
+ table = c.table,
+ wo = c.widgetOptions,
+ l = p.last,
+ debug = ts.debug(c, 'pager');
+
+ // abort page move if the table has filters and has not been initialized
+ if ( p.ajax && !wo.filter_initialized && ts.hasWidget( table, 'filter' ) ) { return; }
+
+ tsp.parsePageNumber( c, p );
+ tsp.calcFilters( c );
+ // fixes issue where one current filter is [] and the other is [ '', '', '' ],
+ // making the next if comparison think the filters as different. Fixes #202.
+ l.currentFilters = ( l.currentFilters || [] ).join( '' ) === '' ? [] : l.currentFilters;
+ p.currentFilters = ( p.currentFilters || [] ).join( '' ) === '' ? [] : p.currentFilters;
+ // don't allow rendering multiple times on the same page/size/totalRows/filters/sorts
+ if ( l.page === p.page && l.size === p.size && l.totalRows === p.totalRows &&
+ ( l.currentFilters || [] ).join( ',' ) === ( p.currentFilters || [] ).join( ',' ) &&
+ // check for ajax url changes see #730
+ ( l.ajaxUrl || '' ) === ( p.ajaxObject.url || '' ) &&
+ // & ajax url option changes (dynamically add/remove/rename sort & filter parameters)
+ ( l.optAjaxUrl || '' ) === ( wo.pager_ajaxUrl || '' ) &&
+ l.sortList === ( c.sortList || [] ).join( ',' ) ) {
+ return;
+ }
+ if ( debug ) {
+ console.log( 'Pager >> Changing to page ' + p.page );
+ }
+ p.last = {
+ page: p.page,
+ size: p.size,
+ // fixes #408; modify sortList otherwise it auto-updates
+ sortList: ( c.sortList || [] ).join( ',' ),
+ totalRows: p.totalRows,
+ currentFilters: p.currentFilters || [],
+ ajaxUrl: p.ajaxObject.url || '',
+ optAjaxUrl: wo.pager_ajaxUrl
+ };
+ if ( p.ajax ) {
+ if ( !wo.pager_processAjaxOnInit && !$.isEmptyObject(wo.pager_initialRows) ) {
+ wo.pager_processAjaxOnInit = true;
+ tmp = wo.pager_initialRows;
+ p.totalRows = typeof tmp.total !== 'undefined' ? tmp.total :
+ ( debug ? console.error('Pager >> No initial total page set!') || 0 : 0 );
+ p.filteredRows = typeof tmp.filtered !== 'undefined' ? tmp.filtered :
+ ( debug ? console.error('Pager >> No initial filtered page set!') || 0 : 0 );
+ tsp.updatePageDisplay( c, false );
+ } else {
+ tsp.getAjax( c );
+ }
+ } else if ( !p.ajax ) {
+ tsp.renderTable( c, c.rowsCopy );
+ }
+ $.data( table, 'pagerLastPage', p.page );
+ if ( p.initialized && pageMoved !== false ) {
+ if ( debug ) {
+ console.log( 'Pager >> Triggering pageMoved' );
+ }
+ c.$table.triggerHandler( 'pageMoved', c );
+ ts.applyWidget( table );
+ if ( !p.ajax && table.isUpdating ) {
+ if ( debug ) {
+ console.log( 'Pager >> Triggering updateComplete' );
+ }
+ c.$table.triggerHandler( 'updateComplete', [ table, true ] );
+ }
+ }
+ },
+
+ getTotalPages: function( c, p ) {
+ return ts.hasWidget( c.table, 'filter' ) ?
+ Math.min( p.totalPages, p.filteredPages ) :
+ p.totalPages;
+ },
+
+ parsePageNumber: function( c, p ) {
+ var min = tsp.getTotalPages( c, p ) - 1;
+ p.page = parseInt( p.page, 10 );
+ if ( p.page < 0 || isNaN( p.page ) ) { p.page = 0; }
+ if ( p.page > min && min >= 0 ) { p.page = min; }
+ return p.page;
+ },
+
+ // set to either set or get value
+ parsePageSize: function( c, size, mode ) {
+ var p = c.pager,
+ wo = c.widgetOptions,
+ s = parseInt( size, 10 ) || p.size || wo.pager_size || 10;
+ if (p.initialized && (/all/i.test( s + ' ' + size ) || s === p.totalRows)) {
+ // Fixing #1364 & #1366
+ return p.$container.find( wo.pager_selectors.pageSize + ' option[value="all"]').length ?
+ 'all' : p.totalRows;
+ }
+ // "get" to set `p.size` or "set" to set `pageSize.val()`
+ return mode === 'get' ? s : p.size;
+ },
+
+ setPageSize: function( c, size ) {
+ var p = c.pager,
+ table = c.table;
+ // "all" size is only returned if an "all" option exists - fixes #1366
+ p.size = tsp.parsePageSize( c, size, 'get' );
+ p.$container
+ .find( c.widgetOptions.pager_selectors.pageSize )
+ .val( p.size );
+ $.data( table, 'pagerLastPage', tsp.parsePageNumber( c, p ) );
+ $.data( table, 'pagerLastSize', p.size );
+ p.totalPages = p.size === 'all' ? 1 : Math.ceil( p.totalRows / p.size );
+ p.filteredPages = p.size === 'all' ? 1 : Math.ceil( p.filteredRows / p.size );
+ },
+
+ moveToFirstPage: function( c, p ) {
+ p.page = 0;
+ tsp.moveToPage( c, p, true );
+ },
+
+ moveToLastPage: function( c, p ) {
+ p.page = tsp.getTotalPages( c, p ) - 1;
+ tsp.moveToPage( c, p, true );
+ },
+
+ moveToNextPage: function( c, p ) {
+ p.page++;
+ var last = tsp.getTotalPages( c, p ) - 1;
+ if ( p.page >= last ) {
+ p.page = last;
+ }
+ tsp.moveToPage( c, p, true );
+ },
+
+ moveToPrevPage: function( c, p ) {
+ p.page--;
+ if ( p.page <= 0 ) {
+ p.page = 0;
+ }
+ tsp.moveToPage( c, p, true );
+ },
+
+ destroyPager: function( c, refreshing ) {
+ var table = c.table,
+ p = c.pager,
+ s = c.widgetOptions.pager_selectors || {},
+ ctrls = [ s.first, s.prev, s.next, s.last, s.gotoPage, s.pageSize ].join( ',' ),
+ namespace = c.namespace + 'pager';
+ // check pager object in case two successive pager destroys are triggered
+ // e.g. "destroyPager" then "removeWidget" - see #1155
+ if ( p ) {
+ p.initialized = false;
+ c.$table.off( namespace );
+ p.$container
+ // hide pager
+ .hide()
+ // unbind pager controls
+ .find( ctrls )
+ .off( namespace );
+ if ( refreshing ) { return; }
+ c.appender = null; // remove pager appender function
+ tsp.showAllRows( c );
+ if ( ts.storage ) {
+ ts.storage( table, c.widgetOptions.pager_storageKey, '' );
+ }
+ p.$container = null;
+ c.pager = null;
+ c.rowsCopy = null;
+ }
+ },
+
+ enablePager: function( c, triggered ) {
+ var info, size,
+ table = c.table,
+ p = c.pager,
+ wo = c.widgetOptions,
+ $el = p.$container.find( wo.pager_selectors.pageSize );
+ p.isDisabled = false;
+ p.page = $.data( table, 'pagerLastPage' ) || p.page || 0;
+ size = $el.find('option[selected]' ).val();
+ p.size = $.data( table, 'pagerLastSize' ) || tsp.parsePageSize( c, size, 'get' );
+ tsp.setPageSize( c, p.size ); // set page size
+ p.totalPages = p.size === 'all' ? 1 : Math.ceil( tsp.getTotalPages( c, p ) / p.size );
+ c.$table.removeClass( 'pagerDisabled' );
+ // if table id exists, include page display with aria info
+ if ( table.id && !c.$table.attr( 'aria-describedby' ) ) {
+ $el = p.$container.find( wo.pager_selectors.pageDisplay );
+ info = $el.attr( 'id' );
+ if ( !info ) {
+ // only add pageDisplay id if it doesn't exist - see #1288
+ info = table.id + '_pager_info';
+ $el.attr( 'id', info );
+ }
+ c.$table.attr( 'aria-describedby', info );
+ }
+ tsp.changeHeight( c );
+ if ( triggered ) {
+ // tablesorter core update table
+ ts.update( c );
+ tsp.setPageSize( c, p.size );
+ tsp.moveToPage( c, p, true );
+ tsp.hideRowsSetup( c );
+ if ( ts.debug(c, 'pager') ) {
+ console.log( 'Pager >> Enabled' );
+ }
+ }
+ },
+
+ appender: function( table, rows ) {
+ var c = table.config,
+ wo = c.widgetOptions,
+ p = c.pager;
+ if ( !p.ajax ) {
+ c.rowsCopy = rows;
+ p.totalRows = wo.pager_countChildRows ? c.$tbodies.eq( 0 ).children( 'tr' ).length : rows.length;
+ p.size = $.data( table, 'pagerLastSize' ) || p.size || wo.pager_size || p.setSize || 10;
+ p.totalPages = p.size === 'all' ? 1 : Math.ceil( p.totalRows / p.size );
+ tsp.moveToPage( c, p );
+ // update display here in case all rows are removed
+ tsp.updatePageDisplay( c, false );
+ } else {
+ tsp.moveToPage( c, p, true );
+ }
+ }
+
+ };
+
+ // see #486
+ ts.showError = function( table, xhr, settings, exception ) {
+ var $table = $( table ),
+ c = $table[ 0 ].config,
+ wo = c && c.widgetOptions,
+ errorRow = c.pager && c.pager.cssErrorRow ||
+ wo && wo.pager_css && wo.pager_css.errorRow ||
+ 'tablesorter-errorRow',
+ typ = typeof xhr,
+ valid = true,
+ message = '',
+ removeRow = function() {
+ c.$table.find( 'thead' ).find( c.selectorRemove ).remove();
+ };
+
+ if ( !$table.length ) {
+ console.error( 'tablesorter showError: no table parameter passed' );
+ return;
+ }
+
+ // ajaxError callback for plugin or widget - see #992
+ if ( typeof c.pager.ajaxError === 'function' ) {
+ valid = c.pager.ajaxError( c, xhr, settings, exception );
+ if ( valid === false ) {
+ return removeRow();
+ } else {
+ message = valid;
+ }
+ } else if ( typeof wo.pager_ajaxError === 'function' ) {
+ valid = wo.pager_ajaxError( c, xhr, settings, exception );
+ if ( valid === false ) {
+ return removeRow();
+ } else {
+ message = valid;
+ }
+ }
+
+ if ( message === '' ) {
+ if ( typ === 'object' ) {
+ message =
+ xhr.status === 0 ? 'Not connected, verify Network' :
+ xhr.status === 404 ? 'Requested page not found [404]' :
+ xhr.status === 500 ? 'Internal Server Error [500]' :
+ exception === 'parsererror' ? 'Requested JSON parse failed' :
+ exception === 'timeout' ? 'Time out error' :
+ exception === 'abort' ? 'Ajax Request aborted' :
+ 'Uncaught error: ' + xhr.statusText + ' [' + xhr.status + ']';
+ } else if ( typ === 'string' ) {
+ // keep backward compatibility (external usage just passes a message string)
+ message = xhr;
+ } else {
+ // remove all error rows
+ return removeRow();
+ }
+ }
+
+ // allow message to include entire row HTML!
+ $( /tr\>/.test( message ) ?
+ message :
+ '<tr><td colspan="' + c.columns + '">' + message + '</td></tr>'
+ )
+ .click( function() {
+ $( this ).remove();
+ })
+ // add error row to thead instead of tbody, or clicking on the header will result in a parser error
+ .appendTo( c.$table.find( 'thead:first' ) )
+ .addClass( errorRow + ' ' + c.selectorRemove.slice( 1 ) )
+ .attr({
+ role: 'alert',
+ 'aria-live': 'assertive'
+ });
+
+ };
+
+})(jQuery);