/*!
Copyright 2015-2021 SpryMedia Ltd.
This source file is free software, available under the following license:
MIT license - http://datatables.net/license/mit
This source file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
For details please refer to: http://www.datatables.net/extensions/select
Select for DataTables 1.3.4-dev
2015-2021 SpryMedia Ltd - datatables.net/license/mit
*/
(function(h){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(r){return h(r,window,document)}):"object"===typeof exports?module.exports=function(r,v){r||(r=window);v&&v.fn.dataTable||(v=require("datatables.net")(r,v).$);return h(v,r,r.document)}:h(jQuery,window,document)})(function(h,r,v,l){function I(a,b,c){var d=function(g,f){if(g>f){var k=f;f=g;g=k}var n=!1;return a.columns(":visible").indexes().filter(function(q){q===g&&(n=!0);return q===f?(n=!1,!0):n})};var e=
function(g,f){var k=a.rows({search:"applied"}).indexes();if(k.indexOf(g)>k.indexOf(f)){var n=f;f=g;g=n}var q=!1;return k.filter(function(y){y===g&&(q=!0);return y===f?(q=!1,!0):q})};a.cells({selected:!0}).any()||c?(d=d(c.column,b.column),c=e(c.row,b.row)):(d=d(0,b.column),c=e(0,b.row));c=a.cells(c,d).flatten();a.cells(b,{selected:!0}).any()?a.cells(c).deselect():a.cells(c).select()}function C(a){var b=a.settings()[0]._select.selector;h(a.table().container()).off("mousedown.dtSelect",b).off("mouseup.dtSelect",
b).off("click.dtSelect",b);h("body").off("click.dtSelect"+D(a.table().node()))}function J(a){var b=h(a.table().container()),c=a.settings()[0],d=c._select.selector,e;b.on("mousedown.dtSelect",d,function(g){if(g.shiftKey||g.metaKey||g.ctrlKey)b.css("-moz-user-select","none").one("selectstart.dtSelect",d,function(){return!1});r.getSelection&&(e=r.getSelection())}).on("mouseup.dtSelect",d,function(){b.css("-moz-user-select","")}).on("click.dtSelect",d,function(g){var f=a.select.items();if(e){var k=r.getSelection();
if((!k.anchorNode||h(k.anchorNode).closest("table")[0]===a.table().node())&&k!==e)return}k=a.settings()[0];var n=a.settings()[0].oClasses.sWrapper.trim().replace(/ +/g,".");if(h(g.target).closest("div."+n)[0]==a.table().container()&&(n=a.cell(h(g.target).closest("td, th")),n.any())){var q=h.Event("user-select.dt");u(a,q,[f,n,g]);q.isDefaultPrevented()||(q=n.index(),"row"===f?(f=q.row,E(g,a,k,"row",f)):"column"===f?(f=n.index().column,E(g,a,k,"column",f)):"cell"===f&&(f=n.index(),E(g,a,k,"cell",f)),
k._select_lastCell=q)}});h("body").on("click.dtSelect"+D(a.table().node()),function(g){!c._select.blurable||h(g.target).parents().filter(a.table().container()).length||0===h(g.target).parents("html").length||h(g.target).parents("div.DTE").length||z(c,!0)})}function u(a,b,c,d){if(!d||a.flatten().length)"string"===typeof b&&(b+=".dt"),c.unshift(a),h(a.table().node()).trigger(b,c)}function N(a){var b=a.settings()[0];if(b._select.info&&b.aanFeatures.i&&"api"!==a.select.style()){var c=a.rows({selected:!0}).flatten().length,
d=a.columns({selected:!0}).flatten().length,e=a.cells({selected:!0}).flatten().length,g=function(f,k,n){f.append(h('').append(a.i18n("select."+k+"s",{_:"%d "+k+"s selected",0:"",1:"1 "+k+" selected"},n)))};h.each(b.aanFeatures.i,function(f,k){k=h(k);f=h('');g(f,"row",c);g(f,"column",d);g(f,"cell",e);var n=k.children("span.select-info");n.length&&n.remove();""!==f.text()&&k.append(f)})}}function O(a){var b=new m.Api(a);a._select_init=!0;a.aoRowCreatedCallback.push({fn:function(c,
d,e){d=a.aoData[e];d._select_selected&&h(c).addClass(a._select.className);c=0;for(e=a.aoColumns.length;cg){var f=g;g=d;d=f}e.splice(g+1,e.length);e.splice(0,d)}else e.splice(h.inArray(c,e)+1,e.length);a[b](c,{selected:!0}).any()?(e.splice(h.inArray(c,e),1),a[b+"s"](e).deselect()):a[b+"s"](e).select()}function z(a,b){if(b||"single"===a._select.style)a=new m.Api(a),a.rows({selected:!0}).deselect(),a.columns({selected:!0}).deselect(),a.cells({selected:!0}).deselect()}function E(a,b,c,d,e){var g=b.select.style(),f=b.select.toggleable(),k=b[d](e,{selected:!0}).any();
if(!k||f)"os"===g?a.ctrlKey||a.metaKey?b[d](e).select(!k):a.shiftKey?"cell"===d?I(b,e,c._select_lastCell||null):K(b,d,e,c._select_lastCell?c._select_lastCell[d]:null):(a=b[d+"s"]({selected:!0}),k&&1===a.flatten().length?b[d](e).deselect():(a.deselect(),b[d](e).select())):"multi+shift"==g?a.shiftKey?"cell"===d?I(b,e,c._select_lastCell||null):K(b,d,e,c._select_lastCell?c._select_lastCell[d]:null):b[d](e).select(!k):b[d](e).select(!k)}function D(a){return a.id.replace(/[^a-zA-Z0-9\-_]/g,"-")}function A(a,
b){return function(c){return c.i18n("buttons."+a,b)}}function F(a){a=a._eventNamespace;return"draw.dt.DT"+a+" select.dt.DT"+a+" deselect.dt.DT"+a}function P(a,b){return-1!==h.inArray("rows",b.limitTo)&&a.rows({selected:!0}).any()||-1!==h.inArray("columns",b.limitTo)&&a.columns({selected:!0}).any()||-1!==h.inArray("cells",b.limitTo)&&a.cells({selected:!0}).any()?!0:!1}var m=h.fn.dataTable;m.select={};m.select.version="1.3.4-dev";m.select.init=function(a){var b=a.settings()[0];if(!b._select){var c=
a.state.loaded(),d=function(t,G,p){if(null!==p&&p.select!==l){a.rows().deselect();a.columns().deselect();a.cells().deselect();p.select.rows!==l&&a.rows(p.select.rows).select();p.select.columns!==l&&a.columns(p.select.columns).select();if(p.select.cells!==l)for(t=0;t