diff --git a/perf-cascade-file-reader.js b/perf-cascade-file-reader.js index ff9671b..cea3c4e 100644 --- a/perf-cascade-file-reader.js +++ b/perf-cascade-file-reader.js @@ -1,4 +1,4 @@ -/*! github.com/micmro/PerfCascade Version:2.11.0 (24/11/2021) */ +/*! github.com/micmro/PerfCascade Version:3.0.0 (12/11/2022) */ /* Copyright (c) 2013 Gildas Lormeau. All rights reserved. @@ -3122,15 +3122,15 @@ env.Inflater = env._jzlib_Inflater = Inflater; })(this); -/*! github.com/micmro/PerfCascade Version:2.11.0 (24/11/2021) */ +/*! github.com/micmro/PerfCascade Version:3.0.0 (12/11/2022) */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.perfCascadeFileReader = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i { + const zip = window["zip"] || {}; zip.useWebWorkers = false; return zip; }; @@ -3141,7 +3141,7 @@ function readFile(file, fileName, callback, onProgress) { } function parseJson(rawData) { try { - var harData = JSON.parse(rawData); + const harData = JSON.parse(rawData); callback(null, harData.log); } catch (e) { @@ -3149,13 +3149,13 @@ function readFile(file, fileName, callback, onProgress) { } } /** start reading the file */ - var extension = (fileName.match(/\.[0-9a-z]+$/i) || [])[0]; - var zip = getConfiguredZipJs(); + const extension = (fileName.match(/\.[0-9a-z]+$/i) || [])[0]; + const zip = getConfiguredZipJs(); if ([".zhar", ".zip"].indexOf(extension) !== -1) { /** zhar */ - zip.createReader(new zip.BlobReader(file), function (zipReader) { - zipReader.getEntries(function (x) { - x[0].getData(new zip.TextWriter(), function (txt) { + zip.createReader(new zip.BlobReader(file), (zipReader) => { + zipReader.getEntries((x) => { + x[0].getData(new zip.TextWriter(), (txt) => { parseJson(txt); // close the zip reader zipReader.close(); @@ -3164,9 +3164,9 @@ function readFile(file, fileName, callback, onProgress) { }); } else { - var reader = new FileReader(); + const reader = new FileReader(); /** try to parse the file once uploaded to browser */ - reader.addEventListener("load", function (e) { + reader.addEventListener("load", (e) => { parseJson(e.target.result); }); reader.readAsText(file); diff --git a/perf-cascade-file-reader.min.js b/perf-cascade-file-reader.min.js index eda1ad3..75f1280 100644 --- a/perf-cascade-file-reader.min.js +++ b/perf-cascade-file-reader.min.js @@ -1,3 +1,3 @@ -/*! github.com/micmro/PerfCascade Version:2.11.0 (24/11/2021) */ +/*! github.com/micmro/PerfCascade Version:3.0.0 (12/11/2022) */ -!function(m){"use strict";var a,g="File format is not recognized.",o="File contains encrypted entry.",s="File is using Zip64 (4gb+ file size).",_="Error while reading zip file.",r="Error while reading file data.",v=524288,f="text/plain";try{a=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(e){}function i(){this.crc=-1}function u(){}function k(e,t){var i=new ArrayBuffer(e),e=new Uint8Array(i);return t&&e.set(t,0),{buffer:i,array:e,view:new DataView(i)}}function e(){}function t(n){var r,a=this;a.size=0,a.init=function(e,t){var i=new Blob([n],{type:f});(r=new l(i)).init(function(){a.size=r.size,e()},t)},a.readUint8Array=function(e,t,i,n){r.readUint8Array(e,t,i,n)}}function n(l){var d,i=this;i.size=0,i.init=function(e){for(var t=l.length;"="==l.charAt(t-1);)t--;d=l.indexOf(",")+1,i.size=Math.floor(.75*(t-d)),e()},i.readUint8Array=function(e,t,i){for(var n=k(t),r=4*Math.floor(e/3),a=4*Math.ceil((e+t)/3),o=m.atob(l.substring(r+d,a+d)),s=e-3*Math.floor(r/4),f=s;fe.size)throw new RangeError("offset:"+t+", length:"+i+", size:"+e.size);return e.slice?e.slice(t,t+i):e.webkitSlice?e.webkitSlice(t,t+i):e.mozSlice?e.mozSlice(t,t+i):e.msSlice?e.msSlice(t,t+i):void 0}(a,e,t))}catch(e){n(e)}}}function d(){}function c(n){var r;this.init=function(e){r=new Blob([],{type:f}),e()},this.writeUint8Array=function(e,t){r=new Blob([r,a?e:e.buffer],{type:f}),t()},this.getData=function(t,e){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=e,i.readAsText(r,n)}}function w(t){var a="",o="";this.init=function(e){a+="data:"+(t||"")+";base64,",e()},this.writeUint8Array=function(e,t){var i,n=o.length,r=o;for(o="",i=0;i<3*Math.floor((n+e.length)/3)-n;i++)r+=String.fromCharCode(e[i]);for(;i>16,e=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&e)>>11,(2016&e)>>5,2*(31&e),0)}catch(e){}}(e.lastModDateRaw),1!=(1&e.bitFlag)?(!n&&8==(8&e.bitFlag)||(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295!==e.compressedSize&&4294967295!==e.uncompressedSize?(e.filenameLength=t.view.getUint16(i+22,!0),e.extraFieldLength=t.view.getUint16(i+24,!0)):r(s)):r(o)}function p(p,t,d){var y=0;function u(){}u.prototype.getData=function(_,n,c,w){var b=this;function h(e,t){var i;w&&(i=t,(t=k(4)).view.setUint32(0,i),b.crc32!=t.view.getUint32(0))?d("CRC failed."):_.getData(function(e){n(e)})}function x(e){d(e||r)}function v(e){d(e||"Error while writing file data.")}p.readUint8Array(b.offset,30,function(e){var u,e=k(e.length,e);1347093252==e.view.getUint32(0)?(E(b,e,4,!1,d),u=b.offset+30+b.filenameLength+b.extraFieldLength,_.init(function(){var e,t,i,n,r,a,o,s,f,l,d;0===b.compressionMethod?A(b._worker,y++,p,_,u,b.compressedSize,w,h,c,x,v):(e=b._worker,t=y++,i=p,n=_,r=u,a=b.compressedSize,s=h,f=c,l=x,d=v,o=(o=w)?"output":"none",m.zip.useWebWorkers?U(e,{sn:t,codecClass:"Inflater",crcType:o},i,n,r,a,f,s,l,d):z(new m.zip.Inflater,i,n,r,a,o,f,s,l,d))},v)):d(g)},x)};var i={getEntries:function(f){var n,e,r,l=this._worker;function t(e,i){p.readUint8Array(p.size-e,e,function(e){for(var t=e.length-r;0<=t;t--)if(80===e[t]&&75===e[t+1]&&5===e[t+2]&&6===e[t+3])return void n(new DataView(e.buffer,t,r));i()},function(){d(_)})}n=function(e){var t=e.getUint32(16,!0),s=e.getUint16(8,!0);t<0||t>=p.size?d(g):p.readUint8Array(t,p.size-t,function(e){for(var t,i,n=0,r=[],a=k(e.length,e),o=0;o>>8^i[255&(t^e[n])];this.crc=t},i.prototype.get=function(){return~this.crc},i.prototype.table=function(){for(var e,t,i=[],n=0;n<256;n++){for(t=n,e=0;e<8;e++)1&t?t=t>>>1^3988292384:t>>>=1;i[n]=t}return i}(),u.prototype.append=function(e,t){return e},u.prototype.flush=function(){},(t.prototype=new e).constructor=t,(n.prototype=new e).constructor=n,(l.prototype=new e).constructor=l,d.prototype.getData=function(e){e(this.data)},(c.prototype=new d).constructor=c,(w.prototype=new d).constructor=w,b.prototype=new d;var L={deflater:["z-worker.js","deflate.js"],inflater:["z-worker.js","inflate.js"]};function M(e,i,n){if(null===m.zip.workerScripts||null===m.zip.workerScriptsPath){var t,r,a;if(m.zip.workerScripts){if(t=m.zip.workerScripts[e],!Array.isArray(t))return void n(new Error("zip.workerScripts."+e+" is not an array!"));r=t,a=document.createElement("a"),t=r.map(function(e){return a.href=e,a.href})}else(t=L[e].slice(0))[0]=(m.zip.workerScriptsPath||"")+t[0];var o=new Worker(t[0]);o.codecTime=o.crcTime=0,o.postMessage({type:"importScripts",scripts:t.slice(1)}),o.addEventListener("message",function e(t){t=t.data;if(t.error)return o.terminate(),void n(t.error);"importScripts"===t.type&&(o.removeEventListener("message",e),o.removeEventListener("error",s),i(o))}),o.addEventListener("error",s)}else n(new Error("Either zip.workerScripts or zip.workerScriptsPath may be set, not both."));function s(e){o.terminate(),n(e)}}function W(e){console.error(e)}m.zip={Reader:e,Writer:d,BlobReader:l,Data64URIReader:n,TextReader:t,BlobWriter:b.prototype.constructor=b,Data64URIWriter:w,TextWriter:c,createReader:function(e,t,i){i=i||W,e.init(function(){p(e,t,i)},i)},createWriter:function(e,t,i,n){i=i||W,n=!!n,e.init(function(){y(e,t,i,n)},i)},useWebWorkers:!0,workerScriptsPath:null,workerScripts:null}}(this),function(e){"use strict";var M=0,W=1,C=-2,R=-3,c=-4,T=-5,I=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],B=1440,r=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],a=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],w=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],b=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],h=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],x=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],F=15;function O(){var l,d,A,S,E,D;function u(e,t,i,n,r,a,o,s,f,l,d){for(var u,_,c,w,b,h,x,v,p,y,m,g,k,U=0,z=i;A[e[t+U]]++,U++,0!==--z;);if(A[0]==i)return o[0]=-1,s[0]=0,M;for(x=s[0],b=1;b<=F&&0===A[b];b++);for(x<(h=b)&&(x=b),z=F;0!==z&&0===A[z];z--);for((c=z)u+1&&(_-=u+1,m=h,bB)return R;E[w]=p=l[0],l[0]+=k,0!==w?(D[w]=z,S[0]=b,S[1]=x,S[2]=p-E[w-1]-(b=z>>>y-x),f.set(S,3*(E[w-1]+b))):o[0]=p}for(S[1]=h-y,i<=U?S[0]=192:d[U]>>y;b>>=1)z^=b;for(z^=b,v=(1<>=l[b+1],p-=l[b+1],0!=(16&u)){for(u&=15,_=l[b+2]+(v&I[u]),v>>=u,p-=u;p<15;)x--,v|=(255&s.read_byte(h++))<>=l[b+1],p-=l[b+1],0!=(16&u)){for(u&=15;p>=u,p-=u,m-=_,c<=y)0>3<(_=s.avail_in-x)?p>>3:_,h-=_,p-=_<<3,o.bitb=v,o.bitk=p,s.avail_in=x,s.total_in+=h-s.next_in_index,s.next_in_index=h,o.write=y,R;f+=l[b+2],u=l[b=3*(d+(f+=v&I[u]))]}break}if(0!=(64&u))return 0!=(32&u)?(x+=_=p>>3<(_=s.avail_in-x)?p>>3:_,h-=_,p-=_<<3,o.bitb=v,o.bitk=p,s.avail_in=x,s.total_in+=h-s.next_in_index,s.next_in_index=h,o.write=y,W):(s.msg="invalid literal/length code",x+=_=p>>3<(_=s.avail_in-x)?p>>3:_,h-=_,p-=_<<3,o.bitb=v,o.bitk=p,s.avail_in=x,s.total_in+=h-s.next_in_index,s.next_in_index=h,o.write=y,R);if(f+=l[b+2],0===(u=l[b=3*(d+(f+=v&I[u]))])){v>>=l[b+1],p-=l[b+1],o.window[y++]=l[b+2],m--;break}}else v>>=l[b+1],p-=l[b+1],o.window[y++]=l[b+2],m--}while(258<=m&&10<=x);return x+=_=p>>3<(_=s.avail_in-x)?p>>3:_,h-=_,p-=_<<3,o.bitb=v,o.bitk=p,s.avail_in=x,s.total_in+=h-s.next_in_index,s.next_in_index=h,o.write=y,M}(k,U,b,z,h,A,e,t),l=t.next_in_index,d=t.avail_in,s=e.bitb,f=e.bitk,_=(u=e.write)>>=w[r+1],f-=w[r+1],0===(a=w[r])){y=w[r+2],c=q;break}if(0!=(16&a)){m=15&a,x=w[r+2],c=D;break}if(0==(64&a)){p=a,v=r/3+w[r+2];break}if(0==(32&a))return c=H,t.msg="invalid literal/length code",i=R,e.bitb=s,e.bitk=f,t.avail_in=d,t.total_in+=l-t.next_in_index,t.next_in_index=l,e.write=u,e.inflate_flush(t,i);c=N;break;case D:for(n=m;f>=n,f-=n,p=U,w=h,v=A,c=L;case L:for(n=p;f>=w[r+1],f-=w[r+1],0!=(16&(a=w[r]))){m=15&a,g=w[r+2],c=P;break}if(0!=(64&a))return c=H,t.msg="invalid distance code",i=R,e.bitb=s,e.bitk=f,t.avail_in=d,t.total_in+=l-t.next_in_index,t.next_in_index=l,e.write=u,e.inflate_flush(t,i);p=a,v=r/3+w[r+2];break;case P:for(n=m;f>=n,f-=n,c=j;case j:for(o=u-g;o<0;)o+=e.end;for(;0!==x;){if(0===_&&0===(_=u==e.end&&0!==e.read?(u=0)e.avail_out?e.avail_out:r)&&t==T&&(t=M),e.avail_out-=r,e.total_out+=r,e.next_out.set(m.window.subarray(n,n+r),i),i+=r,(n+=r)==m.end&&(n=0,m.write==m.end&&(m.write=0),0!==(r=(r=m.write-n)>e.avail_out?e.avail_out:r)&&t==T&&(t=M),e.avail_out-=r,e.total_out+=r,e.next_out.set(m.window.subarray(n,n+r),i),i+=r,n+=r),e.next_out_index=i,m.read=n,t},m.proc=function(e,t){for(var i,n=e.next_in_index,r=e.avail_in,a=m.bitb,o=m.bitk,s=m.write,f=s>>1){case 0:a>>>=3,a>>>=b=7&(o-=3),o-=b,g=Z;break;case 1:var l=[],d=[],u=[[]],_=[[]];O.inflate_trees_fixed(l,d,u,_),E.init(l[0],d[0],u[0],0,_[0],0),a>>>=3,o-=3,g=X;break;case 2:a>>>=3,o-=3,g=G;break;case 3:return a>>>=3,o-=3,g=ie,e.msg="invalid block type",t=R,m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t)}break;case Z:for(;o<32;){if(0===r)return m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);t=M,r--,a|=(255&e.read_byte(n++))<>>16&65535)!=(65535&a))return g=ie,e.msg="invalid stored block lengths",t=R,m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);k=65535&a,a=o=0,g=0!==k?$:0!==D?ee:Y;break;case $:if(0===r)return m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);if(0===f&&0===(f=s==m.end&&0!==m.read?(s=0)>5&31))return g=ie,e.msg="too many length or distance symbols",t=R,m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);if(b=258+(31&b)+(b>>5&31),!y||y.length>>=14,o-=14,z=0,g=K;case K:for(;z<4+(U>>>10);){for(;o<3;){if(0===r)return m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);t=M,r--,a|=(255&e.read_byte(n++))<>>=3,o-=3}for(;z<19;)y[J[z++]]=0;if(A[0]=7,(b=L.inflate_trees_bits(y,A,S,F,e))!=M)return(t=b)==R&&(y=null,g=ie),m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);z=0,g=Q;case Q:for(;!(258+(31&(b=U))+(b>>5&31)<=z);){for(var c,w,b=A[0];o>>=b,o-=b,y[z++]=w;else{for(i=18==w?7:w-14,c=18==w?11:3;o>>=b)&I[i],a>>>=i,o-=i,258+(31&(b=U))+(b>>5&31)<(i=z)+c||16==w&&i<1)return y=null,g=ie,e.msg="invalid bit length repeat",t=R,m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);for(w=16==w?y[i-1]:0;y[i++]=w,0!=--c;);z=i}}S[0]=-1;var h=[],x=[],v=[],p=[];if(h[0]=9,x[0]=6,b=U,(b=L.inflate_trees_dynamic(257+(31&b),1+(b>>5&31),y,h,x,v,p,F,e))!=M)return b==R&&(y=null,g=ie),t=b,m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);E.init(h[0],x[0],F,v[0],F,p[0]),g=X;case X:if(m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,(t=E.proc(m,e,t))!=W)return m.inflate_flush(e,t);if(t=M,E.free(e),n=e.next_in_index,r=e.avail_in,a=m.bitb,o=m.bitk,f=(s=m.write)>4)>e.istate.wbits){e.istate.mode=13,e.msg="invalid window size",e.istate.marker=5;break}e.istate.mode=1;case 1:if(0===e.avail_in)return i;if(i=t,e.avail_in--,e.total_in++,n=255&e.read_byte(e.next_in_index++),((e.istate.method<<8)+n)%31!=0){e.istate.mode=13,e.msg="incorrect header check",e.istate.marker=5;break}if(0==(32&n)){e.istate.mode=7;break}e.istate.mode=2;case 2:if(0===e.avail_in)return i;i=t,e.avail_in--,e.total_in++,e.istate.need=(255&e.read_byte(e.next_in_index++))<<24&4278190080,e.istate.mode=3;case 3:if(0===e.avail_in)return i;i=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.read_byte(e.next_in_index++))<<16&16711680,e.istate.mode=4;case 4:if(0===e.avail_in)return i;i=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.read_byte(e.next_in_index++))<<8&65280,e.istate.mode=5;case 5:return 0===e.avail_in?i:(i=t,e.avail_in--,e.total_in++,e.istate.need+=255&e.read_byte(e.next_in_index++),e.istate.mode=6,2);case 6:return e.istate.mode=13,e.msg="need dictionary",e.istate.marker=0,C;case 7:if((i=e.istate.blocks.proc(e,i))==R){e.istate.mode=13,e.istate.marker=0;break}if((i=i==M?t:i)!=W)return i;i=t,e.istate.blocks.reset(e,e.istate.was),e.istate.mode=12;case 12:return W;case 13:return R;default:return C}},i.inflateSetDictionary=function(e,t,i){var n=0,r=i;return e&&e.istate&&6==e.istate.mode?(r>=1<e.size)throw new RangeError("offset:"+t+", length:"+i+", size:"+e.size);return e.slice?e.slice(t,t+i):e.webkitSlice?e.webkitSlice(t,t+i):e.mozSlice?e.mozSlice(t,t+i):e.msSlice?e.msSlice(t,t+i):void 0}(a,e,t))}catch(e){n(e)}}}function d(){}function c(n){var r;this.init=function(e){r=new Blob([],{type:f}),e()},this.writeUint8Array=function(e,t){r=new Blob([r,a?e:e.buffer],{type:f}),t()},this.getData=function(t,e){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=e,i.readAsText(r,n)}}function w(t){var a="",o="";this.init=function(e){a+="data:"+(t||"")+";base64,",e()},this.writeUint8Array=function(e,t){var i,n=o.length,r=o;for(o="",i=0;i<3*Math.floor((n+e.length)/3)-n;i++)r+=String.fromCharCode(e[i]);for(;i>16,e=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&e)>>11,(2016&e)>>5,2*(31&e),0)}catch(e){}}(e.lastModDateRaw),1!=(1&e.bitFlag)?(!n&&8==(8&e.bitFlag)||(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295!==e.compressedSize&&4294967295!==e.uncompressedSize?(e.filenameLength=t.view.getUint16(i+22,!0),e.extraFieldLength=t.view.getUint16(i+24,!0)):r(s)):r(o)}function p(p,t,d){var y=0;function u(){}u.prototype.getData=function(_,n,c,w){var b=this;function h(e,t){var i;w&&(i=t,(t=k(4)).view.setUint32(0,i),b.crc32!=t.view.getUint32(0))?d("CRC failed."):_.getData(function(e){n(e)})}function x(e){d(e||r)}function v(e){d(e||"Error while writing file data.")}p.readUint8Array(b.offset,30,function(e){var u,e=k(e.length,e);1347093252==e.view.getUint32(0)?(E(b,e,4,!1,d),u=b.offset+30+b.filenameLength+b.extraFieldLength,_.init(function(){var e,t,i,n,r,a,o,s,f,l,d;0===b.compressionMethod?A(b._worker,y++,p,_,u,b.compressedSize,w,h,c,x,v):(e=b._worker,t=y++,i=p,n=_,r=u,a=b.compressedSize,s=h,f=c,l=x,d=v,o=(o=w)?"output":"none",m.zip.useWebWorkers?U(e,{sn:t,codecClass:"Inflater",crcType:o},i,n,r,a,f,s,l,d):z(new m.zip.Inflater,i,n,r,a,o,f,s,l,d))},v)):d(g)},x)};var i={getEntries:function(f){var n,e,r,l=this._worker;function t(e,i){p.readUint8Array(p.size-e,e,function(e){for(var t=e.length-r;0<=t;t--)if(80===e[t]&&75===e[t+1]&&5===e[t+2]&&6===e[t+3])return void n(new DataView(e.buffer,t,r));i()},function(){d(_)})}n=function(e){var t=e.getUint32(16,!0),s=e.getUint16(8,!0);t<0||t>=p.size?d(g):p.readUint8Array(t,p.size-t,function(e){for(var t,i,n=0,r=[],a=k(e.length,e),o=0;o>>8^i[255&(t^e[n])];this.crc=t},i.prototype.get=function(){return~this.crc},i.prototype.table=function(){for(var e,t,i=[],n=0;n<256;n++){for(t=n,e=0;e<8;e++)1&t?t=t>>>1^3988292384:t>>>=1;i[n]=t}return i}(),u.prototype.append=function(e,t){return e},u.prototype.flush=function(){},(t.prototype=new e).constructor=t,(n.prototype=new e).constructor=n,(l.prototype=new e).constructor=l,d.prototype.getData=function(e){e(this.data)},(c.prototype=new d).constructor=c,(w.prototype=new d).constructor=w,b.prototype=new d;var L={deflater:["z-worker.js","deflate.js"],inflater:["z-worker.js","inflate.js"]};function M(e,i,n){if(null===m.zip.workerScripts||null===m.zip.workerScriptsPath){var t,r,a;if(m.zip.workerScripts){if(t=m.zip.workerScripts[e],!Array.isArray(t))return void n(new Error("zip.workerScripts."+e+" is not an array!"));r=t,a=document.createElement("a"),t=r.map(function(e){return a.href=e,a.href})}else(t=L[e].slice(0))[0]=(m.zip.workerScriptsPath||"")+t[0];var o=new Worker(t[0]);o.codecTime=o.crcTime=0,o.postMessage({type:"importScripts",scripts:t.slice(1)}),o.addEventListener("message",function e(t){t=t.data;if(t.error)return o.terminate(),void n(t.error);"importScripts"===t.type&&(o.removeEventListener("message",e),o.removeEventListener("error",s),i(o))}),o.addEventListener("error",s)}else n(new Error("Either zip.workerScripts or zip.workerScriptsPath may be set, not both."));function s(e){o.terminate(),n(e)}}function W(e){console.error(e)}m.zip={Reader:e,Writer:d,BlobReader:l,Data64URIReader:n,TextReader:t,BlobWriter:b.prototype.constructor=b,Data64URIWriter:w,TextWriter:c,createReader:function(e,t,i){i=i||W,e.init(function(){p(e,t,i)},i)},createWriter:function(e,t,i,n){i=i||W,n=!!n,e.init(function(){y(e,t,i,n)},i)},useWebWorkers:!0,workerScriptsPath:null,workerScripts:null}}(this),function(e){"use strict";var M=0,W=1,C=-2,R=-3,c=-4,T=-5,I=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],B=1440,r=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],a=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],w=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],b=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],h=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],x=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],F=15;function O(){var l,d,A,S,E,D;function u(e,t,i,n,r,a,o,s,f,l,d){for(var u,_,c,w,b,h,x,v,p,y,m,g,k,U=0,z=i;A[e[t+U]]++,U++,0!==--z;);if(A[0]==i)return o[0]=-1,s[0]=0,M;for(x=s[0],b=1;b<=F&&0===A[b];b++);for(x<(h=b)&&(x=b),z=F;0!==z&&0===A[z];z--);for((c=z)u+1&&(_-=u+1,m=h,bB)return R;E[w]=p=l[0],l[0]+=k,0!==w?(D[w]=z,S[0]=b,S[1]=x,S[2]=p-E[w-1]-(b=z>>>y-x),f.set(S,3*(E[w-1]+b))):o[0]=p}for(S[1]=h-y,i<=U?S[0]=192:d[U]>>y;b>>=1)z^=b;for(z^=b,v=(1<>=l[b+1],p-=l[b+1],0!=(16&u)){for(u&=15,_=l[b+2]+(v&I[u]),v>>=u,p-=u;p<15;)x--,v|=(255&s.read_byte(h++))<>=l[b+1],p-=l[b+1],0!=(16&u)){for(u&=15;p>=u,p-=u,m-=_,c<=y)0>3<(_=s.avail_in-x)?p>>3:_,h-=_,p-=_<<3,o.bitb=v,o.bitk=p,s.avail_in=x,s.total_in+=h-s.next_in_index,s.next_in_index=h,o.write=y,R;f+=l[b+2],u=l[b=3*(d+(f+=v&I[u]))]}break}if(0!=(64&u))return 0!=(32&u)?(x+=_=p>>3<(_=s.avail_in-x)?p>>3:_,h-=_,p-=_<<3,o.bitb=v,o.bitk=p,s.avail_in=x,s.total_in+=h-s.next_in_index,s.next_in_index=h,o.write=y,W):(s.msg="invalid literal/length code",x+=_=p>>3<(_=s.avail_in-x)?p>>3:_,h-=_,p-=_<<3,o.bitb=v,o.bitk=p,s.avail_in=x,s.total_in+=h-s.next_in_index,s.next_in_index=h,o.write=y,R);if(f+=l[b+2],0===(u=l[b=3*(d+(f+=v&I[u]))])){v>>=l[b+1],p-=l[b+1],o.window[y++]=l[b+2],m--;break}}else v>>=l[b+1],p-=l[b+1],o.window[y++]=l[b+2],m--}while(258<=m&&10<=x);return x+=_=p>>3<(_=s.avail_in-x)?p>>3:_,h-=_,p-=_<<3,o.bitb=v,o.bitk=p,s.avail_in=x,s.total_in+=h-s.next_in_index,s.next_in_index=h,o.write=y,M}(k,U,b,z,h,A,e,t),l=t.next_in_index,d=t.avail_in,s=e.bitb,f=e.bitk,_=(u=e.write)>>=w[r+1],f-=w[r+1],0===(a=w[r])){y=w[r+2],c=q;break}if(0!=(16&a)){m=15&a,x=w[r+2],c=D;break}if(0==(64&a)){p=a,v=r/3+w[r+2];break}if(0==(32&a))return c=H,t.msg="invalid literal/length code",i=R,e.bitb=s,e.bitk=f,t.avail_in=d,t.total_in+=l-t.next_in_index,t.next_in_index=l,e.write=u,e.inflate_flush(t,i);c=N;break;case D:for(n=m;f>=n,f-=n,p=U,w=h,v=A,c=L;case L:for(n=p;f>=w[r+1],f-=w[r+1],0!=(16&(a=w[r]))){m=15&a,g=w[r+2],c=P;break}if(0!=(64&a))return c=H,t.msg="invalid distance code",i=R,e.bitb=s,e.bitk=f,t.avail_in=d,t.total_in+=l-t.next_in_index,t.next_in_index=l,e.write=u,e.inflate_flush(t,i);p=a,v=r/3+w[r+2];break;case P:for(n=m;f>=n,f-=n,c=j;case j:for(o=u-g;o<0;)o+=e.end;for(;0!==x;){if(0===_&&0===(_=u==e.end&&0!==e.read?(u=0)e.avail_out?e.avail_out:r)&&t==T&&(t=M),e.avail_out-=r,e.total_out+=r,e.next_out.set(m.window.subarray(n,n+r),i),i+=r,(n+=r)==m.end&&(n=0,m.write==m.end&&(m.write=0),0!==(r=(r=m.write-n)>e.avail_out?e.avail_out:r)&&t==T&&(t=M),e.avail_out-=r,e.total_out+=r,e.next_out.set(m.window.subarray(n,n+r),i),i+=r,n+=r),e.next_out_index=i,m.read=n,t},m.proc=function(e,t){for(var i,n=e.next_in_index,r=e.avail_in,a=m.bitb,o=m.bitk,s=m.write,f=s>>1){case 0:a>>>=3,a>>>=b=7&(o-=3),o-=b,g=Z;break;case 1:var l=[],d=[],u=[[]],_=[[]];O.inflate_trees_fixed(l,d,u,_),E.init(l[0],d[0],u[0],0,_[0],0),a>>>=3,o-=3,g=X;break;case 2:a>>>=3,o-=3,g=G;break;case 3:return a>>>=3,o-=3,g=ie,e.msg="invalid block type",t=R,m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t)}break;case Z:for(;o<32;){if(0===r)return m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);t=M,r--,a|=(255&e.read_byte(n++))<>>16&65535)!=(65535&a))return g=ie,e.msg="invalid stored block lengths",t=R,m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);k=65535&a,a=o=0,g=0!==k?$:0!==D?ee:Y;break;case $:if(0===r)return m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);if(0===f&&0===(f=s==m.end&&0!==m.read?(s=0)>5&31))return g=ie,e.msg="too many length or distance symbols",t=R,m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);if(b=258+(31&b)+(b>>5&31),!y||y.length>>=14,o-=14,z=0,g=K;case K:for(;z<4+(U>>>10);){for(;o<3;){if(0===r)return m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);t=M,r--,a|=(255&e.read_byte(n++))<>>=3,o-=3}for(;z<19;)y[J[z++]]=0;if(A[0]=7,(b=L.inflate_trees_bits(y,A,S,F,e))!=M)return(t=b)==R&&(y=null,g=ie),m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);z=0,g=Q;case Q:for(;!(258+(31&(b=U))+(b>>5&31)<=z);){for(var c,w,b=A[0];o>>=b,o-=b,y[z++]=w;else{for(i=18==w?7:w-14,c=18==w?11:3;o>>=b)&I[i],a>>>=i,o-=i,258+(31&(b=U))+(b>>5&31)<(i=z)+c||16==w&&i<1)return y=null,g=ie,e.msg="invalid bit length repeat",t=R,m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);for(w=16==w?y[i-1]:0;y[i++]=w,0!=--c;);z=i}}S[0]=-1;var h=[],x=[],v=[],p=[];if(h[0]=9,x[0]=6,b=U,(b=L.inflate_trees_dynamic(257+(31&b),1+(b>>5&31),y,h,x,v,p,F,e))!=M)return b==R&&(y=null,g=ie),t=b,m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,m.inflate_flush(e,t);E.init(h[0],x[0],F,v[0],F,p[0]),g=X;case X:if(m.bitb=a,m.bitk=o,e.avail_in=r,e.total_in+=n-e.next_in_index,e.next_in_index=n,m.write=s,(t=E.proc(m,e,t))!=W)return m.inflate_flush(e,t);if(t=M,E.free(e),n=e.next_in_index,r=e.avail_in,a=m.bitb,o=m.bitk,f=(s=m.write)>4)>e.istate.wbits){e.istate.mode=13,e.msg="invalid window size",e.istate.marker=5;break}e.istate.mode=1;case 1:if(0===e.avail_in)return i;if(i=t,e.avail_in--,e.total_in++,n=255&e.read_byte(e.next_in_index++),((e.istate.method<<8)+n)%31!=0){e.istate.mode=13,e.msg="incorrect header check",e.istate.marker=5;break}if(0==(32&n)){e.istate.mode=7;break}e.istate.mode=2;case 2:if(0===e.avail_in)return i;i=t,e.avail_in--,e.total_in++,e.istate.need=(255&e.read_byte(e.next_in_index++))<<24&4278190080,e.istate.mode=3;case 3:if(0===e.avail_in)return i;i=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.read_byte(e.next_in_index++))<<16&16711680,e.istate.mode=4;case 4:if(0===e.avail_in)return i;i=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.read_byte(e.next_in_index++))<<8&65280,e.istate.mode=5;case 5:return 0===e.avail_in?i:(i=t,e.avail_in--,e.total_in++,e.istate.need+=255&e.read_byte(e.next_in_index++),e.istate.mode=6,2);case 6:return e.istate.mode=13,e.msg="need dictionary",e.istate.marker=0,C;case 7:if((i=e.istate.blocks.proc(e,i))==R){e.istate.mode=13,e.istate.marker=0;break}if((i=i==M?t:i)!=W)return i;i=t,e.istate.blocks.reset(e,e.istate.was),e.istate.mode=12;case 12:return W;case 13:return R;default:return C}},i.inflateSetDictionary=function(e,t,i){var n=0,r=i;return e&&e.istate&&6==e.istate.mode?(r>=1<{const e=window.zip||{};return e.useWebWorkers=!1,e})();if(-1!==[".zhar",".zip"].indexOf(t))a.createReader(new a.BlobReader(e),t=>{t.getEntries(e=>{e[0].getData(new a.TextWriter,e=>{r(e),t.close()},n)})});else{const o=new FileReader;o.addEventListener("load",e=>{r(e.target.result)}),o.readAsText(e)}}},{}]},{},[1])(1)}); \ No newline at end of file diff --git a/perf-cascade.css b/perf-cascade.css index bccac8e..48964c6 100644 --- a/perf-cascade.css +++ b/perf-cascade.css @@ -1,4 +1,4 @@ -/*! github.com/micmro/PerfCascade Version:2.11.0 (24/11/2021) */ +/*! github.com/micmro/PerfCascade Version:3.0.0 (12/11/2022) */ .water-fall-chart {width:100%; overflow: visible; font-size: 12px; line-height: 1em;} .water-fall-chart * {box-sizing: border-box;} .water-fall-chart button {cursor: pointer;} diff --git a/perf-cascade.js b/perf-cascade.js index 2785669..35c5807 100644 --- a/perf-cascade.js +++ b/perf-cascade.js @@ -1,4 +1,4 @@ -/*! github.com/micmro/PerfCascade Version:2.11.0 (24/11/2021) */ +/*! github.com/micmro/PerfCascade Version:3.0.0 (12/11/2022) */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.perfCascade = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i classList.add(c)); } else { // IE doesn't support classList in SVG - also no need for duplication check i.t.m. @@ -27,7 +27,7 @@ exports.addClass = addClass; * @param {string} className */ function removeClass(el, className) { - var classList = el.classList; + const classList = el.classList; if (classList) { classList.remove(className); } @@ -46,7 +46,7 @@ exports.removeClass = removeClass; */ function getParentByClassName(base, className) { if (typeof base.closest === "function") { - return base.closest("." + className); + return base.closest(`.${className}`); } while (base) { if (base.classList.contains(className)) { @@ -91,8 +91,8 @@ function safeSetStyle(el, property, value) { } else { // tslint:disable-next-line:no-console - console.warn(new Error("Trying to set non-existing style " + - (property + " = " + value + " on a <" + el.tagName.toLowerCase() + ">."))); + console.warn(new Error(`Trying to set non-existing style ` + + `${property} = ${value} on a <${el.tagName.toLowerCase()}>.`)); } } exports.safeSetStyle = safeSetStyle; @@ -100,36 +100,34 @@ exports.safeSetStyle = safeSetStyle; function safeSetAttribute(el, name, value) { if (!(name in el)) { // tslint:disable-next-line:no-console - console.warn(new Error("Trying to set non-existing attribute " + - (name + " = " + value + " on a <" + el.tagName.toLowerCase() + ">."))); + console.warn(new Error(`Trying to set non-existing attribute ` + + `${name} = ${value} on a <${el.tagName.toLowerCase()}>.`)); } el.setAttributeNS("", name, value); } exports.safeSetAttribute = safeSetAttribute; /** Sets multiple CSS style properties, but only if property exists on `el` */ function safeSetStyles(el, css) { - Object.keys(css).forEach(function (property) { + Object.keys(css).forEach((property) => { safeSetStyle(el, property, css[property].toString()); }); } exports.safeSetStyles = safeSetStyles; /** Sets attributes, but only if they exist on `el` */ function safeSetAttributes(el, attributes) { - Object.keys(attributes).forEach(function (name) { + Object.keys(attributes).forEach((name) => { safeSetAttribute(el, name, attributes[name].toString()); }); } exports.safeSetAttributes = safeSetAttributes; function makeHtmlEl() { - var html = document.createElement("html"); + const html = document.createElement("html"); html.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.w3.org/2000/xmlns/"); return html; } exports.makeHtmlEl = makeHtmlEl; -function makeBodyEl(css, innerHTML) { - if (css === void 0) { css = {}; } - if (innerHTML === void 0) { innerHTML = ""; } - var body = document.createElement("body"); +function makeBodyEl(css = {}, innerHTML = "") { + const body = document.createElement("body"); body.setAttribute("xmlns", "http://www.w3.org/1999/xhtml"); safeSetStyles(body, css); body.innerHTML = innerHTML; @@ -142,28 +140,28 @@ exports.makeBodyEl = makeBodyEl; Object.defineProperty(exports, "__esModule", { value: true }); exports.getHeaders = exports.getHeader = exports.hasHeader = void 0; /** Partial function that buils a filter predicate function */ -var matchHeaderPartialFn = function (lowercaseName) { - return function (header) { return header.name.toLowerCase() === lowercaseName; }; +const matchHeaderPartialFn = (lowercaseName) => { + return (header) => header.name.toLowerCase() === lowercaseName; }; /** * @param headers List of `Header` to search in * @param headerName Name of `Header` to find */ function hasHeader(headers, headerName) { - var headerFilter = matchHeaderPartialFn(headerName.toLowerCase()); + const headerFilter = matchHeaderPartialFn(headerName.toLowerCase()); return headers.some(headerFilter); } exports.hasHeader = hasHeader; /** feature detection if browser supports `find` for arrays */ -var browserHasFind = !!Array.prototype["find"]; +const browserHasFind = !!Array.prototype["find"]; /** * Returns the fist instances of `headerName` in `headers` * @param headers List of `Header` to search in * @param headerName Name of `Header` to find */ function getHeader(headers, headerName) { - var headerFilter = matchHeaderPartialFn(headerName.toLowerCase()); - var firstItem; + const headerFilter = matchHeaderPartialFn(headerName.toLowerCase()); + let firstItem; if (browserHasFind) { firstItem = headers["find"](headerFilter); } @@ -179,8 +177,8 @@ exports.getHeader = getHeader; * @param headerName Name of `Header` to find */ function getHeaders(headers, headerName) { - var headerFilter = matchHeaderPartialFn(headerName.toLowerCase()); - return headers.filter(headerFilter).map(function (h) { return [headerName, h.value]; }); + const headerFilter = matchHeaderPartialFn(headerName.toLowerCase()); + return headers.filter(headerFilter).map((h) => [headerName, h.value]); } exports.getHeaders = getHeaders; @@ -188,17 +186,17 @@ exports.getHeaders = getHeaders; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.audio = exports.video = exports.flash = exports.font = exports.error = exports.warning = exports.css = exports.html = exports.svg = exports.image = exports.javascript = exports.other = exports.plain = exports.err5xx = exports.err4xx = exports.err3xx = exports.noTls = void 0; -var svgLib = require("./svg"); +const svgLib = require("./svg"); /** * SVG Icons */ -var wrapSvgIcon = function (x, y, title, className, scale, svgEl) { - var holder = svgLib.newSvg("", { - x: x, - y: y, +const wrapSvgIcon = (x, y, title, className, scale, svgEl) => { + const holder = svgLib.newSvg("", { + x, + y, }); - var el = svgLib.newG("icon " + className, { - transform: "scale(" + scale + ")", + const el = svgLib.newG(`icon ${className}`, { + transform: `scale(${scale})`, }); // el.innerHTML = svgDoc; el.appendChild(svgEl); @@ -206,156 +204,220 @@ var wrapSvgIcon = function (x, y, title, className, scale, svgEl) { holder.appendChild(el); return holder; }; -var noTlsIconLazy; -function noTls(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let noTlsIconLazy; +function noTls(x, y, title, scale = 1) { if (noTlsIconLazy === undefined) { - var d = "M18 6.216v2.77q0 .28-.206.486-.205.206-.486.206h-.693q-.28 0-.486-.206-.21-.205-.21\n -.487v-2.77q0-1.145-.81-1.957-.813-.81-1.96-.81-1.146 0-1.957.81-.81.812-.81 1.958v2.077h1.037q.434\n 0 .737.303.302.303.302.736v6.23q0 .433-.305.736t-.737.303H1.038q-.433 0-.736-.3Q0 15.996 0\n 15.56V9.33q0-.433.303-.736t.735-.303h7.27V6.218q0-2 1.422-3.423 1.423-1.423 3.424-1.423 2\n 0 3.424 1.424Q18 4.214 18 6.216"; + const d = `M18 6.216v2.77q0 .28-.206.486-.205.206-.486.206h-.693q-.28 0-.486-.206-.21-.205-.21 + -.487v-2.77q0-1.145-.81-1.957-.813-.81-1.96-.81-1.146 0-1.957.81-.81.812-.81 1.958v2.077h1.037q.434 + 0 .737.303.302.303.302.736v6.23q0 .433-.305.736t-.737.303H1.038q-.433 0-.736-.3Q0 15.996 0 + 15.56V9.33q0-.433.303-.736t.735-.303h7.27V6.218q0-2 1.422-3.423 1.423-1.423 3.424-1.423 2 + 0 3.424 1.424Q18 4.214 18 6.216`; noTlsIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-no-tls", scale, noTlsIconLazy.cloneNode(false)); } exports.noTls = noTls; -var err3xxIconLazy; -function err3xx(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let err3xxIconLazy; +function err3xx(x, y, title, scale = 1) { if (err3xxIconLazy === undefined) { - var d = "M17 2.333V7q0 .27-.198.47-.198.197-.47.197h-4.665q-.438 0-.615-.417-.177-.406.146-.72l1.437-1.436Q11.095\n 3.667 9 3.667q-1.083 0-2.068.422-.984.42-1.703 1.14-.72.715-1.14 1.7-.426.984-.426 2.07 0 1.08.422 2.065.42.984\n 1.14 1.703.718.72 1.702 1.14.984.422 2.067.422 1.24 0 2.344-.54 1.104-.543 1.864-1.533.073-.105.24-.126.146 0\n .26.095l1.427 1.436q.095.084.1.214.006.13-.08.234-1.133 1.376-2.75 2.13Q10.793 17 9 17q-1.625\n 0-3.104-.635-1.48-.636-2.552-1.71-1.073-1.072-1.71-2.55Q1 10.625 1 9t.635-3.104q.636-1.48 1.71-2.552\n 1.072-1.073 2.55-1.71Q7.375 1 9 1q1.53 0 2.964.578 1.432.578 2.546\n 1.63l1.355-1.343q.302-.323.73-.146.405.173.405.61z"; + const d = `M17 2.333V7q0 .27-.198.47-.198.197-.47.197h-4.665q-.438 0-.615-.417-.177-.406.146-.72l1.437-1.436Q11.095 + 3.667 9 3.667q-1.083 0-2.068.422-.984.42-1.703 1.14-.72.715-1.14 1.7-.426.984-.426 2.07 0 1.08.422 2.065.42.984 + 1.14 1.703.718.72 1.702 1.14.984.422 2.067.422 1.24 0 2.344-.54 1.104-.543 1.864-1.533.073-.105.24-.126.146 0 + .26.095l1.427 1.436q.095.084.1.214.006.13-.08.234-1.133 1.376-2.75 2.13Q10.793 17 9 17q-1.625 + 0-3.104-.635-1.48-.636-2.552-1.71-1.073-1.072-1.71-2.55Q1 10.625 1 9t.635-3.104q.636-1.48 1.71-2.552 + 1.072-1.073 2.55-1.71Q7.375 1 9 1q1.53 0 2.964.578 1.432.578 2.546 + 1.63l1.355-1.343q.302-.323.73-.146.405.173.405.61z`; err3xxIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-redirect", scale, err3xxIconLazy.cloneNode(false)); } exports.err3xx = err3xx; -function err4xx(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +function err4xx(x, y, title, scale = 1) { return warning(x, y, title, scale); } exports.err4xx = err4xx; -function err5xx(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +function err5xx(x, y, title, scale = 1) { return warning(x, y, title, scale); } exports.err5xx = err5xx; -var plainIconLazy; -function plain(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let plainIconLazy; +function plain(x, y, title, scale = 1) { if (plainIconLazy === undefined) { - var d = "M15.247 4.393q.25.25.43.678.177.43.177.79v10.287q0\n .357-.25.607t-.607.25h-12q-.357 0-.607-.25t-.25-.606V1.858q0-.358.25-.608T2.997 1h8q.357 0\n .786.18.428.177.678.427zm-3.964-2.18V5.57h3.357q-.09-.256-.196-.364L11.65 2.41q-.108-.106-.367\n -.196zm3.428 13.644V6.714H11q-.357 0-.607-.25t-.25-.607V2.143h-6.86v13.714H14.71zM5.57\n 8.143q0-.125.08-.205.08-.08.204-.08h6.286q.125 0 .205.08.08.08.08.205v.57q0 .126-.08.207-.08.08\n -.205.08H5.854q-.125 0-.205-.08-.08-.08-.08-.206v-.57zm6.57 2q.125 0 .205.08.08.08.08.206V11q0\n .125-.08.205-.08.08-.205.08H5.854q-.125 0-.205-.08-.08-.08-.08-.205v-.57q0-.126.08-.207.08-.08.2\n -.08h6.286zm0 2.286q.125 0 .205.08.08.08.08.2v.572q0 .125-.08.205-.08.08-.205.08H5.854q-.125 0-.205\n -.08-.08-.08-.08-.205v-.572q0-.124.08-.204.08-.08.2-.08h6.286z"; + const d = `M15.247 4.393q.25.25.43.678.177.43.177.79v10.287q0 + .357-.25.607t-.607.25h-12q-.357 0-.607-.25t-.25-.606V1.858q0-.358.25-.608T2.997 1h8q.357 0 + .786.18.428.177.678.427zm-3.964-2.18V5.57h3.357q-.09-.256-.196-.364L11.65 2.41q-.108-.106-.367 + -.196zm3.428 13.644V6.714H11q-.357 0-.607-.25t-.25-.607V2.143h-6.86v13.714H14.71zM5.57 + 8.143q0-.125.08-.205.08-.08.204-.08h6.286q.125 0 .205.08.08.08.08.205v.57q0 .126-.08.207-.08.08 + -.205.08H5.854q-.125 0-.205-.08-.08-.08-.08-.206v-.57zm6.57 2q.125 0 .205.08.08.08.08.206V11q0 + .125-.08.205-.08.08-.205.08H5.854q-.125 0-.205-.08-.08-.08-.08-.205v-.57q0-.126.08-.207.08-.08.2 + -.08h6.286zm0 2.286q.125 0 .205.08.08.08.08.2v.572q0 .125-.08.205-.08.08-.205.08H5.854q-.125 0-.205 + -.08-.08-.08-.08-.205v-.572q0-.124.08-.204.08-.08.2-.08h6.286z`; plainIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-plain", scale, plainIconLazy.cloneNode(false)); } exports.plain = plain; -var otherIconLazy; -function other(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let otherIconLazy; +function other(x, y, title, scale = 1) { if (otherIconLazy === undefined) { - var d = "M10.8 13.5v3q0 .2-.15.35-.15.15-.35.15h-3q-.2 0-.35-.15-.15-.15-.15-.35v-3q0-.2.15-.35.15\n -.15.35-.15h3q.2 0 .35.15.15.15.15.35zM14.75 6q0 .675-.193 1.262-.193.588-.437.957-.244.365\n -.688.74-.443.375-.718.543-.275.17-.763.444-.51.286-.852.81-.344.526-.344.84 0 .21-.15.405-.15.194\n -.35.194h-3q-.186 0-.318-.23-.13-.234-.13-.47v-.564q0-1.037.812-1.956.812-.917 1.787-1.355.74-.336\n 1.05-.7.314-.362.314-.95 0-.524-.583-.924-.58-.4-1.343-.4-.814 0-1.35.362-.44.312-1.34 1.437-.16.2\n -.386.2-.15 0-.313-.1L3.4 4.987q-.16-.124-.193-.312-.03-.188.07-.35Q5.277 1 9.077 1q1 0 2.01.387\n 1.01.388 1.825 1.038.812.65 1.325 1.594.51.94.51 1.98z"; + const d = `M10.8 13.5v3q0 .2-.15.35-.15.15-.35.15h-3q-.2 0-.35-.15-.15-.15-.15-.35v-3q0-.2.15-.35.15 + -.15.35-.15h3q.2 0 .35.15.15.15.15.35zM14.75 6q0 .675-.193 1.262-.193.588-.437.957-.244.365 + -.688.74-.443.375-.718.543-.275.17-.763.444-.51.286-.852.81-.344.526-.344.84 0 .21-.15.405-.15.194 + -.35.194h-3q-.186 0-.318-.23-.13-.234-.13-.47v-.564q0-1.037.812-1.956.812-.917 1.787-1.355.74-.336 + 1.05-.7.314-.362.314-.95 0-.524-.583-.924-.58-.4-1.343-.4-.814 0-1.35.362-.44.312-1.34 1.437-.16.2 + -.386.2-.15 0-.313-.1L3.4 4.987q-.16-.124-.193-.312-.03-.188.07-.35Q5.277 1 9.077 1q1 0 2.01.387 + 1.01.388 1.825 1.038.812.65 1.325 1.594.51.94.51 1.98z`; otherIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-other", scale, otherIconLazy.cloneNode(false)); } exports.other = other; -var javascriptIconLazy; -function javascript(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let javascriptIconLazy; +function javascript(x, y, title, scale = 1) { if (javascriptIconLazy === undefined) { - var d = "M13.516 2.9c-2.766 0-4.463 1.522-4.463 3.536 0 1.733 1.295 2.82 3.256 3.52\n 1.413.49 1.973.926 1.973 1.644 0 .787-.647 1.296-1.873 1.296-1.137 0-2.26-.368-2.96-.736l-.54\n 2.19c.665.367 1.996.734 3.344.734 3.238 0 4.744-1.68 4.744-3.658\n 0-1.68-.966-2.767-3.05-3.537-1.54-.6-2.186-.93-2.186-1.68 0-.6.56-1.14 1.714-1.14\n 1.137 0 1.996.33 2.45.56l.596-2.138c-.7-.332-1.663-.596-3.01-.596zm-9.032.192v7.44c0\n 1.822-.702 2.33-1.822 2.33-.525 0-.997-.09-1.365-.212L1 14.805c.525.175 1.33.28 1.96.28\n 2.574 0 4.185-1.173 4.185-4.534V3.097h-2.66z"; + const d = `M13.516 2.9c-2.766 0-4.463 1.522-4.463 3.536 0 1.733 1.295 2.82 3.256 3.52 + 1.413.49 1.973.926 1.973 1.644 0 .787-.647 1.296-1.873 1.296-1.137 0-2.26-.368-2.96-.736l-.54 + 2.19c.665.367 1.996.734 3.344.734 3.238 0 4.744-1.68 4.744-3.658 + 0-1.68-.966-2.767-3.05-3.537-1.54-.6-2.186-.93-2.186-1.68 0-.6.56-1.14 1.714-1.14 + 1.137 0 1.996.33 2.45.56l.596-2.138c-.7-.332-1.663-.596-3.01-.596zm-9.032.192v7.44c0 + 1.822-.702 2.33-1.822 2.33-.525 0-.997-.09-1.365-.212L1 14.805c.525.175 1.33.28 1.96.28 + 2.574 0 4.185-1.173 4.185-4.534V3.097h-2.66z`; javascriptIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-js", scale, javascriptIconLazy.cloneNode(false)); } exports.javascript = javascript; -var imageIconLazy; -function image(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let imageIconLazy; +function image(x, y, title, scale = 1) { if (imageIconLazy === undefined) { - var d = "M6 6q0 .75-.525 1.275Q4.95 7.8 4.2 7.8q-.75 0-1.275-.525Q2.4 6.75 2.4\n 6q0-.75.525-1.275Q3.45 4.2 4.2 4.2q.75 0 1.275.525Q6 5.25 6 6zm9.6 3.6v4.2H2.4V12l3-3\n 1.5 1.5 4.8-4.8zm.9-6.6h-15q-.122 0-.21.09-.09.088-.09.21v11.4q0\n .122.09.21.088.09.21.09h15q.122 0 .21-.09.09-.088.09-.21V3.3q0-.122-.09-.21Q16.623\n 3 16.5 3zm1.5.3v11.4q0 .62-.44 1.06-.44.44-1.06.44h-15q-.62 0-1.06-.44Q0 15.32 0\n 14.7V3.3q0-.62.44-1.06.44-.44 1.06-.44h15q.62 0 1.06.44.44.44.44 1.06z"; + const d = `M6 6q0 .75-.525 1.275Q4.95 7.8 4.2 7.8q-.75 0-1.275-.525Q2.4 6.75 2.4 + 6q0-.75.525-1.275Q3.45 4.2 4.2 4.2q.75 0 1.275.525Q6 5.25 6 6zm9.6 3.6v4.2H2.4V12l3-3 + 1.5 1.5 4.8-4.8zm.9-6.6h-15q-.122 0-.21.09-.09.088-.09.21v11.4q0 + .122.09.21.088.09.21.09h15q.122 0 .21-.09.09-.088.09-.21V3.3q0-.122-.09-.21Q16.623 + 3 16.5 3zm1.5.3v11.4q0 .62-.44 1.06-.44.44-1.06.44h-15q-.62 0-1.06-.44Q0 15.32 0 + 14.7V3.3q0-.62.44-1.06.44-.44 1.06-.44h15q.62 0 1.06.44.44.44.44 1.06z`; imageIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-image", scale, imageIconLazy.cloneNode(false)); } exports.image = image; -function svg(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +function svg(x, y, title, scale = 1) { return image(x, y, title, scale); } exports.svg = svg; -var htmlIconLazy; -function html(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let htmlIconLazy; +function html(x, y, title, scale = 1) { if (htmlIconLazy === undefined) { - var d = "M5.626 13.31l-.492.492q-.098.098-.226.098t-.226-.098L.098 9.22Q0 9.12 0\n 8.99q0-.127.098-.226L4.682 4.18q.098-.097.226-.097t.226.098l.492.49q.1.1.1.23t-.1.23L1.76\n 8.99l3.866 3.866q.1.098.1.226t-.1.226zM11.44 2.815l-3.67\n 12.7q-.04.127-.152.19-.113.065-.23.026l-.61-.162q-.13-.04-.193-.152-.064-.112-.024-.24l3.67-12.698q.04\n -.128.157-.192.113-.064.23-.025l.61.167q.13.04.193.152.063.113.023.24zM17.9\n 9.22l-4.582 4.58q-.098.098-.226.098t-.226-.098l-.492-.492q-.1-.098-.1-.226t.1-.226L16.24\n 8.99l-3.867-3.865q-.1-.098-.1-.226t.1-.23l.492-.49q.098-.1.226-.1t.23.1l4.58 4.583q.1.1.1.226 0 .13-.1.23z"; + const d = `M5.626 13.31l-.492.492q-.098.098-.226.098t-.226-.098L.098 9.22Q0 9.12 0 + 8.99q0-.127.098-.226L4.682 4.18q.098-.097.226-.097t.226.098l.492.49q.1.1.1.23t-.1.23L1.76 + 8.99l3.866 3.866q.1.098.1.226t-.1.226zM11.44 2.815l-3.67 + 12.7q-.04.127-.152.19-.113.065-.23.026l-.61-.162q-.13-.04-.193-.152-.064-.112-.024-.24l3.67-12.698q.04 + -.128.157-.192.113-.064.23-.025l.61.167q.13.04.193.152.063.113.023.24zM17.9 + 9.22l-4.582 4.58q-.098.098-.226.098t-.226-.098l-.492-.492q-.1-.098-.1-.226t.1-.226L16.24 + 8.99l-3.867-3.865q-.1-.098-.1-.226t.1-.23l.492-.49q.098-.1.226-.1t.23.1l4.58 4.583q.1.1.1.226 0 .13-.1.23z`; htmlIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-html", scale, htmlIconLazy.cloneNode(false)); } exports.html = html; -var cssIconLazy; -function css(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let cssIconLazy; +function css(x, y, title, scale = 1) { if (cssIconLazy === undefined) { - var d = "M15.436.99q.625 0 1.095.416.47.415.47 1.04 0 .564-.4 1.35-2.97 5.624-4.16 6.724-.865.814\n -1.946.814-1.127 0-1.935-.827-.81-.827-.81-1.962 0-1.144.822-1.895l5.705-5.175Q14.8.99\n 15.435.99zM7.31 10.232q.35.68.953 1.162.603.483 1.345.68l.01.634q.035 1.904-1.16 3.102-1.192\n 1.198-3.114 1.198-1.1 0-1.948-.416-.85-.415-1.364-1.14-.514-.723-.773-1.635Q1 12.905 1\n 11.85l.366.268q.304.224.555.398.25.175.53.327.277.15.41.15.368 0 .493-.33.224-.59.515-1.005.29\n -.415.62-.68.332-.263.788-.424.455-.16.92-.228.465-.066 1.118-.094z"; + const d = `M15.436.99q.625 0 1.095.416.47.415.47 1.04 0 .564-.4 1.35-2.97 5.624-4.16 6.724-.865.814 + -1.946.814-1.127 0-1.935-.827-.81-.827-.81-1.962 0-1.144.822-1.895l5.705-5.175Q14.8.99 + 15.435.99zM7.31 10.232q.35.68.953 1.162.603.483 1.345.68l.01.634q.035 1.904-1.16 3.102-1.192 + 1.198-3.114 1.198-1.1 0-1.948-.416-.85-.415-1.364-1.14-.514-.723-.773-1.635Q1 12.905 1 + 11.85l.366.268q.304.224.555.398.25.175.53.327.277.15.41.15.368 0 .493-.33.224-.59.515-1.005.29 + -.415.62-.68.332-.263.788-.424.455-.16.92-.228.465-.066 1.118-.094z`; cssIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-css", scale, cssIconLazy.cloneNode(false)); } exports.css = css; -var warningIconLazy; -function warning(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let warningIconLazy; +function warning(x, y, title, scale = 1) { if (warningIconLazy === undefined) { - var d = "M6 6q0 .75-.525 1.275Q4.95 7.8 4.2 7.8q-.75 0-1.275-.525Q2.4 6.75 2.4\n 6q0-.75.525-1.275Q3.45 4.2 4.2 4.2q.75 0 1.275.525Q6 5.25 6 6zm9.6 3.6v4.2H2.4V12l3-3\n 1.5 1.5 4.8-4.8zm.9-6.6h-15q-.122 0-.21.09-.09.088-.09.21v11.4q0\n .122.09.21.088.09.21.09h15q.122 0 .21-.09.09-.088.09-.21V3.3q0-.122-.09-.21Q16.623\n 3 16.5 3zm1.5.3v11.4q0 .62-.44 1.06-.44.44-1.06.44h-15q-.62 0-1.06-.44Q0 15.32 0\n 14.7V3.3q0-.62.44-1.06.44-.44 1.06-.44h15q.62 0 1.06.44.44.44.44 1.06z"; + const d = `M6 6q0 .75-.525 1.275Q4.95 7.8 4.2 7.8q-.75 0-1.275-.525Q2.4 6.75 2.4 + 6q0-.75.525-1.275Q3.45 4.2 4.2 4.2q.75 0 1.275.525Q6 5.25 6 6zm9.6 3.6v4.2H2.4V12l3-3 + 1.5 1.5 4.8-4.8zm.9-6.6h-15q-.122 0-.21.09-.09.088-.09.21v11.4q0 + .122.09.21.088.09.21.09h15q.122 0 .21-.09.09-.088.09-.21V3.3q0-.122-.09-.21Q16.623 + 3 16.5 3zm1.5.3v11.4q0 .62-.44 1.06-.44.44-1.06.44h-15q-.62 0-1.06-.44Q0 15.32 0 + 14.7V3.3q0-.62.44-1.06.44-.44 1.06-.44h15q.62 0 1.06.44.44.44.44 1.06z`; warningIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-warning", scale, warningIconLazy.cloneNode(false)); } exports.warning = warning; -var errorIconLazy; -function error(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let errorIconLazy; +function error(x, y, title, scale = 1) { if (errorIconLazy === undefined) { - var d = "M9 1q2.177 0 4.016 1.073 1.838 1.073 2.91 2.91Q17 6.823 17 9q0 2.177-1.073 4.016-1.073\n 1.838-2.91 2.91Q11.177 17 9 17q-2.177 0-4.016-1.073-1.838-1.073-2.91-2.91Q1 11.177 1 9q0-2.177 1.073-4.016\n 1.073-1.838 2.91-2.91Q6.823 1 9 1zm1.333 12.99v-1.98q0-.145-.093-.244-.094-.1-.23-.1h-2q-.135 0-.24.105\n -.103.106-.103.24v1.98q0 .136.104.24.106.104.24.104h2q.137 0 .23-.1.094-.098.094-.243zm-.02-3.584l.187\n -6.468q0-.125-.104-.188-.104-.084-.25-.084H7.854q-.146 0-.25.084-.104.062-.104.188l.177 6.468q0\n .104.104.183.106.076.25.076h1.93q.146 0 .245-.078.1-.08.11-.184z"; + const d = `M9 1q2.177 0 4.016 1.073 1.838 1.073 2.91 2.91Q17 6.823 17 9q0 2.177-1.073 4.016-1.073 + 1.838-2.91 2.91Q11.177 17 9 17q-2.177 0-4.016-1.073-1.838-1.073-2.91-2.91Q1 11.177 1 9q0-2.177 1.073-4.016 + 1.073-1.838 2.91-2.91Q6.823 1 9 1zm1.333 12.99v-1.98q0-.145-.093-.244-.094-.1-.23-.1h-2q-.135 0-.24.105 + -.103.106-.103.24v1.98q0 .136.104.24.106.104.24.104h2q.137 0 .23-.1.094-.098.094-.243zm-.02-3.584l.187 + -6.468q0-.125-.104-.188-.104-.084-.25-.084H7.854q-.146 0-.25.084-.104.062-.104.188l.177 6.468q0 + .104.104.183.106.076.25.076h1.93q.146 0 .245-.078.1-.08.11-.184z`; errorIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-no-gzip", scale, errorIconLazy.cloneNode(false)); } exports.error = error; -var fontIconLazy; -function font(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let fontIconLazy; +function font(x, y, title, scale = 1) { if (fontIconLazy === undefined) { - var d = "M7.97 5.754L6.338 10.08q.317 0 1.312.02.994.02 1.542.02.183 0 .548-.02-.836-2.432-1.77\n -4.345zM1 16.38l.02-.76q.22-.068.538-.12.317-.053.548-.102.23-.048.476-.14.245-.09.428-.278.182\n -.187.298-.485l2.28-5.923 2.69-6.962H9.51q.077.135.105.202l1.972 4.615q.317.75 1.02 2.476.7 1.726\n 1.095 2.64.144.327.558 1.39.413 1.062.692 1.62.192.432.336.547.183.145.847.284.663.14.807.197.058.37.058.55\n 0 .04-.005.13t-.005.128q-.605 0-1.827-.076-1.22-.08-1.836-.08-.73 0-2.067.07-1.337.067-1.712.076 0-.412.04\n -.75l1.258-.27q.01 0 .12-.022l.15-.033q.038-.01.14-.044.1-.034.143-.06l.1-.08q.06-.048.082-.106.024-.056.024\n -.133 0-.152-.298-.926t-.693-1.71q-.392-.93-.402-.96l-4.325-.02q-.25.56-.734 1.88-.487 1.32-.487 1.56 0\n .213.136.362.134.15.418.235.285.087.467.13.185.044.55.08.366.04.395.04.01.183.01.558 0 .087-.02.26-.558\n 0-1.678-.095-1.12-.098-1.678-.098-.08 0-.26.04-.18.037-.208.037-.77.136-1.808.136Z"; + const d = `M7.97 5.754L6.338 10.08q.317 0 1.312.02.994.02 1.542.02.183 0 .548-.02-.836-2.432-1.77 + -4.345zM1 16.38l.02-.76q.22-.068.538-.12.317-.053.548-.102.23-.048.476-.14.245-.09.428-.278.182 + -.187.298-.485l2.28-5.923 2.69-6.962H9.51q.077.135.105.202l1.972 4.615q.317.75 1.02 2.476.7 1.726 + 1.095 2.64.144.327.558 1.39.413 1.062.692 1.62.192.432.336.547.183.145.847.284.663.14.807.197.058.37.058.55 + 0 .04-.005.13t-.005.128q-.605 0-1.827-.076-1.22-.08-1.836-.08-.73 0-2.067.07-1.337.067-1.712.076 0-.412.04 + -.75l1.258-.27q.01 0 .12-.022l.15-.033q.038-.01.14-.044.1-.034.143-.06l.1-.08q.06-.048.082-.106.024-.056.024 + -.133 0-.152-.298-.926t-.693-1.71q-.392-.93-.402-.96l-4.325-.02q-.25.56-.734 1.88-.487 1.32-.487 1.56 0 + .213.136.362.134.15.418.235.285.087.467.13.185.044.55.08.366.04.395.04.01.183.01.558 0 .087-.02.26-.558 + 0-1.678-.095-1.12-.098-1.678-.098-.08 0-.26.04-.18.037-.208.037-.77.136-1.808.136Z`; fontIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-font", scale, fontIconLazy.cloneNode(false)); } exports.font = font; -var flashIconLazy; -function flash(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let flashIconLazy; +function flash(x, y, title, scale = 1) { if (flashIconLazy === undefined) { - var d = "M13.724 4.738q.195.216.076.476L7.96 17.73q-.142.27-.456.27-.043 0-.15-.022-.185-.054-.277\n -.205-.092-.15-.05-.325l2.132-8.74L4.765 9.8q-.044.01-.13.01-.195 0-.336-.118-.193-.162-.14-.422L6.337.346q.043\n -.15.173-.25Q6.64 0 6.81 0h3.548q.206 0 .346.135.14.135.14.32 0 .086-.053.194L8.94 5.654l4.285\n -1.06q.086-.02.13-.02.205 0 .367.16z"; + const d = `M13.724 4.738q.195.216.076.476L7.96 17.73q-.142.27-.456.27-.043 0-.15-.022-.185-.054-.277 + -.205-.092-.15-.05-.325l2.132-8.74L4.765 9.8q-.044.01-.13.01-.195 0-.336-.118-.193-.162-.14-.422L6.337.346q.043 + -.15.173-.25Q6.64 0 6.81 0h3.548q.206 0 .346.135.14.135.14.32 0 .086-.053.194L8.94 5.654l4.285 + -1.06q.086-.02.13-.02.205 0 .367.16z`; flashIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-flash", scale, flashIconLazy.cloneNode(false)); } exports.flash = flash; -var videoIconLazy; -function video(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let videoIconLazy; +function video(x, y, title, scale = 1) { if (videoIconLazy === undefined) { - var d = "M17 4.107v9.714q0 .38-.348.53-.116.05-.223.05-.25 0-.41-.17l-3.6-3.6v1.48q0 1.067-.757 1.82-.754.756\n -1.817.756H3.57q-1.06 0-1.816-.753Q1 13.17 1 12.106V5.82q0-1.06.754-1.816.755-.754 1.817-.754h6.29q1.07 0\n 1.82.754.76.755.76 1.817V7.3l3.597-3.59q.16-.17.4-.17.107 0 .22.045.35.153.35.528z"; + const d = `M17 4.107v9.714q0 .38-.348.53-.116.05-.223.05-.25 0-.41-.17l-3.6-3.6v1.48q0 1.067-.757 1.82-.754.756 + -1.817.756H3.57q-1.06 0-1.816-.753Q1 13.17 1 12.106V5.82q0-1.06.754-1.816.755-.754 1.817-.754h6.29q1.07 0 + 1.82.754.76.755.76 1.817V7.3l3.597-3.59q.16-.17.4-.17.107 0 .22.045.35.153.35.528z`; videoIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-video", scale, videoIconLazy.cloneNode(false)); } exports.video = video; -var audioIconLazy; -function audio(x, y, title, scale) { - if (scale === void 0) { scale = 1; } +let audioIconLazy; +function audio(x, y, title, scale = 1) { if (audioIconLazy === undefined) { - var d = "M8.385 3.756v10.46q0 .252-.183.434-.183.183-.433.183t-.44-.183l-3.2-3.202H1.61q-.25\n 0-.43-.183-.18-.182-.18-.432V7.14q0-.25.182-.432.182-.183.432-.183h2.52l3.202-3.202q.182-.183.432\n -.183t.43.183q.182.183.182.433zm3.692 5.23q0 .73-.41 1.36-.407.63-1.08.9-.097.048-.24.048-.25 0\n -.434-.178-.182-.177-.182-.437 0-.21.12-.35.12-.14.28-.24.16-.1.33-.22.166-.12.28-.34.117-.22.117\n -.55 0-.33-.115-.55-.115-.224-.28-.344-.163-.12-.326-.22-.165-.1-.28-.24-.116-.14-.116-.34 0-.26.183\n -.44t.43-.176q.146 0 .24.048.676.26 1.08.894.41.636.41 1.367zm2.46 0q0 1.472-.816 2.717t-2.16 1.813q\n -.12.048-.24.048-.26 0-.44-.183-.18-.18-.18-.43 0-.37.378-.56.54-.28.73-.42.713-.52 1.11-1.302.4\n -.783.4-1.667 0-.886-.4-1.67-.4-.783-1.11-1.303-.192-.145-.73-.424-.376-.192-.376-.567 0-.25.183\n -.434.183-.18.433-.18.123 0 .25.047 1.344.567 2.16 1.812.82 1.244.82 2.716zm2.463 0q0 2.212\n -1.22 4.063-1.222 1.85-3.25 2.72-.126.05-.25.05-.25 0-.434-.19-.183-.183-.183-.433 0-.346.375\n -.568.068-.04.217-.1.15-.064.216-.1.45-.244.79-.494 1.19-.875 1.85-2.183.67-1.306.67-2.777 0\n -1.47-.663-2.78-.664-1.304-1.846-2.18-.346-.25-.79-.49-.065-.035-.214-.1-.15-.06-.22-.1\n -.375-.22-.375-.57 0-.25.183-.43.183-.182.433-.182.123 0 .25.047 2.027.876 3.25 2.727Q17 6.775 17 8.99Z"; + const d = `M8.385 3.756v10.46q0 .252-.183.434-.183.183-.433.183t-.44-.183l-3.2-3.202H1.61q-.25 + 0-.43-.183-.18-.182-.18-.432V7.14q0-.25.182-.432.182-.183.432-.183h2.52l3.202-3.202q.182-.183.432 + -.183t.43.183q.182.183.182.433zm3.692 5.23q0 .73-.41 1.36-.407.63-1.08.9-.097.048-.24.048-.25 0 + -.434-.178-.182-.177-.182-.437 0-.21.12-.35.12-.14.28-.24.16-.1.33-.22.166-.12.28-.34.117-.22.117 + -.55 0-.33-.115-.55-.115-.224-.28-.344-.163-.12-.326-.22-.165-.1-.28-.24-.116-.14-.116-.34 0-.26.183 + -.44t.43-.176q.146 0 .24.048.676.26 1.08.894.41.636.41 1.367zm2.46 0q0 1.472-.816 2.717t-2.16 1.813q + -.12.048-.24.048-.26 0-.44-.183-.18-.18-.18-.43 0-.37.378-.56.54-.28.73-.42.713-.52 1.11-1.302.4 + -.783.4-1.667 0-.886-.4-1.67-.4-.783-1.11-1.303-.192-.145-.73-.424-.376-.192-.376-.567 0-.25.183 + -.434.183-.18.433-.18.123 0 .25.047 1.344.567 2.16 1.812.82 1.244.82 2.716zm2.463 0q0 2.212 + -1.22 4.063-1.222 1.85-3.25 2.72-.126.05-.25.05-.25 0-.434-.19-.183-.183-.183-.433 0-.346.375 + -.568.068-.04.217-.1.15-.064.216-.1.45-.244.79-.494 1.19-.875 1.85-2.183.67-1.306.67-2.777 0 + -1.47-.663-2.78-.664-1.304-1.846-2.18-.346-.25-.79-.49-.065-.035-.214-.1-.15-.06-.22-.1 + -.375-.22-.375-.57 0-.25.183-.43.183-.182.433-.182.123 0 .25.047 2.027.876 3.25 2.727Q17 6.775 17 8.99Z`; audioIconLazy = svgLib.newPath(d); } return wrapSvgIcon(x, y, title, "icon-audio", scale, audioIconLazy.cloneNode(false)); @@ -374,8 +436,8 @@ exports.isTabDown = exports.isTabUp = exports.pluralize = exports.toCssClass = e * @param {string} url */ function parseUrl(url) { - var pattern = RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"); - var matches = url.match(pattern) || []; + const pattern = RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"); + const matches = url.match(pattern) || []; return { authority: matches[4], fragment: matches[9], @@ -390,7 +452,7 @@ function parseUrl(url) { * @returns boolean - true if `item` is in `arr` */ function contains(arr, item) { - return arr.some(function (x) { return x === item; }); + return arr.some((x) => x === item); } exports.contains = contains; /** @@ -399,11 +461,11 @@ exports.contains = contains; * @param predicate Function that returns true for a match */ function findIndex(arr, predicate) { - var i = 0; + let i = 0; if (!arr || arr.length < 1) { return undefined; } - var len = arr.length; + const len = arr.length; while (i < len) { if (predicate(arr[i], i)) { return i; @@ -419,7 +481,7 @@ exports.findIndex = findIndex; * @param predicate Function that returns true for a match */ function find(arr, predicate) { - var index = findIndex(arr, predicate); + const index = findIndex(arr, predicate); if (index === undefined) { return undefined; } @@ -436,14 +498,14 @@ function resourceUrlFormatter(url, maxLength) { if (url.length < maxLength) { return url.replace(/https?:\/\//, ""); } - var matches = parseUrl(url); + const matches = parseUrl(url); if ((matches.authority + matches.path).length < maxLength) { return matches.authority + matches.path; } - var maxAuthLength = Math.floor(maxLength / 2) - 3; - var maxPathLength = Math.floor(maxLength / 2) - 5; + const maxAuthLength = Math.floor(maxLength / 2) - 3; + const maxPathLength = Math.floor(maxLength / 2) - 5; // maybe we could fine tune these numbers - var p = matches.path.split("/"); + const p = matches.path.split("/"); if (matches.authority.length > maxAuthLength) { return matches.authority.substr(0, maxAuthLength) + "..." + p[p.length - 1].substr(-maxPathLength); } @@ -457,8 +519,7 @@ exports.resourceUrlFormatter = resourceUrlFormatter; * @param {number} num - number to round * @param {number} [decimals=2] - decimal precision to round to */ -function roundNumber(num, decimals) { - if (decimals === void 0) { decimals = 2; } +function roundNumber(num, decimals = 2) { return Math.round(num * Math.pow(10, decimals)) / Math.pow(10, decimals); } exports.roundNumber = roundNumber; @@ -474,7 +535,7 @@ function isInStatusCodeRange(status, lowerBound, upperBound) { } exports.isInStatusCodeRange = isInStatusCodeRange; /** precompiled regex */ -var cssClassRegEx = /[^a-z-]/g; +const cssClassRegEx = /[^a-z-]/g; /** * Converts a seed string to a CSS class by stripping out invalid characters * @param {string} seed string to base the CSS class off @@ -513,7 +574,7 @@ exports.isTabDown = isTabDown; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateOptions = exports.toInt = exports.sanitizeAlphaNumeric = exports.sanitizeUrlForLink = exports.escapeHtml = exports.formatBytes = exports.formatDateLocalized = exports.formatSeconds = exports.formatMilliseconds = exports.parsePositive = exports.parseNonNegative = exports.parseDate = exports.parseNonEmpty = exports.parseAndFormat = void 0; -var misc_1 = require("./misc"); +const misc_1 = require("./misc"); /** * Type safe and null safe way to transform, filter and format an input value, e.g. parse a Date from a string, * rejecting invalid dates, and formatting it as a localized string. If the input value is undefined, or the parseFn @@ -523,12 +584,11 @@ var misc_1 = require("./misc"); * @param formatFn an optional function to format the parsed input value. * @returns {string} a formatted string representation of the input, or undefined. */ -function parseAndFormat(input, parseFn, formatFn) { - if (formatFn === void 0) { formatFn = toString; } +function parseAndFormat(input, parseFn, formatFn = toString) { if (input === undefined) { return undefined; } - var parsed = parseFn(input); + const parsed = parseFn(input); if (parsed === undefined) { return undefined; } @@ -540,7 +600,7 @@ function toString(source) { return source.toString(); } else { - throw TypeError("Can't convert type " + typeof source + " to string"); + throw TypeError(`Can't convert type ${typeof source} to string`); } } function parseNonEmpty(input) { @@ -548,7 +608,7 @@ function parseNonEmpty(input) { } exports.parseNonEmpty = parseNonEmpty; function parseDate(input) { - var date = new Date(input); + const date = new Date(input); if (isNaN(date.getTime())) { return undefined; } @@ -559,7 +619,7 @@ function parseNonNegative(input) { if (input === undefined || input === null) { return undefined; } - var filter = function (n) { return (n >= 0); }; + const filter = (n) => (n >= 0); return parseToNumber(input, filter); } exports.parseNonNegative = parseNonNegative; @@ -567,14 +627,14 @@ function parsePositive(input) { if (input === undefined || input === null) { return undefined; } - var filter = function (n) { return (n > 0); }; + const filter = (n) => (n > 0); return parseToNumber(input, filter); } exports.parsePositive = parsePositive; function parseToNumber(input, filterFn) { - var filter = function (n) { return filterFn(n) ? n : undefined; }; + const filter = (n) => filterFn(n) ? n : undefined; if (typeof input === "string") { - var n = parseInt(input, 10); + const n = parseInt(input, 10); if (!isFinite(n)) { return undefined; } @@ -583,51 +643,51 @@ function parseToNumber(input, filterFn) { return filter(input); } function formatMilliseconds(millis) { - return (millis !== undefined) ? misc_1.roundNumber(millis, 3) + " ms" : undefined; + return (millis !== undefined) ? `${(0, misc_1.roundNumber)(millis, 3)} ms` : undefined; } exports.formatMilliseconds = formatMilliseconds; -var secondsPerMinute = 60; -var secondsPerHour = 60 * secondsPerMinute; -var secondsPerDay = 24 * secondsPerHour; +const secondsPerMinute = 60; +const secondsPerHour = 60 * secondsPerMinute; +const secondsPerDay = 24 * secondsPerHour; function formatSeconds(seconds) { if (seconds === undefined) { return undefined; } - var raw = misc_1.roundNumber(seconds, 3) + " s"; + const raw = `${(0, misc_1.roundNumber)(seconds, 3)} s`; if (seconds > secondsPerDay) { - return raw + " (~" + misc_1.roundNumber(seconds / secondsPerDay, 0) + " days)"; + return `${raw} (~${(0, misc_1.roundNumber)(seconds / secondsPerDay, 0)} days)`; } if (seconds > secondsPerHour) { - return raw + " (~" + misc_1.roundNumber(seconds / secondsPerHour, 0) + " hours)"; + return `${raw} (~${(0, misc_1.roundNumber)(seconds / secondsPerHour, 0)} hours)`; } if (seconds > secondsPerMinute) { - return raw + " (~" + misc_1.roundNumber(seconds / secondsPerMinute, 0) + " minutes)"; + return `${raw} (~${(0, misc_1.roundNumber)(seconds / secondsPerMinute, 0)} minutes)`; } return raw; } exports.formatSeconds = formatSeconds; function formatDateLocalized(date) { - return (date !== undefined) ? date.toUTCString() + "
(local time: " + date.toLocaleString() + ")" : undefined; + return (date !== undefined) ? `${date.toUTCString()}
(local time: ${date.toLocaleString()})` : undefined; } exports.formatDateLocalized = formatDateLocalized; -var bytesPerKB = 1024; -var bytesPerMB = 1024 * bytesPerKB; +const bytesPerKB = 1024; +const bytesPerMB = 1024 * bytesPerKB; function formatBytes(bytes) { if (bytes === undefined) { return ""; } - var raw = bytes + " bytes"; + const raw = `${bytes} bytes`; if (bytes >= bytesPerMB) { - return raw + " (~" + misc_1.roundNumber(bytes / bytesPerMB, 1) + " MB)"; + return `${raw} (~${(0, misc_1.roundNumber)(bytes / bytesPerMB, 1)} MB)`; } if (bytes >= bytesPerKB) { - return raw + " (~" + misc_1.roundNumber(bytes / bytesPerKB, 0) + " kB)"; + return `${raw} (~${(0, misc_1.roundNumber)(bytes / bytesPerKB, 0)} kB)`; } return raw; } exports.formatBytes = formatBytes; /** HTML character to escape */ -var htmlCharMap = { +const htmlCharMap = { "\"": """, "&": "&", "'": "'", @@ -638,13 +698,12 @@ var htmlCharMap = { * Reusable regex to escape HTML chars * Combined to improve performance */ -var htmlChars = new RegExp(Object.keys(htmlCharMap).join("|"), "g"); +const htmlChars = new RegExp(Object.keys(htmlCharMap).join("|"), "g"); /** * Escapes unsafe characters in a string to render safely in HTML * @param {string} unsafe - string to be rendered in HTML */ -function escapeHtml(unsafe) { - if (unsafe === void 0) { unsafe = ""; } +function escapeHtml(unsafe = "") { if (unsafe === null || unsafe === undefined) { return ""; // See https://github.com/micmro/PerfCascade/issues/217 } @@ -656,16 +715,16 @@ function escapeHtml(unsafe) { throw TypeError("Invalid parameter"); } } - return unsafe.replace(htmlChars, function (match) { + return unsafe.replace(htmlChars, (match) => { return htmlCharMap[match]; }); } exports.escapeHtml = escapeHtml; /** Whitelist of save-ish URL chars */ -var unSafeUrlChars = new RegExp("[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]", "g"); +const unSafeUrlChars = new RegExp("[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]", "g"); /** returns a cleaned http:// or https:// based URL */ function sanitizeUrlForLink(unsafeUrl) { - var cleaned = unsafeUrl.replace(unSafeUrlChars, "_"); + const cleaned = unsafeUrl.replace(unSafeUrlChars, "_"); if (cleaned.indexOf("http://") === 0 || cleaned.indexOf("https://") === 0) { return cleaned; } @@ -675,7 +734,7 @@ function sanitizeUrlForLink(unsafeUrl) { } exports.sanitizeUrlForLink = sanitizeUrlForLink; /** whitelist basic chars */ -var requestTypeTypeRegEx = new RegExp("[^a-zA-Z0-9]", "g"); +const requestTypeTypeRegEx = new RegExp("[^a-zA-Z0-9]", "g"); /** returns cleaned sting - stipps out not a-zA-Z0-9 */ function sanitizeAlphaNumeric(unsafe) { return unsafe.toString().replace(requestTypeTypeRegEx, ""); @@ -696,14 +755,14 @@ function toInt(input) { exports.toInt = toInt; /** Validates the `ChartOptions` attributes types */ function validateOptions(options) { - var validateInt = function (name) { - var val = toInt(options[name]); + const validateInt = (name) => { + const val = toInt(options[name]); if (val === undefined) { - throw TypeError("option \"" + name + "\" needs to be a number"); + throw TypeError(`option "${name}" needs to be a number`); } options[name] = val; }; - var ensureBoolean = function (name) { + const ensureBoolean = (name) => { options[name] = !!options[name]; }; validateInt("leftColumnWidth"); @@ -723,90 +782,79 @@ exports.validateOptions = validateOptions; */ Object.defineProperty(exports, "__esModule", { value: true }); exports.getNodeTextWidth = exports.newPath = exports.newTextEl = exports.newTitle = exports.newLine = exports.newRect = exports.newA = exports.newForeignObject = exports.newClipPath = exports.newG = exports.newSvg = void 0; -var dom_1 = require("./dom"); +const dom_1 = require("./dom"); /** Namespace for SVG Elements */ -var svgNamespaceUri = "http://www.w3.org/2000/svg"; -function newElement(tagName, _a) { - var _b = _a === void 0 ? {} : _a, _c = _b.attributes, attributes = _c === void 0 ? {} : _c, _d = _b.css, css = _d === void 0 ? {} : _d, _e = _b.text, text = _e === void 0 ? "" : _e, _f = _b.className, className = _f === void 0 ? "" : _f; - var element = document.createElementNS(svgNamespaceUri, tagName); +const svgNamespaceUri = "http://www.w3.org/2000/svg"; +function newElement(tagName, { attributes = {}, css = {}, text = "", className = "", } = {}) { + const element = document.createElementNS(svgNamespaceUri, tagName); if (className) { - dom_1.addClass(element, className); + (0, dom_1.addClass)(element, className); } if (text) { element.textContent = text; } - dom_1.safeSetStyles(element, css); - dom_1.safeSetAttributes(element, attributes); + (0, dom_1.safeSetStyles)(element, css); + (0, dom_1.safeSetAttributes)(element, attributes); return element; } -function newSvg(className, attributes, css) { - if (css === void 0) { css = {}; } - return newElement("svg", { className: className, attributes: attributes, css: css }); +function newSvg(className, attributes, css = {}) { + return newElement("svg", { className, attributes, css }); } exports.newSvg = newSvg; -function newG(className, attributes, css) { - if (attributes === void 0) { attributes = {}; } - if (css === void 0) { css = {}; } - return newElement("g", { className: className, attributes: attributes, css: css }); +function newG(className, attributes = {}, css = {}) { + return newElement("g", { className, attributes, css }); } exports.newG = newG; function newClipPath(id) { - var attributes = { id: id }; - return newElement("clipPath", { attributes: attributes }); + const attributes = { id }; + return newElement("clipPath", { attributes }); } exports.newClipPath = newClipPath; -function newForeignObject(attributes, className, css) { - if (className === void 0) { className = ""; } - if (css === void 0) { css = {}; } - return newElement("foreignObject", { attributes: attributes, className: className, css: css }); +function newForeignObject(attributes, className = "", css = {}) { + return newElement("foreignObject", { attributes, className, css }); } exports.newForeignObject = newForeignObject; function newA(className) { - return newElement("a", { className: className }); + return newElement("a", { className }); } exports.newA = newA; -function newRect(attributes, className, css) { - if (className === void 0) { className = ""; } - if (css === void 0) { css = {}; } - return newElement("rect", { attributes: attributes, className: className, css: css }); +function newRect(attributes, className = "", css = {}) { + return newElement("rect", { attributes, className, css }); } exports.newRect = newRect; -function newLine(attributes, className) { - if (className === void 0) { className = ""; } - return newElement("line", { className: className, attributes: attributes }); +function newLine(attributes, className = "") { + return newElement("line", { className, attributes }); } exports.newLine = newLine; function newTitle(text) { - var title = document.createElementNS(svgNamespaceUri, "title"); + const title = document.createElementNS(svgNamespaceUri, "title"); title.setAttribute("text", text); return title; } exports.newTitle = newTitle; -function newTextEl(text, attributes, css) { - if (attributes === void 0) { attributes = {}; } - if (css === void 0) { css = {}; } - return newElement("text", { text: text, attributes: attributes, css: css }); +function newTextEl(text, attributes = {}, css = {}) { + return newElement("text", { text, attributes, css }); } exports.newTextEl = newTextEl; function newPath(d) { - var path = document.createElementNS(svgNamespaceUri, "path"); + const path = document.createElementNS(svgNamespaceUri, "path"); path.setAttribute("d", d); return path; } exports.newPath = newPath; /** temp SVG element for size measurements */ -var getTestSVGEl = (function () { +const getTestSVGEl = (() => { /** Reference to Temp SVG element for size measurements */ - var svgTestEl; - var removeSvgTestElTimeout; - return function () { + let svgTestEl; + let removeSvgTestElTimeout; + return () => { // lazy init svgTestEl if (svgTestEl === undefined) { - var attributes = { + const attributes = { className: "water-fall-chart temp", width: "9999px", }; - var css = { + const css = { "left": "0px", "position": "absolute", "top": "0px", @@ -822,7 +870,7 @@ var getTestSVGEl = (function () { } // debounced time-deleayed cleanup, so the element can be re-used in tight loops clearTimeout(removeSvgTestElTimeout); - removeSvgTestElTimeout = setTimeout(function () { + removeSvgTestElTimeout = setTimeout(() => { svgTestEl.parentNode.removeChild(svgTestEl); }, 500); return svgTestEl; @@ -834,14 +882,13 @@ var getTestSVGEl = (function () { * @param {boolean=false} skipClone - do not clone `textNode` and use original * @returns number */ -function getNodeTextWidth(textNode, skipClone) { - if (skipClone === void 0) { skipClone = false; } +function getNodeTextWidth(textNode, skipClone = false) { if ((textNode.textContent || "").length === 0) { return 0; } - var tmp = getTestSVGEl(); - var tmpTextNode; - var shadow; + const tmp = getTestSVGEl(); + let tmpTextNode; + let shadow; if (skipClone) { shadow = textNode.style.textShadow; tmpTextNode = textNode; @@ -855,7 +902,7 @@ function getNodeTextWidth(textNode, skipClone) { tmpTextNode.style.textShadow = "0"; tmp.appendChild(tmpTextNode); window.document.body.appendChild(tmp); - var width = tmpTextNode.getComputedTextLength(); + const width = tmpTextNode.getComputedTextLength(); if (skipClone && shadow !== undefined) { textNode.style.textShadow = shadow; } @@ -871,35 +918,32 @@ exports.makeLegend = void 0; * Creates the html for diagrams legend */ function makeLegend() { - var ulNode = document.createElement("ul"); + const ulNode = document.createElement("ul"); ulNode.className = "resource-legend"; - ulNode.innerHTML = "\n
  • Blocked
  • \n
  • DNS
  • \n
  • Connect
  • \n
  • SSL (TLS)
  • \n
  • Send
  • \n
  • Wait
  • \n
  • Receive
  • "; + ulNode.innerHTML = ` +
  • Blocked
  • +
  • DNS
  • +
  • Connect
  • +
  • SSL (TLS)
  • +
  • Send
  • +
  • Wait
  • +
  • Receive
  • `; return ulNode; } exports.makeLegend = makeLegend; },{}],8:[function(require,module,exports){ "use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; Object.defineProperty(exports, "__esModule", { value: true }); exports.fromHar = exports.makeLegend = void 0; -var parse_1 = require("./helpers/parse"); -var legend_1 = require("./legend/legend"); -var paging_1 = require("./paging/paging"); -var HarTransformer = require("./transformers/har"); -var svg_chart_1 = require("./waterfall/svg-chart"); +const parse_1 = require("./helpers/parse"); +const legend_1 = require("./legend/legend"); +const paging_1 = require("./paging/paging"); +const HarTransformer = require("./transformers/har"); +const svg_chart_1 = require("./waterfall/svg-chart"); /** default options to use if not set in `options` parameter */ -var defaultChartOptions = { +const defaultChartOptions = { leftColumnWidth: 25, legendHolder: undefined, onParsed: undefined, @@ -911,7 +955,7 @@ var defaultChartOptions = { showMimeTypeIcon: true, }; /** default options to use if not set in `options` parameter */ -var defaultHarTransformerOptions = { +const defaultHarTransformerOptions = { showUserTiming: false, showUserTimingEndMarker: false, }; @@ -920,25 +964,24 @@ var defaultHarTransformerOptions = { * @returns {HTMLUListElement} - Legend `
      ` element */ function makeLegend() { - return legend_1.makeLegend(); + return (0, legend_1.makeLegend)(); } exports.makeLegend = makeLegend; -function PerfCascade(waterfallDocsData, chartOptions) { - if (chartOptions === void 0) { chartOptions = {}; } +function PerfCascade(waterfallDocsData, chartOptions = {}) { if (chartOptions["leftColumnWith"] !== undefined) { // tslint:disable-next-line: no-console console.warn("Depreciation Warning: The option 'leftColumnWith' has been fixed to 'leftColumnWidth', " + "please update your code as this will get deprecated in the future"); chartOptions.leftColumnWidth = chartOptions["leftColumnWith"]; } - var options = parse_1.validateOptions(__assign(__assign({}, defaultChartOptions), chartOptions)); + const options = (0, parse_1.validateOptions)({ ...defaultChartOptions, ...chartOptions }); // setup paging helper - var paging = new paging_1.default(waterfallDocsData, options.selectedPage); - var doc = svg_chart_1.createWaterfallSvg(paging.getSelectedPage(), options); + const paging = new paging_1.default(waterfallDocsData, options.selectedPage); + let doc = (0, svg_chart_1.createWaterfallSvg)(paging.getSelectedPage(), options); // page update behavior - paging.onPageUpdate(function (_pageIndex, pageDoc) { - var el = doc.parentElement; - var newDoc = svg_chart_1.createWaterfallSvg(pageDoc, options); + paging.onPageUpdate((_pageIndex, pageDoc) => { + const el = doc.parentElement; + const newDoc = (0, svg_chart_1.createWaterfallSvg)(pageDoc, options); el.replaceChild(newDoc, doc); doc = newDoc; }); @@ -947,7 +990,7 @@ function PerfCascade(waterfallDocsData, chartOptions) { } if (options.legendHolder) { options.legendHolder.innerHTML = ""; - options.legendHolder.appendChild(legend_1.makeLegend()); + options.legendHolder.appendChild((0, legend_1.makeLegend)()); } return doc; } @@ -957,10 +1000,12 @@ function PerfCascade(waterfallDocsData, chartOptions) { * @param {ChartOptions} options - PerfCascade options object * @returns {SVGSVGElement} - Chart SVG Element */ -function fromHar(harData, options) { - if (options === void 0) { options = {}; } - var harTransformerOptions = __assign(__assign({}, defaultHarTransformerOptions), options); - var data = HarTransformer.transformDoc(harData, harTransformerOptions); +function fromHar(harData, options = {}) { + const harTransformerOptions = { + ...defaultHarTransformerOptions, + ...options, + }; + const data = HarTransformer.transformDoc(harData, harTransformerOptions); if (typeof options.onParsed === "function") { options.onParsed(data); } @@ -971,11 +1016,10 @@ exports.fromHar = fromHar; },{"./helpers/parse":5,"./legend/legend":7,"./paging/paging":9,"./transformers/har":13,"./waterfall/svg-chart":27}],9:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -var dom_1 = require("../helpers/dom"); +const dom_1 = require("../helpers/dom"); /** Class to keep track of run of a multi-run har is beeing shown */ -var Paging = /** @class */ (function () { - function Paging(doc, selectedPageIndex) { - if (selectedPageIndex === void 0) { selectedPageIndex = 0; } +class Paging { + constructor(doc, selectedPageIndex = 0) { this.doc = doc; this.selectedPageIndex = selectedPageIndex; this.onPageUpdateCbs = []; @@ -988,30 +1032,29 @@ var Paging = /** @class */ (function () { * Returns number of pages * @returns number - number of pages in current doc */ - Paging.prototype.getPageCount = function () { + getPageCount() { return this.doc.pages.length; - }; + } /** * Returns selected pages * @returns WaterfallData - currently selected page */ - Paging.prototype.getSelectedPage = function () { + getSelectedPage() { return this.doc.pages[this.selectedPageIndex]; - }; + } /** * Returns index of currently selected page * @returns number - index of current page (0 based) */ - Paging.prototype.getSelectedPageIndex = function () { + getSelectedPageIndex() { return this.selectedPageIndex; - }; + } /** * Update which pageIndex is currently update. * Published `onPageUpdate` * @param {number} pageIndex */ - Paging.prototype.setSelectedPageIndex = function (pageIndex) { - var _this = this; + setSelectedPageIndex(pageIndex) { if (this.selectedPageIndex === pageIndex) { return; } @@ -1019,85 +1062,83 @@ var Paging = /** @class */ (function () { throw new Error("Page does not exist - Invalid pageIndex selected"); } this.selectedPageIndex = pageIndex; - var selectedPage = this.doc.pages[this.selectedPageIndex]; - this.onPageUpdateCbs.forEach(function (cb) { - cb(_this.selectedPageIndex, selectedPage); + const selectedPage = this.doc.pages[this.selectedPageIndex]; + this.onPageUpdateCbs.forEach((cb) => { + cb(this.selectedPageIndex, selectedPage); }); - }; + } /** * Register subscriber callbacks to be called when the pageindex updates * @param {OnPagingCb} cb * @returns number - index of the callback */ - Paging.prototype.onPageUpdate = function (cb) { + onPageUpdate(cb) { if (this.getPageCount() > 1) { return this.onPageUpdateCbs.push(cb); } return undefined; - }; + } /** * hooks up select box with paging options * @param {HTMLSelectElement} selectbox */ - Paging.prototype.initPagingSelectBox = function (selectbox) { - var _this = this; - var self = this; + initPagingSelectBox(selectbox) { + const self = this; if (this.getPageCount() <= 1) { selectbox.style.display = "none"; return; } // remove all existing options, like placeholders - dom_1.removeChildren(selectbox); - this.doc.pages.forEach(function (p, i) { - var option = new Option(p.title, i.toString(), false, i === _this.selectedPageIndex); + (0, dom_1.removeChildren)(selectbox); + this.doc.pages.forEach((p, i) => { + const option = new Option(p.title, i.toString(), false, i === this.selectedPageIndex); selectbox.add(option); }); selectbox.style.display = "block"; - selectbox.addEventListener("change", function (evt) { - var val = parseInt(evt.target.value, 10); + selectbox.addEventListener("change", (evt) => { + const val = parseInt(evt.target.value, 10); self.setSelectedPageIndex(val); }); - }; - return Paging; -}()); + } +} exports.default = Paging; },{"../helpers/dom":1}],10:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getKeys = void 0; -var har_1 = require("../helpers/har"); -var parse_1 = require("../helpers/parse"); -var helpers_1 = require("./helpers"); -var byteSizeProperty = function (title, input) { - return [title, parse_1.parseAndFormat(input, parse_1.parsePositive, parse_1.formatBytes)]; +const har_1 = require("../helpers/har"); +const parse_1 = require("../helpers/parse"); +const helpers_1 = require("./helpers"); +const byteSizeProperty = (title, input) => { + return [title, (0, parse_1.parseAndFormat)(input, parse_1.parsePositive, parse_1.formatBytes)]; }; -var countProperty = function (title, input) { - return [title, parse_1.parseAndFormat(input, parse_1.parsePositive)]; +const countProperty = (title, input) => { + return [title, (0, parse_1.parseAndFormat)(input, parse_1.parsePositive)]; }; /** Predicate to filter out invalid or empty `KvTuple` */ -var notEmpty = function (kv) { +const notEmpty = (kv) => { return kv.length > 1 && kv[1] !== undefined && kv[1] !== ""; }; function parseGeneralDetails(entry, startRelative, requestID) { return [ - ["Request Number", "#" + requestID], + ["Request Number", `#${requestID}`], ["Started", new Date(entry.startedDateTime).toLocaleString() + ((startRelative > 0) ? - " (" + parse_1.formatMilliseconds(startRelative) + " after page request started)" : "")], - ["Duration", parse_1.formatMilliseconds(entry.time)], + " (" + (0, parse_1.formatMilliseconds)(startRelative) + " after page request started)" : "")], + ["Duration", (0, parse_1.formatMilliseconds)(entry.time)], ["Error/Status Code", entry.response.status + " " + entry.response.statusText], ["Server IPAddress", entry.serverIPAddress], ["Connection", entry.connection], ["Browser Priority", entry._priority || entry._initialPriority], - ["Was pushed", parse_1.parseAndFormat(entry._was_pushed, parse_1.parsePositive, function () { return "yes"; })], + ["Was pushed", (0, parse_1.parseAndFormat)(entry._was_pushed, parse_1.parsePositive, () => "yes")], ["Initiator (Loaded by)", entry._initiator], ["Initiator Line", entry._initiator_line], ["Initiator Type", entry._initiator_type], - ["Host", har_1.getHeader(entry.request.headers, "Host")], + ["Host", (0, har_1.getHeader)(entry.request.headers, "Host")], ["IP", entry._ip_addr], - ["Client Port", parse_1.parseAndFormat(entry._client_port, parse_1.parsePositive)], + ["Client Port", (0, parse_1.parseAndFormat)(entry._client_port, parse_1.parsePositive)], ["Expires", entry._expires], - ["Cache Time", parse_1.parseAndFormat(entry._cache_time, parse_1.parsePositive, parse_1.formatSeconds)], + ["Cache Time", (0, parse_1.parseAndFormat)(entry._cache_time, parse_1.parsePositive, parse_1.formatSeconds)], ["CDN Provider", entry._cdn_provider], ["Render blocking", entry._renderBlocking], ["Is Largest Contentful Paint", entry._isLCP ? "yes" : undefined], @@ -1114,15 +1155,15 @@ function parseGeneralDetails(entry, startRelative, requestID) { ].filter(notEmpty); } function parseRequestDetails(harEntry) { - var request = harEntry.request; - var stringHeader = function (name) { return har_1.getHeaders(request.headers, name); }; - return helpers_1.flattenKvTuple([ + const request = harEntry.request; + const stringHeader = (name) => (0, har_1.getHeaders)(request.headers, name); + return (0, helpers_1.flattenKvTuple)([ ["Method", request.method], ["HTTP Version", request.httpVersion], byteSizeProperty("Bytes Out (uploaded)", harEntry._bytesOut), byteSizeProperty("Headers Size", request.headersSize), byteSizeProperty("Body Size", request.bodySize), - ["Comment", parse_1.parseAndFormat(request.comment, parse_1.parseNonEmpty)], + ["Comment", (0, parse_1.parseAndFormat)(request.comment, parse_1.parseNonEmpty)], stringHeader("User-Agent"), stringHeader("Host"), stringHeader("Connection"), @@ -1138,27 +1179,26 @@ function parseRequestDetails(harEntry) { ]).filter(notEmpty); } function parseResponseDetails(entry) { - var response = entry.response; - var content = response.content; - var headers = response.headers; - var stringHeader = function (title, name) { - if (name === void 0) { name = title; } - return har_1.getHeaders(headers, name); + const response = entry.response; + const content = response.content; + const headers = response.headers; + const stringHeader = (title, name = title) => { + return (0, har_1.getHeaders)(headers, name); }; - var dateHeader = function (name) { - var header = har_1.getHeader(headers, name); - return [name, parse_1.parseAndFormat(header, parse_1.parseDate, parse_1.formatDateLocalized)]; + const dateHeader = (name) => { + const header = (0, har_1.getHeader)(headers, name); + return [name, (0, parse_1.parseAndFormat)(header, parse_1.parseDate, parse_1.formatDateLocalized)]; }; - var contentLength = har_1.getHeader(headers, "Content-Length"); - var contentSize; + const contentLength = (0, har_1.getHeader)(headers, "Content-Length"); + let contentSize; if (content.size && content.size !== -1 && contentLength !== content.size.toString()) { contentSize = content.size; } - var contentType = har_1.getHeader(headers, "Content-Type"); + let contentType = (0, har_1.getHeader)(headers, "Content-Type"); if (entry._contentType && entry._contentType !== contentType) { contentType = contentType + " | " + entry._contentType; } - return helpers_1.flattenKvTuple([ + return (0, helpers_1.flattenKvTuple)([ ["Status", response.status + " " + response.statusText], ["HTTP Version", response.httpVersion], byteSizeProperty("Bytes In (downloaded)", entry._bytesIn), @@ -1176,7 +1216,7 @@ function parseResponseDetails(entry) { stringHeader("Connection"), stringHeader("ETag"), stringHeader("Accept-Patch"), - ["Age", parse_1.parseAndFormat(har_1.getHeader(headers, "Age"), parse_1.parseNonNegative, parse_1.formatSeconds)], + ["Age", (0, parse_1.parseAndFormat)((0, har_1.getHeader)(headers, "Age"), parse_1.parseNonNegative, parse_1.formatSeconds)], stringHeader("Allow"), stringHeader("Content-Disposition"), stringHeader("Location"), @@ -1186,28 +1226,28 @@ function parseResponseDetails(entry) { stringHeader("Upgrade"), stringHeader("Vary"), stringHeader("Timing-Allow-Origin"), - ["Redirect URL", parse_1.parseAndFormat(response.redirectURL, parse_1.parseNonEmpty)], - ["Comment", parse_1.parseAndFormat(response.comment, parse_1.parseNonEmpty)], + ["Redirect URL", (0, parse_1.parseAndFormat)(response.redirectURL, parse_1.parseNonEmpty)], + ["Comment", (0, parse_1.parseAndFormat)(response.comment, parse_1.parseNonEmpty)], ]).filter(notEmpty); } function parseTimings(entry, start, end) { - var timings = entry.timings; - var optionalTiming = function (timing) { return parse_1.parseAndFormat(timing, parse_1.parseNonNegative, parse_1.formatMilliseconds); }; - var total = (typeof start !== "number" || typeof end !== "number") ? undefined : (end - start); - var connectVal = optionalTiming(timings.connect); + const timings = entry.timings; + const optionalTiming = (timing) => (0, parse_1.parseAndFormat)(timing, parse_1.parseNonNegative, parse_1.formatMilliseconds); + const total = (typeof start !== "number" || typeof end !== "number") ? undefined : (end - start); + let connectVal = optionalTiming(timings.connect); if (timings.ssl && timings.ssl > 0 && timings.connect) { // SSL time is also included in the connect field (to ensure backward compatibility with HAR 1.1). - connectVal = connectVal + " (without TLS: " + optionalTiming(timings.connect - timings.ssl) + ")"; + connectVal = `${connectVal} (without TLS: ${optionalTiming(timings.connect - timings.ssl)})`; } return [ - ["Total", parse_1.formatMilliseconds(total)], + ["Total", (0, parse_1.formatMilliseconds)(total)], ["Blocked", optionalTiming(timings.blocked)], ["DNS", optionalTiming(timings.dns)], ["Connect", connectVal], ["SSL (TLS)", optionalTiming(timings.ssl)], - ["Send", parse_1.formatMilliseconds(timings.send)], - ["Wait", parse_1.formatMilliseconds(timings.wait)], - ["Receive", parse_1.formatMilliseconds(timings.receive)], + ["Send", (0, parse_1.formatMilliseconds)(timings.send)], + ["Wait", (0, parse_1.formatMilliseconds)(timings.wait)], + ["Receive", (0, parse_1.formatMilliseconds)(timings.receive)], ].filter(notEmpty); } /** @@ -1216,9 +1256,9 @@ function parseTimings(entry, start, end) { * @param {WaterfallEntry} entry */ function getKeys(entry, requestID, startRelative, endRelative) { - var requestHeaders = entry.request.headers; - var responseHeaders = entry.response.headers; - var headerToKvTuple = function (header) { return [header.name, header.value]; }; + const requestHeaders = entry.request.headers; + const responseHeaders = entry.response.headers; + const headerToKvTuple = (header) => [header.name, header.value]; return { general: parseGeneralDetails(entry, startRelative, requestID), request: parseRequestDetails(entry), @@ -1237,11 +1277,11 @@ exports.getKeys = getKeys; */ Object.defineProperty(exports, "__esModule", { value: true }); exports.collectIndicators = exports.documentIsSecure = void 0; -var har_1 = require("../helpers/har"); -var misc = require("../helpers/misc"); -var parse_1 = require("../helpers/parse"); +const har_1 = require("../helpers/har"); +const misc = require("../helpers/misc"); +const parse_1 = require("../helpers/parse"); function isCompressible(entry, requestType) { - var minCompressionSize = 1000; + const minCompressionSize = 1000; // small responses if (entry.response.bodySize < minCompressionSize) { return false; @@ -1249,8 +1289,8 @@ function isCompressible(entry, requestType) { if (misc.contains(["html", "css", "javascript", "svg", "plain"], requestType)) { return true; } - var mime = entry.response.content.mimeType; - var compressableMimes = ["application/vnd.ms-fontobject", + const mime = entry.response.content.mimeType; + const compressableMimes = ["application/vnd.ms-fontobject", "application/x-font-opentype", "application/x-font-truetype", "application/x-font-ttf", @@ -1276,12 +1316,12 @@ function hasCacheIssue(entry) { if (entry.response.status === 204 || !misc.isInStatusCodeRange(entry.response.status, 200, 299)) { return false; } - var headers = entry.response.headers; - return !(har_1.hasHeader(headers, "Cache-Control") || har_1.hasHeader(headers, "Expires")); + const headers = entry.response.headers; + return !((0, har_1.hasHeader)(headers, "Cache-Control") || (0, har_1.hasHeader)(headers, "Expires")); } function hasCompressionIssue(entry, requestType) { - var headers = entry.response.headers; - return (!har_1.hasHeader(headers, "Content-Encoding") && isCompressible(entry, requestType)); + const headers = entry.response.headers; + return (!(0, har_1.hasHeader)(headers, "Content-Encoding") && isCompressible(entry, requestType)); } /** Checks if the resource uses https */ function isSecure(entry) { @@ -1294,7 +1334,7 @@ function isPush(entry) { if (entry._was_pushed === undefined || entry._was_pushed === null) { return false; } - return parse_1.toInt(entry._was_pushed) === 1; + return (0, parse_1.toInt)(entry._was_pushed) === 1; } /** * Check if the document (disregarding any initial http->https redirects) is loaded over a secure connection. @@ -1302,7 +1342,7 @@ function isPush(entry) { * @returns {boolean} */ function documentIsSecure(data) { - var rootDocument = data.filter(function (e) { return !e.response.redirectURL; })[0]; + const rootDocument = data.filter((e) => !e.response.redirectURL)[0]; // check if request is a redirect chain if (rootDocument === undefined) { return (data.length > 0) ? isSecure(data[0]) : false; @@ -1313,7 +1353,7 @@ exports.documentIsSecure = documentIsSecure; /** Scans `entry` for noteworthy issues or infos and highlights them */ function collectIndicators(entry, index, docIsTLS, requestType) { // const harEntry = entry; - var output = []; + const output = []; if (isPush(entry)) { output.push({ description: "Response was pushed by the server using HTTP2 push.", @@ -1370,13 +1410,13 @@ exports.collectIndicators = collectIndicators; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.makeTabs = void 0; -var misc_1 = require("../helpers/misc"); -var parse_1 = require("../helpers/parse"); -var extract_details_keys_1 = require("./extract-details-keys"); -var helpers_1 = require("./helpers"); -var escapedNewLineRegex = /\\n/g; -var newLineRegex = /\n/g; -var escapedTabRegex = /\\t/g; +const misc_1 = require("../helpers/misc"); +const parse_1 = require("../helpers/parse"); +const extract_details_keys_1 = require("./extract-details-keys"); +const helpers_1 = require("./helpers"); +const escapedNewLineRegex = /\\n/g; +const newLineRegex = /\n/g; +const escapedTabRegex = /\\t/g; /** * Generates the tabs for the details-overlay of a `Entry` * @param {Entry} entry - the entry to parse @@ -1389,12 +1429,12 @@ var escapedTabRegex = /\\t/g; * @returns WaterfallEntryTab */ function makeTabs(entry, requestID, requestType, startRelative, endRelative, indicators) { - var tabs = []; - var tabsData = extract_details_keys_1.getKeys(entry, requestID, startRelative, endRelative); + const tabs = []; + const tabsData = (0, extract_details_keys_1.getKeys)(entry, requestID, startRelative, endRelative); tabs.push(makeGeneralTab(tabsData.general, indicators)); tabs.push(makeRequestTab(tabsData.request, tabsData.requestHeaders)); tabs.push(makeResponseTab(tabsData.response, tabsData.responseHeaders)); - tabs.push(makeWaterfallEntryTab("Timings", helpers_1.makeDefinitionList(tabsData.timings, true))); + tabs.push(makeWaterfallEntryTab("Timings", (0, helpers_1.makeDefinitionList)(tabsData.timings, true))); tabs.push(makeRawData(entry)); if (requestType === "image") { tabs.push(makeImgTab(entry)); @@ -1402,95 +1442,115 @@ function makeTabs(entry, requestID, requestType, startRelative, endRelative, ind if (entry.response.content && entry.response.content.mimeType && entry.response.content.mimeType.indexOf("text/") === 0 && entry.response.content.text) { tabs.push(makeContentTab(entry)); } - return tabs.filter(function (t) { return t !== undefined; }); + return tabs.filter((t) => t !== undefined); } exports.makeTabs = makeTabs; /** Helper to create `WaterfallEntryTab` object literal */ -function makeWaterfallEntryTab(title, content, tabClass) { - if (tabClass === void 0) { tabClass = ""; } +function makeWaterfallEntryTab(title, content, tabClass = "") { return { - content: content, - tabClass: tabClass, - title: title, + content, + tabClass, + title, }; } /** Helper to create `WaterfallEntryTab` object literal that is evaluated lazily at runtime (e.g. for performance) */ -function makeLazyWaterfallEntryTab(title, renderContent, tabClass) { - if (tabClass === void 0) { tabClass = ""; } +function makeLazyWaterfallEntryTab(title, renderContent, tabClass = "") { return { - renderContent: renderContent, - tabClass: tabClass, - title: title, + renderContent, + tabClass, + title, }; } /** General tab with warnings etc. */ function makeGeneralTab(generalData, indicators) { - var mainContent = helpers_1.makeDefinitionList(generalData); + const mainContent = (0, helpers_1.makeDefinitionList)(generalData); if (indicators.length === 0) { return makeWaterfallEntryTab("General", mainContent); } - var general = "

      General

      \n
      " + mainContent + "
      "; - var content = ""; + const general = `

      General

      \n
      ${mainContent}
      `; + let content = ""; // Make indicator sections - var errors = indicators - .filter(function (i) { return i.type === "error"; }) - .map(function (i) { return [i.title, i.description]; }); - var warnings = indicators - .filter(function (i) { return i.type === "warning"; }) - .map(function (i) { return [i.title, i.description]; }); + const errors = indicators + .filter((i) => i.type === "error") + .map((i) => [i.title, i.description]); + const warnings = indicators + .filter((i) => i.type === "warning") + .map((i) => [i.title, i.description]); // all others - var info = indicators - .filter(function (i) { return i.type !== "error" && i.type !== "warning"; }) - .map(function (i) { return [i.title, i.description]; }); + const info = indicators + .filter((i) => i.type !== "error" && i.type !== "warning") + .map((i) => [i.title, i.description]); if (errors.length > 0) { - content += "

      " + misc_1.pluralize("Error", errors.length) + "

      \n
      " + helpers_1.makeDefinitionList(errors) + "
      "; + content += `

      ${(0, misc_1.pluralize)("Error", errors.length)}

      +
      ${(0, helpers_1.makeDefinitionList)(errors)}
      `; } if (warnings.length > 0) { - content += "

      " + misc_1.pluralize("Warning", warnings.length) + "

      \n
      " + helpers_1.makeDefinitionList(warnings) + "
      "; + content += `

      ${(0, misc_1.pluralize)("Warning", warnings.length)}

      +
      ${(0, helpers_1.makeDefinitionList)(warnings)}
      `; } if (info.length > 0) { - content += "

      Info

      \n
      " + helpers_1.makeDefinitionList(info) + "
      "; + content += `

      Info

      +
      ${(0, helpers_1.makeDefinitionList)(info)}
      `; } return makeWaterfallEntryTab("General", content + general); } function makeRequestTab(request, requestHeaders) { - var content = "
      \n " + helpers_1.makeDefinitionList(request) + "\n
      \n

      All Request Headers

      \n
      \n " + helpers_1.makeDefinitionList(requestHeaders) + "\n
      "; + const content = `
      + ${(0, helpers_1.makeDefinitionList)(request)} +
      +

      All Request Headers

      +
      + ${(0, helpers_1.makeDefinitionList)(requestHeaders)} +
      `; return makeWaterfallEntryTab("Request", content); } function makeResponseTab(response, responseHeaders) { - var content = "
      \n " + helpers_1.makeDefinitionList(response) + "\n
      \n

      All Response Headers

      \n
      \n " + helpers_1.makeDefinitionList(responseHeaders) + "\n
      "; + const content = `
      + ${(0, helpers_1.makeDefinitionList)(response)} +
      +

      All Response Headers

      +
      + ${(0, helpers_1.makeDefinitionList)(responseHeaders)} +
      `; return makeWaterfallEntryTab("Response", content); } /** Tab to show the returned (text-based) payload (HTML, CSS, JS etc.) */ function makeContentTab(entry) { - var escapedText = entry.response.content.text || ""; - var unescapedText = escapedText.replace(escapedNewLineRegex, "\n").replace(escapedTabRegex, "\t"); - var newLines = escapedText.match(newLineRegex); - var lineCount = newLines ? newLines.length : 1; - return makeLazyWaterfallEntryTab("Content (" + lineCount + " Line" + (lineCount > 1 ? "s" : "") + ")", + const escapedText = entry.response.content.text || ""; + const unescapedText = escapedText.replace(escapedNewLineRegex, "\n").replace(escapedTabRegex, "\t"); + const newLines = escapedText.match(newLineRegex); + const lineCount = newLines ? newLines.length : 1; + return makeLazyWaterfallEntryTab(`Content (${lineCount} Line${lineCount > 1 ? "s" : ""})`, // class `copy-tab-data` needed to catch bubbled up click event in `details-overlay/html-details-body.ts` - function () { return "\n \n
      " + parse_1.escapeHtml(unescapedText) + "
      \n "; }, "content rendered-data"); + () => ` + +
      ${(0, parse_1.escapeHtml)(unescapedText)}
      + `, "content rendered-data"); } function makeRawData(entry) { - return makeLazyWaterfallEntryTab("Raw Data", function () { + return makeLazyWaterfallEntryTab("Raw Data", () => { // class `copy-tab-data` needed to catch bubbled up click event in `details-overlay/html-details-body.ts` - return "\n \n
      " + parse_1.escapeHtml(JSON.stringify(entry, null, 2)) + "
      \n "; + return ` + +
      ${(0, parse_1.escapeHtml)(JSON.stringify(entry, null, 2))}
      + `; }, "raw-data rendered-data"); } /** Image preview tab */ function makeImgTab(entry) { - return makeLazyWaterfallEntryTab("Preview", function (detailsHeight) { return ""; }); + return makeLazyWaterfallEntryTab("Preview", (detailsHeight) => ``); } },{"../helpers/misc":4,"../helpers/parse":5,"./extract-details-keys":10,"./helpers":14}],13:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.transformPage = exports.transformDoc = void 0; -var misc_1 = require("../helpers/misc"); -var parse_1 = require("../helpers/parse"); -var har_heuristics_1 = require("./har-heuristics"); -var har_tabs_1 = require("./har-tabs"); -var helpers_1 = require("./helpers"); +const misc_1 = require("../helpers/misc"); +const parse_1 = require("../helpers/parse"); +const har_heuristics_1 = require("./har-heuristics"); +const har_tabs_1 = require("./har-tabs"); +const helpers_1 = require("./helpers"); /** * Transforms the full HAR doc, including all pages * @param {Har} harData - raw HAR object @@ -1499,10 +1559,10 @@ var helpers_1 = require("./helpers"); */ function transformDoc(harData, options) { // make sure it's the *.log base node - var data = (harData["log"] !== undefined ? harData["log"] : harData); - var pages = getPages(data); + const data = (harData["log"] !== undefined ? harData["log"] : harData); + const pages = getPages(data); return { - pages: pages.map(function (_page, i) { return transformPage(data, i, options); }), + pages: pages.map((_page, i) => transformPage(data, i, options)), }; } exports.transformDoc = transformDoc; @@ -1516,20 +1576,20 @@ exports.transformDoc = transformDoc; */ function toWaterFallEntry(entry, index, startRelative, isTLS) { startRelative = Math.round(startRelative); - var endRelative = Math.round(parse_1.toInt(entry._all_end) || (startRelative + entry.time)); - var requestType = helpers_1.mimeToRequestType(entry.response.content.mimeType); - var indicators = har_heuristics_1.collectIndicators(entry, index, isTLS, requestType); - var responseDetails = createResponseDetails(entry, indicators); - return helpers_1.createWaterfallEntry(entry.request.url, startRelative, endRelative, buildDetailTimingBlocks(startRelative, entry), responseDetails, har_tabs_1.makeTabs(entry, (index + 1), requestType, startRelative, endRelative, indicators)); + const endRelative = Math.round((0, parse_1.toInt)(entry._all_end) || (startRelative + entry.time)); + const requestType = (0, helpers_1.mimeToRequestType)(entry.response.content.mimeType); + const indicators = (0, har_heuristics_1.collectIndicators)(entry, index, isTLS, requestType); + const responseDetails = createResponseDetails(entry, indicators); + return (0, helpers_1.createWaterfallEntry)(entry.request.url, startRelative, endRelative, buildDetailTimingBlocks(startRelative, entry), responseDetails, (0, har_tabs_1.makeTabs)(entry, (index + 1), requestType, startRelative, endRelative, indicators)); } /** Returns the page or a mock page object */ -var getPages = function (data) { +const getPages = (data) => { if (data.pages && data.pages.length > 0) { return data.pages; } - var statedTime = data.entries.reduce(function (earliest, curr) { - var currDate = Date.parse(curr.startedDateTime); - var earliestDate = Date.parse(earliest); + const statedTime = data.entries.reduce((earliest, curr) => { + const currDate = Date.parse(curr.startedDateTime); + const earliestDate = Date.parse(earliest); return earliestDate < currDate ? earliest : curr.startedDateTime; }, data.entries[0].startedDateTime); return [{ @@ -1546,21 +1606,20 @@ var getPages = function (data) { * @param {ChartOptions} options - HAR-parser-specific options * @returns WaterfallData */ -function transformPage(harData, pageIndex, options) { - if (pageIndex === void 0) { pageIndex = 0; } +function transformPage(harData, pageIndex = 0, options) { // make sure it's the *.log base node - var data = (harData["log"] !== undefined ? harData["log"] : harData); - var pages = getPages(data); - var currPage = pages[pageIndex]; + const data = (harData["log"] !== undefined ? harData["log"] : harData); + const pages = getPages(data); + const currPage = pages[pageIndex]; if (!currPage.startedDateTime) { - throw new TypeError("Invalid HAR document: \"log.pages[" + pageIndex + "].startedDateTime\" is not set"); - } - var pageStartTime = new Date(currPage.startedDateTime).getTime(); - var pageTimings = currPage.pageTimings; - var doneTime = 0; - var isTLS = har_heuristics_1.documentIsSecure(data.entries); - var entries = data.entries - .filter(function (entry) { + throw new TypeError(`Invalid HAR document: "log.pages[${pageIndex}].startedDateTime" is not set`); + } + const pageStartTime = new Date(currPage.startedDateTime).getTime(); + const pageTimings = currPage.pageTimings; + let doneTime = 0; + const isTLS = (0, har_heuristics_1.documentIsSecure)(data.entries); + const entries = data.entries + .filter((entry) => { // filter inline data if (entry.request.url.indexOf("data:") === 0 || entry.request.url.indexOf("javascript:") === 0) { return false; @@ -1570,20 +1629,20 @@ function transformPage(harData, pageIndex, options) { } return entry.pageref === currPage.id; }) - .map(function (entry, index) { - var startRelative = new Date(entry.startedDateTime).getTime() - pageStartTime; + .map((entry, index) => { + const startRelative = new Date(entry.startedDateTime).getTime() - pageStartTime; if (!isNaN(startRelative)) { doneTime = Math.max(doneTime, startRelative + entry.time); } else { // tslint:disable-next-line:no-console - console.warn("Entry has no valid 'startedDateTime' time", entry.request.url, entry); + console.warn(`Entry has no valid 'startedDateTime' time`, entry.request.url, entry); } return toWaterFallEntry(entry, index, startRelative, isTLS); }); - var marks = getMarks(pageTimings, currPage, options); + const marks = getMarks(pageTimings, currPage, options); // if marks happens later than doneTime, increase the doneTime - marks.forEach(function (mark) { + marks.forEach((mark) => { if (mark.startTime > doneTime) { doneTime = mark.startTime; } @@ -1597,8 +1656,8 @@ function transformPage(harData, pageIndex, options) { return { docIsTLS: isTLS, durationMs: doneTime, - entries: entries, - marks: marks, + entries, + marks, title: currPage.title, }; } @@ -1609,17 +1668,17 @@ exports.transformPage = transformPage; * @param {Page} currPage - active page * @param {ChartOptions} options - HAR options */ -var getMarks = function (pageTimings, currPage, options) { +const getMarks = (pageTimings, currPage, options) => { if (pageTimings === undefined) { return []; } - var sortFn = function (a, b) { return a.startTime - b.startTime; }; - var marks = Object.keys(pageTimings) - .filter(function (k) { return (typeof pageTimings[k] === "number" && pageTimings[k] >= 0); }) - .map(function (k) { return ({ - name: parse_1.escapeHtml(k.replace(/^[_]/, "")) + " (" + misc_1.roundNumber(pageTimings[k], 0) + " ms)", + const sortFn = (a, b) => a.startTime - b.startTime; + const marks = Object.keys(pageTimings) + .filter((k) => (typeof pageTimings[k] === "number" && pageTimings[k] >= 0)) + .map((k) => ({ + name: `${(0, parse_1.escapeHtml)(k.replace(/^[_]/, ""))} (${(0, misc_1.roundNumber)(pageTimings[k], 0)} ms)`, startTime: pageTimings[k], - }); }); + })); if (!options.showUserTiming) { return marks.sort(sortFn); } @@ -1632,30 +1691,29 @@ var getMarks = function (pageTimings, currPage, options) { * @param {Page} currPage - active page * @param {ChartOptions} options - HAR options */ -var getUserTimings = function (currPage, options) { - var baseFilter = options.showUserTimingEndMarker ? - function (k) { return k.indexOf("_userTime.") === 0; } : - function (k) { return k.indexOf("_userTime.") === 0 && k.indexOf("_userTime.endTimer-") !== 0; }; - var filterFn = baseFilter; +const getUserTimings = (currPage, options) => { + const baseFilter = options.showUserTimingEndMarker ? + (k) => k.indexOf("_userTime.") === 0 : + (k) => k.indexOf("_userTime.") === 0 && k.indexOf("_userTime.endTimer-") !== 0; + let filterFn = baseFilter; if (Array.isArray(options.showUserTiming)) { - var findTimings_1 = options.showUserTiming; - filterFn = function (k) { return (baseFilter(k) && - findTimings_1.indexOf(k.replace(/^_userTime\./, "")) >= 0); }; - } - var findName = /^_userTime\.((?:startTimer-)?(.+))$/; - var extractUserTiming = function (k) { - var _a; - var name; - var fullName; - var duration; - _a = findName.exec(k) || [, undefined, undefined], fullName = _a[1], name = _a[2]; - fullName = parse_1.escapeHtml(fullName); - name = parse_1.escapeHtml(name); - if (fullName !== name && currPage["_userTime.endTimer-" + name]) { - duration = currPage["_userTime.endTimer-" + name] - currPage[k]; + const findTimings = options.showUserTiming; + filterFn = (k) => (baseFilter(k) && + findTimings.indexOf(k.replace(/^_userTime\./, "")) >= 0); + } + const findName = /^_userTime\.((?:startTimer-)?(.+))$/; + const extractUserTiming = (k) => { + let name; + let fullName; + let duration; + [, fullName, name] = findName.exec(k) || [, undefined, undefined]; + fullName = (0, parse_1.escapeHtml)(fullName); + name = (0, parse_1.escapeHtml)(name); + if (fullName !== name && currPage[`_userTime.endTimer-${name}`]) { + duration = currPage[`_userTime.endTimer-${name}`] - currPage[k]; return { - duration: duration, - name: (options.showUserTimingEndMarker ? fullName : name) + " (" + currPage[k] + " - " + (currPage[k] + duration) + " ms)", + duration, + name: `${options.showUserTimingEndMarker ? fullName : name} (${currPage[k]} - ${currPage[k] + duration} ms)`, startTime: currPage[k], // x: currPage[k], }; @@ -1676,29 +1734,29 @@ var getUserTimings = function (currPage, options) { * @param {Entry} harEntry * @returns Array */ -var buildDetailTimingBlocks = function (startRelative, harEntry) { - var t = harEntry.timings; - var chunks = harEntry._chunks || []; - var types = ["blocked", "dns", "connect", "send", "wait", "receive"]; - return types.reduce(function (collect, key) { - var time = getTimePair(key, harEntry, collect, startRelative); +const buildDetailTimingBlocks = (startRelative, harEntry) => { + const t = harEntry.timings; + const chunks = harEntry._chunks || []; + const types = ["blocked", "dns", "connect", "send", "wait", "receive"]; + return types.reduce((collect, key) => { + const time = getTimePair(key, harEntry, collect, startRelative); if (time.end && time.start >= time.end) { return collect; } // special case for 'connect' && 'ssl' since they share time // http://www.softwareishard.com/blog/har-12-spec/#timings if (key === "connect" && t.ssl && t.ssl !== -1) { - var sslStart = parseInt("" + harEntry["_ssl_start"], 10) || time.start; - var sslEnd = parseInt("" + harEntry["_ssl_end"], 10) || time.start + t.ssl; - var connectStart = (!!parseInt("" + harEntry["_ssl_start"], 10)) ? time.start : sslEnd; + const sslStart = parseInt(`${harEntry[`_ssl_start`]}`, 10) || time.start; + const sslEnd = parseInt(`${harEntry[`_ssl_end`]}`, 10) || time.start + t.ssl; + const connectStart = (!!parseInt(`${harEntry[`_ssl_start`]}`, 10)) ? time.start : sslEnd; return collect - .concat([helpers_1.createWaterfallEntryTiming("ssl", Math.round(sslStart), Math.round(sslEnd))]) - .concat([helpers_1.createWaterfallEntryTiming(key, Math.round(connectStart), Math.round(time.end))]); + .concat([(0, helpers_1.createWaterfallEntryTiming)("ssl", Math.round(sslStart), Math.round(sslEnd))]) + .concat([(0, helpers_1.createWaterfallEntryTiming)(key, Math.round(connectStart), Math.round(time.end))]); } if (key === "receive" && chunks && chunks.length > 0) { - return collect.concat([helpers_1.createWaterfallEntryTiming(key, Math.round(time.start), Math.round(time.end), chunks)]); + return collect.concat([(0, helpers_1.createWaterfallEntryTiming)(key, Math.round(time.start), Math.round(time.end), chunks)]); } - return collect.concat([helpers_1.createWaterfallEntryTiming(key, Math.round(time.start), Math.round(time.end))]); + return collect.concat([(0, helpers_1.createWaterfallEntryTiming)(key, Math.round(time.start), Math.round(time.end))]); }, []); }; /** @@ -1710,8 +1768,8 @@ var buildDetailTimingBlocks = function (startRelative, harEntry) { * @param {number} startRelative - Number of milliseconds since page load started (`page.startedDateTime`) * @returns {Object} */ -var getTimePair = function (key, harEntry, collect, startRelative) { - var wptKey; +const getTimePair = (key, harEntry, collect, startRelative) => { + let wptKey; switch (key) { case "wait": wptKey = "ttfb"; @@ -1721,11 +1779,11 @@ var getTimePair = function (key, harEntry, collect, startRelative) { break; default: wptKey = key; } - var preciseStart = parseInt(harEntry["_" + wptKey + "_start"], 10); - var preciseEnd = parseInt(harEntry["_" + wptKey + "_end"], 10); - var start = isNaN(preciseStart) ? + const preciseStart = parseInt(`${harEntry[`_${wptKey}_start`]}`, 10); + const preciseEnd = parseInt(`${harEntry[`_${wptKey}_end`]}`, 10); + const start = isNaN(preciseStart) ? ((collect.length > 0) ? collect[collect.length - 1].end : startRelative) : preciseStart; - var end = isNaN(preciseEnd) ? (start + harEntry.timings[key]) : preciseEnd; + const end = isNaN(preciseEnd) ? (start + (harEntry.timings[key] ?? 0)) : preciseEnd; return { end: Math.round(end), start: Math.round(start), @@ -1738,16 +1796,16 @@ var getTimePair = function (key, harEntry, collect, startRelative) { * @param {WaterfallEntryIndicator[]} indicators * @returns WaterfallResponseDetails */ -var createResponseDetails = function (entry, indicators) { - var requestType = helpers_1.mimeToRequestType(entry.response.content.mimeType); - var statusClean = parse_1.toInt(entry.response.status) || 0; - var renderBlockingStatus = entry._renderBlocking || ""; - var largestContentfulPaintStatus = entry._isLCP || false; +const createResponseDetails = (entry, indicators) => { + const requestType = (0, helpers_1.mimeToRequestType)(entry.response.content.mimeType); + const statusClean = (0, parse_1.toInt)(entry.response.status) || 0; + const renderBlockingStatus = entry._renderBlocking || ""; + const largestContentfulPaintStatus = entry._isLCP || false; return { - icon: helpers_1.makeMimeTypeIcon(statusClean, entry.response.statusText, requestType, entry.response.redirectURL), - indicators: indicators, - requestType: requestType, - rowClass: helpers_1.makeRowCssClasses(statusClean, renderBlockingStatus, largestContentfulPaintStatus), + icon: (0, helpers_1.makeMimeTypeIcon)(statusClean, entry.response.statusText, requestType, entry.response.redirectURL), + indicators, + requestType, + rowClass: (0, helpers_1.makeRowCssClasses)(statusClean, renderBlockingStatus, largestContentfulPaintStatus), statusCode: statusClean, }; }; @@ -1756,11 +1814,11 @@ var createResponseDetails = function (entry, indicators) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.flattenKvTuple = exports.makeMimeTypeIcon = exports.makeRowCssClasses = exports.createWaterfallEntryTiming = exports.createWaterfallEntry = exports.mimeToRequestType = exports.makeDefinitionList = void 0; -var misc_1 = require("../helpers/misc"); -var parse_1 = require("../helpers/parse"); -var svg_indicators_1 = require("../waterfall/row/svg-indicators"); +const misc_1 = require("../helpers/misc"); +const parse_1 = require("../helpers/parse"); +const svg_indicators_1 = require("../waterfall/row/svg-indicators"); /** Escapes all HTML except linebreaks `
      ` */ -var escapeHtmlLight = function (str) { return parse_1.escapeHtml(str).replace("<br/>", "
      "); }; +const escapeHtmlLight = (str) => (0, parse_1.escapeHtml)(str).replace("<br/>", "
      "); /** * Converts `dlKeyValues` to the contennd a definition list, without the outer `
      ` tags * @param {SafeKvTuple[]} dlKeyValues array of Key/Value pair @@ -1768,17 +1826,19 @@ var escapeHtmlLight = function (str) { return parse_1.escapeHtml(str).replace("& * is converted to a class name andd added to the `
      ` * @returns {string} stringified HTML definition list */ -function makeDefinitionList(dlKeyValues, addClass) { - if (addClass === void 0) { addClass = false; } - var makeClass = function (key) { +function makeDefinitionList(dlKeyValues, addClass = false) { + const makeClass = (key) => { if (!addClass) { return ""; } - var className = misc_1.toCssClass(key) || "no-colour"; - return "class=\"" + className + "\""; + const className = (0, misc_1.toCssClass)(key) || "no-colour"; + return `class="${className}"`; }; return dlKeyValues - .map(function (tuple) { return "\n
      " + escapeHtmlLight(tuple[0]) + "
      \n
      " + escapeHtmlLight(tuple[1]) + "
      \n "; }).join(""); + .map((tuple) => ` +
      ${escapeHtmlLight(tuple[0])}
      +
      ${escapeHtmlLight(tuple[1])}
      + `).join(""); } exports.makeDefinitionList = makeDefinitionList; /** @@ -1789,8 +1849,8 @@ function mimeToRequestType(mimeType) { if (mimeType === undefined) { return "other"; } - var types = mimeType.split("/"); - var part2 = types[1]; + const types = mimeType.split("/"); + let part2 = types[1]; // take care of text/css; charset=UTF-8 etc if (part2 !== undefined) { part2 = part2.indexOf(";") > -1 ? part2.split(";")[0] : part2; @@ -1828,30 +1888,29 @@ function mimeToRequestType(mimeType) { } exports.mimeToRequestType = mimeToRequestType; /** helper to create a `WaterfallEntry` */ -function createWaterfallEntry(url, start, end, segments, responseDetails, tabs) { - if (segments === void 0) { segments = []; } - var total = (typeof start !== "number" || typeof end !== "number") ? NaN : (end - start); +function createWaterfallEntry(url, start, end, segments = [], responseDetails, tabs) { + const total = (typeof start !== "number" || typeof end !== "number") ? NaN : (end - start); return { - end: end, - responseDetails: responseDetails, - segments: segments, - start: start, - tabs: tabs, - total: total, - url: url, + end, + responseDetails, + segments, + start, + tabs, + total, + url, }; } exports.createWaterfallEntry = createWaterfallEntry; /** helper to create a `WaterfallEntryTiming` */ function createWaterfallEntryTiming(type, start, end, chunks) { - var total = (typeof start !== "number" || typeof end !== "number") ? NaN : (end - start); - var typeClean = parse_1.sanitizeAlphaNumeric(type); + const total = (typeof start !== "number" || typeof end !== "number") ? NaN : (end - start); + const typeClean = (0, parse_1.sanitizeAlphaNumeric)(type); return { - end: end, - start: start, - total: total, + end, + start, + total, type: typeClean, - chunks: chunks, + chunks, }; } exports.createWaterfallEntryTiming = createWaterfallEntryTiming; @@ -1863,15 +1922,15 @@ exports.createWaterfallEntryTiming = createWaterfallEntryTiming; * @returns string - concatinated css class names */ function makeRowCssClasses(status, renderBlockingStatus, largestContentfulPaintStatus) { - var classes = ["row-item"]; - if (misc_1.isInStatusCodeRange(status, 500, 599)) { + const classes = ["row-item"]; + if ((0, misc_1.isInStatusCodeRange)(status, 500, 599)) { classes.push("status5xx"); } - else if (misc_1.isInStatusCodeRange(status, 400, 499)) { + else if ((0, misc_1.isInStatusCodeRange)(status, 400, 499)) { classes.push("status4xx"); } else if (status !== 304 && - misc_1.isInStatusCodeRange(status, 300, 399)) { + (0, misc_1.isInStatusCodeRange)(status, 300, 399)) { // 304 == Not Modified, so not an issue classes.push("status3xx"); } @@ -1900,24 +1959,23 @@ exports.makeRowCssClasses = makeRowCssClasses; * @param {string=""} redirectURL - pass the URL for `301` or `302` * @returns Icon */ -function makeMimeTypeIcon(status, statusText, requestType, redirectURL) { - if (redirectURL === void 0) { redirectURL = ""; } +function makeMimeTypeIcon(status, statusText, requestType, redirectURL = "") { // highlight redirects if (!!redirectURL) { - var url = encodeURI(redirectURL.split("?")[0] || ""); - return svg_indicators_1.makeIcon("err3xx", status + " response status: Redirect to " + parse_1.escapeHtml(url) + "..."); + const url = encodeURI(redirectURL.split("?")[0] || ""); + return (0, svg_indicators_1.makeIcon)("err3xx", `${status} response status: Redirect to ${(0, parse_1.escapeHtml)(url)}...`); } - else if (misc_1.isInStatusCodeRange(status, 400, 499)) { - return svg_indicators_1.makeIcon("err4xx", status + " response status: " + parse_1.escapeHtml(statusText)); + else if ((0, misc_1.isInStatusCodeRange)(status, 400, 499)) { + return (0, svg_indicators_1.makeIcon)("err4xx", `${status} response status: ${(0, parse_1.escapeHtml)(statusText)}`); } - else if (misc_1.isInStatusCodeRange(status, 500, 599)) { - return svg_indicators_1.makeIcon("err5xx", status + " response status: " + parse_1.escapeHtml(statusText)); + else if ((0, misc_1.isInStatusCodeRange)(status, 500, 599)) { + return (0, svg_indicators_1.makeIcon)("err5xx", `${status} response status: ${(0, parse_1.escapeHtml)(statusText)}`); } else if (status === 204) { - return svg_indicators_1.makeIcon("plain", "No content"); + return (0, svg_indicators_1.makeIcon)("plain", "No content"); } else { - return svg_indicators_1.makeIcon(parse_1.sanitizeAlphaNumeric(requestType), parse_1.escapeHtml(requestType)); + return (0, svg_indicators_1.makeIcon)((0, parse_1.sanitizeAlphaNumeric)(requestType), (0, parse_1.escapeHtml)(requestType)); } } exports.makeMimeTypeIcon = makeMimeTypeIcon; @@ -1926,14 +1984,14 @@ exports.makeMimeTypeIcon = makeMimeTypeIcon; * * @param nestedKvPairs - nested `KvTuple`s (possibly sub-nested) */ -var flattenKvTuple = function (nestedKvPairs) { - var returnKv = []; - nestedKvPairs.forEach(function (maybeKv) { +const flattenKvTuple = (nestedKvPairs) => { + const returnKv = []; + nestedKvPairs.forEach((maybeKv) => { if (maybeKv === undefined || maybeKv.length === 0) { return; } if (Array.isArray(maybeKv[0])) { - returnKv.push.apply(returnKv, maybeKv); + returnKv.push(...maybeKv); return; } returnKv.push(maybeKv); @@ -1967,8 +2025,8 @@ exports.timingTypeToCssClass = timingTypeToCssClass; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createDetailsBody = void 0; -var dom_1 = require("../../helpers/dom"); -var parse_1 = require("../../helpers/parse"); +const dom_1 = require("../../helpers/dom"); +const parse_1 = require("../../helpers/parse"); /** * Creates the HTML body for the overlay * @@ -1978,17 +2036,17 @@ var parse_1 = require("../../helpers/parse"); * @param entry */ function createDetailsBody(requestID, detailsHeight, entry) { - var html = dom_1.makeHtmlEl(); - var body = dom_1.makeBodyEl(); - var tabMenu = entry.tabs.map(function (t) { - return "
    • "; + const html = (0, dom_1.makeHtmlEl)(); + const body = (0, dom_1.makeBodyEl)(); + const tabMenu = entry.tabs.map((t) => { + return `
    • `; }).join("\n"); - var tabBody = entry.tabs.map(function (t) { - var cssClasses = "tab"; + const tabBody = entry.tabs.map((t) => { + let cssClasses = "tab"; if (t.tabClass) { - cssClasses += " " + t.tabClass; + cssClasses += ` ${t.tabClass}`; } - var content = ""; + let content = ""; if (t.content) { content = t.content; } @@ -2000,9 +2058,23 @@ function createDetailsBody(requestID, detailsHeight, entry) { else { throw TypeError("Invalid Details Tab"); } - return "
      " + content + "
      "; + return `
      ${content}
      `; }).join("\n"); - body.innerHTML = "\n
      \n
      \n

      #" + requestID + " \n " + parse_1.escapeHtml(entry.url) + "\n

      \n \n
      \n " + tabBody + "\n
      \n "; + body.innerHTML = ` +
      +
      +

      #${requestID} + ${(0, parse_1.escapeHtml)(entry.url)} +

      + +
      + ${tabBody} +
      + `; html.appendChild(body); return html; } @@ -2012,12 +2084,12 @@ exports.createDetailsBody = createDetailsBody; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OverlayManager = void 0; -var dom_1 = require("../../helpers/dom"); -var misc_1 = require("../../helpers/misc"); -var svg_details_overlay_1 = require("./svg-details-overlay"); +const dom_1 = require("../../helpers/dom"); +const misc_1 = require("../../helpers/misc"); +const svg_details_overlay_1 = require("./svg-details-overlay"); /** Overlay (popup) instance manager */ -var OverlayManager = /** @class */ (function () { - function OverlayManager(context) { +class OverlayManager { + constructor(context) { this.context = context; /** Collection of currely open overlays */ this.openOverlays = []; @@ -2026,57 +2098,57 @@ var OverlayManager = /** @class */ (function () { * @param {SVGAElement[]} rowItems * @param {number} offset */ - this.realignRow = function (rowItem, offset) { - rowItem.setAttribute("transform", "translate(0, " + offset + ")"); + this.realignRow = (rowItem, offset) => { + rowItem.setAttribute("transform", `translate(0, ${offset})`); }; } /** all open overlays height combined */ - OverlayManager.prototype.getCombinedOverlayHeight = function () { - return this.openOverlays.reduce(function (pre, curr) { return pre + (curr.height || 0); }, 0); - }; + getCombinedOverlayHeight() { + return this.openOverlays.reduce((pre, curr) => pre + (curr.height || 0), 0); + } /** * Opens an overlay - rerenders others internaly */ - OverlayManager.prototype.openOverlay = function (index, y, detailsHeight, entry, rowItems) { - if (this.openOverlays.some(function (o) { return o.index === index; })) { + openOverlay(index, y, detailsHeight, entry, rowItems) { + if (this.openOverlays.some((o) => o.index === index)) { return; } - var self = this; - var newOverlay = { + const self = this; + const newOverlay = { defaultY: y, - entry: entry, - index: index, - onClose: function () { + entry, + index, + onClose: () => { self.closeOverlay(index, detailsHeight, rowItems); }, openTabIndex: 0, }; this.openOverlays.push(newOverlay); - this.openOverlays = this.openOverlays.sort(function (a, b) { return a.index > b.index ? 1 : -1; }); + this.openOverlays = this.openOverlays.sort((a, b) => a.index > b.index ? 1 : -1); this.renderOverlays(detailsHeight, rowItems); this.context.pubSub.publishToOverlayChanges({ changedIndex: index, combinedOverlayHeight: self.getCombinedOverlayHeight(), type: "open", }); - }; + } /** * Toggles an overlay - rerenders others */ - OverlayManager.prototype.toggleOverlay = function (index, y, detailsHeight, entry, rowItems) { - if (this.openOverlays.some(function (o) { return o.index === index; })) { + toggleOverlay(index, y, detailsHeight, entry, rowItems) { + if (this.openOverlays.some((o) => o.index === index)) { this.closeOverlay(index, detailsHeight, rowItems); } else { this.openOverlay(index, y, detailsHeight, entry, rowItems); } - }; + } /** * closes on overlay - rerenders others internally */ - OverlayManager.prototype.closeOverlay = function (index, detailsHeight, rowItems) { - var self = this; - this.openOverlays.splice(this.openOverlays.reduce(function (prev, curr, i) { + closeOverlay(index, detailsHeight, rowItems) { + const self = this; + this.openOverlays.splice(this.openOverlays.reduce((prev, curr, i) => { return (curr.index === index) ? i : prev; }, -1), 1); this.renderOverlays(detailsHeight, rowItems); @@ -2085,7 +2157,7 @@ var OverlayManager = /** @class */ (function () { combinedOverlayHeight: self.getCombinedOverlayHeight(), type: "closed", }); - }; + } /** * Renders / Adjusts Overlays * @@ -2094,51 +2166,50 @@ var OverlayManager = /** @class */ (function () { * @param {number} detailsHeight * @param {SVGAElement[]} rowItems */ - OverlayManager.prototype.renderOverlays = function (detailsHeight, rowItems) { - var _this = this; + renderOverlays(detailsHeight, rowItems) { /** shared variable to keep track of heigth */ - var currY = 0; - var updateHeight = function (overlay, y, currHeight) { + let currY = 0; + const updateHeight = (overlay, y, currHeight) => { currY += currHeight; overlay.actualY = y; overlay.height = currHeight; }; - var addNewOverlay = function (overlayHolder, overlay) { - var y = overlay.defaultY + currY; - var infoOverlay = svg_details_overlay_1.createRowInfoOverlay(overlay, y, detailsHeight); + const addNewOverlay = (overlayHolder, overlay) => { + const y = overlay.defaultY + currY; + const infoOverlay = (0, svg_details_overlay_1.createRowInfoOverlay)(overlay, y, detailsHeight); // if overlay has a preview image show it - var previewImg = infoOverlay.querySelector("img.preview"); + const previewImg = infoOverlay.querySelector("img.preview"); if (previewImg && !previewImg.src) { previewImg.setAttribute("src", (previewImg.attributes.getNamedItem("data-src") || { value: "" }).value); } infoOverlay.querySelector("a") .addEventListener("keydown", OverlayManager.firstElKeypress); - dom_1.getLastItemOfNodeList(infoOverlay.querySelectorAll("button")) + (0, dom_1.getLastItemOfNodeList)(infoOverlay.querySelectorAll("button")) .addEventListener("keydown", OverlayManager.lastElKeypress); overlayHolder.appendChild(infoOverlay); updateHeight(overlay, y, infoOverlay.getBoundingClientRect().height); }; - var updateRow = function (rowItem, index) { - var overlay = misc_1.find(_this.openOverlays, function (o) { return o.index === index; }); - var nextRowItem = rowItem.nextElementSibling; - var overlayEl = nextRowItem.firstElementChild; - _this.realignRow(rowItem, currY); + const updateRow = (rowItem, index) => { + const overlay = (0, misc_1.find)(this.openOverlays, (o) => o.index === index); + const nextRowItem = rowItem.nextElementSibling; + const overlayEl = nextRowItem.firstElementChild; + this.realignRow(rowItem, currY); if (overlay === undefined) { if (overlayEl && nextRowItem !== null) { // remove closed overlay nextRowItem.querySelector("a") .removeEventListener("keydown", OverlayManager.firstElKeypress); - dom_1.getLastItemOfNodeList(nextRowItem.querySelectorAll("button")) + (0, dom_1.getLastItemOfNodeList)(nextRowItem.querySelectorAll("button")) .removeEventListener("keydown", OverlayManager.lastElKeypress); - dom_1.removeChildren(nextRowItem); + (0, dom_1.removeChildren)(nextRowItem); } return; // not open } if (overlayEl && overlay.actualY !== undefined) { - var bg = overlayEl.querySelector(".info-overlay-bg"); - var fo = overlayEl.querySelector("foreignObject"); - var btnRect = overlayEl.querySelector(".info-overlay-close-btn rect"); - var btnText = overlayEl.querySelector(".info-overlay-close-btn text"); + const bg = overlayEl.querySelector(".info-overlay-bg"); + const fo = overlayEl.querySelector("foreignObject"); + const btnRect = overlayEl.querySelector(".info-overlay-close-btn rect"); + const btnText = overlayEl.querySelector(".info-overlay-close-btn text"); updateHeight(overlay, overlay.defaultY + currY, overlay.height); // needs updateHeight bg.setAttribute("y", overlay.actualY.toString()); @@ -2150,70 +2221,67 @@ var OverlayManager = /** @class */ (function () { addNewOverlay(rowItem.nextElementSibling, overlay); }; rowItems.forEach(updateRow); - }; - OverlayManager.showFullName = function (el) { - var _a; - (_a = el.getElementsByClassName("row-fixed") - .item(0)) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new MouseEvent("mouseenter")); - }; - /** - * Keypress Event handler for fist el in Overlay, - * to manage highlighting of the element above - */ - OverlayManager.firstElKeypress = function (evt) { - if (misc_1.isTabUp(evt)) { - var par = dom_1.getParentByClassName(evt.target, "row-overlay-holder"); - if (par && par.previousElementSibling) { - OverlayManager.showFullName(par.previousElementSibling); - } + } +} +exports.OverlayManager = OverlayManager; +OverlayManager.showFullName = (el) => { + el.getElementsByClassName("row-fixed") + .item(0)?.dispatchEvent(new MouseEvent("mouseenter")); +}; +/** + * Keypress Event handler for fist el in Overlay, + * to manage highlighting of the element above + */ +OverlayManager.firstElKeypress = (evt) => { + if ((0, misc_1.isTabUp)(evt)) { + const par = (0, dom_1.getParentByClassName)(evt.target, "row-overlay-holder"); + if (par && par.previousElementSibling) { + OverlayManager.showFullName(par.previousElementSibling); } - }; - /** - * Keypress Event handler for last el in Overlay, - * to manage highlighting of the element below - */ - OverlayManager.lastElKeypress = function (evt) { - if (misc_1.isTabDown(evt)) { - var par = dom_1.getParentByClassName(evt.target, "row-overlay-holder"); - if (par && par.nextElementSibling) { - OverlayManager.showFullName(par.nextElementSibling); - } + } +}; +/** + * Keypress Event handler for last el in Overlay, + * to manage highlighting of the element below + */ +OverlayManager.lastElKeypress = (evt) => { + if ((0, misc_1.isTabDown)(evt)) { + const par = (0, dom_1.getParentByClassName)(evt.target, "row-overlay-holder"); + if (par && par.nextElementSibling) { + OverlayManager.showFullName(par.nextElementSibling); } - }; - return OverlayManager; -}()); -exports.OverlayManager = OverlayManager; + } +}; exports.default = OverlayManager; },{"../../helpers/dom":1,"../../helpers/misc":4,"./svg-details-overlay":19}],18:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PubSub = void 0; -var PubSub = /** @class */ (function () { - function PubSub() { +class PubSub { + constructor() { this.subscribers = []; } /** Call `fn` whenever a new change is publisched on OverlayChanges channel */ - PubSub.prototype.subscribeToOverlayChanges = function (fn) { + subscribeToOverlayChanges(fn) { this.subscribers.push(fn); - }; + } /** * Call `fn` whenever a new change for `index` are publisched * on OverlayChanges channel */ - PubSub.prototype.subscribeToSpecificOverlayChanges = function (index, fn) { - this.subscribers.push(function (evt) { + subscribeToSpecificOverlayChanges(index, fn) { + this.subscribers.push((evt) => { if (evt.changedIndex === index) { fn(evt); } }); - }; + } /** Publish a change on OverlayChanges channel */ - PubSub.prototype.publishToOverlayChanges = function (change) { - this.subscribers.forEach(function (fn) { return fn(change); }); - }; - return PubSub; -}()); + publishToOverlayChanges(change) { + this.subscribers.forEach((fn) => fn(change)); + } +} exports.PubSub = PubSub; exports.default = PubSub; @@ -2221,44 +2289,44 @@ exports.default = PubSub; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createRowInfoOverlay = void 0; -var dom_1 = require("../../helpers/dom"); -var svg = require("../../helpers/svg"); -var html_details_body_1 = require("./html-details-body"); +const dom_1 = require("../../helpers/dom"); +const svg = require("../../helpers/svg"); +const html_details_body_1 = require("./html-details-body"); function createCloseButtonSvg(y) { - var closeBtn = svg.newA("info-overlay-close-btn"); + const closeBtn = svg.newA("info-overlay-close-btn"); closeBtn.appendChild(svg.newRect({ height: 23, width: 23, x: "100%", - y: y, + y, })); closeBtn.appendChild(svg.newTextEl("✕", { dx: 7, dy: 16, x: "100%", - y: y, + y, })); closeBtn.appendChild(svg.newTitle("Close Overlay")); return closeBtn; } function createHolder(y, detailsHeight) { - var holder = svg.newG("info-overlay-holder"); - var bg = svg.newRect({ + const holder = svg.newG("info-overlay-holder"); + const bg = svg.newRect({ height: detailsHeight, rx: 2, ry: 2, width: "100%", x: "0", - y: y, + y, }, "info-overlay-bg"); holder.appendChild(bg); return holder; } /** Shared function to copy the tabs data */ -var onTabDataCopyClick = function (event) { - var btn = event.target; +const onTabDataCopyClick = (event) => { + const btn = event.target; if (btn.tagName.toLowerCase() === "button" && btn.classList.contains("copy-tab-data")) { - var el = document.createElement("textarea"); + const el = document.createElement("textarea"); el.value = btn.nextElementSibling ? btn.nextElementSibling.innerText : ""; document.body.appendChild(el); el.select(); @@ -2268,33 +2336,33 @@ var onTabDataCopyClick = function (event) { } }; function createRowInfoOverlay(overlay, y, detailsHeight) { - var requestID = overlay.index + 1; - var holder = createHolder(y, detailsHeight); - var foreignObject = svg.newForeignObject({ + const requestID = overlay.index + 1; + const holder = createHolder(y, detailsHeight); + const foreignObject = svg.newForeignObject({ height: detailsHeight, width: "100%", x: "0", - y: y, + y, }); - var body = html_details_body_1.createDetailsBody(requestID, detailsHeight, overlay.entry); - var closeBtn = createCloseButtonSvg(y); - closeBtn.addEventListener("click", function () { + const body = (0, html_details_body_1.createDetailsBody)(requestID, detailsHeight, overlay.entry); + const closeBtn = createCloseButtonSvg(y); + closeBtn.addEventListener("click", () => { overlay.onClose(overlay.index); body.removeEventListener("click", onTabDataCopyClick); }); body.addEventListener("click", onTabDataCopyClick); // need to re-fetch the elements to fix Edge "Invalid Calling Object" bug - var getButtons = function () { return body.getElementsByClassName("tab-button"); }; - var getTabs = function () { return body.getElementsByClassName("tab"); }; - var setTabStatus = function (tabIndex) { + const getButtons = () => body.getElementsByClassName("tab-button"); + const getTabs = () => body.getElementsByClassName("tab"); + const setTabStatus = (tabIndex) => { overlay.openTabIndex = tabIndex; - dom_1.forEachNodeList(getTabs(), function (tab, j) { + (0, dom_1.forEachNodeList)(getTabs(), (tab, j) => { tab.style.display = (tabIndex === j) ? "block" : "none"; getButtons().item(j).classList.toggle("active", (tabIndex === j)); }); }; - dom_1.forEachNodeList(getButtons(), function (btn, tabIndex) { - btn.addEventListener("click", function () { return setTabStatus(tabIndex); }); + (0, dom_1.forEachNodeList)(getButtons(), (btn, tabIndex) => { + btn.addEventListener("click", () => setTabStatus(tabIndex)); }); setTabStatus(overlay.openTabIndex); foreignObject.appendChild(body); @@ -2308,14 +2376,14 @@ exports.createRowInfoOverlay = createRowInfoOverlay; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getIndicatorIcons = exports.makeIcon = void 0; -var misc_1 = require("../../helpers/misc"); +const misc_1 = require("../../helpers/misc"); /** * Convinience helper to create a new `Icon` * * _Width of icons is fixed_ */ function makeIcon(type, title) { - return { type: type, title: title, width: 20 }; + return { type, title, width: 20 }; } exports.makeIcon = makeIcon; /** @@ -2324,25 +2392,25 @@ exports.makeIcon = makeIcon; * @returns {Icon[]} */ function getIndicatorIcons(entry) { - var indicators = entry.responseDetails.indicators.filter(function (i) { return i.displayType === "icon"; }); + const indicators = entry.responseDetails.indicators.filter((i) => i.displayType === "icon"); if (indicators.length === 0) { return []; } - var combinedTitle = []; - var icon = ""; - var errors = indicators.filter(function (i) { return i.type === "error"; }); - var warnings = indicators.filter(function (i) { return i.type === "warning"; }); - var info = indicators.filter(function (i) { return i.type !== "error" && i.type !== "warning"; }); + const combinedTitle = []; + let icon = ""; + const errors = indicators.filter((i) => i.type === "error"); + const warnings = indicators.filter((i) => i.type === "warning"); + const info = indicators.filter((i) => i.type !== "error" && i.type !== "warning"); if (errors.length > 0) { - combinedTitle.push(misc_1.pluralize("Error", errors.length) + ":\n " + errors.map(function (e) { return e.title; }).join("\n")); + combinedTitle.push((0, misc_1.pluralize)("Error", errors.length) + ":\n " + errors.map((e) => e.title).join("\n")); icon = "error"; } if (warnings.length > 0) { - combinedTitle.push(misc_1.pluralize("Warning", warnings.length) + ":\n" + warnings.map(function (w) { return w.title; }).join("\n")); + combinedTitle.push((0, misc_1.pluralize)("Warning", warnings.length) + ":\n" + warnings.map((w) => w.title).join("\n")); icon = icon || "warning"; } if (info.length > 0) { - combinedTitle.push("Info:\n" + info.map(function (i) { return i.title; }).join("\n")); + combinedTitle.push(`Info:\n${info.map((i) => i.title).join("\n")}`); if (!icon && info.length === 1) { icon = info[0].icon || info[0].type; } @@ -2361,21 +2429,21 @@ exports.getIndicatorIcons = getIndicatorIcons; */ Object.defineProperty(exports, "__esModule", { value: true }); exports.createRowBg = exports.createNameRowBg = exports.createBgStripe = exports.appendRequestLabels = exports.createRequestLabelFull = exports.createRequestLabelClipped = exports.createRequestNumberLabel = exports.createRect = void 0; -var dom_1 = require("../../helpers/dom"); -var misc = require("../../helpers/misc"); -var svg = require("../../helpers/svg"); -var styling_converters_1 = require("../../transformers/styling-converters"); -var svg_tooltip_1 = require("./svg-tooltip"); +const dom_1 = require("../../helpers/dom"); +const misc = require("../../helpers/misc"); +const svg = require("../../helpers/svg"); +const styling_converters_1 = require("../../transformers/styling-converters"); +const svg_tooltip_1 = require("./svg-tooltip"); /** * Creates the `rect` that represent the timings in `rectData` * @param {RectData} rectData - Data for block * @param {string} className - className for block `rect` */ function makeBlock(rectData, className) { - var holder = svg.newG(""); - var blockHeight = rectData.height - 1; - var rectX = misc.roundNumber(rectData.x / rectData.unit) + "%"; - var rect = svg.newRect({ + const holder = svg.newG(""); + const blockHeight = rectData.height - 1; + const rectX = misc.roundNumber(rectData.x / rectData.unit) + "%"; + const rect = svg.newRect({ height: blockHeight, width: misc.roundNumber(rectData.width / rectData.unit) + "%", x: rectX, @@ -2383,24 +2451,24 @@ function makeBlock(rectData, className) { }, className); holder.appendChild(rect); if (rectData.label) { - var showDelayTimeOut_1; - var foreignElLazy_1; - rect.addEventListener("mouseenter", function () { - if (!foreignElLazy_1) { - foreignElLazy_1 = dom_1.getParentByClassName(rect, "water-fall-chart") + let showDelayTimeOut; + let foreignElLazy; + rect.addEventListener("mouseenter", () => { + if (!foreignElLazy) { + foreignElLazy = (0, dom_1.getParentByClassName)(rect, "water-fall-chart") .querySelector(".tooltip"); } - showDelayTimeOut_1 = setTimeout(function () { - showDelayTimeOut_1 = null; - svg_tooltip_1.onHoverInShowTooltip(rect, rectData, foreignElLazy_1); + showDelayTimeOut = setTimeout(() => { + showDelayTimeOut = null; + (0, svg_tooltip_1.onHoverInShowTooltip)(rect, rectData, foreignElLazy); }, 100); }); - rect.addEventListener("mouseleave", function () { - if (showDelayTimeOut_1) { - clearTimeout(showDelayTimeOut_1); + rect.addEventListener("mouseleave", () => { + if (showDelayTimeOut) { + clearTimeout(showDelayTimeOut); } else { - svg_tooltip_1.onHoverOutShowTooltip(rect); + (0, svg_tooltip_1.onHoverOutShowTooltip)(rect); } }); } @@ -2411,12 +2479,12 @@ function makeBlock(rectData, className) { return holder; } function makeChunkBlock(chunkData, rectData, className) { - var holder = svg.newG(""); - var blockHeight = rectData.height - 1; + const holder = svg.newG(""); + const blockHeight = rectData.height - 1; // TODO: Once we have a way to pass the available bandwidth we can calculate the length for each chunk. // const blockWidth = chunkData.ts - (chunkData.bytes / (5000000 / 8.0)); - var rectX = misc.roundNumber(chunkData.ts / rectData.unit) + "%"; - var rect = svg.newRect({ + const rectX = misc.roundNumber(chunkData.ts / rectData.unit) + "%"; + const rect = svg.newRect({ height: blockHeight, width: "1px", x: rectX, @@ -2434,13 +2502,13 @@ function makeChunkBlock(chunkData, rectData, className) { * @returns RectData */ function segmentToRectData(segment, rectData) { - var total = (!isNaN(segment.total)) ? "
      total: " + Math.round(segment.total) + "ms" : ""; + const total = (!isNaN(segment.total)) ? `
      total: ${Math.round(segment.total)}ms` : ""; return { - cssClass: styling_converters_1.timingTypeToCssClass(segment.type), + cssClass: (0, styling_converters_1.timingTypeToCssClass)(segment.type), height: (rectData.height - 6), hideOverlay: rectData.hideOverlay, - label: "" + segment.type + "
      " + - (Math.round(segment.start) + "ms - " + Math.round(segment.end) + "ms" + total), + label: `${segment.type}
      ` + + `${Math.round(segment.start)}ms - ${Math.round(segment.end)}ms${total}`, showOverlay: rectData.showOverlay, unit: rectData.unit, width: segment.total, @@ -2455,28 +2523,28 @@ function segmentToRectData(segment, rectData) { * @returns SVGTextElement */ function createTimingLabel(rectData, timeTotal, firstX) { - var minWidth = 500; // minimum supported diagram width that should show the timing label uncropped - var spacingPerc = (5 / minWidth * 100); - var y = rectData.y + rectData.height / 1.5; - var totalLabel = Math.round(timeTotal) + " ms"; - var percStart = (rectData.x + rectData.width) / rectData.unit + spacingPerc; - var txtEl = svg.newTextEl(totalLabel, { x: misc.roundNumber(percStart) + "%", y: y }); + const minWidth = 500; // minimum supported diagram width that should show the timing label uncropped + const spacingPerc = (5 / minWidth * 100); + const y = rectData.y + rectData.height / 1.5; + const totalLabel = `${Math.round(timeTotal)} ms`; + let percStart = (rectData.x + rectData.width) / rectData.unit + spacingPerc; + let txtEl = svg.newTextEl(totalLabel, { x: `${misc.roundNumber(percStart)}%`, y }); // (pessimistic) estimation of text with to avoid performance penalty of `getBBox` - var roughTxtWidth = totalLabel.length * 8; + const roughTxtWidth = totalLabel.length * 8; if (percStart + (roughTxtWidth / minWidth * 100) > 100) { percStart = firstX / rectData.unit - spacingPerc; - txtEl = svg.newTextEl(totalLabel, { x: misc.roundNumber(percStart) + "%", y: y }, { textAnchor: "end" }); + txtEl = svg.newTextEl(totalLabel, { x: `${misc.roundNumber(percStart)}%`, y }, { textAnchor: "end" }); } return txtEl; } function createPushIndicator(rectData) { - var y = rectData.y + rectData.height / 1.5; - var x = misc.roundNumber(rectData.x / rectData.unit) + "%"; - var el = svg.newG("http2-inidicator-holder"); + const y = rectData.y + rectData.height / 1.5; + const x = `${misc.roundNumber(rectData.x / rectData.unit)}%`; + const el = svg.newG("http2-inidicator-holder"); el.appendChild(svg.newTextEl("→", { - transform: "translate(-5)", - x: x, - y: y, + transform: `translate(-5)`, + x, + y, }, { "fillOpacity": "0.6", "text-anchor": "end", @@ -2491,27 +2559,27 @@ function createPushIndicator(rectData) { * @return {SVGElement} Renerated SVG (rect or g element) */ function createRect(rectData, entry) { - var segments = entry.segments; - var rect = makeBlock(rectData, "time-block " + rectData.cssClass); - var rectHolder = svg.newG("rect-holder"); - var firstX = rectData.x; + const segments = entry.segments; + const rect = makeBlock(rectData, `time-block ${rectData.cssClass}`); + const rectHolder = svg.newG("rect-holder"); + let firstX = rectData.x; rectHolder.appendChild(rect); if (segments && segments.length > 0) { - segments.forEach(function (segment) { + segments.forEach((segment) => { if (!isNaN(segment.total) && segment.total > 0 && typeof segment.start === "number") { - var childRectData_1 = segmentToRectData(segment, rectData); - var childRect_1 = makeBlock(childRectData_1, "segment " + childRectData_1.cssClass); - firstX = Math.min(firstX, childRectData_1.x); + const childRectData = segmentToRectData(segment, rectData); + const childRect = makeBlock(childRectData, `segment ${childRectData.cssClass}`); + firstX = Math.min(firstX, childRectData.x); if (segment.type === 'receive' && segment.chunks && segment.chunks.length > 0) { - segment.chunks.forEach(function (chunk) { - var chunkRect = makeChunkBlock(chunk, childRectData_1, childRectData_1.cssClass + "-chunk"); - childRect_1.appendChild(chunkRect); + segment.chunks.forEach((chunk) => { + const chunkRect = makeChunkBlock(chunk, childRectData, `${childRectData.cssClass}-chunk`); + childRect.appendChild(chunkRect); }); } - rectHolder.appendChild(childRect_1); + rectHolder.appendChild(childRect); } }); - if (misc.find(entry.responseDetails.indicators, function (indicator) { return indicator.id === "push"; })) { + if (misc.find(entry.responseDetails.indicators, (indicator) => indicator.id === "push")) { rectHolder.appendChild(createPushIndicator(rectData)); } rectHolder.appendChild(createTimingLabel(rectData, entry.total, firstX)); @@ -2531,7 +2599,7 @@ exports.createRect = createRect; function createRequestNumberLabel(x, y, requestNumber, height, width) { y += Math.round(height / 2) + 5; x += width; - return svg.newTextEl(requestNumber, { x: x, y: y }, { "text-anchor": "end" }); + return svg.newTextEl(requestNumber, { x, y }, { "text-anchor": "end" }); } exports.createRequestNumberLabel = createRequestNumberLabel; /** @@ -2543,8 +2611,8 @@ exports.createRequestNumberLabel = createRequestNumberLabel; * @return {SVGTextElement} label SVG element */ function createRequestLabelClipped(x, y, name, height) { - var blockLabel = createRequestLabel(x, y, name, height); - blockLabel.style.clipPath = "url(#titleClipPath)"; + const blockLabel = createRequestLabel(x, y, name, height); + blockLabel.style.clipPath = `url(#titleClipPath)`; return blockLabel; } exports.createRequestLabelClipped = createRequestLabelClipped; @@ -2556,9 +2624,9 @@ exports.createRequestLabelClipped = createRequestLabelClipped; * @param {number} height height of row */ function createRequestLabelFull(x, y, name, height) { - var blockLabel = createRequestLabel(x, y, name, height); - var labelHolder = svg.newG("full-label", {}, { - clipPath: "url(#titleFullClipPath)", + const blockLabel = createRequestLabel(x, y, name, height); + const labelHolder = svg.newG("full-label", {}, { + clipPath: `url(#titleFullClipPath)`, }); labelHolder.appendChild(svg.newRect({ height: height - 4, @@ -2576,14 +2644,14 @@ function createRequestLabelFull(x, y, name, height) { exports.createRequestLabelFull = createRequestLabelFull; // private helper function createRequestLabel(x, y, name, height) { - var blockName = misc.resourceUrlFormatter(name, 125); + const blockName = misc.resourceUrlFormatter(name, 125); y = y + Math.round(height / 2) + 5; - var blockLabel = svg.newTextEl(blockName, { x: x, y: y }); + const blockLabel = svg.newTextEl(blockName, { x, y }); blockLabel.appendChild(svg.newTitle(name)); blockLabel.style.opacity = name.match(/js.map$/) ? "0.5" : "1"; return blockLabel; } -var supportsAnimationFrame = (typeof window.requestAnimationFrame === "function" && +const supportsAnimationFrame = (typeof window.requestAnimationFrame === "function" && typeof window.cancelAnimationFrame === "function"); /** * Appends the labels to `rowFixed` - TODO: see if this can be done more elegant @@ -2593,8 +2661,8 @@ var supportsAnimationFrame = (typeof window.requestAnimationFrame === "function" * @param {SVGGElement} fullLabel [description] */ function appendRequestLabels(rowFixed, requestNumberLabel, shortLabel, fullLabel) { - var labelFullBg = fullLabel.getElementsByTagName("rect")[0]; - var fullLabelText = fullLabel.getElementsByTagName("text")[0]; + const labelFullBg = fullLabel.getElementsByTagName("rect")[0]; + const fullLabelText = fullLabel.getElementsByTagName("text")[0]; // use display: none to not render it and visibility to remove it from search results (crt+f in chrome at least) fullLabel.style.display = "none"; fullLabel.style.visibility = "hidden"; @@ -2602,16 +2670,16 @@ function appendRequestLabels(rowFixed, requestNumberLabel, shortLabel, fullLabel rowFixed.appendChild(shortLabel); rowFixed.appendChild(fullLabel); /** the size adjustment only needs to happend once, this var keeps track of that */ - var isAdjusted = false; + let isAdjusted = false; /** store AnimationFrame id, to cancel it if hovering was too fast */ - var updateAnimFrame; - rowFixed.addEventListener("mouseenter", function () { + let updateAnimFrame; + rowFixed.addEventListener("mouseenter", () => { fullLabel.style.display = "block"; shortLabel.style.display = "none"; fullLabel.style.visibility = "visible"; // offload doublecheck of width - var update = function () { - var newWidth = fullLabelText.getComputedTextLength() + 10; + const update = () => { + const newWidth = fullLabelText.getComputedTextLength() + 10; labelFullBg.setAttribute("width", newWidth.toString()); isAdjusted = true; updateAnimFrame = undefined; @@ -2625,7 +2693,7 @@ function appendRequestLabels(rowFixed, requestNumberLabel, shortLabel, fullLabel } } }); - rowFixed.addEventListener("mouseleave", function () { + rowFixed.addEventListener("mouseleave", () => { shortLabel.style.display = "block"; fullLabel.style.display = "none"; fullLabel.style.visibility = "hidden"; @@ -2643,22 +2711,22 @@ exports.appendRequestLabels = appendRequestLabels; * @return {SVGRectElement} [description] */ function createBgStripe(y, height, isEven) { - var className = isEven ? "even" : "odd"; + const className = isEven ? "even" : "odd"; return svg.newRect({ - height: height, + height, width: "100%", x: 0, - y: y, + y, }, className); } exports.createBgStripe = createBgStripe; function createNameRowBg(y, rowHeight) { - var rowFixed = svg.newG("row row-fixed"); + const rowFixed = svg.newG("row row-fixed"); rowFixed.appendChild(svg.newRect({ height: rowHeight, width: "100%", x: "0", - y: y, + y, }, "", { opacity: 0, })); @@ -2666,12 +2734,12 @@ function createNameRowBg(y, rowHeight) { } exports.createNameRowBg = createNameRowBg; function createRowBg(y, rowHeight) { - var rowFixed = svg.newG("row row-flex"); + const rowFixed = svg.newG("row row-flex"); rowFixed.appendChild(svg.newRect({ height: rowHeight, width: "100%", x: "0", - y: y, + y, }, "", { opacity: 0, })); @@ -2683,90 +2751,90 @@ exports.createRowBg = createRowBg; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createRow = void 0; -var icons = require("../../helpers/icons"); -var misc_1 = require("../../helpers/misc"); -var svg = require("../../helpers/svg"); -var svg_indicators_1 = require("./svg-indicators"); -var rowSubComponents = require("./svg-row-subcomponents"); +const icons = require("../../helpers/icons"); +const misc_1 = require("../../helpers/misc"); +const svg = require("../../helpers/svg"); +const svg_indicators_1 = require("./svg-indicators"); +const rowSubComponents = require("./svg-row-subcomponents"); // initial clip path -var clipPathElProto = svg.newClipPath("titleClipPath"); +const clipPathElProto = svg.newClipPath("titleClipPath"); clipPathElProto.appendChild(svg.newRect({ height: "100%", width: "100%", })); -var clipPathElFullProto = svg.newClipPath("titleFullClipPath"); +const clipPathElFullProto = svg.newClipPath("titleFullClipPath"); clipPathElFullProto.appendChild(svg.newRect({ height: "100%", width: "100%", })); -var ROW_LEFT_MARGIN = 3; +const ROW_LEFT_MARGIN = 3; // Create row for a single request function createRow(context, index, maxIconsWidth, maxNumberWidth, rectData, entry, onDetailsOverlayShow) { - var y = rectData.y; - var rowHeight = rectData.height; - var leftColumnWidth = context.options.leftColumnWidth; - var rowItem = svg.newA(entry.responseDetails.rowClass || ""); + const y = rectData.y; + const rowHeight = rectData.height; + const leftColumnWidth = context.options.leftColumnWidth; + const rowItem = svg.newA(entry.responseDetails.rowClass || ""); rowItem.setAttribute("tabindex", "0"); rowItem.setAttribute("xlink:href", "javascript:void(0)"); - var leftFixedHolder = svg.newSvg("left-fixed-holder", { - width: leftColumnWidth + "%", + const leftFixedHolder = svg.newSvg("left-fixed-holder", { + width: `${leftColumnWidth}%`, x: "0", }); - var flexScaleHolder = svg.newSvg("flex-scale-waterfall", { - width: 100 - leftColumnWidth + "%", - x: leftColumnWidth + "%", + const flexScaleHolder = svg.newSvg("flex-scale-waterfall", { + width: `${100 - leftColumnWidth}%`, + x: `${leftColumnWidth}%`, }); - var rect = rowSubComponents.createRect(rectData, entry); - var rowName = rowSubComponents.createNameRowBg(y, rowHeight); - var rowBar = rowSubComponents.createRowBg(y, rowHeight); - var bgStripe = rowSubComponents.createBgStripe(y, rowHeight, (index % 2 === 0)); - var x = ROW_LEFT_MARGIN + maxIconsWidth; + const rect = rowSubComponents.createRect(rectData, entry); + const rowName = rowSubComponents.createNameRowBg(y, rowHeight); + const rowBar = rowSubComponents.createRowBg(y, rowHeight); + const bgStripe = rowSubComponents.createBgStripe(y, rowHeight, (index % 2 === 0)); + let x = ROW_LEFT_MARGIN + maxIconsWidth; if (context.options.showMimeTypeIcon) { - var icon = entry.responseDetails.icon; + const icon = entry.responseDetails.icon; x -= icon.width; rowName.appendChild(icons[icon.type](x, y + 3, icon.title)); } if (context.options.showIndicatorIcons) { // Create and add warnings for potentia;l issues - svg_indicators_1.getIndicatorIcons(entry).forEach(function (icon) { + (0, svg_indicators_1.getIndicatorIcons)(entry).forEach((icon) => { x -= icon.width; rowName.appendChild(icons[icon.type](x, y + 3, icon.title)); }); } // Jump to the largest offset of all rows x = ROW_LEFT_MARGIN + maxIconsWidth; - var requestNumber = "" + (index + 1); - var requestNumberLabel = rowSubComponents.createRequestNumberLabel(x, y, requestNumber, rowHeight, maxNumberWidth); + const requestNumber = `${index + 1}`; + const requestNumberLabel = rowSubComponents.createRequestNumberLabel(x, y, requestNumber, rowHeight, maxNumberWidth); // 4 is slightly bigger than the hover "glow" around the url x += maxNumberWidth + 4; - var shortLabel = rowSubComponents.createRequestLabelClipped(x, y, misc_1.resourceUrlFormatter(entry.url, 40), rowHeight); - var fullLabel = rowSubComponents.createRequestLabelFull(x, y, entry.url, rowHeight); + const shortLabel = rowSubComponents.createRequestLabelClipped(x, y, (0, misc_1.resourceUrlFormatter)(entry.url, 40), rowHeight); + const fullLabel = rowSubComponents.createRequestLabelFull(x, y, entry.url, rowHeight); // create and attach request block rowBar.appendChild(rect); rowSubComponents.appendRequestLabels(rowName, requestNumberLabel, shortLabel, fullLabel); - context.pubSub.subscribeToSpecificOverlayChanges(index, function (change) { + context.pubSub.subscribeToSpecificOverlayChanges(index, (change) => { hasOpenOverlay = (change.type === "open"); }); if (index > 0) { - context.pubSub.subscribeToSpecificOverlayChanges(index - 1, function (change) { + context.pubSub.subscribeToSpecificOverlayChanges(index - 1, (change) => { hasPrevOpenOverlay = (change.type === "open"); }); } - var hasOpenOverlay; - var hasPrevOpenOverlay; - rowItem.addEventListener("click", function (evt) { + let hasOpenOverlay; + let hasPrevOpenOverlay; + rowItem.addEventListener("click", (evt) => { evt.preventDefault(); onDetailsOverlayShow(evt); }); - rowItem.addEventListener("keydown", function (evt) { - var e = evt; // need to type this manually + rowItem.addEventListener("keydown", (evt) => { + const e = evt; // need to type this manually // space on enter if (e.which === 32 || e.which === 13) { e.preventDefault(); return onDetailsOverlayShow(e); } // tab without open overlays around - if (misc_1.isTabUp(e) && !hasPrevOpenOverlay && index > 0) { + if ((0, misc_1.isTabUp)(e) && !hasPrevOpenOverlay && index > 0) { if (rowItem.previousSibling && rowItem.previousSibling.previousSibling && rowItem.previousSibling.previousSibling.lastChild && @@ -2775,7 +2843,7 @@ function createRow(context, index, maxIconsWidth, maxNumberWidth, rectData, entr } return; } - if (misc_1.isTabDown(e) && !hasOpenOverlay) { + if ((0, misc_1.isTabDown)(e) && !hasOpenOverlay) { if (rowItem.nextSibling && rowItem.nextSibling.nextSibling && rowItem.nextSibling.nextSibling.lastChild && @@ -2785,7 +2853,7 @@ function createRow(context, index, maxIconsWidth, maxNumberWidth, rectData, entr return; } }); - rowItem.addEventListener("focusout", function () { + rowItem.addEventListener("focusout", () => { rowName.dispatchEvent(new MouseEvent("mouseleave")); }); flexScaleHolder.appendChild(rowBar); @@ -2803,44 +2871,43 @@ exports.createRow = createRow; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.makeTooltip = exports.onHoverOutShowTooltip = exports.onHoverInShowTooltip = void 0; -var dom_1 = require("../../helpers/dom"); -var svg = require("../../helpers/svg"); -var translateYRegEx = /(?:translate)\(.+[, ]+(.+)\)/; -var tooltipMaxWidth = 200; -var getTranslateY = function (str) { - if (str === void 0) { str = ""; } +const dom_1 = require("../../helpers/dom"); +const svg = require("../../helpers/svg"); +const translateYRegEx = /(?:translate)\(.+[, ]+(.+)\)/; +const tooltipMaxWidth = 200; +const getTranslateY = (str = "") => { str = (str === null) ? "" : str; - var res = translateYRegEx.exec(str); + const res = translateYRegEx.exec(str); if (res && res.length >= 2) { return parseInt(res[1], 10); } return 0; }; /** static event-handler to show tooltip */ -var onHoverInShowTooltip = function (base, rectData, foreignEl) { - var innerDiv = foreignEl.querySelector(".tooltip-payload"); - var row = dom_1.getParentByClassName(base, "row-item"); - var yTransformOffsest = getTranslateY(row.getAttribute("transform")); +const onHoverInShowTooltip = (base, rectData, foreignEl) => { + const innerDiv = foreignEl.querySelector(".tooltip-payload"); + const row = (0, dom_1.getParentByClassName)(base, "row-item"); + const yTransformOffsest = getTranslateY(row.getAttribute("transform")); /** Base Y */ - var yInt = parseInt(base.getAttribute("y") || "", 10); + const yInt = parseInt(base.getAttribute("y") || "", 10); /** Base X */ - var x = base.getAttribute("x") || ""; + const x = base.getAttribute("x") || ""; /** X Positon of parent in Percent */ - var xPercInt = parseFloat(x); - var offsetY = 50; + const xPercInt = parseFloat(x); + let offsetY = 50; /** Row's width in Pixel */ - var rowWidthPx = base.width.baseVal.value || base.getBoundingClientRect().width; + const rowWidthPx = base.width.baseVal.value || base.getBoundingClientRect().width; /** current ratio: 1% ≙ `pxPerPerc` Pixel */ - var pxPerPerc = rowWidthPx / (rectData.width / rectData.unit); - var percPerPx = (rectData.width / rectData.unit) / rowWidthPx; - var isLeftOfRow = xPercInt > 50 && ((95 - xPercInt) * pxPerPerc < tooltipMaxWidth); + const pxPerPerc = rowWidthPx / (rectData.width / rectData.unit); + const percPerPx = (rectData.width / rectData.unit) / rowWidthPx; + const isLeftOfRow = xPercInt > 50 && ((95 - xPercInt) * pxPerPerc < tooltipMaxWidth); innerDiv.innerHTML = rectData.label || ""; // Disable animation for size-gathering - dom_1.addClass(innerDiv, "no-anim"); + (0, dom_1.addClass)(innerDiv, "no-anim"); foreignEl.style.display = "block"; innerDiv.style.opacity = "0.01"; /** First heigth, floating might change this later, since with is not fixed */ - var initialHeight = innerDiv.clientHeight + 5; + const initialHeight = innerDiv.clientHeight + 5; if (yInt + yTransformOffsest - initialHeight > 0) { // above row offsetY = yTransformOffsest - initialHeight; } @@ -2848,37 +2915,37 @@ var onHoverInShowTooltip = function (base, rectData, foreignEl) { offsetY = yTransformOffsest + rectData.height + 10; } if (isLeftOfRow) { - var newLeft = xPercInt - ((innerDiv.clientWidth + 5) * percPerPx); - var leftOffset = parseInt(foreignEl.querySelector("body").style.left || "", 10); - var ratio = 1 / (1 / 100 * (100 - leftOffset)); + const newLeft = xPercInt - ((innerDiv.clientWidth + 5) * percPerPx); + let leftOffset = parseInt(foreignEl.querySelector("body").style.left || "", 10); + const ratio = 1 / (1 / 100 * (100 - leftOffset)); leftOffset = ratio * leftOffset; if (newLeft > -leftOffset) { // tooltip still visible - innerDiv.style.left = newLeft + "%"; + innerDiv.style.left = `${newLeft}%`; } else { // change value to not crop tooltip - innerDiv.style.left = -leftOffset + "%"; + innerDiv.style.left = `${-leftOffset}%`; } } else { innerDiv.style.left = x; } - foreignEl.setAttribute("y", "" + (yInt + offsetY)); + foreignEl.setAttribute("y", `${yInt + offsetY}`); foreignEl.setAttribute("height", initialHeight.toString()); - dom_1.removeClass(innerDiv, "no-anim"); + (0, dom_1.removeClass)(innerDiv, "no-anim"); innerDiv.style.opacity = "1"; - var diff = (innerDiv.clientHeight + 5) - initialHeight; + const diff = (innerDiv.clientHeight + 5) - initialHeight; if (diff !== 0) { // make adjustments if the initial height was wrong foreignEl.setAttribute("height", (initialHeight + diff).toString()); - foreignEl.setAttribute("y", "" + (yInt + offsetY - diff)); + foreignEl.setAttribute("y", `${yInt + offsetY - diff}`); } }; exports.onHoverInShowTooltip = onHoverInShowTooltip; -var onHoverOutShowTooltip = function (base) { - var holder = dom_1.getParentByClassName(base, "water-fall-chart"); - var foreignEl = holder.querySelector(".tooltip"); - var innerDiv = foreignEl.querySelector(".tooltip-payload"); +const onHoverOutShowTooltip = (base) => { + const holder = (0, dom_1.getParentByClassName)(base, "water-fall-chart"); + const foreignEl = holder.querySelector(".tooltip"); + const innerDiv = foreignEl.querySelector(".tooltip-payload"); foreignEl.style.display = "none"; foreignEl.setAttribute("height", "250"); // set to high value innerDiv.style.opacity = "0"; @@ -2888,25 +2955,25 @@ exports.onHoverOutShowTooltip = onHoverOutShowTooltip; * Creates the Tooltip base elements * @param {ChartOptions} options - Chart config/customization options */ -var makeTooltip = function (options) { - var leftColOffsetPerc = options.leftColumnWidth; - var holder = svg.newSvg("tooltip-holder", { +const makeTooltip = (options) => { + const leftColOffsetPerc = options.leftColumnWidth; + const holder = svg.newSvg("tooltip-holder", { width: "100%", x: "0", y: "0", }); - var foreignEl = svg.newForeignObject({ - width: "100%", + const foreignEl = svg.newForeignObject({ + width: `100%`, x: "0", - y: leftColOffsetPerc + "%", + y: `${leftColOffsetPerc}%`, }, "tooltip", { display: "none", }); - var html = dom_1.makeHtmlEl(); - var body = dom_1.makeBodyEl({ - left: leftColOffsetPerc + "%", - width: 100 - leftColOffsetPerc + "%", - }, "
      "); + const html = (0, dom_1.makeHtmlEl)(); + const body = (0, dom_1.makeBodyEl)({ + left: `${leftColOffsetPerc}%`, + width: `${100 - leftColOffsetPerc}%`, + }, `
      `); html.appendChild(body); foreignEl.appendChild(html); holder.appendChild(foreignEl); @@ -2921,8 +2988,8 @@ exports.makeTooltip = makeTooltip; */ Object.defineProperty(exports, "__esModule", { value: true }); exports.makeHoverEvtListeners = exports.createAlignmentLines = void 0; -var dom_1 = require("../../helpers/dom"); -var svg = require("../../helpers/svg"); +const dom_1 = require("../../helpers/dom"); +const svg = require("../../helpers/svg"); /** * Creates verticale alignment bars * @param {number} diagramHeight height of the requests part of the diagram in px @@ -2950,27 +3017,27 @@ exports.createAlignmentLines = createAlignmentLines; */ function makeHoverEvtListeners(hoverEl) { return { - onMouseEnterPartial: function () { - return function (evt) { - var targetRect = evt.target; - dom_1.addClass(targetRect, "active"); - var xPosEnd = targetRect.x.baseVal.valueInSpecifiedUnits + + onMouseEnterPartial() { + return (evt) => { + const targetRect = evt.target; + (0, dom_1.addClass)(targetRect, "active"); + const xPosEnd = targetRect.x.baseVal.valueInSpecifiedUnits + targetRect.width.baseVal.valueInSpecifiedUnits + "%"; - var xPosStart = targetRect.x.baseVal.valueInSpecifiedUnits + "%"; + const xPosStart = targetRect.x.baseVal.valueInSpecifiedUnits + "%"; hoverEl.endline.x1.baseVal.valueAsString = xPosEnd; hoverEl.endline.x2.baseVal.valueAsString = xPosEnd; hoverEl.startline.x1.baseVal.valueAsString = xPosStart; hoverEl.startline.x2.baseVal.valueAsString = xPosStart; - dom_1.addClass(hoverEl.endline, "active"); - dom_1.addClass(hoverEl.startline, "active"); + (0, dom_1.addClass)(hoverEl.endline, "active"); + (0, dom_1.addClass)(hoverEl.startline, "active"); }; }, - onMouseLeavePartial: function () { - return function (evt) { - var targetRect = evt.target; - dom_1.removeClass(targetRect, "active"); - dom_1.removeClass(hoverEl.endline, "active"); - dom_1.removeClass(hoverEl.startline, "active"); + onMouseLeavePartial() { + return (evt) => { + const targetRect = evt.target; + (0, dom_1.removeClass)(targetRect, "active"); + (0, dom_1.removeClass)(hoverEl.endline, "active"); + (0, dom_1.removeClass)(hoverEl.startline, "active"); }; }, }; @@ -2984,8 +3051,8 @@ exports.makeHoverEvtListeners = makeHoverEvtListeners; */ Object.defineProperty(exports, "__esModule", { value: true }); exports.createTimeScale = void 0; -var misc_1 = require("../../helpers/misc"); -var svg = require("../../helpers/svg"); +const misc_1 = require("../../helpers/misc"); +const svg = require("../../helpers/svg"); /** * Renders a per-second marker line and appends it to `timeHolder` * @@ -2995,39 +3062,38 @@ var svg = require("../../helpers/svg"); * @param {number} sec second of the time marker to render * @param {boolean} addLabel if true a time label is added to the marker-line */ -var appendSecond = function (context, timeHolder, secsTotal, sec, addLabel) { - if (addLabel === void 0) { addLabel = false; } - var diagramHeight = context.diagramHeight; - var secPerc = 100 / secsTotal; +const appendSecond = (context, timeHolder, secsTotal, sec, addLabel = false) => { + const diagramHeight = context.diagramHeight; + const secPerc = 100 / secsTotal; /** just used if `addLabel` is `true` - for full seconds */ - var lineLabel; - var lineClass = "sub-second-line"; - var x; + let lineLabel; + let lineClass = "sub-second-line"; + let x; if (addLabel) { - var showTextBefore = (sec > secsTotal - 0.2); + const showTextBefore = (sec > secsTotal - 0.2); lineClass = "second-line"; - x = misc_1.roundNumber(secPerc * sec) + 0.5 + "%"; - var css = {}; + x = (0, misc_1.roundNumber)(secPerc * sec) + 0.5 + "%"; + const css = {}; if (showTextBefore) { - x = misc_1.roundNumber(secPerc * sec) - 0.5 + "%"; + x = (0, misc_1.roundNumber)(secPerc * sec) - 0.5 + "%"; css["text-anchor"] = "end"; } - lineLabel = svg.newTextEl(sec + "s", { x: x, y: diagramHeight }, css); + lineLabel = svg.newTextEl(sec + "s", { x, y: diagramHeight }, css); } - x = misc_1.roundNumber(secPerc * sec) + "%"; - var lineEl = svg.newLine({ + x = (0, misc_1.roundNumber)(secPerc * sec) + "%"; + const lineEl = svg.newLine({ x1: x, x2: x, y1: 0, y2: diagramHeight, }, lineClass); - context.pubSub.subscribeToOverlayChanges(function (change) { - var offset = change.combinedOverlayHeight; + context.pubSub.subscribeToOverlayChanges((change) => { + const offset = change.combinedOverlayHeight; // figure out why there is an offset - var scale = (diagramHeight + offset) / (diagramHeight); - lineEl.setAttribute("transform", "scale(1, " + scale + ")"); + const scale = (diagramHeight + offset) / (diagramHeight); + lineEl.setAttribute("transform", `scale(1, ${scale})`); if (addLabel) { - lineLabel.setAttribute("transform", "translate(0, " + offset + ")"); + lineLabel.setAttribute("transform", `translate(0, ${offset})`); } }); timeHolder.appendChild(lineEl); @@ -3041,15 +3107,26 @@ var appendSecond = function (context, timeHolder, secsTotal, sec, addLabel) { * @param {number} durationMs Full duration of the waterfall */ function createTimeScale(context, durationMs) { - var timeHolder = svg.newG("time-scale full-width"); - var subStepMs = Math.ceil(durationMs / 10000) * 200; + const timeHolder = svg.newG("time-scale full-width"); + /** Constant to represent a Second in Milliseconds */ + const secInMs = 1000; + /** Number of (Sub-)Steps in a second */ + const stepsInASec = 5; + // more than 20sec doesn't leave space for sub-steps + const showSubSteps = durationMs < 20 * secInMs; + /** Space for a Step or SubStep - sub-steps rounded to 1st digit */ + const subStepMs = showSubSteps + ? Math.ceil(durationMs / (10 * secInMs)) * (secInMs / stepsInASec) + : secInMs; + // need BigInt (`BigInt(10)` or `10n` notation) here + // to avoid floating point precision rounding errors /** steps between each major second marker */ - var subStep = 1000 / subStepMs; - var secs = durationMs / 1000; - var steps = durationMs / subStepMs; - for (var i = 0; i <= steps; i++) { - var isMarkerStep = i % subStep < 0.000000001; // to avoid rounding issues - var secValue = i / subStep; + const subStep = Number(1000n / BigInt(subStepMs)); + const secs = durationMs / secInMs; + const steps = Math.floor(durationMs / subStepMs); + for (let i = 0; i <= steps; i++) { + const isMarkerStep = i % subStep === 0; + const secValue = i / subStep; appendSecond(context, timeHolder, secs, secValue, isMarkerStep); } return timeHolder; @@ -3060,51 +3137,51 @@ exports.createTimeScale = createTimeScale; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createLineRect = exports.createMarks = void 0; -var dom_1 = require("../../helpers/dom"); -var misc_1 = require("../../helpers/misc"); -var svg = require("../../helpers/svg"); +const dom_1 = require("../../helpers/dom"); +const misc_1 = require("../../helpers/misc"); +const svg = require("../../helpers/svg"); /** * Renders global marks for events like the onLoad event etc * @param {Context} context Execution context object * @param {Mark[]} marks [description] */ function createMarks(context, marks) { - var diagramHeight = context.diagramHeight; - var marksHolder = svg.newG("marker-holder", { + const diagramHeight = context.diagramHeight; + const marksHolder = svg.newG("marker-holder", { transform: "scale(1, 1)", }); - marks.forEach(function (mark, i) { - var x = misc_1.roundNumber(mark.startTime / context.unit); - var markHolder = svg.newG("mark-holder type-" + mark.name.toLowerCase().replace(/([0-9]+[ ]?ms)|\W/g, "")); - var lineHolder = svg.newG("line-holder"); - var lineLabelHolder = svg.newG("line-label-holder"); - var lineLabel = svg.newTextEl(mark.name, { x: x + "%", y: diagramHeight + 25 }); + marks.forEach((mark, i) => { + const x = (0, misc_1.roundNumber)(mark.startTime / context.unit); + const markHolder = svg.newG("mark-holder type-" + mark.name.toLowerCase().replace(/([0-9]+[ ]?ms)|\W/g, "")); + const lineHolder = svg.newG("line-holder"); + const lineLabelHolder = svg.newG("line-label-holder"); + const lineLabel = svg.newTextEl(mark.name, { x: `${x}%`, y: diagramHeight + 25 }); lineLabel.setAttribute("writing-mode", "tb"); - var lineRect; + let lineRect; mark.x = x; - var line = svg.newLine({ + const line = svg.newLine({ x1: x + "%", x2: x + "%", y1: 0, y2: diagramHeight, }); - var previousMark = marks[i - 1]; - var nextMark = marks[i + 1]; - var minDistance = 2.5; // minimum distance between marks - var isCloseToPerviousMark = (previousMark === null || previousMark === void 0 ? void 0 : previousMark.x) !== undefined && mark.x - previousMark.x < minDistance; - var nextX = misc_1.roundNumber(((nextMark === null || nextMark === void 0 ? void 0 : nextMark.startTime) || 0) / context.unit); + const previousMark = marks[i - 1]; + const nextMark = marks[i + 1]; + const minDistance = 2.5; // minimum distance between marks + const isCloseToPerviousMark = previousMark?.x !== undefined && mark.x - previousMark.x < minDistance; + const nextX = (0, misc_1.roundNumber)((nextMark?.startTime || 0) / context.unit); if (nextX && nextX - mark.x < minDistance && nextX + minDistance >= 100 && !isCloseToPerviousMark) { // look ahead // push current mark back if next mark would be pushed past 100% and there is no close previous mark - lineLabel.setAttribute("x", nextX - minDistance + "%"); + lineLabel.setAttribute("x", `${nextX - minDistance}%`); mark.x = nextX - minDistance; } - else if ((previousMark === null || previousMark === void 0 ? void 0 : previousMark.x) !== undefined && isCloseToPerviousMark) { // look behind + else if (previousMark?.x !== undefined && isCloseToPerviousMark) { // look behind // push mark ahead to not collide with previous mark - lineLabel.setAttribute("x", previousMark.x + minDistance + "%"); + lineLabel.setAttribute("x", `${previousMark.x + minDistance}%`); mark.x = previousMark.x + minDistance; } // would use polyline but can't use percentage for points - var lineConnection = svg.newLine({ + const lineConnection = svg.newLine({ x1: x + "%", x2: mark.x + "%", y1: diagramHeight, @@ -3116,48 +3193,48 @@ function createMarks(context, marks) { lineRect = createLineRect(context, mark); lineHolder.appendChild(lineRect); } - context.pubSub.subscribeToOverlayChanges(function (change) { - var offset = change.combinedOverlayHeight; - var scale = (diagramHeight + offset) / (diagramHeight); - line.setAttribute("transform", "scale(1, " + scale + ")"); - lineLabelHolder.setAttribute("transform", "translate(0, " + offset + ")"); - lineConnection.setAttribute("transform", "translate(0, " + offset + ")"); + context.pubSub.subscribeToOverlayChanges((change) => { + const offset = change.combinedOverlayHeight; + const scale = (diagramHeight + offset) / (diagramHeight); + line.setAttribute("transform", `scale(1, ${scale})`); + lineLabelHolder.setAttribute("transform", `translate(0, ${offset})`); + lineConnection.setAttribute("transform", `translate(0, ${offset})`); if (lineRect) { - lineRect.setAttribute("transform", "translate(0, " + offset + ")"); + lineRect.setAttribute("transform", `translate(0, ${offset})`); } }); - var isHoverActive = false; + let isHoverActive = false; /** click indicator - overwrites `isHoverActive` */ - var isClickActive = false; - var onLabelMouseEnter = function () { + let isClickActive = false; + const onLabelMouseEnter = () => { if (!isHoverActive) { // move marker to top markHolder.parentNode.appendChild(markHolder); isHoverActive = true; // assign class later to not break animation with DOM re-order if (typeof window.requestAnimationFrame === "function") { - window.requestAnimationFrame(function () { return dom_1.addClass(lineHolder, "active"); }); + window.requestAnimationFrame(() => (0, dom_1.addClass)(lineHolder, "active")); } else { - dom_1.addClass(lineHolder, "active"); + (0, dom_1.addClass)(lineHolder, "active"); } } }; - var onLabelMouseLeave = function () { + const onLabelMouseLeave = () => { isHoverActive = false; if (!isClickActive) { - dom_1.removeClass(lineHolder, "active"); + (0, dom_1.removeClass)(lineHolder, "active"); } }; - var onLabelClick = function () { + const onLabelClick = () => { if (isClickActive) { // deselect isHoverActive = false; - dom_1.removeClass(lineHolder, "active"); + (0, dom_1.removeClass)(lineHolder, "active"); } else if (!isHoverActive) { // for touch devices - dom_1.addClass(lineHolder, "active"); + (0, dom_1.addClass)(lineHolder, "active"); } else { isHoverActive = false; @@ -3183,7 +3260,7 @@ exports.createMarks = createMarks; * @param {Mark} entry Line entry */ function createLineRect(context, entry) { - var holder = svg.newG("line-mark-holder line-marker-" + misc_1.toCssClass(entry.name)); + const holder = svg.newG(`line-mark-holder line-marker-${(0, misc_1.toCssClass)(entry.name)}`); holder.appendChild(svg.newTitle(entry.name.replace(/^startTimer-/, ""))); holder.appendChild(svg.newRect({ height: context.diagramHeight, @@ -3197,37 +3274,26 @@ exports.createLineRect = createLineRect; },{"../../helpers/dom":1,"../../helpers/misc":4,"../../helpers/svg":6}],27:[function(require,module,exports){ "use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; Object.defineProperty(exports, "__esModule", { value: true }); exports.createWaterfallSvg = void 0; -var svg = require("../helpers/svg"); -var styling_converters_1 = require("../transformers/styling-converters"); -var overlay_manager_1 = require("./details-overlay/overlay-manager"); -var pub_sub_1 = require("./details-overlay/pub-sub"); -var row = require("./row/svg-row"); -var svg_tooltip_1 = require("./row/svg-tooltip"); -var svgAlignmentHelper = require("./sub-components/svg-alignment-helper"); -var svgGeneralComponents = require("./sub-components/svg-general-components"); -var svgMarks = require("./sub-components/svg-marks"); +const svg = require("../helpers/svg"); +const styling_converters_1 = require("../transformers/styling-converters"); +const overlay_manager_1 = require("./details-overlay/overlay-manager"); +const pub_sub_1 = require("./details-overlay/pub-sub"); +const row = require("./row/svg-row"); +const svg_tooltip_1 = require("./row/svg-tooltip"); +const svgAlignmentHelper = require("./sub-components/svg-alignment-helper"); +const svgGeneralComponents = require("./sub-components/svg-general-components"); +const svgMarks = require("./sub-components/svg-marks"); /** * Get a string that's as wide, or wider than any number from 0-n. * @param {number} n the highest number that should fit within the returned string's width. * @returns {string} */ function getWidestDigitString(n) { - var numDigits = Math.floor((Math.log(n) / Math.LN10)) + 1; - var s = ""; - for (var i = 0; i < numDigits; i++) { + const numDigits = Math.floor((Math.log(n) / Math.LN10)) + 1; + let s = ""; + for (let i = 0; i < numDigits; i++) { // No number should take more horizontal space than "0" does. s += "0"; } @@ -3240,8 +3306,8 @@ function getWidestDigitString(n) { * @returns Number */ function getSvgHeight(marks, diagramHeight) { - var maxMarkTextLength = marks.reduce(function (currMax, currValue) { - var attributes = { x: 0, y: 0 }; + const maxMarkTextLength = marks.reduce((currMax, currValue) => { + const attributes = { x: 0, y: 0 }; return Math.max(currMax, svg.getNodeTextWidth(svg.newTextEl(currValue.name, attributes), true)); }, 0); return Math.floor(diagramHeight + maxMarkTextLength + 35); @@ -3254,16 +3320,19 @@ function getSvgHeight(marks, diagramHeight) { * @return {Context} Context object */ function createContext(data, options, entriesToShow) { - var unit = data.durationMs / 100; - var diagramHeight = (entriesToShow.length + 1) * options.rowHeight; - var context = { - diagramHeight: diagramHeight, - options: options, + const unit = data.durationMs / 100; + const diagramHeight = (entriesToShow.length + 1) * options.rowHeight; + const context = { + diagramHeight, + options, pubSub: new pub_sub_1.PubSub(), - unit: unit, + unit, }; // `overlayManager` needs the `context` reference, so it's attached later - return __assign(__assign({}, context), { overlayManager: new overlay_manager_1.default(context) }); + return { + ...context, + overlayManager: new overlay_manager_1.default(context), + }; } /** * Entry point to start rendering the full waterfall SVG @@ -3273,31 +3342,31 @@ function createContext(data, options, entriesToShow) { */ function createWaterfallSvg(data, options) { // constants - var entriesToShow = data.entries - .filter(function (entry) { return (typeof entry.start === "number" && typeof entry.total === "number"); }) - .sort(function (a, b) { return (a.start || 0) - (b.start || 0); }); + const entriesToShow = data.entries + .filter((entry) => (typeof entry.start === "number" && typeof entry.total === "number")) + .sort((a, b) => (a.start || 0) - (b.start || 0)); /** Holder of request-details overlay */ - var overlayHolder = svg.newG("overlays"); + const overlayHolder = svg.newG("overlays"); /** Holds all rows */ - var rowHolder = svg.newG("rows-holder"); - var context = createContext(data, options, entriesToShow); + const rowHolder = svg.newG("rows-holder"); + const context = createContext(data, options, entriesToShow); /** full height of the SVG chart in px */ - var chartHolderHeight = getSvgHeight(data.marks, context.diagramHeight); + const chartHolderHeight = getSvgHeight(data.marks, context.diagramHeight); /** Main SVG Element that holds all data */ - var timeLineHolder = svg.newSvg("water-fall-chart", { + const timeLineHolder = svg.newSvg("water-fall-chart", { height: chartHolderHeight, }); /** Holder for scale, event and marks */ - var scaleAndMarksHolder = svg.newSvg("scale-and-marks-holder", { - width: 100 - options.leftColumnWidth + "%", - x: options.leftColumnWidth + "%", + const scaleAndMarksHolder = svg.newSvg("scale-and-marks-holder", { + width: `${100 - options.leftColumnWidth}%`, + x: `${options.leftColumnWidth}%`, }); /** Holder for on-hover vertical comparison bars */ - var hoverOverlayHolder; - var mouseListeners; + let hoverOverlayHolder; + let mouseListeners; if (options.showAlignmentHelpers) { hoverOverlayHolder = svg.newG("hover-overlays"); - var hoverEl = svgAlignmentHelper.createAlignmentLines(context.diagramHeight); + const hoverEl = svgAlignmentHelper.createAlignmentLines(context.diagramHeight); hoverOverlayHolder.appendChild(hoverEl.startline); hoverOverlayHolder.appendChild(hoverEl.endline); mouseListeners = svgAlignmentHelper.makeHoverEvtListeners(hoverEl); @@ -3306,52 +3375,50 @@ function createWaterfallSvg(data, options) { scaleAndMarksHolder.appendChild(svgGeneralComponents.createTimeScale(context, data.durationMs)); scaleAndMarksHolder.appendChild(svgMarks.createMarks(context, data.marks)); // This assumes all icons (mime and indicators) have the same width - var perIconWidth = entriesToShow[0].responseDetails.icon.width; - var maxIcons = 0; + const perIconWidth = entriesToShow[0].responseDetails.icon.width; + let maxIcons = 0; if (options.showMimeTypeIcon) { maxIcons += 1; } if (options.showIndicatorIcons) { - var iconsPerBlock = entriesToShow.map(function (entry) { - return entry.responseDetails.indicators.filter(function (i) { return i.displayType === "icon"; }).length > 0 ? 1 : 0; - }); + const iconsPerBlock = entriesToShow.map((entry) => entry.responseDetails.indicators.filter((i) => i.displayType === "icon").length > 0 ? 1 : 0); maxIcons += Math.max.apply(null, iconsPerBlock); } - var maxIconsWidth = maxIcons * perIconWidth; - var widestRequestNumber = getWidestDigitString(entriesToShow.length); - var maxNumberWidth = svg.getNodeTextWidth(svg.newTextEl("" + widestRequestNumber), true); - var rowItems = []; + const maxIconsWidth = maxIcons * perIconWidth; + const widestRequestNumber = getWidestDigitString(entriesToShow.length); + const maxNumberWidth = svg.getNodeTextWidth(svg.newTextEl(`${widestRequestNumber}`), true); + const rowItems = []; function getChartHeight() { return chartHolderHeight + context.overlayManager.getCombinedOverlayHeight(); } - context.pubSub.subscribeToOverlayChanges(function () { - var newHeight = getChartHeight(); + context.pubSub.subscribeToOverlayChanges(() => { + const newHeight = getChartHeight(); timeLineHolder.classList.toggle("closing", newHeight < timeLineHolder.clientHeight); - timeLineHolder.style.height = newHeight + "px"; + timeLineHolder.style.height = `${newHeight}px`; }); /** Renders single row and hooks up behaviour */ function renderRow(entry, i) { - var entryWidth = entry.total || 1; - var y = options.rowHeight * i; - var x = (entry.start || 0.001); - var detailsHeight = 450; - var rectData = { - cssClass: styling_converters_1.requestTypeToCssClass(entry.responseDetails.requestType), + const entryWidth = entry.total || 1; + const y = options.rowHeight * i; + const x = (entry.start || 0.001); + const detailsHeight = 450; + const rectData = { + cssClass: (0, styling_converters_1.requestTypeToCssClass)(entry.responseDetails.requestType), height: options.rowHeight, hideOverlay: options.showAlignmentHelpers ? mouseListeners.onMouseLeavePartial : undefined, - label: "" + entry.url + "
      " + - (Math.round(entry.start) + "ms - " + Math.round(entry.end) + "ms
      ") + - ("total: " + (isNaN(entry.total) ? "n/a " : Math.round(entry.total)) + "ms"), + label: `${entry.url}
      ` + + `${Math.round(entry.start)}ms - ${Math.round(entry.end)}ms
      ` + + `total: ${isNaN(entry.total) ? "n/a " : Math.round(entry.total)}ms`, showOverlay: options.showAlignmentHelpers ? mouseListeners.onMouseEnterPartial : undefined, unit: context.unit, width: entryWidth, - x: x, - y: y, + x, + y, }; - var showDetailsOverlay = function () { + const showDetailsOverlay = () => { context.overlayManager.toggleOverlay(i, y + options.rowHeight, detailsHeight, entry, rowItems); }; - var rowItem = row.createRow(context, i, maxIconsWidth, maxNumberWidth, rectData, entry, showDetailsOverlay); + const rowItem = row.createRow(context, i, maxIconsWidth, maxNumberWidth, rectData, entry, showDetailsOverlay); rowItems.push(rowItem); rowHolder.appendChild(rowItem); rowHolder.appendChild(svg.newG("row-overlay-holder")); @@ -3364,7 +3431,7 @@ function createWaterfallSvg(data, options) { timeLineHolder.appendChild(scaleAndMarksHolder); timeLineHolder.appendChild(rowHolder); timeLineHolder.appendChild(overlayHolder); - timeLineHolder.appendChild(svg_tooltip_1.makeTooltip(options)); + timeLineHolder.appendChild((0, svg_tooltip_1.makeTooltip)(options)); return timeLineHolder; } exports.createWaterfallSvg = createWaterfallSvg; diff --git a/perf-cascade.min.js b/perf-cascade.min.js index bf547bf..2ca3b87 100644 --- a/perf-cascade.min.js +++ b/perf-cascade.min.js @@ -1,3 +1,131 @@ -/*! github.com/micmro/PerfCascade Version:2.11.0 (24/11/2021) */ +/*! github.com/micmro/PerfCascade Version:3.0.0 (12/11/2022) */ -!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).perfCascade=e()}(function(){return function r(i,o,a){function s(t,e){if(!o[t]){if(!i[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(l)return l(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=o[t]={exports:{}},i[t][0].call(n.exports,function(e){return s(i[t][1][e]||e)},n,n.exports,r,i,o,a)}return o[t].exports}for(var l="function"==typeof require&&require,e=0;e."))}function i(e,t,n){t in e||console.warn(new Error("Trying to set non-existing attribute "+t+" = "+n+" on a <"+e.tagName.toLowerCase()+">.")),e.setAttributeNS("",t,n)}function o(t,n){Object.keys(n).forEach(function(e){r(t,e,n[e].toString())})}Object.defineProperty(n,"__esModule",{value:!0}),n.makeBodyEl=n.makeHtmlEl=n.safeSetAttributes=n.safeSetStyles=n.safeSetAttribute=n.safeSetStyle=n.forEachNodeList=n.getLastItemOfNodeList=n.removeChildren=n.getParentByClassName=n.removeClass=n.addClass=void 0,n.addClass=function(e,t){var n=e.classList;return n?t.split(" ").forEach(function(e){return n.add(e)}):e.setAttribute("class",e.getAttribute("class")+" "+t),e},n.removeClass=function(e,t){var n=e.classList;return n?n.remove(t):e.setAttribute("class",(e.getAttribute("class")||"").replace(new RegExp("(\\s|^)"+t+"(\\s|$)","g"),"$2")),e},n.getParentByClassName=function(e,t){if("function"==typeof e.closest)return e.closest("."+t);for(;e;){if(e.classList.contains(t))return e;e=e.parentElement}return null},n.removeChildren=function(e){for(;e.hasChildNodes();)e.removeChild(e.lastChild);return e},n.getLastItemOfNodeList=function(e){if(e&&0!==e.length)return e.item(e.length-1)},n.forEachNodeList=function(e,t){Array.prototype.forEach.call(e,t)},n.safeSetStyle=r,n.safeSetAttribute=i,n.safeSetStyles=o,n.safeSetAttributes=function(t,n){Object.keys(n).forEach(function(e){i(t,e,n[e].toString())})},n.makeHtmlEl=function(){var e=document.createElement("html");return e.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/xmlns/"),e},n.makeBodyEl=function(e,t){void 0===e&&(e={}),void 0===t&&(t="");var n=document.createElement("body");return n.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),o(n,e),n.innerHTML=t,n}},{}],2:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getHeaders=n.getHeader=n.hasHeader=void 0;function r(t){return function(e){return e.name.toLowerCase()===t}}n.hasHeader=function(e,t){return t=r(t.toLowerCase()),e.some(t)};var i=!!Array.prototype.find;n.getHeader=function(e,t){return t=r(t.toLowerCase()),(t=i?e.find(t):e.map(t).pop())?t.value:void 0},n.getHeaders=function(e,t){var n=r(t.toLowerCase());return e.filter(n).map(function(e){return[t,e.value]})}},{}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.audio=n.video=n.flash=n.font=n.error=n.warning=n.css=n.html=n.svg=n.image=n.javascript=n.other=n.plain=n.err5xx=n.err4xx=n.err3xx=n.noTls=void 0;var i,o,a,s,l,u,d,c,p,h,f,v,m,g,y=e("./svg"),b=function(e,t,n,r,i,o){t=y.newSvg("",{x:e,y:t}),i=y.newG("icon "+r,{transform:"scale("+i+")"});return i.appendChild(o),i.appendChild(y.newTitle(n)),t.appendChild(i),t};function w(e,t,n,r){return void 0===r&&(r=1),void 0===u&&(u=y.newPath("M6 6q0 .75-.525 1.275Q4.95 7.8 4.2 7.8q-.75 0-1.275-.525Q2.4 6.75 2.4\n 6q0-.75.525-1.275Q3.45 4.2 4.2 4.2q.75 0 1.275.525Q6 5.25 6 6zm9.6 3.6v4.2H2.4V12l3-3\n 1.5 1.5 4.8-4.8zm.9-6.6h-15q-.122 0-.21.09-.09.088-.09.21v11.4q0\n .122.09.21.088.09.21.09h15q.122 0 .21-.09.09-.088.09-.21V3.3q0-.122-.09-.21Q16.623\n 3 16.5 3zm1.5.3v11.4q0 .62-.44 1.06-.44.44-1.06.44h-15q-.62 0-1.06-.44Q0 15.32 0\n 14.7V3.3q0-.62.44-1.06.44-.44 1.06-.44h15q.62 0 1.06.44.44.44.44 1.06z")),b(e,t,n,"icon-image",r,u.cloneNode(!1))}function C(e,t,n,r){return void 0===r&&(r=1),void 0===p&&(p=y.newPath("M6 6q0 .75-.525 1.275Q4.95 7.8 4.2 7.8q-.75 0-1.275-.525Q2.4 6.75 2.4\n 6q0-.75.525-1.275Q3.45 4.2 4.2 4.2q.75 0 1.275.525Q6 5.25 6 6zm9.6 3.6v4.2H2.4V12l3-3\n 1.5 1.5 4.8-4.8zm.9-6.6h-15q-.122 0-.21.09-.09.088-.09.21v11.4q0\n .122.09.21.088.09.21.09h15q.122 0 .21-.09.09-.088.09-.21V3.3q0-.122-.09-.21Q16.623\n 3 16.5 3zm1.5.3v11.4q0 .62-.44 1.06-.44.44-1.06.44h-15q-.62 0-1.06-.44Q0 15.32 0\n 14.7V3.3q0-.62.44-1.06.44-.44 1.06-.44h15q.62 0 1.06.44.44.44.44 1.06z")),b(e,t,n,"icon-warning",r,p.cloneNode(!1))}n.noTls=function(e,t,n,r){return void 0===r&&(r=1),void 0===i&&(i=y.newPath("M18 6.216v2.77q0 .28-.206.486-.205.206-.486.206h-.693q-.28 0-.486-.206-.21-.205-.21\n -.487v-2.77q0-1.145-.81-1.957-.813-.81-1.96-.81-1.146 0-1.957.81-.81.812-.81 1.958v2.077h1.037q.434\n 0 .737.303.302.303.302.736v6.23q0 .433-.305.736t-.737.303H1.038q-.433 0-.736-.3Q0 15.996 0\n 15.56V9.33q0-.433.303-.736t.735-.303h7.27V6.218q0-2 1.422-3.423 1.423-1.423 3.424-1.423 2\n 0 3.424 1.424Q18 4.214 18 6.216")),b(e,t,n,"icon-no-tls",r,i.cloneNode(!1))},n.err3xx=function(e,t,n,r){return void 0===r&&(r=1),void 0===o&&(o=y.newPath("M17 2.333V7q0 .27-.198.47-.198.197-.47.197h-4.665q-.438 0-.615-.417-.177-.406.146-.72l1.437-1.436Q11.095\n 3.667 9 3.667q-1.083 0-2.068.422-.984.42-1.703 1.14-.72.715-1.14 1.7-.426.984-.426 2.07 0 1.08.422 2.065.42.984\n 1.14 1.703.718.72 1.702 1.14.984.422 2.067.422 1.24 0 2.344-.54 1.104-.543 1.864-1.533.073-.105.24-.126.146 0\n .26.095l1.427 1.436q.095.084.1.214.006.13-.08.234-1.133 1.376-2.75 2.13Q10.793 17 9 17q-1.625\n 0-3.104-.635-1.48-.636-2.552-1.71-1.073-1.072-1.71-2.55Q1 10.625 1 9t.635-3.104q.636-1.48 1.71-2.552\n 1.072-1.073 2.55-1.71Q7.375 1 9 1q1.53 0 2.964.578 1.432.578 2.546\n 1.63l1.355-1.343q.302-.323.73-.146.405.173.405.61z")),b(e,t,n,"icon-redirect",r,o.cloneNode(!1))},n.err4xx=function(e,t,n,r){return C(e,t,n,r=void 0===r?1:r)},n.err5xx=function(e,t,n,r){return C(e,t,n,r=void 0===r?1:r)},n.plain=function(e,t,n,r){return void 0===r&&(r=1),void 0===a&&(a=y.newPath("M15.247 4.393q.25.25.43.678.177.43.177.79v10.287q0\n .357-.25.607t-.607.25h-12q-.357 0-.607-.25t-.25-.606V1.858q0-.358.25-.608T2.997 1h8q.357 0\n .786.18.428.177.678.427zm-3.964-2.18V5.57h3.357q-.09-.256-.196-.364L11.65 2.41q-.108-.106-.367\n -.196zm3.428 13.644V6.714H11q-.357 0-.607-.25t-.25-.607V2.143h-6.86v13.714H14.71zM5.57\n 8.143q0-.125.08-.205.08-.08.204-.08h6.286q.125 0 .205.08.08.08.08.205v.57q0 .126-.08.207-.08.08\n -.205.08H5.854q-.125 0-.205-.08-.08-.08-.08-.206v-.57zm6.57 2q.125 0 .205.08.08.08.08.206V11q0\n .125-.08.205-.08.08-.205.08H5.854q-.125 0-.205-.08-.08-.08-.08-.205v-.57q0-.126.08-.207.08-.08.2\n -.08h6.286zm0 2.286q.125 0 .205.08.08.08.08.2v.572q0 .125-.08.205-.08.08-.205.08H5.854q-.125 0-.205\n -.08-.08-.08-.08-.205v-.572q0-.124.08-.204.08-.08.2-.08h6.286z")),b(e,t,n,"icon-plain",r,a.cloneNode(!1))},n.other=function(e,t,n,r){return void 0===r&&(r=1),void 0===s&&(s=y.newPath("M10.8 13.5v3q0 .2-.15.35-.15.15-.35.15h-3q-.2 0-.35-.15-.15-.15-.15-.35v-3q0-.2.15-.35.15\n -.15.35-.15h3q.2 0 .35.15.15.15.15.35zM14.75 6q0 .675-.193 1.262-.193.588-.437.957-.244.365\n -.688.74-.443.375-.718.543-.275.17-.763.444-.51.286-.852.81-.344.526-.344.84 0 .21-.15.405-.15.194\n -.35.194h-3q-.186 0-.318-.23-.13-.234-.13-.47v-.564q0-1.037.812-1.956.812-.917 1.787-1.355.74-.336\n 1.05-.7.314-.362.314-.95 0-.524-.583-.924-.58-.4-1.343-.4-.814 0-1.35.362-.44.312-1.34 1.437-.16.2\n -.386.2-.15 0-.313-.1L3.4 4.987q-.16-.124-.193-.312-.03-.188.07-.35Q5.277 1 9.077 1q1 0 2.01.387\n 1.01.388 1.825 1.038.812.65 1.325 1.594.51.94.51 1.98z")),b(e,t,n,"icon-other",r,s.cloneNode(!1))},n.javascript=function(e,t,n,r){return void 0===r&&(r=1),void 0===l&&(l=y.newPath("M13.516 2.9c-2.766 0-4.463 1.522-4.463 3.536 0 1.733 1.295 2.82 3.256 3.52\n 1.413.49 1.973.926 1.973 1.644 0 .787-.647 1.296-1.873 1.296-1.137 0-2.26-.368-2.96-.736l-.54\n 2.19c.665.367 1.996.734 3.344.734 3.238 0 4.744-1.68 4.744-3.658\n 0-1.68-.966-2.767-3.05-3.537-1.54-.6-2.186-.93-2.186-1.68 0-.6.56-1.14 1.714-1.14\n 1.137 0 1.996.33 2.45.56l.596-2.138c-.7-.332-1.663-.596-3.01-.596zm-9.032.192v7.44c0\n 1.822-.702 2.33-1.822 2.33-.525 0-.997-.09-1.365-.212L1 14.805c.525.175 1.33.28 1.96.28\n 2.574 0 4.185-1.173 4.185-4.534V3.097h-2.66z")),b(e,t,n,"icon-js",r,l.cloneNode(!1))},n.image=w,n.svg=function(e,t,n,r){return w(e,t,n,r=void 0===r?1:r)},n.html=function(e,t,n,r){return void 0===r&&(r=1),void 0===d&&(d=y.newPath("M5.626 13.31l-.492.492q-.098.098-.226.098t-.226-.098L.098 9.22Q0 9.12 0\n 8.99q0-.127.098-.226L4.682 4.18q.098-.097.226-.097t.226.098l.492.49q.1.1.1.23t-.1.23L1.76\n 8.99l3.866 3.866q.1.098.1.226t-.1.226zM11.44 2.815l-3.67\n 12.7q-.04.127-.152.19-.113.065-.23.026l-.61-.162q-.13-.04-.193-.152-.064-.112-.024-.24l3.67-12.698q.04\n -.128.157-.192.113-.064.23-.025l.61.167q.13.04.193.152.063.113.023.24zM17.9\n 9.22l-4.582 4.58q-.098.098-.226.098t-.226-.098l-.492-.492q-.1-.098-.1-.226t.1-.226L16.24\n 8.99l-3.867-3.865q-.1-.098-.1-.226t.1-.23l.492-.49q.098-.1.226-.1t.23.1l4.58 4.583q.1.1.1.226 0 .13-.1.23z")),b(e,t,n,"icon-html",r,d.cloneNode(!1))},n.css=function(e,t,n,r){return void 0===r&&(r=1),void 0===c&&(c=y.newPath("M15.436.99q.625 0 1.095.416.47.415.47 1.04 0 .564-.4 1.35-2.97 5.624-4.16 6.724-.865.814\n -1.946.814-1.127 0-1.935-.827-.81-.827-.81-1.962 0-1.144.822-1.895l5.705-5.175Q14.8.99\n 15.435.99zM7.31 10.232q.35.68.953 1.162.603.483 1.345.68l.01.634q.035 1.904-1.16 3.102-1.192\n 1.198-3.114 1.198-1.1 0-1.948-.416-.85-.415-1.364-1.14-.514-.723-.773-1.635Q1 12.905 1\n 11.85l.366.268q.304.224.555.398.25.175.53.327.277.15.41.15.368 0 .493-.33.224-.59.515-1.005.29\n -.415.62-.68.332-.263.788-.424.455-.16.92-.228.465-.066 1.118-.094z")),b(e,t,n,"icon-css",r,c.cloneNode(!1))},n.warning=C,n.error=function(e,t,n,r){return void 0===r&&(r=1),void 0===h&&(h=y.newPath("M9 1q2.177 0 4.016 1.073 1.838 1.073 2.91 2.91Q17 6.823 17 9q0 2.177-1.073 4.016-1.073\n 1.838-2.91 2.91Q11.177 17 9 17q-2.177 0-4.016-1.073-1.838-1.073-2.91-2.91Q1 11.177 1 9q0-2.177 1.073-4.016\n 1.073-1.838 2.91-2.91Q6.823 1 9 1zm1.333 12.99v-1.98q0-.145-.093-.244-.094-.1-.23-.1h-2q-.135 0-.24.105\n -.103.106-.103.24v1.98q0 .136.104.24.106.104.24.104h2q.137 0 .23-.1.094-.098.094-.243zm-.02-3.584l.187\n -6.468q0-.125-.104-.188-.104-.084-.25-.084H7.854q-.146 0-.25.084-.104.062-.104.188l.177 6.468q0\n .104.104.183.106.076.25.076h1.93q.146 0 .245-.078.1-.08.11-.184z")),b(e,t,n,"icon-no-gzip",r,h.cloneNode(!1))},n.font=function(e,t,n,r){return void 0===r&&(r=1),void 0===f&&(f=y.newPath("M7.97 5.754L6.338 10.08q.317 0 1.312.02.994.02 1.542.02.183 0 .548-.02-.836-2.432-1.77\n -4.345zM1 16.38l.02-.76q.22-.068.538-.12.317-.053.548-.102.23-.048.476-.14.245-.09.428-.278.182\n -.187.298-.485l2.28-5.923 2.69-6.962H9.51q.077.135.105.202l1.972 4.615q.317.75 1.02 2.476.7 1.726\n 1.095 2.64.144.327.558 1.39.413 1.062.692 1.62.192.432.336.547.183.145.847.284.663.14.807.197.058.37.058.55\n 0 .04-.005.13t-.005.128q-.605 0-1.827-.076-1.22-.08-1.836-.08-.73 0-2.067.07-1.337.067-1.712.076 0-.412.04\n -.75l1.258-.27q.01 0 .12-.022l.15-.033q.038-.01.14-.044.1-.034.143-.06l.1-.08q.06-.048.082-.106.024-.056.024\n -.133 0-.152-.298-.926t-.693-1.71q-.392-.93-.402-.96l-4.325-.02q-.25.56-.734 1.88-.487 1.32-.487 1.56 0\n .213.136.362.134.15.418.235.285.087.467.13.185.044.55.08.366.04.395.04.01.183.01.558 0 .087-.02.26-.558\n 0-1.678-.095-1.12-.098-1.678-.098-.08 0-.26.04-.18.037-.208.037-.77.136-1.808.136Z")),b(e,t,n,"icon-font",r,f.cloneNode(!1))},n.flash=function(e,t,n,r){return void 0===r&&(r=1),void 0===v&&(v=y.newPath("M13.724 4.738q.195.216.076.476L7.96 17.73q-.142.27-.456.27-.043 0-.15-.022-.185-.054-.277\n -.205-.092-.15-.05-.325l2.132-8.74L4.765 9.8q-.044.01-.13.01-.195 0-.336-.118-.193-.162-.14-.422L6.337.346q.043\n -.15.173-.25Q6.64 0 6.81 0h3.548q.206 0 .346.135.14.135.14.32 0 .086-.053.194L8.94 5.654l4.285\n -1.06q.086-.02.13-.02.205 0 .367.16z")),b(e,t,n,"icon-flash",r,v.cloneNode(!1))},n.video=function(e,t,n,r){return void 0===r&&(r=1),void 0===m&&(m=y.newPath("M17 4.107v9.714q0 .38-.348.53-.116.05-.223.05-.25 0-.41-.17l-3.6-3.6v1.48q0 1.067-.757 1.82-.754.756\n -1.817.756H3.57q-1.06 0-1.816-.753Q1 13.17 1 12.106V5.82q0-1.06.754-1.816.755-.754 1.817-.754h6.29q1.07 0\n 1.82.754.76.755.76 1.817V7.3l3.597-3.59q.16-.17.4-.17.107 0 .22.045.35.153.35.528z")),b(e,t,n,"icon-video",r,m.cloneNode(!1))},n.audio=function(e,t,n,r){return void 0===r&&(r=1),void 0===g&&(g=y.newPath("M8.385 3.756v10.46q0 .252-.183.434-.183.183-.433.183t-.44-.183l-3.2-3.202H1.61q-.25\n 0-.43-.183-.18-.182-.18-.432V7.14q0-.25.182-.432.182-.183.432-.183h2.52l3.202-3.202q.182-.183.432\n -.183t.43.183q.182.183.182.433zm3.692 5.23q0 .73-.41 1.36-.407.63-1.08.9-.097.048-.24.048-.25 0\n -.434-.178-.182-.177-.182-.437 0-.21.12-.35.12-.14.28-.24.16-.1.33-.22.166-.12.28-.34.117-.22.117\n -.55 0-.33-.115-.55-.115-.224-.28-.344-.163-.12-.326-.22-.165-.1-.28-.24-.116-.14-.116-.34 0-.26.183\n -.44t.43-.176q.146 0 .24.048.676.26 1.08.894.41.636.41 1.367zm2.46 0q0 1.472-.816 2.717t-2.16 1.813q\n -.12.048-.24.048-.26 0-.44-.183-.18-.18-.18-.43 0-.37.378-.56.54-.28.73-.42.713-.52 1.11-1.302.4\n -.783.4-1.667 0-.886-.4-1.67-.4-.783-1.11-1.303-.192-.145-.73-.424-.376-.192-.376-.567 0-.25.183\n -.434.183-.18.433-.18.123 0 .25.047 1.344.567 2.16 1.812.82 1.244.82 2.716zm2.463 0q0 2.212\n -1.22 4.063-1.222 1.85-3.25 2.72-.126.05-.25.05-.25 0-.434-.19-.183-.183-.183-.433 0-.346.375\n -.568.068-.04.217-.1.15-.064.216-.1.45-.244.79-.494 1.19-.875 1.85-2.183.67-1.306.67-2.777 0\n -1.47-.663-2.78-.664-1.304-1.846-2.18-.346-.25-.79-.49-.065-.035-.214-.1-.15-.06-.22-.1\n -.375-.22-.375-.57 0-.25.183-.43.183-.182.433-.182.123 0 .25.047 2.027.876 3.25 2.727Q17 6.775 17 8.99Z")),b(e,t,n,"icon-audio",r,g.cloneNode(!1))}},{"./svg":6}],4:[function(e,t,n){"use strict";function r(e,t){var n=0;if(e&&!(e.length<1))for(var r=e.length;nn?e.authority.substr(0,n)+"..."+t[t.length-1].substr(-r):e.authority+"..."+t[t.length-1].substr(-r)},n.roundNumber=function(e,t){return void 0===t&&(t=2),Math.round(e*Math.pow(10,t))/Math.pow(10,t)},n.isInStatusCodeRange=function(e,t,n){return t<=e&&e<=n};var i=/[^a-z-]/g;n.toCssClass=function(e){return e.toLowerCase().replace(i,"")},n.pluralize=function(e,t){return e+(1(local time: "+e.toLocaleString()+")":void 0};n.formatBytes=function(e){if(void 0===e)return"";var t=e+" bytes";return 1048576<=e?t+" (~"+r.roundNumber(e/1048576,1)+" MB)":1024<=e?t+" (~"+r.roundNumber(e/1024,0)+" kB)":t};var a={'"':""","&":"&","'":"'","<":"<",">":">"},s=new RegExp(Object.keys(a).join("|"),"g");n.escapeHtml=function(e){if(null==(e=void 0===e?"":e))return"";if("string"!=typeof e){if("function"!=typeof e.toString)throw TypeError("Invalid parameter");e=e.toString()}return e.replace(s,function(e){return a[e]})};var l=new RegExp("[^-A-Za-z0-9+&@#/%?=~_|!:,.;()]","g");n.sanitizeUrlForLink=function(e){var t=e.replace(l,"_");return 0===t.indexOf("http://")||0===t.indexOf("https://")?t:(console.warn("skipped link, due to potentially unsafe url",e),"")};var u=new RegExp("[^a-zA-Z0-9]","g");function d(e){return"number"==typeof e?e:"string"==typeof e?parseInt(e,10):void 0}n.sanitizeAlphaNumeric=function(e){return e.toString().replace(u,"")},n.toInt=d,n.validateOptions=function(n){function e(e){var t=d(n[e]);if(void 0===t)throw TypeError('option "'+e+'" needs to be a number');n[e]=t}function t(e){n[e]=!!n[e]}return e("leftColumnWidth"),e("rowHeight"),e("selectedPage"),t("showAlignmentHelpers"),t("showIndicatorIcons"),t("showMimeTypeIcon"),n}},{"./misc":4}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getNodeTextWidth=n.newPath=n.newTextEl=n.newTitle=n.newLine=n.newRect=n.newA=n.newForeignObject=n.newClipPath=n.newG=n.newSvg=void 0;var o=e("./dom"),a="http://www.w3.org/2000/svg";function r(e,t){var n=void 0===t?{}:t,r=n.attributes,i=void 0===r?{}:r,t=n.css,r=void 0===t?{}:t,t=n.text,t=void 0===t?"":t,n=n.className,n=void 0===n?"":n,e=document.createElementNS(a,e);return n&&o.addClass(e,n),t&&(e.textContent=t),o.safeSetStyles(e,r),o.safeSetAttributes(e,i),e}function i(e,t,n){return r("svg",{className:e,attributes:t,css:n=void 0===n?{}:n})}n.newSvg=i,n.newG=function(e,t,n){return r("g",{className:e,attributes:t=void 0===t?{}:t,css:n=void 0===n?{}:n})},n.newClipPath=function(e){return r("clipPath",{attributes:{id:e}})},n.newForeignObject=function(e,t,n){return r("foreignObject",{attributes:e,className:t=void 0===t?"":t,css:n=void 0===n?{}:n})},n.newA=function(e){return r("a",{className:e})},n.newRect=function(e,t,n){return r("rect",{attributes:e,className:t=void 0===t?"":t,css:n=void 0===n?{}:n})},n.newLine=function(e,t){return r("line",{className:t=void 0===t?"":t,attributes:e})},n.newTitle=function(e){var t=document.createElementNS(a,"title");return t.setAttribute("text",e),t},n.newTextEl=function(e,t,n){return r("text",{text:e,attributes:t=void 0===t?{}:t,css:n=void 0===n?{}:n})},n.newPath=function(e){var t=document.createElementNS(a,"path");return t.setAttribute("d",e),t};var s,l,u=function(){return void 0===s&&(s=i("water-fall-chart temp",{className:"water-fall-chart temp",width:"9999px"},{left:"0px",position:"absolute",top:"0px",visibility:"hidden","z-index":"99999"})),void 0===s.parentElement&&window.document.body.appendChild(s),clearTimeout(l),l=setTimeout(function(){s.parentNode.removeChild(s)},500),s};n.getNodeTextWidth=function(e,t){if(void 0===t&&(t=!1),0===(e.textContent||"").length)return 0;var n,r=u();t?(n=e.style.textShadow,i=e):((i=e.cloneNode(!0)).setAttribute("x","0"),i.setAttribute("y","0")),i.style.textShadow="0",r.appendChild(i),window.document.body.appendChild(r);var i=i.getComputedTextLength();return t&&void 0!==n&&(e.style.textShadow=n),i}},{"./dom":1}],7:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeLegend=void 0,n.makeLegend=function(){var e=document.createElement("ul");return e.className="resource-legend",e.innerHTML='\n
    • Blocked
    • \n
    • DNS
    • \n
    • Connect
    • \n
    • SSL (TLS)
    • \n
    • Send
    • \n
    • Wait
    • \n
    • Receive
    • ',e}},{}],8:[function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=this.getPageCount())throw new Error("Page does not exist - Invalid pageIndex selected");this.selectedPageIndex=e;var n=this.doc.pages[this.selectedPageIndex];this.onPageUpdateCbs.forEach(function(e){e(t.selectedPageIndex,n)})}},r.prototype.onPageUpdate=function(e){if(1=this.doc.pages.length&&(this.selectedPageIndex=this.doc.pages.length-1)}n.default=e},{"../helpers/dom":1}],10:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getKeys=void 0;var u=e("../helpers/har"),d=e("../helpers/parse"),c=e("./helpers"),p=function(e,t){return[e,d.parseAndFormat(t,d.parsePositive,d.formatBytes)]},r=function(e,t){return[e,d.parseAndFormat(t,d.parsePositive)]},h=function(e){return 1",i="",e=t.filter(function(e){return"error"===e.type}).map(function(e){return[e.title,e.description]}),n=t.filter(function(e){return"warning"===e.type}).map(function(e){return[e.title,e.description]}),t=t.filter(function(e){return"error"!==e.type&&"warning"!==e.type}).map(function(e){return[e.title,e.description]});0'+d.pluralize("Error",e.length)+"\n
      "+h.makeDefinitionList(e)+"
      ");0'+d.pluralize("Warning",n.length)+"\n
      "+h.makeDefinitionList(n)+"
      ");0Info\n
      '+h.makeDefinitionList(t)+"
      ");return g("General",i+r)}(r.general,o)),u.push((i=r.request,o=r.requestHeaders,g("Request","
      \n "+h.makeDefinitionList(i)+"\n
      \n

      All Request Headers

      \n
      \n "+h.makeDefinitionList(o)+"\n
      "))),u.push((i=r.response,o=r.responseHeaders,g("Response","
      \n "+h.makeDefinitionList(i)+"\n
      \n

      All Response Headers

      \n
      \n "+h.makeDefinitionList(o)+"\n
      "))),u.push(g("Timings",h.makeDefinitionList(r.timings,!0))),u.push((a=e,y("Raw Data",function(){return'\n \n
      '+c.escapeHtml(JSON.stringify(a,null,2))+"
      \n "},"raw-data rendered-data"))),"image"===n&&u.push((s=e,y("Preview",function(e){return''}))),e.response.content&&e.response.content.mimeType&&0===e.response.content.mimeType.indexOf("text/")&&e.response.content.text&&u.push((e=(e=e).response.content.text||"",l=e.replace(f,"\n").replace(m,"\t"),y("Content ("+(e=(e=e.match(v))?e.length:1)+" Line"+(1Copy Content to Clipboard\n
      '+c.escapeHtml(l)+"
      \n "},"content rendered-data"))),u.filter(function(e){return void 0!==e})}},{"../helpers/misc":4,"../helpers/parse":5,"./extract-details-keys":10,"./helpers":14}],13:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.transformPage=n.transformDoc=void 0;var o=e("../helpers/misc"),l=e("../helpers/parse"),u=e("./har-heuristics"),d=e("./har-tabs"),c=e("./helpers");n.transformDoc=function(e,n){var r=void 0!==e.log?e.log:e;return{pages:p(r).map(function(e,t){return i(r,t,n)})}};var p=function(e){return e.pages&&0a&&(a=e.startTime)}),n.fixedLengthMs&&(a=n.fixedLengthMs),{docIsTLS:s,durationMs:a+=100,entries:e,marks:t,title:i.title}}n.transformPage=i;var h=function(t,e,n){if(void 0===t)return[];function r(e,t){return e.startTime-t.startTime}var i=Object.keys(t).filter(function(e){return"number"==typeof t[e]&&0<=t[e]}).map(function(e){return{name:l.escapeHtml(e.replace(/^[_]/,""))+" ("+o.roundNumber(t[e],0)+" ms)",startTime:t[e]}});return(n.showUserTiming?a(e,n).concat(i):i).sort(r)},a=function(i,o){var t,n=o.showUserTimingEndMarker?function(e){return 0===e.indexOf("_userTime.")}:function(e){return 0===e.indexOf("_userTime.")&&0!==e.indexOf("_userTime.endTimer-")},e=n;Array.isArray(o.showUserTiming)&&(t=o.showUserTiming,e=function(e){return n(e)&&0<=t.indexOf(e.replace(/^_userTime\./,""))});var a=/^_userTime\.((?:startTimer-)?(.+))$/;return Object.keys(i).filter(e).map(function(e){var t=a.exec(e)||[,void 0,void 0],n=t[1],r=t[2];return(n=l.escapeHtml(n))!==(r=l.escapeHtml(r))&&i["_userTime.endTimer-"+r]?{duration:t=i["_userTime.endTimer-"+r]-i[e],name:(o.showUserTimingEndMarker?n:r)+" ("+i[e]+" - "+(i[e]+t)+" ms)",startTime:i[e]}:{name:n,startTime:i[e]}})},f=function(a,s){var l=s.timings,u=s._chunks||[];return["blocked","dns","connect","send","wait","receive"].reduce(function(e,t){var n=v(t,s,e,a);if(n.end&&n.start>=n.end)return e;if("connect"===t&&l.ssl&&-1!==l.ssl){var r=parseInt(""+s._ssl_start,10)||n.start,i=parseInt(""+s._ssl_end,10)||n.start+l.ssl,o=parseInt(""+s._ssl_start,10)?n.start:i;return e.concat([c.createWaterfallEntryTiming("ssl",Math.round(r),Math.round(i))]).concat([c.createWaterfallEntryTiming(t,Math.round(o),Math.round(n.end))])}return"receive"===t&&u&&0")}var i=e("../helpers/misc"),o=e("../helpers/parse"),a=e("../waterfall/row/svg-indicators");n.makeDefinitionList=function(e,n){return void 0===n&&(n=!1),e.map(function(e){return"\n
      "+r(e[0])+"
      \n
      "+r(e[1])+"
      \n ";var t}).join("")},n.mimeToRequestType=function(e){if(void 0===e)return"other";var t=(e=e.split("/"))[1];switch(void 0!==t&&(t=-1"}).join("\n"),a=t.tabs.map(function(e){var t="tab";e.tabClass&&(t+=" "+e.tabClass);var n="";if(e.content)n=e.content;else{if("function"!=typeof e.renderContent)throw TypeError("Invalid Details Tab");n=e.renderContent(r),e.content=n}return'
      '+n+"
      "}).join("\n");return i.innerHTML='\n
      \n
      \n

      #'+e+' \n '+l.escapeHtml(t.url)+'\n

      \n \n
      \n "+a+"\n
      \n ",n.appendChild(i),n}},{"../../helpers/dom":1,"../../helpers/parse":5}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.OverlayManager=void 0;var h=e("../../helpers/dom"),f=e("../../helpers/misc"),v=e("./svg-details-overlay"),e=(m.prototype.getCombinedOverlayHeight=function(){return this.openOverlays.reduce(function(e,t){return e+(t.height||0)},0)},m.prototype.openOverlay=function(t,e,n,r,i){var o;this.openOverlays.some(function(e){return e.index===t})||((o=this).openOverlays.push({defaultY:e,entry:r,index:t,onClose:function(){o.closeOverlay(t,n,i)},openTabIndex:0}),this.openOverlays=this.openOverlays.sort(function(e,t){return e.index>t.index?1:-1}),this.renderOverlays(n,i),this.context.pubSub.publishToOverlayChanges({changedIndex:t,combinedOverlayHeight:o.getCombinedOverlayHeight(),type:"open"}))},m.prototype.toggleOverlay=function(t,e,n,r,i){this.openOverlays.some(function(e){return e.index===t})?this.closeOverlay(t,n,i):this.openOverlay(t,e,n,r,i)},m.prototype.closeOverlay=function(r,e,t){this.openOverlays.splice(this.openOverlays.reduce(function(e,t,n){return t.index===r?n:e},-1),1),this.renderOverlays(e,t),this.context.pubSub.publishToOverlayChanges({changedIndex:r,combinedOverlayHeight:this.getCombinedOverlayHeight(),type:"closed"})},m.prototype.renderOverlays=function(u,e){function d(e,t,n){p+=n,e.actualY=t,e.height=n}var c=this,p=0;e.forEach(function(e,t){var n=f.find(c.openOverlays,function(e){return e.index===t}),r=e.nextElementSibling,i=r.firstElementChild;if(c.realignRow(e,p),void 0!==n){if(i&&void 0!==n.actualY){var o=i.querySelector(".info-overlay-bg"),a=i.querySelector("foreignObject"),s=i.querySelector(".info-overlay-close-btn rect"),l=i.querySelector(".info-overlay-close-btn text");return d(n,n.defaultY+p,n.height),o.setAttribute("y",n.actualY.toString()),a.setAttribute("y",n.actualY.toString()),l.setAttribute("y",n.actualY.toString()),void s.setAttribute("y",n.actualY.toString())}a=e.nextElementSibling,s=(l=n).defaultY+p,e=v.createRowInfoOverlay(l,s,u),(n=e.querySelector("img.preview"))&&!n.src&&n.setAttribute("src",(n.attributes.getNamedItem("data-src")||{value:""}).value),e.querySelector("a").addEventListener("keydown",m.firstElKeypress),h.getLastItemOfNodeList(e.querySelectorAll("button")).addEventListener("keydown",m.lastElKeypress),a.appendChild(e),d(l,s,e.getBoundingClientRect().height)}else i&&null!==r&&(r.querySelector("a").removeEventListener("keydown",m.firstElKeypress),h.getLastItemOfNodeList(r.querySelectorAll("button")).removeEventListener("keydown",m.lastElKeypress),h.removeChildren(r))})},m.showFullName=function(e){null!==(e=e.getElementsByClassName("row-fixed").item(0))&&void 0!==e&&e.dispatchEvent(new MouseEvent("mouseenter"))},m.firstElKeypress=function(e){!f.isTabUp(e)||(e=h.getParentByClassName(e.target,"row-overlay-holder"))&&e.previousElementSibling&&m.showFullName(e.previousElementSibling)},m.lastElKeypress=function(e){!f.isTabDown(e)||(e=h.getParentByClassName(e.target,"row-overlay-holder"))&&e.nextElementSibling&&m.showFullName(e.nextElementSibling)},m);function m(e){this.context=e,this.openOverlays=[],this.realignRow=function(e,t){e.setAttribute("transform","translate(0, "+t+")")}}n.OverlayManager=e,n.default=e},{"../../helpers/dom":1,"../../helpers/misc":4,"./svg-details-overlay":19}],18:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PubSub=void 0;var r=(i.prototype.subscribeToOverlayChanges=function(e){this.subscribers.push(e)},i.prototype.subscribeToSpecificOverlayChanges=function(t,n){this.subscribers.push(function(e){e.changedIndex===t&&n(e)})},i.prototype.publishToOverlayChanges=function(t){this.subscribers.forEach(function(e){return e(t)})},i);function i(){this.subscribers=[]}n.PubSub=r,n.default=r},{}],19:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createRowInfoOverlay=void 0;var d=e("../../helpers/dom"),c=e("../../helpers/svg"),p=e("./html-details-body");function h(e){var t=e.target;"button"===t.tagName.toLowerCase()&&t.classList.contains("copy-tab-data")&&((e=document.createElement("textarea")).value=t.nextElementSibling?t.nextElementSibling.innerText:"",document.body.appendChild(e),e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(e))}n.createRowInfoOverlay=function(e,t,n){var r,i=e.index+1,o=(o=t,r=n,a=c.newG("info-overlay-holder"),o=c.newRect({height:r,rx:2,ry:2,width:"100%",x:"0",y:o},"info-overlay-bg"),a.appendChild(o),a),a=c.newForeignObject({height:n,width:"100%",x:"0",y:t}),s=p.createDetailsBody(i,n,e.entry);function l(){return s.getElementsByClassName("tab-button")}function u(n){e.openTabIndex=n,d.forEachNodeList(s.getElementsByClassName("tab"),function(e,t){e.style.display=n===t?"block":"none",l().item(t).classList.toggle("active",n===t)})}return(t=(n=t,(t=c.newA("info-overlay-close-btn")).appendChild(c.newRect({height:23,width:23,x:"100%",y:n})),t.appendChild(c.newTextEl("✕",{dx:7,dy:16,x:"100%",y:n})),t.appendChild(c.newTitle("Close Overlay")),t)).addEventListener("click",function(){e.onClose(e.index),s.removeEventListener("click",h)}),s.addEventListener("click",h),d.forEachNodeList(l(),function(e,t){e.addEventListener("click",function(){return u(t)})}),u(e.openTabIndex),a.appendChild(s),o.appendChild(a),o.appendChild(t),o}},{"../../helpers/dom":1,"../../helpers/svg":6,"./html-details-body":16}],20:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getIndicatorIcons=n.makeIcon=void 0;var o=e("../../helpers/misc");function a(e,t){return{type:e,title:t,width:20}}n.makeIcon=a,n.getIndicatorIcons=function(e){if(0===(i=e.responseDetails.indicators.filter(function(e){return"icon"===e.displayType})).length)return[];var t=[],n="",r=i.filter(function(e){return"error"===e.type}),e=i.filter(function(e){return"warning"===e.type}),i=i.filter(function(e){return"error"!==e.type&&"warning"!==e.type});return 0total: "+Math.round(t.total)+"ms",o={cssClass:c.timingTypeToCssClass(t.type),height:n.height-6,hideOverlay:n.hideOverlay,label:""+t.type+"
      "+Math.round(t.start)+"ms - "+Math.round(t.end)+"ms"+r,showOverlay:n.showOverlay,unit:n.unit,width:t.total,x:t.start||.001,y:n.y},a=h(o,"segment "+o.cssClass),l=Math.min(l,o.x),"receive"===e.type&&e.chunks&&0');return e.appendChild(t),r.appendChild(e),n.appendChild(r),n}},{"../../helpers/dom":1,"../../helpers/svg":6}],24:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeHoverEvtListeners=n.createAlignmentLines=void 0;var r=e("../../helpers/dom"),i=e("../../helpers/svg");n.createAlignmentLines=function(e){return{endline:i.newLine({x1:"0",x2:"0",y1:"0",y2:e},"line-end"),startline:i.newLine({x1:"0",x2:"0",y1:"0",y2:e},"line-start")}},n.makeHoverEvtListeners=function(n){return{onMouseEnterPartial:function(){return function(e){var t=e.target;r.addClass(t,"active");e=t.x.baseVal.valueInSpecifiedUnits+t.width.baseVal.valueInSpecifiedUnits+"%",t=t.x.baseVal.valueInSpecifiedUnits+"%";n.endline.x1.baseVal.valueAsString=e,n.endline.x2.baseVal.valueAsString=e,n.startline.x1.baseVal.valueAsString=t,n.startline.x2.baseVal.valueAsString=t,r.addClass(n.endline,"active"),r.addClass(n.startline,"active")}},onMouseLeavePartial:function(){return function(e){e=e.target;r.removeClass(e,"active"),r.removeClass(n.endline,"active"),r.removeClass(n.startline,"active")}}}}},{"../../helpers/dom":1,"../../helpers/svg":6}],25:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createTimeScale=void 0;var p=e("../../helpers/misc"),h=e("../../helpers/svg");n.createTimeScale=function(e,t){for(var n=h.newG("time-scale full-width"),r=200*Math.ceil(t/1e4),i=1e3/r,o=t/1e3,a=t/r,s=0;s<=a;s++)!function(e,t,n,r,i){void 0===i&&(i=!1);var o,a,s,l=e.diagramHeight,u=100/n,d="sub-second-line";i&&(a=n-.2"+e.url+"
      "+Math.round(e.start)+"ms - "+Math.round(e.end)+"ms
      total: "+(isNaN(e.total)?"n/a ":Math.round(e.total))+"ms",showOverlay:o.showAlignmentHelpers?a.onMouseEnterPartial:void 0,unit:l.unit,width:n,x:i,y:r},i=C.createRow(l,t,h,f,i,e,function(){l.overlayManager.toggleOverlay(t,r+o.rowHeight,450,e,v)});v.push(i),s.appendChild(i),s.appendChild(g.newG("row-overlay-holder"))}),o.showAlignmentHelpers&&void 0!==t&&d.appendChild(t),u.appendChild(d),u.appendChild(s),u.appendChild(r),u.appendChild(x.makeTooltip(o)),u}},{"../helpers/svg":6,"../transformers/styling-converters":15,"./details-overlay/overlay-manager":17,"./details-overlay/pub-sub":18,"./row/svg-row":22,"./row/svg-tooltip":23,"./sub-components/svg-alignment-helper":24,"./sub-components/svg-general-components":25,"./sub-components/svg-marks":26}]},{},[8])(8)}); \ No newline at end of file +!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).perfCascade=e()}(function(){return function r(s,i,o){function a(t,e){if(!i[t]){if(!s[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(l)return l(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=i[t]={exports:{}},s[t][0].call(n.exports,function(e){return a(s[t][1][e]||e)},n,n.exports,r,s,i,o)}return i[t].exports}for(var l="function"==typeof require&&require,e=0;e.`))}function s(e,t,n){t in e||console.warn(new Error("Trying to set non-existing attribute "+`${t} = ${n} on a <${e.tagName.toLowerCase()}>.`)),e.setAttributeNS("",t,n)}function i(t,n){Object.keys(n).forEach(e=>{r(t,e,n[e].toString())})}Object.defineProperty(n,"__esModule",{value:!0}),n.makeBodyEl=n.makeHtmlEl=n.safeSetAttributes=n.safeSetStyles=n.safeSetAttribute=n.safeSetStyle=n.forEachNodeList=n.getLastItemOfNodeList=n.removeChildren=n.getParentByClassName=n.removeClass=n.addClass=void 0,n.addClass=function(e,t){const n=e.classList;return n?t.split(" ").forEach(e=>n.add(e)):e.setAttribute("class",e.getAttribute("class")+" "+t),e},n.removeClass=function(e,t){const n=e.classList;return n?n.remove(t):e.setAttribute("class",(e.getAttribute("class")||"").replace(new RegExp("(\\s|^)"+t+"(\\s|$)","g"),"$2")),e},n.getParentByClassName=function(e,t){if("function"==typeof e.closest)return e.closest(`.${t}`);for(;e;){if(e.classList.contains(t))return e;e=e.parentElement}return null},n.removeChildren=function(e){for(;e.hasChildNodes();)e.removeChild(e.lastChild);return e},n.getLastItemOfNodeList=function(e){if(e&&0!==e.length)return e.item(e.length-1)},n.forEachNodeList=function(e,t){Array.prototype.forEach.call(e,t)},n.safeSetStyle=r,n.safeSetAttribute=s,n.safeSetStyles=i,n.safeSetAttributes=function(t,n){Object.keys(n).forEach(e=>{s(t,e,n[e].toString())})},n.makeHtmlEl=function(){const e=document.createElement("html");return e.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/xmlns/"),e},n.makeBodyEl=function(e={},t=""){const n=document.createElement("body");return n.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),i(n,e),n.innerHTML=t,n}},{}],2:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getHeaders=n.getHeader=n.hasHeader=void 0;const r=t=>e=>e.name.toLowerCase()===t;n.hasHeader=function(e,t){return t=r(t.toLowerCase()),e.some(t)};const s=!!Array.prototype.find;n.getHeader=function(e,t){t=r(t.toLowerCase());let n;return n=s?e.find(t):e.map(t).pop(),n?n.value:void 0},n.getHeaders=function(e,t){var n=r(t.toLowerCase());return e.filter(n).map(e=>[t,e.value])}},{}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.audio=n.video=n.flash=n.font=n.error=n.warning=n.css=n.html=n.svg=n.image=n.javascript=n.other=n.plain=n.err5xx=n.err4xx=n.err3xx=n.noTls=void 0;const l=e("./svg"),s=(e,t,n,r,s,i)=>{const o=l.newSvg("",{x:e,y:t}),a=l.newG(`icon ${r}`,{transform:`scale(${s})`});return a.appendChild(i),a.appendChild(l.newTitle(n)),o.appendChild(a),o};let i;n.noTls=function(e,t,n,r=1){return void 0===i&&(i=l.newPath(`M18 6.216v2.77q0 .28-.206.486-.205.206-.486.206h-.693q-.28 0-.486-.206-.21-.205-.21 + -.487v-2.77q0-1.145-.81-1.957-.813-.81-1.96-.81-1.146 0-1.957.81-.81.812-.81 1.958v2.077h1.037q.434 + 0 .737.303.302.303.302.736v6.23q0 .433-.305.736t-.737.303H1.038q-.433 0-.736-.3Q0 15.996 0 + 15.56V9.33q0-.433.303-.736t.735-.303h7.27V6.218q0-2 1.422-3.423 1.423-1.423 3.424-1.423 2 + 0 3.424 1.424Q18 4.214 18 6.216`)),s(e,t,n,"icon-no-tls",r,i.cloneNode(!1))};let o;n.err3xx=function(e,t,n,r=1){return void 0===o&&(o=l.newPath(`M17 2.333V7q0 .27-.198.47-.198.197-.47.197h-4.665q-.438 0-.615-.417-.177-.406.146-.72l1.437-1.436Q11.095 + 3.667 9 3.667q-1.083 0-2.068.422-.984.42-1.703 1.14-.72.715-1.14 1.7-.426.984-.426 2.07 0 1.08.422 2.065.42.984 + 1.14 1.703.718.72 1.702 1.14.984.422 2.067.422 1.24 0 2.344-.54 1.104-.543 1.864-1.533.073-.105.24-.126.146 0 + .26.095l1.427 1.436q.095.084.1.214.006.13-.08.234-1.133 1.376-2.75 2.13Q10.793 17 9 17q-1.625 + 0-3.104-.635-1.48-.636-2.552-1.71-1.073-1.072-1.71-2.55Q1 10.625 1 9t.635-3.104q.636-1.48 1.71-2.552 + 1.072-1.073 2.55-1.71Q7.375 1 9 1q1.53 0 2.964.578 1.432.578 2.546 + 1.63l1.355-1.343q.302-.323.73-.146.405.173.405.61z`)),s(e,t,n,"icon-redirect",r,o.cloneNode(!1))},n.err4xx=function(e,t,n,r=1){return f(e,t,n,r)},n.err5xx=function(e,t,n,r=1){return f(e,t,n,r)};let a;n.plain=function(e,t,n,r=1){return void 0===a&&(a=l.newPath(`M15.247 4.393q.25.25.43.678.177.43.177.79v10.287q0 + .357-.25.607t-.607.25h-12q-.357 0-.607-.25t-.25-.606V1.858q0-.358.25-.608T2.997 1h8q.357 0 + .786.18.428.177.678.427zm-3.964-2.18V5.57h3.357q-.09-.256-.196-.364L11.65 2.41q-.108-.106-.367 + -.196zm3.428 13.644V6.714H11q-.357 0-.607-.25t-.25-.607V2.143h-6.86v13.714H14.71zM5.57 + 8.143q0-.125.08-.205.08-.08.204-.08h6.286q.125 0 .205.08.08.08.08.205v.57q0 .126-.08.207-.08.08 + -.205.08H5.854q-.125 0-.205-.08-.08-.08-.08-.206v-.57zm6.57 2q.125 0 .205.08.08.08.08.206V11q0 + .125-.08.205-.08.08-.205.08H5.854q-.125 0-.205-.08-.08-.08-.08-.205v-.57q0-.126.08-.207.08-.08.2 + -.08h6.286zm0 2.286q.125 0 .205.08.08.08.08.2v.572q0 .125-.08.205-.08.08-.205.08H5.854q-.125 0-.205 + -.08-.08-.08-.08-.205v-.572q0-.124.08-.204.08-.08.2-.08h6.286z`)),s(e,t,n,"icon-plain",r,a.cloneNode(!1))};let c;n.other=function(e,t,n,r=1){return void 0===c&&(c=l.newPath(`M10.8 13.5v3q0 .2-.15.35-.15.15-.35.15h-3q-.2 0-.35-.15-.15-.15-.15-.35v-3q0-.2.15-.35.15 + -.15.35-.15h3q.2 0 .35.15.15.15.15.35zM14.75 6q0 .675-.193 1.262-.193.588-.437.957-.244.365 + -.688.74-.443.375-.718.543-.275.17-.763.444-.51.286-.852.81-.344.526-.344.84 0 .21-.15.405-.15.194 + -.35.194h-3q-.186 0-.318-.23-.13-.234-.13-.47v-.564q0-1.037.812-1.956.812-.917 1.787-1.355.74-.336 + 1.05-.7.314-.362.314-.95 0-.524-.583-.924-.58-.4-1.343-.4-.814 0-1.35.362-.44.312-1.34 1.437-.16.2 + -.386.2-.15 0-.313-.1L3.4 4.987q-.16-.124-.193-.312-.03-.188.07-.35Q5.277 1 9.077 1q1 0 2.01.387 + 1.01.388 1.825 1.038.812.65 1.325 1.594.51.94.51 1.98z`)),s(e,t,n,"icon-other",r,c.cloneNode(!1))};let d;n.javascript=function(e,t,n,r=1){return void 0===d&&(d=l.newPath(`M13.516 2.9c-2.766 0-4.463 1.522-4.463 3.536 0 1.733 1.295 2.82 3.256 3.52 + 1.413.49 1.973.926 1.973 1.644 0 .787-.647 1.296-1.873 1.296-1.137 0-2.26-.368-2.96-.736l-.54 + 2.19c.665.367 1.996.734 3.344.734 3.238 0 4.744-1.68 4.744-3.658 + 0-1.68-.966-2.767-3.05-3.537-1.54-.6-2.186-.93-2.186-1.68 0-.6.56-1.14 1.714-1.14 + 1.137 0 1.996.33 2.45.56l.596-2.138c-.7-.332-1.663-.596-3.01-.596zm-9.032.192v7.44c0 + 1.822-.702 2.33-1.822 2.33-.525 0-.997-.09-1.365-.212L1 14.805c.525.175 1.33.28 1.96.28 + 2.574 0 4.185-1.173 4.185-4.534V3.097h-2.66z`)),s(e,t,n,"icon-js",r,d.cloneNode(!1))};let u;function p(e,t,n,r=1){return void 0===u&&(u=l.newPath(`M6 6q0 .75-.525 1.275Q4.95 7.8 4.2 7.8q-.75 0-1.275-.525Q2.4 6.75 2.4 + 6q0-.75.525-1.275Q3.45 4.2 4.2 4.2q.75 0 1.275.525Q6 5.25 6 6zm9.6 3.6v4.2H2.4V12l3-3 + 1.5 1.5 4.8-4.8zm.9-6.6h-15q-.122 0-.21.09-.09.088-.09.21v11.4q0 + .122.09.21.088.09.21.09h15q.122 0 .21-.09.09-.088.09-.21V3.3q0-.122-.09-.21Q16.623 + 3 16.5 3zm1.5.3v11.4q0 .62-.44 1.06-.44.44-1.06.44h-15q-.62 0-1.06-.44Q0 15.32 0 + 14.7V3.3q0-.62.44-1.06.44-.44 1.06-.44h15q.62 0 1.06.44.44.44.44 1.06z`)),s(e,t,n,"icon-image",r,u.cloneNode(!1))}n.image=p,n.svg=function(e,t,n,r=1){return p(e,t,n,r)};let h;n.html=function(e,t,n,r=1){return void 0===h&&(h=l.newPath(`M5.626 13.31l-.492.492q-.098.098-.226.098t-.226-.098L.098 9.22Q0 9.12 0 + 8.99q0-.127.098-.226L4.682 4.18q.098-.097.226-.097t.226.098l.492.49q.1.1.1.23t-.1.23L1.76 + 8.99l3.866 3.866q.1.098.1.226t-.1.226zM11.44 2.815l-3.67 + 12.7q-.04.127-.152.19-.113.065-.23.026l-.61-.162q-.13-.04-.193-.152-.064-.112-.024-.24l3.67-12.698q.04 + -.128.157-.192.113-.064.23-.025l.61.167q.13.04.193.152.063.113.023.24zM17.9 + 9.22l-4.582 4.58q-.098.098-.226.098t-.226-.098l-.492-.492q-.1-.098-.1-.226t.1-.226L16.24 + 8.99l-3.867-3.865q-.1-.098-.1-.226t.1-.23l.492-.49q.098-.1.226-.1t.23.1l4.58 4.583q.1.1.1.226 0 .13-.1.23z`)),s(e,t,n,"icon-html",r,h.cloneNode(!1))};let m;n.css=function(e,t,n,r=1){return void 0===m&&(m=l.newPath(`M15.436.99q.625 0 1.095.416.47.415.47 1.04 0 .564-.4 1.35-2.97 5.624-4.16 6.724-.865.814 + -1.946.814-1.127 0-1.935-.827-.81-.827-.81-1.962 0-1.144.822-1.895l5.705-5.175Q14.8.99 + 15.435.99zM7.31 10.232q.35.68.953 1.162.603.483 1.345.68l.01.634q.035 1.904-1.16 3.102-1.192 + 1.198-3.114 1.198-1.1 0-1.948-.416-.85-.415-1.364-1.14-.514-.723-.773-1.635Q1 12.905 1 + 11.85l.366.268q.304.224.555.398.25.175.53.327.277.15.41.15.368 0 .493-.33.224-.59.515-1.005.29 + -.415.62-.68.332-.263.788-.424.455-.16.92-.228.465-.066 1.118-.094z`)),s(e,t,n,"icon-css",r,m.cloneNode(!1))};let g;function f(e,t,n,r=1){return void 0===g&&(g=l.newPath(`M6 6q0 .75-.525 1.275Q4.95 7.8 4.2 7.8q-.75 0-1.275-.525Q2.4 6.75 2.4 + 6q0-.75.525-1.275Q3.45 4.2 4.2 4.2q.75 0 1.275.525Q6 5.25 6 6zm9.6 3.6v4.2H2.4V12l3-3 + 1.5 1.5 4.8-4.8zm.9-6.6h-15q-.122 0-.21.09-.09.088-.09.21v11.4q0 + .122.09.21.088.09.21.09h15q.122 0 .21-.09.09-.088.09-.21V3.3q0-.122-.09-.21Q16.623 + 3 16.5 3zm1.5.3v11.4q0 .62-.44 1.06-.44.44-1.06.44h-15q-.62 0-1.06-.44Q0 15.32 0 + 14.7V3.3q0-.62.44-1.06.44-.44 1.06-.44h15q.62 0 1.06.44.44.44.44 1.06z`)),s(e,t,n,"icon-warning",r,g.cloneNode(!1))}n.warning=f;let v;n.error=function(e,t,n,r=1){return void 0===v&&(v=l.newPath(`M9 1q2.177 0 4.016 1.073 1.838 1.073 2.91 2.91Q17 6.823 17 9q0 2.177-1.073 4.016-1.073 + 1.838-2.91 2.91Q11.177 17 9 17q-2.177 0-4.016-1.073-1.838-1.073-2.91-2.91Q1 11.177 1 9q0-2.177 1.073-4.016 + 1.073-1.838 2.91-2.91Q6.823 1 9 1zm1.333 12.99v-1.98q0-.145-.093-.244-.094-.1-.23-.1h-2q-.135 0-.24.105 + -.103.106-.103.24v1.98q0 .136.104.24.106.104.24.104h2q.137 0 .23-.1.094-.098.094-.243zm-.02-3.584l.187 + -6.468q0-.125-.104-.188-.104-.084-.25-.084H7.854q-.146 0-.25.084-.104.062-.104.188l.177 6.468q0 + .104.104.183.106.076.25.076h1.93q.146 0 .245-.078.1-.08.11-.184z`)),s(e,t,n,"icon-no-gzip",r,v.cloneNode(!1))};let y;n.font=function(e,t,n,r=1){return void 0===y&&(y=l.newPath(`M7.97 5.754L6.338 10.08q.317 0 1.312.02.994.02 1.542.02.183 0 .548-.02-.836-2.432-1.77 + -4.345zM1 16.38l.02-.76q.22-.068.538-.12.317-.053.548-.102.23-.048.476-.14.245-.09.428-.278.182 + -.187.298-.485l2.28-5.923 2.69-6.962H9.51q.077.135.105.202l1.972 4.615q.317.75 1.02 2.476.7 1.726 + 1.095 2.64.144.327.558 1.39.413 1.062.692 1.62.192.432.336.547.183.145.847.284.663.14.807.197.058.37.058.55 + 0 .04-.005.13t-.005.128q-.605 0-1.827-.076-1.22-.08-1.836-.08-.73 0-2.067.07-1.337.067-1.712.076 0-.412.04 + -.75l1.258-.27q.01 0 .12-.022l.15-.033q.038-.01.14-.044.1-.034.143-.06l.1-.08q.06-.048.082-.106.024-.056.024 + -.133 0-.152-.298-.926t-.693-1.71q-.392-.93-.402-.96l-4.325-.02q-.25.56-.734 1.88-.487 1.32-.487 1.56 0 + .213.136.362.134.15.418.235.285.087.467.13.185.044.55.08.366.04.395.04.01.183.01.558 0 .087-.02.26-.558 + 0-1.678-.095-1.12-.098-1.678-.098-.08 0-.26.04-.18.037-.208.037-.77.136-1.808.136Z`)),s(e,t,n,"icon-font",r,y.cloneNode(!1))};let b;n.flash=function(e,t,n,r=1){return void 0===b&&(b=l.newPath(`M13.724 4.738q.195.216.076.476L7.96 17.73q-.142.27-.456.27-.043 0-.15-.022-.185-.054-.277 + -.205-.092-.15-.05-.325l2.132-8.74L4.765 9.8q-.044.01-.13.01-.195 0-.336-.118-.193-.162-.14-.422L6.337.346q.043 + -.15.173-.25Q6.64 0 6.81 0h3.548q.206 0 .346.135.14.135.14.32 0 .086-.053.194L8.94 5.654l4.285 + -1.06q.086-.02.13-.02.205 0 .367.16z`)),s(e,t,n,"icon-flash",r,b.cloneNode(!1))};let w;n.video=function(e,t,n,r=1){return void 0===w&&(w=l.newPath(`M17 4.107v9.714q0 .38-.348.53-.116.05-.223.05-.25 0-.41-.17l-3.6-3.6v1.48q0 1.067-.757 1.82-.754.756 + -1.817.756H3.57q-1.06 0-1.816-.753Q1 13.17 1 12.106V5.82q0-1.06.754-1.816.755-.754 1.817-.754h6.29q1.07 0 + 1.82.754.76.755.76 1.817V7.3l3.597-3.59q.16-.17.4-.17.107 0 .22.045.35.153.35.528z`)),s(e,t,n,"icon-video",r,w.cloneNode(!1))};let C;n.audio=function(e,t,n,r=1){return void 0===C&&(C=l.newPath(`M8.385 3.756v10.46q0 .252-.183.434-.183.183-.433.183t-.44-.183l-3.2-3.202H1.61q-.25 + 0-.43-.183-.18-.182-.18-.432V7.14q0-.25.182-.432.182-.183.432-.183h2.52l3.202-3.202q.182-.183.432 + -.183t.43.183q.182.183.182.433zm3.692 5.23q0 .73-.41 1.36-.407.63-1.08.9-.097.048-.24.048-.25 0 + -.434-.178-.182-.177-.182-.437 0-.21.12-.35.12-.14.28-.24.16-.1.33-.22.166-.12.28-.34.117-.22.117 + -.55 0-.33-.115-.55-.115-.224-.28-.344-.163-.12-.326-.22-.165-.1-.28-.24-.116-.14-.116-.34 0-.26.183 + -.44t.43-.176q.146 0 .24.048.676.26 1.08.894.41.636.41 1.367zm2.46 0q0 1.472-.816 2.717t-2.16 1.813q + -.12.048-.24.048-.26 0-.44-.183-.18-.18-.18-.43 0-.37.378-.56.54-.28.73-.42.713-.52 1.11-1.302.4 + -.783.4-1.667 0-.886-.4-1.67-.4-.783-1.11-1.303-.192-.145-.73-.424-.376-.192-.376-.567 0-.25.183 + -.434.183-.18.433-.18.123 0 .25.047 1.344.567 2.16 1.812.82 1.244.82 2.716zm2.463 0q0 2.212 + -1.22 4.063-1.222 1.85-3.25 2.72-.126.05-.25.05-.25 0-.434-.19-.183-.183-.183-.433 0-.346.375 + -.568.068-.04.217-.1.15-.064.216-.1.45-.244.79-.494 1.19-.875 1.85-2.183.67-1.306.67-2.777 0 + -1.47-.663-2.78-.664-1.304-1.846-2.18-.346-.25-.79-.49-.065-.035-.214-.1-.15-.06-.22-.1 + -.375-.22-.375-.57 0-.25.183-.43.183-.182.433-.182.123 0 .25.047 2.027.876 3.25 2.727Q17 6.775 17 8.99Z`)),s(e,t,n,"icon-audio",r,C.cloneNode(!1))}},{"./svg":6}],4:[function(e,t,n){"use strict";function r(e,t){let n=0;if(e&&!(e.length<1))for(var r=e.length;ne===t)},n.findIndex=r,n.find=function(e,t){if(void 0!==(t=r(e,t)))return e[t]},n.resourceUrlFormatter=function(e,t){if(e.lengthe?n.authority.substr(0,e)+"..."+s[s.length-1].substr(-t):n.authority+"..."+s[s.length-1].substr(-t)},n.roundNumber=function(e,t=2){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)},n.isInStatusCodeRange=function(e,t,n){return t<=e&&e<=n};const s=/[^a-z-]/g;n.toCssClass=function(e){return e.toLowerCase().replace(s,"")},n.pluralize=function(e,t){return e+(1t(e)?e:void 0;if("string"!=typeof e)return n(e);e=parseInt(e,10);return isFinite(e)?n(e):void 0}n.parseAndFormat=function(e,t,n=function(e){{if(e.toString&&"function"==typeof e.toString)return e.toString();throw TypeError(`Can't convert type ${typeof e} to string`)}}){if(void 0!==e){e=t(e);if(void 0!==e)return n(e)}},n.parseNonEmpty=function(e){return 00<=e)},n.parsePositive=function(e){if(null!=e)return s(e,e=>0(local time: ${e.toLocaleString()})`:void 0};n.formatBytes=function(e){if(void 0===e)return"";var t=`${e} bytes`;return 1048576<=e?`${t} (~${(0,r.roundNumber)(e/1048576,1)} MB)`:1024<=e?`${t} (~${(0,r.roundNumber)(e/1024,0)} kB)`:t};const i={'"':""","&":"&","'":"'","<":"<",">":">"},o=new RegExp(Object.keys(i).join("|"),"g");n.escapeHtml=function(e=""){if(null==e)return"";if("string"!=typeof e){if("function"!=typeof e.toString)throw TypeError("Invalid parameter");e=e.toString()}return e.replace(o,e=>i[e])};const a=new RegExp("[^-A-Za-z0-9+&@#/%?=~_|!:,.;()]","g");n.sanitizeUrlForLink=function(e){const t=e.replace(a,"_");return 0===t.indexOf("http://")||0===t.indexOf("https://")?t:(console.warn("skipped link, due to potentially unsafe url",e),"")};const l=new RegExp("[^a-zA-Z0-9]","g");function c(e){return"number"==typeof e?e:"string"==typeof e?parseInt(e,10):void 0}n.sanitizeAlphaNumeric=function(e){return e.toString().replace(l,"")},n.toInt=c,n.validateOptions=function(n){var e=e=>{var t=c(n[e]);if(void 0===t)throw TypeError(`option "${e}" needs to be a number`);n[e]=t},t=e=>{n[e]=!!n[e]};return e("leftColumnWidth"),e("rowHeight"),e("selectedPage"),t("showAlignmentHelpers"),t("showIndicatorIcons"),t("showMimeTypeIcon"),n}},{"./misc":4}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getNodeTextWidth=n.newPath=n.newTextEl=n.newTitle=n.newLine=n.newRect=n.newA=n.newForeignObject=n.newClipPath=n.newG=n.newSvg=void 0;const o=e("./dom"),a="http://www.w3.org/2000/svg";function r(e,{attributes:t={},css:n={},text:r="",className:s=""}={}){const i=document.createElementNS(a,e);return s&&(0,o.addClass)(i,s),r&&(i.textContent=r),(0,o.safeSetStyles)(i,n),(0,o.safeSetAttributes)(i,t),i}function s(e,t,n={}){return r("svg",{className:e,attributes:t,css:n})}n.newSvg=s,n.newG=function(e,t={},n={}){return r("g",{className:e,attributes:t,css:n})},n.newClipPath=function(e){return r("clipPath",{attributes:{id:e}})},n.newForeignObject=function(e,t="",n={}){return r("foreignObject",{attributes:e,className:t,css:n})},n.newA=function(e){return r("a",{className:e})},n.newRect=function(e,t="",n={}){return r("rect",{attributes:e,className:t,css:n})},n.newLine=function(e,t=""){return r("line",{className:t,attributes:e})},n.newTitle=function(e){const t=document.createElementNS(a,"title");return t.setAttribute("text",e),t},n.newTextEl=function(e,t={},n={}){return r("text",{text:e,attributes:t,css:n})},n.newPath=function(e){const t=document.createElementNS(a,"path");return t.setAttribute("d",e),t};const l=(()=>{let n,r;return()=>{var e,t;return void 0===n&&(e={className:"water-fall-chart temp",width:"9999px"},t={left:"0px",position:"absolute",top:"0px",visibility:"hidden","z-index":"99999"},n=s("water-fall-chart temp",e,t)),void 0===n.parentElement&&window.document.body.appendChild(n),clearTimeout(r),r=setTimeout(()=>{n.parentNode.removeChild(n)},500),n}})();n.getNodeTextWidth=function(e,t=!1){if(0===(e.textContent||"").length)return 0;const n=l();let r,s;t?(s=e.style.textShadow,r=e):(r=e.cloneNode(!0),r.setAttribute("x","0"),r.setAttribute("y","0")),r.style.textShadow="0",n.appendChild(r),window.document.body.appendChild(n);var i=r.getComputedTextLength();return t&&void 0!==s&&(e.style.textShadow=s),i}},{"./dom":1}],7:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeLegend=void 0,n.makeLegend=function(){const e=document.createElement("ul");return e.className="resource-legend",e.innerHTML=` +
    • Blocked
    • +
    • DNS
    • +
    • Connect
    • +
    • SSL (TLS)
    • +
    • Send
    • +
    • Wait
    • +
    • Receive
    • `,e}},{}],8:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.fromHar=n.makeLegend=void 0;const i=e("./helpers/parse"),o=e("./legend/legend"),a=e("./paging/paging"),r=e("./transformers/har"),l=e("./waterfall/svg-chart"),c={leftColumnWidth:25,legendHolder:void 0,onParsed:void 0,pageSelector:void 0,rowHeight:23,selectedPage:0,showAlignmentHelpers:!0,showIndicatorIcons:!0,showMimeTypeIcon:!0},s={showUserTiming:!1,showUserTimingEndMarker:!1};n.makeLegend=function(){return(0,o.makeLegend)()},n.fromHar=function(e,t={}){var n={...s,...t},n=r.transformDoc(e,n);return"function"==typeof t.onParsed&&t.onParsed(n),function(e,t={}){void 0!==t.leftColumnWith&&(console.warn("Depreciation Warning: The option 'leftColumnWith' has been fixed to 'leftColumnWidth', please update your code as this will get deprecated in the future"),t.leftColumnWidth=t.leftColumnWith);const r=(0,i.validateOptions)({...c,...t}),n=new a.default(e,r.selectedPage);let s=(0,l.createWaterfallSvg)(n.getSelectedPage(),r);return n.onPageUpdate((e,t)=>{const n=s.parentElement;t=(0,l.createWaterfallSvg)(t,r);n.replaceChild(t,s),s=t}),r.pageSelector&&n.initPagingSelectBox(r.pageSelector),r.legendHolder&&(r.legendHolder.innerHTML="",r.legendHolder.appendChild((0,o.makeLegend)())),s}(n,t)}},{"./helpers/parse":5,"./legend/legend":7,"./paging/paging":9,"./transformers/har":13,"./waterfall/svg-chart":27}],9:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const r=e("../helpers/dom");n.default=class{constructor(e,t=0){this.doc=e,this.selectedPageIndex=t,this.onPageUpdateCbs=[],t>=this.doc.pages.length&&(this.selectedPageIndex=this.doc.pages.length-1)}getPageCount(){return this.doc.pages.length}getSelectedPage(){return this.doc.pages[this.selectedPageIndex]}getSelectedPageIndex(){return this.selectedPageIndex}setSelectedPageIndex(e){if(this.selectedPageIndex!==e){if(e<0||e>=this.getPageCount())throw new Error("Page does not exist - Invalid pageIndex selected");this.selectedPageIndex=e;const t=this.doc.pages[this.selectedPageIndex];this.onPageUpdateCbs.forEach(e=>{e(this.selectedPageIndex,t)})}}onPageUpdate(e){if(1{t=new Option(e.title,t.toString(),!1,t===this.selectedPageIndex);n.add(t)}),n.style.display="block",n.addEventListener("change",e=>{e=parseInt(e.target.value,10);t.setSelectedPageIndex(e)}))}}},{"../helpers/dom":1}],10:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getKeys=void 0;const c=e("../helpers/har"),d=e("../helpers/parse"),u=e("./helpers"),p=(e,t)=>[e,(0,d.parseAndFormat)(t,d.parsePositive,d.formatBytes)],h=(e,t)=>[e,(0,d.parseAndFormat)(t,d.parsePositive)],m=e=>1[e.name,e.value];return{general:(o=e,a=n,[["Request Number",`#${t}`],["Started",new Date(o.startedDateTime).toLocaleString()+(0"yes")],["Initiator (Loaded by)",o._initiator],["Initiator Line",o._initiator_line],["Initiator Type",o._initiator_type],["Host",(0,c.getHeader)(o.request.headers,"Host")],["IP",o._ip_addr],["Client Port",(0,d.parseAndFormat)(o._client_port,d.parsePositive)],["Expires",o._expires],["Cache Time",(0,d.parseAndFormat)(o._cache_time,d.parsePositive,d.formatSeconds)],["CDN Provider",o._cdn_provider],["Render blocking",o._renderBlocking],["Is Largest Contentful Paint",o._isLCP?"yes":void 0],p("ObjectSize",o._objectSize),p("Bytes In (downloaded)",o._bytesIn),p("Bytes Out (uploaded)",o._bytesOut),p("JPEG Scan Count",o._jpeg_scan_count),p("Gzip Total",o._gzip_total),p("Gzip Save",o._gzip_save),p("Minify Total",o._minify_total),p("Minify Save",o._minify_save),p("Image Total",o._image_total),p("Image Save",o._image_save)].filter(m)),request:function(e){const t=e.request;var n=e=>(0,c.getHeaders)(t.headers,e);return(0,u.flattenKvTuple)([["Method",t.method],["HTTP Version",t.httpVersion],p("Bytes Out (uploaded)",e._bytesOut),p("Headers Size",t.headersSize),p("Body Size",t.bodySize),["Comment",(0,d.parseAndFormat)(t.comment,d.parseNonEmpty)],n("User-Agent"),n("Host"),n("Connection"),n("Accept"),n("Accept-Encoding"),n("Expect"),n("Forwarded"),n("If-Modified-Since"),n("If-Range"),n("If-Unmodified-Since"),h("Querystring parameters count",t.queryString.length),h("Cookies count",t.cookies.length)]).filter(m)}(e),requestHeaders:s.map(l).filter(m),response:function(e){var t=e.response;const n=t.content,r=t.headers;var s=(e,t=e)=>(0,c.getHeaders)(r,t),i=e=>{var t=(0,c.getHeader)(r,e);return[e,(0,d.parseAndFormat)(t,d.parseDate,d.formatDateLocalized)]},o=(0,c.getHeader)(r,"Content-Length");let a;n.size&&-1!==n.size&&o!==n.size.toString()&&(a=n.size);let l=(0,c.getHeader)(r,"Content-Type");return e._contentType&&e._contentType!==l&&(l=l+" | "+e._contentType),(0,u.flattenKvTuple)([["Status",t.status+" "+t.statusText],["HTTP Version",t.httpVersion],p("Bytes In (downloaded)",e._bytesIn),p("Headers Size",t.headersSize),p("Body Size",t.bodySize),["Content-Type",l],s("Cache-Control"),s("Content-Encoding"),i("Expires"),i("Last-Modified"),s("Pragma"),p("Content-Length",o),p("Content Size",a),p("Content Compression",n.compression),s("Connection"),s("ETag"),s("Accept-Patch"),["Age",(0,d.parseAndFormat)((0,c.getHeader)(r,"Age"),d.parseNonNegative,d.formatSeconds)],s("Allow"),s("Content-Disposition"),s("Location"),s("Strict-Transport-Security"),s("Trailer (for chunked transfer coding)","Trailer"),s("Transfer-Encoding"),s("Upgrade"),s("Vary"),s("Timing-Allow-Origin"),["Redirect URL",(0,d.parseAndFormat)(t.redirectURL,d.parseNonEmpty)],["Comment",(0,d.parseAndFormat)(t.comment,d.parseNonEmpty)]]).filter(m)}(e),responseHeaders:i.map(l).filter(m),timings:function(e,t,n){var r=e.timings,t="number"!=typeof t||"number"!=typeof n?void 0:n-t;let s=(e=e=>(0,d.parseAndFormat)(e,d.parseNonNegative,d.formatMilliseconds))(r.connect);return r.ssl&&0!e.response.redirectURL)[0];return void 0===t?0General\n
      ${n}
      `;let s="";e=t.filter(e=>"error"===e.type).map(e=>[e.title,e.description]),n=t.filter(e=>"warning"===e.type).map(e=>[e.title,e.description]),t=t.filter(e=>"error"!==e.type&&"warning"!==e.type).map(e=>[e.title,e.description]);0${(0,c.pluralize)("Error",e.length)} +
      ${(0,p.makeDefinitionList)(e)}
      `);0${(0,c.pluralize)("Warning",n.length)} +
      ${(0,p.makeDefinitionList)(n)}
      `);0Info +
      ${(0,p.makeDefinitionList)(t)}
      `);return f("General",s+r)}(s.general,i)),o.push(function(e,t){t=`
      + ${(0,p.makeDefinitionList)(e)} +
      +

      All Request Headers

      +
      + ${(0,p.makeDefinitionList)(t)} +
      `;return f("Request",t)}(s.request,s.requestHeaders)),o.push(function(e,t){t=`
      + ${(0,p.makeDefinitionList)(e)} +
      +

      All Response Headers

      +
      + ${(0,p.makeDefinitionList)(t)} +
      `;return f("Response",t)}(s.response,s.responseHeaders)),o.push(f("Timings",(0,p.makeDefinitionList)(s.timings,!0))),o.push((a=e,v("Raw Data",()=>` + +
      ${(0,d.escapeHtml)(JSON.stringify(a,null,2))}
      + `,"raw-data rendered-data"))),"image"===n&&o.push((l=e,v("Preview",e=>``))),e.response.content&&e.response.content.mimeType&&0===e.response.content.mimeType.indexOf("text/")&&e.response.content.text&&o.push(function(e){const t=e.response.content.text||"",n=t.replace(h,"\n").replace(g,"\t"),r=t.match(m),s=r?r.length:1;return v(`Content (${s} Line${1` + +
      ${(0,d.escapeHtml)(n)}
      + `,"content rendered-data")}(e)),o.filter(e=>void 0!==e)}},{"../helpers/misc":4,"../helpers/parse":5,"./extract-details-keys":10,"./helpers":14}],13:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.transformPage=n.transformDoc=void 0;const i=e("../helpers/misc"),d=e("../helpers/parse"),u=e("./har-heuristics"),p=e("./har-tabs"),h=e("./helpers");n.transformDoc=function(e,n){const r=void 0!==e.log?e.log:e,t=m(r);return{pages:t.map((e,t)=>s(r,t,n))}};const m=e=>{return e.pages&&0{var n=Date.parse(t.startedDateTime);return Date.parse(e)0!==e.request.url.indexOf("data:")&&0!==e.request.url.indexOf("javascript:")&&(1===s.length&&""===i.id||e.pageref===i.id)).map((e,t)=>{var n=new Date(e.startedDateTime).getTime()-o;return isNaN(n)?console.warn("Entry has no valid 'startedDateTime' time",e.request.url,e):a=Math.max(a,n+e.time),function(e,t,n,r){n=Math.round(n);var s=Math.round((0,d.toInt)(e._all_end)||n+e.time),i=(0,h.mimeToRequestType)(e.response.content.mimeType),o=(0,u.collectIndicators)(e,t,r,i),r=y(e,o);return(0,h.createWaterfallEntry)(e.request.url,n,s,f(n,e),r,(0,p.makeTabs)(e,t+1,i,n,s,o))}(e,t,n,l)});const c=g(e,i,n);return c.forEach(e=>{e.startTime>a&&(a=e.startTime)}),n.fixedLengthMs&&(a=n.fixedLengthMs),a+=100,{docIsTLS:l,durationMs:a,entries:t,marks:c,title:i.title}}n.transformPage=s;const g=(t,e,n)=>{if(void 0===t)return[];var r=(e,t)=>e.startTime-t.startTime;const s=Object.keys(t).filter(e=>"number"==typeof t[e]&&0<=t[e]).map(e=>({name:`${(0,d.escapeHtml)(e.replace(/^[_]/,""))} (${(0,i.roundNumber)(t[e],0)} ms)`,startTime:t[e]}));return(n.showUserTiming?o(e,n).concat(s):s).sort(r)},o=(s,i)=>{const t=i.showUserTimingEndMarker?e=>0===e.indexOf("_userTime."):e=>0===e.indexOf("_userTime.")&&0!==e.indexOf("_userTime.endTimer-");let e=t;if(Array.isArray(i.showUserTiming)){const n=i.showUserTiming;e=e=>t(e)&&0<=n.indexOf(e.replace(/^_userTime\./,""))}const o=/^_userTime\.((?:startTimer-)?(.+))$/;return Object.keys(s).filter(e).map(e=>{var t,n,r;return[,n,t]=o.exec(e)||[,void 0,void 0],(n=(0,d.escapeHtml)(n))!==(t=(0,d.escapeHtml)(t))&&s[`_userTime.endTimer-${t}`]?{duration:r=s[`_userTime.endTimer-${t}`]-s[e],name:`${i.showUserTimingEndMarker?n:t} (${s[e]} - ${s[e]+r} ms)`,startTime:s[e]}:{name:n,startTime:s[e]}})},f=(o,a)=>{const l=a.timings,c=a._chunks||[];return["blocked","dns","connect","send","wait","receive"].reduce((e,t)=>{var n=v(t,a,e,o);if(n.end&&n.start>=n.end)return e;if("connect"===t&&l.ssl&&-1!==l.ssl){var r=parseInt(`${a._ssl_start}`,10)||n.start,s=parseInt(`${a._ssl_end}`,10)||n.start+l.ssl,i=parseInt(`${a._ssl_start}`,10)?n.start:s;return e.concat([(0,h.createWaterfallEntryTiming)("ssl",Math.round(r),Math.round(s))]).concat([(0,h.createWaterfallEntryTiming)(t,Math.round(i),Math.round(n.end))])}return"receive"===t&&c&&0{let s;switch(e){case"wait":s="ttfb";break;case"receive":s="download";break;default:s=e}var i=parseInt(`${t[`_${s}_start`]}`,10),o=parseInt(`${t[`_${s}_end`]}`,10),i=isNaN(i)?0{var n=(0,h.mimeToRequestType)(e.response.content.mimeType),r=(0,d.toInt)(e.response.status)||0,s=e._renderBlocking||"",i=e._isLCP||!1;return{icon:(0,h.makeMimeTypeIcon)(r,e.response.statusText,n,e.response.redirectURL),indicators:t,requestType:n,rowClass:(0,h.makeRowCssClasses)(r,s,i),statusCode:r}}},{"../helpers/misc":4,"../helpers/parse":5,"./har-heuristics":11,"./har-tabs":12,"./helpers":14}],14:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.flattenKvTuple=n.makeMimeTypeIcon=n.makeRowCssClasses=n.createWaterfallEntryTiming=n.createWaterfallEntry=n.mimeToRequestType=n.makeDefinitionList=void 0;const s=e("../helpers/misc"),i=e("../helpers/parse"),o=e("../waterfall/row/svg-indicators"),r=e=>(0,i.escapeHtml)(e).replace("<br/>","
      ");n.makeDefinitionList=function(e,t=!1){return e.map(e=>` +
      {return t?`class="${(0,s.toCssClass)(e)||"no-colour"}"`:""})(e[0])}>${r(e[0])}
      +
      ${r(e[1])}
      + `).join("")},n.mimeToRequestType=function(e){if(void 0===e)return"other";let t=(e=e.split("/"))[1];switch(void 0!==t&&(t=-1{const t=[];return e.forEach(e=>{void 0!==e&&0!==e.length&&(Array.isArray(e[0])?t.push(...e):t.push(e))}),t}},{"../helpers/misc":4,"../helpers/parse":5,"../waterfall/row/svg-indicators":20}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.timingTypeToCssClass=n.requestTypeToCssClass=void 0,n.requestTypeToCssClass=function(e){return"block-"+e},n.timingTypeToCssClass=function(e){return"block-"+e}},{}],16:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createDetailsBody=void 0;const a=e("../../helpers/dom"),l=e("../../helpers/parse");n.createDetailsBody=function(e,r,t){const n=(0,a.makeHtmlEl)(),s=(0,a.makeBodyEl)();var i=t.tabs.map(e=>`
    • `).join("\n"),o=t.tabs.map(e=>{let t="tab";e.tabClass&&(t+=` ${e.tabClass}`);let n="";if(e.content)n=e.content;else{if("function"!=typeof e.renderContent)throw TypeError("Invalid Details Tab");n=e.renderContent(r),e.content=n}return`
      ${n}
      `}).join("\n");return s.innerHTML=` +
      +
      +

      #${e} + ${(0,l.escapeHtml)(t.url)} +

      + +
      + ${o} +
      + `,n.appendChild(s),n}},{"../../helpers/dom":1,"../../helpers/parse":5}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.OverlayManager=void 0;const p=e("../../helpers/dom"),h=e("../../helpers/misc"),m=e("./svg-details-overlay");class g{constructor(e){this.context=e,this.openOverlays=[],this.realignRow=(e,t)=>{e.setAttribute("transform",`translate(0, ${t})`)}}getCombinedOverlayHeight(){return this.openOverlays.reduce((e,t)=>e+(t.height||0),0)}openOverlay(t,e,n,r,s){if(!this.openOverlays.some(e=>e.index===t)){const i=this;this.openOverlays.push({defaultY:e,entry:r,index:t,onClose:()=>{i.closeOverlay(t,n,s)},openTabIndex:0}),this.openOverlays=this.openOverlays.sort((e,t)=>e.index>t.index?1:-1),this.renderOverlays(n,s),this.context.pubSub.publishToOverlayChanges({changedIndex:t,combinedOverlayHeight:i.getCombinedOverlayHeight(),type:"open"})}}toggleOverlay(t,e,n,r,s){this.openOverlays.some(e=>e.index===t)?this.closeOverlay(t,n,s):this.openOverlay(t,e,n,r,s)}closeOverlay(r,e,t){this.openOverlays.splice(this.openOverlays.reduce((e,t,n)=>t.index===r?n:e,-1),1),this.renderOverlays(e,t),this.context.pubSub.publishToOverlayChanges({changedIndex:r,combinedOverlayHeight:this.getCombinedOverlayHeight(),type:"closed"})}renderOverlays(c,e){let d=0;const u=(e,t,n)=>{d+=n,e.actualY=t,e.height=n};e.forEach((e,t)=>{const n=(0,h.find)(this.openOverlays,e=>e.index===t),r=e.nextElementSibling,s=r.firstElementChild;if(this.realignRow(e,d),void 0!==n){if(s&&void 0!==n.actualY){const i=s.querySelector(".info-overlay-bg"),o=s.querySelector("foreignObject"),a=s.querySelector(".info-overlay-close-btn rect"),l=s.querySelector(".info-overlay-close-btn text");return u(n,n.defaultY+d,n.height),i.setAttribute("y",n.actualY.toString()),o.setAttribute("y",n.actualY.toString()),l.setAttribute("y",n.actualY.toString()),void a.setAttribute("y",n.actualY.toString())}((e,t)=>{var n=t.defaultY+d;const r=(0,m.createRowInfoOverlay)(t,n,c),s=r.querySelector("img.preview");s&&!s.src&&s.setAttribute("src",(s.attributes.getNamedItem("data-src")||{value:""}).value),r.querySelector("a").addEventListener("keydown",g.firstElKeypress),(0,p.getLastItemOfNodeList)(r.querySelectorAll("button")).addEventListener("keydown",g.lastElKeypress),e.appendChild(r),u(t,n,r.getBoundingClientRect().height)})(e.nextElementSibling,n)}else s&&null!==r&&(r.querySelector("a").removeEventListener("keydown",g.firstElKeypress),(0,p.getLastItemOfNodeList)(r.querySelectorAll("button")).removeEventListener("keydown",g.lastElKeypress),(0,p.removeChildren)(r))})}}(n.OverlayManager=g).showFullName=e=>{e.getElementsByClassName("row-fixed").item(0)?.dispatchEvent(new MouseEvent("mouseenter"))},g.firstElKeypress=e=>{!(0,h.isTabUp)(e)||(e=(0,p.getParentByClassName)(e.target,"row-overlay-holder"))&&e.previousElementSibling&&g.showFullName(e.previousElementSibling)},g.lastElKeypress=e=>{!(0,h.isTabDown)(e)||(e=(0,p.getParentByClassName)(e.target,"row-overlay-holder"))&&e.nextElementSibling&&g.showFullName(e.nextElementSibling)},n.default=g},{"../../helpers/dom":1,"../../helpers/misc":4,"./svg-details-overlay":19}],18:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PubSub=void 0;class r{constructor(){this.subscribers=[]}subscribeToOverlayChanges(e){this.subscribers.push(e)}subscribeToSpecificOverlayChanges(t,n){this.subscribers.push(e=>{e.changedIndex===t&&n(e)})}publishToOverlayChanges(t){this.subscribers.forEach(e=>e(t))}}n.PubSub=r,n.default=r},{}],19:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createRowInfoOverlay=void 0;const d=e("../../helpers/dom"),u=e("../../helpers/svg"),p=e("./html-details-body");const h=e=>{const t=e.target;if("button"===t.tagName.toLowerCase()&&t.classList.contains("copy-tab-data")){const n=document.createElement("textarea");n.value=t.nextElementSibling?t.nextElementSibling.innerText:"",document.body.appendChild(n),n.select(),n.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(n)}};n.createRowInfoOverlay=function(e,t,n){var r=e.index+1;const s=function(e,t){const n=u.newG("info-overlay-holder");return e=u.newRect({height:t,rx:2,ry:2,width:"100%",x:"0",y:e},"info-overlay-bg"),n.appendChild(e),n}(t,n),i=u.newForeignObject({height:n,width:"100%",x:"0",y:t}),o=(0,p.createDetailsBody)(r,n,e.entry),a=function(e){const t=u.newA("info-overlay-close-btn");return t.appendChild(u.newRect({height:23,width:23,x:"100%",y:e})),t.appendChild(u.newTextEl("✕",{dx:7,dy:16,x:"100%",y:e})),t.appendChild(u.newTitle("Close Overlay")),t}(t);a.addEventListener("click",()=>{e.onClose(e.index),o.removeEventListener("click",h)}),o.addEventListener("click",h);const l=()=>o.getElementsByClassName("tab-button"),c=n=>{e.openTabIndex=n,(0,d.forEachNodeList)(o.getElementsByClassName("tab"),(e,t)=>{e.style.display=n===t?"block":"none",l().item(t).classList.toggle("active",n===t)})};return(0,d.forEachNodeList)(l(),(e,t)=>{e.addEventListener("click",()=>c(t))}),c(e.openTabIndex),i.appendChild(o),s.appendChild(i),s.appendChild(a),s}},{"../../helpers/dom":1,"../../helpers/svg":6,"./html-details-body":16}],20:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getIndicatorIcons=n.makeIcon=void 0;const a=e("../../helpers/misc");function l(e,t){return{type:e,title:t,width:20}}n.makeIcon=l,n.getIndicatorIcons=function(e){const t=e.responseDetails.indicators.filter(e=>"icon"===e.displayType);if(0===t.length)return[];const n=[];let r="";const s=t.filter(e=>"error"===e.type),i=t.filter(e=>"warning"===e.type),o=t.filter(e=>"error"!==e.type&&"warning"!==e.type);return 0e.title).join("\n")),r="error"),0e.title).join("\n")),r=r||"warning"),0e.title).join("\n")}`),r=r||1!==o.length?r||"info":o[0].icon||o[0].type),[l(r,n.join("\n"))]}},{"../../helpers/misc":4}],21:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createRowBg=n.createNameRowBg=n.createBgStripe=n.appendRequestLabels=n.createRequestLabelFull=n.createRequestLabelClipped=n.createRequestNumberLabel=n.createRect=void 0;const o=e("../../helpers/dom"),c=e("../../helpers/misc"),d=e("../../helpers/svg"),u=e("../../transformers/styling-converters"),a=e("./svg-tooltip");function p(n,e){const t=d.newG("");var r=n.height-1,s=c.roundNumber(n.x/n.unit)+"%";const i=d.newRect({height:r,width:c.roundNumber(n.width/n.unit)+"%",x:s,y:n.y},e);if(t.appendChild(i),n.label){let e,t;i.addEventListener("mouseenter",()=>{t=t||(0,o.getParentByClassName)(i,"water-fall-chart").querySelector(".tooltip"),e=setTimeout(()=>{(e=null,a.onHoverInShowTooltip)(i,n,t)},100)}),i.addEventListener("mouseleave",()=>{e?clearTimeout(e):(0,a.onHoverOutShowTooltip)(i)})}return n.showOverlay&&n.hideOverlay&&(i.addEventListener("mouseenter",n.showOverlay(n)),i.addEventListener("mouseleave",n.hideOverlay(n))),t}function i(e,t,n,r){var s=c.resourceUrlFormatter(n,125);t=t+Math.round(r/2)+5;const i=d.newTextEl(s,{x:e,y:t});return i.appendChild(d.newTitle(n)),i.style.opacity=n.match(/js.map$/)?"0.5":"1",i}n.createRect=function(o,e){const t=e.segments;var n=p(o,`time-block ${o.cssClass}`);const a=d.newG("rect-holder");let l=o.x;return a.appendChild(n),t&&0{if(!isNaN(e.total)&&0total: ${Math.round(t.total)}ms`,{cssClass:(0,u.timingTypeToCssClass)(t.type),height:n.height-6,hideOverlay:n.hideOverlay,label:`${t.type}
      `+`${Math.round(t.start)}ms - ${Math.round(t.end)}ms${r}`,showOverlay:n.showOverlay,unit:n.unit,width:t.total,x:t.start||.001,y:n.y}),i=p(s,`segment ${s.cssClass}`);l=Math.min(l,s.x),"receive"===e.type&&e.chunks&&0{e=function(e,t,n){const r=d.newG("");var s=t.height-1,e=c.roundNumber(e.ts/t.unit)+"%",n=d.newRect({height:s,width:"1px",x:e,y:t.y},n,{pointerEvents:"none"});return r.appendChild(n),r}(e,s,`${s.cssClass}-chunk`);i.appendChild(e)}),a.appendChild(i)}var t,n,r}),c.find(e.responseDetails.indicators,e=>"push"===e.id)&&a.appendChild(function(e){var t=e.y+e.height/1.5,e=`${c.roundNumber(e.x/e.unit)}%`;const n=d.newG("http2-inidicator-holder");return n.appendChild(d.newTextEl("→",{transform:"translate(-5)",x:e,y:t},{fillOpacity:"0.6","text-anchor":"end"})),n.appendChild(d.newTitle("http2 Push")),n}(o)),a.appendChild(function(e,t,n){var r=e.y+e.height/1.5,s=`${Math.round(t)} ms`,t=(e.x+e.width)/e.unit+1;let i=d.newTextEl(s,{x:`${c.roundNumber(t)}%`,y:r});return 100{r.style.display="block",n.style.display="none",r.style.visibility="visible";var e=()=>{const e=i.getComputedTextLength()+10;s.setAttribute("width",e.toString()),o=!0,a=void 0};o||(l?a=window.requestAnimationFrame(e):e())}),e.addEventListener("mouseleave",()=>{n.style.display="block",r.style.display="none",r.style.visibility="hidden",l&&void 0!==a&&cancelAnimationFrame(a)})},n.createBgStripe=function(e,t,n){return n=n?"even":"odd",d.newRect({height:t,width:"100%",x:0,y:e},n)},n.createNameRowBg=function(e,t){const n=d.newG("row row-fixed");return n.appendChild(d.newRect({height:t,width:"100%",x:"0",y:e},"",{opacity:0})),n},n.createRowBg=function(e,t){const n=d.newG("row row-flex");return n.appendChild(d.newRect({height:t,width:"100%",x:"0",y:e},"",{opacity:0})),n}},{"../../helpers/dom":1,"../../helpers/misc":4,"../../helpers/svg":6,"../../transformers/styling-converters":15,"./svg-tooltip":23}],22:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createRow=void 0;const b=e("../../helpers/icons"),w=e("../../helpers/misc"),C=e("../../helpers/svg"),x=e("./svg-indicators"),T=e("./svg-row-subcomponents"),q=C.newClipPath("titleClipPath");q.appendChild(C.newRect({height:"100%",width:"100%"}));const S=C.newClipPath("titleFullClipPath");S.appendChild(C.newRect({height:"100%",width:"100%"}));n.createRow=function(e,n,t,r,s,i,o){const a=s.y;var l=s.height,c=e.options.leftColumnWidth;const d=C.newA(i.responseDetails.rowClass||"");d.setAttribute("tabindex","0"),d.setAttribute("xlink:href","javascript:void(0)");const u=C.newSvg("left-fixed-holder",{width:`${c}%`,x:"0"}),p=C.newSvg("flex-scale-waterfall",{width:`${100-c}%`,x:`${c}%`});var h=T.createRect(s,i);const m=T.createNameRowBg(a,l),g=T.createRowBg(a,l);c=T.createBgStripe(a,l,n%2==0);let f=3+t;e.options.showMimeTypeIcon&&(s=i.responseDetails.icon,f-=s.width,m.appendChild(b[s.type](f,a+3,s.title))),e.options.showIndicatorIcons&&(0,x.getIndicatorIcons)(i).forEach(e=>{f-=e.width,m.appendChild(b[e.type](f,a+3,e.title))}),f=3+t,t=`${n+1}`,t=T.createRequestNumberLabel(f,a,t,l,r),f+=r+4,r=T.createRequestLabelClipped(f,a,(0,w.resourceUrlFormatter)(i.url,40),l),l=T.createRequestLabelFull(f,a,i.url,l),g.appendChild(h),T.appendRequestLabels(m,t,r,l),e.pubSub.subscribeToSpecificOverlayChanges(n,e=>{v="open"===e.type}),0{y="open"===e.type});let v,y;return d.addEventListener("click",e=>{e.preventDefault(),o(e)}),d.addEventListener("keydown",e=>{const t=e;if(32===t.which||13===t.which)return t.preventDefault(),o(t);(0,w.isTabUp)(t)&&!y&&0{m.dispatchEvent(new MouseEvent("mouseleave"))}),p.appendChild(g),u.appendChild(q.cloneNode(!0)),u.appendChild(m),d.appendChild(S.cloneNode(!0)),d.appendChild(c),d.appendChild(p),d.appendChild(u),d}},{"../../helpers/icons":3,"../../helpers/misc":4,"../../helpers/svg":6,"./svg-indicators":20,"./svg-row-subcomponents":21}],23:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeTooltip=n.onHoverOutShowTooltip=n.onHoverInShowTooltip=void 0;const p=e("../../helpers/dom"),s=e("../../helpers/svg"),h=/(?:translate)\(.+[, ]+(.+)\)/;n.onHoverInShowTooltip=(e,t,n)=>{const r=n.querySelector(".tooltip-payload"),s=(0,p.getParentByClassName)(e,"row-item");var i=((e="")=>{e=null===e?"":e;e=h.exec(e);return e&&2<=e.length?parseInt(e[1],10):0})(s.getAttribute("transform")),o=parseInt(e.getAttribute("y")||"",10),a=e.getAttribute("x")||"",l=parseFloat(a);let c=50;var d=e.width.baseVal.value||e.getBoundingClientRect().width,e=d/(t.width/t.unit),d=t.width/t.unit/d,e=50{const t=(0,p.getParentByClassName)(e,"water-fall-chart"),n=t.querySelector(".tooltip"),r=n.querySelector(".tooltip-payload");n.style.display="none",n.setAttribute("height","250"),r.style.opacity="0"};n.makeTooltip=e=>{e=e.leftColumnWidth;const t=s.newSvg("tooltip-holder",{width:"100%",x:"0",y:"0"}),n=s.newForeignObject({width:"100%",x:"0",y:`${e}%`},"tooltip",{display:"none"}),r=(0,p.makeHtmlEl)();e=(0,p.makeBodyEl)({left:`${e}%`,width:`${100-e}%`},'
      ');return r.appendChild(e),n.appendChild(r),t.appendChild(n),t}},{"../../helpers/dom":1,"../../helpers/svg":6}],24:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeHoverEvtListeners=n.createAlignmentLines=void 0;const r=e("../../helpers/dom"),s=e("../../helpers/svg");n.createAlignmentLines=function(e){return{endline:s.newLine({x1:"0",x2:"0",y1:"0",y2:e},"line-end"),startline:s.newLine({x1:"0",x2:"0",y1:"0",y2:e},"line-start")}},n.makeHoverEvtListeners=function(n){return{onMouseEnterPartial(){return e=>{var t=e.target;(0,r.addClass)(t,"active");e=t.x.baseVal.valueInSpecifiedUnits+t.width.baseVal.valueInSpecifiedUnits+"%",t=t.x.baseVal.valueInSpecifiedUnits+"%";n.endline.x1.baseVal.valueAsString=e,n.endline.x2.baseVal.valueAsString=e,n.startline.x1.baseVal.valueAsString=t,n.startline.x2.baseVal.valueAsString=t,(0,r.addClass)(n.endline,"active"),(0,r.addClass)(n.startline,"active")}},onMouseLeavePartial(){return e=>{e=e.target;(0,r.removeClass)(e,"active"),(0,r.removeClass)(n.endline,"active"),(0,r.removeClass)(n.startline,"active")}}}}},{"../../helpers/dom":1,"../../helpers/svg":6}],25:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createTimeScale=void 0;const p=e("../../helpers/misc"),h=e("../../helpers/svg");n.createTimeScale=function(t,e){var n=h.newG("time-scale full-width"),r=e<2e4?200*Math.ceil(e/1e4):1e3,s=Number(1000n/BigInt(r)),i=e/1e3,o=Math.floor(e/r);for(let e=0;e<=o;e++){var a=e%s==0;((e,t,n,r,s)=>{const i=e.diagramHeight;var o=100/n;let a,l="sub-second-line",c;if(s){n=n-.2{var t=e.combinedOverlayHeight,e=(i+t)/i;d.setAttribute("transform",`scale(1, ${e})`),s&&a.setAttribute("transform",`translate(0, ${t})`)}),t.appendChild(d),s&&t.appendChild(a)})(t,n,i,e/s,a)}return n}},{"../../helpers/misc":4,"../../helpers/svg":6}],26:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createLineRect=n.createMarks=void 0;const y=e("../../helpers/dom"),b=e("../../helpers/misc"),w=e("../../helpers/svg");function C(e,t){const n=w.newG(`line-mark-holder line-marker-${(0,b.toCssClass)(t.name)}`);return n.appendChild(w.newTitle(t.name.replace(/^startTimer-/,""))),n.appendChild(w.newRect({height:e.diagramHeight,width:(t.duration||1)/e.unit+"%",x:(t.startTime||.001)/e.unit+"%",y:0},"line-mark")),n}n.createMarks=function(m,g){const f=m.diagramHeight,v=w.newG("marker-holder",{transform:"scale(1, 1)"});return g.forEach((e,t)=>{var n=(0,b.roundNumber)(e.startTime/m.unit);const r=w.newG("mark-holder type-"+e.name.toLowerCase().replace(/([0-9]+[ ]?ms)|\W/g,"")),s=w.newG("line-holder"),i=w.newG("line-label-holder"),o=w.newTextEl(e.name,{x:`${n}%`,y:f+25});o.setAttribute("writing-mode","tb");let a;e.x=n;const l=w.newLine({x1:n+"%",x2:n+"%",y1:0,y2:f});var c=g[t-1],d=g[t+1],t=void 0!==c?.x&&e.x-c.x<2.5,d=(0,b.roundNumber)((d?.startTime||0)/m.unit);d&&d-e.x<2.5&&100<=d+2.5&&!t?(o.setAttribute("x",`${d-2.5}%`),e.x=d-2.5):void 0!==c?.x&&t&&(o.setAttribute("x",`${c.x+2.5}%`),e.x=c.x+2.5);const u=w.newLine({x1:n+"%",x2:e.x+"%",y1:f,y2:f+23});s.appendChild(l),s.appendChild(u),e.duration&&(a=C(m,e),s.appendChild(a)),m.pubSub.subscribeToOverlayChanges(e=>{var t=e.combinedOverlayHeight,e=(f+t)/f;l.setAttribute("transform",`scale(1, ${e})`),i.setAttribute("transform",`translate(0, ${t})`),u.setAttribute("transform",`translate(0, ${t})`),a&&a.setAttribute("transform",`translate(0, ${t})`)});let p=!1,h=!1;o.addEventListener("mouseenter",()=>{p||(r.parentNode.appendChild(r),p=!0,"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(()=>(0,y.addClass)(s,"active")):(0,y.addClass)(s,"active"))}),o.addEventListener("mouseleave",()=>{p=!1,h||(0,y.removeClass)(s,"active")}),o.addEventListener("click",()=>{h?(p=!1,y.removeClass)(s,"active"):p?p=!1:(0,y.addClass)(s,"active"),h=!h}),i.appendChild(o),r.appendChild(w.newTitle(e.name)),r.appendChild(s),r.appendChild(i),v.appendChild(r)}),v},n.createLineRect=C},{"../../helpers/dom":1,"../../helpers/misc":4,"../../helpers/svg":6}],27:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createWaterfallSvg=void 0;const y=e("../helpers/svg"),b=e("../transformers/styling-converters"),w=e("./details-overlay/overlay-manager"),C=e("./details-overlay/pub-sub"),x=e("./row/svg-row"),T=e("./row/svg-tooltip"),q=e("./sub-components/svg-alignment-helper"),S=e("./sub-components/svg-general-components"),E=e("./sub-components/svg-marks");n.createWaterfallSvg=function(e,i){const t=e.entries.filter(e=>"number"==typeof e.start&&"number"==typeof e.total).sort((e,t)=>(e.start||0)-(t.start||0));var n,r,s=y.newG("overlays");const o=y.newG("rows-holder"),a=(r=e,n=t,r=r.durationMs/100,{...r={diagramHeight:(n.length+1)*i.rowHeight,options:i,pubSub:new C.PubSub,unit:r},overlayManager:new w.default(r)}),l=(n=e.marks,r=a.diagramHeight,n=n.reduce((e,t)=>{return Math.max(e,y.getNodeTextWidth(y.newTextEl(t.name,{x:0,y:0}),!0))},0),Math.floor(r+n+35)),c=y.newSvg("water-fall-chart",{height:l}),d=y.newSvg("scale-and-marks-holder",{width:`${100-i.leftColumnWidth}%`,x:`${i.leftColumnWidth}%`});let u,p;i.showAlignmentHelpers&&(u=y.newG("hover-overlays"),h=q.createAlignmentLines(a.diagramHeight),u.appendChild(h.startline),u.appendChild(h.endline),p=q.makeHoverEvtListeners(h)),d.appendChild(S.createTimeScale(a,e.durationMs)),d.appendChild(E.createMarks(a,e.marks));var h=t[0].responseDetails.icon.width;let m=0;i.showMimeTypeIcon&&(m+=1),i.showIndicatorIcons&&(e=t.map(e=>0"icon"===e.displayType).length?1:0),m+=Math.max.apply(null,e));const g=m*h;h=function(e){var t=Math.floor(Math.log(e)/Math.LN10)+1;let n="";for(let e=0;e{var e=l+a.overlayManager.getCombinedOverlayHeight();c.classList.toggle("closing",e${e.url}
      `+`${Math.round(e.start)}ms - ${Math.round(e.end)}ms
      `+`total: ${isNaN(e.total)?"n/a ":Math.round(e.total)}ms`,showOverlay:i.showAlignmentHelpers?p.onMouseEnterPartial:void 0,unit:a.unit,width:n,x:s,y:r},s=x.createRow(a,t,g,f,s,e,()=>{a.overlayManager.toggleOverlay(t,r+i.rowHeight,450,e,v)}),v.push(s),o.appendChild(s),o.appendChild(y.newG("row-overlay-holder"))}),i.showAlignmentHelpers&&void 0!==u&&d.appendChild(u),c.appendChild(d),c.appendChild(o),c.appendChild(s),c.appendChild((0,T.makeTooltip)(i)),c}},{"../helpers/svg":6,"../transformers/styling-converters":15,"./details-overlay/overlay-manager":17,"./details-overlay/pub-sub":18,"./row/svg-row":22,"./row/svg-tooltip":23,"./sub-components/svg-alignment-helper":24,"./sub-components/svg-general-components":25,"./sub-components/svg-marks":26}]},{},[8])(8)}); \ No newline at end of file