"use strict";app.directive("rowSelect",function(){return{restrict:"EA",scope:{selectedIndices:"=selectedIndices"},link:function(e,c,s){function d(c){1==e.selectedIndices.length?e.selectedIndices[0]!=c&&(e.selectedIndices[0]=c):(e.selectedIndices=[],e.selectedIndices=[c])}function t(c){if(0!=e.selectedIndices.length){var s=e.selectedIndices[0],d=c;if(e.selectedIndices=[],s>d)for(var t=s;t>=d;t--)e.selectedIndices.push(t);else for(var i=s;i<=d;i++)e.selectedIndices.push(i)}}function i(c){var s=e.selectedIndices.indexOf(c);s==-1?e.selectedIndices.push(c):e.selectedIndices.splice(s,1)}function n(c){var s=e.selectedIndices,d=s.reverse()[0];if(c>d)for(var t=d;t<=c;t++)e.selectedIndices.indexOf(t)===-1&&e.selectedIndices.push(t);else for(var i=c;i<=d;i++)e.selectedIndices.indexOf(i)===-1&&e.selectedIndices.push(i)}e.selectedIndices=e.selectedIndices||[],c.bind("click",function(c){c.preventDefault();var s=e.$parent.$index;c.shiftKey||c.ctrlKey||e.$apply(d(s)),c.shiftKey&&!c.ctrlKey&&e.$apply(t(s)),!c.shiftKey&&c.ctrlKey&&e.$apply(i(s)),c.shiftKey&&c.ctrlKey&&e.$apply(n(s))})}}});