1var e=class e{constructor(e){this.data=e||{},this.length=(this.data.duration||[]).length||0}_pushByKey(e,t){Object.prototype.hasOwnProperty.call(this.data,e)||(this.data[e]=[]),this.data[e].push(t)}pushItemTo(e,t){for(let n of Object.keys(this.data))t._pushByKey(n,this.data[n][e]);t.length++}groupByDate(){if(this.length===0)return{};let t={};for(let n=0;n<this.length;n++){let r=this.data.creation_date[n].substr(0,10);Object.prototype.hasOwnProperty.call(t,r)||(t[r]=new e),this.pushItemTo(n,t[r])}return t}filter(t,n){if(this.length===0)return new e;let r={};for(let e of Object.keys(this.data))e!==t&&(r[e]=this.data[e].filter((e,r)=>n(this.data[t][r])===!0));return r[t]=this.data[t].filter(n),new e(r)}count(e,t){let n=0;for(let r of this.data[e])n+=t(r)===!0;return n}filterTyping(){return this.filter(`type`,e=>e===`typing`)}filterPassed(){return this.filter(`status`,e=>e===`passed`)}filterFailed(){return this.filter(`status`,e=>e===`failed`)}stats(){let e={nexercises:0,session_duration:0,typing_time:0,avg_speed:0,avg_accuracy:0};if(this.length===0)return e;e.nexercises=this.length;let t=0,n=0,r=0,i=0,a=Date.parse(this.data.creation_date[0]);for(let o=0;o<this.length;o++){let s=Date.parse(this.data.creation_date[o]),c=(s-a)/1e3;a=s,c-i<120?e.session_duration+=c:e.session_duration+=i,i=this.data.duration[o]<450?this.data.duration[o]:450,this.data.type[o]===`typing`&&(r++,t+=this.data.typing_speed[o],n+=this.data.typing_accuracy[o],e.typing_time+=this.data.duration[o])}return r&&(e.avg_speed=t/r,e.avg_accuracy=n/r),e}getAverageSpeedValues(){return this._getAverageFor(`typing_speed`)}getAverageAccuracyValues(){return this._getAverageFor(`typing_accuracy`)}_getAverageFor(e){let t=0,n=this.data[e],r=[];for(let e=0;e<n.length;e++)t+=n[e],r.push(Number.parseInt(t/(e+1)));return r}getSpeedValues(){return this.data.typing_speed||[]}getAccuracyValues(){return this.data.typing_accuracy||[]}getLabels(){return Object.prototype.hasOwnProperty.call(this.data,`labels`)?this.data.labels:(this.data.typing_speed||[]).map((e,t)=>t)}json(){return this.data}static fromJson(t){return new e(t)}};export{e as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.