@lhci/viewer 0.15.1 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/entry-DHLFDJOJ.css +17 -0
- package/dist/chunks/entry-DHLFDJOJ.css.map +7 -0
- package/dist/chunks/entry-KSKAOE6M.js +22 -0
- package/dist/chunks/entry-KSKAOE6M.js.map +7 -0
- package/dist/index.html +5 -5
- package/dist/locales/ar-XB.json +3797 -0
- package/dist/locales/ar.json +3797 -0
- package/dist/locales/bg.json +3797 -0
- package/dist/locales/ca.json +3797 -0
- package/dist/locales/cs.json +3797 -0
- package/dist/locales/da.json +3797 -0
- package/dist/locales/de.json +3797 -0
- package/dist/locales/el.json +3797 -0
- package/dist/locales/en-GB.json +3797 -0
- package/dist/locales/en-US.json +3815 -0
- package/dist/locales/en-XA.json +2747 -0
- package/dist/locales/en-XL.json +3815 -0
- package/dist/locales/es-419.json +3797 -0
- package/dist/locales/es.json +3797 -0
- package/dist/locales/fi.json +3797 -0
- package/dist/locales/fil.json +3797 -0
- package/dist/locales/fr.json +3797 -0
- package/dist/locales/he.json +3794 -0
- package/dist/locales/hi.json +3797 -0
- package/dist/locales/hr.json +3797 -0
- package/dist/locales/hu.json +3797 -0
- package/dist/locales/id.json +3797 -0
- package/dist/locales/it.json +3797 -0
- package/dist/locales/ja.json +3797 -0
- package/dist/locales/ko.json +3797 -0
- package/dist/locales/lt.json +3797 -0
- package/dist/locales/lv.json +3797 -0
- package/dist/locales/nl.json +3797 -0
- package/dist/locales/no.json +3797 -0
- package/dist/locales/pl.json +3797 -0
- package/dist/locales/pt-PT.json +3797 -0
- package/dist/locales/pt.json +3797 -0
- package/dist/locales/ro.json +3797 -0
- package/dist/locales/ru.json +3794 -0
- package/dist/locales/sk.json +3797 -0
- package/dist/locales/sl.json +3797 -0
- package/dist/locales/sr-Latn.json +3797 -0
- package/dist/locales/sr.json +3797 -0
- package/dist/locales/sv.json +3797 -0
- package/dist/locales/ta.json +3794 -0
- package/dist/locales/te.json +3797 -0
- package/dist/locales/th.json +3797 -0
- package/dist/locales/tr.json +3797 -0
- package/dist/locales/uk.json +3797 -0
- package/dist/locales/vi.json +3797 -0
- package/dist/locales/zh-HK.json +3797 -0
- package/dist/locales/zh-TW.json +3797 -0
- package/dist/locales/zh.json +3797 -0
- package/package.json +12 -6
- package/src/ui/components/toast.jsx +1 -1
- package/src/ui/routes/comparison/comparison.css +3 -2
- package/src/ui/routes/comparison/comparison.jsx +39 -14
- package/dist/chunks/entry-JMR57VBF.js +0 -15
- package/dist/chunks/entry-JMR57VBF.js.map +0 -7
- package/dist/chunks/entry-W3IW5PUA.css +0 -12
- package/dist/chunks/entry-W3IW5PUA.css.map +0 -7
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lhci/viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=22.19.0"
|
|
7
|
+
},
|
|
5
8
|
"repository": {
|
|
6
9
|
"type": "git",
|
|
7
10
|
"url": "https://github.com/GoogleChrome/lighthouse-ci.git"
|
|
@@ -9,6 +12,10 @@
|
|
|
9
12
|
"publishConfig": {
|
|
10
13
|
"access": "public"
|
|
11
14
|
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
12
19
|
"scripts": {
|
|
13
20
|
"clean": "rm -rf ./dist",
|
|
14
21
|
"start": "npm run build:watch",
|
|
@@ -16,14 +23,13 @@
|
|
|
16
23
|
"build:watch": "node ../../scripts/build-app.js watch ./src/ui/index.html ./dist ./"
|
|
17
24
|
},
|
|
18
25
|
"devDependencies": {
|
|
26
|
+
"clsx": "^1.0.4",
|
|
27
|
+
"preact": "^10.19.3",
|
|
19
28
|
"@fontsource/material-icons": "^4.4.5",
|
|
20
29
|
"@fontsource/roboto": "^4.4.5",
|
|
21
|
-
"@fontsource/roboto-mono": "^4.4.5"
|
|
22
|
-
"clsx": "^1.0.4",
|
|
23
|
-
"preact": "^10.19.3"
|
|
30
|
+
"@fontsource/roboto-mono": "^4.4.5"
|
|
24
31
|
},
|
|
25
32
|
"alias": {
|
|
26
33
|
"isomorphic-fetch": "clsx"
|
|
27
|
-
}
|
|
28
|
-
"gitHead": "76a49c7cc26cfc6dcff4248e1f170efb845245bb"
|
|
34
|
+
}
|
|
29
35
|
}
|
|
@@ -10,7 +10,7 @@ import {useEffect} from 'preact/hooks';
|
|
|
10
10
|
|
|
11
11
|
/** @typedef {import('../app.jsx').ToastMessage} ToastMessage */
|
|
12
12
|
|
|
13
|
-
/** @param {{toast: ToastMessage, setToasts: import('preact/hooks
|
|
13
|
+
/** @param {{toast: ToastMessage, setToasts: import('preact/hooks').StateUpdater<Array<ToastMessage>>}} props */
|
|
14
14
|
export const Toast = props => {
|
|
15
15
|
const setToasts = props.setToasts;
|
|
16
16
|
const {message, level = 'info'} = props.toast;
|
|
@@ -9,25 +9,34 @@ import './comparison.css';
|
|
|
9
9
|
import {LH_LOGO_PATH} from '../../components/lhci-components.jsx';
|
|
10
10
|
import {ReportUploadBox, computeBestDisplayType} from '../../components/report-upload-box';
|
|
11
11
|
import {LhrComparison} from '../../../../../server/src/ui/routes/build-view/lhr-comparison';
|
|
12
|
+
import {
|
|
13
|
+
useLocalizedLhrs,
|
|
14
|
+
LocaleDropdown,
|
|
15
|
+
} from '../../../../../server/src/ui/routes/build-view/lhr-locale';
|
|
12
16
|
|
|
13
17
|
/** @typedef {import('../../app.jsx').ToastMessage} ToastMessage */
|
|
14
18
|
/** @typedef {import('../../app.jsx').ReportData} ReportData */
|
|
15
19
|
|
|
16
20
|
/** @param {{baseReport: ReportData, compareReport: ReportData, setBaseReport: (d: ReportData|undefined) => void, setCompareReport: (d: ReportData|undefined) => void, addToast: (t: ToastMessage) => void}} props */
|
|
17
21
|
export const ComparisonRoute = props => {
|
|
18
|
-
const
|
|
22
|
+
const {
|
|
23
|
+
lhr: localizedCompareLhr,
|
|
24
|
+
baseLhr: localizedBaseLhr,
|
|
25
|
+
locale,
|
|
26
|
+
setLocale,
|
|
27
|
+
availableLocales,
|
|
28
|
+
canSwapLocale,
|
|
29
|
+
} = useLocalizedLhrs(props.compareReport.lhr, props.baseReport.lhr);
|
|
30
|
+
const compareReport = localizedCompareLhr
|
|
31
|
+
? {...props.compareReport, lhr: localizedCompareLhr}
|
|
32
|
+
: props.compareReport;
|
|
33
|
+
const baseReport = localizedBaseLhr
|
|
34
|
+
? {...props.baseReport, lhr: localizedBaseLhr}
|
|
35
|
+
: props.baseReport;
|
|
36
|
+
const displayType = computeBestDisplayType(baseReport.lhr, compareReport.lhr);
|
|
19
37
|
return (
|
|
20
38
|
<div className="comparison">
|
|
21
39
|
<div className="comparison-header">
|
|
22
|
-
<div
|
|
23
|
-
className="comparison-header__switcher"
|
|
24
|
-
onClick={() => {
|
|
25
|
-
props.setBaseReport(props.compareReport);
|
|
26
|
-
props.setCompareReport(props.baseReport);
|
|
27
|
-
}}
|
|
28
|
-
>
|
|
29
|
-
<i className="material-icons">swap_horiz</i>
|
|
30
|
-
</div>
|
|
31
40
|
<div className="comparison-header__logo">
|
|
32
41
|
<img
|
|
33
42
|
src={LH_LOGO_PATH}
|
|
@@ -42,7 +51,7 @@ export const ComparisonRoute = props => {
|
|
|
42
51
|
<ReportUploadBox
|
|
43
52
|
variant="base"
|
|
44
53
|
dragTarget="self"
|
|
45
|
-
report={
|
|
54
|
+
report={baseReport}
|
|
46
55
|
setReport={props.setBaseReport}
|
|
47
56
|
addToast={props.addToast}
|
|
48
57
|
displayType={displayType}
|
|
@@ -51,21 +60,37 @@ export const ComparisonRoute = props => {
|
|
|
51
60
|
<ReportUploadBox
|
|
52
61
|
variant="compare"
|
|
53
62
|
dragTarget="self"
|
|
54
|
-
report={
|
|
63
|
+
report={compareReport}
|
|
55
64
|
setReport={props.setCompareReport}
|
|
56
65
|
addToast={props.addToast}
|
|
57
66
|
displayType={displayType}
|
|
58
67
|
showOpenLhrLink
|
|
59
68
|
/>
|
|
69
|
+
<div
|
|
70
|
+
className="comparison-header__switcher"
|
|
71
|
+
onClick={() => {
|
|
72
|
+
props.setBaseReport(props.compareReport);
|
|
73
|
+
props.setCompareReport(props.baseReport);
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
<i className="material-icons">swap_horiz</i>
|
|
77
|
+
</div>
|
|
60
78
|
</div>
|
|
79
|
+
{canSwapLocale ? (
|
|
80
|
+
<LocaleDropdown
|
|
81
|
+
locale={locale}
|
|
82
|
+
setLocale={setLocale}
|
|
83
|
+
availableLocales={availableLocales}
|
|
84
|
+
/>
|
|
85
|
+
) : null}
|
|
61
86
|
<a className="comparison-header__info" href="https://github.com/GoogleChrome/lighthouse-ci">
|
|
62
87
|
<i className="material-icons">info</i>
|
|
63
88
|
</a>
|
|
64
89
|
</div>
|
|
65
90
|
<div className="comparison-body">
|
|
66
91
|
<LhrComparison
|
|
67
|
-
lhr={
|
|
68
|
-
baseLhr={
|
|
92
|
+
lhr={compareReport.lhr}
|
|
93
|
+
baseLhr={baseReport.lhr}
|
|
69
94
|
hookElements={{}}
|
|
70
95
|
/>
|
|
71
96
|
</div>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{var To=Object.create;var Ie=Object.defineProperty,Oo=Object.defineProperties,Ho=Object.getOwnPropertyDescriptor,jo=Object.getOwnPropertyDescriptors,Ro=Object.getOwnPropertyNames,xe=Object.getOwnPropertySymbols,Xo=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable;var mt=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,j=(e,t)=>{for(var r in t||(t={}))_e.call(t,r)&&mt(e,r,t[r]);if(xe)for(var r of xe(t))gt.call(t,r)&&mt(e,r,t[r]);return e},X=(e,t)=>Oo(e,jo(t));var ht=(e,t)=>{var r={};for(var o in e)_e.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&xe)for(var o of xe(e))t.indexOf(o)<0&>.call(e,o)&&(r[o]=e[o]);return r};var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Mo=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ro(t))!_e.call(e,i)&&i!==r&&Ie(e,i,{get:()=>t[i],enumerable:!(o=Ho(t,i))||o.enumerable});return e};var I=(e,t,r)=>(r=e!=null?To(Xo(e)):{},Mo(t||!e||!e.__esModule?Ie(r,"default",{value:e,enumerable:!0}):r,e));var P=(e,t,r)=>new Promise((o,i)=>{var a=c=>{try{f(r.next(c))}catch(d){i(d)}},s=c=>{try{f(r.throw(c))}catch(d){i(d)}},f=c=>c.done?o(c.value):Promise.resolve(c.value).then(a,s);f((r=r.apply(e,t)).next())});var St=S((ji,Wo)=>{Wo.exports="./assets/loading-spinner-N6LEBK7Y.svg"});var _t=S((Vi,It)=>{var te=1e3,re=te*60,oe=re*60,Q=oe*24,Jo=Q*7,qo=Q*365.25;It.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Ko(e);if(r==="number"&&isFinite(e))return t.long?$o(e):Qo(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ko(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),o=(t[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return r*qo;case"weeks":case"week":case"w":return r*Jo;case"days":case"day":case"d":return r*Q;case"hours":case"hour":case"hrs":case"hr":case"h":return r*oe;case"minutes":case"minute":case"mins":case"min":case"m":return r*re;case"seconds":case"second":case"secs":case"sec":case"s":return r*te;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Qo(e){var t=Math.abs(e);return t>=Q?Math.round(e/Q)+"d":t>=oe?Math.round(e/oe)+"h":t>=re?Math.round(e/re)+"m":t>=te?Math.round(e/te)+"s":e+"ms"}function $o(e){var t=Math.abs(e);return t>=Q?Oe(e,t,Q,"day"):t>=oe?Oe(e,t,oe,"hour"):t>=re?Oe(e,t,re,"minute"):t>=te?Oe(e,t,te,"second"):e+" ms"}function Oe(e,t,r,o){var i=t>=r*1.5;return Math.round(e/r)+" "+o+(i?"s":"")}});var Gt=S((Gi,Vt)=>{function en(e){r.debug=r,r.default=r,r.coerce=c,r.disable=a,r.enable=i,r.enabled=s,r.humanize=_t(),r.destroy=d,Object.keys(e).forEach(p=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let l=0;for(let g=0;g<p.length;g++)l=(l<<5)-l+p.charCodeAt(g),l|=0;return r.colors[Math.abs(l)%r.colors.length]}r.selectColor=t;function r(p){let l,g=null;function m(...v){if(!m.enabled)return;let C=m,F=Number(new Date),w=F-(l||F);C.diff=w,C.prev=l,C.curr=F,l=F,v[0]=r.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let x=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(O,T)=>{if(O==="%%")return"%";x++;let N=r.formatters[T];if(typeof N=="function"){let U=v[x];O=N.call(C,U),v.splice(x,1),x--}return O}),r.formatArgs.call(C,v),(C.log||r.log).apply(C,v)}return m.namespace=p,m.useColors=r.useColors(),m.color=r.selectColor(p),m.extend=o,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>g===null?r.enabled(p):g,set:v=>{g=v}}),typeof r.init=="function"&&r.init(m),m}function o(p,l){let g=r(this.namespace+(typeof l=="undefined"?":":l)+p);return g.log=this.log,g}function i(p){r.save(p),r.names=[],r.skips=[];let l,g=(typeof p=="string"?p:"").split(/[\s,]+/),m=g.length;for(l=0;l<m;l++)g[l]&&(p=g[l].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.substr(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}function a(){let p=[...r.names.map(f),...r.skips.map(f).map(l=>"-"+l)].join(",");return r.enable(""),p}function s(p){if(p[p.length-1]==="*")return!0;let l,g;for(l=0,g=r.skips.length;l<g;l++)if(r.skips[l].test(p))return!1;for(l=0,g=r.names.length;l<g;l++)if(r.names[l].test(p))return!0;return!1}function f(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function c(p){return p instanceof Error?p.stack||p.message:p}function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Vt.exports=en});var Wt=S((_,He)=>{_.formatArgs=rn;_.save=on;_.load=nn;_.useColors=tn;_.storage=an();_.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();_.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function tn(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function rn(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+He.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(o=r))}),e.splice(o,0,t)}_.log=console.debug||console.log||(()=>{});function on(e){try{e?_.storage.setItem("debug",e):_.storage.removeItem("debug")}catch(t){}}function nn(){let e;try{e=_.storage.getItem("debug")}catch(t){}return!e&&typeof process!="undefined"&&"env"in process&&(e=process.env.DEBUG),e}function an(){try{return localStorage}catch(e){}}He.exports=Gt()(_);var{formatters:sn}=He.exports;sn.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Yt=S((je,Et)=>{(function(e,t){typeof je=="object"&&typeof Et!="undefined"?t(je):typeof define=="function"&&define.amd?define(["exports"],t):t(e.WHATWGFetch={})})(je,function(e){"use strict";var t=typeof globalThis!="undefined"&&globalThis||typeof self!="undefined"&&self||typeof t!="undefined"&&t,r={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(u){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};function o(u){return u&&DataView.prototype.isPrototypeOf(u)}if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(u){return u&&i.indexOf(Object.prototype.toString.call(u))>-1};function s(u){if(typeof u!="string"&&(u=String(u)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(u)||u==="")throw new TypeError("Invalid character in header field name");return u.toLowerCase()}function f(u){return typeof u!="string"&&(u=String(u)),u}function c(u){var h={next:function(){var A=u.shift();return{done:A===void 0,value:A}}};return r.iterable&&(h[Symbol.iterator]=function(){return h}),h}function d(u){this.map={},u instanceof d?u.forEach(function(h,A){this.append(A,h)},this):Array.isArray(u)?u.forEach(function(h){this.append(h[0],h[1])},this):u&&Object.getOwnPropertyNames(u).forEach(function(h){this.append(h,u[h])},this)}d.prototype.append=function(u,h){u=s(u),h=f(h);var A=this.map[u];this.map[u]=A?A+", "+h:h},d.prototype.delete=function(u){delete this.map[s(u)]},d.prototype.get=function(u){return u=s(u),this.has(u)?this.map[u]:null},d.prototype.has=function(u){return this.map.hasOwnProperty(s(u))},d.prototype.set=function(u,h){this.map[s(u)]=f(h)},d.prototype.forEach=function(u,h){for(var A in this.map)this.map.hasOwnProperty(A)&&u.call(h,this.map[A],A,this)},d.prototype.keys=function(){var u=[];return this.forEach(function(h,A){u.push(A)}),c(u)},d.prototype.values=function(){var u=[];return this.forEach(function(h){u.push(h)}),c(u)},d.prototype.entries=function(){var u=[];return this.forEach(function(h,A){u.push([A,h])}),c(u)},r.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);function p(u){if(u.bodyUsed)return Promise.reject(new TypeError("Already read"));u.bodyUsed=!0}function l(u){return new Promise(function(h,A){u.onload=function(){h(u.result)},u.onerror=function(){A(u.error)}})}function g(u){var h=new FileReader,A=l(h);return h.readAsArrayBuffer(u),A}function m(u){var h=new FileReader,A=l(h);return h.readAsText(u),A}function v(u){for(var h=new Uint8Array(u),A=new Array(h.length),H=0;H<h.length;H++)A[H]=String.fromCharCode(h[H]);return A.join("")}function C(u){if(u.slice)return u.slice(0);var h=new Uint8Array(u.byteLength);return h.set(new Uint8Array(u)),h.buffer}function F(){return this.bodyUsed=!1,this._initBody=function(u){this.bodyUsed=this.bodyUsed,this._bodyInit=u,u?typeof u=="string"?this._bodyText=u:r.blob&&Blob.prototype.isPrototypeOf(u)?this._bodyBlob=u:r.formData&&FormData.prototype.isPrototypeOf(u)?this._bodyFormData=u:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(u)?this._bodyText=u.toString():r.arrayBuffer&&r.blob&&o(u)?(this._bodyArrayBuffer=C(u.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(u)||a(u))?this._bodyArrayBuffer=C(u):this._bodyText=u=Object.prototype.toString.call(u):this._bodyText="",this.headers.get("content-type")||(typeof u=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(u)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var u=p(this);if(u)return u;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var u=p(this);return u||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(g)}),this.text=function(){var u=p(this);if(u)return u;if(this._bodyBlob)return m(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(v(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(O)}),this.json=function(){return this.text().then(JSON.parse)},this}var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(u){var h=u.toUpperCase();return w.indexOf(h)>-1?h:u}function z(u,h){if(!(this instanceof z))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');h=h||{};var A=h.body;if(u instanceof z){if(u.bodyUsed)throw new TypeError("Already read");this.url=u.url,this.credentials=u.credentials,h.headers||(this.headers=new d(u.headers)),this.method=u.method,this.mode=u.mode,this.signal=u.signal,!A&&u._bodyInit!=null&&(A=u._bodyInit,u.bodyUsed=!0)}else this.url=String(u);if(this.credentials=h.credentials||this.credentials||"same-origin",(h.headers||!this.headers)&&(this.headers=new d(h.headers)),this.method=x(h.method||this.method||"GET"),this.mode=h.mode||this.mode||null,this.signal=h.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&A)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(A),(this.method==="GET"||this.method==="HEAD")&&(h.cache==="no-store"||h.cache==="no-cache")){var H=/([?&])_=[^&]*/;if(H.test(this.url))this.url=this.url.replace(H,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}z.prototype.clone=function(){return new z(this,{body:this._bodyInit})};function O(u){var h=new FormData;return u.trim().split("&").forEach(function(A){if(A){var H=A.split("="),R=H.shift().replace(/\+/g," "),D=H.join("=").replace(/\+/g," ");h.append(decodeURIComponent(R),decodeURIComponent(D))}}),h}function T(u){var h=new d,A=u.replace(/\r?\n[\t ]+/g," ");return A.split("\r").map(function(H){return H.indexOf(`
|
|
2
|
-
`)===0?H.substr(1,H.length):H}).forEach(function(H){var R=H.split(":"),D=R.shift().trim();if(D){var we=R.join(":").trim();h.append(D,we)}}),h}F.call(z.prototype);function N(u,h){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');h||(h={}),this.type="default",this.status=h.status===void 0?200:h.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in h?h.statusText:"",this.headers=new d(h.headers),this.url=h.url||"",this._initBody(u)}F.call(N.prototype),N.prototype.clone=function(){return new N(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},N.error=function(){var u=new N(null,{status:0,statusText:""});return u.type="error",u};var U=[301,302,303,307,308];N.redirect=function(u,h){if(U.indexOf(h)===-1)throw new RangeError("Invalid status code");return new N(null,{status:h,headers:{location:u}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(u){e.DOMException=function(h,A){this.message=h,this.name=A;var H=Error(h);this.stack=H.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function Z(u,h){return new Promise(function(A,H){var R=new z(u,h);if(R.signal&&R.signal.aborted)return H(new e.DOMException("Aborted","AbortError"));var D=new XMLHttpRequest;function we(){D.abort()}D.onload=function(){var V={status:D.status,statusText:D.statusText,headers:T(D.getAllResponseHeaders()||"")};V.url="responseURL"in D?D.responseURL:V.headers.get("X-Request-URL");var Ce="response"in D?D.response:D.responseText;setTimeout(function(){A(new N(Ce,V))},0)},D.onerror=function(){setTimeout(function(){H(new TypeError("Network request failed"))},0)},D.ontimeout=function(){setTimeout(function(){H(new TypeError("Network request failed"))},0)},D.onabort=function(){setTimeout(function(){H(new e.DOMException("Aborted","AbortError"))},0)};function No(V){try{return V===""&&t.location.href?t.location.href:V}catch(Ce){return V}}D.open(R.method,No(R.url),!0),R.credentials==="include"?D.withCredentials=!0:R.credentials==="omit"&&(D.withCredentials=!1),"responseType"in D&&(r.blob?D.responseType="blob":r.arrayBuffer&&R.headers.get("Content-Type")&&R.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(D.responseType="arraybuffer")),h&&typeof h.headers=="object"&&!(h.headers instanceof d)?Object.getOwnPropertyNames(h.headers).forEach(function(V){D.setRequestHeader(V,f(h.headers[V]))}):R.headers.forEach(function(V,Ce){D.setRequestHeader(Ce,V)}),R.signal&&(R.signal.addEventListener("abort",we),D.onreadystatechange=function(){D.readyState===4&&R.signal.removeEventListener("abort",we)}),D.send(typeof R._bodyInit=="undefined"?null:R._bodyInit)})}Z.polyfill=!0,t.fetch||(t.fetch=Z,t.Headers=d,t.Request=z,t.Response=N),e.Headers=d,e.Request=z,e.Response=N,e.fetch=Z,Object.defineProperty(e,"__esModule",{value:!0})})});var qt=S((Wi,Jt)=>{Yt();Jt.exports=self.fetch.bind(self)});var Qt=S((Ei,Kt)=>{"use strict";var ln=Wt()("lhci:utils:api-client"),cn=qt(),fn=typeof window=="undefined"?e=>Buffer.from(e).toString("base64"):window.btoa,et=class e{constructor(t){if(this._rootURL=t.rootURL,this._extraHeaders=t.extraHeaders||{},this._fetch=t.fetch||cn,this._URL=t.URL||URL,t.basicAuth&&t.basicAuth.password){let{username:o=e.DEFAULT_BASIC_AUTH_USERNAME,password:i}=t.basicAuth;this._extraHeaders.Authorization=`Basic ${fn(`${o}:${i}`)}`}let r=this}setBuildToken(t){this._extraHeaders=X(j({},this._extraHeaders),{"x-lhci-build-token":t||""})}setAdminToken(t){this._extraHeaders=X(j({},this._extraHeaders),{"x-lhci-admin-token":t||""})}_normalizeURL(t){if(!t.startsWith("/"))throw new Error(`Cannot normalize "${t}" without leading /`);let r=this._rootURL.endsWith("/")?this._rootURL.slice(0,this._rootURL.length-1):this._rootURL;return new this._URL(`${r}${t}`)}_convert404ToUndefined(t){return t.catch(r=>{if(!("status"in r&&r.status===404))throw r})}_convertFetchResponseToReturnValue(t){return P(this,null,function*(){if(t.status===204)return;if(t.status>=400){let o=yield t.text(),i=new Error(`Unexpected status code ${t.status}
|
|
3
|
-
${o}`);throw i.status=t.status,i.body=o,i}return yield t.json()})}_fetchWithRequestBody(t,r,o){return P(this,null,function*(){let i=yield this._fetch(this._normalizeURL(r).href,{method:t,body:JSON.stringify(o),headers:X(j({},this._extraHeaders),{"content-type":"application/json"})});return this._convertFetchResponseToReturnValue(i)})}_get(t,r){return P(this,null,function*(){let o=this._normalizeURL(t);if(r)for(let[a,s]of Object.entries(r))s!==void 0&&o.searchParams.append(a,s.toString());let i=yield this._fetch(o.href,{headers:j({},this._extraHeaders)});return this._convertFetchResponseToReturnValue(i)})}_post(t,r){return P(this,null,function*(){return this._fetchWithRequestBody("POST",t,r)})}_put(t,r){return P(this,null,function*(){return this._fetchWithRequestBody("PUT",t,r)})}_delete(t){return P(this,null,function*(){let r=j({},this._extraHeaders),o=yield this._fetch(this._normalizeURL(t).href,{method:"DELETE",headers:r});return this._convertFetchResponseToReturnValue(o)})}initialize(){return P(this,null,function*(){throw new Error("Unimplemented")})}getVersion(){return P(this,null,function*(){let t=yield this._fetch(this._normalizeURL("/version").href,{headers:j({},this._extraHeaders)}),r=t.text();if(!t.ok){let o=new Error(`Unexpected status code ${t.status}
|
|
4
|
-
${r}`);throw o.status=t.status,o.body=r,o}return r})}getProjects(){return P(this,null,function*(){return this._get("/v1/projects")})}getProjectToken(t){return P(this,null,function*(){return(yield this._get(`/v1/projects/${t.id}/token`)).token})}findProjectByToken(t){return P(this,null,function*(){return this._convert404ToUndefined(this._post("/v1/projects/lookup",{token:t}))})}findProjectById(t){return P(this,null,function*(){return this._convert404ToUndefined(this._get(`/v1/projects/${t}`))})}findProjectBySlug(t){return P(this,null,function*(){return this._convert404ToUndefined(this._get(`/v1/projects/slug:${t}`))})}createProject(t){return P(this,null,function*(){return this._post("/v1/projects",t)})}updateProject(t){return P(this,null,function*(){return this._put(`/v1/projects/${t.id}`,t)})}deleteProject(t){return P(this,null,function*(){return this._delete(`/v1/projects/${t}`)})}getBuilds(o){return P(this,arguments,function*(t,r={}){return this._get(`/v1/projects/${t}/builds`,r)})}getBranches(t){return P(this,null,function*(){return this._get(`/v1/projects/${t}/branches`)})}createBuild(t){return P(this,null,function*(){return this._post(`/v1/projects/${t.projectId}/builds`,t)})}sealBuild(t,r){return P(this,null,function*(){return this._put(`/v1/projects/${t}/builds/${r}/lifecycle`,"sealed")})}deleteBuild(t,r){return P(this,null,function*(){return this._delete(`/v1/projects/${t}/builds/${r}`)})}findBuildById(t,r){return P(this,null,function*(){return this._convert404ToUndefined(this._get(`/v1/projects/${t}/builds/${r}`))})}findAncestorBuildById(t,r){return P(this,null,function*(){return this._convert404ToUndefined(this._get(`/v1/projects/${t}/builds/${r}/ancestor`))})}getRuns(i,a){return P(this,arguments,function*(t,r,o={}){return this._get(`/v1/projects/${t}/builds/${r}/runs`,o)})}getUrls(t,r){return P(this,null,function*(){return r?this._get(`/v1/projects/${t}/builds/${r}/urls`):this._get(`/v1/projects/${t}/urls`)})}createRun(t){return P(this,null,function*(){return this._post(`/v1/projects/${t.projectId}/builds/${t.buildId}/runs`,t)})}getStatistics(t,r){return P(this,null,function*(){return this._get(`/v1/projects/${t}/builds/${r}/statistics`)})}getViewerOrigin(){return P(this,null,function*(){return this._get("/v1/viewer/origin")})}_createProject(t){return P(this,null,function*(){throw new Error("Unimplemented")})}_createOrUpdateStatistic(t){return P(this,null,function*(){throw new Error("Unimplemented")})}_getStatistics(t,r){return P(this,null,function*(){throw new Error("Unimplemented")})}_invalidateStatistics(t,r){return P(this,null,function*(){throw new Error("Unimplemented")})}findBuildsBeforeTimestamp(t){return P(this,null,function*(){throw new Error("Unimplemented")})}_resetAdminToken(t){return P(this,null,function*(){throw new Error("Unimplemented")})}_resetProjectToken(t){return P(this,null,function*(){throw new Error("Unimplemented")})}close(){return P(this,null,function*(){})}static get DEFAULT_BASIC_AUTH_USERNAME(){return"lhci"}static isApiVersionCompatible(t,r){ln(`checking for client (${t}) server (${r}) compatibility`);let o=t.match(/(\d+)\.(\d+)\.\d+/),i=r.match(/(\d+)\.(\d+)\.\d+/);if(!o||!i)return!1;let a=Number(o[1]),s=Number(i[1]);return a!==s?!1:(a===0&&(a=Number(o[2])),s===0&&(s=Number(i[2])),a===s||a===s+1)}};Kt.exports=et});var $=S((Ji,tr)=>{"use strict";function tt(e,t){if(Array.isArray(e)){if(!Array.isArray(t))return t;for(let r=0;r<Math.max(e.length,t.length);r++)e[r]=r<t.length?tt(e[r],t[r]):e[r];return e}else if(typeof e=="object"&&e!==null){if(typeof t!="object"||t===null)return t;let r=e,o=t,i=new Set(Object.keys(r)),a=new Set(Object.keys(o));for(let s of new Set([...i,...a]))r[s]=s in o?tt(r[s],o[s]):r[s];return e}else return t}function $t(e,t){let r=e.replace(/([a-z])([A-Z])/g,"$1-$2");return t&&t.alphanumericOnly&&(r=r.replace(/[^a-z0-9]+/gi,"-").replace(/-+/g,"-").replace(/(^-|-$)/g,"")),r.toLowerCase()}function er(e,t){let r=new Map;for(let o of e){let i=t(o),a=r.get(i)||[];a.push(o),r.set(i,a)}return r}function un(e,t){let r,o=()=>{r&&clearTimeout(r),r=void 0},i=(...a)=>{r&&clearTimeout(r),r=setTimeout(()=>e(...a),t)};return i.cancel=o,i}tr.exports={merge:tt,kebabCase:$t,debounce:un,range(e,t,r=1){let o=[];for(let i=e;i<t;i+=r)o.push(i);return o},startCase(e){return $t(e).split("-").map(t=>`${t.slice(0,1).toUpperCase()}${t.slice(1)}`).join(" ")},padStart(e,t,r=" "){return e.length>=t?e:`${r.repeat(t)}${e}`.slice(-t)},padEnd(e,t,r=" "){return e.length>=t?e:`${e}${r.repeat(t)}`.slice(0,t)},isEqual(e,t,r=0){if(r>100||typeof e!=typeof t)return!1;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(typeof e!="object")return e===t;if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e))return Array.isArray(t)?e.every((s,f)=>this.isEqual(s,t[f]))&&e.length===t.length:!1;let o=Object.keys(e).sort(),i=Object.keys(t).sort();return o.every(s=>this.isEqual(e[s],t[s],r+1))&&this.isEqual(o,i)},cloneDeep(e){return JSON.parse(JSON.stringify(e))},uniqBy(e,t){let r=new Set,o=[];for(let i of e){let a=t(i);r.has(a)||(r.add(a),o.push(i))}return o},groupBy(e,t){return[...er(e,t).values()]},groupIntoMap:er,maxBy(e,t){let r,o=-1/0;for(let i of e){let a=t(i);a>o&&(r=i,o=a)}return r},minBy(e,t){return this.maxBy(e,r=>-t(r))},sortBy(e,t){return e.slice().sort((r,o)=>t(r)-t(o))},pick(e,t){let r={};for(let[o,i]of Object.entries(e)){let a=o;t.includes(a)&&(r[a]=i)}return r},omit(e,t,r={}){let o={};for(let[i,a]of Object.entries(e)){let s=i;t.includes(s)||r.dropUndefined&&a===void 0||(o[s]=a)}return o},shortId(e){return e.replace(/-/g,"").slice(0,12)},pluralize(e,t,r){return r=r||`${e}s`,t===1?e:r},uniqueId:(()=>{let e=1;return()=>e++})()}});var nr=S((fa,pn)=>{pn.exports="./assets/favicon-PWXHY3O5.svg"});var ir=S((ga,gn)=>{gn.exports="./assets/confetti-NE5ZCURM.svg"});var ar=S((ha,hn)=>{hn.exports="./assets/logo-7LKJDYBP.svg"});var pr=S((ka,dr)=>{"use strict";var ge=$(),xn="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin urna nunc, molestie sed hendrerit et, vulputate vitae mauris. Sed tempor vitae risus vel hendrerit. Nulla vestibulum malesuada erat vitae laoreet. Phasellus sodales vehicula dolor, dictum ullamcorper metus aliquam id. Nullam porttitor posuere purus id rhoncus. Sed et mi ligula. Donec imperdiet nulla sit amet justo cursus, id tempus ex accumsan. Maecenas ultricies elit eget lectus posuere vestibulum. Cras vestibulum neque nec justo congue feugiat non id dui. Pellentesque dapibus ac orci sed malesuada. Sed rhoncus vitae lorem eget facilisis. Donec auctor tortor a tortor egestas, vel condimentum lacus auctor.";function ur(e){return e.startsWith("a11y")?"accessibility":e.startsWith("seo")?"seo":e.startsWith("best-practices")?"best-practices":e.startsWith("pwa")?"pwa":"performance"}function Me(e){if(e==="cumulative-layout-shift"||e==="first-contentful-paint"||e==="first-meaningful-paint"||e==="speed-index"||e==="interactive"||e==="first-cpu-idle"||e==="max-potential-fid")return"metrics";if(e.startsWith("diagnostic-"))return"diagnostics";if(e.startsWith("uses-"))return"load-opportunities";if(e.startsWith("a11y-aria"))return"a11y-aria";if(e.startsWith("a11y"))return"a11y-best-practices";if(e.startsWith("seo"))return"seo-content";if(e.startsWith("best-practices"))return"best-practices";if(e.startsWith("pwa-fast-reliable"))return"pwa-fast-reliable";if(e.startsWith("pwa-installable"))return"pwa-installable";if(e.startsWith("pwa-optimized"))return"pwa-optimized"}function Be(e,t){let o=e*.1;return(t.next()-.5)*2*o+e}function Pn(e,t,r){let o={},i=xn.split(" ");for(let g of t){let{auditId:m,averageNumericValue:v,averageWastedMs:C,unit:F="items"}=g,w=Me(m);if(typeof v=="number"){let z=Be(v,r),O=1-Math.min(1,Math.max((z-1e3)/9e3,0));o[m]={score:O,numericValue:z,scoreDisplayMode:"numeric",displayValue:w==="metrics"?`${(z/1e3).toLocaleString(void 0,{maximumFractionDigits:1})} s`:`${Math.round(z)} ${F}`}}else if(typeof C=="number"){let z=Be(C,r),O=1-Math.min(1,Math.max((z-100)/900,0)),T=g.items&&g.items.some(U=>U.averageWastedBytes),N=z*257;o[m]={score:O,scoreDisplayMode:"numeric",displayValue:T?`${(N/1024).toLocaleString(void 0,{maximumFractionDigits:0})} KB`:`${(z/1e3).toLocaleString(void 0,{maximumFractionDigits:1})} s`,details:{type:"opportunity",overallSavingsMs:z,overallSavingsBytes:T?N:void 0,items:[]}}}else{let{passRate:z=1}=g;o[m]={score:r.next()<=z?1:0,scoreDisplayMode:"binary"}}let x={};if(g.items){let z=[];for(let p of g.items){let l=p,{url:T,inclusionRate:N=1}=l,U=ht(l,["url","inclusionRate"]);if(r.next()>N)continue;let Z={};T&&(T.includes("lorempixel")&&(x.thumbnail={key:"url",valueType:"thumbnail"}),x.url={key:"url",valueType:"url",label:"URL"},Z.url=new URL(T,e).href);for(let u of Object.keys(U))if(u.startsWith("average")){let h=u.replace("average","").replace(/^\w/,R=>R.toLowerCase()),A=u.endsWith("Ms")?"timespanMs":"bytes";x[h]={key:h,valueType:A,label:ge.startCase(h)};let H=U[u];Z[h]=Be(H,r)}else x[u]={key:u,valueType:"text",label:ge.startCase(u)},Z[u]=U[u];z.push(Z)}let O=o[m].details||{type:"table"};O.headings=Object.values(x).map(T=>Me(m)==="load-opportunities"?T:X(j({},T),{itemType:T.valueType,text:T.label,valueType:void 0})),O.items=z,o[m].details=O}o[m].title=ge.startCase(m),o[m].description=`Help text for ${ge.startCase(m)}. ${i.slice(0,Math.round(m.length*1.5)).join(" ")}.`}let a={},s=ge.groupBy(Object.entries(o),g=>ur(g[0]));for(let g of s){let m=ur(g[0][0]),v=g.reduce((C,F)=>C+(F[1].score||0),0);a[m]={id:m,title:m.toUpperCase(),score:v/g.length,auditRefs:g.map(([C])=>({id:C,weight:1,group:Me(C)}))}}let f=new Date("2019-08-01T12:00:00").getTime(),c=Math.round(r.next()*1e3*60*60*24*7),d=new Date(f+c).toISOString();return{requestedUrl:e,finalUrl:e,categories:a,audits:o,fetchTime:d,lighthouseVersion:"5.2.0",configSettings:{channel:"cli"},categoryGroups:{metrics:{title:"Metrics"},"load-opportunities":{title:"Opportunities"},diagnostics:{title:"Diagnostics"},accessibility:{title:"Accessibility"},seo:{title:"SEO"},"best-practices":{title:"Best Practices"},"pwa-fast-reliable":{title:"PWA Fast & Reliable"},"pwa-installable":{title:"PWA Installable"},"pwa-optimized":{title:"PWA Optimized"}},runWarnings:[],userAgent:"Chrome!",environment:{hostUserAgent:"",networkUserAgent:"",benchmarkIndex:500},timing:{total:1,entries:[]},i18n:{rendererFormattedStrings:{},icuMessagePaths:{}}}}dr.exports={createLHR:Pn,generateNumericValue:Be,getGroupForAuditId:Me}});var E=S((Za,zr)=>{"use strict";var zn=$(),{getGroupForAuditId:Ln}=pr(),An=["main-thread-tasks","screenshot-thumbnails","metrics"];function nt(e,t="audit"){if(e===0)return"neutral";let r=e<0;return t==="score"&&(r=e>0),r?"improvement":"regression"}function Fn(e){switch(e.type){case"error":return"regression";case"score":return nt(ie(e).delta,"score");case"numericValue":case"itemCount":case"itemDelta":return nt(ie(e).delta,"audit");case"itemAddition":return"regression";case"itemRemoval":return"improvement";default:return"neutral"}}function yr(e){if(!e.length)return"no change";if(e.some(r=>r.type==="itemAddition"))return"added";if(e.some(r=>r.type==="itemRemoval"))return"removed";let t=e.filter(r=>r.type==="itemDelta");return t.every(r=>r.compareValue>r.baseValue)?"worse":t.every(r=>r.compareValue<r.baseValue)?"better":t.length?"ambiguous":"no change"}function ct(e,t,r){return e.filter(o=>{let i="compareItemIndex"in o?o.compareItemIndex:void 0,a="baseItemIndex"in o?o.baseItemIndex:void 0;return typeof i=="number"?i===t:typeof a=="number"?a===r:!1})}function it(e,t,r){return yr(ct(e,t,r))}function mr(e,t,r){let i=ct(e,t,r).filter(wr);if(i.length)return Math.max(...i.map(a=>ie(a).delta))}function Dn(e){return e.some(t=>t==="regression")?"regression":e.some(t=>t==="neutral")?"neutral":"improvement"}function wr(e){return["score","numericValue","itemCount","itemDelta"].includes(e.type)}function gr(e){return typeof e!="number"?"error":e>=.9?"pass":e>=.5?"average":"fail"}function Nn(e,t){return typeof e!="number"?"error":e<=t[0]?"pass":e<=t[1]?"average":"fail"}function Tn(e){let t=wr(e)?ie(e).absoluteDelta:0;return e.type==="error"?1e12:e.type==="score"?1e10*t:e.type==="numericValue"?1e8*Math.max(t/1e3,1):e.type==="itemCount"?1e6*t:e.type==="itemAddition"||e.type==="itemRemoval"?1e5:e.type==="itemDelta"?Math.min(Math.max(t/100,1),99999):0}function ie(e){let{baseValue:t,compareValue:r}=e,o=r-t,i=Math.abs(o);if(o===0)return{delta:o,absoluteDelta:i,percentDelta:0,percentAbsoluteDelta:0};let a=t?o/t:1,s=Math.abs(a);return{delta:o,absoluteDelta:i,percentDelta:a,percentAbsoluteDelta:s}}function he(e){let{auditId:t,type:r,baseValue:o,compareValue:i,baseItemIndex:a,compareItemIndex:s,itemKey:f}=e;if(r==="itemAddition"){if(typeof s!="number")throw new Error("compareItemIndex is not set");return{auditId:t,type:r,compareItemIndex:s}}if(r==="itemRemoval"){if(typeof a!="number")throw new Error("baseItemIndex is not set");return{auditId:t,type:r,baseItemIndex:a}}if(r==="displayValue")throw new Error("Do not use createAuditDiff for displayValue, just manually create");if(typeof i!="number"||typeof o!="number"||!Number.isFinite(o)||!Number.isFinite(i)||r==="error")return{auditId:t,type:"error",attemptedType:r,baseValue:o||NaN,compareValue:i||NaN};let c={auditId:t,type:"score",baseValue:o,compareValue:i};if(r==="itemDelta"){if(typeof f!="string")throw new Error("itemKey is not set");if(typeof a!="number"&&typeof s!="number")throw new Error("Either baseItemIndex or compareItemIndex must be set");return X(j({},c),{type:"itemDelta",baseItemIndex:a,compareItemIndex:s,itemKey:f})}return X(j({},c),{type:r})}function On(e,t,r,o){let i=[];for(let a of Object.keys(t.item)){let s=t.item[a],f=r.item[a];typeof s!="number"||typeof f!="number"||o.some(c=>c.key===a)&&i.push(he({auditId:e,type:"itemDelta",itemKey:a,baseItemIndex:t.index,compareItemIndex:r.index,baseValue:s,compareValue:f}))}return i}function Cr(e,t,r){let o=[];for(let i of e){if(i.type!=="itemAddition"&&i.type!=="itemRemoval")continue;let a=i.type==="itemAddition"?r[i.compareItemIndex]:t[i.baseItemIndex];for(let s of Object.keys(a)){let f=i.type==="itemAddition"?0:a[s],c=i.type==="itemAddition"?a[s]:0;if(typeof c!="number"||typeof f!="number")continue;let d=i.type==="itemAddition"?"compareItemIndex":"baseItemIndex",p=i.type==="itemAddition"?i.compareItemIndex:i.baseItemIndex;o.push(he({auditId:i.auditId,type:"itemDelta",itemKey:s,[d]:p,baseValue:f,compareValue:c}))}}return o}function xr(e){if(e.startsWith("http")&&e.includes("?"))try{let t=new URL(e);t.search="",e=t.href}catch(t){}return e.replace(/www-embed-player-[0-9a-z]+/i,"www-embed-player").replace(/player_ias-[0-9a-z]+/i,"player_ias").replace(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,"UUID").replace(/:[0-9]{3,5}\//,":PORT/").replace(/(\.|-)[0-9a-f]{6,8}\.(js|css|woff|html|png|jpeg|jpg|svg)/i,"$1HASH.$2")}function at(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(t=>at(t));{let t=e,o=Object.keys(e).filter(a=>!a.startsWith("_")),i={};for(let a of o)i[a]=at(t[a]);return i}}function st(e){var r,o,i;let t=e.source;return typeof t=="string"?t:t&&t.url?`${t.url}:${t.line}:${t.column}`:typeof e.label=="string"?e.label:typeof e.groupLabel=="string"?e.groupLabel:typeof e.name=="string"?e.name:typeof e.statistic=="string"?e.statistic:e.entity&&typeof e.entity.text=="string"?e.entity.text:typeof((r=e.node)==null?void 0:r.path)=="string"?e.node.path:typeof((o=e.tapTarget)==null?void 0:o.path)=="string"&&typeof((i=e.overlappingTarget)==null?void 0:i.path)=="string"?`${e.tapTarget.path} + ${e.overlappingTarget.path}`:typeof e.url=="string"&&e.url?e.url:typeof e.origin=="string"&&e.origin?e.origin:JSON.stringify(at(e))}function Pr(e,t){let r=zn.groupIntoMap([...e.map((i,a)=>({item:i,kind:"base",index:a})),...t.map((i,a)=>({item:i,kind:"compare",index:a}))],i=>xr(st(i.item))),o=[];for(let i of r.values()){let a=i.filter(f=>f.kind==="base"),s=i.filter(f=>f.kind==="compare");if(a.length>1||s.length>1){for(let f of i)o.push({[f.kind]:f});continue}o.push({base:a[0],compare:s[0]})}return o}function Hn(e,t){let r=["added","worse","ambiguous","removed","better","no change"];return t.map(o=>X(j({},o),{diffs:ct(e,o.compare&&o.compare.index,o.base&&o.base.index)})).sort((o,i)=>{let a=o.compare&&o.compare.index,s=o.base&&o.base.index,f=i.compare&&i.compare.index,c=i.base&&i.base.index,d=r.indexOf(it(e,a,s)),p=r.indexOf(it(e,f,c)),l=st(o.compare&&o.compare.item||o.base&&o.base.item||{}),g=st(i.compare&&i.compare.item||i.base&&i.base.item||{}),m=mr(e,a,s),v=mr(e,f,c);return d===p?typeof m=="number"&&typeof v=="number"?v-m:l.localeCompare(g):d-p})}function jn(e,t,r,o){let i=[];for(let{base:a,compare:s}of Pr(t,r))if(a&&s)i.push(...On(e,a,s,o));else if(s)i.push({type:"itemAddition",auditId:e,compareItemIndex:s.index});else if(a)i.push({type:"itemRemoval",auditId:e,baseItemIndex:a.index});else throw new Error("Impossible");return i}function hr(e){return e.scoreDisplayMode==="notApplicable"?1:e.scoreDisplayMode==="informative"?0:e.score}function lt(e){return typeof e.numericValue!="number"&&e.details&&typeof e.details.overallSavingsMs=="number"?e.details.overallSavingsMs:e.numericValue}function vr(e){return e.scoreDisplayMode==="notApplicable"?0:lt(e)}function br(e){return e.details?{items:e.details.items||[],headings:e.details.headings||[]}:{items:[],headings:[]}}function Rn(e,t,r={}){let o=e.id||"",{percentAbsoluteDeltaThreshold:i=0}=r,a=[];if(An.includes(o))return a;(typeof e.score=="number"||typeof t.score=="number")&&a.push(he({auditId:o,type:"score",baseValue:hr(e),compareValue:hr(t)})),(typeof lt(e)=="number"||typeof lt(t)=="number")&&a.push(he({auditId:o,type:"numericValue",baseValue:vr(e),compareValue:vr(t)})),(typeof e.displayValue=="string"||typeof t.displayValue=="string")&&a.push({auditId:o,type:"displayValue",baseValue:e.displayValue||"",compareValue:t.displayValue||""});let s=!1,f=e.details||{},c=t.details||{};if(f.type!=="debugdata"&&f.type!=="checklist"&&f.items||c.type!=="debugdata"&&c.type!=="checklist"&&c.items){s=!0;let{items:g,headings:m}=br(e),{items:v,headings:C}=br(t),F=m.concat(C);a.push(he({auditId:o,type:"itemCount",baseValue:g.length,compareValue:v.length})),a.push(...jn(o,g,v,F)),r.synthesizeItemKeyDiffs&&a.push(...Cr(a,g,v))}let d=a.filter(g=>g.type==="error"||g.type==="itemAddition"||g.type==="itemRemoval"?!0:g.type==="score"&&!r.forceAllScoreDiffs?gr(g.baseValue)!==gr(g.compareValue):g.type==="displayValue"?g.baseValue!==g.compareValue&&!r.skipDisplayValueDiffs:ie(g).percentAbsoluteDelta>i);if(d.length===1&&d[0].type==="displayValue")return[];let p=t.score===1&&e.score===1;return Ln(o)!=="metrics"&&d.every(g=>g.type==="displayValue"||g.type==="numericValue")&&(p||s)?[]:d}zr.exports={findAuditDiffs:Rn,getDiffSeverity:Tn,getDeltaLabel:nt,getDeltaStats:ie,getDiffLabel:Fn,getRowLabel:yr,getRowLabelForIndex:it,getMostSevereDiffLabel:Dn,getMetricScoreLevel:Nn,zipBaseAndCompareItems:Pr,synthesizeItemKeyDiffs:Cr,sortZippedBaseAndCompareItems:Hn,replaceNondeterministicStrings:xr}});var Dr=S((es,Fr)=>{"use strict";function Xn(e){let t=[],r=e.split(/\[([^\]]+?)\]\((https?:\/\/.*?)\)/g);for(;r.length;){let[o,i,a]=r.splice(0,3);o&&t.push({isLink:!1,text:o}),i&&a&&t.push({isLink:!0,text:i,linkHref:a})}return t}Fr.exports={splitMarkdownLink:Xn}});var Ae,b,xt,Bo,K,vt,Pt,Ve,ko,ce={},zt=[],Uo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Fe=Array.isArray;function J(e,t){for(var r in t)e[r]=t[r];return e}function Lt(e){var t=e.parentNode;t&&t.removeChild(e)}function n(e,t,r){var o,i,a,s={};for(a in t)a=="key"?o=t[a]:a=="ref"?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?Ae.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return ze(e,s,o,i,null)}function ze(e,t,r,o,i){var a={type:e,props:t,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i==null?++xt:i,__i:-1,__u:0};return i==null&&b.vnode!=null&&b.vnode(a),a}function y(e){return e.children}function G(e,t){this.props=e,this.context=t}function ee(e,t){if(t==null)return e.__?ee(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?ee(e):null}function At(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return At(e)}}function bt(e){(!e.__d&&(e.__d=!0)&&K.push(e)&&!Le.__r++||vt!==b.debounceRendering)&&((vt=b.debounceRendering)||Pt)(Le)}function Le(){var e,t,r,o,i,a,s,f,c;for(K.sort(Ve);e=K.shift();)e.__d&&(t=K.length,o=void 0,a=(i=(r=e).__v).__e,f=[],c=[],(s=r.__P)&&((o=J({},i)).__v=i.__v+1,b.vnode&&b.vnode(o),We(s,o,i,r.__n,s.ownerSVGElement!==void 0,32&i.__u?[a]:null,f,a==null?ee(i):a,!!(32&i.__u),c),o.__.__k[o.__i]=o,Nt(f,o,c),o.__e!=a&&At(o)),K.length>t&&K.sort(Ve));Le.__r=0}function Ft(e,t,r,o,i,a,s,f,c,d,p){var l,g,m,v,C,F=o&&o.__k||zt,w=t.length;for(r.__d=c,Zo(r,t,F),c=r.__d,l=0;l<w;l++)(m=r.__k[l])!=null&&typeof m!="boolean"&&typeof m!="function"&&(g=m.__i===-1?ce:F[m.__i]||ce,m.__i=l,We(e,m,g,i,a,s,f,c,d,p),v=m.__e,m.ref&&g.ref!=m.ref&&(g.ref&&Ee(g.ref,null,m),p.push(m.ref,m.__c||v,m)),C==null&&v!=null&&(C=v),65536&m.__u||g.__k===m.__k?c=Dt(m,c,e):typeof m.type=="function"&&m.__d!==void 0?c=m.__d:v&&(c=v.nextSibling),m.__d=void 0,m.__u&=-196609);r.__d=c,r.__e=C}function Zo(e,t,r){var o,i,a,s,f,c=t.length,d=r.length,p=d,l=0;for(e.__k=[],o=0;o<c;o++)(i=e.__k[o]=(i=t[o])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?ze(null,i,null,null,i):Fe(i)?ze(y,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?ze(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,f=So(i,r,s=o+l,p),i.__i=f,a=null,f!==-1&&(p--,(a=r[f])&&(a.__u|=131072)),a==null||a.__v===null?(f==-1&&l--,typeof i.type!="function"&&(i.__u|=65536)):f!==s&&(f===s+1?l++:f>s?p>c-s?l+=f-s:l--:l=f<s&&f==s-1?f-s:0,f!==o+l&&(i.__u|=65536))):(a=r[o])&&a.key==null&&a.__e&&(a.__e==e.__d&&(e.__d=ee(a)),Ge(a,a,!1),r[o]=null,p--);if(p)for(o=0;o<d;o++)(a=r[o])!=null&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=ee(a)),Ge(a,a))}function Dt(e,t,r){var o,i;if(typeof e.type=="function"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=Dt(o[i],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function fe(e,t){return t=t||[],e==null||typeof e=="boolean"||(Fe(e)?e.some(function(r){fe(r,t)}):t.push(e)),t}function So(e,t,r,o){var i=e.key,a=e.type,s=r-1,f=r+1,c=t[r];if(c===null||c&&i==c.key&&a===c.type)return r;if(o>(c!=null&&!(131072&c.__u)?1:0))for(;s>=0||f<t.length;){if(s>=0){if((c=t[s])&&!(131072&c.__u)&&i==c.key&&a===c.type)return s;s--}if(f<t.length){if((c=t[f])&&!(131072&c.__u)&&i==c.key&&a===c.type)return f;f++}}return-1}function yt(e,t,r){t[0]==="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||Uo.test(t)?r:r+"px"}function Pe(e,t,r,o,i){var a;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)r&&t in r||yt(e.style,t,"");if(r)for(t in r)o&&r[t]===o[t]||yt(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")a=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?o?r.u=o.u:(r.u=Date.now(),e.addEventListener(t,a?Ct:wt,a)):e.removeEventListener(t,a?Ct:wt,a);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=r==null?"":r;break e}catch(s){}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,r))}}function wt(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(b.event?b.event(e):e)}function Ct(e){return this.l[e.type+!0](b.event?b.event(e):e)}function We(e,t,r,o,i,a,s,f,c,d){var p,l,g,m,v,C,F,w,x,z,O,T,N,U,Z,u=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),a=[f=t.__e=r.__e]),(p=b.__b)&&p(t);e:if(typeof u=="function")try{if(w=t.props,x=(p=u.contextType)&&o[p.__c],z=p?x?x.props.value:p.__:o,r.__c?F=(l=t.__c=r.__c).__=l.__E:("prototype"in u&&u.prototype.render?t.__c=l=new u(w,z):(t.__c=l=new G(w,z),l.constructor=u,l.render=_o),x&&x.sub(l),l.props=w,l.state||(l.state={}),l.context=z,l.__n=o,g=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),u.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=J({},l.__s)),J(l.__s,u.getDerivedStateFromProps(w,l.__s))),m=l.props,v=l.state,l.__v=t,g)u.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(u.getDerivedStateFromProps==null&&w!==m&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(w,z),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(w,l.__s,z)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(l.props=w,l.state=l.__s,l.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(h){h&&(h.__=t)}),O=0;O<l._sb.length;O++)l.__h.push(l._sb[O]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(w,l.__s,z),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(m,v,C)})}if(l.context=z,l.props=w,l.__P=e,l.__e=!1,T=b.__r,N=0,"prototype"in u&&u.prototype.render){for(l.state=l.__s,l.__d=!1,T&&T(t),p=l.render(l.props,l.state,l.context),U=0;U<l._sb.length;U++)l.__h.push(l._sb[U]);l._sb=[]}else do l.__d=!1,T&&T(t),p=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++N<25);l.state=l.__s,l.getChildContext!=null&&(o=J(J({},o),l.getChildContext())),g||l.getSnapshotBeforeUpdate==null||(C=l.getSnapshotBeforeUpdate(m,v)),Ft(e,Fe(Z=p!=null&&p.type===y&&p.key==null?p.props.children:p)?Z:[Z],t,r,o,i,a,s,f,c,d),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),F&&(l.__E=l.__=null)}catch(h){t.__v=null,c||a!=null?(t.__e=f,t.__u|=c?160:32,a[a.indexOf(f)]=null):(t.__e=r.__e,t.__k=r.__k),b.__e(h,t,r)}else a==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=Io(r.__e,t,r,o,i,a,s,c,d);(p=b.diffed)&&p(t)}function Nt(e,t,r){t.__d=void 0;for(var o=0;o<r.length;o++)Ee(r[o],r[++o],r[++o]);b.__c&&b.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(a){a.call(i)})}catch(a){b.__e(a,i.__v)}})}function Io(e,t,r,o,i,a,s,f,c){var d,p,l,g,m,v,C,F=r.props,w=t.props,x=t.type;if(x==="svg"&&(i=!0),a!=null){for(d=0;d<a.length;d++)if((m=a[d])&&"setAttribute"in m==!!x&&(x?m.localName===x:m.nodeType===3)){e=m,a[d]=null;break}}if(e==null){if(x===null)return document.createTextNode(w);e=i?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,w.is&&w),a=null,f=!1}if(x===null)F===w||f&&e.data===w||(e.data=w);else{if(a=a&&Ae.call(e.childNodes),F=r.props||ce,!f&&a!=null)for(F={},d=0;d<e.attributes.length;d++)F[(m=e.attributes[d]).name]=m.value;for(d in F)m=F[d],d=="children"||(d=="dangerouslySetInnerHTML"?l=m:d==="key"||d in w||Pe(e,d,null,m,i));for(d in w)m=w[d],d=="children"?g=m:d=="dangerouslySetInnerHTML"?p=m:d=="value"?v=m:d=="checked"?C=m:d==="key"||f&&typeof m!="function"||F[d]===m||Pe(e,d,m,F[d],i);if(p)f||l&&(p.__html===l.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(l&&(e.innerHTML=""),Ft(e,Fe(g)?g:[g],t,r,o,i&&x!=="foreignObject",a,s,a?a[0]:r.__k&&ee(r,0),f,c),a!=null)for(d=a.length;d--;)a[d]!=null&&Lt(a[d]);f||(d="value",v!==void 0&&(v!==e[d]||x==="progress"&&!v||x==="option"&&v!==F[d])&&Pe(e,d,v,F[d],!1),d="checked",C!==void 0&&C!==e[d]&&Pe(e,d,C,F[d],!1))}return e}function Ee(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(o){b.__e(o,r)}}function Ge(e,t,r){var o,i;if(b.unmount&&b.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||Ee(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){b.__e(a,t)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&Ge(o[i],t,r||typeof e.type!="function");r||e.__e==null||Lt(e.__e),e.__=e.__e=e.__d=void 0}function _o(e,t,r){return this.constructor(e,r)}function ue(e,t,r){var o,i,a,s;b.__&&b.__(e,t),i=(o=typeof r=="function")?null:r&&r.__k||t.__k,a=[],s=[],We(t,e=(!o&&r||t).__k=n(y,null,[e]),i||ce,ce,t.ownerSVGElement!==void 0,!o&&r?[r]:i?null:t.firstChild?Ae.call(t.childNodes):null,a,!o&&r?r:i?i.__e:t.firstChild,o,s),Nt(a,e,s)}Ae=zt.slice,b={__e:function(e,t,r,o){for(var i,a,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,o||{}),s=i.__d),s)return i.__E=i}catch(f){e=f}throw e}},xt=0,Bo=function(e){return e!=null&&e.constructor==null},G.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=J({},this.state),typeof e=="function"&&(e=e(J({},r),this.props)),e&&J(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),bt(this))},G.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),bt(this))},G.prototype.render=y,K=[],Pt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ve=function(e,t){return e.__v.__b-t.__v.__b},Le.__r=0,ko=0;var de,M,Ye,Tt,pe=0,Bt=[],De=[],Ot=b.__b,Ht=b.__r,jt=b.diffed,Rt=b.__c,Xt=b.unmount;function qe(e,t){b.__h&&b.__h(M,e,pe||t),pe=0;var r=M.__H||(M.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:De}),r.__[e]}function B(e){return pe=1,kt(Zt,e)}function kt(e,t,r){var o=qe(de++,2);if(o.t=e,!o.__c&&(o.__=[r?r(t):Zt(void 0,t),function(f){var c=o.__N?o.__N[0]:o.__[0],d=o.t(c,f);c!==d&&(o.__N=[d,o.__[1]],o.__c.setState({}))}],o.__c=M,!M.u)){var i=function(f,c,d){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(g){return g.__c});if(p.every(function(g){return!g.__N}))return!a||a.call(this,f,c,d);var l=!1;return p.forEach(function(g){if(g.__N){var m=g.__[0];g.__=g.__N,g.__N=void 0,m!==g.__[0]&&(l=!0)}}),!(!l&&o.__c.props===f)&&(!a||a.call(this,f,c,d))};M.u=!0;var a=M.shouldComponentUpdate,s=M.componentWillUpdate;M.componentWillUpdate=function(f,c,d){if(this.__e){var p=a;a=void 0,i(f,c,d),a=p}s&&s.call(this,f,c,d)},M.shouldComponentUpdate=i}return o.__N||o.__}function k(e,t){var r=qe(de++,3);!b.__s&&Ut(r.__H,t)&&(r.__=e,r.i=t,M.__H.__h.push(r))}function W(e){return pe=5,Te(function(){return{current:e}},[])}function Te(e,t){var r=qe(de++,7);return Ut(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Ke(e,t){return pe=8,Te(function(){return e},t)}function Vo(){for(var e;e=Bt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ne),e.__H.__h.forEach(Je),e.__H.__h=[]}catch(t){e.__H.__h=[],b.__e(t,e.__v)}}b.__b=function(e){M=null,Ot&&Ot(e)},b.__r=function(e){Ht&&Ht(e),de=0;var t=(M=e.__c).__H;t&&(Ye===M?(t.__h=[],M.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=De,r.__N=r.i=void 0})):(t.__h.forEach(Ne),t.__h.forEach(Je),t.__h=[],de=0)),Ye=M},b.diffed=function(e){jt&&jt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Bt.push(t)!==1&&Tt===b.requestAnimationFrame||((Tt=b.requestAnimationFrame)||Go)(Vo)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==De&&(r.__=r.__V),r.i=void 0,r.__V=De})),Ye=M=null},b.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Ne),r.__h=r.__h.filter(function(o){return!o.__||Je(o)})}catch(o){t.some(function(i){i.__h&&(i.__h=[])}),t=[],b.__e(o,r.__v)}}),Rt&&Rt(e,t)},b.unmount=function(e){Xt&&Xt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{Ne(o)}catch(i){t=i}}),r.__H=void 0,t&&b.__e(t,r.__v))};var Mt=typeof requestAnimationFrame=="function";function Go(e){var t,r=function(){clearTimeout(o),Mt&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(r,100);Mt&&(t=requestAnimationFrame(r))}function Ne(e){var t=M,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),M=t}function Je(e){var t=M;e.__c=e.__(),M=t}function Ut(e,t){return!e||e.length!==t.length||t.some(function(r,o){return r!==e[o]})}function Zt(e,t){return typeof t=="function"?t(e):t}function Qe(e){var t,r,o="";if(e)if(typeof e=="object")if(e.push)for(t=0;t<e.length;t++)e[t]&&(r=Qe(e[t]))&&(o&&(o+=" "),o+=r);else for(t in e)e[t]&&(r=Qe(t))&&(o&&(o+=" "),o+=r);else typeof e!="boolean"&&!e.call&&(o&&(o+=" "),o+=e);return o}function L(){for(var e=0,t,r="";e<arguments.length;)(t=Qe(arguments[e++]))&&(r&&(r+=" "),r+=t);return r}var Eo=St(),Yo=()=>n("img",{src:Eo,alt:"Loading spinner"}),$e=e=>n("div",{className:L("loading-spinner",{"loading-spinner--container":!e.solo})},n(Yo,null));var q=e=>{let{children:t}=e;return n("div",{className:L("paper",e.className)},t)};var rr=I(Qt()),dn=I($());var or=new rr.default({rootURL:window.location.origin,URL:window.URL,fetch:window.fetch.bind(window)});function Re(e){return P(this,null,function*(){let r=(yield or.getViewerOrigin()).viewerOrigin||"https://googlechrome.github.io";window.addEventListener("message",function s(f){f.origin===r&&a&&f.data.opened&&(a.postMessage({lhresults:e},r),window.removeEventListener("message",s))});let o=e.fetchTime,i=`${e.lighthouseVersion}-${e.requestedUrl}-${o}`,a=window.open(`${r}/lighthouse/viewer`,i)})}var Xe=e=>{let{children:t,lhr:r}=e,[o,i]=B(!1);return n("span",{className:L("lhr-viewer-link",e.className,{"lhr-viewer-link--loading":o}),onClick:a=>P(void 0,null,function*(){if(a.preventDefault(),a.stopImmediatePropagation(),o)return;if(typeof r=="object")return Re(r);i(!0);let s=yield r();i(!1),Re(s)})},t)};var mn=nr(),rt=e=>{let{lhr:t,label:r="Open Report"}=e;return n(Xe,{lhr:t},n("div",{className:"lhr-viewer-button",role:"button"},n("img",{src:mn})," ",n("span",null,r)))};var sr=ir(),me=ar();function ot(e){if(e.includes("<script>window.__LIGHTHOUSE_JSON__ = ")){let t=e.match(/window\.__LIGHTHOUSE_JSON__ = (.*?});<\/script>/);t&&(e=t[1])}if(e.trim().charAt(0)==="{")try{let t=JSON.parse(e);return t.lighthouseVersion?t:new Error("JSON did not contain a lighthouseVersion")}catch(t){return new Error(`File was not valid JSON (${t.message})`)}return new Error("File was not a valid report")}function lr(e,t){let r=new URL(e.finalUrl),o=new URL(t.finalUrl);return r.hostname!==o.hostname?"hostname":r.pathname!==o.pathname?"pathname":r.search!==o.search?"path":r.pathname.length<5?"timestamp-hostname":"timestamp-pathname"}var vn=e=>{let{filename:t,lhr:r}=e.report,o=new URL(r.finalUrl),i=new Date(r.fetchTime).toLocaleString(),a={filename:t,hostname:o.hostname,pathname:o.pathname,path:`${o.pathname}${o.search}`,"timestamp-hostname":`${i} (${o.hostname})`,"timestamp-pathname":`${i} (${o.pathname})`},s=`${o.href} at ${i}`;return n("span",{title:s},a[e.displayType])};function cr(e,t){let r=t[0].name,o=new FileReader;o.readAsText(t[0],"utf-8"),o.addEventListener("load",()=>{if(typeof o.result!="string"){e.addToast({message:"File was not readable as text!",level:"error"});return}let i=ot(o.result);if(i instanceof Error){e.addToast({message:`Invalid file: ${i.message}`,level:"error"});return}e.setReport({filename:r,data:o.result,lhr:i})}),o.addEventListener("error",()=>{e.addToast({message:"File was not readable!",level:"error"})})}function bn(e,t,r,o){o.target instanceof HTMLElement&&(o.stopPropagation(),o.preventDefault(),r(!0),t.current=o.target)}function yn(e,t,r,o){o.target===t.current&&(o.stopPropagation(),o.preventDefault(),r(!1),t.current=void 0)}function wn(e,t,r,o){t.current&&(o.stopPropagation(),o.preventDefault())}function Cn(e,t,r,o){t.current&&o instanceof DragEvent&&o.dataTransfer&&(o.stopPropagation(),o.preventDefault(),r(!1),t.current=void 0,cr(e,o.dataTransfer.files))}var ne=e=>{let[t,r]=B(!1),o=W(void 0),i=c=>bn(e,o,r,c),a=c=>yn(e,o,r,c),s=c=>wn(e,o,r,c),f=c=>Cn(e,o,r,c);return k(()=>{if(e.dragTarget==="document")return document.addEventListener("dragenter",i),document.addEventListener("dragleave",a),document.addEventListener("dragover",s),document.addEventListener("drop",f),()=>{document.removeEventListener("dragenter",i),document.removeEventListener("dragleave",a),document.removeEventListener("dragover",s),document.removeEventListener("drop",f)}},[e.dragTarget,e.addToast,e.setReport,o.current]),n("div",{className:L(`report-upload-box report-upload-box--${e.variant}`,{"report-upload-box--drop":t,"report-upload-box--document-target":e.dragTarget==="document"}),onDragEnter:i,onDragLeave:a,onDragOver:s,onDrop:f},n("div",{className:"report-upload-box__drop-outline"},"Drop your report to upload"),n("span",{className:"report-upload-box__label"},e.variant==="base"?"Base":"Compare"),n("div",{className:"report-upload-box__file"},e.report?n(vn,{report:e.report,displayType:e.displayType}):n(y,null)),n("div",{className:"report-upload-box__lhr-link"},e.report&&e.showOpenLhrLink?n(rt,{lhr:e.report.lhr,label:"View Report"}):null),n("div",{className:"report-upload-box__spacer"}),n("label",{className:"report-upload-box__upload"},"Select file",n("input",{type:"file",style:{display:"none"},onChange:c=>{let d=c.target;if(!(d instanceof HTMLInputElement))return;let p=d.files;!p||p.length!==1||cr(e,p)}})))};var fr=e=>n("div",{className:"landing"},n("div",{className:"landing__background"},n("img",{src:sr,alt:"Lighthouse CI Background Image"})),n(q,{className:"landing__paper"},n("div",{className:"landing__logos"},n("img",{className:"landing__logo",src:me,alt:"Lighthouse Logo"}),n("img",{className:"landing__logo landing__logo--diff",src:me,alt:""}),n("h1",null,"Lighthouse Report Diff Tool")),n("p",null,"Provide two Lighthouse reports to start comparing!"),n("p",null,n("a",{href:"./?baseReport=https://googlechrome.github.io/lighthouse-ci/packages/server/test/fixtures/lh-5-6-0-verge-a.json&compareReport=https://googlechrome.github.io/lighthouse-ci/packages/server/test/fixtures/lh-5-6-0-verge-b.json"},"View example diff")),n("div",{className:"landing__upload"},n(ne,{variant:"base",report:e.baseReport,setReport:e.setBaseReport,addToast:e.addToast,displayType:"filename",dragTarget:e.baseReport?"self":"document"}),n(ne,{variant:"compare",report:e.compareReport,setReport:e.setCompareReport,addToast:e.addToast,displayType:"filename",dragTarget:e.baseReport?"document":"self"})),n("p",null,"Above, drag 'n drop your JSON/HTML, or select the files from disk."),n("footer",null,"Powered by ",n("a",{href:"https://github.com/GoogleChrome/lighthouse-ci"},"lighthouse-ci"))));var yo=I($()),Se=I(E());var Lr=e=>{let{options:t,value:r,setValue:o,className:i,title:a,label:s}=e,f=t.some(c=>c.value===r)?t:[...t,{value:r,label:r}];return n("div",{className:L("dropdown",i),style:{position:"relative"},"data-tooltip":a},n("label",null,s?n("span",{className:"dropdown__label"},s):n(y,null),n("select",{onChange:c=>{c.target instanceof HTMLSelectElement&&o(c.target.value)}},f.map(c=>n("option",{key:c.value,value:c.value,selected:c.value===r},c.label)))),n("div",{className:"dropdown__chevron"},n("i",{className:"material-icons"},"arrow_drop_down")))};function Ar(e){let t=W(void 0);return k(()=>{t.current=e},[e]),t.current}var Y=e=>{let t=e.score;return t>=.9?n("i",{className:"lh-score-pass"}):t>=.5?n("i",{className:"lh-score-average"}):n("i",{className:"lh-score-fail"},n("svg",{viewBox:"0 0 120 120",xmlns:"http://www.w3.org/2000/svg"},n("polygon",{points:"10,110 60,10 110,110"})))},ae=e=>(e.audit.score||0)>=.9?n("span",{className:"lh-score-word"},"Pass"):n("span",{className:"lh-score-word"},"Fail");var Nr=I(Dr());var Tr=e=>{let t=(0,Nr.splitMarkdownLink)(e.text);return n(y,null,t.map((r,o)=>{if(!r.isLink)return n("span",{key:o},r.text);let i=new URL(r.linkHref);return["https://developers.google.com","https://web.dev"].includes(i.origin)&&(i.searchParams.set("utm_source","lighthouse"),i.searchParams.set("utm_medium","ci")),n("a",{key:o,href:i.href,target:"_blank",rel:"noopener noreferrer"},r.text)}))};var ve=()=>n("span",{style:{display:"inline-block",width:4,height:1}});var be=I(E());var Or=e=>{let t=e.type,{compareValue:r,baseValue:o,diff:i}=e,a=r===void 0?o:r;typeof a=="object"&&a.type&&(t=a.type);let s=i?(0,be.getDiffLabel)(i):"neutral",f=Number.isFinite(o)?o:0,c=Number.isFinite(r)?r:0,d=`Base Value: ${Math.round(f).toLocaleString()}`,p=`Compare Value: ${Math.round(c).toLocaleString()}`,l=`${d}, ${p}`,g=i&&(0,be.getDeltaStats)(i).percentAbsoluteDelta!==1?` (${((0,be.getDeltaStats)(i).percentAbsoluteDelta*100).toLocaleString(void 0,{maximumFractionDigits:0})}%)`:"";switch(t){case"bytes":{let m=Math.abs((c-f)/1024);return n("pre",{className:`simple-details--${s}`,"data-tooltip":l},c>=f?"+":"-",m.toLocaleString(void 0,{maximumFractionDigits:Math.abs(m)<1?1:0}),n(ve,null),"KB",g)}case"ms":case"timespanMs":{let m=Math.abs(Math.round(c-f));return n("pre",{className:`simple-details--${s}`,"data-tooltip":l},c>=f?"+":"-",m.toLocaleString(),n(ve,null),"ms",g)}case"thumbnail":return n("img",{style:{width:48,height:48,objectFit:"cover"},src:a,onError:m=>{let v=m.srcElement;v instanceof HTMLImageElement&&(v.onerror=null,v.src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")}});case"url":{let m=a,v="";try{let C=new URL(a);m=C.pathname,v=C.hostname}catch(C){}return n("span",{title:a},m,v?n("span",{className:"simple-details__url-hostname"},"(",v,")"):"")}case"link":return a.url?n("a",{target:"_blank",rel:"noopener noreferrer",href:a.url},a.text):n("span",null,a.text);case"code":return n("pre",null,a);case"numeric":return n("pre",{className:`simple-details--${s}`},c>=f?"+":"-",Math.abs(c-f).toLocaleString(),g);case"text":return n("span",null,a);case"node":return n("pre",null,a.snippet);case"source-location":{if(!a.url)return n("pre",null,JSON.stringify(a));let{url:m,line:v,column:C}=a;return n("pre",null,m,":",v,":",C)}case"debugdata":return n(y,null);default:{let m=JSON.stringify(e);return n("pre",{"data-tooltip":m},m.slice(0,20))}}};var se=I(E());function Mn(e){switch(e){case"bytes":case"ms":case"timespanMs":case"numeric":return!0;default:return!1}}var Hr=e=>{let{audit:t,baseAudit:r,diffs:o}=e.pair;if(!t.details)return n(y,null);let{headings:i,items:a}=t.details;if(!i||!a)return n(y,null);let s=r&&r.details&&r.details.headings||[],f=r&&r.details&&r.details.items||[],c=(0,se.zipBaseAndCompareItems)(f,a),d=(0,se.sortZippedBaseAndCompareItems)(o,c),p=i.length?i:s,l=p.findIndex(g=>Mn(g.valueType||g.itemType||"unknown"))-1;return l<0&&(l=p.length-1),n("div",{className:"table-details"},n("table",null,n("thead",null,n("tr",null,p.map((g,m)=>{let v=g.valueType||g.itemType||"unknown";return n(y,{key:m},n("th",{className:`table-column--${v}`},g.label||g.text),l===m?n("th",null):null)}))),n("tbody",null,d.map(({base:g,compare:m,diffs:v})=>{if(!(m||g))return null;let F=`${g&&g.index}-${m&&m.index}`,w=(0,se.getRowLabelForIndex)(o,m&&m.index,g&&g.index);return n("tr",{key:F},p.map((x,z)=>{let O=x.valueType||x.itemType||"unknown",T=v.find(Z=>Z.type==="itemDelta"&&Z.itemKey===x.key),N=x.key&&m&&m.item[x.key],U=x.key&&g&&g.item[x.key];return n(y,{key:z},n("td",{className:`table-column--${O}`},N||U?n(Or,{type:O,compareValue:N,baseValue:U,diff:T}):n(y,null)),l===z?n("td",{className:"table-column--row-label"},w==="added"||w==="removed"?w:""):null)}))}))))};var Mr=I(E());var jr={"first-contentful-paint":[0,1e4],"first-meaningful-paint":[0,1e4],"largest-contentful-paint":[0,15e3],"speed-index":[0,15e3],"first-cpu-idle":[0,15e3],interactive:[0,2e4],"estimated-input-latency":[0,1500],"max-potential-fid":[0,1500],"total-blocking-time":[0,1500],"experimental-interaction-to-next-paint":[0,3500],"cumulative-layout-shift":[0,1],__default__:[0,30*1e3]},Rr=(e,t)=>{let r=e&&e.id||"";return(jr[r]||jr.__default__)[t==="lower"?0:1]},Xr=(e,t)=>{let r=t==="up"?Math.ceil:Math.floor;return e<10?r(e):e<100?r(e/10)*10:e<1e3?r(e/100)*100:e<1e4?r(e/1e3)*1e3:r(e/2500)*2500},Bn=(e,t)=>{if(e&&e.id==="cumulative-layout-shift")return"none";if(t==="metrics"||t==="load-opportunities")return"ms";if(!e)return"none";if(e.details&&e.details.overallSavingsMs)return"ms";let r=e.displayValue||"";return/[0-9,.]+\s(ms|s)$/.test(r)?"ms":/[0-9,.]+\s(KB|MB)$/.test(r)?"bytes":"none"},le=(e,t)=>{let{asDelta:r=!1,withSuffix:o=!1,unit:i="none"}=t,a=Math.round(e),s=0,f="";i==="ms"&&(f="ms",Math.abs(a)>=1e3&&!t.preventSecondsConversion&&(a/=1e3,s=1,f="s")),i==="bytes"&&(f="KB",a/=1024,Math.abs(a)>=500&&(a/=1024,s=1,f="MB")),i==="none"&&(Math.abs(e)<1?(a=e,s=3):Math.abs(a)<10?(a=e,s=1):Math.abs(a)>=50&&(a/=1e3,s=1,f="K"));let c=a.toLocaleString(void 0,{minimumFractionDigits:s,maximumFractionDigits:s}),d=r&&a>=0?"+":"",p=d+c+(o?f:"");return{element:n("span",null,d,c,o?n(y,null,n(ve,null),f):""),string:p,length:p.length}},ke=e=>{let{diff:t,audit:r,groupId:o}=e,i=Bn(r,o),a=t.compareValue,s=t.baseValue;if(typeof s!="number"||typeof a!="number")return n("span",null,"No diff available");let f=a-s,c=Math.min(a,s),d=Math.max(a,s),p=e.showAsBigPicture?Rr(r,"lower"):Xr(c*.8,"down"),l=e.showAsBigPicture?Rr(r,"upper"):Xr(d*1.2,"up"),g=l-p,m=Math.min(Math.max(c,p),l),v=Math.min(Math.max(d,p),l),C=100*(m-p)/g,F=100-100*(v-p)/g,w=(0,Mr.getDeltaLabel)(f,"audit"),x=c===a,z=`${le(s,{unit:i,withSuffix:!0}).string} to ${le(a,{withSuffix:!0,unit:i}).string}`;if(e.showAsNarrow)return n("div",{className:L("audit-numeric-diff",`text--${w}`),"data-tooltip":z},le(f,{asDelta:!0,withSuffix:!0,preventSecondsConversion:!0,unit:i}).element);let{element:O,length:T}=le(f,{asDelta:!0,withSuffix:!0,preventSecondsConversion:!0,unit:i}),N=T*10*100/300;return n(y,null,n("div",{className:"audit-numeric-diff"},n("div",{className:"audit-numeric-diff__left-label"},le(p,{unit:i}).element),n("div",{className:"audit-numeric-diff__bar"},n("div",{className:L("audit-numeric-diff__box",{"audit-numeric-diff__box--improvement":w==="improvement","audit-numeric-diff__box--regression":w==="regression"}),style:{left:`${C}%`,right:`${F}%`},"data-tooltip":z},n("div",{className:"audit-numeric-diff__now",style:{left:x?"0%":"100%"}}),n("div",{className:L("audit-numeric-diff__delta-label",{"audit-numeric-diff__delta-label--narrow-left":w==="improvement"&&C<N,"audit-numeric-diff__delta-label--narrow-right":w==="regression"&&F<N}),style:{[x?"right":"left"]:"100%"}},O))),n("div",{className:"audit-numeric-diff__right-label"},le(l,{unit:i}).element)))};var kr=I($());var ye=I(E());var kn={"font-display":"font_download","uses-rel-preconnect":"language","user-timings":"timer","bootup-time":"speed","mainthread-work-breakdown":"speed","third-party-summary":"language",deprecations:"error","errors-in-console":"error","font-sizes":"format_size"},Br=e=>{let t=e.audit.id||"",r=e.groupId||"",o="";return r.includes("opportunities")&&(o="web_asset"),r.includes("a11y")&&(o="code"),t.includes("image")&&(o="photo"),o=kn[t]||o||"list_alt",n("i",{className:"material-icons"},o)},Un=e=>n(y,null,n(ae,{audit:e.baseAudit}),n("i",{className:`material-icons audit-group__diff-arrow audit-group__diff-arrow--${(0,ye.getDiffLabel)(e.diff)}`},"arrow_forward"),n(ae,{audit:e.audit})),Zn=e=>n(y,null,n("span",null,e.diff.baseValue),n("i",{className:`material-icons audit-group__diff-arrow audit-group__diff-arrow--${(0,ye.getDiffLabel)(e.diff)}`},"arrow_forward"),n("span",null,e.diff.compareValue));function Sn(e){switch(e){case"added":case"worse":case"ambiguous":return"regression";case"removed":case"better":return"improvement";case"no change":return"neutral"}}function In(e){return kr.uniqBy(e.map(t=>({base:"baseItemIndex"in t?t.baseItemIndex:void 0,compare:"compareItemIndex"in t?t.compareItemIndex:void 0})).filter(t=>typeof t.base=="number"||typeof t.compare=="number"),t=>`${t.base}-${t.compare}`)}var ft=e=>{let{diffs:t,baseAudit:r,groupId:o}=e,i=r.details&&r.details.items||[],s=In(t).map(p=>(0,ye.getRowLabelForIndex)(t,p.compare,p.base)).map(Sn),f=s.filter(p=>p==="regression").length,c=s.filter(p=>p==="improvement").length,d=n(y,null,n("div",{className:"audit-group__diff-badge-group"},n(Br,{audit:e.audit,groupId:o}),n("div",{className:"audit-group__diff-badges"},n("span",{className:"audit-group__diff-badge"},i.length))),n("i",{className:`material-icons audit-group__diff-arrow audit-group__diff-arrow--${c>f?"improvement":"regression"}`},"arrow_forward"));return n(y,null,e.showAsNarrow?n(y,null):d,n("div",{className:L("audit-group__diff-badge-group")},n(Br,{audit:e.audit,groupId:o}),n("div",{className:L("audit-group__diff-badges",{"audit-group__diff-badge-group--multiple":!!(f&&c)})},f?n("span",{className:"audit-group__diff-badge audit-group__diff-badge--regression"},f):null,c?n("span",{className:"audit-group__diff-badge audit-group__diff-badge--improvement"},c):null)))},_n=()=>n("div",{className:"audit-group__error-message","data-tooltip":"Audit did not run in the base report"},n("i",{className:"material-icons"},"error_outline")," Audit Missing"),Vn=e=>{let t="An unknown error occurred while trying to compare the audit results.";return e.audit.scoreDisplayMode==="error"?t=`Audit in compare report errored: ${e.audit.errorMessage}`:e.baseAudit.scoreDisplayMode==="error"&&(t=`Audit in base report errored: ${e.baseAudit.errorMessage}`),n("div",{className:"audit-group__error-message","data-tooltip":t},n("i",{className:"material-icons"},"error_outline")," Audit Error")},Ur=e=>{let{audit:t,baseAudit:r,diffs:o,group:i}=e.pair,a=n("span",null,"No diff available");if(!r)return n(_n,null);if(o.find(l=>l.type==="error"))return n(Vn,{audit:t,baseAudit:r});let f=o.find(l=>l.type==="numericValue");if(f&&f.type==="numericValue")return n(ke,{diff:f,audit:t,groupId:i.id,showAsBigPicture:e.showAsBigPicture,showAsNarrow:e.showAsNarrow});if(o.some(l=>l.type==="itemAddition"||l.type==="itemRemoval"||l.type==="itemDelta"))return n(ft,{diffs:o,audit:t,baseAudit:r,groupId:i.id,showAsNarrow:e.showAsNarrow});let d=o.find(l=>l.type==="score");if(d)return n(Un,{diff:d,audit:t,baseAudit:r});let p=o.find(l=>l.type==="displayValue");return!p||p.type!=="displayValue"?a:n(Zn,{diff:p,audit:t,baseAudit:r})};var Zr=I(E());var Gn=e=>{let{audit:t,baseAudit:r}=e.pair;return r?n("div",{className:"audit-detail-pane__audit-details--binary"},n(ae,{audit:r}),n("i",{className:`material-icons audit-group__diff-arrow audit-group__diff-arrow--${(0,Zr.getDiffLabel)(e.diff)}`},"arrow_forward"),n(ae,{audit:t})):null},Wn=e=>{let t=e.pair.audit.scoreDisplayMode==="error"?e.pair.audit:e.pair.baseAudit;return t?n(y,null,n("div",{className:"audit-detail-pane__audit-details-summary"},"Error occurred in the"," ",t===e.pair.baseAudit?"base report:":"compare report:"),n("pre",null,t.errorMessage||"Unknown error")):null},En=e=>{let{pair:t}=e,r=t.audit.details||{type:"unknown"},o=t.baseAudit&&t.baseAudit.details||{type:"unknown"},i=!!((r.items||[]).length||(o.items||[]).length),a,s,f;if(t.audit.errorMessage||t.baseAudit&&t.baseAudit.errorMessage)return n(Wn,{pair:t});(r.type==="table"||r.type==="opportunity")&&i&&(s=n(Hr,{pair:t}),t.baseAudit&&(a=n(ft,X(j({},t),{baseAudit:t.baseAudit,groupId:t.group.id}))));let c=t.diffs.find(p=>p.type==="numericValue");if(c&&c.type==="numericValue"&&(f=n(ke,{diff:c,audit:t.audit})),s||c)return n(y,null,n("div",{className:"audit-detail-pane__audit-details-summary"},f||a),s);let d=t.diffs.find(p=>p.type==="score");return d&&d.type==="score"?n(Gn,{diff:d,pair:e.pair}):n("pre",null,JSON.stringify(e.pair,null,2))},Sr=e=>{let{audit:t}=e.pair;return n("div",{id:`audit-detail-pane-audit--${t.id}`,className:L("audit-detail-pane__audit")},n("div",{className:"audit-detail-pane__score"},n(Y,{score:t.score||0})),n("div",{className:"audit-detail-pane__audit-title"},t.title),n("div",{className:"audit-detail-pane__audit-description"},n(Tr,{text:t.description||""})),n("div",{className:"audit-detail-pane__audit-details"},n(En,{pair:e.pair})))};var Ir=e=>{let t=W(void 0),r=Ar(e.selectedAuditId);return k(()=>{let o=e.selectedAuditId,i=t.current;if(!i||!o||o===r)return;let a=i.querySelector(`#audit-detail-pane-audit--${o}`);!a||!(a instanceof HTMLElement)||i.scrollTo(0,a.offsetTop)},[e.selectedAuditId,r]),n("div",{className:"audit-detail-pane",ref:o=>t.current=o},n("div",{className:"audit-detail-pane__close",onClick:()=>e.setSelectedAuditId(null)},n("i",{className:"material-icons"},"close")),e.pairs.map(o=>{let{audit:i}=o;if(i.id)return n(Sr,{key:i.id,pair:o})}))};var _r=I(E());var Vr=e=>{let t=Math.round(e.score*100),r=e.diff?e.diff.baseValue:e.score,o=Math.round(r*100),i=e.diff?(0,_r.getDiffLabel)(e.diff):"neutral",s=`${Math.max(0,e.score*352-2)} 352`,f=Math.abs(o-t),c=Math.max(0,f/100*352-2),d=`${c} 352`,p=`rotate(${Math.min(t,o)/100*360}deg)`,l=`rotate(${e.score*360}deg)`;return n("div",{className:L("gauge",`gauge--${i}`)},n("div",{className:"gauge-arc"},n("svg",{viewBox:"0 0 120 120"},n("circle",{className:"gauge-arc__arc",transform:"rotate(-90 60 60)",r:"56",cx:"60",cy:"60",style:{strokeDasharray:s}})),n("div",{className:"gauge-arc__delta-wrapper",style:{transform:p,display:c<1?"none":"block"}},n("svg",{viewBox:"0 0 120 120"},n("circle",{className:"gauge-arc__arc",transform:"rotate(-90 60 60)",r:"56",cx:"60",cy:"60",style:{strokeDasharray:d}}))),n("div",{className:"gauge-arc__indicator-wrapper",style:{transform:l}},n("div",{className:"gauge-arc__indicator"}))),n("span",null,t))};var Gr=I($());var Wr=e=>n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:`pwa-icon pwa-icon--${e.deltaType}`},n("g",{"fill-rule":"nonzero",fill:"none"},n("circle",{class:"pwa-icon__background",cx:"12",cy:"12",r:"12"}),n("path",{d:"M12 4.3l6.3 2.8v4.2c0 3.88-2.69 7.52-6.3 8.4-3.61-.88-6.3-4.51-6.3-8.4V7.1L12 4.3zm-.56 12.88l3.3-5.79.04-.08c.05-.1.01-.29-.26-.29h-1.96l.56-3.92h-.56L9.3 12.82c0 .03.07-.12-.03.07-.11.2-.12.37.2.37h1.97l-.56 3.92h.56z",fill:"#FFF"}))),Er=e=>n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:`pwa-icon pwa-icon--${e.deltaType}`},n("g",{"fill-rule":"nonzero",fill:"none"},n("circle",{class:"pwa-icon__background",cx:"12",cy:"12",r:"12"}),n("path",{d:"M12 5a7 7 0 1 0 0 14 7 7 0 0 0 0-14zm3.5 7.7h-2.8v2.8h-1.4v-2.8H8.5v-1.4h2.8V8.5h1.4v2.8h2.8v1.4z",fill:"#FFF"}))),Yr=e=>n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:`pwa-icon pwa-icon--${e.deltaType}`},n("g",{fill:"none","fill-rule":"evenodd"},n("rect",{class:"pwa-icon__background",width:"24",height:"24",rx:"12"}),n("path",{d:"M5 5h14v14H5z"}),n("path",{fill:"#FFF",d:"M12 15.07l3.6 2.18-.95-4.1 3.18-2.76-4.2-.36L12 6.17l-1.64 3.86-4.2.36 3.2 2.76-.96 4.1z"})));function Ue(e,t,r){return e[r]===t[r]?"neutral":t[r]?"improvement":"regression"}function ut(e){let t=e.categories.pwa,r=Gr.groupIntoMap(t.auditRefs,i=>i.group),o=(i=[])=>i.map(a=>e.audits[a.id]).every(a=>a&&a.score===1);return{optimized:o(r.get("pwa-optimized")||[]),installable:o(r.get("pwa-installable")||[]),fastAndReliable:o(r.get("pwa-fast-reliable")||[])}}var Jr=e=>{let{status:t}=e,r=t.optimized&&t.installable&&t.fastAndReliable;return n("div",{className:L("pwa-gauge",{"pwa-gauge--all":r,"pwa-gauge--pwa-optimized":!r&&t.optimized,"pwa-gauge--pwa-installable":!r&&t.installable,"pwa-gauge--pwa-fast-reliable":!r&&t.fastAndReliable})},n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60"},n("defs",null,n("linearGradient",{id:"pwa-gauge__check-circle__gradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%"},n("stop",{"stop-color":"#00C852",offset:"0%"}),n("stop",{"stop-color":"#009688",offset:"100%"})),n("linearGradient",{id:"pwa-gauge__installable__shadow-gradient",x1:"76.056%",x2:"24.111%",y1:"82.995%",y2:"24.735%"},n("stop",{"stop-color":"#A5D6A7",offset:"0%"}),n("stop",{"stop-color":"#80CBC4",offset:"100%"})),n("linearGradient",{id:"pwa-gauge__fast-reliable__shadow-gradient",x1:"76.056%",y1:"82.995%",x2:"25.678%",y2:"26.493%"},n("stop",{"stop-color":"#64B5F6",offset:"0%"}),n("stop",{"stop-color":"#2979FF",offset:"100%"})),n("g",{id:"pwa-gauge__fast-reliable-badge"},n("circle",{fill:"#FFFFFF",cx:"10",cy:"10",r:"10"}),n("path",{fill:"#304FFE",d:"M10 3.58l5.25 2.34v3.5c0 3.23-2.24 6.26-5.25 7-3.01-.74-5.25-3.77-5.25-7v-3.5L10 3.58zm-.47 10.74l2.76-4.83.03-.07c.04-.08 0-.24-.22-.24h-1.64l.47-3.26h-.47l-2.7 4.77c-.02.01.05-.1-.04.05-.09.16-.1.31.18.31h1.63l-.47 3.27h.47z"})),n("g",{id:"pwa-gauge__installable-badge"},n("circle",{fill:"#FFFFFF",cx:"10",cy:"10",r:"10"}),n("path",{fill:"#009688",d:"M10 4.167A5.835 5.835 0 0 0 4.167 10 5.835 5.835 0 0 0 10 15.833 5.835 5.835 0 0 0 15.833 10 5.835 5.835 0 0 0 10 4.167zm2.917 6.416h-2.334v2.334H9.417v-2.334H7.083V9.417h2.334V7.083h1.166v2.334h2.334v1.166z"}))),n("g",{stroke:"none","fill-rule":"nonzero"},n("circle",{class:"pwa-gauge__disc",cx:"30",cy:"30",r:"30"}),n("g",{class:"pwa-gauge__logo"},n("path",{class:"pwa-gauge__logo--secondary-color",d:"M35.66 19.39l.7-1.75h2L37.4 15 38.6 12l3.4 9h-2.51l-.58-1.61z"}),n("path",{class:"pwa-gauge__logo--primary-color",d:"M33.52 21l3.65-9h-2.42l-2.5 5.82L30.5 12h-1.86l-1.9 5.82-1.35-2.65-1.21 3.72L25.4 21h2.38l1.72-5.2 1.64 5.2z"}),n("path",{class:"pwa-gauge__logo--secondary-color","fill-rule":"nonzero",d:"M20.3 17.91h1.48c.45 0 .85-.05 1.2-.15l.39-1.18 1.07-3.3a2.64 2.64 0 0 0-.28-.37c-.55-.6-1.36-.91-2.42-.91H18v9h2.3V17.9zm1.96-3.84c.22.22.33.5.33.87 0 .36-.1.65-.29.87-.2.23-.59.35-1.15.35h-.86v-2.41h.87c.52 0 .89.1 1.1.32z"})),n("rect",{class:"pwa-gauge__component pwa-gauge__na-line",fill:"#FFFFFF",x:"20",y:"32",width:"20",height:"4",rx:"2"}),n("g",{class:"pwa-gauge__component pwa-gauge__fast-reliable-badge",transform:"translate(20, 29)"},n("path",{fill:"url(#pwa-gauge__fast-reliable__shadow-gradient)",d:"M33.63 19.49A30 30 0 0 1 16.2 30.36L3 17.14 17.14 3l16.49 16.49z"}),n("use",{href:"#pwa-gauge__fast-reliable-badge"})),n("g",{class:"pwa-gauge__component pwa-gauge__installable-badge",transform:"translate(20, 29)"},n("path",{fill:"url(#pwa-gauge__installable__shadow-gradient)",d:"M33.629 19.487c-4.272 5.453-10.391 9.39-17.415 10.869L3 17.142 17.142 3 33.63 19.487z"}),n("use",{href:"#pwa-gauge__installable-badge"})),n("g",{class:"pwa-gauge__component pwa-gauge__fast-reliable-installable-badges"},n("g",{transform:"translate(8, 29)"},n("path",{fill:"url(#pwa-gauge__fast-reliable__shadow-gradient)",d:"M16.321 30.463L3 17.143 17.142 3l22.365 22.365A29.864 29.864 0 0 1 22 31c-1.942 0-3.84-.184-5.679-.537z"}),n("use",{href:"#pwa-gauge__fast-reliable-badge"})),n("g",{transform:"translate(32, 29)"},n("path",{fill:"url(#pwa-gauge__installable__shadow-gradient)",d:"M25.982 11.84a30.107 30.107 0 0 1-13.08 15.203L3 17.143 17.142 3l8.84 8.84z"}),n("use",{href:"#pwa-gauge__installable-badge"}))),n("g",{class:"pwa-gauge__component pwa-gauge__check-circle",transform:"translate(18, 28)"},n("circle",{fill:"#FFFFFF",cx:"12",cy:"12",r:"12"}),n("path",{fill:"url(#pwa-gauge__check-circle__gradient)",d:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})))))};var qr=I(E());var Kr=e=>{let t=Math.round((e.diff.compareValue-e.diff.baseValue)*100);return n("div",{className:L("score-delta-badge",`score-delta-badge--${(0,qr.getDiffLabel)(e.diff)}`,e.className)},t<0?t:`+${t}`)};var Yn=e=>{let{lhr:t,baseLhr:r,categoryId:o}=e,i=t.categories[o],a=r&&r.categories[o],s=a&&{auditId:"",type:"score",baseValue:a.score,compareValue:i.score};return n("div",{key:o,className:L("lhr-comparison-scores-item")},n(Vr,{score:i.score,diff:s}),n("div",{className:"lhr-comparison-scores-item__label"},i.title),s?n(Kr,{diff:s,className:"lhr-comparison-scores-item__delta"}):null)},Jn=e=>{let{lhr:t,baseLhr:r,categoryId:o}=e,i=ut(t),a,s="neutral";if(r){let f=ut(r),c={fastAndReliable:Ue(f,i,"fastAndReliable"),installable:Ue(f,i,"installable"),optimized:Ue(f,i,"optimized")},d=Object.values(c).every(l=>l==="neutral"),p=n(y,null,c.fastAndReliable==="neutral"?n(y,null):n(Wr,{deltaType:c.fastAndReliable}),c.installable==="neutral"?n(y,null):n(Er,{deltaType:c.installable}),c.optimized==="neutral"?n(y,null):n(Yr,{deltaType:c.optimized}));a=n("div",{className:L("lhr-comparison-scores-item__delta")},d?"-":p)}return n("div",{key:o,className:L("lhr-comparison-scores-item","lhr-comparison-scores-item--pwa",`lhr-comparison-scores-item--${s}`)},n(Jr,{status:i}),n("div",{className:"lhr-comparison-scores-item__label"},"PWA"),a)},Qr=e=>{let{lhr:t,baseLhr:r}=e;if(!t)return null;let o=Object.keys(t.categories),i=r?Object.keys(r.categories):o,a=o.filter(s=>i.includes(s));return n("div",{className:"lhr-comparison-scores"},a.sort((s,f)=>{let c=s==="pwa"?1/0:a.indexOf(s),d=f==="pwa"?1/0:a.indexOf(f);return c-d}).map(s=>s==="pwa"?n(Jn,{lhr:t,baseLhr:r,categoryId:s}):n(Yn,{lhr:t,baseLhr:r,categoryId:s})))};var qn=e=>n("div",{className:"audit-group__big-picture-tabs"},n("span",{className:L("big-picture-tabs__tab",{"big-picture-tabs__tab--selected":e.showAsBigPicture}),onClick:()=>e.setShowAsBigPicture(!0)},"Overview"),n("span",{className:L("big-picture-tabs__tab",{"big-picture-tabs__tab--selected":!e.showAsBigPicture}),onClick:()=>e.setShowAsBigPicture(!1)},"Magnified")),Kn=e=>n(y,null,e.pairs.map(t=>{let{audit:r}=t;return e.group.id!=="metrics"&&(t=X(j({},t),{diffs:t.diffs.filter(o=>o.type!=="numericValue")})),n("div",{key:r.id,className:L("audit-group__audit"),onClick:()=>e.setSelectedAuditId(r.id||null)},n("div",{className:"audit-group__audit-score"},n(Y,{score:r.score||0})),n("div",{className:"audit-group__audit-title"},r.title),n("div",{className:"audit-group__audit-diff"},n(Ur,{pair:t,showAsBigPicture:e.showAsBigPicture,showAsNarrow:e.showAsNarrow})))})),Qn=e=>{let t=e.baseLhr;return!t||!e.expanded?n(y,null):n(y,null,e.pairs.map(r=>{let{audit:o}=r;return n("div",{key:o.id,className:L("audit-group__audit","audit-group__audit--unchanged"),onClick:i=>{i.preventDefault(),i.stopPropagation(),Re(t)}},n("div",{className:"audit-group__audit-score"},n(Y,{score:o.score||0})),n("div",{className:"audit-group__audit-title"},o.title),n("div",{className:"audit-group__audit-diff"},"Open Report"))}))},$r=e=>{let{group:t}=e,[r,o]=B(t.id==="metrics"),[i,a]=B(!1);return n(q,{className:L("audit-group",{"audit-group--expanded":i,"audit-group--unchanged":e.showAsUnchanged})},n("div",{className:"audit-group__header",onClick:()=>a(!i)},n("div",{className:"audit-group__title"},t.title," ",e.showAsUnchanged?`(${e.pairs.length})`:""),n("div",{className:"audit-group__expand-toggle"},n("i",{className:"material-icons"},"chevron_right")),t.id==="metrics"&&!e.showAsNarrow?n(qn,X(j({},e),{showAsBigPicture:r,setShowAsBigPicture:o})):n(y,null)),n("div",{className:"audit-group__audits"},e.showAsUnchanged?n(Qn,X(j({},e),{expanded:i})):n(Kn,X(j({},e),{showAsBigPicture:r}))))};var eo=()=>n("div",{className:"lhr-comparison-legend"},n(Y,{score:0}),n("span",{className:"lhr-comparison-legend__label"},"0-49"),n(Y,{score:.5}),n("span",{className:"lhr-comparison-legend__label"},"50-89"),n(Y,{score:1}),n("span",{className:"lhr-comparison-legend__label"},"90-100"),n("i",{className:"lhr-comparison-legend__chip lhr-comparison-legend__chip--regression"}),n("span",{className:"lhr-comparison-legend__label"},"Regression"),n("i",{className:"lhr-comparison-legend__chip lhr-comparison-legend__chip--improvement"}),n("span",{className:"lhr-comparison-legend__label"},"Improvement"));function ti(e,t){for(var r in t)e[r]=t[r];return e}function to(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function ro(e){this.props=e}(ro.prototype=new G).isPureReactComponent=!0,ro.prototype.shouldComponentUpdate=function(e,t){return to(this.props,e)||to(this.state,t)};var oo=b.__b;b.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),oo&&oo(e)};var Wl=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var ri=b.__e;b.__e=function(e,t,r,o){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}ri(e,t,r,o)};var no=b.unmount;function fo(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=ti({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return fo(o,t,r)})),e}function uo(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return uo(o,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function dt(){this.__u=0,this.t=null,this.__b=null}function po(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ze(){this.u=null,this.o=null}b.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),no&&no(e)},(dt.prototype=new G).__c=function(e,t){var r=t.__c,o=this;o.t==null&&(o.t=[]),o.t.push(r);var i=po(o.__v),a=!1,s=function(){a||(a=!0,r.__R=null,i?i(f):f())};r.__R=s;var f=function(){if(!--o.__u){if(o.state.__a){var c=o.state.__a;o.__v.__k[0]=uo(c,c.__c.__P,c.__c.__O)}var d;for(o.setState({__a:o.__b=null});d=o.t.pop();)d.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(s,s)},dt.prototype.componentWillUnmount=function(){this.t=[]},dt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=fo(this.__b,r,o.__O=o.__P)}this.__b=null}var i=t.__a&&n(y,null,e.fallback);return i&&(i.__u&=-33),[n(y,null,t.__a?null:e.children),i]};var io=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};function oi(e){return this.getChildContext=function(){return e.context},e.children}function ni(e){var t=this,r=e.i;t.componentWillUnmount=function(){ue(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(o){this.childNodes.push(o),t.i.appendChild(o)},insertBefore:function(o,i){this.childNodes.push(o),t.i.appendChild(o)},removeChild:function(o){this.childNodes.splice(this.childNodes.indexOf(o)>>>1,1),t.i.removeChild(o)}}),ue(n(oi,{context:t.context},e.__v),t.l)}function mo(e,t){var r=n(ni,{__v:e,i:t});return r.containerInfo=t,r}(Ze.prototype=new G).__a=function(e){var t=this,r=po(t.__v),o=t.o.get(e);return o[0]++,function(i){var a=function(){t.props.revealOrder?(o.push(i),io(t,e,o)):i()};r?r(a):a()}},Ze.prototype.render=function(e){this.u=null,this.o=new Map;var t=fe(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},Ze.prototype.componentDidUpdate=Ze.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){io(e,r,t)})};var ii=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,ai=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,si=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,li=/[A-Z0-9]/g,ci=typeof document!="undefined",fi=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};G.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(G.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ao=b.event;function ui(){}function di(){return this.cancelBubble}function pi(){return this.defaultPrevented}b.event=function(e){return ao&&(e=ao(e)),e.persist=ui,e.isPropagationStopped=di,e.isDefaultPrevented=pi,e.nativeEvent=e};var go,mi={enumerable:!1,configurable:!0,get:function(){return this.class}},so=b.vnode;b.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,o=t.type,i={};for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||ci&&a==="children"&&o==="noscript"||a==="class"||a==="className")){var f=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":f==="ondoubleclick"?a="ondblclick":f!=="onchange"||o!=="input"&&o!=="textarea"||fi(r.type)?f==="onfocus"?a="onfocusin":f==="onblur"?a="onfocusout":si.test(a)?a=f:o.indexOf("-")===-1&&ai.test(a)?a=a.replace(li,"-$&").toLowerCase():s===null&&(s=void 0):f=a="oninput",f==="oninput"&&i[a=f]&&(a="oninputCapture"),i[a]=s}}o=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=fe(r.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),o=="select"&&i.defaultValue!=null&&(i.value=fe(r.children).forEach(function(c){c.props.selected=i.multiple?i.defaultValue.indexOf(c.props.value)!=-1:i.defaultValue==c.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",mi)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=ii,so&&so(e)};var lo=b.__r;b.__r=function(e){lo&&lo(e),go=e.__c};var co=b.diffed;b.diffed=function(e){co&&co(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),go=null};var ho=e=>{let t=W(document.getElementById("preact-modal-root")||document.createElement("div"));return k(()=>(t.current.id="preact-modal-root",document.body.appendChild(t.current),()=>document.body.removeChild(t.current)),[]),mo(n("div",{className:"modal-backdrop"},n("div",{className:L("modal",e.className),style:{position:"relative"}},e.children,n("div",{className:"modal__close",onClick:e.onClose},n("i",{className:"material-icons"},"close")))),t.current)};function vo(e){return typeof e=="string"?e:typeof e=="number"?e.toString():typeof e=="undefined"?"Unset":typeof e=="boolean"?e?"Enabled":"Disabled":Array.isArray(e)?e.join(", "):"Unknown"}function bo(e,t){if(!t)return[];let r=[],{benchmarkIndex:o}=e.environment,{benchmarkIndex:i}=t.environment,a=Math.abs(o-i)/Math.min(o,i);a>1.5&&r.push({label:"CPU/Memory Power",base:t.environment.benchmarkIndex.toString(),compare:e.environment.benchmarkIndex.toString(),severity:a>2?"error":"warn"});let s=e.configSettings,f=t.configSettings,c=s.throttling||{},d=s.throttling||{},p=[["Lighthouse Version",t.lighthouseVersion,e.lighthouseVersion],["Storage Reset",f.disableStorageReset,s.disableStorageReset],["Emulated Form Factor",f.emulatedFormFactor,s.emulatedFormFactor],["Throttling Method",f.throttlingMethod,s.throttlingMethod],["CPU Throttling",d.cpuSlowdownMultiplier,c.cpuSlowdownMultiplier],["Network RTT",d.rttMs,c.rttMs],["Network Throughput",d.throughputKbps,c.throughputKbps],["Network RTT",d.requestLatencyMs,c.requestLatencyMs],["Network Throughput (Up)",d.uploadThroughputKbps,c.uploadThroughputKbps],["Network Throughput (Down)",d.downloadThroughputKbps,c.downloadThroughputKbps]];for(let[l,g,m]of p){let v=vo(g),C=vo(m);v!==C&&r.push({label:l,base:v,compare:C,severity:"error"})}return r}var pt=e=>{let{diffs:t}=e;return n("div",{className:L("lhr-comparison-runtime-diff",`lhr-comparison-runtime-diff--${e.variant}`)},n("div",{className:"lhr-comparison__warning"},n("i",{className:"material-icons"},"info"),n("div",null,"Changes of runtime settings or the environment can substantially affect your Lighthouse scores and might be the reason for the differences here.")),n("div",{className:"lhr-comparison-runtime-diff__diffs"},"The following runtime differences were detected:",n("table",null,n("thead",null,n("tr",null,n("th",null),n("th",null,"Base"),n("th",null,"Compare"))),n("tbody",null,t.map(r=>n("tr",{key:r.label},n("td",null,r.label),n("td",null,r.base),n("td",null,r.compare)))))))};function gi(e){let t=o=>new Promise(i=>setTimeout(i,o)),r=o=>P(this,null,function*(){let i=0;for(;!document.querySelector(o)&&i<10;)yield t(500),i++});k(()=>{window.location.hash.length<=1||Promise.resolve().then(()=>P(this,null,function*(){yield r(".lhr-comparison__audit-groups"),e(window.location.hash.slice(1))}))},[])}function hi(e,t,r){let o=[];for(let[i,a]of Object.entries(e.categories)){let s={title:a.title,description:a.description},f=yo.default.groupBy(a.auditRefs,p=>p.group),c=`unchanged:${i}`,d={id:c,group:{id:c,title:`Unchanged Audits - ${a.title}`},pairs:[],showAsUnchanged:!0};for(let p of f){let l=p[0].group||"",g=e.categoryGroups&&e.categoryGroups[l];if(!g){if(f.length!==1)continue;l=`category:${i}`,g=s}let m=X(j({},g),{id:l}),v=p.map(w=>{let x=X(j({},e.audits[w.id]),{id:w.id}),z=t&&t.audits[x.id||""],O=z?(0,Se.findAuditDiffs)(z,x,X(j({},r),{synthesizeItemKeyDiffs:!0})):[],T=Math.max(...O.map(Se.getDiffSeverity),0);return{audit:x,baseAudit:z,diffs:O,maxSeverity:T,group:m}}).sort((w,x)=>(w.audit.score||0)-(x.audit.score||0)),C=v.filter(w=>!w.baseAudit||w.diffs.length),F=v.filter(w=>w.baseAudit&&!w.diffs.length);C.length&&o.push({id:l,group:m,pairs:C,showAsUnchanged:!1}),F.length&&d.pairs.push(...F)}d.pairs.length&&o.push(d)}return o}var vi=e=>n("div",{className:"lhr-comparison__scores-and-dropdowns"},n("div",{className:"container"},n("div",{className:"lhr-comparison__dropdowns"},e.hookElements.dropdowns,n(Lr,{label:"Threshold",value:e.percentAbsoluteDeltaThreshold.toString(),setValue:t=>{e.setPercentAbsoluteDeltaThreshold(Number(t))},options:[{value:"0",label:"0%"},{value:"0.05",label:"5%"},{value:"0.1",label:"10%"},{value:"0.15",label:"15%"},{value:"0.25",label:"25%"}]})),e.selectedAuditId?n(y,null):n(Qr,j({},e)))),bi=e=>n("div",{className:"lhr-comparison__audit-groups"},e.auditGroups.map(t=>{if(t)return n($r,{key:t.id,showAsNarrow:e.showAsNarrow,showAsUnchanged:t.showAsUnchanged,pairs:t.pairs,group:t.group,baseLhr:e.baseLhr,selectedAuditId:e.selectedAuditId,setSelectedAuditId:e.setSelectedAuditId})})),wo=e=>{let{lhr:t,baseLhr:r}=e,o="none",[i,a]=B(.05),[s,f]=B(null),[c,d]=B(o);gi(f),k(()=>{window.__LHR__=t,window.__BASE_LHR__=r},[t,r]);let p=bo(t,r),l=p.some(m=>m.severity==="error"),g=hi(t,r,{percentAbsoluteDeltaThreshold:i});return n(y,null,c==="none"&&l?n(ho,{onClose:()=>d("acknowledged")},n(pt,{diffs:p,variant:"full"})):null,s?n(Ir,{selectedAuditId:s,setSelectedAuditId:f,pairs:g.filter(m=>!m.showAsUnchanged).map(m=>m.pairs).reduce((m,v)=>m.concat(v)),baseLhr:r}):n(y,null),n("div",{className:L("lhr-comparison",e.className,{"lhr-comparison--with-audit-selection":!!s})},n(vi,{lhr:t,baseLhr:r,selectedAuditId:s,hookElements:e.hookElements,percentAbsoluteDeltaThreshold:i,setPercentAbsoluteDeltaThreshold:a}),n("div",{className:"container"},e.hookElements.warnings,c!=="closed"&&p.length?n(q,{className:"position-relative"},n(pt,{diffs:p,variant:"mini"}),n("div",{className:"lhr-comparison-runtime-diff__close",onClick:()=>d("closed")},n("i",{className:"material-icons"},"close"))):null,g.length&&r?n(y,null,s?null:n("div",{className:"lhr-comparison__legend-container"},n(eo,null)),n(bi,{showAsNarrow:!!s,auditGroups:g,baseLhr:r,selectedAuditId:s,setSelectedAuditId:f})):e.hookElements.warnings?null:n(q,{className:"lhr-comparison__warning"},n("i",{className:"material-icons"},"sentiment_satisfied_alt"),n("div",null,"Woah, no differences found! Switch base builds to explore other differences, or"," ",n(Xe,{className:"lhr-comparison__warning__lhr-link",lhr:e.lhr},"jump straight to the Lighthouse report."))))))};var Co=e=>{let t=lr(e.baseReport.lhr,e.compareReport.lhr);return n("div",{className:"comparison"},n("div",{className:"comparison-header"},n("div",{className:"comparison-header__switcher",onClick:()=>{e.setBaseReport(e.compareReport),e.setCompareReport(e.baseReport)}},n("i",{className:"material-icons"},"swap_horiz")),n("div",{className:"comparison-header__logo"},n("img",{src:me,alt:"Lighthouse Logo",onClick:()=>{e.setBaseReport(void 0),e.setCompareReport(void 0)}})),n("div",{className:"comparison-header__upload"},n(ne,{variant:"base",dragTarget:"self",report:e.baseReport,setReport:e.setBaseReport,addToast:e.addToast,displayType:t,showOpenLhrLink:!0}),n(ne,{variant:"compare",dragTarget:"self",report:e.compareReport,setReport:e.setCompareReport,addToast:e.addToast,displayType:t,showOpenLhrLink:!0})),n("a",{className:"comparison-header__info",href:"https://github.com/GoogleChrome/lighthouse-ci"},n("i",{className:"material-icons"},"info"))),n("div",{className:"comparison-body"},n(wo,{lhr:e.compareReport.lhr,baseLhr:e.baseReport.lhr,hookElements:{}})))};var xo=e=>{let t=e.setToasts,{message:r,level:o="info"}=e.toast;return k(()=>{let i=setTimeout(()=>t(a=>a.filter(s=>s!==e.toast)),5e3);return()=>clearInterval(i)},[]),n("div",{className:`toast toast--${o}`},r)};var Ao=new URLSearchParams(location.search),Po=Ao.get("baseReport"),zo=Ao.get("compareReport");function Lo(e,t){return P(this,null,function*(){let r=new URL(e).pathname.split("/").slice(-1)[0]||"Unknown",i=yield(yield fetch(e)).text(),a=ot(i);if(a instanceof Error)throw a;t({filename:r,data:i,lhr:a})})}function yi(e,t,r,o){return P(this,null,function*(){if(window.location.hostname==="localhost"){let a=localStorage.getItem("lastBaseReport"),s=localStorage.getItem("lastCompareReport");a&&e(JSON.parse(a)),s&&t(JSON.parse(s))}let i=[Po&&Lo(Po,e),zo&&Lo(zo,t)].filter(a=>!!a);i.length&&(r(!0),yield Promise.all(i.map(a=>a.catch(s=>{console.error(s),o({message:`Failed loading report from URL: ${s.message}`,level:"error"})}))),r(!1))})}var Fo=()=>{let[t,r]=B(!1),[o,i]=B(void 0),[a,s]=B(void 0),[f,c]=B([]),p=Ke(l=>c(g=>[...g,l]),[c]);return k(()=>{yi(i,s,r,p)},[]),k(()=>{try{o&&localStorage.setItem("lastBaseReport",JSON.stringify(o)),a&&localStorage.setItem("lastCompareReport",JSON.stringify(a))}catch(l){console.error(`Error saving to localStorage: ${l}`)}},[o,a]),n("div",{className:"lhci-viewer"},t?n("div",{className:"loading-container"},n($e,null)):n(y,null),n("div",{className:"toast-container"},f.map(l=>n(xo,{key:l.message,toast:l,setToasts:c}))),o&&a?n(Co,{baseReport:o,setBaseReport:i,compareReport:a,setCompareReport:s,addToast:p}):n(fr,{baseReport:o,setBaseReport:i,compareReport:a,setCompareReport:s,addToast:p}))};var Do=document.getElementById("preact-root");if(!Do)throw new Error("Missing #preact-root");ue(n(Fo,null),Do);})();
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright 2019 Google Inc. All Rights Reserved.
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* @license Copyright 2020 Google Inc. All Rights Reserved.
|
|
12
|
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
14
|
-
*/
|
|
15
|
-
//# sourceMappingURL=entry-JMR57VBF.js.map
|