@lhci/viewer 0.14.0 → 0.15.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/index.html
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
11
11
|
<link rel="icon" sizes="48x48" href="assets/favicon-48x48-7fe43b6a.png">
|
|
12
12
|
<link rel="icon" sizes="16x16" href="assets/favicon-16x16-7a9d07ba.png">
|
|
13
|
-
<link rel="icon" sizes="32x32" href="assets/favicon-32x32-e9e95133.png">
|
|
14
13
|
<link rel="shortcut icon" href="assets/favicon-196x196-7e07c528.png">
|
|
15
14
|
<link rel="icon" sizes="196x196" href="assets/favicon-196x196-7e07c528.png">
|
|
15
|
+
<link rel="icon" sizes="32x32" href="assets/favicon-32x32-e9e95133.png">
|
|
16
16
|
<link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon-322d6266.png">
|
|
17
17
|
<link rel="apple-touch-icon" sizes="167x167" href="assets/apple-touch-icon-ipad-bb198203.png">
|
|
18
18
|
<title>Lighthouse Report Diff Tool</title>
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<body>
|
|
36
36
|
<noscript>Lighthouse report diff tool currently requires JavaScript.</noscript>
|
|
37
37
|
<div id="preact-root"></div>
|
|
38
|
-
<script src="./chunks/entry-
|
|
38
|
+
<script src="./chunks/entry-JMR57VBF.js" type="application/javascript"></script>
|
|
39
39
|
</body>
|
|
40
40
|
|
|
41
41
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lhci/viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"alias": {
|
|
26
26
|
"isomorphic-fetch": "clsx"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "76a49c7cc26cfc6dcff4248e1f170efb845245bb"
|
|
29
29
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";(()=>{var ro=Object.create;var Ae=Object.defineProperty,oo=Object.defineProperties,ao=Object.getOwnPropertyDescriptor,io=Object.getOwnPropertyDescriptors,no=Object.getOwnPropertyNames,fe=Object.getOwnPropertySymbols,so=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable;var Qe=(e,t,r)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,F=(e,t)=>{for(var r in t||(t={}))Ne.call(t,r)&&Qe(e,r,t[r]);if(fe)for(var r of fe(t))$e.call(t,r)&&Qe(e,r,t[r]);return e},D=(e,t)=>oo(e,io(t));var et=(e,t)=>{var r={};for(var o in e)Ne.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&fe)for(var o of fe(e))t.indexOf(o)<0&&$e.call(e,o)&&(r[o]=e[o]);return r};var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var lo=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of no(t))!Ne.call(e,i)&&i!==r&&Ae(e,i,{get:()=>t[i],enumerable:!(o=ao(t,i))||o.enumerable});return e};var X=(e,t,r)=>(r=e!=null?ro(so(e)):{},lo(t||!e||!e.__esModule?Ae(r,"default",{value:e,enumerable:!0}):r,e));var S=(e,t,r)=>new Promise((o,i)=>{var n=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(n,s);f((r=r.apply(e,t)).next())});var Lt=B((Va,yo)=>{yo.exports="./assets/loading-spinner-N6LEBK7Y.svg"});var At=B((fi,Co)=>{Co.exports="./assets/favicon-PWXHY3O5.svg"});var Nt=B((gi,zo)=>{zo.exports="./assets/confetti-NE5ZCURM.svg"});var Ft=B((vi,Lo)=>{Lo.exports="./assets/logo-7LKJDYBP.svg"});var E=B((ki,Mt)=>{"use strict";function Be(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?Be(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)),n=new Set(Object.keys(o));for(let s of new Set([...i,...n]))r[s]=s in o?Be(r[s],o[s]):r[s];return e}else return t}function jt(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 Xt(e,t){let r=new Map;for(let o of e){let i=t(o),n=r.get(i)||[];n.push(o),r.set(i,n)}return r}function To(e,t){let r,o=()=>{r&&clearTimeout(r),r=void 0},i=(...n)=>{r&&clearTimeout(r),r=setTimeout(()=>e(...n),t)};return i.cancel=o,i}Mt.exports={merge:Be,kebabCase:jt,debounce:To,range(e,t,r=1){let o=[];for(let i=e;i<t;i+=r)o.push(i);return o},startCase(e){return jt(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 n=t(i);r.has(n)||(r.add(n),o.push(i))}return o},groupBy(e,t){return[...Xt(e,t).values()]},groupIntoMap:Xt,maxBy(e,t){let r,o=-1/0;for(let i of e){let n=t(i);n>o&&(r=i,o=n)}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 n=o;t.includes(n)&&(r[n]=i)}return r},omit(e,t,r={}){let o={};for(let[i,n]of Object.entries(e)){let s=i;t.includes(s)||r.dropUndefined&&n===void 0||(o[s]=n)}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 kt=B((Ui,Zt)=>{"use strict";var ie=E(),Oo="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 Rt(e){return e.startsWith("a11y")?"accessibility":e.startsWith("seo")?"seo":e.startsWith("best-practices")?"best-practices":e.startsWith("pwa")?"pwa":"performance"}function we(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 xe(e,t){let o=e*.1;return(t.next()-.5)*2*o+e}function jo(e,t,r){let o={},i=Oo.split(" ");for(let m of t){let{auditId:u,averageNumericValue:v,averageWastedMs:x,unit:P="items"}=m,b=we(u);if(typeof v=="number"){let C=xe(v,r),N=1-Math.min(1,Math.max((C-1e3)/9e3,0));o[u]={score:N,numericValue:C,scoreDisplayMode:"numeric",displayValue:b==="metrics"?`${(C/1e3).toLocaleString(void 0,{maximumFractionDigits:1})} s`:`${Math.round(C)} ${P}`}}else if(typeof x=="number"){let C=xe(x,r),N=1-Math.min(1,Math.max((C-100)/900,0)),z=m.items&&m.items.some(j=>j.averageWastedBytes),O=C*257;o[u]={score:N,scoreDisplayMode:"numeric",displayValue:z?`${(O/1024).toLocaleString(void 0,{maximumFractionDigits:0})} KB`:`${(C/1e3).toLocaleString(void 0,{maximumFractionDigits:1})} s`,details:{type:"opportunity",overallSavingsMs:C,overallSavingsBytes:z?O:void 0,items:[]}}}else{let{passRate:C=1}=m;o[u]={score:r.next()<=C?1:0,scoreDisplayMode:"binary"}}let w={};if(m.items){let C=[];for(let p of m.items){let l=p,{url:z,inclusionRate:O=1}=l,j=et(l,["url","inclusionRate"]);if(r.next()>O)continue;let M={};z&&(z.includes("lorempixel")&&(w.thumbnail={key:"url",valueType:"thumbnail"}),w.url={key:"url",valueType:"url",label:"URL"},M.url=new URL(z,e).href);for(let L of Object.keys(j))if(L.startsWith("average")){let Z=L.replace("average","").replace(/^\w/,to=>to.toLowerCase()),$r=L.endsWith("Ms")?"timespanMs":"bytes";w[Z]={key:Z,valueType:$r,label:ie.startCase(Z)};let eo=j[L];M[Z]=xe(eo,r)}else w[L]={key:L,valueType:"text",label:ie.startCase(L)},M[L]=j[L];C.push(M)}let N=o[u].details||{type:"table"};N.headings=Object.values(w).map(z=>we(u)==="load-opportunities"?z:D(F({},z),{itemType:z.valueType,text:z.label,valueType:void 0})),N.items=C,o[u].details=N}o[u].title=ie.startCase(u),o[u].description=`Help text for ${ie.startCase(u)}. ${i.slice(0,Math.round(u.length*1.5)).join(" ")}.`}let n={},s=ie.groupBy(Object.entries(o),m=>Rt(m[0]));for(let m of s){let u=Rt(m[0][0]),v=m.reduce((x,P)=>x+(P[1].score||0),0);n[u]={id:u,title:u.toUpperCase(),score:v/m.length,auditRefs:m.map(([x])=>({id:x,weight:1,group:we(x)}))}}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:n,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:{}}}}Zt.exports={createLHR:jo,generateNumericValue:xe,getGroupForAuditId:we}});var U=B((Bi,Jt)=>{"use strict";var Xo=E(),{getGroupForAuditId:Mo}=kt(),Ro=["main-thread-tasks","screenshot-thumbnails","metrics"];function Se(e,t="audit"){if(e===0)return"neutral";let r=e<0;return t==="score"&&(r=e>0),r?"improvement":"regression"}function Zo(e){switch(e.type){case"error":return"regression";case"score":return Se(J(e).delta,"score");case"numericValue":case"itemCount":case"itemDelta":return Se(J(e).delta,"audit");case"itemAddition":return"regression";case"itemRemoval":return"improvement";default:return"neutral"}}function Gt(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 _e(e,t,r){return e.filter(o=>{let i="compareItemIndex"in o?o.compareItemIndex:void 0,n="baseItemIndex"in o?o.baseItemIndex:void 0;return typeof i=="number"?i===t:typeof n=="number"?n===r:!1})}function Ve(e,t,r){return Gt(_e(e,t,r))}function Ut(e,t,r){let i=_e(e,t,r).filter(Wt);if(i.length)return Math.max(...i.map(n=>J(n).delta))}function ko(e){return e.some(t=>t==="regression")?"regression":e.some(t=>t==="neutral")?"neutral":"improvement"}function Wt(e){return["score","numericValue","itemCount","itemDelta"].includes(e.type)}function It(e){return typeof e!="number"?"error":e>=.9?"pass":e>=.5?"average":"fail"}function Uo(e,t){return typeof e!="number"?"error":e<=t[0]?"pass":e<=t[1]?"average":"fail"}function Io(e){let t=Wt(e)?J(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 J(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 n=t?o/t:1,s=Math.abs(n);return{delta:o,absoluteDelta:i,percentDelta:n,percentAbsoluteDelta:s}}function ne(e){let{auditId:t,type:r,baseValue:o,compareValue:i,baseItemIndex:n,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 n!="number")throw new Error("baseItemIndex is not set");return{auditId:t,type:r,baseItemIndex:n}}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 n!="number"&&typeof s!="number")throw new Error("Either baseItemIndex or compareItemIndex must be set");return D(F({},c),{type:"itemDelta",baseItemIndex:n,compareItemIndex:s,itemKey:f})}return D(F({},c),{type:r})}function Bo(e,t,r,o){let i=[];for(let n of Object.keys(t.item)){let s=t.item[n],f=r.item[n];typeof s!="number"||typeof f!="number"||o.some(c=>c.key===n)&&i.push(ne({auditId:e,type:"itemDelta",itemKey:n,baseItemIndex:t.index,compareItemIndex:r.index,baseValue:s,compareValue:f}))}return i}function Yt(e,t,r){let o=[];for(let i of e){if(i.type!=="itemAddition"&&i.type!=="itemRemoval")continue;let n=i.type==="itemAddition"?r[i.compareItemIndex]:t[i.baseItemIndex];for(let s of Object.keys(n)){let f=i.type==="itemAddition"?0:n[s],c=i.type==="itemAddition"?n[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(ne({auditId:i.auditId,type:"itemDelta",itemKey:s,[d]:p,baseValue:f,compareValue:c}))}}return o}function _t(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 Ge(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(t=>Ge(t));{let t=e,o=Object.keys(e).filter(n=>!n.startsWith("_")),i={};for(let n of o)i[n]=Ge(t[n]);return i}}function We(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(Ge(e))}function Et(e,t){let r=Xo.groupIntoMap([...e.map((i,n)=>({item:i,kind:"base",index:n})),...t.map((i,n)=>({item:i,kind:"compare",index:n}))],i=>_t(We(i.item))),o=[];for(let i of r.values()){let n=i.filter(f=>f.kind==="base"),s=i.filter(f=>f.kind==="compare");if(n.length>1||s.length>1){for(let f of i)o.push({[f.kind]:f});continue}o.push({base:n[0],compare:s[0]})}return o}function So(e,t){let r=["added","worse","ambiguous","removed","better","no change"];return t.map(o=>D(F({},o),{diffs:_e(e,o.compare&&o.compare.index,o.base&&o.base.index)})).sort((o,i)=>{let n=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(Ve(e,n,s)),p=r.indexOf(Ve(e,f,c)),l=We(o.compare&&o.compare.item||o.base&&o.base.item||{}),m=We(i.compare&&i.compare.item||i.base&&i.base.item||{}),u=Ut(e,n,s),v=Ut(e,f,c);return d===p?typeof u=="number"&&typeof v=="number"?v-u:l.localeCompare(m):d-p})}function Vo(e,t,r,o){let i=[];for(let{base:n,compare:s}of Et(t,r))if(n&&s)i.push(...Bo(e,n,s,o));else if(s)i.push({type:"itemAddition",auditId:e,compareItemIndex:s.index});else if(n)i.push({type:"itemRemoval",auditId:e,baseItemIndex:n.index});else throw new Error("Impossible");return i}function Bt(e){return e.scoreDisplayMode==="notApplicable"?1:e.scoreDisplayMode==="informative"?0:e.score}function Ye(e){return typeof e.numericValue!="number"&&e.details&&typeof e.details.overallSavingsMs=="number"?e.details.overallSavingsMs:e.numericValue}function St(e){return e.scoreDisplayMode==="notApplicable"?0:Ye(e)}function Vt(e){return e.details?{items:e.details.items||[],headings:e.details.headings||[]}:{items:[],headings:[]}}function Go(e,t,r={}){let o=e.id||"",{percentAbsoluteDeltaThreshold:i=0}=r,n=[];if(Ro.includes(o))return n;(typeof e.score=="number"||typeof t.score=="number")&&n.push(ne({auditId:o,type:"score",baseValue:Bt(e),compareValue:Bt(t)})),(typeof Ye(e)=="number"||typeof Ye(t)=="number")&&n.push(ne({auditId:o,type:"numericValue",baseValue:St(e),compareValue:St(t)})),(typeof e.displayValue=="string"||typeof t.displayValue=="string")&&n.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.items||c.type!=="debugdata"&&c.items){s=!0;let{items:m,headings:u}=Vt(e),{items:v,headings:x}=Vt(t),P=u.concat(x);n.push(ne({auditId:o,type:"itemCount",baseValue:m.length,compareValue:v.length})),n.push(...Vo(o,m,v,P)),r.synthesizeItemKeyDiffs&&n.push(...Yt(n,m,v))}let d=n.filter(m=>m.type==="error"||m.type==="itemAddition"||m.type==="itemRemoval"?!0:m.type==="score"&&!r.forceAllScoreDiffs?It(m.baseValue)!==It(m.compareValue):m.type==="displayValue"?m.baseValue!==m.compareValue&&!r.skipDisplayValueDiffs:J(m).percentAbsoluteDelta>i);if(d.length===1&&d[0].type==="displayValue")return[];let p=t.score===1&&e.score===1;return Mo(o)!=="metrics"&&d.every(m=>m.type==="displayValue"||m.type==="numericValue")&&(p||s)?[]:d}Jt.exports={findAuditDiffs:Go,getDiffSeverity:Io,getDeltaLabel:Se,getDeltaStats:J,getDiffLabel:Zo,getRowLabel:Gt,getRowLabelForIndex:Ve,getMostSevereDiffLabel:ko,getMetricScoreLevel:Uo,zipBaseAndCompareItems:Et,synthesizeItemKeyDiffs:Yt,sortZippedBaseAndCompareItems:So,replaceNondeterministicStrings:_t}});var $t=B((tn,Qt)=>{"use strict";function Wo(e){let t=[],r=e.split(/\[([^\]]+?)\]\((https?:\/\/.*?)\)/g);for(;r.length;){let[o,i,n]=r.splice(0,3);o&&t.push({isLink:!1,text:o}),i&&n&&t.push({isLink:!0,text:i,linkHref:n})}return t}Qt.exports={splitMarkdownLink:Wo}});var me,g,nt,co,W,tt,st,Fe,fo,$={},lt=[],uo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ge=Array.isArray;function V(e,t){for(var r in t)e[r]=t[r];return e}function ct(e){var t=e.parentNode;t&&t.removeChild(e)}function a(e,t,r){var o,i,n,s={};for(n in t)n=="key"?o=t[n]:n=="ref"?i=t[n]:s[n]=t[n];if(arguments.length>2&&(s.children=arguments.length>3?me.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(n in e.defaultProps)s[n]===void 0&&(s[n]=e.defaultProps[n]);return ue(e,s,o,i,null)}function ue(e,t,r,o,i){var n={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?++nt:i,__i:-1,__u:0};return i==null&&g.vnode!=null&&g.vnode(n),n}function h(e){return e.children}function R(e,t){this.props=e,this.context=t}function Y(e,t){if(t==null)return e.__?Y(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"?Y(e):null}function ft(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 ft(e)}}function rt(e){(!e.__d&&(e.__d=!0)&&W.push(e)&&!pe.__r++||tt!==g.debounceRendering)&&((tt=g.debounceRendering)||st)(pe)}function pe(){var e,t,r,o,i,n,s,f,c;for(W.sort(Fe);e=W.shift();)e.__d&&(t=W.length,o=void 0,n=(i=(r=e).__v).__e,f=[],c=[],(s=r.__P)&&((o=V({},i)).__v=i.__v+1,g.vnode&&g.vnode(o),He(s,o,i,r.__n,s.ownerSVGElement!==void 0,32&i.__u?[n]:null,f,n==null?Y(i):n,!!(32&i.__u),c),o.__.__k[o.__i]=o,pt(f,o,c),o.__e!=n&&ft(o)),W.length>t&&W.sort(Fe));pe.__r=0}function dt(e,t,r,o,i,n,s,f,c,d,p){var l,m,u,v,x,P=o&&o.__k||lt,b=t.length;for(r.__d=c,po(r,t,P),c=r.__d,l=0;l<b;l++)(u=r.__k[l])!=null&&typeof u!="boolean"&&typeof u!="function"&&(m=u.__i===-1?$:P[u.__i]||$,u.__i=l,He(e,u,m,i,n,s,f,c,d,p),v=u.__e,u.ref&&m.ref!=u.ref&&(m.ref&&Te(m.ref,null,u),p.push(u.ref,u.__c||v,u)),x==null&&v!=null&&(x=v),65536&u.__u||m.__k===u.__k?c=ut(u,c,e):typeof u.type=="function"&&u.__d!==void 0?c=u.__d:v&&(c=v.nextSibling),u.__d=void 0,u.__u&=-196609);r.__d=c,r.__e=x}function po(e,t,r){var o,i,n,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?ue(null,i,null,null,i):ge(i)?ue(h,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?ue(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,f=mo(i,r,s=o+l,p),i.__i=f,n=null,f!==-1&&(p--,(n=r[f])&&(n.__u|=131072)),n==null||n.__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))):(n=r[o])&&n.key==null&&n.__e&&(n.__e==e.__d&&(e.__d=Y(n)),De(n,n,!1),r[o]=null,p--);if(p)for(o=0;o<d;o++)(n=r[o])!=null&&!(131072&n.__u)&&(n.__e==e.__d&&(e.__d=Y(n)),De(n,n))}function ut(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=ut(o[i],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function ee(e,t){return t=t||[],e==null||typeof e=="boolean"||(ge(e)?e.some(function(r){ee(r,t)}):t.push(e)),t}function mo(e,t,r,o){var i=e.key,n=e.type,s=r-1,f=r+1,c=t[r];if(c===null||c&&i==c.key&&n===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&&n===c.type)return s;s--}if(f<t.length){if((c=t[f])&&!(131072&c.__u)&&i==c.key&&n===c.type)return f;f++}}return-1}function ot(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 de(e,t,r,o,i){var n;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||ot(e.style,t,"");if(r)for(t in r)o&&r[t]===o[t]||ot(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")n=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+n]=r,r?o?r.u=o.u:(r.u=Date.now(),e.addEventListener(t,n?it:at,n)):e.removeEventListener(t,n?it:at,n);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 at(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(g.event?g.event(e):e)}function it(e){return this.l[e.type+!0](g.event?g.event(e):e)}function He(e,t,r,o,i,n,s,f,c,d){var p,l,m,u,v,x,P,b,w,C,N,z,O,j,M,L=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),n=[f=t.__e=r.__e]),(p=g.__b)&&p(t);e:if(typeof L=="function")try{if(b=t.props,w=(p=L.contextType)&&o[p.__c],C=p?w?w.props.value:p.__:o,r.__c?P=(l=t.__c=r.__c).__=l.__E:("prototype"in L&&L.prototype.render?t.__c=l=new L(b,C):(t.__c=l=new R(b,C),l.constructor=L,l.render=vo),w&&w.sub(l),l.props=b,l.state||(l.state={}),l.context=C,l.__n=o,m=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),L.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=V({},l.__s)),V(l.__s,L.getDerivedStateFromProps(b,l.__s))),u=l.props,v=l.state,l.__v=t,m)L.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(L.getDerivedStateFromProps==null&&b!==u&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(b,C),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(b,l.__s,C)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(l.props=b,l.state=l.__s,l.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(Z){Z&&(Z.__=t)}),N=0;N<l._sb.length;N++)l.__h.push(l._sb[N]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(b,l.__s,C),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(u,v,x)})}if(l.context=C,l.props=b,l.__P=e,l.__e=!1,z=g.__r,O=0,"prototype"in L&&L.prototype.render){for(l.state=l.__s,l.__d=!1,z&&z(t),p=l.render(l.props,l.state,l.context),j=0;j<l._sb.length;j++)l.__h.push(l._sb[j]);l._sb=[]}else do l.__d=!1,z&&z(t),p=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++O<25);l.state=l.__s,l.getChildContext!=null&&(o=V(V({},o),l.getChildContext())),m||l.getSnapshotBeforeUpdate==null||(x=l.getSnapshotBeforeUpdate(u,v)),dt(e,ge(M=p!=null&&p.type===h&&p.key==null?p.props.children:p)?M:[M],t,r,o,i,n,s,f,c,d),l.base=t.__e,t.__u&=-161,l.__h.length&&s.push(l),P&&(l.__E=l.__=null)}catch(Z){t.__v=null,c||n!=null?(t.__e=f,t.__u|=c?160:32,n[n.indexOf(f)]=null):(t.__e=r.__e,t.__k=r.__k),g.__e(Z,t,r)}else n==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=go(r.__e,t,r,o,i,n,s,c,d);(p=g.diffed)&&p(t)}function pt(e,t,r){t.__d=void 0;for(var o=0;o<r.length;o++)Te(r[o],r[++o],r[++o]);g.__c&&g.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(n){n.call(i)})}catch(n){g.__e(n,i.__v)}})}function go(e,t,r,o,i,n,s,f,c){var d,p,l,m,u,v,x,P=r.props,b=t.props,w=t.type;if(w==="svg"&&(i=!0),n!=null){for(d=0;d<n.length;d++)if((u=n[d])&&"setAttribute"in u==!!w&&(w?u.localName===w:u.nodeType===3)){e=u,n[d]=null;break}}if(e==null){if(w===null)return document.createTextNode(b);e=i?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,b.is&&b),n=null,f=!1}if(w===null)P===b||f&&e.data===b||(e.data=b);else{if(n=n&&me.call(e.childNodes),P=r.props||$,!f&&n!=null)for(P={},d=0;d<e.attributes.length;d++)P[(u=e.attributes[d]).name]=u.value;for(d in P)u=P[d],d=="children"||(d=="dangerouslySetInnerHTML"?l=u:d==="key"||d in b||de(e,d,null,u,i));for(d in b)u=b[d],d=="children"?m=u:d=="dangerouslySetInnerHTML"?p=u:d=="value"?v=u:d=="checked"?x=u:d==="key"||f&&typeof u!="function"||P[d]===u||de(e,d,u,P[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=""),dt(e,ge(m)?m:[m],t,r,o,i&&w!=="foreignObject",n,s,n?n[0]:r.__k&&Y(r,0),f,c),n!=null)for(d=n.length;d--;)n[d]!=null&&ct(n[d]);f||(d="value",v!==void 0&&(v!==e[d]||w==="progress"&&!v||w==="option"&&v!==P[d])&&de(e,d,v,P[d],!1),d="checked",x!==void 0&&x!==e[d]&&de(e,d,x,P[d],!1))}return e}function Te(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(o){g.__e(o,r)}}function De(e,t,r){var o,i;if(g.unmount&&g.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||Te(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(n){g.__e(n,t)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&De(o[i],t,r||typeof e.type!="function");r||e.__e==null||ct(e.__e),e.__=e.__e=e.__d=void 0}function vo(e,t,r){return this.constructor(e,r)}function te(e,t,r){var o,i,n,s;g.__&&g.__(e,t),i=(o=typeof r=="function")?null:r&&r.__k||t.__k,n=[],s=[],He(t,e=(!o&&r||t).__k=a(h,null,[e]),i||$,$,t.ownerSVGElement!==void 0,!o&&r?[r]:i?null:t.firstChild?me.call(t.childNodes):null,n,!o&&r?r:i?i.__e:t.firstChild,o,s),pt(n,e,s)}me=lt.slice,g={__e:function(e,t,r,o){for(var i,n,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((n=i.constructor)&&n.getDerivedStateFromError!=null&&(i.setState(n.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}},nt=0,co=function(e){return e!=null&&e.constructor==null},R.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=V({},this.state),typeof e=="function"&&(e=e(V({},r),this.props)),e&&V(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),rt(this))},R.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),rt(this))},R.prototype.render=h,W=[],st=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Fe=function(e,t){return e.__v.__b-t.__v.__b},pe.__r=0,fo=0;var re,A,Oe,mt,oe=0,xt=[],ve=[],gt=g.__b,vt=g.__r,ht=g.diffed,bt=g.__c,yt=g.unmount;function Xe(e,t){g.__h&&g.__h(A,e,oe||t),oe=0;var r=A.__H||(A.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:ve}),r.__[e]}function H(e){return oe=1,Ct(zt,e)}function Ct(e,t,r){var o=Xe(re++,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=A,!A.u)){var i=function(f,c,d){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(m){return m.__c});if(p.every(function(m){return!m.__N}))return!n||n.call(this,f,c,d);var l=!1;return p.forEach(function(m){if(m.__N){var u=m.__[0];m.__=m.__N,m.__N=void 0,u!==m.__[0]&&(l=!0)}}),!(!l&&o.__c.props===f)&&(!n||n.call(this,f,c,d))};A.u=!0;var n=A.shouldComponentUpdate,s=A.componentWillUpdate;A.componentWillUpdate=function(f,c,d){if(this.__e){var p=n;n=void 0,i(f,c,d),n=p}s&&s.call(this,f,c,d)},A.shouldComponentUpdate=i}return o.__N||o.__}function T(e,t){var r=Xe(re++,3);!g.__s&&Pt(r.__H,t)&&(r.__=e,r.i=t,A.__H.__h.push(r))}function k(e){return oe=5,Me(function(){return{current:e}},[])}function Me(e,t){var r=Xe(re++,7);return Pt(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Re(e,t){return oe=8,Me(function(){return e},t)}function ho(){for(var e;e=xt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(he),e.__H.__h.forEach(je),e.__H.__h=[]}catch(t){e.__H.__h=[],g.__e(t,e.__v)}}g.__b=function(e){A=null,gt&>(e)},g.__r=function(e){vt&&vt(e),re=0;var t=(A=e.__c).__H;t&&(Oe===A?(t.__h=[],A.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=ve,r.__N=r.i=void 0})):(t.__h.forEach(he),t.__h.forEach(je),t.__h=[],re=0)),Oe=A},g.diffed=function(e){ht&&ht(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(xt.push(t)!==1&&mt===g.requestAnimationFrame||((mt=g.requestAnimationFrame)||bo)(ho)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==ve&&(r.__=r.__V),r.i=void 0,r.__V=ve})),Oe=A=null},g.__c=function(e,t){t.some(function(r){try{r.__h.forEach(he),r.__h=r.__h.filter(function(o){return!o.__||je(o)})}catch(o){t.some(function(i){i.__h&&(i.__h=[])}),t=[],g.__e(o,r.__v)}}),bt&&bt(e,t)},g.unmount=function(e){yt&&yt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{he(o)}catch(i){t=i}}),r.__H=void 0,t&&g.__e(t,r.__v))};var wt=typeof requestAnimationFrame=="function";function bo(e){var t,r=function(){clearTimeout(o),wt&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(r,100);wt&&(t=requestAnimationFrame(r))}function he(e){var t=A,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),A=t}function je(e){var t=A;e.__c=e.__(),A=t}function Pt(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 Ze(e){var t,r,o="";if(e)if(typeof e=="object")if(e.push)for(t=0;t<e.length;t++)e[t]&&(r=Ze(e[t]))&&(o&&(o+=" "),o+=r);else for(t in e)e[t]&&(r=Ze(t))&&(o&&(o+=" "),o+=r);else typeof e!="boolean"&&!e.call&&(o&&(o+=" "),o+=e);return o}function y(){for(var e=0,t,r="";e<arguments.length;)(t=Ze(arguments[e++]))&&(r&&(r+=" "),r+=t);return r}var wo=Lt(),xo=()=>a("img",{src:wo,alt:"Loading spinner"}),ke=e=>a("div",{className:y("loading-spinner",{"loading-spinner--container":!e.solo})},a(xo,null));var G=e=>{let{children:t}=e;return a("div",{className:y("paper",e.className)},t)};function be(e){let t="https://googlechrome.github.io";window.addEventListener("message",function n(s){s.origin===t&&i&&s.data.opened&&(i.postMessage({lhresults:e},t),window.removeEventListener("message",n))});let r=e.fetchTime,o=`${e.lighthouseVersion}-${e.requestedUrl}-${r}`,i=window.open(`${t}/lighthouse/viewer`,o)}var ye=e=>{let{children:t,lhr:r}=e,[o,i]=H(!1);return a("span",{className:y("lhr-viewer-link",e.className,{"lhr-viewer-link--loading":o}),onClick:n=>S(void 0,null,function*(){if(n.preventDefault(),n.stopImmediatePropagation(),o)return;if(typeof r=="object")return be(r);i(!0);let s=yield r();i(!1),be(s)})},t)};var Po=At(),Ue=e=>{let{lhr:t,label:r="Open Report"}=e;return a(ye,{lhr:t},a("div",{className:"lhr-viewer-button",role:"button"},a("img",{src:Po})," ",a("span",null,r)))};var Dt=Nt(),ae=Ft();function Ie(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 Ht(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 Ao=e=>{let{filename:t,lhr:r}=e.report,o=new URL(r.finalUrl),i=new Date(r.fetchTime).toLocaleString(),n={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 a("span",{title:s},n[e.displayType])};function Tt(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=Ie(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 No(e,t,r,o){o.target instanceof HTMLElement&&(o.stopPropagation(),o.preventDefault(),r(!0),t.current=o.target)}function Fo(e,t,r,o){o.target===t.current&&(o.stopPropagation(),o.preventDefault(),r(!1),t.current=void 0)}function Do(e,t,r,o){t.current&&(o.stopPropagation(),o.preventDefault())}function Ho(e,t,r,o){t.current&&o instanceof DragEvent&&o.dataTransfer&&(o.stopPropagation(),o.preventDefault(),r(!1),t.current=void 0,Tt(e,o.dataTransfer.files))}var _=e=>{let[t,r]=H(!1),o=k(void 0),i=c=>No(e,o,r,c),n=c=>Fo(e,o,r,c),s=c=>Do(e,o,r,c),f=c=>Ho(e,o,r,c);return T(()=>{if(e.dragTarget==="document")return document.addEventListener("dragenter",i),document.addEventListener("dragleave",n),document.addEventListener("dragover",s),document.addEventListener("drop",f),()=>{document.removeEventListener("dragenter",i),document.removeEventListener("dragleave",n),document.removeEventListener("dragover",s),document.removeEventListener("drop",f)}},[e.dragTarget,e.addToast,e.setReport,o.current]),a("div",{className:y(`report-upload-box report-upload-box--${e.variant}`,{"report-upload-box--drop":t,"report-upload-box--document-target":e.dragTarget==="document"}),onDragEnter:i,onDragLeave:n,onDragOver:s,onDrop:f},a("div",{className:"report-upload-box__drop-outline"},"Drop your report to upload"),a("span",{className:"report-upload-box__label"},e.variant==="base"?"Base":"Compare"),a("div",{className:"report-upload-box__file"},e.report?a(Ao,{report:e.report,displayType:e.displayType}):a(h,null)),a("div",{className:"report-upload-box__lhr-link"},e.report&&e.showOpenLhrLink?a(Ue,{lhr:e.report.lhr,label:"View Report"}):null),a("div",{className:"report-upload-box__spacer"}),a("label",{className:"report-upload-box__upload"},"Select file",a("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||Tt(e,p)}})))};var Ot=e=>a("div",{className:"landing"},a("div",{className:"landing__background"},a("img",{src:Dt,alt:"Lighthouse CI Background Image"})),a(G,{className:"landing__paper"},a("div",{className:"landing__logos"},a("img",{className:"landing__logo",src:ae,alt:"Lighthouse Logo"}),a("img",{className:"landing__logo landing__logo--diff",src:ae,alt:""}),a("h1",null,"Lighthouse Report Diff Tool")),a("p",null,"Provide two Lighthouse reports to start comparing!"),a("p",null,a("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")),a("div",{className:"landing__upload"},a(_,{variant:"base",report:e.baseReport,setReport:e.setBaseReport,addToast:e.addToast,displayType:"filename",dragTarget:e.baseReport?"self":"document"}),a(_,{variant:"compare",report:e.compareReport,setReport:e.setCompareReport,addToast:e.addToast,displayType:"filename",dragTarget:e.baseReport?"document":"self"})),a("p",null,"Above, drag 'n drop your JSON/HTML, or select the files from disk."),a("footer",null,"Powered by ",a("a",{href:"https://github.com/GoogleChrome/lighthouse-ci"},"lighthouse-ci"))));var Vr=X(E()),Le=X(U());var qt=e=>{let{options:t,value:r,setValue:o,className:i,title:n,label:s}=e,f=t.some(c=>c.value===r)?t:[...t,{value:r,label:r}];return a("div",{className:y("dropdown",i),style:{position:"relative"},"data-tooltip":n},a("label",null,s?a("span",{className:"dropdown__label"},s):a(h,null),a("select",{onChange:c=>{c.target instanceof HTMLSelectElement&&o(c.target.value)}},f.map(c=>a("option",{key:c.value,value:c.value,selected:c.value===r},c.label)))),a("div",{className:"dropdown__chevron"},a("i",{className:"material-icons"},"arrow_drop_down")))};function Kt(e){let t=k(void 0);return T(()=>{t.current=e},[e]),t.current}var I=e=>{let t=e.score;return t>=.9?a("i",{className:"lh-score-pass"}):t>=.5?a("i",{className:"lh-score-average"}):a("i",{className:"lh-score-fail"},a("svg",{viewBox:"0 0 120 120",xmlns:"http://www.w3.org/2000/svg"},a("polygon",{points:"10,110 60,10 110,110"})))},q=e=>(e.audit.score||0)>=.9?a("span",{className:"lh-score-word"},"Pass"):a("span",{className:"lh-score-word"},"Fail");var er=X($t());var tr=e=>{let t=(0,er.splitMarkdownLink)(e.text);return a(h,null,t.map((r,o)=>{if(!r.isLink)return a("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")),a("a",{key:o,href:i.href,target:"_blank",rel:"noopener noreferrer"},r.text)}))};var se=()=>a("span",{style:{display:"inline-block",width:4,height:1}});var le=X(U());var rr=e=>{let t=e.type,{compareValue:r,baseValue:o,diff:i}=e,n=r===void 0?o:r;typeof n=="object"&&n.type&&(t=n.type);let s=i?(0,le.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}`,m=i&&(0,le.getDeltaStats)(i).percentAbsoluteDelta!==1?` (${((0,le.getDeltaStats)(i).percentAbsoluteDelta*100).toLocaleString(void 0,{maximumFractionDigits:0})}%)`:"";switch(t){case"bytes":{let u=Math.abs((c-f)/1024);return a("pre",{className:`simple-details--${s}`,"data-tooltip":l},c>=f?"+":"-",u.toLocaleString(void 0,{maximumFractionDigits:Math.abs(u)<1?1:0}),a(se,null),"KB",m)}case"ms":case"timespanMs":{let u=Math.abs(Math.round(c-f));return a("pre",{className:`simple-details--${s}`,"data-tooltip":l},c>=f?"+":"-",u.toLocaleString(),a(se,null),"ms",m)}case"thumbnail":return a("img",{style:{width:48,height:48,objectFit:"cover"},src:n,onError:u=>{let v=u.srcElement;v instanceof HTMLImageElement&&(v.onerror=null,v.src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")}});case"url":{let u=n,v="";try{let x=new URL(n);u=x.pathname,v=x.hostname}catch(x){}return a("span",{title:n},u,v?a("span",{className:"simple-details__url-hostname"},"(",v,")"):"")}case"link":return n.url?a("a",{target:"_blank",rel:"noopener noreferrer",href:n.url},n.text):a("span",null,n.text);case"code":return a("pre",null,n);case"numeric":return a("pre",{className:`simple-details--${s}`},c>=f?"+":"-",Math.abs(c-f).toLocaleString(),m);case"text":return a("span",null,n);case"node":return a("pre",null,n.snippet);case"source-location":{if(!n.url)return a("pre",null,JSON.stringify(n));let{url:u,line:v,column:x}=n;return a("pre",null,u,":",v,":",x)}case"debugdata":return a(h,null);default:{let u=JSON.stringify(e);return a("pre",{"data-tooltip":u},u.slice(0,20))}}};var K=X(U());function Yo(e){switch(e){case"bytes":case"ms":case"timespanMs":case"numeric":return!0;default:return!1}}var or=e=>{let{audit:t,baseAudit:r,diffs:o}=e.pair;if(!t.details)return a(h,null);let{headings:i,items:n}=t.details;if(!i||!n)return a(h,null);let s=r&&r.details&&r.details.headings||[],f=r&&r.details&&r.details.items||[],c=(0,K.zipBaseAndCompareItems)(f,n),d=(0,K.sortZippedBaseAndCompareItems)(o,c),p=i.length?i:s,l=p.findIndex(m=>Yo(m.valueType||m.itemType||"unknown"))-1;return l<0&&(l=p.length-1),a("div",{className:"table-details"},a("table",null,a("thead",null,a("tr",null,p.map((m,u)=>{let v=m.valueType||m.itemType||"unknown";return a(h,{key:u},a("th",{className:`table-column--${v}`},m.label||m.text),l===u?a("th",null):null)}))),a("tbody",null,d.map(({base:m,compare:u,diffs:v})=>{if(!(u||m))return null;let P=`${m&&m.index}-${u&&u.index}`,b=(0,K.getRowLabelForIndex)(o,u&&u.index,m&&m.index);return a("tr",{key:P},p.map((w,C)=>{let N=w.valueType||w.itemType||"unknown",z=v.find(M=>M.type==="itemDelta"&&M.itemKey===w.key),O=w.key&&u&&u.item[w.key],j=w.key&&m&&m.item[w.key];return a(h,{key:C},a("td",{className:`table-column--${N}`},O||j?a(rr,{type:N,compareValue:O,baseValue:j,diff:z}):a(h,null)),l===C?a("td",{className:"table-column--row-label"},b==="added"||b==="removed"?b:""):null)}))}))))};var sr=X(U());var ar={"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]},ir=(e,t)=>{let r=e&&e.id||"";return(ar[r]||ar.__default__)[t==="lower"?0:1]},nr=(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},_o=(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"},Q=(e,t)=>{let{asDelta:r=!1,withSuffix:o=!1,unit:i="none"}=t,n=Math.round(e),s=0,f="";i==="ms"&&(f="ms",Math.abs(n)>=1e3&&!t.preventSecondsConversion&&(n/=1e3,s=1,f="s")),i==="bytes"&&(f="KB",n/=1024,Math.abs(n)>=500&&(n/=1024,s=1,f="MB")),i==="none"&&(Math.abs(e)<1?(n=e,s=3):Math.abs(n)<10?(n=e,s=1):Math.abs(n)>=50&&(n/=1e3,s=1,f="K"));let c=n.toLocaleString(void 0,{minimumFractionDigits:s,maximumFractionDigits:s}),d=r&&n>=0?"+":"",p=d+c+(o?f:"");return{element:a("span",null,d,c,o?a(h,null,a(se,null),f):""),string:p,length:p.length}},Ce=e=>{let{diff:t,audit:r,groupId:o}=e,i=_o(r,o),n=t.compareValue,s=t.baseValue;if(typeof s!="number"||typeof n!="number")return a("span",null,"No diff available");let f=n-s,c=Math.min(n,s),d=Math.max(n,s),p=e.showAsBigPicture?ir(r,"lower"):nr(c*.8,"down"),l=e.showAsBigPicture?ir(r,"upper"):nr(d*1.2,"up"),m=l-p,u=Math.min(Math.max(c,p),l),v=Math.min(Math.max(d,p),l),x=100*(u-p)/m,P=100-100*(v-p)/m,b=(0,sr.getDeltaLabel)(f,"audit"),w=c===n,C=`${Q(s,{unit:i,withSuffix:!0}).string} to ${Q(n,{withSuffix:!0,unit:i}).string}`;if(e.showAsNarrow)return a("div",{className:y("audit-numeric-diff",`text--${b}`),"data-tooltip":C},Q(f,{asDelta:!0,withSuffix:!0,preventSecondsConversion:!0,unit:i}).element);let{element:N,length:z}=Q(f,{asDelta:!0,withSuffix:!0,preventSecondsConversion:!0,unit:i}),O=z*10*100/300;return a(h,null,a("div",{className:"audit-numeric-diff"},a("div",{className:"audit-numeric-diff__left-label"},Q(p,{unit:i}).element),a("div",{className:"audit-numeric-diff__bar"},a("div",{className:y("audit-numeric-diff__box",{"audit-numeric-diff__box--improvement":b==="improvement","audit-numeric-diff__box--regression":b==="regression"}),style:{left:`${x}%`,right:`${P}%`},"data-tooltip":C},a("div",{className:"audit-numeric-diff__now",style:{left:w?"0%":"100%"}}),a("div",{className:y("audit-numeric-diff__delta-label",{"audit-numeric-diff__delta-label--narrow-left":b==="improvement"&&x<O,"audit-numeric-diff__delta-label--narrow-right":b==="regression"&&P<O}),style:{[w?"right":"left"]:"100%"}},N))),a("div",{className:"audit-numeric-diff__right-label"},Q(l,{unit:i}).element)))};var cr=X(E());var ce=X(U());var Eo={"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"},lr=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=Eo[t]||o||"list_alt",a("i",{className:"material-icons"},o)},Jo=e=>a(h,null,a(q,{audit:e.baseAudit}),a("i",{className:`material-icons audit-group__diff-arrow audit-group__diff-arrow--${(0,ce.getDiffLabel)(e.diff)}`},"arrow_forward"),a(q,{audit:e.audit})),qo=e=>a(h,null,a("span",null,e.diff.baseValue),a("i",{className:`material-icons audit-group__diff-arrow audit-group__diff-arrow--${(0,ce.getDiffLabel)(e.diff)}`},"arrow_forward"),a("span",null,e.diff.compareValue));function Ko(e){switch(e){case"added":case"worse":case"ambiguous":return"regression";case"removed":case"better":return"improvement";case"no change":return"neutral"}}function Qo(e){return cr.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 Ee=e=>{let{diffs:t,baseAudit:r,groupId:o}=e,i=r.details&&r.details.items||[],s=Qo(t).map(p=>(0,ce.getRowLabelForIndex)(t,p.compare,p.base)).map(Ko),f=s.filter(p=>p==="regression").length,c=s.filter(p=>p==="improvement").length,d=a(h,null,a("div",{className:"audit-group__diff-badge-group"},a(lr,{audit:e.audit,groupId:o}),a("div",{className:"audit-group__diff-badges"},a("span",{className:"audit-group__diff-badge"},i.length))),a("i",{className:`material-icons audit-group__diff-arrow audit-group__diff-arrow--${c>f?"improvement":"regression"}`},"arrow_forward"));return a(h,null,e.showAsNarrow?a(h,null):d,a("div",{className:y("audit-group__diff-badge-group")},a(lr,{audit:e.audit,groupId:o}),a("div",{className:y("audit-group__diff-badges",{"audit-group__diff-badge-group--multiple":!!(f&&c)})},f?a("span",{className:"audit-group__diff-badge audit-group__diff-badge--regression"},f):null,c?a("span",{className:"audit-group__diff-badge audit-group__diff-badge--improvement"},c):null)))},$o=()=>a("div",{className:"audit-group__error-message","data-tooltip":"Audit did not run in the base report"},a("i",{className:"material-icons"},"error_outline")," Audit Missing"),ea=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}`),a("div",{className:"audit-group__error-message","data-tooltip":t},a("i",{className:"material-icons"},"error_outline")," Audit Error")},fr=e=>{let{audit:t,baseAudit:r,diffs:o,group:i}=e.pair,n=a("span",null,"No diff available");if(!r)return a($o,null);if(o.find(l=>l.type==="error"))return a(ea,{audit:t,baseAudit:r});let f=o.find(l=>l.type==="numericValue");if(f&&f.type==="numericValue")return a(Ce,{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 a(Ee,{diffs:o,audit:t,baseAudit:r,groupId:i.id,showAsNarrow:e.showAsNarrow});let d=o.find(l=>l.type==="score");if(d)return a(Jo,{diff:d,audit:t,baseAudit:r});let p=o.find(l=>l.type==="displayValue");return!p||p.type!=="displayValue"?n:a(qo,{diff:p,audit:t,baseAudit:r})};var dr=X(U());var ta=e=>{let{audit:t,baseAudit:r}=e.pair;return r?a("div",{className:"audit-detail-pane__audit-details--binary"},a(q,{audit:r}),a("i",{className:`material-icons audit-group__diff-arrow audit-group__diff-arrow--${(0,dr.getDiffLabel)(e.diff)}`},"arrow_forward"),a(q,{audit:t})):null},ra=e=>{let t=e.pair.audit.scoreDisplayMode==="error"?e.pair.audit:e.pair.baseAudit;return t?a(h,null,a("div",{className:"audit-detail-pane__audit-details-summary"},"Error occurred in the"," ",t===e.pair.baseAudit?"base report:":"compare report:"),a("pre",null,t.errorMessage||"Unknown error")):null},oa=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),n,s,f;if(t.audit.errorMessage||t.baseAudit&&t.baseAudit.errorMessage)return a(ra,{pair:t});(r.type==="table"||r.type==="opportunity")&&i&&(s=a(or,{pair:t}),t.baseAudit&&(n=a(Ee,D(F({},t),{baseAudit:t.baseAudit,groupId:t.group.id}))));let c=t.diffs.find(p=>p.type==="numericValue");if(c&&c.type==="numericValue"&&(f=a(Ce,{diff:c,audit:t.audit})),s||c)return a(h,null,a("div",{className:"audit-detail-pane__audit-details-summary"},f||n),s);let d=t.diffs.find(p=>p.type==="score");return d&&d.type==="score"?a(ta,{diff:d,pair:e.pair}):a("pre",null,JSON.stringify(e.pair,null,2))},ur=e=>{let{audit:t}=e.pair;return a("div",{id:`audit-detail-pane-audit--${t.id}`,className:y("audit-detail-pane__audit")},a("div",{className:"audit-detail-pane__score"},a(I,{score:t.score||0})),a("div",{className:"audit-detail-pane__audit-title"},t.title),a("div",{className:"audit-detail-pane__audit-description"},a(tr,{text:t.description||""})),a("div",{className:"audit-detail-pane__audit-details"},a(oa,{pair:e.pair})))};var pr=e=>{let t=k(void 0),r=Kt(e.selectedAuditId);return T(()=>{let o=e.selectedAuditId,i=t.current;if(!i||!o||o===r)return;let n=i.querySelector(`#audit-detail-pane-audit--${o}`);!n||!(n instanceof HTMLElement)||i.scrollTo(0,n.offsetTop)},[e.selectedAuditId,r]),a("div",{className:"audit-detail-pane",ref:o=>t.current=o},a("div",{className:"audit-detail-pane__close",onClick:()=>e.setSelectedAuditId(null)},a("i",{className:"material-icons"},"close")),e.pairs.map(o=>{let{audit:i}=o;if(i.id)return a(ur,{key:i.id,pair:o})}))};var mr=X(U());var gr=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,mr.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 a("div",{className:y("gauge",`gauge--${i}`)},a("div",{className:"gauge-arc"},a("svg",{viewBox:"0 0 120 120"},a("circle",{className:"gauge-arc__arc",transform:"rotate(-90 60 60)",r:"56",cx:"60",cy:"60",style:{strokeDasharray:s}})),a("div",{className:"gauge-arc__delta-wrapper",style:{transform:p,display:c<1?"none":"block"}},a("svg",{viewBox:"0 0 120 120"},a("circle",{className:"gauge-arc__arc",transform:"rotate(-90 60 60)",r:"56",cx:"60",cy:"60",style:{strokeDasharray:d}}))),a("div",{className:"gauge-arc__indicator-wrapper",style:{transform:l}},a("div",{className:"gauge-arc__indicator"}))),a("span",null,t))};var vr=X(E());var hr=e=>a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:`pwa-icon pwa-icon--${e.deltaType}`},a("g",{"fill-rule":"nonzero",fill:"none"},a("circle",{class:"pwa-icon__background",cx:"12",cy:"12",r:"12"}),a("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"}))),br=e=>a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:`pwa-icon pwa-icon--${e.deltaType}`},a("g",{"fill-rule":"nonzero",fill:"none"},a("circle",{class:"pwa-icon__background",cx:"12",cy:"12",r:"12"}),a("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=>a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:`pwa-icon pwa-icon--${e.deltaType}`},a("g",{fill:"none","fill-rule":"evenodd"},a("rect",{class:"pwa-icon__background",width:"24",height:"24",rx:"12"}),a("path",{d:"M5 5h14v14H5z"}),a("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 Pe(e,t,r){return e[r]===t[r]?"neutral":t[r]?"improvement":"regression"}function Je(e){let t=e.categories.pwa,r=vr.groupIntoMap(t.auditRefs,i=>i.group),o=(i=[])=>i.map(n=>e.audits[n.id]).every(n=>n&&n.score===1);return{optimized:o(r.get("pwa-optimized")||[]),installable:o(r.get("pwa-installable")||[]),fastAndReliable:o(r.get("pwa-fast-reliable")||[])}}var wr=e=>{let{status:t}=e,r=t.optimized&&t.installable&&t.fastAndReliable;return a("div",{className:y("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})},a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60"},a("defs",null,a("linearGradient",{id:"pwa-gauge__check-circle__gradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%"},a("stop",{"stop-color":"#00C852",offset:"0%"}),a("stop",{"stop-color":"#009688",offset:"100%"})),a("linearGradient",{id:"pwa-gauge__installable__shadow-gradient",x1:"76.056%",x2:"24.111%",y1:"82.995%",y2:"24.735%"},a("stop",{"stop-color":"#A5D6A7",offset:"0%"}),a("stop",{"stop-color":"#80CBC4",offset:"100%"})),a("linearGradient",{id:"pwa-gauge__fast-reliable__shadow-gradient",x1:"76.056%",y1:"82.995%",x2:"25.678%",y2:"26.493%"},a("stop",{"stop-color":"#64B5F6",offset:"0%"}),a("stop",{"stop-color":"#2979FF",offset:"100%"})),a("g",{id:"pwa-gauge__fast-reliable-badge"},a("circle",{fill:"#FFFFFF",cx:"10",cy:"10",r:"10"}),a("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"})),a("g",{id:"pwa-gauge__installable-badge"},a("circle",{fill:"#FFFFFF",cx:"10",cy:"10",r:"10"}),a("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"}))),a("g",{stroke:"none","fill-rule":"nonzero"},a("circle",{class:"pwa-gauge__disc",cx:"30",cy:"30",r:"30"}),a("g",{class:"pwa-gauge__logo"},a("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"}),a("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"}),a("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"})),a("rect",{class:"pwa-gauge__component pwa-gauge__na-line",fill:"#FFFFFF",x:"20",y:"32",width:"20",height:"4",rx:"2"}),a("g",{class:"pwa-gauge__component pwa-gauge__fast-reliable-badge",transform:"translate(20, 29)"},a("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"}),a("use",{href:"#pwa-gauge__fast-reliable-badge"})),a("g",{class:"pwa-gauge__component pwa-gauge__installable-badge",transform:"translate(20, 29)"},a("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"}),a("use",{href:"#pwa-gauge__installable-badge"})),a("g",{class:"pwa-gauge__component pwa-gauge__fast-reliable-installable-badges"},a("g",{transform:"translate(8, 29)"},a("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"}),a("use",{href:"#pwa-gauge__fast-reliable-badge"})),a("g",{transform:"translate(32, 29)"},a("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"}),a("use",{href:"#pwa-gauge__installable-badge"}))),a("g",{class:"pwa-gauge__component pwa-gauge__check-circle",transform:"translate(18, 28)"},a("circle",{fill:"#FFFFFF",cx:"12",cy:"12",r:"12"}),a("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 xr=X(U());var Cr=e=>{let t=Math.round((e.diff.compareValue-e.diff.baseValue)*100);return a("div",{className:y("score-delta-badge",`score-delta-badge--${(0,xr.getDiffLabel)(e.diff)}`,e.className)},t<0?t:`+${t}`)};var aa=e=>{let{lhr:t,baseLhr:r,categoryId:o}=e,i=t.categories[o],n=r&&r.categories[o],s=n&&{auditId:"",type:"score",baseValue:n.score,compareValue:i.score};return a("div",{key:o,className:y("lhr-comparison-scores-item")},a(gr,{score:i.score,diff:s}),a("div",{className:"lhr-comparison-scores-item__label"},i.title),s?a(Cr,{diff:s,className:"lhr-comparison-scores-item__delta"}):null)},ia=e=>{let{lhr:t,baseLhr:r,categoryId:o}=e,i=Je(t),n,s="neutral";if(r){let f=Je(r),c={fastAndReliable:Pe(f,i,"fastAndReliable"),installable:Pe(f,i,"installable"),optimized:Pe(f,i,"optimized")},d=Object.values(c).every(l=>l==="neutral"),p=a(h,null,c.fastAndReliable==="neutral"?a(h,null):a(hr,{deltaType:c.fastAndReliable}),c.installable==="neutral"?a(h,null):a(br,{deltaType:c.installable}),c.optimized==="neutral"?a(h,null):a(yr,{deltaType:c.optimized}));n=a("div",{className:y("lhr-comparison-scores-item__delta")},d?"-":p)}return a("div",{key:o,className:y("lhr-comparison-scores-item","lhr-comparison-scores-item--pwa",`lhr-comparison-scores-item--${s}`)},a(wr,{status:i}),a("div",{className:"lhr-comparison-scores-item__label"},"PWA"),n)},Pr=e=>{let{lhr:t,baseLhr:r}=e;if(!t)return null;let o=Object.keys(t.categories),i=r?Object.keys(r.categories):o,n=o.filter(s=>i.includes(s));return a("div",{className:"lhr-comparison-scores"},n.sort((s,f)=>{let c=s==="pwa"?1/0:n.indexOf(s),d=f==="pwa"?1/0:n.indexOf(f);return c-d}).map(s=>s==="pwa"?a(ia,{lhr:t,baseLhr:r,categoryId:s}):a(aa,{lhr:t,baseLhr:r,categoryId:s})))};var na=e=>a("div",{className:"audit-group__big-picture-tabs"},a("span",{className:y("big-picture-tabs__tab",{"big-picture-tabs__tab--selected":e.showAsBigPicture}),onClick:()=>e.setShowAsBigPicture(!0)},"Overview"),a("span",{className:y("big-picture-tabs__tab",{"big-picture-tabs__tab--selected":!e.showAsBigPicture}),onClick:()=>e.setShowAsBigPicture(!1)},"Magnified")),sa=e=>a(h,null,e.pairs.map(t=>{let{audit:r}=t;return e.group.id!=="metrics"&&(t=D(F({},t),{diffs:t.diffs.filter(o=>o.type!=="numericValue")})),a("div",{key:r.id,className:y("audit-group__audit"),onClick:()=>e.setSelectedAuditId(r.id||null)},a("div",{className:"audit-group__audit-score"},a(I,{score:r.score||0})),a("div",{className:"audit-group__audit-title"},r.title),a("div",{className:"audit-group__audit-diff"},a(fr,{pair:t,showAsBigPicture:e.showAsBigPicture,showAsNarrow:e.showAsNarrow})))})),la=e=>{let t=e.baseLhr;return!t||!e.expanded?a(h,null):a(h,null,e.pairs.map(r=>{let{audit:o}=r;return a("div",{key:o.id,className:y("audit-group__audit","audit-group__audit--unchanged"),onClick:i=>{i.preventDefault(),i.stopPropagation(),be(t)}},a("div",{className:"audit-group__audit-score"},a(I,{score:o.score||0})),a("div",{className:"audit-group__audit-title"},o.title),a("div",{className:"audit-group__audit-diff"},"Open Report"))}))},zr=e=>{let{group:t}=e,[r,o]=H(t.id==="metrics"),[i,n]=H(!1);return a(G,{className:y("audit-group",{"audit-group--expanded":i,"audit-group--unchanged":e.showAsUnchanged})},a("div",{className:"audit-group__header",onClick:()=>n(!i)},a("div",{className:"audit-group__title"},t.title," ",e.showAsUnchanged?`(${e.pairs.length})`:""),a("div",{className:"audit-group__expand-toggle"},a("i",{className:"material-icons"},"chevron_right")),t.id==="metrics"&&!e.showAsNarrow?a(na,D(F({},e),{showAsBigPicture:r,setShowAsBigPicture:o})):a(h,null)),a("div",{className:"audit-group__audits"},e.showAsUnchanged?a(la,D(F({},e),{expanded:i})):a(sa,D(F({},e),{showAsBigPicture:r}))))};var Lr=()=>a("div",{className:"lhr-comparison-legend"},a(I,{score:0}),a("span",{className:"lhr-comparison-legend__label"},"0-49"),a(I,{score:.5}),a("span",{className:"lhr-comparison-legend__label"},"50-89"),a(I,{score:1}),a("span",{className:"lhr-comparison-legend__label"},"90-100"),a("i",{className:"lhr-comparison-legend__chip lhr-comparison-legend__chip--regression"}),a("span",{className:"lhr-comparison-legend__label"},"Regression"),a("i",{className:"lhr-comparison-legend__chip lhr-comparison-legend__chip--improvement"}),a("span",{className:"lhr-comparison-legend__label"},"Improvement"));function da(e,t){for(var r in t)e[r]=t[r];return e}function Ar(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 Nr(e){this.props=e}(Nr.prototype=new R).isPureReactComponent=!0,Nr.prototype.shouldComponentUpdate=function(e,t){return Ar(this.props,e)||Ar(this.state,t)};var Fr=g.__b;g.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Fr&&Fr(e)};var Es=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var ua=g.__e;g.__e=function(e,t,r,o){if(e.then){for(var i,n=t;n=n.__;)if((i=n.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}ua(e,t,r,o)};var Dr=g.unmount;function Mr(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=da({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return Mr(o,t,r)})),e}function Rr(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return Rr(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 qe(){this.__u=0,this.t=null,this.__b=null}function Zr(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ze(){this.u=null,this.o=null}g.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Dr&&Dr(e)},(qe.prototype=new R).__c=function(e,t){var r=t.__c,o=this;o.t==null&&(o.t=[]),o.t.push(r);var i=Zr(o.__v),n=!1,s=function(){n||(n=!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]=Rr(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)},qe.prototype.componentWillUnmount=function(){this.t=[]},qe.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]=Mr(this.__b,r,o.__O=o.__P)}this.__b=null}var i=t.__a&&a(h,null,e.fallback);return i&&(i.__u&=-33),[a(h,null,t.__a?null:e.children),i]};var Hr=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 pa(e){return this.getChildContext=function(){return e.context},e.children}function ma(e){var t=this,r=e.i;t.componentWillUnmount=function(){te(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)}}),te(a(pa,{context:t.context},e.__v),t.l)}function kr(e,t){var r=a(ma,{__v:e,i:t});return r.containerInfo=t,r}(ze.prototype=new R).__a=function(e){var t=this,r=Zr(t.__v),o=t.o.get(e);return o[0]++,function(i){var n=function(){t.props.revealOrder?(o.push(i),Hr(t,e,o)):i()};r?r(n):n()}},ze.prototype.render=function(e){this.u=null,this.o=new Map;var t=ee(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){Hr(e,r,t)})};var ga=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,va=/^(?: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]/,ha=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ba=/[A-Z0-9]/g,ya=typeof document!="undefined",wa=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};R.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(R.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Tr=g.event;function xa(){}function Ca(){return this.cancelBubble}function Pa(){return this.defaultPrevented}g.event=function(e){return Tr&&(e=Tr(e)),e.persist=xa,e.isPropagationStopped=Ca,e.isDefaultPrevented=Pa,e.nativeEvent=e};var Ur,za={enumerable:!1,configurable:!0,get:function(){return this.class}},Or=g.vnode;g.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,o=t.type,i={};for(var n in r){var s=r[n];if(!(n==="value"&&"defaultValue"in r&&s==null||ya&&n==="children"&&o==="noscript"||n==="class"||n==="className")){var f=n.toLowerCase();n==="defaultValue"&&"value"in r&&r.value==null?n="value":n==="download"&&s===!0?s="":f==="ondoubleclick"?n="ondblclick":f!=="onchange"||o!=="input"&&o!=="textarea"||wa(r.type)?f==="onfocus"?n="onfocusin":f==="onblur"?n="onfocusout":ha.test(n)?n=f:o.indexOf("-")===-1&&va.test(n)?n=n.replace(ba,"-$&").toLowerCase():s===null&&(s=void 0):f=n="oninput",f==="oninput"&&i[n=f]&&(n="oninputCapture"),i[n]=s}}o=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=ee(r.children).forEach(function(c){c.props.selected=i.value.indexOf(c.props.value)!=-1})),o=="select"&&i.defaultValue!=null&&(i.value=ee(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",za)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=ga,Or&&Or(e)};var jr=g.__r;g.__r=function(e){jr&&jr(e),Ur=e.__c};var Xr=g.diffed;g.diffed=function(e){Xr&&Xr(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),Ur=null};var Ir=e=>{let t=k(document.getElementById("preact-modal-root")||document.createElement("div"));return T(()=>(t.current.id="preact-modal-root",document.body.appendChild(t.current),()=>document.body.removeChild(t.current)),[]),kr(a("div",{className:"modal-backdrop"},a("div",{className:y("modal",e.className),style:{position:"relative"}},e.children,a("div",{className:"modal__close",onClick:e.onClose},a("i",{className:"material-icons"},"close")))),t.current)};function Br(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 Sr(e,t){if(!t)return[];let r=[],{benchmarkIndex:o}=e.environment,{benchmarkIndex:i}=t.environment,n=Math.abs(o-i)/Math.min(o,i);n>1.5&&r.push({label:"CPU/Memory Power",base:t.environment.benchmarkIndex.toString(),compare:e.environment.benchmarkIndex.toString(),severity:n>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,m,u]of p){let v=Br(m),x=Br(u);v!==x&&r.push({label:l,base:v,compare:x,severity:"error"})}return r}var Ke=e=>{let{diffs:t}=e;return a("div",{className:y("lhr-comparison-runtime-diff",`lhr-comparison-runtime-diff--${e.variant}`)},a("div",{className:"lhr-comparison__warning"},a("i",{className:"material-icons"},"info"),a("div",null,"Changes of runtime settings or the environment can substantially affect your Lighthouse scores and might be the reason for the differences here.")),a("div",{className:"lhr-comparison-runtime-diff__diffs"},"The following runtime differences were detected:",a("table",null,a("thead",null,a("tr",null,a("th",null),a("th",null,"Base"),a("th",null,"Compare"))),a("tbody",null,t.map(r=>a("tr",{key:r.label},a("td",null,r.label),a("td",null,r.base),a("td",null,r.compare)))))))};function La(e){let t=o=>new Promise(i=>setTimeout(i,o)),r=o=>S(this,null,function*(){let i=0;for(;!document.querySelector(o)&&i<10;)yield t(500),i++});T(()=>{window.location.hash.length<=1||Promise.resolve().then(()=>S(this,null,function*(){yield r(".lhr-comparison__audit-groups"),e(window.location.hash.slice(1))}))},[])}function Aa(e,t,r){let o=[];for(let[i,n]of Object.entries(e.categories)){let s={title:n.title,description:n.description},f=Vr.default.groupBy(n.auditRefs,p=>p.group),c=`unchanged:${i}`,d={id:c,group:{id:c,title:`Unchanged Audits - ${n.title}`},pairs:[],showAsUnchanged:!0};for(let p of f){let l=p[0].group||"",m=e.categoryGroups&&e.categoryGroups[l];if(!m){if(f.length!==1)continue;l=`category:${i}`,m=s}let u=D(F({},m),{id:l}),v=p.map(b=>{let w=D(F({},e.audits[b.id]),{id:b.id}),C=t&&t.audits[w.id||""],N=C?(0,Le.findAuditDiffs)(C,w,D(F({},r),{synthesizeItemKeyDiffs:!0})):[],z=Math.max(...N.map(Le.getDiffSeverity),0);return{audit:w,baseAudit:C,diffs:N,maxSeverity:z,group:u}}).sort((b,w)=>(b.audit.score||0)-(w.audit.score||0)),x=v.filter(b=>!b.baseAudit||b.diffs.length),P=v.filter(b=>b.baseAudit&&!b.diffs.length);x.length&&o.push({id:l,group:u,pairs:x,showAsUnchanged:!1}),P.length&&d.pairs.push(...P)}d.pairs.length&&o.push(d)}return o}var Na=e=>a("div",{className:"lhr-comparison__scores-and-dropdowns"},a("div",{className:"container"},a("div",{className:"lhr-comparison__dropdowns"},e.hookElements.dropdowns,a(qt,{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?a(h,null):a(Pr,F({},e)))),Fa=e=>a("div",{className:"lhr-comparison__audit-groups"},e.auditGroups.map(t=>{if(t)return a(zr,{key:t.id,showAsNarrow:e.showAsNarrow,showAsUnchanged:t.showAsUnchanged,pairs:t.pairs,group:t.group,baseLhr:e.baseLhr,selectedAuditId:e.selectedAuditId,setSelectedAuditId:e.setSelectedAuditId})})),Gr=e=>{let{lhr:t,baseLhr:r}=e,o="none",[i,n]=H(.05),[s,f]=H(null),[c,d]=H(o);La(f),T(()=>{window.__LHR__=t,window.__BASE_LHR__=r},[t,r]);let p=Sr(t,r),l=p.some(u=>u.severity==="error"),m=Aa(t,r,{percentAbsoluteDeltaThreshold:i});return a(h,null,c==="none"&&l?a(Ir,{onClose:()=>d("acknowledged")},a(Ke,{diffs:p,variant:"full"})):null,s?a(pr,{selectedAuditId:s,setSelectedAuditId:f,pairs:m.filter(u=>!u.showAsUnchanged).map(u=>u.pairs).reduce((u,v)=>u.concat(v)),baseLhr:r}):a(h,null),a("div",{className:y("lhr-comparison",e.className,{"lhr-comparison--with-audit-selection":!!s})},a(Na,{lhr:t,baseLhr:r,selectedAuditId:s,hookElements:e.hookElements,percentAbsoluteDeltaThreshold:i,setPercentAbsoluteDeltaThreshold:n}),a("div",{className:"container"},e.hookElements.warnings,c!=="closed"&&p.length?a(G,{className:"position-relative"},a(Ke,{diffs:p,variant:"mini"}),a("div",{className:"lhr-comparison-runtime-diff__close",onClick:()=>d("closed")},a("i",{className:"material-icons"},"close"))):null,m.length&&r?a(h,null,s?null:a("div",{className:"lhr-comparison__legend-container"},a(Lr,null)),a(Fa,{showAsNarrow:!!s,auditGroups:m,baseLhr:r,selectedAuditId:s,setSelectedAuditId:f})):e.hookElements.warnings?null:a(G,{className:"lhr-comparison__warning"},a("i",{className:"material-icons"},"sentiment_satisfied_alt"),a("div",null,"Woah, no differences found! Switch base builds to explore other differences, or"," ",a(ye,{className:"lhr-comparison__warning__lhr-link",lhr:e.lhr},"jump straight to the Lighthouse report."))))))};var Wr=e=>{let t=Ht(e.baseReport.lhr,e.compareReport.lhr);return a("div",{className:"comparison"},a("div",{className:"comparison-header"},a("div",{className:"comparison-header__switcher",onClick:()=>{e.setBaseReport(e.compareReport),e.setCompareReport(e.baseReport)}},a("i",{className:"material-icons"},"swap_horiz")),a("div",{className:"comparison-header__logo"},a("img",{src:ae,alt:"Lighthouse Logo",onClick:()=>{e.setBaseReport(void 0),e.setCompareReport(void 0)}})),a("div",{className:"comparison-header__upload"},a(_,{variant:"base",dragTarget:"self",report:e.baseReport,setReport:e.setBaseReport,addToast:e.addToast,displayType:t,showOpenLhrLink:!0}),a(_,{variant:"compare",dragTarget:"self",report:e.compareReport,setReport:e.setCompareReport,addToast:e.addToast,displayType:t,showOpenLhrLink:!0})),a("a",{className:"comparison-header__info",href:"https://github.com/GoogleChrome/lighthouse-ci"},a("i",{className:"material-icons"},"info"))),a("div",{className:"comparison-body"},a(Gr,{lhr:e.compareReport.lhr,baseLhr:e.baseReport.lhr,hookElements:{}})))};var Yr=e=>{let t=e.setToasts,{message:r,level:o="info"}=e.toast;return T(()=>{let i=setTimeout(()=>t(n=>n.filter(s=>s!==e.toast)),5e3);return()=>clearInterval(i)},[]),a("div",{className:`toast toast--${o}`},r)};var qr=new URLSearchParams(location.search),_r=qr.get("baseReport"),Er=qr.get("compareReport");function Jr(e,t){return S(this,null,function*(){let r=new URL(e).pathname.split("/").slice(-1)[0]||"Unknown",i=yield(yield fetch(e)).text(),n=Ie(i);if(n instanceof Error)throw n;t({filename:r,data:i,lhr:n})})}function Da(e,t,r,o){return S(this,null,function*(){if(window.location.hostname==="localhost"){let n=localStorage.getItem("lastBaseReport"),s=localStorage.getItem("lastCompareReport");n&&e(JSON.parse(n)),s&&t(JSON.parse(s))}let i=[_r&&Jr(_r,e),Er&&Jr(Er,t)].filter(n=>!!n);i.length&&(r(!0),yield Promise.all(i.map(n=>n.catch(s=>{console.error(s),o({message:`Failed loading report from URL: ${s.message}`,level:"error"})}))),r(!1))})}var Kr=()=>{let[t,r]=H(!1),[o,i]=H(void 0),[n,s]=H(void 0),[f,c]=H([]),p=Re(l=>c(m=>[...m,l]),[c]);return T(()=>{Da(i,s,r,p)},[]),T(()=>{try{o&&localStorage.setItem("lastBaseReport",JSON.stringify(o)),n&&localStorage.setItem("lastCompareReport",JSON.stringify(n))}catch(l){console.error(`Error saving to localStorage: ${l}`)}},[o,n]),a("div",{className:"lhci-viewer"},t?a("div",{className:"loading-container"},a(ke,null)):a(h,null),a("div",{className:"toast-container"},f.map(l=>a(Yr,{key:l.message,toast:l,setToasts:c}))),o&&n?a(Wr,{baseReport:o,setBaseReport:i,compareReport:n,setCompareReport:s,addToast:p}):a(Ot,{baseReport:o,setBaseReport:i,compareReport:n,setCompareReport:s,addToast:p}))};var Qr=document.getElementById("preact-root");if(!Qr)throw new Error("Missing #preact-root");te(a(Kr,null),Qr);})();
|
|
2
|
-
/**
|
|
3
|
-
* @license Copyright 2019 Google Inc. All Rights Reserved.
|
|
4
|
-
* 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
|
|
5
|
-
* 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.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @license Copyright 2020 Google Inc. All Rights Reserved.
|
|
9
|
-
* 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
|
|
10
|
-
* 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.
|
|
11
|
-
*/
|
|
12
|
-
//# sourceMappingURL=entry-IG5VPVQT.js.map
|