text: (function(a){if(typeof define==="function"&&define.amd){define(["jquery"],function(b){return a(b,window,document)})}else{if(typeof exports==="object"){module.exports=function(b,c){if(!b){b=window}if(!c){c=typeof window!=="undefined"?require("jquery"):require("jquery")(b)}return a(c,b,b.document)}}else{a(jQuery,window,document)}}}(function(h,j,k,d){var f=h.fn.dataTable;var b=f.ext.columnFilters;var n=function o(w){if(w===d){return[]}var v=j.location.search.substring(1),u=v.split("&"),t,s,q=[];for(s=0;s<u.length;s++){t=decodeURIComponent(u[s]).split("=");var r=t[0];var x=t[1];if(r.indexOf(w)>-1){q.push([t[0].substring(r.lastIndexOf(w)+w.length+1),t[1]])}}return q};var p=function(s,r){var q=new f.Api(s);this.c=h.extend(true,[],p.defaults,r);var t=q.settings()[0];if(t._columnFilters){throw"ColumnFilters already initialized on table "+t.nTable.id}t._columnFilters=this;this.s={dt:q,columnFilters:[],filterPresets:n(q.settings()[0].oInit.sapTableId),displayedColumnFilters:h()};this._constructor()};var c=function(q,r,s){this.idx=q;this.context=r;this.element=h();this.state=[];this.number=0;this.id=s};c.prototype.addElement=function(){};c.prototype.addListeners=function(){};c.prototype.setState=function(q){};c.prototype.search=function(){};c.prototype.getState=function(){return this.state};c.prototype.checkDefaults=function(){if(this.id){var q=this.context.s.filterPresets;for(var r=0;r<q.length;r++){if(q[r][0]===this.id){this.addDefaults(q[r][1])}}this.context.s.dt.draw()}};c.prototype.saveState=function(q){if(this.context.s.saveState&&this.state!==q){this.state=q;this.element.trigger("triggerSave")}};c.prototype.addDefaults=function(){};var m=function(q,s,r,t){c.call(this,q,r,t);this.bRegex=s;this.number=1};m.prototype=Object.create(c.prototype);m.prototype.constructor=m;m.prototype.addElement=function(){var q=h('<th><span class="filter_column filter_text"><input class="display" type="text" value="" placeholder="'+this.context.s.dt.i18n("sSearchColumnPlaceholder")+'" /><span class="tablesearch"/></span></th>');h.data(q,"type","text");h.data(q,"bRegex",this.bRegex);this.element=q};m.prototype.addListeners=function(){var r=this.element;var q=this.context.s.dt.column(this.idx);var s=this;r.find("input").on("keyup change",function(){if(q.search()!==this.value){q.search(this.value,h.data(r,"bRegex")).draw();s.saveState(this.value)}})};m.prototype.addDefaults=function(s){var r=this.element;var q=this.context.s.dt.column(this.idx);r.find("input").val(s);q.search(s,h.data(r,"bRegex"));q.draw()};m.prototype.setState=function(q){this.addDefaults(q);this.saveState(q)};var i=function(q,s,r,t){m.call(this,q,s,r,t);this.number=2};i.prototype=Object.create(m.prototype);i.prototype.constructor=i;i.prototype.addElement=function(){var q=h('<th><span class="filter_column filter_text number_filter"><input class="display" type="number" value="" placeholder="Filter" /><span class="tablesearch"/></span></th>');h.data(q,"type","text");this.element=q};var g=function(q,r,s){c.call(this,q,r,s);this.number=3};g.prototype=Object.create(c.prototype);g.prototype.constructor=g;g.prototype.normalizeSearchQueries=function(r){try{h(r);return r}catch(q){return r.replace(/&(?:[a-z\d]+|#\d+|#x[a-f\d]+);/ig,"").replace(/([\!\#\$\%\\&;(\)\*\+,\.\/:=<>\?@\[\]\^\`\{\|\}\~'"])/g,"")}};g.prototype.addElement=function(){var u=this.context.s.dt.column(this.idx);var x=h(u.nodes().to$());var y=this;var C=this.idx;var F={blankLabel:this.context.s.dt.i18n("sEmptyCells"),filter:this.context.s.dt.i18n("sFilter")===""?"Filter":this.context.s.dt.i18n("sFilter"),selectAll:this.context.s.dt.i18n("sSelectAll")===""?"Select All":this.context.s.dt.i18n("sSelectAll"),removeFilter:this.context.s.dt.i18n("sRemoveFilter")===""?"Remove Filter":this.context.s.dt.i18n("sRemoveFilter")};var A=[];var E=[];var s=function(G){h.each(G,function(H,J){if(h(J).find("li.sli").length===0){var I=h("<item>"+J.innerHTML+"</item>");h(I).html(h.trim(h(I).html()));if(A.indexOf(h(I).html())===-1){A.push(h(I).html());E.push(h(I).text().replace("<","").replace(">","").trim())}}else{h(J).find("li.sli").each(function(){h(this).html(h.trim(h(this).html()));if(A.indexOf(h(this).html())===-1){A.push(h(this).html());E.push(h(this).text().replace("<","").replace(">","").trim())}})}})};s(x);var z=B(A,E,F);var r=h("<div><label><a href='#'><span class='hida'>"+F.filter+"</span></a></label></div>");h(r).append("<div class='multiSelect'></div>");h(r.children(".multiSelect")).html(z);var q=h('<th class="dropdown"> </th>');q.append(r);h.fn.dataTable.ext.search.push(function(I,Q,K,H){if(I.nTable.id!==y.context.id){return true}var M=[];var O=h(q).find(".multiSelect input:checked");if(O.length===0){return true}h.each(O,function(R,S){M.push(y.normalizeSearchQueries(h(S).attr("data-label")))});var L=[];var J=false;var N=y.context.s.dt.cell(K,C).nodes().to$();h(N).find("li.sli").each(function(){J=true;var R=y.normalizeSearchQueries(h(this).text().replace("<","").replace(">","").trim());L.push(R);h(this).removeClass("dt_highlight")});if(!J){var P=h(N).text().trim();L.push(y.normalizeSearchQueries(P))}var G=M.filter(function(R){return L.indexOf(R)!==-1});y.saveState(M);if(G.length>0){return true}else{return false}});h.data(q,"type","select");this.element=q;function w(G){return G.replace(/[\"&<>]/g,function(H){return{'"':"&quot;","&":"&amp;","<":"&lt;",">":"&gt;"}[H]})}function t(J,H,G){var I=h("<li class='sli'></li>");I.append(h("<input type='checkbox' value='"+w(J)+"' data-label='"+H+"'/>"));I.append(G);return I}function D(G){var I=h("<li class='sli list-function remove-filter'></li>");var H=h("<a href='#'></a>");H.text(G);I.append(H);return I}function v(G){var I=h("<li class='sli list-function select-all'></li>");var H=h("<a href='#'></a>");H.text(G);I.append(H);return I}function B(K,N,O){var I=[];var J=false;var L="";for(var H=0;H<K.length;H++){var G=t(K[H],N[H],N[H]);if(N[H]===""){L=K[H];J=true}else{I.push(G)}}I.sort(function(Q,P){return h(Q).text().toUpperCase().localeCompare(h(P).text().toUpperCase())});var M=h("<ul></ul>");h.each(I,function(P,Q){M.append(Q)});if(J){M.prepend(t(L,"",O.blankLabel))}M.prepend(D(O.removeFilter));M.prepend(v(O.selectAll));return M}};g.prototype.addListeners=function(){var s=this.element;var q=this.context;var r=this;s.find(".multiSelect").hide();s.find("label").on("click",function(){h(this).next(".multiSelect").toggle();return false});s.find(".select-all").children().on("click",function(){h(this).parent().siblings().find("input:checkbox:not(checked)").prop("checked",true);q.s.dt.draw();return false});s.find(".remove-filter").children().on("click",function(){h(this).parent().siblings().find("input:checkbox:checked").prop("checked",false);q.s.dt.draw();return false});s.find(".multiSelect").on("change",function(){q.s.dt.draw()})};g.prototype.addDefaults=function(r){var q=this;this.element.find("input").each(function(s){if(h(this).attr("data-label")===r||q.normalizeSearchQueries(h(this).attr("data-label"))===r){h(this).prop("checked",true)}})};g.prototype.setState=function(q){for(var r=0;r<q.length;r++){this.addDefaults(q[r])}};var e=function(q,r,s){c.call(this,q,r,s);this.number=4};e.prototype=Object.create(c.prototype);e.prototype.constructor=e;e.prototype.addElement=function(){var r=h('<th class="number-range"></th>');var u=h('<input class="dt-from" type="number" placeholder="'+this.context.s.dt.i18n("sFrom")+'" min="0">');var t=h('<input class="dt-to" type="number" placeholder="'+this.context.s.dt.i18n("sTo")+'" min="0">');var s=this;var q=this.idx;r.append(u);r.append(t);h.data(r,"type","number-range");h.fn.dataTable.ext.search.push(function(z,B,x,w){if(z.nTable.id!==s.context.id){return true}var y=u.val();var v=t.val();s.saveState([y,v]);var A=B[q]==="-"?"":B[q]*1;if(y===""&&v===""){return true}else{if(y===""&&A<=v){return true}else{if(y<=A&&""===v){return true}else{if(y<=A&&A<=v){return true}}}}return false});this.element=r};e.prototype.addListeners=function(){var r=this.element;var q=this.context.s.dt.column(this.idx);r.find("input").on("keyup change",function(){q.draw()})};e.prototype.setState=function(q){var r=this.element;r.find("input.dt-from").val(q[0]);r.find("input.dt-to").val(q[1])};var l=function(q,r,s){c.call(this,q,r,s);this.number=5};l.prototype=Object.create(c.prototype);l.prototype.constructor=l;l.prototype.addElement=function(){var s=h('<th class="filter_column filter_number cell-range"></th>');var r=h('<input type="number" placeholder="'+this.context.s.dt.i18n("sSearchRange")+'" min="0"></input>');s.append(r);h.data(s,"type","cell-range");var t=this;var q=this.idx;h.fn.dataTable.ext.search.push(function(v,B,y,u){if(v.nTable.id!==t.context.id){return true}var z=r.val();t.saveState(z);if(z===""){return true}z=z*1;var D=B[q];var E=new RegExp("^[0-9]+$");var x=new RegExp("^[0-9]+-[0-9]+");if(E.test(D)){if(z===D){return true}}else{if(x.test(D)){var C=D.split("-");var w=C[0];var A=C[1];if(w<=z&&z<=A){return true}}}return false});this.element=s};l.prototype.addListeners=function(){var r=this.element;var q=this.context.s.dt.column(this.idx);r.find("input").on("keyup change",function(){q.draw()})};l.prototype.addDefaults=function(r){var q=this.element;q.find("input").val(r);this.context.s.dt.column(this.idx).draw()};l.prototype.setState=function(q){this.addDefaults(q);this.saveState(q)};var a=function(q,r){c.call(this,q,r);this.number=6};a.prototype=Object.create(c.prototype);a.prototype.constructor=a;a.prototype.addElement=function(){var q=h("<th></th>");h.data(q,"type","none");this.element=q};h.extend(p.prototype,{add:function(u,y){var t={type:"text",bRegex:"false",id:""};var s=h.extend(true,{},t,u);var x=s.type;var w=s.bRegex;var r=s.id;var v=this;if(x==="text"){var q=new m(y,w,v,r)}else{if(x==="number"){var q=new i(y,w,v,r)}else{if(x==="select"){var q=new g(y,v,r)}else{if(x==="number-range"){var q=new e(y,v,r)}else{if(x==="cell-range"){var q=new l(y,v,r)}else{var q=new a(y,v,r)}}}}}q.addElement();this.s.columnFilters.push(q);return this},_constructor:function(){var w=this;var t=this.s.dt;var r=t.settings()[0].sInstance;var s=r+"_filterrow";this.id=r;var v=h("#"+r);var B=this.s.columnFilters;if(t.settings()[0].oInit.searchHighlight){var y="highlight-init"}else{var y="init.dt.dth"}this.s.displayedColumnFilters=h("<tr></tr>").attr("id",s);h("#"+r).find("thead").first().append(this.s.displayedColumnFilters);for(var u=0;u<this.c.length;u++){this.add(this.c[u],u)}this._update();var A=t.settings()[0].oInit.bStateSave;this.s.saveState=A;var z="DataTables_"+r;for(var u=0;u<B.length;u++){z+=B[u].number}var q=z;if(A){v.on(y,function(){var C=localStorage.getItem(q);if(C!==null){var D=JSON.parse(C);for(var x=0;x<w.c.length;x++){B[x].setState(D.columnValues[x])}}});v.on("triggerSave",function(){var C=localStorage.getItem(q);if(C!==null){var D=JSON.parse(C)}else{var D=t.state()}if(D.columnValues===d){D.columnValues=new Array(w.c.length)}for(var x=0;x<w.c.length;x++){D.columnValues[x]=B[x].getState()}localStorage.setItem(q,JSON.stringify(D))})}else{v.on(y,function(){for(var x=0;x<w.c.length;x++){B[x].checkDefaults()}for(var x=0;x<w.s.filterPresets.length;x++){var C=w.s.filterPresets[x];if(C[0]===""){var D=C[1];t.search(D).draw()}}})}h(k).on("column-visibility.dt","#"+r,function(){w._update()});h(k).bind("click",function(C){var x=h(C.target);if(!x.parents().hasClass("dropdown")){h(".dropdown .multiSelect").hide()}})},_update:function(){var t=this.s.displayedColumnFilters;t.empty();var q=[];this.s.dt.columns().every(function(){if(this.visible()){q.push(this.index())}});var u=this.s.columnFilters;for(var r=0;r<u.length;r++){var s=u[r];if(q.indexOf(s.idx)>-1){h(t).append(s.element);s.addListeners()}}}});p.defaults={};jQuery.fn.dataTableExt.oSort["alpha-numeric-asc"]=function(q,u){var s=new RegExp("^([a-zA-Z]*)(.*)");var r=s.exec(q);var t=s.exec(u);if(r[1]>t[1]){return 1}if(r[1]<t[1]){return -1}r[2]=parseInt(r[2]);t[2]=parseInt(t[2]);if(r[2]<t[2]){return -1}if(r[2]>t[2]){return 1}else{return 0}};jQuery.fn.dataTableExt.oSort["alpha-numeric-desc"]=function(q,u){var s=new RegExp("^([a-zA-Z]*)(.*)");var r=s.exec(q);var t=s.exec(u);if(r[1]>t[1]){return -1}if(r[1]<t[1]){return 1}r[2]=parseInt(r[2]);t[2]=parseInt(t[2]);if(r[2]<t[2]){return 1}if(r[2]>t[2]){return -1}else{return 0}};h.fn.dataTable.ColumnFilters=p;h.fn.DataTable.ColumnFilters=p;h(k).on("init.dt plugin-init.dt",function(s,q){if(s.namespace!=="dt"){return}var r=q.oInit.columnFilters||f.defaults.columnFilters;if(r&&!q._columnFilters){new p(q,r)}})}));