<commit_before>(function(µ,SMOD,GMOD,HMOD,SC){
	
	var Tab=GMOD("Tab");
	var goPath=GMOD("goPath");
	
	SC=SC({
		org:"Organizer",
		rs:"rescope",
		rq:"request"
	});
	
	//TODO var fields=[]
	
	var guides={
		network:goPath.guide("network"),
		channel:goPath.guide("channel"),
		bot:goPath.guide("bot"),
		name:goPath.guide("name"),
		packnumber:p=>parseInt(p.packnumber,10)||p.packnumber,
		size:p=>parseFloat(p.size.replace(/K$/i,"e-3").replace(/G$/i,"e+3"))||p.size,
		subber:p=>
		{
			var m=p.name.match(/^\[([^\]]+)/);
			if(m)return m[1];
			return "no subber found";
		}
	};
	
	var SR=µ.Class(Tab,{
		init:function(header,results)
		{
			this.mega(header);
			SC.rs.all(this,["_onFilter","_onListClick","_onAction","updateFilters"]);
			
			this.org=new SC.org(results);
			for(var g in guides) this.org.sort(g,SC.org.sortGetter(guides[g]));

			var groups=["subber","bot","network"];
			for(var g of groups) this.org.group(g,guides[g]);
			
			this.sortColumn=null;
			this.desc=false;
			this.filterExp=null;
			
			this.content.classList.add("searchResult");
			var contentHTML='\
<div class="control">\
	<form><input type="text" name="filter" placeholder="filter"><button type="submit">filter</button></form>\
	<div class="actions">\
		<button data-action="showSelected">show selected</button>\
		<button data-action="download">download</button>\
	</div>\
</div>\
<div class="resultList">\
	<header style="order:-1;">\
		<span class="col-network">network</span>\
		<span class="col-channel">channel</span>\
		<span class="col-bot">bot</span>\
		<span class="col-name">name</span>\
		<span class="col-packnumber">packnumber</span>\
		<span class="col-size">size</span>\
	</header>\n'+
	results.map((r,i)=>'<div data-index="'+i+'">'+
		'<span class="col-network" title="'+r.network+'">'+r.network+'</span>'+
		'<span class="col-channel" title="'+r.channel+'">'+r.channel+'</span>'+
		'<span class="col-bot" title="'+r.bot+'">'+r.bot+'</span>'+
		'<span class="col-name" title="'+r.name+'">'+r.name+'</span>'+
		'<span class="col-packnumber" title="'+r.packnumber+'">'+r.packnumber+'</span>'+
		'<span class="col-size" title="'+r.size+'">'+r.size+'</span>'+
	'</div>').join("\n")+'\
</div>\
<div class="filters">\n';
	for(var g of groups)
	{
		var parts=Object.keys(this.org.getGroup(g));
		contentHTML+='<fieldset><legend>'+g+'</legend><select data-group="'+g+'" multiple="true">'+
			parts.map(p=>'<option value="'+p+'">'+p+'</option>').join("\n")+
		'</select></fieldset>';
	}
+'</div>';

			this.content.innerHTML=contentHTML;
			this.content.querySelector("form").addEventListener("submit",this._onFilter);
			this.content.querySelector(".actions").addEventListener("click",this._onAction);
			this.content.querySelector(".filters").addEventListener("change",this.updateFilters);
			this.resultList=this.content.querySelector(".resultList");
			this.resultList.addEventListener("click",this._onListClick);
			
			this.sort("name",false);
		},
		_onFilter:function(e)
		{
			e.preventDefault();
			this.filter(e.target.filter.value);
			return false;
		},
		filter:function(filter)
		{
			if(filter)
			{
				this.filterExp=filter.toUpperCase();
				if(!this.org.hasFilter(this.filterExp))
				{
					var exp=new RegExp(this.filterExp.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,".*"),"i");
					this.org.filter(this.filterExp,a=>exp.test(a.name));
				}
			}
			else this.filterExp=null;
			this.updateFilters();
		},
		_onListClick:function(e)
		{
			var row=e.target;
			while(row.parentNode&&row.parentNode!=this.resultList)row=row.parentNode;
			if(row.parentNode)
			{
				if(row.tagName==="HEADER")
				{
					this.sort(e.target.textContent);
				}
				else
				{
					if(!e.ctrlKey)
					{
						var selected=this.resultList.querySelectorAll(".selected");
						for(var i=0;i<selected.length;i++)selected[i].classList.remove("selected");
					}
					row.classList.toggle("selected");
				}
			}
			e.preventDefault();
			return false;
		},<commit_msg>select with drag<commit_after>(function(µ,SMOD,GMOD,HMOD,SC){
	
	var Tab=GMOD("Tab");
	var goPath=GMOD("goPath");
	
	SC=SC({
		org:"Organizer",
		rs:"rescope",
		rq:"request",
		it:"iterate"
	});
	
	//TODO var fields=[]
	
	var guides={
		network:goPath.guide("network"),
		channel:goPath.guide("channel"),
		bot:goPath.guide("bot"),
		name:goPath.guide("name"),
		packnumber:p=>parseInt(p.packnumber,10)||p.packnumber,
		size:p=>parseFloat(p.size.replace(/K$/i,"e-3").replace(/G$/i,"e+3"))||p.size,
		subber:p=>
		{
			var m=p.name.match(/^\[([^\]]+)/);
			if(m)return m[1];
			return "no subber found";
		}
	};
	
	var SR=µ.Class(Tab,{
		init:function(header,results)
		{
			this.mega(header);
			SC.rs.all(this,["_onFilter","_onListClick","_onListMouseDown","_onAction","updateFilters"]);
			
			this.org=new SC.org(results);
			for(var g in guides) this.org.sort(g,SC.org.sortGetter(guides[g]));

			var groups=["subber","bot","network"];
			for(var g of groups) this.org.group(g,guides[g]);
			
			this.sortColumn=null;
			this.desc=false;
			this.filterExp=null;
			
			this.content.classList.add("searchResult");
			var contentHTML='\
<div class="control">\
	<form><input type="text" name="filter" placeholder="filter"><button type="submit">filter</button></form>\
	<div class="actions">\
		<button data-action="showSelected">show selected</button>\
		<button data-action="download">download</button>\
	</div>\
</div>\
<div class="resultList">\
	<header style="order:-1;">\
		<span class="col-network">network</span>\
		<span class="col-channel">channel</span>\
		<span class="col-bot">bot</span>\
		<span class="col-name">name</span>\
		<span class="col-packnumber">packnumber</span>\
		<span class="col-size">size</span>\
	</header>\n'+
	results.map((r,i)=>'<div data-index="'+i+'">'+
		'<span class="col-network" title="'+r.network+'">'+r.network+'</span>'+
		'<span class="col-channel" title="'+r.channel+'">'+r.channel+'</span>'+
		'<span class="col-bot" title="'+r.bot+'">'+r.bot+'</span>'+
		'<span class="col-name" title="'+r.name+'">'+r.name+'</span>'+
		'<span class="col-packnumber" title="'+r.packnumber+'">'+r.packnumber+'</span>'+
		'<span class="col-size" title="'+r.size+'">'+r.size+'</span>'+
	'</div>').join("\n")+'\
</div>\
<div class="filters">\n';
	for(var g of groups)
	{
		var parts=Object.keys(this.org.getGroup(g));
		contentHTML+='<fieldset><legend>'+g+'</legend><select data-group="'+g+'" multiple="true">'+
			parts.map(p=>'<option value="'+p+'">'+p+'</option>').join("\n")+
		'</select></fieldset>';
	}
+'</div>';

			this.content.innerHTML=contentHTML;
			this.content.querySelector("form").addEventListener("submit",this._onFilter);
			this.content.querySelector(".actions").addEventListener("click",this._onAction);
			this.content.querySelector(".filters").addEventListener("change",this.updateFilters);
			this.resultList=this.content.querySelector(".resultList");
			this.resultList.addEventListener("click",this._onListClick);
			this.resultList.addEventListener("mousedown",this._onListMouseDown);
			
			this.sort("name",false);
		},
		_onFilter:function(e)
		{
			e.preventDefault();
			this.filter(e.target.filter.value);
			return false;
		},
		filter:function(filter)
		{
			if(filter)
			{
				this.filterExp=filter.toUpperCase();
				if(!this.org.hasFilter(this.filterExp))
				{
					var exp=new RegExp(this.filterExp.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,".*"),"i");
					this.org.filter(this.filterExp,a=>exp.test(a.name));
				}
			}
			else this.filterExp=null;
			this.updateFilters();
		},
		_onListClick:function(e)
		{
			var row=e.target;
			while(row.parentNode&&row.parentNode!=this.resultList)row=row.parentNode;
			if(row.parentNode)
			{
				if(row.tagName==="HEADER")
				{
					this.sort(e.target.textContent);
				}
				else
				{
					if(!e.ctrlKey)
					{
						var selected=this.resultList.querySelectorAll(".selected");
						for(var i=0;i<selected.length;i++)selected[i].classList.remove("selected");
					}
					row.classList.toggle("selected");
				}
			}
			e.preventDefault();
			return false;
		},
		_onListMouseDown:function(downEvent)
		{
			var row=downEvent.target;
			while(row.parentNode&&row.parentNode!=this.resultList)row=row.parentNode;
			if(row.parentNode)
			{
				if(row.tagName==="DIV")
				{
					var onMove=moveEvent=>
					{
						this.resultList.removeEventListener("mousemove",onMove);
						row.classList.add("selected");
						
						var onMouseOver=overEvent=>
						{
							var hoverRow=overEvent.target;
							while(hoverRow.parentNode&&hoverRow.parentNode!=this.resultList)hoverRow=hoverRow.parentNode;
							if(hoverRow.parentNode) hoverRow.classList.add("selected");
						};
						var onMouseUp=()=>
						{
							this.resultList.removeEventListener("mouseover",onMouseOver);
							this.resultList.removeEventListener("mouseup",onMouseUp);
						};
						this.resultList.addEventListener("mouseover",onMouseOver);
						this.resultList.addEventListener("mouseup",onMouseUp);
						
						moveEvent.preventDefault();
						return false;
					};
					var onClick=()=>
					{
						this.resultList.removeEventListener("mousemove",onMove);
						this.resultList.removeEventListener("click",onClick);
					}
					this.resultList.addEventListener("mousemove",onMove);
					this.resultList.addEventListener("click",onClick);
				}
				downEvent.preventDefault();
				return false;
			}
		},
{'fraction_non_alphanumeric': 0.224009373668513, 'fraction_numerical': 0.0014912654452492544, 'mean_word_length': 4.3805157593123205, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 125, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '783047', 'n_tokens_mistral': 3920, 'n_tokens_neox': 3371, 'n_words': 367}